Download data/lean/OAI/Analysis/DiamondDistortion/PathBounds.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 10.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/DiamondDistortion/PathBounds.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/DiamondDistortion/PathBounds.lean
-
curl -L -o PathBounds.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/DiamondDistortion/PathBounds.lean
10.1 kB
| import OAI.Analysis.DiamondDistortion.PathLenses | |
| namespace OAI | |
| universe u v | |
| noncomputable section | |
| open scoped BigOperators Classical Topology | |
| open Set | |
| namespace DiamondDistortion | |
| namespace Midpoint | |
| variable {X : Type*} [NormedAddCommGroup X] [NormedSpace β X] | |
| /-- Packing with one finite-rank head and a common tail bound; no head norm | |
| estimate and no attained infinite minimum is used. -/ | |
| lemma tail_packing (P : X βL[β] X) [FiniteDimensional β (LinearMap.range P.toLinearMap)] | |
| (z : β β X) {R Ξ΅ T : β} (hz : β i,βz iβ β€ R) | |
| (hs : β i j,i β j β Ξ΅ β€ βz i-z jβ) (ht : β i,βz i-P (z i)β β€ T) : | |
| Ξ΅/2 β€ T := by | |
| apply le_of_forall_pos_le_add | |
| intro Ξ· hΞ· | |
| obtain β¨i,j,hij,hPβ© := finite_rank_pair P z hz hΞ· | |
| let w := (1/2:β) β’ (z i-z j) | |
| have hw : Ξ΅/2 β€ βwβ := by | |
| dsimp [w] | |
| rw [norm_smul,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:β)<1/2)] | |
| linarith [hs i j hij] | |
| have he : w=P w+(1/2:β) β’ ((z i-P (z i))-(z j-P (z j))) := by | |
| dsimp [w] | |
| rw [map_smul,map_sub] | |
| module | |
| have htail : β(1/2:β) β’ ((z i-P (z i))-(z j-P (z j)))β β€ T := by | |
| rw [norm_smul,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:β)<1/2)] | |
| have hh := (norm_sub_le (z i-P (z i)) (z j-P (z j))).trans (add_le_add (ht i) (ht j)) | |
| linarith | |
| have hnorm := norm_add_le (P w) ((1/2:β) β’ ((z i-P (z i))-(z j-P (z j)))) | |
| rw [β he] at hnorm | |
| change βP wβ < Ξ· at hP | |
| linarith | |
| end Midpoint | |
| namespace PathApplications | |
| open Midpoint | |
| variable {X ΞΉ : Type*} [NormedAddCommGroup X] [NormedSpace β X] | |
| /-- Threshold-removal uses a single head for *all* deviations at this radius. -/ | |
| def RelativeInput (A : Heads ΞΉ X) : Prop := | |
| β (x : X),x β 0 β β Ξ΄ : β,0 < Ξ΄ β Ξ΄ β€ 1 β β H : ΞΉ, | |
| β y : X,βx+yβ β€ (1+Ξ΄)*βxβ β βx-yβ β€ (1+Ξ΄)*βxβ β | |
| βy-A.projection H yβ β€ 72*Real.sqrt Ξ΄*βxβ | |
| def relativeDelta (D : β) : β := ((200*D)β»ΒΉ)^2 | |
| lemma relative_parameters {D : β} (hD : 1 β€ D) : | |
| 0 < relativeDelta D β§ relativeDelta D β€ 1 β§ 72*Real.sqrt (relativeDelta D)*D < 1 := by | |
| have hDpos : 0 < D := by linarith | |
| have hinv : 0 < (200*D)β»ΒΉ := by positivity | |
| have hinv1 : (200*D)β»ΒΉ β€ 1 := (inv_le_oneβ (by positivity)).mpr (by linarith) | |
| have hsqrt : Real.sqrt (relativeDelta D)=(200*D)β»ΒΉ := by | |
| unfold relativeDelta | |
| exact Real.sqrt_sq hinv.le | |
| refine β¨by unfold relativeDelta; positivity,by unfold relativeDelta; nlinarith,?_β© | |
| rw [hsqrt] | |
| have he : 72*(200*D)β»ΒΉ*D=72/200 := by field_simp | |
| rw [he] | |
| norm_num | |
| lemma relative_lens_impossible (A : Heads ΞΉ X) (hinput : RelativeInput A) | |
| {D : β} (hD : 1 β€ D) {x : X} (z : β β X) (hx : 1 β€ βxβ) (hxD : βxβ β€ D) | |
| (hp : β i,βx+z iβ β€ (1+relativeDelta D)*βxβ) | |
| (hm : β i,βx-z iβ β€ (1+relativeDelta D)*βxβ) | |
| (hs : β i j,i β j β 2 β€ βz i-z jβ) : False := by | |
| obtain β¨hΞ΄,hΞ΄1,hΞ΄Dβ© := relative_parameters hD | |
| have hx0 : x β 0 := by intro h; simp only [h,norm_zero] at hx; linarith | |
| obtain β¨H,hHβ© := hinput x hx0 (relativeDelta D) hΞ΄ hΞ΄1 | |
| let := A.finite H | |
| have hh := tail_packing (A.projection H) z (fun i => Diamond.norm_deviation_le (hp i) (hm i)) | |
| hs (fun i => hH (z i) (hp i) (hm i)) | |
| have hm := mul_le_mul_of_nonneg_left hxD (show 0 β€ 72*Real.sqrt (relativeDelta D) by positivity) | |
| linarith | |
| /-- An actual original child exceeds the relative factor, rather than merely | |
| a quotient representative or a supremum satisfying a non-strict bound. -/ | |
| lemma relative_actual_child (A : Heads ΞΉ X) (hinput : RelativeInput A) | |
| {D : β} (hD : 1 β€ D) {x : X} (z : β β X) (hx : 1 β€ βxβ) (hxD : βxβ β€ D) | |
| (hs : β i j,i β j β 2 β€ βz i-z jβ) : | |
| β i,(1+relativeDelta D)*βxβ < max βx+z iβ βx-z iβ := by | |
| by_contra! hn | |
| exact relative_lens_impossible A hinput hD z hx hxD | |
| (fun i => (le_max_left _ _).trans (hn i)) (fun i => (le_max_right _ _).trans (hn i)) hs | |
| theorem relative_cost (A : Heads ΞΉ X) (hinput : RelativeInput A) | |
| {D s : β} (k : β) (f : Diamond.Vertex k β X) (hf : Diamond.HasDistortion k f D s) : | |
| (1+relativeDelta D)^k β€ D := by | |
| obtain β¨hΞ΄,hΞ΄1,hΞ΄Dβ© := relative_parameters hf.1 | |
| have hb : 0 < 1+relativeDelta D := by positivity | |
| let c : β := 1/(1+relativeDelta D) | |
| have hc : 0 β€ c := by dsimp [c]; positivity | |
| have hc1 : c β€ 1 := (div_le_oneβ hb).mpr (by linarith) | |
| have hstep : β (x : X) (z : β β X) (R : β),0 β€ R β R β€ D β 1 β€ βxβ β | |
| (β i,βx+z iβ β€ R) β (β i,βx-z iβ β€ R) β | |
| (β i j,i β j β 2*1 β€ βz i-z jβ) β βxβ β€ c*R := by | |
| intro x z R hR hRD hx hp hm hs | |
| have hxD := (Diamond.norm_center_le (hp 0) (hm 0)).trans hRD | |
| obtain β¨i,hiβ© := relative_actual_child A hinput hf.1 z hx hxD (by simpa using hs) | |
| have hh := hi.trans_le (max_le (hp i) (hm i)) | |
| have hnorm : βxβ β€ R/(1+relativeDelta D) := (le_div_iffβ hb).mpr (by nlinarith) | |
| simpa only [c,div_eq_mul_inv,one_mul,mul_comm] using hnorm | |
| obtain β¨_,_,hnormβ© := Diamond.normalized_distortion f hf | |
| have hh := Diamond.iterate_contraction hc hc1 hstep k (fun v => sβ»ΒΉ β’ f v) | |
| (show 0 β€ D by linarith [hf.1]) le_rfl (fun u v => (hnorm u v).1) | |
| (fun e => Diamond.slope_upper _ (fun u v => by simpa using (hnorm u v).2) e) | |
| have he : c^k*D=D/(1+relativeDelta D)^k := by dsimp [c]; rw [div_pow,one_pow]; ring | |
| rw [he] at hh | |
| exact (one_le_div (by positivity : 0 < (1+relativeDelta D)^k)).mp hh | |
| end PathApplications | |
| namespace Midpoint | |
| open Filter | |
| variable {X : Type*} [NormedAddCommGroup X] [NormedSpace β X] | |
| [TopologicalSpace.SeparableSpace (StrongDual β X)] | |
| lemma bounded_scalar_subsequence (z : β β X) {R : β} (hz : β i,βz iβ β€ R) : | |
| β n : β β β,StrictMono n β§ β f : StrongDual β X,β a : β, | |
| Tendsto (fun i => f (z (n i))) atTop (π a) := by | |
| let w (i : β) : WeakDual β (StrongDual β X) := | |
| StrongDual.toWeakDual (NormedSpace.inclusionInDoubleDual β X (z i)) | |
| have hw : β i,w i β WeakDual.toStrongDual β»ΒΉ' Metric.closedBall 0 R := by | |
| intro i | |
| change dist (NormedSpace.inclusionInDoubleDual β X (z i)) 0 β€ R | |
| convert (NormedSpace.double_dual_bound β X (z i)).trans (hz i) using 1 | |
| exact @dist_zero_right (StrongDual β (StrongDual β X)) inferInstance | |
| (NormedSpace.inclusionInDoubleDual β X (z i)) | |
| obtain β¨a,ha,n,hn,htβ© := WeakDual.isSeqCompact_closedBall β (StrongDual β X) 0 R hw | |
| refine β¨n,hn,fun f => β¨a f,?_β©β© | |
| have hh := ((WeakDual.eval_continuous f).tendsto a).comp ht | |
| exact hh | |
| lemma bounded_weak_pair (z : β β X) {R : β} (hz : β i,βz iβ β€ R) : | |
| β n : β β β,StrictMono n β§ β f : StrongDual β X, | |
| Tendsto (fun i => f ((1/2:β) β’ (z (n (2*i))-z (n (2*i+1))))) atTop (π 0) := by | |
| obtain β¨n,hn,hfβ© := bounded_scalar_subsequence z hz | |
| refine β¨n,hn,fun f => ?_β© | |
| obtain β¨a,haβ© := hf f | |
| have ht0 : Tendsto (fun i : β => 2*i) atTop atTop := tendsto_atTop_mono (by intro i; dsimp only [id]; omega) tendsto_id | |
| have ht1 : Tendsto (fun i : β => 2*i+1) atTop atTop := tendsto_atTop_mono (by intro i; dsimp only [id]; omega) tendsto_id | |
| have hh := ((ha.comp ht0).sub (ha.comp ht1)).const_mul (1/2:β) | |
| simpa only [Function.comp_def,sub_self,mul_zero,map_smul,map_sub,smul_eq_mul] using hh | |
| end Midpoint | |
| namespace PathApplications | |
| open Midpoint Filter | |
| variable {X : Type*} [NormedAddCommGroup X] [NormedSpace β X] | |
| def WeakInput (X : Type*) [NormedAddCommGroup X] [NormedSpace β X] : Prop := | |
| β (x : X) (y : β β X),(β M : β,β j,βy jβ β€ M) β WeaklyNull y β | |
| Real.sqrt (βxβ^2+(1/16:β)*(liminf (fun j => βy jβ) atTop)^2) β€ | |
| liminf (fun j => max βx+y jβ βx-y jβ) atTop | |
| lemma weak_lens [TopologicalSpace.SeparableSpace (StrongDual β X)] (hinput : WeakInput X) : | |
| Diamond.SquareLens X (1/64) := by | |
| intro x z R Ξ΅ hR hΞ΅ hp hm hs | |
| obtain β¨n,hn,hweakβ© := Midpoint.bounded_weak_pair z (fun i => Diamond.norm_deviation_le (hp i) (hm i)) | |
| let y (i : β) := (1/2:β) β’ (z (n (2*i))-z (n (2*i+1))) | |
| have hnull : WeaklyNull y := hweak | |
| have hend (i : β) : βx+y iβ β€ R β§ βx-y iβ β€ R := average_lens z hp hm _ _ | |
| have hyR (i : β) : βy iβ β€ R := Diamond.norm_deviation_le (hend i).1 (hend i).2 | |
| have hyl (i : β) : Ξ΅/2 β€ βy iβ := by | |
| have hij : n (2*i) β n (2*i+1) := hn.injective.ne (by omega) | |
| dsimp [y] | |
| rw [norm_smul,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:β)<1/2)] | |
| linarith [hs _ _ hij] | |
| have hlim : Ξ΅/2 β€ liminf (fun i => βy iβ) atTop := | |
| le_liminf_of_le (isCoboundedUnder_ge_of_le atTop hyR) (Eventually.of_forall hyl) | |
| have hmaxL (i : β) : 0 β€ max βx+y iβ βx-y iβ := (norm_nonneg _).trans (le_max_left _ _) | |
| have hmaxR (i : β) : max βx+y iβ βx-y iβ β€ R := max_le (hend i).1 (hend i).2 | |
| have hlimR : liminf (fun i => max βx+y iβ βx-y iβ) atTop β€ R := | |
| liminf_le_of_frequently_le (Eventually.of_forall hmaxR).frequently | |
| (isBoundedUnder_of_eventually_ge (Eventually.of_forall hmaxL)) | |
| have hh := (hinput x y β¨R,hyRβ© hnull).trans hlimR | |
| have hsq : βxβ^2+(1/16:β)*(liminf (fun i => βy iβ) atTop)^2 β€ R^2 := by | |
| exact (Real.sqrt_le_iff).mp hh |>.2 | |
| have hlim0 : 0 β€ liminf (fun i => βy iβ) atTop := (by positivity : 0 β€ Ξ΅/2).trans hlim | |
| have hl2 := (sq_le_sqβ (by positivity : 0 β€ Ξ΅/2) hlim0).mpr hlim | |
| nlinarith | |
| theorem weak_linear [TopologicalSpace.SeparableSpace (StrongDual β X)] (hinput : WeakInput X) | |
| {D s : β} (k : β) (f : Diamond.Vertex k β X) (hf : Diamond.HasDistortion k f D s) : | |
| 1+(k:β)/64 β€ D^2 := by | |
| have hh := Diamond.squared_transfer (by norm_num : (0:β)<1/64) (weak_lens hinput) k f D s hf | |
| have hk : (0:β) β€ k := Nat.cast_nonneg k | |
| linarith | |
| end PathApplications | |
| end DiamondDistortion | |
| end | |
| end OAI | |