Smallest factor of a composite is at most its square root
ProvedPrimeEndings.smallest_factor_le_sqrtelementary-number-theoryprime-numberssieve-of-eratosthenes
If is not prime then .
Preamble
import Definitions.Def_PrimeEndings_Defs import Mathlib open PrimeEndings
Formal statement
namespace PrimeEndings
theorem smallest_factor_le_sqrt (n : ℕ) (hn : 0 < n) (hc : ¬ n.Prime) :
n.minFac ^ 2 ≤ n := 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, `smallest_factor_le_sqrt`
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
For every natural number with that is not prime, the smallest prime factor satisfies
Here is Mathlib's "minimal factor" function: the least divisor of that is at least , with the convention (checked by evaluation). Edge case: satisfies both hypotheses (, not prime), and the claim then reads , true via the junk convention , which is not a prime. The case is excluded by . No bundle definitions are used.
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.