The window sieve keeps exactly the primes
ProvedPrimeEndings.window_sieveelementary-number-theoryprime-numberssieve-of-eratosthenes
For all : , , and not crossed out is prime with .
Preamble
import Definitions.Def_PrimeEndings_Defs import Mathlib open PrimeEndings
Formal statement
namespace PrimeEndings
theorem window_sieve (a b n : ℕ) :
(a ≤ n ∧ n ≤ b ∧ 5 < n ∧ Nat.Coprime n 10 ∧ ¬ CrossedOut a b n) ↔
(n.Prime ∧ max a 6 ≤ n ∧ n ≤ b) := 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, `window_sieve`
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
For all natural numbers , the following two conditions are equivalent:
(Left) , , , and not ;
(Right) is prime and .
Unfolding : there exist with prime, , , , ,
Since there is no truncated subtraction and ; the constraints on amount to , , . So "not crossed out" means: cannot be written as with a prime other than satisfying , and coprime to , with .
On the right, is the same as and . The statement holds for all including degenerate windows: if both sides are false. There is no requirement that or that . The window is closed at both ends.
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.