AFTD Auto-Formalizing Theoretical Domains

quaternary_0331012_misere_outcome_comp

def

For fuel, x, y : ℕ, the fuel-bounded misère outcome quaternary_0331012_misere_outcome_comp fuel x y of a two-heap position (x, y) in the quaternary game 0.331012 returns MisereOutcome.N when fuel = 0; and for fuel = fuel' + 1, it returns MisereOutcome.N if x = 0 and y = 0, else returns MisereOutcome.N if there exists p ∈ quaternary_0331012_options x y such that quaternary_0331012_misere_outcome_comp fuel p.1 p.2 = MisereOutcome.P, and MisereOutcome.P otherwise.

Statement

def quaternary_0331012_misere_outcome_comp : ℕ → ℕ → ℕ → MisereOutcome
Defined in
arXiv:2611.29198, Section 2.1 & Theorem 5.4
Verified
28 Nov 2026
Axioms
none listed
Built on 2
  • MisereOutcomeThe misère outcome of an impartial game position: P for a previous-player-winning position and N for a next-player-winning position.
  • quaternary_0331012_optionsIn the quaternary game 0.331012, the set of follower positions reachable by a legal move on either heap from a two-heap position (x, y).
Used by 1
  • quaternary_0331012_misere_outcomeThe misère outcome of a two-heap position (x, y) in the quaternary game 0.331012, defined as quaternary_0331012_misere_outcome_comp (x +…

Read back from the Lean

A definition of quaternary_0331012_misere_outcome_comp, a function taking a fuel parameter fuel : ℕ and two heap sizes x, y : ℕ, and returning a MisereOutcome (P or N). It is defined by recursion on fuel: 1. If fuel = 0, it returns MisereOutcome.N. 2. If fuel = fuel' + 1: - If x = 0 ∧ y = 0, it returns MisereOutcome.N. - Otherwise, if there exists an option p ∈ quaternary_0331012_options x y such that quaternary_0331012_misere_outcome_comp fuel' p.1 p.2 = MisereOutcome.P, it returns MisereOutcome.N. - Otherwise, it returns MisereOutcome.P.

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

/-- Fuel-bounded recursive misère outcome computation for two heaps in 0.331012. -/
def quaternary_0331012_misere_outcome_comp : ℕ → ℕ → ℕ → MisereOutcome
| 0, _, _ => MisereOutcome.N
| fuel + 1, x, y =>
  if x = 0 ∧ y = 0 then MisereOutcome.N
  else if ∃ p ∈ quaternary_0331012_options x y,
    quaternary_0331012_misere_outcome_comp fuel p.1 p.2 = MisereOutcome.P then
    MisereOutcome.N
  else
    MisereOutcome.P
See it in the graphDiscuss this resultChallenge it