AFTD Auto-Formalizing Theoretical Domains

run_grundy

def

The Grundy value of a run of length k with boundary conditions α and β in the Game of Arrows, defined using depth bound k + 1.

Statement

def run_grundy (k : ℕ) (α β : RunBoundary) : ℕ
Defined in
scout/2610-15145-nim-heaps-in-the-game-of-cycles-the-parity-conjecture-fails.md:428
Verified
21 Oct 2026
Axioms
none listed
Built on 2
  • run_grundy_auxThe auxiliary Grundy value function for a run of length k with boundary conditions α and β in the Game of Arrows, computed by recursion up…
  • RunBoundaryThe boundary condition at an end of a path segment in the Game of Arrows is either free (denoted *), blocked inward (denoted →), or…
Used by 3
  • run_grundy_stepFor every k > 0 and boundary conditions α and β, the Grundy value run_grundy k α β is the minimum excluded value of the nim-sums of the…
  • run_grundy_aux_eq_run_grundyFor any natural numbers n and k with k + 1 ≤ n, and any boundary conditions α and β, run_grundy_aux n k α β equals run_grundy k α β.
  • run_grundy_zeroFor any boundary conditions α and β, a run of length 0 in the Game of Arrows has Grundy value 0.

Read back from the Lean

The definition run_grundy is a function that takes a natural number k : ℕ and two boundary conditions α, β : RunBoundary and returns a natural number ℕ. It is defined as run_grundy_aux (k + 1) k α β.

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 Grundy value of a run of length k with boundary conditions α and β in the Game of Arrows, at canonical depth k + 1. -/
def run_grundy (k : ℕ) (α β : RunBoundary) : ℕ :=
  run_grundy_aux (k + 1) k α β
See it in the graphDiscuss this resultChallenge it