betaFeedback

Reading v1View latest version

WorksMathematics

An explicit prime gap under the Riemann hypothesis, formalized in Lean with its prime power input made elementary

Abstract

We report on a Lean 4 formalization of Theorem 2 of Dudek, 2015, as numbered in arXiv v2, which states that if the Riemann hypothesis is true, then for every real x≥2x \ge 2 there is a prime in the interval (x−(4/π)xlog⁡x,x](x - (4/\pi)\sqrt{x}\log x, x]. In the formalization, Theorem 2 is proved assuming the Riemann hypothesis and one cited explicit zero-counting bound of Hasanalizade, Shen and Wong, arXiv:2107.06506. Four cited inputs of the printed proof are replaced in the formal proof. The two that carry the argument are these: first, the prime power contribution ψ−θ\psi - \theta is required only across the moving window (x−h,x+h](x - h, x + h] and is proved outright in Lean by an elementary counting argument with no cited input and without assuming the Riemann hypothesis; second, the sum over nontrivial zeros is bounded from the cited Hasanalizade, Shen and Wong zero count for T≥70T \ge 70 by trading slack between the head and tail sums at the split point T=2x/hT = 2x/h. The Riemann hypothesis is open and this note makes no progress on it.

The paper

This note documents a formalization in Lean 4 of the main explicit prime gap theorem from A. W. Dudek, On the Riemann hypothesis and the difference between primes, Int. J. Number Theory 11, 2015, no. 3, 771–778, doi:10.1142/S1793042115500426; preprint arXiv:1402.6417, v2, 20 May 2014 [1]. That paper improves the constant 8/58/5 of Ramaré and Saouter [RaSa, Theorem 1] to 4/π4/\pi. Later work went further: Dudek, Grenié and Molteni [5 Theorem 1.1] proved a prime in a symmetric interval of total length (1+4/log⁡x)xlog⁡x(1+4/\log x)\sqrt{x}\log x, and Carneiro, Milinovich and Soundararajan [3 Theorem 5] proved, under the Riemann hypothesis, that for x≥4x \ge4 there is a prime in [x,x+(22/25)xlog⁡x][x, x + (22/25)\sqrt{x}\log x]. Theorem 2 of [1] is therefore not the best known constant, and this note is about the formal record of its proof. It is written for readers who use or check formal proofs in analytic number theory.

All theorem, lemma and page numbers of [1] in this note are those of arXiv v2. The journal numbering may differ: [3] cites the journal paper with Theorem 1.3 for Theorem 3 of arXiv v2.

The primary focus of this note is Theorem 2 of arXiv v2 of [1]:

Theorem 1.1 (Dudek [1], Theorem 2 of arXiv v2). Suppose the Riemann hypothesis is true. Then there is a prime in the interval

(x−4πxlog⁡x,x]\left(x-\frac{4}{\pi}\sqrt{x}\log x,x\right]

for all x≥2x \ge2.

In addition to Theorem 2, Theorem 1 of [1], which Dudek quotes from Cramér, gives a constant c>0c > 0 such that

π(x+cxlog⁡x)−π(x)>x\pi(x+c\sqrt{x}\log x)-\pi(x)>\sqrt{x}

for all x≥2x \ge2, and Dudek’s Theorem 3 gives a prime in the interval

(x−(1+ε)xlog⁡x,x]\left(x-(1+\varepsilon)\sqrt{x}\log x,x\right]

for all sufficiently large xx. The same Lean entry also proves Theorems 1 and 3 under the same two hypotheses, with c=108c=10^{8} for Theorem 1, whereas the remark of the paper that c=3+εc=3+\varepsilon works for large xx is not part of the entry.

The purpose of this note is to record which inputs the formal proof took and how they differ from those printed in [1]. No discrepancy was found in the steps of Dudek’s argument that were formalized. Theorem 2 is proved assuming the Riemann hypothesis and one cited zero count. The Riemann hypothesis is open and this note makes no progress on it. The binary Goldbach conjecture also remains open and is not treated here.

The mathematical content of this note is two observations. The proof uses ψ−θ\psi-\theta only across a short window, where the prime power mass is O(log⁡2x)O(\log^{2}x) by counting; this is a simplification of this proof over citing Rosser and Schoenfeld. The zero sum can be closed with a zero count whose constant is too large for the separate head and tail bounds, by trading slack at the split point; this is a convenience forced by the chosen input. Neither is claimed as new. The rest of the Lean entry is formalization work.

Outline of the paper’s proof. Section 2 of [1] establishes Theorem 2 using a weight ww on the open interval (x−h,x+h)(x-h,x+h) together with the integrated Chebyshev function

ψ1(x)=∫2xψ(t) dt.\psi_{1}(x)=\int_{2}^{x}\psi(t)\,\mathrm{d}t.

