math / data /lean /OAI /Geometry /Immersion /ClosedSurface /MeanDifferences.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
6.42 kB
import OAI.Geometry.Immersion.ClosedSurface.ModeDifferences
import OAI.Geometry.Immersion.ClosedSurface.MeanError
namespace OAI
noncomputable section
open Set Complex Bundle Manifold
open scoped ContDiff Matrix Topology Manifold BigOperators
namespace ClosedSurfaceR4.SmallModes
open ClosedSurfaceR4.WeightedEstimates
lemma gradientAmplitude_congr {n : β„•} (Ο„ : ℝ) {Z W : Field n} {p : Base}
(he : Z =αΆ [nhds p] W) (v : Base) : gradientAmplitude Ο„ Z v p = gradientAmplitude Ο„ W v p := by
simp only [gradientAmplitude, coordDeriv, he.fderiv_eq, he.self_of_nhds]
lemma gradientAmplitude_sub {n : β„•} (Ο„ : ℝ) {Z W : Field n} {p : Base}
(hZ : DifferentiableAt ℝ Z p) (hW : DifferentiableAt ℝ W p) (v : Base) :
gradientAmplitude Ο„ (fun p => Z p - W p) v p =
gradientAmplitude Ο„ Z v p - gradientAmplitude Ο„ W v p := by
rw [gradientAmplitude, partial_sub hZ hW]
ext i
simp only [gradientAmplitude, Pi.add_apply, Pi.sub_apply, Pi.smul_apply, smul_eq_mul]
ring
lemma gradientAmplitude_free_sub {n : β„•} (Ο„ : ℝ) {G V W : Field n} {U : Set Base}
(hG : ContDiff ℝ ∞ G) (h : ModeDomain G U)
(hV : ContDiffOn ℝ ∞ V U) (hW : ContDiffOn ℝ ∞ W U) (q : β„•) (v : Base) :
EqOn (gradientAmplitude Ο„ (modeApprox Ο„ G (fun p => V p - W p) (fun _ => 0) q) v)
(fun p => gradientAmplitude Ο„ (modeApprox Ο„ G V (fun _ => 0) q) v p -
gradientAmplitude Ο„ (modeApprox Ο„ G W (fun _ => 0) q) v p) U := by
have he := modeApprox_sub Ο„ hG h hV hW (f := fun _ => 0) (g := fun _ => 0)
contDiffOn_const contDiffOn_const q
simp only [sub_self] at he
have hZ := contDiffOn_modeApprox Ο„ h hV (f := fun _ => 0) contDiffOn_const q
have hY := contDiffOn_modeApprox Ο„ h hW (f := fun _ => 0) contDiffOn_const q
intro p hp
have hee := Filter.Eventually.mono (h.isOpen.mem_nhds hp) (fun z hz => he hz)
rw [gradientAmplitude_congr Ο„ hee,
gradientAmplitude_sub Ο„ (((hZ p hp).contDiffAt (h.isOpen.mem_nhds hp)).differentiableAt (by simp))
(((hY p hp).contDiffAt (h.isOpen.mem_nhds hp)).differentiableAt (by simp))]
lemma leadingDerivative_sub {n : β„•} (Ο„ : ℝ) (V W : Field n) (v : Base) (p : Base) :
leadingDerivative Ο„ (fun p => V p - W p) v p =
leadingDerivative Ο„ V v p - leadingDerivative Ο„ W v p := by
simp only [leadingDerivative, smul_sub]
lemma contDiffOn_modeMeanError {n : β„•} (Ο„ : ℝ) {G V W : Field n} {U : Set Base}
(h : ModeDomain G U) (hV : ContDiffOn ℝ ∞ V U) (hW : ContDiffOn ℝ ∞ W U)
(q : β„•) (v w : Base) : ContDiffOn ℝ ∞ (modeMeanError Ο„ G V W q v w) U := by
have hZ := contDiffOn_gradientAmplitude h.isOpen
(contDiffOn_modeApprox Ο„ h hV (f := fun _ => 0) contDiffOn_const q) Ο„ v
have hY := contDiffOn_gradientAmplitude h.isOpen
(contDiffOn_modeApprox Ο„ h hW (f := fun _ => 0) contDiffOn_const q) Ο„ w
exact (ClosedSurfaceR4.QuadraticMean.contDiffOn_zeroPair hZ hY).sub
(ClosedSurfaceR4.QuadraticMean.contDiffOn_zeroPair
(contDiffOn_leadingDerivative Ο„ hV v) (contDiffOn_leadingDerivative Ο„ hW w))
lemma modeMeanError_sub_left {n : β„•} (Ο„ : ℝ) {G V W Z : Field n} {U : Set Base}
(hG : ContDiff ℝ ∞ G) (h : ModeDomain G U)
(hV : ContDiffOn ℝ ∞ V U) (hW : ContDiffOn ℝ ∞ W U) (q : β„•) (v w : Base) :
EqOn (modeMeanError Ο„ G (fun p => V p - W p) Z q v w)
(fun p => modeMeanError Ο„ G V Z q v w p - modeMeanError Ο„ G W Z q v w p) U := by
intro p hp
unfold modeMeanError
rw [gradientAmplitude_free_sub Ο„ hG h hV hW q v hp, leadingDerivative_sub,
ClosedSurfaceR4.QuadraticMean.zeroPair_sub_left,
ClosedSurfaceR4.QuadraticMean.zeroPair_sub_left]
ring
lemma modeMeanError_sub_right {n : β„•} (Ο„ : ℝ) {G V W Z : Field n} {U : Set Base}
(hG : ContDiff ℝ ∞ G) (h : ModeDomain G U)
(hV : ContDiffOn ℝ ∞ V U) (hW : ContDiffOn ℝ ∞ W U) (q : β„•) (v w : Base) :
EqOn (modeMeanError Ο„ G Z (fun p => V p - W p) q v w)
(fun p => modeMeanError Ο„ G Z V q v w p - modeMeanError Ο„ G Z W q v w p) U := by
intro p hp
unfold modeMeanError
rw [gradientAmplitude_free_sub Ο„ hG h hV hW q w hp, leadingDerivative_sub,
ClosedSurfaceR4.QuadraticMean.zeroPair_sub_right,
ClosedSurfaceR4.QuadraticMean.zeroPair_sub_right]
ring
lemma modeMeanError_difference {n : β„•} (Ο„ : ℝ) {G V W : Field n} {U : Set Base}
(hG : ContDiff ℝ ∞ G) (h : ModeDomain G U)
(hV : ContDiffOn ℝ ∞ V U) (hW : ContDiffOn ℝ ∞ W U) (q : β„•) (v w : Base) :
EqOn (fun p => modeMeanError Ο„ G V V q v w p - modeMeanError Ο„ G W W q v w p)
(fun p => modeMeanError Ο„ G (fun p => V p - W p) V q v w p +
modeMeanError Ο„ G W (fun p => V p - W p) q v w p) U := by
intro p hp
dsimp only
rw [modeMeanError_sub_left Ο„ hG h hV hW q v w hp,
modeMeanError_sub_right Ο„ hG h hV hW q v w hp]
ring
theorem weighted_modeMeanError_difference {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) C W)
(hbDiff : WeightedBound U s (m + q + 2) D (fun p => V p - W p))
(v w : Base) (hv : β€–vβ€– ≀ 1) (hw : β€–wβ€– ≀ 1) :
WeightedBound U s m (2 * meanErrorConstant n m K q * (C * D / (s * Ο„)))
(fun p => modeMeanError Ο„ G V V q v w p - modeMeanError Ο„ G W W q v w p) := by
have h1 := weighted_modeMeanError hΟ„ hG h hs hΟ„s hs1 hK hD hC (hV.sub hW) hV q m
hc hbDiff hbV v w hv hw
have h2 := weighted_modeMeanError hΟ„ hG h hs hΟ„s hs1 hK hC hD hW (hV.sub hW) q m
hc hbW hbDiff v w hv hw
have hh := h1.add h.isOpen.uniqueDiffOn hs.le
(contDiffOn_modeMeanError Ο„ h (hV.smooth.sub hW.smooth) hV.smooth q v w)
(contDiffOn_modeMeanError Ο„ h hW.smooth (hV.smooth.sub hW.smooth) q v w) h2
have he : meanErrorConstant n m K q * (D * C / (s * Ο„)) +
meanErrorConstant n m K q * (C * D / (s * Ο„)) =
2 * meanErrorConstant n m K q * (C * D / (s * Ο„)) := by ring
rw [he] at hh
exact hh.congr (modeMeanError_difference Ο„ hG h hV.smooth hW.smooth q v w)
end ClosedSurfaceR4.SmallModes
end
end OAI