Download data/lean/OAI/GroupTheory/SimpleOvergroups/FamilyProgram.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.39 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/GroupTheory/SimpleOvergroups/FamilyProgram.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/GroupTheory/SimpleOvergroups/FamilyProgram.lean
-
curl -L -o FamilyProgram.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/GroupTheory/SimpleOvergroups/FamilyProgram.lean
6.39 kB
| import Mathlib | |
| import OAI.Computability.FiniteCompiler.Normalization | |
| import OAI.GroupTheory.BooneHigman.TreeCoherence | |
| import OAI.GroupTheory.SimpleOvergroups.EffectiveTables | |
| import OAI.GroupTheory.SimpleOvergroups.FamilyTables | |
| namespace OAI | |
| namespace SimpleFInftyOvergroups.ContextualEncoding | |
| open FiniteAlgebraicEnvelopes FiniteAlgebraicEnvelopes.Bootstrap | |
| namespace CodeTable | |
| variable {A S Q : Type*} {r : S β S β Prop} [Std.Trichotomous r] | |
| theorem table_zero (C : DelimiterCode A S) (E : FiniteSearch C) | |
| (wf : WellFounded r) (q : List A β Option Q) (z : S) : | |
| table C E wf q z 0 = [] := by | |
| apply List.eq_nil_iff_forall_not_mem.mpr | |
| rintro β¨u,vβ© hp | |
| obtain β¨w,hw,hn,_,_,_β© := (mem_table C E wf q z).mp hp | |
| exact hn ((C.encode_eq_nil _).mp (List.length_eq_zero_iff.mp (Nat.eq_zero_of_le_zero hw))) | |
| end CodeTable | |
| namespace Families | |
| variable {I S : Type*} {A Q : I β Type*} [Fintype I] [Fintype S] | |
| variable {r : S β S β Prop} [Std.Trichotomous r] | |
| variable (C : β i, DelimiterCode (A i) S) (E : β i, FiniteSearch (C i)) | |
| (wf : WellFounded r) (q : β i, List (A i) β Option (Q i)) (z : S) | |
| theorem table_zero : table C E wf q z 0 = Base.absorption z := by | |
| simp [table, CodeTable.table_zero] | |
| end Families | |
| namespace FamilyProgram | |
| variable {I S : Type*} {A Q : I β Type*} [Fintype I] [Fintype S] | |
| [DecidableEq S] [β i, DecidableEq (A i)] [β i, DecidableEq (Q i)] | |
| variable {r : S β S β Prop} [DecidableRel (List.Shortlex r)] | |
| variable (C : β i, DelimiterCode (A i) S) (E : β i, FiniteSearch (C i)) | |
| (z : S) (f : β i, List (A i) β Part (Option (Q i))) | |
| noncomputable def compute (n : β) : Part (List (List S Γ List S)) := | |
| if n = 0 then Part.some (Base.absorption z) else | |
| (Effect.traverse (fun i => CodedSearch.compute (r := r) (C i) (E i) z (f i) n) | |
| (Static.letters I)).map (fun rs => Base.absorption z ++ rs.flatten) | |
| omit [β index, DecidableEq (A index)] in | |
| @[simp] theorem compute_zero [β index, DecidableEq (A index)] : | |
| compute (r := r) C E z f 0 = Part.some (Base.absorption z) := by | |
| simp [compute] | |
| variable (wf : WellFounded r) [Std.Trichotomous r] | |
| theorem compute_full {n : β} (q : β i, List (A i) β Option (Q i)) | |
| (h : β i w, (C i |>.encode w).length β€ n β q i w β f i w) : | |
| Families.table C E wf q z n β compute (r := r) C E z f n := by | |
| by_cases hn : n = 0 | |
| Β· subst n | |
| simp [compute_zero, Families.table_zero] | |
| Β· rw [compute, ite_eq_right hn] | |
| apply (Part.mem_map_iff _).mpr | |
| refine β¨(Static.letters I).map (fun i => CodeTable.table (C i) (E i) wf (q i) z n), ?_, ?_β© | |
| Β· apply Search.traverse_map | |
| intro i hi | |
| exact CodedSearch.compute_full (C i) wf (q i) (E i) z (h i) | |
| Β· simp only [Families.table, List.flatMap_def] | |
| omit [β index, DecidableEq (A index)] [Std.Trichotomous r] in | |
| theorem compute_domain [β index, DecidableEq (A index)] [Std.Trichotomous r] | |
| {n : β} (hn : n β 0) | |
| (h : (compute (r := r) C E z f n).Dom) : | |
| β i w, (C i |>.encode w).length β€ n β (f i w).Dom := by | |
| rw [compute, ite_eq_right hn] at h | |
| obtain β¨out, hoβ© := Part.dom_iff_mem.mp h | |
| obtain β¨rs, hrs, _β© := (Part.mem_map_iff _).mp ho | |
| intro i | |
| exact CodedSearch.compute_domain (C i) (E i) z | |
| (Effect.traverse_domain hrs.1 i (by simp [Static.letters])) | |
| theorem compute_eq {n : β} {rs : List (List S Γ List S)} | |
| (h : rs β compute (r := r) C E z f n) : | |
| rs = Families.table C E wf (fun i => Search.value (f i)) z n := by | |
| by_cases hn : n = 0 | |
| Β· subst n | |
| simpa [compute_zero, Families.table_zero] using h | |
| Β· exact Part.mem_unique h (compute_full C E z f wf _ | |
| (fun i w hw => Search.value_mem (compute_domain C E z f hn h.1 i w hw))) | |
| include wf | |
| theorem stable {k n : β} (hkn : k β€ n) | |
| {rk rn : List (List S Γ List S)} | |
| (hk : rk β compute (r := r) C E z f k) (hn : rn β compute (r := r) C E z f n) : | |
| Selectors.BoundedEq rk rn k := by | |
| rw [compute_eq C E z f wf hk, compute_eq C E z f wf hn] | |
| exact Families.stable C E wf _ z hkn | |
| theorem good_zero : GoodTable (r := r) (compute (r := r) C E z f) 0 := by | |
| refine β¨Base.absorption z, by simp, ?_, ?_β© | |
| Β· have hh := Families.decreasing C E wf (fun i => Search.value (f i)) z 0 | |
| simpa only [Families.table_zero] using hh | |
| Β· constructor | |
| Β· intro u u' v v' hu hv x y he hlen | |
| obtain β¨a, ha, _β© := (Base.mem_absorption z).mp hu | |
| rcases ha with rfl | rfl <;> simp at hlen | |
| Β· intro u u' v v' hu hv p m t hm he hf hlen | |
| have hml : m.length = 0 := by simp only [List.length_append] at hlen; omega | |
| exact (hm (List.length_eq_zero_iff.mp hml)).elim | |
| theorem good_at (hz : β i, z β (C i).alphabet) | |
| (hd : β i j, i β j β Disjoint (C i).alphabet (C j).alphabet) {n : β} | |
| (ht : β i w, (C i |>.encode w).length β€ n β (f i w).Dom) | |
| (hzero : β i, Search.value (f i) [] β none) | |
| (hc : β i, CodeTable.Contextual (C i) (Search.value (f i)) n) | |
| (hi : β i, CodeTable.ZeroIdeal (C i) (Search.value (f i)) n) : | |
| GoodTable (r := r) (compute (r := r) C E z f) n := | |
| β¨_, compute_full C E z f wf _ (fun i w hw => Search.value_mem (ht i w hw)), | |
| Families.decreasing C E wf _ z n, Families.critical C E wf _ z hz hd hzero hc hiβ© | |
| theorem bootstrap (normal : List S β Part (List S)) | |
| (fixed : normal = tableNormal (compute (r := r) C E z f)) | |
| (hz : β i, z β (C i).alphabet) | |
| (hd : β i j, i β j β Disjoint (C i).alphabet (C j).alphabet) | |
| (bounded : β n, 0 < n β Compiler.PartialBudget normal (3 * (n / 10)) β | |
| (β i w, (C i |>.encode w).length β€ n β (f i w).Dom) β§ | |
| (β i, Search.value (f i) [] β none) β§ | |
| (β i, CodeTable.Contextual (C i) (Search.value (f i)) n) β§ | |
| (β i, CodeTable.ZeroIdeal (C i) (Search.value (f i)) n)) : | |
| β n, GoodTable (r := r) (compute (r := r) C E z f) n β§ | |
| Compiler.PartialBudget normal n := by | |
| apply bootstrap_length_induction wf _ normal fixed | |
| Β· intro k n hkn rk hk rn hn | |
| exact stable C E z f wf hkn hk hn | |
| Β· intro n ih | |
| by_cases hn : n = 0 | |
| Β· subst n | |
| exact good_zero C E z f wf | |
| Β· obtain β¨ht, hzero, hc, hiβ© := bounded n (Nat.pos_of_ne_zero hn) | |
| (ih _ (strict_dependency (Nat.pos_of_ne_zero hn))) | |
| exact good_at C E z f wf hz hd ht hzero hc hi | |
| end FamilyProgram | |
| end SimpleFInftyOvergroups.ContextualEncoding | |
| end OAI | |