The argument in Section 2 of [1] proceeds through the following steps:

  1. Explicit formula for ψ1\psi_{1}, Lemma 4 of [1]. For x>0x>0, with xx not an integer,

ψ1(x)=x22−∑ρxρ+1ρ(ρ+1)−xlog⁡(2π)+ε(x),∣ε(x)∣<125.\psi_{1}(x)=\frac{x^{2}}{2}-\sum_{\rho}\frac{x^{\rho+1}}{\rho(\rho+1)}-x\log(2\pi)+\varepsilon(x),\qquad\lvert\varepsilon(x)\rvert<\frac{12}{5}.

where the sum runs over the nontrivial zeros ρ\rho of the Riemann zeta function. The printed argument bounds a sum over zeros by 23/2∑ρ1/∣ρ∣22^{3/2}\sum_{\rho}1/\lvert\rho\rvert^{2} and quotes the value of this sum from Davenport [4].

  1. Weighted prime-power sum via second differences, Lemma 5 of [1]. For x>0x>0 and h>0h>0,

∑nΛ(n)w(n)=h−1hΣ+ε(h),∣ε(h)∣<485h,\sum_{n}\Lambda(n)w(n)=h-\frac{1}{h}\Sigma+\varepsilon(h),\qquad\lvert\varepsilon(h)\rvert<\frac{48}{5h},

where Λ\Lambda is the von Mangoldt function and

Σ=∑ρ(x+h)ρ+1−2xρ+1+(x−h)ρ+1ρ(ρ+1).\Sigma=\sum_{\rho}\frac{(x+h)^{\rho+1}-2x^{\rho+1}+(x-h)^{\rho+1}}{\rho(\rho+1)}.

(3) Splitting the sum over zeros. Writing ρ=1/2+iγ\rho= 1/2 + i\gamma under the Riemann hypothesis, the sum Σ\Sigma over nontrivial zeros is split at ∣γ∣=αx/h|\gamma| = \alpha x/h. To bound the head of the sum, the paper uses a zero count, specifically

N(T)<Tlog⁡T2πfor T>15,N(T) < \frac{T \log T}{2\pi} \qquad\text{for } T > 15,

cited as Corollary 1 of Trudgian, Math. Comp. 81, 2012 [Tr]. To bound the tail of the sum, the paper uses Lemma 1 (ii) of Skewes [6].

(4) Passing from Λ\Lambda to primes. To pass from the von Mangoldt function Λ\Lambda to primes, the paper uses, in the paper’s words, Theorem 14 and equation 5.5 of its reference [7], Rosser and Schoenfeld, 1962 [7], namely the two-sided bound

0.98x<ψ(x)−θ(x)<1.11x+3x1/3for x≥121.0.98\sqrt{x} < \psi(x) - \theta(x) < 1.11\sqrt{x} + 3x^{1/3} \qquad\text{for } x \ge121.

(5) Positivity of the lower bound for x≥65000x \ge65000 and finite verification. Choosing α=2\alpha= 2 and

h=2πxlog⁡x,h = \frac{2}{\pi}\sqrt{x}\log x,

the display at the foot of page 6 of arXiv v2 of [1] states that ∑x−h<p≤x+hlog⁡p\sum_{x-h<p\le x+h}\log p, the sum of log⁡p\log p over primes pp in (x−h,x+h](x-h,x+h], exceeds

rhs⁡(x)=h−2π(xx−h+(x+h)3/2x)log⁡(2xh)−1.11x+h−3(x+h)1/3+0.98x−h−485h,\operatorname{rhs}(x) = h - \frac{2}{\pi}\left(\frac{x}{\sqrt{x-h}} + \frac{(x+h)^{3/2}}{x}\right)\log\left(\frac{2x}{h}\right) - 1.11\sqrt{x+h} - 3(x+h)^{1/3} + 0.98\sqrt{x-h} - \frac{48}{5h},

which is positive for all x≥65000x \ge65000. Positivity of rhs⁡(x)\operatorname{rhs}(x) guarantees the existence of a prime in (x−h,x+h](x-h,x+h]. Replacing x+hx+h by xx then yields Theorem 2 from about 66798.7, namely

65000+2π65000log⁡65000.65000 + \frac{2}{\pi}\sqrt{65000}\log65000.

The remaining values of xx below this threshold were checked by computer in the paper, using Mathematica, with no table printed.

What the formal proof does

In the Lean 4 formalization [Palomar, Repo], the main theorem corresponding to Theorem 2 of [1] has the full name

LeanLab.PNTPort.ExplicitPsi1.Trivial.theorem2_of_RH_hsw.

Its exact Lean declaration, together with the interval predicate and width function, is as follows:

theorem theorem2_of_RH_hsw (hRH : RiemannHypothesis)
(hN : LeanLab.Dudek2014.SigmaH.HSWN70 gZ) :
∀ x : R, 2 ≤ x → LeanLab.Dudek2014.PrimeInDudekInterval x
with
def PrimeInDudekInterval (x : R) : Prop :=
∃ p : N, p.Prime ∧ x - dudekH x < p ∧ (p : R) ≤ x
noncomputable def dudekH (x : R) : R := 4 / π * √x * Real.log x

The hypotheses and objects appearing in this statement are defined as follows:

  • RiemannHypothesis is the standard statement of the Riemann hypothesis from Mathlib [Mathlib].

  • gZ is the family of imaginary parts of the zeros of riemannZeta with real part at least −1/2-1/2, which are the nontrivial zeros, indexed with multiplicity given by analyticOrderNatAt.

  • HSWN70 gZ is the one cited input, included explicitly as a hypothesis to the theorem and never declared as an axiom.

The predicate HSWN70 is defined in Lean by:

def HSWN70 (γ : ι → ℝ) : Prop :=
  (∀ T : ℝ, 70 ≤ T → ∀ s : Finset ι,
    ((s.filter (fun i => |γ i| ≤ T)).card : ℝ) ≤ 2 * (Mt T + Rt T)) ∧
  (∀ T t : ℝ, 70 ≤ T → T ≤ t → ∀ s : Finset ι,
    ((s.filter (fun i => T < |γ i| ∧ |γ i| ≤ t)).card : ℝ) ≤
      2 * ((Mt t + Rt t) - (Mt T - Rt T)))

where the main term Mt⁡(T)\operatorname{Mt}(T) and remainder bound Rt⁡(T)\operatorname{Rt}(T) are given by

Mt⁡(T)=T2πlog⁡(T2πe)+78,\operatorname{Mt}(T) = \frac{T}{2\pi} \log\left(\frac{T}{2\pi e}\right) + \frac{7}{8},
Rt⁡(T)=0.1038log⁡T+0.2573log⁡log⁡T+10.2425.\operatorname{Rt}(T) = 0.1038\log T + 0.2573\log\log T + 10.2425.

This hypothesis encodes Corollary 1.2 of Hasanalizade, Shen and Wong, arXiv:2107.06506 [2], which states that

∣N(T)−T2πlog⁡(T2πe)∣≤0.1038log⁡T+0.2573log⁡log⁡T+9.3675for T≥e.\left|N(T) - \frac{T}{2\pi}\log\left(\frac{T}{2\pi e}\right)\right| \le0.1038\log T + 0.2573\log\log T + 9.3675 \qquad\text{for } T \ge e.

In the Lean formalization, this bound is used only for T≥70T \ge70. The Lean definitions add 7/87/8 to the main term and 7/87/8 to the remainder, so that

9.3675+78=10.2425.9.3675 + \frac{7}{8} = 10.2425.

Thus Mt⁡(T)−Rt⁡(T)\operatorname{Mt}(T)-\operatorname{Rt}(T) is exactly the printed lower bound for N(T)N(T), and Mt⁡(T)+Rt⁡(T)\operatorname{Mt}(T)+\operatorname{Rt}(T) is the printed upper bound plus 7/47/4. The factor 2 counts ordinates γ\gamma of both signs, ∣γ∣≤T|\gamma| \le T and T<∣γ∣≤tT < |\gamma| \le t, since N(T)N(T) counts only 0<γ≤T0 < \gamma\le T. Zeros are counted with multiplicity, the standard reading of N(T)N(T), which [2] prints as a set count. Consequently, the hypothesis HSWN70 gZ holds for the actual nontrivial zeros of the Riemann zeta function given Corollary 1.2 of [2], ensuring that theorem2_of_RH_hsw is not vacuous. The cited zero count itself is not proved in Lean.

Table 1 summarizes the relationship between the printed proof in [1] and the formal proof. Four cited inputs of the printed proof are replaced: the zero count of [Tr], the bound of [7], the tail bound of [6] and the value from [4]. The zero count of [2] is a choice of input, not a correction; this note does not examine whether the input of [Tr] also suffices. The smaller differences are these. The Lean definition of ψ1\psi_1 is the sum ∑n≤y(y−n)Λ(n)\sum_{n \le y}(y-n)\Lambda(n), which has the same value as the printed integral for y≥2y \ge2. The Lean form of Lemma 5 adds the side condition h<xh < x, which holds for x≥65000x \ge65000. Lemma 4 is proved by its own route, and integer yy is allowed. Zeros are counted with multiplicity. We present the mathematics of the prime power step and the zero sum in the following two subsections.

