Documentation

Pdl.Game

A General Theory for Determined Two-player Games #

Nothing here is specific about PDL, but we give a general definition of games and show that one of the two players must have a winning strategy: gamedet at the end.

inductive Player :

Two players, A and B.

Instances For
    Equations
    @[simp]
    theorem Player.not_eq_i_eq_other {p i : Player} :
    ¬p = i p = other i
    @[simp]
    theorem Player.not_eq_other_eq_i {p i : Player} :
    ¬p = other i p = i
    @[simp]
    @[simp]
    @[simp]
    theorem other_other {i : Player} :
    other (other i) = i
    class Game :

    Two-player game with

    • perfect information
    • sequential moves (i.e. only one player moves at each position)
    • finitely many moves at each step
    • a decreasing bound on the number of remaining steps
    Instances
      @[reducible, inline]

      Allow notation p.moves for g.moves p.

      Equations
      Instances For
        theorem Game.no_moves_of_bound_zero {g : Game} {p : Game.Pos} (bound_zero : Game.bound p = 0) :

        If the bound bound is zero then there are no more moves.

        instance instLTPos_1 {g : Game} :
        Equations
        def Strategy (g : Game) (i : Player) :

        A strategy in g for i, whenever it is i's turn, chooses a move, if there are any.

        Equations
        Instances For
          noncomputable def choose_move {g : Game} {p : Game.Pos} :
          p.moves.Nonempty{ x : Game.Pos // x p.moves }
          Equations
          Instances For
            instance Strategy.instNonempty {g : Game} {i : Player} :

            There is always some strategy.

            @[irreducible]
            def winner {i : Player} {g : Game} (sI : Strategy g i) (sJ : Strategy g (other i)) (p : Game.Pos) :

            Winner of a game, if the given strategies are used. A player loses iff it is their turn and there are no moves. A player wins if the opponent loses.

            Equations
            Instances For
              def winning {g : Game} {i : Player} (p : Game.Pos) (sI : Strategy g i) :

              A strategy is winning at p if it wins against all strategies of the other player.

              Equations
              Instances For
                inductive inMyCone {i : Player} {g : Game} (sI : Strategy g i) (p : Game.Pos) :

                The cone of all positions reachable from p assuming that i plays sI.

                Instances For
                  @[irreducible]
                  def good {g : Game} (i : Player) (p : Game.Pos) :
                  Equations
                  Instances For
                    noncomputable def good_strat {g : Game} (i : Player) :
                    Equations
                    Instances For
                      theorem good_cone {i : Player} {g : Game} {p r : Game.Pos} (W : good i p) (h : inMyCone (good_strat i) p r) :
                      good i r
                      theorem good_is_surviving {i : Player} {g : Game} {p : Game.Pos} :
                      good i pGame.turn p = ip.moves.Nonempty
                      theorem cone_trans {g : Game} {i : Player} {p q r : Game.Pos} {s : Strategy g i} :
                      inMyCone s p qinMyCone s q rinMyCone s p r
                      @[irreducible]
                      theorem surviving_is_winning {g : Game} {i : Player} {p : Game.Pos} {sI : Strategy g i} (surv : ∀ (q : Game.Pos), inMyCone sI p qGame.turn q = iq.moves.Nonempty) :
                      winning p sI
                      theorem good_strat_winning {i : Player} {self✝ : Game} {p : Game.Pos} (W : good i p) :
                      theorem gamedet (g : Game) (p : Game.Pos) :
                      (∃ (s : Strategy g Player.A), winning p s) ∃ (s : Strategy g Player.B), winning p s

                      Zermelo's Theorem: In every Game posiiton one of the two players has a winning strategy. https://en.wikipedia.org/wiki/Zermelo%27s_theorem_(game_theory)