goldbach-spectral-bridge
Li and Liu's GRH + S ⇒ Goldbach in Lean, checked against the paper by Comparator: clean it up together, and settle S
| 1 | module |
| 2 | |
| 3 | public import ConditionalGoldbach.Proofs.SpectralPoissonConvolution |
| 4 | public import ConditionalGoldbach.Proofs.HardyContourShift |
| 5 | |
| 6 | /-! Fourier inversion of the one-sided exponential supplies the smoothed Perron kernel. -/ |
| 7 | @[expose] public section |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | noncomputable section |
| 11 | open scoped BigOperators ComplexConjugate Topology FourierTransform Convolution |
| 12 | open MeasureTheory Filter Set Complex |
| 13 | namespace ConditionalGoldbach |
| 14 | attribute [local instance] Classical.propDecidable |
| 15 | |
| 16 | def perronExponential (c x : ℝ) : ℂ := if 0 < x then Complex.exp (-((c * x : ℝ) : ℂ)) else 0 |
| 17 | |
| 18 | lemma perronExponential_integrable {c : ℝ} (hc : 0 < c) : Integrable (perronExponential c) := by |
| 19 | have he : perronExponential c = (Ioi (0 : ℝ)).indicator |
| 20 | (fun x : ℝ => Complex.exp ((-(c : ℂ)) * x)) := by |
| 21 | funext x |
| 22 | by_cases hx : 0 < x <;> simp [perronExponential, Set.indicator, hx, ofReal_mul] |
| 23 | rw [he, integrable_indicator_iff measurableSet_Ioi] |
| 24 | exact integrableOn_exp_mul_complex_Ioi (by simpa using neg_neg_of_pos hc) 0 |
| 25 | |
| 26 | lemma perronExponential_fourier {c : ℝ} (hc : 0 < c) (t : ℝ) : |
| 27 | 𝓕 (perronExponential c) t = ((c : ℂ) + (2 * Real.pi * t : ℝ) * I)⁻¹ := by |
| 28 | let z : ℂ := -(c : ℂ) - (2 * Real.pi * t : ℝ) * I |
| 29 | have hz : z.re < 0 := by simpa [z] using neg_neg_of_pos hc |
| 30 | have he : (fun u : ℝ => Complex.exp ((-2 * Real.pi * (t * u) : ℝ) * I) * |
| 31 | perronExponential c u) = (Ioi (0 : ℝ)).indicator (fun u => Complex.exp (z * u)) := by |
| 32 | funext u |
| 33 | by_cases hu : 0 < u |
| 34 | · simp only [perronExponential, hu, ite_true, Set.indicator_of_mem (show u ∈ Ioi (0 : ℝ) from hu), ← Complex.exp_add] |
| 35 | congr 1 |
| 36 | dsimp [z] |
| 37 | push_cast |
| 38 | ring |
| 39 | · simp [perronExponential, hu, Set.indicator] |
| 40 | rw [Real.fourier_eq'] |
| 41 | simp only [RCLike.inner_apply, conj_trivial, smul_eq_mul, he, |
| 42 | integral_indicator measurableSet_Ioi, integral_exp_mul_complex_Ioi hz] |
| 43 | simp only [ofReal_zero, mul_zero, Complex.exp_zero] |
| 44 | dsimp [z] |
| 45 | rw [show -(c : ℂ) - (2 * Real.pi * t : ℝ) * I = -((c : ℂ) + (2 * Real.pi * t : ℝ) * I) by ring, |
| 46 | div_neg, neg_div, neg_neg, one_div] |
| 47 | |
| 48 | lemma perronExponential_convolution (c x : ℝ) : |
| 49 | (convolution (perronExponential c) (perronExponential c) (ContinuousLinearMap.mul ℂ ℂ)) x = |
| 50 | ((max x 0 : ℝ) : ℂ) * Complex.exp (-((c * x : ℝ) : ℂ)) := by |
| 51 | change (∫ u : ℝ, perronExponential c u * perronExponential c (x - u)) = _ |
| 52 | have he : (fun u : ℝ => perronExponential c u * perronExponential c (x - u)) = |
| 53 | (Ioo (0 : ℝ) x).indicator (fun _ => Complex.exp (-((c * x : ℝ) : ℂ))) := by |
| 54 | funext u |
| 55 | by_cases hu : 0 < u |
| 56 | · by_cases hx : u < x |
| 57 | · have hxu : 0 < x - u := by linarith |
| 58 | simp only [perronExponential, hu, hxu, ite_true, Set.indicator_of_mem (show u ∈ Ioo (0 : ℝ) x from ⟨hu, hx⟩), ← Complex.exp_add] |
| 59 | congr 1 |
| 60 | push_cast |
| 61 | ring |
| 62 | · have hxu : ¬0 < x - u := by linarith |
| 63 | simp [perronExponential, hu, hxu, Set.indicator, hx] |
| 64 | · simp [perronExponential, hu, Set.indicator] |
| 65 | rw [he, integral_indicator measurableSet_Ioo, setIntegral_const] |
| 66 | simp only [Measure.real, Real.volume_Ioo, sub_zero, ENNReal.toReal_ofReal', |
| 67 | Complex.real_smul] |
| 68 | |
| 69 | lemma perronCauchySquare_integrable {c : ℝ} (hc : 0 < c) : |
| 70 | Integrable (fun t : ℝ => (((c : ℂ) + (2 * Real.pi * t : ℝ) * I)⁻¹)^2) := by |
| 71 | have hnorm (t : ℝ) : ‖(((c : ℂ) + (2 * Real.pi * t : ℝ) * I)⁻¹)^2‖ = |
| 72 | c⁻¹^2 * (1 + ((2 * Real.pi / c) * t)^2)⁻¹ := by |
| 73 | rw [norm_pow, norm_inv, inv_pow, Complex.sq_norm, Complex.normSq_apply] |
| 74 | simp only [add_re, ofReal_re, mul_re, ofReal_im, I_re, I_im, mul_zero, |
| 75 | sub_zero, add_zero, add_im, mul_im, mul_one, zero_add] |
| 76 | field_simp |
| 77 | apply (integrable_norm_iff (by fun_prop)).mp |
| 78 | simp_rw [hnorm] |
| 79 | exact (integrable_inv_one_add_mul_sq (div_ne_zero (by positivity) hc.ne')).const_mul _ |
| 80 | |
| 81 | lemma perronCauchySquare_fourierInv {c : ℝ} (hc : 0 < c) (x : ℝ) : |
| 82 | 𝓕⁻ (fun t : ℝ => (((c : ℂ) + (2 * Real.pi * t : ℝ) * I)⁻¹)^2) x = |
| 83 | ((max x 0 : ℝ) : ℂ) * Complex.exp (-((c * x : ℝ) : ℂ)) := by |
| 84 | let f := convolution (perronExponential c) (perronExponential c) (ContinuousLinearMap.mul ℂ ℂ) |
| 85 | have hfi : Integrable f := (perronExponential_integrable hc).integrable_convolution |
| 86 | (ContinuousLinearMap.mul ℂ ℂ) (perronExponential_integrable hc) |
| 87 | have hF : 𝓕 f = fun t : ℝ => (((c : ℂ) + (2 * Real.pi * t : ℝ) * I)⁻¹)^2 := by |
| 88 | funext t |
| 89 | rw [Real.fourier_mul_convolution_eq (perronExponential_integrable hc) (perronExponential_integrable hc), |
| 90 | perronExponential_fourier hc, pow_two] |
| 91 | have hcF : Continuous f := by |
| 92 | have he : f = fun x : ℝ => ((max x 0 : ℝ) : ℂ) * Complex.exp (-((c * x : ℝ) : ℂ)) := |
| 93 | funext (perronExponential_convolution c) |
| 94 | rw [he] |
| 95 | fun_prop |
| 96 | have hh := congrFun (hcF.fourierInv_fourier_eq hfi (by rw [hF]; exact perronCauchySquare_integrable hc)) x |
| 97 | rw [hF] at hh |
| 98 | exact hh.trans (perronExponential_convolution c x) |
| 99 | |
| 100 | lemma perron_positivePart_integrable {c Y : ℝ} (hc : 0 < c) (hY : 0 < Y) : |
| 101 | Integrable (fun t : ℝ => (Y : ℂ)^(line c (2 * Real.pi * t)) / |
| 102 | (line c (2 * Real.pi * t))^2) := by |
| 103 | have hv (t : ℝ) : line c (2 * Real.pi * t) ≠ 0 := by |
| 104 | intro he |
| 105 | have hh := congrArg Complex.re he |
| 106 | simp [line] at hh |
| 107 | linarith |
| 108 | apply (integrable_norm_iff (by |
| 109 | apply Continuous.aestronglyMeasurable |
| 110 | apply Continuous.div |
| 111 | · apply Continuous.const_cpow (by unfold line; fun_prop) (Or.inl (Complex.ofReal_ne_zero.mpr hY.ne')) |
| 112 | · unfold line |
| 113 | fun_prop |
| 114 | · intro t |
| 115 | exact pow_ne_zero _ (hv t))).mp |
| 116 | apply ((perronCauchySquare_integrable hc).norm.const_mul (Y^c)).congr |
| 117 | filter_upwards [] with t |
| 118 | rw [norm_div, Complex.norm_cpow_eq_rpow_re_of_pos hY] |
| 119 | simp only [line, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, |
| 120 | Complex.I_re, Complex.I_im, mul_zero, zero_mul, sub_zero, add_zero, |
| 121 | norm_pow, norm_inv, inv_pow, div_eq_mul_inv] |
| 122 | |
| 123 | /-- Perron's second-order kernel is the positive logarithm, with the `2π` normalization |
| 124 | built into the vertical coordinate. -/ |
| 125 | lemma perron_positivePart_integral {c Y : ℝ} (hc : 0 < c) (hY : 0 < Y) : |
| 126 | (∫ t : ℝ, (Y : ℂ)^(line c (2 * Real.pi * t)) / |
| 127 | (line c (2 * Real.pi * t))^2) = ((max (Real.log Y) 0 : ℝ) : ℂ) := by |
| 128 | have hh := perronCauchySquare_fourierInv hc (Real.log Y) |
| 129 | rw [Real.fourierInv_eq'] at hh |
| 130 | simp only [RCLike.inner_apply, conj_trivial, smul_eq_mul] at hh |
| 131 | have he : (fun t : ℝ => (Y : ℂ)^(line c (2 * Real.pi * t)) / |
| 132 | (line c (2 * Real.pi * t))^2) = fun t : ℝ => |
| 133 | Complex.exp ((c * Real.log Y : ℝ) : ℂ) * |
| 134 | (Complex.exp ((2 * Real.pi * (t * Real.log Y) : ℝ) * I) * |
| 135 | (((c : ℂ) + (2 * Real.pi * t : ℝ) * I)⁻¹)^2) := by |
| 136 | funext t |
| 137 | rw [Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr hY.ne'), |
| 138 | ← Complex.ofReal_log hY.le] |
| 139 | have hexp : (Real.log Y : ℂ) * line c (2 * Real.pi * t) = |
| 140 | ((c * Real.log Y : ℝ) : ℂ) + (2 * Real.pi * (t * Real.log Y) : ℝ) * I := by |
| 141 | unfold line |
| 142 | push_cast |
| 143 | ring |
| 144 | rw [hexp, Complex.exp_add] |
| 145 | simp only [line, div_eq_mul_inv, inv_pow] |
| 146 | ring |
| 147 | rw [he, integral_const_mul] |
| 148 | have hh' : (∫ t : ℝ, Complex.exp ((2 * Real.pi * (t * Real.log Y) : ℝ) * I) * |
| 149 | (((c : ℂ) + (2 * Real.pi * t : ℝ) * I)⁻¹)^2) = |
| 150 | ((max (Real.log Y) 0 : ℝ) : ℂ) * Complex.exp (-((c * Real.log Y : ℝ) : ℂ)) := by |
| 151 | convert hh using 1 |
| 152 | congr 1 |
| 153 | funext t |
| 154 | congr 2 |
| 155 | push_cast |
| 156 | ring |
| 157 | rw [hh'] |
| 158 | calc |
| 159 | _ = ((max (Real.log Y) 0 : ℝ) : ℂ) * |
| 160 | (Complex.exp ((c * Real.log Y : ℝ) : ℂ) * Complex.exp (-((c * Real.log Y : ℝ) : ℂ))) := by ring |
| 161 | _ = _ := by rw [← Complex.exp_add]; simp |
| 162 | |
| 163 | lemma smoothedPerronWeight_positiveParts {X : ℝ} (hX : 1 < X) (n : ℕ) (hn : 0 < n) : |
| 164 | smoothedPerronWeight X n = |
| 165 | (max (Real.log (X / n)) 0 - max (Real.log (Real.sqrt X / n)) 0) / |
| 166 | Real.log (Real.sqrt X) := by |
| 167 | have hx : 0 < X := by linarith |
| 168 | have hnR : (0 : ℝ) < n := by exact_mod_cast hn |
| 169 | have hs : 1 < Real.sqrt X := (Real.lt_sqrt (by norm_num)).mpr (by simpa using hX) |
| 170 | have hls : 0 < Real.log (Real.sqrt X) := Real.log_pos hs |
| 171 | have hsq : Real.log X = 2 * Real.log (Real.sqrt X) := by rw [Real.log_sqrt hx.le]; ring |
| 172 | rw [Real.log_div hx.ne' hnR.ne', Real.log_div (by linarith : Real.sqrt X ≠ 0) hnR.ne'] |
| 173 | unfold smoothedPerronWeight |
| 174 | split_ifs with hsmall hlarge |
| 175 | · have hln : Real.log n ≤ Real.log (Real.sqrt X) := Real.log_le_log hnR hsmall |
| 176 | rw [max_eq_left (by linarith), max_eq_left (by linarith)] |
| 177 | rw [hsq] |
| 178 | field_simp; ring |
| 179 | · have hln : Real.log (Real.sqrt X) < Real.log n := Real.log_lt_log (by linarith) (lt_of_not_ge hsmall) |
| 180 | have hlnX : Real.log n ≤ Real.log X := Real.log_le_log hnR hlarge |
| 181 | rw [max_eq_left (by linarith), max_eq_right (by linarith), sub_zero, |
| 182 | Real.log_div hx.ne' hnR.ne'] |
| 183 | · have hln : Real.log X < Real.log n := Real.log_lt_log hx (lt_of_not_ge hlarge) |
| 184 | rw [max_eq_right (by linarith), max_eq_right (by linarith), sub_self, zero_div] |
| 185 | |
| 186 | lemma perron_weight_integrand_eq {X : ℝ} (hX : 1 < X) (n : ℕ) (hn : 0 < n) (v : ℂ) : |
| 187 | (n : ℂ)^(-v) * smoothedPerronKernel X v = |
| 188 | (((X / (n : ℝ) : ℝ) : ℂ)^v / v^2 - |
| 189 | ((Real.sqrt X / (n : ℝ) : ℝ) : ℂ)^v / v^2) / (Real.log (Real.sqrt X) : ℂ) := by |
| 190 | have hnR : (0 : ℝ) < n := by exact_mod_cast hn |
| 191 | simp only [Complex.ofReal_div] |
| 192 | rw [Complex.div_cpow_ofReal_nonneg (by linarith) hnR.le, |
| 193 | Complex.div_cpow_ofReal_nonneg (Real.sqrt_nonneg _) hnR.le] |
| 194 | simp only [Complex.ofReal_natCast] |
| 195 | unfold smoothedPerronKernel |
| 196 | rw [Complex.cpow_neg] |
| 197 | ring |
| 198 | |
| 199 | lemma integral_div_const_complex (f : ℝ → ℂ) (z : ℂ) : |
| 200 | (∫ t : ℝ, f t / z) = (∫ t : ℝ, f t) / z := by |
| 201 | simp only [div_eq_mul_inv, integral_mul_const] |
| 202 | |
| 203 | /-- The actual cutoff weight is the integral of the smoothed Perron kernel. -/ |
| 204 | lemma perron_weight_integral {X c : ℝ} (hX : 1 < X) (hc : 0 < c) (n : ℕ) (hn : 0 < n) : |
| 205 | Integrable (fun t : ℝ => (n : ℂ)^(-line c (2 * Real.pi * t)) * |
| 206 | smoothedPerronKernel X (line c (2 * Real.pi * t))) ∧ |
| 207 | (∫ t : ℝ, (n : ℂ)^(-line c (2 * Real.pi * t)) * |
| 208 | smoothedPerronKernel X (line c (2 * Real.pi * t))) = (smoothedPerronWeight X n : ℂ) := by |
| 209 | have hnR : (0 : ℝ) < n := by exact_mod_cast hn |
| 210 | have hi₁ := perron_positivePart_integrable hc (div_pos (show 0 < X by linarith) hnR) |
| 211 | have hi₂ := perron_positivePart_integrable hc (div_pos (Real.sqrt_pos.mpr (show 0 < X by linarith)) hnR) |
| 212 | simp_rw [perron_weight_integrand_eq hX n hn] |
| 213 | refine ⟨(hi₁.sub hi₂).div_const _, ?_⟩ |
| 214 | rw [integral_div_const_complex, integral_sub hi₁ hi₂, |
| 215 | perron_positivePart_integral hc (div_pos (show 0 < X by linarith) hnR), |
| 216 | perron_positivePart_integral hc (div_pos (Real.sqrt_pos.mpr (show 0 < X by linarith)) hnR), |
| 217 | smoothedPerronWeight_positiveParts hX n hn] |
| 218 | push_cast |
| 219 | rfl |
| 220 | |
| 221 | end ConditionalGoldbach |
