Download data/lean/OAI/Combinatorics/PerfectMatching/Polyhedron.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.04 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/PerfectMatching/Polyhedron.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/PerfectMatching/Polyhedron.lean
-
curl -L -o Polyhedron.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/PerfectMatching/Polyhedron.lean
5.04 kB
| import Mathlib | |
| namespace OAI | |
| /-! | |
| Finite polyhedra, local perturbations, and quotient dimension bounds. | |
| -/ | |
| noncomputable section | |
| open scoped BigOperators Topology | |
| open Filter | |
| namespace MatchingEntropy | |
| section PolyhedralPrelude | |
| variable {I J : Type*} [Fintype I] [Fintype J] | |
| def finitePolyhedron (L : I β (J β β) ββ[β] β) (b : I β β) : Set (J β β) := | |
| {x | β i, L i x β€ b i} | |
| /-- Finite slack, with every active equation preserved, permits both signs. -/ | |
| theorem finitePolyhedron_eventually_line (L : I β (J β β) ββ[β] β) (b : I β β) | |
| {x : J β β} (hx : x β finitePolyhedron L b) (u : J β β) | |
| (hu : β i, L i x = b i β L i u = 0) : | |
| βαΆ t : β in π 0, x+t β’ u β finitePolyhedron L b := by | |
| apply Filter.eventually_all.mpr | |
| intro i | |
| by_cases hi : L i x=b i | |
| Β· apply Filter.Eventually.of_forall | |
| intro t | |
| rw [map_add, map_smul, hu i hi, smul_zero, add_zero, hi] | |
| Β· have hlt : L i x < b i := lt_of_le_of_ne (hx i) hi | |
| have hc : Continuous (fun t : β => L i (x+t β’ u)) := | |
| (L i).continuous_of_finiteDimensional.comp (by fun_prop) | |
| have hh : βαΆ t : β in π 0, L i (x+t β’ u) < b i := | |
| (isOpen_lt hc continuous_const).mem_nhds (by simpa using hlt : L i (x+(0:β) β’ u) < b i) | |
| exact hh.mono fun t ht => le_of_lt ht | |
| /-- Radial expansion about x preserves every active inequality for arbitrary | |
| nearby feasible points. Inactive inequalities are handled by finite slack. -/ | |
| theorem finitePolyhedron_eventually_expand (L : I β (J β β) ββ[β] β) (b : I β β) | |
| {x : J β β} (hx : x β finitePolyhedron L b) {t : β} (ht : 0 < t) : | |
| βαΆ y in π[finitePolyhedron L b] x, x+tβ»ΒΉ β’ (y-x) β finitePolyhedron L b := by | |
| apply Filter.eventually_all.mpr | |
| intro i | |
| by_cases hi : L i x=b i | |
| Β· filter_upwards [eventually_mem_nhdsWithin] with y hy | |
| rw [map_add, map_smul, map_sub, hi] | |
| change b i+tβ»ΒΉ * (L i y-b i) β€ b i | |
| have hh := mul_nonpos_of_nonneg_of_nonpos (inv_nonneg.mpr ht.le) (sub_nonpos.mpr (hy i)) | |
| linarith | |
| Β· have hlt : L i x < b i := lt_of_le_of_ne (hx i) hi | |
| have hc : Continuous (fun y : J β β => L i (x+tβ»ΒΉ β’ (y-x))) := | |
| (L i).continuous_of_finiteDimensional.comp (by fun_prop) | |
| have hh : βαΆ y : J β β in π x, L i (x+tβ»ΒΉ β’ (y-x)) < b i := | |
| (isOpen_lt hc continuous_const).mem_nhds (by simpa using hlt : L i (x+tβ»ΒΉ β’ (x-x)) < b i) | |
| exact (hh.filter_mono nhdsWithin_le_nhds).mono fun y hy => le_of_lt hy | |
| omit [Fintype J] in | |
| theorem extreme_point_direction_zero (P : Set (J β β)) {x : J β β} | |
| (hx : x β Set.extremePoints β P) (u : J β β) | |
| (hu : βαΆ t : β in π 0, x+t β’ u β P) : u=0 := by | |
| have hu' : βαΆ t : β in π 0, x+(-t) β’ u β P := by | |
| have hc : Tendsto (fun t : β => -t) (π 0) (π 0) := by simpa using (continuous_neg.tendsto (0:β)) | |
| exact hc.eventually hu | |
| -- choose a strictly positive point using the right-hand punctured neighborhood | |
| have hh : βαΆ t : β in π[>] 0, (x+t β’ u β P β§ x+(-t) β’ u β P) β§ 0<t := | |
| ((hu.and hu').filter_mono nhdsWithin_le_nhds).and eventually_mem_nhdsWithin | |
| obtain β¨a,β¨ha,hnaβ©,ha0β© := hh.exists | |
| have hseg : x β openSegment β (x+a β’ u) (x+(-a) β’ u) := by | |
| refine β¨1/2,1/2,by norm_num,by norm_num,by norm_num,?_β© | |
| ext j | |
| simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul] | |
| ring | |
| have he := (mem_extremePoints.mp hx).2 _ ha _ hna hseg |>.1 | |
| ext j | |
| have hj := congrFun he j | |
| change x j+a*u j=x j at hj | |
| change u j=0 | |
| exact (mul_eq_zero.mp (by linarith : a*u j=0)).resolve_left (ne_of_gt ha0) | |
| section LinearHelper | |
| open Module | |
| variable {A B C : Type*} [AddCommGroup A] [AddCommGroup B] [AddCommGroup C] | |
| [Module β A] [Module β B] [Module β C] | |
| [FiniteDimensional β A] [FiniteDimensional β B] [FiniteDimensional β C] | |
| theorem quotient_finrank_le_of_ker_le (U : Submodule β A) (f : A ββ[β] B) | |
| (h : f.ker β€ U) : finrank β (A β§Έ U) β€ finrank β B := by | |
| have h1 := U.finrank_quotient_add_finrank | |
| have h2 := f.finrank_range_add_finrank_ker | |
| have h3 := Submodule.finrank_mono h | |
| have h4 : finrank β f.range β€ finrank β B := Submodule.finrank_le _ | |
| omega | |
| theorem quotient_finrank_le_pair (U : Submodule β A) (W : Submodule β B) (Z : Submodule β C) | |
| (f : A ββ[β] B) (g : A ββ[β] C) | |
| (h : β u, f u β W β g u β Z β u β U) : | |
| finrank β (A β§Έ U) β€ finrank β (B β§Έ W)+finrank β (C β§Έ Z) := by | |
| let F := (W.mkQ.comp f).prod (Z.mkQ.comp g) | |
| have hk : F.ker β€ U := by | |
| intro u hu | |
| have hh : (W.mkQ (f u), Z.mkQ (g u))=0 := hu | |
| have hW : f u β W := by | |
| have hq := congrArg Prod.fst hh | |
| simpa using hq | |
| have hZ : g u β Z := by | |
| have hq := congrArg Prod.snd hh | |
| simpa using hq | |
| exact h u hW hZ | |
| simpa using quotient_finrank_le_of_ker_le U F hk | |
| end LinearHelper | |
| end PolyhedralPrelude | |
| end MatchingEntropy | |
| end | |
| end OAI | |