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.SpectralPerronIntegral |
| 4 | public import ConditionalGoldbach.Proofs.CharacterEulerBounds |
| 5 | public import ConditionalGoldbach.Proofs.CharacterShortPolynomial |
| 6 | |
| 7 | /-! The absolutely convergent finite Euler factors in the smoothed Perron integral. -/ |
| 8 | public section |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | noncomputable section |
| 12 | open MeasureTheory Filter Set Complex |
| 13 | open scoped Topology ComplexConjugate BigOperators |
| 14 | namespace ConditionalGoldbach |
| 15 | attribute [local instance] conductorNeZero |
| 16 | |
| 17 | lemma perron_summable_coefficients {X c : ℝ} (hX : 1 < X) (hc : 0 < c) |
| 18 | (a : ℕ → ℂ) (n : ℕ → ℕ) (hn : ∀ k, 0 < n k) (ha : Summable (fun k => ‖a k‖)) : |
| 19 | Integrable (fun t : ℝ => (∑' k, a k*(n k : ℂ)^(-line c (2*Real.pi*t))) * |
| 20 | smoothedPerronKernel X (line c (2*Real.pi*t))) ∧ |
| 21 | (∫ t : ℝ, (∑' k, a k*(n k : ℂ)^(-line c (2*Real.pi*t))) * |
| 22 | smoothedPerronKernel X (line c (2*Real.pi*t))) = |
| 23 | ∑' k, a k * (smoothedPerronWeight X (n k) : ℂ) ∧ |
| 24 | ‖∑' k, a k * (smoothedPerronWeight X (n k) : ℂ)‖ ≤ ∑' k, ‖a k‖ := by |
| 25 | let v (t : ℝ) := line c (2*Real.pi*t) |
| 26 | let F (k : ℕ) (t : ℝ) := a k * ((n k : ℂ)^(-v t) * smoothedPerronKernel X (v t)) |
| 27 | have hK : Integrable (fun t : ℝ => smoothedPerronKernel X (v t)) := by |
| 28 | simpa only [Nat.cast_one,Complex.one_cpow,one_mul] using (perron_weight_integral hX hc 1 (by omega)).1 |
| 29 | have hf (k : ℕ) : Integrable (F k) := (perron_weight_integral hX hc (n k) (hn k)).1.const_mul (a k) |
| 30 | have hbound (k : ℕ) (t : ℝ) : ‖F k t‖ ≤ ‖a k‖ * ‖smoothedPerronKernel X (v t)‖ := by |
| 31 | have hpow : ‖(n k : ℂ)^(-v t)‖ ≤ 1 := by |
| 32 | rw [Complex.norm_natCast_cpow_of_pos (hn k)] |
| 33 | apply Real.rpow_le_one_of_one_le_of_nonpos |
| 34 | · exact_mod_cast hn k |
| 35 | · simp only [v,line,neg_re,add_re,ofReal_re,mul_re,ofReal_im,I_re,I_im, |
| 36 | mul_zero,zero_mul,sub_zero,add_zero] |
| 37 | linarith |
| 38 | dsimp [F] |
| 39 | rw [norm_mul,norm_mul] |
| 40 | exact mul_le_mul_of_nonneg_left (mul_le_of_le_one_left (norm_nonneg _) hpow) (norm_nonneg _) |
| 41 | have hsi : Summable (fun k => ∫ t : ℝ, ‖F k t‖) := by |
| 42 | apply (ha.mul_right (∫ t : ℝ, ‖smoothedPerronKernel X (v t)‖)).of_nonneg_of_le |
| 43 | · intro k; exact integral_nonneg (fun t => norm_nonneg _) |
| 44 | · intro k |
| 45 | have hh := integral_mono (hf k).norm (hK.norm.const_mul ‖a k‖) (hbound k) |
| 46 | simpa only [integral_const_mul] using hh |
| 47 | have hsum (t : ℝ) : (∑' k, F k t) = |
| 48 | (∑' k, a k*(n k : ℂ)^(-v t))*smoothedPerronKernel X (v t) := by |
| 49 | simp only [F,← mul_assoc,tsum_mul_right] |
| 50 | have hfin : Integrable (fun t : ℝ => ∑' k, F k t) := by |
| 51 | apply (hK.norm.const_mul (∑' k, ‖a k‖)).mono' |
| 52 | (AEStronglyMeasurable.tsum (fun k => (hf k).aestronglyMeasurable)) |
| 53 | filter_upwards [] with t |
| 54 | have hs := (ha.mul_right ‖smoothedPerronKernel X (v t)‖).of_nonneg_of_le (fun k => norm_nonneg _) (fun k => hbound k t) |
| 55 | exact (norm_tsum_le_tsum_norm hs).trans ((Summable.tsum_le_tsum (fun k => hbound k t) hs |
| 56 | (ha.mul_right _)).trans_eq tsum_mul_right) |
| 57 | refine ⟨by simpa only [hsum,v] using hfin,?_,?_⟩ |
| 58 | · rw [show (fun t : ℝ => (∑' k, a k*(n k : ℂ)^(-line c (2*Real.pi*t))) * |
| 59 | smoothedPerronKernel X (line c (2*Real.pi*t))) = (fun t => ∑' k, F k t) by funext t; exact (hsum t).symm] |
| 60 | rw [← integral_tsum_of_summable_integral_norm hf hsi] |
| 61 | apply tsum_congr |
| 62 | intro k |
| 63 | exact (integral_const_mul _ _).trans (congrArg (fun z : ℂ => a k*z) (perron_weight_integral hX hc (n k) (hn k)).2) |
| 64 | · have ht (k : ℕ) : ‖a k * (smoothedPerronWeight X (n k) : ℂ)‖ ≤ ‖a k‖ := by |
| 65 | rw [norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (smoothedPerronWeight_nonneg_le_one hX _).1] |
| 66 | exact mul_le_of_le_one_right (norm_nonneg _) (smoothedPerronWeight_nonneg_le_one hX _).2 |
| 67 | have hs := ha.of_nonneg_of_le (fun k => norm_nonneg _) ht |
| 68 | exact (norm_tsum_le_tsum_norm hs).trans (Summable.tsum_le_tsum ht hs ha) |
| 69 | |
| 70 | lemma euler_geometric_ratio_norm_le {d : ℕ} [NeZero d] (χ : Character d) |
| 71 | {p : ℕ} (hp : p.Prime) {u : ℂ} (hu : 1/2 ≤ u.re) : |
| 72 | ‖χ p/(p : ℂ)^u‖ ≤ 4/5 := by |
| 73 | have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hp.two_le |
| 74 | have hp0 : (0 : ℝ) < p := by positivity |
| 75 | have hpow : (5/4 : ℝ) ≤ ‖(p : ℂ)^u‖ := by |
| 76 | rw [Complex.norm_natCast_cpow_of_pos hp.pos] |
| 77 | have hs : (5/4 : ℝ) ≤ Real.sqrt 2 := by |
| 78 | have hh := Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 2) |
| 79 | have hh' := Real.sqrt_nonneg (2 : ℝ) |
| 80 | nlinarith |
| 81 | calc |
| 82 | (5/4 : ℝ) ≤ Real.sqrt 2 := hs |
| 83 | _ = (2 : ℝ)^(1/2 : ℝ) := Real.sqrt_eq_rpow _ |
| 84 | _ ≤ (p : ℝ)^(1/2 : ℝ) := Real.rpow_le_rpow (by norm_num) hp2 (by norm_num) |
| 85 | _ ≤ _ := Real.rpow_le_rpow_of_exponent_le (by linarith) hu |
| 86 | rw [norm_div] |
| 87 | apply (div_le_div_of_nonneg_right (χ.norm_le_one p) (norm_nonneg _)).trans |
| 88 | have hh := div_le_div_of_nonneg_left (show (0 : ℝ) ≤ 1 by norm_num) (by norm_num : (0 : ℝ)<5/4) hpow |
| 89 | norm_num at hh |
| 90 | simpa only [one_div] using hh |
| 91 | |
| 92 | lemma geometric_coefficients_norm_sum (q : ℂ) (hq : ‖q‖ ≤ 4/5) {L : ℝ} (hL : 0 ≤ L) : |
| 93 | Summable (fun k : ℕ => ‖(L : ℂ)*q^(k+1)‖) ∧ |
| 94 | (∑' k : ℕ, ‖(L : ℂ)*q^(k+1)‖) ≤ 4*L := by |
| 95 | have hq1 : ‖q‖ < 1 := by linarith |
| 96 | have hs := ((hasSum_geometric_of_lt_one (norm_nonneg q) hq1).mul_left ‖q‖).mul_left L |
| 97 | have he (k : ℕ) : ‖(L : ℂ)*q^(k+1)‖ = L*(‖q‖*‖q‖^k) := by |
| 98 | rw [norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg hL,norm_pow,pow_succ] |
| 99 | ring |
| 100 | have hs' : HasSum (fun k : ℕ => ‖(L : ℂ)*q^(k+1)‖) (L*(‖q‖*(1-‖q‖)⁻¹)) := by |
| 101 | simpa only [he] using hs |
| 102 | refine ⟨hs'.summable,?_⟩ |
| 103 | rw [hs'.tsum_eq] |
| 104 | rw [mul_comm 4 L] |
| 105 | apply mul_le_mul_of_nonneg_left _ hL |
| 106 | rw [← div_eq_mul_inv] |
| 107 | apply (div_le_iff₀ (by linarith : 0 < 1-‖q‖)).mpr |
| 108 | linarith |
| 109 | |
| 110 | lemma euler_correction_geometric_series {d : ℕ} [NeZero d] (χ : Character d) |
| 111 | {p : ℕ} (hp : p.Prime) {u v : ℂ} (hu : 1/2 ≤ u.re) (hv : 0 ≤ v.re) : |
| 112 | (∑' k : ℕ, ((Real.log p : ℂ)*(χ p/(p : ℂ)^u)^(k+1)) * |
| 113 | ((p^(k+1) : ℕ) : ℂ)^(-v)) = χ p*(Real.log p : ℂ)/((p : ℂ)^(u+v)-χ p) := by |
| 114 | let q : ℂ := χ p/(p : ℂ)^u |
| 115 | let r : ℂ := q*(p : ℂ)^(-v) |
| 116 | have hp0 : (p : ℂ) ≠ 0 := by exact_mod_cast hp.ne_zero |
| 117 | have hpow : (p : ℂ)^(u+v) ≠ 0 := Complex.cpow_ne_zero_iff.mpr (Or.inl hp0) |
| 118 | have hq := euler_geometric_ratio_norm_le χ hp hu |
| 119 | have hnorm : ‖(p : ℂ)^(-v)‖ ≤ 1 := by |
| 120 | rw [Complex.norm_natCast_cpow_of_pos hp.pos] |
| 121 | exact Real.rpow_le_one_of_one_le_of_nonpos (by exact_mod_cast hp.one_le) (by simpa using neg_nonpos.mpr hv) |
| 122 | have hr : ‖r‖ < 1 := by |
| 123 | have hh : ‖r‖ ≤ ‖q‖ := by dsimp [r]; rw [norm_mul]; exact mul_le_of_le_one_right (norm_nonneg _) hnorm |
| 124 | exact hh.trans_lt (lt_of_le_of_lt hq (by norm_num)) |
| 125 | have hratio : r = χ p/(p : ℂ)^(u+v) := by |
| 126 | dsimp [r,q] |
| 127 | rw [Complex.cpow_add _ _ hp0,Complex.cpow_neg] |
| 128 | ring |
| 129 | have hne : 1-r ≠ 0 := by |
| 130 | intro he |
| 131 | have he' : r = 1 := by linear_combination -he |
| 132 | simp [he'] at hr |
| 133 | have hden : (p : ℂ)^(u+v)-χ p ≠ 0 := by |
| 134 | have he : (1-r)*(p : ℂ)^(u+v) = (p : ℂ)^(u+v)-χ p := by rw [hratio]; field_simp |
| 135 | rw [← he] |
| 136 | exact mul_ne_zero hne hpow |
| 137 | have hterm (k : ℕ) : ((Real.log p : ℂ)*q^(k+1))*((p^(k+1) : ℕ) : ℂ)^(-v) = |
| 138 | (Real.log p : ℂ)*r^(k+1) := by |
| 139 | rw [Nat.cast_pow, ← Complex.natCast_cpow_natCast_mul,Complex.cpow_nat_mul] |
| 140 | dsimp [r] |
| 141 | rw [mul_pow] |
| 142 | ring |
| 143 | have hs : HasSum (fun k : ℕ => r^(k+1)) (r*(1-r)⁻¹) := by |
| 144 | simpa only [pow_succ,mul_comm] using (hasSum_geometric_of_norm_lt_one hr).mul_left r |
| 145 | simp_rw [show χ p/(p : ℂ)^u = q from rfl, hterm] |
| 146 | rw [tsum_mul_left,hs.tsum_eq,hratio] |
| 147 | field_simp [hpow,hden] |
| 148 | |
| 149 | lemma euler_correction_term_perron {d : ℕ} [NeZero d] (χ : Character d) |
| 150 | {p : ℕ} (hp : p.Prime) {u : ℂ} (hu : 1/2 ≤ u.re) |
| 151 | {X c : ℝ} (hX : 1 < X) (hc : 0 < c) : |
| 152 | Integrable (fun t : ℝ => |
| 153 | (χ p*(Real.log p : ℂ)/((p : ℂ)^(u+line c (2*Real.pi*t))-χ p)) * |
| 154 | smoothedPerronKernel X (line c (2*Real.pi*t))) ∧ |
| 155 | ‖∫ t : ℝ, (χ p*(Real.log p : ℂ)/((p : ℂ)^(u+line c (2*Real.pi*t))-χ p)) * |
| 156 | smoothedPerronKernel X (line c (2*Real.pi*t))‖ ≤ 4*Real.log p := by |
| 157 | have hL : 0 ≤ Real.log p := Real.log_nonneg (by exact_mod_cast hp.one_le) |
| 158 | have hs := geometric_coefficients_norm_sum (χ p/(p : ℂ)^u) (euler_geometric_ratio_norm_le χ hp hu) hL |
| 159 | have hh := perron_summable_coefficients hX hc |
| 160 | (fun k => (Real.log p : ℂ)*(χ p/(p : ℂ)^u)^(k+1)) (fun k => p^(k+1)) |
| 161 | (fun k => pow_pos hp.pos _) hs.1 |
| 162 | have he (t : ℝ) := euler_correction_geometric_series χ hp hu |
| 163 | (v := line c (2*Real.pi*t)) (by simpa [line] using hc.le) |
| 164 | simp_rw [he] at hh |
| 165 | refine ⟨hh.1,?_⟩ |
| 166 | rw [hh.2.1] |
| 167 | exact hh.2.2.trans hs.2 |
| 168 | |
| 169 | lemma eulerCorrection_perron_integral {N : ℕ} [NeZero N] (χ : Character N) |
| 170 | {u : ℂ} (hu : 1/2 ≤ u.re) {X c : ℝ} (hX : 1 < X) (hc : 0 < c) : |
| 171 | Integrable (fun t : ℝ => eulerCorrection χ (u+line c (2*Real.pi*t)) * |
| 172 | smoothedPerronKernel X (line c (2*Real.pi*t))) ∧ |
| 173 | ‖∫ t : ℝ, eulerCorrection χ (u+line c (2*Real.pi*t)) * |
| 174 | smoothedPerronKernel X (line c (2*Real.pi*t))‖ ≤ 4*Real.log N := by |
| 175 | classical |
| 176 | let F (p : ℕ) (t : ℝ) := (if ¬p ∣ χ.conductor then |
| 177 | χ.primitiveCharacter p*(Real.log p : ℂ)/((p : ℂ)^(u+line c (2*Real.pi*t))-χ.primitiveCharacter p) else 0) * |
| 178 | smoothedPerronKernel X (line c (2*Real.pi*t)) |
| 179 | have hi (p : ℕ) (hp : p ∈ N.primeFactors) : Integrable (F p) := by |
| 180 | by_cases hpc : p ∣ χ.conductor |
| 181 | · simp [F,hpc] |
| 182 | · simpa only [F,hpc,not_false_eq_true,ite_true] using |
| 183 | (euler_correction_term_perron χ.primitiveCharacter (Nat.prime_of_mem_primeFactors hp) hu hX hc).1 |
| 184 | have he (t : ℝ) : eulerCorrection χ (u+line c (2*Real.pi*t)) * |
| 185 | smoothedPerronKernel X (line c (2*Real.pi*t)) = ∑ p ∈ N.primeFactors, F p t := by |
| 186 | simp only [eulerCorrection,F,Finset.sum_mul] |
| 187 | constructor |
| 188 | · simpa only [he] using integrable_finsetSum _ hi |
| 189 | · simp_rw [he] |
| 190 | rw [integral_finsetSum _ hi] |
| 191 | apply (norm_sum_le _ _).trans |
| 192 | calc |
| 193 | _ ≤ ∑ p ∈ N.primeFactors, 4*Real.log p := by |
| 194 | apply Finset.sum_le_sum |
| 195 | intro p hp |
| 196 | by_cases hpc : p ∣ χ.conductor |
| 197 | · simp [F,hpc] |
| 198 | positivity |
| 199 | · simpa only [F,hpc,not_false_eq_true,ite_true] using |
| 200 | (euler_correction_term_perron χ.primitiveCharacter (Nat.prime_of_mem_primeFactors hp) hu hX hc).2 |
| 201 | _ = 4*(∑ p ∈ N.primeFactors, Real.log p) := by rw [Finset.mul_sum] |
| 202 | _ ≤ _ := mul_le_mul_of_nonneg_left (sum_log_primeFactors_le_log N (NeZero.pos N)) (by norm_num) |
| 203 | |
| 204 | lemma eulerCorrection_perron_error {N : ℕ} [NeZero N] (χ : Character N) |
| 205 | {u : ℂ} (hu : 1/2 ≤ u.re) {X c : ℝ} (hX : 1 < X) (hc : 0 < c) : |
| 206 | ‖eulerCorrection χ u - ∫ t : ℝ, eulerCorrection χ (u+line c (2*Real.pi*t)) * |
| 207 | smoothedPerronKernel X (line c (2*Real.pi*t))‖ ≤ 8*Real.log N := by |
| 208 | have h1 := eulerCorrection_norm_le χ hu |
| 209 | have h2 := (eulerCorrection_perron_integral χ hu hX hc).2 |
| 210 | exact (norm_sub_le _ _).trans (by linarith) |
| 211 | |
| 212 | end ConditionalGoldbach |
