set_theory.game.basicMathlib.SetTheory.Game.Basic

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

feat(set_theory/game/pgame): small sets of pre-games / games / surreals are bounded (#15260)
Diff
@@ -128,6 +128,16 @@ instance ordered_add_comm_group : ordered_add_comm_group game :=
   ..game.add_comm_group_with_one,
   ..game.partial_order }
 
+/-- A small set `s` of games is bounded above. -/
+lemma bdd_above_of_small (s : set game.{u}) [small.{u} s] : bdd_above s :=
+⟨_, λ i hi, by simpa using pgame.le_iff_game_le.1
+  (upper_bound_mem_upper_bounds _ (set.mem_image_of_mem quotient.out hi))⟩
+
+/-- A small set `s` of games is bounded below. -/
+lemma bdd_below_of_small (s : set game.{u}) [small.{u} s] : bdd_below s :=
+⟨_, λ i hi, by simpa using pgame.le_iff_game_le.1
+  (lower_bound_mem_lower_bounds _ (set.mem_image_of_mem quotient.out hi))⟩
+
 end game
 
 namespace pgame

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Scott Morrison, Apurva Nakade
 -/
-import SetTheory.Game.Pgame
+import SetTheory.Game.PGame
 import Tactic.Abel
 
 #align_import set_theory.game.basic from "leanprover-community/mathlib"@"8900d545017cd21961daa2a1734bb658ef52c618"
Diff
@@ -198,6 +198,7 @@ instance SetTheory.Game.orderedAddCommGroup : OrderedAddCommGroup SetTheory.Game
 #align game.ordered_add_comm_group SetTheory.Game.orderedAddCommGroup
 -/
 
+#print SetTheory.Game.bddAbove_of_small /-
 /-- A small set `s` of games is bounded above. -/
 theorem SetTheory.Game.bddAbove_of_small (s : Set SetTheory.Game.{u}) [Small.{u} s] : BddAbove s :=
   ⟨_, fun i hi => by
