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.Normed.Module.MultipliableUniformlyOn |
| 4 | public import ConditionalGoldbach.Proofs.DensityResidue |
| 5 | |
| 6 | @[expose] public section |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | noncomputable section |
| 10 | open scoped BigOperators ComplexConjugate Topology |
| 11 | open MeasureTheory Filter Set Complex |
| 12 | namespace ConditionalGoldbach |
| 13 | attribute [local instance] Classical.propDecidable |
| 14 | |
| 15 | def baselineEulerTerm (N p : ℕ) (w : ℂ) : ℂ := |
| 16 | 2*densityEulerTerm N p (1+w)-densityEulerTerm N p (1+2*w) |
| 17 | |
| 18 | lemma baselineEulerTerm_eq (N p : ℕ) (w : ℂ) : |
| 19 | 1+baselineEulerTerm N p w = if p.Prime ∧ 2<p ∧ ¬p∣N then |
| 20 | 1+(2*(p:ℂ)^(-w)-(p:ℂ)^(-2*w))/((p:ℂ)*((p:ℂ)-2)) else 1 := by |
| 21 | unfold baselineEulerTerm densityEulerTerm |
| 22 | split_ifs with hp |
| 23 | · have hp0 : (p:ℂ) ≠ 0 := by exact_mod_cast hp.1.ne_zero |
| 24 | have hp2 : (p:ℂ)-2 ≠ 0 := by |
| 25 | intro he |
| 26 | have hr := congrArg Complex.re he |
| 27 | simp at hr |
| 28 | have : (2:ℝ)<p := by exact_mod_cast hp.2.1 |
| 29 | linarith |
| 30 | rw [show -(1+w)=(-1)+(-w) by ring,show -(1+2*w)=(-1)+(-2*w) by ring, |
| 31 | Complex.cpow_add _ _ hp0,Complex.cpow_add _ _ hp0,Complex.cpow_neg_one] |
| 32 | field_simp |
| 33 | · simp |
| 34 | |
| 35 | lemma baselineEulerTerm_bound (N p : ℕ) (w : ℂ) (hw : -(1/4:ℝ)<w.re) : |
| 36 | ‖baselineEulerTerm N p w‖ ≤ 9*‖LSeries.term 1 (3/2:ℂ) p‖ := by |
| 37 | have h1 := densityEulerTerm_bound N p (1/2) (1+w) (by simp; linarith) |
| 38 | have h2 := densityEulerTerm_bound N p (1/2) (1+2*w) (by simp; linarith) |
| 39 | norm_num at h1 h2 |
| 40 | calc |
| 41 | _ ≤ ‖2*densityEulerTerm N p (1+w)‖+‖densityEulerTerm N p (1+2*w)‖ := norm_sub_le _ _ |
| 42 | _ = 2*‖densityEulerTerm N p (1+w)‖+‖densityEulerTerm N p (1+2*w)‖ := by rw [norm_mul]; norm_num |
| 43 | _ ≤ _ := by linarith |
| 44 | |
| 45 | lemma baselineEulerTerm_differentiable (N p : ℕ) : Differentiable ℂ (baselineEulerTerm N p) := by |
| 46 | unfold baselineEulerTerm |
| 47 | apply Differentiable.sub |
| 48 | · exact ((densityEulerTerm_differentiable N p).comp (by fun_prop)).const_mul 2 |
| 49 | · exact (densityEulerTerm_differentiable N p).comp (by fun_prop) |
| 50 | |
| 51 | lemma baselineEulerTerm_summable_norm (N : ℕ) {w : ℂ} (hw : -(1/4:ℝ)<w.re) : |
| 52 | Summable (fun p => ‖baselineEulerTerm N p w‖) := by |
| 53 | have hs := ((LSeriesSummable_one_iff.mpr (by norm_num : (1:ℝ)<(3/2:ℂ).re)).norm).mul_left 9 |
| 54 | exact hs.of_nonneg_of_le (fun _ => norm_nonneg _) (fun p => baselineEulerTerm_bound N p w hw) |
| 55 | |
| 56 | lemma baselineEulerProduct_differentiableOn (N : ℕ) : |
| 57 | DifferentiableOn ℂ (fun w => ∏' p, (1+baselineEulerTerm N p w)) {w : ℂ | -(1/4:ℝ)<w.re} := by |
| 58 | have ho : IsOpen {w : ℂ | -(1/4:ℝ)<w.re} := isOpen_lt continuous_const Complex.continuous_re |
| 59 | have hs : Summable (fun p => 9*‖LSeries.term 1 (3/2:ℂ) p‖) := |
| 60 | ((LSeriesSummable_one_iff.mpr (by norm_num : (1:ℝ)<(3/2:ℂ).re)).norm).mul_left 9 |
| 61 | have hu : TendstoLocallyUniformlyOn |
| 62 | (fun k w => ∏ p ∈ Finset.range k, (1+baselineEulerTerm N p w)) |
| 63 | (fun w => ∏' p, (1+baselineEulerTerm N p w)) atTop {w : ℂ | -(1/4:ℝ)<w.re} := by |
| 64 | apply (tendstoLocallyUniformlyOn_iff_forall_isCompact ho).2 |
| 65 | intro K hKU hK |
| 66 | have hh := hs.hasProdUniformlyOn_nat_one_add hK |
| 67 | (Eventually.of_forall (fun p w hw => baselineEulerTerm_bound N p w (hKU hw))) |
| 68 | (fun p => (baselineEulerTerm_differentiable N p).continuous.continuousOn) |
| 69 | exact hh.tendstoUniformlyOn_finsetRange |
| 70 | apply hu.differentiableOn _ ho |
| 71 | filter_upwards with k |
| 72 | apply Differentiable.differentiableOn |
| 73 | apply Differentiable.fun_finsetProd |
| 74 | intro p hp |
| 75 | exact (differentiable_const (1:ℂ)).add (baselineEulerTerm_differentiable N p) |
| 76 | |
| 77 | lemma baselineProductR_differentiableOn (N : ℕ) : |
| 78 | DifferentiableOn ℂ (baselineProductR N) {w : ℂ | -(1/4:ℝ)<w.re} := by |
| 79 | have he : baselineProductR N = fun w => |
| 80 | (∏ p ∈ N.primeFactors, (1-(p:ℂ)^(-1-w)))*(∏' p, (1+baselineEulerTerm N p w)) := by |
| 81 | funext w |
| 82 | unfold baselineProductR |
| 83 | congr 1 |
| 84 | exact (tprod_congr (fun p => baselineEulerTerm_eq N p w)).symm |
| 85 | rw [he] |
| 86 | apply DifferentiableOn.mul _ (baselineEulerProduct_differentiableOn N) |
| 87 | apply Differentiable.differentiableOn |
| 88 | apply Differentiable.fun_finsetProd |
| 89 | intro p hp |
| 90 | have hp0 : (p:ℂ) ≠ 0 := by exact_mod_cast (Nat.prime_of_mem_primeFactors hp).ne_zero |
| 91 | intro w |
| 92 | exact (differentiableAt_const (c := (1:ℂ))).sub ((by fun_prop : DifferentiableAt ℂ (fun w : ℂ => -1-w) w).const_cpow (Or.inl hp0)) |
| 93 | |
| 94 | lemma baselineProductR_zero (N : ℕ) (hN : Even N) (hpos : 0<N) : |
| 95 | (singularSeries N:ℂ)*baselineProductR N 0=1 := by |
| 96 | have hp : (∏' p:ℕ, if p.Prime ∧ 2<p ∧ ¬p∣N then |
| 97 | 1+(2*(p:ℂ)^(-(0:ℂ))-(p:ℂ)^(-2*(0:ℂ)))/((p:ℂ)*((p:ℂ)-2)) else 1)=densityEulerProduct N 1 := by |
| 98 | rw [densityEulerProduct_eq_tprod] |
| 99 | apply tprod_congr |
| 100 | intro p |
| 101 | rw [← baselineEulerTerm_eq] |
| 102 | simp only [baselineEulerTerm,add_zero,mul_zero] |
| 103 | ring |
| 104 | have ht := congrArg Complex.ofReal (totient_ratio_prod N hpos) |
| 105 | push_cast at ht |
| 106 | have hfin : (∏ p ∈ N.primeFactors, (1-(p:ℂ)^(-1-(0:ℂ))))*((N:ℂ)/N.totient)=1 := by |
| 107 | rw [ht,← Finset.prod_mul_distrib] |
| 108 | have he : ∀ p ∈ N.primeFactors, (1-(p:ℂ)^(-1-(0:ℂ)))*((p:ℂ)/(p-1))=1 := by |
| 109 | intro p hp |
| 110 | have hp0 : (p:ℂ) ≠ 0 := by exact_mod_cast (Nat.prime_of_mem_primeFactors hp).ne_zero |
| 111 | have hp1 : (p:ℂ)-1 ≠ 0 := by |
| 112 | intro he |
| 113 | have hr := congrArg Complex.re he |
| 114 | simp at hr |
| 115 | have : (2:ℝ)≤p := by exact_mod_cast (Nat.prime_of_mem_primeFactors hp).two_le |
| 116 | linarith |
| 117 | simp only [sub_zero,Complex.cpow_neg_one] |
| 118 | field_simp |
| 119 | simp_rw [Finset.prod_congr rfl he,Finset.prod_const_one] |
| 120 | unfold baselineProductR |
| 121 | rw [hp] |
| 122 | calc |
| 123 | _ = (∏ p ∈ N.primeFactors, (1-(p:ℂ)^(-1-(0:ℂ))))*((singularSeries N:ℂ)*densityEulerProduct N 1) := by ring |
| 124 | _ = 1 := by rw [singularSeries_mul_densityEuler_one N hN hpos]; exact hfin |
| 125 | |
| 126 | theorem proposition_A_4_baseline_product (N : ℕ) (hN : Even N) (hN4 : 4 ≤ N) : |
| 127 | (∃ ε : ℝ, 0 < ε ∧ ∀ w : ℂ, ‖w‖ < ε → |
| 128 | Multipliable (fun p : ℕ => if p.Prime ∧ 2 < p ∧ ¬p ∣ N then |
| 129 | 1 + (2 * (p : ℂ) ^ (-w) - (p : ℂ) ^ (-2 * w)) / ((p : ℂ) * ((p : ℂ) - 2)) |
| 130 | else 1) ∧ DifferentiableAt ℂ (baselineProductR N) w) ∧ |
| 131 | (singularSeries N : ℂ) * baselineProductR N 0 = 1 := by |
| 132 | refine ⟨⟨1/4,by norm_num,?_⟩,baselineProductR_zero N hN (by omega)⟩ |
| 133 | intro w hw |
| 134 | have hw' : -(1/4:ℝ)<w.re := by have hh:=Complex.abs_re_le_norm w; have hh' := neg_abs_le w.re; linarith |
| 135 | constructor |
| 136 | · convert multipliable_one_add_of_summable (baselineEulerTerm_summable_norm N hw') using 1 |
| 137 | exact funext (fun p => (baselineEulerTerm_eq N p w).symm) |
| 138 | · exact (baselineProductR_differentiableOn N).differentiableAt |
| 139 | ((isOpen_lt continuous_const Complex.continuous_re).mem_nhds hw') |
| 140 | |
| 141 | end ConditionalGoldbach |
