Download data/lean/OAI/Geometry/HyperbolicGroups/Budget.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.84 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/HyperbolicGroups/Budget.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/HyperbolicGroups/Budget.lean
-
curl -L -o Budget.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/HyperbolicGroups/Budget.lean
3.84 kB
| import Mathlib | |
| namespace OAI | |
| section | |
| section | |
| noncomputable section | |
| namespace HyperbolicObstruction | |
| namespace SparsePattern | |
| open scoped BigOperators | |
| /-- Independent table entry types, with their coordinate supports and critical costs. | |
| The table model of Sections 2 and 4 is a concrete instance. -/ | |
| structure Pattern (F R : Type*) [Fintype F] [Fintype R] where | |
| support : R β Finset F | |
| cost : R β β€ | |
| nonneg : β r, 0 β€ cost r | |
| variable {F R : Type*} [Fintype F] [Fintype R] [DecidableEq F] | |
| namespace Pattern | |
| def exponent (P : Pattern F R) (W : Finset F) : β€ := | |
| W.card - β r, if P.support r β W then P.cost r else 0 | |
| lemma exponent_submodular (P : Pattern F R) (S T : Finset F) : | |
| P.exponent (S βͺ T) + P.exponent (S β© T) β€ P.exponent S + P.exponent T := by | |
| classical | |
| have hcost : (β r, if P.support r β S then P.cost r else 0) + | |
| (β r, if P.support r β T then P.cost r else 0) β€ | |
| (β r, if P.support r β S βͺ T then P.cost r else 0) + | |
| (β r, if P.support r β S β© T then P.cost r else 0) := by | |
| rw [β Finset.sum_add_distrib, β Finset.sum_add_distrib] | |
| apply Finset.sum_le_sum | |
| intro r _ | |
| by_cases hS : P.support r β S <;> by_cases hT : P.support r β T | |
| Β· simp [hS, hT, Finset.subset_union_left.trans' hS, Finset.subset_inter hS hT] | |
| Β· have hu : P.support r β S βͺ T := hS.trans Finset.subset_union_left | |
| have hi : Β¬P.support r β S β© T := fun h => hT (h.trans Finset.inter_subset_right) | |
| simp [hS, hT, hu, hi] | |
| Β· have hu : P.support r β S βͺ T := hT.trans Finset.subset_union_right | |
| have hi : Β¬P.support r β S β© T := fun h => hS (h.trans Finset.inter_subset_left) | |
| simp [hS, hT, hu, hi] | |
| Β· have hi : Β¬P.support r β S β© T := fun h => hS (h.trans Finset.inter_subset_left) | |
| simp only [hS, hT, hi, ite_false, add_zero] | |
| split_ifs <;> simp [P.nonneg] | |
| have hc : ((S βͺ T).card : β€) + (S β© T).card = S.card + T.card := by | |
| exact_mod_cast Finset.card_union_add_card_inter S T | |
| unfold exponent | |
| linarith | |
| lemma exponent_eq_card (P : Pattern F R) (I : Finset F) | |
| (hI : β r, Β¬P.support r β I) : P.exponent I = I.card := by | |
| simp [exponent, hI] | |
| /-- The maximal critical closure in Section 4. The conclusions retain a full | |
| unit integer margin, not merely strictness. -/ | |
| theorem critical_closure (P : Pattern F R) (I : Finset F) (e : F) | |
| (he : e β I) (hI : P.exponent I = I.card) | |
| (hbudget : β W, I β W β (I.card : β€) β€ P.exponent W) | |
| (htest : β W, insert e I β W β ((insert e I).card : β€) β€ P.exponent W) : | |
| β U : Finset F, I β U β§ P.exponent U = I.card β§ e β U β§ | |
| β V : Finset F, V.Nonempty β Disjoint V U β | |
| 1 β€ P.exponent (U βͺ V) - P.exponent U := by | |
| classical | |
| let B : Finset (Finset F) := Finset.univ.filter (fun U => I β U β§ P.exponent U = I.card) | |
| have hmem : I β B := by simp [B, hI] | |
| obtain β¨U, hU, hmaxβ© := B.exists_max_image Finset.card β¨I, hmemβ© | |
| have hU' : I β U β§ P.exponent U = I.card := (Finset.mem_filter.mp hU).2 | |
| refine β¨U, hU'.1, hU'.2, ?_, ?_β© | |
| Β· intro heU | |
| have hh := htest U (Finset.insert_subset heU hU'.1) | |
| rw [Finset.card_insert_of_notMem he, Nat.cast_add, Nat.cast_one, hU'.2] at hh | |
| omega | |
| Β· intro V hV hd | |
| have hsub : I β U βͺ V := hU'.1.trans Finset.subset_union_left | |
| have hb := hbudget (U βͺ V) hsub | |
| have hne : P.exponent (U βͺ V) β (I.card : β€) := by | |
| intro heq | |
| have hm : U βͺ V β B := by simp [B, hsub, heq] | |
| have hm' := hmax (U βͺ V) hm | |
| have hc : (U βͺ V).card = U.card + V.card := | |
| Finset.card_union_of_disjoint hd.symm | |
| have hv := Finset.card_pos.mpr hV | |
| omega | |
| rw [hU'.2] | |
| omega | |
| end Pattern | |
| end SparsePattern | |
| end HyperbolicObstruction | |
| end | |
| end | |
| end | |
| end OAI | |