theorem Misc.restoration_figure
Module Misc
(lean/phase6/Misc.lean, lines 826–832) · file SHA-256 07766c03566dbfca… Axioms reported by the fresh build: propext
FIGURE fig:restoration-example: from (3,5,6) (nim-sum 0) the opponent plays 5 → 4
(nim-sum 1, δ = 1); the restoration rule answers 3 → 2, restoring nim-sum 0.
Statement as elaborated and printed by Lean 4.26.0
NimAudit.nimSum [3, 5, 6] = 0 ∧
NimAudit.Game.Move [3, 5, 6] [3, 4, 6] ∧
NimAudit.nimSum [3, 4, 6] = 1 ∧
5 ^^^ 4 = 1 ∧
NimAudit.Game.restore [3, 5, 6] [3, 4, 6] = some [2, 4, 6] ∧
NimAudit.Game.Move [3, 4, 6] [2, 4, 6] ∧ NimAudit.nimSum [2, 4, 6] = 0
Exact source text, lines 826–832
826/-- FIGURE fig:restoration-example: from (3,5,6) (nim-sum 0) the opponent plays 5 → 4827 (nim-sum 1, δ = 1); the restoration rule answers 3 → 2, restoring nim-sum 0. -/828theorem restoration_figure :829 nimSum [3, 5, 6] = 0 ∧ Move [3, 5, 6] [3, 4, 6] ∧ nimSum [3, 4, 6] = 1 ∧ (5 ^^^ 4 : Nat) = 1 ∧830 restore [3, 5, 6] [3, 4, 6] = some [2, 4, 6] ∧ Move [3, 4, 6] [2, 4, 6] ∧ nimSum [2, 4, 6] = 0 := by831 refine ⟨by decide, ⟨[3], 5, [6], 4, rfl, rfl, by decide⟩, by decide, by decide, by decide,832 ⟨[], 3, [4, 6], 2, rfl, rfl, by decide⟩, by decide⟩
Project declarations in the statement: Game.Move, Game.restore, nimSum
Project declarations used by the proof or definition body
Game.Move, Game.restore, nimSum
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
def Game.restore
Module NimGame
(lean/phase2/NimGame.lean, lines 407–410) · file SHA-256 23df6bb87ecfd344…
Two-frame restoration selector (paper Prop. restore / Thm search-gap (iii)):
from the predecessor Q and current board Q', cancel delta = nim(Q) XOR nim(Q').
Statement as elaborated and printed by Lean 4.26.0
List ℕ → List ℕ → Option (List ℕ)
Exact source text, lines 407–410
407/-- Two-frame restoration selector (paper Prop. restore / Thm search-gap (iii)):408 from the predecessor Q and current board Q', cancel delta = nim(Q) XOR nim(Q'). -/409def restore (Q Q' : List Nat) : Option (List Nat) :=410 cancelFirst (nimSum Q ^^^ nimSum Q') Q'
Project declarations in the statement: none
Project declarations used by the proof or definition body
Game.cancelFirst, nimSum
def nimSum
Module NimCore
(lean/NimCore.lean, lines 7–9) · file SHA-256 b07db6c505210d5a…
Statement as elaborated and printed by Lean 4.26.0
List ℕ → ℕ
Exact source text, lines 7–9
7def nimSum : List Nat → Nat8 | [] => 09 | h :: t => h ^^^ nimSum t
Project declarations in the statement: none
Project declarations used by the proof or definition body
none
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).