ComponentPrinted paper [1]Lean 4 formalization
Zero hypothesisRiemann hypothesisRiemannHypothesis (Mathlib)
Zero count inputTrudgian [Tr], T≥15T \ge15HSWN70_gZ from [2], T≥70T \ge70
Prime power stepCited from [7] for x≥121x \ge121window_holds, proved outright
ψ1\psi_1 error bound∣ε(x)∣<12/5\lvert\varepsilon(x)\rvert< 12/5error bound ≤2.393<12/5\le2.393 < 12/5
Sum ∑ρ1/∣ρ∣2\sum_{\rho} 1/\lvert\rho\rvert^2Value from Davenport [4]Not used, the route of error bound differs
Tail of ∑1/γ2\sum1/\gamma^2Lemma 1 (ii) of Skewes [6]tail_inv_sq, from HSWN70
Large rangex≥65000x \ge65000 (X≳66798.7X \gtrsim66798.7)rhs_pos (x≥65000x \ge65000), X≥66799X \ge66799
Small rangeMathematica check (unprinted)small_range (2≤x<670012 \le x < 67001, kernel)

Table 1. Comparison between the inputs and verification steps printed in Dudek [1] and those used in the Lean 4 formalization.

The prime power step, proved with no cited input

A key observation of the formalization is that the proof of Theorem 2 uses the difference ψ−θ\psi-\theta only through its increment across the window (x−h,x+h](x-h,x+h]. In Lean, this windowed inequality is named SchoenfeldWindow and is proved as the theorem LeanLab.PrimePowerWindow.window_holds:

def SchoenfeldWindow : Prop :=
  ∀ x : ℝ, 65000 ≤ x →
    (psiF (x + hD x) - thetaF (x + hD x)) -
      (psiF (x - hD x) - thetaF (x - hD x)) <
        1.11 * √(x + hD x) + 3 * (x + hD x) ^ (1 / 3 : ℝ) -
          0.98 * √(x - hD x)

where

hD(x)=2πxlog⁡x.hD(x)=\frac{2}{\pi}\sqrt{x}\log x.

The theorem window_holds is proved outright in Lean, assuming no Riemann hypothesis and using no cited input. A companion lemma, schoenfeld_window_of, records that the two-sided bound of Rosser and Schoenfeld [7] cited in the paper implies SchoenfeldWindow; thus the window form is a logical weakening of the printed input and is all that Dudek’s argument requires.

Proposition 2.1 (LeanLab.PrimePowerWindow.window_holds). For every real x≥65000x \ge65000, with h=hD(x)=(2/π)xlog⁡xh=hD(x)=(2/\pi)\sqrt{x}\log x,

(ψ(x+h)−θ(x+h))−(ψ(x−h)−θ(x−h))<1.11x+h+3(x+h)1/3−0.98x−h.(\psi(x+h)-\theta(x+h))-(\psi(x-h)-\theta(x-h))<1.11\sqrt{x+h}+3(x+h)^{1/3}-0.98\sqrt{x-h}.

The proof goes through the following bound on the mass of the window.

Lemma 2.2 (LeanLab.PrimePowerWindow.mass_le_with_diff_eq). Let 1≤a≤b1 \le a \le b be real numbers with b1/3<a1/3+1b^{1/3}<a^{1/3}+1. Then

(ψ(b)−θ(b))−(ψ(a)−θ(a))≤log⁡b2(b−a+1)+(log⁡b)23log⁡2.(\psi(b)-\theta(b))-(\psi(a)-\theta(a))\le\frac{\log b}{2}\left(\sqrt{b}-\sqrt{a}+1\right)+\frac{(\log b)^2}{3\log2}.

Proof. Since ψ(y)=∑n≤yΛ(n)\psi(y)=\sum_{n\le y}\Lambda(n) and θ(y)=∑p≤ylog⁡p\theta(y)=\sum_{p\le y}\log p, the difference ψ(y)−θ(y)\psi(y)-\theta(y) is the sum of Λ(n)\Lambda(n) over non-prime integers n≤yn\le y. Consequently, the left side of the lemma is precisely the von Mangoldt mass of the prime powers pkp^k with k≥2k \ge2 lying in the interval (a,b](a,b].

First, the lemma sum_nonprime_le bounds the non-prime von Mangoldt mass over a natural-number interval (A,B](A,B] with A≤BA \le B:

∑A<n≤Bn not primeΛ(n)≤∑2≤k≤log⁡2Blog⁡Bk⋅#{m∈N:A<mk≤B}.\sum_{\substack{A<n\le B\\ n\ \text{not prime}}} \Lambda(n) \le\sum_{2\le k\le\log_2 B} \frac{\log B}{k}\cdot\#\{m\in\mathbb{N}: A<m^k\le B\}.

