The next number standing is the next prime
ProvedPrimeEndings.next_pickup_primeelementary-number-theoryprime-numberssieve-of-eratosthenes
If , is still standing after the primes up to , and nothing between and is, then is prime and the only prime strictly between and is possibly .
Preamble
import Definitions.Def_PrimeEndings_Defs import Mathlib open PrimeEndings
Formal statement
namespace PrimeEndings
theorem next_pickup_prime (P n : ℕ) (hP : 3 ≤ P) (hPn : P < n) (ha : Alive P n)
(hmin : ∀ m, P < m → m < n → ¬ Alive P m) :
n.Prime ∧ ∀ q, q.Prime → P < q → q < n → q = 5 := by sorry
end PrimeEndingsSource
mfala22ss, A window form of the sieve of Eratosthenes on the residues prime to ten, with a machine-checked proof (2026), https://github.com/mfala22ss/prime-endings, Lean file lean/Solution.lean, `next_pickup_prime`
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
For all natural numbers and , assume
- ;
- ;
- ;
- for every natural number with , fails.
Then both of the following hold:
- is prime;
- every prime with equals .
Unfolding : , , and for every prime with , , and every with . So the hypotheses say is the least number exceeding that is alive at level .
Conclusion 2 says that the open interval contains no primes other than possibly (it can contain , e.g. when ). Note is not assumed to be prime; any is allowed. The minimality hypothesis is strict on both sides ().
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.