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
- nat_mex_set_eq_zero_of_not_memIf 0 is not in a set s of natural numbers, the mex of s is 0.
- nat_mex_set_eq_one_of_memIf 0 is in a set s of natural numbers and 1 is not, the mex of s is 1.
- arrows_pos_grundy_eq_mod_two_of_classStrategy lemma for parity in the Game of Arrows: let e be a function on positions that drops by exactly one along every legal move, and S…
- nat_mex_set_ne_of_memThe mex of a finite set s of natural numbers is not an element of s.
- arrows_pos_grundyThe Grundy value of a position p : ArrowsPos V in the Game of Arrows on G at recursion depth fuel, defined as 0 when fuel = 0 and as the…
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}