Indeed, every non-prime n∈(A,B]n\in(A,B] with Λ(n)≠0\Lambda(n)\ne0 is of the form n=pkn=p^k for a prime pp and an integer k≥2k\ge2 satisfying k≤log⁡2Bk\le\log_2 B. For such nn, its von Mangoldt weight satisfies

Λ(n)=log⁡p=log⁡(pk)k≤log⁡Bk,\Lambda(n)=\log p=\frac{\log(p^k)}{k}\le\frac{\log B}{k},

and for each fixed exponent kk, the map n↦pn\mapsto p is injective.

Second, the lemma count_le bounds the number of kk-th powers in the integer interval (⌊a⌋,⌊b⌋](\lfloor a\rfloor,\lfloor b\rfloor] for real numbers 0≤a≤b0\le a\le b:

#{m∈N:⌊a⌋<mk≤⌊b⌋}≤b1/k−a1/k+1.\#\{m\in\mathbb{N}:\lfloor a\rfloor<m^k\le\lfloor b\rfloor\}\le b^{1/k}-a^{1/k}+1.

Applying these two bounds separates the prime powers in (a,b](a,b] into squares, k=2k=2, and higher powers, 3≤k≤log⁡2b3\le k\le\log_2 b:

  • For k=2k=2, there are at most b−a+1\sqrt{b}-\sqrt{a}+1 squares in (a,b](a,b], each carrying weight log⁡p≤12log⁡b\log p\le\frac{1}{2}\log b.

  • For each 3≤k≤log⁡2b3\le k\le\log_2 b, the bound b1/k<a1/k+1b^{1/k}<a^{1/k}+1 follows from the case k=3k=3 by rpow_sub_mono, so there is at most one kk-th power in (a,b](a,b], by count_le_one, carrying weight log⁡p≤1klog⁡b≤13log⁡b\log p\le\frac{1}{k}\log b\le\frac{1}{3}\log b.

There are at most log⁡b/log⁡2\log b/\log2 exponents kk, which gives the last term. □

Proof of Proposition 2.1. Let h=hD(x)h=h_D(x), a=x−ha=x-h, b=x+hb=x+h, u=x1/6u=x^{1/6}, L=log⁡xL=\log x and M=log⁡bM=\log b. For all x≥65000x\ge65000,

u≥6.34,L≤1.5u+2.32,L≥11,h≤0.63662u3L.u\ge6.34,\qquad L\le1.5u+2.32,\qquad L\ge11,\qquad h\le0.63662u^3L.

These give h≤x/10h\le x/10, so 0.9x≤a0.9x\le a and b≤1.1xb\le1.1x. Hence a≥0.948u3\sqrt{a}\ge0.948u^3, and (b−a)(b+a)=2h(\sqrt{b}-\sqrt{a})(\sqrt{b}+\sqrt{a})=2h gives b−a≤0.6716L\sqrt{b}-\sqrt{a}\le0.6716L. Also a1/3≥0.965u2a^{1/3}\ge0.965u^2 gives b<(a1/3+1)3b<(a^{1/3}+1)^3, so Lemma 2.2 applies. Further L≤M≤L+0.1≤1.5u+2.42L\le M\le L+0.1\le1.5u+2.42.

Since a≤u3≤b\sqrt{a}\le u^3\le\sqrt{b} and u2≤b1/3u^2\le b^{1/3}, the target satisfies

1.11b+3b1/3−0.98a≥0.13u3+3u2.1.11\sqrt{b}+3b^{1/3}-0.98\sqrt{a}\ge0.13u^3+3u^2.

By Lemma 2.2 and 3log⁡2≥2.07943\log2\ge2.0794, the window mass is at most

M2(0.6716M+1)+M22.0794≤0.8168M2+0.5M.\frac{M}{2}(0.6716M+1)+\frac{M^2}{2.0794}\le0.8168M^2+0.5M.

Substituting M≤1.5u+2.42M\le1.5u+2.42, the proof closes with the polynomial inequality

0.8168(1.5u+2.42)2+0.5(1.5u+2.42)<0.13u3+3u2for u≥6.34,0.8168(1.5u+2.42)^2+0.5(1.5u+2.42)<0.13u^3+3u^2\qquad\text{for }u\ge6.34,

which is checked in Lean. □

The zero sum, from the Hasanalizade, Shen and Wong count

The bound on the zero sum Σ\Sigma is formalized as LeanLab.Dudek2014.SigmaH.sigmaBd_of_hsw, with conclusion SigmaBd, which is the bound of Section 2.2 of [1] at α=2\alpha= 2, on page 5 of the arXiv version:

Proposition 2.3 (LeanLab.Dudek2014.SigmaH.sigmaBd_of_hsw). Let γ\gamma be any family of real ordinates satisfying HSWN70, and let Σ\Sigma be the sum of Dudek’s Lemma 5 over ρ=1/2+iγ\rho= 1/2 + i\gamma, written Zr in Lean. For every x≥65000x \ge65000, with h=hD(x)h = \mathrm{hD}(x),

∣Σ∣≤(2xhπx−h+4h(x+h)3/22πx)log⁡(2xh).\lvert\Sigma\rvert\le\left(\frac{2xh}{\pi\sqrt{x-h}}+\frac{4h(x+h)^{3/2}}{2\pi x}\right)\log\left(\frac{2x}{h}\right).

This theorem takes no Riemann hypothesis. The hypothesis enters only in theorem2_of_RH_hsw, through Zr_eq_Zreal, which identifies the sum over the family gZ with the sum over the nontrivial zeros.

The final bound has the same form as the bound in Dudek’s paper. The route differs. From the count HSWN70, with its constant 10.2425, the separate head and tail estimates that would give this form do not both hold near T=70T = 70: the tail inequality

∑∣γ∣>T1γ2≤log⁡TπT\sum_{\lvert\gamma\rvert>T}\frac{1}{\gamma^2}\le\frac{\log T}{\pi T}

needs about T≥170T \ge170, while at the split point T=2x/hT = 2x/h with x≥65000x \ge65000 we only know T≥70T \ge70.

The formal proof keeps the split at T=2x/hT = 2x/h and trades slack between head and tail through four lemmas:

  1. Head slack, head_count. For all T≥70T \ge70, the zero count hypothesis HSWN70 implies

#{∣γ∣≤T}≤Tlog⁡Tπ−(0.89T−22.25−0.502log⁡T).\#\{\lvert\gamma\rvert\le T\}\le\frac{T\log T}{\pi}-(0.89T-22.25-0.502\log T).

so the head count has a positive slack of about 0.89T0.89T below the main term (Tlog⁡T)/π(T\log T)/\pi. Indeed, HSWN70 gives #{∣γ∣≤T}≤2Mt⁡(T)+2Rt⁡(T)\#\{\lvert\gamma\rvert\le T\}\le2\operatorname{Mt}(T)+2\operatorname{Rt}(T), where

2Mt⁡(T)=Tlog⁡Tπ−log⁡(2π)+1πT+74,log⁡(2π)+1π≥0.89.2\operatorname{Mt}(T)=\frac{T\log T}{\pi}-\frac{\log(2\pi)+1}{\pi}T+\frac{7}{4},\qquad\frac{\log(2\pi)+1}{\pi}\ge0.89.

For T≥70T \ge70, the lemma Rt_le gives Rt⁡(T)≤0.251log⁡T+10.25\operatorname{Rt}(T)\le0.251\log T+10.25, so 2Rt⁡(T)≤0.502log⁡T+20.52\operatorname{Rt}(T)\le0.502\log T+20.5, and 7/4+20.5=22.257/4+20.5=22.25. Write S(T)=0.89T−22.25−0.502log⁡TS(T)=0.89T-22.25-0.502\log T for this slack.

  1. Tail with excess, tail_inv_sq. For T≥70T \ge70, partial summation against the second count in HSWN70 gives

∑∣γ∣>T1γ2≤log⁡TπT+E(T)T2,E(T)=1.004log⁡T+41.26−0.25T,\sum_{\lvert\gamma\rvert>T}\frac{1}{\gamma^2}\le\frac{\log T}{\pi T}+\frac{E(T)}{T^2},\qquad E(T)=1.004\log T+41.26-0.25T,

and the excess E(T)E(T) is positive until about T=187T = 187. The lemma slack gives S(T)≥0S(T)\ge0 and 1.1E(T)≤S(T)1.1E(T)\le S(T) for T≥70T \ge70.

  1. Comparison of head and tail weights, weight_ratio. Let

a=h2(x−h)−1/2andB=4(x+h)3/2a=h^2(x-h)^{-1/2}\qquad\text{and}\qquad B=4(x+h)^{3/2}

denote the head weight and tail weight, respectively. If 35h≤x35h \le x, which is equivalent to T=2x/h≥70T = 2x/h \ge70, then

B≤1.1aT2.B \le1.1aT^2.

(4) Combined split bound, split_bound. Let DiD_i denote the second-difference term

Di=(x+h)ρii+1−2xρii+1+(x−h)ρii+1ρi(ρi+1)D_i = \frac{(x+h)\rho_i^{i+1}-2x\rho_i^{i+1}+(x-h)\rho_i^{i+1}}{\rho_i(\rho_i+1)}

for the ii-th zero. Each head term has ∥Di∥≤a\lVert D_i\rVert\le a, by second_diff_small, and each tail term has ∥Di∥≤B/γi2\lVert D_i\rVert\le B/\gamma_i^2, by second_diff_large. The head count and the tail bound give

