Documentation

LeanPool.MisereGames.GameForm

Misere combinatorial games.

def MisereGames.GameFunctor (α : Type (u + 1)) :
Type (u + 1)

The polynomial functor describing Left and Right option sets.

Equations
Instances For
    theorem MisereGames.GameFunctor.ext {α : Type (u + 1)} {x y : GameFunctor α} :
    x = yx = y
    theorem MisereGames.GameFunctor.ext_iff {α : Type (u + 1)} {x y : GameFunctor α} :
    x = y x = y
    @[implicit_reducible]
    Equations
    theorem MisereGames.GameFunctor.map_def {α β : Type (u_1 + 1)} (f : αβ) (s : GameFunctor α) :
    f <$> s = fun (x : Player) => f '' s x,
    @[implicit_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    @[irreducible]

    The canonical type of combinatorial game forms.

    Equations
    Instances For
      @[implicit_reducible]
      noncomputable instance MisereGames.GameForm.instOfSetsTrue :

      Construct a GameForm from its Left and Right options.

      Equations
      • One or more equations did not get rendered due to their size.

      The set of Left options of the game.

      Equations
      Instances For

        The set of Right options of the game.

        Equations
        Instances For
          @[simp]
          theorem MisereGames.GameForm.ofSets_moves (x : GameForm) :
          !{fun (p : Player) => Moves.moves p x} = x
          theorem MisereGames.GameForm.ext {x y : GameForm} (h : ∀ (p : Player), Moves.moves p x = Moves.moves p y) :
          x = y

          Two GameForms are equal when their option sets are.

          theorem MisereGames.GameForm.ofSets_inj {s₁ s₂ t₁ t₂ : Set GameForm} [Small.{u_1, u_1 + 1} s₁] [Small.{u_1, u_1 + 1} s₂] [Small.{u_1, u_1 + 1} t₁] [Small.{u_1, u_1 + 1} t₂] :
          !{s₁ | t₁} = !{s₂ | t₂} s₁ = s₂ t₁ = t₂
          @[irreducible]
          def MisereGames.GameForm.moveRecOn {motive : GameFormSort u_1} (x : GameForm) (mk : (x : GameForm) → ((p : Player) → (y : GameForm) → y Moves.moves p xmotive y)motive x) :
          motive x

          Conway induction: build data for a game by recursively building it on its Left and Right sets. This rarely needs to be used explicitly, as the termination checker will handle it.

          See ofSetsRecOn for an alternate form.

          Equations
          Instances For
            theorem MisereGames.GameForm.moveRecOn_eq {motive : GameFormSort u_1} (x : GameForm) (mk : (x : GameForm) → ((p : Player) → (y : GameForm) → y Moves.moves p xmotive y)motive x) :
            moveRecOn x mk = mk x fun (x_1 : Player) (y : GameForm) (x : y Moves.moves x_1 x) => moveRecOn y mk
            def MisereGames.GameForm.ofSetsRecOn {motive : GameFormSort u_1} (x : GameForm) (mk : (s t : Set GameForm) → [inst : Small.{u, u + 1} s] → [inst_1 : Small.{u, u + 1} t] → ((x : GameForm) → x smotive x)((x : GameForm) → x tmotive x)motive !{s | t}) :
            motive x

            Conway induction: build data for a game by recursively building it on its Left and Right sets. This rarely needs to be used explicitly, as the termination checker will handle it.

            See moveRecOn for an alternate form.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[simp]
              theorem MisereGames.GameForm.ofSetsRecOn_ofSets {motive : GameFormSort u_1} (s t : Set GameForm) [Small.{u, u + 1} s] [Small.{u, u + 1} t] (mk : (s t : Set GameForm) → [inst : Small.{u, u + 1} s] → [inst_1 : Small.{u, u + 1} t] → ((x : GameForm) → x smotive x)((x : GameForm) → x tmotive x)motive !{s | t}) :
              ofSetsRecOn !{s | t} mk = mk s t (fun (y : GameForm) (x : y s) => ofSetsRecOn y mk) fun (y : GameForm) (x : y t) => ofSetsRecOn y mk
              @[implicit_reducible]
              noncomputable instance MisereGames.GameForm.instNeg :

              $\def\form<#1>[#2]{\left\{#1 \mid #2\right\}}$ The conjugate of a game is defined by -!{s | t} = !{-t | -s}. In the literature, one would see $$ \overline{G}=\form<\overline{G^\mathcal{R}}>[\overline{G^\mathcal{L}}]. $$ In this repository, the conjugate is often referred to as the 'negative', even though it is not necessarily an additive inverse.

              Equations
              theorem MisereGames.GameForm.neg_eq' (x : GameForm) :
              -x = !{fun (p : Player) => -Moves.moves (-p) x}

              Addition and subtraction #

              @[implicit_reducible]
              noncomputable instance MisereGames.GameForm.instAdd :

              $\def\form<#1>[#2]{\left\{#1 \mid #2\right\}}$ The sum of x = !{s₁ | t₁} and y = !{s₂ | t₂} is !{s₁ + y, x + s₂ | t₁ + y, x + t₂}. In the literature, one would see $$ G+H=\form<G^\mathcal{L}+H,G+H^\mathcal{L}>[G^\mathcal{R}+H,G+H^\mathcal{R}]. $$

              Equations
              theorem MisereGames.GameForm.add_eq (x y : GameForm) :
              x + y = !{(fun (x : GameForm) => x + y) '' Moves.moves Player.left x (fun (x_1 : GameForm) => x + x_1) '' Moves.moves Player.left y | (fun (x : GameForm) => x + y) '' Moves.moves Player.right x (fun (x_1 : GameForm) => x + x_1) '' Moves.moves Player.right y}
              theorem MisereGames.GameForm.add_eq' (x y : GameForm) :
              x + y = !{fun (p : Player) => (fun (x : GameForm) => x + y) '' Moves.moves p x (fun (x_1 : GameForm) => x + x_1) '' Moves.moves p y}
              theorem MisereGames.GameForm.ofSets_add_ofSets (s₁ t₁ s₂ t₂ : Set GameForm) [Small.{u_1, u_1 + 1} s₁] [Small.{u_1, u_1 + 1} t₁] [Small.{u_1, u_1 + 1} s₂] [Small.{u_1, u_1 + 1} t₂] :
              !{s₁ | t₁} + !{s₂ | t₂} = !{(fun (x : GameForm) => x + !{s₂ | t₂}) '' s₁ (fun (x : GameForm) => !{s₁ | t₁} + x) '' s₂ | (fun (x : GameForm) => x + !{s₂ | t₂}) '' t₁ (fun (x : GameForm) => !{s₁ | t₁} + x) '' t₂}
              theorem MisereGames.GameForm.ofSets_add_ofSets' (st₁ st₂ : PlayerSet GameForm) [Small.{u_1, u_1 + 1} (st₁ Player.left)] [Small.{u_1, u_1 + 1} (st₂ Player.left)] [Small.{u_1, u_1 + 1} (st₁ Player.right)] [Small.{u_1, u_1 + 1} (st₂ Player.right)] :
              !{st₁} + !{st₂} = !{fun (p : Player) => (fun (x : GameForm) => x + !{st₂}) '' st₁ p (fun (x : GameForm) => !{st₁} + x) '' st₂ p}
              theorem MisereGames.GameForm.forall_moves_neg {P : GameFormProp} {p : Player} {x : GameForm} :
              (∀ yMoves.moves p (-x), P y) yMoves.moves (-p) x, P (-y)
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              theorem MisereGames.GameForm.both_ends_eq_zero {g : GameForm} {p : Player} (h1 : Form.IsEnd p g) (h2 : Form.IsEnd (-p) g) :
              g = 0
              @[simp]
              theorem MisereGames.GameForm.zero_not_both_end {g : GameForm} {p : Player} (h1 : g 0) (h2 : Form.IsEnd p g) :