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.PoissonWeightedEnergy |
| 4 | public import ConditionalGoldbach.Proofs.CharacterPoissonAnchor |
| 5 | |
| 6 | /-! The final uniform mean-square estimate, with its two analytic inputs exposed. -/ |
| 7 | public section |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | noncomputable section |
| 11 | open MeasureTheory Filter Set Complex |
| 12 | open scoped Topology ComplexConjugate BigOperators |
| 13 | namespace ConditionalGoldbach |
| 14 | attribute [local instance] conductorNeZero |
| 15 | |
| 16 | lemma zeroPoisson_nonneg {N : ℕ} [NeZero N] (χ : Character N) (x t : ℝ) (hx : 0 ≤ x) : |
| 17 | 0 ≤ zeroPoisson χ x t := tsum_nonneg (fun p => div_nonneg hx (by positivity)) |
| 18 | |
| 19 | lemma zeroPoisson_width_comparison {N : ℕ} [NeZero N] (χ : Character N) (hχ : χ ≠ 1) |
| 20 | {σ r : ℝ} (hσ : 0 < σ) (hσr : σ ≤ r) (t : ℝ) : |
| 21 | zeroPoisson χ σ t ≤ (r/σ)*zeroPoisson χ r t := by |
| 22 | have hr : 0 < r := hσ.trans_le hσr |
| 23 | have hnon := primitiveCharacter_ne_one_of_ne_one χ hχ |
| 24 | have hi := primitive_zero_poisson_summable χ.primitiveCharacter hnon χ.primitiveCharacter_isPrimitive σ t hσ |
| 25 | have hj := primitive_zero_poisson_summable χ.primitiveCharacter hnon χ.primitiveCharacter_isPrimitive r t hr |
| 26 | unfold zeroPoisson |
| 27 | rw [← tsum_mul_left] |
| 28 | apply Summable.tsum_le_tsum _ hi (hj.mul_left _) |
| 29 | intro p |
| 30 | have hdσ : 0 < σ^2+(t-p.val.1.im)^2 := by positivity |
| 31 | have hdr : 0 < r^2+(t-p.val.1.im)^2 := by positivity |
| 32 | rw [← mul_div_assoc, div_mul_eq_mul_div, div_div] |
| 33 | apply (div_le_div_iff₀ hdσ (mul_pos hσ hdr)).mpr |
| 34 | have hs : σ^2 ≤ r^2 := (sq_le_sq₀ hσ.le hr.le).mpr hσr |
| 35 | have hh := mul_le_mul_of_nonneg_right hs (sq_nonneg (t-p.val.1.im)) |
| 36 | nlinarith |
| 37 | |
| 38 | lemma realPart_le_from_zeroPoisson {N : ℕ} [NeZero N] (χ : Character N) (hχ : χ ≠ 1) |
| 39 | {σ r C E : ℝ} (hσ : 0 < σ) (hσr : σ ≤ r) (hC : 0 ≤ C) (hE : 0 ≤ E) (t : ℝ) |
| 40 | (hcσ : |zeroPoisson χ σ t - (logDerivative χ (line σ t)).re| ≤ C*E) |
| 41 | (hcr : |zeroPoisson χ r t - (logDerivative χ (line r t)).re| ≤ C*E) : |
| 42 | |(logDerivative χ (line σ t)).re| ≤ (r/σ)*(‖logDerivative χ (line r t)‖+2*C*E) := by |
| 43 | have hQ := zeroPoisson_width_comparison χ hχ hσ hσr t |
| 44 | have hQnon := zeroPoisson_nonneg χ σ t hσ.le |
| 45 | have hK : 1 ≤ r/σ := (one_le_div hσ).mpr hσr |
| 46 | have hK0 : 0 ≤ r/σ := by linarith |
| 47 | have hQr : zeroPoisson χ r t ≤ ‖logDerivative χ (line r t)‖+C*E := by |
| 48 | have h := (abs_le.mp hcr).2 |
| 49 | have hn := Complex.re_le_norm (logDerivative χ (line r t)) |
| 50 | linarith |
| 51 | calc |
| 52 | _ = |zeroPoisson χ σ t - (zeroPoisson χ σ t - (logDerivative χ (line σ t)).re)| := by congr 1; ring |
| 53 | _ ≤ |zeroPoisson χ σ t|+|zeroPoisson χ σ t - (logDerivative χ (line σ t)).re| := abs_sub _ _ |
| 54 | _ ≤ zeroPoisson χ σ t+C*E := by rw [abs_of_nonneg hQnon]; exact add_le_add le_rfl hcσ |
| 55 | _ ≤ (r/σ)*(‖logDerivative χ (line r t)‖+C*E)+C*E := |
| 56 | add_le_add (hQ.trans (mul_le_mul_of_nonneg_left hQr hK0)) le_rfl |
| 57 | _ ≤ _ := by nlinarith [mul_le_mul_of_nonneg_right hK (mul_nonneg hC hE)] |
| 58 | |
| 59 | lemma logDerivative_energy_left_comparison (N : ℕ) [NeZero N] (hN4 : 4 ≤ N) (hGRH : GRH N) |
| 60 | (χ : Character N) (hχ : χ ∈ oddCharacters N) (σ r C : ℝ) |
| 61 | (hσ : 0 < σ) (hσr : σ ≤ r) (hC : 0 ≤ C) |
| 62 | (hlogi : Integrable (fun t : ℝ => Real.log ((N : ℝ)*(|t|+2)) ^ 2 / (1+t^2))) |
| 63 | (hcσ : ∀ t : ℝ, |zeroPoisson χ σ t - (logDerivative χ (line σ t)).re| ≤ C*Real.log ((N : ℝ)*(|t|+2))) |
| 64 | (hcr : ∀ t : ℝ, |zeroPoisson χ r t - (logDerivative χ (line r t)).re| ≤ C*Real.log ((N : ℝ)*(|t|+2))) : |
| 65 | (∫ t : ℝ, ‖logDerivative χ (line σ t)‖ ^ 2 / (1+t^2)) ≤ |
| 66 | 4*(r/σ)^2*(∫ t : ℝ, ‖logDerivative χ (line r t)‖ ^ 2 / (1+t^2)) + |
| 67 | 16*(r/σ)^2*C^2*(∫ t : ℝ, Real.log ((N : ℝ)*(|t|+2))^2/(1+t^2)) + |
| 68 | Real.pi*(3*(Real.log 4+4))^2 := by |
| 69 | have hr := hσ.trans_le hσr |
| 70 | have hχ1 := odd_character_ne_one χ (Finset.mem_filter.mp hχ).2 |
| 71 | have hbase := logDerivative_weighted_realPart_bound N hN4 hGRH χ hχ σ hσ |
| 72 | have hri := logDerivative_weighted_square_integrable N hN4 hGRH χ hχ r hr |
| 73 | have hp (t : ℝ) : (logDerivative χ (line σ t)).re^2/(1+t^2) ≤ |
| 74 | 2*(r/σ)^2*(‖logDerivative χ (line r t)‖^2/(1+t^2)) + |
| 75 | 8*(r/σ)^2*C^2*(Real.log ((N : ℝ)*(|t|+2))^2/(1+t^2)) := by |
| 76 | have hn : (1 : ℝ) ≤ N := by exact_mod_cast (by omega : 1 ≤ N) |
| 77 | have he : 0 ≤ Real.log ((N : ℝ)*(|t|+2)) := Real.log_nonneg (by nlinarith [abs_nonneg t]) |
| 78 | have hh := realPart_le_from_zeroPoisson χ hχ1 hσ hσr hC he t (hcσ t) (hcr t) |
| 79 | have hs := (sq_le_sq₀ (abs_nonneg _) ((abs_nonneg _).trans hh)).mpr hh |
| 80 | rw [sq_abs] at hs |
| 81 | have hm := mul_nonneg (sq_nonneg (r/σ)) (sq_nonneg |
| 82 | (‖logDerivative χ (line r t)‖-2*C*Real.log ((N : ℝ)*(|t|+2)))) |
| 83 | have hb : (logDerivative χ (line σ t)).re^2 ≤ |
| 84 | 2*(r/σ)^2*‖logDerivative χ (line r t)‖^2+ |
| 85 | 8*(r/σ)^2*C^2*Real.log ((N : ℝ)*(|t|+2))^2 := by nlinarith |
| 86 | convert div_le_div_of_nonneg_right hb (by positivity : 0 ≤ 1+t^2) using 1; ring |
| 87 | have hi := integral_mono hbase.1 |
| 88 | ((hri.const_mul (2*(r/σ)^2)).add (hlogi.const_mul (8*(r/σ)^2*C^2))) hp |
| 89 | simp only [Pi.add_apply] at hi |
| 90 | rw [integral_add (hri.const_mul _) (hlogi.const_mul _)] at hi |
| 91 | simp only [integral_const_mul] at hi |
| 92 | linarith [hbase.2] |
| 93 | |
| 94 | lemma averagedLogDerivative_left_comparison (N : ℕ) [NeZero N] (hN : Even N) |
| 95 | (hN4 : 4 ≤ N) (hGRH : GRH N) (σ r C : ℝ) (hσ : 0 < σ) (hσr : σ ≤ r) (hC : 0 ≤ C) |
| 96 | (hlogi : Integrable (fun t : ℝ => Real.log ((N : ℝ)*(|t|+2)) ^ 2 / (1+t^2))) |
| 97 | (hcσ : ∀ χ ∈ oddCharacters N, ∀ t : ℝ, |
| 98 | |zeroPoisson χ σ t - (logDerivative χ (line σ t)).re| ≤ C*Real.log ((N : ℝ)*(|t|+2))) |
| 99 | (hcr : ∀ χ ∈ oddCharacters N, ∀ t : ℝ, |
| 100 | |zeroPoisson χ r t - (logDerivative χ (line r t)).re| ≤ C*Real.log ((N : ℝ)*(|t|+2))) : |
| 101 | averagedLogDerivative N σ ≤ 4*(r/σ)^2*averagedLogDerivative N r + |
| 102 | 16*(r/σ)^2*C^2*(∫ t : ℝ, Real.log ((N : ℝ)*(|t|+2))^2/(1+t^2)) + |
| 103 | Real.pi*(3*(Real.log 4+4))^2 := by |
| 104 | unfold averagedLogDerivative |
| 105 | calc |
| 106 | _ ≤ (2 / (N.totient : ℝ)) * ∑ χ ∈ oddCharacters N, |
| 107 | (4*(r/σ)^2*(∫ t : ℝ, ‖logDerivative χ (line r t)‖^2/(1+t^2)) + |
| 108 | 16*(r/σ)^2*C^2*(∫ t : ℝ, Real.log ((N : ℝ)*(|t|+2))^2/(1+t^2)) + |
| 109 | Real.pi*(3*(Real.log 4+4))^2) := |
| 110 | mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun χ hχ => |
| 111 | logDerivative_energy_left_comparison N hN4 hGRH χ hχ σ r C hσ hσr hC hlogi (hcσ χ hχ) (hcr χ hχ))) (by positivity) |
| 112 | _ = _ := by |
| 113 | simp only [Finset.sum_add_distrib, ← Finset.mul_sum, Finset.sum_const, nsmul_eq_mul] |
| 114 | have hm := odd_character_average_mass N hN hN4 |
| 115 | linear_combination (16*(r/σ)^2*C^2*(∫ t : ℝ, Real.log ((N : ℝ)*(|t|+2))^2/(1+t^2))+ |
| 116 | Real.pi*(3*(Real.log 4+4))^2) * hm |
| 117 | |
| 118 | lemma lemma_6_4_of_reference_and_comparison |
| 119 | (href : ∃ A : ℝ, 0 < A ∧ ∀ N : ℕ, ∀ (_ : NeZero N), Even N → |
| 120 | Real.exp 10 < (N : ℝ) → GRH N → |
| 121 | averagedLogDerivative N (2 / Real.log N) ≤ A * Real.log N ^ 2) |
| 122 | (hcompare : ∃ C : ℝ, 0 < C ∧ ∀ N : ℕ, ∀ (_ : NeZero N), Even N → |
| 123 | Real.exp 10 < (N : ℝ) → GRH N → ∀ χ ∈ oddCharacters N, |
| 124 | ∀ x : ℝ, 0 < x → x ≤ 1/5 → ∀ t : ℝ, |
| 125 | |zeroPoisson χ x t - (logDerivative χ (line x t)).re| ≤ C * Real.log ((N : ℝ)*(|t|+2))) : |
| 126 | ∃ C : ℝ, 0 < C ∧ ∀ N : ℕ, ∀ (_ : NeZero N), |
| 127 | Even N → Real.exp 10 < (N : ℝ) → GRH N → ∀ σ : ℝ, 0 < σ → σ ≤ beta → |
| 128 | (∀ χ ∈ oddCharacters N, |
| 129 | Integrable (fun t : ℝ => ‖logDerivative χ (line σ t)‖ ^ 2 / (1 + t ^ 2))) ∧ |
| 130 | averagedLogDerivative N σ ≤ C * (Real.log N ^ 2 + σ⁻¹ ^ 2) := by |
| 131 | obtain ⟨A,hA,href⟩ := href |
| 132 | obtain ⟨C,hC,hcompare⟩ := hcompare |
| 133 | obtain ⟨L,hL,hlog⟩ := conductor_logarithm_energy_bound |
| 134 | let B : ℝ := Real.pi*(3*(Real.log 4+4))^2 |
| 135 | let D : ℝ := 16*A+64*C^2*L+B |
| 136 | have hB : 0 ≤ B := by dsimp [B]; positivity |
| 137 | have hD : 0 ≤ D := by dsimp [D]; positivity |
| 138 | refine ⟨2*A+D,by positivity,?_⟩ |
| 139 | intro N _ hN hlarge hGRH σ hσ hσβ |
| 140 | have hN4 := (large_parameters hlarge).1 |
| 141 | have hn : (0 : ℝ) < N := (Real.exp_pos 10).trans hlarge |
| 142 | have hln : 10 < Real.log N := (Real.lt_log_iff_exp_lt hn).mpr hlarge |
| 143 | let r : ℝ := 2 / Real.log N |
| 144 | have hr : 0 < r := by dsimp [r]; positivity |
| 145 | have hrsmall : r ≤ 1/5 := by |
| 146 | dsimp [r] |
| 147 | apply (div_le_iff₀ (by linarith)).mpr |
| 148 | linarith |
| 149 | have hσsmall : σ ≤ 1/5 := hσβ.trans (by norm_num [beta]) |
| 150 | have hri := href N inferInstance hN hlarge hGRH |
| 151 | have hnexp : Real.exp 1 ≤ (N : ℝ) := |
| 152 | (Real.exp_le_exp.mpr (by norm_num : (1 : ℝ) ≤ 10)).trans hlarge.le |
| 153 | obtain ⟨hli,hle⟩ := hlog N hnexp |
| 154 | refine ⟨fun χ hχ => logDerivative_weighted_square_integrable N hN4 hGRH χ hχ σ hσ,?_⟩ |
| 155 | by_cases hσr : σ ≤ r |
| 156 | · have hleft := averagedLogDerivative_left_comparison N hN hN4 hGRH σ r C hσ hσr hC.le hli |
| 157 | (fun χ hχ => hcompare N inferInstance hN hlarge hGRH χ hχ σ hσ hσsmall) |
| 158 | (fun χ hχ => hcompare N inferInstance hN hlarge hGRH χ hχ r hr hrsmall) |
| 159 | have hprod : (r/σ)^2 * Real.log N ^ 2 = 4*σ⁻¹^2 := by |
| 160 | dsimp [r] |
| 161 | field_simp [(show Real.log N ≠ 0 by linarith),hσ.ne'] |
| 162 | ring |
| 163 | have hh : averagedLogDerivative N σ ≤ (16*A+64*C^2*L)*σ⁻¹^2+B := by |
| 164 | apply hleft.trans |
| 165 | have h1 := mul_le_mul_of_nonneg_left hri (show 0 ≤ 4*(r/σ)^2 by positivity) |
| 166 | have h2 := mul_le_mul_of_nonneg_left hle (show 0 ≤ 16*(r/σ)^2*C^2 by positivity) |
| 167 | calc |
| 168 | _ ≤ 4*(r/σ)^2*(A*Real.log N^2)+16*(r/σ)^2*C^2*(L*Real.log N^2)+B := |
| 169 | add_le_add (add_le_add h1 h2) le_rfl |
| 170 | _ = _ := by |
| 171 | calc |
| 172 | _ = (4*A+16*C^2*L)*((r/σ)^2*Real.log N^2)+B := by ring |
| 173 | _ = _ := by rw [hprod]; ring |
| 174 | have hi1 : 1 ≤ σ⁻¹ := by |
| 175 | rw [inv_eq_one_div] |
| 176 | exact (one_le_div hσ).mpr (hσβ.trans (by norm_num [beta])) |
| 177 | have hisq : 1 ≤ σ⁻¹^2 := by nlinarith only [hi1, sq_nonneg (σ⁻¹-1)] |
| 178 | have hbound : averagedLogDerivative N σ ≤ D*σ⁻¹^2 := by |
| 179 | apply hh.trans |
| 180 | have hb := mul_le_mul_of_nonneg_left hisq hB |
| 181 | dsimp [D] |
| 182 | nlinarith only [hb] |
| 183 | apply hbound.trans |
| 184 | have hnon1 : 0 ≤ (2*A+D)*Real.log N^2 := by positivity |
| 185 | have hnon2 : 0 ≤ 2*A*σ⁻¹^2 := by positivity |
| 186 | nlinarith only [hnon1, hnon2] |
| 187 | · have hle : 0 ≤ σ-r := sub_nonneg.mpr (le_of_lt (lt_of_not_ge hσr)) |
| 188 | have hshift := averagedLogDerivative_shift N hN4 hGRH r (σ-r) hr hle |
| 189 | rw [add_sub_cancel] at hshift |
| 190 | have hfactor : 1+(σ-r) ≤ 2 := by |
| 191 | have hb : σ ≤ 1 := hσβ.trans (by norm_num [beta]) |
| 192 | linarith |
| 193 | have hright : averagedLogDerivative N σ ≤ 2*A*Real.log N^2 := by |
| 194 | apply hshift.trans |
| 195 | calc |
| 196 | _ ≤ (1+(σ-r))*(A*Real.log N^2) := mul_le_mul_of_nonneg_left hri (by positivity) |
| 197 | _ ≤ 2*(A*Real.log N^2) := mul_le_mul_of_nonneg_right hfactor (by positivity) |
| 198 | _ = _ := by ring |
| 199 | apply hright.trans |
| 200 | have hnon1 : 0 ≤ D*Real.log N^2 := by positivity |
| 201 | have hnon2 : 0 ≤ (2*A+D)*σ⁻¹^2 := by positivity |
| 202 | nlinarith only [hnon1, hnon2] |
| 203 | |
| 204 | end ConditionalGoldbach |
