l3lab/ntp-mathlib huggingface dataset:
/-- If `w` has the same moves as `x` and `y` has the same moves as `z`,
then `w + y` has the same moves as `x + z`. -/
def Relabelling.addCongr : ∀ {w x y z : PGame.{u}}, w ≡r x → y ≡r z → w + y ≡r x + z
  | ⟨wl, wr, wL, wR⟩, ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩, ⟨L₁, R₁, hL₁, hR₁⟩,
    ⟨L₂, R₂, hL₂, hR₂⟩ => by
    let Hwx : ⟨wl, wr, wL, wR⟩ ≡r ⟨xl, xr, xL, xR⟩ := ⟨L₁, R₁, hL₁, hR₁⟩
    let Hyz : ⟨yl, yr, yL, yR⟩ ≡r ⟨zl, zr, zL, zR⟩ := ⟨L₂, R₂, hL₂, hR₂⟩
    refine' ⟨Equiv.sumCongr L₁ L₂, Equiv.sumCongr R₁ R₂, _, _⟩ <;> rintro (i | j)
    · exact (hL₁ i).addCongr Hyz
    · 

Proof state:
case refine'_1.inr
wl wr : Type u
wL : wl → PGame
wR : wr → PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
L₁ : LeftMoves (PGame.mk wl wr wL wR) ≃ LeftMoves (PGame.mk xl xr xL xR)
R₁ : RightMoves (PGame.mk wl wr wL wR) ≃ RightMoves (PGame.mk xl xr xL xR)
hL₁ :
  (i : LeftMoves (PGame.mk wl wr wL wR)) →
    PGame.moveLeft (PGame.mk wl wr wL wR) i ≡r PGame.moveLeft (PGame.mk xl xr xL xR) (L₁ i)
hR₁ :
  (j : RightMoves (PGame.mk wl wr wL wR)) →
    PGame.moveRight (PGame.mk wl wr wL wR) j ≡r PGame.moveRight (PGame.mk xl xr xL xR) (R₁ j)
L₂ : LeftMoves (PGame.mk yl yr yL yR) ≃ LeftMoves (PGame.mk zl zr zL zR)
R₂ : RightMoves (PGame.mk yl yr yL yR) ≃ RightMoves (PGame.mk zl zr zL zR)
hL₂ :
  (i : LeftMoves (PGame.mk yl yr yL yR)) →
    PGame.moveLeft (PGame.mk yl yr yL yR) i ≡r PGame.moveLeft (PGame.mk zl zr zL zR) (L₂ i)
hR₂ :
  (j : RightMoves (PGame.mk yl yr yL yR)) →
    PGame.moveRight (PGame.mk yl yr yL yR) j ≡r PGame.moveRight (PGame.mk zl zr zL zR) (R₂ j)
Hwx : PGame.mk wl wr wL wR ≡r PGame.mk xl xr xL xR := mk L₁ R₁ hL₁ hR₁
Hyz : PGame.mk yl yr yL yR ≡r PGame.mk zl zr zL zR := mk L₂ R₂ hL₂ hR₂
j : yl
⊢ PGame.moveLeft (PGame.mk wl wr wL wR + PGame.mk yl yr yL yR) (Sum.inr j) ≡r
    PGame.moveLeft (PGame.mk xl xr xL xR + PGame.mk zl zr zL zR) ((Equiv.sumCongr L₁ L₂) (Sum.inr j))

Next tactic:
exact Hwx.addCongr (hL₂ j)
/-- If `w` has the same moves as `x` and `y` has the same moves as `z`,
then `w + y` has the same moves as `x + z`. -/
def Relabelling.addCongr : ∀ {w x y z : PGame.{u}}, w ≡r x → y ≡r z → w + y ≡r x + z
  | ⟨wl, wr, wL, wR⟩, ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩, ⟨L₁, R₁, hL₁, hR₁⟩,
    ⟨L₂, R₂, hL₂, hR₂⟩ => by
    let Hwx : ⟨wl, wr, wL, wR⟩ ≡r ⟨xl, xr, xL, xR⟩ := ⟨L₁, R₁, hL₁, hR₁⟩
    let Hyz : ⟨yl, yr, yL, yR⟩ ≡r ⟨zl, zr, zL, zR⟩ := ⟨L₂, R₂, hL₂, hR₂⟩
    refine' ⟨Equiv.sumCongr L₁ L₂, Equiv.sumCongr R₁ R₂, _, _⟩ <;> rintro (i | j)
    · exact (hL₁ i).addCongr Hyz
    · exact Hwx.addCongr (hL₂ j)
    · 

