math / data /lean /OAI /MeasureTheory /FalconerCompletion /Sphere /SphereChartScale.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
8.13 kB
import Mathlib
import OAI.MeasureTheory.FalconerCompletion.Graphs.SharedBinSupportCollision
namespace OAI
/-! Canonical spherical measures and differential identities. -/
section
section
open Set MeasureTheory
open scoped ComplexConjugate RealInnerProductSpace
namespace GraphLiteralSupport
namespace Attempt4FullFar
open MeasureTheory Set Metric Module
open scoped RealInnerProductSpace Topology ENNReal Pointwise
variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V]
noncomputable def sphereChartScaleND (u : V) : ℝ := Real.sqrt (1-β€–uβ€–^2/4)
noncomputable def sphereChartND (u : V) : WithLp 2 (V Γ— ℝ) :=
WithLp.toLp 2 (sphereChartScaleND u β€’ u, 1-β€–uβ€–^2/2)
omit [InnerProductSpace ℝ V] in
lemma sphereChartScaleND_pos {u : V} (hu : β€–uβ€– < 2) :
0 < sphereChartScaleND u := by
apply Real.sqrt_pos.mpr
nlinarith [norm_nonneg u]
omit [InnerProductSpace ℝ V] in
lemma sphereChartScaleND_sq {u : V} (hu : β€–uβ€– ≀ 2) :
sphereChartScaleND u ^ 2 = 1-β€–uβ€–^2/4 := by
apply Real.sq_sqrt
nlinarith [norm_nonneg u]
lemma sphereChartND_norm {u : V} (hu : β€–uβ€– ≀ 2) :
β€–sphereChartND uβ€– = 1 := by
have hs : 0 ≀ sphereChartScaleND u := Real.sqrt_nonneg _
have he : β€–sphereChartND uβ€–^2 = 1 := by
rw [sphereChartND, WithLp.prod_norm_sq_eq_of_L2]
change β€–sphereChartScaleND u β€’ uβ€–^2 + β€–(1-β€–uβ€–^2/2:ℝ)β€–^2 = 1
simp only [norm_smul, Real.norm_eq_abs, mul_pow, sq_abs]
rw [sphereChartScaleND_sq hu]
ring
nlinarith [norm_nonneg (sphereChartND u)]
lemma sphereChartND_mem_sphere {u : V} (hu : β€–uβ€– ≀ 2) :
sphereChartND u ∈ sphere (0 : WithLp 2 (V Γ— ℝ)) 1 := by
simpa only [mem_sphere, dist_zero_right] using sphereChartND_norm hu
lemma sphereChartND_phase (u : V) :
inner ℝ (sphereChartND u) (WithLp.toLp 2 (0, (1:ℝ))) = 1-β€–uβ€–^2/2 := by
simp [sphereChartND,WithLp.prod_inner_apply]
lemma sphereChartND_north : sphereChartND (0:V) = WithLp.toLp 2 (0,(1:ℝ)) := by
simp [sphereChartND]
lemma sphereChartND_snd_gt_neg_one {u : V} (hu : β€–uβ€– < 2) :
-1 < (WithLp.ofLp (sphereChartND u)).2 := by
change -1 < 1-β€–uβ€–^2/2
nlinarith [norm_nonneg u]
noncomputable def sphereChartInvND (w : WithLp 2 (V Γ— ℝ)) : V :=
(Real.sqrt ((1+(WithLp.ofLp w).2)/2))⁻¹ β€’ (WithLp.ofLp w).1
lemma sphereChartND_left_inv {u : V} (hu : β€–uβ€– < 2) :
sphereChartInvND (sphereChartND u) = u := by
have hs : sphereChartScaleND u β‰  0 := (sphereChartScaleND_pos hu).ne'
have he : (1+(1-β€–uβ€–^2/2))/2 = 1-β€–uβ€–^2/4 := by ring
simp only [sphereChartInvND, sphereChartND, WithLp.ofLp_toLp, he]
change (sphereChartScaleND u)⁻¹ β€’ (sphereChartScaleND u β€’ u) = u
rw [← mul_smul, inv_mul_cancelβ‚€ hs, one_smul]
lemma sphereChartND_injOn : InjOn (sphereChartND : V β†’ WithLp 2 (V Γ— ℝ)) (ball 0 2) := by
intro u hu v hv he
have hu' : β€–uβ€– < 2 := by simpa using hu
have hv' : β€–vβ€– < 2 := by simpa using hv
have := congrArg sphereChartInvND he
simpa [sphereChartND_left_inv hu', sphereChartND_left_inv hv'] using this
lemma sphereChartInvND_norm_sq {w : WithLp 2 (V Γ— ℝ)} (hw : β€–wβ€– = 1)
(ht : -1 < (WithLp.ofLp w).2) :
β€–sphereChartInvND wβ€–^2 = 2*(1-(WithLp.ofLp w).2) := by
have hp : 0 < (1+(WithLp.ofLp w).2)/2 := by linarith
have hs : Real.sqrt ((1+(WithLp.ofLp w).2)/2)^2 = (1+(WithLp.ofLp w).2)/2 :=
Real.sq_sqrt hp.le
have hn : β€–(WithLp.ofLp w).1β€–^2 + ((WithLp.ofLp w).2)^2 = 1 := by
have he := WithLp.prod_norm_sq_eq_of_L2 w
rw [hw] at he
simpa [Real.norm_eq_abs, sq_abs] using he.symm
unfold sphereChartInvND
rw [norm_smul, Real.norm_eq_abs, mul_pow, sq_abs, inv_pow, hs]
field_simp [show 1+(WithLp.ofLp w).2 β‰  0 by linarith]
rw [div_eq_iff (show 1+(WithLp.ofLp w).2 β‰  0 by linarith)]
nlinarith [hn]
lemma sphereChartInvND_mem_ball {w : WithLp 2 (V Γ— ℝ)} (hw : β€–wβ€– = 1)
(ht : -1 < (WithLp.ofLp w).2) : sphereChartInvND w ∈ ball (0:V) 2 := by
have he := sphereChartInvND_norm_sq hw ht
rw [mem_ball, dist_zero_right]
nlinarith [norm_nonneg (sphereChartInvND w)]
lemma sphereChartND_right_inv {w : WithLp 2 (V Γ— ℝ)} (hw : β€–wβ€– = 1)
(ht : -1 < (WithLp.ofLp w).2) : sphereChartND (sphereChartInvND w) = w := by
have he := sphereChartInvND_norm_sq hw ht
have hp : 0 < (1+(WithLp.ofLp w).2)/2 := by linarith
have hs : Real.sqrt ((1+(WithLp.ofLp w).2)/2) β‰  0 := (Real.sqrt_pos.mpr hp).ne'
have hscale : sphereChartScaleND (sphereChartInvND w) =
Real.sqrt ((1+(WithLp.ofLp w).2)/2) := by
unfold sphereChartScaleND
rw [he]
congr 1
ring
apply WithLp.ofLp_injective 2
apply Prod.ext
Β· change sphereChartScaleND (sphereChartInvND w) β€’ sphereChartInvND w = (WithLp.ofLp w).1
rw [hscale, sphereChartInvND, ← mul_smul, mul_inv_cancelβ‚€ hs, one_smul]
Β· change 1-β€–sphereChartInvND wβ€–^2/2 = (WithLp.ofLp w).2
rw [he]
ring
lemma sphereChartScaleND_contDiffOn :
ContDiffOn ℝ ⊀ (sphereChartScaleND : V β†’ ℝ) (ball 0 2) := by
apply ContDiffOn.sqrt
((contDiffOn_const.sub ((contDiff_norm_sq ℝ).contDiffOn.div_const 4)))
intro u hu
have hu' : β€–uβ€– < 2 := by simpa using hu
have : 0 < 1-β€–uβ€–^2/4 := by nlinarith [norm_nonneg u]
exact this.ne'
lemma sphereChartND_contDiffOn :
ContDiffOn ℝ ⊀ (sphereChartND : V β†’ WithLp 2 (V Γ— ℝ)) (ball 0 2) := by
exact (WithLp.prodContinuousLinearEquiv 2 ℝ V ℝ).symm.contDiff.comp_contDiffOn
((sphereChartScaleND_contDiffOn.smul contDiffOn_id).prodMk
(contDiffOn_const.sub ((contDiff_norm_sq ℝ).contDiffOn.div_const 2)))
lemma sphereChartScaleND_hasStrictFDerivAt {u : V} (hu : β€–uβ€– < 2) :
HasStrictFDerivAt sphereChartScaleND
((-1/(4*sphereChartScaleND u)) β€’ innerSL ℝ u) u := by
have hp : 0 < 1-β€–uβ€–^2/4 := by nlinarith [norm_nonneg u]
have hq : HasStrictFDerivAt (fun x : V => 1-β€–xβ€–^2/4)
((-(1/2:ℝ)) β€’ innerSL ℝ u) u := by
convert! ((hasStrictFDerivAt_norm_sq u).mul_const (1/4:ℝ)).const_sub 1 using 1
Β· funext x
ring
Β· apply ContinuousLinearMap.ext
intro v
simp only [smul_apply, neg_apply, smul_eq_mul]
ring
convert! hq.sqrt hp.ne' using 1
apply ContinuousLinearMap.ext
intro v
simp only [sphereChartScaleND, smul_apply, smul_eq_mul]
ring
noncomputable def sphereConeND (p : V Γ— ℝ) : V Γ— ℝ :=
(p.2 β€’ (sphereChartScaleND p.1 β€’ p.1), p.2 * (1-β€–p.1β€–^2/2))
noncomputable def sphereConeDerivND (p : V Γ— ℝ) : (V Γ— ℝ) β†’L[ℝ] (V Γ— ℝ) :=
let u := p.1
let r := p.2
let s := sphereChartScaleND u
let F := ContinuousLinearMap.fst ℝ V ℝ
let T := ContinuousLinearMap.snd ℝ V ℝ
let H := (innerSL ℝ u).comp F
((r*s) β€’ F + (s β€’ T - (r/(4*s)) β€’ H).smulRight u).prod
((1-β€–uβ€–^2/2) β€’ T - r β€’ H)
lemma sphereConeND_hasStrictFDerivAt {p : V Γ— ℝ} (hp : β€–p.1β€– < 2) :
HasStrictFDerivAt sphereConeND (sphereConeDerivND p) p := by
have hs := (sphereChartScaleND_hasStrictFDerivAt hp).comp p hasStrictFDerivAt_fst
have h₁ := hasStrictFDerivAt_snd.smul (hs.smul hasStrictFDerivAt_fst)
have hv : HasStrictFDerivAt (fun x : V => 1-β€–xβ€–^2/2) (-(innerSL ℝ p.1)) p.1 := by
convert! ((hasStrictFDerivAt_norm_sq p.1).mul_const (1/2:ℝ)).const_sub 1 using 1
Β· funext x
ring
Β· apply ContinuousLinearMap.ext
intro v
simp only [smul_apply, neg_apply, smul_eq_mul]
ring
have hβ‚‚ := (hasStrictFDerivAt_snd (π•œ := ℝ)).mul
(hv.comp p hasStrictFDerivAt_fst)
convert! h₁.prodMk hβ‚‚ using 1
apply ContinuousLinearMap.ext
intro z
apply Prod.ext
Β· simp [sphereConeDerivND, smul_add, sub_smul, smul_smul]; module
Β· simp [sphereConeDerivND]; ring
lemma sphereConeDerivND_apply (p z : V Γ— ℝ) :
sphereConeDerivND p z =
((p.2*sphereChartScaleND p.1) β€’ z.1 +
(sphereChartScaleND p.1*z.2-p.2/(4*sphereChartScaleND p.1)*inner ℝ p.1 z.1) β€’ p.1,
(1-β€–p.1β€–^2/2)*z.2-p.2*inner ℝ p.1 z.1) := by
simp [sphereConeDerivND]
end Attempt4FullFar
end GraphLiteralSupport
end
end
end OAI