This journal is in preparation. Submissions are open as a pilot and the editorial board is being formed. Articles marked Demonstration show the format only.
Journal of Machine-Verified MathematicsPeer-reviewed mathematics with machine-checked proofs, for the age of AI

E424/Tools/T11.lean

All files · 457 lines · source at the verified commit

1module
2
3public import E424.Tools.T11Aux
4
5@[expose] public section
6
7/-!
8# Erdős 424: tool T11. Absolute existential constants; Mathlib only.
9-/
10
11set_option linter.style.header false
12open Finset Complex MeasureTheory Filter Topology
13open scoped FourierTransform
14
15namespace E424
16
17/-- **T11**, Fourier transform of the triangle. -/
18theorem T11_fourier_tri (Q t : ℝ) (hQ : 0 < Q) :
19 ∫ x, (tri Q x : ℂ) * Complex.exp (-(t * x : ℝ) * Complex.I) =
20 ((Real.sinc (t / (2 * Q)) ^ 2 : ℝ) : ℂ) := by
21 have hcont : Continuous (fun x : ℝ => (tri Q x : ℂ) * Complex.exp (-(t * x : ℝ) * Complex.I)) := by
22 have := tri_continuous Q
23 fun_prop
24 rw [integral_split_tri Q hQ _ hcont
25 (fun x hx => by simp only [tri_eq_zero Q x hQ hx, Complex.ofReal_zero, zero_mul])]
26 have hle : -Q⁻¹ ≤ 0 := by have := inv_pos.mpr hQ; linarith
27 have hle' : (0 : ℝ) ≤ Q⁻¹ := (inv_pos.mpr hQ).le
28 have hQ0 : Q ≠ 0 := hQ.ne'
29 by_cases ht : t = 0
30 · subst ht
31 have r1 : ∫ x in (-Q⁻¹)..0, tri Q x = 1 / 2 := by
32 rw [intervalIntegral.integral_congr (g := fun x => Q + Q ^ 2 * x)
33 (fun x hx => by
34 rw [Set.uIcc_of_le hle] at hx
35 exact tri_eq_neg Q x hQ hx.2 hx.1), integral_poly]
36 field_simp
37 ring
38 have r2 : ∫ x in (0)..Q⁻¹, tri Q x = 1 / 2 := by
39 rw [intervalIntegral.integral_congr (g := fun x => Q + (-Q ^ 2) * x)
40 (fun x hx => by
41 rw [Set.uIcc_of_le hle'] at hx
42 rw [tri_eq_pos Q x hQ hx.1 hx.2]
43 ring), integral_poly]
44 field_simp
45 ring
46 simp only [zero_mul, Complex.ofReal_zero, neg_zero, Complex.exp_zero, mul_one]
47 rw [intervalIntegral.integral_ofReal, intervalIntegral.integral_ofReal, r1, r2]
48 norm_num
49 · obtain ⟨c, hc⟩ : ∃ c : ℂ, c = -(t : ℂ) * I := ⟨_, rfl⟩
50 have hcne : c ≠ 0 := by rw [hc]; simp [ht]
51 have hexp : ∀ x : ℝ, Complex.exp (-(t * x : ℝ) * Complex.I) = Complex.exp (c * x) := by
52 intro x; congr 1; rw [hc]; push_cast; ring
53 simp only [hexp]
54 have hL : ∫ x in (-Q⁻¹)..0, (tri Q x : ℂ) * exp (c * x) =
55 ∫ x in (-Q⁻¹)..0, ((Q : ℂ) + (Q : ℂ) ^ 2 * x) * exp (c * x) :=
56 intervalIntegral.integral_congr (fun x hx => by
57 rw [Set.uIcc_of_le hle] at hx
58 simp only [tri_eq_neg Q x hQ hx.2 hx.1]
59 push_cast
60 ring)
61 have hR : ∫ x in (0)..Q⁻¹, (tri Q x : ℂ) * exp (c * x) =
62 ∫ x in (0)..Q⁻¹, ((Q : ℂ) + (-(Q : ℂ) ^ 2) * x) * exp (c * x) :=
63 intervalIntegral.integral_congr (fun x hx => by
64 rw [Set.uIcc_of_le hle'] at hx
65 simp only [tri_eq_pos Q x hQ hx.1 hx.2]
66 push_cast
67 ring)
68 have f1 := intervalIntegral.integral_eq_sub_of_hasDerivAt (a := -Q⁻¹) (b := 0)
69 (f := fun y : ℝ => ((Q : ℂ) + (Q : ℂ) ^ 2 * y) * exp (c * y) / c - (Q : ℂ) ^ 2 * exp (c * y) / c ^ 2)
70 (f' := fun x : ℝ => ((Q : ℂ) + (Q : ℂ) ^ 2 * x) * exp (c * x))
71 (fun x _ => hasDerivAt_linExp _ _ c hcne x)
72 (by apply Continuous.intervalIntegrable; fun_prop)
73 have f2 := intervalIntegral.integral_eq_sub_of_hasDerivAt (a := 0) (b := Q⁻¹)
74 (f := fun y : ℝ => ((Q : ℂ) + (-(Q : ℂ) ^ 2) * y) * exp (c * y) / c - (-(Q : ℂ) ^ 2) * exp (c * y) / c ^ 2)
75 (f' := fun x : ℝ => ((Q : ℂ) + (-(Q : ℂ) ^ 2) * x) * exp (c * x))
76 (fun x _ => hasDerivAt_linExp _ _ c hcne x)
77 (by apply Continuous.intervalIntegrable; fun_prop)
78 rw [hL, hR, f1, f2]
79 linear_combination tri_fourier_alg Q t hQ ht c hc
80
81/-- **T11**, Fejér's identity, the inverse transform. It gives T4 and T6 by expanding squares. -/
82theorem T11_fejer (T u : ℝ) (hT : 0 < T) :
83 ∫ t, ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * Complex.exp ((t * u : ℝ) * Complex.I) =
84 ((2 * Real.pi * tri T u : ℝ) : ℂ) := by
85 set g : ℝ → ℂ := fun x => ((tri T x : ℝ) : ℂ) with hg_def
86 have hgc : Continuous g := Complex.continuous_ofReal.comp (tri_continuous T)
87 have hgi : Integrable g := by
88 refine Continuous.integrable_of_hasCompactSupport hgc
89 (HasCompactSupport.intro (isCompact_Icc (a := -T⁻¹) (b := T⁻¹)) fun x hx => ?_)
90 have hx' : T⁻¹ ≤ |x| := by
91 by_contra h
92 exact hx (Set.mem_Icc.mpr ⟨(abs_lt.mp (not_le.mp h)).1.le, (abs_lt.mp (not_le.mp h)).2.le⟩)
93 simp only [hg_def, tri_eq_zero T x hT hx', Complex.ofReal_zero]
94 have hFT : ∀ w : ℝ, FourierTransform.fourier g w = ((Real.sinc (2 * Real.pi * w / (2 * T)) ^ 2 : ℝ) : ℂ) := by
95 intro w
96 rw [Real.fourier_real_eq_integral_exp_smul, ← T11_fourier_tri T (2 * Real.pi * w) hT]
97 congr 1
98 funext v
99 simp only [smul_eq_mul, hg_def]
100 rw [mul_comm]
101 congr 2
102 push_cast
103 ring
104 have hFTint : Integrable (FourierTransform.fourier g) := by
105 have e : FourierTransform.fourier g = fun w : ℝ =>
106 ((Real.sinc (2 * Real.pi * w / (2 * T)) ^ 2 : ℝ) : ℂ) := funext hFT
107 rw [e]
108 apply Integrable.ofReal
109 refine Integrable.mono' (g := fun w : ℝ => 2 * (1 + (2 * Real.pi * w / (2 * T)) ^ 2)⁻¹) ?_ ?_ ?_
110 · have := (integrable_inv_one_add_sq.comp_mul_left' (R := 2 * Real.pi / (2 * T))
111 (by positivity)).const_mul 2
112 convert this using 1
113 funext w
114 ring_nf
115 · exact (by fun_prop : Continuous fun w : ℝ =>
116 Real.sinc (2 * Real.pi * w / (2 * T)) ^ 2).aestronglyMeasurable
117 · exact Filter.Eventually.of_forall fun w => by
118 rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)]
119 exact sinc_sq_le _
120 have hinv := Continuous.fourierInv_fourier_eq hgc hgi hFTint
121 have hu := congrFun hinv u
122 rw [Real.fourierInv_eq'] at hu
123 simp_rw [hFT, smul_eq_mul, RCLike.inner_apply, conj_trivial] at hu
124 set F : ℝ → ℂ := fun t => ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * Complex.exp ((t * u : ℝ) * Complex.I)
125 with hF
126 have key : ∫ w, F (2 * Real.pi * w) = ((tri T u : ℝ) : ℂ) := by
127 rw [show ((tri T u : ℝ) : ℂ) = g u from rfl, ← hu]
128 congr 1
129 funext w
130 simp only [hF]
131 rw [mul_comm]
132 congr 2
133 push_cast
134 ring
135 have hc := MeasureTheory.Measure.integral_comp_mul_left F (2 * Real.pi)
136 rw [key, abs_of_pos (by positivity), Complex.real_smul] at hc
137 have hpi : (Real.pi : ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_zero
138 rw [Complex.ofReal_mul, hc]
139 push_cast
140 field_simp
141
142theorem T11_sinc (x : ℝ) : 0 ≤ 1 - Real.sinc (x / 2) ^ 2 ∧ 1 - Real.sinc (x / 2) ^ 2 ≤ min 1 |x| := by
143 have h1 : Real.sinc (x / 2) ≤ 1 := Real.sinc_le_one _
144 have h2 : -1 ≤ Real.sinc (x / 2) := Real.neg_one_le_sinc _
145 have h3 : 1 - Real.sinc (x / 2) ≤ x ^ 2 / 24 := by
146 by_cases hx : x = 0
147 · simp [hx]
148 · have hy : x / 2 ≠ 0 := by positivity
149 rw [Real.sinc_of_ne_zero hy]
150 have key := Real.abs_sub_sin_le (x / 2)
151 have e : 1 - Real.sin (x / 2) / (x / 2) = (x / 2 - Real.sin (x / 2)) / (x / 2) := by
152 field_simp
153 have hpos : 0 < |x / 2| := abs_pos.mpr hy
154 calc 1 - Real.sin (x / 2) / (x / 2)
155 ≤ |(x / 2 - Real.sin (x / 2)) / (x / 2)| := by rw [← e]; exact le_abs_self _
156 _ = |x / 2 - Real.sin (x / 2)| / |x / 2| := abs_div _ _
157 _ ≤ (|x / 2| ^ 3 / 6) / |x / 2| := div_le_div_of_nonneg_right key hpos.le
158 _ = x ^ 2 / 24 := by
159 rw [show |x / 2| ^ 3 / 6 / |x / 2| = |x / 2| ^ 2 / 6 by field_simp]
160 rw [sq_abs]
161 ring
162 have h4 : 1 - Real.sinc (x / 2) ^ 2 ≤ x ^ 2 / 12 := by nlinarith
163 refine ⟨by nlinarith, le_min ?_ ?_⟩
164 · nlinarith [sq_nonneg (Real.sinc (x / 2))]
165 · by_cases hx : |x| ≤ 1
166 · have : x ^ 2 ≤ |x| := by
167 rw [← sq_abs]
168 nlinarith [abs_nonneg x]
169 nlinarith
170 · have : 1 ≤ |x| := by linarith
171 nlinarith [sq_nonneg (Real.sinc (x / 2))]
172
173/-- Fourier transform with kernel `e^{-itx}`. -/
174noncomputable def uhat (u : ℝ → ℂ) (t : ℝ) : ℂ :=
175 ∫ x, u x * Complex.exp (-(t * x : ℝ) * Complex.I)
176
177lemma norm_negexp (a : ℝ) : ‖Complex.exp (-(a : ℂ) * Complex.I)‖ = 1 := by
178 rw [show -(a : ℂ) * Complex.I = ((-a : ℝ) : ℂ) * Complex.I by push_cast; ring]
179 exact Complex.norm_exp_ofReal_mul_I _
180
181section
182variable {u : ℝ → ℂ}
183
184lemma uhat_cont (hu : Continuous u) (hi : Integrable u) : Continuous (uhat u) := by
185 unfold uhat
186 refine continuous_of_dominated (bound := fun x => ‖u x‖) (fun t => ?_) (fun t => ?_) hi.norm ?_
187 · exact (by fun_prop : Continuous fun x : ℝ =>
188 u x * Complex.exp (-(t * x : ℝ) * Complex.I)).aestronglyMeasurable
189 · refine Filter.Eventually.of_forall fun x => ?_
190 rw [norm_mul, norm_negexp, mul_one]
191 · exact Filter.Eventually.of_forall fun x => by fun_prop
192
193lemma uhat_bound (t : ℝ) : ‖uhat u t‖ ≤ ∫ x, ‖u x‖ := by
194 refine (norm_integral_le_integral_norm _).trans (le_of_eq (integral_congr_ae (Filter.Eventually.of_forall fun x => ?_)))
195 simp only [norm_mul, norm_negexp, mul_one]
196
197lemma conj_uhat (t : ℝ) :
198 (starRingEnd ℂ) (uhat u t) = ∫ y, (starRingEnd ℂ) (u y) * Complex.exp ((t * y : ℝ) * Complex.I) := by
199 unfold uhat
200 rw [← integral_conj]
201 congr 1; funext y
202 rw [map_mul, ← Complex.exp_conj]
203 simp
204
205
206lemma exp_mul_exp (t x y : ℝ) :
207 Complex.exp (-(t * x : ℝ) * Complex.I) * Complex.exp ((t * y : ℝ) * Complex.I) =
208 Complex.exp ((t * (y - x) : ℝ) * Complex.I) := by
209 rw [← Complex.exp_add]; congr 1; push_cast; ring
210
211lemma norm_posexp (a : ℝ) : ‖Complex.exp ((a : ℝ) * Complex.I)‖ = 1 :=
212 Complex.norm_exp_ofReal_mul_I _
213
214/-- Inner transform of `uhat` against the Fejér weight, collapsed by `T11_fejer`. -/
215lemma inner_fejer (hu : Continuous u) (hi : Integrable u) (T y : ℝ) (hT : 0 < T) :
216 ∫ t, ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * uhat u t * Complex.exp ((t * y : ℝ) * Complex.I) =
217 2 * Real.pi * ∫ x, u x * ((tri T (y - x) : ℝ) : ℂ) := by
218 have hK := integrable_sinc_sq T hT
219 have h1 : ∀ t : ℝ, ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * uhat u t *
220 Complex.exp ((t * y : ℝ) * Complex.I) =
221 ∫ x, ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * (u x * Complex.exp ((t * (y - x) : ℝ) * Complex.I)) := by
222 intro t
223 unfold uhat
224 rw [← integral_const_mul, ← integral_mul_const]
225 congr 1; funext x
226 rw [← exp_mul_exp t x y]; ring
227 simp_rw [h1]
228 have hint : Integrable (Function.uncurry fun (t : ℝ) (x : ℝ) =>
229 ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * (u x * Complex.exp ((t * (y - x) : ℝ) * Complex.I)))
230 (volume.prod volume) := by
231 refine Integrable.mono' (g := fun z : ℝ × ℝ => Real.sinc (z.1 / (2 * T)) ^ 2 * ‖u z.2‖)
232 (hK.mul_prod hi.norm) ?_ (Filter.Eventually.of_forall fun z => ?_)
233 · exact (by fun_prop : Continuous fun z : ℝ × ℝ =>
234 ((Real.sinc (z.1 / (2 * T)) ^ 2 : ℝ) : ℂ) *
235 (u z.2 * Complex.exp ((z.1 * (y - z.2) : ℝ) * Complex.I))).aestronglyMeasurable
236 · simp only [Function.uncurry, norm_mul, Complex.norm_real, norm_posexp, mul_one,
237 Real.norm_eq_abs]
238 rw [abs_of_nonneg (sq_nonneg _)]
239 rw [integral_integral_swap hint, ← integral_const_mul]
240 congr 1; funext x
241 have := T11_fejer T (y - x) hT
242 calc _ = u x * ∫ t, ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * Complex.exp ((t * (y - x) : ℝ) * Complex.I) := by
243 rw [← integral_const_mul]; congr 1; funext t; ring
244 _ = _ := by rw [this]; push_cast; ring
245
246/-- Fejér-weighted Plancherel identity, before letting `T → ∞`. -/
247lemma weighted_identity (hu : Continuous u) (hi : Integrable u) (T : ℝ) (hT : 0 < T) :
248 ∫ t, ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * (uhat u t * (starRingEnd ℂ) (uhat u t)) =
249 2 * Real.pi * ∫ y, (starRingEnd ℂ) (u y) * ∫ x, u x * ((tri T (y - x) : ℝ) : ℂ) := by
250 have hK := integrable_sinc_sq T hT
251 have hc := uhat_cont hu hi
252 set C := ∫ x, ‖u x‖
253 have h1 : ∀ t : ℝ, ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * (uhat u t * (starRingEnd ℂ) (uhat u t)) =
254 ∫ y, ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * uhat u t *
255 ((starRingEnd ℂ) (u y) * Complex.exp ((t * y : ℝ) * Complex.I)) := by
256 intro t
257 rw [integral_const_mul, ← conj_uhat]; ring
258 simp_rw [h1]
259 have hint : Integrable (Function.uncurry fun (t : ℝ) (y : ℝ) =>
260 ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * uhat u t *
261 ((starRingEnd ℂ) (u y) * Complex.exp ((t * y : ℝ) * Complex.I)))
262 (volume.prod volume) := by
263 refine Integrable.mono' (g := fun z : ℝ × ℝ => (Real.sinc (z.1 / (2 * T)) ^ 2 * C) * ‖u z.2‖)
264 ((hK.mul_const C).mul_prod hi.norm) ?_ (Filter.Eventually.of_forall fun z => ?_)
265 · exact (by fun_prop : Continuous fun z : ℝ × ℝ =>
266 ((Real.sinc (z.1 / (2 * T)) ^ 2 : ℝ) : ℂ) * uhat u z.1 *
267 ((starRingEnd ℂ) (u z.2) * Complex.exp ((z.1 * z.2 : ℝ) * Complex.I))).aestronglyMeasurable
268 · simp only [Function.uncurry, norm_mul, Complex.norm_real, norm_posexp, mul_one,
269 Real.norm_eq_abs, RCLike.norm_conj]
270 rw [abs_of_nonneg (sq_nonneg _)]
271 have := uhat_bound (u := u) z.1
272 gcongr
273 rw [integral_integral_swap hint, ← integral_const_mul]
274 congr 1; funext y
275 have := inner_fejer hu hi T y hT
276 calc _ = (starRingEnd ℂ) (u y) * ∫ t, ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) * uhat u t *
277 Complex.exp ((t * y : ℝ) * Complex.I) := by
278 rw [← integral_const_mul]; congr 1; funext t; ring
279 _ = _ := by rw [this]; ring
280
281lemma tri_nonneg (Q x : ℝ) (hQ : 0 ≤ Q) : 0 ≤ tri Q x := by
282 unfold tri; positivity
283
284lemma tri_integral (Q : ℝ) (hQ : 0 < Q) : ∫ x, tri Q x = 1 := by
285 have h := T11_fourier_tri Q 0 hQ
286 simp only [zero_mul, Complex.ofReal_zero, neg_zero, Complex.exp_zero, mul_one,
287 zero_div, Real.sinc_zero, one_pow, Complex.ofReal_one] at h
288 rw [integral_complex_ofReal] at h
289 exact_mod_cast h
290
291lemma tri_support (Q x : ℝ) (hQ : 0 < Q) (hx : tri Q x ≠ 0) : |x| < Q⁻¹ := by
292 by_contra h
293 exact hx (tri_eq_zero Q x hQ (not_lt.mp h))
294
295/-- Approximate identity: `∫ u x · tri_{n+1}(y - x) dx → u y`. -/
296lemma tri_conv_tendsto (hu : Continuous u) (y : ℝ) :
297 Tendsto (fun n : ℕ => ∫ x, u x * ((tri ((n : ℝ) + 1) (y - x) : ℝ) : ℂ)) atTop (𝓝 (u y)) := by
298 have h := convolution_tendsto_right (μ := volume) (l := atTop) (g := fun _ : ℕ => u)
299 (x₀ := y) (z₀ := u y) (φ := fun n : ℕ => tri ((n : ℝ) + 1)) (k := fun _ => y)
300 (Filter.Eventually.of_forall fun n x => tri_nonneg _ _ (by positivity))
301 (Filter.Eventually.of_forall fun n => tri_integral _ (by positivity))
302 ?_ (Filter.Eventually.of_forall fun _ => hu.aestronglyMeasurable)
303 ((hu.tendsto y).comp tendsto_snd) tendsto_const_nhds
304 · refine h.congr fun n => ?_
305 simp only [convolution_def, ContinuousLinearMap.lsmul_apply]
306 rw [← integral_sub_left_eq_self (fun t => tri ((n : ℝ) + 1) t • u (y - t)) volume y]
307 congr 1; funext x
308 simp only [sub_sub_cancel, Complex.real_smul]
309 ring
310 · rw [tendsto_smallSets_iff]
311 intro t ht
312 obtain ⟨ε, hε, hεt⟩ := Metric.mem_nhds_iff.mp ht
313 obtain ⟨N, hN⟩ := exists_nat_gt ε⁻¹
314 filter_upwards [eventually_ge_atTop N] with n hn x hx
315 apply hεt
316 rw [Metric.mem_ball, dist_zero_right, Real.norm_eq_abs]
317 have h1 := tri_support _ x (by positivity) hx
318 refine h1.trans ?_
319 rw [inv_lt_comm₀ (by positivity) hε]
320 have : (N : ℝ) ≤ n := by exact_mod_cast hn
321 have := inv_lt_of_inv_lt₀ (by positivity) hN
322 linarith
323
324lemma tri_integrable (Q : ℝ) (hQ : 0 < Q) : Integrable (tri Q) := by
325 refine Continuous.integrable_of_hasCompactSupport (tri_continuous Q)
326 (HasCompactSupport.intro (isCompact_Icc (a := -Q⁻¹) (b := Q⁻¹)) fun x hx => ?_)
327 exact tri_eq_zero Q x hQ (by
328 by_contra h
329 exact hx (Set.mem_Icc.mpr ⟨(abs_lt.mp (not_le.mp h)).1.le, (abs_lt.mp (not_le.mp h)).2.le⟩))
330
331/-- The autocorrelation side converges to `∫ ‖u‖²`. -/
332lemma rhs_tendsto (hu : Continuous u) (hs : HasCompactSupport u) :
333 Tendsto (fun n : ℕ => ∫ y, (starRingEnd ℂ) (u y) * ∫ x, u x * ((tri ((n : ℝ) + 1) (y - x) : ℝ) : ℂ))
334 atTop (𝓝 (((∫ x, ‖u x‖ ^ 2 : ℝ)) : ℂ)) := by
335 obtain ⟨M, hM⟩ := hu.bounded_above_of_compact_support hs
336 have hi : Integrable u := hu.integrable_of_hasCompactSupport hs
337 rw [← integral_complex_ofReal]
338 refine tendsto_integral_of_dominated_convergence (fun y => ‖u y‖ * M) ?_ (hi.norm.mul_const M) ?_ ?_
339 · intro n
340 have hc : Continuous fun p : ℝ × ℝ => u p.2 * ((tri ((n : ℝ) + 1) (p.1 - p.2) : ℝ) : ℂ) := by
341 have := tri_continuous ((n : ℝ) + 1)
342 fun_prop
343 exact (Complex.continuous_conj.comp hu).aestronglyMeasurable.mul hc.aestronglyMeasurable.integral_prod_right'
344 · intro n
345 refine Filter.Eventually.of_forall fun y => ?_
346 rw [norm_mul, RCLike.norm_conj]
347 gcongr
348 have hQ : (0 : ℝ) < (n : ℝ) + 1 := by positivity
349 have hI := tri_integrable _ hQ
350 calc ‖∫ x, u x * ((tri ((n : ℝ) + 1) (y - x) : ℝ) : ℂ)‖
351 ≤ ∫ x, M * tri ((n : ℝ) + 1) (y - x) := by
352 refine norm_integral_le_of_norm_le ((hI.comp_sub_left y).const_mul M)
353 (Filter.Eventually.of_forall fun x => ?_)
354 rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (tri_nonneg _ _ hQ.le)]
355 exact mul_le_mul_of_nonneg_right (hM x) (tri_nonneg _ _ hQ.le)
356 _ = M := by
357 rw [integral_const_mul, integral_sub_left_eq_self (tri ((n : ℝ) + 1)) volume y,
358 tri_integral _ hQ, mul_one]
359 · refine Filter.Eventually.of_forall fun y => ?_
360 have := (tri_conv_tendsto hu y).const_mul ((starRingEnd ℂ) (u y))
361 convert this using 2
362 rw [Complex.conj_mul', Complex.ofReal_pow]
363
364lemma sinc_weight_tendsto (t : ℝ) :
365 Tendsto (fun n : ℕ => Real.sinc (t / (2 * ((n : ℝ) + 1))) ^ 2) atTop (𝓝 1) := by
366 have h0 : Tendsto (fun n : ℕ => t / (2 * ((n : ℝ) + 1))) atTop (𝓝 0) := by
367 refine tendsto_const_nhds.div_atTop ?_
368 apply Filter.Tendsto.const_mul_atTop (by norm_num)
369 exact tendsto_atTop_add_const_right _ _ tendsto_natCast_atTop_atTop
370 have := ((Real.continuous_sinc.tendsto 0).comp h0).pow 2
371 simpa using this
372
373lemma sinc_sq_le_one (y : ℝ) : Real.sinc y ^ 2 ≤ 1 := by
374 have h1 := Real.sinc_le_one y
375 have h2 := Real.neg_one_le_sinc y
376 nlinarith
377
378/-- **T11**, Plancherel for continuous compactly supported functions (via Fejér weights). -/
379theorem plancherel_core (u : ℝ → ℂ) (hu : Continuous u) (hs : HasCompactSupport u) :
380 ∫ t, ‖uhat u t‖ ^ 2 = 2 * Real.pi * ∫ x, ‖u x‖ ^ 2 := by
381 have hi : Integrable u := hu.integrable_of_hasCompactSupport hs
382 have hc := uhat_cont hu hi
383 set f : ℝ → ℝ := fun t => ‖uhat u t‖ ^ 2 with hf
384 have hfc : Continuous f := by simp only [hf]; fun_prop
385 have hf0 : ∀ t, 0 ≤ f t := fun t => by positivity
386 set K : ℕ → ℝ → ℝ := fun n t => Real.sinc (t / (2 * ((n : ℝ) + 1))) ^ 2 with hK
387 have hKc : ∀ n, Continuous (K n) := fun n => by simp only [hK]; fun_prop
388 have hK1 : ∀ n t, K n t ≤ 1 := fun n t => sinc_sq_le_one _
389 have hK0 : ∀ n t, 0 ≤ K n t := fun n t => sq_nonneg _
390 have hKint : ∀ n, Integrable (fun t => K n t * f t) := by
391 intro n
392 have hQ : (0 : ℝ) < (n : ℝ) + 1 := by positivity
393 have hKi := integrable_sinc_sq _ hQ
394 have hb := uhat_bound (u := u)
395 refine Integrable.mono' (g := fun t => K n t * (∫ x, ‖u x‖) ^ 2) (hKi.mul_const _)
396 ((hKc n).mul hfc).aestronglyMeasurable (Filter.Eventually.of_forall fun t => ?_)
397 rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (hK0 n t) (hf0 t))]
398 refine mul_le_mul_of_nonneg_left ?_ (hK0 n t)
399 simp only [hf]
400 exact pow_le_pow_left₀ (norm_nonneg _) (hb t) 2
401 -- the weighted integrals converge to `2π ∫ ‖u‖²`
402 have hL : Tendsto (fun n : ℕ => ∫ t, K n t * f t) atTop (𝓝 (2 * Real.pi * ∫ x, ‖u x‖ ^ 2)) := by
403 have h := (rhs_tendsto hu hs).const_mul (2 * (Real.pi : ℂ))
404 have h2 := (Complex.continuous_re.tendsto _).comp h
405 simp only [Function.comp_def] at h2
406 rw [show (2 * (Real.pi : ℂ) * ((∫ x, ‖u x‖ ^ 2 : ℝ) : ℂ)) = ((2 * Real.pi * ∫ x, ‖u x‖ ^ 2 : ℝ) : ℂ) by
407 push_cast; ring, Complex.ofReal_re] at h2
408 refine h2.congr fun n => ?_
409 have hQ : (0 : ℝ) < (n : ℝ) + 1 := by positivity
410 have := weighted_identity hu hi _ hQ
411 have e : ∀ t, ((Real.sinc (t / (2 * ((n : ℝ) + 1))) ^ 2 : ℝ) : ℂ) * (uhat u t * (starRingEnd ℂ) (uhat u t))
412 = ((K n t * f t : ℝ) : ℂ) := by
413 intro t; rw [Complex.mul_conj']; simp [hK, hf]
414 simp_rw [e, integral_complex_ofReal] at this
415 rw [← this]
416 simp
417 -- Fatou
418 have hfin : Integrable f := by
419 refine ⟨hfc.aestronglyMeasurable, ?_⟩
420 rw [hasFiniteIntegral_iff_ofReal (Filter.Eventually.of_forall hf0)]
421 have hfat := lintegral_liminf_le (μ := volume) (u := atTop)
422 (f := fun n t => ENNReal.ofReal (K n t * f t))
423 (fun n => ((hKc n).mul hfc).measurable.ennreal_ofReal)
424 have e1 : ∀ t, liminf (fun n => ENNReal.ofReal (K n t * f t)) atTop = ENNReal.ofReal (f t) := by
425 intro t
426 refine Tendsto.liminf_eq ?_
427 refine ENNReal.tendsto_ofReal ?_
428 simpa using (sinc_weight_tendsto t).mul_const (f t)
429 have e2 : ∀ n, ∫⁻ t, ENNReal.ofReal (K n t * f t) = ENNReal.ofReal (∫ t, K n t * f t) := fun n =>
430 (ofReal_integral_eq_lintegral_ofReal (hKint n)
431 (Filter.Eventually.of_forall fun t => mul_nonneg (hK0 n t) (hf0 t))).symm
432 simp_rw [e1, e2] at hfat
433 have e3 : liminf (fun n : ℕ => ENNReal.ofReal (∫ t, K n t * f t)) atTop =
434 ENNReal.ofReal (2 * Real.pi * ∫ x, ‖u x‖ ^ 2) :=
435 Tendsto.liminf_eq (ENNReal.tendsto_ofReal hL)
436 rw [e3] at hfat
437 exact lt_of_le_of_lt hfat ENNReal.ofReal_lt_top
438 have hD := tendsto_integral_of_dominated_convergence (μ := volume) f
439 (fun n => ((hKc n).mul hfc).aestronglyMeasurable) hfin
440 (fun n => Filter.Eventually.of_forall fun t => by
441 show ‖K n t * f t‖ ≤ f t
442 rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (hK0 n t) (hf0 t))]
443 exact mul_le_of_le_one_left (hf0 t) (hK1 n t))
444 (Filter.Eventually.of_forall fun t => by
445 simpa using (sinc_weight_tendsto t).mul_const (f t))
446 exact tendsto_nhds_unique hD hL
447
448end
449
450/-- **T11**, Plancherel for continuous compactly supported functions, kernel `e^{-itx}`. -/
451theorem T11_plancherel (u : ℝ → ℂ) (hu : Continuous u) (hs : HasCompactSupport u) :
452 ∫ t, ‖∫ x, u x * Complex.exp (-(t * x : ℝ) * Complex.I)‖ ^ 2 =
453 2 * Real.pi * ∫ x, ‖u x‖ ^ 2 :=
454 plancherel_core u hu hs
455
456end E424
457