Download data/lean/OAI/MeasureTheory/FalconerCompletion/Sphere/SphereChartScale.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.13 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MeasureTheory/FalconerCompletion/Sphere/SphereChartScale.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MeasureTheory/FalconerCompletion/Sphere/SphereChartScale.lean
-
curl -L -o SphereChartScale.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MeasureTheory/FalconerCompletion/Sphere/SphereChartScale.lean
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 | |