Proof state:
case refine'_2.inl
wl wr : Type u
wL : wl → PGame
wR : wr → PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
L₁ : LeftMoves (PGame.mk wl wr wL wR) ≃ LeftMoves (PGame.mk xl xr xL xR)
R₁ : RightMoves (PGame.mk wl wr wL wR) ≃ RightMoves (PGame.mk xl xr xL xR)
hL₁ :
  (i : LeftMoves (PGame.mk wl wr wL wR)) →
    PGame.moveLeft (PGame.mk wl wr wL wR) i ≡r PGame.moveLeft (PGame.mk xl xr xL xR) (L₁ i)
hR₁ :
  (j : RightMoves (PGame.mk wl wr wL wR)) →
    PGame.moveRight (PGame.mk wl wr wL wR) j ≡r PGame.moveRight (PGame.mk xl xr xL xR) (R₁ j)
L₂ : LeftMoves (PGame.mk yl yr yL yR) ≃ LeftMoves (PGame.mk zl zr zL zR)
R₂ : RightMoves (PGame.mk yl yr yL yR) ≃ RightMoves (PGame.mk zl zr zL zR)
hL₂ :
  (i : LeftMoves (PGame.mk yl yr yL yR)) →
    PGame.moveLeft (PGame.mk yl yr yL yR) i ≡r PGame.moveLeft (PGame.mk zl zr zL zR) (L₂ i)
hR₂ :
  (j : RightMoves (PGame.mk yl yr yL yR)) →
    PGame.moveRight (PGame.mk yl yr yL yR) j ≡r PGame.moveRight (PGame.mk zl zr zL zR) (R₂ j)
Hwx : PGame.mk wl wr wL wR ≡r PGame.mk xl xr xL xR := mk L₁ R₁ hL₁ hR₁
Hyz : PGame.mk yl yr yL yR ≡r PGame.mk zl zr zL zR := mk L₂ R₂ hL₂ hR₂
i : wr
⊢ PGame.moveRight (PGame.mk wl wr wL wR + PGame.mk yl yr yL yR) (Sum.inl i) ≡r
    PGame.moveRight (PGame.mk xl xr xL xR + PGame.mk zl zr zL zR) ((Equiv.sumCongr R₁ R₂) (Sum.inl i))

Next tactic:
exact (hR₁ i).addCongr Hyz
/-- If `w` has the same moves as `x` and `y` has the same moves as `z`,
then `w + y` has the same moves as `x + z`. -/
def Relabelling.addCongr : ∀ {w x y z : PGame.{u}}, w ≡r x → y ≡r z → w + y ≡r x + z
  | ⟨wl, wr, wL, wR⟩, ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩, ⟨L₁, R₁, hL₁, hR₁⟩,
    ⟨L₂, R₂, hL₂, hR₂⟩ => by
    let Hwx : ⟨wl, wr, wL, wR⟩ ≡r ⟨xl, xr, xL, xR⟩ := ⟨L₁, R₁, hL₁, hR₁⟩
    let Hyz : ⟨yl, yr, yL, yR⟩ ≡r ⟨zl, zr, zL, zR⟩ := ⟨L₂, R₂, hL₂, hR₂⟩
    refine' ⟨Equiv.sumCongr L₁ L₂, Equiv.sumCongr R₁ R₂, _, _⟩ <;> rintro (i | j)
    · exact (hL₁ i).addCongr Hyz
    · exact Hwx.addCongr (hL₂ j)
    · exact (hR₁ i).addCongr Hyz
    · 

