Skip to content
The Lumenary
First-year graduateGraduate 150 min

Analytic number theory

Counting primes with complex analysis — the Euler product, the Riemann zeta function and its zeros, the prime number theorem, primes in arithmetic progressions, and the open Riemann hypothesis.

Formally verified · 17 LeanComputationally tested · 2 PythonAI-drafted · awaiting human reviewMathematically reviewed: Awaiting human review
MotivationH

How many primes are there below a million?

Euclid proved that the primes never run out. But how thinly are they spread? Around 1792, the teenage Carl Friedrich Gauss counted the primes in blocks of a thousand from tables and observed that near xx about one number in log⁡x\log x is prime (natural logarithm). So the number of primes up to xx should be roughly

π(x)≈xlog⁡xor, better,π(x)≈li⁡(x)=∫0xdtlog⁡t.\pi(x) \approx \frac{x}{\log x} \qquad\text{or, better,}\qquad \pi(x) \approx \operatorname{li}(x) = \int_0^x \frac{dt}{\log t}.

For x=106x = 10^6: π(x)=78498\pi(x) = 78498, x/log⁡x≈72382x/\log x \approx 72382, and li⁡(x)≈78628\operatorname{li}(x) \approx 78628. Proving that π(x)/(x/log⁡x)→1\pi(x)/(x/\log x) \to 1 — the prime number theorem — took a century and a new idea: Bernhard Riemann's 1859 memoir, which studied the primes through the complex function

ζ(s)=∑n=1∞1ns=∏p11−p−s(Re⁡s>1),\zeta(s) = \sum_{n=1}^\infty \frac{1}{n^s} = \prod_{p} \frac{1}{1 - p^{-s}} \qquad (\operatorname{Re} s > 1),

and showed that the distribution of primes is governed by the zeros of ζ\zeta. The theorem was proved in 1896 by Jacques Hadamard and Charles de la Vallée Poussin. Riemann also conjectured that all the non-trivial zeros lie on the line Re⁡s=12\operatorname{Re} s = \tfrac12; this Riemann hypothesis is still open, and it is equivalent to the statement that π(x)=li⁡(x)+O(xlog⁡x)\pi(x) = \operatorname{li}(x) + O(\sqrt x \log x) — the primes are as regular as they could possibly be.

Analytic number theory answers arithmetic questions with analysis: generating functions (Dirichlet series), complex integration, Fourier analysis and estimates. This lesson assumes elementary number theory and complex analysis (holomorphic functions, analytic continuation, the residue theorem).

IntuitionH

