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.Characters |
| 4 | public import ConditionalGoldbach.Definitions.Hardy |
| 5 | public import ConditionalGoldbach.Definitions.Hilbert |
| 6 | public import ConditionalGoldbach.Definitions.Weights |
| 7 | public import Mathlib.Analysis.MellinTransform |
| 8 | public import Mathlib.MeasureTheory.Function.L2Space |
| 9 | public import Mathlib.NumberTheory.ArithmeticFunction.Defs |
| 10 | public import Mathlib.NumberTheory.DirichletCharacter.Orthogonality |
| 11 | |
| 12 | /-! Experiment definitions used by the conditional Goldbach formalization. -/ |
| 13 | @[expose] public section |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | noncomputable section |
| 17 | open scoped BigOperators ComplexConjugate Topology |
| 18 | open MeasureTheory Filter Set Complex |
| 19 | namespace ConditionalGoldbach |
| 20 | attribute [local instance] Classical.propDecidable |
| 21 | attribute [local instance] conductorNeZero |
| 22 | |
| 23 | abbrev experimentN : ℕ := 30030 |
| 24 | |
| 25 | def cutoffPolynomial (t : ℝ) : ℝ := |
| 26 | if t ≤ 0 then 0 else if 1 ≤ t then 1 else |
| 27 | ∑ j ∈ Finset.Icc 7 13, (Nat.choose 13 j : ℝ) * t ^ j * (1 - t) ^ (13 - j) |
| 28 | |
| 29 | def wideCutoff (x : ℝ) : ℝ := |
| 30 | cutoffPolynomial ((x - 16) / (1000 - 16)) * |
| 31 | cutoffPolynomial ((experimentN - x - 16) / (1000 - 16)) |
| 32 | |
| 33 | def wideCompanion (u : ℝ) : ℝ := |
| 34 | if u ∈ Ioo (16 / experimentN : ℝ) (1 - 16 / experimentN : ℝ) then |
| 35 | Real.sqrt (1 - u) * wideCutoff (experimentN * u) / |
| 36 | Real.sqrt (Real.log (experimentN * u) * Real.log (experimentN * (1 - u))) else 0 |
| 37 | |
| 38 | def wideWeight (u : ℝ) : ℝ := wideCompanion u / Real.sqrt u |
| 39 | |
| 40 | def wideCorrelation : ℝ := goldbach experimentN wideWeight |
| 41 | |
| 42 | def unorderedPrimePairs : ℕ := ((Finset.range (experimentN + 1)).filter |
| 43 | (fun p => p.Prime ∧ (experimentN - p).Prime ∧ p ≤ experimentN - p)).card |
| 44 | |
| 45 | def edgeCorrection : ℝ := ∑ p ∈ Finset.range 1000, |
| 46 | if p.Prime ∧ (experimentN - p).Prime ∧ p ≤ experimentN - p |
| 47 | then 1 - wideCutoff p ^ 2 else 0 |
| 48 | |
| 49 | def primePowerCorrection : ℝ := |
| 50 | ∑ p ∈ Finset.range (experimentN + 1), ∑ q ∈ Finset.range (experimentN + 1), |
| 51 | ∑ k ∈ Finset.range (experimentN + 1), ∑ l ∈ Finset.range (experimentN + 1), |
| 52 | if p.Prime ∧ q.Prime ∧ 0 < k ∧ 0 < l ∧ 2 ≤ max k l ∧ |
| 53 | p ^ k + q ^ l = experimentN ∧ Nat.Coprime (p * q) experimentN |
| 54 | then wideCutoff (p ^ k) ^ 2 / (k * l : ℕ) else 0 |
| 55 | |
| 56 | def countingCoefficient (n : ℕ) : ℝ := mangoldt n / Real.sqrt n * wideCompanion (n / experimentN) |
| 57 | |
| 58 | def countingIntegral (χ : Character experimentN) : ℂ := |
| 59 | verticalMellin 1 (fun s => (experimentN : ℂ) ^ s * |
| 60 | mellin (fun u => (wideCompanion u : ℂ)) s * logDerivative χ s) |
| 61 | |
| 62 | def diagonalCountingMoment : ℝ := ∑ n ∈ Finset.range experimentN, |
| 63 | if Nat.Coprime n experimentN then countingCoefficient n ^ 2 else 0 |
| 64 | |
| 65 | def approxSignedMoment (Ihat : Character experimentN → ℂ) : ℝ := |
| 66 | (5760 : ℝ)⁻¹ * (∑ χ : Character experimentN, (χ (-1)).re * ‖Ihat χ‖ ^ 2) |
| 67 | |
| 68 | def approxDiagonalMoment (Ihat : Character experimentN → ℂ) : ℝ := |
| 69 | (5760 : ℝ)⁻¹ * ∑ χ : Character experimentN, ‖Ihat χ‖ ^ 2 |
| 70 | |
| 71 | def wideModelMass : ℝ := ∫ u in (0 : ℝ)..1, wideWeight u * wideWeight (1 - u) |
| 72 | |
| 73 | def wideResidual : ℝ := wideModelMass * singularSeries experimentN - wideCorrelation |
| 74 | |
| 75 | def approxPrimeCount (Ihat : Character experimentN → ℂ) : ℝ := |
| 76 | (experimentN : ℝ) / 2 * approxSignedMoment Ihat - primePowerCorrection / 2 + edgeCorrection |
| 77 | |
| 78 | def countError (Ihat : Character experimentN → ℂ) (ε : ℝ) : ℝ := |
| 79 | (experimentN : ℝ) / 2 * (2 * Real.sqrt (approxDiagonalMoment Ihat) * ε + ε ^ 2) |
| 80 | |
| 81 | def wideFunctional {a : ℝ} (h : HardySpace a beta) : ℂ := |
| 82 | verticalMellin sigmaStar (fun s => (experimentN : ℂ) ^ s * |
| 83 | mellin (fun u => (wideCompanion u : ℂ)) s * (1 + s) * fourierLaplace h s) |
| 84 | |
| 85 | def wideRieszVector : HardySpace (alpha experimentN) beta := |
| 86 | if h : ∃ v : HardySpace (alpha experimentN) beta, ∀ f, wideFunctional f = paperInner f v |
| 87 | then Classical.choose h else 0 |
| 88 | |
| 89 | def wideMainIntegral : ℝ := singularSeries experimentN * |
| 90 | ∫ x in (16 : ℝ)..((experimentN : ℝ) / 2), |
| 91 | wideCutoff x ^ 2 / (Real.log x * Real.log ((experimentN : ℝ) - x)) |
| 92 | |
| 93 | def HasMomentError (Ihat : Character experimentN → ℂ) (ε : ℝ) : Prop := |
| 94 | 0 ≤ ε ∧ (5760 : ℝ)⁻¹ * ∑ χ : Character experimentN, |
| 95 | ‖countingIntegral χ - Ihat χ‖ ^ 2 ≤ ε ^ 2 |
| 96 | |
| 97 | end ConditionalGoldbach |