∑i∥Di∥≤(Tlog⁡Tπ−S(T))a+B(log⁡TπT+E(T)T2).\sum_i \lVert D_i\rVert\le\left(\frac{T\log T}{\pi}-S(T)\right)a+B\left(\frac{\log T}{\pi T}+\frac{E(T)}{T^2}\right).

Using B≤1.1aT2B \le1.1aT^2 and 1.1E(T)≤S(T)1.1E(T) \le S(T), the excess from the tail sum is absorbed into the slack of the head count, which yields

∑i∥Di∥≤Tlog⁡Tπa+Blog⁡TπT.\sum_i \lVert D_i\rVert\le\frac{T\log T}{\pi}a+\frac{B\log T}{\pi T}.

Since ∣Σ∣≤∑i∥Di∥|\Sigma| \le\sum_i \lVert D_i\rVert, substituting T=2x/hT=2x/h, a=h2(x−h)−1/2a=h^2(x-h)^{-1/2}, and B=4(x+h)3/2B=4(x+h)^{3/2}, this upper bound equals the displayed formula in SigmaBd.

The rest of the formal proof

The remaining steps of the formalization connect the explicit formula, the positivity of rhs(x), and the finite prime gap verification to assemble Theorem 2 for all x≥2x \ge2:

  • Lemma 4 and Lemma 5, lemma4_Zpatch. Lemma 4 of [1] is proved in Lean as lemma4_Zpatch, combining the explicit formula psi1_formula and the error estimate error_bound for all y>0y>0 in the form

∣ψ1(y)−(y22−Z(y)−ylog⁡(2π))∣≤2.393,\left|\psi_1(y)-\left(\frac{y^2}{2}-Z(y)-y\log(2\pi)\right)\right|\le2.393,

which is strictly below the printed bound 12/5=2.412/5=2.4. Here Z(y)Z(y) is the zero sum for y>1y>1; for y≤1y\le1 the Lean definition Zpatch takes the value that makes the identity exact, and the proof of Theorem 2 uses ZZ only for y>1y>1. Lemma 5 of [1] then follows by taking the second difference across (x−h,x,x+h)(x-h,x,x+h), giving the error bound 48/(5h)48/(5h).

  • Positivity for x≥65000x \ge65000, rhs_pos. The lemma rhs_pos proves by explicit analytic bounds in Lean that rhs(x) > 0 for every real x≥65000x \ge65000.

  • Large range transfer, theorem2_large_of. From the existence of a prime in (x−hD(x),x+hD(x)](x-hD(x),x+hD(x)] for all x≥65000x \ge65000, the theorem theorem2_large_of deduces PrimeInDudekInterval X for all X≥66799X \ge66799 via the intermediate value theorem and monotonicity, since 65000+(2/π)65000log⁡6500065000+(2/\pi)\sqrt{65000}\log65000 is about 66798.766798.7.

  • Small range verification, small_range. The theorem small_range proves PrimeInDudekInterval x for every real xx satisfying 2≤x<670012 \le x < 67001, with no Riemann hypothesis, by a prime gap scan evaluated by the Lean kernel through decide +kernel. The function gapScan walks the integers of a tier, keeps the last prime seen, and checks n<last+gn < \text{last}+g at each nn, so every such nn has a prime p≤np \le n with n−p<gn-p<g. Table 2 lists the six tiers;

Integers nnGap ggdudekH(tt) at the start tt, about
211.25
3 to 422.42
5 to 624.58
7 to 2246.56
23 to 1991419.15
200 to 670007295.40

Table 2. The tiers of small_range. Each integer nn in a tier has a prime p≤np \leq n with n−p<gn-p < g.

the lemma gaps_big is the last one. Since g≤g \leq dudekH(tt) at the start tt of each tier and dudekH is increasing, the lemma tier gives a prime in the interval. Because the small range [2,67001)[2, 67001) and the large range [66799,∞)[66799,\infty) overlap, theorem2_of_RH_hsw covers all x≥2x \geq2.

Status, cited inputs and data availability

Status of each claim. In Table 3, Kernel means checked by the Lean kernel at the commit below, Text means argued in this note and not in Lean, and Cited means taken from the source and not proved.

ClaimStatusLean name
Theorem 1.1Kernel, given hRH and hNtheorem2_of_RH_hsw
Proposition 2.1Kernel, no hypothesiswindow_holds
Lemma 2.2Kernel, no hypothesismass_le
Proposition 2.3Kernel, given HSWN70sigmaBd_of_hsw
Lemma 4 in the form with 2.393Kernel, no hypothesislemma4_Zpatch
Positivity of rhs(xx)Kernel, no hypothesisrhs_pos
Small rangeKernel, no hypothesissmall_range
HSWN70 gZ follows from Corollary 1.2 of [2]Textnone
Corollary 1.2 of [2]Citedhypothesis hN

