Under RH, prime gaps are
ProvedCramer.primeGap_isBigO_sqrt_mul_log_sq_of_riemannHypothesisanalytic-number-theoryprime-gapsriemann-hypothesis
Assume the Riemann hypothesis, in Mathlib's form RiemannHypothesis. Let be the -th prime () and the -th prime gap. Then
This is the classical consequence of RH for gaps between consecutive primes. Cramér (1920) proved the sharper bound by a smoothed explicit formula; the stated bound is the weaker form. It follows directly from the von Koch-type estimate : an interval always contains a prime for large .
Formalization Note. is LindelofHypothesis.primeGap n Nat.nth Nat.Prime (n+1) - Nat.nth Nat.Prime n, from the definitions bundle LindelofHypothesis_GrowthAndZeroCounts, also used by LindelofHypothesis.ingham_primeGap_of_lindelof. The is Asymptotics.IsBigO along Filter.atTop on .
Preamble
import Mathlib import Definitions.Def_LindelofHypothesis_GrowthAndZeroCounts
Formal statement
namespace Cramer
theorem primeGap_isBigO_sqrt_mul_log_sq_of_riemannHypothesis (hRH : RiemannHypothesis) :
(fun n : ℕ => (LindelofHypothesis.primeGap n : ℝ)) =O[Filter.atTop]
(fun n : ℕ => Real.sqrt (Nat.nth Nat.Prime n : ℝ) * Real.log (Nat.nth Nat.Prime n : ℝ) ^ 2) := by sorry
end CramerSource
H. Cramér, Some theorems concerning prime numbers, Ark. Mat. Astr. Fys. 15 (1920), no. 5 (under RH, p_{n+1} - p_n = O(√p_n log p_n)); the stated O(√p_n log² p_n) is the weaker bound obtained from θ(x) = x + O(√x log² x) under RH (von Koch 1901). See also H. L. Montgomery and R. C. Vaughan, Multiplicative Number Theory I, Cambridge Univ. Press 2007, §13.1 (Exercise on primes in short intervals under RH).