cfahlgren1/math / lean /OAI /Analysis /HenonEmden /RadialCalculus.lean
cfahlgren1's picture
download
raw
7.22 kB
import OAI.Analysis.HenonEmden.WeakForm
namespace OAI
universe uE uE2 uE3
section RadialCalculus
open Set Filter Topology MeasureTheory
open scoped ContDiff
open Set Filter Topology
open scoped RealInnerProductSpace ContDiff
namespace HenonLaneEmden.RadialCalculus
variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
lemma hasFDerivAt_profile_norm_sq {h : ℝ → ℝ} {h' : ℝ} {x : E}
(hh : HasDerivAt h h' (‖x‖^2)) :
HasFDerivAt (fun y : E => h (‖y‖^2)) ((2*h') • innerSL ℝ x) x := by
have hc : HasFDerivAt (fun y : E => h (‖y‖^2))
(h' • (2 • innerSL ℝ x)) x :=
hh.comp_hasFDerivAt x (hasStrictFDerivAt_norm_sq x).hasFDerivAt
have heq : h' • (2 • innerSL ℝ x) = (2*h') • innerSL ℝ x := by
ext v
simp only [smul_apply, smul_eq_mul]
ring
rw [heq] at hc
exact hc
lemma fderiv_profile_norm_sq {h : ℝ → ℝ} {h' : ℝ → ℝ}
(hh : ∀ r, HasDerivAt h (h' r) r) :
fderiv ℝ (fun x : E => h (‖x‖^2)) = fun x => (2*h' (‖x‖^2)) • innerSL ℝ x := by
funext x
exact (hasFDerivAt_profile_norm_sq (x := x) (hh _)).fderiv
lemma second_profile_norm_sq {h h' : ℝ → ℝ} {h'' : ℝ} {x : E}
(hh : ∀ r, HasDerivAt h (h' r) r) (hh' : HasDerivAt h' h'' (‖x‖^2)) (e : E) :
iteratedFDeriv ℝ 2 (fun y : E => h (‖y‖^2)) x ![e,e] =
4*h''*⟪x,e⟫^2+2*h' (‖x‖^2)*‖e‖^2 := by
rw [← bilinearIteratedFDerivTwo_eq_iteratedFDeriv]
unfold bilinearIteratedFDerivTwo
rw [fderiv_profile_norm_sq hh]
have hd := ((hasFDerivAt_profile_norm_sq hh').const_mul 2).smul
(innerSL ℝ (E := E)).hasFDerivAt
change HasFDerivAt (fun y : E => (2*h' (‖y‖^2)) • innerSL ℝ y) _ x at hd
rw [hd.fderiv]
simp [ContinuousLinearMap.smulRight_apply]
change 2*h' (‖x‖^2)*⟪e,e⟫ + (2*(2*h''*⟪x,e⟫))*⟪x,e⟫ = _
rw [real_inner_self_eq_norm_sq]
ring
variable [FiniteDimensional ℝ E]
lemma laplacian_profile_norm_sq {h h' : ℝ → ℝ} {h'' : ℝ} (x : E)
(hh : ∀ r, HasDerivAt h (h' r) r) (hh' : HasDerivAt h' h'' (‖x‖^2)) :
Laplacian.laplacian (fun y : E => h (‖y‖^2)) x =
4*‖x‖^2*h''+2*(Module.finrank ℝ E : ℝ)*h' (‖x‖^2) := by
rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis]
simp_rw [second_profile_norm_sq hh hh', (stdOrthonormalBasis ℝ E).norm_eq_one, one_pow,
mul_one, Finset.sum_add_distrib, ← Finset.mul_sum]
have hsum : (∑ i, ⟪x,stdOrthonormalBasis ℝ E i⟫^2) = ‖x‖^2 := by
simpa only [Real.norm_eq_abs, sq_abs] using (stdOrthonormalBasis ℝ E).sum_sq_norm_inner_left x
rw [hsum]
simp
ring
end HenonLaneEmden.RadialCalculus
namespace HenonLaneEmden.RadialCalculus
variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
lemma hasFDerivAt_norm_real {x : E} (hx : x ≠ 0) :
HasFDerivAt (fun y : E => ‖y‖) (‖x‖⁻¹ • innerSL ℝ x) x := by
have hd := (hasStrictFDerivAt_norm_sq x).hasFDerivAt.sqrt (pow_ne_zero 2 (norm_ne_zero_iff.mpr hx))
simp only [Real.sqrt_sq (norm_nonneg _)] at hd
refine hd.congr_fderiv ?_
ext v
simp only [smul_apply, smul_eq_mul]
field_simp
ring
lemma hasFDerivAt_profile_norm {h : ℝ → ℝ} {h' : ℝ} {x : E}
(hx : x ≠ 0) (hh : HasDerivAt h h' ‖x‖) :
HasFDerivAt (fun y : E => h ‖y‖) ((h'/‖x‖) • innerSL ℝ x) x := by
have hd := hh.comp_hasFDerivAt x (hasFDerivAt_norm_real hx)
convert! hd using 1
ext v
simp only [smul_apply, smul_eq_mul]
ring
lemma second_profile_norm {h h' : ℝ → ℝ} {h'' : ℝ} {x : E}
(hx : x ≠ 0) (hh : ∀ r > 0, HasDerivAt h (h' r) r)
(hh' : HasDerivAt h' h'' ‖x‖) (e : E) :
iteratedFDeriv ℝ 2 (fun y : E => h ‖y‖) x ![e,e] =
((h''*‖x‖-h' ‖x‖)/‖x‖^3)*⟪x,e⟫^2+(h' ‖x‖/‖x‖)*‖e‖^2 := by
have hr : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx
have heq : fderiv ℝ (fun y : E => h ‖y‖) =ᶠ[𝓝 x]
(fun y => (h' ‖y‖ / ‖y‖) • innerSL ℝ y) := by
filter_upwards [isOpen_compl_singleton.mem_nhds hx] with y hy
exact (hasFDerivAt_profile_norm hy (hh _ (norm_pos_iff.mpr hy))).fderiv
have hc := hasFDerivAt_profile_norm hx (hh'.div (hasDerivAt_id _) hr)
have hd := hc.smul (innerSL ℝ (E := E)).hasFDerivAt
change HasFDerivAt (fun y : E => (h' ‖y‖ / ‖y‖) • innerSL ℝ y) _ x at hd
rw [← bilinearIteratedFDerivTwo_eq_iteratedFDeriv]
unfold bilinearIteratedFDerivTwo
rw [heq.fderiv_eq, hd.fderiv]
simp [ContinuousLinearMap.smulRight_apply]
change h' ‖x‖ / ‖x‖ * ⟪e,e⟫ +
((h''*‖x‖-h' ‖x‖)/‖x‖^2/‖x‖*⟪x,e⟫)*⟪x,e⟫ = _
rw [real_inner_self_eq_norm_sq]
field_simp
ring
variable [FiniteDimensional ℝ E]
lemma laplacian_profile_norm {h h' : ℝ → ℝ} {h'' : ℝ} {x : E}
(hx : x ≠ 0) (hh : ∀ r > 0, HasDerivAt h (h' r) r)
(hh' : HasDerivAt h' h'' ‖x‖) :
Laplacian.laplacian (fun y : E => h ‖y‖) x =
h''+((Module.finrank ℝ E:ℝ)-1)/‖x‖*h' ‖x‖ := by
rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis]
simp_rw [second_profile_norm hx hh hh', (stdOrthonormalBasis ℝ E).norm_eq_one,
one_pow, mul_one, Finset.sum_add_distrib, ← Finset.mul_sum]
have hsum : (∑ i, ⟪x,stdOrthonormalBasis ℝ E i⟫^2) = ‖x‖^2 := by
simpa only [Real.norm_eq_abs, sq_abs] using (stdOrthonormalBasis ℝ E).sum_sq_norm_inner_left x
rw [hsum]
simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]
field_simp [norm_ne_zero_iff.mpr hx]
ring
end HenonLaneEmden.RadialCalculus
open Set Filter Topology
open scoped ContDiff
namespace HenonLaneEmden.RadialCalculus
variable {E : Type uE3} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
omit [InnerProductSpace ℝ E] in
lemma radial_tsupport {h : ℝ → ℝ} :
tsupport (fun x : E => h ‖x‖) ⊆ (fun x : E => ‖x‖) ⁻¹' tsupport h :=
tsupport_comp_subset_preimage h continuous_norm
omit [InnerProductSpace ℝ E] in
lemma radial_tsupport_off_origin {h : ℝ → ℝ} (hs : tsupport h ⊆ Ioi 0) :
tsupport (fun x : E => h ‖x‖) ⊆ ({0}ᶜ : Set E) := by
intro x hx
have hpos := hs (radial_tsupport hx)
exact norm_pos_iff.mp hpos
lemma radial_contDiff {h : ℝ → ℝ} {k : ℕ∞ω}
(hh : ContDiff ℝ k h) (hs : tsupport h ⊆ Ioi 0) :
ContDiff ℝ k (fun x : E => h ‖x‖) := by
rw [contDiff_iff_contDiffAt]
intro x
by_cases hx : x = 0
· have hn : x ∉ tsupport (fun y : E => h ‖y‖) := by
intro hy
exact radial_tsupport_off_origin hs hy hx
exact contDiffAt_const.congr_of_eventuallyEq (notMem_tsupport_iff_eventuallyEq.mp hn)
· exact hh.contDiffAt.comp x (contDiffAt_norm ℝ hx)
variable [FiniteDimensional ℝ E]
lemma radial_compactSupport {h : ℝ → ℝ} (hh : HasCompactSupport h) :
HasCompactSupport (fun x : E => h ‖x‖) := by
obtain ⟨R,hR⟩ := hh.isBounded.exists_norm_le
apply (isCompact_closedBall (0:E) R).of_isClosed_subset (isClosed_tsupport _)
intro x hx
simpa [Metric.mem_closedBall, dist_zero_right] using hR ‖x‖ (radial_tsupport hx)
end HenonLaneEmden.RadialCalculus
end RadialCalculus
end OAI

Xet Storage Details

Size:
7.22 kB
·
Xet hash:
6479834cabe8cdf95607da3918991b588eeb7b1ddca0280631220226026a106a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.