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/T6.lean

All files · 189 lines · source at the verified commit

1module
2
3public import E424.Tools.T6Aux
4
5@[expose] public section
6
7/-!
8# Erdős 424: tool T6. Absolute existential constants; Mathlib only.
9
10Gallagher's lemma with `C = 4π`. Proof: `sinc²(t/(2T)) ≥ 1/2` on `[-T, T]`, so
11`∫_{-T}^T |F|² ≤ 2 ∫ sinc² |F|²`. Expanding `|F|²` gives a double sum, and Fejér's identity (T11)
12turns each `∫ sinc² e^{it(log n - log m)}` into `2π tri T (log n - log m)`, which is `2π T²` times a
13`1/y` integral over the log-scale window (`pair_kernel`). Summing over the pairs gives `|S(y)|²`.
14-/
15
16set_option linter.style.header false
17open Finset MeasureTheory Set
18
19namespace E424
20
21/-- `‖z‖² = z · conj z` as a complex number. -/
22lemma ofReal_norm_sq_eq_mul_star (z : ℂ) : ((‖z‖ ^ 2 : ℝ) : ℂ) = z * star z := by
23 rw [Complex.star_def, ← Complex.normSq_eq_norm_sq, Complex.mul_conj]
24
25/-- Expansion of `|Σ a_n n^{-it}|²` as a double sum over pairs. -/
26lemma norm_sq_expand (s : Finset ℕ) (a : ℕ → ℂ) (t : ℝ) :
27 ((‖∑ n ∈ s, a n * nit n t‖ ^ 2 : ℝ) : ℂ) = ∑ m ∈ s, ∑ n ∈ s,
28 a m * star (a n) * Complex.exp (((t * (Real.log n - Real.log m) : ℝ) : ℂ) * Complex.I) := by
29 have hnit : ∀ m n : ℕ, nit m t * star (nit n t) =
30 Complex.exp (((t * (Real.log n - Real.log m) : ℝ) : ℂ) * Complex.I) := by
31 intro m n
32 unfold nit
33 rw [Complex.star_def, ← Complex.exp_conj, ← Complex.exp_add]
34 congr 1
35 simp only [map_neg, map_mul, Complex.conj_I, Complex.conj_ofReal]
36 push_cast
37 ring
38 rw [ofReal_norm_sq_eq_mul_star, Complex.star_def, map_sum]
39 simp only [map_mul, Finset.sum_mul_sum]
40 refine Finset.sum_congr rfl fun m _ => Finset.sum_congr rfl fun n _ => ?_
41 rw [← hnit m n]
42 simp only [Complex.star_def] at *
43 ring
44
45/-- Fourier side: `∫ sinc² |F|²` equals `2π` times the sum of triangle kernels. -/
46lemma fourier_side (T : ℝ) (hT : 0 < T) (s : Finset ℕ) (a : ℕ → ℂ) :
47 ((∫ t, Real.sinc (t / (2 * T)) ^ 2 * ‖∑ n ∈ s, a n * nit n t‖ ^ 2 : ℝ) : ℂ) =
48 ∑ m ∈ s, ∑ n ∈ s, a m * star (a n) *
49 ((2 * Real.pi * tri T (Real.log n - Real.log m) : ℝ) : ℂ) := by
50 have hpt : ∀ t : ℝ, ((Real.sinc (t / (2 * T)) ^ 2 * ‖∑ n ∈ s, a n * nit n t‖ ^ 2 : ℝ) : ℂ) =
51 ∑ m ∈ s, ∑ n ∈ s, (a m * star (a n)) *
52 (((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) *
53 Complex.exp (((t * (Real.log n - Real.log m) : ℝ) : ℂ) * Complex.I)) := by
54 intro t
55 rw [Complex.ofReal_mul, norm_sq_expand, Finset.mul_sum]
56 refine Finset.sum_congr rfl fun m _ => ?_
57 rw [Finset.mul_sum]
58 refine Finset.sum_congr rfl fun n _ => ?_
59 ring
60 rw [← integral_complex_ofReal, funext hpt]
61 rw [integral_finsetSum s fun m _ =>
62 integrable_finsetSum s fun n _ => (sinc_sq_mul_exp_integrable T _ hT).const_mul _]
63 refine Finset.sum_congr rfl fun m _ => ?_
64 rw [integral_finsetSum s fun n _ => (sinc_sq_mul_exp_integrable T _ hT).const_mul _]
65 refine Finset.sum_congr rfl fun n _ => ?_
66 rw [integral_const_mul, T11_fejer T _ hT]
67
68/-- Sum side: the pair kernels against `a_m conj a_n` give `∫ |S(y)|² / y`. -/
69lemma y_side (T : ℝ) (s : Finset ℕ) (a : ℕ → ℂ) (hs : ∀ n ∈ s, 1 ≤ n) :
70 ∑ m ∈ s, ∑ n ∈ s, a m * star (a n) *
71 ((∫ y in Ioi (0 : ℝ), (if (y < m ∧ m ≤ Real.exp (1 / T) * y) ∧
72 (y < n ∧ n ≤ Real.exp (1 / T) * y) then y⁻¹ else 0) : ℝ) : ℂ)
73 = ((∫ y in Ioi (0 : ℝ),
74 ‖∑ n ∈ s.filter (fun n : ℕ => y < (n : ℝ) ∧ (n : ℝ) ≤ Real.exp (1 / T) * y), a n‖ ^ 2 / y
75 : ℝ) : ℂ) := by
76 have hpos : ∀ n ∈ s, (0 : ℝ) < n := fun n hn => by
77 have := hs n hn
78 exact_mod_cast (show 0 < n from by omega)
79 have hint : ∀ m ∈ s, ∀ n ∈ s,
80 a m * star (a n) * ((∫ y in Ioi (0 : ℝ), (if (y < m ∧ m ≤ Real.exp (1 / T) * y) ∧
81 (y < n ∧ n ≤ Real.exp (1 / T) * y) then y⁻¹ else 0) : ℝ) : ℂ) =
82 ∫ y in Ioi (0 : ℝ), a m * star (a n) * (((if (y < m ∧ m ≤ Real.exp (1 / T) * y) ∧
83 (y < n ∧ n ≤ Real.exp (1 / T) * y) then y⁻¹ else 0) : ℝ) : ℂ) := by
84 intro m hm n hn
85 rw [← integral_complex_ofReal, integral_const_mul]
86 have hI : ∀ m ∈ s, ∀ n ∈ s, IntegrableOn (fun y : ℝ => a m * star (a n) *
87 (((if (y < m ∧ m ≤ Real.exp (1 / T) * y) ∧ (y < n ∧ n ≤ Real.exp (1 / T) * y)
88 then y⁻¹ else 0) : ℝ) : ℂ)) (Ioi (0 : ℝ)) := fun m hm n hn =>
89 (Integrable.ofReal (pair_kernel_integrableOn T m n (hpos m hm))).const_mul _
90 rw [Finset.sum_congr rfl fun m hm => Finset.sum_congr rfl fun n hn => hint m hm n hn]
91 have hsum : ∑ m ∈ s, ∑ n ∈ s, ∫ y in Ioi (0 : ℝ), a m * star (a n) *
92 (((if (y < m ∧ m ≤ Real.exp (1 / T) * y) ∧ (y < n ∧ n ≤ Real.exp (1 / T) * y)
93 then y⁻¹ else 0) : ℝ) : ℂ)
94 = ∫ y in Ioi (0 : ℝ), ∑ m ∈ s, ∑ n ∈ s, a m * star (a n) *
95 (((if (y < m ∧ m ≤ Real.exp (1 / T) * y) ∧ (y < n ∧ n ≤ Real.exp (1 / T) * y)
96 then y⁻¹ else 0) : ℝ) : ℂ) := by
97 rw [integral_finsetSum s fun m hm => integrable_finsetSum s fun n hn => hI m hm n hn]
98 exact Finset.sum_congr rfl fun m hm => (integral_finsetSum s fun n hn => hI m hm n hn).symm
99 rw [hsum, ← integral_complex_ofReal]
100 refine setIntegral_congr_fun measurableSet_Ioi fun y hy => ?_
101 have hy' : (0 : ℝ) < y := hy
102 rw [Finset.sum_filter, Complex.ofReal_div, ofReal_norm_sq_eq_mul_star, div_eq_mul_inv _ (y : ℂ)]
103 have hstar : star (∑ n ∈ s, if (y < n ∧ (n : ℝ) ≤ Real.exp (1 / T) * y) then a n else 0) =
104 ∑ n ∈ s, if (y < n ∧ (n : ℝ) ≤ Real.exp (1 / T) * y) then star (a n) else 0 := by
105 rw [Complex.star_def, map_sum]
106 refine Finset.sum_congr rfl fun n _ => ?_
107 split_ifs <;> simp
108 rw [hstar, Finset.sum_mul_sum]
109 simp only [Finset.sum_mul]
110 refine Finset.sum_congr rfl fun m _ => Finset.sum_congr rfl fun n _ => ?_
111 by_cases h1 : y < m ∧ (m : ℝ) ≤ Real.exp (1 / T) * y <;>
112 by_cases h2 : y < n ∧ (n : ℝ) ≤ Real.exp (1 / T) * y
113 · rw [if_pos (And.intro h1 h2), if_pos h1, if_pos h2, Complex.ofReal_inv]
114 · rw [if_neg (fun h => h2 h.2), if_pos h1, if_neg h2]; simp
115 · rw [if_neg (fun h => h1 h.1), if_neg h1, if_pos h2]; simp
116 · rw [if_neg (fun h => h1 h.1), if_neg h1, if_neg h2]; simp
117
118/-- `‖nit n t‖ = 1`. -/
119lemma norm_nit (n : ℕ) (t : ℝ) : ‖nit n t‖ = 1 := by
120 unfold nit
121 rw [show -((t * Real.log n : ℝ) : ℂ) * Complex.I = ((-(t * Real.log n) : ℝ) : ℂ) * Complex.I by
122 push_cast; ring]
123 exact Complex.norm_exp_ofReal_mul_I _
124
125open Classical in
126/-- **T6**, Gallagher's lemma. -/
127theorem T6_gallagher : ∃ C > 0, ∀ (T : ℝ), 0 < T → ∀ (s : Finset ℕ) (a : ℕ → ℂ),
128 (∀ n ∈ s, 1 ≤ n) →
129 ∫ t in (-T)..T, ‖∑ n ∈ s, a n * nit n t‖ ^ 2 ≤
130 C * T ^ 2 * ∫ y in Set.Ioi (0 : ℝ),
131 ‖∑ n ∈ s.filter (fun n : ℕ => y < (n : ℝ) ∧ (n : ℝ) ≤ Real.exp (1 / T) * y), a n‖ ^ 2 / y := by
132 refine ⟨4 * Real.pi, by positivity, fun T hT s a hs => ?_⟩
133 set F : ℝ → ℂ := fun t => ∑ n ∈ s, a n * nit n t with hF
134 -- `|F|²` is bounded and continuous, so `sinc² |F|²` is integrable
135 have hbound : ∀ t : ℝ, ‖F t‖ ^ 2 ≤ (∑ n ∈ s, ‖a n‖) ^ 2 := by
136 intro t
137 have h1 : ‖F t‖ ≤ ∑ n ∈ s, ‖a n‖ := by
138 refine (norm_sum_le _ _).trans (le_of_eq (Finset.sum_congr rfl fun n _ => ?_))
139 rw [norm_mul, norm_nit, mul_one]
140 exact pow_le_pow_left₀ (norm_nonneg _) h1 2
141 have hcont : Continuous F := by
142 simp only [hF]
143 unfold nit
144 fun_prop
145 have hint : Integrable (fun t : ℝ => Real.sinc (t / (2 * T)) ^ 2 * ‖F t‖ ^ 2) := by
146 refine (sinc_sq_integrable T hT).mul_bdd (c := (∑ n ∈ s, ‖a n‖) ^ 2) ?_ ?_
147 · exact (hcont.norm.pow 2).aestronglyMeasurable
148 · refine Filter.Eventually.of_forall fun t => ?_
149 rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)]
150 exact hbound t
151 -- Step 1: on `[-T, T]`, `sinc² ≥ 1/2`, so the interval integral is at most twice the weighted one
152 have hA : ∫ t in (-T)..T, ‖F t‖ ^ 2 ≤ 2 * ∫ t, Real.sinc (t / (2 * T)) ^ 2 * ‖F t‖ ^ 2 := by
153 rw [intervalIntegral.integral_of_le (by linarith : -T ≤ T)]
154 calc ∫ t in Ioc (-T) T, ‖F t‖ ^ 2
155 ≤ ∫ t in Ioc (-T) T, 2 * (Real.sinc (t / (2 * T)) ^ 2 * ‖F t‖ ^ 2) := by
156 refine setIntegral_mono_on ((hcont.norm.pow 2).integrableOn_Icc.mono_set Set.Ioc_subset_Icc_self)
157 (hint.const_mul 2).integrableOn measurableSet_Ioc
158 fun t ht => ?_
159 have hsq := half_le_sinc_sq T t hT (abs_le.mpr ⟨by linarith [ht.1], ht.2⟩)
160 nlinarith [mul_nonneg (sub_nonneg.mpr hsq) (sq_nonneg ‖F t‖)]
161 _ ≤ ∫ t, 2 * (Real.sinc (t / (2 * T)) ^ 2 * ‖F t‖ ^ 2) :=
162 setIntegral_le_integral (hint.const_mul 2)
163 (Filter.Eventually.of_forall fun t => by positivity)
164 _ = 2 * ∫ t, Real.sinc (t / (2 * T)) ^ 2 * ‖F t‖ ^ 2 := integral_const_mul _ _
165 -- Step 2: the weighted integral is `2π T²` times the `1/y` integral, by Fejér and the kernel identity
166 have hF2 : ((∫ t, Real.sinc (t / (2 * T)) ^ 2 * ‖F t‖ ^ 2 : ℝ) : ℂ) =
167 (2 * Real.pi * T ^ 2 : ℂ) * ∑ m ∈ s, ∑ n ∈ s, a m * star (a n) *
168 ((∫ y in Ioi (0 : ℝ), (if (y < m ∧ m ≤ Real.exp (1 / T) * y) ∧
169 (y < n ∧ n ≤ Real.exp (1 / T) * y) then y⁻¹ else 0) : ℝ) : ℂ) := by
170 have hpos : ∀ n ∈ s, (0 : ℝ) < n := fun n hn => by
171 have := hs n hn
172 exact_mod_cast (show 0 < n from by omega)
173 rw [fourier_side T hT s a, Finset.mul_sum]
174 refine Finset.sum_congr rfl fun m hm => ?_
175 rw [Finset.mul_sum]
176 refine Finset.sum_congr rfl fun n hn => ?_
177 rw [← pair_kernel T m n hT (hpos m hm) (hpos n hn)]
178 push_cast
179 ring
180 rw [y_side T s a hs] at hF2
181 have hI : ∫ t, Real.sinc (t / (2 * T)) ^ 2 * ‖F t‖ ^ 2 = 2 * Real.pi * T ^ 2 *
182 ∫ y in Ioi (0 : ℝ), ‖∑ n ∈ s.filter (fun n : ℕ => y < (n : ℝ) ∧ (n : ℝ) ≤ Real.exp (1 / T) * y), a n‖ ^ 2 / y := by
183 exact_mod_cast hF2
184 rw [hI] at hA
185 show ∫ t in (-T)..T, ‖F t‖ ^ 2 ≤ _
186 linarith
187
188end E424
189