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 Mathlib.Analysis.Real.Pi.Bounds |
| 4 | public import ConditionalGoldbach.Proofs.CharacterGrowthFoundation |
| 5 | public import ConditionalGoldbach.Proofs.CharacterZeroReflection |
| 6 | public import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup |
| 7 | |
| 8 | /-! Growth of completed Dirichlet L-functions on expanding disks, from Euler's Gamma integral |
| 9 | and the primitive functional equation. -/ |
| 10 | public section |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | noncomputable section |
| 14 | open scoped BigOperators ComplexConjugate Topology |
| 15 | open MeasureTheory Filter Set Complex |
| 16 | namespace ConditionalGoldbach |
| 17 | |
| 18 | lemma gamma_norm_le_real {s : ℂ} (hs : 0 < s.re) : ‖Gamma s‖ ≤ Real.Gamma s.re := by |
| 19 | rw [Complex.Gamma_eq_integral hs, Complex.GammaIntegral, Real.Gamma_eq_integral hs] |
| 20 | apply (norm_integral_le_integral_norm _).trans |
| 21 | apply le_of_eq |
| 22 | apply setIntegral_congr_fun measurableSet_Ioi |
| 23 | intro x hx |
| 24 | dsimp only |
| 25 | rw [norm_mul, Complex.norm_of_nonneg (Real.exp_pos _).le, |
| 26 | Complex.norm_cpow_eq_rpow_re_of_pos hx] |
| 27 | simp only [Complex.sub_re, Complex.one_re] |
| 28 | |
| 29 | lemma growth_scale_ge_one {R : ℝ} (hR : 1 ≤ R) : 1 ≤ R * Real.log (R + 2) := by |
| 30 | have hlog : 1 ≤ Real.log (R + 2) := by |
| 31 | apply (Real.le_log_iff_exp_le (by linarith)).mpr |
| 32 | exact Real.exp_one_lt_three.le.trans (by linarith) |
| 33 | nlinarith |
| 34 | |
| 35 | lemma gamma_right_disk_bound {R : ℝ} (hR : 1 ≤ R) {s : ℂ} |
| 36 | (hslo : 1 / 4 ≤ s.re) (hshi : s.re ≤ R + 1) : |
| 37 | ‖Gamma s‖ ≤ (Real.Gamma (1 / 4) + 1) * Real.exp (2 * R * Real.log (R + 2)) := by |
| 38 | let n : ℕ := ⌈R⌉₊ |
| 39 | have hnlo : R ≤ (n : ℝ) := Nat.le_ceil R |
| 40 | have hnhi : (n : ℝ) ≤ 2 * R := (Nat.ceil_lt_add_one (by linarith : 0 ≤ R)).le.trans (by linarith) |
| 41 | have hnpos : (0 : ℝ) < n := by linarith |
| 42 | have hfact : (n.factorial : ℝ) ≤ Real.exp (2 * R * Real.log (R + 2)) := by |
| 43 | have hpow : (n : ℝ)^n ≤ Real.exp (2 * R * Real.log (R + 2)) := by |
| 44 | rw [← Real.rpow_natCast, Real.rpow_def_of_pos hnpos] |
| 45 | apply Real.exp_le_exp.mpr |
| 46 | have hnR : (n : ℝ) ≤ R + 2 := (Nat.ceil_lt_add_one (by linarith : 0 ≤ R)).le.trans (by linarith) |
| 47 | have hlog := Real.log_le_log hnpos hnR |
| 48 | have hlogR : 0 ≤ Real.log (R + 2) := Real.log_nonneg (by linarith) |
| 49 | calc |
| 50 | Real.log n * n ≤ Real.log (R + 2) * n := mul_le_mul_of_nonneg_right hlog hnpos.le |
| 51 | _ ≤ Real.log (R + 2) * (2 * R) := mul_le_mul_of_nonneg_left hnhi hlogR |
| 52 | _ = _ := by ring |
| 53 | exact (show (n.factorial : ℝ) ≤ (n : ℝ)^n by exact_mod_cast Nat.factorial_le_pow n).trans hpow |
| 54 | have hg : Real.Gamma s.re ≤ max (Real.Gamma (1 / 4)) (n.factorial : ℝ) := by |
| 55 | have hh := Real.convexOn_Gamma.le_max_of_mem_Icc |
| 56 | (show (1 / 4 : ℝ) ∈ Ioi 0 by norm_num) |
| 57 | (show (n : ℝ) + 1 ∈ Ioi 0 by simp only [mem_Ioi]; positivity) |
| 58 | (show s.re ∈ Icc (1 / 4) ((n : ℝ) + 1) by exact ⟨hslo, by linarith⟩) |
| 59 | simpa only [Real.Gamma_nat_eq_factorial] using hh |
| 60 | have hE : 1 ≤ Real.exp (2 * R * Real.log (R + 2)) := |
| 61 | Real.one_le_exp_iff.mpr (by nlinarith [growth_scale_ge_one hR]) |
| 62 | have hG : 0 < Real.Gamma (1 / 4) := Real.Gamma_pos_of_pos (by norm_num) |
| 63 | calc |
| 64 | _ ≤ Real.Gamma s.re := gamma_norm_le_real (by linarith) |
| 65 | _ ≤ max (Real.Gamma (1 / 4)) (n.factorial : ℝ) := hg |
| 66 | _ ≤ (Real.Gamma (1 / 4) + 1) * Real.exp (2 * R * Real.log (R + 2)) := by |
| 67 | apply max_le |
| 68 | · nlinarith |
| 69 | · nlinarith |
| 70 | |
| 71 | lemma gammaRealFactor_disk_bound {R : ℝ} (hR : 1 ≤ R) {s : ℂ} |
| 72 | (hslo : 1 / 2 ≤ s.re) (hshi : s.re ≤ R + 1) : |
| 73 | ‖Gammaℝ s‖ ≤ (Real.Gamma (1 / 4) + 1) * Real.exp (2 * R * Real.log (R + 2)) := by |
| 74 | have hpi : ‖(Real.pi : ℂ)^(-s / 2)‖ ≤ 1 := by |
| 75 | rw [Complex.norm_cpow_eq_rpow_re_of_pos Real.pi_pos] |
| 76 | apply Real.rpow_le_one_of_one_le_of_nonpos (by linarith [Real.pi_gt_three]) |
| 77 | simp only [div_ofNat_re, neg_re] |
| 78 | linarith |
| 79 | rw [Complex.Gammaℝ_def, norm_mul] |
| 80 | calc |
| 81 | _ ≤ 1 * ‖Gamma (s / 2)‖ := mul_le_mul_of_nonneg_right hpi (norm_nonneg _) |
| 82 | _ ≤ _ := by |
| 83 | rw [one_mul] |
| 84 | exact gamma_right_disk_bound hR (by simp only [div_ofNat_re]; linarith) |
| 85 | (by simp only [div_ofNat_re]; linarith) |
| 86 | |
| 87 | lemma gammaFactor_disk_bound {d : ℕ} (χ : Character d) {R : ℝ} (hR : 1 ≤ R) {s : ℂ} |
| 88 | (hslo : 1 / 2 ≤ s.re) (hsnorm : ‖s‖ ≤ R) : |
| 89 | ‖χ.gammaFactor s‖ ≤ (Real.Gamma (1 / 4) + 1) * Real.exp (2 * R * Real.log (R + 2)) := by |
| 90 | have hsre : s.re ≤ R := (Complex.re_le_norm s).trans hsnorm |
| 91 | classical |
| 92 | simp only [DirichletCharacter.gammaFactor] |
| 93 | split_ifs |
| 94 | · exact gammaRealFactor_disk_bound hR hslo (by linarith) |
| 95 | · exact gammaRealFactor_disk_bound hR (by simp only [add_re, one_re]; linarith) |
| 96 | (by simp only [add_re, one_re]; linarith) |
| 97 | |
| 98 | lemma completedLFunction_right_disk_bound {d : ℕ} [NeZero d] (χ : Character d) (hχ : χ ≠ 1) |
| 99 | {R : ℝ} (hR : 1 ≤ R) {s : ℂ} (hslo : 1 / 2 ≤ s.re) (hsnorm : ‖s‖ ≤ R) : |
| 100 | ‖χ.completedLFunction s‖ ≤ |
| 101 | (3 * d * (Real.Gamma (1 / 4) + 1)) * Real.exp (3 * R * Real.log (R + 2)) := by |
| 102 | have hspos : 0 < s.re := by linarith |
| 103 | have hsne : s ≠ 0 := by intro he; simp [he] at hspos |
| 104 | have hL : ‖χ.LFunction s‖ ≤ (d : ℝ) * (1 + 2 * R) := by |
| 105 | apply (LFunction_polynomial_bound χ hχ s hspos).trans |
| 106 | apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) |
| 107 | apply add_le_add le_rfl |
| 108 | calc |
| 109 | ‖s‖ / s.re ≤ R / (1 / 2 : ℝ) := div_le_div₀ (by linarith) hsnorm (by norm_num) hslo |
| 110 | _ = _ := by ring |
| 111 | have hE : 1 + 2 * R ≤ 3 * Real.exp (R * Real.log (R + 2)) := by |
| 112 | have he : R + 2 ≤ Real.exp (R * Real.log (R + 2)) := by |
| 113 | calc |
| 114 | R + 2 = Real.exp (Real.log (R + 2)) := (Real.exp_log (by linarith)).symm |
| 115 | _ ≤ _ := Real.exp_le_exp.mpr (by nlinarith [Real.log_nonneg (show 1 ≤ R + 2 by linarith)]) |
| 116 | linarith |
| 117 | have heq : χ.completedLFunction s = χ.LFunction s * χ.gammaFactor s := by |
| 118 | rw [χ.LFunction_eq_completed_div_gammaFactor s (Or.inl hsne)] |
| 119 | exact (div_mul_cancel₀ _ (gammaFactor_ne_zero_re_pos χ hspos)).symm |
| 120 | rw [heq, norm_mul] |
| 121 | calc |
| 122 | _ ≤ ((d : ℝ) * (1 + 2 * R)) * |
| 123 | ((Real.Gamma (1 / 4) + 1) * Real.exp (2 * R * Real.log (R + 2))) := |
| 124 | mul_le_mul hL (gammaFactor_disk_bound χ hR hslo hsnorm) (norm_nonneg _) |
| 125 | (by positivity) |
| 126 | _ ≤ ((d : ℝ) * (3 * Real.exp (R * Real.log (R + 2)))) * |
| 127 | ((Real.Gamma (1 / 4) + 1) * Real.exp (2 * R * Real.log (R + 2))) := by |
| 128 | gcongr |
| 129 | _ = _ := by |
| 130 | rw [show (d : ℝ) * (3 * Real.exp (R * Real.log (R + 2))) * |
| 131 | ((Real.Gamma (1 / 4) + 1) * Real.exp (2 * R * Real.log (R + 2))) = |
| 132 | (3 * d * (Real.Gamma (1 / 4) + 1)) * |
| 133 | (Real.exp (R * Real.log (R + 2)) * Real.exp (2 * R * Real.log (R + 2))) by ring, |
| 134 | ← Real.exp_add] |
| 135 | congr 2 |
| 136 | ring |
| 137 | |
| 138 | lemma growth_scale_successor {R : ℝ} (hR : 1 ≤ R) : |
| 139 | (R + 1) * Real.log (R + 3) ≤ 4 * (R * Real.log (R + 2)) := by |
| 140 | have hl0 : 0 ≤ Real.log (R + 2) := Real.log_nonneg (by linarith) |
| 141 | have hl : Real.log (R + 3) ≤ 2 * Real.log (R + 2) := by |
| 142 | have hh := Real.log_le_log (show 0 < R + 3 by linarith) |
| 143 | (show R + 3 ≤ (R + 2) * (R + 2) by nlinarith) |
| 144 | rw [Real.log_mul (by linarith : R + 2 ≠ 0) (by linarith : R + 2 ≠ 0)] at hh |
| 145 | linarith |
| 146 | calc |
| 147 | _ ≤ (R + 1) * (2 * Real.log (R + 2)) := mul_le_mul_of_nonneg_left hl (by linarith) |
| 148 | _ ≤ (2 * R) * (2 * Real.log (R + 2)) := mul_le_mul_of_nonneg_right (by linarith) (by positivity) |
| 149 | _ = _ := by ring |
| 150 | |
| 151 | /-- The completed primitive L-function has order at most one, with the precise |
| 152 | `exp (A R log(R+2))` majorant needed for the Hadamard argument. -/ |
| 153 | theorem completedLFunction_disk_growth {d : ℕ} [NeZero d] (χ : Character d) |
| 154 | (hχ : χ ≠ 1) (hprim : χ.IsPrimitive) : |
| 155 | ∃ A : ℝ, 0 < A ∧ ∀ R : ℝ, 1 ≤ R → ∀ s : ℂ, ‖s‖ ≤ R → |
| 156 | ‖χ.completedLFunction s‖ ≤ Real.exp (A * R * Real.log (R + 2)) := by |
| 157 | have hd0 : (0 : ℝ) < d := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne d) |
| 158 | have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (NeZero.ne d) |
| 159 | have hdlog : 0 ≤ Real.log d := Real.log_nonneg hd1 |
| 160 | have hG : 0 < Real.Gamma (1 / 4) := Real.Gamma_pos_of_pos (by norm_num) |
| 161 | let K₀ : ℝ := 3 * d * (Real.Gamma (1 / 4) + 1) |
| 162 | let K : ℝ := K₀ * (‖χ.rootNumber‖ + 1) |
| 163 | let B : ℝ := 12 + 2 * Real.log d |
| 164 | have hK₀ : 0 < K₀ := by dsimp [K₀]; positivity |
| 165 | have hK : 0 < K := by dsimp [K]; positivity |
| 166 | have hB : 0 < B := by dsimp [B]; positivity |
| 167 | refine ⟨B + |Real.log K| + 1, by positivity, ?_⟩ |
| 168 | intro R hR s hs |
| 169 | let X := R * Real.log (R + 2) |
| 170 | have hX : 1 ≤ X := growth_scale_ge_one hR |
| 171 | have hXR : R ≤ X := by |
| 172 | have hl : 1 ≤ Real.log (R + 2) := by |
| 173 | apply (Real.le_log_iff_exp_le (by linarith)).mpr |
| 174 | exact Real.exp_one_lt_three.le.trans (by linarith) |
| 175 | dsimp [X] |
| 176 | nlinarith |
| 177 | have hbasic : ‖χ.completedLFunction s‖ ≤ K * Real.exp (B * X) := by |
| 178 | by_cases hre : 1 / 2 ≤ s.re |
| 179 | · have hh := completedLFunction_right_disk_bound χ hχ hR hre hs |
| 180 | apply hh.trans |
| 181 | apply mul_le_mul |
| 182 | · dsimp [K] |
| 183 | nlinarith [norm_nonneg χ.rootNumber] |
| 184 | · apply Real.exp_le_exp.mpr |
| 185 | dsimp [B, X] |
| 186 | have hx0 : 0 ≤ R * Real.log (R + 2) := le_trans (by norm_num) hX |
| 187 | nlinarith [mul_nonneg hdlog hx0] |
| 188 | · positivity |
| 189 | · exact hK.le |
| 190 | · have hright : 1 / 2 ≤ (1 - s).re := by simp; linarith |
| 191 | have hnorm : ‖1 - s‖ ≤ R + 1 := by |
| 192 | have hh := (norm_sub_le (1 : ℂ) s).trans (add_le_add le_rfl hs) |
| 193 | simpa only [norm_one, add_comm] using hh |
| 194 | have hh := completedLFunction_right_disk_bound χ⁻¹ (inv_ne_one.mpr hχ) |
| 195 | (show 1 ≤ R + 1 by linarith) hright hnorm |
| 196 | have hright' : ‖χ⁻¹.completedLFunction (1 - s)‖ ≤ K₀ * Real.exp (12 * X) := by |
| 197 | apply hh.trans |
| 198 | apply mul_le_mul_of_nonneg_left _ hK₀.le |
| 199 | apply Real.exp_le_exp.mpr |
| 200 | have ht := growth_scale_successor hR |
| 201 | dsimp [X] |
| 202 | convert mul_le_mul_of_nonneg_left ht (show (0 : ℝ) ≤ 3 by norm_num) using 1 <;> ring_nf |
| 203 | have hpower : ‖(d : ℂ)^((1 - s) - 1 / 2)‖ ≤ Real.exp ((2 * Real.log d) * X) := by |
| 204 | rw [Complex.norm_natCast_cpow_of_pos (Nat.pos_of_ne_zero (NeZero.ne d)), |
| 205 | Real.rpow_def_of_pos hd0] |
| 206 | apply Real.exp_le_exp.mpr |
| 207 | have hneg : -s.re ≤ R := (neg_le_abs s.re).trans ((Complex.abs_re_le_norm s).trans hs) |
| 208 | simp only [Complex.sub_re, Complex.one_re, Complex.div_ofNat_re] at * |
| 209 | calc |
| 210 | Real.log d * (1 - s.re - 1 / 2) ≤ Real.log d * (2 * R) := |
| 211 | mul_le_mul_of_nonneg_left (by linarith) hdlog |
| 212 | _ ≤ Real.log d * (2 * X) := mul_le_mul_of_nonneg_left (by linarith) hdlog |
| 213 | _ = _ := by ring |
| 214 | have heq := hprim.completedLFunction_one_sub (1 - s) |
| 215 | rw [sub_sub_cancel] at heq |
| 216 | rw [heq, norm_mul, norm_mul] |
| 217 | calc |
| 218 | _ ≤ Real.exp ((2 * Real.log d) * X) * (‖χ.rootNumber‖ + 1) * |
| 219 | (K₀ * Real.exp (12 * X)) := by |
| 220 | gcongr |
| 221 | exact le_add_of_nonneg_right zero_le_one |
| 222 | _ = K * Real.exp (B * X) := by |
| 223 | dsimp [K, B] |
| 224 | rw [show Real.exp ((2 * Real.log d) * X) * (‖χ.rootNumber‖ + 1) * |
| 225 | (K₀ * Real.exp (12 * X)) = |
| 226 | K₀ * (‖χ.rootNumber‖ + 1) * |
| 227 | (Real.exp ((2 * Real.log d) * X) * Real.exp (12 * X)) by ring, |
| 228 | ← Real.exp_add] |
| 229 | congr 2 |
| 230 | ring |
| 231 | apply hbasic.trans |
| 232 | calc |
| 233 | K * Real.exp (B * X) = Real.exp (Real.log K + B * X) := by |
| 234 | rw [Real.exp_add, Real.exp_log hK] |
| 235 | _ ≤ Real.exp ((B + |Real.log K| + 1) * R * Real.log (R + 2)) := by |
| 236 | apply Real.exp_le_exp.mpr |
| 237 | have hh : Real.log K ≤ |Real.log K| * X := by |
| 238 | exact (le_abs_self _).trans (le_mul_of_one_le_right (abs_nonneg _) hX) |
| 239 | dsimp [X] at * |
| 240 | nlinarith |
| 241 | |
| 242 | /-- The same disk estimate in the paper's conductor-normalized convention. -/ |
| 243 | theorem completedL_disk_growth {d : ℕ} [NeZero d] (χ : Character d) |
| 244 | (hχ : χ ≠ 1) (hprim : χ.IsPrimitive) : |
| 245 | ∃ A : ℝ, 0 < A ∧ ∀ R : ℝ, 1 ≤ R → ∀ s : ℂ, ‖s‖ ≤ R → |
| 246 | ‖completedL χ s‖ ≤ Real.exp (A * R * Real.log (R + 2)) := by |
| 247 | obtain ⟨A, hA, hbound⟩ := completedLFunction_disk_growth χ hχ hprim |
| 248 | have hd0 : (0 : ℝ) < d := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne d) |
| 249 | have hdlog : 0 ≤ Real.log d := Real.log_nonneg |
| 250 | (by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (NeZero.ne d)) |
| 251 | refine ⟨A + Real.log d, by positivity, ?_⟩ |
| 252 | intro R hR s hs |
| 253 | have hlogR : 1 ≤ Real.log (R + 2) := by |
| 254 | apply (Real.le_log_iff_exp_le (by linarith)).mpr |
| 255 | exact Real.exp_one_lt_three.le.trans (by linarith) |
| 256 | have hpower : ‖(d : ℂ)^((s + 1) / 2)‖ ≤ Real.exp (Real.log d * R * Real.log (R + 2)) := by |
| 257 | rw [Complex.norm_natCast_cpow_of_pos (Nat.pos_of_ne_zero (NeZero.ne d)), |
| 258 | Real.rpow_def_of_pos hd0] |
| 259 | apply Real.exp_le_exp.mpr |
| 260 | have hsre : s.re ≤ R := (Complex.re_le_norm s).trans hs |
| 261 | simp only [Complex.div_ofNat_re, Complex.add_re, Complex.one_re] |
| 262 | calc |
| 263 | Real.log d * ((s.re + 1) / 2) ≤ Real.log d * R := |
| 264 | mul_le_mul_of_nonneg_left (by linarith) hdlog |
| 265 | _ ≤ _ := le_mul_of_one_le_right (by positivity) hlogR |
| 266 | rw [completedL, norm_mul] |
| 267 | calc |
| 268 | _ ≤ Real.exp (Real.log d * R * Real.log (R + 2)) * Real.exp (A * R * Real.log (R + 2)) := |
| 269 | mul_le_mul hpower (hbound R hR s hs) (norm_nonneg _) (by positivity) |
| 270 | _ = _ := by rw [← Real.exp_add]; congr 1; ring |
| 271 | |
| 272 | end ConditionalGoldbach |
