Stop rule of the pick-up loop
ProvedPrimeEndings.stop_ruleelementary-number-theoryprime-numberssieve-of-eratosthenes
If , nothing between and is still standing, and is still standing, then is prime.
Preamble
import Definitions.Def_PrimeEndings_Defs import Mathlib open PrimeEndings
Formal statement
namespace PrimeEndings
theorem stop_rule (P p x m : ℕ) (hP : 3 ≤ P) (hPp : P < p)
(hmin : ∀ m, P < m → m < p → ¬ Alive P m) (hx : x < p * p) (hm : m ≤ x)
(ha : Alive P m) : m.Prime := 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, `stop_rule`
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
For all natural numbers , assume
- ;
- ;
- for every natural number with , fails (in the code this bound variable is also named , shadowing the outer ; it is a separate, universally quantified variable);
- ;
- ;
- .
Then is prime.
Unfolding : , , and for every prime with , and every with .
Points to note: is not assumed to be prime, nor is assumed; the hypothesis on is only that and that no number strictly between and is alive at level . is not assumed prime. is not required to exceed (it may lie at or below ) beyond from Alive. The variable serves only as an intermediate bound: the hypotheses amount to (strict).
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.