Documentation

LeanPool.MisereGames.Form

Misere combinatorial games.

def MisereGames.Moves.IsOption' {G : Type v} (moves : PlayerGSet G) (x y : G) :

The immediate-option relation determined by a raw move function.

Equations
Instances For
    class MisereGames.Moves (G : Type v) :

    A type with Left and Right moves and a well-founded option relation.

    Instances
      class MisereGames.Form (G : Type (v + 1)) extends MisereGames.Moves G, MisereGames.OfSets G fun (x : MisereGames.PlayerSet G) => True, InvolutiveNeg G, AddCommSemigroup G :
      Type (v + 1)

      A type of combinatorial game forms with negation, addition, and set construction.

      Instances
        def MisereGames.Moves.IsOption {G : Type (u + 1)} [g_moves : Moves G] (x y : G) :

        IsOption x y means that x is either a Left or a Right option for y.

        Equations
        Instances For
          theorem MisereGames.Moves.IsOption.of_mem_moves {G : Type (u + 1)} [g_moves : Moves G] {x y : G} {p : Player} (h : x moves p y) :
          instance MisereGames.Moves.instSmallSubtypeIsOption {G : Type (u + 1)} [g_moves : Moves G] (x : G) :
          theorem MisereGames.Moves.IsOption.irrefl {G : Type (u + 1)} [g_moves : Moves G] (x : G) :
          theorem MisereGames.Moves.self_notMem_moves {G : Type (u + 1)} [g_moves : Moves G] (p : Player) (x : G) :
          xmoves p x
          def MisereGames.Moves.Subposition {G : Type (u + 1)} [g_moves : Moves G] :
          GGProp

          A proper subposition is an element of the transitive closure of IsOption. Note that this is not the reflexive-transitive closure! While it is common to say that $G$ is a subposition of $G$ in the literature, here Subposition refers to a proper subposition.

          Equations
          Instances For
            theorem MisereGames.Moves.Subposition.of_isOption {G : Type (u + 1)} [g_moves : Moves G] {x y : G} (h : IsOption x y) :
            theorem MisereGames.Moves.Subposition.of_mem_moves {G : Type (u + 1)} [g_moves : Moves G] {p : Player} {x y : G} (h : x moves p y) :
            theorem MisereGames.Moves.Subposition.trans {G : Type (u + 1)} [g_moves : Moves G] {x y z : G} (h₁ : Subposition x y) (h₂ : Subposition y z) :

            Solve routine well-foundedness goals generated by recursive form definitions.

            Equations
            Instances For
              def MisereGames.Form.IsEnd {G : Type (u + 1)} [Moves G] (p : Player) (g : G) :

              A position is an end for p when p has no legal move.

              Equations
              Instances For
                theorem MisereGames.Form.isEnd_def {G : Type (u + 1)} [Moves G] (p : Player) (g : G) :
                IsEnd p g = (moves p g = )
                theorem MisereGames.Form.not_isEnd_def {G : Type (u + 1)} [Moves G] (p : Player) (g : G) :
                theorem MisereGames.Form.isEndLike_of_isEnd {G : Type (u + 1)} [g_form : Form G] {p : Player} {x : G} (h1 : IsEnd p x) :
                @[simp]
                theorem MisereGames.Form.IsEndLike.add_iff {G : Type (u + 1)} [g_form : Form G] {p : Player} {x y : G} :
                @[simp]
                theorem MisereGames.Form.IsEndLike.neg_iff_neg {G : Type (u + 1)} [g_form : Form G] {g : G} {p : Player} :
                @[simp]
                theorem MisereGames.Form.moves_neg {G : Type (u + 1)} [g_form : Form G] (p : Player) (x : G) :
                moves p (-x) = -moves (-p) x
                @[simp]
                theorem MisereGames.Form.moves_add {G : Type (u + 1)} [g_form : Form G] (p : Player) (x y : G) :
                moves p (x + y) = (fun (x : G) => x + y) '' moves p x (fun (x_1 : G) => x + x_1) '' moves p y
                instance MisereGames.Form.instSmallElemMoves {G : Type (u + 1)} [g_form : Form G] (p : Player) (x : G) :
                @[simp]
                theorem MisereGames.Form.moves_ofSets {G : Type (u + 1)} [g_form : Form G] (p : Player) (st : PlayerSet G) [Small.{u, u + 1} (st Player.left)] [Small.{u, u + 1} (st Player.right)] :
                moves p !{st} = st p
                theorem MisereGames.Form.ofSets_moves_of_not_isEndLike {G : Type (u + 1)} [g_form : Form G] {g : G} (h : ∀ (p : Player), ¬IsEndLike p g) :
                !{fun (p : Player) => moves p g} = g

                Away from end-like positions, a form is determined by its sets of moves.

                @[simp]
                theorem MisereGames.Form.leftMoves_ofSets {G : Type (u + 1)} [g_form : Form G] (s t : Set G) [Small.{u, u + 1} s] [Small.{u, u + 1} t] :
                moves Player.left !{s | t} = s
                @[simp]
                theorem MisereGames.Form.rightMoves_ofSets {G : Type (u + 1)} [g_form : Form G] (s t : Set G) [Small.{u, u + 1} s] [Small.{u, u + 1} t] :
                moves Player.right !{s | t} = t
                @[simp]
                theorem MisereGames.Form.ofSets_inj' {G : Type (u + 1)} [g_form : Form G] {st₁ st₂ : PlayerSet G} [Small.{u, u + 1} (st₁ Player.left)] [Small.{u, u + 1} (st₁ Player.right)] [Small.{u, u + 1} (st₂ Player.left)] [Small.{u, u + 1} (st₂ Player.right)] :
                !{st₁} = !{st₂} st₁ = st₂
                theorem MisereGames.Form.ofSets_inj {G : Type (u + 1)} [g_form : Form G] {s₁ s₂ t₁ t₂ : Set G} [Small.{u, u + 1} s₁] [Small.{u, u + 1} s₂] [Small.{u, u + 1} t₁] [Small.{u, u + 1} t₂] :
                !{s₁ | t₁} = !{s₂ | t₂} s₁ = s₂ t₁ = t₂
                @[implicit_reducible]
                instance MisereGames.Form.instZero {G : Type (u + 1)} [g_form : Form G] :
                Equations
                theorem MisereGames.Form.zero_def {G : Type (u + 1)} [g_form : Form G] :
                0 = !{fun (x : Player) => }
                @[simp]
                theorem MisereGames.Form.moves_zero {G : Type (u + 1)} [g_form : Form G] (p : Player) :
                moves p 0 =
                @[simp]
                theorem MisereGames.Form.isEnd_zero {G : Type (u + 1)} [g_form : Form G] {p : Player} :
                IsEnd p 0
                def MisereGames.Form.IsZeroLike {G : Type (u + 1)} [g_form : Form G] (g : G) :

                A form is zero-like if it is both a Left and a Right end, just like 0.

                Equations
                Instances For
                  @[simp]
                  theorem MisereGames.Form.isZeroLike_zero {G : Type (u + 1)} [g_form : Form G] :
                  @[simp]
                  theorem MisereGames.Form.neg_ofSets {G : Type (u + 1)} [g_form : Form G] (s t : Set G) [Small.{u, u + 1} s] [Small.{u, u + 1} t] :
                  -!{s | t} = !{-t | -s}
                  @[simp]
                  theorem MisereGames.Form.neg_ofSets_const {G : Type (u + 1)} [g_form : Form G] (s : Set G) [Small.{u, u + 1} s] :
                  -!{fun (x : Player) => s} = !{fun (x : Player) => -s}
                  @[implicit_reducible]
                  instance MisereGames.Form.instNegZeroClass {G : Type (u + 1)} [g_form : Form G] :
                  Equations
                  @[implicit_reducible]
                  instance MisereGames.Form.instInhabited {G : Type (u + 1)} [g_form : Form G] :
                  Equations
                  @[implicit_reducible]
                  instance MisereGames.Form.instOne {G : Type (u + 1)} [g_form : Form G] :
                  One G
                  Equations
                  theorem MisereGames.Form.one_def {G : Type (u + 1)} [g_form : Form G] :
                  1 = !{{0} | }
                  @[simp]
                  theorem MisereGames.Form.leftMoves_one {G : Type (u + 1)} [g_form : Form G] :
                  @[simp]
                  theorem MisereGames.Form.rightMoves_one {G : Type (u + 1)} [g_form : Form G] :
                  @[simp]
                  theorem MisereGames.Form.moves_small {G : Type (u + 1)} [g_form : Form G] (p : Player) (x : G) :
                  theorem MisereGames.Form.exists_moves_neg {G : Type (u + 1)} [g_form : Form G] {P : GProp} {p : Player} {x : G} :
                  (∃ ymoves p (-x), P y) ymoves (-p) x, P (-y)
                  @[simp]
                  theorem MisereGames.Form.IsEnd.add_iff {G : Type (u + 1)} [g_form : Form G] {g h : G} {p : Player} :
                  IsEnd p (g + h) IsEnd p g IsEnd p h
                  theorem MisereGames.Form.IsEnd.neg_iff_neg {G : Type (u + 1)} [g_form : Form G] {g : G} {p : Player} :
                  IsEnd p (-g) IsEnd (-p) g
                  theorem MisereGames.Form.mem_moves_ne_zero {G : Type (u + 1)} [g_form : Form G] {g gl : G} {p : Player} (h1 : gl moves p g) :
                  g 0
                  theorem MisereGames.Form.not_isEnd_ne_zero {G : Type (u + 1)} [g_form : Form G] {g : G} {p : Player} (h1 : ¬IsEnd p g) :
                  g 0
                  theorem MisereGames.Form.not_isEnd_exists_move {G : Type (u + 1)} [g_form : Form G] {g : G} {p : Player} (h1 : ¬IsEnd p g) :
                  ∃ (gp : G), gp moves p g
                  @[simp]
                  theorem MisereGames.Form.not_mem_moves_of_isEnd {G : Type (u + 1)} [g_form : Form G] {p : Player} {g gp : G} (h1 : IsEnd p g) :
                  gpmoves p g
                  theorem MisereGames.Form.not_isEnd_of_mem_moves {G : Type (u + 1)} [g_form : Form G] {p : Player} {g g' : G} (h1 : g' moves p g) :
                  theorem MisereGames.Form.not_isEnd_add_left {G : Type (u + 1)} [g_form : Form G] {p : Player} {g h : G} (h_not_isEnd : ¬IsEnd p g) :
                  ¬IsEnd p (g + h)
                  theorem MisereGames.Form.not_isEnd_add_right {G : Type (u + 1)} [g_form : Form G] {p : Player} {g h : G} (h_not_isEnd : ¬IsEnd p h) :
                  ¬IsEnd p (g + h)
                  theorem MisereGames.Form.add_left_mem_moves_add {G : Type (u + 1)} [g_form : Form G] {p : Player} {x y : G} (h : x moves p y) (z : G) :
                  z + x moves p (z + y)
                  theorem MisereGames.Form.add_right_mem_moves_add {G : Type (u + 1)} [g_form : Form G] {p : Player} {x y : G} (h : x moves p y) (z : G) :
                  x + z moves p (y + z)
                  @[implicit_reducible]
                  instance MisereGames.Form.instAddCommMonoid {G : Type (u + 1)} [g_form : Form G] :
                  Equations
                  • One or more equations did not get rendered due to their size.
                  @[implicit_reducible]
                  instance MisereGames.Form.instSubNegMonoid {G : Type (u + 1)} [g_form : Form G] :
                  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.Form.sub_left_mem_moves_sub {G : Type (u + 1)} [g_form : Form G] {p : Player} {x y : G} (h : x moves p y) (z : G) :
                  z - x moves (-p) (z - y)
                  theorem MisereGames.Form.sub_left_mem_moves_sub_neg {G : Type (u + 1)} [g_form : Form G] {p : Player} {x y : G} (h : x moves (-p) y) (z : G) :
                  z - x moves p (z - y)
                  theorem MisereGames.Form.sub_right_mem_moves_sub {G : Type (u + 1)} [g_form : Form G] {p : Player} {x y : G} (h : x moves p y) (z : G) :
                  x - z moves p (y - z)
                  theorem MisereGames.Form.exists_moves_add {G : Type (u + 1)} [g_form : Form G] {p : Player} {P : GProp} {x y : G} :
                  (∃ amoves p (x + y), P a) (∃ amoves p x, P (a + y)) bmoves p y, P (x + b)
                  theorem MisereGames.Form.isOption_iff_mem_moves {G : Type (u + 1)} [g_form : Form G] {x y : G} :
                  IsOption x y ∃ (p : Player), x moves p y
                  @[simp]
                  theorem MisereGames.Form.not_isOption_zero {G : Type (u + 1)} [g_form : Form G] (g : G) :
                  @[simp]
                  theorem MisereGames.Form.isOption_zero_neg_iff {G : Type (u + 1)} [g_form : Form G] {g : G} :
                  theorem MisereGames.Form.isOption_not_mem {G : Type (u + 1)} [g_form : Form G] {p : Player} {g g' : G} (h_isOption : IsOption g' g) (h_mem : g'moves p g) :
                  g' moves (-p) g
                  theorem MisereGames.Form.isOption_not_mem_neg {G : Type (u + 1)} [g_form : Form G] {p : Player} {g g' : G} (h_isOption : IsOption g' g) (h_mem : g'moves (-p) g) :
                  g' moves p g
                  theorem MisereGames.Form.leftMoves_natCast_succ' {G : Type (u + 1)} [g_form : Form G] (n : ) :
                  @[simp]
                  theorem MisereGames.Form.leftMoves_natCast_succ {G : Type (u + 1)} [g_form : Form G] (n : ) :
                  moves Player.left (n + 1) = {n}
                  @[simp]
                  theorem MisereGames.Form.rightMoves_natCast {G : Type (u + 1)} [g_form : Form G] (n : ) :
                  @[simp]
                  theorem MisereGames.Form.leftMoves_ofNat {G : Type (u + 1)} [g_form : Form G] (n : ) [n.AtLeastTwo] :
                  @[simp]
                  theorem MisereGames.Form.rightMoves_ofNat {G : Type (u + 1)} [g_form : Form G] (n : ) [n.AtLeastTwo] :
                  @[implicit_reducible]
                  instance MisereGames.Form.instIntCast {G : Type (u + 1)} [g_form : Form G] :
                  Equations
                  @[simp]
                  theorem MisereGames.Form.intCast_nat {G : Type (u + 1)} [g_form : Form G] (n : ) :
                  n = n
                  @[simp]
                  theorem MisereGames.Form.intCast_ofNat {G : Type (u + 1)} [g_form : Form G] (n : ) :
                  (OfNat.ofNat n) = n
                  @[simp]
                  theorem MisereGames.Form.intCast_negSucc {G : Type (u + 1)} [g_form : Form G] (n : ) :
                  (Int.negSucc n) = -(n + 1)
                  theorem MisereGames.Form.intCast_zero {G : Type (u + 1)} [g_form : Form G] :
                  0 = 0
                  theorem MisereGames.Form.intCast_one {G : Type (u + 1)} [g_form : Form G] :
                  1 = 1
                  theorem MisereGames.Form.natCast_zero {G : Type (u + 1)} [g_form : Form G] :
                  0 = 0
                  theorem MisereGames.Form.natCast_one {G : Type (u + 1)} [g_form : Form G] :
                  1 = 1
                  @[simp]
                  theorem MisereGames.Form.intCast_neg {G : Type (u + 1)} [g_form : Form G] (n : ) :
                  ↑(-n) = -n
                  @[simp]
                  theorem MisereGames.Form.leftMoves_eq_natCast_zero_lt {G : Type (u + 1)} [g_form : Form G] {a : } (h1 : 0 < a) :
                  moves Player.left a = {↑(a - 1)}
                  theorem MisereGames.Form.leftMoves_natCast_zero_lt {G : Type (u + 1)} [g_form : Form G] {a : } (h1 : 0 < a) :
                  ↑(a - 1) moves Player.left a
                  @[simp]
                  theorem MisereGames.Form.leftMoves_intCast_succ {G : Type (u + 1)} [g_form : Form G] {n : } (h1 : 0 n) :
                  moves Player.left (n + 1) = {n}
                  @[simp]
                  theorem MisereGames.Form.leftMoves_intCast {G : Type (u + 1)} [g_form : Form G] {a : } (h1 : 0 < a) :
                  moves Player.left a = {↑(a - 1)}
                  theorem MisereGames.Form.leftMoves_intCast_zero_lt {G : Type (u + 1)} [g_form : Form G] {a : } (h1 : 0 < a) :
                  ↑(a - 1) moves Player.left a
                  theorem MisereGames.Form.leftMoves_intCast_zero_le_succ {G : Type (u + 1)} [g_form : Form G] {a : } (h1 : 0 a) :
                  a moves Player.left ↑(a + 1)
                  theorem MisereGames.Form.leftMoves_intCast_le_zero_of_empty {G : Type (u + 1)} [g_form : Form G] {k : } (h1 : 0 k) (h2 : moves Player.left k = ) :
                  k = 0
                  theorem MisereGames.Form.leftMoves_intCast_le_one_eq {G : Type (u + 1)} [g_form : Form G] {a : } (h1 : 1 a) :
                  moves Player.left a = {↑(a - 1)}
                  @[simp]
                  theorem MisereGames.Form.leftMoves_intCast_le_one_ne_empty {G : Type (u + 1)} [g_form : Form G] {a : } (h1 : 1 a) :
                  @[simp]
                  theorem MisereGames.Form.rightMoves_intCast {G : Type (u + 1)} [g_form : Form G] {a : } (h1 : 0 a) :
                  theorem MisereGames.Form.mem_moves_add_one_iff_mem_moves {G : Type (u + 1)} [g_form : Form G] {g : G} {p : Player} {n : } :
                  g + 1 moves p (n + 1) g moves p n
                  @[simp]
                  theorem MisereGames.Form.one_isEnd_right {G : Type (u + 1)} [g_form : Form G] :
                  @[simp]
                  theorem MisereGames.Form.not_isEnd_left_one {G : Type (u + 1)} [g_form : Form G] :
                  theorem MisereGames.Form.natCast_isEnd_right {G : Type (u + 1)} [g_form : Form G] (n : ) :
                  @[simp]
                  theorem MisereGames.Form.ofSets_isEndLike_iff {G : Type (u + 1)} [g_form : Form G] {p : Player} {s t : Set G} [Small.{u, u + 1} s] [Small.{u, u + 1} t] :
                  IsEndLike p !{s | t} IsEnd p !{s | t}
                  theorem MisereGames.Form.ofSets_add_ofSets {G : Type (u + 1)} [g_form : Form G] (s₁ t₁ s₂ t₂ : Set G) [Small.{u, u + 1} s₁] [Small.{u, u + 1} t₁] [Small.{u, u + 1} s₂] [Small.{u, u + 1} t₂] :
                  !{s₁ | t₁} + !{s₂ | t₂} = !{(fun (x : G) => x + !{s₂ | t₂}) '' s₁ (fun (x : G) => !{s₁ | t₁} + x) '' s₂ | (fun (x : G) => x + !{s₂ | t₂}) '' t₁ (fun (x : G) => !{s₁ | t₁} + x) '' t₂}
                  theorem MisereGames.Form.ofSets_add_ofSets' {G : Type (u + 1)} [g_form : Form G] (st₁ st₂ : PlayerSet G) [Small.{u, u + 1} (st₁ Player.left)] [Small.{u, u + 1} (st₂ Player.left)] [Small.{u, u + 1} (st₁ Player.right)] [Small.{u, u + 1} (st₂ Player.right)] :
                  !{st₁} + !{st₂} = !{fun (p : Player) => (fun (x : G) => x + !{st₂}) '' st₁ p (fun (x : G) => !{st₁} + x) '' st₂ p}
                  theorem MisereGames.Form.natCast_add_one_ofSets {G : Type (u + 1)} [g_form : Form G] {n : } :
                  ↑(n + 1) = !{{n} | }
                  @[simp]
                  theorem MisereGames.Form.natCast_isEndLike_iff {G : Type (u + 1)} [g_form : Form G] {p : Player} {n : } :
                  IsEndLike p n IsEnd p n
                  @[simp]
                  @[simp]
                  theorem MisereGames.Form.natCast_ext {G : Type (u + 1)} [g_form : Form G] {k m : } (h_moves : ∀ (p : Player) (gp : G), gp moves p k gp moves p m) :
                  k = m
                  @[simp]
                  theorem MisereGames.Form.isEnd_left_natCast_iff {G : Type (u + 1)} [g_form : Form G] {n : } :
                  @[simp]
                  theorem MisereGames.Form.isEnd_left_intCast_iff {G : Type (u + 1)} [g_form : Form G] {n : } :
                  @[simp]
                  theorem MisereGames.Form.isEnd_right_intCast_iff {G : Type (u + 1)} [g_form : Form G] {n : } :
                  @[simp]
                  theorem MisereGames.Form.isEnd_right_natCast {G : Type (u + 1)} [g_form : Form G] {n : } :
                  theorem MisereGames.Form.isEnd_of_not_mem {G : Type (u + 1)} [g_form : Form G] {p : Player} {g : G} (h1 : ∀ (gr : G), grmoves p g) :
                  IsEnd p g
                  instance MisereGames.Form.instCharZero {G : Type (u + 1)} [g_form : Form G] :
                  theorem MisereGames.Form.eq_sub_one_of_mem_leftMoves_intCast {G : Type (u + 1)} [g_form : Form G] {n : } {x : G} (hx : x moves Player.left n) :
                  x = ↑(n - 1)
                  theorem MisereGames.Form.eq_add_one_of_mem_rightMoves_intCast {G : Type (u + 1)} [g_form : Form G] {n : } {x : G} (hx : x moves Player.right n) :
                  x = ↑(n + 1)
                  theorem MisereGames.Form.eq_intCast_of_mem_leftMoves_intCast {G : Type (u + 1)} [g_form : Form G] {n : } {x : G} (hx : x moves Player.left n) :
                  m < n, m = x

                  Every Left option of an integer is equal to a smaller integer.

                  theorem MisereGames.Form.eq_intCast_of_mem_rightMoves_intCast {G : Type (u + 1)} [g_form : Form G] {n : } {x : G} (hx : x moves Player.right n) :
                  ∃ (m : ), n < m m = x
                  theorem MisereGames.Form.succ_nat_end_right {G : Type (u + 1)} [g_form : Form G] {p : Player} {n : } :
                  theorem MisereGames.Form.nat_forall_moves {G : Type (u + 1)} [g_form : Form G] {n : } {P : GProp} (h1 : P n) (p : Player) (gp : G) :
                  gp moves p n.succP gp

                  If P holds at n, then P holds at every option of n+1 (since n is the only such option).

                  @[simp]
                  theorem MisereGames.Form.add_eq_zero_iff {G : Type (u + 1)} [g_form : Form G] {x y : G} :
                  x + y = 0 x = 0 y = 0
                  @[implicit_reducible]
                  Equations
                  • One or more equations did not get rendered due to their size.
                  @[simp]
                  theorem MisereGames.Form.IsEnd.sub_iff {G : Type (u + 1)} [g_form : Form G] {g h : G} {p : Player} :
                  IsEnd p (g - h) IsEnd p g IsEnd (-p) h
                  theorem MisereGames.Form.mem_leftMoves_natSub_add_isEnd {G : Type (u + 1)} [g_form : Form G] {a b : } {y g' : G} (hye : IsEnd Player.left y) :
                  g' moves Player.left (a - b + y) ∃ (a' : ), a = a' + 1 g' = a' - b + y
                  theorem MisereGames.Form.mem_rightMoves_natSub_add {G : Type (u + 1)} [g_form : Form G] {a b : } {y g' : G} :
                  g' moves Player.right (a - b + y) (∃ (b' : ), b = b' + 1 g' = a - b' + y) yrmoves Player.right y, g' = a - b + yr