Basic definitions about impartial (pre-)games #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
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 classifed as impartial.
The definition for a impartial game, defined using Conway induction.
Equations
- G.impartial_aux = (G.equiv (-G) ∧ (∀ (i : G.left_moves), (G.move_left i).impartial_aux) ∧ ∀ (j : G.right_moves), (G.move_right j).impartial_aux)
theorem
pgame.impartial_aux_def
{G : pgame} :
G.impartial_aux ↔ G.equiv (-G) ∧ (∀ (i : G.left_moves), (G.move_left i).impartial_aux) ∧ ∀ (j : G.right_moves), (G.move_right j).impartial_aux
theorem
pgame.impartial_def
{G : pgame} :
G.impartial ↔ G.equiv (-G) ∧ (∀ (i : G.left_moves), (G.move_left i).impartial) ∧ ∀ (j : G.right_moves), (G.move_right j).impartial
@[protected, instance]
@[protected, instance]
def
pgame.impartial.move_right_impartial
{G : pgame}
[h : G.impartial]
(j : G.right_moves) :
(G.move_right j).impartial
theorem
pgame.impartial.forall_right_moves_fuzzy_iff_equiv_zero
(G : pgame)
[G.impartial] :
(∀ (j : G.right_moves), (G.move_right j).fuzzy 0) ↔ G.equiv 0
theorem
pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero
(G : pgame)
[G.impartial] :
(∃ (j : G.right_moves), (G.move_right j).equiv 0) ↔ G.fuzzy 0