Three ideas

  1. Unique factorisation is an Euler product. Expanding ∏p(1+p−s+p−2s+⋯ )\prod_p (1 + p^{-s} + p^{-2s} + \cdots) produces each n−sn^{-s} exactly once, because each nn factors uniquely into primes. So the analytic properties of ζ(s)\zeta(s) — a pole at s=1s = 1, where ∑1/n\sum 1/n diverges — say something about primes: there must be infinitely many, and ∑p1/p\sum_p 1/p must diverge.
  2. Logarithmic derivatives count primes. Taking −ddslog⁡-\frac{d}{ds}\log of the Euler product gives −ζ′(s)/ζ(s)=∑nΛ(n)n−s-\zeta'(s)/\zeta(s) = \sum_n \Lambda(n) n^{-s}, where Λ(n)=log⁡p\Lambda(n) = \log p if n=pkn = p^k and 00 otherwise. The poles of −ζ′/ζ-\zeta'/\zeta are the pole and the zeros of ζ\zeta, and complex integration (Perron's formula) turns them into terms of ψ(x)=∑n≤xΛ(n)\psi(x) = \sum_{n \leq x}\Lambda(n): the pole at s=1s = 1 gives the main term xx, and each zero ρ\rho gives a term −xρ/ρ-x^\rho/\rho.
  3. Zeros are frequencies. If ρ=β+iγ\rho = \beta + i\gamma, then xρ=xβeiγlog⁡xx^\rho = x^\beta e^{i\gamma\log x} oscillates in log⁡x\log x with frequency γ\gamma and amplitude xβx^\beta. The primes are the "sound" and the zeros its "spectrum" (an analogy; the precise statement is von Mangoldt's explicit formula, Theorem 9). Zeros with β=1\beta = 1 would destroy the prime number theorem; zeros with β=12\beta = \frac12 give the smallest possible error terms.

A heuristic that gets many predictions right is Cramér's model: pretend each n≥3n \geq 3 is prime independently with probability 1/log⁡n1/\log n. It predicts π(x)≈li⁡(x)\pi(x) \approx \operatorname{li}(x) with fluctuations of size about x\sqrt x (up to logarithms) — consistent with the Riemann hypothesis. It is a model, not a theorem, and it is known to be wrong in some details (Maier, 1985).

DefinitionsH

Definitions

Definition— arithmetic functions and Dirichlet convolution

An arithmetic function is a map f:N≥1→Cf : \N_{\geq 1} \to \C. The Dirichlet convolution is (f∗g)(n)=∑d∣nf(d) g(n/d)(f * g)(n) = \sum_{d \mid n} f(d)\, g(n/d). The function ff is multiplicative if f(mn)=f(m)f(n)f(mn) = f(m)f(n) whenever gcd⁡(m,n)=1\gcd(m, n) = 1 (and f(1)=1f(1) = 1), and completely multiplicative if this holds for all m,nm, n. Important examples: ε(n)=[n=1]\varepsilon(n) = [n = 1] (the identity for ∗*), 1(n)=1\mathbf{1}(n) = 1, id⁡(n)=n\operatorname{id}(n) = n, log⁡(n)\log(n), Euler's φ\varphi, the divisor function d=1∗1d = \mathbf{1} * \mathbf{1}, the Möbius function μ(n)=(−1)k\mu(n) = (-1)^k if nn is a product of kk distinct primes and μ(n)=0\mu(n) = 0 if nn has a square factor, and the von Mangoldt function Λ(n)=log⁡p\Lambda(n) = \log p if n=pkn = p^k (k≥1k \geq 1) and 00 otherwise.

Definition— Dirichlet series

The Dirichlet series of ff is D(f,s)=∑n≥1f(n) n−sD(f, s) = \sum_{n \geq 1} f(n)\, n^{-s}, s=σ+its = \sigma + it. If it converges absolutely at s0s_0, it converges absolutely and uniformly on Re⁡s≥Re⁡s0\operatorname{Re} s \geq \operatorname{Re} s_0 and defines a holomorphic function on Re⁡s>Re⁡s0\operatorname{Re} s > \operatorname{Re} s_0. The Riemann zeta function is ζ(s)=D(1,s)\zeta(s) = D(\mathbf{1}, s) for Re⁡s>1\operatorname{Re} s > 1.

Definition— prime-counting functions

π(x)=#{p≤x}\pi(x) = \#\{p \leq x\}, θ(x)=∑p≤xlog⁡p\theta(x) = \sum_{p \leq x}\log p, ψ(x)=∑n≤xΛ(n)=∑pk≤xlog⁡p\psi(x) = \sum_{n \leq x}\Lambda(n) = \sum_{p^k \leq x}\log p, and li⁡(x)=∫0xdt/log⁡t\operatorname{li}(x) = \int_0^x dt/\log t (principal value at t=1t = 1). We write f∼gf \sim g if f/g→1f/g \to 1, f=O(g)f = O(g) or f≪gf \ll g if ∣f∣≤Cg|f| \leq Cg for some constant CC, and f≍gf \asymp g if f≪g≪ff \ll g \ll f.

Definition— Dirichlet characters and L-functions

A Dirichlet character modulo qq is a homomorphism χ:(Z/qZ)×→C×\chi : (\Z/q\Z)^\times \to \C^\times, extended to Z\Z by χ(n)=χ(n mod q)\chi(n) = \chi(n \bmod q) if gcd⁡(n,q)=1\gcd(n, q) = 1 and χ(n)=0\chi(n) = 0 otherwise. It is completely multiplicative and periodic. The principal character χ0\chi_0 is 11 on all nn coprime to qq; there are φ(q)\varphi(q) characters modulo qq. The Dirichlet LL-function is L(s,χ)=∑nχ(n)n−s=∏p(1−χ(p)p−s)−1L(s, \chi) = \sum_n \chi(n) n^{-s} = \prod_p (1 - \chi(p)p^{-s})^{-1} for Re⁡s>1\operatorname{Re} s > 1.

Worked examplesH

Examples

Example— Dirichlet series of familiar functions

For Re⁡s>1\operatorname{Re} s > 1 (or >2> 2 where noted), Proposition 2 below gives

∑nμ(n)ns=1ζ(s),∑nd(n)ns=ζ(s)2,∑nφ(n)ns=ζ(s−1)ζ(s) (Re⁡s>2),∑nΛ(n)ns=−ζ′(s)ζ(s),\sum_n \frac{\mu(n)}{n^s} = \frac{1}{\zeta(s)}, \qquad \sum_n \frac{d(n)}{n^s} = \zeta(s)^2, \qquad \sum_n \frac{\varphi(n)}{n^s} = \frac{\zeta(s - 1)}{\zeta(s)}\ (\operatorname{Re} s > 2), \qquad \sum_n \frac{\Lambda(n)}{n^s} = -\frac{\zeta'(s)}{\zeta(s)},

from the convolution identities μ∗1=ε\mu * \mathbf{1} = \varepsilon, d=1∗1d = \mathbf{1} * \mathbf{1}, φ∗1=id⁡\varphi * \mathbf{1} = \operatorname{id} and Λ∗1=log⁡\Lambda * \mathbf{1} = \log (formalised below). For instance Λ∗1=log⁡\Lambda * \mathbf{1} = \log says ∑d∣12Λ(d)=Λ(2)+Λ(3)+Λ(4)=2log⁡2+log⁡3=log⁡12\sum_{d \mid 12}\Lambda(d) = \Lambda(2) + \Lambda(3) + \Lambda(4) = 2\log 2 + \log 3 = \log 12.

Example— Characters modulo 4 and modulo 5

Modulo 44 there are two characters: χ0\chi_0 and χ4\chi_4 with χ4(1)=1\chi_4(1) = 1, χ4(3)=−1\chi_4(3) = -1. Then

L(1,χ4)=1−13+15−17+⋯=π4,L(1, \chi_4) = 1 - \frac13 + \frac15 - \frac17 + \cdots = \frac{\pi}{4},

the series of Mādhava and Leibniz. Modulo 55, (Z/5)×(\Z/5)^\times is cyclic of order 44, generated by 22, and a character is determined by χ(2)∈{1,i,−1,−i}\chi(2) \in \{1, i, -1, -i\}: two characters are real (χ0\chi_0 and the Legendre symbol (⋅5)\left(\frac{\cdot}{5}\right)) and two are complex conjugates.

n mod 5n \bmod 511223344
χ0\chi_011111111
χ1\chi_111ii−i-i−1-1
χ2=(⋅5)\chi_2 = \left(\frac{\cdot}{5}\right)11−1-1−1-111
χ3=χ1‾\chi_3 = \overline{\chi_1}11−i-iii−1-1

Example— Special values of ζ

Euler showed ζ(2)=π2/6\zeta(2) = \pi^2/6 (the Basel problem, 1734) and more generally ζ(2k)=(−1)k+1B2k(2π)2k/(2(2k)!)\zeta(2k) = (-1)^{k+1}B_{2k}(2\pi)^{2k}/(2(2k)!) with Bernoulli numbers B2kB_{2k}. The continued function also has values at negative integers: ζ(0)=−12\zeta(0) = -\tfrac12, ζ(−1)=−112\zeta(-1) = -\tfrac{1}{12}, and ζ(−2k)=0\zeta(-2k) = 0 for k≥1k \geq 1 (the trivial zeros). These are values of the analytic continuation — the series ∑n−s\sum n^{-s} diverges for Re⁡s≤1\operatorname{Re} s \leq 1. The first non-trivial zero is ρ1=12+14.134725… i\rho_1 = \tfrac12 + 14.134725\ldots\, i.

ProofH

The main theorems

Theorem— Proposition 1 (the ring of arithmetic functions; Möbius inversion)

Under pointwise addition and Dirichlet convolution, arithmetic functions form a commutative ring with identity ε\varepsilon; ff is invertible if and only if f(1)≠0f(1) \neq 0. Convolutions of multiplicative functions are multiplicative. Moreover μ∗1=ε\mu * \mathbf{1} = \varepsilon, that is, ∑d∣nμ(d)=0\sum_{d \mid n}\mu(d) = 0 for n>1n > 1, and consequently

g(n)=∑d∣nf(d)  for all n⟺f(n)=∑d∣nμ(d) g(n/d)  for all n.g(n) = \sum_{d \mid n} f(d) \ \text{ for all } n \quad\Longleftrightarrow\quad f(n) = \sum_{d \mid n}\mu(d)\, g(n/d) \ \text{ for all } n.

Proof

Commutativity and associativity follow from writing (f∗g)(n)=∑ab=nf(a)g(b)(f * g)(n) = \sum_{ab = n} f(a)g(b) and ((f∗g)∗h)(n)=∑abc=nf(a)g(b)h(c)((f * g) * h)(n) = \sum_{abc = n} f(a)g(b)h(c); distributivity and f∗ε=ff * \varepsilon = f are immediate. If f(1)≠0f(1) \neq 0, the equations (f∗g)(1)=1(f * g)(1) = 1 and (f∗g)(n)=0(f * g)(n) = 0 for n>1n > 1 determine g(1)=1/f(1)g(1) = 1/f(1) and then, recursively, g(n)=−1f(1)∑d∣n,d>1f(d)g(n/d)g(n) = -\frac{1}{f(1)}\sum_{d \mid n, d > 1} f(d)g(n/d). If gcd⁡(m,n)=1\gcd(m, n) = 1, divisors of mnmn are uniquely products d1d2d_1 d_2 with d1∣md_1 \mid m, d2∣nd_2 \mid n, which gives multiplicativity of f∗gf * g. Since μ∗1\mu * \mathbf{1} is multiplicative, it suffices to check prime powers: ∑d∣pkμ(d)=1−1+0+⋯=0\sum_{d \mid p^k}\mu(d) = 1 - 1 + 0 + \cdots = 0 for k≥1k \geq 1. Finally, if g=f∗1g = f * \mathbf{1} then g∗μ=f∗(1∗μ)=f∗ε=fg * \mu = f * (\mathbf{1} * \mu) = f * \varepsilon = f, and conversely if f=g∗μf = g * \mu then f∗1=gf * \mathbf{1} = g.

∎

Theorem— Proposition 2 (Dirichlet series multiply)

If D(f,s)D(f, s) and D(g,s)D(g, s) converge absolutely, then so does D(f∗g,s)D(f * g, s), and D(f∗g,s)=D(f,s) D(g,s)D(f * g, s) = D(f, s)\, D(g, s).

Proof

D(f,s)D(g,s)=∑a,bf(a)g(b)(ab)−sD(f, s)D(g, s) = \sum_{a, b} f(a)g(b)(ab)^{-s} is an absolutely convergent double series, so it may be summed in any order; grouping the terms with ab=nab = n gives ∑n(f∗g)(n)n−s\sum_n (f * g)(n) n^{-s}, and the same grouping of ∑∣f(a)∣∣g(b)∣∣(ab)−s∣\sum|f(a)||g(b)||(ab)^{-s}| bounds ∑n∣(f∗g)(n)∣∣n−s∣\sum_n |(f * g)(n)||n^{-s}|.

∎

Theorem— Theorem 3 (Euler product; Euler's theorem on Σ 1/p)

For Re⁡s>1\operatorname{Re} s > 1, ζ(s)=∏p(1−p−s)−1\zeta(s) = \prod_p (1 - p^{-s})^{-1}, the product converging absolutely; in particular ζ(s)≠0\zeta(s) \neq 0 there. More generally D(f,s)=∏p(∑k≥0f(pk)p−ks)D(f, s) = \prod_p \big(\sum_{k \geq 0} f(p^k)p^{-ks}\big) for multiplicative ff with D(∣f∣,σ)D(|f|, \sigma) convergent. Consequently ∑p1/p=∞\sum_p 1/p = \infty, and there are infinitely many primes.

Proof

Fix ss with σ=Re⁡s>1\sigma = \operatorname{Re} s > 1 and let P(N)=∏p≤N(1−p−s)−1=∏p≤N∑k≥0p−ksP(N) = \prod_{p \leq N}(1 - p^{-s})^{-1} = \prod_{p \leq N}\sum_{k \geq 0} p^{-ks}. Multiplying out finitely many absolutely convergent series, P(N)=∑n∈SNn−sP(N) = \sum_{n \in S_N} n^{-s} where SNS_N is the set of nn all of whose prime factors are ≤N\leq N — each such nn appears exactly once by unique factorisation. Every n≤Nn \leq N is in SNS_N, so ∣ζ(s)−P(N)∣≤∑n>Nn−σ→0|\zeta(s) - P(N)| \leq \sum_{n > N} n^{-\sigma} \to 0. The product converges absolutely because ∑p∣p−s∣<∞\sum_p |p^{-s}| < \infty, and a convergent product of non-zero factors with this property is non-zero. The same argument works for multiplicative ff.

For the divergence, let 1<σ<21 < \sigma < 2. Taking logarithms, log⁡ζ(σ)=∑p∑k≥1p−kσk=∑pp−σ+R(σ)\log\zeta(\sigma) = \sum_p \sum_{k \geq 1}\frac{p^{-k\sigma}}{k} = \sum_p p^{-\sigma} + R(\sigma), where 0≤R(σ)≤∑p∑k≥2p−k=∑p1p(p−1)<10 \leq R(\sigma) \leq \sum_p \sum_{k \geq 2} p^{-k} = \sum_p \frac{1}{p(p - 1)} < 1. Since ζ(σ)≥∫1∞x−σ dx=1σ−1→∞\zeta(\sigma) \geq \int_1^\infty x^{-\sigma}\,dx = \frac{1}{\sigma - 1} \to \infty as σ→1+\sigma \to 1^+, ∑pp−σ\sum_p p^{-\sigma} is unbounded, so ∑pp−1=∞\sum_p p^{-1} = \infty by monotone convergence.

∎

Differentiating the logarithm of the Euler product termwise gives −ζ′(s)/ζ(s)=∑p∑k(log⁡p) p−ks=∑nΛ(n)n−s-\zeta'(s)/\zeta(s) = \sum_p \sum_k (\log p)\, p^{-ks} = \sum_n \Lambda(n) n^{-s}, matching Λ∗1=log⁡\Lambda * \mathbf{1} = \log and Proposition 2.

Theorem— Theorem 4 (Chebyshev's bounds)

For all x≥1x \geq 1 and integers n≥1n \geq 1:

  1. ∏p≤np≤4n\prod_{p \leq n} p \leq 4^n, hence θ(x)≤xlog⁡4\theta(x) \leq x\log 4;
  2. 2n≤(n+1)lcm⁡(1,2,…,n)2^n \leq (n + 1)\operatorname{lcm}(1, 2, \dots, n), hence ψ(n)≥nlog⁡2−log⁡(n+1)\psi(n) \geq n\log 2 - \log(n + 1).

Consequently ψ(x)≍x\psi(x) \asymp x, θ(x)≍x\theta(x) \asymp x and π(x)≍x/log⁡x\pi(x) \asymp x/\log x.

Proof

(1) Induction on nn (Erdős's argument). For n≤2n \leq 2 it is clear; for even n>2n > 2 the product equals that for n−1n - 1. For n=2m+1n = 2m + 1: every prime pp with m+1<p≤2m+1m + 1 < p \leq 2m + 1 divides (2m+1m)=(2m+1)!m! (m+1)!\binom{2m+1}{m} = \frac{(2m+1)!}{m!\,(m+1)!} (it divides the numerator but not the denominator), and (2m+1m)=(2m+1m+1)\binom{2m+1}{m} = \binom{2m+1}{m+1} are two terms of ∑j(2m+1j)=22m+1\sum_j\binom{2m+1}{j} = 2^{2m+1}, so (2m+1m)≤4m\binom{2m+1}{m} \leq 4^m. Hence ∏p≤2m+1p≤∏p≤m+1p⋅(2m+1m)≤4m+1⋅4m=42m+1\prod_{p \leq 2m+1} p \leq \prod_{p \leq m+1}p \cdot \binom{2m+1}{m} \leq 4^{m+1}\cdot 4^m = 4^{2m+1}. Taking logarithms gives θ(n)≤nlog⁡4\theta(n) \leq n\log 4, and θ(x)=θ(⌊x⌋)\theta(x) = \theta(\lfloor x \rfloor).

(2) The exponent of a prime pp in lcm⁡(1,…,n)\operatorname{lcm}(1, \dots, n) is the largest kk with pk≤np^k \leq n, so log⁡lcm⁡(1,…,n)=∑pk≤nlog⁡p=ψ(n)\log\operatorname{lcm}(1, \dots, n) = \sum_{p^k \leq n}\log p = \psi(n). Each binomial coefficient (nj)\binom{n}{j} divides lcm⁡(1,…,n)\operatorname{lcm}(1, \dots, n): by Kummer's theorem the exponent of pp in (nj)\binom{n}{j} is the number of carries when adding jj and n−jn - j in base pp, which is at most the number of base-pp digits of nn beyond the first, i.e. at most ⌊log⁡n/log⁡p⌋\lfloor\log n/\log p\rfloor. So 2n=∑j=0n(nj)≤(n+1)lcm⁡(1,…,n)2^n = \sum_{j=0}^n \binom{n}{j} \leq (n + 1)\operatorname{lcm}(1, \dots, n); take logarithms.

For the consequences: θ≤ψ\theta \leq \psi, and ψ(x)−θ(x)=∑k≥2θ(x1/k)≪xlog⁡x\psi(x) - \theta(x) = \sum_{k \geq 2}\theta(x^{1/k}) \ll \sqrt x\log x (there are at most log⁡2x\log_2 x non-zero terms, each ≤θ(x)≤xlog⁡4\leq \theta(\sqrt x) \leq \sqrt x\log 4), so both are ≍x\asymp x. Then π(x)≥θ(x)/log⁡x≫x/log⁡x\pi(x) \geq \theta(x)/\log x \gg x/\log x, and θ(x)≥∑x<p≤xlog⁡p≥12log⁡x (π(x)−x)\theta(x) \geq \sum_{\sqrt x < p \leq x}\log p \geq \frac12\log x\,(\pi(x) - \sqrt x) gives π(x)≪x/log⁡x\pi(x) \ll x/\log x.

∎

Theorem— Theorem 5 (analytic continuation to Re s > 0)

For Re⁡s>1\operatorname{Re} s > 1,

ζ(s)=ss−1−s∫1∞{x}xs+1 dx,\zeta(s) = \frac{s}{s - 1} - s\int_1^\infty \frac{\{x\}}{x^{s+1}}\,dx,

where {x}=x−⌊x⌋\{x\} = x - \lfloor x \rfloor. The right-hand side is meromorphic on Re⁡s>0\operatorname{Re} s > 0 with a single simple pole, at s=1s = 1, of residue 11. So ζ\zeta continues meromorphically to Re⁡s>0\operatorname{Re} s > 0, and ζ(s)−1s−1\zeta(s) - \frac{1}{s - 1} is holomorphic there.

Proof

For Re⁡s>1\operatorname{Re} s > 1, partial summation gives

∑n≥1n−s=∑n≥1n(n−s−(n+1)−s)=∑n≥1n⋅s∫nn+1x−s−1 dx=s∫1∞⌊x⌋x−s−1 dx,\sum_{n \geq 1} n^{-s} = \sum_{n \geq 1} n\big(n^{-s} - (n + 1)^{-s}\big) = \sum_{n \geq 1} n \cdot s\int_n^{n+1} x^{-s-1}\,dx = s\int_1^\infty \lfloor x \rfloor x^{-s-1}\,dx,

(the boundary terms N⋅(N+1)−s→0N\cdot(N+1)^{-s} \to 0). Writing ⌊x⌋=x−{x}\lfloor x \rfloor = x - \{x\} and s∫1∞x−s dx=ss−1s\int_1^\infty x^{-s}\,dx = \frac{s}{s - 1} gives the formula. Since 0≤{x}<10 \leq \{x\} < 1, the integral converges absolutely and locally uniformly on Re⁡s>0\operatorname{Re} s > 0, so it is holomorphic there. Finally ss−1=1+1s−1\frac{s}{s - 1} = 1 + \frac{1}{s - 1}.

∎

Theorem— Theorem 6 (the functional equation; proof sketched)

The completed zeta function Λ(s)=π−s/2 Γ(s/2) ζ(s)\Lambda(s) = \pi^{-s/2}\,\Gamma(s/2)\,\zeta(s) extends to a meromorphic function on C\C whose only poles are simple poles at s=0s = 0 and s=1s = 1, and

Λ(1−s)=Λ(s).\Lambda(1 - s) = \Lambda(s).

Hence ζ\zeta is meromorphic on C\C with a single simple pole at s=1s = 1; ζ(−2k)=0\zeta(-2k) = 0 for k=1,2,…k = 1, 2, \dots (the poles of Γ(s/2)\Gamma(s/2) must cancel); and all other zeros — the non-trivial zeros — lie in the critical strip 0≤Re⁡s≤10 \leq \operatorname{Re} s \leq 1, symmetric about the real axis and about the critical line Re⁡s=12\operatorname{Re} s = \tfrac12.

Proof sketch (Riemann's second proof). Let ϑ(t)=∑n∈Ze−πn2t\vartheta(t) = \sum_{n \in \Z} e^{-\pi n^2 t} for t>0t > 0. Poisson summation applied to the Gaussian e−πx2te^{-\pi x^2 t}, whose Fourier transform is t−1/2e−πξ2/tt^{-1/2}e^{-\pi \xi^2/t}, gives ϑ(1/t)=t ϑ(t)\vartheta(1/t) = \sqrt{t}\,\vartheta(t). For Re⁡s>1\operatorname{Re} s > 1, ∫0∞e−πn2tts/2 dtt=π−s/2Γ(s/2)n−s\int_0^\infty e^{-\pi n^2 t}t^{s/2}\,\frac{dt}{t} = \pi^{-s/2}\Gamma(s/2)n^{-s}, so Λ(s)=∫0∞ϑ(t)−12 ts/2 dtt\Lambda(s) = \int_0^\infty \frac{\vartheta(t) - 1}{2}\,t^{s/2}\,\frac{dt}{t}. Splitting the integral at t=1t = 1 and using ϑ(1/t)=t ϑ(t)\vartheta(1/t) = \sqrt t\,\vartheta(t) on (0,1)(0, 1) gives

Λ(s)=−1s−11−s+∫1∞ϑ(t)−12(ts/2+t(1−s)/2)dtt,\Lambda(s) = -\frac{1}{s} - \frac{1}{1 - s} + \int_1^\infty \frac{\vartheta(t) - 1}{2}\left(t^{s/2} + t^{(1-s)/2}\right)\frac{dt}{t},

in which the integral is entire (the integrand decays like e−πte^{-\pi t}) and the whole expression is visibly symmetric under s↦1−ss \mapsto 1 - s. Zeros of ζ\zeta in Re⁡s<0\operatorname{Re} s < 0 come from poles of Γ(s/2)\Gamma(s/2) only, and ζ≠0\zeta \neq 0 on Re⁡s>1\operatorname{Re} s > 1 (Theorem 3), so by symmetry the non-trivial zeros lie in 0≤Re⁡s≤10 \leq \operatorname{Re} s \leq 1. Details: Davenport, Chapter 8; Titchmarsh, Chapter II. Mathlib proves the functional equation (below). □\square

Theorem— Theorem 7 (no zeros on the line Re s = 1)

ζ(1+it)≠0\zeta(1 + it) \neq 0 for every real tt.

Proof

At t=0t = 0 there is a pole. For σ>1\sigma > 1, the Euler product gives log⁡ζ(s)=∑p∑k≥1p−ksk=∑n≥2Λ(n)log⁡nn−s\log\zeta(s) = \sum_p\sum_{k \geq 1}\frac{p^{-ks}}{k} = \sum_{n \geq 2}\frac{\Lambda(n)}{\log n}n^{-s}, so

log⁡∣ζ(σ+it)∣=Re⁡log⁡ζ(σ+it)=∑n≥2Λ(n)log⁡n n−σcos⁡(tlog⁡n).\log|\zeta(\sigma + it)| = \operatorname{Re}\log\zeta(\sigma + it) = \sum_{n \geq 2}\frac{\Lambda(n)}{\log n}\,n^{-\sigma}\cos(t\log n).

Therefore, with θn=tlog⁡n\theta_n = t\log n,

log⁡∣ζ(σ)3 ζ(σ+it)4 ζ(σ+2it)∣=∑n≥2Λ(n)log⁡n n−σ(3+4cos⁡θn+cos⁡2θn)≥0,\log\left|\zeta(\sigma)^3\,\zeta(\sigma + it)^4\,\zeta(\sigma + 2it)\right| = \sum_{n \geq 2}\frac{\Lambda(n)}{\log n}\,n^{-\sigma}\big(3 + 4\cos\theta_n + \cos 2\theta_n\big) \geq 0,

because 3+4cos⁡θ+cos⁡2θ=2(1+cos⁡θ)2≥03 + 4\cos\theta + \cos 2\theta = 2(1 + \cos\theta)^2 \geq 0 (Mertens' trick, formalised below). So ∣ζ(σ)3ζ(σ+it)4ζ(σ+2it)∣≥1|\zeta(\sigma)^3\zeta(\sigma + it)^4\zeta(\sigma + 2it)| \geq 1 for all σ>1\sigma > 1.

Suppose ζ(1+it)=0\zeta(1 + it) = 0 with t≠0t \neq 0. As σ→1+\sigma \to 1^+: ζ(σ)3∼(σ−1)−3\zeta(\sigma)^3 \sim (\sigma - 1)^{-3} (simple pole of residue 11, Theorem 5); ζ(σ+it)4=O((σ−1)4)\zeta(\sigma + it)^4 = O\big((\sigma - 1)^4\big) (a zero at 1+it1 + it, and ζ\zeta is holomorphic there); and ζ(σ+2it)\zeta(\sigma + 2it) stays bounded, because ζ\zeta is holomorphic at 1+2it≠11 + 2it \neq 1. So the product is O(σ−1)→0O(\sigma - 1) \to 0, contradicting the lower bound 11.

∎

Theorem— Theorem 8 (the prime number theorem; proof outlined)

ψ(x)∼x,θ(x)∼x,π(x)∼xlog⁡x∼li⁡(x).\psi(x) \sim x, \qquad \theta(x) \sim x, \qquad \pi(x) \sim \frac{x}{\log x} \sim \operatorname{li}(x).

Outline of a proof (D. J. Newman's, as presented by Zagier, 1997).

  1. θ(x)=O(x)\theta(x) = O(x) — Theorem 4.
  2. The function Φ(s)=∑p(log⁡p) p−s\Phi(s) = \sum_p (\log p)\,p^{-s} differs from −ζ′(s)/ζ(s)-\zeta'(s)/\zeta(s) by ∑p(log⁡p) p−sps−1\sum_p \frac{(\log p)\, p^{-s}}{p^s - 1}, which is holomorphic for Re⁡s>12\operatorname{Re} s > \frac12. By Theorems 5 and 7, −ζ′/ζ-\zeta'/\zeta has a simple pole with residue 11 at s=1s = 1 and no other poles on Re⁡s≥1\operatorname{Re} s \geq 1. So Φ(s)−1s−1\Phi(s) - \frac{1}{s - 1} extends holomorphically to a neighbourhood of Re⁡s≥1\operatorname{Re} s \geq 1.
  3. Newman's analytic theorem: if ff is bounded and locally integrable on [0,∞)[0, \infty) and its Laplace transform g(z)=∫0∞f(t)e−zt dtg(z) = \int_0^\infty f(t)e^{-zt}\,dt extends holomorphically to a neighbourhood of Re⁡z≥0\operatorname{Re} z \geq 0, then ∫0∞f(t) dt\int_0^\infty f(t)\,dt converges (and equals g(0)g(0)). The proof is a single clever contour integral.
  4. Apply it to f(t)=θ(et)e−t−1f(t) = \theta(e^t)e^{-t} - 1, bounded by step 1, whose Laplace transform is Φ(z+1)z+1−1z\frac{\Phi(z + 1)}{z + 1} - \frac{1}{z}, holomorphic on Re⁡z≥0\operatorname{Re} z \geq 0 by step 2. So ∫1∞θ(x)−xx2 dx\int_1^\infty \frac{\theta(x) - x}{x^2}\,dx converges.
  5. If θ(x)≥λx\theta(x) \geq \lambda x for some λ>1\lambda > 1 and arbitrarily large xx, then since θ\theta is increasing, ∫xλxθ(t)−tt2 dt≥∫1λλ−uu2 du>0\int_x^{\lambda x}\frac{\theta(t) - t}{t^2}\,dt \geq \int_1^\lambda \frac{\lambda - u}{u^2}\,du > 0 for those xx, contradicting convergence; similarly for λ<1\lambda < 1. So θ(x)∼x\theta(x) \sim x.
  6. Partial summation: π(x)=θ(x)log⁡x+∫2xθ(t)tlog⁡2t dt\pi(x) = \frac{\theta(x)}{\log x} + \int_2^x \frac{\theta(t)}{t\log^2 t}\,dt, and the integral is O(x/log⁡2x)O(x/\log^2 x), so π(x)∼x/log⁡x\pi(x) \sim x/\log x; also li⁡(x)∼x/log⁡x\operatorname{li}(x) \sim x/\log x by L'Hôpital.

Complete proof: Zagier, Newman's short proof of the prime number theorem, Amer. Math. Monthly 104 (1997). The classical proofs use the zero-free region σ>1−c/log⁡(∣t∣+2)\sigma > 1 - c/\log(|t| + 2) (de la Vallée Poussin, 1899), which gives the error term ψ(x)=x+O(xe−c′log⁡x)\psi(x) = x + O\big(x e^{-c'\sqrt{\log x}}\big). □\square

Theorem— Theorem 9 (von Mangoldt's explicit formula; stated)

For x>1x > 1 not a prime power,

ψ(x)=x−∑ρxρρ−log⁡2π−12log⁡(1−x−2),\psi(x) = x - \sum_\rho \frac{x^\rho}{\rho} - \log 2\pi - \frac12\log\left(1 - x^{-2}\right),

where ρ\rho runs over the non-trivial zeros of ζ\zeta with multiplicity, the sum taken as lim⁡T→∞∑∣Im⁡ρ∣<T\lim_{T \to \infty}\sum_{|\operatorname{Im}\rho| < T}.

This is proved by integrating −ζ′(s)ζ(s)xss-\frac{\zeta'(s)}{\zeta(s)}\frac{x^s}{s} around a large rectangle and collecting residues: xx from the pole at s=1s = 1, −xρ/ρ-x^\rho/\rho from each zero, −log⁡2π=−ζ′(0)/ζ(0)-\log 2\pi = -\zeta'(0)/\zeta(0) from s=0s = 0, and −12log⁡(1−x−2)=∑kx−2k2k-\frac12\log(1 - x^{-2}) = \sum_k \frac{x^{-2k}}{2k} from the trivial zeros (Davenport, Chapter 17). It explains everything:

  • If every zero has real part at most Θ\Theta, then ψ(x)=x+O(xΘlog⁡2x)\psi(x) = x + O(x^\Theta\log^2 x); conversely a zero with real part β\beta forces errors of size xβ−εx^{\beta - \varepsilon} infinitely often. The prime number theorem is equivalent to "no zeros on Re⁡s=1\operatorname{Re} s = 1".
  • The Riemann hypothesis (Θ=12\Theta = \frac12) is equivalent to ψ(x)=x+O(xlog⁡2x)\psi(x) = x + O(\sqrt x\log^2 x), and to π(x)=li⁡(x)+O(xlog⁡x)\pi(x) = \operatorname{li}(x) + O(\sqrt x\log x) (von Koch, 1901).
  • Each pair of zeros 12±iγ\frac12 \pm i\gamma contributes the wave −2Re⁡xρρ=−4x (cos⁡(γlog⁡x)+2γsin⁡(γlog⁡x))1+4γ2-2\operatorname{Re}\frac{x^\rho}{\rho} = -\frac{4\sqrt x\,\big(\cos(\gamma\log x) + 2\gamma\sin(\gamma\log x)\big)}{1 + 4\gamma^2}, of amplitude about 2x/γ2\sqrt x/\gamma; the visualisation below adds these waves one by one.

What is known and what is open. Proved: infinitely many zeros lie on the critical line (Hardy, 1914), in fact a positive proportion (Selberg, 1942), more than 40%40\% (Conrey, 1989); every zero with 0<Im⁡ρ≤3⋅10120 < \operatorname{Im}\rho \leq 3 \cdot 10^{12} is on the line (Platt and Trudgian, 2021); π(x)−li⁡(x)\pi(x) - \operatorname{li}(x) changes sign infinitely often (Littlewood, 1914). Open: the Riemann hypothesis itself; even the existence of some Θ<1\Theta < 1 with no zeros in Re⁡s>Θ\operatorname{Re} s > \Theta; the twin prime conjecture; Goldbach's conjecture for even numbers.

Theorem— Theorem 10 (Dirichlet's theorem on primes in arithmetic progressions)

If gcd⁡(a,q)=1\gcd(a, q) = 1, there are infinitely many primes p≡a(modq)p \equiv a \pmod q; in fact ∑p≡a (q)1/p=∞\sum_{p \equiv a \ (q)} 1/p = \infty.

Proof for q=4q = 4, and the general strategy. For σ>1\sigma > 1 and a character χ\chi mod qq, the Euler product of L(s,χ)L(s, \chi) gives, as in Theorem 3,

log⁡L(σ,χ)=∑pχ(p)pσ+O(1)(σ→1+).\log L(\sigma, \chi) = \sum_p \frac{\chi(p)}{p^\sigma} + O(1) \qquad (\sigma \to 1^+).

Take q=4q = 4. For χ0\chi_0, L(σ,χ0)=(1−2−σ)ζ(σ)→∞L(\sigma, \chi_0) = (1 - 2^{-\sigma})\zeta(\sigma) \to \infty, so ∑p oddp−σ→∞\sum_{p \text{ odd}} p^{-\sigma} \to \infty. For χ4\chi_4, the alternating series L(σ,χ4)=1−3−σ+5−σ−⋯L(\sigma, \chi_4) = 1 - 3^{-\sigma} + 5^{-\sigma} - \cdots converges for σ>0\sigma > 0 and is continuous in σ\sigma, and L(1,χ4)=π4>0L(1, \chi_4) = \frac{\pi}{4} > 0, so log⁡L(σ,χ4)\log L(\sigma, \chi_4) stays bounded as σ→1+\sigma \to 1^+. Adding and subtracting,

∑p≡1 (4)1pσ=12(∑p odd1pσ+∑pχ4(p)pσ)→∞,∑p≡3 (4)1pσ=12(∑p odd1pσ−∑pχ4(p)pσ)→∞.\sum_{p \equiv 1 \ (4)}\frac{1}{p^\sigma} = \frac12\left(\sum_{p \text{ odd}}\frac{1}{p^\sigma} + \sum_p\frac{\chi_4(p)}{p^\sigma}\right) \to \infty, \qquad \sum_{p \equiv 3 \ (4)}\frac{1}{p^\sigma} = \frac12\left(\sum_{p \text{ odd}}\frac{1}{p^\sigma} - \sum_p\frac{\chi_4(p)}{p^\sigma}\right) \to \infty.

For general qq, the orthogonality relation 1φ(q)∑χχ(a)‾χ(n)=[n≡a mod q]\frac{1}{\varphi(q)}\sum_\chi \overline{\chi(a)}\chi(n) = [n \equiv a \bmod q] (for gcd⁡(a,q)=1\gcd(a, q) = 1) gives

∑p≡a (q)1pσ=1φ(q)∑χχ(a)‾log⁡L(σ,χ)+O(1).\sum_{p \equiv a \ (q)}\frac{1}{p^\sigma} = \frac{1}{\varphi(q)}\sum_\chi \overline{\chi(a)}\log L(\sigma, \chi) + O(1).

The principal character contributes 1φ(q)log⁡1σ−1+O(1)→∞\frac{1}{\varphi(q)}\log\frac{1}{\sigma - 1} + O(1) \to \infty, and the theorem follows once L(1,χ)≠0L(1, \chi) \neq 0 for every χ≠χ0\chi \neq \chi_0 (each such L(s,χ)L(s, \chi) is holomorphic on Re⁡s>0\operatorname{Re} s > 0 by partial summation). For complex χ\chi this follows from ∏χL(σ,χ)≥1\prod_\chi L(\sigma, \chi) \geq 1 (a 33-44-11-type argument); for real χ\chi it is the deep point, proved by Dirichlet via his class number formula (L(1,χ)=πh∣d∣L(1, \chi) = \frac{\pi h}{\sqrt{|d|}} for imaginary quadratic characters with ∣d∣>4|d| > 4, and h≥1h \geq 1). Full proof: Apostol, Chapter 7; Davenport, Chapters 1–4. Mathlib proves the theorem (below). □\square

With more work (the zero-free region for LL-functions) one gets the prime number theorem for arithmetic progressions: π(x;q,a)∼1φ(q)xlog⁡x\pi(x; q, a) \sim \frac{1}{\varphi(q)}\frac{x}{\log x} — the primes are equidistributed among the φ(q)\varphi(q) admissible classes.

Explore

Explore: building the staircase from zeros

The plot shows the right-hand side of the explicit formula (Theorem 9) truncated to the first NN pairs of zeros 12±iγk\frac12 \pm i\gamma_k, against the line y=xy = x. With N=0N = 0 you see the smooth main term x−log⁡2πx - \log 2\pi. Increase NN: every zero adds a wave of amplitude about 2x/γk2\sqrt x/\gamma_k, and the waves conspire to build a staircase that jumps by log⁡p\log p at each prime power pkp^k — at 2,3,4,5,7,8,9,11,13,…2, 3, 4, 5, 7, 8, 9, 11, 13, \dots — exactly as the true ψ(x)\psi(x) does. Seven zeros already locate the small primes; with infinitely many the staircase is exact. The second experiment computes the zeros and compares the same truncation with the true ψ(x)\psi(x).

ψ(x) rebuilt from the zeros of ζ

The true ψ(x) jumps by log p at every prime power pᵏ; watch the jumps appear as N grows.

  • explicit formula with N pairs of zeros
  • y = x
  • explicit formula with N pairs of zeros: y = −0.0006
  • y = x: y = 1.5

Where the pole lives. The series ∑n−p\sum n^{-p} converges exactly for p>1p > 1; at p=1p = 1 its partial sums grow like log⁡N\log N. This divergence is the pole of ζ(s)\zeta(s) at s=1s = 1, which by Theorem 3 forces infinitely many primes. Move pp towards 11 and watch the convergence slow down.

Partial sums of ζ(p) = Σ 1/nᵖ

Convergent for p > 1 (ζ(2) = π²/6 ≈ 1.645); divergent like log N at p = 1.

Examples
an =
  • partial sums Sₙ
  • terms aₙ

S400 = a1 + … + a400 = 2.512438

Partial sums on a screen are evidence, never proof: a series can look settled and still diverge, as the harmonic series does.

Formal mathematicsF

Analytic number theory in Lean and Mathlib

Mathlib has a substantial library of analytic number theory: arithmetic functions, LL-series, the Riemann zeta function on all of C\C, Chebyshev's functions and Dirichlet's theorem. We start with Proposition 1, proved by the three-line ring computation of the text, and Mathlib's version with sums:

moebius_inversionLean 4Proved here from basic factsFormally verified
/-- **Möbius inversion**, proved in the ring of arithmetic functions under Dirichlet convolution
`*`. If `g = f * ζ` — that is, `g(n) = ∑_{d ∣ n} f(d)` — then `f = g * μ`, i.e.
`f(n) = ∑_{d ∣ n} μ(d) g(n/d)`. The proof is three lines of algebra, using associativity of `*` and
the identity `ζ * μ = 1` (Mathlib: `coe_zeta_mul_moebius`), which says `∑_{d ∣ n} μ(d) = 0` for
`n > 1`. -/
theorem moebius_inversion (f g : ArithmeticFunction ℤ) (h : g = f * ζ) : f = g * μ :=
  calc f = f * 1 := (mul_one f).symm
    _ = f * ((ζ : ArithmeticFunction ℤ) * μ) := by rw [coe_zeta_mul_moebius]
    _ = (f * ζ) * μ := (mul_assoc _ _ _).symm
    _ = g * μ := by rw [h]
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
moebius_inversion_sumsLean 4Applies a library theoremFormally verified
/-- **Möbius inversion, written with sums**: `∑_{d ∣ n} f(d) = g(n)` for all `n > 0` if and only if
`f(n) = ∑_{ab = n} μ(a) g(b)` for all `n > 0`. Mathlib:
`ArithmeticFunction.sum_eq_iff_sum_mul_moebius_eq`. -/
theorem moebius_inversion_sums {f g : ℕ → ℤ} :
    (∀ n > 0, ∑ i ∈ n.divisors, f i = g n) ↔
      ∀ n > 0, ∑ x ∈ n.divisorsAntidiagonal, (μ x.fst : ℤ) * g x.snd = f n :=
  sum_eq_iff_sum_mul_moebius_eq
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
von_mangoldt_sumLean 4Applies a library theoremFormally verified
/-- **`∑_{d ∣ n} Λ(d) = log n`** — unique factorisation, written additively: if
`n = ∏ pᵢ^{aᵢ}` then the prime powers dividing `n` contribute `∑ aᵢ log pᵢ = log n`. As Dirichlet
series this is `−ζ'(s)/ζ(s) = ∑ Λ(n) n^{−s}`. Mathlib: `ArithmeticFunction.vonMangoldt_sum`. -/
theorem von_mangoldt_sum (n : ℕ) : ∑ i ∈ n.divisors, Λ i = Real.log n :=
  vonMangoldt_sum
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor

Theorem 3 and Euler's divergence theorem, the Basel problem, Theorem 5's residue, Theorem 6 and the trivial zeros:

euler_productLean 4Applies a library theoremFormally verified
/-- **Euler product**: for `Re s > 1`, `∏_p (1 − p^{−s})^{−1} = ζ(s)`, the analytic form of unique
factorisation. Mathlib: `riemannZeta_eulerProduct_tprod`. -/
theorem euler_product {s : ℂ} (hs : 1 < s.re) :
    ∏' p : Nat.Primes, (1 - (p : ℂ) ^ (-s))⁻¹ = riemannZeta s :=
  riemannZeta_eulerProduct_tprod hs
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
sum_inv_primes_divergesLean 4Applies a library theoremFormally verified
/-- **Euler: `∑ 1/p` diverges**, so there are infinitely many primes, and they are not too sparse.
Mathlib: `Nat.Primes.not_summable_one_div` (proved by Erdős's elementary argument). -/
theorem sum_inv_primes_diverges : ¬ Summable (fun p : Nat.Primes ↦ (1 / p : ℝ)) :=
  Nat.Primes.not_summable_one_div
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
zeta_twoLean 4Applies a library theoremFormally verified
/-- **The Basel problem**: `ζ(2) = π²/6` (Euler, 1734). Mathlib: `riemannZeta_two`. -/
theorem zeta_two : riemannZeta 2 = (Real.pi : ℂ) ^ 2 / 6 :=
  riemannZeta_two
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
zeta_residueLean 4Applies a library theoremFormally verified
/-- **`ζ` has a simple pole with residue `1` at `s = 1`**: `(s − 1) ζ(s) → 1` as `s → 1`. Mathlib:
`riemannZeta_residue_one`. -/
theorem zeta_residue :
    Filter.Tendsto (fun s ↦ (s - 1) * riemannZeta s) (nhdsWithin 1 {1}ᶜ) (nhds 1) :=
  riemannZeta_residue_one
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
functional_equationLean 4Applies a library theoremFormally verified
/-- **The functional equation** (Riemann, 1859): the completed zeta function
`Λ(s) = π^{−s/2} Γ(s/2) ζ(s)` satisfies `Λ(1 − s) = Λ(s)` for every complex `s`. Mathlib:
`completedRiemannZeta_one_sub`. -/
theorem functional_equation (s : ℂ) : completedRiemannZeta (1 - s) = completedRiemannZeta s :=
  completedRiemannZeta_one_sub s
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
trivial_zerosLean 4Applies a library theoremFormally verified
/-- **The trivial zeros**: `ζ(−2), ζ(−4), ζ(−6), …` all vanish (the poles of `Γ(s/2)` must be
cancelled in the functional equation). Mathlib: `riemannZeta_neg_two_mul_nat_add_one`. -/
theorem trivial_zeros (n : ℕ) : riemannZeta (-2 * (n + 1)) = 0 :=
  riemannZeta_neg_two_mul_nat_add_one n
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor

Theorem 7: the trigonometric heart of the proof, proved here, and Mathlib's theorem (which extends to Re⁡s≥1\operatorname{Re} s \geq 1):

three_four_oneLean 4Proved here from basic factsFormally verified
/-- **The `3–4–1` inequality** (Mertens, 1898): `3 + 4 cos θ + cos 2θ ≥ 0` for all real `θ`, because
`3 + 4 cos θ + cos 2θ = 2 (1 + cos θ)²`. Applied with `θ = t log n` it gives
`|ζ(σ)³ ζ(σ + it)⁴ ζ(σ + 2it)| ≥ 1` for `σ > 1`, which rules out a zero on the line `Re s = 1`. -/
theorem three_four_one (θ : ℝ) : 0 ≤ 3 + 4 * Real.cos θ + Real.cos (2 * θ) := by
  rw [Real.cos_two_mul]
  nlinarith [sq_nonneg (1 + Real.cos θ)]
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
zeta_ne_zero_one_lineLean 4Applies a library theoremFormally verified
/-- **`ζ(s) ≠ 0` for `Re s ≥ 1`** (Hadamard and de la Vallée Poussin, 1896) — the analytic heart of
the prime number theorem. Mathlib: `riemannZeta_ne_zero_of_one_le_re`, proved with the `3–4–1`
trick. -/
theorem zeta_ne_zero_one_line {s : ℂ} (hs : 1 ≤ s.re) : riemannZeta s ≠ 0 :=
  riemannZeta_ne_zero_of_one_le_re hs
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor

The Riemann hypothesis can be stated in Lean. We write it in the words of the lesson and check that it is literally Mathlib's RiemannHypothesis. Nobody can prove either:

CriticalLineHypothesisLean 4Formally verified
/-- **The Riemann hypothesis, stated** (an open problem since 1859): every zero of `ζ` other than
the trivial zeros `−2, −4, −6, …` lies on the critical line `Re s = 1/2`. (The condition `s ≠ 1`
is harmless: Mathlib assigns `ζ(1)` a junk value.) Lean can *state* this precisely; no one can
prove it. -/
def CriticalLineHypothesis : Prop :=
  ∀ s : ℂ, riemannZeta s = 0 → (¬ ∃ n : ℕ, s = -2 * (n + 1)) → s ≠ 1 → s.re = 1 / 2
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
critical_line_iffLean 4Applies a library theoremFormally verified
/-- **Our statement agrees with Mathlib's `RiemannHypothesis`** — a check that we have read the
definition correctly, not a proof of anything about zeros. -/
theorem critical_line_iff : CriticalLineHypothesis ↔ RiemannHypothesis :=
  Iff.rfl
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor

Theorem 4: part (2) proved as in the text from the divisibility (nk)∣lcm⁡(1,…,n)\binom{n}{k} \mid \operatorname{lcm}(1, \dots, n), and part (1) from Mathlib:

two_pow_le_lcmLean 4Proved here from basic factsFormally verified
/-- **`2ⁿ ≤ (n + 1) · lcm(1, 2, …, n)`.** Human proof: `2ⁿ = ∑_{k=0}^{n} C(n, k)` has `n + 1` terms,
and each binomial coefficient `C(n, k)` divides `lcm(1, …, n)` (Mathlib:
`Chebyshev.choose_dvd_lcmUpto`, a `p`-adic valuation argument), so is at most it. -/
theorem two_pow_le_lcm (n : ℕ) : 2 ^ n ≤ (n + 1) * Nat.lcmUpto n :=
  calc 2 ^ n = ∑ k ∈ Finset.range (n + 1), n.choose k := (Nat.sum_range_choose n).symm
    _ ≤ ∑ _k ∈ Finset.range (n + 1), Nat.lcmUpto n := by
      apply Finset.sum_le_sum
      intro k hk
      have hkn : k ≤ n := Nat.lt_succ_iff.mp (Finset.mem_range.mp hk)
      exact Nat.le_of_dvd (Nat.lcmUpto_pos n) (Chebyshev.choose_dvd_lcmUpto hkn)
    _ = (n + 1) * Nat.lcmUpto n := by simp
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
chebyshev_lowerLean 4Proved here from basic factsFormally verified
/-- **Chebyshev's lower bound**: `ψ(n) ≥ n log 2 − log(n + 1)`, so `ψ(x) ≫ x`. Take logarithms in
`two_pow_le_lcm` and use `ψ(n) = log lcm(1, …, n)` (Mathlib: `Chebyshev.psi_eq_log_lcmUpto`) — the
exponent of `p` in `lcm(1, …, n)` is the number of powers of `p` up to `n`. -/
theorem chebyshev_lower (n : ℕ) : n * Real.log 2 - Real.log (n + 1) ≤ Chebyshev.psi n := by
  have hpos : (0 : ℝ) < Nat.lcmUpto n := by exact_mod_cast Nat.lcmUpto_pos n
  have hkey : ((2 : ℝ) ^ n) ≤ (n + 1) * Nat.lcmUpto n := by exact_mod_cast two_pow_le_lcm n
  have hlog := Real.log_le_log (by positivity) hkey
  rw [Real.log_pow, Real.log_mul (by positivity) hpos.ne'] at hlog
  rw [Chebyshev.psi_eq_log_lcmUpto]
  linarith
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor
chebyshev_upperLean 4Applies a library theoremFormally verified
/-- **Chebyshev's upper bound**: `θ(x) = ∑_{p ≤ x} log p ≤ x log 4`, from `∏_{p ≤ n} p ≤ 4ⁿ`
(Mathlib: `primorial_le_four_pow`). Mathlib: `Chebyshev.theta_le_log4_mul_x`. -/
theorem chebyshev_upper {x : ℝ} (hx : 0 ≤ x) : Chebyshev.theta x ≤ Real.log 4 * x :=
  Chebyshev.theta_le_log4_mul_x hx
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor

Theorem 10, in full generality:

dirichlet_theoremLean 4Applies a library theoremFormally verified
/-- **Dirichlet's theorem** (1837): if `a` is a unit modulo `q`, there are infinitely many primes
`p ≡ a (mod q)`. The proof needs `L(1, χ) ≠ 0` for every non-trivial Dirichlet character `χ`.
Mathlib: `Nat.infinite_setOfPred_prime_and_eq_mod`. -/
theorem dirichlet_theorem {q : ℕ} [NeZero q] {a : ZMod q} (ha : IsUnit a) :
    {p : ℕ | p.Prime ∧ (p : ZMod q) = a}.Infinite :=
  Nat.infinite_setOfPred_prime_and_eq_mod ha
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AnalyticNumberTheory.leanTry it in the Lean web editor

What is and is not formalised. Proved here: Möbius inversion from ζ∗μ=1\zeta * \mu = 1, the 33-44-11 inequality, 2n≤(n+1)lcm⁡(1,…,n)2^n \leq (n + 1)\operatorname{lcm}(1, \dots, n) and Chebyshev's lower bound for ψ\psi. From Mathlib: the Euler product, ∑1/p=∞\sum 1/p = \infty, ζ(2)=π2/6\zeta(2) = \pi^2/6, the residue at 11, the functional equation, the trivial zeros, non-vanishing on Re⁡s≥1\operatorname{Re} s \geq 1, Chebyshev's upper bound and Dirichlet's theorem; and the statement of the Riemann hypothesis. Not formalised: the prime number theorem (not in Mathlib at this version; it was formalised in Isabelle by Avigad, Donnelly, Gray and Raff (2007) and in HOL Light by Harrison (2009), and it is a goal of the Lean project PrimeNumberTheoremAnd, from which Mathlib's Chebyshev file was partly upstreamed), the explicit formula, and the zero-free region.

ComputationC

Primes, counted and synthesised

The first experiment sieves the primes up to 10610^6 and compares π(x)\pi(x) with x/log⁡xx/\log x and li⁡(x)\operatorname{li}(x): the ratio π(x)/(x/log⁡x)\pi(x)/(x/\log x) creeps towards 11 while the difference grows, li⁡(x)\operatorname{li}(x) is far closer, and ψ(x)/x\psi(x)/x is already within 0.1%0.1\% of 11. It also runs the race between primes ≡1\equiv 1 and ≡3(mod4)\equiv 3 \pmod 4: the second team leads for a long time (Chebyshev's bias) and the first lead change happens at 2686126861, though both counts are asymptotically equal (Theorem 10 and its refinement).

Counting primes up to a millionPythonExact computationNumerical approximationComputationally tested
"""Counting primes: pi(x) against x/log x and li(x), and a prime race.

We sieve the primes up to one million and compare the prime-counting
function pi(x) with Gauss's and Legendre's approximations x/log x and the
logarithmic integral li(x) at x = 10, 100, ..., 10^6. The prime number
theorem says pi(x) / (x / log x) -> 1; the table shows how slowly, and that
the *difference* pi(x) - x/log x grows without bound even though the ratio
tends to 1. We also compute Chebyshev's psi(x) = sum of log p over prime
powers p^k <= x, for which psi(x)/x -> 1 is the same theorem, and the race
between primes 1 and 3 mod 4: primes 3 mod 4 lead for a long time (Chebyshev's
bias), the first lead change is at 26861 (Leech, 1957), and the ratio of the
two counts tends to 1 (Dirichlet; de la Vallee Poussin). Exact counts, with
li(x) computed from a convergent series in floating point; numerical
evidence about finitely many x, not a proof of any limit.
"""

import itertools
import math

EULER_GAMMA = 0.5772156649015329

def sieve(n):
    """Bytearray flags: flags[k] == 1 exactly when k is prime (0 <= k <= n)."""
    flags = bytearray([1]) * (n + 1)
    flags[0:2] = b"\x00\x00"[: min(2, n + 1)]
    for p in range(2, math.isqrt(n) + 1):
        if flags[p]:
            flags[p * p::p] = bytes(len(range(p * p, n + 1, p)))
    return flags

def prime_counts(flags, points):
    """pi(x) for each x in the increasing list points."""
    out, count, i = [], 0, 0
    for x in points:
        while i <= x:
            count += flags[i]
            i += 1
        out.append(count)
    return out

def li(x):
    """Logarithmic integral li(x) = gamma + log log x + sum (log x)^n/(n n!)."""
    t = math.log(x)
    total, term, n = 0.0, 1.0, 1
    while True:
        term *= t / n
        add = term / n
        total += add
        if add < 1e-17 * total:
            break
        n += 1
    return EULER_GAMMA + math.log(t) + total

def psi(flags, x):
    """Chebyshev psi(x) = sum of log p over prime powers p^k <= x."""
    total = 0.0
    for p in itertools.compress(range(x + 1), flags[:x + 1]):
        k, q = 0, p
        while q <= x:
            k, q = k + 1, q * p
        total += k * math.log(p)
    return total

def first_lead_change(flags, n):
    """First x <= n with #{p <= x : p = 1 mod 4} > #{p <= x : p = 3 mod 4}."""
    ones = threes = 0
    for x in range(3, n + 1):
        if flags[x]:
            if x % 4 == 1:
                ones += 1
            else:
                threes += 1
            if ones > threes:
                return x
    return None

def main():
    n = 10 ** 6
    flags = sieve(n)
    points = [10 ** k for k in range(1, 7)]
    counts = prime_counts(flags, points)
    print(f"{'x':>8} {'pi(x)':>7} {'x/log x':>10} {'ratio':>7} "
          f"{'pi - x/log x':>12} {'li(x) - pi':>10}")
    for x, c in zip(points, counts):
        approx = x / math.log(x)
        print(f"{x:>8} {c:>7} {approx:>10.1f} {c / approx:>7.4f} "
              f"{c - approx:>12.1f} {li(x) - c:>10.1f}")
    print("psi(x)/x at x = 10^3, 10^4, 10^5, 10^6:",
          " ".join(f"{psi(flags, x) / x:.4f}" for x in points[2:]))
    ones = sum(flags[5::4])
    threes = sum(flags[3::4])
    print(f"Primes below 10^6: {ones} are 1 mod 4, {threes} are 3 mod 4 "
          f"(ratio {ones / threes:.4f})")
    print("First x where primes 1 mod 4 take the lead:",
          first_lead_change(flags, 100000))
    print()
    print("Epistemic status: exact prime counts below 10^6 and floating-point")
    print("values of x/log x and li(x). The trends (ratio -> 1, difference")
    print("unbounded, li(x) closer) are numerical evidence; the limits are the")
    print("prime number theorem and Dirichlet's theorem, proved analytically.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The second experiment evaluates ζ\zeta with Euler–Maclaurin summation, locates the first ten zeros on the critical line as sign changes of Hardy's real function Z(t)Z(t), compares them with the published values, and feeds them into the explicit formula.

Zeros of zeta and the explicit formulaPythonNumerical approximationComputationally tested
"""Zeros of the Riemann zeta function, and how they generate the primes.

We evaluate zeta(s) for complex s by Euler-Maclaurin summation (valid for all
s != 1, error far below 1e-10 in the range used), check it against
zeta(2) = pi^2/6, and locate the zeros on the critical line Re s = 1/2 as sign
changes of Hardy's real function Z(t) = exp(i theta(t)) zeta(1/2 + it),
refined by bisection. The first ten zeros are compared with the published
values (Odlyzko's tables), and their number with the Riemann-von Mangoldt
formula N(T) ~ (T/2 pi) log(T/2 pi) - T/2 pi + 7/8. Finally the explicit
formula of von Mangoldt,
    psi(x) = x - sum_rho x^rho / rho - log(2 pi) - log(1 - x^-2) / 2,
truncated to these ten pairs of zeros, is compared with the true psi(x):
each zero contributes a wave, and together they start to carve the staircase
of prime powers. Numerical evidence only: locating zeros on the line says
nothing about zeros off it, and the Riemann hypothesis remains open.
"""

import cmath
import math

#: Bernoulli numbers B_2, B_4, ..., B_16.
BERNOULLI = [1 / 6, -1 / 30, 1 / 42, -1 / 30, 5 / 66, -691 / 2730, 7 / 6,
             -3617 / 510]

#: First ten ordinates of zeros on the critical line (Odlyzko's tables).
KNOWN_ZEROS = [14.134725142, 21.022039639, 25.010857580, 30.424876126,
               32.935061588, 37.586178159, 40.918719012, 43.327073281,
               48.005150881, 49.773832478]

def zeta(s, n_terms=30):
    """Riemann zeta(s), s != 1, by Euler-Maclaurin summation."""
    s = complex(s)
    n = n_terms
    total = sum(k ** -s for k in range(1, n))
    total += n ** (1 - s) / (s - 1) + n ** -s / 2
    rising = s                      # s (s+1) ... (s + 2j - 2)
    fact = 2.0                      # (2j)!
    for j, b in enumerate(BERNOULLI, start=1):
        total += b / fact * rising * n ** (-s - 2 * j + 1)
        rising *= (s + 2 * j - 1) * (s + 2 * j)
        fact *= (2 * j + 1) * (2 * j + 2)
    return total

def theta(t):
    """Riemann-Siegel theta function, asymptotic series (accurate for t > 10)."""
    return (t / 2 * math.log(t / (2 * math.pi)) - t / 2 - math.pi / 8
            + 1 / (48 * t) + 7 / (5760 * t ** 3) + 31 / (80640 * t ** 5))

def hardy_z(t):
    """Hardy's Z(t) = exp(i theta(t)) zeta(1/2 + it), real for real t."""
    return (cmath.exp(1j * theta(t)) * zeta(0.5 + 1j * t)).real

def zeros_on_line(t_min, t_max, step=0.05):
    """Ordinates of sign changes of Z in [t_min, t_max], refined by bisection."""
    found = []
    t, z_old = t_min, hardy_z(t_min)
    while t < t_max:
        t_new = t + step
        z_new = hardy_z(t_new)
        if z_old * z_new < 0:
            lo, hi = t, t_new
            for _ in range(40):
                mid = (lo + hi) / 2
                if hardy_z(lo) * hardy_z(mid) <= 0:
                    hi = mid
                else:
                    lo = mid
            found.append((lo + hi) / 2)
        t, z_old = t_new, z_new
    return found

def riemann_von_mangoldt(T):
    """Main terms of N(T), the number of zeros with 0 < Im rho < T."""
    u = T / (2 * math.pi)
    return u * math.log(u) - u + 7 / 8

def psi_exact(x):
    """Chebyshev psi(x) = sum of log p over prime powers p^k <= x."""
    total = 0.0
    for p in range(2, int(x) + 1):
        if all(p % q for q in range(2, math.isqrt(p) + 1)):
            q = p
            while q <= x:
                total += math.log(p)
                q *= p
    return total

def psi_explicit(x, zeros):
    """von Mangoldt's explicit formula truncated to rho = 1/2 +- i gamma."""
    total = x - math.log(2 * math.pi) - 0.5 * math.log(1 - x ** -2)
    for g in zeros:
        rho = complex(0.5, g)
        total -= 2 * (x ** rho / rho).real
    return total

def main():
    z2 = zeta(2)
    print(f"zeta(2) = {z2.real:.12f}, pi^2/6 = {math.pi ** 2 / 6:.12f}")
    print(f"|zeta(1/2 + 14.134725i)| = {abs(zeta(0.5 + 14.134725j)):.1e}")
    zeros = zeros_on_line(10, 50)
    print(f"Zeros of Z(t) in 10 < t < 50: {len(zeros)} found")
    err = max(abs(a - b) for a, b in zip(zeros, KNOWN_ZEROS))
    for start in (0, 5):
        print("  " + "  ".join(f"{g:.6f}" for g in zeros[start:start + 5]))
    print(f"  largest difference from published values: {err:.1e}")
    print(f"  Riemann-von Mangoldt main term N(50) = "
          f"{riemann_von_mangoldt(50):.2f}")
    print("Explicit formula with these 10 pairs of zeros:")
    print(f"  {'x':>5} {'psi(x)':>8} {'from zeros':>11}")
    for x in (7.5, 10.5, 15.5, 20.5, 25.5, 30.5):
        print(f"  {x:>5} {psi_exact(x):>8.3f} {psi_explicit(x, zeros):>11.3f}")
    print()
    print("Epistemic status: numerical computation in double precision. It")
    print("finds zeros on the critical line in one window; it cannot rule out")
    print("zeros off the line, so it is evidence for, not a proof of, the")
    print("Riemann hypothesis, which is open.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Exercises

Exercises

1. Analytic number theory

Warm-upHuman

Compute μ(30)+μ(36)+μ(7)\mu(30) + \mu(36) + \mu(7), where μ\mu is the Möbius function.

2. Analytic number theory

Warm-upHuman

Which Dirichlet series equals 1/ζ(s)1/\zeta(s) for Re⁡s>1\operatorname{Re} s > 1?

Choose one

3. Analytic number theory

CoreHuman

The prime number theorem says π(x)∼x/log⁡x\pi(x) \sim x/\log x. Which statement is a correct reading of it?

Choose one

4. Analytic number theory

CoreHuman

In the proof that ζ(1+it)≠0\zeta(1 + it) \ne 0 (Theorem 7), why does ζ(σ+2it)\zeta(\sigma + 2it) stay bounded as σ→1+\sigma \to 1^+ (for fixed t≠0t \ne 0)?

Choose one

5. Analytic number theory

CoreHuman

Gauss's identity ∑d∣nφ(d)=n\sum_{d \mid n}\varphi(d) = n says φ∗1=id⁡\varphi * \mathbf{1} = \operatorname{id}. Möbius inversion gives φ(n)=∑d∣nμ(d) nd=n∏p∣n(1−1p)\varphi(n) = \sum_{d \mid n}\mu(d)\,\frac{n}{d} = n\prod_{p \mid n}\left(1 - \frac1p\right). Compute φ(60)\varphi(60).

6. Analytic number theory

CoreHuman

Every non-trivial zero ρ\rho of ζ\zeta with 0<Im⁡ρ≤3⋅10120 < \operatorname{Im}\rho \le 3 \cdot 10^{12} has been verified to lie on the critical line. What follows?

Choose one

7. Analytic number theory

StretchHuman

Suppose (hypothetically) that ζ\zeta had a zero ρ=0.9+iγ\rho = 0.9 + i\gamma. Using the explicit formula, what is the best possible error term one could then hope for in ψ(x)=x+E(x)\psi(x) = x + E(x)?

Choose one

8. Analytic number theory

CoreFormal

Which Lean proposition correctly states the Riemann hypothesis (for Mathlib's riemannZeta : ℂ → ℂ, which assigns a junk value at the pole s=1s = 1)?

Choose one

9. Analytic number theory

StretchComputational

Write mobius(n) for n≥1n \ge 1: return 00 if nn has a repeated prime factor, and (−1)k(-1)^k if nn is a product of kk distinct primes. Then check numerically that ∑d∣nμ(d)=0\sum_{d \mid n}\mu(d) = 0 for 1<n≤2001 < n \le 200 (Proposition 1).

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Common misconceptionsH

Common misconceptions

Misconception

"Billions of zeros have been checked, so the Riemann hypothesis is essentially proved." More than 101310^{13} zeros are known to lie on the critical line, but that is a finite amount of evidence about infinitely many zeros, and number theory has famous examples of patterns that fail only at enormous heights: π(x)<li⁡(x)\pi(x) < \operatorname{li}(x) holds for every xx ever computed, yet Littlewood proved that it fails infinitely often. Numerical verification is evidence, not proof; the Riemann hypothesis is open.

Misconception

"π(x)∼x/log⁡x\pi(x) \sim x/\log x means π(x)−x/log⁡x→0\pi(x) - x/\log x \to 0." It means the ratio tends to 11. The difference grows without bound: it is 61166116 at x=106x = 10^6 and is of order x/log⁡2xx/\log^2 x. Even the much better approximation li⁡(x)\operatorname{li}(x) has an error that is unbounded (by Littlewood) and, under the Riemann hypothesis, of order at most xlog⁡x\sqrt x\log x.

Misconception

"1+2+3+⋯=−1121 + 2 + 3 + \cdots = -\frac{1}{12} because ζ(−1)=−112\zeta(-1) = -\frac{1}{12}." The series ∑n−s\sum n^{-s} converges only for Re⁡s>1\operatorname{Re} s > 1; ζ(−1)=−112\zeta(-1) = -\frac{1}{12} is the value at −1-1 of the unique analytic continuation, not a sum of the divergent series. (Regularisation methods in physics do assign −112-\frac{1}{12} to it, but that is a different, carefully specified procedure.)

Misconception

"Primes in progressions are as easy as primes: just repeat Euclid's argument." Euclid-style arguments exist for some progressions — 4k+34k + 3, 4k+14k + 1, and more generally exactly the classes a mod qa \bmod q with a2≡1(modq)a^2 \equiv 1 \pmod q (Schur, 1912; Murty, 1988) — but not for all. Dirichlet needed LL-functions and the non-vanishing of L(1,χ)L(1, \chi). (Selberg found an elementary proof in 1949, but it is not a variation on Euclid.)

ViewpointsH

Viewpoints

Analysis— Fourier duality between primes and zeros

The explicit formula is a Fourier-type duality, made precise by Weil: schematically, for a nice even test function gg with Fourier transform hh,

∑γh(γ)=h ⁣(i2)+h ⁣(−i2)−12π∑nΛ(n)n(g(log⁡n)+g(−log⁡n))+(archimedean term),\sum_\gamma h(\gamma) = h\!\left(\tfrac{i}{2}\right) + h\!\left(-\tfrac{i}{2}\right) - \frac{1}{2\pi}\sum_n \frac{\Lambda(n)}{\sqrt n}\big(g(\log n) + g(-\log n)\big) + (\text{archimedean term}),

summing over the ordinates of non-trivial zeros on one side and prime powers on the other — the analogue of the Poisson summation formula that proves the functional equation. Analysis supplies the tools: Mellin and Laplace transforms, contour integration, Tauberian theorems (Wiener–Ikehara gives the prime number theorem from Theorem 7 alone), and sieve methods, which bound primes in sets where LL-functions say nothing. Modern highlights mix these: Yitang Zhang (2013) proved bounded gaps between primes, and Maynard and Tao (2013) found a simpler sieve; the best bound, 246246, is due to the Polymath project.

Probability— Primes as a random-looking set

Cramér's model (each nn prime with probability 1/log⁡n1/\log n) is a heuristic that predicts the size of prime gaps (Cramér conjectured lim sup⁡(pn+1−pn)/log⁡2pn=1\limsup (p_{n+1} - p_n)/\log^2 p_n = 1) and the Riemann-hypothesis-sized error term. Some probabilistic statements are theorems: the Erdős–Kac theorem (1940) says that the number of distinct prime factors ω(n)\omega(n) of a random n≤xn \leq x is asymptotically normal with mean and variance log⁡log⁡x\log\log x — a central limit theorem for arithmetic. The Möbius function behaves like a random sign: the prime number theorem is equivalent to ∑n≤xμ(n)=o(x)\sum_{n \leq x}\mu(n) = o(x), and the Riemann hypothesis to ∑n≤xμ(n)=O(x1/2+ε)\sum_{n \leq x}\mu(n) = O(x^{1/2 + \varepsilon}), the square-root cancellation of a random walk. Sarnak's Möbius disjointness conjecture and Chowla's conjecture make "μ\mu is random" precise; Tao and Teräväinen have proved cases of them.

Physics— Zeros and random matrices

In 1972 Hugh Montgomery computed (assuming the Riemann hypothesis, and for a restricted class of test functions) the pair correlation of the zeros 12+iγ\frac12 + i\gamma: normalised spacings are distributed with density 1−(sin⁡πuπu)21 - \left(\frac{\sin\pi u}{\pi u}\right)^2. Freeman Dyson recognised this as the pair correlation of eigenvalues of large random Hermitian matrices (the Gaussian Unitary Ensemble), which models energy levels of heavy nuclei and quantum chaotic systems. Andrew Odlyzko's computations of zeros near the 102010^{20}-th zero (1980s onwards) match GUE statistics with striking precision. This suggests the Hilbert–Pólya idea that the γ\gamma's are the eigenvalues of a self-adjoint operator, which would imply the Riemann hypothesis. All of this is conjecture supported by numerical evidence and partial theorems; no such operator is known. Random matrix theory also predicts moments of ζ\zeta on the critical line (Keating and Snaith, 2000), again conjecturally.

Geometry— The Riemann hypothesis for curves is a theorem

For a smooth projective curve CC of genus gg over Fq\mathbb{F}_q, the zeta function Z(C,T)=exp⁡(∑m#C(Fqm) Tm/m)Z(C, T) = \exp\big(\sum_m \#C(\mathbb{F}_{q^m})\,T^m/m\big) is a rational function P(T)(1−T)(1−qT)\frac{P(T)}{(1 - T)(1 - qT)} with deg⁡P=2g\deg P = 2g, it satisfies a functional equation, and all zeros of PP have absolute value q−1/2q^{-1/2} — the exact analogue of the Riemann hypothesis, proved by Weil in the 1940s (Hasse had done g=1g = 1 in 1933) and generalised to all varieties by Deligne (1974). Geometrically, #C(Fqm)=qm+1−∑i=12gαim\#C(\mathbb{F}_{q^m}) = q^m + 1 - \sum_{i=1}^{2g}\alpha_i^m is a Lefschetz fixed-point formula for the Frobenius map acting on cohomology, and ∣αi∣=q|\alpha_i| = \sqrt q is a positivity statement (the Hodge index theorem on C×CC \times C). In the analogy, Spec⁡Z\operatorname{Spec}\Z is a "curve" whose missing cohomology theory would prove the Riemann hypothesis; this analogy has guided research for eighty years but is not a proof strategy anyone has completed (see algebraic geometry and arithmetic geometry).

Algebra— Characters are Fourier analysis on a finite group

Dirichlet characters are the characters (one-dimensional representations) of the finite abelian group (Z/qZ)×(\Z/q\Z)^\times, and the orthogonality relations used in Theorem 10 are Fourier analysis on that group: the indicator function of a residue class is 1φ(q)∑χχ(a)‾χ\frac{1}{\varphi(q)}\sum_\chi\overline{\chi(a)}\chi. Replacing (Z/q)×(\Z/q)^\times by Galois groups leads to Artin LL-functions L(s,ρ)L(s, \rho) of Galois representations ρ\rho, whose analytic properties encode the splitting of primes in number fields (Chebotarev's density theorem generalises Dirichlet's theorem). The quadratic character χd\chi_d satisfies ζQ(d)(s)=ζ(s)L(s,χd)\zeta_{\Q(\sqrt d)}(s) = \zeta(s)L(s, \chi_d), so L(1,χd)≠0L(1, \chi_d) \neq 0 is a statement about class numbers (see algebraic number theory). The Langlands programme predicts that all such LL-functions are automorphic (see the Langlands programme).

Wonder Trails

Wonder Trail

The trail starts where this lesson does — Euclid's proof and a table of primes — and is a good companion for younger readers.

Wonder Trail · Optional · never gradedPrimes forever2, 3, 5, 7, 11, 13, … The primes get rarer as the numbers grow. Do they ever run out? And how rare do they get?Follow the trail
History & global context

History and global context

  • Mādhava of Sangamagrāma (Kerala, c. 1400) found the series π4=1−13+15−⋯\frac{\pi}{4} = 1 - \frac13 + \frac15 - \cdots, rediscovered by Gregory and Leibniz; it is L(1,χ4)L(1, \chi_4). Leonhard Euler found the Euler product and proved that ∑1/p\sum 1/p diverges (1737), and evaluated ζ(2)=π2/6\zeta(2) = \pi^2/6 (1734).
  • Gauss (from about 1792, described in an 1849 letter to Encke) and Legendre (1798) conjectured the prime number theorem. Dirichlet (1837) proved his theorem on primes in progressions, inventing characters and LL-functions. Pafnuty Chebyshev (1848–52) proved π(x)≍x/log⁡x\pi(x) \asymp x/\log x with explicit constants and Bertrand's postulate.
  • Bernhard Riemann's eight-page memoir Ueber die Anzahl der Primzahlen unter einer gegebenen Grösse (1859) introduced ζ\zeta as a complex function, proved the functional equation, sketched the explicit formula and stated the Riemann hypothesis. Hans von Mangoldt proved the explicit formula (1895); Jacques Hadamard and Charles de la Vallée Poussin independently proved the prime number theorem (1896).
  • G. H. Hardy proved that infinitely many zeros lie on the critical line, and J. E. Littlewood that π(x)−li⁡(x)\pi(x) - \operatorname{li}(x) changes sign infinitely often (both 1914). Srinivasa Ramanujan and Hardy developed the circle method (1918), which I. M. Vinogradov used to prove that every sufficiently large odd number is a sum of three primes (1937); Harald Helfgott completed this ternary Goldbach theorem (2013). Chen Jingrun proved that every sufficiently large even number is a prime plus a product of at most two primes (1973).
  • Atle Selberg and Paul Erdős found elementary proofs of the prime number theorem (1948–49). Ben Green and Terence Tao proved that the primes contain arbitrarily long arithmetic progressions (2004), and Yitang Zhang proved bounded gaps between primes (2013), improved by James Maynard, Tao and the Polymath project.
Further reading

Further reading

  • Tom M. Apostol, Introduction to Analytic Number Theory (1976) — arithmetic functions, Dirichlet series, Dirichlet's theorem and the prime number theorem, very carefully.
  • Harold Davenport, Multiplicative Number Theory (1967; 3rd ed. revised by H. L. Montgomery, 2000) — the classical theory of ζ\zeta and LL-functions, the explicit formula and zero-free regions, in short chapters.
  • Hugh L. Montgomery and Robert C. Vaughan, Multiplicative Number Theory I: Classical Theory (2007) — a modern graduate course.
  • H. M. Edwards, Riemann's Zeta Function (1974) — Riemann's memoir read line by line, with its history.
  • E. C. Titchmarsh, The Theory of the Riemann Zeta-Function (1951; 2nd ed. revised by D. R. Heath-Brown, 1986) — the standard reference on ζ\zeta.
  • Don Zagier, Newman's short proof of the prime number theorem, American Mathematical Monthly 104 (1997) — four pages.
  • Henryk Iwaniec and Emmanuel Kowalski, Analytic Number Theory (2004) — the research-level panorama.