Proof state:
case refine'_2.inr
wl wr : Type u
wL : wl → PGame
wR : wr → PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
L₁ : LeftMoves (PGame.mk wl wr wL wR) ≃ LeftMoves (PGame.mk xl xr xL xR)
R₁ : RightMoves (PGame.mk wl wr wL wR) ≃ RightMoves (PGame.mk xl xr xL xR)
hL₁ :
  (i : LeftMoves (PGame.mk wl wr wL wR)) →
    PGame.moveLeft (PGame.mk wl wr wL wR) i ≡r PGame.moveLeft (PGame.mk xl xr xL xR) (L₁ i)
hR₁ :
  (j : RightMoves (PGame.mk wl wr wL wR)) →
    PGame.moveRight (PGame.mk wl wr wL wR) j ≡r PGame.moveRight (PGame.mk xl xr xL xR) (R₁ j)
L₂ : LeftMoves (PGame.mk yl yr yL yR) ≃ LeftMoves (PGame.mk zl zr zL zR)
R₂ : RightMoves (PGame.mk yl yr yL yR) ≃ RightMoves (PGame.mk zl zr zL zR)
hL₂ :
  (i : LeftMoves (PGame.mk yl yr yL yR)) →
    PGame.moveLeft (PGame.mk yl yr yL yR) i ≡r PGame.moveLeft (PGame.mk zl zr zL zR) (L₂ i)
hR₂ :
  (j : RightMoves (PGame.mk yl yr yL yR)) →
    PGame.moveRight (PGame.mk yl yr yL yR) j ≡r PGame.moveRight (PGame.mk zl zr zL zR) (R₂ j)
Hwx : PGame.mk wl wr wL wR ≡r PGame.mk xl xr xL xR := mk L₁ R₁ hL₁ hR₁
Hyz : PGame.mk yl yr yL yR ≡r PGame.mk zl zr zL zR := mk L₂ R₂ hL₂ hR₂
j : yr
⊢ PGame.moveRight (PGame.mk wl wr wL wR + PGame.mk yl yr yL yR) (Sum.inr j) ≡r
    PGame.moveRight (PGame.mk xl xr xL xR + PGame.mk zl zr zL zR) ((Equiv.sumCongr R₁ R₂) (Sum.inr j))

Next tactic:
exact Hwx.addCongr (hR₂ j)
@[simp]
theorem sub_zero (x : PGame) : x - 0 = x + 0 :=
  show x + -0 = x + 0 by 

Proof state:
x : PGame
⊢ x + -0 = x + 0

Next tactic:
rw [neg_zero]
/-- `-(x + y)` has exactly the same moves as `-x + -y`. -/
def negAddRelabelling : ∀ x y : PGame, -(x + y) ≡r -x + -y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
    

Proof state:
xl xr : Type ?u.158140
xL : xl → PGame
xR : xr → PGame
yl yr : Type ?u.158140
yL : yl → PGame
yR : yr → PGame
⊢ -(mk xl xr xL xR + mk yl yr yL yR) ≡r -mk xl xr xL xR + -mk yl yr yL yR

Next tactic:
refine' ⟨Equiv.refl _, Equiv.refl _, _, _⟩
/-- `-(x + y)` has exactly the same moves as `-x + -y`. -/
def negAddRelabelling : ∀ x y : PGame, -(x + y) ≡r -x + -y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
    refine' ⟨Equiv.refl _, Equiv.refl _, _, _⟩
    

Proof state:
case refine'_1
xl xr : Type ?u.158140
xL : xl → PGame
xR : xr → PGame
yl yr : Type ?u.158140
yL : yl → PGame
yR : yr → PGame
⊢ (i : LeftMoves (-(mk xl xr xL xR + mk yl yr yL yR))) →
    moveLeft (-(mk xl xr xL xR + mk yl yr yL yR)) i ≡r
      moveLeft (-mk xl xr xL xR + -mk yl yr yL yR) ((Equiv.refl (LeftMoves (-(mk xl xr xL xR + mk yl yr yL yR)))) i)
case refine'_2
xl xr : Type ?u.158140
xL : xl → PGame
xR : xr → PGame
yl yr : Type ?u.158140
yL : yl → PGame
yR : yr → PGame
⊢ (j : RightMoves (-(mk xl xr xL xR + mk yl yr yL yR))) →
    moveRight (-(mk xl xr xL xR + mk yl yr yL yR)) j ≡r
      moveRight (-mk xl xr xL xR + -mk yl yr yL yR) ((Equiv.refl (RightMoves (-(mk xl xr xL xR + mk yl yr yL yR)))) j)

