AFTD Auto-Formalizing Theoretical Domains

spider_grundy_val_two_two_up_to_two

theoremverified

For every natural number z with 1 ≤ z and z ≤ 2, the Grundy value spider_grundy_val 2 2 z of the spider tree S(2, 2, z) in the Game of Arrows is equal to z % 2.

Statement

theorem spider_grundy_val_two_two_up_to_two (z : ℕ) (h1 : 1 ≤ z) (h2 : z ≤ 2) :
    spider_grundy_val 2 2 z = z % 2
Source
folklore
Verified
20 Oct 2026
Axioms
Quot.soundpropext
Built on 1
  • spider_grundy_valThe Grundy value spider_grundy_val of the 3-legged spider tree with leg parameters x, y, z : ℕ is defined as spider_gamma (x + y + z + 1)…

Read back from the Lean

For any natural number $z$, if $1 \le z$ and $z \le 2$ (so $z \in \{1, 2\}$), then $\mathrm{spider\_grundy\_val}(2, 2, z) = z \bmod 2$ (evaluating to $1$ when $z = 1$ and $0$ when $z = 2$).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

The theorem is established by finite case exhaustion followed by direct computational evaluation. Since z is a natural number constrained by 1 ≤ z ≤ 2, there are only two possibilities: z = 1 and z = 2. For each case, the Grundy value function `spider_grundy_val` is fully computable, so Lean evaluates the expressions directly to confirm that spider_grundy_val 2 2 1 = 1 % 2 and spider_grundy_val 2 2 2 = 2 % 2.

  1. For every natural number z satisfying 1 ≤ z ≤ 2, the Grundy value spider_grundy_val 2 2 z equals z % 2. automation

    The hypotheses 1 ≤ z and z ≤ 2 restrict z to the finite set {1, 2}. The tactic `interval_cases z` splits the proof into these two cases: z = 1 and z = 2. In each branch, both sides of the equation are concrete computable natural numbers: for z = 1, spider_grundy_val 2 2 1 evaluates to 1 and 1 % 2 = 1; for z = 2, spider_grundy_val 2 2 2 evaluates to 0 and 2 % 2 = 0. The tactic `decide` closes both goals by direct evaluation.

    line 4

      interval_cases z <;> decide

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- The Grundy value of the twin spider S(2, 2, z) in the Game of Arrows equals z % 2 for all 1 ≤ z ≤ 2. -/theorem spider_grundy_val_two_two_up_to_two (z : ℕ) (h1 : 1 ≤ z) (h2 : z ≤ 2) :    spider_grundy_val 2 2 z = z % 2 := by  interval_cases z <;> decide
See it in the graphDiscuss this resultChallenge it