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.BaselineEuler |
| 4 | public import ConditionalGoldbach.Proofs.DensityEulerIdentity |
| 5 | |
| 6 | public section |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | noncomputable section |
| 10 | open scoped BigOperators |
| 11 | open Set Complex |
| 12 | namespace ConditionalGoldbach |
| 13 | attribute [local instance] Classical.propDecidable |
| 14 | |
| 15 | lemma baselineProduct_factor (N p : ℕ) (hN : Even N) (hpos : 0 < N) |
| 16 | {w : ℂ} (hw : 0 < w.re) : |
| 17 | (if p.Prime then (1-(p:ℂ)^(-(1+w)))⁻¹ else 1)* |
| 18 | (if p∈N.primeFactors then 1-(p:ℂ)^(-1-w) else 1)* |
| 19 | (1+baselineEulerTerm N p w) = 1+densityEulerTerm N p w := by |
| 20 | by_cases hp : p.Prime |
| 21 | · have hp0 : (p:ℂ) ≠ 0 := by exact_mod_cast hp.ne_zero |
| 22 | have hq : ‖(p:ℂ)^(-(1+w))‖ < 1 := by |
| 23 | rw [Complex.norm_natCast_cpow_of_pos hp.pos,Complex.neg_re,Complex.add_re,Complex.one_re] |
| 24 | exact Real.rpow_lt_one_of_one_lt_of_neg (by exact_mod_cast hp.one_lt) (by linarith) |
| 25 | have hqn : 1-(p:ℂ)^(-(1+w)) ≠ 0 := by |
| 26 | intro he |
| 27 | have he' : (p:ℂ)^(-(1+w))=1 := by linear_combination -he |
| 28 | rw [he'] at hq |
| 29 | simp only [norm_one, lt_self_iff_false] at hq |
| 30 | have hm : p∈N.primeFactors ↔ p∣N := by simp [Nat.mem_primeFactors,hp,hpos.ne'] |
| 31 | have he : -1-w=-(1+w) := by ring |
| 32 | rw [ite_eq_left hp,he] |
| 33 | by_cases hd : p∣N |
| 34 | · simp only [ite_eq_left (hm.mpr hd),baselineEulerTerm,densityEulerTerm,hd,not_true_eq_false, |
| 35 | and_false,ite_false,mul_zero,sub_zero,add_zero,inv_mul_cancel₀ hqn,mul_one] |
| 36 | · have hp2 : 2<p := by |
| 37 | have : p≠2 := by intro h; subst p; exact hd (even_iff_two_dvd.mp hN) |
| 38 | have := hp.two_le |
| 39 | omega |
| 40 | rw [ite_eq_right (mt hm.mp hd),mul_one,baselineEulerTerm_eq] |
| 41 | simp only [hp,hp2,hd,not_false_eq_true,and_self,ite_true,densityEulerTerm] |
| 42 | have hp2c : (p:ℂ)-2 ≠ 0 := by |
| 43 | intro h |
| 44 | have hh := congrArg Complex.re h |
| 45 | simp at hh |
| 46 | have hh' : (2:ℝ)<p := by exact_mod_cast hp2 |
| 47 | linarith |
| 48 | rw [show -(1+w)=(-1)+(-w) by ring,Complex.cpow_add _ _ hp0,Complex.cpow_neg_one] |
| 49 | have hpow : (p:ℂ)^(-2*w)=((p:ℂ)^(-w))^2 := by |
| 50 | rw [show -2*w=(-w)+(-w) by ring,Complex.cpow_add _ _ hp0,pow_two] |
| 51 | rw [hpow] |
| 52 | have hqn' : 1-(p:ℂ)⁻¹*(p:ℂ)^(-w) ≠ 0 := by |
| 53 | convert hqn using 1 |
| 54 | rw [show -(1+w)=(-1)+(-w) by ring,Complex.cpow_add _ _ hp0,Complex.cpow_neg_one] |
| 55 | rw [inv_mul_eq_div,div_eq_iff hqn'] |
| 56 | field_simp; ring |
| 57 | · have hm : p∉N.primeFactors := fun h => hp (Nat.prime_of_mem_primeFactors h) |
| 58 | simp [hp,hm,baselineEulerTerm,densityEulerTerm] |
| 59 | |
| 60 | lemma densityEulerProduct_eq_zeta_baseline (N : ℕ) (hN : Even N) (hpos : 0 < N) |
| 61 | {w : ℂ} (hw : 0 < w.re) : |
| 62 | densityEulerProduct N w = riemannZeta (1+w)*baselineProductR N w := by |
| 63 | have hz : HasProd (fun p : ℕ => if p.Prime then (1-(p:ℂ)^(-(1+w)))⁻¹ else 1) |
| 64 | (riemannZeta (1+w)) := by |
| 65 | convert ((hasProd_subtype_iff_mulIndicator |
| 66 | (f := fun p : ℕ => (1-(p:ℂ)^(-(1+w)))⁻¹) (s := {p : ℕ | p.Prime})).mp |
| 67 | (riemannZeta_eulerProduct_hasProd (by simp; exact hw))) using 1 |
| 68 | ext p |
| 69 | by_cases hp : p.Prime <;> simp [Set.mulIndicator,hp] |
| 70 | have hf : HasProd (fun p : ℕ => if p∈N.primeFactors then 1-(p:ℂ)^(-1-w) else 1) |
| 71 | (∏ p∈N.primeFactors, (1-(p:ℂ)^(-1-w))) := by |
| 72 | have hh : HasProd (fun p : ℕ => if p∈N.primeFactors then 1-(p:ℂ)^(-1-w) else 1) |
| 73 | (∏ p∈N.primeFactors, if p∈N.primeFactors then 1-(p:ℂ)^(-1-w) else 1) := |
| 74 | hasProd_prod_of_ne_finset_one (fun p hp => ite_eq_right hp) |
| 75 | simpa only [Finset.prod_ite_of_true (fun p hp => hp)] using hh |
| 76 | have hb := (multipliable_one_add_of_summable (baselineEulerTerm_summable_norm N (by linarith : -(1/4:ℝ)<w.re))).hasProd |
| 77 | have he := (multipliable_one_add_of_summable (densityEulerTerm_summable_norm N hw)).hasProd |
| 78 | rw [← densityEulerProduct_eq_tprod] at he |
| 79 | have hprod := (hz.mul hf).mul hb |
| 80 | simp only [baselineProduct_factor N _ hN hpos hw] at hprod |
| 81 | rw [he.unique hprod] |
| 82 | unfold baselineProductR |
| 83 | rw [← mul_assoc] |
| 84 | congr 1 |
| 85 | exact tprod_congr (fun p => baselineEulerTerm_eq N p w) |
| 86 | |
| 87 | end ConditionalGoldbach |
