math / data /lean /OAI /SetTheory /PartitionPrinciple /Transfinite /GroundCompressionPrefixGraphs.lean
Download data/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionPrefixGraphs.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 14.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionPrefixGraphs.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionPrefixGraphs.lean
-
curl -L -o GroundCompressionPrefixGraphs.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionPrefixGraphs.lean
14.6 kB
| 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 | |