Download data/lean/OAI/Analysis/HenonEmden/Gradients.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 26.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/HenonEmden/Gradients.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/HenonEmden/Gradients.lean
-
curl -L -o Gradients.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/HenonEmden/Gradients.lean
26.8 kB
| import OAI.Analysis.HenonEmden.CapMismatch | |
| namespace OAI | |
| universe uE uE2 uE3 uE4 uE5 uE6 | |
| section Gradients | |
| open Set Filter Topology MeasureTheory MeasureTheory.Measure | |
| open scoped RealInnerProductSpace ContDiff ENNReal Convolution Pointwise | |
| noncomputable section | |
| open HenonLaneEmden.RadialCalculus HenonLaneEmden.WeakPDE HenonLaneEmden.SphereCalculus | |
| namespace HenonLaneEmden.WeakPDE | |
| variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| noncomputable def kernelDir (e x : E) : β := | |
| (2-(Module.finrank β E:β))*βxβ^(-(Module.finrank β E:β))*βͺx,eβ« | |
| omit [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] in | |
| lemma hasFDerivAt_kernel {x : E} (hx : x β 0) : | |
| HasFDerivAt (fun y : E => βyβ^(2-(Module.finrank β E:β))) | |
| (((2-(Module.finrank β E:β))*βxβ^(-(Module.finrank β E:β))) β’ innerSL β x) x := by | |
| have hr := norm_pos_iff.mpr hx | |
| have hd := RadialCalculus.hasFDerivAt_profile_norm hx | |
| (Real.hasDerivAt_rpow_const (p := 2-(Module.finrank β E:β)) (Or.inl hr.ne')) | |
| convert hd using 1 | |
| congr 1 | |
| rw [mul_div_assoc] | |
| congr 1 | |
| calc | |
| _ = βxβ^(2-(Module.finrank β E:β)-1-1) := by congr 1; ring | |
| _ = _ := by rw [Real.rpow_sub hr,Real.rpow_one] | |
| omit [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] in | |
| lemma dir_kernel {e x : E} (hx : x β 0) : | |
| dir (fun y : E => βyβ^(2-(Module.finrank β E:β))) e x = kernelDir e x := by | |
| rw [dir,(hasFDerivAt_kernel hx).fderiv] | |
| rfl | |
| omit [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] in | |
| lemma kernelDir_bound (e x : E) : | |
| |kernelDir e x| β€ |2-(Module.finrank β E:β)| *βeβ*βxβ^(1-(Module.finrank β E:β)) := by | |
| by_cases hx : x = 0 | |
| Β· simp only [hx,kernelDir,inner_zero_left,mul_zero,abs_zero,norm_zero] | |
| positivity | |
| have hr := norm_pos_iff.mpr hx | |
| unfold kernelDir | |
| rw [abs_mul,abs_mul,abs_of_nonneg (Real.rpow_nonneg (norm_nonneg _) _)] | |
| have he : βxβ^(-(Module.finrank β E:β))*βxβ = βxβ^(1-(Module.finrank β E:β)) := by | |
| calc | |
| _ = βxβ^(-(Module.finrank β E:β)+1) := by rw [Real.rpow_add hr,Real.rpow_one] | |
| _ = _ := by congr 1; ring | |
| calc | |
| _ β€ (|2-(Module.finrank β E:β)| *βxβ^(-(Module.finrank β E:β)))*(βxβ*βeβ) := | |
| mul_le_mul_of_nonneg_left (abs_real_inner_le_norm x e) (by positivity) | |
| _ = |2-(Module.finrank β E:β)| *βeβ*(βxβ^(-(Module.finrank β E:β))*βxβ) := by ring | |
| _ = _ := by rw [he] | |
| lemma measurable_kernelDir (e : E) : Measurable (kernelDir e) := | |
| (measurable_const.mul (measurable_norm.pow_const _)).mul (by fun_prop) | |
| lemma locallyIntegrable_kernelDir (hn : 1 β€ Module.finrank β E) (e : E) : | |
| LocallyIntegrable (kernelDir e) := by | |
| apply locallyIntegrable_of_norm_le_rpow hn | |
| (Ξ± := (Module.finrank β E:β)-1) (C := |2-(Module.finrank β E:β)| *βeβ) (by linarith) | |
| ?_ (measurable_kernelDir e).aestronglyMeasurable | |
| apply Eventually.of_forall | |
| intro x | |
| simpa only [Real.norm_eq_abs,neg_sub] using kernelDir_bound e x | |
| lemma integral_kernel_dir_off_zero (hn : 1 β€ Module.finrank β E) {Ο : E β β} | |
| (hΟ : ContDiff β 2 Ο) (hc : HasCompactSupport Ο) (h0 : 0 β tsupport Ο) (e : E) : | |
| (β« x, βxβ^(2-(Module.finrank β E:β))*dir Ο e x) = -(β« x, kernelDir e x*Ο x) := by | |
| have hK := locallyIntegrable_newtonKernel hn | |
| have hdΟ : Continuous (dir Ο e) := (contDiffOn_univ.mp | |
| (contDiffOn_dir (k := 1) hΟ.contDiffOn isOpen_univ e)).continuous | |
| have hi := (locallyIntegrable_kernelDir hn e).integrable_smul_right_of_hasCompactSupport hΟ.continuous hc | |
| have heq : (fun x => dir (fun y : E => βyβ^(2-(Module.finrank β E:β))) e x*Ο x) = | |
| (fun x => kernelDir e x*Ο x) := by | |
| ext x | |
| by_cases hx : x = 0 | |
| Β· simp [hx,image_eq_zero_of_notMem_tsupport h0] | |
| Β· rw [dir_kernel hx] | |
| have hh := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable | |
| (ΞΌ := volume) (v := e) (f := fun x : E => βxβ^(2-(Module.finrank β E:β))) (g := Ο) | |
| (by change Integrable (fun x => dir (fun y : E => βyβ^(2-(Module.finrank β E:β))) e x*Ο x); rw [heq]; exact hi) | |
| (hK.integrable_smul_right_of_hasCompactSupport hdΟ (compactSupport_dir hc e)) | |
| (hK.integrable_smul_right_of_hasCompactSupport hΟ.continuous hc) | |
| (fun x hx => (hasFDerivAt_kernel (fun he => h0 (he βΈ hx))).differentiableAt) | |
| (fun x _ => hΟ.differentiable (by norm_num) x) | |
| change (β« x, βxβ^(2-(Module.finrank β E:β))*dir Ο e x) = -(β« x, dir (fun y : E => βyβ^(2-(Module.finrank β E:β))) e x*Ο x) at hh | |
| rwa [heq] at hh | |
| end HenonLaneEmden.WeakPDE | |
| namespace HenonLaneEmden.WeakPDE | |
| variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] | |
| lemma kernel_cutoff_derivative_tendsto_zero (hn : 1 β€ Module.finrank β E) {Ο : E β β} | |
| (hΟ : Continuous Ο) (hc : HasCompactSupport Ο) (ΞΎ : ContDiffBump (0:E)) (e : E) : | |
| Tendsto (fun R : β => β« x : E, βxβ^(2-(Module.finrank β E:β))*Ο x* | |
| (Rβ»ΒΉ*dir ΞΎ e (Rβ»ΒΉ β’ x))) (π[>] 0) (π 0) := by | |
| have hdΞΎ : Continuous (dir ΞΎ e) := (contDiffOn_univ.mp | |
| (contDiffOn_dir (k := 1) (ΞΎ.contDiff.of_le (by exact WithTop.coe_le_coe.mpr le_top)).contDiffOn isOpen_univ e)).continuous | |
| obtain β¨M,hMβ© := (compactSupport_dir ΞΎ.hasCompactSupport e).exists_bound_of_continuous hdΞΎ | |
| have hM0 : 0 β€ M := (norm_nonneg (dir ΞΎ e 0)).trans (hM 0) | |
| have hi : Integrable (fun x : E => βxβ^(1-(Module.finrank β E:β))*Ο x) := | |
| (locallyIntegrable_norm_power hn _ (by linarith)).integrable_smul_right_of_hasCompactSupport hΟ hc | |
| have hlim := tendsto_integral_filter_of_dominated_convergence | |
| (ΞΌ := volume) (l := π[>] (0:β)) | |
| (F := fun (R : β) (x : E) => βxβ^(2-(Module.finrank β E:β))*Ο x*(Rβ»ΒΉ*dir ΞΎ e (Rβ»ΒΉ β’ x))) | |
| (f := fun _ => (0:β)) (fun x => (M*ΞΎ.rOut)*ββxβ^(1-(Module.finrank β E:β))*Ο xβ) | |
| (Eventually.of_forall fun R => by | |
| exact (((measurable_norm.pow_const _).mul hΟ.measurable).mul | |
| (measurable_const.mul (hdΞΎ.measurable.comp (measurable_const.smul measurable_id)))).aestronglyMeasurable) | |
| ?_ (hi.norm.const_mul (M*ΞΎ.rOut)) ?_ | |
| Β· simpa only [integral_zero] using hlim | |
| Β· filter_upwards [self_mem_nhdsWithin] with R hR | |
| filter_upwards [ae_iff.mpr (show volume {x : E | Β¬ x β 0} = 0 by simp)] with x hx | |
| by_cases hd : dir ΞΎ e (Rβ»ΒΉ β’ x) = 0 | |
| Β· simp only [hd,mul_zero,norm_zero] | |
| exact mul_nonneg (mul_nonneg hM0 ΞΎ.rOut_pos.le) (norm_nonneg _) | |
| have hs := tsupport_dir_subset (ΞΎ : E β β) e (subset_tsupport _ hd) | |
| rw [ΞΎ.tsupport_eq] at hs | |
| have hnorm : Rβ»ΒΉ*βxβ β€ ΞΎ.rOut := by | |
| simpa only [Metric.mem_closedBall,dist_zero_right,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr (show 0 < R from hR))] using hs | |
| have hrx := norm_pos_iff.mpr hx | |
| have hb : Rβ»ΒΉ β€ ΞΎ.rOut/βxβ := (le_div_iffβ hrx).mpr hnorm | |
| have hh : |Rβ»ΒΉ*dir ΞΎ e (Rβ»ΒΉ β’ x)| β€ M*ΞΎ.rOut/βxβ := by | |
| rw [abs_mul,abs_of_pos (inv_pos.mpr hR)] | |
| have hm' : |dir ΞΎ e (Rβ»ΒΉ β’ x)| β€ M := by simpa only [Real.norm_eq_abs] using hM (Rβ»ΒΉ β’ x) | |
| calc | |
| _ β€ Rβ»ΒΉ*M := mul_le_mul_of_nonneg_left hm' (inv_pos.mpr hR).le | |
| _ β€ (ΞΎ.rOut/βxβ)*M := mul_le_mul_of_nonneg_right hb hM0 | |
| _ = _ := by ring | |
| rw [norm_mul,Real.norm_eq_abs (Rβ»ΒΉ*_),norm_mul,Real.norm_eq_abs (βxβ^_),abs_of_nonneg (Real.rpow_nonneg (norm_nonneg _) _)] | |
| apply (mul_le_mul_of_nonneg_left hh (mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) (norm_nonneg _))).trans_eq | |
| rw [norm_mul,Real.norm_eq_abs (βxβ^_),abs_of_nonneg (Real.rpow_nonneg (norm_nonneg _) _)] | |
| have he : βxβ^(2-(Module.finrank β E:β))/βxβ = βxβ^(1-(Module.finrank β E:β)) := by | |
| calc | |
| _ = βxβ^(2-(Module.finrank β E:β)-1) := by rw [Real.rpow_sub hrx (2-(Module.finrank β E:β)) 1,Real.rpow_one] | |
| _ = _ := by congr 1; ring | |
| calc | |
| _ = (M*ΞΎ.rOut)*(βxβ^(2-(Module.finrank β E:β))/βxβ)*βΟ xβ := by ring | |
| _ = _ := by rw [he]; ring | |
| Β· filter_upwards [ae_iff.mpr (show volume {x : E | Β¬ x β 0} = 0 by simp)] with x hx | |
| have he : 0 < βxβ/ΞΎ.rOut := div_pos (norm_pos_iff.mpr hx) ΞΎ.rOut_pos | |
| apply tendsto_const_nhds.congr' | |
| filter_upwards [self_mem_nhdsWithin,(eventually_lt_nhds he).filter_mono nhdsWithin_le_nhds] with R hR hlt | |
| have hs : Rβ»ΒΉ β’ x β tsupport (ΞΎ : E β β) := by | |
| rw [ΞΎ.tsupport_eq,Metric.mem_closedBall,dist_zero_right,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hR)] | |
| apply not_le_of_gt | |
| rw [β div_eq_inv_mul] | |
| apply (lt_div_iffβ hR).mpr | |
| simpa only [mul_comm] using (lt_div_iffβ ΞΎ.rOut_pos).mp hlt | |
| simp only [dir,fderiv_of_notMem_tsupport β hs,_root_.zero_apply,mul_zero] | |
| end HenonLaneEmden.WeakPDE | |
| namespace HenonLaneEmden.WeakPDE | |
| variable {E : Type uE3} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] | |
| lemma kernel_dir_cutoff_tendsto_zero (hn : 1 β€ Module.finrank β E) {Ο : E β β} | |
| (hΟ : ContDiff β 2 Ο) (hc : HasCompactSupport Ο) (ΞΎ : ContDiffBump (0:E)) (e : E) : | |
| Tendsto (fun R : β => β« x : E, βxβ^(2-(Module.finrank β E:β))* | |
| dir (fun y => Ο y*ΞΎ (Rβ»ΒΉ β’ y)) e x) (π[>] 0) (π 0) := by | |
| have hK := locallyIntegrable_newtonKernel hn | |
| have hdΟ : Continuous (dir Ο e) := (contDiffOn_univ.mp | |
| (contDiffOn_dir (k := 1) hΟ.contDiffOn isOpen_univ e)).continuous | |
| have hdΞΎ : Continuous (dir ΞΎ e) := (contDiffOn_univ.mp | |
| (contDiffOn_dir (k := 1) (ΞΎ.contDiff.of_le (by exact WithTop.coe_le_coe.mpr le_top)).contDiffOn isOpen_univ e)).continuous | |
| have heq (R : β) : (β« x : E, βxβ^(2-(Module.finrank β E:β))*dir (fun y => Ο y*ΞΎ (Rβ»ΒΉ β’ y)) e x) = | |
| (β« x : E, βxβ^(2-(Module.finrank β E:β))*(dir Ο e x*ΞΎ (Rβ»ΒΉ β’ x))) + | |
| (β« x : E, βxβ^(2-(Module.finrank β E:β))*Ο x*(Rβ»ΒΉ*dir ΞΎ e (Rβ»ΒΉ β’ x))) := by | |
| have hΞΎR : Differentiable β (fun y : E => ΞΎ (Rβ»ΒΉ β’ y)) := | |
| ((ΞΎ.contDiff : ContDiff β 2 ΞΎ).comp (contDiff_const.smul contDiff_id)).differentiable (by norm_num) | |
| simp_rw [dir_mul (hΟ.differentiable (by norm_num) _) (hΞΎR _) e,dir_dilation,mul_add,β mul_assoc] | |
| apply integral_add | |
| Β· simpa only [smul_eq_mul, Pi.mul_apply, Function.comp_apply, Pi.smul_apply, id_eq, mul_assoc] using | |
| hK.integrable_smul_right_of_hasCompactSupport | |
| (hdΟ.mul (ΞΎ.continuous.comp (continuous_id.const_smul Rβ»ΒΉ))) (compactSupport_dir hc e).mul_right | |
| Β· simpa only [smul_eq_mul, Pi.mul_apply, Function.comp_apply, Pi.smul_apply, id_eq, mul_assoc] using | |
| hK.integrable_smul_right_of_hasCompactSupport | |
| (hΟ.continuous.mul ((continuous_const : Continuous (fun _ : E => Rβ»ΒΉ)).mul | |
| (hdΞΎ.comp (continuous_id.const_smul Rβ»ΒΉ)))) hc.mul_right | |
| simp_rw [heq] | |
| simpa only [add_zero] using (cutoff_source_integral_tendsto_zero hK hdΟ (compactSupport_dir hc e) ΞΎ).add | |
| (kernel_cutoff_derivative_tendsto_zero hn hΟ.continuous hc ΞΎ e) | |
| lemma integral_kernel_dir (hn : 1 β€ Module.finrank β E) {Ο : E β β} | |
| (hΟ : ContDiff β 2 Ο) (hc : HasCompactSupport Ο) (e : E) : | |
| (β« x, βxβ^(2-(Module.finrank β E:β))*dir Ο e x) = -(β« x, kernelDir e x*Ο x) := by | |
| let ΞΎ : ContDiffBump (0:E) := β¨1,2,by norm_num,by norm_numβ© | |
| have hK := locallyIntegrable_newtonKernel hn | |
| have hD := locallyIntegrable_kernelDir hn e | |
| have hdΟ : Continuous (dir Ο e) := (contDiffOn_univ.mp | |
| (contDiffOn_dir (k := 1) hΟ.contDiffOn isOpen_univ e)).continuous | |
| have hiK := hK.integrable_smul_right_of_hasCompactSupport hdΟ (compactSupport_dir hc e) | |
| have hiD := hD.integrable_smul_right_of_hasCompactSupport hΟ.continuous hc | |
| have hevent : βαΆ R : β in π[>] 0, | |
| (β« x, βxβ^(2-(Module.finrank β E:β))*dir Ο e x) - | |
| (β« x, βxβ^(2-(Module.finrank β E:β))*dir (fun y => Ο y*ΞΎ (Rβ»ΒΉ β’ y)) e x) = | |
| -(β« x, kernelDir e x*Ο x)+(β« x, kernelDir e x*(Ο x*ΞΎ (Rβ»ΒΉ β’ x))) := by | |
| filter_upwards [self_mem_nhdsWithin] with R hR | |
| obtain β¨hΟ,hΟc,hΟ0β© := cutoff_test_off_origin hΟ hc ΞΎ hR | |
| have hh := integral_kernel_dir_off_zero hn hΟ hΟc hΟ0 e | |
| have hΟ : ContDiff β 2 (fun y : E => Ο y*ΞΎ (Rβ»ΒΉ β’ y)) := | |
| hΟ.mul (ΞΎ.contDiff.comp (contDiff_const.smul contDiff_id)) | |
| have hΟc : HasCompactSupport (fun y : E => Ο y*ΞΎ (Rβ»ΒΉ β’ y)) := hc.mul_right | |
| have hdΟ : Continuous (dir (fun y : E => Ο y*ΞΎ (Rβ»ΒΉ β’ y)) e) := (contDiffOn_univ.mp | |
| (contDiffOn_dir (k := 1) hΟ.contDiffOn isOpen_univ e)).continuous | |
| have hiΟK := hK.integrable_smul_right_of_hasCompactSupport hdΟ (compactSupport_dir hΟc e) | |
| have hiΟD := hD.integrable_smul_right_of_hasCompactSupport hΟ.continuous hΟc | |
| simp only [smul_eq_mul] at hiK hiD hiΟK hiΟD | |
| have hid (x : E) : dir (fun y => Ο y-Ο y*ΞΎ (Rβ»ΒΉ β’ y)) e x = | |
| dir Ο e x-dir (fun y => Ο y*ΞΎ (Rβ»ΒΉ β’ y)) e x := by | |
| unfold dir | |
| exact congrArg (fun L : E βL[β] β => L e) | |
| ((hΟ.differentiable (by norm_num) x).hasFDerivAt.sub | |
| (hΟ.differentiable (by norm_num) x).hasFDerivAt).fderiv | |
| simp_rw [hid,mul_sub] at hh | |
| rw [integral_sub hiK hiΟK,integral_sub hiD hiΟD] at hh | |
| linarith | |
| have hlimβ := (tendsto_const_nhds (x := β« x, βxβ^(2-(Module.finrank β E:β))*dir Ο e x)).sub | |
| (kernel_dir_cutoff_tendsto_zero hn hΟ hc ΞΎ e) | |
| have hlimβ := (tendsto_const_nhds (x := -(β« x, kernelDir e x*Ο x))).add | |
| (cutoff_source_integral_tendsto_zero hD hΟ.continuous hc ΞΎ) | |
| simpa only [sub_zero,add_zero] using tendsto_nhds_unique hlimβ (hlimβ.congr' (hevent.mono fun _ hh => hh.symm)) | |
| end HenonLaneEmden.WeakPDE | |
| namespace HenonLaneEmden.WeakPDE | |
| variable {E : Type uE4} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| omit [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] in | |
| lemma kernelDir_shift_bound (hn : 3 β€ Module.finrank β E) {r : β} (hr : 0 < r) | |
| {x xβ y : E} (hx : βx-xββ < r/2) (hy : r β€ βxβ-yβ) (e : E) : | |
| |kernelDir e (x-y)| β€ (|2-(Module.finrank β E:β)| *βeβ*(2/r)*(1/2:β)^(2-(Module.finrank β E:β)))* | |
| βxβ-yβ^(2-(Module.finrank β E:β)) := by | |
| have ht := norm_sub_le (xβ-x) (y-x) | |
| simp only [sub_sub_sub_cancel_right,norm_sub_rev y x,norm_sub_rev xβ x] at ht | |
| have hl : r/2 β€ βx-yβ := by linarith | |
| have hp : 0 < βx-yβ := lt_of_lt_of_le (half_pos hr) hl | |
| have ha : 2-(Module.finrank β E:β) β€ 0 := by | |
| have hh : (3:β) β€ Module.finrank β E := by exact_mod_cast hn | |
| linarith | |
| have he : βx-yβ^(1-(Module.finrank β E:β)) = βx-yβ^(2-(Module.finrank β E:β))/βx-yβ := by | |
| calc | |
| _ = βx-yβ^(2-(Module.finrank β E:β)-1) := by congr 1; ring | |
| _ = _ := by rw [Real.rpow_sub hp,Real.rpow_one] | |
| have hh : βx-yβ^(1-(Module.finrank β E:β)) β€ | |
| (2/r)*((1/2:β)^(2-(Module.finrank β E:β))*βxβ-yβ^(2-(Module.finrank β E:β))) := by | |
| rw [he,div_eq_inv_mul] | |
| apply mul_le_mul | |
| Β· have h := one_div_le_one_div_of_le (half_pos hr) hl | |
| simpa only [one_div,inv_div] using h | |
| Β· exact rpow_kernel_shift_bound ha hr hx hy | |
| Β· positivity | |
| Β· positivity | |
| exact (kernelDir_bound e (x-y)).trans ((mul_le_mul_of_nonneg_left hh (by positivity)).trans_eq (by ring)) | |
| lemma hasLineDerivAt_far_rawPotential (hn : 3 β€ Module.finrank β E) {g : E β β} | |
| (hg : Measurable g) (hgp : β y, 0 β€ g y) {xβ : E} {r : β} (hr : 0 < r) | |
| (hzero : β y β Metric.ball xβ r, g y = 0) | |
| (hi : Integrable (fun y => βxβ-yβ^(2-(Module.finrank β E:β))*g y)) (e : E) : | |
| Integrable (fun y => kernelDir e (xβ-y)*g y) β§ | |
| HasLineDerivAt β (rawPotential g) (β« y, kernelDir e (xβ-y)*g y) xβ e := by | |
| let C := |2-(Module.finrank β E:β)| *βeβ*(2/r)*(1/2:β)^(2-(Module.finrank β E:β)) | |
| let s : Set β := {t | βt β’ eβ < r/2} | |
| have hs : s β π (0:β) := by | |
| apply IsOpen.mem_nhds (isOpen_lt (continuous_id.smul continuous_const).norm continuous_const) | |
| simpa [s] using half_pos hr | |
| have hDmeas : Measurable (fun y : E => kernelDir e (xβ-y)*g y) := | |
| ((measurable_kernelDir e).comp (measurable_const.sub measurable_id)).mul hg | |
| have hh := hasDerivAt_integral_of_dominated_loc_of_deriv_le | |
| (ΞΌ := (volume : Measure E)) (F := fun (t : β) (y : E) => β(xβ+t β’ e)-yβ^(2-(Module.finrank β E:β))*g y) | |
| (F' := fun (t : β) (y : E) => kernelDir e ((xβ+t β’ e)-y)*g y) | |
| (bound := fun y => C*(βxβ-yβ^(2-(Module.finrank β E:β))*g y)) hs | |
| (Eventually.of_forall fun t => (((measurable_const.sub measurable_id).norm.pow_const _).mul hg).aestronglyMeasurable) | |
| (by simpa using hi) | |
| (by simpa only [zero_smul, add_zero] using hDmeas.aestronglyMeasurable) | |
| ?_ (hi.const_mul C) ?_ | |
| Β· simpa only [zero_smul,add_zero,HasLineDerivAt,rawPotential] using hh | |
| Β· apply Eventually.of_forall | |
| intro y t ht | |
| by_cases hy : y β Metric.ball xβ r | |
| Β· simp only [hzero y hy,mul_zero,norm_zero,le_refl] | |
| have hyr : r β€ βxβ-yβ := by | |
| have hy' : Β¬ βy-xββ < r := by simpa only [Metric.mem_ball,dist_eq_norm] using hy | |
| simpa only [norm_sub_rev] using le_of_not_gt hy' | |
| have htx : β(xβ+t β’ e)-xββ < r/2 := by simpa only [s,Set.mem_ofPred_eq,add_sub_cancel_left] using ht | |
| rw [norm_mul,Real.norm_eq_abs,Real.norm_eq_abs,abs_of_nonneg (hgp y)] | |
| exact (mul_le_mul_of_nonneg_right (kernelDir_shift_bound hn hr htx hyr e) (hgp y)).trans_eq (mul_assoc _ _ _) | |
| Β· apply Eventually.of_forall | |
| intro y t ht | |
| by_cases hy : y β Metric.ball xβ r | |
| Β· simp only [hzero y hy,mul_zero] | |
| exact hasDerivAt_const t 0 | |
| have hyr : r β€ βxβ-yβ := by | |
| have hy' : Β¬ βy-xββ < r := by simpa only [Metric.mem_ball,dist_eq_norm] using hy | |
| simpa only [norm_sub_rev] using le_of_not_gt hy' | |
| have hne : (xβ+t β’ e)-y β 0 := by | |
| intro he | |
| have he' : y = xβ+t β’ e := (sub_eq_zero.mp he).symm | |
| rw [he',norm_sub_rev,add_sub_cancel_left] at hyr | |
| linarith [show βt β’ eβ < r/2 from ht] | |
| have haff : HasDerivAt (fun t : β => (xβ+t β’ e)-y) e t := by | |
| simpa using (((hasDerivAt_id t).smul_const e).const_add xβ).sub_const y | |
| have hd := ((hasFDerivAt_kernel hne).comp_hasDerivAt t haff).mul_const (g y) | |
| simpa only [_root_.smul_apply,innerSL_apply_apply,smul_eq_mul,kernelDir,Function.comp_apply] using hd | |
| end HenonLaneEmden.WeakPDE | |
| namespace HenonLaneEmden.WeakPDE | |
| variable {E : Type uE5} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] | |
| omit [FiniteDimensional β E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] in | |
| lemma contDiff_mul_cutoff {g ΞΎ : E β β} {s : Set E} {k : ββΟ} (hs : IsOpen s) | |
| (hg : ContDiffOn β k g s) (hΞΎ : ContDiff β k ΞΎ) (hΞΎs : tsupport ΞΎ β s) : | |
| ContDiff β k (fun y => ΞΎ y*g y) := by | |
| apply contDiff_iff_contDiffAt.mpr | |
| intro x | |
| by_cases hx : x β tsupport ΞΎ | |
| Β· exact hΞΎ.contDiffAt.mul (hg.contDiffAt (hs.mem_nhds (hΞΎs hx))) | |
| Β· apply (contDiffAt_const (c := (0:β))).congr_of_eventuallyEq | |
| filter_upwards [(isClosed_tsupport ΞΎ).isOpen_compl.mem_nhds hx] with y hy | |
| simp only [image_eq_zero_of_notMem_tsupport hy,zero_mul] | |
| omit [Nontrivial E] in | |
| lemma rawPotential_eq_convolve (g : E β β) : rawPotential g = convolve (fun y : E => βyβ^(2-(Module.finrank β E:β))) g := by | |
| ext x | |
| rw [rawPotential,convolve_def,β integral_sub_left_eq_self (fun y : E => βyβ^(2-(Module.finrank β E:β))*g (x-y)) volume x] | |
| simp only [sub_sub_cancel] | |
| omit [Nontrivial E] in | |
| lemma integrable_kernelDir_local (hn : 1 β€ Module.finrank β E) {g : E β β} | |
| (hg : Continuous g) (hc : HasCompactSupport g) (e x : E) : | |
| Integrable (fun y => kernelDir e (x-y)*g y) := by | |
| have hh := (locallyIntegrable_kernelDir hn e).integrable_smul_right_of_hasCompactSupport | |
| (hg.comp (continuous_const.sub continuous_id)) (hc.comp_homeomorph (Homeomorph.subLeft x)) | |
| have hi := (Measure.measurePreserving_sub_left volume x).integrable_comp hh.aestronglyMeasurable | |
| apply hi.mpr hh |>.congr | |
| exact Eventually.of_forall fun y => by simp only [Function.comp_apply,Pi.sub_apply,id_eq,sub_sub_cancel,smul_eq_mul] | |
| lemma dir_rawPotential_local (hn : 1 β€ Module.finrank β E) {g : E β β} | |
| (hg : ContDiff β 2 g) (hc : HasCompactSupport g) (e x : E) : | |
| dir (rawPotential g) e x = β« y, kernelDir e (x-y)*g y := by | |
| let Ο : E β β := fun z => g (x-z) | |
| have hΟ : ContDiff β 2 Ο := hg.comp (contDiff_const.sub contDiff_id) | |
| have hΟc : HasCompactSupport Ο := hc.comp_homeomorph (Homeomorph.subLeft x) | |
| have hdΟ (z : E) : dir Ο e z = -dir g e (x-z) := by | |
| unfold dir Ο | |
| have hd := (hg.differentiable (by norm_num) (x-z)).hasFDerivAt.comp z | |
| ((hasFDerivAt_id z).const_sub x) | |
| have hfd : fderiv β (fun z => g (x-z)) z = _ := hd.fderiv | |
| rw [hfd] | |
| simp | |
| have hh := integral_kernel_dir hn hΟ hΟc e | |
| simp_rw [hdΟ,mul_neg,integral_neg] at hh | |
| have hh' := neg_injective hh | |
| rw [rawPotential_eq_convolve,dir_convolve (locallyIntegrable_newtonKernel hn) (hg.of_le (by norm_num)) hc,convolve_def,hh'] | |
| rw [β integral_sub_left_eq_self (fun z => kernelDir e z*g (x-z)) volume x] | |
| simp only [sub_sub_cancel] | |
| lemma hasLineDerivAt_rawPotential_local (hn : 1 β€ Module.finrank β E) {g : E β β} | |
| (hg : ContDiff β 2 g) (hc : HasCompactSupport g) (e x : E) : | |
| HasLineDerivAt β (rawPotential g) (β« y, kernelDir e (x-y)*g y) x e := by | |
| have hd : Differentiable β (rawPotential g) := by | |
| rw [rawPotential_eq_convolve] | |
| exact (contDiff_convolve (locallyIntegrable_newtonKernel hn) hg hc).differentiable (by norm_num) | |
| rw [β dir_rawPotential_local hn hg hc] | |
| exact (hd x).hasFDerivAt.hasLineDerivAt e | |
| end HenonLaneEmden.WeakPDE | |
| namespace HenonLaneEmden.WeakPDE | |
| variable {E : Type uE6} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] | |
| lemma hasLineDerivAt_rawPotential (hn : 3 β€ Module.finrank β E) {g : E β β} {s : Set E} | |
| (hg : Measurable g) (hgp : β x, 0 β€ g x) (hs : IsOpen s) (hgc : ContDiffOn β 2 g s) | |
| (hi : β x, Integrable (fun y => βx-yβ^(2-(Module.finrank β E:β))*g y)) | |
| {xβ : E} (hxβ : xβ β s) (e : E) : | |
| Integrable (fun y => kernelDir e (xβ-y)*g y) β§ | |
| HasLineDerivAt β (rawPotential g) (β« y, kernelDir e (xβ-y)*g y) xβ e := by | |
| obtain β¨r,hr,hrsβ© := Metric.mem_nhds_iff.mp (hs.mem_nhds hxβ) | |
| let ΞΎ : ContDiffBump xβ := β¨r/4,r/2,by linarith,by linarithβ© | |
| have hΞΎs : tsupport ΞΎ β s := by | |
| apply Subset.trans (by rw [ΞΎ.tsupport_eq] : tsupport ΞΎ β Metric.closedBall xβ ΞΎ.rOut) | |
| intro y hy | |
| apply hrs | |
| have hy' : dist y xβ β€ r/2 := hy | |
| change dist y xβ < r | |
| linarith | |
| let gβ : E β β := fun y => ΞΎ y*g y | |
| let gβ : E β β := fun y => (1-ΞΎ y)*g y | |
| have hgβc : ContDiff β 2 gβ := contDiff_mul_cutoff hs hgc ΞΎ.contDiff hΞΎs | |
| have hgβk : HasCompactSupport gβ := ΞΎ.hasCompactSupport.mul_right | |
| have hgβm : Measurable gβ := (measurable_const.sub ΞΎ.continuous.measurable).mul hg | |
| have hgβp : β y, 0 β€ gβ y := fun y => mul_nonneg (sub_nonneg.mpr (ΞΎ.le_one (x := y))) (hgp y) | |
| have hiβ (x : E) := rawPotential_integrable_cutoff hg hgp ΞΎ.continuous.measurable | |
| (fun _ => ΞΎ.nonneg) (fun _ => ΞΎ.le_one) (hi x) | |
| have hiβ (x : E) : Integrable (fun y => βx-yβ^(2-(Module.finrank β E:β))*((1-ΞΎ y)*g y)) := by | |
| simpa only [Pi.sub_apply] using rawPotential_integrable_cutoff hg hgp | |
| (measurable_const.sub ΞΎ.continuous.measurable) (fun y => sub_nonneg.mpr (ΞΎ.le_one (x := y))) | |
| (fun y => by change 1-ΞΎ y β€ 1; linarith [ΞΎ.nonneg (x := y)]) (hi x) | |
| obtain β¨hdβ,hfarβ© := hasLineDerivAt_far_rawPotential hn hgβm hgβp (r := r/4) (by linarith) | |
| (by intro y hy | |
| have heq : ΞΎ y = 1 := ΞΎ.one_of_mem_closedBall (Metric.ball_subset_closedBall hy) | |
| simp [gβ,heq]) (hiβ xβ) e | |
| have hdβ := integrable_kernelDir_local (by omega : 1 β€ Module.finrank β E) hgβc.continuous hgβk e xβ | |
| have heqD : (fun y => kernelDir e (xβ-y)*g y) = | |
| (fun y => kernelDir e (xβ-y)*gβ y+kernelDir e (xβ-y)*gβ y) := by | |
| funext y; dsimp [gβ,gβ]; ring | |
| refine β¨?_,?_β© | |
| Β· rw [heqD] | |
| exact hdβ.add hdβ | |
| have heq : rawPotential g = fun x => rawPotential gβ x+rawPotential gβ x := by | |
| ext x | |
| change (β« y, βx-yβ^(2-(Module.finrank β E:β))*g y) = | |
| (β« y, βx-yβ^(2-(Module.finrank β E:β))*(ΞΎ y*g y)) + | |
| (β« y, βx-yβ^(2-(Module.finrank β E:β))*((1-ΞΎ y)*g y)) | |
| rw [β integral_add (hiβ x) (hiβ x)] | |
| apply integral_congr_ae | |
| exact Eventually.of_forall fun y => by ring | |
| rw [heq,heqD,integral_add hdβ hdβ] | |
| exact (hasLineDerivAt_rawPotential_local (by omega) hgβc hgβk e xβ).add hfar | |
| end HenonLaneEmden.WeakPDE | |
| namespace HenonLaneEmden | |
| open WeakPDE | |
| lemma IsSolution.gradient_u {n : β} (hn : 2 β€ n) {p q A B : β} | |
| {u v : Space n β β} (h : IsSolution n p q A B u v) (hq : 0 < q) | |
| {x : Space n} (hx : x β 0) (e : Space n) : | |
| Integrable (fun y => kernelDir e (x-y)*source v p A y) β§ | |
| newtonDenom n*dir u e x = β« y, kernelDir e (x-y)*source v p A y := by | |
| have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := β) (by simp; omega) | |
| obtain β¨hi,hdβ© := hasLineDerivAt_rawPotential (by simpa using h.dimension_ge_three hn) | |
| (measurable_source h.continuous_v p A) (source_nonneg (fun y => (h.positive_v y).le) p A) | |
| isOpen_compl_singleton (regular_source h.regular_v h.positive_v p A) | |
| (by simpa only [finrank_euclideanSpace_fin] using h.kernel_g_integrable hn) hx e | |
| refine β¨hi,?_β© | |
| have hu := (h.regular_u.contDiffAt (isOpen_compl_singleton.mem_nhds hx)).differentiableAt (by norm_num) | |
| have hd' : HasLineDerivAt β (fun y => newtonDenom n*u y) (newtonDenom n*dir u e x) x e := by | |
| simpa only [dir,_root_.smul_apply,smul_eq_mul] using (hu.hasFDerivAt.const_mul (newtonDenom n)).hasLineDerivAt e | |
| apply hd'.unique | |
| apply hd.congr_of_eventuallyEq | |
| filter_upwards [isOpen_compl_singleton.mem_nhds hx] with y hy | |
| exact h.potential_u hn hq hy | |
| end HenonLaneEmden | |
| end | |
| end Gradients | |
| end OAI | |