Exact source: Mathlib/Analysis/Calculus/ContDiff/Convolution.lean
Pinned GitHub source Β· Raw UTF-8 source
Back to Differentiating a local mollification through its kernel
1/-2Copyright (c) 2022 Floris van Doorn. All rights reserved.3Released under Apache 2.0 license as described in the file LICENSE.4Authors: Floris van Doorn5-/6module78public import Mathlib.Analysis.Calculus.ContDiff.Comp9public import Mathlib.Analysis.Calculus.ParametricIntegral10public import Mathlib.Analysis.Convolution1112/-!13# Differentiability of a convolution of functions1415Criteria for a convolution of functions to be differentiable.1617## Main Results1819* `HasCompactSupport.hasFDerivAt_convolution_right` and20 `HasCompactSupport.hasFDerivAt_convolution_left`: we can compute the total derivative21 of the convolution as a convolution with the total derivative of the right (left) function.22* `HasCompactSupport.contDiff_convolution_right` and23 `HasCompactSupport.contDiff_convolution_left`: the convolution is `πβΏ` if one of the functions24 is `πβΏ` with compact support and the other function in locally integrable.2526-/2728public section29open Set Function Filter MeasureTheory MeasureTheory.Measure TopologicalSpace3031open Bornology ContinuousLinearMap Metric Topology32open scoped Pointwise NNReal Filter3334universe uπ uG uE uE' uE'' uF uF' uF'' uP3536variable {π : Type uπ} {G : Type uG} {E : Type uE} {E' : Type uE'} {E'' : Type uE''} {F : Type uF}37 {F' : Type uF'} {F'' : Type uF''} {P : Type uP}3839variable [NormedAddCommGroup E] [NormedAddCommGroup E'] [NormedAddCommGroup E'']40 [NormedAddCommGroup F] {f f' : G β E} {g g' : G β E'} {x x' : G} {y y' : E}4142namespace MeasureTheory4344open scoped Convolution4546section RCLike47variable [RCLike π]48variable [NormedSpace π E]49variable [NormedSpace π E']50variable [NormedSpace π E'']51variable [NormedSpace β F] [NormedSpace π F]52variable {n : ββ}53variable [MeasurableSpace G] {ΞΌ Ξ½ : Measure G}54variable (L : E βL[π] E' βL[π] F)5556variable [NormedAddCommGroup G] [BorelSpace G]5758variable [NormedSpace π G] [SFinite ΞΌ] [IsAddLeftInvariant ΞΌ]5960/-- Compute the total derivative of `f β g` if `g` is `C^1` with compact support and `f` is locally61integrable. To write down the total derivative as a convolution, we use62`ContinuousLinearMap.precompR`. -/63theorem _root_.HasCompactSupport.hasFDerivAt_convolution_right (hcg : HasCompactSupport g)64 (hf : LocallyIntegrable f ΞΌ) (hg : ContDiff π 1 g) (xβ : G) :65 HasFDerivAt (f β[L, ΞΌ] g) ((f β[L.precompR G, ΞΌ] fderiv π g) xβ) xβ := by66 rcases hcg.eq_zero_or_finiteDimensional π hg.continuous with (rfl | fin_dim)67 Β· have : fderiv π (0 : G β E') = 0 := fderiv_const (0 : E')68 simp only [this, convolution_zero, Pi.zero_apply]69 exact hasFDerivAt_const (0 : F) xβ70 have : ProperSpace G := FiniteDimensional.proper_rclike π G71 set L' := L.precompR G72 have h1 : βαΆ x in π xβ, AEStronglyMeasurable (fun t => L (f t) (g (x - t))) ΞΌ :=73 Eventually.of_forall74 (hf.aestronglyMeasurable.convolution_integrand_snd L hg.continuous.aestronglyMeasurable)75 have h2 : β x, AEStronglyMeasurable (fun t => L' (f t) (fderiv π g (x - t))) ΞΌ :=76 hf.aestronglyMeasurable.convolution_integrand_snd L'77 (hg.continuous_fderiv one_ne_zero).aestronglyMeasurable78 have h3 : β x t, HasFDerivAt (fun x => g (x - t)) (fderiv π g (x - t)) x := fun x t β¦ by79 simpa using!80 (hg.differentiable one_ne_zero).differentiableAt.hasFDerivAt.comp x81 ((hasFDerivAt_id x).sub (hasFDerivAt_const t x))82 let K' := -tsupport (fderiv π g) + closedBall xβ 183 have hK' : IsCompact K' := (hcg.fderiv π).isCompact.neg.add (isCompact_closedBall xβ 1)84 apply hasFDerivAt_integral_of_dominated_of_fderiv_le (ball_mem_nhds _ zero_lt_one) h1 _ (h2 xβ)85 Β· filter_upwards with t x hx using86 (hcg.fderiv π).convolution_integrand_bound_right L' (hg.continuous_fderiv one_ne_zero)87 (ball_subset_closedBall hx)88 Β· rw [integrable_indicator_iff hK'.measurableSet]89 exact ((hf.integrableOn_isCompact hK').norm.const_mul _).mul_const _90 Β· exact Eventually.of_forall fun t x _ => (L _).hasFDerivAt.comp x (h3 x t)91 Β· exact hcg.convolutionExists_right L hf hg.continuous xβ9293theorem _root_.HasCompactSupport.hasFDerivAt_convolution_left [IsNegInvariant ΞΌ]94 (hcf : HasCompactSupport f) (hf : ContDiff π 1 f) (hg : LocallyIntegrable g ΞΌ) (xβ : G) :95 HasFDerivAt (f β[L, ΞΌ] g) ((fderiv π f β[L.precompL G, ΞΌ] g) xβ) xβ := by96 simp +singlePass only [β convolution_flip]97 exact hcf.hasFDerivAt_convolution_right L.flip hg hf xβ9899end RCLike100101section Real102103/-! The one-variable case -/104105variable [RCLike π]106variable [NormedSpace π E]107variable [NormedSpace π E']108variable [NormedSpace β F] [NormedSpace π F]109variable {fβ : π β E} {gβ : π β E'}110variable {n : ββ}111variable (L : E βL[π] E' βL[π] F)112variable {ΞΌ : Measure π}113variable [IsAddLeftInvariant ΞΌ] [SFinite ΞΌ]114115theorem _root_.HasCompactSupport.hasDerivAt_convolution_right (hf : LocallyIntegrable fβ ΞΌ)116 (hcg : HasCompactSupport gβ) (hg : ContDiff π 1 gβ) (xβ : π) :117 HasDerivAt (fβ β[L, ΞΌ] gβ) ((fβ β[L, ΞΌ] deriv gβ) xβ) xβ := by118 convert (hcg.hasFDerivAt_convolution_right L hf hg xβ).hasDerivAt119 rw [convolution_precompR_apply L hf (hcg.fderiv π) (hg.continuous_fderiv one_ne_zero)]120 rfl121122theorem _root_.HasCompactSupport.hasDerivAt_convolution_left [IsNegInvariant ΞΌ]123 (hcf : HasCompactSupport fβ) (hf : ContDiff π 1 fβ) (hg : LocallyIntegrable gβ ΞΌ) (xβ : π) :124 HasDerivAt (fβ β[L, ΞΌ] gβ) ((deriv fβ β[L, ΞΌ] gβ) xβ) xβ := by125 simp +singlePass only [β convolution_flip]126 exact hcf.hasDerivAt_convolution_right L.flip hg hf xβ127128end Real129130section WithParam131132variable [RCLike π] [NormedSpace π E] [NormedSpace π E'] [NormedSpace π E''] [NormedSpace β F]133 [NormedSpace π F] [MeasurableSpace G] [NormedAddCommGroup G] [BorelSpace G]134 [NormedSpace π G] [NormedAddCommGroup P] [NormedSpace π P] {ΞΌ : Measure G}135 (L : E βL[π] E' βL[π] F)136137/-- The derivative of the convolution `f * g` is given by `f * Dg`, when `f` is locally integrable138and `g` is `C^1` and compactly supported. Version where `g` depends on an additional parameter in an139open subset `s` of a parameter space `P` (and the compact support `k` is independent of the140parameter in `s`). -/141theorem hasFDerivAt_convolution_right_with_param {g : P β G β E'} {s : Set P} {k : Set G}142 (hs : IsOpen s) (hk : IsCompact k) (hgs : β p, β x, p β s β x β k β g p x = 0)143 (hf : LocallyIntegrable f ΞΌ) (hg : ContDiffOn π 1 βΏg (s ΓΛ’ univ)) (qβ : P Γ G)144 (hqβ : qβ.1 β s) :145 HasFDerivAt (fun q : P Γ G => (f β[L, ΞΌ] g q.1) q.2)146 ((f β[L.precompR (P Γ G), ΞΌ] fun x : G => fderiv π βΏg (qβ.1, x)) qβ.2) qβ := by147 let g' := fderiv π βΏg148 have A : β p β s, Continuous (g p) := fun p hp β¦ by149 refine hg.continuousOn.comp_continuous (.prodMk_right _) fun x => ?_150 simpa only [prodMk_mem_set_prod_eq, mem_univ, and_true] using hp151 have A' : β q : P Γ G, q.1 β s β s ΓΛ’ univ β π q := fun q hq β¦ by152 apply (hs.prod isOpen_univ).mem_nhds153 simpa only [mem_prod, mem_univ, and_true] using hq154 -- The derivative of `g` vanishes away from `k`.155 have g'_zero : β p x, p β s β x β k β g' (p, x) = 0 := by156 intro p x hp hx157 refine (hasFDerivAt_zero_of_eventually_const 0 ?_).fderiv158 have M2 : kαΆ β π x := hk.isClosed.isOpen_compl.mem_nhds hx159 have M1 : s β π p := hs.mem_nhds hp160 rw [nhds_prod_eq]161 filter_upwards [prod_mem_prod M1 M2]162 rintro β¨p, yβ© β¨hp, hyβ©163 exact hgs p y hp hy164 /- We find a small neighborhood of `{qβ.1} Γ k` on which the derivative is uniformly bounded. This165 follows from the continuity at all points of the compact set `k`. -/166 obtain β¨Ξ΅, C, Ξ΅pos, hβΞ΅, hΞ΅β© :167 β Ξ΅ C, 0 < Ξ΅ β§ ball qβ.1 Ξ΅ β s β§ β p x, βp - qβ.1β < Ξ΅ β βg' (p, x)β β€ C := by168 have A : IsCompact ({qβ.1} ΓΛ’ k) := isCompact_singleton.prod hk169 obtain β¨t, kt, t_open, htβ© : β t, {qβ.1} ΓΛ’ k β t β§ IsOpen t β§ IsBounded (g' '' t) := by170 have B : ContinuousOn g' (s ΓΛ’ univ) :=171 hg.continuousOn_fderiv_of_isOpen (hs.prod isOpen_univ) le_rfl172 apply exists_isOpen_isBounded_image_of_isCompact_of_continuousOn A (hs.prod isOpen_univ) _ B173 simp only [prod_subset_prod_iff, hqβ, singleton_subset_iff, subset_univ, and_self_iff,174 true_or]175 obtain β¨Ξ΅, Ξ΅pos, hΞ΅, h'Ξ΅β© :176 β Ξ΅ : β, 0 < Ξ΅ β§ thickening Ξ΅ ({qβ.fst} ΓΛ’ k) β t β§ ball qβ.1 Ξ΅ β s := by177 obtain β¨Ξ΅, Ξ΅pos, hΞ΅β© : β Ξ΅ : β, 0 < Ξ΅ β§ thickening Ξ΅ (({qβ.fst} : Set P) ΓΛ’ k) β t :=178 A.exists_thickening_subset_open t_open kt179 obtain β¨Ξ΄, Ξ΄pos, hΞ΄β© : β Ξ΄ : β, 0 < Ξ΄ β§ ball qβ.1 Ξ΄ β s := Metric.isOpen_iff.1 hs _ hqβ180 refine β¨min Ξ΅ Ξ΄, lt_min Ξ΅pos Ξ΄pos, ?_, ?_β©181 Β· exact Subset.trans (thickening_mono (min_le_left _ _) _) hΞ΅182 Β· exact Subset.trans (ball_subset_ball (min_le_right _ _)) hΞ΄183 obtain β¨C, Cpos, hCβ© : β C, 0 < C β§ g' '' t β closedBall 0 C := ht.subset_closedBall_lt 0 0184 refine β¨Ξ΅, C, Ξ΅pos, h'Ξ΅, fun p x hp => ?_β©185 have hps : p β s := h'Ξ΅ (mem_ball_iff_norm.2 hp)186 by_cases hx : x β k187 Β· have H : (p, x) β t := by188 apply hΞ΅189 refine mem_thickening_iff.2 β¨(qβ.1, x), ?_, ?_β©190 Β· simp only [hx, singleton_prod, mem_image, Prod.mk_inj, true_and, exists_eq_right]191 Β· rw [β dist_eq_norm] at hp192 simpa only [Prod.dist_eq, Ξ΅pos, dist_self, max_lt_iff, and_true] using hp193 have : g' (p, x) β closedBall (0 : P Γ G βL[π] E') C := hC (mem_image_of_mem _ H)194 rwa [mem_closedBall_zero_iff] at this195 Β· have : g' (p, x) = 0 := g'_zero _ _ hps hx196 rw [this]197 simpa only [norm_zero] using Cpos.le198 /- Now, we wish to apply a theorem on differentiation of integrals. For this, we need to check199 trivial measurability or integrability assumptions (in `I1`, `I2`, `I3`), as well as a uniform200 integrability assumption over the derivative (in `I4` and `I5`) and pointwise differentiability201 in `I6`. -/202 have I1 :203 βαΆ x : P Γ G in π qβ, AEStronglyMeasurable (fun a : G => L (f a) (g x.1 (x.2 - a))) ΞΌ := by204 filter_upwards [A' qβ hqβ]205 rintro β¨p, xβ© β¨hp, -β©206 refine (HasCompactSupport.convolutionExists_right L ?_ hf (A _ hp) _).1207 apply hk.of_isClosed_subset (isClosed_tsupport _)208 exact closure_minimal (support_subset_iff'.2 fun z hz => hgs _ _ hp hz) hk.isClosed209 have I2 : Integrable (fun a : G => L (f a) (g qβ.1 (qβ.2 - a))) ΞΌ := by210 have M : HasCompactSupport (g qβ.1) := HasCompactSupport.intro hk fun x hx => hgs qβ.1 x hqβ hx211 apply M.convolutionExists_right L hf (A qβ.1 hqβ) qβ.2212 have I3 : AEStronglyMeasurable (fun a : G => (L (f a)).comp (g' (qβ.fst, qβ.snd - a))) ΞΌ := by213 have T : HasCompactSupport fun y => g' (qβ.1, y) :=214 HasCompactSupport.intro hk fun x hx => g'_zero qβ.1 x hqβ hx215 apply (HasCompactSupport.convolutionExists_right (L.precompR (P Γ G) :) T hf _ qβ.2).1216 have : ContinuousOn g' (s ΓΛ’ univ) :=217 hg.continuousOn_fderiv_of_isOpen (hs.prod isOpen_univ) le_rfl218 apply this.comp_continuous (.prodMk_right _)219 intro x220 simpa only [prodMk_mem_set_prod_eq, mem_univ, and_true] using hqβ221 set K' := (-k + {qβ.2} : Set G) with K'_def222 have hK' : IsCompact K' := hk.neg.add isCompact_singleton223 obtain β¨U, U_open, K'U, hUβ© : β U, IsOpen U β§ K' β U β§ IntegrableOn f U ΞΌ :=224 hf.integrableOn_nhds_isCompact hK'225 obtain β¨Ξ΄, Ξ΄pos, δΡ, hΞ΄β© : β Ξ΄, (0 : β) < Ξ΄ β§ Ξ΄ β€ Ξ΅ β§ K' + ball 0 Ξ΄ β U := by226 obtain β¨V, V_mem, hVβ© : β V β π (0 : G), K' + V β U :=227 compact_open_separated_add_right hK' U_open K'U228 rcases Metric.mem_nhds_iff.1 V_mem with β¨Ξ΄, Ξ΄pos, hΞ΄β©229 refine β¨min Ξ΄ Ξ΅, lt_min Ξ΄pos Ξ΅pos, min_le_right Ξ΄ Ξ΅, ?_β©230 exact (add_subset_add_left ((ball_subset_ball (min_le_left _ _)).trans hΞ΄)).trans hV231 letI := ContinuousLinearMap.hasOpNorm (π := π) (πβ := π) (E := E)232 (F := (P Γ G βL[π] E') βL[π] P Γ G βL[π] F) (Οββ := RingHom.id π)233 let bound : G β β := indicator U fun t => β(L.precompR (P Γ G))β * βf tβ * C234 have I4 : βα΅ a : G βΞΌ, β x : P Γ G, dist x qβ < Ξ΄ β235 βL.precompR (P Γ G) (f a) (g' (x.fst, x.snd - a))β β€ bound a := by236 filter_upwards with a x hx237 rw [Prod.dist_eq, dist_eq_norm, dist_eq_norm] at hx238 have : (-tsupport fun a => g' (x.1, a)) + ball qβ.2 Ξ΄ β U := by239 apply Subset.trans _ hΞ΄240 rw [K'_def, add_assoc]241 apply add_subset_add242 Β· rw [neg_subset_neg]243 refine closure_minimal (support_subset_iff'.2 fun z hz => ?_) hk.isClosed244 apply g'_zero x.1 z (hβΞ΅ _) hz245 rw [mem_ball_iff_norm]246 exact ((le_max_left _ _).trans_lt hx).trans_le δΡ247 Β· simp only [add_ball, thickening_singleton, zero_vadd, subset_rfl]248 apply convolution_integrand_bound_right_of_le_of_subset _ _ _ this249 Β· intro y250 exact hΞ΅ _ _ (((le_max_left _ _).trans_lt hx).trans_le δΡ)251 Β· rw [mem_ball_iff_norm]252 exact (le_max_right _ _).trans_lt hx253 have I5 : Integrable bound ΞΌ := by254 rw [integrable_indicator_iff U_open.measurableSet]255 exact (hU.norm.const_mul _).mul_const _256 have I6 : βα΅ a : G βΞΌ, β x : P Γ G, dist x qβ < Ξ΄ β257 HasFDerivAt (fun x : P Γ G => L (f a) (g x.1 (x.2 - a)))258 ((L (f a)).comp (g' (x.fst, x.snd - a))) x := by259 filter_upwards with a x hx260 apply (L _).hasFDerivAt.comp x261 have N : s ΓΛ’ univ β π (x.1, x.2 - a) := by262 apply A'263 apply hβΞ΅264 rw [Prod.dist_eq] at hx265 exact lt_of_lt_of_le (lt_of_le_of_lt (le_max_left _ _) hx) δΡ266 have Z := ((hg.differentiableOn one_ne_zero).differentiableAt N).hasFDerivAt267 have Z' :268 HasFDerivAt (fun x : P Γ G => (x.1, x.2 - a)) (ContinuousLinearMap.id π (P Γ G)) x := by269 have : (fun x : P Γ G => (x.1, x.2 - a)) = _root_.id - fun x => (0, a) := by270 ext x <;> simp only [Pi.sub_apply, _root_.id, Prod.fst_sub, sub_zero, Prod.snd_sub]271 rw [this]272 exact (hasFDerivAt_id x).sub_const (0, a)273 exact Z.comp x Z'274 exact hasFDerivAt_integral_of_dominated_of_fderiv_le (ball_mem_nhds _ Ξ΄pos) I1 I2 I3 I4 I5 I6275276/-- The convolution `f * g` is `C^n` when `f` is locally integrable and `g` is `C^n` and compactly277supported. Version where `g` depends on an additional parameter in an open subset `s` of a278parameter space `P` (and the compact support `k` is independent of the parameter in `s`).279In this version, all the types belong to the same universe (to get an induction working in the280proof). Use instead `contDiffOn_convolution_right_with_param`, which removes this restriction. -/281theorem contDiffOn_convolution_right_with_param_aux {G : Type uP} {E' : Type uP} {F : Type uP}282 {P : Type uP} [NormedAddCommGroup E'] [NormedAddCommGroup F] [NormedSpace π E']283 [NormedSpace β F] [NormedSpace π F] [MeasurableSpace G]284 {ΞΌ : Measure G}285 [NormedAddCommGroup G] [BorelSpace G] [NormedSpace π G] [NormedAddCommGroup P] [NormedSpace π P]286 {f : G β E} {n : ββ} (L : E βL[π] E' βL[π] F) {g : P β G β E'} {s : Set P} {k : Set G}287 (hs : IsOpen s) (hk : IsCompact k) (hgs : β p, β x, p β s β x β k β g p x = 0)288 (hf : LocallyIntegrable f ΞΌ) (hg : ContDiffOn π n βΏg (s ΓΛ’ univ)) :289 ContDiffOn π n (fun q : P Γ G => (f β[L, ΞΌ] g q.1) q.2) (s ΓΛ’ univ) := by290 /- We have a formula for the derivation of `f * g`, which is of the same form, thanks to291 `hasFDerivAt_convolution_right_with_param`. Therefore, we can prove the result by induction on292 `n` (but for this we need the spaces at the different steps of the induction to live in the same293 universe, which is why we make the assumption in the lemma that all the relevant spaces294 come from the same universe). -/295 induction n using ENat.nat_induction generalizing g E' F with296 | zero =>297 rw [WithTop.coe_zero, contDiffOn_zero] at hg β’298 exact continuousOn_convolution_right_with_param L hk hgs hf hg299 | succ n ih =>300 simp only [Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one, WithTop.coe_add,301 WithTop.coe_natCast, WithTop.coe_one] at hg β’302 let f' : P β G β P Γ G βL[π] F := fun p a =>303 (f β[L.precompR (P Γ G), ΞΌ] fun x : G => fderiv π (uncurry g) (p, x)) a304 have A : β qβ : P Γ G, qβ.1 β s β305 HasFDerivAt (fun q : P Γ G => (f β[L, ΞΌ] g q.1) q.2) (f' qβ.1 qβ.2) qβ :=306 hasFDerivAt_convolution_right_with_param L hs hk hgs hf hg.one_of_succ307 rw [contDiffOn_succ_iff_fderiv_of_isOpen (hs.prod (@isOpen_univ G _))] at hg β’308 refine β¨?_, by simp, ?_β©309 Β· rintro β¨p, xβ© β¨hp, -β©310 exact (A (p, x) hp).differentiableAt.differentiableWithinAt311 Β· suffices H : ContDiffOn π n βΏf' (s ΓΛ’ univ) by312 apply H.congr313 rintro β¨p, xβ© β¨hp, -β©314 exact (A (p, x) hp).fderiv315 have B : β (p : P) (x : G), p β s β x β k β fderiv π (uncurry g) (p, x) = 0 := by316 intro p x hp hx317 apply (hasFDerivAt_zero_of_eventually_const (0 : E') _).fderiv318 have M2 : kαΆ β π x := IsOpen.mem_nhds hk.isClosed.isOpen_compl hx319 have M1 : s β π p := hs.mem_nhds hp320 rw [nhds_prod_eq]321 filter_upwards [prod_mem_prod M1 M2]322 rintro β¨p, yβ© β¨hp, hyβ©323 exact hgs p y hp hy324 apply ih (L.precompR (P Γ G) :) B325 convert! hg.2.2326 | top ih =>327 rw [contDiffOn_infty] at hg β’328 exact fun n β¦ ih n L hgs (hg n)329330/-- The convolution `f * g` is `C^n` when `f` is locally integrable and `g` is `C^n` and compactly331supported. Version where `g` depends on an additional parameter in an open subset `s` of a332parameter space `P` (and the compact support `k` is independent of the parameter in `s`). -/333theorem contDiffOn_convolution_right_with_param {f : G β E} {n : ββ} (L : E βL[π] E' βL[π] F)334 {g : P β G β E'} {s : Set P} {k : Set G} (hs : IsOpen s) (hk : IsCompact k)335 (hgs : β p, β x, p β s β x β k β g p x = 0) (hf : LocallyIntegrable f ΞΌ)336 (hg : ContDiffOn π n βΏg (s ΓΛ’ univ)) :337 ContDiffOn π n (fun q : P Γ G => (f β[L, ΞΌ] g q.1) q.2) (s ΓΛ’ univ) := by338 /- The result is known when all the universes are the same, from339 `contDiffOn_convolution_right_with_param_aux`. We reduce to this situation by pushing340 everything through `ULift` continuous linear equivalences. -/341 let eG : Type max uG uE' uF uP := ULift.{max uE' uF uP} G342 borelize eG343 let eE' : Type max uE' uG uF uP := ULift.{max uG uF uP} E'344 let eF : Type max uF uG uE' uP := ULift.{max uG uE' uP} F345 let eP : Type max uP uG uE' uF := ULift.{max uG uE' uF} P346 let isoG : eG βL[π] G := ContinuousLinearEquiv.ulift347 let isoE' : eE' βL[π] E' := ContinuousLinearEquiv.ulift348 let isoF : eF βL[π] F := ContinuousLinearEquiv.ulift349 let isoP : eP βL[π] P := ContinuousLinearEquiv.ulift350 let ef := f β isoG351 let eΞΌ : Measure eG := Measure.map isoG.symm ΞΌ352 let eg : eP β eG β eE' := fun ep ex => isoE'.symm (g (isoP ep) (isoG ex))353 let eL :=354 ContinuousLinearMap.comp355 ((ContinuousLinearEquiv.arrowCongr isoE' isoF).symm : (E' βL[π] F) βL[π] eE' βL[π] eF) L356 let R := fun q : eP Γ eG => (ef β[eL, eΞΌ] eg q.1) q.2357 have R_contdiff : ContDiffOn π n R ((isoP β»ΒΉ' s) ΓΛ’ univ) := by358 have hek : IsCompact (isoG β»ΒΉ' k) := isoG.toHomeomorph.isClosedEmbedding.isCompact_preimage hk359 have hes : IsOpen (isoP β»ΒΉ' s) := isoP.continuous.isOpen_preimage _ hs360 refine contDiffOn_convolution_right_with_param_aux eL hes hek ?_ ?_ ?_361 Β· intro p x hp hx362 simp only [eg,363 ContinuousLinearEquiv.map_eq_zero_iff]364 exact hgs _ _ hp hx365 Β· exact (locallyIntegrable_map_homeomorph isoG.symm.toHomeomorph).2 hf366 Β· apply isoE'.symm.contDiff.comp_contDiffOn367 apply hg.comp (isoP.prodCongr isoG).contDiff.contDiffOn368 rintro β¨p, xβ© β¨hp, -β©369 simpa only [mem_preimage, ContinuousLinearEquiv.prodCongr_apply, prodMk_mem_set_prod_eq,370 mem_univ, and_true] using hp371 have A : ContDiffOn π n (isoF β R β (isoP.prodCongr isoG).symm) (s ΓΛ’ univ) := by372 apply isoF.contDiff.comp_contDiffOn373 apply R_contdiff.comp (ContinuousLinearEquiv.contDiff _).contDiffOn374 rintro β¨p, xβ© β¨hp, -β©375 simpa only [mem_preimage, mem_prod, mem_univ, and_true, ContinuousLinearEquiv.prodCongr_symm,376 ContinuousLinearEquiv.prodCongr_apply, ContinuousLinearEquiv.apply_symm_apply] using hp377 have : isoF β R β (isoP.prodCongr isoG).symm = fun q : P Γ G => (f β[L, ΞΌ] g q.1) q.2 := by378 apply funext379 rintro β¨p, xβ©380 simp only [(Β· β Β·), ContinuousLinearEquiv.prodCongr_symm, ContinuousLinearEquiv.prodCongr_apply]381 simp only [R, convolution]382 rw [IsClosedEmbedding.integral_map, β isoF.integral_comp_comm]383 Β· rfl384 Β· exact isoG.symm.toHomeomorph.isClosedEmbedding385 simp_rw [this] at A386 exact A387388/-- The convolution `f * g` is `C^n` when `f` is locally integrable and `g` is `C^n` and compactly389supported. Version where `g` depends on an additional parameter in an open subset `s` of a390parameter space `P` (and the compact support `k` is independent of the parameter in `s`),391given in terms of composition with an additional `C^n` function. -/392theorem contDiffOn_convolution_right_with_param_comp {n : ββ} (L : E βL[π] E' βL[π] F) {s : Set P}393 {v : P β G} (hv : ContDiffOn π n v s) {f : G β E} {g : P β G β E'} {k : Set G} (hs : IsOpen s)394 (hk : IsCompact k) (hgs : β p, β x, p β s β x β k β g p x = 0) (hf : LocallyIntegrable f ΞΌ)395 (hg : ContDiffOn π n βΏg (s ΓΛ’ univ)) : ContDiffOn π n (fun x => (f β[L, ΞΌ] g x) (v x)) s := by396 apply (contDiffOn_convolution_right_with_param L hs hk hgs hf hg).comp (contDiffOn_id.prodMk hv)397 intro x hx398 simp only [hx, prodMk_mem_set_prod_eq, mem_univ, and_self_iff, _root_.id]399400/-- The convolution `g * f` is `C^n` when `f` is locally integrable and `g` is `C^n` and compactly401supported. Version where `g` depends on an additional parameter in an open subset `s` of a402parameter space `P` (and the compact support `k` is independent of the parameter in `s`). -/403theorem contDiffOn_convolution_left_with_param [ΞΌ.IsAddLeftInvariant] [ΞΌ.IsNegInvariant]404 (L : E' βL[π] E βL[π] F) {f : G β E} {n : ββ} {g : P β G β E'} {s : Set P} {k : Set G}405 (hs : IsOpen s) (hk : IsCompact k) (hgs : β p, β x, p β s β x β k β g p x = 0)406 (hf : LocallyIntegrable f ΞΌ) (hg : ContDiffOn π n βΏg (s ΓΛ’ univ)) :407 ContDiffOn π n (fun q : P Γ G => (g q.1 β[L, ΞΌ] f) q.2) (s ΓΛ’ univ) := by408 simpa only [convolution_flip] using contDiffOn_convolution_right_with_param L.flip hs hk hgs hf hg409410/-- The convolution `g * f` is `C^n` when `f` is locally integrable and `g` is `C^n` and compactly411supported. Version where `g` depends on an additional parameter in an open subset `s` of a412parameter space `P` (and the compact support `k` is independent of the parameter in `s`),413given in terms of composition with additional `C^n` functions. -/414theorem contDiffOn_convolution_left_with_param_comp [ΞΌ.IsAddLeftInvariant] [ΞΌ.IsNegInvariant]415 (L : E' βL[π] E βL[π] F) {s : Set P} {n : ββ} {v : P β G} (hv : ContDiffOn π n v s) {f : G β E}416 {g : P β G β E'} {k : Set G} (hs : IsOpen s) (hk : IsCompact k)417 (hgs : β p, β x, p β s β x β k β g p x = 0) (hf : LocallyIntegrable f ΞΌ)418 (hg : ContDiffOn π n βΏg (s ΓΛ’ univ)) : ContDiffOn π n (fun x => (g x β[L, ΞΌ] f) (v x)) s := by419 apply (contDiffOn_convolution_left_with_param L hs hk hgs hf hg).comp (contDiffOn_id.prodMk hv)420 intro x hx421 simp only [hx, prodMk_mem_set_prod_eq, mem_univ, and_self_iff, _root_.id]422423theorem _root_.HasCompactSupport.contDiff_convolution_right {n : ββ} (hcg : HasCompactSupport g)424 (hf : LocallyIntegrable f ΞΌ) (hg : ContDiff π n g) : ContDiff π n (f β[L, ΞΌ] g) := by425 rcases exists_compact_iff_hasCompactSupport.2 hcg with β¨k, hk, h'kβ©426 rw [β contDiffOn_univ]427 exact contDiffOn_convolution_right_with_param_comp L contDiffOn_id isOpen_univ hk428 (fun p x _ hx => h'k x hx) hf (hg.comp contDiff_snd).contDiffOn429430theorem _root_.HasCompactSupport.contDiff_convolution_left [ΞΌ.IsAddLeftInvariant] [ΞΌ.IsNegInvariant]431 {n : ββ} (hcf : HasCompactSupport f) (hf : ContDiff π n f) (hg : LocallyIntegrable g ΞΌ) :432 ContDiff π n (f β[L, ΞΌ] g) := by433 rw [β convolution_flip]434 exact hcf.contDiff_convolution_right L.flip hg hf435436end WithParam437438end MeasureTheory