AFTD Auto-Formalizing Theoretical Domains

nat_mex_set

deforiginal

The minimum excluded natural number of a set s of natural numbers is the infimum of the set of natural numbers not in s.

Statement

noncomputable def nat_mex_set (s : Set ℕ) : ℕ
Related work
folklore
Verified
24 Oct 2026
Axioms
none listed
Used by 5

Read back from the Lean

For a set of natural numbers s, nat_mex_set s is defined as the infimum (sInf) of the set of all natural numbers n that do not belong to s.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The minimum excluded natural number (mex) of a set of natural numbers. -/
noncomputable def nat_mex_set (s : Set ℕ) : ℕ := sInf {n : ℕ | n ∉ s}
See it in the graphDiscuss this resultChallenge it