Machine
Hermeneutics
All guides

Riemann hypothesis · Alpöge and Claude

How far can the primes stray?

Primes bunch up in some stretches and thin out in others. A smooth formula estimates how many you’ll find before a given number. The hard question is how far off that estimate can be. The Riemann hypothesis predicts a remarkably tight limit.

Count the primes

Same space. A different count.

Choose 25–48 and compare its prime count with 1–24. Both strips cover 24 numbers. Each highlighted number is prime. It’s bigger than 1 and you can divide it evenly by only 1 and itself.

From 1 to 24 there are 9 primes. 2, 3, 5, 7, 11, 13, 17, 19, and 23.

Add the first two counts, 9 and 6, and you get 15 primes up to 48. That’s a running total. The Riemann hypothesis concerns how far that total can stray from a smooth estimate as you count much higher. See where the error comes from.

What would one zero change about the primes?

Think of the gap between the actual prime count and the smooth estimate as a signal. A classic formula for a weighted count breaks that signal into waves. Each wave comes from a pair of places where a function called zeta equals zero. The farther right a zero sits, the faster its wave can grow as you count higher.

Move one hypothetical zero

A zero’s horizontal coordinate is called its real part. Try 0.50, the middle line, then 0.67. Watch the wave on the right as you count farther.

Gold is the wave from one pair of zeros. The pale dashed envelope gives the largest possible swing. The green lines mark one square-root unit in each direction.
0.50
k = 8
Amplitude relative to the square-root scale1.00×

At real part 0.50, the amplitude grows like the square root of x. It stays at 1.00× on this relative scale.

Use this zero in the cutoff test

On the middle line, counting 100 times farther multiplies the wave’s maximum swing by 10, because √100 = 10. The graph divides out that square-root growth so you can see when a wave outruns it. A separate theorem connects a bound on the weighted prime error to places where zeros can’t sit. Put that bound on a map.

Read the exact expression behind the chart

In von Mangoldt’s explicit formula for the weighted prime count ψ, the pair ρ = β ± iγ contributes −2 Re(x^ρ/ρ), taking ρ with positive imaginary part. Divide that term by 2√x/|ρ|. The wave shown here is −x^(β−½) cos(γ log x − arg ρ), using natural log and an illustrative height γ = 3. The graph singles out this pair. The proof uses a different weighted prime remainder, described below.

What would it take to eliminate an entire side?

The nontrivial zeros are the ones in question. The hypothesis puts all of them on the line with real part ½, at any height. A particular bound on a weighted sum of primes rules out zeros strictly to the right of a cutoff. The functional equation gives a reflected zero if there is one on either side, so the same bound rules out a region on the left.

Close the window

Start with the zero at 0.67. Try cutoffs of 0.70, 0.67 and 0.60. Which is the first to rule it out?

0.70
0.67
Shaded regions are excluded if the corresponding prime bound holds. The dots are hypothetical and the vertical positions are illustrative.

The cutoff is 0.70. A proposed zero at 0.67 and its mirror at 0.33 fall inside the window.

Try putting the zero at 0.50. No allowable cutoff can exclude the critical line.

Why one cutoff is only one step

If an off-line zero had real part 0.67, a bound at β = 0.60 would eliminate it. To eliminate every number greater than ½, prove the bound for every β > ½. Between ½ and any proposed real part to its right there is a cutoff that excludes it. Reflection handles the left side. The strict inequality at the cutoff is why the position at ½ is allowed.

Moving the cutoff is easy here because you can assume the bound. In the proof, getting a strong enough bound is the hard step. Try the choice Claude made.

How many times should you repeat the step?

The proof needs a tight upper limit on the error in a weighted count of primes. Repeating an algebraic step tightens that limit. Hold the other factors fixed and a chain of m steps leaves 1/m of the original ceiling. Find the shortest chain here that reaches the target.

Length of the prime sum10,000

Your goal is a ceiling of 1/100 or lower.

Normalized error ceiling1/m Target ≤ 1/100

Shorter chains do less work. Try one and see how much error the bound still allows.

The actual proof also has to control the other factors and build a chain of the required length. See where the division by m comes from.

Where the square root enters

The proof constructs a chain of operations on modular forms, called theta lifts. It compares an upper and a lower estimate for the same lattice quantity. The common height term cancels. What survives is an inequality in which the prime remainder is multiplied by the length m of the chain.

