File size: 4,771 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | import OAI.Combinatorics.MatchingEntropy.Simplex
namespace OAI
noncomputable section
open scoped BigOperators Topology
open Filter
universe uV uE uI uJ uA uB uC uW uF uD uΞΉ
namespace MatchingEntropyBounds
section PolyhedralPrelude
variable {I : Type uI} {J : Type uJ} [Fintype I] [Fintype J]
def finitePolyhedron (L : I β (J β β) ββ[β] β) (b : I β β) : Set (J β β) :=
{x | β i, L i x β€ b i}
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
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
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 : Type uA} {B : Type uB} {C : Type uC} [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 MatchingEntropyBounds
end
end OAI
|