FormalConjectures/Paper/CatchUpConjecture.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1

8 declarations, 1 contain sorry, 0 declared as axioms

The Catch-Up game and conjecture

The game Catch-Up (Isaksen–Ismail–Brams–Nealen, 2015) is a two-player, perfect-information game played on a finite nonempty set S of positive integers. Each time a player removes a number from S, that number is added to the player’s score.

Rules.

When S is empty, the player with higher score wins; equal scores give a draw.

In this file we define:

Example

For S = {1,2,3,4} one play is: p1 takes 2, p2 takes 1 then 4, and p1 takes 3, ending with scores (5,5).

References

A. Isaksen, M. Ismail, S. J. Brams, A. Nealen, Catch-Up: A Game in Which the Lead Alternates, Game & Puzzle Design 1(2), 38–49 (2015).

Imports (1)
  1. inductive CatchUp.Player An arbitrary two elements type indexing the players in the Catch-Up game line 59 source

    Source documentation

    An arbitrary two elements type indexing the players in the Catch-Up game.

    no axioms what this means

    inductive Player
      | p1
      | p2
    deriving DecidableEq, Repr
    
    /-- Returns the other player. -/
  2. def CatchUp.Player.other Returns the other player line 65 source

    Source documentation

    Returns the other player.

    no axioms what this means

    Statement uses: CatchUp.Player

    Proof uses: CatchUp.Player.other.match_1, Unit, CatchUp.Player.p2, CatchUp.Player.p1

    def Player.other : Player → Player
      | p1 => p2
      | p2 => p1
    
    /-- The possible outcomes of a Catch-Up game. -/

    Mentions: CatchUp.Player

  3. inductive CatchUp.Outcome The possible outcomes of a Catch-Up game line 70 source

    Source documentation

    The possible outcomes of a Catch-Up game.

    no axioms what this means

    inductive Outcome
      | win
      | loss
      | draw
    deriving DecidableEq, Repr
    
    /-- Negates an outcome, swapping win and loss. Used when switching player perspectives. -/
  4. def CatchUp.Outcome.neg Negates an outcome, swapping win and loss line 77 source

    Source documentation

    Negates an outcome, swapping win and loss. Used when switching player perspectives.

    no axioms what this means

    Statement uses: CatchUp.Outcome

    Proof uses: CatchUp.Outcome.neg.match_1, Unit, CatchUp.Outcome.loss, CatchUp.Outcome.win, CatchUp.Outcome.draw

    def Outcome.neg : Outcome → Outcome
      | win => loss
      | loss => win
      | draw => draw
    
    /--
    Computes the best outcome for the current player from a list of possible outcomes.
    Win > Draw > Loss.
    -/

    Mentions: CatchUp.Outcome, CatchUp.Outcome.best

  5. def CatchUp.Outcome.best Computes the best outcome for the current player from a list of possible outcomes line 86 source

    Source documentation

    Computes the best outcome for the current player from a list of possible outcomes. Win > Draw > Loss.

    standard axioms: propext what this means

    Statement uses: List, CatchUp.Outcome

    Proof uses: List.foldl, CatchUp.Outcome.best.match_1, CatchUp.Outcome.win, CatchUp.Outcome.draw, CatchUp.Outcome.loss

    def Outcome.best (os : List Outcome) : Outcome :=
    …

    Mentions: CatchUp.Outcome

  6. def CatchUp.valueAux value remaining s_me s_opp isFirstMove evaluates the position where: * remaining is the set S' of numbers not yet taken line 116 source

    Source documentation

    value remaining s_me s_opp isFirstMove evaluates the position where:

    • remaining is the set S' of numbers not yet taken.
    • s_me is the current score of the player who is about to act (the “current player”).
    • s_opp is the opponent’s current score.
    • isFirstMove indicates whether we are in the special very first move of the whole game, where the rules force exactly one pick and then the turn passes.

    The result is the game-theoretic value from the current player’s point of view: .win / .loss / .draw, assuming optimal play from both sides.

    We model a single turn (which may consist of several picks $x_1,...,x_k$) by recursion: the current player chooses one number x; if they are still strictly behind after taking it, they must continue the same turn (so the recursive call keeps the same “current player”); once they catch up (score ≥ opponent), the turn ends and we swap players.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Finset, Nat, Bool, CatchUp.Outcome

    Proof uses: PSigma.mk, PSigma

    1 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

    Open to load the checked before-and-after goal states.

    noncomputable def valueAux (remaining : Finset ℕ) (s_me s_opp : ℕ) (isFirstMove : Bool) : Outcome :=
    …

    Mentions: CatchUp.Outcome

  7. def CatchUp.value Public API: The game-theoretic value of Catch-Up on the set S, assuming optimal play line 173 source

    Source documentation

    Public API: The game-theoretic value of Catch-Up on the set S, assuming optimal play. Returns .win if player 1 wins, .loss if player 2 wins, .draw if the game is tied.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Finset, Nat, CatchUp.Outcome

    Proof uses: CatchUp.valueAux, OfNat.ofNat, Bool.true

    1 instances, coercions and auxiliary constants left out.

    noncomputable def value (S : Finset ℕ) : Outcome :=
    …

    Mentions: CatchUp.Outcome

  8. theorem CatchUp.value_of_even_mul_succ_self_div_two Let $T_N = \sum_{k=1}^{N} k = \frac{N(N+1)}{2}$ sorry line 182 source

    Source documentation

    Let $T_N = \sum_{k=1}^{N} k = \frac{N(N+1)}{2}$. If $T_N$ is even (equivalently $N \equiv 0 \pmod 4$ or $N \equiv 3 \pmod 4$), then under optimal play the game Catch-Up($\{1, \ldots, N\}$) ends in a draw.

    depends on sorry what this means

    Statement uses: Nat, Even, HDiv.hDiv, HMul.hMul, HAdd.hAdd, OfNat.ofNat, Eq, CatchUp.Outcome, CatchUp.value, Finset.Icc, CatchUp.Outcome.draw

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    18 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem value_of_even_mul_succ_self_div_two
        (N : ℕ) (h_even : Even (N * (N + 1) / 2)) :
        value (.Icc 1 N) = .draw := by
    …

    Mentions: CatchUp.value