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

All files · 188 lines · source at the verified commit

1module
2
3public import E424.Tools.T11
4
5@[expose] public section
6
7/-!
8# Erdős 424: helpers for T6 (Gallagher). Mathlib only.
9
10Sinc bounds, integrability of `sinc²`, and the log-scale kernel: the triangle `tri T (log n - log m)`
11is `T²` times the integral over `y > 0` of `1/y` on the set where both `m` and `n` lie in `(y, e^{1/T} y]`.
12-/
13
14set_option linter.style.header false
15open Finset MeasureTheory Set
16
17namespace E424
18
19/-- `sinc² y ≤ 2/(1+y²)`, so `sinc²` is integrable. -/
20lemma sinc_sq_le_inv (y : ℝ) : Real.sinc y ^ 2 ≤ 2 * (1 + y ^ 2)⁻¹ := by
21 by_cases hy : |y| ≤ 1
22 · have h1 : Real.sinc y ^ 2 ≤ 1 := by
23 have := Real.abs_sinc_le_one y
24 nlinarith [abs_nonneg (Real.sinc y), sq_abs (Real.sinc y)]
25 have hy2 : y ^ 2 ≤ 1 := by nlinarith [sq_abs y, abs_nonneg y]
26 have h2 : 1 ≤ 2 * (1 + y ^ 2)⁻¹ := by
27 rw [← div_eq_mul_inv, le_div_iff₀ (by positivity)]
28 linarith
29 linarith
30 · have hy0 : y ≠ 0 := by rintro rfl; simp at hy
31 have hy2 : 1 < y ^ 2 := by nlinarith [sq_abs y, abs_nonneg y]
32 rw [Real.sinc_of_ne_zero hy0, div_pow]
33 calc Real.sin y ^ 2 / y ^ 2 ≤ 1 / y ^ 2 :=
34 div_le_div_of_nonneg_right (Real.sin_sq_le_one y) (by positivity)
35 _ ≤ 2 * (1 + y ^ 2)⁻¹ := by
36 rw [div_le_iff₀ (by positivity)]
37 rw [← div_eq_mul_inv, div_mul_eq_mul_div, le_div_iff₀ (by positivity)]
38 nlinarith
39
40/-- `t ↦ sinc²(t/(2T))` is integrable on `ℝ`. -/
41lemma sinc_sq_integrable (T : ℝ) (hT : 0 < T) :
42 Integrable (fun t : ℝ => Real.sinc (t / (2 * T)) ^ 2) := by
43 have hint := (integrable_inv_one_add_sq.comp_mul_left' (R := 1 / (2 * T)) (by positivity)).const_mul 2
44 refine Integrable.mono' (g := fun t : ℝ => 2 * (1 + (1 / (2 * T) * t) ^ 2)⁻¹) hint
45 (by fun_prop : Continuous fun t : ℝ => Real.sinc (t / (2 * T)) ^ 2).aestronglyMeasurable ?_
46 refine Filter.Eventually.of_forall fun t => ?_
47 rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)]
48 have := sinc_sq_le_inv (t / (2 * T))
49 rw [show 1 / (2 * T) * t = t / (2 * T) by ring]
50 exact this
51
52/-- On `|t| ≤ T`, `sinc²(t/(2T)) ≥ 1/2`. -/
53lemma half_le_sinc_sq (T t : ℝ) (hT : 0 < T) (ht : |t| ≤ T) :
54 1 / 2 ≤ Real.sinc (t / (2 * T)) ^ 2 := by
55 -- `y = t/(2T)` lies in `[-1/2, 1/2]` and `sinc y ≥ 1 - y²/6 ≥ 23/24` there
56 set y := t / (2 * T) with hy
57 have hy' : |y| ≤ 1 / 2 := by
58 rw [hy, abs_div, abs_of_pos (by positivity : (0:ℝ) < 2 * T), div_le_iff₀ (by positivity)]
59 linarith
60 -- for `0 < z ≤ 1/2`: `sin z / z ≥ 1 - z²/6 ≥ 23/24`
61 have pos : ∀ z : ℝ, 0 < z → z ≤ 1 / 2 → 23 / 24 ≤ Real.sin z / z := by
62 intro z hz hz2
63 rw [le_div_iff₀ hz]
64 have := Real.sin_gt_sub_cube hz
65 have h2 : z ^ 2 ≤ 1 / 4 := by nlinarith
66 have h3 : z ^ 3 ≤ z / 4 := by nlinarith
67 nlinarith
68 have hs : 23 / 24 ≤ Real.sinc y := by
69 by_cases h0 : y = 0
70 · rw [h0]; norm_num
71 rw [Real.sinc_of_ne_zero h0]
72 rcases lt_or_gt_of_ne h0 with hneg | hpos
73 · have hyb : -y ≤ 1 / 2 := by rw [abs_of_neg hneg] at hy'; linarith
74 rw [show Real.sin y / y = Real.sin (-y) / (-y) by rw [Real.sin_neg, neg_div_neg_eq]]
75 exact pos (-y) (by linarith) hyb
76 · have hyb : y ≤ 1 / 2 := by rw [abs_of_pos hpos] at hy'; linarith
77 exact pos y hpos hyb
78 have h23 : (23 / 24 : ℝ) ^ 2 ≥ 1 / 2 := by norm_num
79 nlinarith [sq_nonneg (Real.sinc y)]
80
81/-- `∫_{y>0} 1[A ≤ y < B] / y = max 0 (log B - log A)` for `0 < A`, `0 < B`. -/
82lemma kernel_integral (A B : ℝ) (hA : 0 < A) (hB : 0 < B) :
83 ∫ y in Ioi (0 : ℝ), (if A ≤ y ∧ y < B then y⁻¹ else 0) = max 0 (Real.log B - Real.log A) := by
84 have hind : (fun y : ℝ => if A ≤ y ∧ y < B then y⁻¹ else 0) =
85 (Ico A B).indicator (fun y => y⁻¹) := by
86 funext y; simp only [Set.indicator_apply, Set.mem_Ico]
87 rw [hind, setIntegral_indicator measurableSet_Ico]
88 rcases lt_or_ge A B with hAB | hAB
89 · rw [show Ioi (0:ℝ) ∩ Ico A B = Ico A B from
90 Set.Subset.antisymm Set.inter_subset_right (fun y hy => ⟨lt_of_lt_of_le hA hy.1, hy⟩)]
91 rw [integral_Ico_eq_integral_Ioo, ← integral_Ioc_eq_integral_Ioo,
92 ← intervalIntegral.integral_of_le hAB.le, integral_inv_of_pos hA hB,
93 Real.log_div hB.ne' hA.ne', max_eq_right]
94 linarith [Real.log_lt_log hA hAB]
95 · rw [Set.Ico_eq_empty (not_lt.mpr hAB), Set.inter_empty, setIntegral_empty,
96 max_eq_left (by linarith [Real.log_le_log hB hAB])]
97
98lemma exp_mul_le_iff (L m y : ℝ) : m ≤ Real.exp L * y ↔ Real.exp (-L) * m ≤ y := by
99 constructor
100 · intro h
101 calc Real.exp (-L) * m ≤ Real.exp (-L) * (Real.exp L * y) :=
102 mul_le_mul_of_nonneg_left h (Real.exp_pos (-L)).le
103 _ = y := by rw [← mul_assoc, ← Real.exp_add]; simp
104 · intro h
105 calc m = Real.exp L * (Real.exp (-L) * m) := by rw [← mul_assoc, ← Real.exp_add]; simp
106 _ ≤ Real.exp L * y := mul_le_mul_of_nonneg_left h (Real.exp_pos L).le
107
108/-- The `log`-length of the set of `y` with `m, n ∈ (y, e^{1/T} y]`: `1/T - |log n - log m|`. -/
109lemma log_gap (T m n : ℝ) (hm : 0 < m) (hn : 0 < n) :
110 Real.log (min m n) - Real.log (Real.exp (-(1 / T)) * max m n) =
111 1 / T - |Real.log n - Real.log m| := by
112 rw [Real.log_mul (Real.exp_pos _).ne' (lt_max_of_lt_left hm).ne', Real.log_exp]
113 rcases le_total m n with h | h
114 · rw [min_eq_left h, max_eq_right h, abs_of_nonneg (sub_nonneg.mpr (Real.log_le_log hm h))]
115 ring
116 · rw [min_eq_right h, max_eq_left h, abs_sub_comm,
117 abs_of_nonneg (sub_nonneg.mpr (Real.log_le_log hn h))]
118 ring
119
120/-- The pair condition `m, n ∈ (y, e^{1/T} y]` is the window `e^{-1/T} max(m,n) ≤ y < min(m,n)`. -/
121lemma pair_cond_iff (T m n : ℝ) (y : ℝ) :
122 ((y < m ∧ m ≤ Real.exp (1 / T) * y) ∧ (y < n ∧ n ≤ Real.exp (1 / T) * y)) ↔
123 (Real.exp (-(1 / T)) * max m n ≤ y ∧ y < min m n) := by
124 rw [exp_mul_le_iff, exp_mul_le_iff]
125 rcases le_total m n with h | h
126 · rw [max_eq_right h, min_eq_left h]
127 constructor
128 · rintro ⟨⟨h1, _⟩, ⟨_, h4⟩⟩; exact ⟨h4, h1⟩
129 · rintro ⟨h1, h2⟩
130 exact ⟨⟨h2, le_trans (mul_le_mul_of_nonneg_left h (Real.exp_pos _).le) h1⟩,
131 ⟨by linarith, h1⟩⟩
132 · rw [max_eq_left h, min_eq_right h]
133 constructor
134 · rintro ⟨⟨_, h3⟩, ⟨h2, _⟩⟩; exact ⟨h3, h2⟩
135 · rintro ⟨h1, h2⟩
136 exact ⟨⟨by linarith, h1⟩,
137 ⟨h2, le_trans (mul_le_mul_of_nonneg_left h (Real.exp_pos _).le) h1⟩⟩
138
139/-- The triangle kernel as a `1/y` integral over the log-scale window. -/
140lemma pair_kernel (T m n : ℝ) (hT : 0 < T) (hm : 0 < m) (hn : 0 < n) :
141 T ^ 2 * ∫ y in Ioi (0 : ℝ),
142 (if (y < m ∧ m ≤ Real.exp (1 / T) * y) ∧ (y < n ∧ n ≤ Real.exp (1 / T) * y)
143 then y⁻¹ else 0)
144 = tri T (Real.log n - Real.log m) := by
145 simp only [pair_cond_iff T m n]
146 have hA : 0 < Real.exp (-(1 / T)) * max m n := mul_pos (Real.exp_pos _) (lt_max_of_lt_left hm)
147 have hB : 0 < min m n := lt_min hm hn
148 rw [kernel_integral _ _ hA hB, log_gap T m n hm hn]
149 unfold tri
150 rw [show ∀ x : ℝ, T ^ 2 * max 0 (1 / T - x) = T * max 0 (1 - T * x) from fun x => by
151 rw [mul_max_of_nonneg _ _ (sq_nonneg T), mul_max_of_nonneg _ _ hT.le]
152 congr 1
153 · ring
154 · field_simp]
155
156/-- The kernel `1[A ≤ y < B] / y` is integrable on `(0, ∞)` when `0 < A`. -/
157lemma kernel_integrableOn (A B : ℝ) (hA : 0 < A) :
158 IntegrableOn (fun y : ℝ => if A ≤ y ∧ y < B then y⁻¹ else 0) (Ioi (0 : ℝ)) := by
159 have hind : (fun y : ℝ => if A ≤ y ∧ y < B then y⁻¹ else 0) =
160 (Ico A B).indicator (fun y => y⁻¹) := by
161 funext y; simp only [Set.indicator_apply, Set.mem_Ico]
162 rw [hind]
163 refine ((integrable_indicator_iff measurableSet_Ico).mpr ?_).integrableOn
164 refine IntegrableOn.mono_set ?_ Set.Ico_subset_Icc_self
165 refine ContinuousOn.integrableOn_Icc (ContinuousOn.inv₀ continuousOn_id fun y hy => ?_)
166 exact (lt_of_lt_of_le hA hy.1).ne'
167
168/-- `t ↦ sinc²(t/(2T)) · exp(i t u)` is integrable on `ℝ`. -/
169lemma sinc_sq_mul_exp_integrable (T u : ℝ) (hT : 0 < T) :
170 Integrable (fun t : ℝ => ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ) *
171 Complex.exp (((t * u : ℝ) : ℂ) * Complex.I)) := by
172 have h1 : Integrable (fun t : ℝ => ((Real.sinc (t / (2 * T)) ^ 2 : ℝ) : ℂ)) :=
173 (sinc_sq_integrable T hT).ofReal
174 refine h1.mul_bdd (c := 1) ?_ ?_
175 · exact (by fun_prop : Continuous fun t : ℝ =>
176 Complex.exp (((t * u : ℝ) : ℂ) * Complex.I)).aestronglyMeasurable
177 · refine Filter.Eventually.of_forall fun t => ?_
178 rw [Complex.norm_exp_ofReal_mul_I]
179
180/-- The pair kernel is integrable on `(0, ∞)`. -/
181lemma pair_kernel_integrableOn (T m n : ℝ) (hm : 0 < m) :
182 IntegrableOn (fun y : ℝ => if (y < m ∧ m ≤ Real.exp (1 / T) * y) ∧
183 (y < n ∧ n ≤ Real.exp (1 / T) * y) then y⁻¹ else 0) (Ioi (0 : ℝ)) := by
184 simp only [pair_cond_iff T m n]
185 exact kernel_integrableOn _ _ (mul_pos (Real.exp_pos _) (lt_max_of_lt_left hm))
186
187end E424
188