Download data/lean/OAI/Computability/StarHeight/AffineClock.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.04 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/StarHeight/AffineClock.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/StarHeight/AffineClock.lean
-
curl -L -o AffineClock.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/StarHeight/AffineClock.lean
6.04 kB
Lean 4 Β· 20
declarations fullstatements
| import OAI.Computability.StarHeight.SplitMetadata | |
| namespace OAI | |
| namespace GeneralizedStarHeight | |
| universe u | |
| universe uT uP uC uM uS uK uM2 uM3 | |
| universe uM4 | |
| namespace ClockAffine | |
| open scoped Classical | |
| open RobustClock | |
| variable {T : Type uT} {P : Type uP} {C : Type uC} {M : Type uM} {S : Type uS} {K : Type uK} [Fintype T] [Fintype P] [Fintype C] | |
| [Monoid M] [Field K] [AddCommGroup S] [Module K S] | |
| variable (clock : Specification T P C) | |
| def Edge (z : C β RobustClock.Circle) (a b : T) : Prop := | |
| β i β clock.I a, β j β clock.J b, i + j = z | |
| noncomputable def offChoice (z : C β RobustClock.Circle) : Option (T Γ T) := | |
| if h : β ab : T Γ T, ab.1 β ab.2 β§ Edge clock z ab.1 ab.2 then some h.choose else none | |
| lemma offChoice_some {z : C β RobustClock.Circle} {ab : T Γ T} | |
| (he : offChoice clock z = some ab) : | |
| ab.1 β ab.2 β§ Edge clock z ab.1 ab.2 β§ | |
| β a b, Edge clock z a b β a = ab.1 β§ b = ab.2 := by | |
| classical | |
| unfold offChoice at he | |
| split_ifs at he with hx | |
| Β· have hab := Option.some.inj he | |
| have hh := hab βΈ hx.choose_spec | |
| refine β¨hh.1,hh.2,?_β© | |
| rcases clock.graph z with hd | β¨a,b,_,_,huβ© | |
| Β· exact False.elim (hh.1 (hd _ _ hh.2)) | |
| Β· have ht := hu _ _ hh.2 | |
| intro a' b' he' | |
| exact β¨(hu _ _ he').1.trans ht.1.symm,(hu _ _ he').2.trans ht.2.symmβ© | |
| lemma offChoice_none {z : C β RobustClock.Circle} (he : offChoice clock z = none) | |
| {a b : T} (hab : Edge clock z a b) : a = b := by | |
| classical | |
| by_contra hn | |
| have hx : β ab : T Γ T, ab.1 β ab.2 β§ Edge clock z ab.1 ab.2 := β¨(a,b),hn,habβ© | |
| simp only [offChoice,dite_eq_left hx] at he | |
| cases he | |
| lemma offChoice_of_offedge {z : C β RobustClock.Circle} {a b : T} | |
| (hn : a β b) (he : Edge clock z a b) : offChoice clock z = some (a,b) := by | |
| cases hh : offChoice clock z with | |
| | none => exact False.elim (hn (offChoice_none clock hh he)) | |
| | some ab => | |
| have hp := (offChoice_some clock hh).2.2 _ _ he | |
| rcases ab with β¨a',b'β© | |
| dsimp at hp | |
| rcases hp with β¨rfl,rflβ© | |
| rfl | |
| lemma edge_add (Ο : β€ β+ (C β RobustClock.Circle)) {q t k : β€} {a b : T} | |
| (hp : Ο (k-t) β clock.I a) (hs : Ο (q-k) β clock.J b) : | |
| Edge clock (Ο (q-t)) a b := by | |
| refine β¨_,hp,_,hs,?_β© | |
| rw [β map_add] | |
| congr 1 | |
| ring | |
| variable (Ο : M β (S ββ[K] S)) | |
| def productTable {g : β} (A C : M) (d : Fin g β M) : S ββ[K] S := | |
| Ο (A * (List.ofFn d).prod * C) | |
| structure Factors (M : Type uM2) (g : β) where | |
| A : M | |
| entries : Fin g β M | |
| C : M | |
| structure Snapshot (M : Type uM3) [Monoid M] (g : β) where | |
| product : M | |
| boundaries : Option (Factors M g) | |
| product_eq : β f, boundaries = some f β product = f.A * (List.ofFn f.entries).prod * f.C | |
| variable {g : β} | |
| variable (Ξ² : M β M β (Fin g β M) β S) (X Y : T β S) | |
| noncomputable def shift (z : C β RobustClock.Circle) (D : Snapshot M g) : S := | |
| match offChoice clock z with | |
| | some ab => Y ab.2 - Ο D.product (X ab.1) | |
| | none => match D.boundaries with | |
| | none => 0 | |
| | some f => Ξ² f.A f.C f.entries | |
| noncomputable def update (z : C β RobustClock.Circle) (D : Snapshot M g) (x : S) : S := | |
| Ο D.product x + shift clock Ο Ξ² X Y z D | |
| lemma update_off {z : C β RobustClock.Circle} {a b : T} (D : Snapshot M g) | |
| (hn : a β b) (he : Edge clock z a b) : | |
| update clock Ο Ξ² X Y z D (X a) = Y b := by | |
| simp only [update,shift,offChoice_of_offedge clock hn he] | |
| abel | |
| lemma update_main {z : C β RobustClock.Circle} {f : Factors M g} (D : Snapshot M g) | |
| (hc : offChoice clock z = none) (hf : D.boundaries = some f) (x : S) : | |
| update clock Ο Ξ² X Y z D x = productTable Ο f.A f.C f.entries x + Ξ² f.A f.C f.entries := by | |
| simp only [update,shift,hc,hf,productTable,D.product_eq f hf] | |
| lemma update_periodic {z : C β RobustClock.Circle} (D : Snapshot M g) | |
| (hc : offChoice clock z = none) (hf : D.boundaries = none) (x : S) : | |
| update clock Ο Ξ² X Y z D x = Ο D.product x := by | |
| simp only [update,shift,hc,hf,add_zero] | |
| lemma independent_pair {z : C β RobustClock.Circle} {a b : T} (D : Snapshot M g) | |
| (he : Edge clock z a b) | |
| (hdiag : a = b β offChoice clock z = none β | |
| Ο D.product (X a) + (match D.boundaries with | |
| | none => 0 | |
| | some f => Ξ² f.A f.C f.entries) = Y b) : | |
| update clock Ο Ξ² X Y z D (X a) = Y b := by | |
| cases hc : offChoice clock z with | |
| | none => | |
| have hab := offChoice_none clock hc he | |
| simpa only [update,shift,hc] using hdiag hab hc | |
| | some ab => | |
| have hh := offChoice_some clock hc | |
| have hab := hh.2.2 _ _ he | |
| have hn : a β b := fun heq => hh.1 (hab.1.symm.trans (heq.trans hab.2)) | |
| exact update_off clock Ο Ξ² X Y D hn he | |
| structure Later (M : Type uM4) [Monoid M] (g : β) where | |
| tailProduct : M | |
| boundaries : Option (Factors M g) | |
| tail_eq : β f, boundaries = some f β tailProduct = f.A * (List.ofFn f.entries).prod * f.C | |
| def Later.substitute (D : Later M g) (m : M) : Snapshot M g where | |
| product := m * D.tailProduct | |
| boundaries := D.boundaries.map (fun f => β¨m * f.A,f.entries,f.Cβ©) | |
| product_eq := by | |
| intro f hf | |
| obtain β¨a,ha,hfβ© := Option.map_eq_some_iff.mp hf | |
| subst f | |
| simp only [D.tail_eq a ha,mul_assoc] | |
| noncomputable def hypothetical (z : C β RobustClock.Circle) (D : Later M g) : | |
| M β (S Γ K ββ[K] S Γ K) := fun m => | |
| Homogenization.lift (Ο (m * D.tailProduct)) | |
| (shift clock Ο Ξ² X Y z (D.substitute m)) | |
| lemma hypothetical_at (z : C β RobustClock.Circle) (D : Later M g) (m : M) (x : S) : | |
| hypothetical clock Ο Ξ² X Y z D m (x,1) = | |
| (update clock Ο Ξ² X Y z (D.substitute m) x,1) := by | |
| simp only [hypothetical,Homogenization.lift_apply_one,update,Later.substitute] | |
| lemma hypothetical_actual (z : C β RobustClock.Circle) (D : Later M g) (m : M) : | |
| hypothetical clock Ο Ξ² X Y z D m = | |
| Homogenization.lift (Ο (D.substitute m).product) | |
| (shift clock Ο Ξ² X Y z (D.substitute m)) := rfl | |
| end ClockAffine | |
| end GeneralizedStarHeight | |
| end OAI | |
Outline
- def
Edge21 - def
offChoice24 - lemma
offChoice_some27 - lemma
offChoice_none43 - lemma
offChoice_of_offedge51 - lemma
edge_add62 - def
productTable72 - structure
Factors75 - structure
Snapshot80 - def
shift88 - def
update95 - lemma
update_off98 - lemma
update_main104 - lemma
update_periodic109 - lemma
independent_pair114 - structure
Later131 - def
Later.substitute136 - def
hypothetical145 - lemma
hypothetical_at150 - lemma
hypothetical_actual155