Documentation

Mathlib.SetTheory.Game.Impartial

Basic definitions about impartial (pre-)games #

We will define an impartial game, one in which left and right can make exactly the same moves. Our definition differs slightly by saying that the game is always equivalent to its negative, no matter what moves are played. This allows for games such as poker-nim to be classified as impartial.

@[irreducible]

The definition for an impartial game, defined using Conway induction.

Equations
  • G.ImpartialAux = (G -G (∀ (i : G.LeftMoves), (G.moveLeft i).ImpartialAux) ∀ (j : G.RightMoves), (G.moveRight j).ImpartialAux)
Instances For
    theorem SetTheory.PGame.impartialAux_def {G : SetTheory.PGame} :
    G.ImpartialAux G -G (∀ (i : G.LeftMoves), (G.moveLeft i).ImpartialAux) ∀ (j : G.RightMoves), (G.moveRight j).ImpartialAux

    A typeclass on impartial games.

    • out : G.ImpartialAux
    Instances
      theorem SetTheory.PGame.Impartial.out {G : SetTheory.PGame} [self : G.Impartial] :
      G.ImpartialAux
      theorem SetTheory.PGame.impartial_iff_aux {G : SetTheory.PGame} :
      G.Impartial G.ImpartialAux
      theorem SetTheory.PGame.impartial_def {G : SetTheory.PGame} :
      G.Impartial G -G (∀ (i : G.LeftMoves), (G.moveLeft i).Impartial) ∀ (j : G.RightMoves), (G.moveRight j).Impartial
      @[simp]
      theorem SetTheory.PGame.Impartial.mk'_neg_equiv_self (G : SetTheory.PGame) [G.Impartial] :
      -G = G
      instance SetTheory.PGame.Impartial.moveLeft_impartial {G : SetTheory.PGame} [h : G.Impartial] (i : G.LeftMoves) :
      (G.moveLeft i).Impartial
      Equations
      • =
      instance SetTheory.PGame.Impartial.moveRight_impartial {G : SetTheory.PGame} [h : G.Impartial] (j : G.RightMoves) :
      (G.moveRight j).Impartial
      Equations
      • =
      @[irreducible]
      theorem SetTheory.PGame.Impartial.impartial_congr {G : SetTheory.PGame} {H : SetTheory.PGame} (e : G.Relabelling H) [G.Impartial] :
      H.Impartial
      @[irreducible]
      instance SetTheory.PGame.Impartial.impartial_add (G : SetTheory.PGame) (H : SetTheory.PGame) [G.Impartial] [H.Impartial] :
      (G + H).Impartial
      Equations
      • =
      @[irreducible]
      instance SetTheory.PGame.Impartial.impartial_neg (G : SetTheory.PGame) [G.Impartial] :
      (-G).Impartial
      Equations
      • =
      theorem SetTheory.PGame.Impartial.equiv_or_fuzzy_zero (G : SetTheory.PGame) [G.Impartial] :
      G 0 G.Fuzzy 0

      In an impartial game, either the first player always wins, or the second player always wins.

      @[simp]
      theorem SetTheory.PGame.Impartial.not_equiv_zero_iff (G : SetTheory.PGame) [G.Impartial] :
      ¬G 0 G.Fuzzy 0
      @[simp]
      theorem SetTheory.PGame.Impartial.not_fuzzy_zero_iff (G : SetTheory.PGame) [G.Impartial] :
      ¬G.Fuzzy 0 G 0
      @[simp]
      theorem SetTheory.PGame.Impartial.mk'_add_self (G : SetTheory.PGame) [G.Impartial] :
      G + G = 0

      This lemma doesn't require H to be impartial.

      This lemma doesn't require H to be impartial.

      theorem SetTheory.PGame.Impartial.fuzzy_zero_iff_lf (G : SetTheory.PGame) [G.Impartial] :
      G.Fuzzy 0 G.LF 0
      theorem SetTheory.PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero (G : SetTheory.PGame) [G.Impartial] :
      (∀ (i : G.LeftMoves), (G.moveLeft i).Fuzzy 0) G 0
      theorem SetTheory.PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero (G : SetTheory.PGame) [G.Impartial] :
      (∀ (j : G.RightMoves), (G.moveRight j).Fuzzy 0) G 0
      theorem SetTheory.PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero (G : SetTheory.PGame) [G.Impartial] :
      (∃ (i : G.LeftMoves), G.moveLeft i 0) G.Fuzzy 0
      theorem SetTheory.PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero (G : SetTheory.PGame) [G.Impartial] :
      (∃ (j : G.RightMoves), G.moveRight j 0) G.Fuzzy 0