Sieving up to the square root is enough
ProvedPrimeEndings.sqrt_ruleelementary-number-theoryprime-numberssieve-of-eratosthenes
If and no prime with divides , then is prime.
Preamble
import Definitions.Def_PrimeEndings_Defs import Mathlib open PrimeEndings
Formal statement
namespace PrimeEndings
theorem sqrt_rule (x n : ℕ) (hn : 1 < n) (hx : n ≤ x)
(h : ∀ p, p.Prime → p * p ≤ x → ¬ p ∣ n) : n.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, `sqrt_rule`
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
For all natural numbers and , assume
- ;
- ;
- for every prime with , .
Then is prime.
Note the square-root bound is taken with respect to , not : the hypothesis requires that no prime with divides , and since this covers at least all primes with (it is a stronger hypothesis than the one with ). The variable appears only as this upper bound. No bundle definitions are used.
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.