3 and 7 suffice up to 120
ProvedPrimeEndings.three_seven_enoughelementary-number-theoryprime-numberssieve-of-eratosthenes
If , ends in , , and ( or ), then is prime.
Preamble
import Definitions.Def_PrimeEndings_Defs import Mathlib open PrimeEndings
Formal statement
namespace PrimeEndings
theorem three_seven_enough (n : ℕ) (h5 : 5 < n) (hn : n ≤ 120)
(hend : n % 10 = 1 ∨ n % 10 = 3 ∨ n % 10 = 7 ∨ n % 10 = 9)
(h3 : ¬ 3 ∣ n) (h7 : ¬ 7 ∣ n ∨ n = 7) : 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, `three_seven_enough`
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
For every natural number , assume
- ;
- ;
- ;
- or .
Then is prime.
So among ending in (hence coprime to ), those not divisible by and not divisible by , together with itself, are all prime. The disjunct is needed because ; the analogous exception for is not needed since is excluded by . The upper bound is inclusive. No bundle definitions are used.
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.