Classes of games #
This file collects multiple basic classes of games, so as to make them available on most files. We develop their theory elsewhere.
Dicotic games #
A game is dicotic when every non-zero subposition has both left and right moves. The lawnmower
theorem (proven in CombinatorialGames.Game.Small) shows that every dicotic game is small.
Impartial games #
We define an impartial game as one where every subposition is equivalent to its negative. This is a weaker definition than that found in the literature (which requires equality, rather than equivalence), but this is still strong enough to prove the Sprague--Grundy theorem, as well as closure under the basic arithmetic operations of multiplication and division.
Numeric games #
A game is Numeric if all the Left options are strictly smaller than all the Right options, and all
those options are themselves numeric. In terms of combinatorial games, the numeric games have
"frozen"; you can only make your position worse by playing, and Left is some definite "number" of
moves ahead (or behind) Right.
Short games #
A combinatorial game is Short if it has only finitely many subpositions. In particular, this means
there is a finite set of moves at every point.
We historically defined Short x as data, which we then used to enable some degree of computation
on combinatorial games. This functionality is now implemented through the game_cmp tactic instead.
Dicotic games #
dicotic eagerly adds all possible Dicotic hypotheses.
Equations
- IGame.Dicotic.tacticDicotic = Lean.ParserDescr.node `IGame.Dicotic.tacticDicotic 1024 (Lean.ParserDescr.nonReservedSymbol "dicotic" false)
Instances For
Self-negative games #
An auxiliary typeclass for games which are equivalent to their own negative. This allows us to generalize results about impartial games.
- neg_equiv : -x ≈ x
Instances
By setting y = 0, we find that in a self-negative game, either the first player always wins,
or the second player always wins.
This lemma doesn't require x to be self-negative.
This lemma doesn't require y to be self-negative.
This lemma doesn't require x to be self-negative.
This lemma doesn't require y to be self-negative.
"Weakly" impartial games #
A weakly impartial game is one that's equivalent to its negative, such that each left and right move is also weakly impartial.
This is more general than Impartial, since we don't require x = -x. Despite this, the
Sprague-Grundy theorem still holds: see IGame.nim_grundy_equiv.
In such a game, both players have the same payoffs at any subposition.
- mk {x : IGame} : -x ≈ x → (∀ (p : Player), ∀ y ∈ moves p x, y.WeaklyImpartial) → x.WeaklyImpartial
Instances
weakly_impartial eagerly adds all possible WeaklyImpartial hypotheses.
Equations
- IGame.WeaklyImpartial.tacticWeakly_impartial = Lean.ParserDescr.node `IGame.WeaklyImpartial.tacticWeakly_impartial 1024 (Lean.ParserDescr.nonReservedSymbol "weakly_impartial" false)
Instances For
A strategy stealing argument. If there's a move in x, such that any immediate move could
have also been reached in the first turn, then x is won by the first player.
Impartial games #
An impartial game is one that's equal to its negative, such that each left and right move is also impartial.
Note that many theorems hold under the WeaklyImpartial assumption, or the even weaker
NegSelfEquiv assumption.
Instances
impartial eagerly adds all possible Impartial hypotheses.
Equations
- IGame.Impartial.tacticImpartial = Lean.ParserDescr.node `IGame.Impartial.tacticImpartial 1024 (Lean.ParserDescr.nonReservedSymbol "impartial" false)
Instances For
Numeric games #
A game !{s | t} is numeric if everything in s is less than everything in t, and all the
elements of these sets are also numeric.
The Surreal numbers are built as the quotient of numeric games under equivalence.
- mk {x : IGame} : (∀ y ∈ moves left x, ∀ z ∈ moves right x, y < z) → (∀ (p : Player), ∀ y ∈ moves p x, y.Numeric) → x.Numeric
Instances
numeric eagerly adds all possible Numeric hypotheses.
Equations
- IGame.Numeric.tacticNumeric = Lean.ParserDescr.node `IGame.Numeric.tacticNumeric 1024 (Lean.ParserDescr.nonReservedSymbol "numeric" false)
Instances For
Short games #
short eagerly adds all possible Short hypotheses.
Equations
- IGame.Short.tacticShort = Lean.ParserDescr.node `IGame.Short.tacticShort 1024 (Lean.ParserDescr.nonReservedSymbol "short" false)