Next tactic:
all_goals
      exact fun j =>
        Sum.casesOn j (fun j => negAddRelabelling _ _) fun j =>
          negAddRelabelling ⟨xl, xr, xL, xR⟩ _
/-- `-(x + y)` has exactly the same moves as `-x + -y`. -/
def negAddRelabelling : ∀ x y : PGame, -(x + y) ≡r -x + -y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
    refine' ⟨Equiv.refl _, Equiv.refl _, _, _⟩
    all_goals
      

Proof state:
case refine'_1
xl xr : Type ?u.158140
xL : xl → PGame
xR : xr → PGame
yl yr : Type ?u.158140
yL : yl → PGame
yR : yr → PGame
⊢ (i : LeftMoves (-(mk xl xr xL xR + mk yl yr yL yR))) →
    moveLeft (-(mk xl xr xL xR + mk yl yr yL yR)) i ≡r
      moveLeft (-mk xl xr xL xR + -mk yl yr yL yR) ((Equiv.refl (LeftMoves (-(mk xl xr xL xR + mk yl yr yL yR)))) i)

Next tactic:
exact fun j =>
        Sum.casesOn j (fun j => negAddRelabelling _ _) fun j =>
          negAddRelabelling ⟨xl, xr, xL, xR⟩ _
/-- `-(x + y)` has exactly the same moves as `-x + -y`. -/
def negAddRelabelling : ∀ x y : PGame, -(x + y) ≡r -x + -y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
    refine' ⟨Equiv.refl _, Equiv.refl _, _, _⟩
    all_goals
      

Proof state:
case refine'_2
xl xr : Type ?u.158887
xL : xl → PGame
xR : xr → PGame
yl yr : Type ?u.158887
yL : yl → PGame
yR : yr → PGame
⊢ (j : RightMoves (-(mk xl xr xL xR + mk yl yr yL yR))) →
    moveRight (-(mk xl xr xL xR + mk yl yr yL yR)) j ≡r
      moveRight (-mk xl xr xL xR + -mk yl yr yL yR) ((Equiv.refl (RightMoves (-(mk xl xr xL xR + mk yl yr yL yR)))) j)

Next tactic:
exact fun j =>
        Sum.casesOn j (fun j => negAddRelabelling _ _) fun j =>
          negAddRelabelling ⟨xl, xr, xL, xR⟩ _
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    

Proof state:
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ mk xl xr xL xR + mk yl yr yL yR ≡r mk yl yr yL yR + mk xl xr xL xR

Next tactic:
refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> 

Proof state:
case refine'_1
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ (i : LeftMoves (mk xl xr xL xR + mk yl yr yL yR)) →
    moveLeft (mk xl xr xL xR + mk yl yr yL yR) i ≡r moveLeft (mk yl yr yL yR + mk xl xr xL xR) ((Equiv.sumComm xl yl) i)

Next tactic:
rintro (_ | _)
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> 

Proof state:
case refine'_2
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ (j : RightMoves (mk xl xr xL xR + mk yl yr yL yR)) →
    moveRight (mk xl xr xL xR + mk yl yr yL yR) j ≡r
      moveRight (mk yl yr yL yR + mk xl xr xL xR) ((Equiv.sumComm xr yr) j)

Next tactic:
rintro (_ | _)
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (_ | _) <;>
      · 

Proof state:
case refine'_1.inl
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
val✝ : xl
⊢ moveLeft (mk xl xr xL xR + mk yl yr yL yR) (Sum.inl val✝) ≡r
    moveLeft (mk yl yr yL yR + mk xl xr xL xR) ((Equiv.sumComm xl yl) (Sum.inl val✝))

Next tactic:
dsimp [leftMoves_add, rightMoves_add]
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (_ | _) <;>
      · dsimp [leftMoves_add, rightMoves_add]
        

Proof state:
case refine'_1.inl
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
val✝ : xl
⊢ xL val✝ + mk yl yr yL yR ≡r moveLeft (mk yl yr yL yR + mk xl xr xL xR) ((Equiv.sumComm xl yl) (Sum.inl val✝))

