The Turan-Kubilius inequality for the number of distinct prime factors
ProvedProbabilisticNT.turan_kubiliusThe Turán–Kubilius inequality measures how tightly the number of distinct prime factors of an integer clusters around its average.
Here is the number of distinct prime factors of , and the sum runs over the integers . Hardy and Ramanujan showed that has normal order ; this inequality is the quantitative form of that statement, bounding the total squared deviation from by . Dividing by , the mean square deviation is , so a typical integer has .
The inequality is the analytic engine behind the Erdős–Kac theorem, which upgrades it to a central limit theorem for , and it is the standard tool in probabilistic number theory for controlling additive arithmetic functions by a second-moment argument. Turán's original proof of the Hardy–Ramanujan result rests on exactly this estimate, and it in turn rests on Mertens' second theorem for the sum of reciprocals of primes.
Formalization note. The bound is stated with explicit constants and a threshold , both
existentially quantified. The count is n.primeFactors.card and the range is
Finset.Icc 1 ⌊x⌋₊. Only Mathlib is required; no auxiliary definitions are introduced.
import Mathlib
namespace ProbabilisticNT
/-- The Turán–Kubilius inequality: the number of distinct prime factors `ω(n)` has
mean square deviation from `log log x` of order `x · log log x`. -/
theorem turan_kubilius :
∃ C : ℝ, ∃ x₀ : ℝ, 0 < C ∧ ∀ x : ℝ, x₀ ≤ x →
∑ n ∈ Finset.Icc 1 ⌊x⌋₊, ((n.primeFactors.card : ℝ) - Real.log (Real.log x)) ^ 2
≤ C * x * Real.log (Real.log x) := by
sorry
end ProbabilisticNT