RiemannA guide by Principia Superintelligence

Part II, chapter 7

Chebyshev's trick, and where it stalls

An integer divisible by many primes is at least their product. That one line bounds primes from above, which is the direction chapter 4 needs. Applied to n!n! it gives Chebyshev's theorem and no more, because floors hide everything. The heart of the proof builds the object that Chebyshev lacked.

draft, under review14 minfirst published in v0.1.0, 2026-11-22

Where Part II begins

Part I ended at a contract. Chapter 4 showed that an upper bound G(x)≤x1/2+εG(x) \le x^{1/2+\varepsilon} on sparse windows [Y,Y3/2][Y, Y^{3/2}] rules out every zero to the right of the critical line, and chapter 6 named the statement, , that the arithmetic half of the archive hands to the analytic half. Part II is about that arithmetic half: how one proves an upper bound on a sum over primes with an error as small as x\sqrt{x}.

The method is old. Chebyshev used it in 1850 to prove that ψ(x)\psi(x), the weighted count of prime powers up to xx, lies between c1xc_1 x and c2xc_2 x. Its single idea is that divisibility bounds size: if a nonzero integer is divisible by many primes, it must be large. The whole heart of the proof is this idea, pushed until the error term is x\sqrt x instead of xx. This chapter explains the idea in its classical form, measures exactly where it stalls, and lists what an “integer” would have to look like to do better. the exposition (§I.2) is the source for the shape of this account; the numbers are ours.

our exposition This chapter is motivation. The archive has no theorem called “Chebyshev’s method”; its elementary ingredients appear below as the small lemmas the archive does prove, and the big construction occupies chapters 8 to 15.

The binomial coefficient

Let N=(2nn)N = \binom{2n}{n}. Every prime pp with n<p≤2nn < p \le 2n divides (2n)!(2n)! exactly once and does not divide n! n!n!\,n! at all, so pp divides NN. A positive integer divisible by distinct primes is at least their product. On the other side, NN is one term of (1+1)2n(1+1)^{2n}, so N≤4nN \le 4^n. Together,

∑n<p≤2nlog⁡p  ≤  log⁡N  ≤  2nlog⁡2.\sum_{n < p \le 2n} \log p \;\le\; \log N \;\le\; 2n \log 2 .

In general, if Δ\Delta is a nonzero integer and pepp^{e_p} divides Δ\Delta for each prime pp in some set, then

∑peplog⁡p  ≤  log⁡∣Δ∣.\sum_p e_p \log p \;\le\; \log|\Delta| .

Divisibility is a statement about each prime separately; size is a statement about real numbers; the inequality is the bridge, and it always points the same way. It bounds primes from above. That is the direction the window lemma of chapter 4 consumes. (The same count, for a polynomial, says that a polynomial of degree DD has at most D/mD/m distinct roots of multiplicity mm; Stepanov used it for curves over finite fields, and the archive’s chain of mm maps in chapter 9 is the analogue of his multiplicity mm.)

Every prime between nn and 2n2n divides the middle binomial coefficient, which is at most 4n4^n. Below: Legendre's staircase for the exponent of 3 in n!n! against the smooth ramp n/2n/2; the fractional parts between them add up to about 0.42 n0.42\,n.

The best classical integer

For Δ=n!\Delta = n! both sides are known exactly. Legendre's formula says that the exponent of pp in n!n! is ∑h≥1⌊n/ph⌋\sum_{h \ge 1} \lfloor n/p^h \rfloor. Summing over primes with the weight log⁡p\log p, and writing Λ\Lambda for the von Mangoldt function of chapter 2,

log⁡n!  =  ∑r≤nΛ(r)⌊nr⌋.\log n! \;=\; \sum_{r \le n} \Lambda(r) \Big\lfloor \frac{n}{r} \Big\rfloor .

The left side is nlog⁡n−n+O(log⁡n)n\log n - n + O(\log n) by Stirling. If the floor were not there, the right side would be n∑r≤nΛ(r)/rn \sum_{r\le n} \Lambda(r)/r, which equals S(n)+ψ(n)S(n) + \psi(n) in the notation of chapter 2: essentially the statistic G(n)G(n) we want to bound.

The archive proves the lower half of Legendre’s formula in the form it later needs: the exponent of pp in m!m! is at least m/(p−1)m/(p-1) minus the number of base-pp digits of mm.

Formalism.InvariantFactorPaths.G7.FactorialLgdefUniformThetaSubstitution/StatementAB.lean:97The statement: for a prime pp and m≥0m \ge 0, m/(p−1)−λp(m)≤vp(m!)m/(p-1) - \lambda_p(m) \le v_p(m!), where λp(m)\lambda_p(m) counts the digits of mm in base pp. Legendre's exact formula gives vp(m!)=(m−sp(m))/(p−1)v_p(m!) = (m - s_p(m))/(p-1) with sps_p the digit sum, and each digit is at most p−1p - 1.
def FactorialLg : Prop