Next tactic:
apply addCommRelabelling
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (_ | _) <;>
      · 

Proof state:
case refine'_1.inr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
val✝ : yl
⊢ moveLeft (mk xl xr xL xR + mk yl yr yL yR) (Sum.inr val✝) ≡r
    moveLeft (mk yl yr yL yR + mk xl xr xL xR) ((Equiv.sumComm xl yl) (Sum.inr val✝))

Next tactic:
dsimp [leftMoves_add, rightMoves_add]
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (_ | _) <;>
      · dsimp [leftMoves_add, rightMoves_add]
        

Proof state:
case refine'_1.inr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
val✝ : yl
⊢ mk xl xr xL xR + yL val✝ ≡r moveLeft (mk yl yr yL yR + mk xl xr xL xR) ((Equiv.sumComm xl yl) (Sum.inr val✝))

Next tactic:
apply addCommRelabelling
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (_ | _) <;>
      · 

Proof state:
case refine'_2.inl
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
val✝ : xr
⊢ moveRight (mk xl xr xL xR + mk yl yr yL yR) (Sum.inl val✝) ≡r
    moveRight (mk yl yr yL yR + mk xl xr xL xR) ((Equiv.sumComm xr yr) (Sum.inl val✝))

Next tactic:
dsimp [leftMoves_add, rightMoves_add]
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (_ | _) <;>
      · dsimp [leftMoves_add, rightMoves_add]
        

Proof state:
case refine'_2.inl
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
val✝ : xr
⊢ xR val✝ + mk yl yr yL yR ≡r moveRight (mk yl yr yL yR + mk xl xr xL xR) ((Equiv.sumComm xr yr) (Sum.inl val✝))

Next tactic:
apply addCommRelabelling
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (_ | _) <;>
      · 

Proof state:
case refine'_2.inr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
val✝ : yr
⊢ moveRight (mk xl xr xL xR + mk yl yr yL yR) (Sum.inr val✝) ≡r
    moveRight (mk yl yr yL yR + mk xl xr xL xR) ((Equiv.sumComm xr yr) (Sum.inr val✝))

Next tactic:
dsimp [leftMoves_add, rightMoves_add]
/-- `x + y` has exactly the same moves as `y + x`. -/
def addCommRelabelling : ∀ x y : PGame.{u}, x + y ≡r y + x
  | mk xl xr xL xR, mk yl yr yL yR => by
    refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (_ | _) <;>
      · dsimp [leftMoves_add, rightMoves_add]
        

Proof state:
case refine'_2.inr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
val✝ : yr
⊢ mk xl xr xL xR + yR val✝ ≡r moveRight (mk yl yr yL yR + mk xl xr xL xR) ((Equiv.sumComm xr yr) (Sum.inr val✝))

Next tactic:
apply addCommRelabelling
/-- `(x + y) + z` has exactly the same moves as `x + (y + z)`. -/
def addAssocRelabelling : ∀ x y z : PGame.{u}, x + y + z ≡r x + (y + z)
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩ => by
    

Proof state:
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
⊢ mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR ≡r mk xl xr xL xR + (mk yl yr yL yR + mk zl zr zL zR)

Next tactic:
refine' ⟨Equiv.sumAssoc _ _ _, Equiv.sumAssoc _ _ _, _, _⟩
/-- `(x + y) + z` has exactly the same moves as `x + (y + z)`. -/
def addAssocRelabelling : ∀ x y z : PGame.{u}, x + y + z ≡r x + (y + z)
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩ => by
    refine' ⟨Equiv.sumAssoc _ _ _, Equiv.sumAssoc _ _ _, _, _⟩
    · 

Proof state:
case refine'_1
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
⊢ (i : LeftMoves (mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR)) →
    moveLeft (mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR) i ≡r
      moveLeft (mk xl xr xL xR + (mk yl yr yL yR + mk zl zr zL zR)) ((Equiv.sumAssoc xl yl zl) i)

