Download data/lean/OAI/Geometry/Immersion/ClosedSurface/MeanError.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/Immersion/ClosedSurface/MeanError.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/Immersion/ClosedSurface/MeanError.lean
-
curl -L -o MeanError.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/Immersion/ClosedSurface/MeanError.lean
7 kB
| import OAI.Geometry.Immersion.ClosedSurface.GradientBounds | |
| import OAI.Geometry.Immersion.ClosedSurface.QuadraticError | |
| namespace OAI | |
| noncomputable section | |
| open Set Complex Bundle Manifold | |
| open scoped ContDiff Matrix Topology Manifold BigOperators | |
| namespace ClosedSurfaceR4.SmallModes | |
| open ClosedSurfaceR4.WeightedEstimates | |
| structure FreeCoefficient {n : β} (G : Field n) (U : Set Base) (V : Field n) : Prop where | |
| smooth : ContDiffOn β β V U | |
| perpX : β p β U, coordDeriv dx G p β¬α΅₯ V p = 0 | |
| perpY : β p β U, coordDeriv dy G p β¬α΅₯ V p = 0 | |
| perpSecond : β p β U, goodSecond G p β¬α΅₯ V p = 0 | |
| lemma FreeCoefficient.sub {n : β} {G V W : Field n} {U : Set Base} | |
| (hV : FreeCoefficient G U V) (hW : FreeCoefficient G U W) : | |
| FreeCoefficient G U (fun p => V p - W p) := by | |
| refine β¨hV.smooth.sub hW.smooth, ?_, ?_, ?_β© | |
| Β· intro p hp; simp [dotProduct_sub, hV.perpX p hp, hW.perpX p hp] | |
| Β· intro p hp; simp [dotProduct_sub, hV.perpY p hp, hW.perpY p hp] | |
| Β· intro p hp; simp [dotProduct_sub, hV.perpSecond p hp, hW.perpSecond p hp] | |
| def leadingDerivative {n : β} (Ο : β) (V : Field n) (v : Base) : Field n := | |
| fun p => (Complex.I / (Ο : β) * (v.1 : β)) β’ V p | |
| lemma contDiffOn_leadingDerivative {n : β} (Ο : β) {V : Field n} {U : Set Base} | |
| (hV : ContDiffOn β β V U) (v : Base) : | |
| ContDiffOn β β (leadingDerivative Ο V v) U := by | |
| unfold leadingDerivative | |
| simpa only [Pi.smul_def'] using | |
| (contDiffOn_const (c := Complex.I / (Ο : β) * (v.1 : β))).smul hV | |
| lemma weighted_leadingDerivative {n : β} {Ο : β} (hΟ : 0 < Ο) {V : Field n} | |
| {U : Set Base} (hU : UniqueDiffOn β U) {s C : β} {m : β} (hs : 0 < s) | |
| (hC : 0 β€ C) (hV : ContDiffOn β β V U) (hb : WeightedBound U s m C V) | |
| (v : Base) (hv : βvβ β€ 1) : WeightedBound U s m (C / Ο) (leadingDerivative Ο V v) := by | |
| have hh := hb.complex_smul_pi hU hs hC hV (Complex.I / (Ο : β) * (v.1 : β)) | |
| apply hh.mono_const | |
| have hn : βComplex.I / (Ο : β) * (v.1 : β)β β€ 1 / Ο := by | |
| rw [norm_mul, norm_div] | |
| simp only [Complex.norm_I, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hΟ] | |
| exact mul_le_of_le_one_right (div_nonneg zero_le_one hΟ.le) | |
| (by simpa only [Real.norm_eq_abs] using (norm_fst_le v).trans hv) | |
| simpa only [one_div, div_eq_mul_inv, mul_comm, mul_one] using mul_le_mul_of_nonneg_right hn hC | |
| lemma weighted_gradient_free {n : β} {Ο : β} (hΟ : 0 < Ο) {G V : Field n} | |
| (hG : ContDiff β β G) {U : Set Base} (h : ModeDomain G U) | |
| {s K C : β} (hs : 0 < s) (hΟs : Ο β€ s) (hs1 : s β€ 1) (hK : 0 β€ K) (hC : 0 β€ C) | |
| (hV : FreeCoefficient G U V) (q m : β) | |
| (hc : ReconstructionCoefficientBound G U s (m + q + 2) K) | |
| (hbV : WeightedBound U s (m + q + 2) C V) (v : Base) (hv : βvβ β€ 1) : | |
| WeightedBound U s m ((1 + gradientErrorConstant n m K q) * (C / Ο)) | |
| (gradientAmplitude Ο (modeApprox Ο G V (fun _ => 0) q) v) := by | |
| have he := weighted_gradientAmplitude_free_error hΟ hG h hs hΟs hs1 hK hC | |
| hV.smooth hV.perpX hV.perpY hV.perpSecond q m hc hbV v hv | |
| have hl := weighted_leadingDerivative hΟ h.isOpen.uniqueDiffOn hs hC hV.smooth | |
| (hbV.mono_order (show m β€ m + q + 2 by omega)) v hv | |
| have hE := (gradientErrorConstant_pos n m q hK).le | |
| have hZ := contDiffOn_modeApprox Ο h hV.smooth (f := fun _ => 0) contDiffOn_const q | |
| have hsZ := contDiffOn_gradientAmplitude h.isOpen hZ Ο v | |
| have hsL := contDiffOn_leadingDerivative Ο hV.smooth v | |
| have ha := he.add h.isOpen.uniqueDiffOn hs.le (hsZ.sub hsL) hsL hl | |
| have ha' := ha.congr (fun p _ => (sub_add_cancel _ _).symm) | |
| apply ha'.mono_const | |
| have hdiv : C / s β€ C / Ο := div_le_div_of_nonneg_left hC hΟ hΟs | |
| nlinarith [mul_le_mul_of_nonneg_left hdiv hE] | |
| def modeMeanError {n : β} (Ο : β) (G V W : Field n) (q : β) (v w : Base) : Base β β := | |
| fun p => ClosedSurfaceR4.QuadraticMean.zeroPair | |
| (gradientAmplitude Ο (modeApprox Ο G V (fun _ => 0) q) v p) | |
| (gradientAmplitude Ο (modeApprox Ο G W (fun _ => 0) q) w p) - | |
| ClosedSurfaceR4.QuadraticMean.zeroPair (leadingDerivative Ο V v p) (leadingDerivative Ο W w p) | |
| def meanErrorConstant (n m : β) (K : β) (q : β) : β := | |
| (n : β) * 2 ^ m * gradientErrorConstant n m K q * (2 + gradientErrorConstant n m K q) | |
| lemma meanErrorConstant_nonneg (n m q : β) {K : β} (hK : 0 β€ K) : | |
| 0 β€ meanErrorConstant n m K q := by | |
| have hE := (gradientErrorConstant_pos n m q hK).le | |
| unfold meanErrorConstant | |
| positivity | |
| theorem weighted_modeMeanError {n : β} {Ο : β} (hΟ : 0 < Ο) {G V W : Field n} | |
| (hG : ContDiff β β G) {U : Set Base} (h : ModeDomain G U) | |
| {s K C D : β} (hs : 0 < s) (hΟs : Ο β€ s) (hs1 : s β€ 1) | |
| (hK : 0 β€ K) (hC : 0 β€ C) (hD : 0 β€ D) | |
| (hV : FreeCoefficient G U V) (hW : FreeCoefficient G U W) (q m : β) | |
| (hc : ReconstructionCoefficientBound G U s (m + q + 2) K) | |
| (hbV : WeightedBound U s (m + q + 2) C V) | |
| (hbW : WeightedBound U s (m + q + 2) D W) | |
| (v w : Base) (hv : βvβ β€ 1) (hw : βwβ β€ 1) : | |
| WeightedBound U s m (meanErrorConstant n m K q * (C * D / (s * Ο))) | |
| (modeMeanError Ο G V W q v w) := by | |
| have hE := (gradientErrorConstant_pos n m q hK).le | |
| have hZV := contDiffOn_modeApprox Ο h hV.smooth (f := fun _ => 0) contDiffOn_const q | |
| have hZW := contDiffOn_modeApprox Ο h hW.smooth (f := fun _ => 0) contDiffOn_const q | |
| have hA := contDiffOn_leadingDerivative Ο hV.smooth v | |
| have hB := contDiffOn_leadingDerivative Ο hW.smooth w | |
| have hZ := contDiffOn_gradientAmplitude h.isOpen hZV Ο v | |
| have hY := contDiffOn_gradientAmplitude h.isOpen hZW Ο w | |
| have hbA := weighted_leadingDerivative hΟ h.isOpen.uniqueDiffOn hs hC hV.smooth | |
| (hbV.mono_order (show m β€ m + q + 2 by omega)) v hv | |
| have hbY := weighted_gradient_free hΟ hG h hs hΟs hs1 hK hD hW q m hc hbW w hw | |
| have heZ := weighted_gradientAmplitude_free_error hΟ hG h hs hΟs hs1 hK hC | |
| hV.smooth hV.perpX hV.perpY hV.perpSecond q m hc hbV v hv | |
| have heY := weighted_gradientAmplitude_free_error hΟ hG h hs hΟs hs1 hK hD | |
| hW.smooth hW.perpX hW.perpY hW.perpSecond q m hc hbW w hw | |
| have hnC : 0 β€ C / Ο := div_nonneg hC hΟ.le | |
| have hnD : 0 β€ (1 + gradientErrorConstant n m K q) * (D / Ο) := by positivity | |
| have hnE : 0 β€ gradientErrorConstant n m K q * (C / s) := by positivity | |
| have hnF : 0 β€ gradientErrorConstant n m K q * (D / s) := by positivity | |
| have hh := ClosedSurfaceR4.QuadraticMean.weighted_zeroPair_error h.isOpen.uniqueDiffOn hs | |
| hnC hnD hnE hnF hA hB hZ hY hbA hbY heZ heY | |
| have heq : (n : β) * 2 ^ m * | |
| (gradientErrorConstant n m K q * (C / s) * | |
| ((1 + gradientErrorConstant n m K q) * (D / Ο)) + | |
| C / Ο * (gradientErrorConstant n m K q * (D / s))) = | |
| meanErrorConstant n m K q * (C * D / (s * Ο)) := by | |
| unfold meanErrorConstant | |
| ring | |
| rw [heq] at hh | |
| exact hh | |
| end ClosedSurfaceR4.SmallModes | |
| end | |
| end OAI | |