Skip to content

Commit 981dca5

Browse files
committed
chore(SchwartzSpace): clean up white space (#19336)
Definitions in term mode using `mkCLM` are indented by 6 spaces, but formulating things with `refine` drops it to a more reasonable 2 spaces. Absolutely no math change, just unindenting.
1 parent fe0e8bc commit 981dca5

File tree

1 file changed

+114
-120
lines changed

1 file changed

+114
-120
lines changed

Mathlib/Analysis/Distribution/SchwartzSpace.lean

Lines changed: 114 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -764,53 +764,51 @@ variable [NormedAddCommGroup G] [NormedSpace ℝ G]
764764
/-- The map `f ↦ (x ↦ B (f x) (g x))` as a continuous `𝕜`-linear map on Schwartz space,
765765
where `B` is a continuous `𝕜`-linear map and `g` is a function of temperate growth. -/
766766
def bilinLeftCLM (B : E →L[ℝ] F →L[ℝ] G) {g : D → F} (hg : g.HasTemperateGrowth) :
767-
𝓢(D, E) →L[ℝ] 𝓢(D, G) :=
767+
𝓢(D, E) →L[ℝ] 𝓢(D, G) := by
768768
-- Todo (after port): generalize to `B : E →L[𝕜] F →L[𝕜] G` and `𝕜`-linear
769-
mkCLM
770-
(fun f x => B (f x) (g x))
769+
refine mkCLM (fun f x => B (f x) (g x))
771770
(fun _ _ _ => by
772771
simp only [map_add, add_left_inj, Pi.add_apply, eq_self_iff_true,
773772
ContinuousLinearMap.add_apply])
774773
(fun _ _ _ => by
775774
simp only [smul_apply, map_smul, ContinuousLinearMap.coe_smul', Pi.smul_apply,
776775
RingHom.id_apply])
777-
(fun f => (B.isBoundedBilinearMap.contDiff.restrict_scalars ℝ).comp (f.smooth'.prod hg.1))
778-
(by
779-
rintro ⟨k, n⟩
780-
rcases hg.norm_iteratedFDeriv_le_uniform_aux n with ⟨l, C, hC, hgrowth⟩
781-
use
782-
Finset.Iic (l + k, n), ‖B‖ * ((n : ℝ) + (1 : ℝ)) * n.choose (n / 2) * (C * 2 ^ (l + k)),
783-
by positivity
784-
intro f x
785-
have hxk : 0 ≤ ‖x‖ ^ k := by positivity
786-
have hnorm_mul :=
787-
ContinuousLinearMap.norm_iteratedFDeriv_le_of_bilinear B f.smooth' hg.1 x (n := n) le_top
788-
refine le_trans (mul_le_mul_of_nonneg_left hnorm_mul hxk) ?_
789-
move_mul [← ‖B‖]
790-
simp_rw [mul_assoc ‖B‖]
791-
gcongr _ * ?_
792-
rw [Finset.mul_sum]
793-
have : (∑ _x ∈ Finset.range (n + 1), (1 : ℝ)) = n + 1 := by simp
794-
simp_rw [mul_assoc ((n : ℝ) + 1)]
795-
rw [← this, Finset.sum_mul]
796-
refine Finset.sum_le_sum fun i hi => ?_
797-
simp only [one_mul]
798-
move_mul [(Nat.choose n i : ℝ), (Nat.choose n (n / 2) : ℝ)]
799-
gcongr ?_ * ?_
800-
swap
801-
· norm_cast
802-
exact i.choose_le_middle n
803-
specialize hgrowth (n - i) (by simp only [tsub_le_self]) x
804-
refine le_trans (mul_le_mul_of_nonneg_left hgrowth (by positivity)) ?_
805-
move_mul [C]
806-
gcongr ?_ * C
807-
rw [Finset.mem_range_succ_iff] at hi
808-
change i ≤ (l + k, n).snd at hi
809-
refine le_trans ?_ (one_add_le_sup_seminorm_apply le_rfl hi f x)
810-
rw [pow_add]
811-
move_mul [(1 + ‖x‖) ^ l]
812-
gcongr
813-
simp)
776+
(fun f => (B.isBoundedBilinearMap.contDiff.restrict_scalars ℝ).comp (f.smooth'.prod hg.1)) ?_
777+
rintro ⟨k, n⟩
778+
rcases hg.norm_iteratedFDeriv_le_uniform_aux n with ⟨l, C, hC, hgrowth⟩
779+
use
780+
Finset.Iic (l + k, n), ‖B‖ * ((n : ℝ) + (1 : ℝ)) * n.choose (n / 2) * (C * 2 ^ (l + k)),
781+
by positivity
782+
intro f x
783+
have hxk : 0 ≤ ‖x‖ ^ k := by positivity
784+
have hnorm_mul :=
785+
ContinuousLinearMap.norm_iteratedFDeriv_le_of_bilinear B f.smooth' hg.1 x (n := n) le_top
786+
refine le_trans (mul_le_mul_of_nonneg_left hnorm_mul hxk) ?_
787+
move_mul [← ‖B‖]
788+
simp_rw [mul_assoc ‖B‖]
789+
gcongr _ * ?_
790+
rw [Finset.mul_sum]
791+
have : (∑ _x ∈ Finset.range (n + 1), (1 : ℝ)) = n + 1 := by simp
792+
simp_rw [mul_assoc ((n : ℝ) + 1)]
793+
rw [← this, Finset.sum_mul]
794+
refine Finset.sum_le_sum fun i hi => ?_
795+
simp only [one_mul]
796+
move_mul [(Nat.choose n i : ℝ), (Nat.choose n (n / 2) : ℝ)]
797+
gcongr ?_ * ?_
798+
swap
799+
· norm_cast
800+
exact i.choose_le_middle n
801+
specialize hgrowth (n - i) (by simp only [tsub_le_self]) x
802+
refine le_trans (mul_le_mul_of_nonneg_left hgrowth (by positivity)) ?_
803+
move_mul [C]
804+
gcongr ?_ * C
805+
rw [Finset.mem_range_succ_iff] at hi
806+
change i ≤ (l + k, n).snd at hi
807+
refine le_trans ?_ (one_add_le_sup_seminorm_apply le_rfl hi f x)
808+
rw [pow_add]
809+
move_mul [(1 + ‖x‖) ^ l]
810+
gcongr
811+
simp
814812

815813
end Multiplication
816814

@@ -824,68 +822,67 @@ variable [NormedSpace 𝕜 F] [SMulCommClass ℝ 𝕜 F]
824822
/-- Composition with a function on the right is a continuous linear map on Schwartz space
825823
provided that the function is temperate and growths polynomially near infinity. -/
826824
def compCLM {g : D → E} (hg : g.HasTemperateGrowth)
827-
(hg_upper : ∃ (k : ℕ) (C : ℝ), ∀ x, ‖x‖ ≤ C * (1 + ‖g x‖) ^ k) : 𝓢(E, F) →L[𝕜] 𝓢(D, F) :=
828-
mkCLM (fun f x => f (g x))
825+
(hg_upper : ∃ (k : ℕ) (C : ℝ), ∀ x, ‖x‖ ≤ C * (1 + ‖g x‖) ^ k) : 𝓢(E, F) →L[𝕜] 𝓢(D, F) := by
826+
refine mkCLM (fun f x => f (g x))
829827
(fun _ _ _ => by simp only [add_left_inj, Pi.add_apply, eq_self_iff_true]) (fun _ _ _ => rfl)
830-
(fun f => f.smooth'.comp hg.1)
831-
(by
832-
rintro ⟨k, n⟩
833-
rcases hg.norm_iteratedFDeriv_le_uniform_aux n with ⟨l, C, hC, hgrowth⟩
834-
rcases hg_upper with ⟨kg, Cg, hg_upper'⟩
835-
have hCg : 11 + Cg := by
836-
refine le_add_of_nonneg_right ?_
837-
specialize hg_upper' 0
838-
rw [norm_zero] at hg_upper'
839-
exact nonneg_of_mul_nonneg_left hg_upper' (by positivity)
840-
let k' := kg * (k + l * n)
841-
use Finset.Iic (k', n), (1 + Cg) ^ (k + l * n) * ((C + 1) ^ n * n ! * 2 ^ k'), by positivity
842-
intro f x
843-
let seminorm_f := ((Finset.Iic (k', n)).sup (schwartzSeminormFamily 𝕜 _ _)) f
844-
have hg_upper'' : (1 + ‖x‖) ^ (k + l * n) ≤ (1 + Cg) ^ (k + l * n) * (1 + ‖g x‖) ^ k' := by
845-
rw [pow_mul, ← mul_pow]
846-
gcongr
847-
rw [add_mul]
848-
refine add_le_add ?_ (hg_upper' x)
849-
nth_rw 1 [← one_mul (1 : ℝ)]
850-
gcongr
851-
apply one_le_pow₀
852-
simp only [le_add_iff_nonneg_right, norm_nonneg]
853-
have hbound :
854-
∀ i, i ≤ n → ‖iteratedFDeriv ℝ i f (g x)‖ ≤ 2 ^ k' * seminorm_f / (1 + ‖g x‖) ^ k' := by
855-
intro i hi
856-
have hpos : 0 < (1 + ‖g x‖) ^ k' := by positivity
857-
rw [le_div_iff₀' hpos]
858-
change i ≤ (k', n).snd at hi
859-
exact one_add_le_sup_seminorm_apply le_rfl hi _ _
860-
have hgrowth' : ∀ N : ℕ, 1 ≤ N → N ≤ n →
861-
‖iteratedFDeriv ℝ N g x‖ ≤ ((C + 1) * (1 + ‖x‖) ^ l) ^ N := by
862-
intro N hN₁ hN₂
863-
refine (hgrowth N hN₂ x).trans ?_
864-
rw [mul_pow]
865-
have hN₁' := (lt_of_lt_of_le zero_lt_one hN₁).ne'
866-
gcongr
867-
· exact le_trans (by simp [hC]) (le_self_pow₀ (by simp [hC]) hN₁')
868-
· refine le_self_pow₀ (one_le_pow₀ ?_) hN₁'
869-
simp only [le_add_iff_nonneg_right, norm_nonneg]
870-
have := norm_iteratedFDeriv_comp_le f.smooth' hg.1 le_top x hbound hgrowth'
871-
have hxk : ‖x‖ ^ k ≤ (1 + ‖x‖) ^ k :=
872-
pow_le_pow_left₀ (norm_nonneg _) (by simp only [zero_le_one, le_add_iff_nonneg_left]) _
873-
refine le_trans (mul_le_mul hxk this (by positivity) (by positivity)) ?_
874-
have rearrange :
875-
(1 + ‖x‖) ^ k *
876-
(n ! * (2 ^ k' * seminorm_f / (1 + ‖g x‖) ^ k') * ((C + 1) * (1 + ‖x‖) ^ l) ^ n) =
877-
(1 + ‖x‖) ^ (k + l * n) / (1 + ‖g x‖) ^ k' *
878-
((C + 1) ^ n * n ! * 2 ^ k' * seminorm_f) := by
879-
rw [mul_pow, pow_add, ← pow_mul]
880-
ring
881-
rw [rearrange]
882-
have hgxk' : 0 < (1 + ‖g x‖) ^ k' := by positivity
883-
rw [← div_le_iff₀ hgxk'] at hg_upper''
884-
have hpos : (0 : ℝ) ≤ (C + 1) ^ n * n ! * 2 ^ k' * seminorm_f := by
885-
have : 0 ≤ seminorm_f := apply_nonneg _ _
886-
positivity
887-
refine le_trans (mul_le_mul_of_nonneg_right hg_upper'' hpos) ?_
888-
rw [← mul_assoc])
828+
(fun f => f.smooth'.comp hg.1) ?_
829+
rintro ⟨k, n⟩
830+
rcases hg.norm_iteratedFDeriv_le_uniform_aux n with ⟨l, C, hC, hgrowth⟩
831+
rcases hg_upper with ⟨kg, Cg, hg_upper'⟩
832+
have hCg : 11 + Cg := by
833+
refine le_add_of_nonneg_right ?_
834+
specialize hg_upper' 0
835+
rw [norm_zero] at hg_upper'
836+
exact nonneg_of_mul_nonneg_left hg_upper' (by positivity)
837+
let k' := kg * (k + l * n)
838+
use Finset.Iic (k', n), (1 + Cg) ^ (k + l * n) * ((C + 1) ^ n * n ! * 2 ^ k'), by positivity
839+
intro f x
840+
let seminorm_f := ((Finset.Iic (k', n)).sup (schwartzSeminormFamily 𝕜 _ _)) f
841+
have hg_upper'' : (1 + ‖x‖) ^ (k + l * n) ≤ (1 + Cg) ^ (k + l * n) * (1 + ‖g x‖) ^ k' := by
842+
rw [pow_mul, ← mul_pow]
843+
gcongr
844+
rw [add_mul]
845+
refine add_le_add ?_ (hg_upper' x)
846+
nth_rw 1 [← one_mul (1 : ℝ)]
847+
gcongr
848+
apply one_le_pow₀
849+
simp only [le_add_iff_nonneg_right, norm_nonneg]
850+
have hbound :
851+
∀ i, i ≤ n → ‖iteratedFDeriv ℝ i f (g x)‖ ≤ 2 ^ k' * seminorm_f / (1 + ‖g x‖) ^ k' := by
852+
intro i hi
853+
have hpos : 0 < (1 + ‖g x‖) ^ k' := by positivity
854+
rw [le_div_iff₀' hpos]
855+
change i ≤ (k', n).snd at hi
856+
exact one_add_le_sup_seminorm_apply le_rfl hi _ _
857+
have hgrowth' : ∀ N : ℕ, 1 ≤ N → N ≤ n →
858+
‖iteratedFDeriv ℝ N g x‖ ≤ ((C + 1) * (1 + ‖x‖) ^ l) ^ N := by
859+
intro N hN₁ hN₂
860+
refine (hgrowth N hN₂ x).trans ?_
861+
rw [mul_pow]
862+
have hN₁' := (lt_of_lt_of_le zero_lt_one hN₁).ne'
863+
gcongr
864+
· exact le_trans (by simp [hC]) (le_self_pow₀ (by simp [hC]) hN₁')
865+
· refine le_self_pow₀ (one_le_pow₀ ?_) hN₁'
866+
simp only [le_add_iff_nonneg_right, norm_nonneg]
867+
have := norm_iteratedFDeriv_comp_le f.smooth' hg.1 le_top x hbound hgrowth'
868+
have hxk : ‖x‖ ^ k ≤ (1 + ‖x‖) ^ k :=
869+
pow_le_pow_left₀ (norm_nonneg _) (by simp only [zero_le_one, le_add_iff_nonneg_left]) _
870+
refine le_trans (mul_le_mul hxk this (by positivity) (by positivity)) ?_
871+
have rearrange :
872+
(1 + ‖x‖) ^ k *
873+
(n ! * (2 ^ k' * seminorm_f / (1 + ‖g x‖) ^ k') * ((C + 1) * (1 + ‖x‖) ^ l) ^ n) =
874+
(1 + ‖x‖) ^ (k + l * n) / (1 + ‖g x‖) ^ k' *
875+
((C + 1) ^ n * n ! * 2 ^ k' * seminorm_f) := by
876+
rw [mul_pow, pow_add, ← pow_mul]
877+
ring
878+
rw [rearrange]
879+
have hgxk' : 0 < (1 + ‖g x‖) ^ k' := by positivity
880+
rw [← div_le_iff₀ hgxk'] at hg_upper''
881+
have hpos : (0 : ℝ) ≤ (C + 1) ^ n * n ! * 2 ^ k' * seminorm_f := by
882+
have : 0 ≤ seminorm_f := apply_nonneg _ _
883+
positivity
884+
refine le_trans (mul_le_mul_of_nonneg_right hg_upper'' hpos) ?_
885+
rw [← mul_assoc]
889886

890887
@[simp] lemma compCLM_apply {g : D → E} (hg : g.HasTemperateGrowth)
891888
(hg_upper : ∃ (k : ℕ) (C : ℝ), ∀ x, ‖x‖ ≤ C * (1 + ‖g x‖) ^ k) (f : 𝓢(E, F)) :
@@ -1070,25 +1067,22 @@ lemma integrable (f : 𝓢(D, V)) : Integrable f μ :=
10701067

10711068
variable (𝕜 μ) in
10721069
/-- The integral as a continuous linear map from Schwartz space to the codomain. -/
1073-
def integralCLM : 𝓢(D, V) →L[𝕜] V :=
1074-
mkCLMtoNormedSpace (∫ x, · x ∂μ)
1075-
(fun f g ↦ by
1076-
exact integral_add f.integrable g.integrable)
1077-
(integral_smul · ·)
1078-
(by
1079-
rcases hμ.exists_integrable with ⟨n, h⟩
1080-
let m := (n, 0)
1081-
use Finset.Iic m, 2 ^ n * ∫ x : D, (1 + ‖x‖) ^ (- (n : ℝ)) ∂μ
1082-
refine ⟨by positivity, fun f ↦ (norm_integral_le_integral_norm f).trans ?_⟩
1083-
have h' : ∀ x, ‖f x‖ ≤ (1 + ‖x‖) ^ (-(n : ℝ)) *
1084-
(2 ^ n * ((Finset.Iic m).sup (fun m' => SchwartzMap.seminorm 𝕜 m'.1 m'.2) f)) := by
1085-
intro x
1086-
rw [rpow_neg (by positivity), ← div_eq_inv_mul, le_div_iff₀' (by positivity), rpow_natCast]
1087-
simpa using one_add_le_sup_seminorm_apply (m := m) (k := n) (n := 0) le_rfl le_rfl f x
1088-
apply (integral_mono (by simpa using f.integrable_pow_mul μ 0) _ h').trans
1089-
· rw [integral_mul_right, ← mul_assoc, mul_comm (2 ^ n)]
1090-
rfl
1091-
apply h.mul_const)
1070+
def integralCLM : 𝓢(D, V) →L[𝕜] V := by
1071+
refine mkCLMtoNormedSpace (∫ x, · x ∂μ)
1072+
(fun f g ↦ integral_add f.integrable g.integrable) (integral_smul · ·) ?_
1073+
rcases hμ.exists_integrable with ⟨n, h⟩
1074+
let m := (n, 0)
1075+
use Finset.Iic m, 2 ^ n * ∫ x : D, (1 + ‖x‖) ^ (- (n : ℝ)) ∂μ
1076+
refine ⟨by positivity, fun f ↦ (norm_integral_le_integral_norm f).trans ?_⟩
1077+
have h' : ∀ x, ‖f x‖ ≤ (1 + ‖x‖) ^ (-(n : ℝ)) *
1078+
(2 ^ n * ((Finset.Iic m).sup (fun m' => SchwartzMap.seminorm 𝕜 m'.1 m'.2) f)) := by
1079+
intro x
1080+
rw [rpow_neg (by positivity), ← div_eq_inv_mul, le_div_iff₀' (by positivity), rpow_natCast]
1081+
simpa using one_add_le_sup_seminorm_apply (m := m) (k := n) (n := 0) le_rfl le_rfl f x
1082+
apply (integral_mono (by simpa using f.integrable_pow_mul μ 0) _ h').trans
1083+
· rw [integral_mul_right, ← mul_assoc, mul_comm (2 ^ n)]
1084+
rfl
1085+
apply h.mul_const
10921086

10931087
variable (𝕜) in
10941088
@[simp]

0 commit comments

Comments
 (0)