@@ -205,7 +206,9 @@ theorem SetTheory.Game.bddAbove_of_small (s : Set SetTheory.Game.{u}) [Small.{u}
       SetTheory.PGame.le_iff_game_le.1
         (upper_bound_mem_upper_bounds _ (Set.mem_image_of_mem Quotient.out hi))⟩
 #align game.bdd_above_of_small SetTheory.Game.bddAbove_of_small
+-/
 
+#print SetTheory.Game.bddBelow_of_small /-
 /-- A small set `s` of games is bounded below. -/
 theorem SetTheory.Game.bddBelow_of_small (s : Set SetTheory.Game.{u}) [Small.{u} s] : BddBelow s :=
   ⟨_, fun i hi => by
@@ -213,6 +216,7 @@ theorem SetTheory.Game.bddBelow_of_small (s : Set SetTheory.Game.{u}) [Small.{u}
       SetTheory.PGame.le_iff_game_le.1
         (lower_bound_mem_lower_bounds _ (Set.mem_image_of_mem Quotient.out hi))⟩
 #align game.bdd_below_of_small SetTheory.Game.bddBelow_of_small
+-/
 
 end SetTheory.Game
 
@@ -244,7 +248,7 @@ theorem SetTheory.PGame.quot_eq_of_mk'_quot_eq {x y : SetTheory.PGame}
     (L : x.LeftMoves ≃ y.LeftMoves) (R : x.RightMoves ≃ y.RightMoves)
     (hl : ∀ i, ⟦x.moveLeft i⟧ = ⟦y.moveLeft (L i)⟧)
     (hr : ∀ j, ⟦x.moveRight j⟧ = ⟦y.moveRight (R j)⟧) : ⟦x⟧ = ⟦y⟧ := by
-  simp_rw [Quotient.eq'] at hl hr ; exact Quot.sound (equiv_of_mk_equiv L R hl hr)
+  simp_rw [Quotient.eq'] at hl hr; exact Quot.sound (equiv_of_mk_equiv L R hl hr)
 #align pgame.quot_eq_of_mk_quot_eq SetTheory.PGame.quot_eq_of_mk'_quot_eq
 -/
 
Diff
@@ -945,14 +945,14 @@ theorem SetTheory.PGame.inv'_one_equiv : SetTheory.PGame.inv' 1 ≈ 1 :=
 
 /-- The inverse of a pre-game in terms of the inverse on positive pre-games. -/
 noncomputable instance : Inv SetTheory.PGame :=
-  ⟨by classical⟩
+  ⟨by classical exact fun x => if x ≈ 0 then 0 else if 0 < x then inv' x else -inv' (-x)⟩
 
 noncomputable instance : Div SetTheory.PGame :=
   ⟨fun x y => x * y⁻¹⟩
 
 #print SetTheory.PGame.inv_eq_of_equiv_zero /-
 theorem SetTheory.PGame.inv_eq_of_equiv_zero {x : SetTheory.PGame} (h : x ≈ 0) : x⁻¹ = 0 := by
-  classical
+  classical exact if_pos h
 #align pgame.inv_eq_of_equiv_zero SetTheory.PGame.inv_eq_of_equiv_zero
 -/
 
@@ -965,13 +965,14 @@ theorem SetTheory.PGame.inv_zero : (0 : SetTheory.PGame)⁻¹ = 0 :=
 
 #print SetTheory.PGame.inv_eq_of_pos /-
 theorem SetTheory.PGame.inv_eq_of_pos {x : SetTheory.PGame} (h : 0 < x) :
-    x⁻¹ = SetTheory.PGame.inv' x := by classical
+    x⁻¹ = SetTheory.PGame.inv' x := by classical exact (if_neg h.lf.not_equiv').trans (if_pos h)
 #align pgame.inv_eq_of_pos SetTheory.PGame.inv_eq_of_pos
 -/
 
 #print SetTheory.PGame.inv_eq_of_lf_zero /-
 theorem SetTheory.PGame.inv_eq_of_lf_zero {x : SetTheory.PGame} (h : x ⧏ 0) :
-    x⁻¹ = -SetTheory.PGame.inv' (-x) := by classical
+    x⁻¹ = -SetTheory.PGame.inv' (-x) := by
+  classical exact (if_neg h.not_equiv).trans (if_neg h.not_gt)
 #align pgame.inv_eq_of_lf_zero SetTheory.PGame.inv_eq_of_lf_zero
 -/
 
Diff
@@ -945,14 +945,14 @@ theorem SetTheory.PGame.inv'_one_equiv : SetTheory.PGame.inv' 1 ≈ 1 :=
 
 /-- The inverse of a pre-game in terms of the inverse on positive pre-games. -/
 noncomputable instance : Inv SetTheory.PGame :=
-  ⟨by classical exact fun x => if x ≈ 0 then 0 else if 0 < x then inv' x else -inv' (-x)⟩
+  ⟨by classical⟩
 
 noncomputable instance : Div SetTheory.PGame :=
   ⟨fun x y => x * y⁻¹⟩
 
 #print SetTheory.PGame.inv_eq_of_equiv_zero /-
 theorem SetTheory.PGame.inv_eq_of_equiv_zero {x : SetTheory.PGame} (h : x ≈ 0) : x⁻¹ = 0 := by
-  classical exact if_pos h
+  classical
 #align pgame.inv_eq_of_equiv_zero SetTheory.PGame.inv_eq_of_equiv_zero
 -/
 
@@ -965,14 +965,13 @@ theorem SetTheory.PGame.inv_zero : (0 : SetTheory.PGame)⁻¹ = 0 :=
 
 #print SetTheory.PGame.inv_eq_of_pos /-
 theorem SetTheory.PGame.inv_eq_of_pos {x : SetTheory.PGame} (h : 0 < x) :
-    x⁻¹ = SetTheory.PGame.inv' x := by classical exact (if_neg h.lf.not_equiv').trans (if_pos h)
+    x⁻¹ = SetTheory.PGame.inv' x := by classical
 #align pgame.inv_eq_of_pos SetTheory.PGame.inv_eq_of_pos
 -/
 
 #print SetTheory.PGame.inv_eq_of_lf_zero /-
 theorem SetTheory.PGame.inv_eq_of_lf_zero {x : SetTheory.PGame} (h : x ⧏ 0) :
-    x⁻¹ = -SetTheory.PGame.inv' (-x) := by
-  classical exact (if_neg h.not_equiv).trans (if_neg h.not_gt)
+    x⁻¹ = -SetTheory.PGame.inv' (-x) := by classical
 #align pgame.inv_eq_of_lf_zero SetTheory.PGame.inv_eq_of_lf_zero
 -/
 
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Scott Morrison, Apurva Nakade
 -/
-import Mathbin.SetTheory.Game.Pgame
-import Mathbin.Tactic.Abel
+import SetTheory.Game.Pgame
+import Tactic.Abel
 
 #align_import set_theory.game.basic from "leanprover-community/mathlib"@"8900d545017cd21961daa2a1734bb658ef52c618"
 
Diff
@@ -82,17 +82,17 @@ instance : PartialOrder SetTheory.Game
   lt := Quotient.lift₂ (· < ·) fun x₁ y₁ x₂ y₂ hx hy => propext (SetTheory.PGame.lt_congr hx hy)
   lt_iff_le_not_le := by rintro ⟨x⟩ ⟨y⟩; exact @lt_iff_le_not_le _ _ x y
 
-#print SetTheory.Game.Lf /-
+#print SetTheory.Game.LF /-
 /-- The less or fuzzy relation on games.
 
 If `0 ⧏ x` (less or fuzzy with), then Left can win `x` as the first player. -/
-def SetTheory.Game.Lf : SetTheory.Game → SetTheory.Game → Prop :=
-  Quotient.lift₂ SetTheory.PGame.Lf fun x₁ y₁ x₂ y₂ hx hy =>
+def SetTheory.Game.LF : SetTheory.Game → SetTheory.Game → Prop :=
+  Quotient.lift₂ SetTheory.PGame.LF fun x₁ y₁ x₂ y₂ hx hy =>
     propext (SetTheory.PGame.lf_congr hx hy)
-#align game.lf SetTheory.Game.Lf
+#align game.lf SetTheory.Game.LF
 -/
 
-local infixl:50 " ⧏ " => SetTheory.Game.Lf
+local infixl:50 " ⧏ " => SetTheory.Game.LF
 
 #print SetTheory.Game.not_le /-
 /-- On `game`, simp-normal inequalities should use as few negations as possible. -/
@@ -121,10 +121,10 @@ theorem SetTheory.PGame.le_iff_game_le {x y : SetTheory.PGame} : x ≤ y ↔ ⟦
   Iff.rfl
 #align pgame.le_iff_game_le SetTheory.PGame.le_iff_game_le
 
-theorem SetTheory.PGame.lf_iff_game_lf {x y : SetTheory.PGame} :
-    SetTheory.PGame.Lf x y ↔ ⟦x⟧ ⧏ ⟦y⟧ :=
+theorem SetTheory.PGame.lF_iff_game_lF {x y : SetTheory.PGame} :
+    SetTheory.PGame.LF x y ↔ ⟦x⟧ ⧏ ⟦y⟧ :=
   Iff.rfl
-#align pgame.lf_iff_game_lf SetTheory.PGame.lf_iff_game_lf
+#align pgame.lf_iff_game_lf SetTheory.PGame.lF_iff_game_lF
 
 theorem SetTheory.PGame.lt_iff_game_lt {x y : SetTheory.PGame} : x < y ↔ ⟦x⟧ < ⟦y⟧ :=
   Iff.rfl
Diff
@@ -27,19 +27,19 @@ the abelian group structure on games allows us to simplify many proofs for pre-g
 -/
 
 
-open Function PGame
+open Function SetTheory.PGame
 
-open scoped PGame
+open scoped SetTheory.PGame
 
 universe u
 
-#print PGame.setoid /-
-instance PGame.setoid : Setoid PGame :=
-  ⟨(· ≈ ·), equiv_refl, @PGame.Equiv.symm, @PGame.Equiv.trans⟩
-#align pgame.setoid PGame.setoid
+#print SetTheory.PGame.setoid /-
+instance SetTheory.PGame.setoid : Setoid SetTheory.PGame :=
+  ⟨(· ≈ ·), SetTheory.PGame.equiv_refl, @SetTheory.PGame.Equiv.symm, @SetTheory.PGame.Equiv.trans⟩
+#align pgame.setoid SetTheory.PGame.setoid
 -/
 
-#print Game /-
+#print SetTheory.Game /-
 /-- The type of combinatorial games. In ZFC, a combinatorial game is constructed from
   two sets of combinatorial games that have been constructed at an earlier
   stage. To do this in type theory, we say that a combinatorial pre-game is built
@@ -48,191 +48,204 @@ instance PGame.setoid : Setoid PGame :=
   reflecting that it is a proper class in ZFC.
   A combinatorial game is then constructed by quotienting by the equivalence
   `x ≈ y ↔ x ≤ y ∧ y ≤ x`. -/
-abbrev Game :=
-  Quotient PGame.setoid
-#align game Game
+abbrev SetTheory.Game :=
+  Quotient SetTheory.PGame.setoid
+#align game SetTheory.Game
 -/
 
-namespace Game
+namespace SetTheory.Game
 
-instance : AddCommGroupWithOne Game where
+instance : AddCommGroupWithOne SetTheory.Game
+    where
   zero := ⟦0⟧
   one := ⟦1⟧
-  neg := Quot.lift (fun x => ⟦-x⟧) fun x y h => Quot.sound ((@neg_equiv_neg_iff x y).2 h)
+  neg :=
+    Quot.lift (fun x => ⟦-x⟧) fun x y h => Quot.sound ((@SetTheory.PGame.neg_equiv_neg_iff x y).2 h)
   add :=
-    Quotient.lift₂ (fun x y : PGame => ⟦x + y⟧) fun x₁ y₁ x₂ y₂ hx hy =>
-      Quot.sound (PGame.add_congr hx hy)
+    Quotient.lift₂ (fun x y : SetTheory.PGame => ⟦x + y⟧) fun x₁ y₁ x₂ y₂ hx hy =>
+      Quot.sound (SetTheory.PGame.add_congr hx hy)
   add_zero := by rintro ⟨x⟩; exact Quot.sound (add_zero_equiv x)
   zero_add := by rintro ⟨x⟩; exact Quot.sound (zero_add_equiv x)
   add_assoc := by rintro ⟨x⟩ ⟨y⟩ ⟨z⟩; exact Quot.sound add_assoc_equiv
   add_left_neg := by rintro ⟨x⟩; exact Quot.sound (add_left_neg_equiv x)
   add_comm := by rintro ⟨x⟩ ⟨y⟩; exact Quot.sound add_comm_equiv
 
-instance : Inhabited Game :=
+instance : Inhabited SetTheory.Game :=
   ⟨0⟩
 
-instance : PartialOrder Game
+instance : PartialOrder SetTheory.Game
     where
-  le := Quotient.lift₂ (· ≤ ·) fun x₁ y₁ x₂ y₂ hx hy => propext (le_congr hx hy)
+  le := Quotient.lift₂ (· ≤ ·) fun x₁ y₁ x₂ y₂ hx hy => propext (SetTheory.PGame.le_congr hx hy)
   le_refl := by rintro ⟨x⟩; exact le_refl x
   le_trans := by rintro ⟨x⟩ ⟨y⟩ ⟨z⟩; exact @le_trans _ _ x y z
   le_antisymm := by rintro ⟨x⟩ ⟨y⟩ h₁ h₂; apply Quot.sound; exact ⟨h₁, h₂⟩
-  lt := Quotient.lift₂ (· < ·) fun x₁ y₁ x₂ y₂ hx hy => propext (lt_congr hx hy)
+  lt := Quotient.lift₂ (· < ·) fun x₁ y₁ x₂ y₂ hx hy => propext (SetTheory.PGame.lt_congr hx hy)
   lt_iff_le_not_le := by rintro ⟨x⟩ ⟨y⟩; exact @lt_iff_le_not_le _ _ x y
 
-#print Game.Lf /-
+#print SetTheory.Game.Lf /-
 /-- The less or fuzzy relation on games.
 
 If `0 ⧏ x` (less or fuzzy with), then Left can win `x` as the first player. -/
-def Lf : Game → Game → Prop :=
-  Quotient.lift₂ Lf fun x₁ y₁ x₂ y₂ hx hy => propext (lf_congr hx hy)
-#align game.lf Game.Lf
+def SetTheory.Game.Lf : SetTheory.Game → SetTheory.Game → Prop :=
+  Quotient.lift₂ SetTheory.PGame.Lf fun x₁ y₁ x₂ y₂ hx hy =>
+    propext (SetTheory.PGame.lf_congr hx hy)
+#align game.lf SetTheory.Game.Lf
 -/
 
-local infixl:50 " ⧏ " => Lf
+local infixl:50 " ⧏ " => SetTheory.Game.Lf
 
-#print Game.not_le /-
+#print SetTheory.Game.not_le /-
 /-- On `game`, simp-normal inequalities should use as few negations as possible. -/
 @[simp]
-theorem not_le : ∀ {x y : Game}, ¬x ≤ y ↔ y ⧏ x := by rintro ⟨x⟩ ⟨y⟩; exact PGame.not_le
-#align game.not_le Game.not_le
+theorem SetTheory.Game.not_le : ∀ {x y : SetTheory.Game}, ¬x ≤ y ↔ y ⧏ x := by rintro ⟨x⟩ ⟨y⟩;
+  exact SetTheory.PGame.not_le
+#align game.not_le SetTheory.Game.not_le
 -/
 
-#print Game.not_lf /-
+#print SetTheory.Game.not_lf /-
 /-- On `game`, simp-normal inequalities should use as few negations as possible. -/
 @[simp]
-theorem not_lf : ∀ {x y : Game}, ¬x ⧏ y ↔ y ≤ x := by rintro ⟨x⟩ ⟨y⟩; exact not_lf
-#align game.not_lf Game.not_lf
+theorem SetTheory.Game.not_lf : ∀ {x y : SetTheory.Game}, ¬x ⧏ y ↔ y ≤ x := by rintro ⟨x⟩ ⟨y⟩;
+  exact not_lf
+#align game.not_lf SetTheory.Game.not_lf
 -/
 
-instance : IsTrichotomous Game (· ⧏ ·) :=
+instance : IsTrichotomous SetTheory.Game (· ⧏ ·) :=
   ⟨by rintro ⟨x⟩ ⟨y⟩; change _ ∨ ⟦x⟧ = ⟦y⟧ ∨ _; rw [Quotient.eq']; apply lf_or_equiv_or_gf⟩
 
 /-! It can be useful to use these lemmas to turn `pgame` inequalities into `game` inequalities, as
 the `add_comm_group` structure on `game` often simplifies many proofs. -/
 
 
-theorem PGame.le_iff_game_le {x y : PGame} : x ≤ y ↔ ⟦x⟧ ≤ ⟦y⟧ :=
+theorem SetTheory.PGame.le_iff_game_le {x y : SetTheory.PGame} : x ≤ y ↔ ⟦x⟧ ≤ ⟦y⟧ :=
   Iff.rfl
-#align pgame.le_iff_game_le PGame.le_iff_game_le
+#align pgame.le_iff_game_le SetTheory.PGame.le_iff_game_le
 
-theorem PGame.lf_iff_game_lf {x y : PGame} : PGame.Lf x y ↔ ⟦x⟧ ⧏ ⟦y⟧ :=
+theorem SetTheory.PGame.lf_iff_game_lf {x y : SetTheory.PGame} :
+    SetTheory.PGame.Lf x y ↔ ⟦x⟧ ⧏ ⟦y⟧ :=
   Iff.rfl
-#align pgame.lf_iff_game_lf PGame.lf_iff_game_lf
+#align pgame.lf_iff_game_lf SetTheory.PGame.lf_iff_game_lf
 
-theorem PGame.lt_iff_game_lt {x y : PGame} : x < y ↔ ⟦x⟧ < ⟦y⟧ :=
+theorem SetTheory.PGame.lt_iff_game_lt {x y : SetTheory.PGame} : x < y ↔ ⟦x⟧ < ⟦y⟧ :=
   Iff.rfl
-#align pgame.lt_iff_game_lt PGame.lt_iff_game_lt
+#align pgame.lt_iff_game_lt SetTheory.PGame.lt_iff_game_lt
 
-theorem PGame.equiv_iff_game_eq {x y : PGame} : (x ≈ y) ↔ ⟦x⟧ = ⟦y⟧ :=
+theorem SetTheory.PGame.equiv_iff_game_eq {x y : SetTheory.PGame} : (x ≈ y) ↔ ⟦x⟧ = ⟦y⟧ :=
   (@Quotient.eq' _ _ x y).symm
-#align pgame.equiv_iff_game_eq PGame.equiv_iff_game_eq
+#align pgame.equiv_iff_game_eq SetTheory.PGame.equiv_iff_game_eq
 
-#print Game.Fuzzy /-
+#print SetTheory.Game.Fuzzy /-
 /-- The fuzzy, confused, or incomparable relation on games.
 
 If `x ‖ 0`, then the first player can always win `x`. -/
-def Fuzzy : Game → Game → Prop :=
-  Quotient.lift₂ Fuzzy fun x₁ y₁ x₂ y₂ hx hy => propext (fuzzy_congr hx hy)
-#align game.fuzzy Game.Fuzzy
+def SetTheory.Game.Fuzzy : SetTheory.Game → SetTheory.Game → Prop :=
+  Quotient.lift₂ SetTheory.PGame.Fuzzy fun x₁ y₁ x₂ y₂ hx hy =>
+    propext (SetTheory.PGame.fuzzy_congr hx hy)
+#align game.fuzzy SetTheory.Game.Fuzzy
 -/
 
-local infixl:50 " ‖ " => Fuzzy
+local infixl:50 " ‖ " => SetTheory.Game.Fuzzy
 
-theorem PGame.fuzzy_iff_game_fuzzy {x y : PGame} : PGame.Fuzzy x y ↔ ⟦x⟧ ‖ ⟦y⟧ :=
+theorem SetTheory.PGame.fuzzy_iff_game_fuzzy {x y : SetTheory.PGame} :
+    SetTheory.PGame.Fuzzy x y ↔ ⟦x⟧ ‖ ⟦y⟧ :=
   Iff.rfl
-#align pgame.fuzzy_iff_game_fuzzy PGame.fuzzy_iff_game_fuzzy
+#align pgame.fuzzy_iff_game_fuzzy SetTheory.PGame.fuzzy_iff_game_fuzzy
 
-#print Game.covariantClass_add_le /-
-instance covariantClass_add_le : CovariantClass Game Game (· + ·) (· ≤ ·) :=
+#print SetTheory.Game.covariantClass_add_le /-
+instance SetTheory.Game.covariantClass_add_le :
+    CovariantClass SetTheory.Game SetTheory.Game (· + ·) (· ≤ ·) :=
   ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_le_add_left _ _ _ _ b c h a⟩
-#align game.covariant_class_add_le Game.covariantClass_add_le
+#align game.covariant_class_add_le SetTheory.Game.covariantClass_add_le
 -/
 
-#print Game.covariantClass_swap_add_le /-
-instance covariantClass_swap_add_le : CovariantClass Game Game (swap (· + ·)) (· ≤ ·) :=
+#print SetTheory.Game.covariantClass_swap_add_le /-
+instance SetTheory.Game.covariantClass_swap_add_le :
+    CovariantClass SetTheory.Game SetTheory.Game (swap (· + ·)) (· ≤ ·) :=
   ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_le_add_right _ _ _ _ b c h a⟩
-#align game.covariant_class_swap_add_le Game.covariantClass_swap_add_le
+#align game.covariant_class_swap_add_le SetTheory.Game.covariantClass_swap_add_le
 -/
 
-#print Game.covariantClass_add_lt /-
-instance covariantClass_add_lt : CovariantClass Game Game (· + ·) (· < ·) :=
+#print SetTheory.Game.covariantClass_add_lt /-
+instance SetTheory.Game.covariantClass_add_lt :
+    CovariantClass SetTheory.Game SetTheory.Game (· + ·) (· < ·) :=
   ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_lt_add_left _ _ _ _ b c h a⟩
-#align game.covariant_class_add_lt Game.covariantClass_add_lt
+#align game.covariant_class_add_lt SetTheory.Game.covariantClass_add_lt
 -/
 
-#print Game.covariantClass_swap_add_lt /-
-instance covariantClass_swap_add_lt : CovariantClass Game Game (swap (· + ·)) (· < ·) :=
+#print SetTheory.Game.covariantClass_swap_add_lt /-
+instance SetTheory.Game.covariantClass_swap_add_lt :
+    CovariantClass SetTheory.Game SetTheory.Game (swap (· + ·)) (· < ·) :=
   ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_lt_add_right _ _ _ _ b c h a⟩
-#align game.covariant_class_swap_add_lt Game.covariantClass_swap_add_lt
+#align game.covariant_class_swap_add_lt SetTheory.Game.covariantClass_swap_add_lt
 -/
 
-#print Game.add_lf_add_right /-
-theorem add_lf_add_right : ∀ {b c : Game} (h : b ⧏ c) (a), b + a ⧏ c + a := by rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩;
-  apply add_lf_add_right h
-#align game.add_lf_add_right Game.add_lf_add_right
+#print SetTheory.Game.add_lf_add_right /-
+theorem SetTheory.Game.add_lf_add_right : ∀ {b c : SetTheory.Game} (h : b ⧏ c) (a), b + a ⧏ c + a :=
+  by rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩; apply add_lf_add_right h
+#align game.add_lf_add_right SetTheory.Game.add_lf_add_right
 -/
 
-#print Game.add_lf_add_left /-
-theorem add_lf_add_left : ∀ {b c : Game} (h : b ⧏ c) (a), a + b ⧏ a + c := by rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩;
-  apply add_lf_add_left h
-#align game.add_lf_add_left Game.add_lf_add_left
+#print SetTheory.Game.add_lf_add_left /-
+theorem SetTheory.Game.add_lf_add_left : ∀ {b c : SetTheory.Game} (h : b ⧏ c) (a), a + b ⧏ a + c :=
+  by rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩; apply add_lf_add_left h
+#align game.add_lf_add_left SetTheory.Game.add_lf_add_left
 -/
 
-#print Game.orderedAddCommGroup /-
-instance orderedAddCommGroup : OrderedAddCommGroup Game :=
-  { Game.addCommGroupWithOne, Game.partialOrder with
-    add_le_add_left := @add_le_add_left _ _ _ Game.covariantClass_add_le }
-#align game.ordered_add_comm_group Game.orderedAddCommGroup
+#print SetTheory.Game.orderedAddCommGroup /-
+instance SetTheory.Game.orderedAddCommGroup : OrderedAddCommGroup SetTheory.Game :=
+  { SetTheory.Game.addCommGroupWithOne, SetTheory.Game.partialOrder with
+    add_le_add_left := @add_le_add_left _ _ _ SetTheory.Game.covariantClass_add_le }
+#align game.ordered_add_comm_group SetTheory.Game.orderedAddCommGroup
 -/
 
 /-- A small set `s` of games is bounded above. -/
-theorem bddAbove_of_small (s : Set Game.{u}) [Small.{u} s] : BddAbove s :=
+theorem SetTheory.Game.bddAbove_of_small (s : Set SetTheory.Game.{u}) [Small.{u} s] : BddAbove s :=
   ⟨_, fun i hi => by
     simpa using
-      PGame.le_iff_game_le.1
+      SetTheory.PGame.le_iff_game_le.1
         (upper_bound_mem_upper_bounds _ (Set.mem_image_of_mem Quotient.out hi))⟩
-#align game.bdd_above_of_small Game.bddAbove_of_small
+#align game.bdd_above_of_small SetTheory.Game.bddAbove_of_small
 
 /-- A small set `s` of games is bounded below. -/
-theorem bddBelow_of_small (s : Set Game.{u}) [Small.{u} s] : BddBelow s :=
+theorem SetTheory.Game.bddBelow_of_small (s : Set SetTheory.Game.{u}) [Small.{u} s] : BddBelow s :=
   ⟨_, fun i hi => by
     simpa using
-      PGame.le_iff_game_le.1
+      SetTheory.PGame.le_iff_game_le.1
         (lower_bound_mem_lower_bounds _ (Set.mem_image_of_mem Quotient.out hi))⟩
-#align game.bdd_below_of_small Game.bddBelow_of_small
+#align game.bdd_below_of_small SetTheory.Game.bddBelow_of_small
 
-end Game
+end SetTheory.Game
 
-namespace PGame
+namespace SetTheory.PGame
 
-#print PGame.quot_neg /-
+#print SetTheory.PGame.quot_neg /-
 @[simp]
-theorem quot_neg (a : PGame) : ⟦-a⟧ = -⟦a⟧ :=
+theorem SetTheory.PGame.quot_neg (a : SetTheory.PGame) : ⟦-a⟧ = -⟦a⟧ :=
   rfl
-#align pgame.quot_neg PGame.quot_neg
+#align pgame.quot_neg SetTheory.PGame.quot_neg
 -/
 
-#print PGame.quot_add /-
+#print SetTheory.PGame.quot_add /-
 @[simp]
-theorem quot_add (a b : PGame) : ⟦a + b⟧ = ⟦a⟧ + ⟦b⟧ :=
+theorem SetTheory.PGame.quot_add (a b : SetTheory.PGame) : ⟦a + b⟧ = ⟦a⟧ + ⟦b⟧ :=
   rfl
-#align pgame.quot_add PGame.quot_add
+#align pgame.quot_add SetTheory.PGame.quot_add
 -/
 
-#print PGame.quot_sub /-
+#print SetTheory.PGame.quot_sub /-
 @[simp]
-theorem quot_sub (a b : PGame) : ⟦a - b⟧ = ⟦a⟧ - ⟦b⟧ :=
+theorem SetTheory.PGame.quot_sub (a b : SetTheory.PGame) : ⟦a - b⟧ = ⟦a⟧ - ⟦b⟧ :=
   rfl
-#align pgame.quot_sub PGame.quot_sub
+#align pgame.quot_sub SetTheory.PGame.quot_sub
 -/
 
-#print PGame.quot_eq_of_mk'_quot_eq /-
-theorem quot_eq_of_mk'_quot_eq {x y : PGame} (L : x.LeftMoves ≃ y.LeftMoves)
-    (R : x.RightMoves ≃ y.RightMoves) (hl : ∀ i, ⟦x.moveLeft i⟧ = ⟦y.moveLeft (L i)⟧)
+#print SetTheory.PGame.quot_eq_of_mk'_quot_eq /-
+theorem SetTheory.PGame.quot_eq_of_mk'_quot_eq {x y : SetTheory.PGame}
+    (L : x.LeftMoves ≃ y.LeftMoves) (R : x.RightMoves ≃ y.RightMoves)
+    (hl : ∀ i, ⟦x.moveLeft i⟧ = ⟦y.moveLeft (L i)⟧)
     (hr : ∀ j, ⟦x.moveRight j⟧ = ⟦y.moveRight (R j)⟧) : ⟦x⟧ = ⟦y⟧ := by
   simp_rw [Quotient.eq'] at hl hr ; exact Quot.sound (equiv_of_mk_equiv L R hl hr)
-#align pgame.quot_eq_of_mk_quot_eq PGame.quot_eq_of_mk'_quot_eq
+#align pgame.quot_eq_of_mk_quot_eq SetTheory.PGame.quot_eq_of_mk'_quot_eq
 -/
 
 /-! Multiplicative operations can be defined at the level of pre-games,
@@ -242,7 +255,7 @@ Hence we define them here. -/
 
 /-- The product of `x = {xL | xR}` and `y = {yL | yR}` is
 `{xL*y + x*yL - xL*yL, xR*y + x*yR - xR*yR | xL*y + x*yR - xL*yR, x*yL + xR*y - xR*yL }`. -/
-instance : Mul PGame.{u} :=
+instance : Mul SetTheory.PGame.{u} :=
   ⟨fun x y => by
     induction' x with xl xr xL xR IHxl IHxr generalizing y
     induction' y with yl yr yL yR IHyl IHyr
@@ -253,179 +266,187 @@ instance : Mul PGame.{u} :=
     · exact IHxl i y + IHyr j - IHxl i (yR j)
     · exact IHxr i y + IHyl j - IHxr i (yL j)⟩
 
-#print PGame.leftMoves_mul /-
-theorem leftMoves_mul :
-    ∀ x y : PGame.{u},
+#print SetTheory.PGame.leftMoves_mul /-
+theorem SetTheory.PGame.leftMoves_mul :
+    ∀ x y : SetTheory.PGame.{u},
       (x * y).LeftMoves = Sum (x.LeftMoves × y.LeftMoves) (x.RightMoves × y.RightMoves)
   | ⟨_, _, _, _⟩, ⟨_, _, _, _⟩ => rfl
-#align pgame.left_moves_mul PGame.leftMoves_mul
+#align pgame.left_moves_mul SetTheory.PGame.leftMoves_mul
 -/
 
-#print PGame.rightMoves_mul /-
-theorem rightMoves_mul :
-    ∀ x y : PGame.{u},
+#print SetTheory.PGame.rightMoves_mul /-
+theorem SetTheory.PGame.rightMoves_mul :
+    ∀ x y : SetTheory.PGame.{u},
       (x * y).RightMoves = Sum (x.LeftMoves × y.RightMoves) (x.RightMoves × y.LeftMoves)
   | ⟨_, _, _, _⟩, ⟨_, _, _, _⟩ => rfl
-#align pgame.right_moves_mul PGame.rightMoves_mul
+#align pgame.right_moves_mul SetTheory.PGame.rightMoves_mul
 -/
 
-#print PGame.toLeftMovesMul /-
+#print SetTheory.PGame.toLeftMovesMul /-
 /-- Turns two left or right moves for `x` and `y` into a left move for `x * y` and vice versa.
 
 Even though these types are the same (not definitionally so), this is the preferred way to convert
 between them. -/
-def toLeftMovesMul {x y : PGame} :
+def SetTheory.PGame.toLeftMovesMul {x y : SetTheory.PGame} :
     Sum (x.LeftMoves × y.LeftMoves) (x.RightMoves × y.RightMoves) ≃ (x * y).LeftMoves :=
-  Equiv.cast (leftMoves_mul x y).symm
-#align pgame.to_left_moves_mul PGame.toLeftMovesMul
+  Equiv.cast (SetTheory.PGame.leftMoves_mul x y).symm
+#align pgame.to_left_moves_mul SetTheory.PGame.toLeftMovesMul
 -/
 
-#print PGame.toRightMovesMul /-
+#print SetTheory.PGame.toRightMovesMul /-
 /-- Turns a left and a right move for `x` and `y` into a right move for `x * y` and vice versa.
 
 Even though these types are the same (not definitionally so), this is the preferred way to convert
 between them. -/
-def toRightMovesMul {x y : PGame} :
+def SetTheory.PGame.toRightMovesMul {x y : SetTheory.PGame} :
     Sum (x.LeftMoves × y.RightMoves) (x.RightMoves × y.LeftMoves) ≃ (x * y).RightMoves :=
-  Equiv.cast (rightMoves_mul x y).symm
-#align pgame.to_right_moves_mul PGame.toRightMovesMul
+  Equiv.cast (SetTheory.PGame.rightMoves_mul x y).symm
+#align pgame.to_right_moves_mul SetTheory.PGame.toRightMovesMul
 -/
 
-#print PGame.mk_mul_moveLeft_inl /-
+#print SetTheory.PGame.mk_mul_moveLeft_inl /-
 @[simp]
-theorem mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
-    (mk xl xr xL xR * mk yl yr yL yR).moveLeft (Sum.inl (i, j)) =
-      xL i * mk yl yr yL yR + mk xl xr xL xR * yL j - xL i * yL j :=
+theorem SetTheory.PGame.mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
+    (SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR).moveLeft (Sum.inl (i, j)) =
+      xL i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yL j - xL i * yL j :=
   rfl
-#align pgame.mk_mul_move_left_inl PGame.mk_mul_moveLeft_inl
+#align pgame.mk_mul_move_left_inl SetTheory.PGame.mk_mul_moveLeft_inl
 -/
 
-#print PGame.mul_moveLeft_inl /-
+#print SetTheory.PGame.mul_moveLeft_inl /-
 @[simp]
-theorem mul_moveLeft_inl {x y : PGame} {i j} :
-    (x * y).moveLeft (toLeftMovesMul (Sum.inl (i, j))) =
+theorem SetTheory.PGame.mul_moveLeft_inl {x y : SetTheory.PGame} {i j} :
+    (x * y).moveLeft (SetTheory.PGame.toLeftMovesMul (Sum.inl (i, j))) =
       x.moveLeft i * y + x * y.moveLeft j - x.moveLeft i * y.moveLeft j :=
   by cases x; cases y; rfl
-#align pgame.mul_move_left_inl PGame.mul_moveLeft_inl
+#align pgame.mul_move_left_inl SetTheory.PGame.mul_moveLeft_inl
 -/
 
-#print PGame.mk_mul_moveLeft_inr /-
+#print SetTheory.PGame.mk_mul_moveLeft_inr /-
 @[simp]
-theorem mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
-    (mk xl xr xL xR * mk yl yr yL yR).moveLeft (Sum.inr (i, j)) =
-      xR i * mk yl yr yL yR + mk xl xr xL xR * yR j - xR i * yR j :=
+theorem SetTheory.PGame.mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
+    (SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR).moveLeft (Sum.inr (i, j)) =
+      xR i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yR j - xR i * yR j :=
   rfl
-#align pgame.mk_mul_move_left_inr PGame.mk_mul_moveLeft_inr
+#align pgame.mk_mul_move_left_inr SetTheory.PGame.mk_mul_moveLeft_inr
 -/
 
-#print PGame.mul_moveLeft_inr /-
+#print SetTheory.PGame.mul_moveLeft_inr /-
 @[simp]
-theorem mul_moveLeft_inr {x y : PGame} {i j} :
-    (x * y).moveLeft (toLeftMovesMul (Sum.inr (i, j))) =
+theorem SetTheory.PGame.mul_moveLeft_inr {x y : SetTheory.PGame} {i j} :
+    (x * y).moveLeft (SetTheory.PGame.toLeftMovesMul (Sum.inr (i, j))) =
       x.moveRight i * y + x * y.moveRight j - x.moveRight i * y.moveRight j :=
   by cases x; cases y; rfl
-#align pgame.mul_move_left_inr PGame.mul_moveLeft_inr
+#align pgame.mul_move_left_inr SetTheory.PGame.mul_moveLeft_inr
 -/
 
-#print PGame.mk_mul_moveRight_inl /-
+#print SetTheory.PGame.mk_mul_moveRight_inl /-
 @[simp]
-theorem mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
-    (mk xl xr xL xR * mk yl yr yL yR).moveRight (Sum.inl (i, j)) =
-      xL i * mk yl yr yL yR + mk xl xr xL xR * yR j - xL i * yR j :=
+theorem SetTheory.PGame.mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
+    (SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR).moveRight (Sum.inl (i, j)) =
+      xL i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yR j - xL i * yR j :=
   rfl
-#align pgame.mk_mul_move_right_inl PGame.mk_mul_moveRight_inl
+#align pgame.mk_mul_move_right_inl SetTheory.PGame.mk_mul_moveRight_inl
 -/
 
-#print PGame.mul_moveRight_inl /-
+#print SetTheory.PGame.mul_moveRight_inl /-
 @[simp]
-theorem mul_moveRight_inl {x y : PGame} {i j} :
-    (x * y).moveRight (toRightMovesMul (Sum.inl (i, j))) =
+theorem SetTheory.PGame.mul_moveRight_inl {x y : SetTheory.PGame} {i j} :
+    (x * y).moveRight (SetTheory.PGame.toRightMovesMul (Sum.inl (i, j))) =
       x.moveLeft i * y + x * y.moveRight j - x.moveLeft i * y.moveRight j :=
   by cases x; cases y; rfl
-#align pgame.mul_move_right_inl PGame.mul_moveRight_inl
+#align pgame.mul_move_right_inl SetTheory.PGame.mul_moveRight_inl
 -/
 
-#print PGame.mk_mul_moveRight_inr /-
+#print SetTheory.PGame.mk_mul_moveRight_inr /-
 @[simp]
-theorem mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
-    (mk xl xr xL xR * mk yl yr yL yR).moveRight (Sum.inr (i, j)) =
-      xR i * mk yl yr yL yR + mk xl xr xL xR * yL j - xR i * yL j :=
+theorem SetTheory.PGame.mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
+    (SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR).moveRight (Sum.inr (i, j)) =
+      xR i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yL j - xR i * yL j :=
   rfl
-#align pgame.mk_mul_move_right_inr PGame.mk_mul_moveRight_inr
+#align pgame.mk_mul_move_right_inr SetTheory.PGame.mk_mul_moveRight_inr
 -/
 
-#print PGame.mul_moveRight_inr /-
+#print SetTheory.PGame.mul_moveRight_inr /-
 @[simp]
-theorem mul_moveRight_inr {x y : PGame} {i j} :
-    (x * y).moveRight (toRightMovesMul (Sum.inr (i, j))) =
+theorem SetTheory.PGame.mul_moveRight_inr {x y : SetTheory.PGame} {i j} :
+    (x * y).moveRight (SetTheory.PGame.toRightMovesMul (Sum.inr (i, j))) =
       x.moveRight i * y + x * y.moveLeft j - x.moveRight i * y.moveLeft j :=
   by cases x; cases y; rfl
-#align pgame.mul_move_right_inr PGame.mul_moveRight_inr
+#align pgame.mul_move_right_inr SetTheory.PGame.mul_moveRight_inr
 -/
 
-#print PGame.neg_mk_mul_moveLeft_inl /-
+#print SetTheory.PGame.neg_mk_mul_moveLeft_inl /-
 @[simp]
-theorem neg_mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
-    (-(mk xl xr xL xR * mk yl yr yL yR)).moveLeft (Sum.inl (i, j)) =
-      -(xL i * mk yl yr yL yR + mk xl xr xL xR * yR j - xL i * yR j) :=
+theorem SetTheory.PGame.neg_mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
+    (-(SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR)).moveLeft (Sum.inl (i, j)) =
+      -(xL i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yR j -
+          xL i * yR j) :=
   rfl
-#align pgame.neg_mk_mul_move_left_inl PGame.neg_mk_mul_moveLeft_inl
+#align pgame.neg_mk_mul_move_left_inl SetTheory.PGame.neg_mk_mul_moveLeft_inl
 -/
 
-#print PGame.neg_mk_mul_moveLeft_inr /-
+#print SetTheory.PGame.neg_mk_mul_moveLeft_inr /-
 @[simp]
-theorem neg_mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
-    (-(mk xl xr xL xR * mk yl yr yL yR)).moveLeft (Sum.inr (i, j)) =
-      -(xR i * mk yl yr yL yR + mk xl xr xL xR * yL j - xR i * yL j) :=
+theorem SetTheory.PGame.neg_mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
+    (-(SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR)).moveLeft (Sum.inr (i, j)) =
+      -(xR i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yL j -
+          xR i * yL j) :=
   rfl
-#align pgame.neg_mk_mul_move_left_inr PGame.neg_mk_mul_moveLeft_inr
+#align pgame.neg_mk_mul_move_left_inr SetTheory.PGame.neg_mk_mul_moveLeft_inr
 -/
 
-#print PGame.neg_mk_mul_moveRight_inl /-
+#print SetTheory.PGame.neg_mk_mul_moveRight_inl /-
 @[simp]
-theorem neg_mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
-    (-(mk xl xr xL xR * mk yl yr yL yR)).moveRight (Sum.inl (i, j)) =
-      -(xL i * mk yl yr yL yR + mk xl xr xL xR * yL j - xL i * yL j) :=
+theorem SetTheory.PGame.neg_mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
+    (-(SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR)).moveRight
+        (Sum.inl (i, j)) =
+      -(xL i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yL j -
+          xL i * yL j) :=
   rfl
-#align pgame.neg_mk_mul_move_right_inl PGame.neg_mk_mul_moveRight_inl
+#align pgame.neg_mk_mul_move_right_inl SetTheory.PGame.neg_mk_mul_moveRight_inl
 -/
 
-#print PGame.neg_mk_mul_moveRight_inr /-
+#print SetTheory.PGame.neg_mk_mul_moveRight_inr /-
 @[simp]
-theorem neg_mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
-    (-(mk xl xr xL xR * mk yl yr yL yR)).moveRight (Sum.inr (i, j)) =
-      -(xR i * mk yl yr yL yR + mk xl xr xL xR * yR j - xR i * yR j) :=
+theorem SetTheory.PGame.neg_mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
+    (-(SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR)).moveRight
+        (Sum.inr (i, j)) =
+      -(xR i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yR j -
+          xR i * yR j) :=
   rfl
-#align pgame.neg_mk_mul_move_right_inr PGame.neg_mk_mul_moveRight_inr
+#align pgame.neg_mk_mul_move_right_inr SetTheory.PGame.neg_mk_mul_moveRight_inr
 -/
 
-#print PGame.leftMoves_mul_cases /-
-theorem leftMoves_mul_cases {x y : PGame} (k) {P : (x * y).LeftMoves → Prop}
-    (hl : ∀ ix iy, P <| toLeftMovesMul (Sum.inl ⟨ix, iy⟩))
-    (hr : ∀ jx jy, P <| toLeftMovesMul (Sum.inr ⟨jx, jy⟩)) : P k :=
+#print SetTheory.PGame.leftMoves_mul_cases /-
+theorem SetTheory.PGame.leftMoves_mul_cases {x y : SetTheory.PGame} (k)
+    {P : (x * y).LeftMoves → Prop}
+    (hl : ∀ ix iy, P <| SetTheory.PGame.toLeftMovesMul (Sum.inl ⟨ix, iy⟩))
+    (hr : ∀ jx jy, P <| SetTheory.PGame.toLeftMovesMul (Sum.inr ⟨jx, jy⟩)) : P k :=
   by
   rw [← to_left_moves_mul.apply_symm_apply k]
   rcases to_left_moves_mul.symm k with (⟨ix, iy⟩ | ⟨jx, jy⟩)
   · apply hl
   · apply hr
-#align pgame.left_moves_mul_cases PGame.leftMoves_mul_cases
+#align pgame.left_moves_mul_cases SetTheory.PGame.leftMoves_mul_cases
 -/
 
-#print PGame.rightMoves_mul_cases /-
-theorem rightMoves_mul_cases {x y : PGame} (k) {P : (x * y).RightMoves → Prop}
-    (hl : ∀ ix jy, P <| toRightMovesMul (Sum.inl ⟨ix, jy⟩))
-    (hr : ∀ jx iy, P <| toRightMovesMul (Sum.inr ⟨jx, iy⟩)) : P k :=
+#print SetTheory.PGame.rightMoves_mul_cases /-
+theorem SetTheory.PGame.rightMoves_mul_cases {x y : SetTheory.PGame} (k)
+    {P : (x * y).RightMoves → Prop}
+    (hl : ∀ ix jy, P <| SetTheory.PGame.toRightMovesMul (Sum.inl ⟨ix, jy⟩))
+    (hr : ∀ jx iy, P <| SetTheory.PGame.toRightMovesMul (Sum.inr ⟨jx, iy⟩)) : P k :=
   by
   rw [← to_right_moves_mul.apply_symm_apply k]
   rcases to_right_moves_mul.symm k with (⟨ix, iy⟩ | ⟨jx, jy⟩)
   · apply hl
   · apply hr
-#align pgame.right_moves_mul_cases PGame.rightMoves_mul_cases
+#align pgame.right_moves_mul_cases SetTheory.PGame.rightMoves_mul_cases
 -/
 
-#print PGame.mulCommRelabelling /-
+#print SetTheory.PGame.mulCommRelabelling /-
 /-- `x * y` and `y * x` have the same moves. -/
-def mulCommRelabelling : ∀ x y : PGame.{u}, x * y ≡r y * x
+def SetTheory.PGame.mulCommRelabelling : ∀ x y : SetTheory.PGame.{u}, x * y ≡r y * x
   | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
     refine'
             ⟨Equiv.sumCongr (Equiv.prodComm _ _) (Equiv.prodComm _ _),
@@ -438,124 +459,126 @@ def mulCommRelabelling : ∀ x y : PGame.{u}, x * y ≡r y * x
               (mul_comm_relabelling _ _).addCongr (mul_comm_relabelling _ _)).subCongr
           (mul_comm_relabelling _ _)
 decreasing_by pgame_wf_tac
-#align pgame.mul_comm_relabelling PGame.mulCommRelabelling
+#align pgame.mul_comm_relabelling SetTheory.PGame.mulCommRelabelling
 -/
 
-#print PGame.quot_mul_comm /-
-theorem quot_mul_comm (x y : PGame.{u}) : ⟦x * y⟧ = ⟦y * x⟧ :=
-  Quot.sound (mulCommRelabelling x y).Equiv
-#align pgame.quot_mul_comm PGame.quot_mul_comm
+#print SetTheory.PGame.quot_mul_comm /-
+theorem SetTheory.PGame.quot_mul_comm (x y : SetTheory.PGame.{u}) : ⟦x * y⟧ = ⟦y * x⟧ :=
+  Quot.sound (SetTheory.PGame.mulCommRelabelling x y).Equiv
+#align pgame.quot_mul_comm SetTheory.PGame.quot_mul_comm
 -/
 
-#print PGame.mul_comm_equiv /-
+#print SetTheory.PGame.mul_comm_equiv /-
 /-- `x * y` is equivalent to `y * x`. -/
-theorem mul_comm_equiv (x y : PGame) : x * y ≈ y * x :=
-  Quotient.exact <| quot_mul_comm _ _
-#align pgame.mul_comm_equiv PGame.mul_comm_equiv
+theorem SetTheory.PGame.mul_comm_equiv (x y : SetTheory.PGame) : x * y ≈ y * x :=
+  Quotient.exact <| SetTheory.PGame.quot_mul_comm _ _
+#align pgame.mul_comm_equiv SetTheory.PGame.mul_comm_equiv
 -/
 
-#print PGame.isEmpty_mul_zero_leftMoves /-
-instance isEmpty_mul_zero_leftMoves (x : PGame.{u}) : IsEmpty (x * 0).LeftMoves := by cases x;
-  apply Sum.isEmpty
-#align pgame.is_empty_mul_zero_left_moves PGame.isEmpty_mul_zero_leftMoves
+#print SetTheory.PGame.isEmpty_mul_zero_leftMoves /-
+instance SetTheory.PGame.isEmpty_mul_zero_leftMoves (x : SetTheory.PGame.{u}) :
+    IsEmpty (x * 0).LeftMoves := by cases x; apply Sum.isEmpty
+#align pgame.is_empty_mul_zero_left_moves SetTheory.PGame.isEmpty_mul_zero_leftMoves
 -/
 
-#print PGame.isEmpty_mul_zero_rightMoves /-
-instance isEmpty_mul_zero_rightMoves (x : PGame.{u}) : IsEmpty (x * 0).RightMoves := by cases x;
-  apply Sum.isEmpty
-#align pgame.is_empty_mul_zero_right_moves PGame.isEmpty_mul_zero_rightMoves
+#print SetTheory.PGame.isEmpty_mul_zero_rightMoves /-
+instance SetTheory.PGame.isEmpty_mul_zero_rightMoves (x : SetTheory.PGame.{u}) :
+    IsEmpty (x * 0).RightMoves := by cases x; apply Sum.isEmpty
+#align pgame.is_empty_mul_zero_right_moves SetTheory.PGame.isEmpty_mul_zero_rightMoves
 -/
 
-#print PGame.isEmpty_zero_mul_leftMoves /-
-instance isEmpty_zero_mul_leftMoves (x : PGame.{u}) : IsEmpty (0 * x).LeftMoves := by cases x;
-  apply Sum.isEmpty
-#align pgame.is_empty_zero_mul_left_moves PGame.isEmpty_zero_mul_leftMoves
+#print SetTheory.PGame.isEmpty_zero_mul_leftMoves /-
+instance SetTheory.PGame.isEmpty_zero_mul_leftMoves (x : SetTheory.PGame.{u}) :
+    IsEmpty (0 * x).LeftMoves := by cases x; apply Sum.isEmpty
+#align pgame.is_empty_zero_mul_left_moves SetTheory.PGame.isEmpty_zero_mul_leftMoves
 -/
 
-#print PGame.isEmpty_zero_mul_rightMoves /-
-instance isEmpty_zero_mul_rightMoves (x : PGame.{u}) : IsEmpty (0 * x).RightMoves := by cases x;
-  apply Sum.isEmpty
-#align pgame.is_empty_zero_mul_right_moves PGame.isEmpty_zero_mul_rightMoves
+#print SetTheory.PGame.isEmpty_zero_mul_rightMoves /-
+instance SetTheory.PGame.isEmpty_zero_mul_rightMoves (x : SetTheory.PGame.{u}) :
+    IsEmpty (0 * x).RightMoves := by cases x; apply Sum.isEmpty
+#align pgame.is_empty_zero_mul_right_moves SetTheory.PGame.isEmpty_zero_mul_rightMoves
 -/
 
-#print PGame.mulZeroRelabelling /-
+#print SetTheory.PGame.mulZeroRelabelling /-
 /-- `x * 0` has exactly the same moves as `0`. -/
-def mulZeroRelabelling (x : PGame) : x * 0 ≡r 0 :=
-  Relabelling.isEmpty _
-#align pgame.mul_zero_relabelling PGame.mulZeroRelabelling
+def SetTheory.PGame.mulZeroRelabelling (x : SetTheory.PGame) : x * 0 ≡r 0 :=
+  SetTheory.PGame.Relabelling.isEmpty _
+#align pgame.mul_zero_relabelling SetTheory.PGame.mulZeroRelabelling
 -/
 
-#print PGame.mul_zero_equiv /-
+#print SetTheory.PGame.mul_zero_equiv /-
 /-- `x * 0` is equivalent to `0`. -/
-theorem mul_zero_equiv (x : PGame) : x * 0 ≈ 0 :=
-  (mulZeroRelabelling x).Equiv
-#align pgame.mul_zero_equiv PGame.mul_zero_equiv
+theorem SetTheory.PGame.mul_zero_equiv (x : SetTheory.PGame) : x * 0 ≈ 0 :=
+  (SetTheory.PGame.mulZeroRelabelling x).Equiv
+#align pgame.mul_zero_equiv SetTheory.PGame.mul_zero_equiv
 -/
 
-#print PGame.quot_mul_zero /-
+#print SetTheory.PGame.quot_mul_zero /-
 @[simp]
-theorem quot_mul_zero (x : PGame) : ⟦x * 0⟧ = ⟦0⟧ :=
+theorem SetTheory.PGame.quot_mul_zero (x : SetTheory.PGame) : ⟦x * 0⟧ = ⟦0⟧ :=
   @Quotient.sound _ _ (x * 0) _ x.mul_zero_equiv
-#align pgame.quot_mul_zero PGame.quot_mul_zero
+#align pgame.quot_mul_zero SetTheory.PGame.quot_mul_zero
 -/
 
-#print PGame.zeroMulRelabelling /-
+#print SetTheory.PGame.zeroMulRelabelling /-
 /-- `0 * x` has exactly the same moves as `0`. -/
-def zeroMulRelabelling (x : PGame) : 0 * x ≡r 0 :=
-  Relabelling.isEmpty _
-#align pgame.zero_mul_relabelling PGame.zeroMulRelabelling
+def SetTheory.PGame.zeroMulRelabelling (x : SetTheory.PGame) : 0 * x ≡r 0 :=
+  SetTheory.PGame.Relabelling.isEmpty _
+#align pgame.zero_mul_relabelling SetTheory.PGame.zeroMulRelabelling
 -/
 
-#print PGame.zero_mul_equiv /-
+#print SetTheory.PGame.zero_mul_equiv /-
 /-- `0 * x` is equivalent to `0`. -/
-theorem zero_mul_equiv (x : PGame) : 0 * x ≈ 0 :=
-  (zeroMulRelabelling x).Equiv
-#align pgame.zero_mul_equiv PGame.zero_mul_equiv
+theorem SetTheory.PGame.zero_mul_equiv (x : SetTheory.PGame) : 0 * x ≈ 0 :=
+  (SetTheory.PGame.zeroMulRelabelling x).Equiv
+#align pgame.zero_mul_equiv SetTheory.PGame.zero_mul_equiv
 -/
 
-#print PGame.quot_zero_mul /-
+#print SetTheory.PGame.quot_zero_mul /-
 @[simp]
-theorem quot_zero_mul (x : PGame) : ⟦0 * x⟧ = ⟦0⟧ :=
+theorem SetTheory.PGame.quot_zero_mul (x : SetTheory.PGame) : ⟦0 * x⟧ = ⟦0⟧ :=
   @Quotient.sound _ _ (0 * x) _ x.zero_mul_equiv
-#align pgame.quot_zero_mul PGame.quot_zero_mul
+#align pgame.quot_zero_mul SetTheory.PGame.quot_zero_mul
 -/
 
-#print PGame.negMulRelabelling /-
+#print SetTheory.PGame.negMulRelabelling /-
 /-- `-x * y` and `-(x * y)` have the same moves. -/
-def negMulRelabelling : ∀ x y : PGame.{u}, -x * y ≡r -(x * y)
+def SetTheory.PGame.negMulRelabelling : ∀ x y : SetTheory.PGame.{u}, -x * y ≡r -(x * y)
   | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
     refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (⟨i, j⟩ | ⟨i, j⟩) <;> dsimp <;>
           apply ((neg_add_relabelling _ _).trans _).symm <;>
         apply ((neg_add_relabelling _ _).trans (relabelling.add_congr _ _)).subCongr <;>
       exact (neg_mul_relabelling _ _).symm
 decreasing_by pgame_wf_tac
-#align pgame.neg_mul_relabelling PGame.negMulRelabelling
+#align pgame.neg_mul_relabelling SetTheory.PGame.negMulRelabelling
 -/
 
-#print PGame.quot_neg_mul /-
+#print SetTheory.PGame.quot_neg_mul /-
 @[simp]
-theorem quot_neg_mul (x y : PGame) : ⟦-x * y⟧ = -⟦x * y⟧ :=
-  Quot.sound (negMulRelabelling x y).Equiv
-#align pgame.quot_neg_mul PGame.quot_neg_mul
+theorem SetTheory.PGame.quot_neg_mul (x y : SetTheory.PGame) : ⟦-x * y⟧ = -⟦x * y⟧ :=
+  Quot.sound (SetTheory.PGame.negMulRelabelling x y).Equiv
+#align pgame.quot_neg_mul SetTheory.PGame.quot_neg_mul
 -/
 
-#print PGame.mulNegRelabelling /-
+#print SetTheory.PGame.mulNegRelabelling /-
 /-- `x * -y` and `-(x * y)` have the same moves. -/
-def mulNegRelabelling (x y : PGame) : x * -y ≡r -(x * y) :=
-  (mulCommRelabelling x _).trans <| (negMulRelabelling _ x).trans (mulCommRelabelling y x).negCongr
-#align pgame.mul_neg_relabelling PGame.mulNegRelabelling
+def SetTheory.PGame.mulNegRelabelling (x y : SetTheory.PGame) : x * -y ≡r -(x * y) :=
+  (SetTheory.PGame.mulCommRelabelling x _).trans <|
+    (SetTheory.PGame.negMulRelabelling _ x).trans (SetTheory.PGame.mulCommRelabelling y x).negCongr
+#align pgame.mul_neg_relabelling SetTheory.PGame.mulNegRelabelling
 -/
 
-#print PGame.quot_mul_neg /-
+#print SetTheory.PGame.quot_mul_neg /-
 @[simp]
-theorem quot_mul_neg (x y : PGame) : ⟦x * -y⟧ = -⟦x * y⟧ :=
-  Quot.sound (mulNegRelabelling x y).Equiv
-#align pgame.quot_mul_neg PGame.quot_mul_neg
+theorem SetTheory.PGame.quot_mul_neg (x y : SetTheory.PGame) : ⟦x * -y⟧ = -⟦x * y⟧ :=
+  Quot.sound (SetTheory.PGame.mulNegRelabelling x y).Equiv
+#align pgame.quot_mul_neg SetTheory.PGame.quot_mul_neg
 -/
 
-#print PGame.quot_left_distrib /-
+#print SetTheory.PGame.quot_left_distrib /-
 @[simp]
-theorem quot_left_distrib : ∀ x y z : PGame, ⟦x * (y + z)⟧ = ⟦x * y⟧ + ⟦x * z⟧
+theorem SetTheory.PGame.quot_left_distrib :
+    ∀ x y z : SetTheory.PGame, ⟦x * (y + z)⟧ = ⟦x * y⟧ + ⟦x * z⟧
   | mk xl xr xL xR, mk yl yr yL yR, mk zl zr zL zR =>
     by
     let x := mk xl xr xL xR
@@ -615,47 +638,51 @@ theorem quot_left_distrib : ∀ x y z : PGame, ⟦x * (y + z)⟧ = ⟦x * y⟧ +
             ⟦x * y + (xR i * z + x * zL k - xR i * zL k)⟧
         simp [quot_left_distrib]; abel
 decreasing_by pgame_wf_tac
-#align pgame.quot_left_distrib PGame.quot_left_distrib
+#align pgame.quot_left_distrib SetTheory.PGame.quot_left_distrib
 -/
 
-#print PGame.left_distrib_equiv /-
+#print SetTheory.PGame.left_distrib_equiv /-
 /-- `x * (y + z)` is equivalent to `x * y + x * z.`-/
-theorem left_distrib_equiv (x y z : PGame) : x * (y + z) ≈ x * y + x * z :=
-  Quotient.exact <| quot_left_distrib _ _ _
-#align pgame.left_distrib_equiv PGame.left_distrib_equiv
+theorem SetTheory.PGame.left_distrib_equiv (x y z : SetTheory.PGame) :
+    x * (y + z) ≈ x * y + x * z :=
+  Quotient.exact <| SetTheory.PGame.quot_left_distrib _ _ _
+#align pgame.left_distrib_equiv SetTheory.PGame.left_distrib_equiv
 -/
 
-#print PGame.quot_left_distrib_sub /-
+#print SetTheory.PGame.quot_left_distrib_sub /-
 @[simp]
-theorem quot_left_distrib_sub (x y z : PGame) : ⟦x * (y - z)⟧ = ⟦x * y⟧ - ⟦x * z⟧ := by
-  change ⟦x * (y + -z)⟧ = ⟦x * y⟧ + -⟦x * z⟧; rw [quot_left_distrib, quot_mul_neg]
-#align pgame.quot_left_distrib_sub PGame.quot_left_distrib_sub
+theorem SetTheory.PGame.quot_left_distrib_sub (x y z : SetTheory.PGame) :
+    ⟦x * (y - z)⟧ = ⟦x * y⟧ - ⟦x * z⟧ := by change ⟦x * (y + -z)⟧ = ⟦x * y⟧ + -⟦x * z⟧;
+  rw [quot_left_distrib, quot_mul_neg]
+#align pgame.quot_left_distrib_sub SetTheory.PGame.quot_left_distrib_sub
 -/
 
-#print PGame.quot_right_distrib /-
+#print SetTheory.PGame.quot_right_distrib /-
 @[simp]
-theorem quot_right_distrib (x y z : PGame) : ⟦(x + y) * z⟧ = ⟦x * z⟧ + ⟦y * z⟧ := by
-  simp only [quot_mul_comm, quot_left_distrib]
-#align pgame.quot_right_distrib PGame.quot_right_distrib
+theorem SetTheory.PGame.quot_right_distrib (x y z : SetTheory.PGame) :
+    ⟦(x + y) * z⟧ = ⟦x * z⟧ + ⟦y * z⟧ := by simp only [quot_mul_comm, quot_left_distrib]
+#align pgame.quot_right_distrib SetTheory.PGame.quot_right_distrib
 -/
 
-#print PGame.right_distrib_equiv /-
+#print SetTheory.PGame.right_distrib_equiv /-
 /-- `(x + y) * z` is equivalent to `x * z + y * z.`-/
-theorem right_distrib_equiv (x y z : PGame) : (x + y) * z ≈ x * z + y * z :=
-  Quotient.exact <| quot_right_distrib _ _ _
-#align pgame.right_distrib_equiv PGame.right_distrib_equiv
+theorem SetTheory.PGame.right_distrib_equiv (x y z : SetTheory.PGame) :
+    (x + y) * z ≈ x * z + y * z :=
+  Quotient.exact <| SetTheory.PGame.quot_right_distrib _ _ _
+#align pgame.right_distrib_equiv SetTheory.PGame.right_distrib_equiv
 -/
 
-#print PGame.quot_right_distrib_sub /-
+#print SetTheory.PGame.quot_right_distrib_sub /-
 @[simp]
-theorem quot_right_distrib_sub (x y z : PGame) : ⟦(y - z) * x⟧ = ⟦y * x⟧ - ⟦z * x⟧ := by
-  change ⟦(y + -z) * x⟧ = ⟦y * x⟧ + -⟦z * x⟧; rw [quot_right_distrib, quot_neg_mul]
-#align pgame.quot_right_distrib_sub PGame.quot_right_distrib_sub
+theorem SetTheory.PGame.quot_right_distrib_sub (x y z : SetTheory.PGame) :
+    ⟦(y - z) * x⟧ = ⟦y * x⟧ - ⟦z * x⟧ := by change ⟦(y + -z) * x⟧ = ⟦y * x⟧ + -⟦z * x⟧;
+  rw [quot_right_distrib, quot_neg_mul]
+#align pgame.quot_right_distrib_sub SetTheory.PGame.quot_right_distrib_sub
 -/
 
-#print PGame.mulOneRelabelling /-
+#print SetTheory.PGame.mulOneRelabelling /-
 /-- `x * 1` has the same moves as `x`. -/
-def mulOneRelabelling : ∀ x : PGame.{u}, x * 1 ≡r x
+def SetTheory.PGame.mulOneRelabelling : ∀ x : SetTheory.PGame.{u}, x * 1 ≡r x
   | ⟨xl, xr, xL, xR⟩ => by
     unfold One.one
     refine'
@@ -670,46 +697,46 @@ def mulOneRelabelling : ∀ x : PGame.{u}, x * 1 ≡r x
         (add_zero_relabelling _).trans
           (((mul_one_relabelling _).addCongr (mul_zero_relabelling _)).trans <|
             add_zero_relabelling _)
-#align pgame.mul_one_relabelling PGame.mulOneRelabelling
+#align pgame.mul_one_relabelling SetTheory.PGame.mulOneRelabelling
 -/
 
-#print PGame.quot_mul_one /-
+#print SetTheory.PGame.quot_mul_one /-
 @[simp]
-theorem quot_mul_one (x : PGame) : ⟦x * 1⟧ = ⟦x⟧ :=
-  Quot.sound <| mulOneRelabelling x
-#align pgame.quot_mul_one PGame.quot_mul_one
+theorem SetTheory.PGame.quot_mul_one (x : SetTheory.PGame) : ⟦x * 1⟧ = ⟦x⟧ :=
+  Quot.sound <| SetTheory.PGame.mulOneRelabelling x
+#align pgame.quot_mul_one SetTheory.PGame.quot_mul_one
 -/
 
-#print PGame.mul_one_equiv /-
+#print SetTheory.PGame.mul_one_equiv /-
 /-- `x * 1` is equivalent to `x`. -/
-theorem mul_one_equiv (x : PGame) : x * 1 ≈ x :=
-  Quotient.exact <| quot_mul_one x
-#align pgame.mul_one_equiv PGame.mul_one_equiv
+theorem SetTheory.PGame.mul_one_equiv (x : SetTheory.PGame) : x * 1 ≈ x :=
+  Quotient.exact <| SetTheory.PGame.quot_mul_one x
+#align pgame.mul_one_equiv SetTheory.PGame.mul_one_equiv
 -/
 
-#print PGame.oneMulRelabelling /-
+#print SetTheory.PGame.oneMulRelabelling /-
 /-- `1 * x` has the same moves as `x`. -/
-def oneMulRelabelling (x : PGame) : 1 * x ≡r x :=
-  (mulCommRelabelling 1 x).trans <| mulOneRelabelling x
-#align pgame.one_mul_relabelling PGame.oneMulRelabelling
+def SetTheory.PGame.oneMulRelabelling (x : SetTheory.PGame) : 1 * x ≡r x :=
+  (SetTheory.PGame.mulCommRelabelling 1 x).trans <| SetTheory.PGame.mulOneRelabelling x
+#align pgame.one_mul_relabelling SetTheory.PGame.oneMulRelabelling
 -/
 
-#print PGame.quot_one_mul /-
+#print SetTheory.PGame.quot_one_mul /-
 @[simp]
-theorem quot_one_mul (x : PGame) : ⟦1 * x⟧ = ⟦x⟧ :=
-  Quot.sound <| oneMulRelabelling x
-#align pgame.quot_one_mul PGame.quot_one_mul
+theorem SetTheory.PGame.quot_one_mul (x : SetTheory.PGame) : ⟦1 * x⟧ = ⟦x⟧ :=
+  Quot.sound <| SetTheory.PGame.oneMulRelabelling x
+#align pgame.quot_one_mul SetTheory.PGame.quot_one_mul
 -/
 
-#print PGame.one_mul_equiv /-
+#print SetTheory.PGame.one_mul_equiv /-
 /-- `1 * x` is equivalent to `x`. -/
-theorem one_mul_equiv (x : PGame) : 1 * x ≈ x :=
-  Quotient.exact <| quot_one_mul x
-#align pgame.one_mul_equiv PGame.one_mul_equiv
+theorem SetTheory.PGame.one_mul_equiv (x : SetTheory.PGame) : 1 * x ≈ x :=
+  Quotient.exact <| SetTheory.PGame.quot_one_mul x
+#align pgame.one_mul_equiv SetTheory.PGame.one_mul_equiv
 -/
 
-#print PGame.quot_mul_assoc /-
-theorem quot_mul_assoc : ∀ x y z : PGame, ⟦x * y * z⟧ = ⟦x * (y * z)⟧
+#print SetTheory.PGame.quot_mul_assoc /-
+theorem SetTheory.PGame.quot_mul_assoc : ∀ x y z : SetTheory.PGame, ⟦x * y * z⟧ = ⟦x * (y * z)⟧
   | mk xl xr xL xR, mk yl yr yL yR, mk zl zr zL zR =>
     by
     let x := mk xl xr xL xR
@@ -785,91 +812,98 @@ theorem quot_mul_assoc : ∀ x y z : PGame, ⟦x * y * z⟧ = ⟦x * (y * z)⟧
                 xR i * (yL j * z + y * zL k - yL j * zL k)⟧
         simp [quot_mul_assoc]; abel
 decreasing_by pgame_wf_tac
-#align pgame.quot_mul_assoc PGame.quot_mul_assoc
+#align pgame.quot_mul_assoc SetTheory.PGame.quot_mul_assoc
 -/
 
-#print PGame.mul_assoc_equiv /-
+#print SetTheory.PGame.mul_assoc_equiv /-
 /-- `x * y * z` is equivalent to `x * (y * z).`-/
-theorem mul_assoc_equiv (x y z : PGame) : x * y * z ≈ x * (y * z) :=
-  Quotient.exact <| quot_mul_assoc _ _ _
-#align pgame.mul_assoc_equiv PGame.mul_assoc_equiv
+theorem SetTheory.PGame.mul_assoc_equiv (x y z : SetTheory.PGame) : x * y * z ≈ x * (y * z) :=
+  Quotient.exact <| SetTheory.PGame.quot_mul_assoc _ _ _
+#align pgame.mul_assoc_equiv SetTheory.PGame.mul_assoc_equiv
 -/
 
-#print PGame.InvTy /-
+#print SetTheory.PGame.InvTy /-
 /-- Because the two halves of the definition of `inv` produce more elements
 on each side, we have to define the two families inductively.
 This is the indexing set for the function, and `inv_val` is the function part. -/
-inductive InvTy (l r : Type u) : Bool → Type u
+inductive SetTheory.PGame.InvTy (l r : Type u) : Bool → Type u
   | zero : inv_ty false
   | left₁ : r → inv_ty false → inv_ty false
   | left₂ : l → inv_ty true → inv_ty false
   | right₁ : l → inv_ty false → inv_ty true
   | right₂ : r → inv_ty true → inv_ty true
-#align pgame.inv_ty PGame.InvTy
+#align pgame.inv_ty SetTheory.PGame.InvTy
 -/
 
-instance (l r : Type u) [IsEmpty l] [IsEmpty r] : IsEmpty (InvTy l r true) :=
+instance (l r : Type u) [IsEmpty l] [IsEmpty r] : IsEmpty (SetTheory.PGame.InvTy l r true) :=
   ⟨by rintro (_ | _ | _ | a | a) <;> exact isEmptyElim a⟩
 
-instance (l r : Type u) : Inhabited (InvTy l r false) :=
-  ⟨InvTy.zero⟩
+instance (l r : Type u) : Inhabited (SetTheory.PGame.InvTy l r false) :=
+  ⟨SetTheory.PGame.InvTy.zero⟩
 
-#print PGame.uniqueInvTy /-
-instance uniqueInvTy (l r : Type u) [IsEmpty l] [IsEmpty r] : Unique (InvTy l r false) :=
-  { InvTy.inhabited l r with uniq := by rintro (a | a | a); rfl; all_goals exact isEmptyElim a }
-#align pgame.unique_inv_ty PGame.uniqueInvTy
+#print SetTheory.PGame.uniqueInvTy /-
+instance SetTheory.PGame.uniqueInvTy (l r : Type u) [IsEmpty l] [IsEmpty r] :
+    Unique (SetTheory.PGame.InvTy l r false) :=
+  { SetTheory.PGame.InvTy.inhabited l r with
+    uniq := by rintro (a | a | a); rfl; all_goals exact isEmptyElim a }
+#align pgame.unique_inv_ty SetTheory.PGame.uniqueInvTy
 -/
 
-#print PGame.invVal /-
+#print SetTheory.PGame.invVal /-
 /-- Because the two halves of the definition of `inv` produce more elements
 of each side, we have to define the two families inductively.
 This is the function part, defined by recursion on `inv_ty`. -/
-def invVal {l r} (L : l → PGame) (R : r → PGame) (IHl : l → PGame) (IHr : r → PGame) :
-    ∀ {b}, InvTy l r b → PGame
+def SetTheory.PGame.invVal {l r} (L : l → SetTheory.PGame) (R : r → SetTheory.PGame)
+    (IHl : l → SetTheory.PGame) (IHr : r → SetTheory.PGame) :
+    ∀ {b}, SetTheory.PGame.InvTy l r b → SetTheory.PGame
   | _, inv_ty.zero => 0
-  | _, inv_ty.left₁ i j => (1 + (R i - mk l r L R) * inv_val j) * IHr i
-  | _, inv_ty.left₂ i j => (1 + (L i - mk l r L R) * inv_val j) * IHl i
-  | _, inv_ty.right₁ i j => (1 + (L i - mk l r L R) * inv_val j) * IHl i
-  | _, inv_ty.right₂ i j => (1 + (R i - mk l r L R) * inv_val j) * IHr i
-#align pgame.inv_val PGame.invVal
+  | _, inv_ty.left₁ i j => (1 + (R i - SetTheory.PGame.mk l r L R) * inv_val j) * IHr i
+  | _, inv_ty.left₂ i j => (1 + (L i - SetTheory.PGame.mk l r L R) * inv_val j) * IHl i
+  | _, inv_ty.right₁ i j => (1 + (L i - SetTheory.PGame.mk l r L R) * inv_val j) * IHl i
+  | _, inv_ty.right₂ i j => (1 + (R i - SetTheory.PGame.mk l r L R) * inv_val j) * IHr i
+#align pgame.inv_val SetTheory.PGame.invVal
 -/
 
-#print PGame.invVal_isEmpty /-
+#print SetTheory.PGame.invVal_isEmpty /-
 @[simp]
-theorem invVal_isEmpty {l r : Type u} {b} (L R IHl IHr) (i : InvTy l r b) [IsEmpty l] [IsEmpty r] :
-    invVal L R IHl IHr i = 0 := by
+theorem SetTheory.PGame.invVal_isEmpty {l r : Type u} {b} (L R IHl IHr)
+    (i : SetTheory.PGame.InvTy l r b) [IsEmpty l] [IsEmpty r] :
+    SetTheory.PGame.invVal L R IHl IHr i = 0 :=
+  by
   cases' i with a _ a _ a _ a
   · rfl
   all_goals exact isEmptyElim a
-#align pgame.inv_val_is_empty PGame.invVal_isEmpty
+#align pgame.inv_val_is_empty SetTheory.PGame.invVal_isEmpty
 -/
 
-#print PGame.inv' /-
+#print SetTheory.PGame.inv' /-
 /-- The inverse of a positive surreal number `x = {L | R}` is
 given by `x⁻¹ = {0,
   (1 + (R - x) * x⁻¹L) * R, (1 + (L - x) * x⁻¹R) * L |
   (1 + (L - x) * x⁻¹L) * L, (1 + (R - x) * x⁻¹R) * R}`.
 Because the two halves `x⁻¹L, x⁻¹R` of `x⁻¹` are used in their own
 definition, the sets and elements are inductively generated. -/
-def inv' : PGame → PGame
+def SetTheory.PGame.inv' : SetTheory.PGame → SetTheory.PGame
   | ⟨l, r, L, R⟩ =>
     let l' := { i // 0 < L i }
-    let L' : l' → PGame := fun i => L i.1
-    let IHl' : l' → PGame := fun i => inv' (L i.1)
+    let L' : l' → SetTheory.PGame := fun i => L i.1
+    let IHl' : l' → SetTheory.PGame := fun i => inv' (L i.1)
     let IHr i := inv' (R i)
-    ⟨InvTy l' r false, InvTy l' r true, invVal L' R IHl' IHr, invVal L' R IHl' IHr⟩
-#align pgame.inv' PGame.inv'
+    ⟨SetTheory.PGame.InvTy l' r false, SetTheory.PGame.InvTy l' r true,
+      SetTheory.PGame.invVal L' R IHl' IHr, SetTheory.PGame.invVal L' R IHl' IHr⟩
+#align pgame.inv' SetTheory.PGame.inv'
 -/
 
-#print PGame.zero_lf_inv' /-
-theorem zero_lf_inv' : ∀ x : PGame, 0 ⧏ inv' x
+#print SetTheory.PGame.zero_lf_inv' /-
+theorem SetTheory.PGame.zero_lf_inv' : ∀ x : SetTheory.PGame, 0 ⧏ SetTheory.PGame.inv' x
   | ⟨xl, xr, xL, xR⟩ => by convert lf_mk _ _ inv_ty.zero; rfl
-#align pgame.zero_lf_inv' PGame.zero_lf_inv'
+#align pgame.zero_lf_inv' SetTheory.PGame.zero_lf_inv'
 -/
 
-#print PGame.inv'Zero /-
+#print SetTheory.PGame.inv'Zero /-
 /-- `inv' 0` has exactly the same moves as `1`. -/
-def inv'Zero : inv' 0 ≡r 1 := by
+def SetTheory.PGame.inv'Zero : SetTheory.PGame.inv' 0 ≡r 1 :=
+  by
   change mk _ _ _ _ ≡r 1
   refine' ⟨_, _, fun i => _, IsEmpty.elim _⟩
   · apply Equiv.equivPUnit (inv_ty _ _ _)
@@ -879,78 +913,81 @@ def inv'Zero : inv' 0 ≡r 1 := by
   · simp
   · dsimp
     infer_instance
-#align pgame.inv'_zero PGame.inv'Zero
+#align pgame.inv'_zero SetTheory.PGame.inv'Zero
 -/
 
-#print PGame.inv'_zero_equiv /-
-theorem inv'_zero_equiv : inv' 0 ≈ 1 :=
-  inv'Zero.Equiv
-#align pgame.inv'_zero_equiv PGame.inv'_zero_equiv
+#print SetTheory.PGame.inv'_zero_equiv /-
+theorem SetTheory.PGame.inv'_zero_equiv : SetTheory.PGame.inv' 0 ≈ 1 :=
+  SetTheory.PGame.inv'Zero.Equiv
+#align pgame.inv'_zero_equiv SetTheory.PGame.inv'_zero_equiv
 -/
 
-#print PGame.inv'One /-
+#print SetTheory.PGame.inv'One /-
 /-- `inv' 1` has exactly the same moves as `1`. -/
-def inv'One : inv' 1 ≡r (1 : PGame.{u}) :=
+def SetTheory.PGame.inv'One : SetTheory.PGame.inv' 1 ≡r (1 : SetTheory.PGame.{u}) :=
   by
   change relabelling (mk _ _ _ _) 1
-  have : IsEmpty { i : PUnit.{u + 1} // (0 : PGame.{u}) < 0 } := by rw [lt_self_iff_false];
-    infer_instance
+  have : IsEmpty { i : PUnit.{u + 1} // (0 : SetTheory.PGame.{u}) < 0 } := by
+    rw [lt_self_iff_false]; infer_instance
   refine' ⟨_, _, fun i => _, IsEmpty.elim _⟩ <;> dsimp
   · apply Equiv.equivPUnit
   · apply Equiv.equivOfIsEmpty
   · simp
   · infer_instance
-#align pgame.inv'_one PGame.inv'One
+#align pgame.inv'_one SetTheory.PGame.inv'One
 -/
 
-#print PGame.inv'_one_equiv /-
-theorem inv'_one_equiv : inv' 1 ≈ 1 :=
-  inv'One.Equiv
-#align pgame.inv'_one_equiv PGame.inv'_one_equiv
+#print SetTheory.PGame.inv'_one_equiv /-
+theorem SetTheory.PGame.inv'_one_equiv : SetTheory.PGame.inv' 1 ≈ 1 :=
+  SetTheory.PGame.inv'One.Equiv
+#align pgame.inv'_one_equiv SetTheory.PGame.inv'_one_equiv
 -/
 
 /-- The inverse of a pre-game in terms of the inverse on positive pre-games. -/
-noncomputable instance : Inv PGame :=
+noncomputable instance : Inv SetTheory.PGame :=
   ⟨by classical exact fun x => if x ≈ 0 then 0 else if 0 < x then inv' x else -inv' (-x)⟩
 
-noncomputable instance : Div PGame :=
+noncomputable instance : Div SetTheory.PGame :=
   ⟨fun x y => x * y⁻¹⟩
 
-#print PGame.inv_eq_of_equiv_zero /-
-theorem inv_eq_of_equiv_zero {x : PGame} (h : x ≈ 0) : x⁻¹ = 0 := by classical exact if_pos h
-#align pgame.inv_eq_of_equiv_zero PGame.inv_eq_of_equiv_zero
+#print SetTheory.PGame.inv_eq_of_equiv_zero /-
+theorem SetTheory.PGame.inv_eq_of_equiv_zero {x : SetTheory.PGame} (h : x ≈ 0) : x⁻¹ = 0 := by
+  classical exact if_pos h
+#align pgame.inv_eq_of_equiv_zero SetTheory.PGame.inv_eq_of_equiv_zero
 -/
 
-#print PGame.inv_zero /-
+#print SetTheory.PGame.inv_zero /-
 @[simp]
-theorem inv_zero : (0 : PGame)⁻¹ = 0 :=
-  inv_eq_of_equiv_zero (equiv_refl _)
-#align pgame.inv_zero PGame.inv_zero
+theorem SetTheory.PGame.inv_zero : (0 : SetTheory.PGame)⁻¹ = 0 :=
+  SetTheory.PGame.inv_eq_of_equiv_zero (SetTheory.PGame.equiv_refl _)
+#align pgame.inv_zero SetTheory.PGame.inv_zero
 -/
 
-#print PGame.inv_eq_of_pos /-
-theorem inv_eq_of_pos {x : PGame} (h : 0 < x) : x⁻¹ = inv' x := by
-  classical exact (if_neg h.lf.not_equiv').trans (if_pos h)
-#align pgame.inv_eq_of_pos PGame.inv_eq_of_pos
+#print SetTheory.PGame.inv_eq_of_pos /-
+theorem SetTheory.PGame.inv_eq_of_pos {x : SetTheory.PGame} (h : 0 < x) :
+    x⁻¹ = SetTheory.PGame.inv' x := by classical exact (if_neg h.lf.not_equiv').trans (if_pos h)
+#align pgame.inv_eq_of_pos SetTheory.PGame.inv_eq_of_pos
 -/
 
-#print PGame.inv_eq_of_lf_zero /-
-theorem inv_eq_of_lf_zero {x : PGame} (h : x ⧏ 0) : x⁻¹ = -inv' (-x) := by
+#print SetTheory.PGame.inv_eq_of_lf_zero /-
+theorem SetTheory.PGame.inv_eq_of_lf_zero {x : SetTheory.PGame} (h : x ⧏ 0) :
+    x⁻¹ = -SetTheory.PGame.inv' (-x) := by
   classical exact (if_neg h.not_equiv).trans (if_neg h.not_gt)
-#align pgame.inv_eq_of_lf_zero PGame.inv_eq_of_lf_zero
+#align pgame.inv_eq_of_lf_zero SetTheory.PGame.inv_eq_of_lf_zero
 -/
 
-#print PGame.invOne /-
+#print SetTheory.PGame.invOne /-
 /-- `1⁻¹` has exactly the same moves as `1`. -/
-def invOne : 1⁻¹ ≡r 1 := by rw [inv_eq_of_pos PGame.zero_lt_one]; exact inv'_one
-#align pgame.inv_one PGame.invOne
+def SetTheory.PGame.invOne : 1⁻¹ ≡r 1 := by rw [inv_eq_of_pos SetTheory.PGame.zero_lt_one];
+  exact inv'_one
+#align pgame.inv_one SetTheory.PGame.invOne
 -/
 
-#print PGame.inv_one_equiv /-
-theorem inv_one_equiv : 1⁻¹ ≈ 1 :=
-  invOne.Equiv
-#align pgame.inv_one_equiv PGame.inv_one_equiv
+#print SetTheory.PGame.inv_one_equiv /-
+theorem SetTheory.PGame.inv_one_equiv : 1⁻¹ ≈ 1 :=
+  SetTheory.PGame.invOne.Equiv
+#align pgame.inv_one_equiv SetTheory.PGame.inv_one_equiv
 -/
 
-end PGame
+end SetTheory.PGame
 
Diff
@@ -6,7 +6,7 @@ Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Scott Morrison, Apurva
 import Mathbin.SetTheory.Game.Pgame
 import Mathbin.Tactic.Abel
 
-#align_import set_theory.game.basic from "leanprover-community/mathlib"@"08b63ab58a6ec1157ebeafcbbe6c7a3fb3c9f6d5"
+#align_import set_theory.game.basic from "leanprover-community/mathlib"@"8900d545017cd21961daa2a1734bb658ef52c618"
 
 /-!
 # Combinatorial games.
@@ -186,6 +186,22 @@ instance orderedAddCommGroup : OrderedAddCommGroup Game :=
 #align game.ordered_add_comm_group Game.orderedAddCommGroup
 -/
 
+/-- A small set `s` of games is bounded above. -/
+theorem bddAbove_of_small (s : Set Game.{u}) [Small.{u} s] : BddAbove s :=
+  ⟨_, fun i hi => by
+    simpa using
+      PGame.le_iff_game_le.1
+        (upper_bound_mem_upper_bounds _ (Set.mem_image_of_mem Quotient.out hi))⟩
+#align game.bdd_above_of_small Game.bddAbove_of_small
+
+/-- A small set `s` of games is bounded below. -/
+theorem bddBelow_of_small (s : Set Game.{u}) [Small.{u} s] : BddBelow s :=
+  ⟨_, fun i hi => by
+    simpa using
+      PGame.le_iff_game_le.1
+        (lower_bound_mem_lower_bounds _ (Set.mem_image_of_mem Quotient.out hi))⟩
+#align game.bdd_below_of_small Game.bddBelow_of_small
+
 end Game
 
 namespace PGame
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2019 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Scott Morrison, Apurva Nakade
-
-! This file was ported from Lean 3 source module set_theory.game.basic
-! leanprover-community/mathlib commit 08b63ab58a6ec1157ebeafcbbe6c7a3fb3c9f6d5
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.SetTheory.Game.Pgame
 import Mathbin.Tactic.Abel
 
+#align_import set_theory.game.basic from "leanprover-community/mathlib"@"08b63ab58a6ec1157ebeafcbbe6c7a3fb3c9f6d5"
+
 /-!
 # Combinatorial games.
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Scott Morrison, Apurva Nakade
 
 ! This file was ported from Lean 3 source module set_theory.game.basic
-! leanprover-community/mathlib commit 6623e6af705e97002a9054c1c05a980180276fc1
+! leanprover-community/mathlib commit 08b63ab58a6ec1157ebeafcbbe6c7a3fb3c9f6d5
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Tactic.Abel
 /-!
 # Combinatorial games.
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file we define the quotient of pre-games by the equivalence relation
 `p ≈ q ↔ p ≤ q ∧ q ≤ p` (its `antisymmetrization`), and construct an instance `add_comm_group game`,
 as well as an instance `partial_order game`.
Diff
@@ -33,10 +33,13 @@ open scoped PGame
 
 universe u
 
+#print PGame.setoid /-
 instance PGame.setoid : Setoid PGame :=
   ⟨(· ≈ ·), equiv_refl, @PGame.Equiv.symm, @PGame.Equiv.trans⟩
 #align pgame.setoid PGame.setoid
+-/
 
+#print Game /-
 /-- The type of combinatorial games. In ZFC, a combinatorial game is constructed from
   two sets of combinatorial games that have been constructed at an earlier
   stage. To do this in type theory, we say that a combinatorial pre-game is built
@@ -48,6 +51,7 @@ instance PGame.setoid : Setoid PGame :=
 abbrev Game :=
   Quotient PGame.setoid
 #align game Game
+-/
 
 namespace Game
 
@@ -76,24 +80,30 @@ instance : PartialOrder Game
   lt := Quotient.lift₂ (· < ·) fun x₁ y₁ x₂ y₂ hx hy => propext (lt_congr hx hy)
   lt_iff_le_not_le := by rintro ⟨x⟩ ⟨y⟩; exact @lt_iff_le_not_le _ _ x y
 
+#print Game.Lf /-
 /-- The less or fuzzy relation on games.
 
 If `0 ⧏ x` (less or fuzzy with), then Left can win `x` as the first player. -/
 def Lf : Game → Game → Prop :=
   Quotient.lift₂ Lf fun x₁ y₁ x₂ y₂ hx hy => propext (lf_congr hx hy)
 #align game.lf Game.Lf
+-/
 
 local infixl:50 " ⧏ " => Lf
 
+#print Game.not_le /-
 /-- On `game`, simp-normal inequalities should use as few negations as possible. -/
 @[simp]
 theorem not_le : ∀ {x y : Game}, ¬x ≤ y ↔ y ⧏ x := by rintro ⟨x⟩ ⟨y⟩; exact PGame.not_le
 #align game.not_le Game.not_le
+-/
 
+#print Game.not_lf /-
 /-- On `game`, simp-normal inequalities should use as few negations as possible. -/
 @[simp]
 theorem not_lf : ∀ {x y : Game}, ¬x ⧏ y ↔ y ≤ x := by rintro ⟨x⟩ ⟨y⟩; exact not_lf
 #align game.not_lf Game.not_lf
+-/
 
 instance : IsTrichotomous Game (· ⧏ ·) :=
   ⟨by rintro ⟨x⟩ ⟨y⟩; change _ ∨ ⟦x⟧ = ⟦y⟧ ∨ _; rw [Quotient.eq']; apply lf_or_equiv_or_gf⟩
@@ -118,12 +128,14 @@ theorem PGame.equiv_iff_game_eq {x y : PGame} : (x ≈ y) ↔ ⟦x⟧ = ⟦y⟧
   (@Quotient.eq' _ _ x y).symm
 #align pgame.equiv_iff_game_eq PGame.equiv_iff_game_eq
 
+#print Game.Fuzzy /-
 /-- The fuzzy, confused, or incomparable relation on games.
 
 If `x ‖ 0`, then the first player can always win `x`. -/
 def Fuzzy : Game → Game → Prop :=
   Quotient.lift₂ Fuzzy fun x₁ y₁ x₂ y₂ hx hy => propext (fuzzy_congr hx hy)
 #align game.fuzzy Game.Fuzzy
+-/
 
 local infixl:50 " ‖ " => Fuzzy
 
@@ -131,59 +143,81 @@ theorem PGame.fuzzy_iff_game_fuzzy {x y : PGame} : PGame.Fuzzy x y ↔ ⟦x⟧ 
   Iff.rfl
 #align pgame.fuzzy_iff_game_fuzzy PGame.fuzzy_iff_game_fuzzy
 
+#print Game.covariantClass_add_le /-
 instance covariantClass_add_le : CovariantClass Game Game (· + ·) (· ≤ ·) :=
   ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_le_add_left _ _ _ _ b c h a⟩
 #align game.covariant_class_add_le Game.covariantClass_add_le
+-/
 
+#print Game.covariantClass_swap_add_le /-
 instance covariantClass_swap_add_le : CovariantClass Game Game (swap (· + ·)) (· ≤ ·) :=
   ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_le_add_right _ _ _ _ b c h a⟩
 #align game.covariant_class_swap_add_le Game.covariantClass_swap_add_le
+-/
 
+#print Game.covariantClass_add_lt /-
 instance covariantClass_add_lt : CovariantClass Game Game (· + ·) (· < ·) :=
   ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_lt_add_left _ _ _ _ b c h a⟩
 #align game.covariant_class_add_lt Game.covariantClass_add_lt
+-/
 
+#print Game.covariantClass_swap_add_lt /-
 instance covariantClass_swap_add_lt : CovariantClass Game Game (swap (· + ·)) (· < ·) :=
   ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_lt_add_right _ _ _ _ b c h a⟩
 #align game.covariant_class_swap_add_lt Game.covariantClass_swap_add_lt
+-/
 
+#print Game.add_lf_add_right /-
 theorem add_lf_add_right : ∀ {b c : Game} (h : b ⧏ c) (a), b + a ⧏ c + a := by rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩;
   apply add_lf_add_right h
 #align game.add_lf_add_right Game.add_lf_add_right
+-/
 
+#print Game.add_lf_add_left /-
 theorem add_lf_add_left : ∀ {b c : Game} (h : b ⧏ c) (a), a + b ⧏ a + c := by rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩;
   apply add_lf_add_left h
 #align game.add_lf_add_left Game.add_lf_add_left
+-/
 
+#print Game.orderedAddCommGroup /-
 instance orderedAddCommGroup : OrderedAddCommGroup Game :=
   { Game.addCommGroupWithOne, Game.partialOrder with
     add_le_add_left := @add_le_add_left _ _ _ Game.covariantClass_add_le }
 #align game.ordered_add_comm_group Game.orderedAddCommGroup
+-/
 
 end Game
 
 namespace PGame
 
+#print PGame.quot_neg /-
 @[simp]
 theorem quot_neg (a : PGame) : ⟦-a⟧ = -⟦a⟧ :=
   rfl
 #align pgame.quot_neg PGame.quot_neg
+-/
 
+#print PGame.quot_add /-
 @[simp]
 theorem quot_add (a b : PGame) : ⟦a + b⟧ = ⟦a⟧ + ⟦b⟧ :=
   rfl
 #align pgame.quot_add PGame.quot_add
+-/
 
+#print PGame.quot_sub /-
 @[simp]
 theorem quot_sub (a b : PGame) : ⟦a - b⟧ = ⟦a⟧ - ⟦b⟧ :=
   rfl
 #align pgame.quot_sub PGame.quot_sub
+-/
 
+#print PGame.quot_eq_of_mk'_quot_eq /-
 theorem quot_eq_of_mk'_quot_eq {x y : PGame} (L : x.LeftMoves ≃ y.LeftMoves)
     (R : x.RightMoves ≃ y.RightMoves) (hl : ∀ i, ⟦x.moveLeft i⟧ = ⟦y.moveLeft (L i)⟧)
     (hr : ∀ j, ⟦x.moveRight j⟧ = ⟦y.moveRight (R j)⟧) : ⟦x⟧ = ⟦y⟧ := by
   simp_rw [Quotient.eq'] at hl hr ; exact Quot.sound (equiv_of_mk_equiv L R hl hr)
 #align pgame.quot_eq_of_mk_quot_eq PGame.quot_eq_of_mk'_quot_eq
+-/
 
 /-! Multiplicative operations can be defined at the level of pre-games,
 but to prove their properties we need to use the abelian group structure of games.
@@ -203,18 +237,23 @@ instance : Mul PGame.{u} :=
     · exact IHxl i y + IHyr j - IHxl i (yR j)
     · exact IHxr i y + IHyl j - IHxr i (yL j)⟩
 
+#print PGame.leftMoves_mul /-
 theorem leftMoves_mul :
     ∀ x y : PGame.{u},
       (x * y).LeftMoves = Sum (x.LeftMoves × y.LeftMoves) (x.RightMoves × y.RightMoves)
   | ⟨_, _, _, _⟩, ⟨_, _, _, _⟩ => rfl
 #align pgame.left_moves_mul PGame.leftMoves_mul
+-/
 
+#print PGame.rightMoves_mul /-
 theorem rightMoves_mul :
     ∀ x y : PGame.{u},
       (x * y).RightMoves = Sum (x.LeftMoves × y.RightMoves) (x.RightMoves × y.LeftMoves)
   | ⟨_, _, _, _⟩, ⟨_, _, _, _⟩ => rfl
 #align pgame.right_moves_mul PGame.rightMoves_mul
+-/
 
+#print PGame.toLeftMovesMul /-
 /-- Turns two left or right moves for `x` and `y` into a left move for `x * y` and vice versa.
 
 Even though these types are the same (not definitionally so), this is the preferred way to convert
@@ -223,7 +262,9 @@ def toLeftMovesMul {x y : PGame} :
     Sum (x.LeftMoves × y.LeftMoves) (x.RightMoves × y.RightMoves) ≃ (x * y).LeftMoves :=
   Equiv.cast (leftMoves_mul x y).symm
 #align pgame.to_left_moves_mul PGame.toLeftMovesMul
+-/
 
+#print PGame.toRightMovesMul /-
 /-- Turns a left and a right move for `x` and `y` into a right move for `x * y` and vice versa.
 
 Even though these types are the same (not definitionally so), this is the preferred way to convert
@@ -232,91 +273,117 @@ def toRightMovesMul {x y : PGame} :
     Sum (x.LeftMoves × y.RightMoves) (x.RightMoves × y.LeftMoves) ≃ (x * y).RightMoves :=
   Equiv.cast (rightMoves_mul x y).symm
 #align pgame.to_right_moves_mul PGame.toRightMovesMul
+-/
 
+#print PGame.mk_mul_moveLeft_inl /-
 @[simp]
 theorem mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveLeft (Sum.inl (i, j)) =
       xL i * mk yl yr yL yR + mk xl xr xL xR * yL j - xL i * yL j :=
   rfl
 #align pgame.mk_mul_move_left_inl PGame.mk_mul_moveLeft_inl
+-/
 
+#print PGame.mul_moveLeft_inl /-
 @[simp]
 theorem mul_moveLeft_inl {x y : PGame} {i j} :
     (x * y).moveLeft (toLeftMovesMul (Sum.inl (i, j))) =
       x.moveLeft i * y + x * y.moveLeft j - x.moveLeft i * y.moveLeft j :=
   by cases x; cases y; rfl
 #align pgame.mul_move_left_inl PGame.mul_moveLeft_inl
+-/
 
+#print PGame.mk_mul_moveLeft_inr /-
 @[simp]
 theorem mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveLeft (Sum.inr (i, j)) =
       xR i * mk yl yr yL yR + mk xl xr xL xR * yR j - xR i * yR j :=
   rfl
 #align pgame.mk_mul_move_left_inr PGame.mk_mul_moveLeft_inr
+-/
 
+#print PGame.mul_moveLeft_inr /-
 @[simp]
 theorem mul_moveLeft_inr {x y : PGame} {i j} :
     (x * y).moveLeft (toLeftMovesMul (Sum.inr (i, j))) =
       x.moveRight i * y + x * y.moveRight j - x.moveRight i * y.moveRight j :=
   by cases x; cases y; rfl
 #align pgame.mul_move_left_inr PGame.mul_moveLeft_inr
+-/
 
+#print PGame.mk_mul_moveRight_inl /-
 @[simp]
 theorem mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveRight (Sum.inl (i, j)) =
       xL i * mk yl yr yL yR + mk xl xr xL xR * yR j - xL i * yR j :=
   rfl
 #align pgame.mk_mul_move_right_inl PGame.mk_mul_moveRight_inl
+-/
 
+#print PGame.mul_moveRight_inl /-
 @[simp]
 theorem mul_moveRight_inl {x y : PGame} {i j} :
     (x * y).moveRight (toRightMovesMul (Sum.inl (i, j))) =
       x.moveLeft i * y + x * y.moveRight j - x.moveLeft i * y.moveRight j :=
   by cases x; cases y; rfl
 #align pgame.mul_move_right_inl PGame.mul_moveRight_inl
+-/
 
+#print PGame.mk_mul_moveRight_inr /-
 @[simp]
 theorem mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveRight (Sum.inr (i, j)) =
       xR i * mk yl yr yL yR + mk xl xr xL xR * yL j - xR i * yL j :=
   rfl
 #align pgame.mk_mul_move_right_inr PGame.mk_mul_moveRight_inr
+-/
 
+#print PGame.mul_moveRight_inr /-
 @[simp]
 theorem mul_moveRight_inr {x y : PGame} {i j} :
     (x * y).moveRight (toRightMovesMul (Sum.inr (i, j))) =
       x.moveRight i * y + x * y.moveLeft j - x.moveRight i * y.moveLeft j :=
   by cases x; cases y; rfl
 #align pgame.mul_move_right_inr PGame.mul_moveRight_inr
+-/
 
+#print PGame.neg_mk_mul_moveLeft_inl /-
 @[simp]
 theorem neg_mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveLeft (Sum.inl (i, j)) =
       -(xL i * mk yl yr yL yR + mk xl xr xL xR * yR j - xL i * yR j) :=
   rfl
 #align pgame.neg_mk_mul_move_left_inl PGame.neg_mk_mul_moveLeft_inl
+-/
 
+#print PGame.neg_mk_mul_moveLeft_inr /-
 @[simp]
 theorem neg_mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveLeft (Sum.inr (i, j)) =
       -(xR i * mk yl yr yL yR + mk xl xr xL xR * yL j - xR i * yL j) :=
   rfl
 #align pgame.neg_mk_mul_move_left_inr PGame.neg_mk_mul_moveLeft_inr
+-/
 
+#print PGame.neg_mk_mul_moveRight_inl /-
 @[simp]
 theorem neg_mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveRight (Sum.inl (i, j)) =
       -(xL i * mk yl yr yL yR + mk xl xr xL xR * yL j - xL i * yL j) :=
   rfl
 #align pgame.neg_mk_mul_move_right_inl PGame.neg_mk_mul_moveRight_inl
+-/
 
+#print PGame.neg_mk_mul_moveRight_inr /-
 @[simp]
 theorem neg_mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveRight (Sum.inr (i, j)) =
       -(xR i * mk yl yr yL yR + mk xl xr xL xR * yR j - xR i * yR j) :=
   rfl
 #align pgame.neg_mk_mul_move_right_inr PGame.neg_mk_mul_moveRight_inr
+-/
 
+#print PGame.leftMoves_mul_cases /-
 theorem leftMoves_mul_cases {x y : PGame} (k) {P : (x * y).LeftMoves → Prop}
     (hl : ∀ ix iy, P <| toLeftMovesMul (Sum.inl ⟨ix, iy⟩))
     (hr : ∀ jx jy, P <| toLeftMovesMul (Sum.inr ⟨jx, jy⟩)) : P k :=
@@ -326,7 +393,9 @@ theorem leftMoves_mul_cases {x y : PGame} (k) {P : (x * y).LeftMoves → Prop}
   · apply hl
   · apply hr
 #align pgame.left_moves_mul_cases PGame.leftMoves_mul_cases
+-/
 
+#print PGame.rightMoves_mul_cases /-
 theorem rightMoves_mul_cases {x y : PGame} (k) {P : (x * y).RightMoves → Prop}
     (hl : ∀ ix jy, P <| toRightMovesMul (Sum.inl ⟨ix, jy⟩))
     (hr : ∀ jx iy, P <| toRightMovesMul (Sum.inr ⟨jx, iy⟩)) : P k :=
@@ -336,7 +405,9 @@ theorem rightMoves_mul_cases {x y : PGame} (k) {P : (x * y).RightMoves → Prop}
   · apply hl
   · apply hr
 #align pgame.right_moves_mul_cases PGame.rightMoves_mul_cases
+-/
 
+#print PGame.mulCommRelabelling /-
 /-- `x * y` and `y * x` have the same moves. -/
 def mulCommRelabelling : ∀ x y : PGame.{u}, x * y ≡r y * x
   | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
@@ -352,62 +423,88 @@ def mulCommRelabelling : ∀ x y : PGame.{u}, x * y ≡r y * x
           (mul_comm_relabelling _ _)
 decreasing_by pgame_wf_tac
 #align pgame.mul_comm_relabelling PGame.mulCommRelabelling
+-/
 
+#print PGame.quot_mul_comm /-
 theorem quot_mul_comm (x y : PGame.{u}) : ⟦x * y⟧ = ⟦y * x⟧ :=
   Quot.sound (mulCommRelabelling x y).Equiv
 #align pgame.quot_mul_comm PGame.quot_mul_comm
+-/
 
+#print PGame.mul_comm_equiv /-
 /-- `x * y` is equivalent to `y * x`. -/
 theorem mul_comm_equiv (x y : PGame) : x * y ≈ y * x :=
   Quotient.exact <| quot_mul_comm _ _
 #align pgame.mul_comm_equiv PGame.mul_comm_equiv
+-/
 
+#print PGame.isEmpty_mul_zero_leftMoves /-
 instance isEmpty_mul_zero_leftMoves (x : PGame.{u}) : IsEmpty (x * 0).LeftMoves := by cases x;
   apply Sum.isEmpty
 #align pgame.is_empty_mul_zero_left_moves PGame.isEmpty_mul_zero_leftMoves
+-/
 
+#print PGame.isEmpty_mul_zero_rightMoves /-
 instance isEmpty_mul_zero_rightMoves (x : PGame.{u}) : IsEmpty (x * 0).RightMoves := by cases x;
   apply Sum.isEmpty
 #align pgame.is_empty_mul_zero_right_moves PGame.isEmpty_mul_zero_rightMoves
+-/
 
+#print PGame.isEmpty_zero_mul_leftMoves /-
 instance isEmpty_zero_mul_leftMoves (x : PGame.{u}) : IsEmpty (0 * x).LeftMoves := by cases x;
   apply Sum.isEmpty
 #align pgame.is_empty_zero_mul_left_moves PGame.isEmpty_zero_mul_leftMoves
+-/
 
+#print PGame.isEmpty_zero_mul_rightMoves /-
 instance isEmpty_zero_mul_rightMoves (x : PGame.{u}) : IsEmpty (0 * x).RightMoves := by cases x;
   apply Sum.isEmpty
 #align pgame.is_empty_zero_mul_right_moves PGame.isEmpty_zero_mul_rightMoves
+-/
 
+#print PGame.mulZeroRelabelling /-
 /-- `x * 0` has exactly the same moves as `0`. -/
 def mulZeroRelabelling (x : PGame) : x * 0 ≡r 0 :=
   Relabelling.isEmpty _
 #align pgame.mul_zero_relabelling PGame.mulZeroRelabelling
+-/
 
+#print PGame.mul_zero_equiv /-
 /-- `x * 0` is equivalent to `0`. -/
 theorem mul_zero_equiv (x : PGame) : x * 0 ≈ 0 :=
   (mulZeroRelabelling x).Equiv
 #align pgame.mul_zero_equiv PGame.mul_zero_equiv
+-/
 
+#print PGame.quot_mul_zero /-
 @[simp]
 theorem quot_mul_zero (x : PGame) : ⟦x * 0⟧ = ⟦0⟧ :=
   @Quotient.sound _ _ (x * 0) _ x.mul_zero_equiv
 #align pgame.quot_mul_zero PGame.quot_mul_zero
+-/
 
+#print PGame.zeroMulRelabelling /-
 /-- `0 * x` has exactly the same moves as `0`. -/
 def zeroMulRelabelling (x : PGame) : 0 * x ≡r 0 :=
   Relabelling.isEmpty _
 #align pgame.zero_mul_relabelling PGame.zeroMulRelabelling
+-/
 
+#print PGame.zero_mul_equiv /-
 /-- `0 * x` is equivalent to `0`. -/
 theorem zero_mul_equiv (x : PGame) : 0 * x ≈ 0 :=
   (zeroMulRelabelling x).Equiv
 #align pgame.zero_mul_equiv PGame.zero_mul_equiv
+-/
 
+#print PGame.quot_zero_mul /-
 @[simp]
 theorem quot_zero_mul (x : PGame) : ⟦0 * x⟧ = ⟦0⟧ :=
   @Quotient.sound _ _ (0 * x) _ x.zero_mul_equiv
 #align pgame.quot_zero_mul PGame.quot_zero_mul
+-/
 
+#print PGame.negMulRelabelling /-
 /-- `-x * y` and `-(x * y)` have the same moves. -/
 def negMulRelabelling : ∀ x y : PGame.{u}, -x * y ≡r -(x * y)
   | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
@@ -417,22 +514,30 @@ def negMulRelabelling : ∀ x y : PGame.{u}, -x * y ≡r -(x * y)
       exact (neg_mul_relabelling _ _).symm
 decreasing_by pgame_wf_tac
 #align pgame.neg_mul_relabelling PGame.negMulRelabelling
+-/
 
+#print PGame.quot_neg_mul /-
 @[simp]
 theorem quot_neg_mul (x y : PGame) : ⟦-x * y⟧ = -⟦x * y⟧ :=
   Quot.sound (negMulRelabelling x y).Equiv
 #align pgame.quot_neg_mul PGame.quot_neg_mul
+-/
 
+#print PGame.mulNegRelabelling /-
 /-- `x * -y` and `-(x * y)` have the same moves. -/
 def mulNegRelabelling (x y : PGame) : x * -y ≡r -(x * y) :=
   (mulCommRelabelling x _).trans <| (negMulRelabelling _ x).trans (mulCommRelabelling y x).negCongr
 #align pgame.mul_neg_relabelling PGame.mulNegRelabelling
+-/
 
+#print PGame.quot_mul_neg /-
 @[simp]
 theorem quot_mul_neg (x y : PGame) : ⟦x * -y⟧ = -⟦x * y⟧ :=
   Quot.sound (mulNegRelabelling x y).Equiv
 #align pgame.quot_mul_neg PGame.quot_mul_neg
+-/
 
+#print PGame.quot_left_distrib /-
 @[simp]
 theorem quot_left_distrib : ∀ x y z : PGame, ⟦x * (y + z)⟧ = ⟦x * y⟧ + ⟦x * z⟧
   | mk xl xr xL xR, mk yl yr yL yR, mk zl zr zL zR =>
@@ -495,32 +600,44 @@ theorem quot_left_distrib : ∀ x y z : PGame, ⟦x * (y + z)⟧ = ⟦x * y⟧ +
         simp [quot_left_distrib]; abel
 decreasing_by pgame_wf_tac
 #align pgame.quot_left_distrib PGame.quot_left_distrib
+-/
 
+#print PGame.left_distrib_equiv /-
 /-- `x * (y + z)` is equivalent to `x * y + x * z.`-/
 theorem left_distrib_equiv (x y z : PGame) : x * (y + z) ≈ x * y + x * z :=
   Quotient.exact <| quot_left_distrib _ _ _
 #align pgame.left_distrib_equiv PGame.left_distrib_equiv
+-/
 
+#print PGame.quot_left_distrib_sub /-
 @[simp]
 theorem quot_left_distrib_sub (x y z : PGame) : ⟦x * (y - z)⟧ = ⟦x * y⟧ - ⟦x * z⟧ := by
   change ⟦x * (y + -z)⟧ = ⟦x * y⟧ + -⟦x * z⟧; rw [quot_left_distrib, quot_mul_neg]
 #align pgame.quot_left_distrib_sub PGame.quot_left_distrib_sub
+-/
 
+#print PGame.quot_right_distrib /-
 @[simp]
 theorem quot_right_distrib (x y z : PGame) : ⟦(x + y) * z⟧ = ⟦x * z⟧ + ⟦y * z⟧ := by
   simp only [quot_mul_comm, quot_left_distrib]
 #align pgame.quot_right_distrib PGame.quot_right_distrib
+-/
 
+#print PGame.right_distrib_equiv /-
 /-- `(x + y) * z` is equivalent to `x * z + y * z.`-/
 theorem right_distrib_equiv (x y z : PGame) : (x + y) * z ≈ x * z + y * z :=
   Quotient.exact <| quot_right_distrib _ _ _
 #align pgame.right_distrib_equiv PGame.right_distrib_equiv
+-/
 
+#print PGame.quot_right_distrib_sub /-
 @[simp]
 theorem quot_right_distrib_sub (x y z : PGame) : ⟦(y - z) * x⟧ = ⟦y * x⟧ - ⟦z * x⟧ := by
   change ⟦(y + -z) * x⟧ = ⟦y * x⟧ + -⟦z * x⟧; rw [quot_right_distrib, quot_neg_mul]
 #align pgame.quot_right_distrib_sub PGame.quot_right_distrib_sub
+-/
 
+#print PGame.mulOneRelabelling /-
 /-- `x * 1` has the same moves as `x`. -/
 def mulOneRelabelling : ∀ x : PGame.{u}, x * 1 ≡r x
   | ⟨xl, xr, xL, xR⟩ => by
@@ -538,32 +655,44 @@ def mulOneRelabelling : ∀ x : PGame.{u}, x * 1 ≡r x
           (((mul_one_relabelling _).addCongr (mul_zero_relabelling _)).trans <|
             add_zero_relabelling _)
 #align pgame.mul_one_relabelling PGame.mulOneRelabelling
+-/
 
+#print PGame.quot_mul_one /-
 @[simp]
 theorem quot_mul_one (x : PGame) : ⟦x * 1⟧ = ⟦x⟧ :=
   Quot.sound <| mulOneRelabelling x
 #align pgame.quot_mul_one PGame.quot_mul_one
+-/
 
+#print PGame.mul_one_equiv /-
 /-- `x * 1` is equivalent to `x`. -/
 theorem mul_one_equiv (x : PGame) : x * 1 ≈ x :=
   Quotient.exact <| quot_mul_one x
 #align pgame.mul_one_equiv PGame.mul_one_equiv
+-/
 
+#print PGame.oneMulRelabelling /-
 /-- `1 * x` has the same moves as `x`. -/
 def oneMulRelabelling (x : PGame) : 1 * x ≡r x :=
   (mulCommRelabelling 1 x).trans <| mulOneRelabelling x
 #align pgame.one_mul_relabelling PGame.oneMulRelabelling
+-/
 
+#print PGame.quot_one_mul /-
 @[simp]
 theorem quot_one_mul (x : PGame) : ⟦1 * x⟧ = ⟦x⟧ :=
   Quot.sound <| oneMulRelabelling x
 #align pgame.quot_one_mul PGame.quot_one_mul
+-/
 
+#print PGame.one_mul_equiv /-
 /-- `1 * x` is equivalent to `x`. -/
 theorem one_mul_equiv (x : PGame) : 1 * x ≈ x :=
   Quotient.exact <| quot_one_mul x
 #align pgame.one_mul_equiv PGame.one_mul_equiv
+-/
 
+#print PGame.quot_mul_assoc /-
 theorem quot_mul_assoc : ∀ x y z : PGame, ⟦x * y * z⟧ = ⟦x * (y * z)⟧
   | mk xl xr xL xR, mk yl yr yL yR, mk zl zr zL zR =>
     by
@@ -641,12 +770,16 @@ theorem quot_mul_assoc : ∀ x y z : PGame, ⟦x * y * z⟧ = ⟦x * (y * z)⟧
         simp [quot_mul_assoc]; abel
 decreasing_by pgame_wf_tac
 #align pgame.quot_mul_assoc PGame.quot_mul_assoc
+-/
 
+#print PGame.mul_assoc_equiv /-
 /-- `x * y * z` is equivalent to `x * (y * z).`-/
 theorem mul_assoc_equiv (x y z : PGame) : x * y * z ≈ x * (y * z) :=
   Quotient.exact <| quot_mul_assoc _ _ _
 #align pgame.mul_assoc_equiv PGame.mul_assoc_equiv
+-/
 
+#print PGame.InvTy /-
 /-- Because the two halves of the definition of `inv` produce more elements
 on each side, we have to define the two families inductively.
 This is the indexing set for the function, and `inv_val` is the function part. -/
@@ -657,6 +790,7 @@ inductive InvTy (l r : Type u) : Bool → Type u
   | right₁ : l → inv_ty false → inv_ty true
   | right₂ : r → inv_ty true → inv_ty true
 #align pgame.inv_ty PGame.InvTy
+-/
 
 instance (l r : Type u) [IsEmpty l] [IsEmpty r] : IsEmpty (InvTy l r true) :=
   ⟨by rintro (_ | _ | _ | a | a) <;> exact isEmptyElim a⟩
@@ -664,10 +798,13 @@ instance (l r : Type u) [IsEmpty l] [IsEmpty r] : IsEmpty (InvTy l r true) :=
 instance (l r : Type u) : Inhabited (InvTy l r false) :=
   ⟨InvTy.zero⟩
 
+#print PGame.uniqueInvTy /-
 instance uniqueInvTy (l r : Type u) [IsEmpty l] [IsEmpty r] : Unique (InvTy l r false) :=
   { InvTy.inhabited l r with uniq := by rintro (a | a | a); rfl; all_goals exact isEmptyElim a }
 #align pgame.unique_inv_ty PGame.uniqueInvTy
+-/
 
+#print PGame.invVal /-
 /-- Because the two halves of the definition of `inv` produce more elements
 of each side, we have to define the two families inductively.
 This is the function part, defined by recursion on `inv_ty`. -/
@@ -679,7 +816,9 @@ def invVal {l r} (L : l → PGame) (R : r → PGame) (IHl : l → PGame) (IHr :
   | _, inv_ty.right₁ i j => (1 + (L i - mk l r L R) * inv_val j) * IHl i
   | _, inv_ty.right₂ i j => (1 + (R i - mk l r L R) * inv_val j) * IHr i
 #align pgame.inv_val PGame.invVal
+-/
 
+#print PGame.invVal_isEmpty /-
 @[simp]
 theorem invVal_isEmpty {l r : Type u} {b} (L R IHl IHr) (i : InvTy l r b) [IsEmpty l] [IsEmpty r] :
     invVal L R IHl IHr i = 0 := by
@@ -687,7 +826,9 @@ theorem invVal_isEmpty {l r : Type u} {b} (L R IHl IHr) (i : InvTy l r b) [IsEmp
   · rfl
   all_goals exact isEmptyElim a
 #align pgame.inv_val_is_empty PGame.invVal_isEmpty
+-/
 
+#print PGame.inv' /-
 /-- The inverse of a positive surreal number `x = {L | R}` is
 given by `x⁻¹ = {0,
   (1 + (R - x) * x⁻¹L) * R, (1 + (L - x) * x⁻¹R) * L |
@@ -702,11 +843,15 @@ def inv' : PGame → PGame
     let IHr i := inv' (R i)
     ⟨InvTy l' r false, InvTy l' r true, invVal L' R IHl' IHr, invVal L' R IHl' IHr⟩
 #align pgame.inv' PGame.inv'
+-/
 
+#print PGame.zero_lf_inv' /-
 theorem zero_lf_inv' : ∀ x : PGame, 0 ⧏ inv' x
   | ⟨xl, xr, xL, xR⟩ => by convert lf_mk _ _ inv_ty.zero; rfl
 #align pgame.zero_lf_inv' PGame.zero_lf_inv'
+-/
 
+#print PGame.inv'Zero /-
 /-- `inv' 0` has exactly the same moves as `1`. -/
 def inv'Zero : inv' 0 ≡r 1 := by
   change mk _ _ _ _ ≡r 1
@@ -719,11 +864,15 @@ def inv'Zero : inv' 0 ≡r 1 := by
   · dsimp
     infer_instance
 #align pgame.inv'_zero PGame.inv'Zero
+-/
 
+#print PGame.inv'_zero_equiv /-
 theorem inv'_zero_equiv : inv' 0 ≈ 1 :=
   inv'Zero.Equiv
 #align pgame.inv'_zero_equiv PGame.inv'_zero_equiv
+-/
 
+#print PGame.inv'One /-
 /-- `inv' 1` has exactly the same moves as `1`. -/
 def inv'One : inv' 1 ≡r (1 : PGame.{u}) :=
   by
@@ -736,10 +885,13 @@ def inv'One : inv' 1 ≡r (1 : PGame.{u}) :=
   · simp
   · infer_instance
 #align pgame.inv'_one PGame.inv'One
+-/
 
+#print PGame.inv'_one_equiv /-
 theorem inv'_one_equiv : inv' 1 ≈ 1 :=
   inv'One.Equiv
 #align pgame.inv'_one_equiv PGame.inv'_one_equiv
+-/
 
 /-- The inverse of a pre-game in terms of the inverse on positive pre-games. -/
 noncomputable instance : Inv PGame :=
@@ -748,29 +900,41 @@ noncomputable instance : Inv PGame :=
 noncomputable instance : Div PGame :=
   ⟨fun x y => x * y⁻¹⟩
 
+#print PGame.inv_eq_of_equiv_zero /-
 theorem inv_eq_of_equiv_zero {x : PGame} (h : x ≈ 0) : x⁻¹ = 0 := by classical exact if_pos h
 #align pgame.inv_eq_of_equiv_zero PGame.inv_eq_of_equiv_zero
+-/
 
+#print PGame.inv_zero /-
 @[simp]
 theorem inv_zero : (0 : PGame)⁻¹ = 0 :=
   inv_eq_of_equiv_zero (equiv_refl _)
 #align pgame.inv_zero PGame.inv_zero
+-/
 
+#print PGame.inv_eq_of_pos /-
 theorem inv_eq_of_pos {x : PGame} (h : 0 < x) : x⁻¹ = inv' x := by
   classical exact (if_neg h.lf.not_equiv').trans (if_pos h)
 #align pgame.inv_eq_of_pos PGame.inv_eq_of_pos
+-/
 
+#print PGame.inv_eq_of_lf_zero /-
 theorem inv_eq_of_lf_zero {x : PGame} (h : x ⧏ 0) : x⁻¹ = -inv' (-x) := by
   classical exact (if_neg h.not_equiv).trans (if_neg h.not_gt)
 #align pgame.inv_eq_of_lf_zero PGame.inv_eq_of_lf_zero
+-/
 
+#print PGame.invOne /-
 /-- `1⁻¹` has exactly the same moves as `1`. -/
 def invOne : 1⁻¹ ≡r 1 := by rw [inv_eq_of_pos PGame.zero_lt_one]; exact inv'_one
 #align pgame.inv_one PGame.invOne
+-/
 
+#print PGame.inv_one_equiv /-
 theorem inv_one_equiv : 1⁻¹ ≈ 1 :=
   invOne.Equiv
 #align pgame.inv_one_equiv PGame.inv_one_equiv
+-/
 
 end PGame
 
Diff
@@ -83,7 +83,6 @@ def Lf : Game → Game → Prop :=
   Quotient.lift₂ Lf fun x₁ y₁ x₂ y₂ hx hy => propext (lf_congr hx hy)
 #align game.lf Game.Lf
 
--- mathport name: «expr ⧏ »
 local infixl:50 " ⧏ " => Lf
 
 /-- On `game`, simp-normal inequalities should use as few negations as possible. -/
@@ -126,7 +125,6 @@ def Fuzzy : Game → Game → Prop :=
   Quotient.lift₂ Fuzzy fun x₁ y₁ x₂ y₂ hx hy => propext (fuzzy_congr hx hy)
 #align game.fuzzy Game.Fuzzy
 
--- mathport name: «expr ‖ »
 local infixl:50 " ‖ " => Fuzzy
 
 theorem PGame.fuzzy_iff_game_fuzzy {x y : PGame} : PGame.Fuzzy x y ↔ ⟦x⟧ ‖ ⟦y⟧ :=
Diff
@@ -184,7 +184,7 @@ theorem quot_sub (a b : PGame) : ⟦a - b⟧ = ⟦a⟧ - ⟦b⟧ :=
 theorem quot_eq_of_mk'_quot_eq {x y : PGame} (L : x.LeftMoves ≃ y.LeftMoves)
     (R : x.RightMoves ≃ y.RightMoves) (hl : ∀ i, ⟦x.moveLeft i⟧ = ⟦y.moveLeft (L i)⟧)
     (hr : ∀ j, ⟦x.moveRight j⟧ = ⟦y.moveRight (R j)⟧) : ⟦x⟧ = ⟦y⟧ := by
-  simp_rw [Quotient.eq'] at hl hr; exact Quot.sound (equiv_of_mk_equiv L R hl hr)
+  simp_rw [Quotient.eq'] at hl hr ; exact Quot.sound (equiv_of_mk_equiv L R hl hr)
 #align pgame.quot_eq_of_mk_quot_eq PGame.quot_eq_of_mk'_quot_eq
 
 /-! Multiplicative operations can be defined at the level of pre-games,
@@ -351,8 +351,8 @@ def mulCommRelabelling : ∀ x y : PGame.{u}, x * y ≡r y * x
       exact
         ((add_comm_relabelling _ _).trans <|
               (mul_comm_relabelling _ _).addCongr (mul_comm_relabelling _ _)).subCongr
-          (mul_comm_relabelling _ _)decreasing_by
-  pgame_wf_tac
+          (mul_comm_relabelling _ _)
+decreasing_by pgame_wf_tac
 #align pgame.mul_comm_relabelling PGame.mulCommRelabelling
 
 theorem quot_mul_comm (x y : PGame.{u}) : ⟦x * y⟧ = ⟦y * x⟧ :=
@@ -416,8 +416,8 @@ def negMulRelabelling : ∀ x y : PGame.{u}, -x * y ≡r -(x * y)
     refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (⟨i, j⟩ | ⟨i, j⟩) <;> dsimp <;>
           apply ((neg_add_relabelling _ _).trans _).symm <;>
         apply ((neg_add_relabelling _ _).trans (relabelling.add_congr _ _)).subCongr <;>
-      exact (neg_mul_relabelling _ _).symm decreasing_by
-  pgame_wf_tac
+      exact (neg_mul_relabelling _ _).symm
+decreasing_by pgame_wf_tac
 #align pgame.neg_mul_relabelling PGame.negMulRelabelling
 
 @[simp]
@@ -494,7 +494,8 @@ theorem quot_left_distrib : ∀ x y z : PGame, ⟦x * (y + z)⟧ = ⟦x * y⟧ +
       · change
           ⟦xR i * (y + z) + x * (y + zL k) - xR i * (y + zL k)⟧ =
             ⟦x * y + (xR i * z + x * zL k - xR i * zL k)⟧
-        simp [quot_left_distrib]; abel decreasing_by pgame_wf_tac
+        simp [quot_left_distrib]; abel
+decreasing_by pgame_wf_tac
 #align pgame.quot_left_distrib PGame.quot_left_distrib
 
 /-- `x * (y + z)` is equivalent to `x * y + x * z.`-/
@@ -639,7 +640,8 @@ theorem quot_mul_assoc : ∀ x y z : PGame, ⟦x * y * z⟧ = ⟦x * (y * z)⟧
                 (xR i * y + x * yL j - xR i * yL j) * zL k⟧ =
             ⟦xR i * (y * z) + x * (yL j * z + y * zL k - yL j * zL k) -
                 xR i * (yL j * z + y * zL k - yL j * zL k)⟧
-        simp [quot_mul_assoc]; abel decreasing_by pgame_wf_tac
+        simp [quot_mul_assoc]; abel
+decreasing_by pgame_wf_tac
 #align pgame.quot_mul_assoc PGame.quot_mul_assoc
 
 /-- `x * y * z` is equivalent to `x * (y * z).`-/
Diff
@@ -29,7 +29,7 @@ the abelian group structure on games allows us to simplify many proofs for pre-g
 
 open Function PGame
 
-open PGame
+open scoped PGame
 
 universe u
 
Diff
@@ -58,21 +58,11 @@ instance : AddCommGroupWithOne Game where
   add :=
     Quotient.lift₂ (fun x y : PGame => ⟦x + y⟧) fun x₁ y₁ x₂ y₂ hx hy =>
       Quot.sound (PGame.add_congr hx hy)
-  add_zero := by
-    rintro ⟨x⟩
-    exact Quot.sound (add_zero_equiv x)
-  zero_add := by
-    rintro ⟨x⟩
-    exact Quot.sound (zero_add_equiv x)
-  add_assoc := by
-    rintro ⟨x⟩ ⟨y⟩ ⟨z⟩
-    exact Quot.sound add_assoc_equiv
-  add_left_neg := by
-    rintro ⟨x⟩
-    exact Quot.sound (add_left_neg_equiv x)
-  add_comm := by
-    rintro ⟨x⟩ ⟨y⟩
-    exact Quot.sound add_comm_equiv
+  add_zero := by rintro ⟨x⟩; exact Quot.sound (add_zero_equiv x)
+  zero_add := by rintro ⟨x⟩; exact Quot.sound (zero_add_equiv x)
+  add_assoc := by rintro ⟨x⟩ ⟨y⟩ ⟨z⟩; exact Quot.sound add_assoc_equiv
+  add_left_neg := by rintro ⟨x⟩; exact Quot.sound (add_left_neg_equiv x)
+  add_comm := by rintro ⟨x⟩ ⟨y⟩; exact Quot.sound add_comm_equiv
 
 instance : Inhabited Game :=
   ⟨0⟩
@@ -80,20 +70,11 @@ instance : Inhabited Game :=
 instance : PartialOrder Game
     where
   le := Quotient.lift₂ (· ≤ ·) fun x₁ y₁ x₂ y₂ hx hy => propext (le_congr hx hy)
-  le_refl := by
-    rintro ⟨x⟩
-    exact le_refl x
-  le_trans := by
-    rintro ⟨x⟩ ⟨y⟩ ⟨z⟩
-    exact @le_trans _ _ x y z
-  le_antisymm := by
-    rintro ⟨x⟩ ⟨y⟩ h₁ h₂
-    apply Quot.sound
-    exact ⟨h₁, h₂⟩
+  le_refl := by rintro ⟨x⟩; exact le_refl x
+  le_trans := by rintro ⟨x⟩ ⟨y⟩ ⟨z⟩; exact @le_trans _ _ x y z
+  le_antisymm := by rintro ⟨x⟩ ⟨y⟩ h₁ h₂; apply Quot.sound; exact ⟨h₁, h₂⟩
   lt := Quotient.lift₂ (· < ·) fun x₁ y₁ x₂ y₂ hx hy => propext (lt_congr hx hy)
-  lt_iff_le_not_le := by
-    rintro ⟨x⟩ ⟨y⟩
-    exact @lt_iff_le_not_le _ _ x y
+  lt_iff_le_not_le := by rintro ⟨x⟩ ⟨y⟩; exact @lt_iff_le_not_le _ _ x y
 
 /-- The less or fuzzy relation on games.
 
@@ -107,26 +88,16 @@ local infixl:50 " ⧏ " => Lf
 
 /-- On `game`, simp-normal inequalities should use as few negations as possible. -/
 @[simp]
-theorem not_le : ∀ {x y : Game}, ¬x ≤ y ↔ y ⧏ x :=
-  by
-  rintro ⟨x⟩ ⟨y⟩
-  exact PGame.not_le
+theorem not_le : ∀ {x y : Game}, ¬x ≤ y ↔ y ⧏ x := by rintro ⟨x⟩ ⟨y⟩; exact PGame.not_le
 #align game.not_le Game.not_le
 
 /-- On `game`, simp-normal inequalities should use as few negations as possible. -/
 @[simp]
-theorem not_lf : ∀ {x y : Game}, ¬x ⧏ y ↔ y ≤ x :=
-  by
-  rintro ⟨x⟩ ⟨y⟩
-  exact not_lf
+theorem not_lf : ∀ {x y : Game}, ¬x ⧏ y ↔ y ≤ x := by rintro ⟨x⟩ ⟨y⟩; exact not_lf
 #align game.not_lf Game.not_lf
 
 instance : IsTrichotomous Game (· ⧏ ·) :=
-  ⟨by
-    rintro ⟨x⟩ ⟨y⟩
-    change _ ∨ ⟦x⟧ = ⟦y⟧ ∨ _
-    rw [Quotient.eq']
-    apply lf_or_equiv_or_gf⟩
+  ⟨by rintro ⟨x⟩ ⟨y⟩; change _ ∨ ⟦x⟧ = ⟦y⟧ ∨ _; rw [Quotient.eq']; apply lf_or_equiv_or_gf⟩
 
 /-! It can be useful to use these lemmas to turn `pgame` inequalities into `game` inequalities, as
 the `add_comm_group` structure on `game` often simplifies many proofs. -/
@@ -163,38 +134,26 @@ theorem PGame.fuzzy_iff_game_fuzzy {x y : PGame} : PGame.Fuzzy x y ↔ ⟦x⟧ 
 #align pgame.fuzzy_iff_game_fuzzy PGame.fuzzy_iff_game_fuzzy
 
 instance covariantClass_add_le : CovariantClass Game Game (· + ·) (· ≤ ·) :=
-  ⟨by
-    rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h
-    exact @add_le_add_left _ _ _ _ b c h a⟩
+  ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_le_add_left _ _ _ _ b c h a⟩
 #align game.covariant_class_add_le Game.covariantClass_add_le
 
 instance covariantClass_swap_add_le : CovariantClass Game Game (swap (· + ·)) (· ≤ ·) :=
-  ⟨by
-    rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h
-    exact @add_le_add_right _ _ _ _ b c h a⟩
+  ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_le_add_right _ _ _ _ b c h a⟩
 #align game.covariant_class_swap_add_le Game.covariantClass_swap_add_le
 
 instance covariantClass_add_lt : CovariantClass Game Game (· + ·) (· < ·) :=
-  ⟨by
-    rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h
-    exact @add_lt_add_left _ _ _ _ b c h a⟩
+  ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_lt_add_left _ _ _ _ b c h a⟩
 #align game.covariant_class_add_lt Game.covariantClass_add_lt
 
 instance covariantClass_swap_add_lt : CovariantClass Game Game (swap (· + ·)) (· < ·) :=
-  ⟨by
-    rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h
-    exact @add_lt_add_right _ _ _ _ b c h a⟩
+  ⟨by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h; exact @add_lt_add_right _ _ _ _ b c h a⟩
 #align game.covariant_class_swap_add_lt Game.covariantClass_swap_add_lt
 
-theorem add_lf_add_right : ∀ {b c : Game} (h : b ⧏ c) (a), b + a ⧏ c + a :=
-  by
-  rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩
+theorem add_lf_add_right : ∀ {b c : Game} (h : b ⧏ c) (a), b + a ⧏ c + a := by rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩;
   apply add_lf_add_right h
 #align game.add_lf_add_right Game.add_lf_add_right
 
-theorem add_lf_add_left : ∀ {b c : Game} (h : b ⧏ c) (a), a + b ⧏ a + c :=
-  by
-  rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩
+theorem add_lf_add_left : ∀ {b c : Game} (h : b ⧏ c) (a), a + b ⧏ a + c := by rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩;
   apply add_lf_add_left h
 #align game.add_lf_add_left Game.add_lf_add_left
 
@@ -224,10 +183,8 @@ theorem quot_sub (a b : PGame) : ⟦a - b⟧ = ⟦a⟧ - ⟦b⟧ :=
 
 theorem quot_eq_of_mk'_quot_eq {x y : PGame} (L : x.LeftMoves ≃ y.LeftMoves)
     (R : x.RightMoves ≃ y.RightMoves) (hl : ∀ i, ⟦x.moveLeft i⟧ = ⟦y.moveLeft (L i)⟧)
-    (hr : ∀ j, ⟦x.moveRight j⟧ = ⟦y.moveRight (R j)⟧) : ⟦x⟧ = ⟦y⟧ :=
-  by
-  simp_rw [Quotient.eq'] at hl hr
-  exact Quot.sound (equiv_of_mk_equiv L R hl hr)
+    (hr : ∀ j, ⟦x.moveRight j⟧ = ⟦y.moveRight (R j)⟧) : ⟦x⟧ = ⟦y⟧ := by
+  simp_rw [Quotient.eq'] at hl hr; exact Quot.sound (equiv_of_mk_equiv L R hl hr)
 #align pgame.quot_eq_of_mk_quot_eq PGame.quot_eq_of_mk'_quot_eq
 
 /-! Multiplicative operations can be defined at the level of pre-games,
@@ -289,10 +246,7 @@ theorem mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
 theorem mul_moveLeft_inl {x y : PGame} {i j} :
     (x * y).moveLeft (toLeftMovesMul (Sum.inl (i, j))) =
       x.moveLeft i * y + x * y.moveLeft j - x.moveLeft i * y.moveLeft j :=
-  by
-  cases x
-  cases y
-  rfl
+  by cases x; cases y; rfl
 #align pgame.mul_move_left_inl PGame.mul_moveLeft_inl
 
 @[simp]
@@ -306,10 +260,7 @@ theorem mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
 theorem mul_moveLeft_inr {x y : PGame} {i j} :
     (x * y).moveLeft (toLeftMovesMul (Sum.inr (i, j))) =
       x.moveRight i * y + x * y.moveRight j - x.moveRight i * y.moveRight j :=
-  by
-  cases x
-  cases y
-  rfl
+  by cases x; cases y; rfl
 #align pgame.mul_move_left_inr PGame.mul_moveLeft_inr
 
 @[simp]
@@ -323,10 +274,7 @@ theorem mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
 theorem mul_moveRight_inl {x y : PGame} {i j} :
     (x * y).moveRight (toRightMovesMul (Sum.inl (i, j))) =
       x.moveLeft i * y + x * y.moveRight j - x.moveLeft i * y.moveRight j :=
-  by
-  cases x
-  cases y
-  rfl
+  by cases x; cases y; rfl
 #align pgame.mul_move_right_inl PGame.mul_moveRight_inl
 
 @[simp]
@@ -340,10 +288,7 @@ theorem mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
 theorem mul_moveRight_inr {x y : PGame} {i j} :
     (x * y).moveRight (toRightMovesMul (Sum.inr (i, j))) =
       x.moveRight i * y + x * y.moveLeft j - x.moveRight i * y.moveLeft j :=
-  by
-  cases x
-  cases y
-  rfl
+  by cases x; cases y; rfl
 #align pgame.mul_move_right_inr PGame.mul_moveRight_inr
 
 @[simp]
@@ -419,27 +364,19 @@ theorem mul_comm_equiv (x y : PGame) : x * y ≈ y * x :=
   Quotient.exact <| quot_mul_comm _ _
 #align pgame.mul_comm_equiv PGame.mul_comm_equiv
 
-instance isEmpty_mul_zero_leftMoves (x : PGame.{u}) : IsEmpty (x * 0).LeftMoves :=
-  by
-  cases x
+instance isEmpty_mul_zero_leftMoves (x : PGame.{u}) : IsEmpty (x * 0).LeftMoves := by cases x;
   apply Sum.isEmpty
 #align pgame.is_empty_mul_zero_left_moves PGame.isEmpty_mul_zero_leftMoves
 
-instance isEmpty_mul_zero_rightMoves (x : PGame.{u}) : IsEmpty (x * 0).RightMoves :=
-  by
-  cases x
+instance isEmpty_mul_zero_rightMoves (x : PGame.{u}) : IsEmpty (x * 0).RightMoves := by cases x;
   apply Sum.isEmpty
 #align pgame.is_empty_mul_zero_right_moves PGame.isEmpty_mul_zero_rightMoves
 
-instance isEmpty_zero_mul_leftMoves (x : PGame.{u}) : IsEmpty (0 * x).LeftMoves :=
-  by
-  cases x
+instance isEmpty_zero_mul_leftMoves (x : PGame.{u}) : IsEmpty (0 * x).LeftMoves := by cases x;
   apply Sum.isEmpty
 #align pgame.is_empty_zero_mul_left_moves PGame.isEmpty_zero_mul_leftMoves
 
-instance isEmpty_zero_mul_rightMoves (x : PGame.{u}) : IsEmpty (0 * x).RightMoves :=
-  by
-  cases x
+instance isEmpty_zero_mul_rightMoves (x : PGame.{u}) : IsEmpty (0 * x).RightMoves := by cases x;
   apply Sum.isEmpty
 #align pgame.is_empty_zero_mul_right_moves PGame.isEmpty_zero_mul_rightMoves
 
@@ -528,44 +465,36 @@ theorem quot_left_distrib : ∀ x y z : PGame, ⟦x * (y + z)⟧ = ⟦x * y⟧ +
       · change
           ⟦xL i * (y + z) + x * (yL j + z) - xL i * (yL j + z)⟧ =
             ⟦xL i * y + x * yL j - xL i * yL j + x * z⟧
-        simp [quot_left_distrib]
-        abel
+        simp [quot_left_distrib]; abel
       · change
           ⟦xL i * (y + z) + x * (y + zL k) - xL i * (y + zL k)⟧ =
             ⟦x * y + (xL i * z + x * zL k - xL i * zL k)⟧
-        simp [quot_left_distrib]
-        abel
+        simp [quot_left_distrib]; abel
       · change
           ⟦xR i * (y + z) + x * (yR j + z) - xR i * (yR j + z)⟧ =
             ⟦xR i * y + x * yR j - xR i * yR j + x * z⟧
-        simp [quot_left_distrib]
-        abel
+        simp [quot_left_distrib]; abel
       · change
           ⟦xR i * (y + z) + x * (y + zR k) - xR i * (y + zR k)⟧ =
             ⟦x * y + (xR i * z + x * zR k - xR i * zR k)⟧
-        simp [quot_left_distrib]
-        abel
+        simp [quot_left_distrib]; abel
     · rintro (⟨i, j | k⟩ | ⟨i, j | k⟩)
       · change
           ⟦xL i * (y + z) + x * (yR j + z) - xL i * (yR j + z)⟧ =
             ⟦xL i * y + x * yR j - xL i * yR j + x * z⟧
-        simp [quot_left_distrib]
-        abel
+        simp [quot_left_distrib]; abel
       · change
           ⟦xL i * (y + z) + x * (y + zR k) - xL i * (y + zR k)⟧ =
             ⟦x * y + (xL i * z + x * zR k - xL i * zR k)⟧
-        simp [quot_left_distrib]
-        abel
+        simp [quot_left_distrib]; abel
       · change
           ⟦xR i * (y + z) + x * (yL j + z) - xR i * (yL j + z)⟧ =
             ⟦xR i * y + x * yL j - xR i * yL j + x * z⟧
-        simp [quot_left_distrib]
-        abel
+        simp [quot_left_distrib]; abel
       · change
           ⟦xR i * (y + z) + x * (y + zL k) - xR i * (y + zL k)⟧ =
             ⟦x * y + (xR i * z + x * zL k - xR i * zL k)⟧
-        simp [quot_left_distrib]
-        abel decreasing_by pgame_wf_tac
+        simp [quot_left_distrib]; abel decreasing_by pgame_wf_tac
 #align pgame.quot_left_distrib PGame.quot_left_distrib
 
 /-- `x * (y + z)` is equivalent to `x * y + x * z.`-/
@@ -574,10 +503,8 @@ theorem left_distrib_equiv (x y z : PGame) : x * (y + z) ≈ x * y + x * z :=
 #align pgame.left_distrib_equiv PGame.left_distrib_equiv
 
 @[simp]
-theorem quot_left_distrib_sub (x y z : PGame) : ⟦x * (y - z)⟧ = ⟦x * y⟧ - ⟦x * z⟧ :=
-  by
-  change ⟦x * (y + -z)⟧ = ⟦x * y⟧ + -⟦x * z⟧
-  rw [quot_left_distrib, quot_mul_neg]
+theorem quot_left_distrib_sub (x y z : PGame) : ⟦x * (y - z)⟧ = ⟦x * y⟧ - ⟦x * z⟧ := by
+  change ⟦x * (y + -z)⟧ = ⟦x * y⟧ + -⟦x * z⟧; rw [quot_left_distrib, quot_mul_neg]
 #align pgame.quot_left_distrib_sub PGame.quot_left_distrib_sub
 
 @[simp]
@@ -591,10 +518,8 @@ theorem right_distrib_equiv (x y z : PGame) : (x + y) * z ≈ x * z + y * z :=
 #align pgame.right_distrib_equiv PGame.right_distrib_equiv
 
 @[simp]
-theorem quot_right_distrib_sub (x y z : PGame) : ⟦(y - z) * x⟧ = ⟦y * x⟧ - ⟦z * x⟧ :=
-  by
-  change ⟦(y + -z) * x⟧ = ⟦y * x⟧ + -⟦z * x⟧
-  rw [quot_right_distrib, quot_neg_mul]
+theorem quot_right_distrib_sub (x y z : PGame) : ⟦(y - z) * x⟧ = ⟦y * x⟧ - ⟦z * x⟧ := by
+  change ⟦(y + -z) * x⟧ = ⟦y * x⟧ + -⟦z * x⟧; rw [quot_right_distrib, quot_neg_mul]
 #align pgame.quot_right_distrib_sub PGame.quot_right_distrib_sub
 
 /-- `x * 1` has the same moves as `x`. -/
@@ -671,58 +596,50 @@ theorem quot_mul_assoc : ∀ x y z : PGame, ⟦x * y * z⟧ = ⟦x * (y * z)⟧
                 (xL i * y + x * yL j - xL i * yL j) * zL k⟧ =
             ⟦xL i * (y * z) + x * (yL j * z + y * zL k - yL j * zL k) -
                 xL i * (yL j * z + y * zL k - yL j * zL k)⟧
-        simp [quot_mul_assoc]
-        abel
+        simp [quot_mul_assoc]; abel
       · change
           ⟦(xR i * y + x * yR j - xR i * yR j) * z + x * y * zL k -
                 (xR i * y + x * yR j - xR i * yR j) * zL k⟧ =
             ⟦xR i * (y * z) + x * (yR j * z + y * zL k - yR j * zL k) -
                 xR i * (yR j * z + y * zL k - yR j * zL k)⟧
-        simp [quot_mul_assoc]
-        abel
+        simp [quot_mul_assoc]; abel
       · change
           ⟦(xL i * y + x * yR j - xL i * yR j) * z + x * y * zR k -
                 (xL i * y + x * yR j - xL i * yR j) * zR k⟧ =
             ⟦xL i * (y * z) + x * (yR j * z + y * zR k - yR j * zR k) -
                 xL i * (yR j * z + y * zR k - yR j * zR k)⟧
-        simp [quot_mul_assoc]
-        abel
+        simp [quot_mul_assoc]; abel
       · change
           ⟦(xR i * y + x * yL j - xR i * yL j) * z + x * y * zR k -
                 (xR i * y + x * yL j - xR i * yL j) * zR k⟧ =
             ⟦xR i * (y * z) + x * (yL j * z + y * zR k - yL j * zR k) -
                 xR i * (yL j * z + y * zR k - yL j * zR k)⟧
-        simp [quot_mul_assoc]
-        abel
+        simp [quot_mul_assoc]; abel
     · rintro (⟨⟨i, j⟩ | ⟨i, j⟩, k⟩ | ⟨⟨i, j⟩ | ⟨i, j⟩, k⟩)
       · change
           ⟦(xL i * y + x * yL j - xL i * yL j) * z + x * y * zR k -
                 (xL i * y + x * yL j - xL i * yL j) * zR k⟧ =
             ⟦xL i * (y * z) + x * (yL j * z + y * zR k - yL j * zR k) -
                 xL i * (yL j * z + y * zR k - yL j * zR k)⟧
-        simp [quot_mul_assoc]
-        abel
+        simp [quot_mul_assoc]; abel
       · change
           ⟦(xR i * y + x * yR j - xR i * yR j) * z + x * y * zR k -
                 (xR i * y + x * yR j - xR i * yR j) * zR k⟧ =
             ⟦xR i * (y * z) + x * (yR j * z + y * zR k - yR j * zR k) -
                 xR i * (yR j * z + y * zR k - yR j * zR k)⟧
-        simp [quot_mul_assoc]
-        abel
+        simp [quot_mul_assoc]; abel
       · change
           ⟦(xL i * y + x * yR j - xL i * yR j) * z + x * y * zL k -
                 (xL i * y + x * yR j - xL i * yR j) * zL k⟧ =
             ⟦xL i * (y * z) + x * (yR j * z + y * zL k - yR j * zL k) -
                 xL i * (yR j * z + y * zL k - yR j * zL k)⟧
-        simp [quot_mul_assoc]
-        abel
+        simp [quot_mul_assoc]; abel
       · change
           ⟦(xR i * y + x * yL j - xR i * yL j) * z + x * y * zL k -
                 (xR i * y + x * yL j - xR i * yL j) * zL k⟧ =
             ⟦xR i * (y * z) + x * (yL j * z + y * zL k - yL j * zL k) -
                 xR i * (yL j * z + y * zL k - yL j * zL k)⟧
-        simp [quot_mul_assoc]
-        abel decreasing_by pgame_wf_tac
+        simp [quot_mul_assoc]; abel decreasing_by pgame_wf_tac
 #align pgame.quot_mul_assoc PGame.quot_mul_assoc
 
 /-- `x * y * z` is equivalent to `x * (y * z).`-/
@@ -748,11 +665,7 @@ instance (l r : Type u) : Inhabited (InvTy l r false) :=
   ⟨InvTy.zero⟩
 
 instance uniqueInvTy (l r : Type u) [IsEmpty l] [IsEmpty r] : Unique (InvTy l r false) :=
-  { InvTy.inhabited l r with
-    uniq := by
-      rintro (a | a | a)
-      rfl
-      all_goals exact isEmptyElim a }
+  { InvTy.inhabited l r with uniq := by rintro (a | a | a); rfl; all_goals exact isEmptyElim a }
 #align pgame.unique_inv_ty PGame.uniqueInvTy
 
 /-- Because the two halves of the definition of `inv` produce more elements
@@ -791,9 +704,7 @@ def inv' : PGame → PGame
 #align pgame.inv' PGame.inv'
 
 theorem zero_lf_inv' : ∀ x : PGame, 0 ⧏ inv' x
-  | ⟨xl, xr, xL, xR⟩ => by
-    convert lf_mk _ _ inv_ty.zero
-    rfl
+  | ⟨xl, xr, xL, xR⟩ => by convert lf_mk _ _ inv_ty.zero; rfl
 #align pgame.zero_lf_inv' PGame.zero_lf_inv'
 
 /-- `inv' 0` has exactly the same moves as `1`. -/
@@ -817,9 +728,7 @@ theorem inv'_zero_equiv : inv' 0 ≈ 1 :=
 def inv'One : inv' 1 ≡r (1 : PGame.{u}) :=
   by
   change relabelling (mk _ _ _ _) 1
-  have : IsEmpty { i : PUnit.{u + 1} // (0 : PGame.{u}) < 0 } :=
-    by
-    rw [lt_self_iff_false]
+  have : IsEmpty { i : PUnit.{u + 1} // (0 : PGame.{u}) < 0 } := by rw [lt_self_iff_false];
     infer_instance
   refine' ⟨_, _, fun i => _, IsEmpty.elim _⟩ <;> dsimp
   · apply Equiv.equivPUnit
@@ -856,9 +765,7 @@ theorem inv_eq_of_lf_zero {x : PGame} (h : x ⧏ 0) : x⁻¹ = -inv' (-x) := by
 #align pgame.inv_eq_of_lf_zero PGame.inv_eq_of_lf_zero
 
 /-- `1⁻¹` has exactly the same moves as `1`. -/
-def invOne : 1⁻¹ ≡r 1 := by
-  rw [inv_eq_of_pos PGame.zero_lt_one]
-  exact inv'_one
+def invOne : 1⁻¹ ≡r 1 := by rw [inv_eq_of_pos PGame.zero_lt_one]; exact inv'_one
 #align pgame.inv_one PGame.invOne
 
 theorem inv_one_equiv : 1⁻¹ ≈ 1 :=
Diff
@@ -27,15 +27,15 @@ the abelian group structure on games allows us to simplify many proofs for pre-g
 -/
 
 
-open Function Pgame
+open Function PGame
 
-open Pgame
+open PGame
 
 universe u
 
-instance Pgame.setoid : Setoid Pgame :=
-  ⟨(· ≈ ·), equiv_refl, @Pgame.Equiv.symm, @Pgame.Equiv.trans⟩
-#align pgame.setoid Pgame.setoid
+instance PGame.setoid : Setoid PGame :=
+  ⟨(· ≈ ·), equiv_refl, @PGame.Equiv.symm, @PGame.Equiv.trans⟩
+#align pgame.setoid PGame.setoid
 
 /-- The type of combinatorial games. In ZFC, a combinatorial game is constructed from
   two sets of combinatorial games that have been constructed at an earlier
@@ -46,7 +46,7 @@ instance Pgame.setoid : Setoid Pgame :=
   A combinatorial game is then constructed by quotienting by the equivalence
   `x ≈ y ↔ x ≤ y ∧ y ≤ x`. -/
 abbrev Game :=
-  Quotient Pgame.setoid
+  Quotient PGame.setoid
 #align game Game
 
 namespace Game
@@ -56,8 +56,8 @@ instance : AddCommGroupWithOne Game where
   one := ⟦1⟧
   neg := Quot.lift (fun x => ⟦-x⟧) fun x y h => Quot.sound ((@neg_equiv_neg_iff x y).2 h)
   add :=
-    Quotient.lift₂ (fun x y : Pgame => ⟦x + y⟧) fun x₁ y₁ x₂ y₂ hx hy =>
-      Quot.sound (Pgame.add_congr hx hy)
+    Quotient.lift₂ (fun x y : PGame => ⟦x + y⟧) fun x₁ y₁ x₂ y₂ hx hy =>
+      Quot.sound (PGame.add_congr hx hy)
   add_zero := by
     rintro ⟨x⟩
     exact Quot.sound (add_zero_equiv x)
@@ -110,7 +110,7 @@ local infixl:50 " ⧏ " => Lf
 theorem not_le : ∀ {x y : Game}, ¬x ≤ y ↔ y ⧏ x :=
   by
   rintro ⟨x⟩ ⟨y⟩
-  exact Pgame.not_le
+  exact PGame.not_le
 #align game.not_le Game.not_le
 
 /-- On `game`, simp-normal inequalities should use as few negations as possible. -/
@@ -132,21 +132,21 @@ instance : IsTrichotomous Game (· ⧏ ·) :=
 the `add_comm_group` structure on `game` often simplifies many proofs. -/
 
 
-theorem Pgame.le_iff_game_le {x y : Pgame} : x ≤ y ↔ ⟦x⟧ ≤ ⟦y⟧ :=
+theorem PGame.le_iff_game_le {x y : PGame} : x ≤ y ↔ ⟦x⟧ ≤ ⟦y⟧ :=
   Iff.rfl
-#align pgame.le_iff_game_le Pgame.le_iff_game_le
+#align pgame.le_iff_game_le PGame.le_iff_game_le
 
-theorem Pgame.lf_iff_game_lf {x y : Pgame} : Pgame.Lf x y ↔ ⟦x⟧ ⧏ ⟦y⟧ :=
+theorem PGame.lf_iff_game_lf {x y : PGame} : PGame.Lf x y ↔ ⟦x⟧ ⧏ ⟦y⟧ :=
   Iff.rfl
-#align pgame.lf_iff_game_lf Pgame.lf_iff_game_lf
+#align pgame.lf_iff_game_lf PGame.lf_iff_game_lf
 
-theorem Pgame.lt_iff_game_lt {x y : Pgame} : x < y ↔ ⟦x⟧ < ⟦y⟧ :=
+theorem PGame.lt_iff_game_lt {x y : PGame} : x < y ↔ ⟦x⟧ < ⟦y⟧ :=
   Iff.rfl
-#align pgame.lt_iff_game_lt Pgame.lt_iff_game_lt
+#align pgame.lt_iff_game_lt PGame.lt_iff_game_lt
 
-theorem Pgame.equiv_iff_game_eq {x y : Pgame} : (x ≈ y) ↔ ⟦x⟧ = ⟦y⟧ :=
+theorem PGame.equiv_iff_game_eq {x y : PGame} : (x ≈ y) ↔ ⟦x⟧ = ⟦y⟧ :=
   (@Quotient.eq' _ _ x y).symm
-#align pgame.equiv_iff_game_eq Pgame.equiv_iff_game_eq
+#align pgame.equiv_iff_game_eq PGame.equiv_iff_game_eq
 
 /-- The fuzzy, confused, or incomparable relation on games.
 
@@ -158,9 +158,9 @@ def Fuzzy : Game → Game → Prop :=
 -- mathport name: «expr ‖ »
 local infixl:50 " ‖ " => Fuzzy
 
-theorem Pgame.fuzzy_iff_game_fuzzy {x y : Pgame} : Pgame.Fuzzy x y ↔ ⟦x⟧ ‖ ⟦y⟧ :=
+theorem PGame.fuzzy_iff_game_fuzzy {x y : PGame} : PGame.Fuzzy x y ↔ ⟦x⟧ ‖ ⟦y⟧ :=
   Iff.rfl
-#align pgame.fuzzy_iff_game_fuzzy Pgame.fuzzy_iff_game_fuzzy
+#align pgame.fuzzy_iff_game_fuzzy PGame.fuzzy_iff_game_fuzzy
 
 instance covariantClass_add_le : CovariantClass Game Game (· + ·) (· ≤ ·) :=
   ⟨by
@@ -205,30 +205,30 @@ instance orderedAddCommGroup : OrderedAddCommGroup Game :=
 
 end Game
 
-namespace Pgame
+namespace PGame
 
 @[simp]
-theorem quot_neg (a : Pgame) : ⟦-a⟧ = -⟦a⟧ :=
+theorem quot_neg (a : PGame) : ⟦-a⟧ = -⟦a⟧ :=
   rfl
-#align pgame.quot_neg Pgame.quot_neg
+#align pgame.quot_neg PGame.quot_neg
 
 @[simp]
-theorem quot_add (a b : Pgame) : ⟦a + b⟧ = ⟦a⟧ + ⟦b⟧ :=
+theorem quot_add (a b : PGame) : ⟦a + b⟧ = ⟦a⟧ + ⟦b⟧ :=
   rfl
-#align pgame.quot_add Pgame.quot_add
+#align pgame.quot_add PGame.quot_add
 
 @[simp]
-theorem quot_sub (a b : Pgame) : ⟦a - b⟧ = ⟦a⟧ - ⟦b⟧ :=
+theorem quot_sub (a b : PGame) : ⟦a - b⟧ = ⟦a⟧ - ⟦b⟧ :=
   rfl
-#align pgame.quot_sub Pgame.quot_sub
+#align pgame.quot_sub PGame.quot_sub
 
-theorem quot_eq_of_mk'_quot_eq {x y : Pgame} (L : x.LeftMoves ≃ y.LeftMoves)
+theorem quot_eq_of_mk'_quot_eq {x y : PGame} (L : x.LeftMoves ≃ y.LeftMoves)
     (R : x.RightMoves ≃ y.RightMoves) (hl : ∀ i, ⟦x.moveLeft i⟧ = ⟦y.moveLeft (L i)⟧)
     (hr : ∀ j, ⟦x.moveRight j⟧ = ⟦y.moveRight (R j)⟧) : ⟦x⟧ = ⟦y⟧ :=
   by
   simp_rw [Quotient.eq'] at hl hr
   exact Quot.sound (equiv_of_mk_equiv L R hl hr)
-#align pgame.quot_eq_of_mk_quot_eq Pgame.quot_eq_of_mk'_quot_eq
+#align pgame.quot_eq_of_mk_quot_eq PGame.quot_eq_of_mk'_quot_eq
 
 /-! Multiplicative operations can be defined at the level of pre-games,
 but to prove their properties we need to use the abelian group structure of games.
@@ -237,7 +237,7 @@ Hence we define them here. -/
 
 /-- The product of `x = {xL | xR}` and `y = {yL | yR}` is
 `{xL*y + x*yL - xL*yL, xR*y + x*yR - xR*yR | xL*y + x*yR - xL*yR, x*yL + xR*y - xR*yL }`. -/
-instance : Mul Pgame.{u} :=
+instance : Mul PGame.{u} :=
   ⟨fun x y => by
     induction' x with xl xr xL xR IHxl IHxr generalizing y
     induction' y with yl yr yL yR IHyl IHyr
@@ -249,132 +249,132 @@ instance : Mul Pgame.{u} :=
     · exact IHxr i y + IHyl j - IHxr i (yL j)⟩
 
 theorem leftMoves_mul :
-    ∀ x y : Pgame.{u},
+    ∀ x y : PGame.{u},
       (x * y).LeftMoves = Sum (x.LeftMoves × y.LeftMoves) (x.RightMoves × y.RightMoves)
   | ⟨_, _, _, _⟩, ⟨_, _, _, _⟩ => rfl
-#align pgame.left_moves_mul Pgame.leftMoves_mul
+#align pgame.left_moves_mul PGame.leftMoves_mul
 
 theorem rightMoves_mul :
-    ∀ x y : Pgame.{u},
+    ∀ x y : PGame.{u},
       (x * y).RightMoves = Sum (x.LeftMoves × y.RightMoves) (x.RightMoves × y.LeftMoves)
   | ⟨_, _, _, _⟩, ⟨_, _, _, _⟩ => rfl
-#align pgame.right_moves_mul Pgame.rightMoves_mul
+#align pgame.right_moves_mul PGame.rightMoves_mul
 
 /-- Turns two left or right moves for `x` and `y` into a left move for `x * y` and vice versa.
 
 Even though these types are the same (not definitionally so), this is the preferred way to convert
 between them. -/
-def toLeftMovesMul {x y : Pgame} :
+def toLeftMovesMul {x y : PGame} :
     Sum (x.LeftMoves × y.LeftMoves) (x.RightMoves × y.RightMoves) ≃ (x * y).LeftMoves :=
   Equiv.cast (leftMoves_mul x y).symm
-#align pgame.to_left_moves_mul Pgame.toLeftMovesMul
+#align pgame.to_left_moves_mul PGame.toLeftMovesMul
 
 /-- Turns a left and a right move for `x` and `y` into a right move for `x * y` and vice versa.
 
 Even though these types are the same (not definitionally so), this is the preferred way to convert
 between them. -/
-def toRightMovesMul {x y : Pgame} :
+def toRightMovesMul {x y : PGame} :
     Sum (x.LeftMoves × y.RightMoves) (x.RightMoves × y.LeftMoves) ≃ (x * y).RightMoves :=
   Equiv.cast (rightMoves_mul x y).symm
-#align pgame.to_right_moves_mul Pgame.toRightMovesMul
+#align pgame.to_right_moves_mul PGame.toRightMovesMul
 
 @[simp]
 theorem mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveLeft (Sum.inl (i, j)) =
       xL i * mk yl yr yL yR + mk xl xr xL xR * yL j - xL i * yL j :=
   rfl
-#align pgame.mk_mul_move_left_inl Pgame.mk_mul_moveLeft_inl
+#align pgame.mk_mul_move_left_inl PGame.mk_mul_moveLeft_inl
 
 @[simp]
-theorem mul_moveLeft_inl {x y : Pgame} {i j} :
+theorem mul_moveLeft_inl {x y : PGame} {i j} :
     (x * y).moveLeft (toLeftMovesMul (Sum.inl (i, j))) =
       x.moveLeft i * y + x * y.moveLeft j - x.moveLeft i * y.moveLeft j :=
   by
   cases x
   cases y
   rfl
-#align pgame.mul_move_left_inl Pgame.mul_moveLeft_inl
+#align pgame.mul_move_left_inl PGame.mul_moveLeft_inl
 
 @[simp]
 theorem mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveLeft (Sum.inr (i, j)) =
       xR i * mk yl yr yL yR + mk xl xr xL xR * yR j - xR i * yR j :=
   rfl
-#align pgame.mk_mul_move_left_inr Pgame.mk_mul_moveLeft_inr
+#align pgame.mk_mul_move_left_inr PGame.mk_mul_moveLeft_inr
 
 @[simp]
-theorem mul_moveLeft_inr {x y : Pgame} {i j} :
+theorem mul_moveLeft_inr {x y : PGame} {i j} :
     (x * y).moveLeft (toLeftMovesMul (Sum.inr (i, j))) =
       x.moveRight i * y + x * y.moveRight j - x.moveRight i * y.moveRight j :=
   by
   cases x
   cases y
   rfl
-#align pgame.mul_move_left_inr Pgame.mul_moveLeft_inr
+#align pgame.mul_move_left_inr PGame.mul_moveLeft_inr
 
 @[simp]
 theorem mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveRight (Sum.inl (i, j)) =
       xL i * mk yl yr yL yR + mk xl xr xL xR * yR j - xL i * yR j :=
   rfl
-#align pgame.mk_mul_move_right_inl Pgame.mk_mul_moveRight_inl
+#align pgame.mk_mul_move_right_inl PGame.mk_mul_moveRight_inl
 
 @[simp]
-theorem mul_moveRight_inl {x y : Pgame} {i j} :
+theorem mul_moveRight_inl {x y : PGame} {i j} :
     (x * y).moveRight (toRightMovesMul (Sum.inl (i, j))) =
       x.moveLeft i * y + x * y.moveRight j - x.moveLeft i * y.moveRight j :=
   by
   cases x
   cases y
   rfl
-#align pgame.mul_move_right_inl Pgame.mul_moveRight_inl
+#align pgame.mul_move_right_inl PGame.mul_moveRight_inl
 
 @[simp]
 theorem mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveRight (Sum.inr (i, j)) =
       xR i * mk yl yr yL yR + mk xl xr xL xR * yL j - xR i * yL j :=
   rfl
-#align pgame.mk_mul_move_right_inr Pgame.mk_mul_moveRight_inr
+#align pgame.mk_mul_move_right_inr PGame.mk_mul_moveRight_inr
 
 @[simp]
-theorem mul_moveRight_inr {x y : Pgame} {i j} :
+theorem mul_moveRight_inr {x y : PGame} {i j} :
     (x * y).moveRight (toRightMovesMul (Sum.inr (i, j))) =
       x.moveRight i * y + x * y.moveLeft j - x.moveRight i * y.moveLeft j :=
   by
   cases x
   cases y
   rfl
-#align pgame.mul_move_right_inr Pgame.mul_moveRight_inr
+#align pgame.mul_move_right_inr PGame.mul_moveRight_inr
 
 @[simp]
 theorem neg_mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveLeft (Sum.inl (i, j)) =
       -(xL i * mk yl yr yL yR + mk xl xr xL xR * yR j - xL i * yR j) :=
   rfl
-#align pgame.neg_mk_mul_move_left_inl Pgame.neg_mk_mul_moveLeft_inl
+#align pgame.neg_mk_mul_move_left_inl PGame.neg_mk_mul_moveLeft_inl
 
 @[simp]
 theorem neg_mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveLeft (Sum.inr (i, j)) =
       -(xR i * mk yl yr yL yR + mk xl xr xL xR * yL j - xR i * yL j) :=
   rfl
-#align pgame.neg_mk_mul_move_left_inr Pgame.neg_mk_mul_moveLeft_inr
+#align pgame.neg_mk_mul_move_left_inr PGame.neg_mk_mul_moveLeft_inr
 
 @[simp]
 theorem neg_mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveRight (Sum.inl (i, j)) =
       -(xL i * mk yl yr yL yR + mk xl xr xL xR * yL j - xL i * yL j) :=
   rfl
-#align pgame.neg_mk_mul_move_right_inl Pgame.neg_mk_mul_moveRight_inl
+#align pgame.neg_mk_mul_move_right_inl PGame.neg_mk_mul_moveRight_inl
 
 @[simp]
 theorem neg_mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveRight (Sum.inr (i, j)) =
       -(xR i * mk yl yr yL yR + mk xl xr xL xR * yR j - xR i * yR j) :=
   rfl
-#align pgame.neg_mk_mul_move_right_inr Pgame.neg_mk_mul_moveRight_inr
+#align pgame.neg_mk_mul_move_right_inr PGame.neg_mk_mul_moveRight_inr
 
-theorem leftMoves_mul_cases {x y : Pgame} (k) {P : (x * y).LeftMoves → Prop}
+theorem leftMoves_mul_cases {x y : PGame} (k) {P : (x * y).LeftMoves → Prop}
     (hl : ∀ ix iy, P <| toLeftMovesMul (Sum.inl ⟨ix, iy⟩))
     (hr : ∀ jx jy, P <| toLeftMovesMul (Sum.inr ⟨jx, jy⟩)) : P k :=
   by
@@ -382,9 +382,9 @@ theorem leftMoves_mul_cases {x y : Pgame} (k) {P : (x * y).LeftMoves → Prop}
   rcases to_left_moves_mul.symm k with (⟨ix, iy⟩ | ⟨jx, jy⟩)
   · apply hl
   · apply hr
-#align pgame.left_moves_mul_cases Pgame.leftMoves_mul_cases
+#align pgame.left_moves_mul_cases PGame.leftMoves_mul_cases
 
-theorem rightMoves_mul_cases {x y : Pgame} (k) {P : (x * y).RightMoves → Prop}
+theorem rightMoves_mul_cases {x y : PGame} (k) {P : (x * y).RightMoves → Prop}
     (hl : ∀ ix jy, P <| toRightMovesMul (Sum.inl ⟨ix, jy⟩))
     (hr : ∀ jx iy, P <| toRightMovesMul (Sum.inr ⟨jx, iy⟩)) : P k :=
   by
@@ -392,10 +392,10 @@ theorem rightMoves_mul_cases {x y : Pgame} (k) {P : (x * y).RightMoves → Prop}
   rcases to_right_moves_mul.symm k with (⟨ix, iy⟩ | ⟨jx, jy⟩)
   · apply hl
   · apply hr
-#align pgame.right_moves_mul_cases Pgame.rightMoves_mul_cases
+#align pgame.right_moves_mul_cases PGame.rightMoves_mul_cases
 
 /-- `x * y` and `y * x` have the same moves. -/
-def mulCommRelabelling : ∀ x y : Pgame.{u}, x * y ≡r y * x
+def mulCommRelabelling : ∀ x y : PGame.{u}, x * y ≡r y * x
   | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
     refine'
             ⟨Equiv.sumCongr (Equiv.prodComm _ _) (Equiv.prodComm _ _),
@@ -408,98 +408,98 @@ def mulCommRelabelling : ∀ x y : Pgame.{u}, x * y ≡r y * x
               (mul_comm_relabelling _ _).addCongr (mul_comm_relabelling _ _)).subCongr
           (mul_comm_relabelling _ _)decreasing_by
   pgame_wf_tac
-#align pgame.mul_comm_relabelling Pgame.mulCommRelabelling
+#align pgame.mul_comm_relabelling PGame.mulCommRelabelling
 
-theorem quot_mul_comm (x y : Pgame.{u}) : ⟦x * y⟧ = ⟦y * x⟧ :=
+theorem quot_mul_comm (x y : PGame.{u}) : ⟦x * y⟧ = ⟦y * x⟧ :=
   Quot.sound (mulCommRelabelling x y).Equiv
-#align pgame.quot_mul_comm Pgame.quot_mul_comm
+#align pgame.quot_mul_comm PGame.quot_mul_comm
 
 /-- `x * y` is equivalent to `y * x`. -/
-theorem mul_comm_equiv (x y : Pgame) : x * y ≈ y * x :=
+theorem mul_comm_equiv (x y : PGame) : x * y ≈ y * x :=
   Quotient.exact <| quot_mul_comm _ _
-#align pgame.mul_comm_equiv Pgame.mul_comm_equiv
+#align pgame.mul_comm_equiv PGame.mul_comm_equiv
 
-instance isEmpty_mul_zero_leftMoves (x : Pgame.{u}) : IsEmpty (x * 0).LeftMoves :=
+instance isEmpty_mul_zero_leftMoves (x : PGame.{u}) : IsEmpty (x * 0).LeftMoves :=
   by
   cases x
   apply Sum.isEmpty
-#align pgame.is_empty_mul_zero_left_moves Pgame.isEmpty_mul_zero_leftMoves
+#align pgame.is_empty_mul_zero_left_moves PGame.isEmpty_mul_zero_leftMoves
 
-instance isEmpty_mul_zero_rightMoves (x : Pgame.{u}) : IsEmpty (x * 0).RightMoves :=
+instance isEmpty_mul_zero_rightMoves (x : PGame.{u}) : IsEmpty (x * 0).RightMoves :=
   by
   cases x
   apply Sum.isEmpty
-#align pgame.is_empty_mul_zero_right_moves Pgame.isEmpty_mul_zero_rightMoves
+#align pgame.is_empty_mul_zero_right_moves PGame.isEmpty_mul_zero_rightMoves
 
-instance isEmpty_zero_mul_leftMoves (x : Pgame.{u}) : IsEmpty (0 * x).LeftMoves :=
+instance isEmpty_zero_mul_leftMoves (x : PGame.{u}) : IsEmpty (0 * x).LeftMoves :=
   by
   cases x
   apply Sum.isEmpty
-#align pgame.is_empty_zero_mul_left_moves Pgame.isEmpty_zero_mul_leftMoves
+#align pgame.is_empty_zero_mul_left_moves PGame.isEmpty_zero_mul_leftMoves
 
-instance isEmpty_zero_mul_rightMoves (x : Pgame.{u}) : IsEmpty (0 * x).RightMoves :=
+instance isEmpty_zero_mul_rightMoves (x : PGame.{u}) : IsEmpty (0 * x).RightMoves :=
   by
   cases x
   apply Sum.isEmpty
-#align pgame.is_empty_zero_mul_right_moves Pgame.isEmpty_zero_mul_rightMoves
+#align pgame.is_empty_zero_mul_right_moves PGame.isEmpty_zero_mul_rightMoves
 
 /-- `x * 0` has exactly the same moves as `0`. -/
-def mulZeroRelabelling (x : Pgame) : x * 0 ≡r 0 :=
+def mulZeroRelabelling (x : PGame) : x * 0 ≡r 0 :=
   Relabelling.isEmpty _
-#align pgame.mul_zero_relabelling Pgame.mulZeroRelabelling
+#align pgame.mul_zero_relabelling PGame.mulZeroRelabelling
 
 /-- `x * 0` is equivalent to `0`. -/
-theorem mul_zero_equiv (x : Pgame) : x * 0 ≈ 0 :=
+theorem mul_zero_equiv (x : PGame) : x * 0 ≈ 0 :=
   (mulZeroRelabelling x).Equiv
-#align pgame.mul_zero_equiv Pgame.mul_zero_equiv
+#align pgame.mul_zero_equiv PGame.mul_zero_equiv
 
 @[simp]
-theorem quot_mul_zero (x : Pgame) : ⟦x * 0⟧ = ⟦0⟧ :=
+theorem quot_mul_zero (x : PGame) : ⟦x * 0⟧ = ⟦0⟧ :=
   @Quotient.sound _ _ (x * 0) _ x.mul_zero_equiv
-#align pgame.quot_mul_zero Pgame.quot_mul_zero
+#align pgame.quot_mul_zero PGame.quot_mul_zero
 
 /-- `0 * x` has exactly the same moves as `0`. -/
-def zeroMulRelabelling (x : Pgame) : 0 * x ≡r 0 :=
+def zeroMulRelabelling (x : PGame) : 0 * x ≡r 0 :=
   Relabelling.isEmpty _
-#align pgame.zero_mul_relabelling Pgame.zeroMulRelabelling
+#align pgame.zero_mul_relabelling PGame.zeroMulRelabelling
 
 /-- `0 * x` is equivalent to `0`. -/
-theorem zero_mul_equiv (x : Pgame) : 0 * x ≈ 0 :=
+theorem zero_mul_equiv (x : PGame) : 0 * x ≈ 0 :=
   (zeroMulRelabelling x).Equiv
-#align pgame.zero_mul_equiv Pgame.zero_mul_equiv
+#align pgame.zero_mul_equiv PGame.zero_mul_equiv
 
 @[simp]
-theorem quot_zero_mul (x : Pgame) : ⟦0 * x⟧ = ⟦0⟧ :=
+theorem quot_zero_mul (x : PGame) : ⟦0 * x⟧ = ⟦0⟧ :=
   @Quotient.sound _ _ (0 * x) _ x.zero_mul_equiv
-#align pgame.quot_zero_mul Pgame.quot_zero_mul
+#align pgame.quot_zero_mul PGame.quot_zero_mul
 
 /-- `-x * y` and `-(x * y)` have the same moves. -/
-def negMulRelabelling : ∀ x y : Pgame.{u}, -x * y ≡r -(x * y)
+def negMulRelabelling : ∀ x y : PGame.{u}, -x * y ≡r -(x * y)
   | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
     refine' ⟨Equiv.sumComm _ _, Equiv.sumComm _ _, _, _⟩ <;> rintro (⟨i, j⟩ | ⟨i, j⟩) <;> dsimp <;>
           apply ((neg_add_relabelling _ _).trans _).symm <;>
         apply ((neg_add_relabelling _ _).trans (relabelling.add_congr _ _)).subCongr <;>
       exact (neg_mul_relabelling _ _).symm decreasing_by
   pgame_wf_tac
-#align pgame.neg_mul_relabelling Pgame.negMulRelabelling
+#align pgame.neg_mul_relabelling PGame.negMulRelabelling
 
 @[simp]
-theorem quot_neg_mul (x y : Pgame) : ⟦-x * y⟧ = -⟦x * y⟧ :=
+theorem quot_neg_mul (x y : PGame) : ⟦-x * y⟧ = -⟦x * y⟧ :=
   Quot.sound (negMulRelabelling x y).Equiv
-#align pgame.quot_neg_mul Pgame.quot_neg_mul
+#align pgame.quot_neg_mul PGame.quot_neg_mul
 
 /-- `x * -y` and `-(x * y)` have the same moves. -/
-def mulNegRelabelling (x y : Pgame) : x * -y ≡r -(x * y) :=
+def mulNegRelabelling (x y : PGame) : x * -y ≡r -(x * y) :=
   (mulCommRelabelling x _).trans <| (negMulRelabelling _ x).trans (mulCommRelabelling y x).negCongr
-#align pgame.mul_neg_relabelling Pgame.mulNegRelabelling
+#align pgame.mul_neg_relabelling PGame.mulNegRelabelling
 
 @[simp]
-theorem quot_mul_neg (x y : Pgame) : ⟦x * -y⟧ = -⟦x * y⟧ :=
+theorem quot_mul_neg (x y : PGame) : ⟦x * -y⟧ = -⟦x * y⟧ :=
   Quot.sound (mulNegRelabelling x y).Equiv
-#align pgame.quot_mul_neg Pgame.quot_mul_neg
+#align pgame.quot_mul_neg PGame.quot_mul_neg
 
 @[simp]
-theorem quot_left_distrib : ∀ x y z : Pgame, ⟦x * (y + z)⟧ = ⟦x * y⟧ + ⟦x * z⟧
+theorem quot_left_distrib : ∀ x y z : PGame, ⟦x * (y + z)⟧ = ⟦x * y⟧ + ⟦x * z⟧
   | mk xl xr xL xR, mk yl yr yL yR, mk zl zr zL zR =>
     by
     let x := mk xl xr xL xR
@@ -566,39 +566,39 @@ theorem quot_left_distrib : ∀ x y z : Pgame, ⟦x * (y + z)⟧ = ⟦x * y⟧ +
             ⟦x * y + (xR i * z + x * zL k - xR i * zL k)⟧
         simp [quot_left_distrib]
         abel decreasing_by pgame_wf_tac
-#align pgame.quot_left_distrib Pgame.quot_left_distrib
+#align pgame.quot_left_distrib PGame.quot_left_distrib
 
 /-- `x * (y + z)` is equivalent to `x * y + x * z.`-/
-theorem left_distrib_equiv (x y z : Pgame) : x * (y + z) ≈ x * y + x * z :=
+theorem left_distrib_equiv (x y z : PGame) : x * (y + z) ≈ x * y + x * z :=
   Quotient.exact <| quot_left_distrib _ _ _
-#align pgame.left_distrib_equiv Pgame.left_distrib_equiv
+#align pgame.left_distrib_equiv PGame.left_distrib_equiv
 
 @[simp]
-theorem quot_left_distrib_sub (x y z : Pgame) : ⟦x * (y - z)⟧ = ⟦x * y⟧ - ⟦x * z⟧ :=
+theorem quot_left_distrib_sub (x y z : PGame) : ⟦x * (y - z)⟧ = ⟦x * y⟧ - ⟦x * z⟧ :=
   by
   change ⟦x * (y + -z)⟧ = ⟦x * y⟧ + -⟦x * z⟧
   rw [quot_left_distrib, quot_mul_neg]
-#align pgame.quot_left_distrib_sub Pgame.quot_left_distrib_sub
+#align pgame.quot_left_distrib_sub PGame.quot_left_distrib_sub
 
 @[simp]
-theorem quot_right_distrib (x y z : Pgame) : ⟦(x + y) * z⟧ = ⟦x * z⟧ + ⟦y * z⟧ := by
+theorem quot_right_distrib (x y z : PGame) : ⟦(x + y) * z⟧ = ⟦x * z⟧ + ⟦y * z⟧ := by
   simp only [quot_mul_comm, quot_left_distrib]
-#align pgame.quot_right_distrib Pgame.quot_right_distrib
+#align pgame.quot_right_distrib PGame.quot_right_distrib
 
 /-- `(x + y) * z` is equivalent to `x * z + y * z.`-/
-theorem right_distrib_equiv (x y z : Pgame) : (x + y) * z ≈ x * z + y * z :=
+theorem right_distrib_equiv (x y z : PGame) : (x + y) * z ≈ x * z + y * z :=
   Quotient.exact <| quot_right_distrib _ _ _
-#align pgame.right_distrib_equiv Pgame.right_distrib_equiv
+#align pgame.right_distrib_equiv PGame.right_distrib_equiv
 
 @[simp]
-theorem quot_right_distrib_sub (x y z : Pgame) : ⟦(y - z) * x⟧ = ⟦y * x⟧ - ⟦z * x⟧ :=
+theorem quot_right_distrib_sub (x y z : PGame) : ⟦(y - z) * x⟧ = ⟦y * x⟧ - ⟦z * x⟧ :=
   by
   change ⟦(y + -z) * x⟧ = ⟦y * x⟧ + -⟦z * x⟧
   rw [quot_right_distrib, quot_neg_mul]
-#align pgame.quot_right_distrib_sub Pgame.quot_right_distrib_sub
+#align pgame.quot_right_distrib_sub PGame.quot_right_distrib_sub
 
 /-- `x * 1` has the same moves as `x`. -/
-def mulOneRelabelling : ∀ x : Pgame.{u}, x * 1 ≡r x
+def mulOneRelabelling : ∀ x : PGame.{u}, x * 1 ≡r x
   | ⟨xl, xr, xL, xR⟩ => by
     unfold One.one
     refine'
@@ -613,34 +613,34 @@ def mulOneRelabelling : ∀ x : Pgame.{u}, x * 1 ≡r x
         (add_zero_relabelling _).trans
           (((mul_one_relabelling _).addCongr (mul_zero_relabelling _)).trans <|
             add_zero_relabelling _)
-#align pgame.mul_one_relabelling Pgame.mulOneRelabelling
+#align pgame.mul_one_relabelling PGame.mulOneRelabelling
 
 @[simp]
-theorem quot_mul_one (x : Pgame) : ⟦x * 1⟧ = ⟦x⟧ :=
+theorem quot_mul_one (x : PGame) : ⟦x * 1⟧ = ⟦x⟧ :=
   Quot.sound <| mulOneRelabelling x
-#align pgame.quot_mul_one Pgame.quot_mul_one
+#align pgame.quot_mul_one PGame.quot_mul_one
 
 /-- `x * 1` is equivalent to `x`. -/
-theorem mul_one_equiv (x : Pgame) : x * 1 ≈ x :=
+theorem mul_one_equiv (x : PGame) : x * 1 ≈ x :=
   Quotient.exact <| quot_mul_one x
-#align pgame.mul_one_equiv Pgame.mul_one_equiv
+#align pgame.mul_one_equiv PGame.mul_one_equiv
 
 /-- `1 * x` has the same moves as `x`. -/
-def oneMulRelabelling (x : Pgame) : 1 * x ≡r x :=
+def oneMulRelabelling (x : PGame) : 1 * x ≡r x :=
   (mulCommRelabelling 1 x).trans <| mulOneRelabelling x
-#align pgame.one_mul_relabelling Pgame.oneMulRelabelling
+#align pgame.one_mul_relabelling PGame.oneMulRelabelling
 
 @[simp]
-theorem quot_one_mul (x : Pgame) : ⟦1 * x⟧ = ⟦x⟧ :=
+theorem quot_one_mul (x : PGame) : ⟦1 * x⟧ = ⟦x⟧ :=
   Quot.sound <| oneMulRelabelling x
-#align pgame.quot_one_mul Pgame.quot_one_mul
+#align pgame.quot_one_mul PGame.quot_one_mul
 
 /-- `1 * x` is equivalent to `x`. -/
-theorem one_mul_equiv (x : Pgame) : 1 * x ≈ x :=
+theorem one_mul_equiv (x : PGame) : 1 * x ≈ x :=
   Quotient.exact <| quot_one_mul x
-#align pgame.one_mul_equiv Pgame.one_mul_equiv
+#align pgame.one_mul_equiv PGame.one_mul_equiv
 
-theorem quot_mul_assoc : ∀ x y z : Pgame, ⟦x * y * z⟧ = ⟦x * (y * z)⟧
+theorem quot_mul_assoc : ∀ x y z : PGame, ⟦x * y * z⟧ = ⟦x * (y * z)⟧
   | mk xl xr xL xR, mk yl yr yL yR, mk zl zr zL zR =>
     by
     let x := mk xl xr xL xR
@@ -723,12 +723,12 @@ theorem quot_mul_assoc : ∀ x y z : Pgame, ⟦x * y * z⟧ = ⟦x * (y * z)⟧
                 xR i * (yL j * z + y * zL k - yL j * zL k)⟧
         simp [quot_mul_assoc]
         abel decreasing_by pgame_wf_tac
-#align pgame.quot_mul_assoc Pgame.quot_mul_assoc
+#align pgame.quot_mul_assoc PGame.quot_mul_assoc
 
 /-- `x * y * z` is equivalent to `x * (y * z).`-/
-theorem mul_assoc_equiv (x y z : Pgame) : x * y * z ≈ x * (y * z) :=
+theorem mul_assoc_equiv (x y z : PGame) : x * y * z ≈ x * (y * z) :=
   Quotient.exact <| quot_mul_assoc _ _ _
-#align pgame.mul_assoc_equiv Pgame.mul_assoc_equiv
+#align pgame.mul_assoc_equiv PGame.mul_assoc_equiv
 
 /-- Because the two halves of the definition of `inv` produce more elements
 on each side, we have to define the two families inductively.
@@ -739,7 +739,7 @@ inductive InvTy (l r : Type u) : Bool → Type u
   | left₂ : l → inv_ty true → inv_ty false
   | right₁ : l → inv_ty false → inv_ty true
   | right₂ : r → inv_ty true → inv_ty true
-#align pgame.inv_ty Pgame.InvTy
+#align pgame.inv_ty PGame.InvTy
 
 instance (l r : Type u) [IsEmpty l] [IsEmpty r] : IsEmpty (InvTy l r true) :=
   ⟨by rintro (_ | _ | _ | a | a) <;> exact isEmptyElim a⟩
@@ -753,19 +753,19 @@ instance uniqueInvTy (l r : Type u) [IsEmpty l] [IsEmpty r] : Unique (InvTy l r
       rintro (a | a | a)
       rfl
       all_goals exact isEmptyElim a }
-#align pgame.unique_inv_ty Pgame.uniqueInvTy
+#align pgame.unique_inv_ty PGame.uniqueInvTy
 
 /-- Because the two halves of the definition of `inv` produce more elements
 of each side, we have to define the two families inductively.
 This is the function part, defined by recursion on `inv_ty`. -/
-def invVal {l r} (L : l → Pgame) (R : r → Pgame) (IHl : l → Pgame) (IHr : r → Pgame) :
-    ∀ {b}, InvTy l r b → Pgame
+def invVal {l r} (L : l → PGame) (R : r → PGame) (IHl : l → PGame) (IHr : r → PGame) :
+    ∀ {b}, InvTy l r b → PGame
   | _, inv_ty.zero => 0
   | _, inv_ty.left₁ i j => (1 + (R i - mk l r L R) * inv_val j) * IHr i
   | _, inv_ty.left₂ i j => (1 + (L i - mk l r L R) * inv_val j) * IHl i
   | _, inv_ty.right₁ i j => (1 + (L i - mk l r L R) * inv_val j) * IHl i
   | _, inv_ty.right₂ i j => (1 + (R i - mk l r L R) * inv_val j) * IHr i
-#align pgame.inv_val Pgame.invVal
+#align pgame.inv_val PGame.invVal
 
 @[simp]
 theorem invVal_isEmpty {l r : Type u} {b} (L R IHl IHr) (i : InvTy l r b) [IsEmpty l] [IsEmpty r] :
@@ -773,7 +773,7 @@ theorem invVal_isEmpty {l r : Type u} {b} (L R IHl IHr) (i : InvTy l r b) [IsEmp
   cases' i with a _ a _ a _ a
   · rfl
   all_goals exact isEmptyElim a
-#align pgame.inv_val_is_empty Pgame.invVal_isEmpty
+#align pgame.inv_val_is_empty PGame.invVal_isEmpty
 
 /-- The inverse of a positive surreal number `x = {L | R}` is
 given by `x⁻¹ = {0,
@@ -781,20 +781,20 @@ given by `x⁻¹ = {0,
   (1 + (L - x) * x⁻¹L) * L, (1 + (R - x) * x⁻¹R) * R}`.
 Because the two halves `x⁻¹L, x⁻¹R` of `x⁻¹` are used in their own
 definition, the sets and elements are inductively generated. -/
-def inv' : Pgame → Pgame
+def inv' : PGame → PGame
   | ⟨l, r, L, R⟩ =>
     let l' := { i // 0 < L i }
-    let L' : l' → Pgame := fun i => L i.1
-    let IHl' : l' → Pgame := fun i => inv' (L i.1)
+    let L' : l' → PGame := fun i => L i.1
+    let IHl' : l' → PGame := fun i => inv' (L i.1)
     let IHr i := inv' (R i)
     ⟨InvTy l' r false, InvTy l' r true, invVal L' R IHl' IHr, invVal L' R IHl' IHr⟩
-#align pgame.inv' Pgame.inv'
+#align pgame.inv' PGame.inv'
 
-theorem zero_lf_inv' : ∀ x : Pgame, 0 ⧏ inv' x
+theorem zero_lf_inv' : ∀ x : PGame, 0 ⧏ inv' x
   | ⟨xl, xr, xL, xR⟩ => by
     convert lf_mk _ _ inv_ty.zero
     rfl
-#align pgame.zero_lf_inv' Pgame.zero_lf_inv'
+#align pgame.zero_lf_inv' PGame.zero_lf_inv'
 
 /-- `inv' 0` has exactly the same moves as `1`. -/
 def inv'Zero : inv' 0 ≡r 1 := by
@@ -807,17 +807,17 @@ def inv'Zero : inv' 0 ≡r 1 := by
   · simp
   · dsimp
     infer_instance
-#align pgame.inv'_zero Pgame.inv'Zero
+#align pgame.inv'_zero PGame.inv'Zero
 
 theorem inv'_zero_equiv : inv' 0 ≈ 1 :=
   inv'Zero.Equiv
-#align pgame.inv'_zero_equiv Pgame.inv'_zero_equiv
+#align pgame.inv'_zero_equiv PGame.inv'_zero_equiv
 
 /-- `inv' 1` has exactly the same moves as `1`. -/
-def inv'One : inv' 1 ≡r (1 : Pgame.{u}) :=
+def inv'One : inv' 1 ≡r (1 : PGame.{u}) :=
   by
   change relabelling (mk _ _ _ _) 1
-  have : IsEmpty { i : PUnit.{u + 1} // (0 : Pgame.{u}) < 0 } :=
+  have : IsEmpty { i : PUnit.{u + 1} // (0 : PGame.{u}) < 0 } :=
     by
     rw [lt_self_iff_false]
     infer_instance
@@ -826,44 +826,44 @@ def inv'One : inv' 1 ≡r (1 : Pgame.{u}) :=
   · apply Equiv.equivOfIsEmpty
   · simp
   · infer_instance
-#align pgame.inv'_one Pgame.inv'One
+#align pgame.inv'_one PGame.inv'One
 
 theorem inv'_one_equiv : inv' 1 ≈ 1 :=
   inv'One.Equiv
-#align pgame.inv'_one_equiv Pgame.inv'_one_equiv
+#align pgame.inv'_one_equiv PGame.inv'_one_equiv
 
 /-- The inverse of a pre-game in terms of the inverse on positive pre-games. -/
-noncomputable instance : Inv Pgame :=
+noncomputable instance : Inv PGame :=
   ⟨by classical exact fun x => if x ≈ 0 then 0 else if 0 < x then inv' x else -inv' (-x)⟩
 
-noncomputable instance : Div Pgame :=
+noncomputable instance : Div PGame :=
   ⟨fun x y => x * y⁻¹⟩
 
-theorem inv_eq_of_equiv_zero {x : Pgame} (h : x ≈ 0) : x⁻¹ = 0 := by classical exact if_pos h
-#align pgame.inv_eq_of_equiv_zero Pgame.inv_eq_of_equiv_zero
+theorem inv_eq_of_equiv_zero {x : PGame} (h : x ≈ 0) : x⁻¹ = 0 := by classical exact if_pos h
+#align pgame.inv_eq_of_equiv_zero PGame.inv_eq_of_equiv_zero
 
 @[simp]
-theorem inv_zero : (0 : Pgame)⁻¹ = 0 :=
+theorem inv_zero : (0 : PGame)⁻¹ = 0 :=
   inv_eq_of_equiv_zero (equiv_refl _)
-#align pgame.inv_zero Pgame.inv_zero
+#align pgame.inv_zero PGame.inv_zero
 
-theorem inv_eq_of_pos {x : Pgame} (h : 0 < x) : x⁻¹ = inv' x := by
+theorem inv_eq_of_pos {x : PGame} (h : 0 < x) : x⁻¹ = inv' x := by
   classical exact (if_neg h.lf.not_equiv').trans (if_pos h)
-#align pgame.inv_eq_of_pos Pgame.inv_eq_of_pos
+#align pgame.inv_eq_of_pos PGame.inv_eq_of_pos
 
-theorem inv_eq_of_lf_zero {x : Pgame} (h : x ⧏ 0) : x⁻¹ = -inv' (-x) := by
+theorem inv_eq_of_lf_zero {x : PGame} (h : x ⧏ 0) : x⁻¹ = -inv' (-x) := by
   classical exact (if_neg h.not_equiv).trans (if_neg h.not_gt)
-#align pgame.inv_eq_of_lf_zero Pgame.inv_eq_of_lf_zero
+#align pgame.inv_eq_of_lf_zero PGame.inv_eq_of_lf_zero
 
 /-- `1⁻¹` has exactly the same moves as `1`. -/
 def invOne : 1⁻¹ ≡r 1 := by
-  rw [inv_eq_of_pos Pgame.zero_lt_one]
+  rw [inv_eq_of_pos PGame.zero_lt_one]
   exact inv'_one
-#align pgame.inv_one Pgame.invOne
+#align pgame.inv_one PGame.invOne
 
 theorem inv_one_equiv : 1⁻¹ ≈ 1 :=
   invOne.Equiv
-#align pgame.inv_one_equiv Pgame.inv_one_equiv
+#align pgame.inv_one_equiv PGame.inv_one_equiv
 
-end Pgame
+end PGame
 

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 1 (#12338)

A PR accompanying #12339.

Zulip discussion

Diff
@@ -494,8 +494,8 @@ def negMulRelabelling (x y : PGame.{u}) : -x * y ≡r -(x * y) :=
         apply ((negAddRelabelling _ _).trans _).symm
         apply ((negAddRelabelling _ _).trans (Relabelling.addCongr _ _)).subCongr
         -- Porting note: we used to just do `<;> exact (negMulRelabelling _ _).symm` from here.
-        exact (negMulRelabelling _ _).symm
-        exact (negMulRelabelling _ _).symm
+        · exact (negMulRelabelling _ _).symm
+        · exact (negMulRelabelling _ _).symm
         -- Porting note: not sure what has gone wrong here.
         -- The goal is hideous here, and the `exact` doesn't work,
         -- but if we just `change` it to look like the mathlib3 goal then we're fine!?
@@ -866,7 +866,7 @@ instance uniqueInvTy (l r : Type u) [IsEmpty l] [IsEmpty r] : Unique (InvTy l r
   { InvTy.instInhabited l r with
     uniq := by
       rintro (a | a | a)
-      rfl
+      · rfl
       all_goals exact isEmptyElim a }
 #align pgame.unique_inv_ty SetTheory.PGame.uniqueInvTy
 
chore: Split Data.{Nat,Int}{.Order}.Basic in group vs ring instances (#11924)

Scatter the content of Data.Nat.Basic across:

  • Data.Nat.Defs for the lemmas having no dependencies
  • Algebra.Group.Nat for the monoid instances and the few miscellaneous lemmas needing them.
  • Algebra.Ring.Nat for the semiring instance and the few miscellaneous lemmas following it.

Similarly, scatter

  • Data.Int.Basic across Data.Int.Defs, Algebra.Group.Int, Algebra.Ring.Int
  • Data.Nat.Order.Basic across Data.Nat.Defs, Algebra.Order.Group.Nat, Algebra.Order.Ring.Nat
  • Data.Int.Order.Basic across Data.Int.Defs, Algebra.Order.Group.Int, Algebra.Order.Ring.Int

Also move a few lemmas from Data.Nat.Order.Lemmas to Data.Nat.Defs.

Before pre_11924

After post_11924

Diff
@@ -3,7 +3,7 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Scott Morrison, Apurva Nakade
 -/
-import Mathlib.Data.Int.Basic
+import Mathlib.Algebra.Ring.Int
 import Mathlib.SetTheory.Game.PGame
 import Mathlib.Tactic.Abel
 
chore: classify new definition porting notes (#11512)

Classifies by adding issue number #11446 to porting notes claiming "added definition".

Diff
@@ -49,7 +49,7 @@ abbrev Game :=
 
 namespace Game
 
--- Porting note: added this definition
+-- Porting note (#11445): added this definition
 /-- Negation of games. -/
 instance : Neg Game where
   neg := Quot.map Neg.neg <| fun _ _ => (neg_equiv_neg_iff).2
chore: remove unneeded decreasing_by and termination_by (#11386)

The termination checker has been getting more capable, and many of the termination_by or decreasing_by clauses in Mathlib are no longer needed.

(Note that termination_by? will show the automatically derived termination expression, so no information is being lost by removing these.)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -423,7 +423,6 @@ def mulCommRelabelling (x y : PGame.{u}) : x * y ≡r y * x :=
         (mulCommRelabelling _ _).addCongr (mulCommRelabelling _ _)).subCongr
         (mulCommRelabelling _ _) }
   termination_by (x, y)
-  decreasing_by all_goals pgame_wf_tac
 #align pgame.mul_comm_relabelling SetTheory.PGame.mulCommRelabelling
 
 theorem quot_mul_comm (x y : PGame.{u}) : (⟦x * y⟧ : Game) = ⟦y * x⟧ :=
@@ -503,7 +502,6 @@ def negMulRelabelling (x y : PGame.{u}) : -x * y ≡r -(x * y) :=
         change -(mk xl xr xL xR * _) ≡r _
         exact (negMulRelabelling _ _).symm
   termination_by (x, y)
-  decreasing_by all_goals pgame_wf_tac
 #align pgame.neg_mul_relabelling SetTheory.PGame.negMulRelabelling
 
 @[simp]
@@ -617,7 +615,6 @@ theorem quot_left_distrib (x y z : PGame) : (⟦x * (y + z)⟧ : Game) = ⟦x *
         rw [quot_left_distrib (xR i) (mk yl yr yL yR) (zL k)]
         abel
   termination_by (x, y, z)
-  decreasing_by all_goals pgame_wf_tac
 #align pgame.quot_left_distrib SetTheory.PGame.quot_left_distrib
 
 /-- `x * (y + z)` is equivalent to `x * y + x * z.`-/
@@ -841,7 +838,6 @@ theorem quot_mul_assoc (x y z : PGame) : (⟦x * y * z⟧ : Game) = ⟦x * (y *
         rw [quot_mul_assoc (xR i) (yL j) (zL k)]
         abel
   termination_by (x, y, z)
-  decreasing_by all_goals pgame_wf_tac
 #align pgame.quot_mul_assoc SetTheory.PGame.quot_mul_assoc
 
 /-- `x * y * z` is equivalent to `x * (y * z).`-/
chore: remove useless tactics (#11333)

The removal of some pointless tactics flagged by #11308.

Diff
@@ -660,8 +660,7 @@ def mulOneRelabelling : ∀ x : PGame.{u}, x * 1 ≡r x
     refine ⟨(Equiv.sumEmpty _ _).trans (Equiv.prodPUnit _),
       (Equiv.emptySum _ _).trans (Equiv.prodPUnit _), ?_, ?_⟩ <;>
     (try rintro (⟨i, ⟨⟩⟩ | ⟨i, ⟨⟩⟩)) <;>
-    { (try intro i)
-      dsimp
+    { dsimp
       apply (Relabelling.subCongr (Relabelling.refl _) (mulZeroRelabelling _)).trans
       rw [sub_zero]
       exact (addZeroRelabelling _).trans <|
feat: Small sets of games/surreals are bounded (#10458)

Finish forwarding porting https://github.com/leanprover-community/mathlib/pull/15260 after #10566 ported just the changes in PGame.lean.

We don't port upper_bound_numeric (or lower_bound_numeric) because upper_bound was deleted following review feedback on the previous forward-porting PR #10566.

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: timotree3 <timorcb@gmail.com>

Diff
@@ -7,7 +7,7 @@ import Mathlib.Data.Int.Basic
 import Mathlib.SetTheory.Game.PGame
 import Mathlib.Tactic.Abel
 
-#align_import set_theory.game.basic from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
+#align_import set_theory.game.basic from "leanprover-community/mathlib"@"8900d545017cd21961daa2a1734bb658ef52c618"
 
 /-!
 # Combinatorial games.
@@ -202,6 +202,30 @@ instance orderedAddCommGroup : OrderedAddCommGroup Game :=
     add_le_add_left := @add_le_add_left _ _ _ Game.covariantClass_add_le }
 #align game.ordered_add_comm_group SetTheory.Game.orderedAddCommGroup
 
+/-- A small family of games is bounded above. -/
+lemma bddAbove_range_of_small {ι : Type*} [Small.{u} ι] (f : ι → Game.{u}) :
+    BddAbove (Set.range f) := by
+  obtain ⟨x, hx⟩ := PGame.bddAbove_range_of_small (Quotient.out ∘ f)
+  refine ⟨⟦x⟧, Set.forall_mem_range.2 fun i ↦ ?_⟩
+  simpa [PGame.le_iff_game_le] using hx $ Set.mem_range_self i
+
+/-- A small set of games is bounded above. -/
+lemma bddAbove_of_small (s : Set Game.{u}) [Small.{u} s] : BddAbove s := by
+  simpa using bddAbove_range_of_small (Subtype.val : s → Game.{u})
+#align game.bdd_above_of_small SetTheory.Game.bddAbove_of_small
+
+/-- A small family of games is bounded below. -/
+lemma bddBelow_range_of_small {ι : Type*} [Small.{u} ι] (f : ι → Game.{u}) :
+    BddBelow (Set.range f) := by
+  obtain ⟨x, hx⟩ := PGame.bddBelow_range_of_small (Quotient.out ∘ f)
+  refine ⟨⟦x⟧, Set.forall_mem_range.2 fun i ↦ ?_⟩
+  simpa [PGame.le_iff_game_le] using hx $ Set.mem_range_self i
+
+/-- A small set of games is bounded below. -/
+lemma bddBelow_of_small (s : Set Game.{u}) [Small.{u} s] : BddBelow s := by
+  simpa using bddBelow_range_of_small (Subtype.val : s → Game.{u})
+#align game.bdd_below_of_small SetTheory.Game.bddBelow_of_small
+
 end Game
 
 namespace PGame
refactor: do not allow nsmul and zsmul to default automatically (#6262)

This PR removes the default values for nsmul and zsmul, forcing the user to populate them manually. The previous behavior can be obtained by writing nsmul := nsmulRec and zsmul := zsmulRec, which is now in the docstring for these fields.

The motivation here is to make it more obvious when module diamonds are being introduced, or at least where they might be hiding; you can now simply search for nsmulRec in the source code.

Arguably we should do the same thing for intCast, natCast, pow, and zpow too, but diamonds are less common in those fields, so I'll leave them to a subsequent PR.

Co-authored-by: Matthew Ballard <matt@mrb.email>

Diff
@@ -51,15 +51,16 @@ namespace Game
 
 -- Porting note: added this definition
 /-- Negation of games. -/
-def neg : Game → Game := Quot.lift (fun x => ⟦-x⟧) fun _ _ h => Quot.sound ((neg_equiv_neg_iff).2 h)
+instance : Neg Game where
+  neg := Quot.map Neg.neg <| fun _ _ => (neg_equiv_neg_iff).2
+
+instance : Zero Game where zero := ⟦0⟧
+instance : Add Game where
+  add := Quotient.map₂ HAdd.hAdd <| fun _ _ hx _ _ hy => PGame.add_congr hx hy
 
 instance instAddCommGroupWithOneGame : AddCommGroupWithOne Game where
   zero := ⟦0⟧
   one := ⟦1⟧
-  neg := neg
-  add :=
-    Quotient.lift₂ (fun x y : PGame => ⟦x + y⟧) fun x₁ y₁ x₂ y₂ hx hy =>
-      Quot.sound (PGame.add_congr hx hy)
   add_zero := by
     rintro ⟨x⟩
     exact Quot.sound (add_zero_equiv x)
@@ -69,12 +70,12 @@ instance instAddCommGroupWithOneGame : AddCommGroupWithOne Game where
   add_assoc := by
     rintro ⟨x⟩ ⟨y⟩ ⟨z⟩
     exact Quot.sound add_assoc_equiv
-  add_left_neg := by
-    rintro ⟨x⟩
-    exact Quot.sound (add_left_neg_equiv x)
+  add_left_neg := Quotient.ind <| fun x => Quot.sound (add_left_neg_equiv x)
   add_comm := by
     rintro ⟨x⟩ ⟨y⟩
     exact Quot.sound add_comm_equiv
+  nsmul := nsmulRec
+  zsmul := zsmulRec
 
 instance : Inhabited Game :=
   ⟨0⟩
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -119,7 +119,7 @@ theorem not_lf : ∀ {x y : Game}, ¬x ⧏ y ↔ y ≤ x := by
   exact PGame.not_lf
 #align game.not_lf SetTheory.Game.not_lf
 
--- porting note: had to replace ⧏ with LF, otherwise cannot differentiate with the operator on PGame
+-- Porting note: had to replace ⧏ with LF, otherwise cannot differentiate with the operator on PGame
 instance : IsTrichotomous Game LF :=
   ⟨by
     rintro ⟨x⟩ ⟨y⟩
@@ -130,7 +130,7 @@ instance : IsTrichotomous Game LF :=
 /-! It can be useful to use these lemmas to turn `PGame` inequalities into `Game` inequalities, as
 the `AddCommGroup` structure on `Game` often simplifies many proofs. -/
 
--- porting note: In a lot of places, I had to add explicitely that the quotient element was a Game.
+-- Porting note: In a lot of places, I had to add explicitely that the quotient element was a Game.
 -- In Lean4, quotients don't have the setoid as an instance argument,
 -- but as an explicit argument, see https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/confusion.20between.20equivalence.20and.20instance.20setoid/near/360822354
 theorem PGame.le_iff_game_le {x y : PGame} : x ≤ y ↔ (⟦x⟧ : Game) ≤ ⟦y⟧ :=
feat: add lake exe shake to CI (#9751)

This checks files for unused imports. The output here is piped through gh-problem-matcher-wrap so that it will show up as annotations.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -3,6 +3,7 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Scott Morrison, Apurva Nakade
 -/
+import Mathlib.Data.Int.Basic
 import Mathlib.SetTheory.Game.PGame
 import Mathlib.Tactic.Abel
 
chore: move to v4.6.0-rc1, merging adaptations from bump/v4.6.0 (#10176)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>

Diff
@@ -396,8 +396,8 @@ def mulCommRelabelling (x y : PGame.{u}) : x * y ≡r y * x :=
       exact ((addCommRelabelling _ _).trans <|
         (mulCommRelabelling _ _).addCongr (mulCommRelabelling _ _)).subCongr
         (mulCommRelabelling _ _) }
-  termination_by _ => (x, y)
-  decreasing_by pgame_wf_tac
+  termination_by (x, y)
+  decreasing_by all_goals pgame_wf_tac
 #align pgame.mul_comm_relabelling SetTheory.PGame.mulCommRelabelling
 
 theorem quot_mul_comm (x y : PGame.{u}) : (⟦x * y⟧ : Game) = ⟦y * x⟧ :=
@@ -476,8 +476,8 @@ def negMulRelabelling (x y : PGame.{u}) : -x * y ≡r -(x * y) :=
         -- but if we just `change` it to look like the mathlib3 goal then we're fine!?
         change -(mk xl xr xL xR * _) ≡r _
         exact (negMulRelabelling _ _).symm
-  termination_by _ => (x, y)
-  decreasing_by pgame_wf_tac
+  termination_by (x, y)
+  decreasing_by all_goals pgame_wf_tac
 #align pgame.neg_mul_relabelling SetTheory.PGame.negMulRelabelling
 
 @[simp]
@@ -590,8 +590,8 @@ theorem quot_left_distrib (x y z : PGame) : (⟦x * (y + z)⟧ : Game) = ⟦x *
         rw [quot_left_distrib (mk xl xr xL xR) (mk yl yr yL yR) (zL k)]
         rw [quot_left_distrib (xR i) (mk yl yr yL yR) (zL k)]
         abel
-  termination_by _ => (x, y, z)
-  decreasing_by pgame_wf_tac
+  termination_by (x, y, z)
+  decreasing_by all_goals pgame_wf_tac
 #align pgame.quot_left_distrib SetTheory.PGame.quot_left_distrib
 
 /-- `x * (y + z)` is equivalent to `x * y + x * z.`-/
@@ -815,8 +815,8 @@ theorem quot_mul_assoc (x y z : PGame) : (⟦x * y * z⟧ : Game) = ⟦x * (y *
         rw [quot_mul_assoc (mk xl xr xL xR) (yL j) (zL k)]
         rw [quot_mul_assoc (xR i) (yL j) (zL k)]
         abel
-  termination_by _ => (x, y, z)
-  decreasing_by pgame_wf_tac
+  termination_by (x, y, z)
+  decreasing_by all_goals pgame_wf_tac
 #align pgame.quot_mul_assoc SetTheory.PGame.quot_mul_assoc
 
 /-- `x * y * z` is equivalent to `x * (y * z).`-/
chore: fix name *.Lf (#7163)
Diff
@@ -98,11 +98,11 @@ instance instPartialOrderGame : PartialOrder Game where
 /-- The less or fuzzy relation on games.
 
 If `0 ⧏ x` (less or fuzzy with), then Left can win `x` as the first player. -/
-def Lf : Game → Game → Prop :=
-  Quotient.lift₂ PGame.Lf fun _ _ _ _ hx hy => propext (lf_congr hx hy)
-#align game.lf SetTheory.Game.Lf
+def LF : Game → Game → Prop :=
+  Quotient.lift₂ PGame.LF fun _ _ _ _ hx hy => propext (lf_congr hx hy)
+#align game.lf SetTheory.Game.LF
 
-local infixl:50 " ⧏ " => Lf
+local infixl:50 " ⧏ " => LF
 
 /-- On `Game`, simp-normal inequalities should use as few negations as possible. -/
 @[simp]
@@ -118,8 +118,8 @@ theorem not_lf : ∀ {x y : Game}, ¬x ⧏ y ↔ y ≤ x := by
   exact PGame.not_lf
 #align game.not_lf SetTheory.Game.not_lf
 
--- porting note: had to replace ⧏ with Lf, otherwise cannot differentiate with the operator on PGame
-instance : IsTrichotomous Game Lf :=
+-- porting note: had to replace ⧏ with LF, otherwise cannot differentiate with the operator on PGame
+instance : IsTrichotomous Game LF :=
   ⟨by
     rintro ⟨x⟩ ⟨y⟩
     change _ ∨ ⟦x⟧ = ⟦y⟧ ∨ _
@@ -136,7 +136,7 @@ theorem PGame.le_iff_game_le {x y : PGame} : x ≤ y ↔ (⟦x⟧ : Game) ≤ 
   Iff.rfl
 #align game.pgame.le_iff_game_le SetTheory.Game.PGame.le_iff_game_le
 
-theorem PGame.lf_iff_game_lf {x y : PGame} : PGame.Lf x y ↔ ⟦x⟧ ⧏ ⟦y⟧ :=
+theorem PGame.lf_iff_game_lf {x y : PGame} : PGame.LF x y ↔ ⟦x⟧ ⧏ ⟦y⟧ :=
   Iff.rfl
 #align game.pgame.lf_iff_game_lf SetTheory.Game.PGame.lf_iff_game_lf
 
chore: move Game to SetTheory.Game (#6365)

move Game and PGame into namespace SetTheory as _root_.Game might collide with other definitions (e.g. in projects depending on mathlib)

Diff
@@ -11,7 +11,7 @@ import Mathlib.Tactic.Abel
 /-!
 # Combinatorial games.
 
-In this file we construct an instance `OrderedAddCommGroup Game`.
+In this file we construct an instance `OrderedAddCommGroup SetTheory.Game`.
 
 ## Multiplication on pre-games
 
@@ -24,6 +24,8 @@ the abelian group structure on games allows us to simplify many proofs for pre-g
 -- Porting note: many definitions here are noncomputable as the compiler does not support PGame.rec
 noncomputable section
 
+namespace SetTheory
+
 open Function PGame
 
 open PGame
@@ -42,7 +44,7 @@ universe u
   `x ≈ y ↔ x ≤ y ∧ y ≤ x`. -/
 abbrev Game :=
   Quotient PGame.setoid
-#align game Game
+#align game SetTheory.Game
 
 namespace Game
 
@@ -98,7 +100,7 @@ instance instPartialOrderGame : PartialOrder Game where
 If `0 ⧏ x` (less or fuzzy with), then Left can win `x` as the first player. -/
 def Lf : Game → Game → Prop :=
   Quotient.lift₂ PGame.Lf fun _ _ _ _ hx hy => propext (lf_congr hx hy)
-#align game.lf Game.Lf
+#align game.lf SetTheory.Game.Lf
 
 local infixl:50 " ⧏ " => Lf
 
@@ -107,14 +109,14 @@ local infixl:50 " ⧏ " => Lf
 theorem not_le : ∀ {x y : Game}, ¬x ≤ y ↔ y ⧏ x := by
   rintro ⟨x⟩ ⟨y⟩
   exact PGame.not_le
-#align game.not_le Game.not_le
+#align game.not_le SetTheory.Game.not_le
 
 /-- On `Game`, simp-normal inequalities should use as few negations as possible. -/
 @[simp]
 theorem not_lf : ∀ {x y : Game}, ¬x ⧏ y ↔ y ≤ x := by
   rintro ⟨x⟩ ⟨y⟩
   exact PGame.not_lf
-#align game.not_lf Game.not_lf
+#align game.not_lf SetTheory.Game.not_lf
 
 -- porting note: had to replace ⧏ with Lf, otherwise cannot differentiate with the operator on PGame
 instance : IsTrichotomous Game Lf :=
@@ -132,71 +134,71 @@ the `AddCommGroup` structure on `Game` often simplifies many proofs. -/
 -- but as an explicit argument, see https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/confusion.20between.20equivalence.20and.20instance.20setoid/near/360822354
 theorem PGame.le_iff_game_le {x y : PGame} : x ≤ y ↔ (⟦x⟧ : Game) ≤ ⟦y⟧ :=
   Iff.rfl
-#align game.pgame.le_iff_game_le Game.PGame.le_iff_game_le
+#align game.pgame.le_iff_game_le SetTheory.Game.PGame.le_iff_game_le
 
 theorem PGame.lf_iff_game_lf {x y : PGame} : PGame.Lf x y ↔ ⟦x⟧ ⧏ ⟦y⟧ :=
   Iff.rfl
-#align game.pgame.lf_iff_game_lf Game.PGame.lf_iff_game_lf
+#align game.pgame.lf_iff_game_lf SetTheory.Game.PGame.lf_iff_game_lf
 
 theorem PGame.lt_iff_game_lt {x y : PGame} : x < y ↔ (⟦x⟧ : Game) < ⟦y⟧ :=
   Iff.rfl
-#align game.pgame.lt_iff_game_lt Game.PGame.lt_iff_game_lt
+#align game.pgame.lt_iff_game_lt SetTheory.Game.PGame.lt_iff_game_lt
 
 theorem PGame.equiv_iff_game_eq {x y : PGame} : x ≈ y ↔ (⟦x⟧ : Game) = ⟦y⟧ :=
   (@Quotient.eq' _ _ x y).symm
-#align game.pgame.equiv_iff_game_eq Game.PGame.equiv_iff_game_eq
+#align game.pgame.equiv_iff_game_eq SetTheory.Game.PGame.equiv_iff_game_eq
 
 /-- The fuzzy, confused, or incomparable relation on games.
 
 If `x ‖ 0`, then the first player can always win `x`. -/
 def Fuzzy : Game → Game → Prop :=
   Quotient.lift₂ PGame.Fuzzy fun _ _ _ _ hx hy => propext (fuzzy_congr hx hy)
-#align game.fuzzy Game.Fuzzy
+#align game.fuzzy SetTheory.Game.Fuzzy
 
 local infixl:50 " ‖ " => Fuzzy
 
 theorem PGame.fuzzy_iff_game_fuzzy {x y : PGame} : PGame.Fuzzy x y ↔ ⟦x⟧ ‖ ⟦y⟧ :=
   Iff.rfl
-#align game.pgame.fuzzy_iff_game_fuzzy Game.PGame.fuzzy_iff_game_fuzzy
+#align game.pgame.fuzzy_iff_game_fuzzy SetTheory.Game.PGame.fuzzy_iff_game_fuzzy
 
 instance covariantClass_add_le : CovariantClass Game Game (· + ·) (· ≤ ·) :=
   ⟨by
     rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h
     exact @add_le_add_left _ _ _ _ b c h a⟩
-#align game.covariant_class_add_le Game.covariantClass_add_le
+#align game.covariant_class_add_le SetTheory.Game.covariantClass_add_le
 
 instance covariantClass_swap_add_le : CovariantClass Game Game (swap (· + ·)) (· ≤ ·) :=
   ⟨by
     rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h
     exact @add_le_add_right _ _ _ _ b c h a⟩
-#align game.covariant_class_swap_add_le Game.covariantClass_swap_add_le
+#align game.covariant_class_swap_add_le SetTheory.Game.covariantClass_swap_add_le
 
 instance covariantClass_add_lt : CovariantClass Game Game (· + ·) (· < ·) :=
   ⟨by
     rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h
     exact @add_lt_add_left _ _ _ _ b c h a⟩
-#align game.covariant_class_add_lt Game.covariantClass_add_lt
+#align game.covariant_class_add_lt SetTheory.Game.covariantClass_add_lt
 
 instance covariantClass_swap_add_lt : CovariantClass Game Game (swap (· + ·)) (· < ·) :=
   ⟨by
     rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ h
     exact @add_lt_add_right _ _ _ _ b c h a⟩
-#align game.covariant_class_swap_add_lt Game.covariantClass_swap_add_lt
+#align game.covariant_class_swap_add_lt SetTheory.Game.covariantClass_swap_add_lt
 
 theorem add_lf_add_right : ∀ {b c : Game} (_ : b ⧏ c) (a), (b + a : Game) ⧏ c + a := by
   rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩
   apply PGame.add_lf_add_right h
-#align game.add_lf_add_right Game.add_lf_add_right
+#align game.add_lf_add_right SetTheory.Game.add_lf_add_right
 
 theorem add_lf_add_left : ∀ {b c : Game} (_ : b ⧏ c) (a), (a + b : Game) ⧏ a + c := by
   rintro ⟨b⟩ ⟨c⟩ h ⟨a⟩
   apply PGame.add_lf_add_left h
-#align game.add_lf_add_left Game.add_lf_add_left
+#align game.add_lf_add_left SetTheory.Game.add_lf_add_left
 
 instance orderedAddCommGroup : OrderedAddCommGroup Game :=
   { Game.instAddCommGroupWithOneGame, Game.instPartialOrderGame with
     add_le_add_left := @add_le_add_left _ _ _ Game.covariantClass_add_le }
-#align game.ordered_add_comm_group Game.orderedAddCommGroup
+#align game.ordered_add_comm_group SetTheory.Game.orderedAddCommGroup
 
 end Game
 
@@ -205,24 +207,24 @@ namespace PGame
 @[simp]
 theorem quot_neg (a : PGame) : (⟦-a⟧ : Game) = -⟦a⟧ :=
   rfl
-#align pgame.quot_neg PGame.quot_neg
+#align pgame.quot_neg SetTheory.PGame.quot_neg
 
 @[simp]
 theorem quot_add (a b : PGame) : ⟦a + b⟧ = (⟦a⟧ : Game) + ⟦b⟧ :=
   rfl
-#align pgame.quot_add PGame.quot_add
+#align pgame.quot_add SetTheory.PGame.quot_add
 
 @[simp]
 theorem quot_sub (a b : PGame) : ⟦a - b⟧ = (⟦a⟧ : Game) - ⟦b⟧ :=
   rfl
-#align pgame.quot_sub PGame.quot_sub
+#align pgame.quot_sub SetTheory.PGame.quot_sub
 
 theorem quot_eq_of_mk'_quot_eq {x y : PGame} (L : x.LeftMoves ≃ y.LeftMoves)
     (R : x.RightMoves ≃ y.RightMoves) (hl : ∀ i, (⟦x.moveLeft i⟧ : Game) = ⟦y.moveLeft (L i)⟧)
     (hr : ∀ j, (⟦x.moveRight j⟧ : Game) = ⟦y.moveRight (R j)⟧) : (⟦x⟧ : Game) = ⟦y⟧ := by
   exact Quot.sound (equiv_of_mk_equiv L R (fun _ => Game.PGame.equiv_iff_game_eq.2 (hl _))
                                           (fun _ => Game.PGame.equiv_iff_game_eq.2 (hr _)))
-#align pgame.quot_eq_of_mk_quot_eq PGame.quot_eq_of_mk'_quot_eq
+#align pgame.quot_eq_of_mk_quot_eq SetTheory.PGame.quot_eq_of_mk'_quot_eq
 
 /-! Multiplicative operations can be defined at the level of pre-games,
 but to prove their properties we need to use the abelian group structure of games.
@@ -246,13 +248,13 @@ theorem leftMoves_mul :
     ∀ x y : PGame.{u},
       (x * y).LeftMoves = Sum (x.LeftMoves × y.LeftMoves) (x.RightMoves × y.RightMoves)
   | ⟨_, _, _, _⟩, ⟨_, _, _, _⟩ => rfl
-#align pgame.left_moves_mul PGame.leftMoves_mul
+#align pgame.left_moves_mul SetTheory.PGame.leftMoves_mul
 
 theorem rightMoves_mul :
     ∀ x y : PGame.{u},
       (x * y).RightMoves = Sum (x.LeftMoves × y.RightMoves) (x.RightMoves × y.LeftMoves)
   | ⟨_, _, _, _⟩, ⟨_, _, _, _⟩ => rfl
-#align pgame.right_moves_mul PGame.rightMoves_mul
+#align pgame.right_moves_mul SetTheory.PGame.rightMoves_mul
 
 /-- Turns two left or right moves for `x` and `y` into a left move for `x * y` and vice versa.
 
@@ -261,7 +263,7 @@ between them. -/
 def toLeftMovesMul {x y : PGame} :
     Sum (x.LeftMoves × y.LeftMoves) (x.RightMoves × y.RightMoves) ≃ (x * y).LeftMoves :=
   Equiv.cast (leftMoves_mul x y).symm
-#align pgame.to_left_moves_mul PGame.toLeftMovesMul
+#align pgame.to_left_moves_mul SetTheory.PGame.toLeftMovesMul
 
 /-- Turns a left and a right move for `x` and `y` into a right move for `x * y` and vice versa.
 
@@ -270,14 +272,14 @@ between them. -/
 def toRightMovesMul {x y : PGame} :
     Sum (x.LeftMoves × y.RightMoves) (x.RightMoves × y.LeftMoves) ≃ (x * y).RightMoves :=
   Equiv.cast (rightMoves_mul x y).symm
-#align pgame.to_right_moves_mul PGame.toRightMovesMul
+#align pgame.to_right_moves_mul SetTheory.PGame.toRightMovesMul
 
 @[simp]
 theorem mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveLeft (Sum.inl (i, j)) =
       xL i * mk yl yr yL yR + mk xl xr xL xR * yL j - xL i * yL j :=
   rfl
-#align pgame.mk_mul_move_left_inl PGame.mk_mul_moveLeft_inl
+#align pgame.mk_mul_move_left_inl SetTheory.PGame.mk_mul_moveLeft_inl
 
 @[simp]
 theorem mul_moveLeft_inl {x y : PGame} {i j} :
@@ -286,14 +288,14 @@ theorem mul_moveLeft_inl {x y : PGame} {i j} :
   cases x
   cases y
   rfl
-#align pgame.mul_move_left_inl PGame.mul_moveLeft_inl
+#align pgame.mul_move_left_inl SetTheory.PGame.mul_moveLeft_inl
 
 @[simp]
 theorem mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveLeft (Sum.inr (i, j)) =
       xR i * mk yl yr yL yR + mk xl xr xL xR * yR j - xR i * yR j :=
   rfl
-#align pgame.mk_mul_move_left_inr PGame.mk_mul_moveLeft_inr
+#align pgame.mk_mul_move_left_inr SetTheory.PGame.mk_mul_moveLeft_inr
 
 @[simp]
 theorem mul_moveLeft_inr {x y : PGame} {i j} :
@@ -302,14 +304,14 @@ theorem mul_moveLeft_inr {x y : PGame} {i j} :
   cases x
   cases y
   rfl
-#align pgame.mul_move_left_inr PGame.mul_moveLeft_inr
+#align pgame.mul_move_left_inr SetTheory.PGame.mul_moveLeft_inr
 
 @[simp]
 theorem mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveRight (Sum.inl (i, j)) =
       xL i * mk yl yr yL yR + mk xl xr xL xR * yR j - xL i * yR j :=
   rfl
-#align pgame.mk_mul_move_right_inl PGame.mk_mul_moveRight_inl
+#align pgame.mk_mul_move_right_inl SetTheory.PGame.mk_mul_moveRight_inl
 
 @[simp]
 theorem mul_moveRight_inl {x y : PGame} {i j} :
@@ -318,14 +320,14 @@ theorem mul_moveRight_inl {x y : PGame} {i j} :
   cases x
   cases y
   rfl
-#align pgame.mul_move_right_inl PGame.mul_moveRight_inl
+#align pgame.mul_move_right_inl SetTheory.PGame.mul_moveRight_inl
 
 @[simp]
 theorem mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (mk xl xr xL xR * mk yl yr yL yR).moveRight (Sum.inr (i, j)) =
       xR i * mk yl yr yL yR + mk xl xr xL xR * yL j - xR i * yL j :=
   rfl
-#align pgame.mk_mul_move_right_inr PGame.mk_mul_moveRight_inr
+#align pgame.mk_mul_move_right_inr SetTheory.PGame.mk_mul_moveRight_inr
 
 @[simp]
 theorem mul_moveRight_inr {x y : PGame} {i j} :
@@ -334,35 +336,35 @@ theorem mul_moveRight_inr {x y : PGame} {i j} :
   cases x
   cases y
   rfl
-#align pgame.mul_move_right_inr PGame.mul_moveRight_inr
+#align pgame.mul_move_right_inr SetTheory.PGame.mul_moveRight_inr
 
 -- @[simp] -- Porting note: simpNF linter complains
 theorem neg_mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveLeft (Sum.inl (i, j)) =
       -(xL i * mk yl yr yL yR + mk xl xr xL xR * yR j - xL i * yR j) :=
   rfl
-#align pgame.neg_mk_mul_move_left_inl PGame.neg_mk_mul_moveLeft_inl
+#align pgame.neg_mk_mul_move_left_inl SetTheory.PGame.neg_mk_mul_moveLeft_inl
 
 -- @[simp] -- Porting note: simpNF linter complains
 theorem neg_mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveLeft (Sum.inr (i, j)) =
       -(xR i * mk yl yr yL yR + mk xl xr xL xR * yL j - xR i * yL j) :=
   rfl
-#align pgame.neg_mk_mul_move_left_inr PGame.neg_mk_mul_moveLeft_inr
+#align pgame.neg_mk_mul_move_left_inr SetTheory.PGame.neg_mk_mul_moveLeft_inr
 
 -- @[simp] -- Porting note: simpNF linter complains
 theorem neg_mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveRight (Sum.inl (i, j)) =
       -(xL i * mk yl yr yL yR + mk xl xr xL xR * yL j - xL i * yL j) :=
   rfl
-#align pgame.neg_mk_mul_move_right_inl PGame.neg_mk_mul_moveRight_inl
+#align pgame.neg_mk_mul_move_right_inl SetTheory.PGame.neg_mk_mul_moveRight_inl
 
 -- @[simp] -- Porting note: simpNF linter complains
 theorem neg_mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
     (-(mk xl xr xL xR * mk yl yr yL yR)).moveRight (Sum.inr (i, j)) =
       -(xR i * mk yl yr yL yR + mk xl xr xL xR * yR j - xR i * yR j) :=
   rfl
-#align pgame.neg_mk_mul_move_right_inr PGame.neg_mk_mul_moveRight_inr
+#align pgame.neg_mk_mul_move_right_inr SetTheory.PGame.neg_mk_mul_moveRight_inr
 
 theorem leftMoves_mul_cases {x y : PGame} (k) {P : (x * y).LeftMoves → Prop}
     (hl : ∀ ix iy, P <| toLeftMovesMul (Sum.inl ⟨ix, iy⟩))
@@ -371,7 +373,7 @@ theorem leftMoves_mul_cases {x y : PGame} (k) {P : (x * y).LeftMoves → Prop}
   rcases toLeftMovesMul.symm k with (⟨ix, iy⟩ | ⟨jx, jy⟩)
   · apply hl
   · apply hr
-#align pgame.left_moves_mul_cases PGame.leftMoves_mul_cases
+#align pgame.left_moves_mul_cases SetTheory.PGame.leftMoves_mul_cases
 
 theorem rightMoves_mul_cases {x y : PGame} (k) {P : (x * y).RightMoves → Prop}
     (hl : ∀ ix jy, P <| toRightMovesMul (Sum.inl ⟨ix, jy⟩))
@@ -380,7 +382,7 @@ theorem rightMoves_mul_cases {x y : PGame} (k) {P : (x * y).RightMoves → Prop}
   rcases toRightMovesMul.symm k with (⟨ix, iy⟩ | ⟨jx, jy⟩)
   · apply hl
   · apply hr
-#align pgame.right_moves_mul_cases PGame.rightMoves_mul_cases
+#align pgame.right_moves_mul_cases SetTheory.PGame.rightMoves_mul_cases
 
 /-- `x * y` and `y * x` have the same moves. -/
 def mulCommRelabelling (x y : PGame.{u}) : x * y ≡r y * x :=
@@ -396,66 +398,66 @@ def mulCommRelabelling (x y : PGame.{u}) : x * y ≡r y * x :=
         (mulCommRelabelling _ _) }
   termination_by _ => (x, y)
   decreasing_by pgame_wf_tac
-#align pgame.mul_comm_relabelling PGame.mulCommRelabelling
+#align pgame.mul_comm_relabelling SetTheory.PGame.mulCommRelabelling
 
 theorem quot_mul_comm (x y : PGame.{u}) : (⟦x * y⟧ : Game) = ⟦y * x⟧ :=
   Quot.sound (mulCommRelabelling x y).equiv
-#align pgame.quot_mul_comm PGame.quot_mul_comm
+#align pgame.quot_mul_comm SetTheory.PGame.quot_mul_comm
 
 /-- `x * y` is equivalent to `y * x`. -/
 theorem mul_comm_equiv (x y : PGame) : x * y ≈ y * x :=
   Quotient.exact <| quot_mul_comm _ _
-#align pgame.mul_comm_equiv PGame.mul_comm_equiv
+#align pgame.mul_comm_equiv SetTheory.PGame.mul_comm_equiv
 
 instance isEmpty_mul_zero_leftMoves (x : PGame.{u}) : IsEmpty (x * 0).LeftMoves := by
   cases x
   exact instIsEmptySum
-#align pgame.is_empty_mul_zero_left_moves PGame.isEmpty_mul_zero_leftMoves
+#align pgame.is_empty_mul_zero_left_moves SetTheory.PGame.isEmpty_mul_zero_leftMoves
 
 instance isEmpty_mul_zero_rightMoves (x : PGame.{u}) : IsEmpty (x * 0).RightMoves := by
   cases x
   apply instIsEmptySum
-#align pgame.is_empty_mul_zero_right_moves PGame.isEmpty_mul_zero_rightMoves
+#align pgame.is_empty_mul_zero_right_moves SetTheory.PGame.isEmpty_mul_zero_rightMoves
 
 instance isEmpty_zero_mul_leftMoves (x : PGame.{u}) : IsEmpty (0 * x).LeftMoves := by
   cases x
   apply instIsEmptySum
-#align pgame.is_empty_zero_mul_left_moves PGame.isEmpty_zero_mul_leftMoves
+#align pgame.is_empty_zero_mul_left_moves SetTheory.PGame.isEmpty_zero_mul_leftMoves
 
 instance isEmpty_zero_mul_rightMoves (x : PGame.{u}) : IsEmpty (0 * x).RightMoves := by
   cases x
   apply instIsEmptySum
-#align pgame.is_empty_zero_mul_right_moves PGame.isEmpty_zero_mul_rightMoves
+#align pgame.is_empty_zero_mul_right_moves SetTheory.PGame.isEmpty_zero_mul_rightMoves
 
 /-- `x * 0` has exactly the same moves as `0`. -/
 def mulZeroRelabelling (x : PGame) : x * 0 ≡r 0 :=
   Relabelling.isEmpty _
-#align pgame.mul_zero_relabelling PGame.mulZeroRelabelling
+#align pgame.mul_zero_relabelling SetTheory.PGame.mulZeroRelabelling
 
 /-- `x * 0` is equivalent to `0`. -/
 theorem mul_zero_equiv (x : PGame) : x * 0 ≈ 0 :=
   (mulZeroRelabelling x).equiv
-#align pgame.mul_zero_equiv PGame.mul_zero_equiv
+#align pgame.mul_zero_equiv SetTheory.PGame.mul_zero_equiv
 
 @[simp]
 theorem quot_mul_zero (x : PGame) : (⟦x * 0⟧ : Game) = ⟦0⟧ :=
   @Quotient.sound _ _ (x * 0) _ x.mul_zero_equiv
-#align pgame.quot_mul_zero PGame.quot_mul_zero
+#align pgame.quot_mul_zero SetTheory.PGame.quot_mul_zero
 
 /-- `0 * x` has exactly the same moves as `0`. -/
 def zeroMulRelabelling (x : PGame) : 0 * x ≡r 0 :=
   Relabelling.isEmpty _
-#align pgame.zero_mul_relabelling PGame.zeroMulRelabelling
+#align pgame.zero_mul_relabelling SetTheory.PGame.zeroMulRelabelling
 
 /-- `0 * x` is equivalent to `0`. -/
 theorem zero_mul_equiv (x : PGame) : 0 * x ≈ 0 :=
   (zeroMulRelabelling x).equiv
-#align pgame.zero_mul_equiv PGame.zero_mul_equiv
+#align pgame.zero_mul_equiv SetTheory.PGame.zero_mul_equiv
 
 @[simp]
 theorem quot_zero_mul (x : PGame) : (⟦0 * x⟧ : Game) = ⟦0⟧ :=
   @Quotient.sound _ _ (0 * x) _ x.zero_mul_equiv
-#align pgame.quot_zero_mul PGame.quot_zero_mul
+#align pgame.quot_zero_mul SetTheory.PGame.quot_zero_mul
 
 /-- `-x * y` and `-(x * y)` have the same moves. -/
 def negMulRelabelling (x y : PGame.{u}) : -x * y ≡r -(x * y) :=
@@ -476,22 +478,22 @@ def negMulRelabelling (x y : PGame.{u}) : -x * y ≡r -(x * y) :=
         exact (negMulRelabelling _ _).symm
   termination_by _ => (x, y)
   decreasing_by pgame_wf_tac
-#align pgame.neg_mul_relabelling PGame.negMulRelabelling
+#align pgame.neg_mul_relabelling SetTheory.PGame.negMulRelabelling
 
 @[simp]
 theorem quot_neg_mul (x y : PGame) : (⟦-x * y⟧ : Game) = -⟦x * y⟧ :=
   Quot.sound (negMulRelabelling x y).equiv
-#align pgame.quot_neg_mul PGame.quot_neg_mul
+#align pgame.quot_neg_mul SetTheory.PGame.quot_neg_mul
 
 /-- `x * -y` and `-(x * y)` have the same moves. -/
 def mulNegRelabelling (x y : PGame) : x * -y ≡r -(x * y) :=
   (mulCommRelabelling x _).trans <| (negMulRelabelling _ x).trans (mulCommRelabelling y x).negCongr
-#align pgame.mul_neg_relabelling PGame.mulNegRelabelling
+#align pgame.mul_neg_relabelling SetTheory.PGame.mulNegRelabelling
 
 @[simp]
 theorem quot_mul_neg (x y : PGame) : ⟦x * -y⟧ = (-⟦x * y⟧ : Game) :=
   Quot.sound (mulNegRelabelling x y).equiv
-#align pgame.quot_mul_neg PGame.quot_mul_neg
+#align pgame.quot_mul_neg SetTheory.PGame.quot_mul_neg
 
 @[simp]
 theorem quot_left_distrib (x y z : PGame) : (⟦x * (y + z)⟧ : Game) = ⟦x * y⟧ + ⟦x * z⟧ :=
@@ -590,34 +592,34 @@ theorem quot_left_distrib (x y z : PGame) : (⟦x * (y + z)⟧ : Game) = ⟦x *
         abel
   termination_by _ => (x, y, z)
   decreasing_by pgame_wf_tac
-#align pgame.quot_left_distrib PGame.quot_left_distrib
+#align pgame.quot_left_distrib SetTheory.PGame.quot_left_distrib
 
 /-- `x * (y + z)` is equivalent to `x * y + x * z.`-/
 theorem left_distrib_equiv (x y z : PGame) : x * (y + z) ≈ x * y + x * z :=
   Quotient.exact <| quot_left_distrib _ _ _
-#align pgame.left_distrib_equiv PGame.left_distrib_equiv
+#align pgame.left_distrib_equiv SetTheory.PGame.left_distrib_equiv
 
 @[simp]
 theorem quot_left_distrib_sub (x y z : PGame) : (⟦x * (y - z)⟧ : Game) = ⟦x * y⟧ - ⟦x * z⟧ := by
   change (⟦x * (y + -z)⟧ : Game) = ⟦x * y⟧ + -⟦x * z⟧
   rw [quot_left_distrib, quot_mul_neg]
-#align pgame.quot_left_distrib_sub PGame.quot_left_distrib_sub
+#align pgame.quot_left_distrib_sub SetTheory.PGame.quot_left_distrib_sub
 
 @[simp]
 theorem quot_right_distrib (x y z : PGame) : (⟦(x + y) * z⟧ : Game) = ⟦x * z⟧ + ⟦y * z⟧ := by
   simp only [quot_mul_comm, quot_left_distrib]
-#align pgame.quot_right_distrib PGame.quot_right_distrib
+#align pgame.quot_right_distrib SetTheory.PGame.quot_right_distrib
 
 /-- `(x + y) * z` is equivalent to `x * z + y * z.`-/
 theorem right_distrib_equiv (x y z : PGame) : (x + y) * z ≈ x * z + y * z :=
   Quotient.exact <| quot_right_distrib _ _ _
-#align pgame.right_distrib_equiv PGame.right_distrib_equiv
+#align pgame.right_distrib_equiv SetTheory.PGame.right_distrib_equiv
 
 @[simp]
 theorem quot_right_distrib_sub (x y z : PGame) : (⟦(y - z) * x⟧ : Game) = ⟦y * x⟧ - ⟦z * x⟧ := by
   change (⟦(y + -z) * x⟧ : Game) = ⟦y * x⟧ + -⟦z * x⟧
   rw [quot_right_distrib, quot_neg_mul]
-#align pgame.quot_right_distrib_sub PGame.quot_right_distrib_sub
+#align pgame.quot_right_distrib_sub SetTheory.PGame.quot_right_distrib_sub
 
 /-- `x * 1` has the same moves as `x`. -/
 def mulOneRelabelling : ∀ x : PGame.{u}, x * 1 ≡r x
@@ -638,32 +640,32 @@ def mulOneRelabelling : ∀ x : PGame.{u}, x * 1 ≡r x
       rw [sub_zero]
       exact (addZeroRelabelling _).trans <|
         (((mulOneRelabelling _).addCongr (mulZeroRelabelling _)).trans <| addZeroRelabelling _) }
-#align pgame.mul_one_relabelling PGame.mulOneRelabelling
+#align pgame.mul_one_relabelling SetTheory.PGame.mulOneRelabelling
 
 @[simp]
 theorem quot_mul_one (x : PGame) : (⟦x * 1⟧ : Game) = ⟦x⟧ :=
   Quot.sound <| PGame.Relabelling.equiv <| mulOneRelabelling x
-#align pgame.quot_mul_one PGame.quot_mul_one
+#align pgame.quot_mul_one SetTheory.PGame.quot_mul_one
 
 /-- `x * 1` is equivalent to `x`. -/
 theorem mul_one_equiv (x : PGame) : x * 1 ≈ x :=
   Quotient.exact <| quot_mul_one x
-#align pgame.mul_one_equiv PGame.mul_one_equiv
+#align pgame.mul_one_equiv SetTheory.PGame.mul_one_equiv
 
 /-- `1 * x` has the same moves as `x`. -/
 def oneMulRelabelling (x : PGame) : 1 * x ≡r x :=
   (mulCommRelabelling 1 x).trans <| mulOneRelabelling x
-#align pgame.one_mul_relabelling PGame.oneMulRelabelling
+#align pgame.one_mul_relabelling SetTheory.PGame.oneMulRelabelling
 
 @[simp]
 theorem quot_one_mul (x : PGame) : (⟦1 * x⟧ : Game) = ⟦x⟧ :=
   Quot.sound <| PGame.Relabelling.equiv <| oneMulRelabelling x
-#align pgame.quot_one_mul PGame.quot_one_mul
+#align pgame.quot_one_mul SetTheory.PGame.quot_one_mul
 
 /-- `1 * x` is equivalent to `x`. -/
 theorem one_mul_equiv (x : PGame) : 1 * x ≈ x :=
   Quotient.exact <| quot_one_mul x
-#align pgame.one_mul_equiv PGame.one_mul_equiv
+#align pgame.one_mul_equiv SetTheory.PGame.one_mul_equiv
 
 theorem quot_mul_assoc (x y z : PGame) : (⟦x * y * z⟧ : Game) = ⟦x * (y * z)⟧ :=
   match x, y, z with
@@ -815,12 +817,12 @@ theorem quot_mul_assoc (x y z : PGame) : (⟦x * y * z⟧ : Game) = ⟦x * (y *
         abel
   termination_by _ => (x, y, z)
   decreasing_by pgame_wf_tac
-#align pgame.quot_mul_assoc PGame.quot_mul_assoc
+#align pgame.quot_mul_assoc SetTheory.PGame.quot_mul_assoc
 
 /-- `x * y * z` is equivalent to `x * (y * z).`-/
 theorem mul_assoc_equiv (x y z : PGame) : x * y * z ≈ x * (y * z) :=
   Quotient.exact <| quot_mul_assoc _ _ _
-#align pgame.mul_assoc_equiv PGame.mul_assoc_equiv
+#align pgame.mul_assoc_equiv SetTheory.PGame.mul_assoc_equiv
 
 /-- Because the two halves of the definition of `inv` produce more elements
 on each side, we have to define the two families inductively.
@@ -831,7 +833,7 @@ inductive InvTy (l r : Type u) : Bool → Type u
   | left₂ : l → InvTy l r true → InvTy l r false
   | right₁ : l → InvTy l r false → InvTy l r true
   | right₂ : r → InvTy l r true → InvTy l r true
-#align pgame.inv_ty PGame.InvTy
+#align pgame.inv_ty SetTheory.PGame.InvTy
 
 instance (l r : Type u) [IsEmpty l] [IsEmpty r] : IsEmpty (InvTy l r true) :=
   ⟨by rintro (_ | _ | _ | a | a) <;> exact isEmptyElim a⟩
@@ -845,7 +847,7 @@ instance uniqueInvTy (l r : Type u) [IsEmpty l] [IsEmpty r] : Unique (InvTy l r
       rintro (a | a | a)
       rfl
       all_goals exact isEmptyElim a }
-#align pgame.unique_inv_ty PGame.uniqueInvTy
+#align pgame.unique_inv_ty SetTheory.PGame.uniqueInvTy
 
 /-- Because the two halves of the definition of `inv` produce more elements
 of each side, we have to define the two families inductively.
@@ -857,7 +859,7 @@ def invVal {l r} (L : l → PGame) (R : r → PGame) (IHl : l → PGame) (IHr :
   | _, InvTy.left₂ i j => (1 + (L i - mk l r L R) * invVal L R IHl IHr j) * IHl i
   | _, InvTy.right₁ i j => (1 + (L i - mk l r L R) * invVal L R IHl IHr j) * IHl i
   | _, InvTy.right₂ i j => (1 + (R i - mk l r L R) * invVal L R IHl IHr j) * IHr i
-#align pgame.inv_val PGame.invVal
+#align pgame.inv_val SetTheory.PGame.invVal
 
 @[simp]
 theorem invVal_isEmpty {l r : Type u} {b} (L R IHl IHr) (i : InvTy l r b) [IsEmpty l] [IsEmpty r] :
@@ -865,7 +867,7 @@ theorem invVal_isEmpty {l r : Type u} {b} (L R IHl IHr) (i : InvTy l r b) [IsEmp
   cases' i with a _ a _ a _ a
   · rfl
   all_goals exact isEmptyElim a
-#align pgame.inv_val_is_empty PGame.invVal_isEmpty
+#align pgame.inv_val_is_empty SetTheory.PGame.invVal_isEmpty
 
 /-- The inverse of a positive surreal number `x = {L | R}` is
 given by `x⁻¹ = {0,
@@ -880,13 +882,13 @@ def inv' : PGame → PGame
     let IHl' : l' → PGame := fun i => inv' (L i.1)
     let IHr i := inv' (R i)
     ⟨InvTy l' r false, InvTy l' r true, invVal L' R IHl' IHr, invVal L' R IHl' IHr⟩
-#align pgame.inv' PGame.inv'
+#align pgame.inv' SetTheory.PGame.inv'
 
 theorem zero_lf_inv' : ∀ x : PGame, 0 ⧏ inv' x
   | ⟨xl, xr, xL, xR⟩ => by
     convert lf_mk _ _ InvTy.zero
     rfl
-#align pgame.zero_lf_inv' PGame.zero_lf_inv'
+#align pgame.zero_lf_inv' SetTheory.PGame.zero_lf_inv'
 
 /-- `inv' 0` has exactly the same moves as `1`. -/
 def inv'Zero : inv' 0 ≡r 1 := by
@@ -898,11 +900,11 @@ def inv'Zero : inv' 0 ≡r 1 := by
     simp; rfl
   · dsimp
     infer_instance
-#align pgame.inv'_zero PGame.inv'Zero
+#align pgame.inv'_zero SetTheory.PGame.inv'Zero
 
 theorem inv'_zero_equiv : inv' 0 ≈ 1 :=
   inv'Zero.equiv
-#align pgame.inv'_zero_equiv PGame.inv'_zero_equiv
+#align pgame.inv'_zero_equiv SetTheory.PGame.inv'_zero_equiv
 
 /-- `inv' 1` has exactly the same moves as `1`. -/
 def inv'One : inv' 1 ≡r (1 : PGame.{u}) := by
@@ -916,11 +918,11 @@ def inv'One : inv' 1 ≡r (1 : PGame.{u}) := by
   · -- Porting note: had to add `rfl`, because `simp` only uses the built-in `rfl`.
     simp; rfl
   · infer_instance
-#align pgame.inv'_one PGame.inv'One
+#align pgame.inv'_one SetTheory.PGame.inv'One
 
 theorem inv'_one_equiv : inv' 1 ≈ 1 :=
   inv'One.equiv
-#align pgame.inv'_one_equiv PGame.inv'_one_equiv
+#align pgame.inv'_one_equiv SetTheory.PGame.inv'_one_equiv
 
 /-- The inverse of a pre-game in terms of the inverse on positive pre-games. -/
 noncomputable instance : Inv PGame :=
@@ -930,29 +932,29 @@ noncomputable instance : Div PGame :=
   ⟨fun x y => x * y⁻¹⟩
 
 theorem inv_eq_of_equiv_zero {x : PGame} (h : x ≈ 0) : x⁻¹ = 0 := by classical exact if_pos h
-#align pgame.inv_eq_of_equiv_zero PGame.inv_eq_of_equiv_zero
+#align pgame.inv_eq_of_equiv_zero SetTheory.PGame.inv_eq_of_equiv_zero
 
 @[simp]
 theorem inv_zero : (0 : PGame)⁻¹ = 0 :=
   inv_eq_of_equiv_zero (equiv_refl _)
-#align pgame.inv_zero PGame.inv_zero
+#align pgame.inv_zero SetTheory.PGame.inv_zero
 
 theorem inv_eq_of_pos {x : PGame} (h : 0 < x) : x⁻¹ = inv' x := by
   classical exact (if_neg h.lf.not_equiv').trans (if_pos h)
-#align pgame.inv_eq_of_pos PGame.inv_eq_of_pos
+#align pgame.inv_eq_of_pos SetTheory.PGame.inv_eq_of_pos
 
 theorem inv_eq_of_lf_zero {x : PGame} (h : x ⧏ 0) : x⁻¹ = -inv' (-x) := by
   classical exact (if_neg h.not_equiv).trans (if_neg h.not_gt)
-#align pgame.inv_eq_of_lf_zero PGame.inv_eq_of_lf_zero
+#align pgame.inv_eq_of_lf_zero SetTheory.PGame.inv_eq_of_lf_zero
 
 /-- `1⁻¹` has exactly the same moves as `1`. -/
 def invOne : 1⁻¹ ≡r 1 := by
   rw [inv_eq_of_pos PGame.zero_lt_one]
   exact inv'One
-#align pgame.inv_one PGame.invOne
+#align pgame.inv_one SetTheory.PGame.invOne
 
 theorem inv_one_equiv : (1⁻¹ : PGame) ≈ 1 :=
   invOne.equiv
-#align pgame.inv_one_equiv PGame.inv_one_equiv
+#align pgame.inv_one_equiv SetTheory.PGame.inv_one_equiv
 
 end PGame
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -220,7 +220,6 @@ theorem quot_sub (a b : PGame) : ⟦a - b⟧ = (⟦a⟧ : Game) - ⟦b⟧ :=
 theorem quot_eq_of_mk'_quot_eq {x y : PGame} (L : x.LeftMoves ≃ y.LeftMoves)
     (R : x.RightMoves ≃ y.RightMoves) (hl : ∀ i, (⟦x.moveLeft i⟧ : Game) = ⟦y.moveLeft (L i)⟧)
     (hr : ∀ j, (⟦x.moveRight j⟧ : Game) = ⟦y.moveRight (R j)⟧) : (⟦x⟧ : Game) = ⟦y⟧ := by
-  simp_rw [Quotient.eq'] at hl hr
   exact Quot.sound (equiv_of_mk_equiv L R (fun _ => Game.PGame.equiv_iff_game_eq.2 (hl _))
                                           (fun _ => Game.PGame.equiv_iff_game_eq.2 (hr _)))
 #align pgame.quot_eq_of_mk_quot_eq PGame.quot_eq_of_mk'_quot_eq
chore: ensure all instances referred to directly have explicit names (#6423)

Per https://github.com/leanprover/lean4/issues/2343, we are going to need to change the automatic generation of instance names, as they become too long.

This PR ensures that everywhere in Mathlib that refers to an instance by name, that name is given explicitly, rather than being automatically generated.

There are four exceptions, which are now commented, with links to https://github.com/leanprover/lean4/issues/2343.

This was implemented by running Mathlib against a modified Lean that appended _ᾰ to all automatically generated names, and fixing everything.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -50,7 +50,7 @@ namespace Game
 /-- Negation of games. -/
 def neg : Game → Game := Quot.lift (fun x => ⟦-x⟧) fun _ _ h => Quot.sound ((neg_equiv_neg_iff).2 h)
 
-instance : AddCommGroupWithOne Game where
+instance instAddCommGroupWithOneGame : AddCommGroupWithOne Game where
   zero := ⟦0⟧
   one := ⟦1⟧
   neg := neg
@@ -76,7 +76,7 @@ instance : AddCommGroupWithOne Game where
 instance : Inhabited Game :=
   ⟨0⟩
 
-instance : PartialOrder Game where
+instance instPartialOrderGame : PartialOrder Game where
   le := Quotient.lift₂ (· ≤ ·) fun x₁ y₁ x₂ y₂ hx hy => propext (le_congr hx hy)
   le_refl := by
     rintro ⟨x⟩
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2019 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Scott Morrison, Apurva Nakade
-
-! This file was ported from Lean 3 source module set_theory.game.basic
-! leanprover-community/mathlib commit 6623e6af705e97002a9054c1c05a980180276fc1
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.SetTheory.Game.PGame
 import Mathlib.Tactic.Abel
 
+#align_import set_theory.game.basic from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
+
 /-!
 # Combinatorial games.
 
feat: port SetTheory.Game.Basic (#4311)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: David Renshaw <dwrenshaw@gmail.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Dependencies 6 + 179

180 files ported (96.8%)
83136 lines ported (97.5%)
Show graph

The unported dependencies are