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 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 on sparse windows rules out every zero to the right of the critical line, and chapter 6 named the statement, TopGUpperTheory.Top.TopGdefCharacterBoxes/ZeroFreeAllOfTopG.lean:12def TopG : Prop, 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 .
The method is old. Chebyshev used it in 1850 to prove that , the weighted count of prime powers up to , lies between and . 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 instead of . 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 . Every prime with divides exactly once and does not divide at all, so divides . A positive integer divisible by distinct primes is at least their product. On the other side, is one term of , so . Together,
In general, if is a nonzero integer and divides for each prime in some set, then
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 has at most distinct roots of multiplicity ; Stepanov used it for curves over finite fields, and the archive’s chain of maps in chapter 9 is the analogue of his multiplicity .)
The best classical integer
For both sides are known exactly. Legendre's formula says that the exponent of in is . Summing over primes with the weight , and writing for the von Mangoldt function of chapter 2,
The left side is by Stirling. If the floor were not there, the right side would be , which equals in the notation of chapter 2: essentially the statistic we want to bound.
The archive proves the lower half of Legendre’s formula in the form it later needs: the exponent of in is at least minus the number of base- digits of .
Formalism.InvariantFactorPaths.G7.FactorialLgdefUniformThetaSubstitution/StatementAB.lean:97The statement: for a prime and , , where counts the digits of in base . Legendre's exact formula gives with the digit sum, and each digit is at most .
def FactorialLg : Prop
The statement: for a prime and , , where counts the digits of in base . Legendre's exact formula gives with the digit sum, and each digit is at most .
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 produces.
theorem factorialValuationLowerBound : FactorialLg
The proof of the statement above. Chapter 10 uses it to count the factorials that a derivative of order 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]
linarithFormalism.InvariantFactorPaths.G7.lgNdefUniformThetaSubstitution/StatementAB.lean:95The digit count : for , and at .
def lgN (p x : ℕ) : ℕ
The digit count : for , and at .
Where it stalls
The floor is there. Writing , the fractional parts contribute
and this sum is of size : numerically it settles near (the chart below). That is as large as the term on the left side of Stirling’s formula. All the information about , and with it about , is hidden in the fractional parts, and Legendre’s formula cannot separate it. This is why Chebyshev’s method yields and no more. Bertrand's postulate is the classical corollary; the Riemann Hypothesis is forty orders of precision further.
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” in which the exponent of is a smooth function of , like the ramp 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). must be known with an error much smaller than its linear term, in fact smaller by a factor of about , where 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 and in Euclidean spaces and an injective linear map with : . The slope is . For this is exactly the one-line inequality of this chapter.
def SlopeInequality : Prop
For lattices and in Euclidean spaces and an injective linear map with : . The slope is . For 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 CA 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 ,
Chapter 8 shows that for primes of a certain kind, the integers it constructs are divisible by to an exponent of about , where is the order of a derivative; the two forms of the identity are the two halves of that computation, from a factorial and from a power series.
Formalism.GrowthSums.GammaIdentitydefGrowthSums/StatementA.lean:67For real : the series sums to , and with .
def GammaIdentity : Prop
For real : the series sums to , and with .
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 pFormalism.GrowthSums.gamPdefGrowthSums/StatementA.lean:65.
def gamP (p : ℝ) : ℝ
.
Formalism.GrowthSums.rhoPdefGrowthSums/StatementA.lean:63, the cost per unit of degree of the series in chapter 8.
def rhoP (p : ℝ) : ℝ
, 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 . For the three quantities of Chebyshev’s inequality are ; for they are . The fractional-part sum divided by is at , at , at and at . The exposition states the size as “of size ” without a constant; the value near is consistent with the heuristic for the mean of a fractional part, which is what one expects if the prime powers were spread evenly.