Next tactic:
rintro (⟨i | i⟩ | i)
/-- `(x + y) + z` has exactly the same moves as `x + (y + z)`. -/
def addAssocRelabelling : ∀ x y z : PGame.{u}, x + y + z ≡r x + (y + z)
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩ => by
    refine' ⟨Equiv.sumAssoc _ _ _, Equiv.sumAssoc _ _ _, _, _⟩
    · rintro (⟨i | i⟩ | i)
      · 

Proof state:
case refine'_1.inl.inl
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
i : xl
⊢ moveLeft (mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR) (Sum.inl (Sum.inl i)) ≡r
    moveLeft (mk xl xr xL xR + (mk yl yr yL yR + mk zl zr zL zR)) ((Equiv.sumAssoc xl yl zl) (Sum.inl (Sum.inl i)))

Next tactic:
apply addAssocRelabelling
/-- `(x + y) + z` has exactly the same moves as `x + (y + z)`. -/
def addAssocRelabelling : ∀ x y z : PGame.{u}, x + y + z ≡r x + (y + z)
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩ => by
    refine' ⟨Equiv.sumAssoc _ _ _, Equiv.sumAssoc _ _ _, _, _⟩
    · rintro (⟨i | i⟩ | i)
      · apply addAssocRelabelling
      · 

Proof state:
case refine'_1.inl.inr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
i : yl
⊢ moveLeft (mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR) (Sum.inl (Sum.inr i)) ≡r
    moveLeft (mk xl xr xL xR + (mk yl yr yL yR + mk zl zr zL zR)) ((Equiv.sumAssoc xl yl zl) (Sum.inl (Sum.inr i)))

Next tactic:
apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ (yL i)
/-- `(x + y) + z` has exactly the same moves as `x + (y + z)`. -/
def addAssocRelabelling : ∀ x y z : PGame.{u}, x + y + z ≡r x + (y + z)
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩ => by
    refine' ⟨Equiv.sumAssoc _ _ _, Equiv.sumAssoc _ _ _, _, _⟩
    · rintro (⟨i | i⟩ | i)
      · apply addAssocRelabelling
      · apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ (yL i)
      · 

Proof state:
case refine'_1.inr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
i : zl
⊢ moveLeft (mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR) (Sum.inr i) ≡r
    moveLeft (mk xl xr xL xR + (mk yl yr yL yR + mk zl zr zL zR)) ((Equiv.sumAssoc xl yl zl) (Sum.inr i))

Next tactic:
apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ ⟨yl, yr, yL, yR⟩ (zL i)
/-- `(x + y) + z` has exactly the same moves as `x + (y + z)`. -/
def addAssocRelabelling : ∀ x y z : PGame.{u}, x + y + z ≡r x + (y + z)
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩ => by
    refine' ⟨Equiv.sumAssoc _ _ _, Equiv.sumAssoc _ _ _, _, _⟩
    · rintro (⟨i | i⟩ | i)
      · apply addAssocRelabelling
      · apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ (yL i)
      · apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ ⟨yl, yr, yL, yR⟩ (zL i)
    · 

Proof state:
case refine'_2
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
⊢ (j : RightMoves (mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR)) →
    moveRight (mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR) j ≡r
      moveRight (mk xl xr xL xR + (mk yl yr yL yR + mk zl zr zL zR)) ((Equiv.sumAssoc xr yr zr) j)

Next tactic:
rintro (⟨i | i⟩ | i)
/-- `(x + y) + z` has exactly the same moves as `x + (y + z)`. -/
def addAssocRelabelling : ∀ x y z : PGame.{u}, x + y + z ≡r x + (y + z)
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩ => by
    refine' ⟨Equiv.sumAssoc _ _ _, Equiv.sumAssoc _ _ _, _, _⟩
    · rintro (⟨i | i⟩ | i)
      · apply addAssocRelabelling
      · apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ (yL i)
      · apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ ⟨yl, yr, yL, yR⟩ (zL i)
    · rintro (⟨i | i⟩ | i)
      · 

Proof state:
case refine'_2.inl.inl
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
i : xr
⊢ moveRight (mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR) (Sum.inl (Sum.inl i)) ≡r
    moveRight (mk xl xr xL xR + (mk yl yr yL yR + mk zl zr zL zR)) ((Equiv.sumAssoc xr yr zr) (Sum.inl (Sum.inl i)))

