Documentation

CombinatorialGames.Game.Player

Type of players #

This file implements the two-element type of players (Left, Right), alongside other basic notational machinery to be used within game theory.

Players #

inductive Player :

Either the Left or Right player.

  • left : Player

    The Left player.

  • right : Player

    The Right player.

Instances For
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    @[reducible, inline]
    abbrev Player.cases {α : Sort u_1} (l r : α) :
    Player → α

    Specify a function Player → α from its two outputs.

    Equations
    Instances For
      theorem Player.apply_cases {α : Sort u_1} {β : Sort u_2} (f : α → β) (l r : α) (p : Player) :
      f (cases l r p) = cases (f l) (f r) p
      @[simp]
      theorem Player.cases_inj {α : Sort u_1} {l₁ r₁ l₂ r₂ : α} :
      cases l₁ r₁ = cases l₂ r₂ ↔ l₁ = l₂ ∧ r₁ = r₂
      theorem Player.const_of_left_eq_right {α : Sort u_1} {f : Player → α} (hf : f left = f right) (p q : Player) :
      f p = f q
      theorem Player.const_of_left_eq_right' {f : Player → Prop} (hf : f left ↔ f right) (p q : Player) :
      f p ↔ f q
      @[simp]
      theorem Player.forall {p : Player → Prop} :
      (∀ (x : Player), p x) ↔ p left ∧ p right
      @[simp]
      theorem Player.exists {p : Player → Prop} :
      (∃ (x : Player), p x) ↔ p left ∨ p right
      theorem Player.range_eq {α : Type u_1} (f : Player → α) :
      @[simp]
      theorem Player.range_cases {α : Type u_1} (l r : α) :
      Set.range (cases l r) = {l, r}
      @[instance_reducible]
      Equations
      @[simp]
      theorem Player.eq_neg {p q : Player} :
      p = -q ↔ p ≠ q
      @[simp]
      theorem Player.neg_eq {p q : Player} :
      -p = q ↔ p ≠ q
      theorem Player.ne_neg {p q : Player} :
      p ≠ -q ↔ p = q
      theorem Player.neg_ne {p q : Player} :
      -p ≠ q ↔ p = q
      @[instance_reducible]

      The multiplication of Players is used to state the lemmas about the multiplication of combinatorial games, such as IGame.mulOption_mem_moves_mul.

      Equations
      @[simp]
      theorem Player.left_mul (p : Player) :
      left * p = p
      @[simp]
      theorem Player.right_mul (p : Player) :
      right * p = -p
      @[simp]
      theorem Player.mul_left (p : Player) :
      p * left = p
      @[simp]
      theorem Player.mul_right (p : Player) :
      p * right = -p
      @[simp]
      theorem Player.mul_self (p : Player) :
      p * p = left
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      @[simp]
      @[simp]
      theorem Player.inv_eq_self (p : Player) :
      p⁻¹ = p
      @[reducible, inline]
      abbrev Player.LE {α : Type u_1} [LE α] (p : Player) (x y : α) :

      A predicate for x ≤ y or y ≤ x, according to the player.

      Equations
      Instances For
        theorem Player.left_le {α : Type u_1} [LE α] {x y : α} :
        left.LE x y ↔ x ≤ y
        theorem Player.right_le {α : Type u_1} [LE α] {x y : α} :
        right.LE x y ↔ y ≤ x
        theorem Player.le_congr_left {α : Type u_1} [Preorder α] {p : Player} {x₁ x₂ y : α} (h : AntisymmRel (fun (x1 x2 : α) => x1 ≤ x2) x₁ x₂) :
        p.LE x₁ y ↔ p.LE x₂ y
        theorem Player.le_congr_right {α : Type u_1} [Preorder α] {p : Player} {x y₁ y₂ : α} (h : AntisymmRel (fun (x1 x2 : α) => x1 ≤ x2) y₁ y₂) :
        p.LE x y₁ ↔ p.LE x y₂
        theorem Player.le_congr {α : Type u_1} [Preorder α] {p : Player} {x₁ x₂ y₁ y₂ : α} (hx : AntisymmRel (fun (x1 x2 : α) => x1 ≤ x2) x₁ x₂) (hy : AntisymmRel (fun (x1 x2 : α) => x1 ≤ x2) y₁ y₂) :
        p.LE x₁ y₁ ↔ p.LE x₂ y₂
        @[simp]
        theorem Player.neg_le_iff_swap {α : Type u_1} [LE α] {p : Player} {x y : α} :
        (-p).LE x y ↔ p.LE y x
        @[reducible, inline]
        abbrev Player.LT {α : Type u_1} [LT α] (p : Player) (x y : α) :

        A predicate for x < y or y < x, according to the player.

        Equations
        Instances For
          theorem Player.left_lt {α : Type u_1} [LT α] {x y : α} :
          left.LT x y ↔ x < y
          theorem Player.right_lt {α : Type u_1} [LT α] {x y : α} :
          right.LT x y ↔ y < x
          theorem Player.lt_congr_left {α : Type u_1} [Preorder α] {p : Player} {x₁ x₂ y : α} (h : AntisymmRel (fun (x1 x2 : α) => x1 ≤ x2) x₁ x₂) :
          p.LT x₁ y ↔ p.LT x₂ y
          theorem Player.lt_congr_right {α : Type u_1} [Preorder α] {p : Player} {x y₁ y₂ : α} (h : AntisymmRel (fun (x1 x2 : α) => x1 ≤ x2) y₁ y₂) :
          p.LT x y₁ ↔ p.LT x y₂
          theorem Player.lt_congr {α : Type u_1} [Preorder α] {p : Player} {x₁ x₂ y₁ y₂ : α} (hx : AntisymmRel (fun (x1 x2 : α) => x1 ≤ x2) x₁ x₂) (hy : AntisymmRel (fun (x1 x2 : α) => x1 ≤ x2) y₁ y₂) :
          p.LT x₁ y₁ ↔ p.LT x₂ y₂
          @[simp]
          theorem Player.neg_lt_iff_swap {α : Type u_1} [LT α] {p : Player} {x y : α} :
          (-p).LT x y ↔ p.LT y x

          Outcomes #

          inductive Outcome :

          The three possible outcomes of a game.

          We register a linear order, with ⊤ = win and ⊥ = loss.

          • loss : Outcome

            A given player loses in perfect play.

          • draw : Outcome

            A given player draws in perfect play.

          • win : Outcome

            A given player wins in perfect play.

          Instances For
            @[instance_reducible]
            Equations
            @[instance_reducible]
            Equations
            @[simp]
            theorem Outcome.loss_le (x : Outcome) :
            @[simp]
            theorem Outcome.le_win (x : Outcome) :
            @[instance_reducible]
            Equations

            OfSets #

            class OfSets (α : Type (u + 1)) (Valid : outParam ((Player → Set α) → Prop)) :
            Type (u + 1)

            Type class for the ofSets operation. Used to implement the !{st} and !{s | t} syntax.

            • ofSets (st : Player → Set α) (h : Valid st) [Small.{u, u + 1} ↑(st Player.left)] [Small.{u, u + 1} ↑(st Player.right)] : α

              Construct a combinatorial game from its left and right sets.

              Conventions for notations in identifiers:

              • The recommended spelling of !{st}'h in identifiers is ofSets.

              • The recommended spelling of !{s | t}'h in identifiers is ofSets.

              • The recommended spelling of !{st} in identifiers is ofSets.

              • The recommended spelling of !{s | t} in identifiers is ofSets.

            Instances

              Construct a combinatorial game from its left and right sets.

              Conventions for notations in identifiers:

              • The recommended spelling of !{st}'h in identifiers is ofSets.
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Construct a combinatorial game from its left and right sets.

                Conventions for notations in identifiers:

                • The recommended spelling of !{s | t}'h in identifiers is ofSets.
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  A tactic which attempts to automatically solve goals which appear on OfSets.

                  Equations
                  Instances For

                    Construct a combinatorial game from its left and right sets.

                    Conventions for notations in identifiers:

                    • The recommended spelling of !{st} in identifiers is ofSets.
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Construct a combinatorial game from its left and right sets.

                      Conventions for notations in identifiers:

                      • The recommended spelling of !{s | t} in identifiers is ofSets.
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        Delaborates ofSets (Player.cases s t) to !{s | t} and ofSets st to !{st}.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem ofSets_eq_ofSets_cases {α : Type (u_1 + 1)} {Valid : (Player → Set α) → Prop} [OfSets α Valid] (st : Player → Set α) (h : Valid st) [Small.{u_1, u_1 + 1} ↑(st Player.left)] [Small.{u_1, u_1 + 1} ↑(st Player.right)] :
                          !{st} = !{st Player.left | st Player.right}