Riemann hypothesis: the Lean proof, cleaned up together
The 2026 Lean proof of the Riemann hypothesis and GRH, machine-checked by others, not refereed, no word from Clay; cleaned up together: more readable, faster to build, the theorems unchanged

| 1 | # From a one-sided bound on the primes to a zero-free half-plane |
| 2 | |
| 3 | This is the chapter asked for by #30 (T-6). It states and proves in prose the criterion |
| 4 | `New.LFunction_ne_zero_of_primeRemainder_le` of `src/New/Reduction/Zeros/Criterion.lean`, and says |
| 5 | how the prime number theorem `New.eventually_abs_primeRemainder_exp_le_inv_pow` of |
| 6 | `src/New/Reduction/Zeros/PrimeNumberTheorem.lean` enters. It does not prove the one-sided bound |
| 7 | itself: that bound is the rest of the proof. |
| 8 | |
| 9 | ## 1. The objects |
| 10 | |
| 11 | Fix a modulus `q` and a prime `d`, and let `χ_K = (·/d)` be the Legendre symbol, which Lean calls |
| 12 | `chiK d`. The weight |
| 13 | |
| 14 | `λ(n) = Λ(n) (1 - χ_K(n))` for `n ≡ 1` mod `q`, and `0` otherwise, |
| 15 | |
| 16 | is `New.lambdaKResidueClass d q`. It is nonnegative, because `0 ≤ 1 - χ_K(n) ≤ 2` |
| 17 | (`New.lambdaKResidueClass_nonneg`, `New.one_sub_chiK_mem_Icc`), and at most `2 Λ(n)`. |
| 18 | |
| 19 | The mean of logarithmic derivatives |
| 20 | |
| 21 | `G_q(s) = (∑_ψ (logDeriv E_{ψχ_K}(s) - logDeriv E_ψ(s)) - 1) / φ(q)`, |
| 22 | |
| 23 | summed over the characters `ψ` mod `q`, is `New.logDerivMean d q`. Here `E_ψ = entireL ψ` is |
| 24 | `L(s, ψ)`, multiplied by `s - 1` when `ψ` is principal, and `ψχ_K = quadTwist ψ d`. |
| 25 | |
| 26 | The remainder is |
| 27 | |
| 28 | `R_q(x) = ∑_{n ≤ x} λ(n) (1/n - 1/x) - log x / φ(q) - c_q`, with `c_q = re G_q(1)`, |
| 29 | |
| 30 | and is `New.primeRemainder d q`. The constant `c_q` is the one for which `R_q(x) → 0`; §5 says how |
| 31 | the prime number theorem identifies it. |
| 32 | |
| 33 | ## 2. The statement |
| 34 | |
| 35 | **Criterion** (`New.LFunction_ne_zero_of_primeRemainder_le`). Let `q₀` be a positive multiple of |
| 36 | `8`, let `d₀` be a prime with `d₀ ≡ 7` mod `8` and `d₀` coprime to `q₀`, and let `β > 1/2`. Suppose |
| 37 | that for every prime `d ≡ d₀` mod `q₀` there is `A` with |
| 38 | |
| 39 | `R_{q₀}(x) ≤ A x^(β - 1)` for all large real `x`. |
| 40 | |
| 41 | Then for every character `ψ` mod `q₀` and every `ρ ≠ 1` with `re ρ > β`, one has `L(ρ, ψ) ≠ 0`. |
| 42 | |
| 43 | In Lean the primes are quantified as `d : Primes` with `(d : ℕ) ≡ d₀ [MOD q₀]`, the bound is |
| 44 | `h_bound`, and the conclusion is `ψ.LFunction ρ ≠ 0` under `hρ_ne : ρ ≠ 1` and |
| 45 | `hρ_re : β < ρ.re`. |
| 46 | |
| 47 | So a bound on the primes `≡ 1` mod `q₀` — one-sided, and only for the primes of one class mod |
| 48 | `q₀` — forces a zero-free half-plane for all characters mod `q₀`. Nothing is assumed about real |
| 49 | zeros: the argument below excludes them together with the complex ones. |
| 50 | |
| 51 | ## 3. One prime: the two zero counts agree |
| 52 | |
| 53 | **Lemma** (`New.sum_entireL_orders_eq_twisted_of_primeRemainder_le`). Let `d` be a prime with |
| 54 | `d ≡ 7` mod `8`, coprime to `q`, let `β > 0`, and suppose |
| 55 | |
| 56 | `R_q(x) ≤ A x^(β - 1)` for all large `x`, |
| 57 | |
| 58 | and that on the real interval `(β, 1)` the total order of the twisted zeros does not exceed the |
| 59 | untwisted one: |
| 60 | |
| 61 | `∑_χ ord_x E_{χχ_K} ≤ ∑_χ ord_x E_χ` for `β < x < 1`. |
| 62 | |
| 63 | Then at every `ρ` with `re ρ > β` the two total orders agree, with multiplicities: |
| 64 | |
| 65 | `∑_χ ord_ρ E_χ = ∑_χ ord_ρ E_{χχ_K}`. |
| 66 | |
| 67 | The proof has four steps. |
| 68 | |
| 69 | *The transform and its residues.* Define `n(s) = ∑_χ ord_s E_χ` and |
| 70 | `n'(s) = ∑_χ ord_s E_{χχ_K}`, and |
| 71 | |
| 72 | `r(s) = (n(s) - n'(s)) / (φ(q) s (1 - s))`. |
| 73 | |
| 74 | `New.isPolar_primeRemainder` says that `v ↦ R_q(e^v)` has a Laplace transform which converges for |
| 75 | `re s > 2` and continues meromorphically to `re s > 0` with at most simple poles, whose residue at |
| 76 | `s ≠ 1` is exactly `r(s)`, and with no pole at `1`. That is the statement `New.IsPolar` with |
| 77 | residue `r`, obtained from `New.tendsto_logDerivMean_residue` and the vanishing of the numerator |
| 78 | at `1` (`New.ofReal_re_logDerivMean_one`). |
| 79 | |
| 80 | *The sign on the real interval.* For real `x` with `β < x < 1` the assumed inequality |
| 81 | `n'(x) ≤ n(x)` and the positivity of `φ(q) x (1 - x)` give `re (r x) ≥ 0`. For real `x ≥ 1` both |
| 82 | counts vanish, since no `L(s, ψ)` vanishes for `re s ≥ 1` (`New.entireL_ne_zero`), so again |
| 83 | `re (r x) = 0`. Thus the residue has nonnegative real part at every real point right of `β`. |
| 84 | |
| 85 | *The growth condition.* The assumed one-sided bound, read at `x = e^v`, is |
| 86 | `R_q(e^v) ≤ A e^((β - 1) v)` for all large `v`; this is `exp_bound` in the Lean proof. |
| 87 | |
| 88 | *Landau's lemma.* `New.IsPolar.landau` applies to a transform of one sign: if the residues at real |
| 89 | points right of `β` have nonnegative real part and the transform grows at most like |
| 90 | `e^((β - 1) v)`, then there is no pole right of `β`, i.e. `r(ρ) = 0`. Hence `n(ρ) = n'(ρ)`, first |
| 91 | as complex numbers and then as natural numbers. This is Landau's lemma of 1905, the same device |
| 92 | that turns a one-sided prime bound into a zero-free region in the classical proofs. |
| 93 | |
| 94 | ## 4. Choosing the prime, and closing the argument |
| 95 | |
| 96 | **Lemma** (`New.exists_entireL_quadTwist_ne_zero`). Let `β > 1/2`, let `H` be real, and let `a` be |
| 97 | an invertible class mod `N` all of whose primes are `≡ 7` mod `8` and coprime to `N`. Then some |
| 98 | prime `d` of that class has no zero of any `L(s, ξ (·/d))`, `ξ` mod `N`, in the box |
| 99 | `β ≤ re s`, `|im s| ≤ H`. |
| 100 | |
| 101 | This lemma is where `β > 1/2` is used, and it needs no prime number theorem: the bound on bad |
| 102 | primes is played against the divergence of `∑ log p / p` over the class (Dirichlet), through the |
| 103 | zero-density estimate `New.zero_density_quadTwist` of `src/Lib/Analytic/QuadraticTwist.lean`. |
| 104 | |
| 105 | *Proof of the criterion.* Apply the choice lemma with `N = q₀`, `a = d₀`, `H = |ρ.im|`; the |
| 106 | hypotheses on the class are supplied by `d₀ ≡ 7` mod `8` and `(d₀, q₀) = 1`, using `8 ∣ q₀`. Let |
| 107 | `d` be the prime it returns. At every `s` with `β ≤ re s` and `|im s| ≤ |ρ.im|` all twisted |
| 108 | `L`-functions are nonzero, so the twisted total order at `s` is `0`; in particular the hypothesis |
| 109 | `hreal` of the lemma of §3 holds, with `0 ≤ n(x)` on `(β, 1)`. The bound for this `d` is the one |
| 110 | assumed for the class. The lemma of §3 then gives `∑_χ ord_ρ E_χ = 0`. A sum of natural numbers is |
| 111 | zero only if every term is, so `ord_ρ E_ψ = 0` for every `ψ`, that is `L(ρ, ψ) ≠ 0`. Since |
| 112 | `ρ ≠ 1`, `E_ψ` and `L(·, ψ)` agree at `ρ`, and the conclusion follows. |
| 113 | |
| 114 | ## 5. Where the prime number theorem enters |
| 115 | |
| 116 | **Theorem** (`New.eventually_abs_primeRemainder_exp_le_inv_pow`). Let `d` be an odd prime coprime |
| 117 | to `q`, and let `B` be a natural number. Then for all large real `v`, |
| 118 | |
| 119 | `|R_q(e^v)| ≤ 1 / v^B`. |
| 120 | |
| 121 | The proof applies a Tauberian theorem (`New.eventually_abs_le_inv_pow_of_transform`) to the |
| 122 | Laplace transform of `v ↦ R_q(e^v)`, which is `(G_q(s)/s - c_q)/(s - 1)` by |
| 123 | `New.integral_primeRemainder`, and uses the holomorphy and growth of `G_q(s)/s` on |
| 124 | `re s ≥ 1 - l^(-26)`, `|s| ≤ e^l` (`New.eventually_norm_logDerivMean_div_le`). |
| 125 | |
| 126 | The theorem enters the chapter at three places, and it is worth separating them. |
| 127 | |
| 128 | 1. *The constant.* With `B = 1` it gives `R_q(x) → 0`, so the subtracted `c_q = re G_q(1)` is the |
| 129 | constant that makes the remainder tend to zero, as the docstring of `New.primeRemainder` |
| 130 | records. |
| 131 | |
| 132 | 2. *The tail in the one-sided bound.* In `src/New/Reduction/OneSidedBound.lean` the theorem is |
| 133 | used with `B ≥ 24/ε`: for every large integer `x` and every `l ≥ x^(ε/12)`, |
| 134 | `|R_{q₀}(e^l)| ≤ x^(-2)` and `|R_1(e^l)| ≤ x^(-2)` (`New.eventually_abs_primeRemainder_exp_le`). |
| 135 | These two bounds are two of the three terms inserted into `New.Data.primeRemainder_le`, and |
| 136 | they yield the one-sided bound at integers, |
| 137 | `R_{q₀}(x) ≤ (64 φ(q₀) + 3) x^(-1/2 + 6ε)` |
| 138 | (`New.eventually_primeRemainder_natCast_le`). That is the shape fed into the criterion, with |
| 139 | `β = 1/2 + 6ε`. |
| 140 | |
| 141 | 3. *What it cannot do.* The theorem gives logarithmic decay, `1/(log x)^B`, which is slower than |
| 142 | every power `x^(-δ)`, `δ > 0`. It therefore cannot supply the hypothesis |
| 143 | `R_q(x) ≤ A x^(β - 1)` of the criterion for any `β < 1`: that hypothesis is polynomial decay, |
| 144 | and it is what the main inequality establishes, not what the prime number theorem gives. The |
| 145 | theorem only makes the remainder small enough that the main inequality can absorb it. |
| 146 | |
| 147 | ## 6. What this chapter does not show |
| 148 | |
| 149 | The one-sided bound `R_q(x) ≤ A x^(β - 1)` itself. The criterion is conditional on it; the |
| 150 | argument above converts it into the absence of zeros, and stops there. The bound is the content |
| 151 | of the rest of the proof. |
| 152 | |
| 153 | ## 7. Declarations used |
| 154 | |
| 155 | | Declaration | What it says here | |
| 156 | |---|---| |
| 157 | | `New.lambdaKResidueClass` | the weight `λ(n) = Λ(n)(1 - χ_K(n))` on `n ≡ 1` mod `q`, `0` elsewhere | |
| 158 | | `New.logDerivMean` | the mean `G_q` of the differences of logarithmic derivatives, less `1/φ(q)` | |
| 159 | | `New.primeRemainder` | the remainder `R_q(x)`, with `c_q = re G_q(1)` | |
| 160 | | `New.isPolar_primeRemainder` | the transform of `v ↦ R_q(e^v)` has at most simple poles, residue `r(s)`, none at `1` | |
| 161 | | `New.IsPolar.landau` | Landau's lemma: no pole right of `β` under a one-sided bound and nonnegative residues | |
| 162 | | `New.sum_entireL_orders_eq_twisted_of_primeRemainder_le` | at one prime, the twisted and untwisted total orders agree right of `β` | |
| 163 | | `New.exists_entireL_quadTwist_ne_zero` | a prime of the class whose quadratic twists have no zero in the box | |
| 164 | | `New.LFunction_ne_zero_of_primeRemainder_le` | the criterion: `L(ρ, ψ) ≠ 0` for `ρ ≠ 1`, `re ρ > β` | |
| 165 | | `New.eventually_abs_primeRemainder_exp_le_inv_pow` | the prime number theorem for `R_q`: `|R_q(e^v)| ≤ 1/v^B` | |
| 166 | | `New.eventually_abs_primeRemainder_exp_le` | with `B ≥ 24/ε`, the tail is `≤ x^(-2)` beyond `x^(ε/12)` | |
| 167 | | `New.eventually_primeRemainder_natCast_le` | the resulting one-sided bound `R_{q₀}(x) ≤ (64φ(q₀)+3) x^(-1/2+6ε)` | |