Table 3. Status of the claims of this note.

Cited inputs. Table 4 lists every cited input of the printed proof and of the formal proof. Corollary 1.2 of [2] was read in arXiv v1. The other four sources were not read for this note; they are quoted as [1] states them, by page of its arXiv v2.

InputPagePrinted statementUseLean form
Corollary 1.2 of [2]arXiv v1, p. 2, display 1.5∣N(T)−T2πlog⁡T2π∣≤0.1038log⁡T+0.2573log⁡log⁡T+9.3675\left|N(T)-\frac{T}{2\pi}\log\frac{T}{2\pi}\right| \le0.1038\log T+0.2573\log\log T+9.3675 for T≥eT\ge eUsed for T≥70T\ge70, both signs, 7/8 added to Mt and to RtHSWN70 gZ
Corollary 1 of [Tr][1], p. 5N(T)<Tlog⁡T/(2π)N(T)<T\log T/(2\pi) for T>15T>15Replaced by HSWN70none
Theorem 14 and 5.5 of [7][1], p. 60.98x<ψ(x)−θ(x)<1.11x+3x1/30.98\sqrt{x}<\psi(x)-\theta(x)<1.11\sqrt{x}+3x^{1/3} for x≥121x\ge121Replaced by the window boundwindow_holds
Lemma 1 (ii) of [6][1], p. 5Gives the bound on the tail of the zero sumReplaced from HSWN70tail_inv_sq
Value of ∑ρ1/∣ρ∣2\sum_{\rho}1/|\rho|^2, [4][1], p. 4The value of the sum is explicitly knownNot usednone

Table 4. Cited inputs. Printed statement, page, how the proof uses it, and Lean form.

Data availability.

  • Registry entry: Palomar registry PALOMAR-2026-11-01-000028, version 1, https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-01-000028&version=1 [Palomar].

  • Repository: https://github.com/sthubbar/goldbach-lean, directory entries/dudek2014, commit da5cf9edad7896290771dfcab8feee2906399e3d [Repo].

  • Toolchain: Lean and Mathlib version v4.35.0-rc3 [Mathlib].

  • Build: in that directory, run lake exe cache get, lake build and lake comparator --config=comparator-dudek2014.json. A fresh public clone of this commit built 9036 jobs in 1196 s of wall time on a 2 core machine.

  • Axioms and comparator check: The axioms of the compared theorems are solely the standard Lean foundational axioms propext, Quot.sound, and Classical.choice, with 0 sorry. The comparator passed against the challenge file ChallengeDudek2014.lean.

  • Ported files: sixteen files under LeanLab/PNTPort/StrongPNT are from the PrimeNumberTheoremAnd project [PNT], commit c39a751132c88b6e8080b74c74023fd95b3d8be0, Apache-2.0, credited to its contributors.

Steve Hubbard designed the research program and directed this work. AI tools, Claude and Gemini, were used to write the Lean code and draft the text. AI agents also did the checks of the Lean against the source, and no human expert has reviewed the mathematics. The author takes full responsibility for the content.

Independent Researcher

References

  1. [1][Dudek] A. W. Dudek, On the Riemann hypothesis and the difference between primes, Int. J. Number Theory 11 (2015), no. 3, 771–778, doi:10.1142/S1793042115000426, arXiv:1402.6417.arxiv.org/abs/1402.6417
  2. [2][HSW] E. Hasanalizade, Q. S.-N. and P.-J. Wong, Counting zeroes of the Riemann zeta function, J. Number Theory 235 (2022), 219–241, arXiv:2107.06506.
  3. [3][CMS] E. Carneiro, M. B. Milinovich and K. Soundararajan, Fourier optimization and prime gaps, arXiv:1708.04122v2, first posted 2017, doi:10.1417/CMH/467.DOI
  4. [4][Da] H. Davenport, Multiplicative Number Theory, Springer, 1980.DOI
  5. [5][DGM] A. W. Dudek, L. Grenié and G. Molteni, Primes in explicit short intervals on RH, Int. J. Number Theory 12 (2016), no. 5, 1391–1407, arXiv:1503.05403.DOI
  6. [6][Sk] S. Skewes, On the difference π(x) − li(x) II, Proc. London Math. Soc. (3) 5 (1955), 48–70.DOI
  7. [7][RS] J. B. Rosser and L. Schoenfeld, Approximate formulas for some functions of prime numbers, Illinois J. Math. 6, 1962, no. 1, 64–94.

Paper details

vlnc:W_tj2v65xk
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 28

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents