AFTD Auto-Formalizing Theoretical Domains

quaternary_03102_misere_outcome_comp

def

For fuel, x, y : ℕ, the fuel-bounded misère outcome quaternary_03102_misere_outcome_comp fuel x y of a two-heap position (x, y) in the quaternary game 0.3102 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_03102_options x y such that quaternary_03102_misere_outcome_comp fuel' p.1 p.2 = MisereOutcome.P, and MisereOutcome.P otherwise.

Statement

def quaternary_03102_misere_outcome_comp : ℕ → ℕ → ℕ → MisereOutcome
Defined in
arXiv:2611.29198 Section 2.1
Verified
25 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_03102_optionsIn the quaternary game 0.3102, the set of follower positions reachable by a legal move on either heap from a two-heap position (x, y).
Used by 2
  • quaternary_03102_two_heap_outcomeIn the quaternary game 0.3102, for all heap sizes x, y ≥ 3, the two-heap misère outcome is P if and only if the absolute difference |y -…
  • quaternary_03102_misere_outcomeThe misère outcome of a two-heap position (x, y) in the quaternary game 0.3102, defined as quaternary_03102_misere_outcome_comp (x + y) x y.

Read back from the Lean

The declaration defines a function quaternary_03102_misere_outcome_comp taking three natural numbers fuel, x, and y, and returning a MisereOutcome (P or N). It is defined by structural recursion on fuel: 1. When fuel = 0, for any x and y, it returns MisereOutcome.N. 2. When fuel = fuel' + 1: - If x = 0 and y = 0, it returns MisereOutcome.N. - Else, if there exists a pair p ∈ quaternary_03102_options x y such that quaternary_03102_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 misère outcome computation for two heaps in 0.3102. -/
def quaternary_03102_misere_outcome_comp : ℕ → ℕ → ℕ → MisereOutcome
| 0, _, _ => MisereOutcome.N
| fuel + 1, x, y =>
  if x = 0 ∧ y = 0 then MisereOutcome.N
  else if ∃ p ∈ quaternary_03102_options x y,
    quaternary_03102_misere_outcome_comp fuel p.1 p.2 = MisereOutcome.P then
    MisereOutcome.N
  else
    MisereOutcome.P
See it in the graphDiscuss this resultChallenge it