Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

QED-E054 statement definitions

Definition
QED_E054

by floration · Nov 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

gamesqed

Definitions for the QED problem QED-E054, ending with the proposition Claim.

Let g(0)=g(1)=g(2)=0g(0)=g(1)=g(2)=0g(0)=g(1)=g(2)=0 and for n≥3n\ge3n≥3 let g(n)=mex⁡{g(a)⊕g(b):a+b=n, 1≤a<b}g(n)=\operatorname{mex}\{g(a)\oplus g(b): a+b=n,\ 1\le a<b\}g(n)=mex{g(a)⊕g(b):a+b=n, 1≤a<b}, where ⊕\oplus⊕ is bitwise XOR. Is ggg eventually periodic, i.e. are there N,p≥1N,p\ge1N,p≥1 with g(n+p)=g(n)g(n+p)=g(n)g(n+p)=g(n) for all n≥Nn\ge Nn≥N? (Weaker open question: is ggg bounded?)

Definition code
import Mathlib
/-! QED-E054: Is Grundy's game eventually periodic?
In Grundy's game a move splits a heap into two nonempty heaps of different sizes. Is the sequence of Grundy values of single heaps eventually periodic?
Informal statement: Let g(n) = mex{ g(a) ⊕ g(b) : a + b = n, 1 ≤ a < b } (so g(0) = g(1) = g(2) = 0). Are there N and p ≥ 1 with g(n + p) = g(n) for all n ≥ N?
Formalization notes: Instead of defining g by well-founded recursion, `IsGrundy g` states the mex recursion: no option value equals g n, and every smaller value is an option value. A function satisfying it exists and is unique (strong induction on n), so quantifying over all such g is neither vacuous nor ambiguous. ⊕ is `^^^` (bitwise xor on ℕ). For n ≤ 2 there are no options, which forces g n = 0. `Claim` = eventual periodicity (the Berlekamp–Conway–Guy conjecture). `¬Claim` = not eventually periodic.
-/
namespace OpenProblems.QEDE054

/-- `g` satisfies the Grundy-value recursion of Grundy's game. -/
def IsGrundy (g : ℕ → ℕ) : Prop :=
  ∀ n : ℕ,
    (∀ a b : ℕ, 1 ≤ a → a < b → a + b = n → g n ≠ (g a ^^^ g b)) ∧
    (∀ m : ℕ, m < g n → ∃ a b : ℕ, 1 ≤ a ∧ a < b ∧ a + b = n ∧ (g a ^^^ g b) = m)

def Claim : Prop :=
  ∀ g : ℕ → ℕ, IsGrundy g →
    ∃ N p : ℕ, 0 < p ∧ ∀ n : ℕ, N ≤ n → g (n + p) = g n

end OpenProblems.QEDE054
Source
QED open problem QED-E054, https://floration.github.io/QED/#QED-E054
Human review
  • Endorsed by Shuze Chen · Nov 28, 2026

    Confirmed by the moderator at approval.

  • Endorsed by floration · Nov 28, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me