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.Definitions.Arithmetic |
| 4 | import Mathlib.Tactic.NormNum.RealSqrt |
| 5 | |
| 6 | /-! Exact local factors and arithmetic bounds for the source singular series. -/ |
| 7 | public section |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | noncomputable section |
| 11 | open scoped BigOperators ComplexConjugate Topology ContDiff |
| 12 | open MeasureTheory Filter Set Complex |
| 13 | namespace ConditionalGoldbach |
| 14 | |
| 15 | lemma localDensityFactor_eq_liu {p h : ℕ} (hp : 2 < p) : |
| 16 | localDensityFactor p h = MathlibNt.SieveTheory.SingularSeries.liuLocalFactor p h := by |
| 17 | have hp0 : (p : ℝ) ≠ 0 := by exact_mod_cast (show p ≠ 0 by omega) |
| 18 | have hp1 : (p : ℝ) - 1 ≠ 0 := by |
| 19 | have : (2 : ℝ) < p := by exact_mod_cast hp |
| 20 | linarith |
| 21 | unfold localDensityFactor MathlibNt.SieveTheory.SingularSeries.liuLocalFactor |
| 22 | split_ifs <;> field_simp |
| 23 | |
| 24 | lemma localDensityFactor_two {h : ℕ} (hh : Even h) : localDensityFactor 2 h = 2 := by |
| 25 | norm_num [localDensityFactor, hh.two_dvd] |
| 26 | |
| 27 | lemma localDensityFactor_factorization (h : ℕ) (hh : Even h) (hpos : 0 < h) (p : ℕ) : |
| 28 | (if p.Prime then localDensityFactor p h else 1) = |
| 29 | (if p = 2 then (2 : ℝ) else 1) * |
| 30 | (if p ∈ h.primeFactors.filter (fun p => 2 < p) then MathlibNt.SieveTheory.SingularSeries.liuCorrectionFactor p else 1) * |
| 31 | (1 + MathlibNt.SieveTheory.SingularSeries.liuBaseDeviation p) := by |
| 32 | by_cases hp : p.Prime |
| 33 | · by_cases hp2 : p = 2 |
| 34 | · subst p |
| 35 | simp [localDensityFactor_two hh, MathlibNt.SieveTheory.SingularSeries.liuBaseDeviation, Nat.prime_two] |
| 36 | · have hpgt : 2 < p := lt_of_le_of_ne hp.two_le (Ne.symm hp2) |
| 37 | rw [ite_eq_left hp, localDensityFactor_eq_liu hpgt, |
| 38 | MathlibNt.SieveTheory.SingularSeries.liuLocalFactor_eq_correction_mul_base hp hpgt, ite_eq_right hp2, one_mul] |
| 39 | simp [Finset.mem_filter, Nat.mem_primeFactors, hp, hpgt, hpos.ne'] |
| 40 | · have hp2 : p ≠ 2 := by rintro rfl; exact hp Nat.prime_two |
| 41 | have hpm : p ∉ h.primeFactors.filter (fun p => 2 < p) := by |
| 42 | intro hm |
| 43 | exact hp (Nat.prime_of_mem_primeFactors (Finset.mem_filter.mp hm).1) |
| 44 | simp [hp, hp2, hpm, MathlibNt.SieveTheory.SingularSeries.liuBaseDeviation] |
| 45 | |
| 46 | lemma localDensity_hasProd (h : ℕ) (hh : Even h) (hpos : 0 < h) : |
| 47 | HasProd (fun p : ℕ => if p.Prime then localDensityFactor p h else 1) (singularSeries h) := by |
| 48 | have hc : HasProd |
| 49 | (fun p : ℕ => if p ∈ h.primeFactors.filter (fun p => 2 < p) then MathlibNt.SieveTheory.SingularSeries.liuCorrectionFactor p else 1) |
| 50 | (MathlibNt.SieveTheory.SingularSeries.liuCorrection h) := by |
| 51 | convert hasProd_prod_of_ne_finset_one |
| 52 | (s := h.primeFactors.filter (fun p => 2 < p)) |
| 53 | (f := fun p => if p ∈ h.primeFactors.filter (fun p => 2 < p) then MathlibNt.SieveTheory.SingularSeries.liuCorrectionFactor p else 1) |
| 54 | (fun p hp => ite_eq_right hp) using 1 |
| 55 | · unfold MathlibNt.SieveTheory.SingularSeries.liuCorrection |
| 56 | apply Finset.prod_congr rfl |
| 57 | intro p hp |
| 58 | simp only [hp, ite_true] |
| 59 | · infer_instance |
| 60 | have hb : HasProd (fun p : ℕ => 1 + MathlibNt.SieveTheory.SingularSeries.liuBaseDeviation p) MathlibNt.SieveTheory.SingularSeries.liuUniversalProduct := |
| 61 | MathlibNt.SieveTheory.SingularSeries.multipliable_one_add_liuBaseDeviation.hasProd |
| 62 | have ht := ((hasProd_ite_eq (2 : ℕ) (2 : ℝ)).mul hc).mul hb |
| 63 | convert ht using 1 |
| 64 | · ext p |
| 65 | exact localDensityFactor_factorization h hh hpos p |
| 66 | · simp [singularSeries, MathlibNt.SieveTheory.SingularSeries.liuSingularSeries, mul_assoc] |
| 67 | |
| 68 | theorem lemma_4_1_local_density (h : ℕ) (hh : Even h) (hpos : 0 < h) : |
| 69 | (∏' p : ℕ, if p.Prime then localDensityFactor p h else 1) = singularSeries h := |
| 70 | (localDensity_hasProd h hh hpos).tprod_eq |
| 71 | |
| 72 | end ConditionalGoldbach |
