A Lean 4 proof of Wilf's conjecture for embedding dimension four
Luke Friedrichs, 1 December 2026
Let S be a numerical semigroup with conductor c and four minimal generators. Then
c ≤ 4 · #{x ∈ S : x < c}. The proof is formalized in Lean 4 with Mathlib.
It uses no axioms beyond propext, Classical.choice and Quot.sound.
Formal statement
theorem Wilf.wilf_four_plain (A : Finset ℕ) (hA : A.card ≤ 4)
(hfin : ((AddSubmonoid.closure (A : Set ℕ) : Set ℕ)ᶜ).Finite) (c : ℕ)
(hc : IsLeast {c : ℕ | ∀ n, c ≤ n → n ∈ AddSubmonoid.closure (A : Set ℕ)} c) :
c ≤ 4 * ((Finset.range c).filter fun x => x ∈ AddSubmonoid.closure (A : Set ℕ)).card
Check it
In the repository, run lake exe cache get and lake build. Then run ./scripts/check.sh.
Every module passes the Lean kernel replay with leanchecker.