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.
Games #
Auxiliary declaration used in the GL coalgebra development.
Equations
Instances For
Two-player game with
- perfect information
- sequential moves (i.e. only one player moves at each position)
- finitely many moves at each step (aka finitely branching)
- a well-founded relation to ensure that the game ends.
- Pos : Type
Positions in the game.
Whose turn is it?
What are the available moves?
- wf : WellFoundedRelation Pos
A wellfounded relation on positions.
- move_rel (p next : Pos) : next ∈ moves p → WellFoundedRelation.rel next p
Every move goes a step down in the relation.
Instances
This seems a bit hacky, but makes termination_by (p : g.Pos) work in winner and elsewhere.
If the instance causes trouble, change to termination_by g.wf.2.wrap p via WellFounded.wrap.
If the bound bound is zero then there are no more moves.
Equations
- Lean4GlCoalgebras.instLTPos = { lt := fun (p q : Lean4GlCoalgebras.Game.Pos) => WellFoundedRelation.rel q p }
Strategies #
A strategy in g for i, whenever it is i's turn, chooses a move, if there are any.
Equations
- Lean4GlCoalgebras.Strategy g i = ((p : Lean4GlCoalgebras.Game.Pos) → Lean4GlCoalgebras.Game.turn p = i → p.moves.Nonempty → ↥p.moves)
Instances For
Auxiliary declaration used in the GL coalgebra development.
Equations
Instances For
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
- One or more equations did not get rendered due to their size.
Instances For
A strategy is winning at p if it wins against all strategies of the other player.
Equations
- Lean4GlCoalgebras.winning sI p = ∀ (sJ : Lean4GlCoalgebras.Strategy g (Lean4GlCoalgebras.other i)), Lean4GlCoalgebras.winner sI sJ p = i
Instances For
Good positions #
Auxiliary declaration used in the GL coalgebra development.
Equations
- Lean4GlCoalgebras.goodStrat i p turn nempty = if W : Lean4GlCoalgebras.good i p then have E := ⋯; ⟨E.choose, ⋯⟩ else Lean4GlCoalgebras.chooseMove nempty
Instances For
Cones #
The cone of all positions reachable from p assuming that i plays sI.
- nil {i : Player} {g : Game} {sI : Strategy g i} {p : Game.Pos} : inMyCone sI p p
- myStep {i : Player} {g : Game} {sI : Strategy g i} {p q : Game.Pos} : inMyCone sI p q → ∀ (has_moves : q.moves.Nonempty) (h : Game.turn q = i), inMyCone sI p ↑(sI q h has_moves)
- oStep {i : Player} {g : Game} {sI : Strategy g i} {p q r : Game.Pos} : inMyCone sI p q → Game.turn q = other i → r ∈ Game.moves q → inMyCone sI p r