/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/modulepublicimportFormalConjecturesUtil
Cramér's Conjecture on Prime Gaps
Write $p_n$ for the $n$-th prime (Nat.nth Nat.Prime, with $p_0 = 2$) and $g_n = p_{n+1} - p_n$
(primeGap n). Using an independent random prime heuristic, Harald Cramér [Cr36] conjectured in
1936 that $g_n = O((\log p_n)^2)$; his random model further predicts
$$\limsup_{n \to \infty} \frac{p_{n+1} - p_n}{(\log p_n)^2} = 1,$$
while numerical searches also test the strict inequality $g_n < (\log p_n)^2$ for $n \ge 4$
($p_n \ge 11$). Accounting for Helmut Maier's short-interval oscillations [Ma85] and small-prime
sieve factors, Andrew Granville [Gr95] conjectured instead that the limit superior is at least
$2 e^{-\gamma} \approx 1.1229$ (contradicting $\limsup = 1$). Unconditionally, Baker, Harman, and
Pintz [BHP01] proved $g_n = O(p_n^{0.525})$. See also Erdos5, Erdos233, Andrica, Oppermann,
and Firoozbakht (Firoozbakht.firoozbakht_conjecture_consequence).
Cramér's normalized prime-gap ratio $\dfrac{p_{n+1} - p_n}{(\log p_n)^2}$. Since $p_n \ge 2$
for all $n \in \mathbb{N}$, the denominator $(\log p_n)^2$ is always strictly positive.
Cramér's Heuristic Limit-Superior Prediction: $\limsup_{n \to \infty} g_n / (\log p_n)^2 =
1$. Rather than an explicit conjecture in [Cr36], this stronger statement comes from Cramér's
probabilistic prime model and contradicts cramer_conjecture.variants.granville
($2 e^{-\gamma} > 1$).
Westzynthius's Theorem [We31] (cf. Erdos5.erdos_5.variants.westzynthius): for every real
$M$, infinitely many indices $n$ satisfy $p_{n+1} - p_n \ge M \log p_n$.