Documentation

CombinatorialGames.Game.Concrete

Combinatorial games from a type of states #

In the literature, mathematicians often describe games as graphs, consisting of a set of states, as well as move relations for the left and right players. We define a structure ConcreteGame which facilitates this construction, bundling the left and right set functions along with the type, as well as functions ConcreteGame.toLGame and ConcreteGame.toIGame which turn them into the appropriate type of game.

Mathematically, ConcreteGame.toLGame is nothing but the corecursor on loopy games, while ConcreteGame.toIGame is defined inductively.

Design notes #

When working with any "specific" game (nim, domineering, etc.) you can use ConcreteGame to set up the basic theorems and definitions, but the intent is that you're not working with ConcreteGame directly most of the time.

structure ConcreteGame (α : Type v) :

A "concrete" game is a type of states endowed with move sets for the left and right players.

You can use ConcreteGame.toLGame and ConcreteGame.toIGame to turn this structure into the appropriate game type.

  • leftMoves : αSet α

    The set of options for the left player.

  • rightMoves : αSet α

    The set of options for the right player.

Instances For
    def ConcreteGame.IsOption {α : Type v} (c : ConcreteGame α) (a b : α) :

    IsOption a b means that a is either a left or a right move for b.

    Equations
    Instances For
      theorem ConcreteGame.IsOption.of_mem_leftMoves {α : Type v} {c : ConcreteGame α} {a b : α} :
      a c.leftMoves bc.IsOption a b
      theorem ConcreteGame.IsOption.of_mem_rightMoves {α : Type v} {c : ConcreteGame α} {a b : α} :
      a c.rightMoves bc.IsOption a b
      instance ConcreteGame.instSmallSubtypeIsOption {α : Type v} {c : ConcreteGame α} [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] (a : α) :

      Loopy games #

      def ConcreteGame.toLGame {α : Type v} (c : ConcreteGame α) [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] (a : α) :

      Turns a state of a ConcreteLGame into an LGame.

      Equations
      Instances For
        @[simp]
        theorem ConcreteGame.leftMoves_toLGame {α : Type v} (c : ConcreteGame α) [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] (a : α) :
        @[simp]
        theorem ConcreteGame.rightMoves_toLGame {α : Type v} (c : ConcreteGame α) [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] (a : α) :
        theorem ConcreteGame.mem_leftMoves_toLGame_of_mem {α : Type v} {c : ConcreteGame α} [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] {a b : α} (hab : b c.leftMoves a) :
        theorem ConcreteGame.mem_rightMoves_toLGame_of_mem {α : Type v} {c : ConcreteGame α} [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] {a b : α} (hab : b c.rightMoves a) :
        theorem ConcreteGame.neg_toLGame {α : Type v} {c : ConcreteGame α} [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] (h : c.leftMoves = c.rightMoves) (a : α) :

        Well-founded games #

        def ConcreteGame.moveRecOn {α : Type v} (c : ConcreteGame α) [H : IsWellFounded α c.IsOption] {motive : αSort u_1} (x : α) (mk : (x : α) → ((y : α) → y c.leftMoves xmotive y)((y : α) → y c.rightMoves xmotive y)motive x) :
        motive x

        Conway recursion: build data for a game by recursively building it on its left and right sets.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[irreducible]
          def ConcreteGame.toIGame {α : Type v} (c : ConcreteGame α) [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] [H : IsWellFounded α c.IsOption] (a : α) :

          Turns a state of a ConcreteIGame into an IGame.

          Equations
          Instances For
            @[simp]
            theorem ConcreteGame.leftMoves_toIGame {α : Type v} (c : ConcreteGame α) [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] [H : IsWellFounded α c.IsOption] (a : α) :
            @[simp]
            theorem ConcreteGame.rightMoves_toIGame {α : Type v} (c : ConcreteGame α) [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] [H : IsWellFounded α c.IsOption] (a : α) :
            theorem ConcreteGame.mem_leftMoves_toIGame_of_mem {α : Type v} {c : ConcreteGame α} [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] [H : IsWellFounded α c.IsOption] {a b : α} (hab : b c.leftMoves a) :
            theorem ConcreteGame.mem_rightMoves_toIGame_of_mem {α : Type v} {c : ConcreteGame α} [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] [H : IsWellFounded α c.IsOption] {a b : α} (hab : b c.rightMoves a) :
            @[simp]
            theorem ConcreteGame.toLGame_toIGame {α : Type v} (c : ConcreteGame α) [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] [H : IsWellFounded α c.IsOption] (a : α) :
            theorem ConcreteGame.neg_toIGame {α : Type v} {c : ConcreteGame α} [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] [H : IsWellFounded α c.IsOption] (h : c.leftMoves = c.rightMoves) (a : α) :
            theorem ConcreteGame.impartial_toIGame {α : Type v} {c : ConcreteGame α} [∀ (a : α), Small.{u, v} (c.leftMoves a)] [∀ (a : α), Small.{u, v} (c.rightMoves a)] [H : IsWellFounded α c.IsOption] (h : c.leftMoves = c.rightMoves) (a : α) :

            Convenience constructors #

            def ConcreteGame.ofImpartial {α : Type v} (moves : αSet α) :

            Create a ConcreteGame from a single function used for the left and right moves.

            Equations
            Instances For
              @[simp]
              theorem ConcreteGame.ofImpartial_leftMoves {α : Type v} (moves : αSet α) :
              (ofImpartial moves).leftMoves = moves
              @[simp]
              theorem ConcreteGame.ofImpartial_rightMoves {α : Type v} (moves : αSet α) :
              (ofImpartial moves).rightMoves = moves
              theorem ConcreteGame.isOption_ofImpartial_iff {α : Type v} {moves : αSet α} {a b : α} :
              (ofImpartial moves).IsOption a b a moves b
              @[simp]
              theorem ConcreteGame.isOption_ofImpartial {α : Type v} (moves : αSet α) :
              (ofImpartial moves).IsOption = fun (a b : α) => a moves b
              instance ConcreteGame.instSmallElemLeftMovesOfImpartial {α : Type v} (moves : αSet α) [Hm : ∀ (a : α), Small.{u, v} (moves a)] (a : α) :
              instance ConcreteGame.instSmallElemRightMovesOfImpartial {α : Type v} (moves : αSet α) [Hm : ∀ (a : α), Small.{u, v} (moves a)] (a : α) :
              @[simp]
              theorem ConcreteGame.neg_toLGame_ofImpartial {α : Type v} (moves : αSet α) [Hm : ∀ (a : α), Small.{u, v} (moves a)] (a : α) :
              instance ConcreteGame.impartial_toIGame_ofImpartial {α : Type v} (moves : αSet α) [Hm : ∀ (a : α), Small.{u, v} (moves a)] [IsWellFounded α (ofImpartial moves).IsOption] (a : α) :
              @[simp]
              theorem ConcreteGame.neg_toIGame_ofImpartial {α : Type v} (moves : αSet α) [Hm : ∀ (a : α), Small.{u, v} (moves a)] [IsWellFounded α (ofImpartial moves).IsOption] (a : α) :