math / data /lean /OAI /MeasureTheory /Falconer /Shells /DistanceLinearization.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.43 kB
import OAI.MeasureTheory.Falconer.Geometry.DyadicCube
import Mathlib.Analysis.InnerProductSpace.Basic
namespace OAI
/-! # The actual distance Taylor error for the suffix reduction
The error estimate is dimension independent before insertion of the cube
diameter. Its proof is the exact squared-norm identity, so no differentiable
extension across the diagonal is needed.
-/
namespace Falconer
open Set
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
theorem norm_linearization_bounds (u v : E) (hu : 0 < β€–uβ€–) :
0 ≀ β€–vβ€–-inner ℝ (β€–u‖⁻¹ β€’ u) v ∧
β€–vβ€–-inner ℝ (β€–u‖⁻¹ β€’ u) v ≀ β€–v-uβ€–^2/(2*β€–uβ€–) := by
have hi : inner ℝ (β€–u‖⁻¹ β€’ u) v = inner ℝ u v/β€–uβ€– := by
rw [real_inner_smul_left]
ring
rw [hi]
have hb : inner ℝ u v/β€–uβ€– ≀ β€–vβ€– := by
apply (div_le_iffβ‚€ hu).mpr
exact (real_inner_le_norm u v).trans_eq (mul_comm _ _)
have he : 2*β€–uβ€–*(β€–vβ€–-inner ℝ u v/β€–uβ€–) =
β€–v-uβ€–^2-(β€–vβ€–-β€–uβ€–)^2 := by
have hs := norm_sub_sq_real v u
rw [real_inner_comm u v] at hs
field_simp
nlinarith
refine ⟨sub_nonneg.mpr hb,?_⟩
apply (le_div_iffβ‚€ (mul_pos (by norm_num) hu)).mpr
nlinarith [sq_nonneg (β€–vβ€–-β€–uβ€–)]
theorem norm_linearization_abs_le (u v : E) (hu : 0 < β€–uβ€–) :
|β€–vβ€–-inner ℝ (β€–u‖⁻¹ β€’ u) v| ≀ β€–v-uβ€–^2/(2*β€–uβ€–) := by
rw [abs_of_nonneg (norm_linearization_bounds u v hu).1]
exact (norm_linearization_bounds u v hu).2
omit [InnerProductSpace ℝ E] in
theorem pair_displacement_bound (x y c₁ cβ‚‚ : E) {δ₁ Ξ΄β‚‚ : ℝ}
(h₁ : β€–x-c₁‖ ≀ δ₁) (hβ‚‚ : β€–y-cβ‚‚β€– ≀ Ξ΄β‚‚) :
β€–(x-y)-(c₁-cβ‚‚)β€– ≀ δ₁+Ξ΄β‚‚ := by
have he : (x-y)-(c₁-cβ‚‚) = (x-c₁)-(y-cβ‚‚) := by abel
rw [he]
exact (norm_sub_le _ _).trans (add_le_add h₁ hβ‚‚)
/-- Original distances on a pair of small cubes have the required
quadratic error relative to their center direction. -/
theorem DyadicCube.distance_linearization {d : β„•} (P Q : DyadicCube d)
(hP : 0 < P.side) (hQ : Q.side = P.side)
{g : ℝ} (hg : 0 < g) (hsep : g ≀ β€–P.center-Q.centerβ€–)
{x y : Space d} (hx : x ∈ P.carrier) (hy : y ∈ Q.carrier) :
|dist x y-inner ℝ (β€–P.center-Q.center‖⁻¹ β€’ (P.center-Q.center)) (x-y)| ≀
2*(d:ℝ)*P.side^2/g := by
have hQp : 0 < Q.side := by rw [hQ]; exact hP
have hΞ΄ : β€–(x-y)-(P.center-Q.center)β€– ≀ 2*Real.sqrt d*P.side := by
have h₁ := P.dist_le hP.le hx (P.center_mem hP)
have hβ‚‚ := Q.dist_le hQp.le hy (Q.center_mem hQp)
rw [hQ] at hβ‚‚
simpa only [dist_eq_norm,two_mul,mul_add,add_mul] using
pair_displacement_bound x y P.center Q.center h₁ hβ‚‚
have hsquare : β€–(x-y)-(P.center-Q.center)β€–^2 ≀ 4*(d:ℝ)*P.side^2 := by
have hh := (sq_le_sqβ‚€ (norm_nonneg _) (by positivity)).mpr hΞ΄
nlinarith [Real.sq_sqrt (Nat.cast_nonneg (Ξ± := ℝ) d)]
have hnorm : 0 < β€–P.center-Q.centerβ€– := hg.trans_le hsep
rw [dist_eq_norm]
apply (norm_linearization_abs_le _ _ hnorm).trans
calc
_ ≀ (4*(d:ℝ)*P.side^2)/(2*β€–P.center-Q.centerβ€–) :=
div_le_div_of_nonneg_right hsquare (by positivity)
_ ≀ (4*(d:ℝ)*P.side^2)/(2*g) :=
div_le_div_of_nonneg_left (by positivity) (by positivity)
(mul_le_mul_of_nonneg_left hsep (by norm_num))
_ = _ := by ring
end Falconer
end OAI