m · rem ≤ f · a · (log b)⁵

This is the proof’s starred inequality. The other symbols are positive quantities in the construction. Divide both sides by m and the rest of the right side to isolate the effect of making the chain longer.

Watch the ceiling shrink

Move from k = 6 to k = 8. A hundredfold increase in x makes the chain ten times as long. See what happens to the upper bound.

k = 6
Scale x1,000,000
Chain length m1,000
Normalized remainder ceiling 1/m0.001
Left to right, each increase in k multiplies x by 10. The ceiling uses a logarithmic scale, so one labeled step down divides it by 10.

At this scale, dividing by the chain length makes the normalized ceiling 1,000 times smaller than for one lift.

Find enough short forms

Theorems A and B give an upper estimate for the normalized size. It contains the base height H minus m · rem, plus error.

Bound integrality from below

Theorem C puts the same size above the base height H minus error. Its leverage comes from comparing sizes with divisibility at the primes.

Cancel the base height

The two estimates must agree on the same range. The prime remainder multiplied by m can be no larger than the combined error.

Make the two estimates agree

Both estimates talk about the same unknown number. Their allowed ranges have to overlap. Start by doubling the chain length from 2 to 4. Can an error of 3 still fit?

Chain length m
3
Base height H 20
At least 17 At most 19

The ranges share 17 to 19. A remainder of 3 could fit. The largest possible remainder is 4.

Follow the algebra with these numbers

For this model the lower estimate is H − 3 and the upper one is H − mR + 5. The lower estimate has to be at most the upper one. Cancel H from both sides and you get mR ≤ 8, or R ≤ 8/m. Changing H moves both ranges together. The two allowances, 3 and 5, are illustrative. The actual proof bounds the corresponding terms.

The full argument relates that normalized inequality to a particular prime remainder Rq₀(x) and controls the other scales. It obtains a one-sided bound of order x^(−1/2 + ε). Choosing ε smaller than β − ½ supplies the cutoff bound x^(β−1) used above.

In the first exercise β described a position on the zero diagram. Here x is how far the prime sum runs. The analytic criterion connects the two. It turns decay as x grows into a restriction on where a zero could be.

The weighted prime sum and Landau’s criterion

The reduction uses nonnegative weights on integers in the class 1 modulo a chosen modulus q₀. The weights combine the von Mangoldt function, which picks out prime powers, with a quadratic character. It smooths them by multiplying by 1/n − 1/x for n ≤ x, then subtracts a logarithmic main term and a constant. For the proof’s admissible choices, a bound R(x) ≤ x^(β−1) for all sufficiently large x implies a zero-free region to the right of β for the relevant Dirichlet L-functions. The compact proof calls this step entireL_ne_zero_of_primeError_le.

The exercise isolates the division by m. The complete proof also justifies the cancellation, the field and scale choices, the analytic criterion, and coverage of all moduli.

What the proof measures in the lattice

A lattice has a covolume, the volume spanned by a basis. The proof tracks logarithmic covolumes of lifts of automorphic forms at the complex embeddings, with a correction for the arithmetic index. Theorems A and B supply a family with small norms that spans nearly all the target space. Theorem C uses the product formula for heights to relate size at the complex embeddings to prime-by-prime valuations. Factoring the chain into individual lifts makes its contribution measurable. See section 7 of the technical guide below.

Try the idea on a new case

What if the cutoffs stop at 0.55?

Suppose you can prove the bound for every cutoff strictly greater than 0.55. Could a zero at 0.53 still survive?

It could still be there.

Yes. To exclude 0.53 you need a permitted cutoff smaller than 0.53. You would need bounds all the way down toward 0.50 to finish the argument.

All those cutoffs would rule it out.

Try imagining the striped area starting at 0.56. The point at 0.53 remains inside the window. Bringing the cutoff down to 0.551 still leaves it inside.

Try that reasoning in the zero diagram ↑

Read the argument and its checks

Alpöge announced the original Lean development on 20 November. The Lean community checked that it proves Mathlib’s statement of the Riemann hypothesis and reported independent verification of the formal proof. Luke Sernau and collaborators later published a shorter version. These sources show where a proof checker supplies assurance and where a reader can investigate the mathematical reasoning.

Another discoveryWhat shape wastes the most space?

Watch two incompatible bounds rule out a whole family of shapes.