analysis.schwartz_space ⟷ Mathlib.Analysis.Distribution.SchwartzSpace

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -187,7 +187,7 @@ theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
   simp_rw [Asymptotics.IsBigO, Asymptotics.IsBigOWith]
   refine' ⟨1, Filter.eventually_of_mem (Filter.eventually_ge_atTop 1) fun x hx => _⟩
   rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg (zero_le_one.trans hx) _),
-    Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_int_cast, Int.cast_neg,
+    Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_intCast, Int.cast_neg,
     Int.cast_natCast]
   exact Real.rpow_le_rpow_of_exponent_le hx hk
 #align schwartz_map.is_O_cocompact_rpow SchwartzMap.isBigO_cocompact_rpow
@@ -196,7 +196,7 @@ theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
 #print SchwartzMap.isBigO_cocompact_zpow /-
 theorem isBigO_cocompact_zpow [ProperSpace E] (k : β„€) :
     Asymptotics.IsBigO (Filter.cocompact E) f fun x => β€–xβ€– ^ k := by
-  simpa only [Real.rpow_int_cast] using is_O_cocompact_rpow f k
+  simpa only [Real.rpow_intCast] using is_O_cocompact_rpow f k
 #align schwartz_map.is_O_cocompact_zpow SchwartzMap.isBigO_cocompact_zpow
 -/
 
Diff
@@ -188,7 +188,7 @@ theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
   refine' ⟨1, Filter.eventually_of_mem (Filter.eventually_ge_atTop 1) fun x hx => _⟩
   rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg (zero_le_one.trans hx) _),
     Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_int_cast, Int.cast_neg,
-    Int.cast_ofNat]
+    Int.cast_natCast]
   exact Real.rpow_le_rpow_of_exponent_le hx hk
 #align schwartz_map.is_O_cocompact_rpow SchwartzMap.isBigO_cocompact_rpow
 -/
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2022 Moritz Doll. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 -/
-import Analysis.Calculus.ContDiff
-import Analysis.Calculus.IteratedDeriv
+import Analysis.Calculus.ContDiff.Basic
+import Analysis.Calculus.IteratedDeriv.Defs
 import Analysis.LocallyConvex.WithSeminorms
 import Topology.Algebra.UniformFilterBasis
 import Topology.ContinuousFunction.Bounded
@@ -901,7 +901,7 @@ section Comp
 
 variable (π•œ)
 
-variable [IsROrC π•œ]
+variable [RCLike π•œ]
 
 variable [NormedAddCommGroup D] [NormedSpace ℝ D]
 
@@ -993,7 +993,7 @@ section Derivatives
 
 variable (π•œ)
 
-variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+variable [RCLike π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
 #print SchwartzMap.fderivCLM /-
 /-- The FrΓ©chet derivative on Schwartz space as a continuous `π•œ`-linear map. -/
@@ -1130,7 +1130,7 @@ def toContinuousMap (f : 𝓒(E, F)) : C(E, F) :=
 
 variable (π•œ E F)
 
-variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+variable [RCLike π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
 #print SchwartzMap.toBoundedContinuousFunctionCLM /-
 /-- The inclusion map from Schwartz functions to bounded continuous functions as a linear map. -/
Diff
@@ -163,7 +163,7 @@ theorem isBigO_cocompact_zpow_neg_nat (k : β„•) :
     Asymptotics.IsBigO (Filter.cocompact E) f fun x => β€–xβ€– ^ (-k : β„€) :=
   by
   obtain ⟨d, hd, hd'⟩ := f.decay k 0
-  simp_rw [norm_iteratedFDeriv_zero] at hd' 
+  simp_rw [norm_iteratedFDeriv_zero] at hd'
   simp_rw [Asymptotics.IsBigO, Asymptotics.IsBigOWith]
   refine' ⟨d, Filter.Eventually.filter_mono Filter.cocompact_le_cofinite _⟩
   refine' (Filter.eventually_cofinite_ne 0).mp (Filter.eventually_of_forall fun x hx => _)
@@ -567,7 +567,7 @@ theorem norm_iteratedFDeriv_le_seminorm (f : 𝓒(E, F)) (n : β„•) (xβ‚€ : E) :
     β€–iteratedFDeriv ℝ n f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ 0 n) f :=
   by
   have := SchwartzMap.le_seminorm π•œ 0 n f xβ‚€
-  rwa [pow_zero, one_mul] at this 
+  rwa [pow_zero, one_mul] at this
 #align schwartz_map.norm_iterated_fderiv_le_seminorm SchwartzMap.norm_iteratedFDeriv_le_seminorm
 -/
 
@@ -576,7 +576,7 @@ theorem norm_pow_mul_le_seminorm (f : 𝓒(E, F)) (k : β„•) (xβ‚€ : E) :
     β€–xβ‚€β€– ^ k * β€–f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ k 0) f :=
   by
   have := SchwartzMap.le_seminorm π•œ k 0 f xβ‚€
-  rwa [norm_iteratedFDeriv_zero] at this 
+  rwa [norm_iteratedFDeriv_zero] at this
 #align schwartz_map.norm_pow_mul_le_seminorm SchwartzMap.norm_pow_mul_le_seminorm
 -/
 
@@ -584,7 +584,7 @@ theorem norm_pow_mul_le_seminorm (f : 𝓒(E, F)) (k : β„•) (xβ‚€ : E) :
 theorem norm_le_seminorm (f : 𝓒(E, F)) (xβ‚€ : E) : β€–f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ 0 0) f :=
   by
   have := norm_pow_mul_le_seminorm π•œ f 0 xβ‚€
-  rwa [pow_zero, one_mul] at this 
+  rwa [pow_zero, one_mul] at this
 #align schwartz_map.norm_le_seminorm SchwartzMap.norm_le_seminorm
 -/
 
