Principal declarations
theorem Misc.shootout_spec
Module Misc
(lean/phase6/Misc.lean, lines 456–466) · file SHA-256 07766c03566dbfca… Axioms reported by the fresh build: propext, Classical.choice, Quot.sound
SHOOTOUT CONTROLLER THEOREM: started at head 0 with fuel B + 1 it outputs the OR of the
B outcome bits, using at most B queries (one query if head 0 reports 1).
Statement as elaborated and printed by Lean 4.26.0
∀ {B : ℕ},
1 ≤ B →
∀ (o : ℕ → Bool),
((NimAudit.Misc.shootout B).run o (B + 1) 0).1 = some ((List.range B).any o) ∧
((NimAudit.Misc.shootout B).run o (B + 1) 0).2 ≤ B ∧
(o 0 = true → ((NimAudit.Misc.shootout B).run o (B + 1) 0).2 = 1)
Exact source text, lines 456–466
456/-- SHOOTOUT CONTROLLER THEOREM: started at head 0 with fuel B + 1 it outputs the OR of the457 B outcome bits, using at most B queries (one query if head 0 reports 1). -/458theorem shootout_spec {B : Nat} (hB : 1 ≤ B) (o : Nat → Bool) :459 ((shootout B).run o (B + 1) 0).1 = some ((List.range B).any o) ∧460 ((shootout B).run o (B + 1) 0).2 ≤ B ∧461 (o 0 = true → ((shootout B).run o (B + 1) 0).2 = 1) := by462 obtain ⟨k, rfl⟩ : ∃ k, B = k + 1 := ⟨B - 1, by omega⟩463 have h := shootout_from (B := k + 1) o k 0 (by omega)464 rw [show k + 1 + 1 = k + 2 by omega, h, List.range_eq_range']465 refine ⟨rfl, by simp; omega, fun h0 => ?_⟩466 simp [firstHit_hit (show 0 < k + 1 by omega) h0]
Project declarations in the statement: Misc.FSM.run, Misc.shootout
Project declarations used by the proof or definition body
Misc.FSM.run, Misc.firstHit, Misc.firstHit_hit, Misc.shootout, Misc.shootout_from
theorem Misc.shootout_decides
Module Misc
(lean/phase6/Misc.lean, lines 485–490) · file SHA-256 07766c03566dbfca… Axioms reported by the fresh build: propext, Classical.choice, Quot.sound
The shootout over the exact structured heads decides whether P is an N-position.
Statement as elaborated and printed by Lean 4.26.0
∀ {B : ℕ},
1 ≤ B →
∀ {P : List ℕ},
NimAudit.Game.Width B P →
((NimAudit.Misc.shootout B).run (fun j => NimAudit.Game.rolloutWinner j P) (B + 1) 0).1 =
some (decide (NimAudit.nimSum P ≠ 0)) ∧
((NimAudit.Misc.shootout B).run (fun j => NimAudit.Game.rolloutWinner j P) (B + 1) 0).2 ≤
B
Exact source text, lines 485–490
485/-- The shootout over the exact structured heads decides whether P is an N-position. -/486theorem shootout_decides {B : Nat} (hB : 1 ≤ B) {P : List Nat} (hw : Width B P) :487 ((shootout B).run (fun j => rolloutWinner j P) (B + 1) 0).1 = some (decide (nimSum P ≠ 0)) ∧488 ((shootout B).run (fun j => rolloutWinner j P) (B + 1) 0).2 ≤ B := by489 obtain ⟨h1, h2, _⟩ := shootout_spec hB (fun j => rolloutWinner j P)490 exact ⟨by rw [h1, channels_or hB hw], h2⟩
Project declarations in the statement: Game.Width, Game.rolloutWinner, Misc.FSM.run, Misc.shootout, nimSum
Project declarations used by the proof or definition body
Game.Width, Game.rolloutWinner, Misc.FSM.run, Misc.channels_or, Misc.shootout, Misc.shootout_spec, nimSum
Definitions these statements use
def Misc.FSM.run
Module Misc
(lean/phase6/Misc.lean, lines 371–376) · file SHA-256 07766c03566dbfca…
Run with fuel against outcome oracle o: decision and number of queries.
Statement as elaborated and printed by Lean 4.26.0
NimAudit.Misc.FSM → (ℕ → Bool) → ℕ → ℕ → Option Bool × ℕ
Exact source text, lines 371–376
371/-- Run with fuel against outcome oracle o: decision and number of queries. -/372def FSM.run (C : FSM) (o : Nat → Bool) : Nat → Nat → Option Bool × Nat373 | 0, _ => (none, 0)374 | f + 1, s => match C.out s with375 | some d => (some d, 0)376 | none => ((C.run o f (C.next s (o (C.head s)))).1, (C.run o f (C.next s (o (C.head s)))).2 + 1)
Project declarations in the statement: Misc.FSM
Project declarations used by the proof or definition body
Misc.FSM, Misc.FSM.head, Misc.FSM.next, Misc.FSM.out
def Misc.shootout
Module Misc
(lean/phase6/Misc.lean, lines 378–382) · file SHA-256 07766c03566dbfca…
The controller of the figure: states 0..B−1 query heads 0..B−1 in turn; state B
declares σ ≠ 0 (N-position), state B+1 declares σ = 0 (P-position).
Statement as elaborated and printed by Lean 4.26.0
ℕ → NimAudit.Misc.FSM
Exact source text, lines 378–382
378/-- The controller of the figure: states 0..B−1 query heads 0..B−1 in turn; state B379 declares σ ≠ 0 (N-position), state B+1 declares σ = 0 (P-position). -/380def shootout (B : Nat) : FSM :=381 ⟨0, id, fun s b => if b then B else if s + 1 < B then s + 1 else B + 1,382 fun s => if s = B then some true else if s = B + 1 then some false else none⟩
Project declarations in the statement: Misc.FSM
Project declarations used by the proof or definition body
Misc.FSM.mk
def Game.Width
Module NimGame
(lean/phase2/NimGame.lean, lines 31–32) · file SHA-256 23df6bb87ecfd344…
B-bit board: every heap is below 2^B.
Statement as elaborated and printed by Lean 4.26.0
ℕ → List ℕ → Prop
Exact source text, lines 31–32
31/-- B-bit board: every heap is below 2^B. -/32def Width (B : Nat) (p : List Nat) : Prop := ∀ x ∈ p, x < 2 ^ B
Project declarations in the statement: none
Project declarations used by the proof or definition body
none
def Game.rolloutWinner
Module NimGame
(lean/phase2/NimGame.lean, lines 142–152) · file SHA-256 23df6bb87ecfd344…
Rollout outcome RO_{pi_j}(P) as a game: both players follow pi_j; the result is
`true` iff the player to move at P (the first player) wins under normal play.
At a terminal start it is `false`.
Statement as elaborated and printed by Lean 4.26.0
ℕ → List ℕ → Bool
Exact source text, lines 142–152
142/-- Rollout outcome RO_{pi_j}(P) as a game: both players follow pi_j; the result is143 `true` iff the player to move at P (the first player) wins under normal play.144 At a terminal start it is `false`. -/145def rolloutWinner (j : Nat) (p : List Nat) : Bool :=146 match h : policyStep j p with147 | none => false148 | some q => !rolloutWinner j q149termination_by rolloutCount j p150decreasing_by151 have := policyMove_count (policyStep_some h)152 omega
Project declarations in the statement: none
Project declarations used by the proof or definition body
Rollout.policyMove_count, Rollout.policyStep, Rollout.policyStep_some, rolloutCount
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
Full modules
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).