NIM paper · interactive edition Interactive edition · paper, explanations and Lean proofs.

Section 4.1, paragraph 1A position with no legal moves is terminal

Checked definition or construction Lean contains the definition or construction, with checked properties.

1 Paper text

A position with no legal moves is terminal.

Generated from paper_jmlr.tex, lines 411–411.

2 Explain this

A terminal position is one with no legal moves. In NIM, these are exactly the boards whose heaps are all empty; the player to move there has lost (normal play).

3 How this is formalised

Game.Terminal defines a terminal board as one whose heaps are all zero, and Game.terminal_iff_no_move proves that this is equivalent to having no legal move.

Coverage record
Paper anchorsec-impartial-games-p1 (website anchor; the manuscript has no label here)
Displayed asSection 4.1, paragraph 1
ClaimA position with no legal moves is terminal
Coverage categoryChecked definition or construction
Statement sourcepaper_jmlr.tex lines 411–411; SHA-256 of the normalised block source f4e009f7b01f0a24…
Lean declarations
Explanationsexplain/c-terminal, formal/c-terminal
Build evidencefresh isolated rebuild, audit report

4 Lean statement and source

Principal declarations

theorem Game.terminal_iff_no_move

Module NimGame (lean/phase2/NimGame.lean, lines 48–57) · file SHA-256 23df6bb87ecfd344… Axioms reported by the fresh build: propext, Quot.sound

Statement as elaborated and printed by Lean 4.26.0

∀ (p : List ℕ), NimAudit.Game.Terminal p ↔ ∀ (q : List ℕ), ¬NimAudit.Game.Move p q
Exact source text, lines 48–57
48theorem terminal_iff_no_move (p : List Nat) : Terminal p ↔ ∀ q, ¬ Move p q := by49  constructor50  · intro ht q ⟨pre, x, post, y, hp, _, hlt⟩51    have : x = 0 := ht x (by rw [hp]; simp)52    omega53  · intro hno x hx54    obtain ⟨pre, post, rfl⟩ := List.append_of_mem hx55    by_cases h0 : x = 056    · exact h057    · exact absurd ⟨pre, x, post, 0, rfl, rfl, by omega⟩ (hno (pre ++ 0 :: post))

Project declarations in the statement: Game.Move, Game.Terminal

Project declarations used by the proof or definition body

Game.Move, Game.Terminal

Definitions these statements use

def Game.Terminal

Module NimGame (lean/phase2/NimGame.lean, lines 28–29) · file SHA-256 23df6bb87ecfd344…

Terminal board: every heap is empty.

Statement as elaborated and printed by Lean 4.26.0

List ℕ → Prop
Exact source text, lines 28–29
28/-- Terminal board: every heap is empty. -/29def Terminal (p : List Nat) : Prop := ∀ x ∈ p, x = 0

Project declarations in the statement: none

Project declarations used by the proof or definition body

none

def Game.Move

Module NimGame (lean/phase2/NimGame.lean, lines 24–26) · file SHA-256 23df6bb87ecfd344…

An ordinary legal Nim move: exactly one heap strictly decreases.

Statement as elaborated and printed by Lean 4.26.0

List ℕ → List ℕ → Prop
Exact source text, lines 24–26
24/-- An ordinary legal Nim move: exactly one heap strictly decreases. -/25def Move (p q : List Nat) : Prop :=26  ∃ pre x post y, p = pre ++ x :: post ∧ q = pre ++ y :: post ∧ y < x

Project declarations in the statement: none

Project declarations used by the proof or definition body

none

Full modules

ModuleFileLinesImports
NimGamelean/phase2/NimGame.lean634NimRollout

Build evidence: fresh isolated rebuild of all 38 bundled modules with Lean (version 4.26.0, started 2026-10-10T15:21:56Z, finished 2026-10-10T15:27:00Z: 38/38 modules compiled, 1588 axiom reports, no errors. See Build for the commands and the independent audit of 2026-10-10 (dated evidence).