@@ -720,7 +720,7 @@ theorem Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f : E 
   have hC' : 0 ≀ C' := by simp only [le_refl, Finset.le_sup'_iff, true_or_iff, le_max_iff]
   use C', hC'
   intro N hN x
-  rw [← Finset.mem_range_succ_iff] at hN 
+  rw [← Finset.mem_range_succ_iff] at hN
   refine' le_trans (f N x) (mul_le_mul _ _ (by positivity) hC')
   Β· simp only [Finset.le_sup'_iff, le_max_iff]
     right
@@ -884,8 +884,8 @@ def bilinLeftCLM (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemper
       refine' mul_le_mul_of_nonneg_left _ hC
       nth_rw 2 [mul_comm]
       rw [← mul_assoc]
-      rw [Finset.mem_range_succ_iff] at hi 
-      change i ≀ (l + k, n).snd at hi 
+      rw [Finset.mem_range_succ_iff] at hi
+      change i ≀ (l + k, n).snd at hi
       refine' le_trans _ (one_add_le_sup_seminorm_apply le_rfl hi f x)
       refine' mul_le_mul_of_nonneg_right _ (norm_nonneg _)
       rw [pow_add]
@@ -926,7 +926,7 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
       have hCg : 1 ≀ 1 + Cg := by
         refine' le_add_of_nonneg_right _
         specialize hg_upper' 0
-        rw [norm_zero] at hg_upper' 
+        rw [norm_zero] at hg_upper'
         refine' nonneg_of_mul_nonneg_left hg_upper' (by positivity)
       let k' := kg * (k + l * n)
       use Finset.Iic (k', n), (1 + Cg) ^ (k + l * n) * ((C + 1) ^ n * n ! * 2 ^ k'), by positivity
@@ -947,7 +947,7 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
         intro i hi
         have hpos : 0 < (1 + β€–g xβ€–) ^ k' := by positivity
         rw [le_div_iff' hpos]
-        change i ≀ (k', n).snd at hi 
+        change i ≀ (k', n).snd at hi
         exact one_add_le_sup_seminorm_apply le_rfl hi _ _
       have hgrowth' :
         βˆ€ (N : β„•) (hN₁ : 1 ≀ N) (hNβ‚‚ : N ≀ n),
@@ -974,7 +974,7 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
         ring
       rw [rearrange]
       have hgxk' : 0 < (1 + β€–g xβ€–) ^ k' := by positivity
-      rw [← div_le_iff hgxk'] at hg_upper'' 
+      rw [← div_le_iff hgxk'] at hg_upper''
       have hpos : 0 ≀ (C + 1) ^ n * n ! * 2 ^ k' * seminorm_f :=
         by
         have : 0 ≀ seminorm_f := map_nonneg _ _
@@ -1132,29 +1132,31 @@ variable (π•œ E F)
 
 variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
-#print SchwartzMap.toBoundedContinuousFunctionLM /-
+#print SchwartzMap.toBoundedContinuousFunctionCLM /-
 /-- The inclusion map from Schwartz functions to bounded continuous functions as a linear map. -/
-def toBoundedContinuousFunctionLM : 𝓒(E, F) β†’β‚—[π•œ] E →ᡇ F
+def toBoundedContinuousFunctionCLM : 𝓒(E, F) β†’β‚—[π•œ] E →ᡇ F
     where
   toFun f := f.toBoundedContinuousFunction
   map_add' f g := by ext; exact add_apply
   map_smul' a f := by ext; exact smul_apply
-#align schwartz_map.to_bounded_continuous_function_lm SchwartzMap.toBoundedContinuousFunctionLM
+#align schwartz_map.to_bounded_continuous_function_lm SchwartzMap.toBoundedContinuousFunctionCLM
 -/
 
-#print SchwartzMap.toBoundedContinuousFunctionLM_apply /-
+#print SchwartzMap.toBoundedContinuousFunctionCLM_apply /-
 @[simp]
-theorem toBoundedContinuousFunctionLM_apply (f : 𝓒(E, F)) (x : E) :
-    toBoundedContinuousFunctionLM π•œ E F f x = f x :=
+theorem toBoundedContinuousFunctionCLM_apply (f : 𝓒(E, F)) (x : E) :
+    toBoundedContinuousFunctionCLM π•œ E F f x = f x :=
   rfl
-#align schwartz_map.to_bounded_continuous_function_lm_apply SchwartzMap.toBoundedContinuousFunctionLM_apply
+#align schwartz_map.to_bounded_continuous_function_lm_apply SchwartzMap.toBoundedContinuousFunctionCLM_apply
 -/
 
+/- warning: schwartz_map.to_bounded_continuous_function_clm clashes with schwartz_map.to_bounded_continuous_function_lm -> SchwartzMap.toBoundedContinuousFunctionCLM
+Case conversion may be inaccurate. Consider using '#align schwartz_map.to_bounded_continuous_function_clm SchwartzMap.toBoundedContinuousFunctionCLMβ‚“'. -/
 #print SchwartzMap.toBoundedContinuousFunctionCLM /-
 /-- The inclusion map from Schwartz functions to bounded continuous functions as a continuous linear
 map. -/
 def toBoundedContinuousFunctionCLM : 𝓒(E, F) β†’L[π•œ] E →ᡇ F :=
-  { toBoundedContinuousFunctionLM π•œ E F with
+  { toBoundedContinuousFunctionCLM π•œ E F with
     cont := by
       change Continuous (to_bounded_continuous_function_lm π•œ E F)
       refine'
@@ -1167,6 +1169,8 @@ def toBoundedContinuousFunctionCLM : 𝓒(E, F) β†’L[π•œ] E →ᡇ F :=
 #align schwartz_map.to_bounded_continuous_function_clm SchwartzMap.toBoundedContinuousFunctionCLM
 -/
 
+/- warning: schwartz_map.to_bounded_continuous_function_clm_apply clashes with schwartz_map.to_bounded_continuous_function_lm_apply -> SchwartzMap.toBoundedContinuousFunctionCLM_apply
+Case conversion may be inaccurate. Consider using '#align schwartz_map.to_bounded_continuous_function_clm_apply SchwartzMap.toBoundedContinuousFunctionCLM_applyβ‚“'. -/
 #print SchwartzMap.toBoundedContinuousFunctionCLM_apply /-
 @[simp]
 theorem toBoundedContinuousFunctionCLM_apply (f : 𝓒(E, F)) (x : E) :
Diff
@@ -1180,7 +1180,7 @@ variable {E}
 #print SchwartzMap.delta /-
 /-- The Dirac delta distribution -/
 def delta (x : E) : 𝓒(E, F) β†’L[π•œ] F :=
-  (BoundedContinuousFunction.evalClm π•œ x).comp (toBoundedContinuousFunctionCLM π•œ E F)
+  (BoundedContinuousFunction.evalCLM π•œ x).comp (toBoundedContinuousFunctionCLM π•œ E F)
 #align schwartz_map.delta SchwartzMap.delta
 -/
 
Diff
@@ -93,12 +93,12 @@ namespace SchwartzMap
 instance : Coe 𝓒(E, F) (E β†’ F) :=
   ⟨toFun⟩
 
-#print SchwartzMap.instDFunLike /-
-instance instDFunLike : DFunLike 𝓒(E, F) E fun _ => F
+#print SchwartzMap.instFunLike /-
+instance instFunLike : DFunLike 𝓒(E, F) E fun _ => F
     where
   coe f := f.toFun
   coe_injective' f g h := by cases f <;> cases g <;> congr
-#align schwartz_map.fun_like SchwartzMap.instDFunLike
+#align schwartz_map.fun_like SchwartzMap.instFunLike
 -/
 
 /-- Helper instance for when there's too many metavariables to apply `fun_like.has_coe_to_fun`. -/
Diff
@@ -93,12 +93,12 @@ namespace SchwartzMap
 instance : Coe 𝓒(E, F) (E β†’ F) :=
   ⟨toFun⟩
 
-#print SchwartzMap.instFunLike /-
-instance instFunLike : FunLike 𝓒(E, F) E fun _ => F
+#print SchwartzMap.instDFunLike /-
+instance instDFunLike : DFunLike 𝓒(E, F) E fun _ => F
     where
   coe f := f.toFun
   coe_injective' f g h := by cases f <;> cases g <;> congr
-#align schwartz_map.fun_like SchwartzMap.instFunLike
+#align schwartz_map.fun_like SchwartzMap.instDFunLike
 -/
 
 /-- Helper instance for when there's too many metavariables to apply `fun_like.has_coe_to_fun`. -/
@@ -149,7 +149,7 @@ theorem differentiableAt (f : 𝓒(E, F)) {x : E} : DifferentiableAt ℝ f x :=
 #print SchwartzMap.ext /-
 @[ext]
 theorem ext {f g : 𝓒(E, F)} (h : βˆ€ x, (f : E β†’ F) x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align schwartz_map.ext SchwartzMap.ext
 -/
 
@@ -464,7 +464,7 @@ end Sub
 section AddCommGroup
 
 instance : AddCommGroup 𝓒(E, F) :=
-  FunLike.coe_injective.AddCommGroup _ rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
+  DFunLike.coe_injective.AddCommGroup _ rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
     (fun _ _ => rfl) fun _ _ => rfl
 
 variable (E F)
@@ -488,7 +488,7 @@ theorem coe_coeHom : (coeHom E F : 𝓒(E, F) β†’ E β†’ F) = coeFn :=
 
 #print SchwartzMap.coeHom_injective /-
 theorem coeHom_injective : Function.Injective (coeHom E F) := by rw [coe_coe_hom];
-  exact FunLike.coe_injective
+  exact DFunLike.coe_injective
 #align schwartz_map.coe_hom_injective SchwartzMap.coeHom_injective
 -/
 
Diff
@@ -186,7 +186,7 @@ theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
       tendsto_norm_cocompact_atTop
   simp_rw [Asymptotics.IsBigO, Asymptotics.IsBigOWith]
   refine' ⟨1, Filter.eventually_of_mem (Filter.eventually_ge_atTop 1) fun x hx => _⟩
-  rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg_of_nonneg (zero_le_one.trans hx) _),
+  rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg (zero_le_one.trans hx) _),
     Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_int_cast, Int.cast_neg,
     Int.cast_ofNat]
   exact Real.rpow_le_rpow_of_exponent_le hx hk
Diff
@@ -725,7 +725,7 @@ theorem Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f : E 
   Β· simp only [Finset.le_sup'_iff, le_max_iff]
     right
     exact ⟨N, hN, rfl.le⟩
-  refine' pow_le_pow (by simp only [le_add_iff_nonneg_right, norm_nonneg]) _
+  refine' pow_le_pow_right (by simp only [le_add_iff_nonneg_right, norm_nonneg]) _
   exact Finset.le_sup hN
 #align function.has_temperate_growth.norm_iterated_fderiv_le_uniform_aux Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux
 -/
@@ -890,7 +890,7 @@ def bilinLeftCLM (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemper
       refine' mul_le_mul_of_nonneg_right _ (norm_nonneg _)
       rw [pow_add]
       refine' mul_le_mul_of_nonneg_left _ (by positivity)
-      refine' pow_le_pow_of_le_left (norm_nonneg _) _ _
+      refine' pow_le_pow_left (norm_nonneg _) _ _
       simp only [zero_le_one, le_add_iff_nonneg_left])
 #align schwartz_map.bilin_left_clm SchwartzMap.bilinLeftCLM
 -/
@@ -935,7 +935,7 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
       have hg_upper'' : (1 + β€–xβ€–) ^ (k + l * n) ≀ (1 + Cg) ^ (k + l * n) * (1 + β€–g xβ€–) ^ k' :=
         by
         rw [pow_mul, ← mul_pow]
-        refine' pow_le_pow_of_le_left (by positivity) _ _
+        refine' pow_le_pow_left (by positivity) _ _
         rw [add_mul]
         refine' add_le_add _ (hg_upper' x)
         nth_rw 1 [← one_mul (1 : ℝ)]
@@ -963,7 +963,7 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
           simp only [le_add_iff_nonneg_right, norm_nonneg]
       have := norm_iteratedFDeriv_comp_le f.smooth' hg.1 le_top x hbound hgrowth'
       have hxk : β€–xβ€– ^ k ≀ (1 + β€–xβ€–) ^ k :=
-        pow_le_pow_of_le_left (norm_nonneg _) (by simp only [zero_le_one, le_add_iff_nonneg_left]) _
+        pow_le_pow_left (norm_nonneg _) (by simp only [zero_le_one, le_add_iff_nonneg_left]) _
       refine' le_trans (mul_le_mul hxk this (by positivity) (by positivity)) _
       have rearrange :
         (1 + β€–xβ€–) ^ k *
Diff
@@ -690,7 +690,7 @@ instance : UniformAddGroup 𝓒(E, F) :=
 instance : LocallyConvexSpace ℝ 𝓒(E, F) :=
   (schwartz_withSeminorms ℝ E F).toLocallyConvexSpace
 
-instance : TopologicalSpace.FirstCountableTopology 𝓒(E, F) :=
+instance : FirstCountableTopology 𝓒(E, F) :=
   (schwartz_withSeminorms ℝ E F).first_countable
 
 end Topology
Diff
@@ -3,13 +3,13 @@ Copyright (c) 2022 Moritz Doll. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 -/
-import Mathbin.Analysis.Calculus.ContDiff
-import Mathbin.Analysis.Calculus.IteratedDeriv
-import Mathbin.Analysis.LocallyConvex.WithSeminorms
-import Mathbin.Topology.Algebra.UniformFilterBasis
-import Mathbin.Topology.ContinuousFunction.Bounded
-import Mathbin.Tactic.Positivity
-import Mathbin.Analysis.SpecialFunctions.Pow.Real
+import Analysis.Calculus.ContDiff
+import Analysis.Calculus.IteratedDeriv
+import Analysis.LocallyConvex.WithSeminorms
+import Topology.Algebra.UniformFilterBasis
+import Topology.ContinuousFunction.Bounded
+import Tactic.Positivity
+import Analysis.SpecialFunctions.Pow.Real
 
 #align_import analysis.schwartz_space from "leanprover-community/mathlib"@"f2ad3645af9effcdb587637dc28a6074edc813f9"
 
Diff
@@ -715,7 +715,7 @@ theorem Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f : E 
       βˆ€ (N : β„•) (hN : N ≀ n) (x : E), β€–iteratedFDeriv ℝ N f xβ€– ≀ C * (1 + β€–xβ€–) ^ k :=
   by
   choose k C f using hf_temperate.2
-  use (Finset.range (n + 1)).sup k
+  use(Finset.range (n + 1)).sup k
   let C' := max (0 : ℝ) ((Finset.range (n + 1)).sup' (by simp) C)
   have hC' : 0 ≀ C' := by simp only [le_refl, Finset.le_sup'_iff, true_or_iff, le_max_iff]
   use C', hC'
@@ -818,7 +818,7 @@ def evalCLM (m : E) : 𝓒(E, E β†’L[ℝ] F) β†’L[π•œ] 𝓒(E, F) :=
     (fun f => ContDiff.clm_apply f.2 contDiff_const)
     (by
       rintro ⟨k, n⟩
-      use {(k, n)}, β€–mβ€–, norm_nonneg _
+      use{(k, n)}, β€–mβ€–, norm_nonneg _
       intro f x
       refine'
         le_trans
@@ -1088,7 +1088,7 @@ theorem iteratedPDeriv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E,
   Β· rw [iterated_pderiv_zero, iterated_pderiv_one]
     rfl
   -- The proof is `βˆ‚^{n + 2} = βˆ‚ βˆ‚^{n + 1} = βˆ‚ βˆ‚^n βˆ‚ = βˆ‚^{n+1} βˆ‚`
-  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSucc_zero]
+  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSucc_zero']
   have hmtail : Fin.tail m (Fin.last n) = m (Fin.last n.succ) := by
     simp only [Fin.tail_def, Fin.succ_last]
   simp only [iterated_pderiv_succ_left, IH (Fin.tail m), hmzero, hmtail, Fin.tail_init_eq_init_tail]
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2022 Moritz Doll. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
-
-! This file was ported from Lean 3 source module analysis.schwartz_space
-! leanprover-community/mathlib commit f2ad3645af9effcdb587637dc28a6074edc813f9
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Calculus.ContDiff
 import Mathbin.Analysis.Calculus.IteratedDeriv
@@ -16,6 +11,8 @@ import Mathbin.Topology.ContinuousFunction.Bounded
 import Mathbin.Tactic.Positivity
 import Mathbin.Analysis.SpecialFunctions.Pow.Real
 
+#align_import analysis.schwartz_space from "leanprover-community/mathlib"@"f2ad3645af9effcdb587637dc28a6074edc813f9"
+
 /-!
 # Schwartz space
 
Diff
@@ -1091,7 +1091,7 @@ theorem iteratedPDeriv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E,
   Β· rw [iterated_pderiv_zero, iterated_pderiv_one]
     rfl
   -- The proof is `βˆ‚^{n + 2} = βˆ‚ βˆ‚^{n + 1} = βˆ‚ βˆ‚^n βˆ‚ = βˆ‚^{n+1} βˆ‚`
-  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSuccEmb_zero]
+  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSucc_zero]
   have hmtail : Fin.tail m (Fin.last n) = m (Fin.last n.succ) := by
     simp only [Fin.tail_def, Fin.succ_last]
   simp only [iterated_pderiv_succ_left, IH (Fin.tail m), hmzero, hmtail, Fin.tail_init_eq_init_tail]
Diff
@@ -1091,7 +1091,7 @@ theorem iteratedPDeriv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E,
   Β· rw [iterated_pderiv_zero, iterated_pderiv_one]
     rfl
   -- The proof is `βˆ‚^{n + 2} = βˆ‚ βˆ‚^{n + 1} = βˆ‚ βˆ‚^n βˆ‚ = βˆ‚^{n+1} βˆ‚`
-  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSucc_zero]
+  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSuccEmb_zero]
   have hmtail : Fin.tail m (Fin.last n) = m (Fin.last n.succ) := by
     simp only [Fin.tail_def, Fin.succ_last]
   simp only [iterated_pderiv_succ_left, IH (Fin.tail m), hmzero, hmtail, Fin.tail_init_eq_init_tail]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 
 ! This file was ported from Lean 3 source module analysis.schwartz_space
-! leanprover-community/mathlib commit e137999b2c6f2be388f4cd3bbf8523de1910cd2b
+! leanprover-community/mathlib commit f2ad3645af9effcdb587637dc28a6074edc813f9
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -19,6 +19,9 @@ import Mathbin.Analysis.SpecialFunctions.Pow.Real
 /-!
 # Schwartz space
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines the Schwartz space. Usually, the Schwartz space is defined as the set of smooth
 functions $f : ℝ^n β†’ β„‚$ such that there exists $C_{Ξ±Ξ²} > 0$ with $$|x^Ξ± βˆ‚^Ξ² f(x)| < C_{Ξ±Ξ²}$$ for
 all $x ∈ ℝ^n$ and for all multiindices $Ξ±, Ξ²$.
Diff
@@ -74,6 +74,7 @@ variable [NormedAddCommGroup F] [NormedSpace ℝ F]
 
 variable (E F)
 
+#print SchwartzMap /-
 /-- A function is a Schwartz function if it is smooth and all derivatives decay faster than
   any power of `β€–xβ€–`. -/
 structure SchwartzMap where
@@ -81,6 +82,7 @@ structure SchwartzMap where
   smooth' : ContDiff ℝ ⊀ to_fun
   decay' : βˆ€ k n : β„•, βˆƒ C : ℝ, βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n to_fun xβ€– ≀ C
 #align schwartz_map SchwartzMap
+-/
 
 scoped[SchwartzSpace] notation "𝓒(" E ", " F ")" => SchwartzMap E F
 
@@ -91,16 +93,19 @@ namespace SchwartzMap
 instance : Coe 𝓒(E, F) (E β†’ F) :=
   ⟨toFun⟩
 
-instance funLike : FunLike 𝓒(E, F) E fun _ => F
+#print SchwartzMap.instFunLike /-
+instance instFunLike : FunLike 𝓒(E, F) E fun _ => F
     where
   coe f := f.toFun
   coe_injective' f g h := by cases f <;> cases g <;> congr
-#align schwartz_map.fun_like SchwartzMap.funLike
+#align schwartz_map.fun_like SchwartzMap.instFunLike
+-/
 
 /-- Helper instance for when there's too many metavariables to apply `fun_like.has_coe_to_fun`. -/
 instance : CoeFun 𝓒(E, F) fun _ => E β†’ F :=
   ⟨fun p => p.toFun⟩
 
+#print SchwartzMap.decay /-
 /-- All derivatives of a Schwartz function are rapidly decaying. -/
 theorem decay (f : 𝓒(E, F)) (k n : β„•) :
     βˆƒ (C : ℝ) (hC : 0 < C), βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ C :=
@@ -108,39 +113,51 @@ theorem decay (f : 𝓒(E, F)) (k n : β„•) :
   rcases f.decay' k n with ⟨C, hC⟩
   exact ⟨max C 1, by positivity, fun x => (hC x).trans (le_max_left _ _)⟩
 #align schwartz_map.decay SchwartzMap.decay
+-/
 
+#print SchwartzMap.smooth /-
 /-- Every Schwartz function is smooth. -/
 theorem smooth (f : 𝓒(E, F)) (n : β„•βˆž) : ContDiff ℝ n f :=
   f.smooth'.of_le le_top
 #align schwartz_map.smooth SchwartzMap.smooth
+-/
 
+#print SchwartzMap.continuous /-
 /-- Every Schwartz function is continuous. -/
 @[continuity, protected]
 theorem continuous (f : 𝓒(E, F)) : Continuous f :=
   (f.smooth 0).Continuous
 #align schwartz_map.continuous SchwartzMap.continuous
+-/
 
+#print SchwartzMap.differentiable /-
 /-- Every Schwartz function is differentiable. -/
 @[protected]
 theorem differentiable (f : 𝓒(E, F)) : Differentiable ℝ f :=
   (f.smooth 1).Differentiable rfl.le
 #align schwartz_map.differentiable SchwartzMap.differentiable
+-/
 
+#print SchwartzMap.differentiableAt /-
 /-- Every Schwartz function is differentiable at any point. -/
 @[protected]
 theorem differentiableAt (f : 𝓒(E, F)) {x : E} : DifferentiableAt ℝ f x :=
   f.Differentiable.DifferentiableAt
 #align schwartz_map.differentiable_at SchwartzMap.differentiableAt
+-/
 
+#print SchwartzMap.ext /-
 @[ext]
 theorem ext {f g : 𝓒(E, F)} (h : βˆ€ x, (f : E β†’ F) x = g x) : f = g :=
   FunLike.ext f g h
 #align schwartz_map.ext SchwartzMap.ext
+-/
 
 section IsO
 
 variable (f : 𝓒(E, F))
 
+#print SchwartzMap.isBigO_cocompact_zpow_neg_nat /-
 /-- Auxiliary lemma, used in proving the more general result `is_O_cocompact_zpow`. -/
 theorem isBigO_cocompact_zpow_neg_nat (k : β„•) :
     Asymptotics.IsBigO (Filter.cocompact E) f fun x => β€–xβ€– ^ (-k : β„€) :=
@@ -153,7 +170,9 @@ theorem isBigO_cocompact_zpow_neg_nat (k : β„•) :
   rwa [Real.norm_of_nonneg (zpow_nonneg (norm_nonneg _) _), zpow_neg, ← div_eq_mul_inv, le_div_iff']
   exacts [hd' x, zpow_pos_of_pos (norm_pos_iff.mpr hx) _]
 #align schwartz_map.is_O_cocompact_zpow_neg_nat SchwartzMap.isBigO_cocompact_zpow_neg_nat
+-/
 
+#print SchwartzMap.isBigO_cocompact_rpow /-
 theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
     Asymptotics.IsBigO (Filter.cocompact E) f fun x => β€–xβ€– ^ s :=
   by
@@ -172,27 +191,35 @@ theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
     Int.cast_ofNat]
   exact Real.rpow_le_rpow_of_exponent_le hx hk
 #align schwartz_map.is_O_cocompact_rpow SchwartzMap.isBigO_cocompact_rpow
+-/
 
+#print SchwartzMap.isBigO_cocompact_zpow /-
 theorem isBigO_cocompact_zpow [ProperSpace E] (k : β„€) :
     Asymptotics.IsBigO (Filter.cocompact E) f fun x => β€–xβ€– ^ k := by
   simpa only [Real.rpow_int_cast] using is_O_cocompact_rpow f k
 #align schwartz_map.is_O_cocompact_zpow SchwartzMap.isBigO_cocompact_zpow
+-/
 
 end IsO
 
 section Aux
 
+#print SchwartzMap.bounds_nonempty /-
 theorem bounds_nonempty (k n : β„•) (f : 𝓒(E, F)) :
     βˆƒ c : ℝ, c ∈ {c : ℝ | 0 ≀ c ∧ βˆ€ x : E, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c} :=
   let ⟨M, hMp, hMb⟩ := f.decay k n
   ⟨M, le_of_lt hMp, hMb⟩
 #align schwartz_map.bounds_nonempty SchwartzMap.bounds_nonempty
+-/
 
+#print SchwartzMap.bounds_bddBelow /-
 theorem bounds_bddBelow (k n : β„•) (f : 𝓒(E, F)) :
     BddBelow {c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c} :=
   ⟨0, fun _ ⟨hn, _⟩ => hn⟩
 #align schwartz_map.bounds_bdd_below SchwartzMap.bounds_bddBelow
+-/
 
+#print SchwartzMap.decay_add_le_aux /-
 theorem decay_add_le_aux (k n : β„•) (f g : 𝓒(E, F)) (x : E) :
     β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n (f + g) xβ€– ≀
       β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– + β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n g xβ€– :=
@@ -202,7 +229,9 @@ theorem decay_add_le_aux (k n : β„•) (f g : 𝓒(E, F)) (x : E) :
   convert norm_add_le _ _
   exact iteratedFDeriv_add_apply (f.smooth _) (g.smooth _)
 #align schwartz_map.decay_add_le_aux SchwartzMap.decay_add_le_aux
+-/
 
+#print SchwartzMap.decay_neg_aux /-
 theorem decay_neg_aux (k n : β„•) (f : 𝓒(E, F)) (x : E) :
     β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n (-f) xβ€– = β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– :=
   by
@@ -210,38 +239,49 @@ theorem decay_neg_aux (k n : β„•) (f : 𝓒(E, F)) (x : E) :
   congr
   exact iteratedFDeriv_neg_apply
 #align schwartz_map.decay_neg_aux SchwartzMap.decay_neg_aux
+-/
 
 variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
+#print SchwartzMap.decay_smul_aux /-
 theorem decay_smul_aux (k n : β„•) (f : 𝓒(E, F)) (c : π•œ) (x : E) :
     β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n (c β€’ f) xβ€– = β€–cβ€– * β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– := by
   rw [mul_comm β€–cβ€–, mul_assoc, iteratedFDeriv_const_smul_apply (f.smooth _), norm_smul]
 #align schwartz_map.decay_smul_aux SchwartzMap.decay_smul_aux
+-/
 
 end Aux
 
 section SeminormAux
 
+#print SchwartzMap.seminormAux /-
 /-- Helper definition for the seminorms of the Schwartz space. -/
 @[protected]
 def seminormAux (k n : β„•) (f : 𝓒(E, F)) : ℝ :=
   sInf {c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c}
 #align schwartz_map.seminorm_aux SchwartzMap.seminormAux
+-/
 
+#print SchwartzMap.seminormAux_nonneg /-
 theorem seminormAux_nonneg (k n : β„•) (f : 𝓒(E, F)) : 0 ≀ f.seminormAux k n :=
   le_csInf (bounds_nonempty k n f) fun _ ⟨hx, _⟩ => hx
 #align schwartz_map.seminorm_aux_nonneg SchwartzMap.seminormAux_nonneg
+-/
 
+#print SchwartzMap.le_seminormAux /-
 theorem le_seminormAux (k n : β„•) (f : 𝓒(E, F)) (x : E) :
     β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n (⇑f) xβ€– ≀ f.seminormAux k n :=
   le_csInf (bounds_nonempty k n f) fun y ⟨_, h⟩ => h x
 #align schwartz_map.le_seminorm_aux SchwartzMap.le_seminormAux
+-/
 
+#print SchwartzMap.seminormAux_le_bound /-
 /-- If one controls the norm of every `A x`, then one controls the norm of `A`. -/
 theorem seminormAux_le_bound (k n : β„•) (f : 𝓒(E, F)) {M : ℝ} (hMp : 0 ≀ M)
     (hM : βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ M) : f.seminormAux k n ≀ M :=
   csInf_le (bounds_bddBelow k n f) ⟨hMp, hM⟩
 #align schwartz_map.seminorm_aux_le_bound SchwartzMap.seminormAux_le_bound
+-/
 
 end SeminormAux
 
@@ -268,10 +308,12 @@ instance : SMul π•œ 𝓒(E, F) :=
         Β· apply mul_le_mul_of_nonneg_left _ (f.seminorm_aux_nonneg k n)
           linarith }⟩
 
+#print SchwartzMap.smul_apply /-
 @[simp]
 theorem smul_apply {f : 𝓒(E, F)} {c : π•œ} {x : E} : (c β€’ f) x = c β€’ f x :=
   rfl
 #align schwartz_map.smul_apply SchwartzMap.smul_apply
+-/
 
 instance [SMul π•œ π•œ'] [IsScalarTower π•œ π•œ' F] : IsScalarTower π•œ π•œ' 𝓒(E, F) :=
   ⟨fun a b f => ext fun x => smul_assoc a b (f x)⟩
@@ -279,6 +321,7 @@ instance [SMul π•œ π•œ'] [IsScalarTower π•œ π•œ' F] : IsScalarTower π•œ 
 instance [SMulCommClass π•œ π•œ' F] : SMulCommClass π•œ π•œ' 𝓒(E, F) :=
   ⟨fun a b f => ext fun x => smul_comm a b (f x)⟩
 
+#print SchwartzMap.seminormAux_smul_le /-
 theorem seminormAux_smul_le (k n : β„•) (c : π•œ) (f : 𝓒(E, F)) :
     (c β€’ f).seminormAux k n ≀ β€–cβ€– * f.seminormAux k n :=
   by
@@ -288,8 +331,10 @@ theorem seminormAux_smul_le (k n : β„•) (c : π•œ) (f : 𝓒(E, F)) :
   rw [mul_assoc]
   exact mul_le_mul_of_nonneg_left (f.le_seminorm_aux k n x) (norm_nonneg _)
 #align schwartz_map.seminorm_aux_smul_le SchwartzMap.seminormAux_smul_le
+-/
 
-instance hasNsmul : SMul β„• 𝓒(E, F) :=
+#print SchwartzMap.instNSMul /-
+instance instNSMul : SMul β„• 𝓒(E, F) :=
   ⟨fun c f =>
     { toFun := c β€’ f
       smooth' := (f.smooth _).const_smul c
@@ -299,9 +344,11 @@ instance hasNsmul : SMul β„• 𝓒(E, F) :=
           simp only [Pi.smul_apply, ← nsmul_eq_smul_cast]
         simp only [this]
         exact ((c : ℝ) β€’ f).decay' }⟩
-#align schwartz_map.has_nsmul SchwartzMap.hasNsmul
+#align schwartz_map.has_nsmul SchwartzMap.instNSMul
+-/
 
-instance hasZsmul : SMul β„€ 𝓒(E, F) :=
+#print SchwartzMap.instZSMul /-
+instance instZSMul : SMul β„€ 𝓒(E, F) :=
   ⟨fun c f =>
     { toFun := c β€’ f
       smooth' := (f.smooth _).const_smul c
@@ -311,7 +358,8 @@ instance hasZsmul : SMul β„€ 𝓒(E, F) :=
           simp only [Pi.smul_apply, ← zsmul_eq_smul_cast]
         simp only [this]
         exact ((c : ℝ) β€’ f).decay' }⟩
-#align schwartz_map.has_zsmul SchwartzMap.hasZsmul
+#align schwartz_map.has_zsmul SchwartzMap.instZSMul
+-/
 
 end Smul
 
@@ -325,24 +373,32 @@ instance : Zero 𝓒(E, F) :=
 instance : Inhabited 𝓒(E, F) :=
   ⟨0⟩
 
+#print SchwartzMap.coe_zero /-
 theorem coe_zero : ↑(0 : 𝓒(E, F)) = (0 : E β†’ F) :=
   rfl
 #align schwartz_map.coe_zero SchwartzMap.coe_zero
+-/
 
+#print SchwartzMap.coeFn_zero /-
 @[simp]
 theorem coeFn_zero : coeFn (0 : 𝓒(E, F)) = (0 : E β†’ F) :=
   rfl
 #align schwartz_map.coe_fn_zero SchwartzMap.coeFn_zero
+-/
 
+#print SchwartzMap.zero_apply /-
 @[simp]
 theorem zero_apply {x : E} : (0 : 𝓒(E, F)) x = 0 :=
   rfl
 #align schwartz_map.zero_apply SchwartzMap.zero_apply
+-/
 
+#print SchwartzMap.seminormAux_zero /-
 theorem seminormAux_zero (k n : β„•) : (0 : 𝓒(E, F)).seminormAux k n = 0 :=
   le_antisymm (seminormAux_le_bound k n _ rfl.le fun _ => by simp [Pi.zero_def])
     (seminormAux_nonneg _ _ _)
 #align schwartz_map.seminorm_aux_zero SchwartzMap.seminormAux_zero
+-/
 
 end Zero
 
@@ -364,11 +420,14 @@ instance : Add 𝓒(E, F) :=
         (decay_add_le_aux k n f g x).trans
           (add_le_add (f.le_seminormAux k n x) (g.le_seminormAux k n x))⟩⟩⟩
 
+#print SchwartzMap.add_apply /-
 @[simp]
 theorem add_apply {f g : 𝓒(E, F)} {x : E} : (f + g) x = f x + g x :=
   rfl
 #align schwartz_map.add_apply SchwartzMap.add_apply
+-/
 
+#print SchwartzMap.seminormAux_add_le /-
 theorem seminormAux_add_le (k n : β„•) (f g : 𝓒(E, F)) :
     (f + g).seminormAux k n ≀ f.seminormAux k n + g.seminormAux k n :=
   (f + g).seminormAux_le_bound k n
@@ -376,6 +435,7 @@ theorem seminormAux_add_le (k n : β„•) (f g : 𝓒(E, F)) :
     (decay_add_le_aux k n f g x).trans <|
       add_le_add (f.le_seminormAux k n x) (g.le_seminormAux k n x)
 #align schwartz_map.seminorm_aux_add_le SchwartzMap.seminormAux_add_le
+-/
 
 end Add
 
@@ -391,11 +451,13 @@ instance : Sub 𝓒(E, F) :=
       rw [← decay_neg_aux k n g x]
       convert decay_add_le_aux k n f (-g) x⟩⟩
 
+#print SchwartzMap.sub_apply /-
 -- exact fails with deterministic timeout
 @[simp]
 theorem sub_apply {f g : 𝓒(E, F)} {x : E} : (f - g) x = f x - g x :=
   rfl
 #align schwartz_map.sub_apply SchwartzMap.sub_apply
+-/
 
 end Sub
 
@@ -407,22 +469,28 @@ instance : AddCommGroup 𝓒(E, F) :=
 
 variable (E F)
 
+#print SchwartzMap.coeHom /-
 /-- Coercion as an additive homomorphism. -/
 def coeHom : 𝓒(E, F) β†’+ E β†’ F where
   toFun f := f
   map_zero' := coe_zero
   map_add' _ _ := rfl
 #align schwartz_map.coe_hom SchwartzMap.coeHom
+-/
 
 variable {E F}
 
+#print SchwartzMap.coe_coeHom /-
 theorem coe_coeHom : (coeHom E F : 𝓒(E, F) β†’ E β†’ F) = coeFn :=
   rfl
 #align schwartz_map.coe_coe_hom SchwartzMap.coe_coeHom
+-/
 
+#print SchwartzMap.coeHom_injective /-
 theorem coeHom_injective : Function.Injective (coeHom E F) := by rw [coe_coe_hom];
   exact FunLike.coe_injective
 #align schwartz_map.coe_hom_injective SchwartzMap.coeHom_injective
+-/
 
 end AddCommGroup
 
@@ -444,6 +512,7 @@ variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
 variable (π•œ)
 
+#print SchwartzMap.seminorm /-
 /-- The seminorms of the Schwartz space given by the best constants in the definition of
 `𝓒(E, F)`. -/
 @[protected]
@@ -451,13 +520,17 @@ def seminorm (k n : β„•) : Seminorm π•œ 𝓒(E, F) :=
   Seminorm.ofSMulLE (seminormAux k n) (seminormAux_zero k n) (seminormAux_add_le k n)
     (seminormAux_smul_le k n)
 #align schwartz_map.seminorm SchwartzMap.seminorm
+-/
 
+#print SchwartzMap.seminorm_le_bound /-
 /-- If one controls the seminorm for every `x`, then one controls the seminorm. -/
 theorem seminorm_le_bound (k n : β„•) (f : 𝓒(E, F)) {M : ℝ} (hMp : 0 ≀ M)
     (hM : βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ M) : Seminorm π•œ k n f ≀ M :=
   f.seminormAux_le_bound k n hMp hM
 #align schwartz_map.seminorm_le_bound SchwartzMap.seminorm_le_bound
+-/
 
+#print SchwartzMap.seminorm_le_bound' /-
 /-- If one controls the seminorm for every `x`, then one controls the seminorm.
 
 Variant for functions `𝓒(ℝ, F)`. -/
@@ -467,13 +540,17 @@ theorem seminorm_le_bound' (k n : β„•) (f : 𝓒(ℝ, F)) {M : ℝ} (hMp : 0 ≀
   refine' seminorm_le_bound π•œ k n f hMp _
   simpa only [Real.norm_eq_abs, norm_iteratedFDeriv_eq_norm_iteratedDeriv]
 #align schwartz_map.seminorm_le_bound' SchwartzMap.seminorm_le_bound'
+-/
 
+#print SchwartzMap.le_seminorm /-
 /-- The seminorm controls the Schwartz estimate for any fixed `x`. -/
 theorem le_seminorm (k n : β„•) (f : 𝓒(E, F)) (x : E) :
     β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ Seminorm π•œ k n f :=
   f.le_seminormAux k n x
 #align schwartz_map.le_seminorm SchwartzMap.le_seminorm
+-/
 
+#print SchwartzMap.le_seminorm' /-
 /-- The seminorm controls the Schwartz estimate for any fixed `x`.
 
 Variant for functions `𝓒(ℝ, F)`. -/
@@ -483,47 +560,61 @@ theorem le_seminorm' (k n : β„•) (f : 𝓒(ℝ, F)) (x : ℝ) :
   have := le_seminorm π•œ k n f x
   rwa [← Real.norm_eq_abs, ← norm_iteratedFDeriv_eq_norm_iteratedDeriv]
 #align schwartz_map.le_seminorm' SchwartzMap.le_seminorm'
+-/
 
+#print SchwartzMap.norm_iteratedFDeriv_le_seminorm /-
 theorem norm_iteratedFDeriv_le_seminorm (f : 𝓒(E, F)) (n : β„•) (xβ‚€ : E) :
     β€–iteratedFDeriv ℝ n f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ 0 n) f :=
   by
   have := SchwartzMap.le_seminorm π•œ 0 n f xβ‚€
   rwa [pow_zero, one_mul] at this 
 #align schwartz_map.norm_iterated_fderiv_le_seminorm SchwartzMap.norm_iteratedFDeriv_le_seminorm
+-/
 
+#print SchwartzMap.norm_pow_mul_le_seminorm /-
 theorem norm_pow_mul_le_seminorm (f : 𝓒(E, F)) (k : β„•) (xβ‚€ : E) :
     β€–xβ‚€β€– ^ k * β€–f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ k 0) f :=
   by
   have := SchwartzMap.le_seminorm π•œ k 0 f xβ‚€
   rwa [norm_iteratedFDeriv_zero] at this 
 #align schwartz_map.norm_pow_mul_le_seminorm SchwartzMap.norm_pow_mul_le_seminorm
+-/
 
+#print SchwartzMap.norm_le_seminorm /-
 theorem norm_le_seminorm (f : 𝓒(E, F)) (xβ‚€ : E) : β€–f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ 0 0) f :=
   by
   have := norm_pow_mul_le_seminorm π•œ f 0 xβ‚€
   rwa [pow_zero, one_mul] at this 
 #align schwartz_map.norm_le_seminorm SchwartzMap.norm_le_seminorm
+-/
 
 variable (π•œ E F)
 
+#print schwartzSeminormFamily /-
 /-- The family of Schwartz seminorms. -/
 def schwartzSeminormFamily : SeminormFamily π•œ 𝓒(E, F) (β„• Γ— β„•) := fun m => Seminorm π•œ m.1 m.2
 #align schwartz_seminorm_family schwartzSeminormFamily
+-/
 
+#print SchwartzMap.schwartzSeminormFamily_apply /-
 @[simp]
 theorem schwartzSeminormFamily_apply (n k : β„•) :
     schwartzSeminormFamily π•œ E F (n, k) = SchwartzMap.seminorm π•œ n k :=
   rfl
 #align schwartz_map.schwartz_seminorm_family_apply SchwartzMap.schwartzSeminormFamily_apply
+-/
 
+#print SchwartzMap.schwartzSeminormFamily_apply_zero /-
 @[simp]
 theorem schwartzSeminormFamily_apply_zero :
     schwartzSeminormFamily π•œ E F 0 = SchwartzMap.seminorm π•œ 0 0 :=
   rfl
 #align schwartz_map.schwartz_seminorm_family_apply_zero SchwartzMap.schwartzSeminormFamily_apply_zero
+-/
 
 variable {π•œ E F}
 
+#print SchwartzMap.one_add_le_sup_seminorm_apply /-
 /-- A more convenient version of `le_sup_seminorm_apply`.
 
 The set `finset.Iic m` is the set of all pairs `(k', n')` with `k' ≀ m.1` and `n' ≀ m.2`.
@@ -554,6 +645,7 @@ theorem one_add_le_sup_seminorm_apply {m : β„• Γ— β„•} {k n : β„•} (hk : k ≀ m
           (Finset.mem_Iic.2 <| Prod.mk_le_mk.2 ⟨finset.mem_range_succ_iff.mp hi, hn⟩) le_rfl)
         _)
 #align schwartz_map.one_add_le_sup_seminorm_apply SchwartzMap.one_add_le_sup_seminorm_apply
+-/
 
 end Seminorms
 
@@ -569,6 +661,7 @@ variable (π•œ E F)
 instance : TopologicalSpace 𝓒(E, F) :=
   (schwartzSeminormFamily ℝ E F).ModuleFilterBasis.topology'
 
+#print schwartz_withSeminorms /-
 theorem schwartz_withSeminorms : WithSeminorms (schwartzSeminormFamily π•œ E F) :=
   by
   have A : WithSeminorms (schwartzSeminormFamily ℝ E F) := ⟨rfl⟩
@@ -576,6 +669,7 @@ theorem schwartz_withSeminorms : WithSeminorms (schwartzSeminormFamily π•œ E F)
   rw [A]
   rfl
 #align schwartz_with_seminorms schwartz_withSeminorms
+-/
 
 variable {π•œ E F}
 
@@ -606,12 +700,15 @@ section TemperateGrowth
 /-! ### Functions of temperate growth -/
 
 
+#print Function.HasTemperateGrowth /-
 /-- A function is called of temperate growth if it is smooth and all iterated derivatives are
 polynomially bounded. -/
 def Function.HasTemperateGrowth (f : E β†’ F) : Prop :=
   ContDiff ℝ ⊀ f ∧ βˆ€ n : β„•, βˆƒ (k : β„•) (C : ℝ), βˆ€ x, β€–iteratedFDeriv ℝ n f xβ€– ≀ C * (1 + β€–xβ€–) ^ k
 #align function.has_temperate_growth Function.HasTemperateGrowth
+-/
 
+#print Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux /-
 theorem Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f : E β†’ F}
     (hf_temperate : f.HasTemperateGrowth) (n : β„•) :
     βˆƒ (k : β„•) (C : ℝ) (hC : 0 ≀ C),
@@ -631,6 +728,7 @@ theorem Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f : E 
   refine' pow_le_pow (by simp only [le_add_iff_nonneg_right, norm_nonneg]) _
   exact Finset.le_sup hN
 #align function.has_temperate_growth.norm_iterated_fderiv_le_uniform_aux Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux
+-/
 
 end TemperateGrowth
 
@@ -649,10 +747,11 @@ variable [NormedAddCommGroup G] [NormedSpace ℝ G] [NormedSpace π•œ' G] [SMulC
 
 variable {Οƒ : π•œ β†’+* π•œ'}
 
+#print SchwartzMap.mkLM /-
 /-- Create a semilinear map between Schwartz spaces.
 
 Note: This is a helper definition for `mk_clm`. -/
-def mkLm (A : (D β†’ E) β†’ F β†’ G) (hadd : βˆ€ (f g : 𝓒(D, E)) (x), A (f + g) x = A f x + A g x)
+def mkLM (A : (D β†’ E) β†’ F β†’ G) (hadd : βˆ€ (f g : 𝓒(D, E)) (x), A (f + g) x = A f x + A g x)
     (hsmul : βˆ€ (a : π•œ) (f : 𝓒(D, E)) (x), A (a β€’ f) x = Οƒ a β€’ A f x)
     (hsmooth : βˆ€ f : 𝓒(D, E), ContDiff ℝ ⊀ (A f))
     (hbound :
@@ -672,12 +771,14 @@ def mkLm (A : (D β†’ E) β†’ F β†’ G) (hadd : βˆ€ (f g : 𝓒(D, E)) (x), A (f +
         exact ⟨C * (s.sup (schwartzSeminormFamily π•œ D E)) f, h f⟩ }
   map_add' f g := ext (hadd f g)
   map_smul' a f := ext (hsmul a f)
-#align schwartz_map.mk_lm SchwartzMap.mkLm
+#align schwartz_map.mk_lm SchwartzMap.mkLM
+-/
 
+#print SchwartzMap.mkCLM /-
 /-- Create a continuous semilinear map between Schwartz spaces.
 
 For an example of using this definition, see `fderiv_clm`. -/
-def mkClm [RingHomIsometric Οƒ] (A : (D β†’ E) β†’ F β†’ G)
+def mkCLM [RingHomIsometric Οƒ] (A : (D β†’ E) β†’ F β†’ G)
     (hadd : βˆ€ (f g : 𝓒(D, E)) (x), A (f + g) x = A f x + A g x)
     (hsmul : βˆ€ (a : π•œ) (f : 𝓒(D, E)) (x), A (a β€’ f) x = Οƒ a β€’ A f x)
     (hsmooth : βˆ€ f : 𝓒(D, E), ContDiff ℝ ⊀ (A f))
@@ -699,8 +800,9 @@ def mkClm [RingHomIsometric Οƒ] (A : (D β†’ E) β†’ F β†’ G)
     simp only [Seminorm.comp_apply, Seminorm.smul_apply, NNReal.smul_def, Algebra.id.smul_eq_mul,
       Subtype.coe_mk]
     exact (mk_lm A hadd hsmul hsmooth hbound f).seminorm_le_bound π•œ' n.1 n.2 (by positivity) (h f)
-  toLinearMap := mkLm A hadd hsmul hsmooth hbound
-#align schwartz_map.mk_clm SchwartzMap.mkClm
+  toLinearMap := mkLM A hadd hsmul hsmooth hbound
+#align schwartz_map.mk_clm SchwartzMap.mkCLM
+-/
 
 end Clm
 
@@ -708,10 +810,11 @@ section EvalClm
 
 variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
+#print SchwartzMap.evalCLM /-
 /-- The map applying a vector to Hom-valued Schwartz function as a continuous linear map. -/
 @[protected]
-def evalClm (m : E) : 𝓒(E, E β†’L[ℝ] F) β†’L[π•œ] 𝓒(E, F) :=
-  mkClm (fun f x => f x m) (fun _ _ _ => rfl) (fun _ _ _ => rfl)
+def evalCLM (m : E) : 𝓒(E, E β†’L[ℝ] F) β†’L[π•œ] 𝓒(E, F) :=
+  mkCLM (fun f x => f x m) (fun _ _ _ => rfl) (fun _ _ _ => rfl)
     (fun f => ContDiff.clm_apply f.2 contDiff_const)
     (by
       rintro ⟨k, n⟩
@@ -725,7 +828,8 @@ def evalClm (m : E) : 𝓒(E, E β†’L[ℝ] F) β†’L[π•œ] 𝓒(E, F) :=
       rw [← mul_assoc, ← mul_comm β€–mβ€–, mul_assoc]
       refine' mul_le_mul_of_nonneg_left _ (norm_nonneg _)
       simp only [Finset.sup_singleton, schwartz_seminorm_family_apply, le_seminorm])
-#align schwartz_map.eval_clm SchwartzMap.evalClm
+#align schwartz_map.eval_clm SchwartzMap.evalCLM
+-/
 
 end EvalClm
 
@@ -735,12 +839,13 @@ variable [NormedAddCommGroup D] [NormedSpace ℝ D]
 
 variable [NormedAddCommGroup G] [NormedSpace ℝ G]
 
+#print SchwartzMap.bilinLeftCLM /-
 /-- The map `f ↦ (x ↦ B (f x) (g x))` as a continuous `π•œ`-linear map on Schwartz space,
 where `B` is a continuous `π•œ`-linear map and `g` is a function of temperate growth. -/
-def bilinLeftClm (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemperateGrowth) :
+def bilinLeftCLM (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemperateGrowth) :
     𝓒(D, E) β†’L[ℝ] 𝓒(D, G) :=
   -- Todo (after port): generalize to `B : E β†’L[π•œ] F β†’L[π•œ] G` and `π•œ`-linear
-    mkClm
+    mkCLM
     (fun f x => B (f x) (g x))
     (fun _ _ _ => by
       simp only [map_add, add_left_inj, Pi.add_apply, eq_self_iff_true,
@@ -787,7 +892,8 @@ def bilinLeftClm (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemper
       refine' mul_le_mul_of_nonneg_left _ (by positivity)
       refine' pow_le_pow_of_le_left (norm_nonneg _) _ _
       simp only [zero_le_one, le_add_iff_nonneg_left])
-#align schwartz_map.bilin_left_clm SchwartzMap.bilinLeftClm
+#align schwartz_map.bilin_left_clm SchwartzMap.bilinLeftCLM
+-/
 
 end Multiplication
 
@@ -805,11 +911,12 @@ variable [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
 variable [NormedSpace π•œ G] [SMulCommClass ℝ π•œ G]
 
+#print SchwartzMap.compCLM /-
 /-- Composition with a function on the right is a continuous linear map on Schwartz space
 provided that the function is temperate and growths polynomially near infinity. -/
-def compClm {g : D β†’ E} (hg : g.HasTemperateGrowth)
+def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
     (hg_upper : βˆƒ (k : β„•) (C : ℝ), βˆ€ x, β€–xβ€– ≀ C * (1 + β€–g xβ€–) ^ k) : 𝓒(E, F) β†’L[π•œ] 𝓒(D, F) :=
-  mkClm (fun f x => f (g x))
+  mkCLM (fun f x => f (g x))
     (fun _ _ _ => by simp only [add_left_inj, Pi.add_apply, eq_self_iff_true]) (fun _ _ _ => rfl)
     (fun f => f.smooth'.comp hg.1)
     (by
@@ -874,7 +981,8 @@ def compClm {g : D β†’ E} (hg : g.HasTemperateGrowth)
         positivity
       refine' le_trans (mul_le_mul_of_nonneg_right hg_upper'' hpos) _
       rw [← mul_assoc])
-#align schwartz_map.comp_clm SchwartzMap.compClm
+#align schwartz_map.comp_clm SchwartzMap.compCLM
+-/
 
 end Comp
 
@@ -887,73 +995,94 @@ variable (π•œ)
 
 variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
+#print SchwartzMap.fderivCLM /-
 /-- The FrΓ©chet derivative on Schwartz space as a continuous `π•œ`-linear map. -/
-def fderivClm : 𝓒(E, F) β†’L[π•œ] 𝓒(E, E β†’L[ℝ] F) :=
-  mkClm (fderiv ℝ) (fun f g _ => fderiv_add f.DifferentiableAt g.DifferentiableAt)
+def fderivCLM : 𝓒(E, F) β†’L[π•œ] 𝓒(E, E β†’L[ℝ] F) :=
+  mkCLM (fderiv ℝ) (fun f g _ => fderiv_add f.DifferentiableAt g.DifferentiableAt)
     (fun a f _ => fderiv_const_smul f.DifferentiableAt a)
     (fun f => (contDiff_top_iff_fderiv.mp f.smooth').2) fun ⟨k, n⟩ =>
     ⟨{⟨k, n + 1⟩}, 1, zero_le_one, fun f x => by
       simpa only [schwartz_seminorm_family_apply, Seminorm.comp_apply, Finset.sup_singleton,
         one_smul, norm_iteratedFDeriv_fderiv, one_mul] using f.le_seminorm π•œ k (n + 1) x⟩
-#align schwartz_map.fderiv_clm SchwartzMap.fderivClm
+#align schwartz_map.fderiv_clm SchwartzMap.fderivCLM
+-/
 
+#print SchwartzMap.fderivCLM_apply /-
 @[simp]
-theorem fderivClm_apply (f : 𝓒(E, F)) (x : E) : fderivClm π•œ f x = fderiv ℝ f x :=
+theorem fderivCLM_apply (f : 𝓒(E, F)) (x : E) : fderivCLM π•œ f x = fderiv ℝ f x :=
   rfl
-#align schwartz_map.fderiv_clm_apply SchwartzMap.fderivClm_apply
+#align schwartz_map.fderiv_clm_apply SchwartzMap.fderivCLM_apply
+-/
 
+#print SchwartzMap.derivCLM /-
 /-- The 1-dimensional derivative on Schwartz space as a continuous `π•œ`-linear map. -/
-def derivClm : 𝓒(ℝ, F) β†’L[π•œ] 𝓒(ℝ, F) :=
-  mkClm (fun f => deriv f) (fun f g _ => deriv_add f.DifferentiableAt g.DifferentiableAt)
+def derivCLM : 𝓒(ℝ, F) β†’L[π•œ] 𝓒(ℝ, F) :=
+  mkCLM (fun f => deriv f) (fun f g _ => deriv_add f.DifferentiableAt g.DifferentiableAt)
     (fun a f _ => deriv_const_smul a f.DifferentiableAt)
     (fun f => (contDiff_top_iff_deriv.mp f.smooth').2) fun ⟨k, n⟩ =>
     ⟨{⟨k, n + 1⟩}, 1, zero_le_one, fun f x => by
       simpa only [Real.norm_eq_abs, Finset.sup_singleton, schwartz_seminorm_family_apply, one_mul,
         norm_iteratedFDeriv_eq_norm_iteratedDeriv, ← iteratedDeriv_succ'] using
         f.le_seminorm' π•œ k (n + 1) x⟩
-#align schwartz_map.deriv_clm SchwartzMap.derivClm
+#align schwartz_map.deriv_clm SchwartzMap.derivCLM
+-/
 
+#print SchwartzMap.derivCLM_apply /-
 @[simp]
-theorem derivClm_apply (f : 𝓒(ℝ, F)) (x : ℝ) : derivClm π•œ f x = deriv f x :=
+theorem derivCLM_apply (f : 𝓒(ℝ, F)) (x : ℝ) : derivCLM π•œ f x = deriv f x :=
   rfl
-#align schwartz_map.deriv_clm_apply SchwartzMap.derivClm_apply
+#align schwartz_map.deriv_clm_apply SchwartzMap.derivCLM_apply
+-/
 
+#print SchwartzMap.pderivCLM /-
 /-- The partial derivative (or directional derivative) in the direction `m : E` as a
 continuous linear map on Schwartz space. -/
-def pderivClm (m : E) : 𝓒(E, F) β†’L[π•œ] 𝓒(E, F) :=
-  (evalClm m).comp (fderivClm π•œ)
-#align schwartz_map.pderiv_clm SchwartzMap.pderivClm
+def pderivCLM (m : E) : 𝓒(E, F) β†’L[π•œ] 𝓒(E, F) :=
+  (evalCLM m).comp (fderivCLM π•œ)
+#align schwartz_map.pderiv_clm SchwartzMap.pderivCLM
+-/
 
+#print SchwartzMap.pderivCLM_apply /-
 @[simp]
-theorem pderivClm_apply (m : E) (f : 𝓒(E, F)) (x : E) : pderivClm π•œ m f x = fderiv ℝ f x m :=
+theorem pderivCLM_apply (m : E) (f : 𝓒(E, F)) (x : E) : pderivCLM π•œ m f x = fderiv ℝ f x m :=
   rfl
-#align schwartz_map.pderiv_clm_apply SchwartzMap.pderivClm_apply
+#align schwartz_map.pderiv_clm_apply SchwartzMap.pderivCLM_apply
+-/
 
+#print SchwartzMap.iteratedPDeriv /-
 /-- The iterated partial derivative (or directional derivative) as a continuous linear map on
 Schwartz space. -/
-def iteratedPderiv {n : β„•} : (Fin n β†’ E) β†’ 𝓒(E, F) β†’L[π•œ] 𝓒(E, F) :=
+def iteratedPDeriv {n : β„•} : (Fin n β†’ E) β†’ 𝓒(E, F) β†’L[π•œ] 𝓒(E, F) :=
   Nat.recOn n (fun x => ContinuousLinearMap.id π•œ _) fun n rec x =>
-    (pderivClm π•œ (x 0)).comp (rec (Fin.tail x))
-#align schwartz_map.iterated_pderiv SchwartzMap.iteratedPderiv
+    (pderivCLM π•œ (x 0)).comp (rec (Fin.tail x))
+#align schwartz_map.iterated_pderiv SchwartzMap.iteratedPDeriv
+-/
 
+#print SchwartzMap.iteratedPDeriv_zero /-
 @[simp]
-theorem iteratedPderiv_zero (m : Fin 0 β†’ E) (f : 𝓒(E, F)) : iteratedPderiv π•œ m f = f :=
+theorem iteratedPDeriv_zero (m : Fin 0 β†’ E) (f : 𝓒(E, F)) : iteratedPDeriv π•œ m f = f :=
   rfl
-#align schwartz_map.iterated_pderiv_zero SchwartzMap.iteratedPderiv_zero
+#align schwartz_map.iterated_pderiv_zero SchwartzMap.iteratedPDeriv_zero
+-/
 
+#print SchwartzMap.iteratedPDeriv_one /-
 @[simp]
-theorem iteratedPderiv_one (m : Fin 1 β†’ E) (f : 𝓒(E, F)) :
-    iteratedPderiv π•œ m f = pderivClm π•œ (m 0) f :=
+theorem iteratedPDeriv_one (m : Fin 1 β†’ E) (f : 𝓒(E, F)) :
+    iteratedPDeriv π•œ m f = pderivCLM π•œ (m 0) f :=
   rfl
-#align schwartz_map.iterated_pderiv_one SchwartzMap.iteratedPderiv_one
+#align schwartz_map.iterated_pderiv_one SchwartzMap.iteratedPDeriv_one
+-/
 
-theorem iteratedPderiv_succ_left {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E, F)) :
-    iteratedPderiv π•œ m f = pderivClm π•œ (m 0) (iteratedPderiv π•œ (Fin.tail m) f) :=
+#print SchwartzMap.iteratedPDeriv_succ_left /-
+theorem iteratedPDeriv_succ_left {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E, F)) :
+    iteratedPDeriv π•œ m f = pderivCLM π•œ (m 0) (iteratedPDeriv π•œ (Fin.tail m) f) :=
   rfl
-#align schwartz_map.iterated_pderiv_succ_left SchwartzMap.iteratedPderiv_succ_left
+#align schwartz_map.iterated_pderiv_succ_left SchwartzMap.iteratedPDeriv_succ_left
+-/
 
-theorem iteratedPderiv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E, F)) :
-    iteratedPderiv π•œ m f = iteratedPderiv π•œ (Fin.init m) (pderivClm π•œ (m (Fin.last n)) f) :=
+#print SchwartzMap.iteratedPDeriv_succ_right /-
+theorem iteratedPDeriv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E, F)) :
+    iteratedPDeriv π•œ m f = iteratedPDeriv π•œ (Fin.init m) (pderivCLM π•œ (m (Fin.last n)) f) :=
   by
   induction' n with n IH
   Β· rw [iterated_pderiv_zero, iterated_pderiv_one]
@@ -963,7 +1092,8 @@ theorem iteratedPderiv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E,
   have hmtail : Fin.tail m (Fin.last n) = m (Fin.last n.succ) := by
     simp only [Fin.tail_def, Fin.succ_last]
   simp only [iterated_pderiv_succ_left, IH (Fin.tail m), hmzero, hmtail, Fin.tail_init_eq_init_tail]
-#align schwartz_map.iterated_pderiv_succ_right SchwartzMap.iteratedPderiv_succ_right
+#align schwartz_map.iterated_pderiv_succ_right SchwartzMap.iteratedPDeriv_succ_right
+-/
 
 -- Todo: `iterated_pderiv π•œ m f x = iterated_fderiv ℝ f x m`
 end Derivatives
@@ -975,45 +1105,56 @@ section BoundedContinuousFunction
 
 open scoped BoundedContinuousFunction
 
+#print SchwartzMap.toBoundedContinuousFunction /-
 /-- Schwartz functions as bounded continuous functions -/
 def toBoundedContinuousFunction (f : 𝓒(E, F)) : E →ᡇ F :=
   BoundedContinuousFunction.ofNormedAddCommGroup f (SchwartzMap.continuous f)
     (SchwartzMap.seminorm ℝ 0 0 f) (norm_le_seminorm ℝ f)
 #align schwartz_map.to_bounded_continuous_function SchwartzMap.toBoundedContinuousFunction
+-/
 
+#print SchwartzMap.toBoundedContinuousFunction_apply /-
 @[simp]
 theorem toBoundedContinuousFunction_apply (f : 𝓒(E, F)) (x : E) :
     f.toBoundedContinuousFunction x = f x :=
   rfl
 #align schwartz_map.to_bounded_continuous_function_apply SchwartzMap.toBoundedContinuousFunction_apply
+-/
 
+#print SchwartzMap.toContinuousMap /-
 /-- Schwartz functions as continuous functions -/
 def toContinuousMap (f : 𝓒(E, F)) : C(E, F) :=
   f.toBoundedContinuousFunction.toContinuousMap
 #align schwartz_map.to_continuous_map SchwartzMap.toContinuousMap
+-/
 
 variable (π•œ E F)
 
 variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
+#print SchwartzMap.toBoundedContinuousFunctionLM /-
 /-- The inclusion map from Schwartz functions to bounded continuous functions as a linear map. -/
-def toBoundedContinuousFunctionLm : 𝓒(E, F) β†’β‚—[π•œ] E →ᡇ F
+def toBoundedContinuousFunctionLM : 𝓒(E, F) β†’β‚—[π•œ] E →ᡇ F
     where
   toFun f := f.toBoundedContinuousFunction
   map_add' f g := by ext; exact add_apply
   map_smul' a f := by ext; exact smul_apply
-#align schwartz_map.to_bounded_continuous_function_lm SchwartzMap.toBoundedContinuousFunctionLm
+#align schwartz_map.to_bounded_continuous_function_lm SchwartzMap.toBoundedContinuousFunctionLM
+-/
 
+#print SchwartzMap.toBoundedContinuousFunctionLM_apply /-
 @[simp]
-theorem toBoundedContinuousFunctionLm_apply (f : 𝓒(E, F)) (x : E) :
-    toBoundedContinuousFunctionLm π•œ E F f x = f x :=
+theorem toBoundedContinuousFunctionLM_apply (f : 𝓒(E, F)) (x : E) :
+    toBoundedContinuousFunctionLM π•œ E F f x = f x :=
   rfl
-#align schwartz_map.to_bounded_continuous_function_lm_apply SchwartzMap.toBoundedContinuousFunctionLm_apply
+#align schwartz_map.to_bounded_continuous_function_lm_apply SchwartzMap.toBoundedContinuousFunctionLM_apply
+-/
 
+#print SchwartzMap.toBoundedContinuousFunctionCLM /-
 /-- The inclusion map from Schwartz functions to bounded continuous functions as a continuous linear
 map. -/
-def toBoundedContinuousFunctionClm : 𝓒(E, F) β†’L[π•œ] E →ᡇ F :=
-  { toBoundedContinuousFunctionLm π•œ E F with
+def toBoundedContinuousFunctionCLM : 𝓒(E, F) β†’L[π•œ] E →ᡇ F :=
+  { toBoundedContinuousFunctionLM π•œ E F with
     cont := by
       change Continuous (to_bounded_continuous_function_lm π•œ E F)
       refine'
@@ -1023,25 +1164,32 @@ def toBoundedContinuousFunctionClm : 𝓒(E, F) β†’L[π•œ] E →ᡇ F :=
         schwartz_seminorm_family_apply_zero, BoundedContinuousFunction.norm_le (map_nonneg _ _)]
       intro x
       exact norm_le_seminorm π•œ _ _ }
-#align schwartz_map.to_bounded_continuous_function_clm SchwartzMap.toBoundedContinuousFunctionClm
+#align schwartz_map.to_bounded_continuous_function_clm SchwartzMap.toBoundedContinuousFunctionCLM
+-/
 
+#print SchwartzMap.toBoundedContinuousFunctionCLM_apply /-
 @[simp]
-theorem toBoundedContinuousFunctionClm_apply (f : 𝓒(E, F)) (x : E) :
-    toBoundedContinuousFunctionClm π•œ E F f x = f x :=
+theorem toBoundedContinuousFunctionCLM_apply (f : 𝓒(E, F)) (x : E) :
+    toBoundedContinuousFunctionCLM π•œ E F f x = f x :=
   rfl
-#align schwartz_map.to_bounded_continuous_function_clm_apply SchwartzMap.toBoundedContinuousFunctionClm_apply
+#align schwartz_map.to_bounded_continuous_function_clm_apply SchwartzMap.toBoundedContinuousFunctionCLM_apply
+-/
 
 variable {E}
 
+#print SchwartzMap.delta /-
 /-- The Dirac delta distribution -/
 def delta (x : E) : 𝓒(E, F) β†’L[π•œ] F :=
-  (BoundedContinuousFunction.evalClm π•œ x).comp (toBoundedContinuousFunctionClm π•œ E F)
+  (BoundedContinuousFunction.evalClm π•œ x).comp (toBoundedContinuousFunctionCLM π•œ E F)
 #align schwartz_map.delta SchwartzMap.delta
+-/
 
+#print SchwartzMap.delta_apply /-
 @[simp]
 theorem delta_apply (xβ‚€ : E) (f : 𝓒(E, F)) : delta π•œ F xβ‚€ f = f xβ‚€ :=
   rfl
 #align schwartz_map.delta_apply SchwartzMap.delta_apply
+-/
 
 end BoundedContinuousFunction
 
Diff
@@ -82,7 +82,6 @@ structure SchwartzMap where
   decay' : βˆ€ k n : β„•, βˆƒ C : ℝ, βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n to_fun xβ€– ≀ C
 #align schwartz_map SchwartzMap
 
--- mathport name: Β«expr𝓒( , )Β»
 scoped[SchwartzSpace] notation "𝓒(" E ", " F ")" => SchwartzMap E F
 
 variable {E F}
Diff
@@ -764,7 +764,7 @@ def bilinLeftClm (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemper
       simp_rw [mul_assoc β€–Bβ€–]
       refine' mul_le_mul_of_nonneg_left _ (by positivity)
       rw [Finset.mul_sum]
-      have : (βˆ‘ x_1 : β„• in Finset.range (n + 1), (1 : ℝ)) = n + 1 := by simp
+      have : βˆ‘ x_1 : β„• in Finset.range (n + 1), (1 : ℝ) = n + 1 := by simp
       repeat' rw [mul_assoc ((n : ℝ) + 1)]
       rw [← this, Finset.sum_mul]
       refine' Finset.sum_le_sum fun i hi => _
Diff
@@ -184,13 +184,13 @@ end IsO
 section Aux
 
 theorem bounds_nonempty (k n : β„•) (f : 𝓒(E, F)) :
-    βˆƒ c : ℝ, c ∈ { c : ℝ | 0 ≀ c ∧ βˆ€ x : E, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c } :=
+    βˆƒ c : ℝ, c ∈ {c : ℝ | 0 ≀ c ∧ βˆ€ x : E, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c} :=
   let ⟨M, hMp, hMb⟩ := f.decay k n
   ⟨M, le_of_lt hMp, hMb⟩
 #align schwartz_map.bounds_nonempty SchwartzMap.bounds_nonempty
 
 theorem bounds_bddBelow (k n : β„•) (f : 𝓒(E, F)) :
-    BddBelow { c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c } :=
+    BddBelow {c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c} :=
   ⟨0, fun _ ⟨hn, _⟩ => hn⟩
 #align schwartz_map.bounds_bdd_below SchwartzMap.bounds_bddBelow
 
@@ -226,7 +226,7 @@ section SeminormAux
 /-- Helper definition for the seminorms of the Schwartz space. -/
 @[protected]
 def seminormAux (k n : β„•) (f : 𝓒(E, F)) : ℝ :=
-  sInf { c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c }
+  sInf {c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c}
 #align schwartz_map.seminorm_aux SchwartzMap.seminormAux
 
 theorem seminormAux_nonneg (k n : β„•) (f : 𝓒(E, F)) : 0 ≀ f.seminormAux k n :=
Diff
@@ -104,7 +104,7 @@ instance : CoeFun 𝓒(E, F) fun _ => E β†’ F :=
 
 /-- All derivatives of a Schwartz function are rapidly decaying. -/
 theorem decay (f : 𝓒(E, F)) (k n : β„•) :
-    βˆƒ (C : ℝ)(hC : 0 < C), βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ C :=
+    βˆƒ (C : ℝ) (hC : 0 < C), βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ C :=
   by
   rcases f.decay' k n with ⟨C, hC⟩
   exact ⟨max C 1, by positivity, fun x => (hC x).trans (le_max_left _ _)⟩
@@ -147,12 +147,12 @@ theorem isBigO_cocompact_zpow_neg_nat (k : β„•) :
     Asymptotics.IsBigO (Filter.cocompact E) f fun x => β€–xβ€– ^ (-k : β„€) :=
   by
   obtain ⟨d, hd, hd'⟩ := f.decay k 0
-  simp_rw [norm_iteratedFDeriv_zero] at hd'
+  simp_rw [norm_iteratedFDeriv_zero] at hd' 
   simp_rw [Asymptotics.IsBigO, Asymptotics.IsBigOWith]
   refine' ⟨d, Filter.Eventually.filter_mono Filter.cocompact_le_cofinite _⟩
   refine' (Filter.eventually_cofinite_ne 0).mp (Filter.eventually_of_forall fun x hx => _)
   rwa [Real.norm_of_nonneg (zpow_nonneg (norm_nonneg _) _), zpow_neg, ← div_eq_mul_inv, le_div_iff']
-  exacts[hd' x, zpow_pos_of_pos (norm_pos_iff.mpr hx) _]
+  exacts [hd' x, zpow_pos_of_pos (norm_pos_iff.mpr hx) _]
 #align schwartz_map.is_O_cocompact_zpow_neg_nat SchwartzMap.isBigO_cocompact_zpow_neg_nat
 
 theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
@@ -489,20 +489,20 @@ theorem norm_iteratedFDeriv_le_seminorm (f : 𝓒(E, F)) (n : β„•) (xβ‚€ : E) :
     β€–iteratedFDeriv ℝ n f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ 0 n) f :=
   by
   have := SchwartzMap.le_seminorm π•œ 0 n f xβ‚€
-  rwa [pow_zero, one_mul] at this
+  rwa [pow_zero, one_mul] at this 
 #align schwartz_map.norm_iterated_fderiv_le_seminorm SchwartzMap.norm_iteratedFDeriv_le_seminorm
 
 theorem norm_pow_mul_le_seminorm (f : 𝓒(E, F)) (k : β„•) (xβ‚€ : E) :
     β€–xβ‚€β€– ^ k * β€–f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ k 0) f :=
   by
   have := SchwartzMap.le_seminorm π•œ k 0 f xβ‚€
-  rwa [norm_iteratedFDeriv_zero] at this
+  rwa [norm_iteratedFDeriv_zero] at this 
 #align schwartz_map.norm_pow_mul_le_seminorm SchwartzMap.norm_pow_mul_le_seminorm
 
 theorem norm_le_seminorm (f : 𝓒(E, F)) (xβ‚€ : E) : β€–f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ 0 0) f :=
   by
   have := norm_pow_mul_le_seminorm π•œ f 0 xβ‚€
-  rwa [pow_zero, one_mul] at this
+  rwa [pow_zero, one_mul] at this 
 #align schwartz_map.norm_le_seminorm SchwartzMap.norm_le_seminorm
 
 variable (π•œ E F)
@@ -573,7 +573,7 @@ instance : TopologicalSpace 𝓒(E, F) :=
 theorem schwartz_withSeminorms : WithSeminorms (schwartzSeminormFamily π•œ E F) :=
   by
   have A : WithSeminorms (schwartzSeminormFamily ℝ E F) := ⟨rfl⟩
-  rw [SeminormFamily.withSeminorms_iff_nhds_eq_iInf] at A⊒
+  rw [SeminormFamily.withSeminorms_iff_nhds_eq_iInf] at A ⊒
   rw [A]
   rfl
 #align schwartz_with_seminorms schwartz_withSeminorms
@@ -610,12 +610,12 @@ section TemperateGrowth
 /-- A function is called of temperate growth if it is smooth and all iterated derivatives are
 polynomially bounded. -/
 def Function.HasTemperateGrowth (f : E β†’ F) : Prop :=
-  ContDiff ℝ ⊀ f ∧ βˆ€ n : β„•, βˆƒ (k : β„•)(C : ℝ), βˆ€ x, β€–iteratedFDeriv ℝ n f xβ€– ≀ C * (1 + β€–xβ€–) ^ k
+  ContDiff ℝ ⊀ f ∧ βˆ€ n : β„•, βˆƒ (k : β„•) (C : ℝ), βˆ€ x, β€–iteratedFDeriv ℝ n f xβ€– ≀ C * (1 + β€–xβ€–) ^ k
 #align function.has_temperate_growth Function.HasTemperateGrowth
 
 theorem Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f : E β†’ F}
     (hf_temperate : f.HasTemperateGrowth) (n : β„•) :
-    βˆƒ (k : β„•)(C : ℝ)(hC : 0 ≀ C),
+    βˆƒ (k : β„•) (C : ℝ) (hC : 0 ≀ C),
       βˆ€ (N : β„•) (hN : N ≀ n) (x : E), β€–iteratedFDeriv ℝ N f xβ€– ≀ C * (1 + β€–xβ€–) ^ k :=
   by
   choose k C f using hf_temperate.2
@@ -624,7 +624,7 @@ theorem Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f : E 
   have hC' : 0 ≀ C' := by simp only [le_refl, Finset.le_sup'_iff, true_or_iff, le_max_iff]
   use C', hC'
   intro N hN x
-  rw [← Finset.mem_range_succ_iff] at hN
+  rw [← Finset.mem_range_succ_iff] at hN 
   refine' le_trans (f N x) (mul_le_mul _ _ (by positivity) hC')
   Β· simp only [Finset.le_sup'_iff, le_max_iff]
     right
@@ -658,7 +658,7 @@ def mkLm (A : (D β†’ E) β†’ F β†’ G) (hadd : βˆ€ (f g : 𝓒(D, E)) (x), A (f +
     (hsmooth : βˆ€ f : 𝓒(D, E), ContDiff ℝ ⊀ (A f))
     (hbound :
       βˆ€ n : β„• Γ— β„•,
-        βˆƒ (s : Finset (β„• Γ— β„•))(C : ℝ)(hC : 0 ≀ C),
+        βˆƒ (s : Finset (β„• Γ— β„•)) (C : ℝ) (hC : 0 ≀ C),
           βˆ€ (f : 𝓒(D, E)) (x : F),
             β€–xβ€– ^ n.fst * β€–iteratedFDeriv ℝ n.snd (A f) xβ€– ≀
               C * s.sup (schwartzSeminormFamily π•œ D E) f) :
@@ -684,7 +684,7 @@ def mkClm [RingHomIsometric Οƒ] (A : (D β†’ E) β†’ F β†’ G)
     (hsmooth : βˆ€ f : 𝓒(D, E), ContDiff ℝ ⊀ (A f))
     (hbound :
       βˆ€ n : β„• Γ— β„•,
-        βˆƒ (s : Finset (β„• Γ— β„•))(C : ℝ)(hC : 0 ≀ C),
+        βˆƒ (s : Finset (β„• Γ— β„•)) (C : ℝ) (hC : 0 ≀ C),
           βˆ€ (f : 𝓒(D, E)) (x : F),
             β€–xβ€– ^ n.fst * β€–iteratedFDeriv ℝ n.snd (A f) xβ€– ≀
               C * s.sup (schwartzSeminormFamily π•œ D E) f) :
@@ -780,8 +780,8 @@ def bilinLeftClm (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemper
       refine' mul_le_mul_of_nonneg_left _ hC
       nth_rw 2 [mul_comm]
       rw [← mul_assoc]
-      rw [Finset.mem_range_succ_iff] at hi
-      change i ≀ (l + k, n).snd at hi
+      rw [Finset.mem_range_succ_iff] at hi 
+      change i ≀ (l + k, n).snd at hi 
       refine' le_trans _ (one_add_le_sup_seminorm_apply le_rfl hi f x)
       refine' mul_le_mul_of_nonneg_right _ (norm_nonneg _)
       rw [pow_add]
@@ -809,7 +809,7 @@ variable [NormedSpace π•œ G] [SMulCommClass ℝ π•œ G]
 /-- Composition with a function on the right is a continuous linear map on Schwartz space
 provided that the function is temperate and growths polynomially near infinity. -/
 def compClm {g : D β†’ E} (hg : g.HasTemperateGrowth)
-    (hg_upper : βˆƒ (k : β„•)(C : ℝ), βˆ€ x, β€–xβ€– ≀ C * (1 + β€–g xβ€–) ^ k) : 𝓒(E, F) β†’L[π•œ] 𝓒(D, F) :=
+    (hg_upper : βˆƒ (k : β„•) (C : ℝ), βˆ€ x, β€–xβ€– ≀ C * (1 + β€–g xβ€–) ^ k) : 𝓒(E, F) β†’L[π•œ] 𝓒(D, F) :=
   mkClm (fun f x => f (g x))
     (fun _ _ _ => by simp only [add_left_inj, Pi.add_apply, eq_self_iff_true]) (fun _ _ _ => rfl)
     (fun f => f.smooth'.comp hg.1)
@@ -820,7 +820,7 @@ def compClm {g : D β†’ E} (hg : g.HasTemperateGrowth)
       have hCg : 1 ≀ 1 + Cg := by
         refine' le_add_of_nonneg_right _
         specialize hg_upper' 0
-        rw [norm_zero] at hg_upper'
+        rw [norm_zero] at hg_upper' 
         refine' nonneg_of_mul_nonneg_left hg_upper' (by positivity)
       let k' := kg * (k + l * n)
       use Finset.Iic (k', n), (1 + Cg) ^ (k + l * n) * ((C + 1) ^ n * n ! * 2 ^ k'), by positivity
@@ -841,7 +841,7 @@ def compClm {g : D β†’ E} (hg : g.HasTemperateGrowth)
         intro i hi
         have hpos : 0 < (1 + β€–g xβ€–) ^ k' := by positivity
         rw [le_div_iff' hpos]
-        change i ≀ (k', n).snd at hi
+        change i ≀ (k', n).snd at hi 
         exact one_add_le_sup_seminorm_apply le_rfl hi _ _
       have hgrowth' :
         βˆ€ (N : β„•) (hN₁ : 1 ≀ N) (hNβ‚‚ : N ≀ n),
@@ -868,7 +868,7 @@ def compClm {g : D β†’ E} (hg : g.HasTemperateGrowth)
         ring
       rw [rearrange]
       have hgxk' : 0 < (1 + β€–g xβ€–) ^ k' := by positivity
-      rw [← div_le_iff hgxk'] at hg_upper''
+      rw [← div_le_iff hgxk'] at hg_upper'' 
       have hpos : 0 ≀ (C + 1) ^ n * n ! * 2 ^ k' * seminorm_f :=
         by
         have : 0 ≀ seminorm_f := map_nonneg _ _
Diff
@@ -79,7 +79,7 @@ variable (E F)
 structure SchwartzMap where
   toFun : E β†’ F
   smooth' : ContDiff ℝ ⊀ to_fun
-  decay' : βˆ€ k n : β„•, βˆƒ C : ℝ, βˆ€ x, β€–xβ€– ^ k * β€–iteratedFderiv ℝ n to_fun xβ€– ≀ C
+  decay' : βˆ€ k n : β„•, βˆƒ C : ℝ, βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n to_fun xβ€– ≀ C
 #align schwartz_map SchwartzMap
 
 -- mathport name: Β«expr𝓒( , )Β»
@@ -104,7 +104,7 @@ instance : CoeFun 𝓒(E, F) fun _ => E β†’ F :=
 
 /-- All derivatives of a Schwartz function are rapidly decaying. -/
 theorem decay (f : 𝓒(E, F)) (k n : β„•) :
-    βˆƒ (C : ℝ)(hC : 0 < C), βˆ€ x, β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ C :=
+    βˆƒ (C : ℝ)(hC : 0 < C), βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ C :=
   by
   rcases f.decay' k n with ⟨C, hC⟩
   exact ⟨max C 1, by positivity, fun x => (hC x).trans (le_max_left _ _)⟩
@@ -147,7 +147,7 @@ theorem isBigO_cocompact_zpow_neg_nat (k : β„•) :
     Asymptotics.IsBigO (Filter.cocompact E) f fun x => β€–xβ€– ^ (-k : β„€) :=
   by
   obtain ⟨d, hd, hd'⟩ := f.decay k 0
-  simp_rw [norm_iteratedFderiv_zero] at hd'
+  simp_rw [norm_iteratedFDeriv_zero] at hd'
   simp_rw [Asymptotics.IsBigO, Asymptotics.IsBigOWith]
   refine' ⟨d, Filter.Eventually.filter_mono Filter.cocompact_le_cofinite _⟩
   refine' (Filter.eventually_cofinite_ne 0).mp (Filter.eventually_of_forall fun x hx => _)
@@ -184,39 +184,39 @@ end IsO
 section Aux
 
 theorem bounds_nonempty (k n : β„•) (f : 𝓒(E, F)) :
-    βˆƒ c : ℝ, c ∈ { c : ℝ | 0 ≀ c ∧ βˆ€ x : E, β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ c } :=
+    βˆƒ c : ℝ, c ∈ { c : ℝ | 0 ≀ c ∧ βˆ€ x : E, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c } :=
   let ⟨M, hMp, hMb⟩ := f.decay k n
   ⟨M, le_of_lt hMp, hMb⟩
 #align schwartz_map.bounds_nonempty SchwartzMap.bounds_nonempty
 
 theorem bounds_bddBelow (k n : β„•) (f : 𝓒(E, F)) :
-    BddBelow { c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ c } :=
+    BddBelow { c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c } :=
   ⟨0, fun _ ⟨hn, _⟩ => hn⟩
 #align schwartz_map.bounds_bdd_below SchwartzMap.bounds_bddBelow
 
 theorem decay_add_le_aux (k n : β„•) (f g : 𝓒(E, F)) (x : E) :
-    β€–xβ€– ^ k * β€–iteratedFderiv ℝ n (f + g) xβ€– ≀
-      β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– + β€–xβ€– ^ k * β€–iteratedFderiv ℝ n g xβ€– :=
+    β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n (f + g) xβ€– ≀
+      β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– + β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n g xβ€– :=
   by
   rw [← mul_add]
   refine' mul_le_mul_of_nonneg_left _ (by positivity)
   convert norm_add_le _ _
-  exact iteratedFderiv_add_apply (f.smooth _) (g.smooth _)
+  exact iteratedFDeriv_add_apply (f.smooth _) (g.smooth _)
 #align schwartz_map.decay_add_le_aux SchwartzMap.decay_add_le_aux
 
 theorem decay_neg_aux (k n : β„•) (f : 𝓒(E, F)) (x : E) :
-    β€–xβ€– ^ k * β€–iteratedFderiv ℝ n (-f) xβ€– = β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– :=
+    β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n (-f) xβ€– = β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– :=
   by
   nth_rw 4 [← norm_neg]
   congr
-  exact iteratedFderiv_neg_apply
+  exact iteratedFDeriv_neg_apply
 #align schwartz_map.decay_neg_aux SchwartzMap.decay_neg_aux
 
 variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
 theorem decay_smul_aux (k n : β„•) (f : 𝓒(E, F)) (c : π•œ) (x : E) :
-    β€–xβ€– ^ k * β€–iteratedFderiv ℝ n (c β€’ f) xβ€– = β€–cβ€– * β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– := by
-  rw [mul_comm β€–cβ€–, mul_assoc, iteratedFderiv_const_smul_apply (f.smooth _), norm_smul]
+    β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n (c β€’ f) xβ€– = β€–cβ€– * β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– := by
+  rw [mul_comm β€–cβ€–, mul_assoc, iteratedFDeriv_const_smul_apply (f.smooth _), norm_smul]
 #align schwartz_map.decay_smul_aux SchwartzMap.decay_smul_aux
 
 end Aux
@@ -226,7 +226,7 @@ section SeminormAux
 /-- Helper definition for the seminorms of the Schwartz space. -/
 @[protected]
 def seminormAux (k n : β„•) (f : 𝓒(E, F)) : ℝ :=
-  sInf { c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ c }
+  sInf { c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ c }
 #align schwartz_map.seminorm_aux SchwartzMap.seminormAux
 
 theorem seminormAux_nonneg (k n : β„•) (f : 𝓒(E, F)) : 0 ≀ f.seminormAux k n :=
@@ -234,13 +234,13 @@ theorem seminormAux_nonneg (k n : β„•) (f : 𝓒(E, F)) : 0 ≀ f.seminormAux k
 #align schwartz_map.seminorm_aux_nonneg SchwartzMap.seminormAux_nonneg
 
 theorem le_seminormAux (k n : β„•) (f : 𝓒(E, F)) (x : E) :
-    β€–xβ€– ^ k * β€–iteratedFderiv ℝ n (⇑f) xβ€– ≀ f.seminormAux k n :=
+    β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n (⇑f) xβ€– ≀ f.seminormAux k n :=
   le_csInf (bounds_nonempty k n f) fun y ⟨_, h⟩ => h x
 #align schwartz_map.le_seminorm_aux SchwartzMap.le_seminormAux
 
 /-- If one controls the norm of every `A x`, then one controls the norm of `A`. -/
 theorem seminormAux_le_bound (k n : β„•) (f : 𝓒(E, F)) {M : ℝ} (hMp : 0 ≀ M)
-    (hM : βˆ€ x, β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ M) : f.seminormAux k n ≀ M :=
+    (hM : βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ M) : f.seminormAux k n ≀ M :=
   csInf_le (bounds_bddBelow k n f) ⟨hMp, hM⟩
 #align schwartz_map.seminorm_aux_le_bound SchwartzMap.seminormAux_le_bound
 
@@ -455,7 +455,7 @@ def seminorm (k n : β„•) : Seminorm π•œ 𝓒(E, F) :=
 
 /-- If one controls the seminorm for every `x`, then one controls the seminorm. -/
 theorem seminorm_le_bound (k n : β„•) (f : 𝓒(E, F)) {M : ℝ} (hMp : 0 ≀ M)
-    (hM : βˆ€ x, β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ M) : Seminorm π•œ k n f ≀ M :=
+    (hM : βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ M) : Seminorm π•œ k n f ≀ M :=
   f.seminormAux_le_bound k n hMp hM
 #align schwartz_map.seminorm_le_bound SchwartzMap.seminorm_le_bound
 
@@ -466,12 +466,12 @@ theorem seminorm_le_bound' (k n : β„•) (f : 𝓒(ℝ, F)) {M : ℝ} (hMp : 0 ≀
     (hM : βˆ€ x, |x| ^ k * β€–iteratedDeriv n f xβ€– ≀ M) : Seminorm π•œ k n f ≀ M :=
   by
   refine' seminorm_le_bound π•œ k n f hMp _
-  simpa only [Real.norm_eq_abs, norm_iteratedFderiv_eq_norm_iteratedDeriv]
+  simpa only [Real.norm_eq_abs, norm_iteratedFDeriv_eq_norm_iteratedDeriv]
 #align schwartz_map.seminorm_le_bound' SchwartzMap.seminorm_le_bound'
 
 /-- The seminorm controls the Schwartz estimate for any fixed `x`. -/
 theorem le_seminorm (k n : β„•) (f : 𝓒(E, F)) (x : E) :
-    β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ Seminorm π•œ k n f :=
+    β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀ Seminorm π•œ k n f :=
   f.le_seminormAux k n x
 #align schwartz_map.le_seminorm SchwartzMap.le_seminorm
 
@@ -482,21 +482,21 @@ theorem le_seminorm' (k n : β„•) (f : 𝓒(ℝ, F)) (x : ℝ) :
     |x| ^ k * β€–iteratedDeriv n f xβ€– ≀ Seminorm π•œ k n f :=
   by
   have := le_seminorm π•œ k n f x
-  rwa [← Real.norm_eq_abs, ← norm_iteratedFderiv_eq_norm_iteratedDeriv]
+  rwa [← Real.norm_eq_abs, ← norm_iteratedFDeriv_eq_norm_iteratedDeriv]
 #align schwartz_map.le_seminorm' SchwartzMap.le_seminorm'
 
-theorem norm_iteratedFderiv_le_seminorm (f : 𝓒(E, F)) (n : β„•) (xβ‚€ : E) :
-    β€–iteratedFderiv ℝ n f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ 0 n) f :=
+theorem norm_iteratedFDeriv_le_seminorm (f : 𝓒(E, F)) (n : β„•) (xβ‚€ : E) :
+    β€–iteratedFDeriv ℝ n f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ 0 n) f :=
   by
   have := SchwartzMap.le_seminorm π•œ 0 n f xβ‚€
   rwa [pow_zero, one_mul] at this
-#align schwartz_map.norm_iterated_fderiv_le_seminorm SchwartzMap.norm_iteratedFderiv_le_seminorm
+#align schwartz_map.norm_iterated_fderiv_le_seminorm SchwartzMap.norm_iteratedFDeriv_le_seminorm
 
 theorem norm_pow_mul_le_seminorm (f : 𝓒(E, F)) (k : β„•) (xβ‚€ : E) :
     β€–xβ‚€β€– ^ k * β€–f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ k 0) f :=
   by
   have := SchwartzMap.le_seminorm π•œ k 0 f xβ‚€
-  rwa [norm_iteratedFderiv_zero] at this
+  rwa [norm_iteratedFDeriv_zero] at this
 #align schwartz_map.norm_pow_mul_le_seminorm SchwartzMap.norm_pow_mul_le_seminorm
 
 theorem norm_le_seminorm (f : 𝓒(E, F)) (xβ‚€ : E) : β€–f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ 0 0) f :=
@@ -531,7 +531,7 @@ The set `finset.Iic m` is the set of all pairs `(k', n')` with `k' ≀ m.1` and
 Note that the constant is far from optimal. -/
 theorem one_add_le_sup_seminorm_apply {m : β„• Γ— β„•} {k n : β„•} (hk : k ≀ m.1) (hn : n ≀ m.2)
     (f : 𝓒(E, F)) (x : E) :
-    (1 + β€–xβ€–) ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀
+    (1 + β€–xβ€–) ^ k * β€–iteratedFDeriv ℝ n f xβ€– ≀
       2 ^ m.1 * (Finset.Iic m).sup (fun m => Seminorm π•œ m.1 m.2) f :=
   by
   rw [add_comm, add_pow]
@@ -610,13 +610,13 @@ section TemperateGrowth
 /-- A function is called of temperate growth if it is smooth and all iterated derivatives are
 polynomially bounded. -/
 def Function.HasTemperateGrowth (f : E β†’ F) : Prop :=
-  ContDiff ℝ ⊀ f ∧ βˆ€ n : β„•, βˆƒ (k : β„•)(C : ℝ), βˆ€ x, β€–iteratedFderiv ℝ n f xβ€– ≀ C * (1 + β€–xβ€–) ^ k
+  ContDiff ℝ ⊀ f ∧ βˆ€ n : β„•, βˆƒ (k : β„•)(C : ℝ), βˆ€ x, β€–iteratedFDeriv ℝ n f xβ€– ≀ C * (1 + β€–xβ€–) ^ k
 #align function.has_temperate_growth Function.HasTemperateGrowth
 
-theorem Function.HasTemperateGrowth.norm_iteratedFderiv_le_uniform_aux {f : E β†’ F}
+theorem Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f : E β†’ F}
     (hf_temperate : f.HasTemperateGrowth) (n : β„•) :
     βˆƒ (k : β„•)(C : ℝ)(hC : 0 ≀ C),
-      βˆ€ (N : β„•) (hN : N ≀ n) (x : E), β€–iteratedFderiv ℝ N f xβ€– ≀ C * (1 + β€–xβ€–) ^ k :=
+      βˆ€ (N : β„•) (hN : N ≀ n) (x : E), β€–iteratedFDeriv ℝ N f xβ€– ≀ C * (1 + β€–xβ€–) ^ k :=
   by
   choose k C f using hf_temperate.2
   use (Finset.range (n + 1)).sup k
@@ -631,7 +631,7 @@ theorem Function.HasTemperateGrowth.norm_iteratedFderiv_le_uniform_aux {f : E 
     exact ⟨N, hN, rfl.le⟩
   refine' pow_le_pow (by simp only [le_add_iff_nonneg_right, norm_nonneg]) _
   exact Finset.le_sup hN
-#align function.has_temperate_growth.norm_iterated_fderiv_le_uniform_aux Function.HasTemperateGrowth.norm_iteratedFderiv_le_uniform_aux
+#align function.has_temperate_growth.norm_iterated_fderiv_le_uniform_aux Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux
 
 end TemperateGrowth
 
@@ -660,7 +660,7 @@ def mkLm (A : (D β†’ E) β†’ F β†’ G) (hadd : βˆ€ (f g : 𝓒(D, E)) (x), A (f +
       βˆ€ n : β„• Γ— β„•,
         βˆƒ (s : Finset (β„• Γ— β„•))(C : ℝ)(hC : 0 ≀ C),
           βˆ€ (f : 𝓒(D, E)) (x : F),
-            β€–xβ€– ^ n.fst * β€–iteratedFderiv ℝ n.snd (A f) xβ€– ≀
+            β€–xβ€– ^ n.fst * β€–iteratedFDeriv ℝ n.snd (A f) xβ€– ≀
               C * s.sup (schwartzSeminormFamily π•œ D E) f) :
     𝓒(D, E) β†’β‚›β‚—[Οƒ] 𝓒(F, G)
     where
@@ -686,7 +686,7 @@ def mkClm [RingHomIsometric Οƒ] (A : (D β†’ E) β†’ F β†’ G)
       βˆ€ n : β„• Γ— β„•,
         βˆƒ (s : Finset (β„• Γ— β„•))(C : ℝ)(hC : 0 ≀ C),
           βˆ€ (f : 𝓒(D, E)) (x : F),
-            β€–xβ€– ^ n.fst * β€–iteratedFderiv ℝ n.snd (A f) xβ€– ≀
+            β€–xβ€– ^ n.fst * β€–iteratedFDeriv ℝ n.snd (A f) xβ€– ≀
               C * s.sup (schwartzSeminormFamily π•œ D E) f) :
     𝓒(D, E) β†’SL[Οƒ] 𝓒(F, G)
     where
@@ -720,7 +720,7 @@ def evalClm (m : E) : 𝓒(E, E β†’L[ℝ] F) β†’L[π•œ] 𝓒(E, F) :=
       intro f x
       refine'
         le_trans
-          (mul_le_mul_of_nonneg_left (norm_iteratedFderiv_clm_apply_const f.2 le_top)
+          (mul_le_mul_of_nonneg_left (norm_iteratedFDeriv_clm_apply_const f.2 le_top)
             (by positivity))
           _
       rw [← mul_assoc, ← mul_comm β€–mβ€–, mul_assoc]
@@ -758,7 +758,7 @@ def bilinLeftClm (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemper
       intro f x
       have hxk : 0 ≀ β€–xβ€– ^ k := by positivity
       have hnorm_mul :=
-        ContinuousLinearMap.norm_iteratedFderiv_le_of_bilinear B f.smooth' hg.1 x le_top
+        ContinuousLinearMap.norm_iteratedFDeriv_le_of_bilinear B f.smooth' hg.1 x le_top
       refine' le_trans (mul_le_mul_of_nonneg_left hnorm_mul hxk) _
       rw [← mul_assoc (β€–xβ€– ^ k), mul_comm (β€–xβ€– ^ k)]
       simp_rw [mul_assoc β€–Bβ€–]
@@ -836,7 +836,7 @@ def compClm {g : D β†’ E} (hg : g.HasTemperateGrowth)
         refine' mul_le_mul (le_refl _) (one_le_pow_of_one_le _ _) zero_le_one zero_le_one
         simp only [le_add_iff_nonneg_right, norm_nonneg]
       have hbound :
-        βˆ€ i, i ≀ n β†’ β€–iteratedFderiv ℝ i f (g x)β€– ≀ 2 ^ k' * seminorm_f / (1 + β€–g xβ€–) ^ k' :=
+        βˆ€ i, i ≀ n β†’ β€–iteratedFDeriv ℝ i f (g x)β€– ≀ 2 ^ k' * seminorm_f / (1 + β€–g xβ€–) ^ k' :=
         by
         intro i hi
         have hpos : 0 < (1 + β€–g xβ€–) ^ k' := by positivity
@@ -845,7 +845,7 @@ def compClm {g : D β†’ E} (hg : g.HasTemperateGrowth)
         exact one_add_le_sup_seminorm_apply le_rfl hi _ _
       have hgrowth' :
         βˆ€ (N : β„•) (hN₁ : 1 ≀ N) (hNβ‚‚ : N ≀ n),
-          β€–iteratedFderiv ℝ N g xβ€– ≀ ((C + 1) * (1 + β€–xβ€–) ^ l) ^ N :=
+          β€–iteratedFDeriv ℝ N g xβ€– ≀ ((C + 1) * (1 + β€–xβ€–) ^ l) ^ N :=
         by
         intro N hN₁ hNβ‚‚
         refine' (hgrowth N hNβ‚‚ x).trans _
@@ -855,7 +855,7 @@ def compClm {g : D β†’ E} (hg : g.HasTemperateGrowth)
         Β· exact le_trans (by simp [hC]) (le_self_pow (by simp [hC]) hN₁')
         Β· refine' le_self_pow (one_le_pow_of_one_le _ l) hN₁'
           simp only [le_add_iff_nonneg_right, norm_nonneg]
-      have := norm_iteratedFderiv_comp_le f.smooth' hg.1 le_top x hbound hgrowth'
+      have := norm_iteratedFDeriv_comp_le f.smooth' hg.1 le_top x hbound hgrowth'
       have hxk : β€–xβ€– ^ k ≀ (1 + β€–xβ€–) ^ k :=
         pow_le_pow_of_le_left (norm_nonneg _) (by simp only [zero_le_one, le_add_iff_nonneg_left]) _
       refine' le_trans (mul_le_mul hxk this (by positivity) (by positivity)) _
@@ -895,7 +895,7 @@ def fderivClm : 𝓒(E, F) β†’L[π•œ] 𝓒(E, E β†’L[ℝ] F) :=
     (fun f => (contDiff_top_iff_fderiv.mp f.smooth').2) fun ⟨k, n⟩ =>
     ⟨{⟨k, n + 1⟩}, 1, zero_le_one, fun f x => by
       simpa only [schwartz_seminorm_family_apply, Seminorm.comp_apply, Finset.sup_singleton,
-        one_smul, norm_iteratedFderiv_fderiv, one_mul] using f.le_seminorm π•œ k (n + 1) x⟩
+        one_smul, norm_iteratedFDeriv_fderiv, one_mul] using f.le_seminorm π•œ k (n + 1) x⟩
 #align schwartz_map.fderiv_clm SchwartzMap.fderivClm
 
 @[simp]
@@ -910,7 +910,7 @@ def derivClm : 𝓒(ℝ, F) β†’L[π•œ] 𝓒(ℝ, F) :=
     (fun f => (contDiff_top_iff_deriv.mp f.smooth').2) fun ⟨k, n⟩ =>
     ⟨{⟨k, n + 1⟩}, 1, zero_le_one, fun f x => by
       simpa only [Real.norm_eq_abs, Finset.sup_singleton, schwartz_seminorm_family_apply, one_mul,
-        norm_iteratedFderiv_eq_norm_iteratedDeriv, ← iteratedDeriv_succ'] using
+        norm_iteratedFDeriv_eq_norm_iteratedDeriv, ← iteratedDeriv_succ'] using
         f.le_seminorm' π•œ k (n + 1) x⟩
 #align schwartz_map.deriv_clm SchwartzMap.derivClm
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 
 ! This file was ported from Lean 3 source module analysis.schwartz_space
-! leanprover-community/mathlib commit 0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
+! leanprover-community/mathlib commit e137999b2c6f2be388f4cd3bbf8523de1910cd2b
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -64,6 +64,8 @@ Schwartz space, tempered distributions
 
 noncomputable section
 
+open scoped BigOperators Nat
+
 variable {π•œ π•œ' D E F G : Type _}
 
 variable [NormedAddCommGroup E] [NormedSpace ℝ E]
@@ -600,6 +602,39 @@ instance : TopologicalSpace.FirstCountableTopology 𝓒(E, F) :=
 
 end Topology
 
+section TemperateGrowth
+
+/-! ### Functions of temperate growth -/
+
+
+/-- A function is called of temperate growth if it is smooth and all iterated derivatives are
+polynomially bounded. -/
+def Function.HasTemperateGrowth (f : E β†’ F) : Prop :=
+  ContDiff ℝ ⊀ f ∧ βˆ€ n : β„•, βˆƒ (k : β„•)(C : ℝ), βˆ€ x, β€–iteratedFderiv ℝ n f xβ€– ≀ C * (1 + β€–xβ€–) ^ k
+#align function.has_temperate_growth Function.HasTemperateGrowth
+
+theorem Function.HasTemperateGrowth.norm_iteratedFderiv_le_uniform_aux {f : E β†’ F}
+    (hf_temperate : f.HasTemperateGrowth) (n : β„•) :
+    βˆƒ (k : β„•)(C : ℝ)(hC : 0 ≀ C),
+      βˆ€ (N : β„•) (hN : N ≀ n) (x : E), β€–iteratedFderiv ℝ N f xβ€– ≀ C * (1 + β€–xβ€–) ^ k :=
+  by
+  choose k C f using hf_temperate.2
+  use (Finset.range (n + 1)).sup k
+  let C' := max (0 : ℝ) ((Finset.range (n + 1)).sup' (by simp) C)
+  have hC' : 0 ≀ C' := by simp only [le_refl, Finset.le_sup'_iff, true_or_iff, le_max_iff]
+  use C', hC'
+  intro N hN x
+  rw [← Finset.mem_range_succ_iff] at hN
+  refine' le_trans (f N x) (mul_le_mul _ _ (by positivity) hC')
+  Β· simp only [Finset.le_sup'_iff, le_max_iff]
+    right
+    exact ⟨N, hN, rfl.le⟩
+  refine' pow_le_pow (by simp only [le_add_iff_nonneg_right, norm_nonneg]) _
+  exact Finset.le_sup hN
+#align function.has_temperate_growth.norm_iterated_fderiv_le_uniform_aux Function.HasTemperateGrowth.norm_iteratedFderiv_le_uniform_aux
+
+end TemperateGrowth
+
 section Clm
 
 /-! ### Construction of continuous linear maps between Schwartz spaces -/
@@ -670,6 +705,180 @@ def mkClm [RingHomIsometric Οƒ] (A : (D β†’ E) β†’ F β†’ G)
 
 end Clm
 
+section EvalClm
+
+variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+
+/-- The map applying a vector to Hom-valued Schwartz function as a continuous linear map. -/
+@[protected]
+def evalClm (m : E) : 𝓒(E, E β†’L[ℝ] F) β†’L[π•œ] 𝓒(E, F) :=
+  mkClm (fun f x => f x m) (fun _ _ _ => rfl) (fun _ _ _ => rfl)
+    (fun f => ContDiff.clm_apply f.2 contDiff_const)
+    (by
+      rintro ⟨k, n⟩
+      use {(k, n)}, β€–mβ€–, norm_nonneg _
+      intro f x
+      refine'
+        le_trans
+          (mul_le_mul_of_nonneg_left (norm_iteratedFderiv_clm_apply_const f.2 le_top)
+            (by positivity))
+          _
+      rw [← mul_assoc, ← mul_comm β€–mβ€–, mul_assoc]
+      refine' mul_le_mul_of_nonneg_left _ (norm_nonneg _)
+      simp only [Finset.sup_singleton, schwartz_seminorm_family_apply, le_seminorm])
+#align schwartz_map.eval_clm SchwartzMap.evalClm
+
+end EvalClm
+
+section Multiplication
+
+variable [NormedAddCommGroup D] [NormedSpace ℝ D]
+
+variable [NormedAddCommGroup G] [NormedSpace ℝ G]
+
+/-- The map `f ↦ (x ↦ B (f x) (g x))` as a continuous `π•œ`-linear map on Schwartz space,
+where `B` is a continuous `π•œ`-linear map and `g` is a function of temperate growth. -/
+def bilinLeftClm (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemperateGrowth) :
+    𝓒(D, E) β†’L[ℝ] 𝓒(D, G) :=
+  -- Todo (after port): generalize to `B : E β†’L[π•œ] F β†’L[π•œ] G` and `π•œ`-linear
+    mkClm
+    (fun f x => B (f x) (g x))
+    (fun _ _ _ => by
+      simp only [map_add, add_left_inj, Pi.add_apply, eq_self_iff_true,
+        ContinuousLinearMap.add_apply])
+    (fun _ _ _ => by
+      simp only [Pi.smul_apply, ContinuousLinearMap.coe_smul', ContinuousLinearMap.map_smul,
+        RingHom.id_apply])
+    (fun f => (B.IsBoundedBilinearMap.ContDiff.restrictScalars ℝ).comp (f.smooth'.Prod hg.1))
+    (by
+      -- Porting note: rewrite this proof with `rel_congr`
+      rintro ⟨k, n⟩
+      rcases hg.norm_iterated_fderiv_le_uniform_aux n with ⟨l, C, hC, hgrowth⟩
+      use Finset.Iic (l + k, n), β€–Bβ€– * (n + 1) * n.choose (n / 2) * (C * 2 ^ (l + k)), by positivity
+      intro f x
+      have hxk : 0 ≀ β€–xβ€– ^ k := by positivity
+      have hnorm_mul :=
+        ContinuousLinearMap.norm_iteratedFderiv_le_of_bilinear B f.smooth' hg.1 x le_top
+      refine' le_trans (mul_le_mul_of_nonneg_left hnorm_mul hxk) _
+      rw [← mul_assoc (β€–xβ€– ^ k), mul_comm (β€–xβ€– ^ k)]
+      simp_rw [mul_assoc β€–Bβ€–]
+      refine' mul_le_mul_of_nonneg_left _ (by positivity)
+      rw [Finset.mul_sum]
+      have : (βˆ‘ x_1 : β„• in Finset.range (n + 1), (1 : ℝ)) = n + 1 := by simp
+      repeat' rw [mul_assoc ((n : ℝ) + 1)]
+      rw [← this, Finset.sum_mul]
+      refine' Finset.sum_le_sum fun i hi => _
+      simp only [one_mul]
+      rw [← mul_assoc, mul_comm (β€–xβ€– ^ k), mul_assoc, mul_assoc, mul_assoc]
+      refine' mul_le_mul _ _ (by positivity) (by positivity)
+      Β· norm_cast
+        exact i.choose_le_middle n
+      specialize hgrowth (n - i) (by simp only [tsub_le_self]) x
+      rw [← mul_assoc]
+      refine' le_trans (mul_le_mul_of_nonneg_left hgrowth (by positivity)) _
+      rw [mul_comm _ (C * _), mul_assoc, mul_assoc C]
+      refine' mul_le_mul_of_nonneg_left _ hC
+      nth_rw 2 [mul_comm]
+      rw [← mul_assoc]
+      rw [Finset.mem_range_succ_iff] at hi
+      change i ≀ (l + k, n).snd at hi
+      refine' le_trans _ (one_add_le_sup_seminorm_apply le_rfl hi f x)
+      refine' mul_le_mul_of_nonneg_right _ (norm_nonneg _)
+      rw [pow_add]
+      refine' mul_le_mul_of_nonneg_left _ (by positivity)
+      refine' pow_le_pow_of_le_left (norm_nonneg _) _ _
+      simp only [zero_le_one, le_add_iff_nonneg_left])
+#align schwartz_map.bilin_left_clm SchwartzMap.bilinLeftClm
+
+end Multiplication
+
+section Comp
+
+variable (π•œ)
+
+variable [IsROrC π•œ]
+
+variable [NormedAddCommGroup D] [NormedSpace ℝ D]
+
+variable [NormedAddCommGroup G] [NormedSpace ℝ G]
+
+variable [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+
+variable [NormedSpace π•œ G] [SMulCommClass ℝ π•œ G]
+
+/-- Composition with a function on the right is a continuous linear map on Schwartz space
+provided that the function is temperate and growths polynomially near infinity. -/
+def compClm {g : D β†’ E} (hg : g.HasTemperateGrowth)
+    (hg_upper : βˆƒ (k : β„•)(C : ℝ), βˆ€ x, β€–xβ€– ≀ C * (1 + β€–g xβ€–) ^ k) : 𝓒(E, F) β†’L[π•œ] 𝓒(D, F) :=
+  mkClm (fun f x => f (g x))
+    (fun _ _ _ => by simp only [add_left_inj, Pi.add_apply, eq_self_iff_true]) (fun _ _ _ => rfl)
+    (fun f => f.smooth'.comp hg.1)
+    (by
+      rintro ⟨k, n⟩
+      rcases hg.norm_iterated_fderiv_le_uniform_aux n with ⟨l, C, hC, hgrowth⟩
+      rcases hg_upper with ⟨kg, Cg, hg_upper'⟩
+      have hCg : 1 ≀ 1 + Cg := by
+        refine' le_add_of_nonneg_right _
+        specialize hg_upper' 0
+        rw [norm_zero] at hg_upper'
+        refine' nonneg_of_mul_nonneg_left hg_upper' (by positivity)
+      let k' := kg * (k + l * n)
+      use Finset.Iic (k', n), (1 + Cg) ^ (k + l * n) * ((C + 1) ^ n * n ! * 2 ^ k'), by positivity
+      intro f x
+      let seminorm_f := ((Finset.Iic (k', n)).sup (schwartzSeminormFamily π•œ _ _)) f
+      have hg_upper'' : (1 + β€–xβ€–) ^ (k + l * n) ≀ (1 + Cg) ^ (k + l * n) * (1 + β€–g xβ€–) ^ k' :=
+        by
+        rw [pow_mul, ← mul_pow]
+        refine' pow_le_pow_of_le_left (by positivity) _ _
+        rw [add_mul]
+        refine' add_le_add _ (hg_upper' x)
+        nth_rw 1 [← one_mul (1 : ℝ)]
+        refine' mul_le_mul (le_refl _) (one_le_pow_of_one_le _ _) zero_le_one zero_le_one
+        simp only [le_add_iff_nonneg_right, norm_nonneg]
+      have hbound :
+        βˆ€ i, i ≀ n β†’ β€–iteratedFderiv ℝ i f (g x)β€– ≀ 2 ^ k' * seminorm_f / (1 + β€–g xβ€–) ^ k' :=
+        by
+        intro i hi
+        have hpos : 0 < (1 + β€–g xβ€–) ^ k' := by positivity
+        rw [le_div_iff' hpos]
+        change i ≀ (k', n).snd at hi
+        exact one_add_le_sup_seminorm_apply le_rfl hi _ _
+      have hgrowth' :
+        βˆ€ (N : β„•) (hN₁ : 1 ≀ N) (hNβ‚‚ : N ≀ n),
+          β€–iteratedFderiv ℝ N g xβ€– ≀ ((C + 1) * (1 + β€–xβ€–) ^ l) ^ N :=
+        by
+        intro N hN₁ hNβ‚‚
+        refine' (hgrowth N hNβ‚‚ x).trans _
+        rw [mul_pow]
+        have hN₁' := (lt_of_lt_of_le zero_lt_one hN₁).Ne.symm
+        refine' mul_le_mul _ _ (by positivity) (by positivity)
+        Β· exact le_trans (by simp [hC]) (le_self_pow (by simp [hC]) hN₁')
+        Β· refine' le_self_pow (one_le_pow_of_one_le _ l) hN₁'
+          simp only [le_add_iff_nonneg_right, norm_nonneg]
+      have := norm_iteratedFderiv_comp_le f.smooth' hg.1 le_top x hbound hgrowth'
+      have hxk : β€–xβ€– ^ k ≀ (1 + β€–xβ€–) ^ k :=
+        pow_le_pow_of_le_left (norm_nonneg _) (by simp only [zero_le_one, le_add_iff_nonneg_left]) _
+      refine' le_trans (mul_le_mul hxk this (by positivity) (by positivity)) _
+      have rearrange :
+        (1 + β€–xβ€–) ^ k *
+            (n ! * (2 ^ k' * seminorm_f / (1 + β€–g xβ€–) ^ k') * ((C + 1) * (1 + β€–xβ€–) ^ l) ^ n) =
+          (1 + β€–xβ€–) ^ (k + l * n) / (1 + β€–g xβ€–) ^ k' * ((C + 1) ^ n * n ! * 2 ^ k' * seminorm_f) :=
+        by
+        rw [mul_pow, pow_add, ← pow_mul]
+        ring
+      rw [rearrange]
+      have hgxk' : 0 < (1 + β€–g xβ€–) ^ k' := by positivity
+      rw [← div_le_iff hgxk'] at hg_upper''
+      have hpos : 0 ≀ (C + 1) ^ n * n ! * 2 ^ k' * seminorm_f :=
+        by
+        have : 0 ≀ seminorm_f := map_nonneg _ _
+        positivity
+      refine' le_trans (mul_le_mul_of_nonneg_right hg_upper'' hpos) _
+      rw [← mul_assoc])
+#align schwartz_map.comp_clm SchwartzMap.compClm
+
+end Comp
+
 section Derivatives
 
 /-! ### Derivatives of Schwartz functions -/
@@ -710,6 +919,54 @@ theorem derivClm_apply (f : 𝓒(ℝ, F)) (x : ℝ) : derivClm π•œ f x = deriv
   rfl
 #align schwartz_map.deriv_clm_apply SchwartzMap.derivClm_apply
 
+/-- The partial derivative (or directional derivative) in the direction `m : E` as a
+continuous linear map on Schwartz space. -/
+def pderivClm (m : E) : 𝓒(E, F) β†’L[π•œ] 𝓒(E, F) :=
+  (evalClm m).comp (fderivClm π•œ)
+#align schwartz_map.pderiv_clm SchwartzMap.pderivClm
+
+@[simp]
+theorem pderivClm_apply (m : E) (f : 𝓒(E, F)) (x : E) : pderivClm π•œ m f x = fderiv ℝ f x m :=
+  rfl
+#align schwartz_map.pderiv_clm_apply SchwartzMap.pderivClm_apply
+
+/-- The iterated partial derivative (or directional derivative) as a continuous linear map on
+Schwartz space. -/
+def iteratedPderiv {n : β„•} : (Fin n β†’ E) β†’ 𝓒(E, F) β†’L[π•œ] 𝓒(E, F) :=
+  Nat.recOn n (fun x => ContinuousLinearMap.id π•œ _) fun n rec x =>
+    (pderivClm π•œ (x 0)).comp (rec (Fin.tail x))
+#align schwartz_map.iterated_pderiv SchwartzMap.iteratedPderiv
+
+@[simp]
+theorem iteratedPderiv_zero (m : Fin 0 β†’ E) (f : 𝓒(E, F)) : iteratedPderiv π•œ m f = f :=
+  rfl
+#align schwartz_map.iterated_pderiv_zero SchwartzMap.iteratedPderiv_zero
+
+@[simp]
+theorem iteratedPderiv_one (m : Fin 1 β†’ E) (f : 𝓒(E, F)) :
+    iteratedPderiv π•œ m f = pderivClm π•œ (m 0) f :=
+  rfl
+#align schwartz_map.iterated_pderiv_one SchwartzMap.iteratedPderiv_one
+
+theorem iteratedPderiv_succ_left {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E, F)) :
+    iteratedPderiv π•œ m f = pderivClm π•œ (m 0) (iteratedPderiv π•œ (Fin.tail m) f) :=
+  rfl
+#align schwartz_map.iterated_pderiv_succ_left SchwartzMap.iteratedPderiv_succ_left
+
+theorem iteratedPderiv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E, F)) :
+    iteratedPderiv π•œ m f = iteratedPderiv π•œ (Fin.init m) (pderivClm π•œ (m (Fin.last n)) f) :=
+  by
+  induction' n with n IH
+  Β· rw [iterated_pderiv_zero, iterated_pderiv_one]
+    rfl
+  -- The proof is `βˆ‚^{n + 2} = βˆ‚ βˆ‚^{n + 1} = βˆ‚ βˆ‚^n βˆ‚ = βˆ‚^{n+1} βˆ‚`
+  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSucc_zero]
+  have hmtail : Fin.tail m (Fin.last n) = m (Fin.last n.succ) := by
+    simp only [Fin.tail_def, Fin.succ_last]
+  simp only [iterated_pderiv_succ_left, IH (Fin.tail m), hmzero, hmtail, Fin.tail_init_eq_init_tail]
+#align schwartz_map.iterated_pderiv_succ_right SchwartzMap.iteratedPderiv_succ_right
+
+-- Todo: `iterated_pderiv π•œ m f x = iterated_fderiv ℝ f x m`
 end Derivatives
 
 section BoundedContinuousFunction
Diff
@@ -717,7 +717,7 @@ section BoundedContinuousFunction
 /-! ### Inclusion into the space of bounded continuous functions -/
 
 
-open BoundedContinuousFunction
+open scoped BoundedContinuousFunction
 
 /-- Schwartz functions as bounded continuous functions -/
 def toBoundedContinuousFunction (f : 𝓒(E, F)) : E →ᡇ F :=
Diff
@@ -294,8 +294,7 @@ instance hasNsmul : SMul β„• 𝓒(E, F) :=
       smooth' := (f.smooth _).const_smul c
       decay' :=
         by
-        have : c β€’ (f : E β†’ F) = (c : ℝ) β€’ f := by
-          ext x
+        have : c β€’ (f : E β†’ F) = (c : ℝ) β€’ f := by ext x;
           simp only [Pi.smul_apply, ← nsmul_eq_smul_cast]
         simp only [this]
         exact ((c : ℝ) β€’ f).decay' }⟩
@@ -307,8 +306,7 @@ instance hasZsmul : SMul β„€ 𝓒(E, F) :=
       smooth' := (f.smooth _).const_smul c
       decay' :=
         by
-        have : c β€’ (f : E β†’ F) = (c : ℝ) β€’ f := by
-          ext x
+        have : c β€’ (f : E β†’ F) = (c : ℝ) β€’ f := by ext x;
           simp only [Pi.smul_apply, ← zsmul_eq_smul_cast]
         simp only [this]
         exact ((c : ℝ) β€’ f).decay' }⟩
@@ -421,9 +419,7 @@ theorem coe_coeHom : (coeHom E F : 𝓒(E, F) β†’ E β†’ F) = coeFn :=
   rfl
 #align schwartz_map.coe_coe_hom SchwartzMap.coe_coeHom
 
-theorem coeHom_injective : Function.Injective (coeHom E F) :=
-  by
-  rw [coe_coe_hom]
+theorem coeHom_injective : Function.Injective (coeHom E F) := by rw [coe_coe_hom];
   exact FunLike.coe_injective
 #align schwartz_map.coe_hom_injective SchwartzMap.coeHom_injective
 
@@ -748,12 +744,8 @@ variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 def toBoundedContinuousFunctionLm : 𝓒(E, F) β†’β‚—[π•œ] E →ᡇ F
     where
   toFun f := f.toBoundedContinuousFunction
-  map_add' f g := by
-    ext
-    exact add_apply
-  map_smul' a f := by
-    ext
-    exact smul_apply
+  map_add' f g := by ext; exact add_apply
+  map_smul' a f := by ext; exact smul_apply
 #align schwartz_map.to_bounded_continuous_function_lm SchwartzMap.toBoundedContinuousFunctionLm
 
 @[simp]
Diff
@@ -597,7 +597,7 @@ instance : UniformAddGroup 𝓒(E, F) :=
   (schwartzSeminormFamily ℝ E F).AddGroupFilterBasis.UniformAddGroup
 
 instance : LocallyConvexSpace ℝ 𝓒(E, F) :=
-  (schwartz_withSeminorms ℝ E F).to_locallyConvexSpace
+  (schwartz_withSeminorms ℝ E F).toLocallyConvexSpace
 
 instance : TopologicalSpace.FirstCountableTopology 𝓒(E, F) :=
   (schwartz_withSeminorms ℝ E F).first_countable
Diff
@@ -597,7 +597,7 @@ instance : UniformAddGroup 𝓒(E, F) :=
   (schwartzSeminormFamily ℝ E F).AddGroupFilterBasis.UniformAddGroup
 
 instance : LocallyConvexSpace ℝ 𝓒(E, F) :=
-  (schwartz_withSeminorms ℝ E F).toLocallyConvexSpace
+  (schwartz_withSeminorms ℝ E F).to_locallyConvexSpace
 
 instance : TopologicalSpace.FirstCountableTopology 𝓒(E, F) :=
   (schwartz_withSeminorms ℝ E F).first_countable
Diff
@@ -451,7 +451,7 @@ variable (π•œ)
 `𝓒(E, F)`. -/
 @[protected]
 def seminorm (k n : β„•) : Seminorm π•œ 𝓒(E, F) :=
-  Seminorm.ofSMulLe (seminormAux k n) (seminormAux_zero k n) (seminormAux_add_le k n)
+  Seminorm.ofSMulLE (seminormAux k n) (seminormAux_zero k n) (seminormAux_add_le k n)
     (seminormAux_smul_le k n)
 #align schwartz_map.seminorm SchwartzMap.seminorm
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 
 ! This file was ported from Lean 3 source module analysis.schwartz_space
-! leanprover-community/mathlib commit a968611b6a772cf7bdf61146e6d62fc882c92372
+! leanprover-community/mathlib commit 0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,7 +14,7 @@ import Mathbin.Analysis.LocallyConvex.WithSeminorms
 import Mathbin.Topology.Algebra.UniformFilterBasis
 import Mathbin.Topology.ContinuousFunction.Bounded
 import Mathbin.Tactic.Positivity
-import Mathbin.Analysis.SpecialFunctions.Pow
+import Mathbin.Analysis.SpecialFunctions.Pow.Real
 
 /-!
 # Schwartz space
Diff
@@ -224,22 +224,22 @@ section SeminormAux
 /-- Helper definition for the seminorms of the Schwartz space. -/
 @[protected]
 def seminormAux (k n : β„•) (f : 𝓒(E, F)) : ℝ :=
-  infβ‚› { c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ c }
+  sInf { c | 0 ≀ c ∧ βˆ€ x, β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ c }
 #align schwartz_map.seminorm_aux SchwartzMap.seminormAux
 
 theorem seminormAux_nonneg (k n : β„•) (f : 𝓒(E, F)) : 0 ≀ f.seminormAux k n :=
-  le_cinfβ‚› (bounds_nonempty k n f) fun _ ⟨hx, _⟩ => hx
+  le_csInf (bounds_nonempty k n f) fun _ ⟨hx, _⟩ => hx
 #align schwartz_map.seminorm_aux_nonneg SchwartzMap.seminormAux_nonneg
 
 theorem le_seminormAux (k n : β„•) (f : 𝓒(E, F)) (x : E) :
     β€–xβ€– ^ k * β€–iteratedFderiv ℝ n (⇑f) xβ€– ≀ f.seminormAux k n :=
-  le_cinfβ‚› (bounds_nonempty k n f) fun y ⟨_, h⟩ => h x
+  le_csInf (bounds_nonempty k n f) fun y ⟨_, h⟩ => h x
 #align schwartz_map.le_seminorm_aux SchwartzMap.le_seminormAux
 
 /-- If one controls the norm of every `A x`, then one controls the norm of `A`. -/
 theorem seminormAux_le_bound (k n : β„•) (f : 𝓒(E, F)) {M : ℝ} (hMp : 0 ≀ M)
     (hM : βˆ€ x, β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ M) : f.seminormAux k n ≀ M :=
-  cinfβ‚›_le (bounds_bddBelow k n f) ⟨hMp, hM⟩
+  csInf_le (bounds_bddBelow k n f) ⟨hMp, hM⟩
 #align schwartz_map.seminorm_aux_le_bound SchwartzMap.seminormAux_le_bound
 
 end SeminormAux
@@ -575,7 +575,7 @@ instance : TopologicalSpace 𝓒(E, F) :=
 theorem schwartz_withSeminorms : WithSeminorms (schwartzSeminormFamily π•œ E F) :=
   by
   have A : WithSeminorms (schwartzSeminormFamily ℝ E F) := ⟨rfl⟩
-  rw [SeminormFamily.withSeminorms_iff_nhds_eq_infᡒ] at A⊒
+  rw [SeminormFamily.withSeminorms_iff_nhds_eq_iInf] at A⊒
   rw [A]
   rfl
 #align schwartz_with_seminorms schwartz_withSeminorms
Diff
@@ -451,7 +451,7 @@ variable (π•œ)
 `𝓒(E, F)`. -/
 @[protected]
 def seminorm (k n : β„•) : Seminorm π•œ 𝓒(E, F) :=
-  Seminorm.ofSmulLe (seminormAux k n) (seminormAux_zero k n) (seminormAux_add_le k n)
+  Seminorm.ofSMulLe (seminormAux k n) (seminormAux_zero k n) (seminormAux_add_le k n)
     (seminormAux_smul_le k n)
 #align schwartz_map.seminorm SchwartzMap.seminorm
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 
 ! This file was ported from Lean 3 source module analysis.schwartz_space
-! leanprover-community/mathlib commit 8cab1cd8f0fcaa0995b9d98188f7c7edfd4a3983
+! leanprover-community/mathlib commit a968611b6a772cf7bdf61146e6d62fc882c92372
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -27,7 +27,7 @@ smooth functions `f : E β†’ F`, where `E` and `F` are real normed vector spaces
 natural numbers `k` and `n` we have uniform bounds `β€–xβ€–^k * β€–iterated_fderiv ℝ n f xβ€– < C`.
 This approach completely avoids using partial derivatives as well as polynomials.
 We construct the topology on the Schwartz space by a family of seminorms, which are the best
-constants in the above estimates, which is by abstract theory from
+constants in the above estimates. The abstract theory of topological vector spaces developed in
 `seminorm_family.module_filter_basis` and `with_seminorms.to_locally_convex_space` turns the
 Schwartz space into a locally convex topological vector space.
 
@@ -45,6 +45,8 @@ decay faster than any power of `β€–xβ€–`.
 
 * `schwartz_map.uniform_add_group` and `schwartz_map.locally_convex`: The Schwartz space is a
 locally convex topological vector space.
+* `schwartz_map.one_add_le_sup_seminorm_apply`: For a Schwartz function `f` there is a uniform bound
+on `(1 + β€–xβ€–) ^ k * β€–iterated_fderiv ℝ n f xβ€–`.
 
 ## Implementation details
 
@@ -505,19 +507,10 @@ theorem norm_le_seminorm (f : 𝓒(E, F)) (xβ‚€ : E) : β€–f xβ‚€β€– ≀ (Schwart
   rwa [pow_zero, one_mul] at this
 #align schwartz_map.norm_le_seminorm SchwartzMap.norm_le_seminorm
 
-end Seminorms
-
-section Topology
-
-/-! ### The topology on the Schwartz space-/
-
-
-variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
-
 variable (π•œ E F)
 
 /-- The family of Schwartz seminorms. -/
-def schwartzSeminormFamily : SeminormFamily π•œ 𝓒(E, F) (β„• Γ— β„•) := fun n => Seminorm π•œ n.1 n.2
+def schwartzSeminormFamily : SeminormFamily π•œ 𝓒(E, F) (β„• Γ— β„•) := fun m => Seminorm π•œ m.1 m.2
 #align schwartz_seminorm_family schwartzSeminormFamily
 
 @[simp]
@@ -532,6 +525,50 @@ theorem schwartzSeminormFamily_apply_zero :
   rfl
 #align schwartz_map.schwartz_seminorm_family_apply_zero SchwartzMap.schwartzSeminormFamily_apply_zero
 
+variable {π•œ E F}
+
+/-- A more convenient version of `le_sup_seminorm_apply`.
+
+The set `finset.Iic m` is the set of all pairs `(k', n')` with `k' ≀ m.1` and `n' ≀ m.2`.
+Note that the constant is far from optimal. -/
+theorem one_add_le_sup_seminorm_apply {m : β„• Γ— β„•} {k n : β„•} (hk : k ≀ m.1) (hn : n ≀ m.2)
+    (f : 𝓒(E, F)) (x : E) :
+    (1 + β€–xβ€–) ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀
+      2 ^ m.1 * (Finset.Iic m).sup (fun m => Seminorm π•œ m.1 m.2) f :=
+  by
+  rw [add_comm, add_pow]
+  simp only [one_pow, mul_one, Finset.sum_congr, Finset.sum_mul]
+  norm_cast
+  rw [← Nat.sum_range_choose m.1]
+  push_cast
+  rw [Finset.sum_mul]
+  have hk' : Finset.range (k + 1) βŠ† Finset.range (m.1 + 1) := by
+    rwa [Finset.range_subset, add_le_add_iff_right]
+  refine' le_trans (Finset.sum_le_sum_of_subset_of_nonneg hk' fun _ _ _ => by positivity) _
+  refine' Finset.sum_le_sum fun i hi => _
+  rw [mul_comm (β€–xβ€– ^ i), mul_assoc]
+  refine' mul_le_mul _ _ (by positivity) (by positivity)
+  Β· norm_cast
+    exact i.choose_le_choose hk
+  exact
+    (le_seminorm π•œ i n f x).trans
+      (Seminorm.le_def.1
+        (Finset.le_sup_of_le
+          (Finset.mem_Iic.2 <| Prod.mk_le_mk.2 ⟨finset.mem_range_succ_iff.mp hi, hn⟩) le_rfl)
+        _)
+#align schwartz_map.one_add_le_sup_seminorm_apply SchwartzMap.one_add_le_sup_seminorm_apply
+
+end Seminorms
+
+section Topology
+
+/-! ### The topology on the Schwartz space-/
+
+
+variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+
+variable (π•œ E F)
+
 instance : TopologicalSpace 𝓒(E, F) :=
   (schwartzSeminormFamily ℝ E F).ModuleFilterBasis.topology'
 
Diff
@@ -139,39 +139,41 @@ section IsO
 variable (f : 𝓒(E, F))
 
 /-- Auxiliary lemma, used in proving the more general result `is_O_cocompact_zpow`. -/
-theorem isO_cocompact_zpow_neg_nat (k : β„•) :
-    Asymptotics.IsO (Filter.cocompact E) f fun x => β€–xβ€– ^ (-k : β„€) :=
+theorem isBigO_cocompact_zpow_neg_nat (k : β„•) :
+    Asymptotics.IsBigO (Filter.cocompact E) f fun x => β€–xβ€– ^ (-k : β„€) :=
   by
   obtain ⟨d, hd, hd'⟩ := f.decay k 0
   simp_rw [norm_iteratedFderiv_zero] at hd'
-  simp_rw [Asymptotics.IsO, Asymptotics.IsOWith]
+  simp_rw [Asymptotics.IsBigO, Asymptotics.IsBigOWith]
   refine' ⟨d, Filter.Eventually.filter_mono Filter.cocompact_le_cofinite _⟩
   refine' (Filter.eventually_cofinite_ne 0).mp (Filter.eventually_of_forall fun x hx => _)
   rwa [Real.norm_of_nonneg (zpow_nonneg (norm_nonneg _) _), zpow_neg, ← div_eq_mul_inv, le_div_iff']
   exacts[hd' x, zpow_pos_of_pos (norm_pos_iff.mpr hx) _]
-#align schwartz_map.is_O_cocompact_zpow_neg_nat SchwartzMap.isO_cocompact_zpow_neg_nat
+#align schwartz_map.is_O_cocompact_zpow_neg_nat SchwartzMap.isBigO_cocompact_zpow_neg_nat
 
-theorem isO_cocompact_rpow [ProperSpace E] (s : ℝ) :
-    Asymptotics.IsO (Filter.cocompact E) f fun x => β€–xβ€– ^ s :=
+theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
+    Asymptotics.IsBigO (Filter.cocompact E) f fun x => β€–xβ€– ^ s :=
   by
   let k := ⌈-sβŒ‰β‚Š
   have hk : -(k : ℝ) ≀ s := neg_le.mp (Nat.le_ceil (-s))
   refine' (is_O_cocompact_zpow_neg_nat f k).trans _
   refine'
-    (_ : Asymptotics.IsO Filter.atTop (fun x : ℝ => x ^ (-k : β„€)) fun x : ℝ => x ^ s).comp_tendsto
+    (_ :
+          Asymptotics.IsBigO Filter.atTop (fun x : ℝ => x ^ (-k : β„€)) fun x : ℝ =>
+            x ^ s).comp_tendsto
       tendsto_norm_cocompact_atTop
-  simp_rw [Asymptotics.IsO, Asymptotics.IsOWith]
+  simp_rw [Asymptotics.IsBigO, Asymptotics.IsBigOWith]
   refine' ⟨1, Filter.eventually_of_mem (Filter.eventually_ge_atTop 1) fun x hx => _⟩
   rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg_of_nonneg (zero_le_one.trans hx) _),
     Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_int_cast, Int.cast_neg,
     Int.cast_ofNat]
   exact Real.rpow_le_rpow_of_exponent_le hx hk
-#align schwartz_map.is_O_cocompact_rpow SchwartzMap.isO_cocompact_rpow
+#align schwartz_map.is_O_cocompact_rpow SchwartzMap.isBigO_cocompact_rpow
 
-theorem isO_cocompact_zpow [ProperSpace E] (k : β„€) :
-    Asymptotics.IsO (Filter.cocompact E) f fun x => β€–xβ€– ^ k := by
+theorem isBigO_cocompact_zpow [ProperSpace E] (k : β„€) :
+    Asymptotics.IsBigO (Filter.cocompact E) f fun x => β€–xβ€– ^ k := by
   simpa only [Real.rpow_int_cast] using is_O_cocompact_rpow f k
-#align schwartz_map.is_O_cocompact_zpow SchwartzMap.isO_cocompact_zpow
+#align schwartz_map.is_O_cocompact_zpow SchwartzMap.isBigO_cocompact_zpow
 
 end IsO
 
Diff
@@ -4,11 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 
 ! This file was ported from Lean 3 source module analysis.schwartz_space
-! leanprover-community/mathlib commit b2a5f0d6fc79f4aa24586177a8d33b20daf3aea5
+! leanprover-community/mathlib commit 8cab1cd8f0fcaa0995b9d98188f7c7edfd4a3983
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Calculus.ContDiff
+import Mathbin.Analysis.Calculus.IteratedDeriv
 import Mathbin.Analysis.LocallyConvex.WithSeminorms
 import Mathbin.Topology.Algebra.UniformFilterBasis
 import Mathbin.Topology.ContinuousFunction.Bounded
@@ -37,6 +38,8 @@ decay faster than any power of `β€–xβ€–`.
 * `schwartz_map.seminorm`: The family of seminorms as described above
 * `schwartz_map.fderiv_clm`: The differential as a continuous linear map
 `𝓒(E, F) β†’L[π•œ] 𝓒(E, E β†’L[ℝ] F)`
+* `schwartz_map.deriv_clm`: The one-dimensional derivative as a continuous linear map
+`𝓒(ℝ, F) β†’L[π•œ] 𝓒(ℝ, F)`
 
 ## Main statements
 
@@ -120,6 +123,12 @@ theorem differentiable (f : 𝓒(E, F)) : Differentiable ℝ f :=
   (f.smooth 1).Differentiable rfl.le
 #align schwartz_map.differentiable SchwartzMap.differentiable
 
+/-- Every Schwartz function is differentiable at any point. -/
+@[protected]
+theorem differentiableAt (f : 𝓒(E, F)) {x : E} : DifferentiableAt ℝ f x :=
+  f.Differentiable.DifferentiableAt
+#align schwartz_map.differentiable_at SchwartzMap.differentiableAt
+
 @[ext]
 theorem ext {f g : 𝓒(E, F)} (h : βˆ€ x, (f : E β†’ F) x = g x) : f = g :=
   FunLike.ext f g h
@@ -448,12 +457,32 @@ theorem seminorm_le_bound (k n : β„•) (f : 𝓒(E, F)) {M : ℝ} (hMp : 0 ≀ M)
   f.seminormAux_le_bound k n hMp hM
 #align schwartz_map.seminorm_le_bound SchwartzMap.seminorm_le_bound
 
+/-- If one controls the seminorm for every `x`, then one controls the seminorm.
+
+Variant for functions `𝓒(ℝ, F)`. -/
+theorem seminorm_le_bound' (k n : β„•) (f : 𝓒(ℝ, F)) {M : ℝ} (hMp : 0 ≀ M)
+    (hM : βˆ€ x, |x| ^ k * β€–iteratedDeriv n f xβ€– ≀ M) : Seminorm π•œ k n f ≀ M :=
+  by
+  refine' seminorm_le_bound π•œ k n f hMp _
+  simpa only [Real.norm_eq_abs, norm_iteratedFderiv_eq_norm_iteratedDeriv]
+#align schwartz_map.seminorm_le_bound' SchwartzMap.seminorm_le_bound'
+
 /-- The seminorm controls the Schwartz estimate for any fixed `x`. -/
 theorem le_seminorm (k n : β„•) (f : 𝓒(E, F)) (x : E) :
     β€–xβ€– ^ k * β€–iteratedFderiv ℝ n f xβ€– ≀ Seminorm π•œ k n f :=
   f.le_seminormAux k n x
 #align schwartz_map.le_seminorm SchwartzMap.le_seminorm
 
+/-- The seminorm controls the Schwartz estimate for any fixed `x`.
+
+Variant for functions `𝓒(ℝ, F)`. -/
+theorem le_seminorm' (k n : β„•) (f : 𝓒(ℝ, F)) (x : ℝ) :
+    |x| ^ k * β€–iteratedDeriv n f xβ€– ≀ Seminorm π•œ k n f :=
+  by
+  have := le_seminorm π•œ k n f x
+  rwa [← Real.norm_eq_abs, ← norm_iteratedFderiv_eq_norm_iteratedDeriv]
+#align schwartz_map.le_seminorm' SchwartzMap.le_seminorm'
+
 theorem norm_iteratedFderiv_le_seminorm (f : 𝓒(E, F)) (n : β„•) (xβ‚€ : E) :
     β€–iteratedFderiv ℝ n f xβ‚€β€– ≀ (SchwartzMap.seminorm π•œ 0 n) f :=
   by
@@ -606,7 +635,7 @@ def mkClm [RingHomIsometric Οƒ] (A : (D β†’ E) β†’ F β†’ G)
 
 end Clm
 
-section fderiv
+section Derivatives
 
 /-! ### Derivatives of Schwartz functions -/
 
@@ -615,11 +644,10 @@ variable (π•œ)
 
 variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
-/-- The real derivative on Schwartz space as a continuous `π•œ`-linear map. -/
+/-- The FrΓ©chet derivative on Schwartz space as a continuous `π•œ`-linear map. -/
 def fderivClm : 𝓒(E, F) β†’L[π•œ] 𝓒(E, E β†’L[ℝ] F) :=
-  mkClm (fderiv ℝ)
-    (fun f g _ => fderiv_add f.Differentiable.DifferentiableAt g.Differentiable.DifferentiableAt)
-    (fun a f _ => fderiv_const_smul f.Differentiable.DifferentiableAt a)
+  mkClm (fderiv ℝ) (fun f g _ => fderiv_add f.DifferentiableAt g.DifferentiableAt)
+    (fun a f _ => fderiv_const_smul f.DifferentiableAt a)
     (fun f => (contDiff_top_iff_fderiv.mp f.smooth').2) fun ⟨k, n⟩ =>
     ⟨{⟨k, n + 1⟩}, 1, zero_le_one, fun f x => by
       simpa only [schwartz_seminorm_family_apply, Seminorm.comp_apply, Finset.sup_singleton,
@@ -631,7 +659,23 @@ theorem fderivClm_apply (f : 𝓒(E, F)) (x : E) : fderivClm π•œ f x = fderiv 
   rfl
 #align schwartz_map.fderiv_clm_apply SchwartzMap.fderivClm_apply
 
-end fderiv
+/-- The 1-dimensional derivative on Schwartz space as a continuous `π•œ`-linear map. -/
+def derivClm : 𝓒(ℝ, F) β†’L[π•œ] 𝓒(ℝ, F) :=
+  mkClm (fun f => deriv f) (fun f g _ => deriv_add f.DifferentiableAt g.DifferentiableAt)
+    (fun a f _ => deriv_const_smul a f.DifferentiableAt)
+    (fun f => (contDiff_top_iff_deriv.mp f.smooth').2) fun ⟨k, n⟩ =>
+    ⟨{⟨k, n + 1⟩}, 1, zero_le_one, fun f x => by
+      simpa only [Real.norm_eq_abs, Finset.sup_singleton, schwartz_seminorm_family_apply, one_mul,
+        norm_iteratedFderiv_eq_norm_iteratedDeriv, ← iteratedDeriv_succ'] using
+        f.le_seminorm' π•œ k (n + 1) x⟩
+#align schwartz_map.deriv_clm SchwartzMap.derivClm
+
+@[simp]
+theorem derivClm_apply (f : 𝓒(ℝ, F)) (x : ℝ) : derivClm π•œ f x = deriv f x :=
+  rfl
+#align schwartz_map.deriv_clm_apply SchwartzMap.derivClm_apply
+
+end Derivatives
 
 section BoundedContinuousFunction
 
Diff
@@ -504,23 +504,23 @@ theorem schwartzSeminormFamily_apply_zero :
 instance : TopologicalSpace 𝓒(E, F) :=
   (schwartzSeminormFamily ℝ E F).ModuleFilterBasis.topology'
 
-theorem schwartzWithSeminorms : WithSeminorms (schwartzSeminormFamily π•œ E F) :=
+theorem schwartz_withSeminorms : WithSeminorms (schwartzSeminormFamily π•œ E F) :=
   by
   have A : WithSeminorms (schwartzSeminormFamily ℝ E F) := ⟨rfl⟩
   rw [SeminormFamily.withSeminorms_iff_nhds_eq_infᡒ] at A⊒
   rw [A]
   rfl
-#align schwartz_with_seminorms schwartzWithSeminorms
+#align schwartz_with_seminorms schwartz_withSeminorms
 
 variable {π•œ E F}
 
 instance : ContinuousSMul π•œ 𝓒(E, F) :=
   by
-  rw [(schwartzWithSeminorms π•œ E F).withSeminorms_eq]
+  rw [(schwartz_withSeminorms π•œ E F).withSeminorms_eq]
   exact (schwartzSeminormFamily π•œ E F).ModuleFilterBasis.ContinuousSMul
 
 instance : TopologicalAddGroup 𝓒(E, F) :=
-  (schwartzSeminormFamily ℝ E F).AddGroupFilterBasis.is_topological_add_group
+  (schwartzSeminormFamily ℝ E F).AddGroupFilterBasis.isTopologicalAddGroup
 
 instance : UniformSpace 𝓒(E, F) :=
   (schwartzSeminormFamily ℝ E F).AddGroupFilterBasis.UniformSpace
@@ -529,10 +529,10 @@ instance : UniformAddGroup 𝓒(E, F) :=
   (schwartzSeminormFamily ℝ E F).AddGroupFilterBasis.UniformAddGroup
 
 instance : LocallyConvexSpace ℝ 𝓒(E, F) :=
-  (schwartzWithSeminorms ℝ E F).toLocallyConvexSpace
+  (schwartz_withSeminorms ℝ E F).toLocallyConvexSpace
 
 instance : TopologicalSpace.FirstCountableTopology 𝓒(E, F) :=
-  (schwartzWithSeminorms ℝ E F).first_countable
+  (schwartz_withSeminorms ℝ E F).first_countable
 
 end Topology
 
@@ -594,8 +594,8 @@ def mkClm [RingHomIsometric Οƒ] (A : (D β†’ E) β†’ F β†’ G)
   cont := by
     change Continuous (mk_lm A hadd hsmul hsmooth hbound : 𝓒(D, E) β†’β‚›β‚—[Οƒ] 𝓒(F, G))
     refine'
-      Seminorm.continuous_from_bounded (schwartzWithSeminorms π•œ D E) (schwartzWithSeminorms π•œ' F G)
-        _ fun n => _
+      Seminorm.continuous_from_bounded (schwartz_withSeminorms π•œ D E)
+        (schwartz_withSeminorms π•œ' F G) _ fun n => _
     rcases hbound n with ⟨s, C, hC, h⟩
     refine' ⟨s, ⟨C, hC⟩, fun f => _⟩
     simp only [Seminorm.comp_apply, Seminorm.smul_apply, NNReal.smul_def, Algebra.id.smul_eq_mul,
@@ -686,8 +686,8 @@ def toBoundedContinuousFunctionClm : 𝓒(E, F) β†’L[π•œ] E →ᡇ F :=
     cont := by
       change Continuous (to_bounded_continuous_function_lm π•œ E F)
       refine'
-        Seminorm.continuous_from_bounded (schwartzWithSeminorms π•œ E F)
-          (normWithSeminorms π•œ (E →ᡇ F)) _ fun i => ⟨{0}, 1, fun f => _⟩
+        Seminorm.continuous_from_bounded (schwartz_withSeminorms π•œ E F)
+          (norm_withSeminorms π•œ (E →ᡇ F)) _ fun i => ⟨{0}, 1, fun f => _⟩
       rw [Finset.sup_singleton, one_smul, Seminorm.comp_apply, coe_normSeminorm,
         schwartz_seminorm_family_apply_zero, BoundedContinuousFunction.norm_le (map_nonneg _ _)]
       intro x
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 
 ! This file was ported from Lean 3 source module analysis.schwartz_space
-! leanprover-community/mathlib commit b31173ee05c911d61ad6a05bd2196835c932e0ec
+! leanprover-community/mathlib commit b2a5f0d6fc79f4aa24586177a8d33b20daf3aea5
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -59,7 +59,7 @@ Schwartz space, tempered distributions
 
 noncomputable section
 
-variable {π•œ π•œ' E F : Type _}
+variable {π•œ π•œ' D E F G : Type _}
 
 variable [NormedAddCommGroup E] [NormedSpace ℝ E]
 
@@ -536,78 +536,98 @@ instance : TopologicalSpace.FirstCountableTopology 𝓒(E, F) :=
 
 end Topology
 
-section fderiv
+section Clm
 
-/-! ### Derivatives of Schwartz functions -/
+/-! ### Construction of continuous linear maps between Schwartz spaces -/
 
 
-variable {E F}
+variable [NormedField π•œ] [NormedField π•œ']
 
-/-- The derivative of a Schwartz function as a Schwartz function with values in the
-continuous linear maps `Eβ†’L[ℝ] F`. -/
-@[protected]
-def fderiv (f : 𝓒(E, F)) : 𝓒(E, E β†’L[ℝ] F)
-    where
-  toFun := fderiv ℝ f
-  smooth' := (contDiff_top_iff_fderiv.mp f.smooth').2
-  decay' := by
-    intro k n
-    cases' f.decay' k (n + 1) with C hC
-    use C
-    intro x
-    rw [norm_iteratedFderiv_fderiv]
-    exact hC x
-#align schwartz_map.fderiv SchwartzMap.fderiv
-
-@[simp, norm_cast]
-theorem coe_fderiv (f : 𝓒(E, F)) : ⇑f.fderiv = fderiv ℝ f :=
-  rfl
-#align schwartz_map.coe_fderiv SchwartzMap.coe_fderiv
+variable [NormedAddCommGroup D] [NormedSpace ℝ D]
 
-@[simp]
-theorem fderiv_apply (f : 𝓒(E, F)) (x : E) : f.fderiv x = fderiv ℝ f x :=
-  rfl
-#align schwartz_map.fderiv_apply SchwartzMap.fderiv_apply
+variable [NormedSpace π•œ E] [SMulCommClass ℝ π•œ E]
 
-variable (π•œ)
+variable [NormedAddCommGroup G] [NormedSpace ℝ G] [NormedSpace π•œ' G] [SMulCommClass ℝ π•œ' G]
 
-variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+variable {Οƒ : π•œ β†’+* π•œ'}
 
-/-- The derivative on Schwartz space as a linear map. -/
-def fderivLm : 𝓒(E, F) β†’β‚—[π•œ] 𝓒(E, E β†’L[ℝ] F)
-    where
-  toFun := SchwartzMap.fderiv
-  map_add' f g :=
-    ext fun _ => fderiv_add f.Differentiable.DifferentiableAt g.Differentiable.DifferentiableAt
-  map_smul' a f := ext fun _ => fderiv_const_smul f.Differentiable.DifferentiableAt a
-#align schwartz_map.fderiv_lm SchwartzMap.fderivLm
-
-@[simp, norm_cast]
-theorem fderivLm_apply (f : 𝓒(E, F)) : fderivLm π•œ f = SchwartzMap.fderiv f :=
-  rfl
-#align schwartz_map.fderiv_lm_apply SchwartzMap.fderivLm_apply
+/-- Create a semilinear map between Schwartz spaces.
 
-/-- The derivative on Schwartz space as a continuous linear map. -/
-def fderivClm : 𝓒(E, F) β†’L[π•œ] 𝓒(E, E β†’L[ℝ] F)
+Note: This is a helper definition for `mk_clm`. -/
+def mkLm (A : (D β†’ E) β†’ F β†’ G) (hadd : βˆ€ (f g : 𝓒(D, E)) (x), A (f + g) x = A f x + A g x)
+    (hsmul : βˆ€ (a : π•œ) (f : 𝓒(D, E)) (x), A (a β€’ f) x = Οƒ a β€’ A f x)
+    (hsmooth : βˆ€ f : 𝓒(D, E), ContDiff ℝ ⊀ (A f))
+    (hbound :
+      βˆ€ n : β„• Γ— β„•,
+        βˆƒ (s : Finset (β„• Γ— β„•))(C : ℝ)(hC : 0 ≀ C),
+          βˆ€ (f : 𝓒(D, E)) (x : F),
+            β€–xβ€– ^ n.fst * β€–iteratedFderiv ℝ n.snd (A f) xβ€– ≀
+              C * s.sup (schwartzSeminormFamily π•œ D E) f) :
+    𝓒(D, E) β†’β‚›β‚—[Οƒ] 𝓒(F, G)
+    where
+  toFun f :=
+    { toFun := A f
+      smooth' := hsmooth f
+      decay' := by
+        intro k n
+        rcases hbound ⟨k, n⟩ with ⟨s, C, hC, h⟩
+        exact ⟨C * (s.sup (schwartzSeminormFamily π•œ D E)) f, h f⟩ }
+  map_add' f g := ext (hadd f g)
+  map_smul' a f := ext (hsmul a f)
+#align schwartz_map.mk_lm SchwartzMap.mkLm
+
+/-- Create a continuous semilinear map between Schwartz spaces.
+
+For an example of using this definition, see `fderiv_clm`. -/
+def mkClm [RingHomIsometric Οƒ] (A : (D β†’ E) β†’ F β†’ G)
+    (hadd : βˆ€ (f g : 𝓒(D, E)) (x), A (f + g) x = A f x + A g x)
+    (hsmul : βˆ€ (a : π•œ) (f : 𝓒(D, E)) (x), A (a β€’ f) x = Οƒ a β€’ A f x)
+    (hsmooth : βˆ€ f : 𝓒(D, E), ContDiff ℝ ⊀ (A f))
+    (hbound :
+      βˆ€ n : β„• Γ— β„•,
+        βˆƒ (s : Finset (β„• Γ— β„•))(C : ℝ)(hC : 0 ≀ C),
+          βˆ€ (f : 𝓒(D, E)) (x : F),
+            β€–xβ€– ^ n.fst * β€–iteratedFderiv ℝ n.snd (A f) xβ€– ≀
+              C * s.sup (schwartzSeminormFamily π•œ D E) f) :
+    𝓒(D, E) β†’SL[Οƒ] 𝓒(F, G)
     where
   cont := by
-    change Continuous (fderiv_lm π•œ : 𝓒(E, F) β†’β‚—[π•œ] 𝓒(E, E β†’L[ℝ] F))
+    change Continuous (mk_lm A hadd hsmul hsmooth hbound : 𝓒(D, E) β†’β‚›β‚—[Οƒ] 𝓒(F, G))
     refine'
-      Seminorm.continuous_from_bounded (schwartzWithSeminorms π•œ E F)
-        (schwartzWithSeminorms π•œ E (E β†’L[ℝ] F)) _ _
-    rintro ⟨k, n⟩
-    use {⟨k, n + 1⟩}, 1
-    intro f
-    simp only [schwartz_seminorm_family_apply, Seminorm.comp_apply, Finset.sup_singleton, one_smul]
-    refine' (fderiv_lm π•œ f).seminorm_le_bound π•œ k n (by positivity) _
-    intro x
-    rw [fderiv_lm_apply, coe_fderiv, norm_iteratedFderiv_fderiv]
-    exact f.le_seminorm π•œ k (n + 1) x
-  toLinearMap := fderivLm π•œ
+      Seminorm.continuous_from_bounded (schwartzWithSeminorms π•œ D E) (schwartzWithSeminorms π•œ' F G)
+        _ fun n => _
+    rcases hbound n with ⟨s, C, hC, h⟩
+    refine' ⟨s, ⟨C, hC⟩, fun f => _⟩
+    simp only [Seminorm.comp_apply, Seminorm.smul_apply, NNReal.smul_def, Algebra.id.smul_eq_mul,
+      Subtype.coe_mk]
+    exact (mk_lm A hadd hsmul hsmooth hbound f).seminorm_le_bound π•œ' n.1 n.2 (by positivity) (h f)
+  toLinearMap := mkLm A hadd hsmul hsmooth hbound
+#align schwartz_map.mk_clm SchwartzMap.mkClm
+
+end Clm
+
+section fderiv
+
+/-! ### Derivatives of Schwartz functions -/
+
+
+variable (π•œ)
+
+variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+
+/-- The real derivative on Schwartz space as a continuous `π•œ`-linear map. -/
+def fderivClm : 𝓒(E, F) β†’L[π•œ] 𝓒(E, E β†’L[ℝ] F) :=
+  mkClm (fderiv ℝ)
+    (fun f g _ => fderiv_add f.Differentiable.DifferentiableAt g.Differentiable.DifferentiableAt)
+    (fun a f _ => fderiv_const_smul f.Differentiable.DifferentiableAt a)
+    (fun f => (contDiff_top_iff_fderiv.mp f.smooth').2) fun ⟨k, n⟩ =>
+    ⟨{⟨k, n + 1⟩}, 1, zero_le_one, fun f x => by
+      simpa only [schwartz_seminorm_family_apply, Seminorm.comp_apply, Finset.sup_singleton,
+        one_smul, norm_iteratedFderiv_fderiv, one_mul] using f.le_seminorm π•œ k (n + 1) x⟩
 #align schwartz_map.fderiv_clm SchwartzMap.fderivClm
 
-@[simp, norm_cast]
-theorem fderivClm_apply (f : 𝓒(E, F)) : fderivClm π•œ f = SchwartzMap.fderiv f :=
+@[simp]
+theorem fderivClm_apply (f : 𝓒(E, F)) (x : E) : fderivClm π•œ f x = fderiv ℝ f x :=
   rfl
 #align schwartz_map.fderiv_clm_apply SchwartzMap.fderivClm_apply
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 
 ! This file was ported from Lean 3 source module analysis.schwartz_space
-! leanprover-community/mathlib commit 38f16f960f5006c6c0c2bac7b0aba5273188f4e5
+! leanprover-community/mathlib commit b31173ee05c911d61ad6a05bd2196835c932e0ec
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -596,7 +596,7 @@ def fderivClm : 𝓒(E, F) β†’L[π•œ] 𝓒(E, E β†’L[ℝ] F)
       Seminorm.continuous_from_bounded (schwartzWithSeminorms π•œ E F)
         (schwartzWithSeminorms π•œ E (E β†’L[ℝ] F)) _ _
     rintro ⟨k, n⟩
-    use {⟨k, n + 1⟩}, 1, one_ne_zero
+    use {⟨k, n + 1⟩}, 1
     intro f
     simp only [schwartz_seminorm_family_apply, Seminorm.comp_apply, Finset.sup_singleton, one_smul]
     refine' (fderiv_lm π•œ f).seminorm_le_bound π•œ k n (by positivity) _
@@ -667,7 +667,7 @@ def toBoundedContinuousFunctionClm : 𝓒(E, F) β†’L[π•œ] E →ᡇ F :=
       change Continuous (to_bounded_continuous_function_lm π•œ E F)
       refine'
         Seminorm.continuous_from_bounded (schwartzWithSeminorms π•œ E F)
-          (normWithSeminorms π•œ (E →ᡇ F)) _ fun i => ⟨{0}, 1, one_ne_zero, fun f => _⟩
+          (normWithSeminorms π•œ (E →ᡇ F)) _ fun i => ⟨{0}, 1, fun f => _⟩
       rw [Finset.sup_singleton, one_smul, Seminorm.comp_apply, coe_normSeminorm,
         schwartz_seminorm_family_apply_zero, BoundedContinuousFunction.norm_le (map_nonneg _ _)]
       intro x
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 
 ! This file was ported from Lean 3 source module analysis.schwartz_space
-! leanprover-community/mathlib commit 17ef379e997badd73e5eabb4d38f11919ab3c4b3
+! leanprover-community/mathlib commit 38f16f960f5006c6c0c2bac7b0aba5273188f4e5
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,7 @@ import Mathbin.Analysis.LocallyConvex.WithSeminorms
 import Mathbin.Topology.Algebra.UniformFilterBasis
 import Mathbin.Topology.ContinuousFunction.Bounded
 import Mathbin.Tactic.Positivity
+import Mathbin.Analysis.SpecialFunctions.Pow
 
 /-!
 # Schwartz space
@@ -124,6 +125,47 @@ theorem ext {f g : 𝓒(E, F)} (h : βˆ€ x, (f : E β†’ F) x = g x) : f = g :=
   FunLike.ext f g h
 #align schwartz_map.ext SchwartzMap.ext
 
+section IsO
+
+variable (f : 𝓒(E, F))
+
+/-- Auxiliary lemma, used in proving the more general result `is_O_cocompact_zpow`. -/
+theorem isO_cocompact_zpow_neg_nat (k : β„•) :
+    Asymptotics.IsO (Filter.cocompact E) f fun x => β€–xβ€– ^ (-k : β„€) :=
+  by
+  obtain ⟨d, hd, hd'⟩ := f.decay k 0
+  simp_rw [norm_iteratedFderiv_zero] at hd'
+  simp_rw [Asymptotics.IsO, Asymptotics.IsOWith]
+  refine' ⟨d, Filter.Eventually.filter_mono Filter.cocompact_le_cofinite _⟩
+  refine' (Filter.eventually_cofinite_ne 0).mp (Filter.eventually_of_forall fun x hx => _)
+  rwa [Real.norm_of_nonneg (zpow_nonneg (norm_nonneg _) _), zpow_neg, ← div_eq_mul_inv, le_div_iff']
+  exacts[hd' x, zpow_pos_of_pos (norm_pos_iff.mpr hx) _]
+#align schwartz_map.is_O_cocompact_zpow_neg_nat SchwartzMap.isO_cocompact_zpow_neg_nat
+
+theorem isO_cocompact_rpow [ProperSpace E] (s : ℝ) :
+    Asymptotics.IsO (Filter.cocompact E) f fun x => β€–xβ€– ^ s :=
+  by
+  let k := ⌈-sβŒ‰β‚Š
+  have hk : -(k : ℝ) ≀ s := neg_le.mp (Nat.le_ceil (-s))
+  refine' (is_O_cocompact_zpow_neg_nat f k).trans _
+  refine'
+    (_ : Asymptotics.IsO Filter.atTop (fun x : ℝ => x ^ (-k : β„€)) fun x : ℝ => x ^ s).comp_tendsto
+      tendsto_norm_cocompact_atTop
+  simp_rw [Asymptotics.IsO, Asymptotics.IsOWith]
+  refine' ⟨1, Filter.eventually_of_mem (Filter.eventually_ge_atTop 1) fun x hx => _⟩
+  rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg_of_nonneg (zero_le_one.trans hx) _),
+    Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_int_cast, Int.cast_neg,
+    Int.cast_ofNat]
+  exact Real.rpow_le_rpow_of_exponent_le hx hk
+#align schwartz_map.is_O_cocompact_rpow SchwartzMap.isO_cocompact_rpow
+
+theorem isO_cocompact_zpow [ProperSpace E] (k : β„€) :
+    Asymptotics.IsO (Filter.cocompact E) f fun x => β€–xβ€– ^ k := by
+  simpa only [Real.rpow_int_cast] using is_O_cocompact_rpow f k
+#align schwartz_map.is_O_cocompact_zpow SchwartzMap.isO_cocompact_zpow
+
+end IsO
+
 section Aux
 
 theorem bounds_nonempty (k n : β„•) (f : 𝓒(E, F)) :
@@ -578,7 +620,7 @@ section BoundedContinuousFunction
 
 open BoundedContinuousFunction
 
-/-- Schwartz functions as bounded continuous functions-/
+/-- Schwartz functions as bounded continuous functions -/
 def toBoundedContinuousFunction (f : 𝓒(E, F)) : E →ᡇ F :=
   BoundedContinuousFunction.ofNormedAddCommGroup f (SchwartzMap.continuous f)
     (SchwartzMap.seminorm ℝ 0 0 f) (norm_le_seminorm ℝ f)
@@ -590,6 +632,11 @@ theorem toBoundedContinuousFunction_apply (f : 𝓒(E, F)) (x : E) :
   rfl
 #align schwartz_map.to_bounded_continuous_function_apply SchwartzMap.toBoundedContinuousFunction_apply
 
+/-- Schwartz functions as continuous functions -/
+def toContinuousMap (f : 𝓒(E, F)) : C(E, F) :=
+  f.toBoundedContinuousFunction.toContinuousMap
+#align schwartz_map.to_continuous_map SchwartzMap.toContinuousMap
+
 variable (π•œ E F)
 
 variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]

Changes in mathlib4

mathlib3
mathlib4
feat: more integrability statements for iterated derivatives of Schwartz functions (#12152)
Diff
@@ -63,7 +63,7 @@ Schwartz space, tempered distributions
 
 noncomputable section
 
-open scoped BigOperators Nat
+open scoped BigOperators Nat NNReal
 
 variable {π•œ π•œ' D E F G V : Type*}
 variable [NormedAddCommGroup E] [NormedSpace ℝ E]
@@ -667,6 +667,18 @@ open MeasureTheory FiniteDimensional
 class _root_.MeasureTheory.Measure.HasTemperateGrowth (ΞΌ : Measure D) : Prop :=
   exists_integrable : βˆƒ (n : β„•), Integrable (fun x ↦ (1 + β€–xβ€–) ^ (- (n : ℝ))) ΞΌ
 
+open Classical in
+/-- An integer exponent `l` such that `(1 + β€–xβ€–) ^ (-l)` is integrable if `ΞΌ` has
+temperate growth. -/
+def _root_.MeasureTheory.Measure.integrablePower (ΞΌ : Measure D) : β„• :=
+  if h : ΞΌ.HasTemperateGrowth then h.exists_integrable.choose else 0
+
+lemma integrable_pow_neg_integrablePower
+    (ΞΌ : Measure D) [h : ΞΌ.HasTemperateGrowth] :
+    Integrable (fun x ↦ (1 + β€–xβ€–) ^ (- (ΞΌ.integrablePower : ℝ))) ΞΌ := by
+  simp [Measure.integrablePower, h]
+  exact h.exists_integrable.choose_spec
+
 instance _root_.MeasureTheory.Measure.IsFiniteMeasure.instHasTemperateGrowth {ΞΌ : Measure D}
     [h : IsFiniteMeasure μ] : μ.HasTemperateGrowth := ⟨⟨0, by simp⟩⟩
 
@@ -674,6 +686,67 @@ instance _root_.MeasureTheory.Measure.IsAddHaarMeasure.instHasTemperateGrowth {
     [h : ΞΌ.IsAddHaarMeasure] : ΞΌ.HasTemperateGrowth :=
   ⟨⟨finrank ℝ D + 1, by apply integrable_one_add_norm; norm_num⟩⟩
 
+/-- Pointwise inequality to control `x ^ k * f` in terms of `1 / (1 + x) ^ l` if one controls both
+`f` (with a bound `C₁`) and `x ^ (k + l) * f` (with a bound `Cβ‚‚`). This will be used to check
+integrability of `x ^ k * f x` when `f` is a Schwartz function, and to control explicitly its
+integral in terms of suitable seminorms of `f`. -/
+lemma pow_mul_le_of_le_of_pow_mul_le {C₁ Cβ‚‚ : ℝ} {k l : β„•} {x f : ℝ} (hx : 0 ≀ x) (hf : 0 ≀ f)
+    (h₁ : f ≀ C₁) (hβ‚‚ : x ^ (k + l) * f ≀ Cβ‚‚) :
+    x ^ k * f ≀ 2 ^ l * (C₁ + Cβ‚‚) * (1 + x) ^ (- (l : ℝ)) := by
+  have : 0 ≀ C₁ := le_trans (by positivity) h₁
+  have : 0 ≀ Cβ‚‚ := le_trans (by positivity) hβ‚‚
+  have : 2 ^ l * (C₁ + Cβ‚‚) * (1 + x) ^ (- (l : ℝ)) = ((1 + x) / 2) ^ (-(l:ℝ)) * (C₁ + Cβ‚‚) := by
+    rw [Real.div_rpow (by linarith) zero_le_two]
+    simp [div_eq_inv_mul, ← Real.rpow_neg_one, ← Real.rpow_mul]
+    ring
+  rw [this]
+  rcases le_total x 1 with h'x|h'x
+  Β· gcongr
+    Β· apply (pow_le_one k hx h'x).trans
+      apply Real.one_le_rpow_of_pos_of_le_one_of_nonpos
+      Β· linarith
+      Β· linarith
+      Β· simp
+    Β· linarith
+  Β· calc
+    x ^ k * f = x ^ (-(l:ℝ)) * (x ^ (k + l) * f) := by
+      rw [← Real.rpow_natCast, ← Real.rpow_natCast, ← mul_assoc, ← Real.rpow_add (by linarith)]
+      simp
+    _ ≀ ((1 + x) / 2) ^ (-(l:ℝ)) * (C₁ + Cβ‚‚) := by
+      apply mul_le_mul _ _ (by positivity) (by positivity)
+      Β· exact Real.rpow_le_rpow_of_nonpos (by linarith) (by linarith) (by simp)
+      Β· exact hβ‚‚.trans (by linarith)
+
+/-- Given a function such that `f` and `x ^ (k + l) * f` are bounded for a suitable `l`, then
+`x ^ k * f` is integrable. The bounds are not relevant for the integrability conclusion, but they
+are relevant for bounding the integral in `integral_pow_mul_le_of_le_of_pow_mul_le`. We formulate
+the two lemmas with the same set of assumptions for ease of applications. -/
+lemma integrable_of_le_of_pow_mul_le
+    {ΞΌ : Measure D} [ΞΌ.HasTemperateGrowth] {f : D β†’ E} {C₁ Cβ‚‚ : ℝ} {k : β„•}
+    (hf : βˆ€ x, β€–f xβ€– ≀ C₁) (h'f : βˆ€ x, β€–xβ€– ^ (k + ΞΌ.integrablePower) * β€–f xβ€– ≀ Cβ‚‚)
+    (h''f : AEStronglyMeasurable f ΞΌ) :
+    Integrable (fun x ↦ β€–xβ€– ^ k * β€–f xβ€–) ΞΌ := by
+  apply ((integrable_pow_neg_integrablePower ΞΌ).const_mul (2 ^ ΞΌ.integrablePower * (C₁ + Cβ‚‚))).mono'
+  Β· exact AEStronglyMeasurable.mul (aestronglyMeasurable_id.norm.pow _) h''f.norm
+  Β· filter_upwards with v
+    simp only [norm_mul, norm_pow, norm_norm]
+    apply pow_mul_le_of_le_of_pow_mul_le (norm_nonneg _) (norm_nonneg _) (hf v) (h'f v)
+
+/-- Given a function such that `f` and `x ^ (k + l) * f` are bounded for a suitable `l`, then
+one can bound explicitly the integral of `x ^ k * f`. -/
+lemma integral_pow_mul_le_of_le_of_pow_mul_le
+    {ΞΌ : Measure D} [ΞΌ.HasTemperateGrowth] {f : D β†’ E} {C₁ Cβ‚‚ : ℝ} {k : β„•}
+    (hf : βˆ€ x, β€–f xβ€– ≀ C₁) (h'f : βˆ€ x, β€–xβ€– ^ (k + ΞΌ.integrablePower) * β€–f xβ€– ≀ Cβ‚‚) :
+    ∫ x, β€–xβ€– ^ k * β€–f xβ€– βˆ‚ΞΌ ≀ 2 ^ ΞΌ.integrablePower *
+      (∫ x, (1 + β€–xβ€–) ^ (- (ΞΌ.integrablePower : ℝ)) βˆ‚ΞΌ) * (C₁ + Cβ‚‚) := by
+  rw [← integral_mul_left, ← integral_mul_right]
+  apply integral_mono_of_nonneg
+  Β· filter_upwards with v using by positivity
+  Β· exact ((integrable_pow_neg_integrablePower ΞΌ).const_mul _).mul_const _
+  filter_upwards with v
+  exact (pow_mul_le_of_le_of_pow_mul_le (norm_nonneg _) (norm_nonneg _) (hf v) (h'f v)).trans
+    (le_of_eq (by ring))
+
 end TemperateGrowth
 
 section CLM
@@ -906,6 +979,44 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
       rw [← mul_assoc])
 #align schwartz_map.comp_clm SchwartzMap.compCLM
 
+@[simp] lemma compCLM_apply {g : D β†’ E} (hg : g.HasTemperateGrowth)
+    (hg_upper : βˆƒ (k : β„•) (C : ℝ), βˆ€ x, β€–xβ€– ≀ C * (1 + β€–g xβ€–) ^ k) (f : 𝓒(E, F)) :
+    compCLM π•œ hg hg_upper f = f ∘ g := rfl
+
+/-- Composition with a function on the right is a continuous linear map on Schwartz space
+provided that the function is temperate and antilipschitz. -/
+def compCLMOfAntilipschitz {K : ℝβ‰₯0} {g : D β†’ E}
+    (hg : g.HasTemperateGrowth) (h'g : AntilipschitzWith K g) :
+    𝓒(E, F) β†’L[π•œ] 𝓒(D, F) := by
+  refine compCLM π•œ hg ⟨1, K * max 1 β€–g 0β€–, fun x ↦ ?_⟩
+  calc
+  β€–xβ€– ≀ K * β€–g x - g 0β€– := by
+    rw [← dist_zero_right, ← dist_eq_norm]
+    apply h'g.le_mul_dist
+  _ ≀ K * (β€–g xβ€– + β€–g 0β€–) := by
+    gcongr
+    exact norm_sub_le _ _
+  _ ≀ K * (β€–g xβ€– + max 1 β€–g 0β€–) := by
+    gcongr
+    exact le_max_right _ _
+  _ ≀ (K * max 1 β€–g 0β€– : ℝ) * (1 + β€–g xβ€–) ^ 1 := by
+    simp only [mul_add, add_comm (K * β€–g xβ€–), pow_one, mul_one, add_le_add_iff_left]
+    gcongr
+    exact le_mul_of_one_le_right (by positivity) (le_max_left _ _)
+
+@[simp] lemma compCLMOfAntilipschitz_apply {K : ℝβ‰₯0} {g : D β†’ E} (hg : g.HasTemperateGrowth)
+    (h'g : AntilipschitzWith K g) (f : 𝓒(E, F)) :
+    compCLMOfAntilipschitz π•œ hg h'g f = f ∘ g := rfl
+
+/-- Composition with a continuous linear equiv on the right is a continuous linear map on
+Schwartz space. -/
+def compCLMOfContinuousLinearEquiv (g : D ≃L[ℝ] E) :
+    𝓒(E, F) β†’L[π•œ] 𝓒(D, F) :=
+  compCLMOfAntilipschitz π•œ (g.toContinuousLinearMap.hasTemperateGrowth) g.antilipschitz
+
+@[simp] lemma compCLMOfContinuousLinearEquiv_apply (g : D ≃L[ℝ] E) (f : 𝓒(E, F)) :
+    compCLMOfContinuousLinearEquiv π•œ g f = f ∘ g := rfl
+
 end Comp
 
 section Derivatives
@@ -1029,25 +1140,27 @@ variable [MeasurableSpace D] [BorelSpace D] [SecondCountableTopology D]
 
 variable {ΞΌ : Measure D} [hΞΌ : HasTemperateGrowth ΞΌ]
 
+attribute [local instance 101] secondCountableTopologyEither_of_left
+
+variable (ΞΌ) in
+lemma integrable_pow_mul_iteratedFDeriv (f : 𝓒(D, V))
+    (k n : β„•) : Integrable (fun x ↦ β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€–) ΞΌ :=
+  integrable_of_le_of_pow_mul_le (norm_iteratedFDeriv_le_seminorm ℝ _ _) (le_seminorm ℝ _ _ _)
+    ((f.smooth ⊀).continuous_iteratedFDeriv le_top).aestronglyMeasurable
+
 variable (ΞΌ) in
 lemma integrable_pow_mul (f : 𝓒(D, V))
     (k : β„•) : Integrable (fun x ↦ β€–xβ€– ^ k * β€–f xβ€–) ΞΌ := by
-  rcases hμ.exists_integrable with ⟨n, h⟩
-  let l := n + k
-  obtain ⟨C, C_nonneg, hC⟩ : βˆƒ C, 0 ≀ C ∧ βˆ€ x, (1 + β€–xβ€–) ^ l * β€–f xβ€– ≀ C := by
-    use 2 ^ l * (Finset.Iic (l, 0)).sup (fun m ↦ SchwartzMap.seminorm ℝ m.1 m.2) f, by positivity
-    simpa using f.one_add_le_sup_seminorm_apply (m := (l, 0)) (k := l) (n := 0) le_rfl le_rfl
-  have : Integrable (fun x : D ↦ C * (1 + β€–xβ€–) ^ (-(n : ℝ))) ΞΌ := h.const_mul _
-  apply this.mono ((aestronglyMeasurable_id.norm.pow _).mul f.continuous.aestronglyMeasurable.norm)
-    (eventually_of_forall (fun x ↦ ?_))
-  conv_rhs => rw [norm_of_nonneg (by positivity), rpow_neg (by positivity), ← div_eq_mul_inv]
-  rw [le_div_iff' (by positivity)]
-  simp only [id_eq, Pi.mul_apply, Pi.pow_apply, norm_mul, norm_pow, norm_norm, rpow_natCast]
-  calc
-    (1 + β€–xβ€–) ^ n * (β€–xβ€– ^ k * β€–f xβ€–)
-      ≀ (1 + β€–xβ€–) ^ n * ((1 + β€–xβ€–) ^ k * β€–f xβ€–) := by gcongr; simp
-    _ = (1 + β€–xβ€–) ^ (n + k) * β€–f xβ€– := by simp only [pow_add, mul_assoc]
-    _ ≀ C := hC x
+  convert integrable_pow_mul_iteratedFDeriv ΞΌ f k 0 with x
+  simp
+
+variable (π•œ ΞΌ) in
+lemma integral_pow_mul_iteratedFDeriv_le (f : 𝓒(D, V)) (k n : β„•) :
+    ∫ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– βˆ‚ΞΌ ≀ 2 ^ ΞΌ.integrablePower *
+      (∫ x, (1 + β€–xβ€–) ^ (- (ΞΌ.integrablePower : ℝ)) βˆ‚ΞΌ) *
+        (SchwartzMap.seminorm π•œ 0 n f + SchwartzMap.seminorm π•œ (k + ΞΌ.integrablePower) n f) :=
+  integral_pow_mul_le_of_le_of_pow_mul_le (norm_iteratedFDeriv_le_seminorm ℝ _ _)
+    (le_seminorm ℝ _ _ _)
 
 lemma integrable (f : 𝓒(D, V)) : Integrable f ΞΌ :=
   (f.integrable_pow_mul ΞΌ 0).mono f.continuous.aestronglyMeasurable
chore: Rename nat_cast/int_cast/rat_cast to natCast/intCast/ratCast (#11486)

Now that I am defining NNRat.cast, I want a definitive answer to this naming issue. Plenty of lemmas in mathlib already use natCast/intCast/ratCast over nat_cast/int_cast/rat_cast, and this matches with the general expectation that underscore-separated name parts correspond to a single declaration.

Diff
@@ -164,7 +164,7 @@ theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
   simp_rw [Asymptotics.IsBigO, Asymptotics.IsBigOWith]
   refine' ⟨1, (Filter.eventually_ge_atTop 1).mono fun x hx => _⟩
   rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg (zero_le_one.trans hx) _),
-    Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_int_cast, Int.cast_neg,
+    Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_intCast, Int.cast_neg,
     Int.cast_natCast]
   exact Real.rpow_le_rpow_of_exponent_le hx hk
 set_option linter.uppercaseLean3 false in
@@ -172,7 +172,7 @@ set_option linter.uppercaseLean3 false in
 
 theorem isBigO_cocompact_zpow [ProperSpace E] (k : β„€) :
     f =O[cocompact E] fun x => β€–xβ€– ^ k := by
-  simpa only [Real.rpow_int_cast] using isBigO_cocompact_rpow f k
+  simpa only [Real.rpow_intCast] using isBigO_cocompact_rpow f k
 set_option linter.uppercaseLean3 false in
 #align schwartz_map.is_O_cocompact_zpow SchwartzMap.isBigO_cocompact_zpow
 
@@ -1042,7 +1042,7 @@ lemma integrable_pow_mul (f : 𝓒(D, V))
     (eventually_of_forall (fun x ↦ ?_))
   conv_rhs => rw [norm_of_nonneg (by positivity), rpow_neg (by positivity), ← div_eq_mul_inv]
   rw [le_div_iff' (by positivity)]
-  simp only [id_eq, Pi.mul_apply, Pi.pow_apply, norm_mul, norm_pow, norm_norm, rpow_nat_cast]
+  simp only [id_eq, Pi.mul_apply, Pi.pow_apply, norm_mul, norm_pow, norm_norm, rpow_natCast]
   calc
     (1 + β€–xβ€–) ^ n * (β€–xβ€– ^ k * β€–f xβ€–)
       ≀ (1 + β€–xβ€–) ^ n * ((1 + β€–xβ€–) ^ k * β€–f xβ€–) := by gcongr; simp
@@ -1068,7 +1068,7 @@ def integralCLM : 𝓒(D, V) β†’L[π•œ] V :=
       have h' : βˆ€ x, β€–f xβ€– ≀ (1 + β€–xβ€–) ^ (-(n : ℝ)) *
           (2 ^ n * ((Finset.Iic m).sup (fun m' => SchwartzMap.seminorm π•œ m'.1 m'.2) f)) := by
         intro x
-        rw [rpow_neg (by positivity), ← div_eq_inv_mul, le_div_iff' (by positivity), rpow_nat_cast]
+        rw [rpow_neg (by positivity), ← div_eq_inv_mul, le_div_iff' (by positivity), rpow_natCast]
         simpa using one_add_le_sup_seminorm_apply (m := m) (k := n) (n := 0) le_rfl le_rfl f x
       apply (integral_mono (by simpa using f.integrable_pow_mul ΞΌ 0) _ h').trans
       Β· rw [integral_mul_right, ← mul_assoc, mul_comm (2 ^ n)]
feat(Topology/Algebra/StrongTopology): introduce type synonym for abstract topologies on CLM (#11470)
Diff
@@ -637,9 +637,8 @@ lemma _root_.Function.HasTemperateGrowth.of_fderiv {f : E β†’ F}
   rcases n with rfl|m
   Β· exact ⟨k, C, fun x ↦ by simpa using h x⟩
   · rcases h'f.2 m with ⟨k', C', h'⟩
-    refine ⟨k', C', fun x ↦ ?_⟩
-    simpa only [ContinuousLinearMap.strongUniformity_topology_eq, Function.comp_apply,
-      LinearIsometryEquiv.norm_map, iteratedFDeriv_succ_eq_comp_right] using h' x
+    refine ⟨k', C', ?_⟩
+    simpa [iteratedFDeriv_succ_eq_comp_right] using h'
 
 lemma _root_.Function.HasTemperateGrowth.zero :
     Function.HasTemperateGrowth (fun _ : E ↦ (0 : F)) := by
chore(Analysis/Distribution/SchwartzSpace): improve proofs (#11684)

Use move_mul to make a few proofs more robust.

Diff
@@ -11,6 +11,7 @@ import Mathlib.Analysis.Normed.Group.ZeroAtInfty
 import Mathlib.Analysis.SpecialFunctions.Pow.Real
 import Mathlib.Analysis.SpecialFunctions.JapaneseBracket
 import Mathlib.Topology.Algebra.UniformFilterBasis
+import Mathlib.Tactic.MoveAdd
 
 #align_import analysis.schwartz_space from "leanprover-community/mathlib"@"e137999b2c6f2be388f4cd3bbf8523de1910cd2b"
 
@@ -539,16 +540,14 @@ theorem one_add_le_sup_seminorm_apply {m : β„• Γ— β„•} {k n : β„•} (hk : k ≀ m
   have hk' : Finset.range (k + 1) βŠ† Finset.range (m.1 + 1) := by
     rwa [Finset.range_subset, add_le_add_iff_right]
   refine' le_trans (Finset.sum_le_sum_of_subset_of_nonneg hk' fun _ _ _ => by positivity) _
-  refine' Finset.sum_le_sum fun i hi => _
-  rw [mul_comm (β€–xβ€– ^ i), mul_assoc]
-  refine' mul_le_mul _ _ (by positivity) (by positivity)
+  gcongr βˆ‘ _i in Finset.range (m.1 + 1), ?_ with i hi
+  move_mul [(Nat.choose k i : ℝ), (Nat.choose m.1 i : ℝ)]
+  gcongr
+  Β· apply (le_seminorm π•œ i n f x).trans
+    apply Seminorm.le_def.1
+    exact Finset.le_sup_of_le (Finset.mem_Iic.2 <|
+      Prod.mk_le_mk.2 ⟨Finset.mem_range_succ_iff.mp hi, hn⟩) le_rfl
   Β· exact mod_cast Nat.choose_le_choose i hk
-  Β· trans
-    Β· exact le_seminorm π•œ i n f x
-    Β· apply Seminorm.le_def.1
-      exact
-        Finset.le_sup_of_le (Finset.mem_Iic.2 <|
-          Prod.mk_le_mk.2 ⟨Finset.mem_range_succ_iff.mp hi, hn⟩) le_rfl
 #align schwartz_map.one_add_le_sup_seminorm_apply SchwartzMap.one_add_le_sup_seminorm_apply
 
 end Seminorms
@@ -625,7 +624,8 @@ theorem _root_.Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f
   Β· simp only [C', Finset.le_sup'_iff, le_max_iff]
     right
     exact ⟨N, hN, rfl.le⟩
-  refine' pow_le_pow_right (by simp only [le_add_iff_nonneg_right, norm_nonneg]) _
+  gcongr
+  Β· simp
   exact Finset.le_sup hN
 #align function.has_temperate_growth.norm_iterated_fderiv_le_uniform_aux Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux
 
@@ -765,8 +765,8 @@ protected def evalCLM (m : E) : 𝓒(E, E β†’L[ℝ] F) β†’L[π•œ] 𝓒(E, F) :=
           (mul_le_mul_of_nonneg_left (norm_iteratedFDeriv_clm_apply_const f.2 le_top)
             (by positivity))
           _
-      rw [← mul_assoc, ← mul_comm β€–mβ€–, mul_assoc]
-      refine' mul_le_mul_of_nonneg_left _ (norm_nonneg _)
+      move_mul [β€–mβ€–]
+      gcongr ?_ * β€–mβ€–
       simp only [Finset.sup_singleton, schwartzSeminormFamily_apply, le_seminorm])
 #align schwartz_map.eval_clm SchwartzMap.evalCLM
 
@@ -792,7 +792,6 @@ def bilinLeftCLM (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemper
         RingHom.id_apply])
     (fun f => (B.isBoundedBilinearMap.contDiff.restrict_scalars ℝ).comp (f.smooth'.prod hg.1))
     (by
-      -- Porting note: rewrite this proof with `rel_congr`
       rintro ⟨k, n⟩
       rcases hg.norm_iteratedFDeriv_le_uniform_aux n with ⟨l, C, hC, hgrowth⟩
       use
@@ -803,34 +802,31 @@ def bilinLeftCLM (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemper
       have hnorm_mul :=
         ContinuousLinearMap.norm_iteratedFDeriv_le_of_bilinear B f.smooth' hg.1 x (n := n) le_top
       refine' le_trans (mul_le_mul_of_nonneg_left hnorm_mul hxk) _
-      rw [← mul_assoc (β€–xβ€– ^ k), mul_comm (β€–xβ€– ^ k)]
+      move_mul [← β€–Bβ€–]
       simp_rw [mul_assoc β€–Bβ€–]
-      refine' mul_le_mul_of_nonneg_left _ (by positivity)
+      gcongr _ * ?_
       rw [Finset.mul_sum]
       have : (βˆ‘ _x : β„• in Finset.range (n + 1), (1 : ℝ)) = n + 1 := by simp
-      repeat rw [mul_assoc ((n : ℝ) + 1)]
+      simp_rw [mul_assoc ((n : ℝ) + 1)]
       rw [← this, Finset.sum_mul]
       refine' Finset.sum_le_sum fun i hi => _
       simp only [one_mul]
-      rw [← mul_assoc, mul_comm (β€–xβ€– ^ k), mul_assoc, mul_assoc, mul_assoc]
-      refine' mul_le_mul _ _ (by positivity) (by positivity)
+      move_mul [(Nat.choose n i : ℝ), (Nat.choose n (n / 2) : ℝ)]
+      gcongr ?_ * ?_
+      swap
       Β· norm_cast
         exact i.choose_le_middle n
       specialize hgrowth (n - i) (by simp only [tsub_le_self]) x
-      rw [← mul_assoc]
       refine' le_trans (mul_le_mul_of_nonneg_left hgrowth (by positivity)) _
-      rw [mul_comm _ (C * _), mul_assoc, mul_assoc C]
-      refine' mul_le_mul_of_nonneg_left _ hC
-      rw [mul_comm _ (β€–xβ€– ^ k)]
-      rw [← mul_assoc]
+      move_mul [C]
+      gcongr ?_ * C
       rw [Finset.mem_range_succ_iff] at hi
       change i ≀ (l + k, n).snd at hi
       refine' le_trans _ (one_add_le_sup_seminorm_apply le_rfl hi f x)
-      refine' mul_le_mul_of_nonneg_right _ (norm_nonneg _)
       rw [pow_add]
-      refine' mul_le_mul_of_nonneg_left _ (by positivity)
-      refine' pow_le_pow_left (norm_nonneg _) _ _
-      simp only [zero_le_one, le_add_iff_nonneg_left])
+      move_mul [(1 + β€–xβ€–) ^ l]
+      gcongr
+      simp)
 #align schwartz_map.bilin_left_clm SchwartzMap.bilinLeftCLM
 
 end Multiplication
@@ -866,11 +862,12 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
       let seminorm_f := ((Finset.Iic (k', n)).sup (schwartzSeminormFamily π•œ _ _)) f
       have hg_upper'' : (1 + β€–xβ€–) ^ (k + l * n) ≀ (1 + Cg) ^ (k + l * n) * (1 + β€–g xβ€–) ^ k' := by
         rw [pow_mul, ← mul_pow]
-        refine' pow_le_pow_left (by positivity) _ _
+        gcongr
         rw [add_mul]
         refine' add_le_add _ (hg_upper' x)
         nth_rw 1 [← one_mul (1 : ℝ)]
-        refine' mul_le_mul (le_refl _) (one_le_pow_of_one_le _ _) zero_le_one zero_le_one
+        gcongr
+        apply one_le_pow_of_one_le
         simp only [le_add_iff_nonneg_right, norm_nonneg]
       have hbound :
         βˆ€ i, i ≀ n β†’ β€–iteratedFDeriv ℝ i f (g x)β€– ≀ 2 ^ k' * seminorm_f / (1 + β€–g xβ€–) ^ k' := by
@@ -885,7 +882,7 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
         refine' (hgrowth N hNβ‚‚ x).trans _
         rw [mul_pow]
         have hN₁' := (lt_of_lt_of_le zero_lt_one hN₁).ne'
-        refine' mul_le_mul _ _ (by positivity) (by positivity)
+        gcongr
         Β· exact le_trans (by simp [hC]) (le_self_pow (by simp [hC]) hN₁')
         Β· refine' le_self_pow (one_le_pow_of_one_le _ l) hN₁'
           simp only [le_add_iff_nonneg_right, norm_nonneg]
chore(Data/Int/Cast): fix confusion between OfNat and Nat.cast lemmas (#11861)

This renames

  • Int.cast_ofNat to Int.cast_natCast
  • Int.int_cast_ofNat to Int.cast_ofNat

I think the history here is that this lemma was previously about Int.ofNat, before we globally fixed the simp-normal form to be Nat.cast.

Since the Int.cast_ofNat name is repurposed, it can't be deprecated. Int.int_cast_ofNat is such a wonky name that it was probably never used.

Diff
@@ -164,7 +164,7 @@ theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
   refine' ⟨1, (Filter.eventually_ge_atTop 1).mono fun x hx => _⟩
   rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg (zero_le_one.trans hx) _),
     Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_int_cast, Int.cast_neg,
-    Int.cast_ofNat]
+    Int.cast_natCast]
   exact Real.rpow_le_rpow_of_exponent_le hx hk
 set_option linter.uppercaseLean3 false in
 #align schwartz_map.is_O_cocompact_rpow SchwartzMap.isBigO_cocompact_rpow
chore: Rename IsROrC to RCLike (#10819)

IsROrC contains data, which goes against the expectation that classes prefixed with Is are prop-valued. People have been complaining about this on and off, so this PR renames IsROrC to RCLike.

Diff
@@ -838,7 +838,7 @@ end Multiplication
 section Comp
 
 variable (π•œ)
-variable [IsROrC π•œ]
+variable [RCLike π•œ]
 variable [NormedAddCommGroup D] [NormedSpace ℝ D]
 variable [NormedAddCommGroup G] [NormedSpace ℝ G]
 variable [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
@@ -918,7 +918,7 @@ section Derivatives
 
 
 variable (π•œ)
-variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+variable [RCLike π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
 /-- The FrΓ©chet derivative on Schwartz space as a continuous `π•œ`-linear map. -/
 def fderivCLM : 𝓒(E, F) β†’L[π•œ] 𝓒(E, E β†’L[ℝ] F) :=
@@ -1026,7 +1026,7 @@ section Integration
 
 open Real Complex Filter MeasureTheory MeasureTheory.Measure FiniteDimensional
 
-variable [IsROrC π•œ]
+variable [RCLike π•œ]
 variable [NormedAddCommGroup D] [NormedSpace ℝ D]
 variable [NormedAddCommGroup V] [NormedSpace ℝ V] [NormedSpace π•œ V]
 variable [MeasurableSpace D] [BorelSpace D] [SecondCountableTopology D]
@@ -1115,7 +1115,7 @@ def toContinuousMap (f : 𝓒(E, F)) : C(E, F) :=
 #align schwartz_map.to_continuous_map SchwartzMap.toContinuousMap
 
 variable (π•œ E F)
-variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+variable [RCLike π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
 /-- The inclusion map from Schwartz functions to bounded continuous functions as a continuous linear
 map. -/
@@ -1198,7 +1198,7 @@ def toZeroAtInfty (f : 𝓒(E, F)) : Cβ‚€(E, F) where
   rfl
 
 variable (π•œ E F)
-variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+variable [RCLike π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
 /-- The inclusion map from Schwartz functions to continuous functions vanishing at infinity as a
 continuous linear map. -/
feat: Real.toNNReal_abs (#11606)

Partially forward-port https://github.com/leanprover-community/mathlib/pull/16976

Also fix an unused argument that somehow made it to master, likely from #10661.

Diff
@@ -1068,10 +1068,6 @@ def integralCLM : 𝓒(D, V) β†’L[π•œ] V :=
       rcases hμ.exists_integrable with ⟨n, h⟩
       let m := (n, 0)
       use Finset.Iic m, 2 ^ n * ∫ x : D, (1 + β€–xβ€–) ^ (- (n : ℝ)) βˆ‚ΞΌ
-      have hpos : 0 ≀ ∫ x : D, (1 + β€–xβ€–) ^ (- (n : ℝ)) βˆ‚ΞΌ := by
-        apply integral_nonneg
-        intro
-        positivity
       refine ⟨by positivity, fun f ↦ (norm_integral_le_integral_norm f).trans ?_⟩
       have h' : βˆ€ x, β€–f xβ€– ≀ (1 + β€–xβ€–) ^ (-(n : ℝ)) *
           (2 ^ n * ((Finset.Iic m).sup (fun m' => SchwartzMap.seminorm π•œ m'.1 m'.2) f)) := by
feat(Analysis/Distribution/SchwartzSpace): generalize the integral (#11373)
Diff
@@ -7,10 +7,10 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds
 import Mathlib.Analysis.Calculus.IteratedDeriv.Defs
 import Mathlib.Analysis.Calculus.LineDeriv.Basic
 import Mathlib.Analysis.LocallyConvex.WithSeminorms
-import Mathlib.Topology.Algebra.UniformFilterBasis
 import Mathlib.Analysis.Normed.Group.ZeroAtInfty
 import Mathlib.Analysis.SpecialFunctions.Pow.Real
 import Mathlib.Analysis.SpecialFunctions.JapaneseBracket
+import Mathlib.Topology.Algebra.UniformFilterBasis
 
 #align_import analysis.schwartz_space from "leanprover-community/mathlib"@"e137999b2c6f2be388f4cd3bbf8523de1910cd2b"
 
@@ -658,6 +658,23 @@ lemma _root_.ContinuousLinearMap.hasTemperateGrowth (f : E β†’L[ℝ] F) :
     simpa [this] using .const _
   Β· exact (f.le_op_norm x).trans (by simp [mul_add])
 
+variable [NormedAddCommGroup D] [NormedSpace ℝ D]
+variable [MeasurableSpace D] [BorelSpace D] [SecondCountableTopology D] [FiniteDimensional ℝ D]
+
+open MeasureTheory FiniteDimensional
+
+/-- A measure `ΞΌ` has temperate growth if there is an `n : β„•` such that `(1 + β€–xβ€–) ^ (- n)` is
+`ΞΌ`-integrable. -/
+class _root_.MeasureTheory.Measure.HasTemperateGrowth (ΞΌ : Measure D) : Prop :=
+  exists_integrable : βˆƒ (n : β„•), Integrable (fun x ↦ (1 + β€–xβ€–) ^ (- (n : ℝ))) ΞΌ
+
+instance _root_.MeasureTheory.Measure.IsFiniteMeasure.instHasTemperateGrowth {ΞΌ : Measure D}
+    [h : IsFiniteMeasure μ] : μ.HasTemperateGrowth := ⟨⟨0, by simp⟩⟩
+
+instance _root_.MeasureTheory.Measure.IsAddHaarMeasure.instHasTemperateGrowth {ΞΌ : Measure D}
+    [h : ΞΌ.IsAddHaarMeasure] : ΞΌ.HasTemperateGrowth :=
+  ⟨⟨finrank ℝ D + 1, by apply integrable_one_add_norm; norm_num⟩⟩
+
 end TemperateGrowth
 
 section CLM
@@ -1009,63 +1026,66 @@ section Integration
 
 open Real Complex Filter MeasureTheory MeasureTheory.Measure FiniteDimensional
 
-variable [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup V] [NormedSpace β„‚ V]
-variable [MeasurableSpace D] [BorelSpace D] [FiniteDimensional ℝ D]
+variable [IsROrC π•œ]
+variable [NormedAddCommGroup D] [NormedSpace ℝ D]
+variable [NormedAddCommGroup V] [NormedSpace ℝ V] [NormedSpace π•œ V]
+variable [MeasurableSpace D] [BorelSpace D] [SecondCountableTopology D]
+
+variable {ΞΌ : Measure D} [hΞΌ : HasTemperateGrowth ΞΌ]
 
-lemma integrable_pow_mul (f : 𝓒(D, V)) {ΞΌ : Measure D} (k : β„•) [IsAddHaarMeasure ΞΌ] :
-    Integrable (fun x ↦ β€–xβ€– ^ k * β€–f xβ€–) ΞΌ := by
-  let l := finrank ℝ D + 1 + k
+variable (ΞΌ) in
+lemma integrable_pow_mul (f : 𝓒(D, V))
+    (k : β„•) : Integrable (fun x ↦ β€–xβ€– ^ k * β€–f xβ€–) ΞΌ := by
+  rcases hμ.exists_integrable with ⟨n, h⟩
+  let l := n + k
   obtain ⟨C, C_nonneg, hC⟩ : βˆƒ C, 0 ≀ C ∧ βˆ€ x, (1 + β€–xβ€–) ^ l * β€–f xβ€– ≀ C := by
     use 2 ^ l * (Finset.Iic (l, 0)).sup (fun m ↦ SchwartzMap.seminorm ℝ m.1 m.2) f, by positivity
     simpa using f.one_add_le_sup_seminorm_apply (m := (l, 0)) (k := l) (n := 0) le_rfl le_rfl
-  have : Integrable (fun x : D ↦ C * (1 + β€–xβ€–) ^ (-((finrank ℝ D + 1 : β„•) : ℝ))) ΞΌ := by
-    apply (integrable_one_add_norm ?_).const_mul
-    exact Nat.cast_lt.mpr Nat.le.refl
+  have : Integrable (fun x : D ↦ C * (1 + β€–xβ€–) ^ (-(n : ℝ))) ΞΌ := h.const_mul _
   apply this.mono ((aestronglyMeasurable_id.norm.pow _).mul f.continuous.aestronglyMeasurable.norm)
     (eventually_of_forall (fun x ↦ ?_))
   conv_rhs => rw [norm_of_nonneg (by positivity), rpow_neg (by positivity), ← div_eq_mul_inv]
   rw [le_div_iff' (by positivity)]
   simp only [id_eq, Pi.mul_apply, Pi.pow_apply, norm_mul, norm_pow, norm_norm, rpow_nat_cast]
   calc
-    (1 + β€–xβ€–) ^ (finrank ℝ D + 1) * (β€–xβ€– ^ k * β€–f xβ€–)
-      ≀ (1 + β€–xβ€–) ^ (finrank ℝ D + 1) * ((1 + β€–xβ€–) ^ k * β€–f xβ€–) := by gcongr; simp
-    _ = (1 + β€–xβ€–) ^ (finrank ℝ D + 1 + k) * β€–f xβ€– := by simp only [pow_add, mul_assoc]
+    (1 + β€–xβ€–) ^ n * (β€–xβ€– ^ k * β€–f xβ€–)
+      ≀ (1 + β€–xβ€–) ^ n * ((1 + β€–xβ€–) ^ k * β€–f xβ€–) := by gcongr; simp
+    _ = (1 + β€–xβ€–) ^ (n + k) * β€–f xβ€– := by simp only [pow_add, mul_assoc]
     _ ≀ C := hC x
 
-lemma integrable (f : 𝓒(D, V)) {ΞΌ : Measure D} [IsAddHaarMeasure ΞΌ] :
-    Integrable f ΞΌ :=
-  (f.integrable_pow_mul (ΞΌ := ΞΌ) 0).mono f.continuous.aestronglyMeasurable
+lemma integrable (f : 𝓒(D, V)) : Integrable f ΞΌ :=
+  (f.integrable_pow_mul ΞΌ 0).mono f.continuous.aestronglyMeasurable
     (eventually_of_forall (fun _ ↦ by simp))
 
+variable (π•œ ΞΌ) in
 /-- The integral as a continuous linear map from Schwartz space to the codomain. -/
-def integralCLM (ΞΌ : Measure D) [IsAddHaarMeasure ΞΌ] : 𝓒(D, V) β†’L[ℝ] V :=
+def integralCLM : 𝓒(D, V) β†’L[π•œ] V :=
   mkCLMtoNormedSpace (∫ x, Β· x βˆ‚ΞΌ)
-    (fun f g ↦ integral_add f.integrable g.integrable)
+    (fun f g ↦ by
+      exact integral_add f.integrable g.integrable)
     (integral_smul Β· Β·)
     (by
-      let l := finrank ℝ D + 1
-      let m := (l, 0)
-      use Finset.Iic (l, 0), 2 ^ l * ∫ x : D, (1 + β€–xβ€–) ^ (- (l : ℝ)) βˆ‚ΞΌ
-      have hpos : 0 ≀ ∫ x : D, (1 + β€–xβ€–) ^ (- (l : ℝ)) βˆ‚ΞΌ := by
+      rcases hμ.exists_integrable with ⟨n, h⟩
+      let m := (n, 0)
+      use Finset.Iic m, 2 ^ n * ∫ x : D, (1 + β€–xβ€–) ^ (- (n : ℝ)) βˆ‚ΞΌ
+      have hpos : 0 ≀ ∫ x : D, (1 + β€–xβ€–) ^ (- (n : ℝ)) βˆ‚ΞΌ := by
         apply integral_nonneg
         intro
         positivity
       refine ⟨by positivity, fun f ↦ (norm_integral_le_integral_norm f).trans ?_⟩
-      have h : βˆ€ x, β€–f xβ€– ≀ (1 + β€–xβ€–) ^ (-(l : ℝ)) *
-          (2^l * ((Finset.Iic m).sup (fun m' => SchwartzMap.seminorm ℝ m'.1 m'.2) f)) := by
+      have h' : βˆ€ x, β€–f xβ€– ≀ (1 + β€–xβ€–) ^ (-(n : ℝ)) *
+          (2 ^ n * ((Finset.Iic m).sup (fun m' => SchwartzMap.seminorm π•œ m'.1 m'.2) f)) := by
         intro x
         rw [rpow_neg (by positivity), ← div_eq_inv_mul, le_div_iff' (by positivity), rpow_nat_cast]
-        simpa using one_add_le_sup_seminorm_apply (m := m) (k := l) (n := 0) le_rfl le_rfl f x
-      apply (integral_mono (by simpa using f.integrable_pow_mul (ΞΌ := ΞΌ) 0) _ h).trans
-      Β· rw [integral_mul_right, ← mul_assoc]
-        gcongr ?_ * ?_
-        Β· rw [mul_comm]
-        Β· rfl
-      apply (integrable_one_add_norm (by simp)).mul_const)
+        simpa using one_add_le_sup_seminorm_apply (m := m) (k := n) (n := 0) le_rfl le_rfl f x
+      apply (integral_mono (by simpa using f.integrable_pow_mul ΞΌ 0) _ h').trans
+      Β· rw [integral_mul_right, ← mul_assoc, mul_comm (2 ^ n)]
+        rfl
+      apply h.mul_const)
 
+variable (π•œ) in
 @[simp]
-lemma integralCLM_apply {ΞΌ : Measure D} [IsAddHaarMeasure ΞΌ] (f : 𝓒(D, V)) :
-    integralCLM ΞΌ f = ∫ x, f x βˆ‚ΞΌ := rfl
+lemma integralCLM_apply (f : 𝓒(D, V)) : integralCLM π•œ ΞΌ f = ∫ x, f x βˆ‚ΞΌ := by rfl
 
 end Integration
 
@@ -1120,6 +1140,8 @@ theorem toBoundedContinuousFunctionCLM_apply (f : 𝓒(E, F)) (x : E) :
 
 variable {E}
 
+section DiracDelta
+
 /-- The Dirac delta distribution -/
 def delta (x : E) : 𝓒(E, F) β†’L[π•œ] F :=
   (BoundedContinuousFunction.evalCLM π•œ x).comp (toBoundedContinuousFunctionCLM π•œ E F)
@@ -1130,6 +1152,16 @@ theorem delta_apply (xβ‚€ : E) (f : 𝓒(E, F)) : delta π•œ F xβ‚€ f = f xβ‚€ :
   rfl
 #align schwartz_map.delta_apply SchwartzMap.delta_apply
 
+open MeasureTheory MeasureTheory.Measure
+
+variable [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] [CompleteSpace F]
+
+/-- Integrating against the Dirac measure is equal to the delta distribution. -/
+@[simp]
+theorem integralCLM_dirac_eq_delta (x : E) : integralCLM π•œ (dirac x) = delta π•œ F x := by aesop
+
+end DiracDelta
+
 end BoundedContinuousFunction
 
 section ZeroAtInfty
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -65,11 +65,8 @@ noncomputable section
 open scoped BigOperators Nat
 
 variable {π•œ π•œ' D E F G V : Type*}
-
 variable [NormedAddCommGroup E] [NormedSpace ℝ E]
-
 variable [NormedAddCommGroup F] [NormedSpace ℝ F]
-
 variable (E F)
 
 /-- A function is a Schwartz function if it is smooth and all derivatives decay faster than
@@ -448,7 +445,6 @@ section Seminorms
 
 
 variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
-
 variable (π•œ)
 
 /-- The seminorms of the Schwartz space given by the best constants in the definition of
@@ -563,7 +559,6 @@ section Topology
 
 
 variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
-
 variable (π•œ E F)
 
 instance instTopologicalSpace : TopologicalSpace 𝓒(E, F) :=
@@ -671,13 +666,9 @@ section CLM
 
 
 variable [NormedField π•œ] [NormedField π•œ']
-
 variable [NormedAddCommGroup D] [NormedSpace ℝ D]
-
 variable [NormedSpace π•œ E] [SMulCommClass ℝ π•œ E]
-
 variable [NormedAddCommGroup G] [NormedSpace ℝ G] [NormedSpace π•œ' G] [SMulCommClass ℝ π•œ' G]
-
 variable {Οƒ : π•œ β†’+* π•œ'}
 
 /-- Create a semilinear map between Schwartz spaces.
@@ -767,7 +758,6 @@ end EvalCLM
 section Multiplication
 
 variable [NormedAddCommGroup D] [NormedSpace ℝ D]
-
 variable [NormedAddCommGroup G] [NormedSpace ℝ G]
 
 /-- The map `f ↦ (x ↦ B (f x) (g x))` as a continuous `π•œ`-linear map on Schwartz space,
@@ -831,15 +821,10 @@ end Multiplication
 section Comp
 
 variable (π•œ)
-
 variable [IsROrC π•œ]
-
 variable [NormedAddCommGroup D] [NormedSpace ℝ D]
-
 variable [NormedAddCommGroup G] [NormedSpace ℝ G]
-
 variable [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
-
 variable [NormedSpace π•œ G] [SMulCommClass ℝ π•œ G]
 
 /-- Composition with a function on the right is a continuous linear map on Schwartz space
@@ -916,7 +901,6 @@ section Derivatives
 
 
 variable (π•œ)
-
 variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
 /-- The FrΓ©chet derivative on Schwartz space as a continuous `π•œ`-linear map. -/
@@ -1115,7 +1099,6 @@ def toContinuousMap (f : 𝓒(E, F)) : C(E, F) :=
 #align schwartz_map.to_continuous_map SchwartzMap.toContinuousMap
 
 variable (π•œ E F)
-
 variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
 /-- The inclusion map from Schwartz functions to bounded continuous functions as a continuous linear
feat(Analysis/Distribution/SchwartzSpace): Constructor for CLMs to normed space and integration (#10652)
  • We define a constructor for continuous linear maps from Schwartz space into normed spaces similar to mkCLM
  • Define the integral as a distribution on Schwartz space (moved to lemmas from Analysis/Distribution/FourierSchwartz to Analysis/Distribution/SchwartzSpace for that)
  • Golf a few definitions
Diff
@@ -10,6 +10,7 @@ import Mathlib.Analysis.LocallyConvex.WithSeminorms
 import Mathlib.Topology.Algebra.UniformFilterBasis
 import Mathlib.Analysis.Normed.Group.ZeroAtInfty
 import Mathlib.Analysis.SpecialFunctions.Pow.Real
+import Mathlib.Analysis.SpecialFunctions.JapaneseBracket
 
 #align_import analysis.schwartz_space from "leanprover-community/mathlib"@"e137999b2c6f2be388f4cd3bbf8523de1910cd2b"
 
@@ -37,6 +38,7 @@ decay faster than any power of `β€–xβ€–`.
 `𝓒(E, F) β†’L[π•œ] 𝓒(E, E β†’L[ℝ] F)`
 * `SchwartzMap.derivCLM`: The one-dimensional derivative as a continuous linear map
 `𝓒(ℝ, F) β†’L[π•œ] 𝓒(ℝ, F)`
+* `SchwartzMap.integralCLM`: Integration as a continuous linear map `𝓒(ℝ, F) β†’L[ℝ] F`
 
 ## Main statements
 
@@ -62,7 +64,7 @@ noncomputable section
 
 open scoped BigOperators Nat
 
-variable {π•œ π•œ' D E F G : Type*}
+variable {π•œ π•œ' D E F G V : Type*}
 
 variable [NormedAddCommGroup E] [NormedSpace ℝ E]
 
@@ -78,15 +80,14 @@ structure SchwartzMap where
   decay' : βˆ€ k n : β„•, βˆƒ C : ℝ, βˆ€ x, β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n toFun xβ€– ≀ C
 #align schwartz_map SchwartzMap
 
--- mathport name: Β«expr𝓒( , )Β»
-scoped[SchwartzSpace] notation "𝓒(" E ", " F ")" => SchwartzMap E F
+/-- A function is a Schwartz function if it is smooth and all derivatives decay faster than
+  any power of `β€–xβ€–`. -/
+scoped[SchwartzMap] notation "𝓒(" E ", " F ")" => SchwartzMap E F
 
 variable {E F}
 
 namespace SchwartzMap
 
-open SchwartzSpace
-
 -- Porting note: removed
 -- instance : Coe 𝓒(E, F) (E β†’ F) := ⟨toFun⟩
 
@@ -716,12 +717,27 @@ def mkCLM [RingHomIsometric Οƒ] (A : (D β†’ E) β†’ F β†’ G)
         (schwartz_withSeminorms π•œ' F G) _ fun n => _
     rcases hbound n with ⟨s, C, hC, h⟩
     refine' ⟨s, ⟨C, hC⟩, fun f => _⟩
-    simp only [Seminorm.comp_apply, Seminorm.smul_apply, NNReal.smul_def, Algebra.id.smul_eq_mul,
-      Subtype.coe_mk]
     exact (mkLM A hadd hsmul hsmooth hbound f).seminorm_le_bound π•œ' n.1 n.2 (by positivity) (h f)
   toLinearMap := mkLM A hadd hsmul hsmooth hbound
 #align schwartz_map.mk_clm SchwartzMap.mkCLM
 
+/-- Define a continuous semilinear map from Schwartz space to a normed space. -/
+def mkCLMtoNormedSpace [RingHomIsometric Οƒ] (A : 𝓒(D, E) β†’ G)
+    (hadd : βˆ€ (f g : 𝓒(D, E)), A (f + g) = A f + A g)
+    (hsmul : βˆ€ (a : π•œ) (f : 𝓒(D, E)), A (a β€’ f) = Οƒ a β€’ A f)
+    (hbound : βˆƒ (s : Finset (β„• Γ— β„•)) (C : ℝ), 0 ≀ C ∧ βˆ€ (f : 𝓒(D, E)),
+      β€–A fβ€– ≀ C * s.sup (schwartzSeminormFamily π•œ D E) f) :
+    𝓒(D, E) β†’SL[Οƒ] G where
+  toLinearMap :=
+    { toFun := (A Β·)
+      map_add' := hadd
+      map_smul' := hsmul }
+  cont := by
+    change Continuous (LinearMap.mk _ _)
+    apply Seminorm.cont_withSeminorms_normedSpace G (schwartz_withSeminorms π•œ D E)
+    rcases hbound with ⟨s, C, hC, h⟩
+    exact ⟨s, ⟨C, hC⟩, h⟩
+
 end CLM
 
 section EvalCLM
@@ -981,7 +997,6 @@ theorem iteratedPDeriv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E,
   have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSucc_zero]
   have hmtail : Fin.tail m (Fin.last n) = m (Fin.last n.succ) := by
     simp only [Fin.tail_def, Fin.succ_last]
-  -- Porting note: changed to `calc` proof
   calc
     _ = pderivCLM π•œ (m 0) (iteratedPDeriv π•œ _ f) := iteratedPDeriv_succ_left _ _ _
     _ = pderivCLM π•œ (m 0) ((iteratedPDeriv π•œ _) ((pderivCLM π•œ _) f)) := by
@@ -1003,6 +1018,73 @@ theorem iteratedPDeriv_eq_iteratedFDeriv {n : β„•} {m : Fin n β†’ E} {f : 𝓒(E
 
 end Derivatives
 
+section Integration
+
+/-! ### Integration -/
+
+
+open Real Complex Filter MeasureTheory MeasureTheory.Measure FiniteDimensional
+
+variable [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup V] [NormedSpace β„‚ V]
+variable [MeasurableSpace D] [BorelSpace D] [FiniteDimensional ℝ D]
+
+lemma integrable_pow_mul (f : 𝓒(D, V)) {ΞΌ : Measure D} (k : β„•) [IsAddHaarMeasure ΞΌ] :
+    Integrable (fun x ↦ β€–xβ€– ^ k * β€–f xβ€–) ΞΌ := by
+  let l := finrank ℝ D + 1 + k
+  obtain ⟨C, C_nonneg, hC⟩ : βˆƒ C, 0 ≀ C ∧ βˆ€ x, (1 + β€–xβ€–) ^ l * β€–f xβ€– ≀ C := by
+    use 2 ^ l * (Finset.Iic (l, 0)).sup (fun m ↦ SchwartzMap.seminorm ℝ m.1 m.2) f, by positivity
+    simpa using f.one_add_le_sup_seminorm_apply (m := (l, 0)) (k := l) (n := 0) le_rfl le_rfl
+  have : Integrable (fun x : D ↦ C * (1 + β€–xβ€–) ^ (-((finrank ℝ D + 1 : β„•) : ℝ))) ΞΌ := by
+    apply (integrable_one_add_norm ?_).const_mul
+    exact Nat.cast_lt.mpr Nat.le.refl
+  apply this.mono ((aestronglyMeasurable_id.norm.pow _).mul f.continuous.aestronglyMeasurable.norm)
+    (eventually_of_forall (fun x ↦ ?_))
+  conv_rhs => rw [norm_of_nonneg (by positivity), rpow_neg (by positivity), ← div_eq_mul_inv]
+  rw [le_div_iff' (by positivity)]
+  simp only [id_eq, Pi.mul_apply, Pi.pow_apply, norm_mul, norm_pow, norm_norm, rpow_nat_cast]
+  calc
+    (1 + β€–xβ€–) ^ (finrank ℝ D + 1) * (β€–xβ€– ^ k * β€–f xβ€–)
+      ≀ (1 + β€–xβ€–) ^ (finrank ℝ D + 1) * ((1 + β€–xβ€–) ^ k * β€–f xβ€–) := by gcongr; simp
+    _ = (1 + β€–xβ€–) ^ (finrank ℝ D + 1 + k) * β€–f xβ€– := by simp only [pow_add, mul_assoc]
+    _ ≀ C := hC x
+
+lemma integrable (f : 𝓒(D, V)) {ΞΌ : Measure D} [IsAddHaarMeasure ΞΌ] :
+    Integrable f ΞΌ :=
+  (f.integrable_pow_mul (ΞΌ := ΞΌ) 0).mono f.continuous.aestronglyMeasurable
+    (eventually_of_forall (fun _ ↦ by simp))
+
+/-- The integral as a continuous linear map from Schwartz space to the codomain. -/
+def integralCLM (ΞΌ : Measure D) [IsAddHaarMeasure ΞΌ] : 𝓒(D, V) β†’L[ℝ] V :=
+  mkCLMtoNormedSpace (∫ x, Β· x βˆ‚ΞΌ)
+    (fun f g ↦ integral_add f.integrable g.integrable)
+    (integral_smul Β· Β·)
+    (by
+      let l := finrank ℝ D + 1
+      let m := (l, 0)
+      use Finset.Iic (l, 0), 2 ^ l * ∫ x : D, (1 + β€–xβ€–) ^ (- (l : ℝ)) βˆ‚ΞΌ
+      have hpos : 0 ≀ ∫ x : D, (1 + β€–xβ€–) ^ (- (l : ℝ)) βˆ‚ΞΌ := by
+        apply integral_nonneg
+        intro
+        positivity
+      refine ⟨by positivity, fun f ↦ (norm_integral_le_integral_norm f).trans ?_⟩
+      have h : βˆ€ x, β€–f xβ€– ≀ (1 + β€–xβ€–) ^ (-(l : ℝ)) *
+          (2^l * ((Finset.Iic m).sup (fun m' => SchwartzMap.seminorm ℝ m'.1 m'.2) f)) := by
+        intro x
+        rw [rpow_neg (by positivity), ← div_eq_inv_mul, le_div_iff' (by positivity), rpow_nat_cast]
+        simpa using one_add_le_sup_seminorm_apply (m := m) (k := l) (n := 0) le_rfl le_rfl f x
+      apply (integral_mono (by simpa using f.integrable_pow_mul (ΞΌ := ΞΌ) 0) _ h).trans
+      Β· rw [integral_mul_right, ← mul_assoc]
+        gcongr ?_ * ?_
+        Β· rw [mul_comm]
+        Β· rfl
+      apply (integrable_one_add_norm (by simp)).mul_const)
+
+@[simp]
+lemma integralCLM_apply {ΞΌ : Measure D} [IsAddHaarMeasure ΞΌ] (f : 𝓒(D, V)) :
+    integralCLM ΞΌ f = ∫ x, f x βˆ‚ΞΌ := rfl
+
+end Integration
+
 section BoundedContinuousFunction
 
 /-! ### Inclusion into the space of bounded continuous functions -/
@@ -1010,10 +1092,10 @@ section BoundedContinuousFunction
 
 open scoped BoundedContinuousFunction
 
-instance instBoundedContinuousMapClass : BoundedContinuousMapClass 𝓒(E, F) E F :=
-  { instContinuousMapClass with
-    map_bounded := fun f ↦ ⟨2 * (SchwartzMap.seminorm ℝ 0 0) f,
-      (BoundedContinuousFunction.dist_le_two_norm' (norm_le_seminorm ℝ f))⟩ }
+instance instBoundedContinuousMapClass : BoundedContinuousMapClass 𝓒(E, F) E F where
+  __ := instContinuousMapClass
+  map_bounded := fun f ↦ ⟨2 * (SchwartzMap.seminorm ℝ 0 0) f,
+    (BoundedContinuousFunction.dist_le_two_norm' (norm_le_seminorm ℝ f))⟩
 
 /-- Schwartz functions as bounded continuous functions -/
 def toBoundedContinuousFunction (f : 𝓒(E, F)) : E →ᡇ F :=
@@ -1036,40 +1118,21 @@ variable (π•œ E F)
 
 variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
-/-- The inclusion map from Schwartz functions to bounded continuous functions as a linear map. -/
-def toBoundedContinuousFunctionLM : 𝓒(E, F) β†’β‚—[π•œ] E →ᡇ F where
-  toFun f := f.toBoundedContinuousFunction
-  map_add' f g := by ext; exact add_apply
-  map_smul' a f := by ext; exact smul_apply
-#align schwartz_map.to_bounded_continuous_function_lm SchwartzMap.toBoundedContinuousFunctionLM
-
-@[simp]
-theorem toBoundedContinuousFunctionLM_apply (f : 𝓒(E, F)) (x : E) :
-    toBoundedContinuousFunctionLM π•œ E F f x = f x :=
-  rfl
-#align schwartz_map.to_bounded_continuous_function_lm_apply SchwartzMap.toBoundedContinuousFunctionLM_apply
-
 /-- The inclusion map from Schwartz functions to bounded continuous functions as a continuous linear
 map. -/
 def toBoundedContinuousFunctionCLM : 𝓒(E, F) β†’L[π•œ] E →ᡇ F :=
-  { toBoundedContinuousFunctionLM π•œ E F with
-    cont := by
-      change Continuous (toBoundedContinuousFunctionLM π•œ E F)
-      refine'
-        Seminorm.continuous_from_bounded (schwartz_withSeminorms π•œ E F)
-          (norm_withSeminorms π•œ (E →ᡇ F)) _ fun _ => ⟨{0}, 1, fun f => _⟩
-      -- Porting note: Lean failed to find this instance
-      have : MulAction NNReal (Seminorm π•œ 𝓒(E, F)) := Seminorm.instDistribMulAction.toMulAction
-      simp only [Seminorm.comp_apply, coe_normSeminorm, Finset.sup_singleton,
-        schwartzSeminormFamily_apply_zero, Seminorm.smul_apply, one_smul, ge_iff_le,
-        BoundedContinuousFunction.norm_le (apply_nonneg _ _)]
-      exact norm_le_seminorm π•œ _ }
+  mkCLMtoNormedSpace toBoundedContinuousFunction (by intro f g; ext; exact add_apply)
+    (by intro a f; ext; exact smul_apply)
+    (⟨{0}, 1, zero_le_one, by
+      simpa [BoundedContinuousFunction.norm_le (apply_nonneg _ _)] using norm_le_seminorm π•œ ⟩)
+#align schwartz_map.to_bounded_continuous_function_lm SchwartzMap.toBoundedContinuousFunctionCLM
 #align schwartz_map.to_bounded_continuous_function_clm SchwartzMap.toBoundedContinuousFunctionCLM
 
 @[simp]
 theorem toBoundedContinuousFunctionCLM_apply (f : 𝓒(E, F)) (x : E) :
     toBoundedContinuousFunctionCLM π•œ E F f x = f x :=
   rfl
+#align schwartz_map.to_bounded_continuous_function_lm_apply SchwartzMap.toBoundedContinuousFunctionCLM_apply
 #align schwartz_map.to_bounded_continuous_function_clm_apply SchwartzMap.toBoundedContinuousFunctionCLM_apply
 
 variable {E}
@@ -1092,24 +1155,24 @@ open scoped ZeroAtInfty
 
 variable [ProperSpace E]
 
-instance instZeroAtInftyContinuousMapClass : ZeroAtInftyContinuousMapClass 𝓒(E, F) E F :=
-  { instContinuousMapClass with
-    zero_at_infty := by
-      intro f
-      apply zero_at_infty_of_norm_le
-      intro Ξ΅ hΞ΅
-      use (SchwartzMap.seminorm ℝ 1 0) f / Ξ΅
-      intro x hx
-      rw [div_lt_iff hΞ΅] at hx
-      have hxpos : 0 < β€–xβ€– := by
-        rw [norm_pos_iff']
-        intro hxzero
-        simp only [hxzero, norm_zero, zero_mul, ← not_le] at hx
-        exact hx (apply_nonneg (SchwartzMap.seminorm ℝ 1 0) f)
-      have := norm_pow_mul_le_seminorm ℝ f 1 x
-      rw [pow_one, ← le_div_iff' hxpos] at this
-      apply lt_of_le_of_lt this
-      rwa [div_lt_iff' hxpos] }
+instance instZeroAtInftyContinuousMapClass : ZeroAtInftyContinuousMapClass 𝓒(E, F) E F where
+  __ := instContinuousMapClass
+  zero_at_infty := by
+    intro f
+    apply zero_at_infty_of_norm_le
+    intro Ξ΅ hΞ΅
+    use (SchwartzMap.seminorm ℝ 1 0) f / Ξ΅
+    intro x hx
+    rw [div_lt_iff hΞ΅] at hx
+    have hxpos : 0 < β€–xβ€– := by
+      rw [norm_pos_iff']
+      intro hxzero
+      simp only [hxzero, norm_zero, zero_mul, ← not_le] at hx
+      exact hx (apply_nonneg (SchwartzMap.seminorm ℝ 1 0) f)
+    have := norm_pow_mul_le_seminorm ℝ f 1 x
+    rw [pow_one, ← le_div_iff' hxpos] at this
+    apply lt_of_le_of_lt this
+    rwa [div_lt_iff' hxpos]
 
 /-- Schwartz functions as continuous functions vanishing at infinity. -/
 def toZeroAtInfty (f : 𝓒(E, F)) : Cβ‚€(E, F) where
@@ -1120,37 +1183,19 @@ def toZeroAtInfty (f : 𝓒(E, F)) : Cβ‚€(E, F) where
   rfl
 
 @[simp] theorem toZeroAtInfty_toBCF (f : 𝓒(E, F)) :
-    f.toZeroAtInfty.toBCF = f.toBoundedContinuousFunction := by
-  ext; rfl
+    f.toZeroAtInfty.toBCF = f.toBoundedContinuousFunction :=
+  rfl
 
 variable (π•œ E F)
 variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 
-/-- The inclusion map from Schwartz functions to continuous functions vanishing at infinity as a
-linear map. -/
-def toZeroAtInftyLM : 𝓒(E, F) β†’β‚—[π•œ] Cβ‚€(E, F) where
-  toFun f := f.toZeroAtInfty
-  map_add' f g := by ext; exact add_apply
-  map_smul' a f := by ext; exact smul_apply
-
-@[simp] theorem toZeroAtInftyLM_apply (f : 𝓒(E, F)) (x : E) : toZeroAtInftyLM π•œ E F f x = f x :=
-  rfl
-
 /-- The inclusion map from Schwartz functions to continuous functions vanishing at infinity as a
 continuous linear map. -/
 def toZeroAtInftyCLM : 𝓒(E, F) β†’L[π•œ] Cβ‚€(E, F) :=
-  { toZeroAtInftyLM π•œ E F with
-    cont := by
-      change Continuous (toZeroAtInftyLM π•œ E F)
-      refine'
-        Seminorm.continuous_from_bounded (schwartz_withSeminorms π•œ E F)
-          (norm_withSeminorms π•œ (Cβ‚€(E, F))) _ fun _ => ⟨{0}, 1, fun f => _⟩
-      haveI : MulAction NNReal (Seminorm π•œ 𝓒(E, F)) := Seminorm.instDistribMulAction.toMulAction
-      simp only [Seminorm.comp_apply, coe_normSeminorm, Finset.sup_singleton,
-        schwartzSeminormFamily_apply_zero, Seminorm.smul_apply, one_smul, ge_iff_le,
-        ← ZeroAtInftyContinuousMap.norm_toBCF_eq_norm,
-        BoundedContinuousFunction.norm_le (apply_nonneg _ _)]
-      exact norm_le_seminorm π•œ _ }
+  mkCLMtoNormedSpace toZeroAtInfty (by intro f g; ext; exact add_apply)
+    (by intro a f; ext; exact smul_apply)
+    (⟨{0}, 1, zero_le_one, by simpa [← ZeroAtInftyContinuousMap.norm_toBCF_eq_norm,
+      BoundedContinuousFunction.norm_le (apply_nonneg _ _)] using norm_le_seminorm π•œ ⟩)
 
 @[simp] theorem toZeroAtInftyCLM_apply (f : 𝓒(E, F)) (x : E) : toZeroAtInftyCLM π•œ E F f x = f x :=
   rfl
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -87,7 +87,7 @@ namespace SchwartzMap
 
 open SchwartzSpace
 
--- porting note: removed
+-- Porting note: removed
 -- instance : Coe 𝓒(E, F) (E β†’ F) := ⟨toFun⟩
 
 instance instFunLike : FunLike 𝓒(E, F) E F where
chore: prepare Lean version bump with explicit simp (#10999)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -621,12 +621,12 @@ theorem _root_.Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f
   choose k C f using hf_temperate.2
   use (Finset.range (n + 1)).sup k
   let C' := max (0 : ℝ) ((Finset.range (n + 1)).sup' (by simp) C)
-  have hC' : 0 ≀ C' := by simp only [le_refl, Finset.le_sup'_iff, true_or_iff, le_max_iff]
+  have hC' : 0 ≀ C' := by simp only [C', le_refl, Finset.le_sup'_iff, true_or_iff, le_max_iff]
   use C', hC'
   intro N hN x
   rw [← Finset.mem_range_succ_iff] at hN
   refine' le_trans (f N x) (mul_le_mul _ _ (by positivity) hC')
-  Β· simp only [Finset.le_sup'_iff, le_max_iff]
+  Β· simp only [C', Finset.le_sup'_iff, le_max_iff]
     right
     exact ⟨N, hN, rfl.le⟩
   refine' pow_le_pow_right (by simp only [le_add_iff_nonneg_right, norm_nonneg]) _
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -841,7 +841,7 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
         refine' le_add_of_nonneg_right _
         specialize hg_upper' 0
         rw [norm_zero] at hg_upper'
-        refine' nonneg_of_mul_nonneg_left hg_upper' (by positivity)
+        exact nonneg_of_mul_nonneg_left hg_upper' (by positivity)
       let k' := kg * (k + l * n)
       use Finset.Iic (k', n), (1 + Cg) ^ (k + l * n) * ((C + 1) ^ n * n ! * 2 ^ k'), by positivity
       intro f x
feat(Analysis/Distribution/SchwartzMap): pderiv equals lineDeriv (#9954)
Diff
@@ -3,10 +3,9 @@ Copyright (c) 2022 Moritz Doll. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 -/
-import Mathlib.Analysis.Calculus.Deriv.Add
-import Mathlib.Analysis.Calculus.Deriv.Mul
 import Mathlib.Analysis.Calculus.ContDiff.Bounds
 import Mathlib.Analysis.Calculus.IteratedDeriv.Defs
+import Mathlib.Analysis.Calculus.LineDeriv.Basic
 import Mathlib.Analysis.LocallyConvex.WithSeminorms
 import Mathlib.Topology.Algebra.UniformFilterBasis
 import Mathlib.Analysis.Normed.Group.ZeroAtInfty
@@ -946,6 +945,10 @@ theorem pderivCLM_apply (m : E) (f : 𝓒(E, F)) (x : E) : pderivCLM π•œ m f x
   rfl
 #align schwartz_map.pderiv_clm_apply SchwartzMap.pderivCLM_apply
 
+theorem pderivCLM_eq_lineDeriv (m : E) (f : 𝓒(E, F)) (x : E) :
+    pderivCLM π•œ m f x = lineDeriv ℝ f x m := by
+  simp only [pderivCLM_apply, f.differentiableAt.lineDeriv_eq_fderiv]
+
 /-- The iterated partial derivative (or directional derivative) as a continuous linear map on
 Schwartz space. -/
 def iteratedPDeriv {n : β„•} : (Fin n β†’ E) β†’ 𝓒(E, F) β†’L[π•œ] 𝓒(E, F) :=
chore(NonnegHomClass): rename map_nonneg to apply_nonneg (#10507)

... to avoid conflict with _root_.map_nonneg, see Zulip.

Diff
@@ -887,7 +887,7 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
       have hgxk' : 0 < (1 + β€–g xβ€–) ^ k' := by positivity
       rw [← div_le_iff hgxk'] at hg_upper''
       have hpos : (0 : ℝ) ≀ (C + 1) ^ n * n ! * 2 ^ k' * seminorm_f := by
-        have : 0 ≀ seminorm_f := map_nonneg _ _
+        have : 0 ≀ seminorm_f := apply_nonneg _ _
         positivity
       refine' le_trans (mul_le_mul_of_nonneg_right hg_upper'' hpos) _
       rw [← mul_assoc])
@@ -1059,7 +1059,7 @@ def toBoundedContinuousFunctionCLM : 𝓒(E, F) β†’L[π•œ] E →ᡇ F :=
       have : MulAction NNReal (Seminorm π•œ 𝓒(E, F)) := Seminorm.instDistribMulAction.toMulAction
       simp only [Seminorm.comp_apply, coe_normSeminorm, Finset.sup_singleton,
         schwartzSeminormFamily_apply_zero, Seminorm.smul_apply, one_smul, ge_iff_le,
-        BoundedContinuousFunction.norm_le (map_nonneg _ _)]
+        BoundedContinuousFunction.norm_le (apply_nonneg _ _)]
       exact norm_le_seminorm π•œ _ }
 #align schwartz_map.to_bounded_continuous_function_clm SchwartzMap.toBoundedContinuousFunctionCLM
 
@@ -1102,7 +1102,7 @@ instance instZeroAtInftyContinuousMapClass : ZeroAtInftyContinuousMapClass 𝓒(
         rw [norm_pos_iff']
         intro hxzero
         simp only [hxzero, norm_zero, zero_mul, ← not_le] at hx
-        exact hx (map_nonneg (SchwartzMap.seminorm ℝ 1 0) f)
+        exact hx (apply_nonneg (SchwartzMap.seminorm ℝ 1 0) f)
       have := norm_pow_mul_le_seminorm ℝ f 1 x
       rw [pow_one, ← le_div_iff' hxpos] at this
       apply lt_of_le_of_lt this
@@ -1146,7 +1146,7 @@ def toZeroAtInftyCLM : 𝓒(E, F) β†’L[π•œ] Cβ‚€(E, F) :=
       simp only [Seminorm.comp_apply, coe_normSeminorm, Finset.sup_singleton,
         schwartzSeminormFamily_apply_zero, Seminorm.smul_apply, one_smul, ge_iff_le,
         ← ZeroAtInftyContinuousMap.norm_toBCF_eq_norm,
-        BoundedContinuousFunction.norm_le (map_nonneg _ _)]
+        BoundedContinuousFunction.norm_le (apply_nonneg _ _)]
       exact norm_le_seminorm π•œ _ }
 
 @[simp] theorem toZeroAtInftyCLM_apply (f : 𝓒(E, F)) (x : E) : toZeroAtInftyCLM π•œ E F f x = f x :=
feat: the Fourier transform of a Schwartz function is differentiable (#10268)
Diff
@@ -610,7 +610,6 @@ section TemperateGrowth
 
 /-! ### Functions of temperate growth -/
 
-
 /-- A function is called of temperate growth if it is smooth and all iterated derivatives are
 polynomially bounded. -/
 def _root_.Function.HasTemperateGrowth (f : E β†’ F) : Prop :=
@@ -635,6 +634,35 @@ theorem _root_.Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f
   exact Finset.le_sup hN
 #align function.has_temperate_growth.norm_iterated_fderiv_le_uniform_aux Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux
 
+lemma _root_.Function.HasTemperateGrowth.of_fderiv {f : E β†’ F}
+    (h'f : Function.HasTemperateGrowth (fderiv ℝ f)) (hf : Differentiable ℝ f) {k : β„•} {C : ℝ}
+    (h : βˆ€ x, β€–f xβ€– ≀ C * (1 + β€–xβ€–) ^ k) :
+    Function.HasTemperateGrowth f := by
+  refine ⟨contDiff_top_iff_fderiv.2 ⟨hf, h'f.1⟩ , fun n ↦ ?_⟩
+  rcases n with rfl|m
+  Β· exact ⟨k, C, fun x ↦ by simpa using h x⟩
+  · rcases h'f.2 m with ⟨k', C', h'⟩
+    refine ⟨k', C', fun x ↦ ?_⟩
+    simpa only [ContinuousLinearMap.strongUniformity_topology_eq, Function.comp_apply,
+      LinearIsometryEquiv.norm_map, iteratedFDeriv_succ_eq_comp_right] using h' x
+
+lemma _root_.Function.HasTemperateGrowth.zero :
+    Function.HasTemperateGrowth (fun _ : E ↦ (0 : F)) := by
+  refine ⟨contDiff_const, fun n ↦ ⟨0, 0, fun x ↦ ?_⟩⟩
+  simp only [iteratedFDeriv_zero_fun, Pi.zero_apply, norm_zero, forall_const]
+  positivity
+
+lemma _root_.Function.HasTemperateGrowth.const (c : F) :
+    Function.HasTemperateGrowth (fun _ : E ↦ c) :=
+  .of_fderiv (by simpa using .zero) (differentiable_const c) (k := 0) (C := β€–cβ€–) (fun x ↦ by simp)
+
+lemma _root_.ContinuousLinearMap.hasTemperateGrowth (f : E β†’L[ℝ] F) :
+    Function.HasTemperateGrowth f := by
+  apply Function.HasTemperateGrowth.of_fderiv ?_ f.differentiable (k := 1) (C := β€–fβ€–) (fun x ↦ ?_)
+  Β· have : fderiv ℝ f = fun _ ↦ f := by ext1 v; simp only [ContinuousLinearMap.fderiv]
+    simpa [this] using .const _
+  Β· exact (f.le_op_norm x).trans (by simp [mul_add])
+
 end TemperateGrowth
 
 section CLM
feat(Analysis/Distribution/SchwartzMap): projection to ZeroAtInfty and corresponding type class (#9987)

Adds a characterization of ZeroAtInfty in terms of norms and uses one direction to show that every Schwartz function is zero at infinity. We also add a few lemmas that characterize elements of the cocompact filter in terms of norm estimates.

Diff
@@ -9,7 +9,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds
 import Mathlib.Analysis.Calculus.IteratedDeriv.Defs
 import Mathlib.Analysis.LocallyConvex.WithSeminorms
 import Mathlib.Topology.Algebra.UniformFilterBasis
-import Mathlib.Topology.ContinuousFunction.Bounded
+import Mathlib.Analysis.Normed.Group.ZeroAtInfty
 import Mathlib.Analysis.SpecialFunctions.Pow.Real
 
 #align_import analysis.schwartz_space from "leanprover-community/mathlib"@"e137999b2c6f2be388f4cd3bbf8523de1910cd2b"
@@ -119,6 +119,9 @@ protected theorem continuous (f : 𝓒(E, F)) : Continuous f :=
   (f.smooth 0).continuous
 #align schwartz_map.continuous SchwartzMap.continuous
 
+instance instContinuousMapClass : ContinuousMapClass 𝓒(E, F) E F where
+  map_continuous := SchwartzMap.continuous
+
 /-- Every Schwartz function is differentiable. -/
 protected theorem differentiable (f : 𝓒(E, F)) : Differentiable ℝ f :=
   (f.smooth 1).differentiable rfl.le
@@ -976,6 +979,11 @@ section BoundedContinuousFunction
 
 open scoped BoundedContinuousFunction
 
+instance instBoundedContinuousMapClass : BoundedContinuousMapClass 𝓒(E, F) E F :=
+  { instContinuousMapClass with
+    map_bounded := fun f ↦ ⟨2 * (SchwartzMap.seminorm ℝ 0 0) f,
+      (BoundedContinuousFunction.dist_le_two_norm' (norm_le_seminorm ℝ f))⟩ }
+
 /-- Schwartz functions as bounded continuous functions -/
 def toBoundedContinuousFunction (f : 𝓒(E, F)) : E →ᡇ F :=
   BoundedContinuousFunction.ofNormedAddCommGroup f (SchwartzMap.continuous f)
@@ -1024,8 +1032,7 @@ def toBoundedContinuousFunctionCLM : 𝓒(E, F) β†’L[π•œ] E →ᡇ F :=
       simp only [Seminorm.comp_apply, coe_normSeminorm, Finset.sup_singleton,
         schwartzSeminormFamily_apply_zero, Seminorm.smul_apply, one_smul, ge_iff_le,
         BoundedContinuousFunction.norm_le (map_nonneg _ _)]
-      intro x
-      exact norm_le_seminorm π•œ _ _ }
+      exact norm_le_seminorm π•œ _ }
 #align schwartz_map.to_bounded_continuous_function_clm SchwartzMap.toBoundedContinuousFunctionCLM
 
 @[simp]
@@ -1048,4 +1055,75 @@ theorem delta_apply (xβ‚€ : E) (f : 𝓒(E, F)) : delta π•œ F xβ‚€ f = f xβ‚€ :
 
 end BoundedContinuousFunction
 
+section ZeroAtInfty
+
+open scoped ZeroAtInfty
+
+variable [ProperSpace E]
+
+instance instZeroAtInftyContinuousMapClass : ZeroAtInftyContinuousMapClass 𝓒(E, F) E F :=
+  { instContinuousMapClass with
+    zero_at_infty := by
+      intro f
+      apply zero_at_infty_of_norm_le
+      intro Ξ΅ hΞ΅
+      use (SchwartzMap.seminorm ℝ 1 0) f / Ξ΅
+      intro x hx
+      rw [div_lt_iff hΞ΅] at hx
+      have hxpos : 0 < β€–xβ€– := by
+        rw [norm_pos_iff']
+        intro hxzero
+        simp only [hxzero, norm_zero, zero_mul, ← not_le] at hx
+        exact hx (map_nonneg (SchwartzMap.seminorm ℝ 1 0) f)
+      have := norm_pow_mul_le_seminorm ℝ f 1 x
+      rw [pow_one, ← le_div_iff' hxpos] at this
+      apply lt_of_le_of_lt this
+      rwa [div_lt_iff' hxpos] }
+
+/-- Schwartz functions as continuous functions vanishing at infinity. -/
+def toZeroAtInfty (f : 𝓒(E, F)) : Cβ‚€(E, F) where
+  toFun := f
+  zero_at_infty' := zero_at_infty f
+
+@[simp] theorem toZeroAtInfty_apply (f : 𝓒(E, F)) (x : E) : f.toZeroAtInfty x = f x :=
+  rfl
+
+@[simp] theorem toZeroAtInfty_toBCF (f : 𝓒(E, F)) :
+    f.toZeroAtInfty.toBCF = f.toBoundedContinuousFunction := by
+  ext; rfl
+
+variable (π•œ E F)
+variable [IsROrC π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
+
+/-- The inclusion map from Schwartz functions to continuous functions vanishing at infinity as a
+linear map. -/
+def toZeroAtInftyLM : 𝓒(E, F) β†’β‚—[π•œ] Cβ‚€(E, F) where
+  toFun f := f.toZeroAtInfty
+  map_add' f g := by ext; exact add_apply
+  map_smul' a f := by ext; exact smul_apply
+
+@[simp] theorem toZeroAtInftyLM_apply (f : 𝓒(E, F)) (x : E) : toZeroAtInftyLM π•œ E F f x = f x :=
+  rfl
+
+/-- The inclusion map from Schwartz functions to continuous functions vanishing at infinity as a
+continuous linear map. -/
+def toZeroAtInftyCLM : 𝓒(E, F) β†’L[π•œ] Cβ‚€(E, F) :=
+  { toZeroAtInftyLM π•œ E F with
+    cont := by
+      change Continuous (toZeroAtInftyLM π•œ E F)
+      refine'
+        Seminorm.continuous_from_bounded (schwartz_withSeminorms π•œ E F)
+          (norm_withSeminorms π•œ (Cβ‚€(E, F))) _ fun _ => ⟨{0}, 1, fun f => _⟩
+      haveI : MulAction NNReal (Seminorm π•œ 𝓒(E, F)) := Seminorm.instDistribMulAction.toMulAction
+      simp only [Seminorm.comp_apply, coe_normSeminorm, Finset.sup_singleton,
+        schwartzSeminormFamily_apply_zero, Seminorm.smul_apply, one_smul, ge_iff_le,
+        ← ZeroAtInftyContinuousMap.norm_toBCF_eq_norm,
+        BoundedContinuousFunction.norm_le (map_nonneg _ _)]
+      exact norm_le_seminorm π•œ _ }
+
+@[simp] theorem toZeroAtInftyCLM_apply (f : 𝓒(E, F)) (x : E) : toZeroAtInftyCLM π•œ E F f x = f x :=
+  rfl
+
+end ZeroAtInfty
+
 end SchwartzMap
feat: fderiv of ContinuousMultilinearMap applied to const; use for SchwartzMap.iteratedPDeriv (#9576)

add ContinuousMultilinearMap.apply; use for fderiv, iteratedFDeriv, SchwartzMap.iteratedPDeriv

Defining ContinuousMultilinearMap.apply as a CLM (using existing proof of continuity) enables the proof that the application of a ContinuousMultilinearMap to a constant commutes with differentiation.

This closes a todo in Mathlib/Analysis/Distribution/SchwartzSpace.lean.

Co-authored-by: Jack Valmadre <jvlmdr@users.noreply.github.com>

Diff
@@ -957,7 +957,16 @@ theorem iteratedPDeriv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E,
       simp only [hmtail, iteratedPDeriv_succ_left, hmzero, Fin.tail_init_eq_init_tail]
 #align schwartz_map.iterated_pderiv_succ_right SchwartzMap.iteratedPDeriv_succ_right
 
--- Todo: `iteratedPDeriv π•œ m f x = iteratedFDeriv ℝ f x m`
+theorem iteratedPDeriv_eq_iteratedFDeriv {n : β„•} {m : Fin n β†’ E} {f : 𝓒(E, F)} {x : E} :
+    iteratedPDeriv π•œ m f x = iteratedFDeriv ℝ n f x m := by
+  induction n generalizing x with
+  | zero => simp
+  | succ n ih =>
+    simp only [iteratedPDeriv_succ_left, iteratedFDeriv_succ_apply_left]
+    rw [← fderiv_continuousMultilinear_apply_const_apply]
+    Β· simp [← ih]
+    Β· exact f.smooth'.differentiable_iteratedFDeriv (WithTop.coe_lt_top n) _
+
 end Derivatives
 
 section BoundedContinuousFunction
fix: Clm -> CLM, Cle -> CLE (#10018)

Rename

  • Complex.equivRealProdClm β†’ Complex.equivRealProdCLM;
    • TODO: should this one use CLE?
  • Complex.reClm β†’ Complex.reCLM;
  • Complex.imClm β†’ Complex.imCLM;
  • Complex.conjLie β†’ Complex.conjLIE;
  • Complex.conjCle β†’ Complex.conjCLE;
  • Complex.ofRealLi β†’ Complex.ofRealLI;
  • Complex.ofRealClm β†’ Complex.ofRealCLM;
  • fderivInnerClm β†’ fderivInnerCLM;
  • LinearPMap.adjointDomainMkClm β†’ LinearPMap.adjointDomainMkCLM;
  • LinearPMap.adjointDomainMkClmExtend β†’ LinearPMap.adjointDomainMkCLMExtend;
  • IsROrC.reClm β†’ IsROrC.reCLM;
  • IsROrC.imClm β†’ IsROrC.imCLM;
  • IsROrC.conjLie β†’ IsROrC.conjLIE;
  • IsROrC.conjCle β†’ IsROrC.conjCLE;
  • IsROrC.ofRealLi β†’ IsROrC.ofRealLI;
  • IsROrC.ofRealClm β†’ IsROrC.ofRealCLM;
  • MeasureTheory.condexpL1Clm β†’ MeasureTheory.condexpL1CLM;
  • algebraMapClm β†’ algebraMapCLM;
  • WeakDual.CharacterSpace.toClm β†’ WeakDual.CharacterSpace.toCLM;
  • BoundedContinuousFunction.evalClm β†’ BoundedContinuousFunction.evalCLM;
  • ContinuousMap.evalClm β†’ ContinuousMap.evalCLM;
  • TrivSqZeroExt.fstClm β†’ TrivSqZeroExt.fstClm;
  • TrivSqZeroExt.sndClm β†’ TrivSqZeroExt.sndCLM;
  • TrivSqZeroExt.inlClm β†’ TrivSqZeroExt.inlCLM;
  • TrivSqZeroExt.inrClm β†’ TrivSqZeroExt.inrCLM

and related theorems.

Diff
@@ -1029,7 +1029,7 @@ variable {E}
 
 /-- The Dirac delta distribution -/
 def delta (x : E) : 𝓒(E, F) β†’L[π•œ] F :=
-  (BoundedContinuousFunction.evalClm π•œ x).comp (toBoundedContinuousFunctionCLM π•œ E F)
+  (BoundedContinuousFunction.evalCLM π•œ x).comp (toBoundedContinuousFunctionCLM π•œ E F)
 #align schwartz_map.delta SchwartzMap.delta
 
 @[simp]
chore: remove spurious imports of positivity (#9924)

Some of these are already transitively imported, others aren't used at all (but not handled by noshake in #9772).

Mostly I wanted to avoid needing all of algebra imported (but unused!) in FilteredColimitCommutesFiniteLimit; there are now some assert_not_exists to preserve this.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -10,7 +10,6 @@ import Mathlib.Analysis.Calculus.IteratedDeriv.Defs
 import Mathlib.Analysis.LocallyConvex.WithSeminorms
 import Mathlib.Topology.Algebra.UniformFilterBasis
 import Mathlib.Topology.ContinuousFunction.Bounded
-import Mathlib.Tactic.Positivity
 import Mathlib.Analysis.SpecialFunctions.Pow.Real
 
 #align_import analysis.schwartz_space from "leanprover-community/mathlib"@"e137999b2c6f2be388f4cd3bbf8523de1910cd2b"
feat(Analysis/NormedSpace/Multilinear.Basic): operator norm on ContinuousMultilinearMap for seminormed spaces (#9700)

Slightly generalize the definition of the operator norm on ContinuousMultilinearMap so that it works when the spaces have seminorms (and not just norms). There are two new lemmas MultilinearMap.zero_of_continuous_of_one_entry_norm_zero and MultilinearMap.bound_of_shell_of_continuous that do the work of the old lemma MultilinearMap.bound_of_shell; I kept that last lemma (with the same hypotheses as before) in case it is useful somewhere else. Also, ContinuousMultilinearMap only gets a SeminormedAddCommGroup instance in general, which is upgraded to a NormedAddCommGroup instance if the target space is normed. Other lemmas and their proofs are unchanged, they are just rearranged to separate the ones that work for general seminormed spaces and the ones that only work for normed spaces.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: smorel394 <67864981+smorel394@users.noreply.github.com>

Diff
@@ -210,7 +210,8 @@ variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
 theorem decay_smul_aux (k n : β„•) (f : 𝓒(E, F)) (c : π•œ) (x : E) :
     β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n (c β€’ (f : E β†’ F)) xβ€– =
       β€–cβ€– * β€–xβ€– ^ k * β€–iteratedFDeriv ℝ n f xβ€– := by
-  rw [mul_comm β€–cβ€–, mul_assoc, iteratedFDeriv_const_smul_apply (f.smooth _), norm_smul]
+  rw [mul_comm β€–cβ€–, mul_assoc, iteratedFDeriv_const_smul_apply (f.smooth _),
+    norm_smul c (iteratedFDeriv ℝ n (⇑f) x)]
 #align schwartz_map.decay_smul_aux SchwartzMap.decay_smul_aux
 
 end Aux
refactor(*): abbreviation for non-dependent FunLike (#9833)

This follows up from #9785, which renamed FunLike to DFunLike, by introducing a new abbreviation FunLike F Ξ± Ξ² := DFunLike F Ξ± (fun _ => Ξ²), to make the non-dependent use of FunLike easier.

I searched for the pattern DFunLike.*fun and DFunLike.*Ξ» in all files to replace expressions of the form DFunLike F Ξ± (fun _ => Ξ²) with FunLike F Ξ± Ξ². I did this everywhere except for extends clauses for two reasons: it would conflict with #8386, and more importantly extends must directly refer to a structure with no unfolding of defs or abbrevs.

Diff
@@ -92,10 +92,10 @@ open SchwartzSpace
 -- porting note: removed
 -- instance : Coe 𝓒(E, F) (E β†’ F) := ⟨toFun⟩
 
-instance instDFunLike : DFunLike 𝓒(E, F) E fun _ => F where
+instance instFunLike : FunLike 𝓒(E, F) E F where
   coe f := f.toFun
   coe_injective' f g h := by cases f; cases g; congr
-#align schwartz_map.fun_like SchwartzMap.instDFunLike
+#align schwartz_map.fun_like SchwartzMap.instFunLike
 
 /-- Helper instance for when there's too many metavariables to apply `DFunLike.hasCoeToFun`. -/
 instance instCoeFun : CoeFun 𝓒(E, F) fun _ => E β†’ F :=
feat: add lemmas about iteratedDerivWithin (#9679)

Mostly based on @CBirkbeck's work on modular forms.

Diff
@@ -6,7 +6,7 @@ Authors: Moritz Doll
 import Mathlib.Analysis.Calculus.Deriv.Add
 import Mathlib.Analysis.Calculus.Deriv.Mul
 import Mathlib.Analysis.Calculus.ContDiff.Bounds
-import Mathlib.Analysis.Calculus.IteratedDeriv
+import Mathlib.Analysis.Calculus.IteratedDeriv.Defs
 import Mathlib.Analysis.LocallyConvex.WithSeminorms
 import Mathlib.Topology.Algebra.UniformFilterBasis
 import Mathlib.Topology.ContinuousFunction.Bounded
chore(*): rename FunLike to DFunLike (#9785)

This prepares for the introduction of a non-dependent synonym of FunLike, which helps a lot with keeping #8386 readable.

This is entirely search-and-replace in 680197f combined with manual fixes in 4145626, e900597 and b8428f8. The commands that generated this change:

sed -i 's/\bFunLike\b/DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoFunLike\b/toDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/import Mathlib.Data.DFunLike/import Mathlib.Data.FunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bHom_FunLike\b/Hom_DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean     
sed -i 's/\binstFunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bfunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoo many metavariables to apply `fun_like.has_coe_to_fun`/too many metavariables to apply `DFunLike.hasCoeToFun`/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean

Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -92,14 +92,14 @@ open SchwartzSpace
 -- porting note: removed
 -- instance : Coe 𝓒(E, F) (E β†’ F) := ⟨toFun⟩
 
-instance instFunLike : FunLike 𝓒(E, F) E fun _ => F where
+instance instDFunLike : DFunLike 𝓒(E, F) E fun _ => F where
   coe f := f.toFun
   coe_injective' f g h := by cases f; cases g; congr
-#align schwartz_map.fun_like SchwartzMap.instFunLike
+#align schwartz_map.fun_like SchwartzMap.instDFunLike
 
-/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
+/-- Helper instance for when there's too many metavariables to apply `DFunLike.hasCoeToFun`. -/
 instance instCoeFun : CoeFun 𝓒(E, F) fun _ => E β†’ F :=
-  FunLike.hasCoeToFun
+  DFunLike.hasCoeToFun
 #align schwartz_map.has_coe_to_fun SchwartzMap.instCoeFun
 
 /-- All derivatives of a Schwartz function are rapidly decaying. -/
@@ -132,7 +132,7 @@ protected theorem differentiableAt (f : 𝓒(E, F)) {x : E} : DifferentiableAt 
 
 @[ext]
 theorem ext {f g : 𝓒(E, F)} (h : βˆ€ x, (f : E β†’ F) x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align schwartz_map.ext SchwartzMap.ext
 
 section IsBigO
@@ -323,7 +323,7 @@ instance instInhabited : Inhabited 𝓒(E, F) :=
   ⟨0⟩
 #align schwartz_map.inhabited SchwartzMap.instInhabited
 
-theorem coe_zero : FunLike.coe (0 : 𝓒(E, F)) = (0 : E β†’ F) :=
+theorem coe_zero : DFunLike.coe (0 : 𝓒(E, F)) = (0 : E β†’ F) :=
   rfl
 #align schwartz_map.coe_zero SchwartzMap.coe_zero
 
@@ -403,7 +403,7 @@ end Sub
 section AddCommGroup
 
 instance instAddCommGroup : AddCommGroup 𝓒(E, F) :=
-  FunLike.coe_injective.addCommGroup _ rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
+  DFunLike.coe_injective.addCommGroup _ rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
     (fun _ _ => rfl) fun _ _ => rfl
 #align schwartz_map.add_comm_group SchwartzMap.instAddCommGroup
 
@@ -418,13 +418,13 @@ def coeHom : 𝓒(E, F) β†’+ E β†’ F where
 
 variable {E F}
 
-theorem coe_coeHom : (coeHom E F : 𝓒(E, F) β†’ E β†’ F) = FunLike.coe :=
+theorem coe_coeHom : (coeHom E F : 𝓒(E, F) β†’ E β†’ F) = DFunLike.coe :=
   rfl
 #align schwartz_map.coe_coe_hom SchwartzMap.coe_coeHom
 
 theorem coeHom_injective : Function.Injective (coeHom E F) := by
   rw [coe_coeHom]
-  exact FunLike.coe_injective
+  exact DFunLike.coe_injective
 #align schwartz_map.coe_hom_injective SchwartzMap.coeHom_injective
 
 end AddCommGroup
chore: Rename rpow_nonneg_of_nonneg to rpow_nonneg (#9518)

This better matches other lemma names.

From LeanAPAP

Diff
@@ -163,7 +163,7 @@ theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
     from this.comp_tendsto tendsto_norm_cocompact_atTop
   simp_rw [Asymptotics.IsBigO, Asymptotics.IsBigOWith]
   refine' ⟨1, (Filter.eventually_ge_atTop 1).mono fun x hx => _⟩
-  rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg_of_nonneg (zero_le_one.trans hx) _),
+  rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg (zero_le_one.trans hx) _),
     Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_int_cast, Int.cast_neg,
     Int.cast_ofNat]
   exact Real.rpow_le_rpow_of_exponent_le hx hk
chore(*): use βˆƒ x ∈ s, _ instead of βˆƒ (x) (_ : x ∈ s), _ (#9215)

Follow-up #9184

Diff
@@ -616,8 +616,7 @@ def _root_.Function.HasTemperateGrowth (f : E β†’ F) : Prop :=
 
 theorem _root_.Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f : E β†’ F}
     (hf_temperate : f.HasTemperateGrowth) (n : β„•) :
-    βˆƒ (k : β„•) (C : ℝ) (_ : 0 ≀ C), βˆ€ (N : β„•) (_ : N ≀ n) (x : E),
-      β€–iteratedFDeriv ℝ N f xβ€– ≀ C * (1 + β€–xβ€–) ^ k := by
+    βˆƒ (k : β„•) (C : ℝ), 0 ≀ C ∧ βˆ€ N ≀ n, βˆ€ x : E, β€–iteratedFDeriv ℝ N f xβ€– ≀ C * (1 + β€–xβ€–) ^ k := by
   choose k C f using hf_temperate.2
   use (Finset.range (n + 1)).sup k
   let C' := max (0 : ℝ) ((Finset.range (n + 1)).sup' (by simp) C)
chore: Rename pow monotonicity lemmas (#9095)

The names for lemmas about monotonicity of (a ^ Β·) and (Β· ^ n) were a mess. This PR tidies up everything related by following the naming convention for (a * Β·) and (Β· * b). Namely, (a ^ Β·) is pow_right and (Β· ^ n) is pow_left in lemma names. All lemma renames follow the corresponding multiplication lemma names closely.

Renames

Algebra.GroupPower.Order

  • pow_mono β†’ pow_right_mono
  • pow_le_pow β†’ pow_le_pow_right
  • pow_le_pow_of_le_left β†’ pow_le_pow_left
  • pow_lt_pow_of_lt_left β†’ pow_lt_pow_left
  • strictMonoOn_pow β†’ pow_left_strictMonoOn
  • pow_strictMono_right β†’ pow_right_strictMono
  • pow_lt_pow β†’ pow_lt_pow_right
  • pow_lt_pow_iff β†’ pow_lt_pow_iff_right
  • pow_le_pow_iff β†’ pow_le_pow_iff_right
  • self_lt_pow β†’ lt_self_pow
  • strictAnti_pow β†’ pow_right_strictAnti
  • pow_lt_pow_iff_of_lt_one β†’ pow_lt_pow_iff_right_of_lt_one
  • pow_lt_pow_of_lt_one β†’ pow_lt_pow_right_of_lt_one
  • lt_of_pow_lt_pow β†’ lt_of_pow_lt_pow_left
  • le_of_pow_le_pow β†’ le_of_pow_le_pow_left
  • pow_lt_powβ‚€ β†’ pow_lt_pow_rightβ‚€

Algebra.GroupPower.CovariantClass

  • pow_le_pow_of_le_left' β†’ pow_le_pow_left'
  • nsmul_le_nsmul_of_le_right β†’ nsmul_le_nsmul_right
  • pow_lt_pow' β†’ pow_lt_pow_right'
  • nsmul_lt_nsmul β†’ nsmul_lt_nsmul_left
  • pow_strictMono_left β†’ pow_right_strictMono'
  • nsmul_strictMono_right β†’ nsmul_left_strictMono
  • StrictMono.pow_right' β†’ StrictMono.pow_const
  • StrictMono.nsmul_left β†’ StrictMono.const_nsmul
  • pow_strictMono_right' β†’ pow_left_strictMono
  • nsmul_strictMono_left β†’ nsmul_right_strictMono
  • Monotone.pow_right β†’ Monotone.pow_const
  • Monotone.nsmul_left β†’ Monotone.const_nsmul
  • lt_of_pow_lt_pow' β†’ lt_of_pow_lt_pow_left'
  • lt_of_nsmul_lt_nsmul β†’ lt_of_nsmul_lt_nsmul_right
  • pow_le_pow' β†’ pow_le_pow_right'
  • nsmul_le_nsmul β†’ nsmul_le_nsmul_left
  • pow_le_pow_of_le_one' β†’ pow_le_pow_right_of_le_one'
  • nsmul_le_nsmul_of_nonpos β†’ nsmul_le_nsmul_left_of_nonpos
  • le_of_pow_le_pow' β†’ le_of_pow_le_pow_left'
  • le_of_nsmul_le_nsmul' β†’ le_of_nsmul_le_nsmul_right'
  • pow_le_pow_iff' β†’ pow_le_pow_iff_right'
  • nsmul_le_nsmul_iff β†’ nsmul_le_nsmul_iff_left
  • pow_lt_pow_iff' β†’ pow_lt_pow_iff_right'
  • nsmul_lt_nsmul_iff β†’ nsmul_lt_nsmul_iff_left

Data.Nat.Pow

  • Nat.pow_lt_pow_of_lt_left β†’ Nat.pow_lt_pow_left
  • Nat.pow_le_iff_le_left β†’ Nat.pow_le_pow_iff_left
  • Nat.pow_lt_iff_lt_left β†’ Nat.pow_lt_pow_iff_left

Lemmas added

  • pow_le_pow_iff_left
  • pow_lt_pow_iff_left
  • pow_right_injective
  • pow_right_inj
  • Nat.pow_le_pow_left to have the correct name since Nat.pow_le_pow_of_le_left is in Std.
  • Nat.pow_le_pow_right to have the correct name since Nat.pow_le_pow_of_le_right is in Std.

Lemmas removed

  • self_le_pow was a duplicate of le_self_pow.
  • Nat.pow_lt_pow_of_lt_right is defeq to pow_lt_pow_right.
  • Nat.pow_right_strictMono is defeq to pow_right_strictMono.
  • Nat.pow_le_iff_le_right is defeq to pow_le_pow_iff_right.
  • Nat.pow_lt_iff_lt_right is defeq to pow_lt_pow_iff_right.

Other changes

  • A bunch of proofs have been golfed.
  • Some lemma assumptions have been turned from 0 < n or 1 ≀ n to n β‰  0.
  • A few Nat lemmas have been protected.
  • One docstring has been fixed.
Diff
@@ -629,7 +629,7 @@ theorem _root_.Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f
   Β· simp only [Finset.le_sup'_iff, le_max_iff]
     right
     exact ⟨N, hN, rfl.le⟩
-  refine' pow_le_pow (by simp only [le_add_iff_nonneg_right, norm_nonneg]) _
+  refine' pow_le_pow_right (by simp only [le_add_iff_nonneg_right, norm_nonneg]) _
   exact Finset.le_sup hN
 #align function.has_temperate_growth.norm_iterated_fderiv_le_uniform_aux Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux
 
@@ -777,7 +777,7 @@ def bilinLeftCLM (B : E β†’L[ℝ] F β†’L[ℝ] G) {g : D β†’ F} (hg : g.HasTemper
       refine' mul_le_mul_of_nonneg_right _ (norm_nonneg _)
       rw [pow_add]
       refine' mul_le_mul_of_nonneg_left _ (by positivity)
-      refine' pow_le_pow_of_le_left (norm_nonneg _) _ _
+      refine' pow_le_pow_left (norm_nonneg _) _ _
       simp only [zero_le_one, le_add_iff_nonneg_left])
 #align schwartz_map.bilin_left_clm SchwartzMap.bilinLeftCLM
 
@@ -819,7 +819,7 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
       let seminorm_f := ((Finset.Iic (k', n)).sup (schwartzSeminormFamily π•œ _ _)) f
       have hg_upper'' : (1 + β€–xβ€–) ^ (k + l * n) ≀ (1 + Cg) ^ (k + l * n) * (1 + β€–g xβ€–) ^ k' := by
         rw [pow_mul, ← mul_pow]
-        refine' pow_le_pow_of_le_left (by positivity) _ _
+        refine' pow_le_pow_left (by positivity) _ _
         rw [add_mul]
         refine' add_le_add _ (hg_upper' x)
         nth_rw 1 [← one_mul (1 : ℝ)]
@@ -844,7 +844,7 @@ def compCLM {g : D β†’ E} (hg : g.HasTemperateGrowth)
           simp only [le_add_iff_nonneg_right, norm_nonneg]
       have := norm_iteratedFDeriv_comp_le f.smooth' hg.1 le_top x hbound hgrowth'
       have hxk : β€–xβ€– ^ k ≀ (1 + β€–xβ€–) ^ k :=
-        pow_le_pow_of_le_left (norm_nonneg _) (by simp only [zero_le_one, le_add_iff_nonneg_left]) _
+        pow_le_pow_left (norm_nonneg _) (by simp only [zero_le_one, le_add_iff_nonneg_left]) _
       refine' le_trans (mul_le_mul hxk this (by positivity) (by positivity)) _
       have rearrange :
         (1 + β€–xβ€–) ^ k *
chore: Nsmul -> NSMul, Zpow -> ZPow, etc (#9067)

Normalising to naming convention rule number 6.

Diff
@@ -241,7 +241,7 @@ end SeminormAux
 
 /-! ### Algebraic properties -/
 
-section Smul
+section SMul
 
 variable [NormedField π•œ] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F] [NormedField π•œ'] [NormedSpace π•œ' F]
   [SMulCommClass ℝ π•œ' F]
@@ -309,7 +309,7 @@ instance instZSMul : SMul β„€ 𝓒(E, F) :=
         exact ((c : ℝ) β€’ f).decay' }⟩
 #align schwartz_map.has_zsmul SchwartzMap.instZSMul
 
-end Smul
+end SMul
 
 section Zero
 
chore: replace exact_mod_cast tactic with mod_cast elaborator where possible (#8404)

We still have the exact_mod_cast tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast are the ones that don't work using the term elaborator by itself.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -543,7 +543,7 @@ theorem one_add_le_sup_seminorm_apply {m : β„• Γ— β„•} {k n : β„•} (hk : k ≀ m
   refine' Finset.sum_le_sum fun i hi => _
   rw [mul_comm (β€–xβ€– ^ i), mul_assoc]
   refine' mul_le_mul _ _ (by positivity) (by positivity)
-  Β· exact_mod_cast Nat.choose_le_choose i hk
+  Β· exact mod_cast Nat.choose_le_choose i hk
   Β· trans
     Β· exact le_seminorm π•œ i n f x
     Β· apply Seminorm.le_def.1
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -60,8 +60,6 @@ The implementation of the seminorms is taken almost literally from `ContinuousLi
 Schwartz space, tempered distributions
 -/
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
 noncomputable section
 
 open scoped BigOperators Nat
chore: split Mathlib.Analysis.Calculus.ContDiff.Basic (#8344)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -3,7 +3,9 @@ Copyright (c) 2022 Moritz Doll. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 -/
-import Mathlib.Analysis.Calculus.ContDiff.Basic
+import Mathlib.Analysis.Calculus.Deriv.Add
+import Mathlib.Analysis.Calculus.Deriv.Mul
+import Mathlib.Analysis.Calculus.ContDiff.Bounds
 import Mathlib.Analysis.Calculus.IteratedDeriv
 import Mathlib.Analysis.LocallyConvex.WithSeminorms
 import Mathlib.Topology.Algebra.UniformFilterBasis
chore: move Analysis/ContDiff to Analysis/ContDiff/Basic to make room for splitting (#8337)

No changes to content, or splitting, just a rename so there is room for more files.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -3,7 +3,7 @@ Copyright (c) 2022 Moritz Doll. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
 -/
-import Mathlib.Analysis.Calculus.ContDiff
+import Mathlib.Analysis.Calculus.ContDiff.Basic
 import Mathlib.Analysis.Calculus.IteratedDeriv
 import Mathlib.Analysis.LocallyConvex.WithSeminorms
 import Mathlib.Topology.Algebra.UniformFilterBasis
chore: move TopologicalSpace.SecondCountableTopology into the root namespace (#8186)

All the other properties of topological spaces like T0Space or RegularSpace are in the root namespace. Many files were opening TopologicalSpace just for the sake of shortening TopologicalSpace.SecondCountableTopology...

Diff
@@ -597,7 +597,7 @@ instance instLocallyConvexSpace : LocallyConvexSpace ℝ 𝓒(E, F) :=
   (schwartz_withSeminorms ℝ E F).toLocallyConvexSpace
 #align schwartz_map.locally_convex_space SchwartzMap.instLocallyConvexSpace
 
-instance instFirstCountableTopology : TopologicalSpace.FirstCountableTopology 𝓒(E, F) :=
+instance instFirstCountableTopology : FirstCountableTopology 𝓒(E, F) :=
   (schwartz_withSeminorms ℝ E F).first_countable
 #align schwartz_map.topological_space.first_countable_topology SchwartzMap.instFirstCountableTopology
 
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -629,7 +629,6 @@ theorem _root_.Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f
   Β· simp only [Finset.le_sup'_iff, le_max_iff]
     right
     exact ⟨N, hN, rfl.le⟩
-  simp_rw [Real.rpow_nat_cast]
   refine' pow_le_pow (by simp only [le_add_iff_nonneg_right, norm_nonneg]) _
   exact Finset.le_sup hN
 #align function.has_temperate_growth.norm_iterated_fderiv_le_uniform_aux Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -64,7 +64,7 @@ noncomputable section
 
 open scoped BigOperators Nat
 
-variable {π•œ π•œ' D E F G : Type _}
+variable {π•œ π•œ' D E F G : Type*}
 
 variable [NormedAddCommGroup E] [NormedSpace ℝ E]
 
chore: regularize HPow.hPow porting notes (#6465)
Diff
@@ -58,7 +58,7 @@ The implementation of the seminorms is taken almost literally from `ContinuousLi
 Schwartz space, tempered distributions
 -/
 
-local macro_rules | `($x ^ $y)   => `(HPow.hPow $x $y) -- Porting note: See issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
 
 noncomputable section
 
chore: fix grammar mistakes (#6121)
Diff
@@ -19,7 +19,7 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Real
 This file defines the Schwartz space. Usually, the Schwartz space is defined as the set of smooth
 functions $f : ℝ^n β†’ β„‚$ such that there exists $C_{Ξ±Ξ²} > 0$ with $$|x^Ξ± βˆ‚^Ξ² f(x)| < C_{Ξ±Ξ²}$$ for
 all $x ∈ ℝ^n$ and for all multiindices $Ξ±, Ξ²$.
-In mathlib, we use a slightly different approach and define define the Schwartz space as all
+In mathlib, we use a slightly different approach and define the Schwartz space as all
 smooth functions `f : E β†’ F`, where `E` and `F` are real normed vector spaces such that for all
 natural numbers `k` and `n` we have uniform bounds `β€–xβ€–^k * β€–iteratedFDeriv ℝ n f xβ€– < C`.
 This approach completely avoids using partial derivatives as well as polynomials.
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2022 Moritz Doll. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Moritz Doll
-
-! This file was ported from Lean 3 source module analysis.schwartz_space
-! leanprover-community/mathlib commit e137999b2c6f2be388f4cd3bbf8523de1910cd2b
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.Calculus.ContDiff
 import Mathlib.Analysis.Calculus.IteratedDeriv
@@ -16,6 +11,8 @@ import Mathlib.Topology.ContinuousFunction.Bounded
 import Mathlib.Tactic.Positivity
 import Mathlib.Analysis.SpecialFunctions.Pow.Real
 
+#align_import analysis.schwartz_space from "leanprover-community/mathlib"@"e137999b2c6f2be388f4cd3bbf8523de1910cd2b"
+
 /-!
 # Schwartz space
 
chore: bump to nightly-2023-07-01 (#5409)

Open in Gitpod

Co-authored-by: Komyyy <pol_tta@outlook.jp> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -949,7 +949,7 @@ theorem iteratedPDeriv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E,
   Β· rw [iteratedPDeriv_zero, iteratedPDeriv_one]
     rfl
   -- The proof is `βˆ‚^{n + 2} = βˆ‚ βˆ‚^{n + 1} = βˆ‚ βˆ‚^n βˆ‚ = βˆ‚^{n+1} βˆ‚`
-  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSuccEmb_zero]
+  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSucc_zero]
   have hmtail : Fin.tail m (Fin.last n) = m (Fin.last n.succ) := by
     simp only [Fin.tail_def, Fin.succ_last]
   -- Porting note: changed to `calc` proof
chore: rename Fin.castSucc to Fin.castSuccEmb (#5729)

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -949,7 +949,7 @@ theorem iteratedPDeriv_succ_right {n : β„•} (m : Fin (n + 1) β†’ E) (f : 𝓒(E,
   Β· rw [iteratedPDeriv_zero, iteratedPDeriv_one]
     rfl
   -- The proof is `βˆ‚^{n + 2} = βˆ‚ βˆ‚^{n + 1} = βˆ‚ βˆ‚^n βˆ‚ = βˆ‚^{n+1} βˆ‚`
-  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSucc_zero]
+  have hmzero : Fin.init m 0 = m 0 := by simp only [Fin.init_def, Fin.castSuccEmb_zero]
   have hmtail : Fin.tail m (Fin.last n) = m (Fin.last n.succ) := by
     simp only [Fin.tail_def, Fin.succ_last]
   -- Porting note: changed to `calc` proof
feat: port Analysis.SchwartzSpace (#4762)

Co-authored-by: Moritz Firsching <firsching@google.com> Co-authored-by: int-y1 <jason_yuen2007@hotmail.com> Co-authored-by: Xavier-François Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Komyyy <pol_tta@outlook.jp> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Dependencies 12 + 922

923 files ported (98.7%)
408731 lines ported (98.6%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file