Download data/lean/OAI/Geometry/Cannon/Energy/RawFunction.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.54 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/Cannon/Energy/RawFunction.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/Cannon/Energy/RawFunction.lean
-
curl -L -o RawFunction.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/Cannon/Energy/RawFunction.lean
9.54 kB
| import Mathlib | |
| import OAI.Geometry.Cannon.Energy.PathCosts | |
| import OAI.Geometry.Cannon.ScalarLimits.LocalOscillation | |
| namespace OAI | |
| section | |
| section | |
| section | |
| noncomputable section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| open Set Topology | |
| open Set Metric Topology | |
| open Set Topology Filter Metric unitInterval | |
| open scoped InnerProductSpace | |
| open Set unitInterval | |
| namespace CannonApprox | |
| open CannonGrid CannonRegularization CannonLevel CannonCells CannonBands | |
| variable {ΞΉ : Type*} [Fintype ΞΉ] | |
| local instance : PathConnectedSpace (Strip height (1 / 3) (2 / 3)) := | |
| strip_pathConnected _ _ (by norm_num) (by norm_num) (by norm_num) | |
| def rawFunction (C : ΞΉ β Set CannonGrid.Square) (Ο : ΞΉ β β) : CannonGrid.Square β β := | |
| rawExtended height (1/3) (2/3) C Ο | |
| def Admissible (C : ΞΉ β Set CannonGrid.Square) (Ο : ΞΉ β β) : Prop := | |
| β u : Strip height (1/3) (2/3), height u.val = 1/3 β | |
| β v : Strip height (1/3) (2/3), height v.val = 2/3 β | |
| β p : Path u v, 1 β€ cost (fun i => Subtype.val β»ΒΉ' C i) Ο (range p) | |
| theorem rawFunction_properties (C : ΞΉ β Set CannonGrid.Square) (Ο : ΞΉ β β) | |
| (hΟ : β i, 0 β€ Ο i) (hcross : Admissible C Ο) : | |
| (β z, rawFunction C Ο z β Icc 0 1) β§ | |
| (β z β topBand, rawFunction C Ο z = 0) β§ | |
| (β z β bottomBand, rawFunction C Ο z = 1) β§ | |
| (β u v, β p : Path u v, |rawFunction C Ο u-rawFunction C Ο v| β€ cost C Ο (range p)) := by | |
| exact rawExtended_properties height (by unfold height; fun_prop) (1/3) (2/3) (by norm_num) C Ο hΟ | |
| (strip_top_nonempty _ _ (by norm_num) (by norm_num) (by norm_num)) hcross | |
| def initial (C : ΞΉ β Set CannonGrid.Square) (Ο : ΞΉ β β) (n : β) (hn : 0 < n) : | |
| CannonGrid.Square β β := interpolate (3*n) (by omega) (rawFunction C Ο) | |
| def scalar (C : ΞΉ β Set CannonGrid.Square) (Ο : ΞΉ β β) (n : β) (hn : 0 < n) : | |
| CannonGrid.Square β β := drain (flood (initial C Ο n hn) topBand) bottomBand | |
| lemma initial_properties (C : ΞΉ β Set CannonGrid.Square) (Ο : ΞΉ β β) | |
| (hΟ : β i, 0 β€ Ο i) (hcross : Admissible C Ο) (n : β) (hn : 0 < n) : | |
| Continuous (initial C Ο n hn) β§ (β z, initial C Ο n hn z β Icc 0 1) β§ | |
| (β z β topBand, initial C Ο n hn z = 0) β§ | |
| (β z β bottomBand, initial C Ο n hn z = 1) := by | |
| obtain β¨hrange,htop,hbottom,_β© := rawFunction_properties C Ο hΟ hcross | |
| have hbands := interpolate_preserves_bands n hn (rawFunction C Ο) htop hbottom | |
| exact β¨continuous_interpolate _ _ _, interpolate_bounds _ _ _ hrange,hbandsβ© | |
| theorem scalar_properties (C : ΞΉ β Set CannonGrid.Square) (Ο : ΞΉ β β) | |
| (hΟ : β i, 0 β€ Ο i) (hcross : Admissible C Ο) (n : β) (hn : 0 < n) : | |
| Continuous (scalar C Ο n hn) β§ (β z, scalar C Ο n hn z β Icc 0 1) β§ | |
| (β z β topBand, scalar C Ο n hn z = 0) β§ | |
| (β z β bottomBand, scalar C Ο n hn z = 1) := by | |
| obtain β¨hf,hfI,hT,hBβ© := initial_properties C Ο hΟ hcross n hn | |
| have hF := continuous_flood topBand_pathConnected.nonempty hf (fun z => (hfI z).2) | |
| have hFk : β z, 0 β€ flood (initial C Ο n hn) topBand z := fun z => | |
| (hfI z).1.trans (le_flood topBand_pathConnected.nonempty (fun w => (hfI w).2) z) | |
| exact β¨continuous_drain bottomBand_pathConnected.nonempty hF hFk, | |
| regularized_values topBand_pathConnected.nonempty bottomBand_pathConnected.nonempty | |
| (fun z => (hfI z).1) (fun z => (hfI z).2) hT hBβ© | |
| theorem scalar_level (C : ΞΉ β Set CannonGrid.Square) (Ο : ΞΉ β β) | |
| (hΟ : β i, 0 β€ Ο i) (hcross : Admissible C Ο) (n : β) (hn : 0 < n) | |
| {t : β} (ht : t β Ioo (0:β) 1) : | |
| β A : Set CannonGrid.Square, IsCompact A β§ IsConnected A β§ A β centralRectangle β§ | |
| (β z β A, scalar C Ο n hn z = t) β§ (β z β A, z.1 = 0) β§ (β z β A, z.1 = 1) β§ | |
| (β {x y : CannonGrid.Square} (p : Path x y), scalar C Ο n hn x < t β | |
| t < scalar C Ο n hn y β β s, p s β A) := by | |
| obtain β¨hf,hfI,hT,hBβ© := initial_properties C Ο hΟ hcross n hn | |
| exact rectangle_separating_level hf (fun z => (hfI z).1) (fun z => (hfI z).2) hT hB ht.1 ht.2 | |
| theorem exists_mesh {X : Type*} [MetricSpace X] (e : CannonGrid.Square β X) | |
| (he : Continuous e) {r : β} (hr : 0 < r) : | |
| β n : β, β hn : 0 < n, β z : CannonGrid.Square, β i : Index (3*n), | |
| weight (3*n) z i β 0 β dist (e z) (e (vertex (3*n) (by omega) i)) < r := | |
| exists_metric_mesh e he hr | |
| theorem scalar_local_oscillation {X : Type*} [MetricSpace X] | |
| (e : CannonGrid.Square β X) (he : Topology.IsEmbedding e) | |
| (L J r : β) (hL : 1 β€ L) (hJ : 0 < J) (hr : 0 < r) | |
| (hpaths : β (o u v : X) (s : β), 0 < s β dist o u β€ s β dist o v β€ s β | |
| JoinedIn {z | dist o z < L*s} u v) | |
| (x : X) (hchart : Metric.ball x (L*(L*J+1)*r) β range e) | |
| (q : ΞΉ β X) (Ο : ΞΉ β β) (hΟ : β i, 0 β€ Ο i) | |
| (hcross : Admissible (fun i => e β»ΒΉ' Metric.ball (q i) (2*r)) Ο) | |
| (n : β) (hn : 0 < n) | |
| (hmesh : β z : CannonGrid.Square, β i : Index (3*n), weight (3*n) z i β 0 β | |
| dist (e z) (e (vertex (3*n) (by omega) i)) < r) | |
| (a b : CannonGrid.Square) (ha : dist x (e a) β€ J*r) (hb : dist x (e b) β€ J*r) : | |
| let C := fun i => e β»ΒΉ' Metric.ball (q i) (2*r) | |
| |scalar C Ο n hn a-scalar C Ο n hn b| β€ | |
| β i β Finset.univ.filter (fun i => dist (q i) x β€ (L*(L*J+1)+3)*r), Ο i := by | |
| let C := fun i => e β»ΒΉ' Metric.ball (q i) (2*r) | |
| obtain β¨hrawI,_,_,hrawβ© := rawFunction_properties C Ο hΟ hcross | |
| exact CannonScalarLocal.local_oscillation e he L J r hL hJ hr hpaths x hchart q Ο hΟ | |
| (rawFunction C Ο) hrawI hraw (3*n) (by omega) hmesh topBand bottomBand | |
| topBand_pathConnected.nonempty bottomBand_pathConnected.nonempty a b ha hb | |
| end CannonApprox | |
| namespace CannonRectangle | |
| open CannonGrid CannonCells CannonBands | |
| abbrev Middle := Strip height (1/3) (2/3) | |
| def normalize (z : Middle) : CannonGrid.Square := | |
| (z.val.1, β¨3*(z.val.2:β)-1, by | |
| have hz := z.property | |
| change (z.val.2:β) β Icc (1/3:β) (2/3) at hz | |
| constructor <;> linarith [hz.1,hz.2]β©) | |
| lemma continuous_normalize : Continuous normalize := by | |
| unfold normalize | |
| fun_prop | |
| lemma normalize_injective : Function.Injective normalize := by | |
| intro x y h | |
| apply Subtype.ext | |
| apply Prod.ext | |
| Β· simpa only [normalize] using congrArg Prod.fst h | |
| Β· apply Subtype.ext | |
| have hh := congrArg (fun z : CannonGrid.Square => (z.2:β)) h | |
| change 3*(x.val.2:β)-1 = 3*(y.val.2:β)-1 at hh | |
| linarith | |
| def leftRight : Set (Set CannonGrid.Square) := | |
| {A | β u v : Middle, u.val.1 = 0 β§ v.val.1 = 1 β§ | |
| β p : Path u v, A = Subtype.val '' range p} | |
| def topBottom : Set (Set CannonGrid.Square) := | |
| {A | β u v : Middle, height u.val = 1/3 β§ height v.val = 2/3 β§ | |
| β p : Path u v, A = Subtype.val '' range p} | |
| lemma leftRight_nonempty : leftRight.Nonempty := by | |
| let u : Middle := β¨(0,β¨1/2,by norm_numβ©),by norm_num [height]β© | |
| let v : Middle := β¨(1,β¨1/2,by norm_numβ©),by norm_num [height]β© | |
| let : PathConnectedSpace Middle := strip_pathConnected _ _ (by norm_num) (by norm_num) (by norm_num) | |
| exact β¨Subtype.val '' range (PathConnectedSpace.somePath u v), | |
| u,v,rfl,rfl,PathConnectedSpace.somePath u v,rflβ© | |
| lemma leftRight_members_nonempty (A : Set CannonGrid.Square) (hA : A β leftRight) : | |
| A.Nonempty := by | |
| obtain β¨u,v,_,_,p,rflβ© := hA | |
| exact β¨(p 0).val,β¨p 0,β¨0,rflβ©,rflβ©β© | |
| lemma crossings_intersect (A : Set CannonGrid.Square) (hA : A β leftRight) | |
| (B : Set CannonGrid.Square) (hB : B β topBottom) : (A β© B).Nonempty := by | |
| obtain β¨u,v,hu,hv,p,rflβ© := hA | |
| obtain β¨w,z,hw,hz,q,rflβ© := hB | |
| have hp0 : (normalize (p 0)).1 = 0 := by simpa [normalize] using hu | |
| have hp1 : (normalize (p 1)).1 = 1 := by simpa [normalize] using hv | |
| have hq0 : (normalize (q.symm 0)).2 = 1 := by | |
| apply Subtype.ext | |
| change 3*((q.symm 0).val.2:β)-1 = 1 | |
| simpa only [Path.source] using show 3*(z.val.2:β)-1 = 1 by | |
| change (z.val.2:β) = 2/3 at hz | |
| linarith | |
| have hq1 : (normalize (q.symm 1)).2 = 0 := by | |
| apply Subtype.ext | |
| change 3*((q.symm 1).val.2:β)-1 = 0 | |
| simpa only [Path.target] using show 3*(w.val.2:β)-1 = 0 by | |
| change (w.val.2:β) = 1/3 at hw | |
| linarith | |
| obtain β¨s,t,hstβ© := CannonPlanar.paths_cross | |
| (continuous_normalize.comp p.continuous) (continuous_normalize.comp q.symm.continuous) | |
| hp0 hp1 hq0 hq1 | |
| have he := normalize_injective hst | |
| refine β¨(p s).val,β¨p s,β¨s,rflβ©,rflβ©,?_β© | |
| refine β¨q.symm t,?_,congrArg Subtype.val he.symmβ© | |
| exact (q.symm_range βΈ mem_range_self t) | |
| theorem exists_dual_weights {ΞΉ : Type*} [Fintype ΞΉ] | |
| (C : ΞΉ β Set CannonGrid.Square) (hcover : β x, β i, x β C i) : | |
| 0 < modulus C leftRight β§ β Ο : ΞΉ β β, (β i, 0 β€ Ο i) β§ | |
| CannonApprox.Admissible C Ο β§ (β i, (Ο i)^2) = (modulus C leftRight)β»ΒΉ := by | |
| obtain β¨hpos,_β© := modulus_minimum C hcover leftRight_nonempty leftRight_members_nonempty | |
| obtain β¨Ο,hΟ,heβ© := transverse_weights C hcover leftRight_nonempty | |
| leftRight_members_nonempty crossings_intersect | |
| obtain β¨hn,hadmβ© := (admissible_iff C topBottom Ο).mp hΟ | |
| refine β¨hpos,Ο,hn,?_,?_β© | |
| Β· intro u hu v hv p | |
| rw [cost_preimage_image] | |
| exact hadm _ β¨u,v,hu,hv,p,rflβ© | |
| Β· simpa only [EuclideanSpace.real_norm_sq_eq] using he | |
| end CannonRectangle | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end OAI | |