The statement: for a prime pp and m≥0m \ge 0, m/(p−1)−λp(m)≤vp(m!)m/(p-1) - \lambda_p(m) \le v_p(m!), where λp(m)\lambda_p(m) counts the digits of mm in base pp. Legendre's exact formula gives vp(m!)=(m−sp(m))/(p−1)v_p(m!) = (m - s_p(m))/(p-1) with sps_p the digit sum, and each digit is at most p−1p - 1.

Full declaration with proof
def FactorialLg : Prop :=
  ∀ (p m : ℕ), p.Prime → (m : ℝ) / ((p : ℝ) - 1) - lgN p m ≤ (padicValNat p m.factorial : ℝ)
Formalism.InvariantFactorPaths.G7.factorialValuationLowerBoundtheoremFrobeniusLiftNorms/ABArith.lean:35The proof of the statement above. Chapter 10 uses it to count the factorials that a derivative of order aa produces.
theorem factorialValuationLowerBound : FactorialLg

The proof of the statement above. Chapter 10 uses it to count the factorials that a derivative of order aa produces.

Full declaration with proof
theorem factorialValuationLowerBound : FactorialLg := by
  intro p m hp
  have : Fact p.Prime := ⟨hp⟩
  have h1 := sub_one_mul_padicValNat_factorial (p := p) m
  have h2 := Nat.digit_sum_le p m
  have h3 := digits_sum_le_lgN p m hp.one_lt
  have h4 : m ≤ (p - 1) * (padicValNat p m.factorial + lgN p m) := by
    rw [mul_add, h1]
    omega
  have hp1 : (0 : ℝ) < (p : ℝ) - 1 := by
    have : (1 : ℝ) < p := by exact_mod_cast hp.one_lt
    linarith
  have h5 : (m : ℝ) ≤ ((p : ℝ) - 1) * ((padicValNat p m.factorial : ℝ) + lgN p m) := by
    have h6 : ((p - 1 : ℕ) : ℝ) = (p : ℝ) - 1 := by
      rw [Nat.cast_sub hp.one_lt.le, Nat.cast_one]
    rw [← h6]
    exact_mod_cast h4
  rw [sub_le_iff_le_add, div_le_iff₀ hp1]
  linarith
Formalism.InvariantFactorPaths.G7.lgNdefUniformThetaSubstitution/StatementAB.lean:95The digit count λp\lambda_p: ⌊log⁡px⌋+1\lfloor \log_p x \rfloor + 1 for x≥1x \ge 1, and 00 at 00.
def lgN (p x : ℕ) : ℕ

The digit count λp\lambda_p: ⌊log⁡px⌋+1\lfloor \log_p x \rfloor + 1 for x≥1x \ge 1, and 00 at 00.

Where it stalls

The floor is there. Writing ⌊n/r⌋=n/r−{n/r}\lfloor n/r \rfloor = n/r - \{n/r\}, the fractional parts contribute

∑r≤nΛ(r){nr},\sum_{r \le n} \Lambda(r) \Big\{ \frac{n}{r} \Big\} ,

and this sum is of size nn: numerically it settles near 0.42 n0.42\,n (the chart below). That is as large as the term −n-n on the left side of Stirling’s formula. All the information about ψ(n)−n\psi(n) - n, and with it about G(n)G(n), is hidden in the fractional parts, and Legendre’s formula cannot separate it. This is why Chebyshev’s method yields c1n≤ψ(n)≤c2nc_1 n \le \psi(n) \le c_2 n and no more. Bertrand's postulate is the classical corollary; the Riemann Hypothesis is forty orders of precision further.

101001,00010,000101001,00010,000n2n log 2log C(2n, n)sum of log p over n < p ≤ 2n101001,00010,000100,0000.00.20.40.6n(1/n) · sum of Λ(r)·{n/r} over r ≤ n
Above: the three quantities in Chebyshev's inequality grow together, and the gap between the prime sum and 2n log 2 never closes. Below: the fractional parts in Legendre's formula add up to about 0.42 n, the same order as the term ψ(n) − n one would like to see.

What would be needed

The exposition lists three wishes (§I.2), and the rest of Part II is the construction that grants them.

  • Smooth exponents (W1). A nonzero “integer” Δ\Delta in which the exponent of php^h is a smooth function of php^h, like the ramp (x/ph−1)+(x/p^h - 1)_+ of chapter 2, with no floor function, or with rounding that is negligible. Chapter 8 finds such integers; chapter 10 explains why their exponents are smooth.
  • Size known to the linear term (W2). log⁡∣Δ∣\log|\Delta| must be known with an error much smaller than its linear term, in fact smaller by a factor of about x−1/2x^{-1/2}, where xx is the scale at which the primes are tested. Chapters 9 and 13 are about size.
  • All primes (W3). The primes that occur must be all primes, or a set of primes that can be related to all primes. Chapters 11 and 12 do this with Dirichlet characters.

No single integer does all three. The final object is a linear map between lattices, and the inequality above becomes an inequality between the index of a lattice and the norm of a map. Chapter 14 states it. Its statement in the archive is already visible from here:

Formalism.F.SlopeInequalitydefLatticeSlopes/Statement.lean:75For lattices L⊂EL \subset E and M⊂FM \subset F in Euclidean spaces and an injective linear map φ ⁣:L→M\varphi\colon L \to M with ∥φx∥≤C∥x∥\|\varphi x\| \le C\|x\|: slope(L)≤μmax⁡(M)+log⁡C\mathrm{slope}(L) \le \mu_{\max}(M) + \log C. The slope is −log⁡(covolume)/rank-\log(\mathrm{covolume})/\mathrm{rank}. For L=M=ZL = M = \mathbb Z this is exactly the one-line inequality of this chapter.
def SlopeInequality : Prop

For lattices L⊂EL \subset E and M⊂FM \subset F in Euclidean spaces and an injective linear map φ ⁣:L→M\varphi\colon L \to M with ∥φx∥≤C∥x∥\|\varphi x\| \le C\|x\|: slope(L)≤μmax⁡(M)+log⁡C\mathrm{slope}(L) \le \mu_{\max}(M) + \log C. The slope is −log⁡(covolume)/rank-\log(\mathrm{covolume})/\mathrm{rank}. For L=M=ZL = M = \mathbb Z this is exactly the one-line inequality of this chapter.

Full declaration with proof
def SlopeInequality : Prop :=
  ∀ (E F : Type*) [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E]
    [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F]
    (L : Submodule ℤ E) (M : Submodule ℤ F), DiscreteTopology L → DiscreteTopology M → L ≠ ⊥ →
    ∀ (φ : L →ₗ[ℤ] M) (C : ℝ), Function.Injective φ →
    (∀ x : L, ‖((φ x : M) : F)‖ ≤ C * ‖(x : E)‖) →
    slope L ≤ muMax M + Real.log C

A first look at the gain

One more identity belongs here, because it names the quantity the whole construction is built to produce. For an odd prime pp,

1p+1p3+1p5+⋯  =  pp2−1  =  1p−1−1p2−1.\frac{1}{p} + \frac{1}{p^3} + \frac{1}{p^5} + \cdots \;=\; \frac{p}{p^2-1} \;=\; \frac{1}{p-1} - \frac{1}{p^2-1} .

Chapter 8 shows that for primes of a certain kind, the integers it constructs are divisible by pp to an exponent of about a⋅p/(p2−1)a \cdot p/(p^2-1), where aa is the order of a derivative; the two forms of the identity are the two halves of that computation, a/(p−1)a/(p-1) from a factorial and −a/(p2−1)-a/(p^2-1) from a power series.

Formalism.GrowthSums.GammaIdentitydefGrowthSums/StatementA.lean:67For real p>1p > 1: the series ∑np−(2n+1)\sum_n p^{-(2n+1)} sums to γp=p/(p2−1)\gamma_p = p/(p^2-1), and γp=1/(p−1)−ρp\gamma_p = 1/(p-1) - \rho_p with ρp=1/(p2−1)\rho_p = 1/(p^2-1).
def GammaIdentity : Prop

For real p>1p > 1: the series ∑np−(2n+1)\sum_n p^{-(2n+1)} sums to γp=p/(p2−1)\gamma_p = p/(p^2-1), and γp=1/(p−1)−ρp\gamma_p = 1/(p-1) - \rho_p with ρp=1/(p2−1)\rho_p = 1/(p^2-1).

Full declaration with proof
def GammaIdentity : Prop :=
  ∀ p : ℝ, 1 < p →
    HasSum (fun n : ℕ => (p ^ (2 * n + 1))⁻¹) (gamP p) ∧ gamP p = 1 / (p - 1) - rhoP p
Formalism.GrowthSums.gamPdefGrowthSums/StatementA.lean:65γp=p⋅ρp\gamma_p = p \cdot \rho_p.
def gamP (p : ℝ) : ℝ

γp=p⋅ρp\gamma_p = p \cdot \rho_p.

Formalism.GrowthSums.rhoPdefGrowthSums/StatementA.lean:63ρp=1/(p2−1)\rho_p = 1/(p^2 - 1), the cost per unit of degree of the series in chapter 8.
def rhoP (p : ℝ) : ℝ

ρp=1/(p2−1)\rho_p = 1/(p^2 - 1), the cost per unit of degree of the series in chapter 8.

The numbers, and how they were computed

The chart and the animation use data/numerics/chebyshev.json, produced by the heart module of our tools from a sieve to 10610^6. For n=50n = 50 the three quantities of Chebyshev’s inequality are 42.77≤66.78≤69.3142.77 \le 66.78 \le 69.31; for n=5000n = 5000 they are 4984.3≤6926.6≤6931.54984.3 \le 6926.6 \le 6931.5. The fractional-part sum ∑r≤nΛ(r){n/r}\sum_{r \le n} \Lambda(r)\{n/r\} divided by nn is 0.3480.348 at n=100n = 100, 0.4170.417 at 10310^3, 0.4240.424 at 10410^4 and 0.4230.423 at 10510^5. The exposition states the size as “of size nn” without a constant; the value near 0.420.42 is consistent with the heuristic ∫01{1/t} dt=1−γ=0.4228…\int_0^1 \{1/t\}\,dt = 1 - \gamma = 0.4228\ldots for the mean of a fractional part, which is what one expects if the prime powers were spread evenly.