Next tactic:
apply addAssocRelabelling
/-- `(x + y) + z` has exactly the same moves as `x + (y + z)`. -/
def addAssocRelabelling : ∀ x y z : PGame.{u}, x + y + z ≡r x + (y + z)
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩ => by
    refine' ⟨Equiv.sumAssoc _ _ _, Equiv.sumAssoc _ _ _, _, _⟩
    · rintro (⟨i | i⟩ | i)
      · apply addAssocRelabelling
      · apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ (yL i)
      · apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ ⟨yl, yr, yL, yR⟩ (zL i)
    · rintro (⟨i | i⟩ | i)
      · apply addAssocRelabelling
      · 

Proof state:
case refine'_2.inl.inr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
i : yr
⊢ moveRight (mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR) (Sum.inl (Sum.inr i)) ≡r
    moveRight (mk xl xr xL xR + (mk yl yr yL yR + mk zl zr zL zR)) ((Equiv.sumAssoc xr yr zr) (Sum.inl (Sum.inr i)))

Next tactic:
apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ (yR i)
/-- `(x + y) + z` has exactly the same moves as `x + (y + z)`. -/
def addAssocRelabelling : ∀ x y z : PGame.{u}, x + y + z ≡r x + (y + z)
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ⟨zl, zr, zL, zR⟩ => by
    refine' ⟨Equiv.sumAssoc _ _ _, Equiv.sumAssoc _ _ _, _, _⟩
    · rintro (⟨i | i⟩ | i)
      · apply addAssocRelabelling
      · apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ (yL i)
      · apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ ⟨yl, yr, yL, yR⟩ (zL i)
    · rintro (⟨i | i⟩ | i)
      · apply addAssocRelabelling
      · apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ (yR i)
      · 

Proof state:
case refine'_2.inr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
zl zr : Type u
zL : zl → PGame
zR : zr → PGame
i : zr
⊢ moveRight (mk xl xr xL xR + mk yl yr yL yR + mk zl zr zL zR) (Sum.inr i) ≡r
    moveRight (mk xl xr xL xR + (mk yl yr yL yR + mk zl zr zL zR)) ((Equiv.sumAssoc xr yr zr) (Sum.inr i))

Next tactic:
apply addAssocRelabelling ⟨xl, xr, xL, xR⟩ ⟨yl, yr, yL, yR⟩ (zR i)
theorem add_left_neg_le_zero : ∀ x : PGame, -x + x ≤ 0
  | ⟨xl, xr, xL, xR⟩ =>
    le_zero.2 fun i => by
      

Proof state:
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
i : LeftMoves (-mk xl xr xL xR + mk xl xr xL xR)
⊢ ∃ j, moveRight (moveLeft (-mk xl xr xL xR + mk xl xr xL xR) i) j ≤ 0

Next tactic:
cases' i with i i
theorem add_left_neg_le_zero : ∀ x : PGame, -x + x ≤ 0
  | ⟨xl, xr, xL, xR⟩ =>
    le_zero.2 fun i => by
      cases' i with i i
      · -- If Left played in -x, Right responds with the same move in x.
        

Proof state:
case inl
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
i : xr
⊢ ∃ j, moveRight (moveLeft (-mk xl xr xL xR + mk xl xr xL xR) (Sum.inl i)) j ≤ 0

Next tactic:
refine' ⟨@toRightMovesAdd _ ⟨_, _, _, _⟩ (Sum.inr i), _⟩
theorem add_left_neg_le_zero : ∀ x : PGame, -x + x ≤ 0
  | ⟨xl, xr, xL, xR⟩ =>
    le_zero.2 fun i => by
      cases' i with i i
      · -- If Left played in -x, Right responds with the same move in x.
        refine' ⟨@toRightMovesAdd _ ⟨_, _, _, _⟩ (Sum.inr i), _⟩
        

Proof state:
case inl
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
i : xr
⊢ moveRight (moveLeft (-mk xl xr xL xR + mk xl xr xL xR) (Sum.inl i)) (toRightMovesAdd (Sum.inr i)) ≤ 0

Next tactic:
convert @add_left_neg_le_zero (xR i)