import Euler.LpTranslation import Euler.LpDominatedDerivative import Mathlib.Analysis.Calculus.MeanValue import Euler.LpDominatedConvergence /-! Expanding ordinary-space cutoffs and their actual first derivative controls. -/ /-! ## From `Euler/LpCompactTranslation.lean` The text of `Euler/LpCompactTranslation.lean`, folded into this file, which was its only importer. -/ section /-! The genuine L² derivative of translations of compact smooth ordinary-space fields. -/ noncomputable section namespace EulerLpTranslation open MeasureTheory EulerSmoothLimit EulerLpDerivative Filter open scoped ContDiff Topology variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] def compactField (f : Space → V) (hc : HasCompactSupport f) (hf : ContDiff ℝ ∞ f) : L2Space V := (hf.continuous.memLp_of_hasCompactSupport hc).toLp f def compactDerivative (f : Space → V) (hc : HasCompactSupport f) (hf : ContDiff ℝ ∞ f) : L2Space (Space →L[ℝ] V) := ((hf.fderiv_right (m := ∞) (by simp)).continuous.memLp_of_hasCompactSupport (hc.fderiv ℝ)).toLp (fderiv ℝ f) theorem compactField_ae (f : Space → V) (hc : HasCompactSupport f) (hf : ContDiff ℝ ∞ f) : compactField f hc hf =ᵐ[volume] f := MemLp.coeFn_toLp _ theorem compactDerivative_ae (f : Space → V) (hc : HasCompactSupport f) (hf : ContDiff ℝ ∞ f) : compactDerivative f hc hf =ᵐ[volume] fderiv ℝ f := MemLp.coeFn_toLp _ /-- A single compactly supported L² function dominates every small translation increment. -/ theorem compact_increment_bound (f : Space → V) (hc : HasCompactSupport f) (hf : ContDiff ℝ ∞ f) : ∃ M : Space → ℝ, MemLp M 2 volume ∧ (∀ x, 0 ≤ M x) ∧ ∀ a : Space, ‖a‖ ≤ 1 → ∀ x, ‖f (x+a)-f x‖ ≤ M x * ‖a‖ := by obtain ⟨R, hR⟩ := hc.isBounded.subset_closedBall (0 : Space) obtain ⟨C, hC⟩ := (hc.fderiv ℝ).exists_bound_of_continuous (hf.fderiv_right (m := ∞) (by simp)).continuous have hC0 : 0 ≤ C := (norm_nonneg _).trans (hC 0) let K := Metric.closedBall (0 : Space) (|R|+1) have hK : IsCompact K := isCompact_closedBall _ _ have hsupport : tsupport f ⊆ K := fun _ hx => Metric.closedBall_subset_closedBall (by linarith [le_abs_self R]) (hR hx) refine ⟨K.indicator (fun _ => C), memLp_indicator_const 2 hK.isClosed.measurableSet C (Or.inr hK.measure_ne_top), ?_, ?_⟩ · intro x exact Set.indicator_nonneg (fun _ _ => hC0) x · intro a ha x by_cases hx : x ∈ K · rw [Set.indicator_of_mem hx] have h := Convex.norm_image_sub_le_of_norm_fderiv_le (𝕜 := ℝ) (f := f) (s := Set.univ) (fun y _ => hf.differentiable (by simp) y) (fun y _ => hC y) (convex_univ : Convex ℝ (Set.univ : Set Space)) (Set.mem_univ x) (Set.mem_univ (x+a)) simpa only [add_sub_cancel_left] using h · have hxf : x ∉ tsupport f := fun ht => hx (hsupport ht) have hxa : x+a ∉ tsupport f := by intro ht apply hx have hn : ‖x+a‖ ≤ R := by simpa only [Metric.mem_closedBall, dist_zero_right] using hR ht change dist x 0 ≤ |R|+1 rw [dist_zero_right] have hh : ‖x‖ ≤ ‖x+a‖+‖a‖ := by simpa only [add_sub_cancel_right] using norm_sub_le (x+a) a linarith [le_abs_self R] simp only [image_eq_zero_of_notMem_tsupport hxa, image_eq_zero_of_notMem_tsupport hxf, sub_zero, norm_zero, Set.indicator_of_notMem hx, zero_mul, le_refl] /-- Ordinary Fréchet differentiation and L² translation differentiation agree on compact smooth fields. -/ theorem compactField_hasFDerivAt (f : Space → V) (hc : HasCompactSupport f) (hf : ContDiff ℝ ∞ f) : HasFDerivAt (fun a : Space => translation a (compactField f hc hf)) (derivativeMap volume (compactDerivative f hc hf)) 0 := by obtain ⟨M, hM, hM0, hbound⟩ := compact_increment_bound f hc hf apply EulerLpDerivative.hasFDerivAt_of_dominated volume (fun a : Space => translation a (compactField f hc hf)) (fun a x => f (x+a)) _ (compactDerivative f hc hf) _ M hM (Eventually.of_forall hM0) · filter_upwards [Metric.ball_mem_nhds (0 : Space) zero_lt_one] with a ha apply Eventually.of_forall intro x simpa only [add_zero] using hbound a ((by simpa only [Metric.mem_ball, dist_zero_right] using ha : ‖a‖ < 1).le) x · intro a filter_upwards [translation_ae a (compactField f hc hf), (measurePreserving_add_right (volume : Measure Space) a).quasiMeasurePreserving.ae (compactField_ae f hc hf)] with x hx hy exact hx.trans hy · filter_upwards [compactDerivative_ae f hc hf] with x hx rw [hx] simpa only [zero_add] using (hasFDerivAt_comp_add_left (f := f) x (x := (0 : Space))).mpr (by simpa only [add_zero] using (hf.differentiable (by simp) x).hasFDerivAt) end EulerLpTranslation end end noncomputable section namespace EulerLpTranslation open MeasureTheory EulerSmoothLimit EulerNoncompactTransport Filter open scoped ContDiff Topology def cutoff (n : ℕ) (x : Space) : ℝ := spatialBump (cutoffScale n • x) theorem cutoff_smooth (n : ℕ) : ContDiff ℝ ∞ (cutoff n) := spatialBump.contDiff.comp (contDiff_id.const_smul (cutoffScale n)) theorem cutoff_compact (n : ℕ) : HasCompactSupport (cutoff n) := spatialBump.hasCompactSupport.comp_smul (cutoffScale_pos n).ne' theorem cutoff_bounds (n : ℕ) (x : Space) : 0 ≤ cutoff n x ∧ cutoff n x ≤ 1 := ⟨spatialBump.nonneg, spatialBump.le_one⟩ theorem cutoff_sub_one_norm (n : ℕ) (x : Space) : ‖cutoff n x - 1‖ ≤ 1 := by rw [Real.norm_eq_abs, abs_le] constructor <;> linarith [cutoff_bounds n x] theorem cutoff_tendsto (x : Space) : Tendsto (fun n => cutoff n x) atTop (𝓝 1) := by have h := spatialBump.continuous.continuousAt.tendsto.comp (cutoffScale_tendsto.smul_const x) have hb : spatialBump (0 : Space) = 1 := spatialBump.one_of_mem_closedBall (by simp [spatialBump]) simpa only [cutoff, zero_smul, hb, Function.comp_def] using h theorem cutoff_derivative_bound : ∃ M : ℝ, 0 ≤ M ∧ ∀ n x, ‖fderiv ℝ (cutoff n) x‖ ≤ M * cutoffScale n := by have hs : ContDiff ℝ ∞ (spatialBump : Space → ℝ) := spatialBump.contDiff obtain ⟨M, hM⟩ := (spatialBump.hasCompactSupport.fderiv ℝ).exists_bound_of_continuous (hs.fderiv_right (m := ∞) (by simp)).continuous have hM0 : 0 ≤ M := (norm_nonneg _).trans (hM 0) refine ⟨M, hM0, ?_⟩ intro n x have hder := ((hs.differentiable (by simp)) (cutoffScale n • x)).hasFDerivAt.comp x ((hasFDerivAt_id x).const_smul (cutoffScale n)) change HasFDerivAt (cutoff n) ((fderiv ℝ (spatialBump : Space → ℝ) (cutoffScale n • x)).comp (cutoffScale n • ContinuousLinearMap.id ℝ Space)) x at hder rw [hder.fderiv] calc _ ≤ ‖fderiv ℝ (spatialBump : Space → ℝ) (cutoffScale n • x)‖ * ‖cutoffScale n • ContinuousLinearMap.id ℝ Space‖ := ContinuousLinearMap.opNorm_comp_le _ _ _ = ‖fderiv ℝ (spatialBump : Space → ℝ) (cutoffScale n • x)‖ * cutoffScale n := by rw [norm_smul, Real.norm_eq_abs, abs_of_pos (cutoffScale_pos n), ContinuousLinearMap.norm_id, mul_one] _ ≤ M * cutoffScale n := mul_le_mul_of_nonneg_right (hM _) (cutoffScale_pos n).le theorem cutoff_derivative_tendsto (x : Space) : Tendsto (fun n => fderiv ℝ (cutoff n) x) atTop (𝓝 0) := by obtain ⟨M, _, hM⟩ := cutoff_derivative_bound apply squeeze_zero_norm (fun n => hM n x) simpa only [mul_zero] using cutoffScale_tendsto.const_mul M variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] def cutoffField (f : Space → V) (n : ℕ) (x : Space) : V := cutoff n x • f x theorem cutoffField_smooth (f : Space → V) (hf : ContDiff ℝ ∞ f) (n : ℕ) : ContDiff ℝ ∞ (cutoffField f n) := (cutoff_smooth n).smul hf theorem cutoffField_compact (f : Space → V) (n : ℕ) : HasCompactSupport (cutoffField f n) := (cutoff_compact n).smul_right theorem cutoffField_fderiv (f : Space → V) (hf : ContDiff ℝ ∞ f) (n : ℕ) (x : Space) : fderiv ℝ (cutoffField f n) x = cutoff n x • fderiv ℝ f x + (fderiv ℝ (cutoff n) x).smulRight (f x) := fderiv_fun_smul ((cutoff_smooth n).differentiable (by simp) x) (hf.differentiable (by simp) x) theorem cutoffField_tendsto (f : Space → V) (x : Space) : Tendsto (fun n => cutoffField f n x) atTop (𝓝 (f x)) := by simpa only [one_smul, cutoffField] using (cutoff_tendsto x).smul_const (f x) theorem cutoffField_fderiv_tendsto (f : Space → V) (hf : ContDiff ℝ ∞ f) (x : Space) : Tendsto (fun n => fderiv ℝ (cutoffField f n) x) atTop (𝓝 (fderiv ℝ f x)) := by have hright : Tendsto (fun n => (fderiv ℝ (cutoff n) x).smulRight (f x)) atTop (𝓝 0) := by have hc : Continuous (fun L : Space →L[ℝ] ℝ => L.smulRight (f x)) := by fun_prop simpa only [ContinuousLinearMap.zero_smulRight, Function.comp_def] using hc.continuousAt.tendsto.comp (cutoff_derivative_tendsto x) simp_rw [cutoffField_fderiv f hf] simpa only [one_smul, add_zero] using ((cutoff_tendsto x).smul_const (fderiv ℝ f x)).add hright end EulerLpTranslation