set_theory.game.impartialMathlib.SetTheory.Game.Impartial

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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -168,7 +168,7 @@ variable (G : SetTheory.PGame) [SetTheory.PGame.Impartial G]
 theorem SetTheory.PGame.Impartial.nonpos : ¬0 < G := fun h =>
   by
   have h' := neg_lt_neg_iff.2 h
-  rw [neg_zero, lt_congr_left (neg_equiv_self G).symm] at h' 
+  rw [neg_zero, lt_congr_left (neg_equiv_self G).symm] at h'
   exact (h.trans h').False
 #align pgame.impartial.nonpos SetTheory.PGame.Impartial.nonpos
 -/
@@ -177,7 +177,7 @@ theorem SetTheory.PGame.Impartial.nonpos : ¬0 < G := fun h =>
 theorem SetTheory.PGame.Impartial.nonneg : ¬G < 0 := fun h =>
   by
   have h' := neg_lt_neg_iff.2 h
-  rw [neg_zero, lt_congr_right (neg_equiv_self G).symm] at h' 
+  rw [neg_zero, lt_congr_right (neg_equiv_self G).symm] at h'
   exact (h.trans h').False
 #align pgame.impartial.nonneg SetTheory.PGame.Impartial.nonneg
 -/
@@ -303,7 +303,7 @@ theorem SetTheory.PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero :
     (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 :=
   by
   refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_gf G).2 (lf_of_le_move_left hi.2), fun hn => _⟩
-  rw [fuzzy_zero_iff_gf G, zero_lf_le] at hn 
+  rw [fuzzy_zero_iff_gf G, zero_lf_le] at hn
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_ge _).2 hi⟩
 #align pgame.impartial.exists_left_move_equiv_iff_fuzzy_zero SetTheory.PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero
@@ -314,7 +314,7 @@ theorem SetTheory.PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero :
     (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 :=
   by
   refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_lf G).2 (lf_of_move_right_le hi.1), fun hn => _⟩
-  rw [fuzzy_zero_iff_lf G, lf_zero_le] at hn 
+  rw [fuzzy_zero_iff_lf G, lf_zero_le] at hn
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_le _).2 hi⟩
 #align pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero SetTheory.PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2020 Fox Thomson. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Fox Thomson
 -/
-import Mathbin.SetTheory.Game.Basic
+import SetTheory.Game.Basic
 import Mathbin.Tactic.NthRewrite.Default
 
 #align_import set_theory.game.impartial from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
Diff
@@ -23,88 +23,97 @@ impartial.
 
 universe u
 
-open scoped PGame
+open scoped SetTheory.PGame
 
-namespace PGame
+namespace SetTheory.PGame
 
-#print PGame.ImpartialAux /-
+#print SetTheory.PGame.ImpartialAux /-
 /-- The definition for a impartial game, defined using Conway induction. -/
-def ImpartialAux : PGame → Prop
+def SetTheory.PGame.ImpartialAux : SetTheory.PGame → Prop
   | G => (G ≈ -G) ∧ (∀ i, impartial_aux (G.moveLeft i)) ∧ ∀ j, impartial_aux (G.moveRight j)
 decreasing_by pgame_wf_tac
-#align pgame.impartial_aux PGame.ImpartialAux
+#align pgame.impartial_aux SetTheory.PGame.ImpartialAux
 -/
 
-#print PGame.impartialAux_def /-
-theorem impartialAux_def {G : PGame} :
+#print SetTheory.PGame.impartialAux_def /-
+theorem SetTheory.PGame.impartialAux_def {G : SetTheory.PGame} :
     G.ImpartialAux ↔
-      (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j) :=
+      (G ≈ -G) ∧
+        (∀ i, SetTheory.PGame.ImpartialAux (G.moveLeft i)) ∧
+          ∀ j, SetTheory.PGame.ImpartialAux (G.moveRight j) :=
   by rw [impartial_aux]
-#align pgame.impartial_aux_def PGame.impartialAux_def
+#align pgame.impartial_aux_def SetTheory.PGame.impartialAux_def
 -/
 
-#print PGame.Impartial /-
+#print SetTheory.PGame.Impartial /-
 /-- A typeclass on impartial games. -/
-class Impartial (G : PGame) : Prop where
-  out : ImpartialAux G
-#align pgame.impartial PGame.Impartial
+class SetTheory.PGame.Impartial (G : SetTheory.PGame) : Prop where
+  out : SetTheory.PGame.ImpartialAux G
+#align pgame.impartial SetTheory.PGame.Impartial
 -/
 
-#print PGame.impartial_iff_aux /-
-theorem impartial_iff_aux {G : PGame} : G.Impartial ↔ G.ImpartialAux :=
+#print SetTheory.PGame.impartial_iff_aux /-
+theorem SetTheory.PGame.impartial_iff_aux {G : SetTheory.PGame} : G.Impartial ↔ G.ImpartialAux :=
   ⟨fun h => h.1, fun h => ⟨h⟩⟩
-#align pgame.impartial_iff_aux PGame.impartial_iff_aux
+#align pgame.impartial_iff_aux SetTheory.PGame.impartial_iff_aux
 -/
 
-#print PGame.impartial_def /-
-theorem impartial_def {G : PGame} :
-    G.Impartial ↔ (G ≈ -G) ∧ (∀ i, Impartial (G.moveLeft i)) ∧ ∀ j, Impartial (G.moveRight j) := by
-  simpa only [impartial_iff_aux] using impartial_aux_def
-#align pgame.impartial_def PGame.impartial_def
+#print SetTheory.PGame.impartial_def /-
+theorem SetTheory.PGame.impartial_def {G : SetTheory.PGame} :
+    G.Impartial ↔
+      (G ≈ -G) ∧
+        (∀ i, SetTheory.PGame.Impartial (G.moveLeft i)) ∧
+          ∀ j, SetTheory.PGame.Impartial (G.moveRight j) :=
+  by simpa only [impartial_iff_aux] using impartial_aux_def
+#align pgame.impartial_def SetTheory.PGame.impartial_def
 -/
 
 namespace Impartial
 
-#print PGame.Impartial.impartial_zero /-
-instance impartial_zero : Impartial 0 := by rw [impartial_def]; dsimp; simp
-#align pgame.impartial.impartial_zero PGame.Impartial.impartial_zero
+#print SetTheory.PGame.Impartial.impartial_zero /-
+instance SetTheory.PGame.Impartial.impartial_zero : SetTheory.PGame.Impartial 0 := by
+  rw [impartial_def]; dsimp; simp
+#align pgame.impartial.impartial_zero SetTheory.PGame.Impartial.impartial_zero
 -/
 
-#print PGame.Impartial.impartial_star /-
-instance impartial_star : Impartial star := by rw [impartial_def];
+#print SetTheory.PGame.Impartial.impartial_star /-
+instance SetTheory.PGame.Impartial.impartial_star :
+    SetTheory.PGame.Impartial SetTheory.PGame.star := by rw [impartial_def];
   simpa using impartial.impartial_zero
-#align pgame.impartial.impartial_star PGame.Impartial.impartial_star
+#align pgame.impartial.impartial_star SetTheory.PGame.Impartial.impartial_star
 -/
 
-#print PGame.Impartial.neg_equiv_self /-
-theorem neg_equiv_self (G : PGame) [h : G.Impartial] : G ≈ -G :=
-  (impartial_def.1 h).1
-#align pgame.impartial.neg_equiv_self PGame.Impartial.neg_equiv_self
+#print SetTheory.PGame.Impartial.neg_equiv_self /-
+theorem SetTheory.PGame.Impartial.neg_equiv_self (G : SetTheory.PGame) [h : G.Impartial] : G ≈ -G :=
+  (SetTheory.PGame.impartial_def.1 h).1
+#align pgame.impartial.neg_equiv_self SetTheory.PGame.Impartial.neg_equiv_self
 -/
 
-#print PGame.Impartial.mk'_neg_equiv_self /-
+#print SetTheory.PGame.Impartial.mk'_neg_equiv_self /-
 @[simp]
-theorem mk'_neg_equiv_self (G : PGame) [h : G.Impartial] : -⟦G⟧ = ⟦G⟧ :=
-  Quot.sound (neg_equiv_self G).symm
-#align pgame.impartial.mk_neg_equiv_self PGame.Impartial.mk'_neg_equiv_self
+theorem SetTheory.PGame.Impartial.mk'_neg_equiv_self (G : SetTheory.PGame) [h : G.Impartial] :
+    -⟦G⟧ = ⟦G⟧ :=
+  Quot.sound (SetTheory.PGame.Impartial.neg_equiv_self G).symm
+#align pgame.impartial.mk_neg_equiv_self SetTheory.PGame.Impartial.mk'_neg_equiv_self
 -/
 
-#print PGame.Impartial.moveLeft_impartial /-
-instance moveLeft_impartial {G : PGame} [h : G.Impartial] (i : G.LeftMoves) :
-    (G.moveLeft i).Impartial :=
-  (impartial_def.1 h).2.1 i
-#align pgame.impartial.move_left_impartial PGame.Impartial.moveLeft_impartial
+#print SetTheory.PGame.Impartial.moveLeft_impartial /-
+instance SetTheory.PGame.Impartial.moveLeft_impartial {G : SetTheory.PGame} [h : G.Impartial]
+    (i : G.LeftMoves) : (G.moveLeft i).Impartial :=
+  (SetTheory.PGame.impartial_def.1 h).2.1 i
+#align pgame.impartial.move_left_impartial SetTheory.PGame.Impartial.moveLeft_impartial
 -/
 
-#print PGame.Impartial.moveRight_impartial /-
-instance moveRight_impartial {G : PGame} [h : G.Impartial] (j : G.RightMoves) :
-    (G.moveRight j).Impartial :=
-  (impartial_def.1 h).2.2 j
-#align pgame.impartial.move_right_impartial PGame.Impartial.moveRight_impartial
+#print SetTheory.PGame.Impartial.moveRight_impartial /-
+instance SetTheory.PGame.Impartial.moveRight_impartial {G : SetTheory.PGame} [h : G.Impartial]
+    (j : G.RightMoves) : (G.moveRight j).Impartial :=
+  (SetTheory.PGame.impartial_def.1 h).2.2 j
+#align pgame.impartial.move_right_impartial SetTheory.PGame.Impartial.moveRight_impartial
 -/
 
-#print PGame.Impartial.impartial_congr /-
-theorem impartial_congr : ∀ {G H : PGame} (e : G ≡r H) [G.Impartial], H.Impartial
+#print SetTheory.PGame.Impartial.impartial_congr /-
+theorem SetTheory.PGame.Impartial.impartial_congr :
+    ∀ {G H : SetTheory.PGame} (e : G ≡r H) [G.Impartial], H.Impartial
   | G, H => fun e => by
     intro h
     exact
@@ -112,11 +121,12 @@ theorem impartial_congr : ∀ {G H : PGame} (e : G ≡r H) [G.Impartial], H.Impa
         ⟨e.symm.equiv.trans ((neg_equiv_self G).trans (neg_equiv_neg_iff.2 e.equiv)), fun i =>
           impartial_congr (e.move_left_symm i), fun j => impartial_congr (e.move_right_symm j)⟩
 decreasing_by pgame_wf_tac
-#align pgame.impartial.impartial_congr PGame.Impartial.impartial_congr
+#align pgame.impartial.impartial_congr SetTheory.PGame.Impartial.impartial_congr
 -/
 
-#print PGame.Impartial.impartial_add /-
-instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).Impartial
+#print SetTheory.PGame.Impartial.impartial_add /-
+instance SetTheory.PGame.Impartial.impartial_add :
+    ∀ (G H : SetTheory.PGame) [G.Impartial] [H.Impartial], (G + H).Impartial
   | G, H => by
     intro hG hH
     rw [impartial_def]
@@ -132,11 +142,12 @@ instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).
         intro i; simp only [add_move_right_inl, add_move_right_inr]
         apply impartial_add
 decreasing_by pgame_wf_tac
-#align pgame.impartial.impartial_add PGame.Impartial.impartial_add
+#align pgame.impartial.impartial_add SetTheory.PGame.Impartial.impartial_add
 -/
 
-#print PGame.Impartial.impartial_neg /-
-instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
+#print SetTheory.PGame.Impartial.impartial_neg /-
+instance SetTheory.PGame.Impartial.impartial_neg :
+    ∀ (G : SetTheory.PGame) [G.Impartial], (-G).Impartial
   | G => by
     intro hG
     rw [impartial_def]
@@ -148,161 +159,168 @@ instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
     · rw [move_right_neg']
       apply impartial_neg
 decreasing_by pgame_wf_tac
-#align pgame.impartial.impartial_neg PGame.Impartial.impartial_neg
+#align pgame.impartial.impartial_neg SetTheory.PGame.Impartial.impartial_neg
 -/
 
-variable (G : PGame) [Impartial G]
+variable (G : SetTheory.PGame) [SetTheory.PGame.Impartial G]
 
-#print PGame.Impartial.nonpos /-
-theorem nonpos : ¬0 < G := fun h =>
+#print SetTheory.PGame.Impartial.nonpos /-
+theorem SetTheory.PGame.Impartial.nonpos : ¬0 < G := fun h =>
   by
   have h' := neg_lt_neg_iff.2 h
   rw [neg_zero, lt_congr_left (neg_equiv_self G).symm] at h' 
   exact (h.trans h').False
-#align pgame.impartial.nonpos PGame.Impartial.nonpos
+#align pgame.impartial.nonpos SetTheory.PGame.Impartial.nonpos
 -/
 
-#print PGame.Impartial.nonneg /-
-theorem nonneg : ¬G < 0 := fun h =>
+#print SetTheory.PGame.Impartial.nonneg /-
+theorem SetTheory.PGame.Impartial.nonneg : ¬G < 0 := fun h =>
   by
   have h' := neg_lt_neg_iff.2 h
   rw [neg_zero, lt_congr_right (neg_equiv_self G).symm] at h' 
   exact (h.trans h').False
-#align pgame.impartial.nonneg PGame.Impartial.nonneg
+#align pgame.impartial.nonneg SetTheory.PGame.Impartial.nonneg
 -/
 
-#print PGame.Impartial.equiv_or_fuzzy_zero /-
+#print SetTheory.PGame.Impartial.equiv_or_fuzzy_zero /-
 /-- In an impartial game, either the first player always wins, or the second player always wins. -/
-theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 :=
+theorem SetTheory.PGame.Impartial.equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 :=
   by
   rcases lt_or_equiv_or_gt_or_fuzzy G 0 with (h | h | h | h)
   · exact ((nonneg G) h).elim
   · exact Or.inl h
   · exact ((nonpos G) h).elim
   · exact Or.inr h
-#align pgame.impartial.equiv_or_fuzzy_zero PGame.Impartial.equiv_or_fuzzy_zero
+#align pgame.impartial.equiv_or_fuzzy_zero SetTheory.PGame.Impartial.equiv_or_fuzzy_zero
 -/
 
-#print PGame.Impartial.not_equiv_zero_iff /-
+#print SetTheory.PGame.Impartial.not_equiv_zero_iff /-
 @[simp]
-theorem not_equiv_zero_iff : ¬(G ≈ 0) ↔ G ‖ 0 :=
-  ⟨(equiv_or_fuzzy_zero G).resolve_left, Fuzzy.not_equiv⟩
-#align pgame.impartial.not_equiv_zero_iff PGame.Impartial.not_equiv_zero_iff
+theorem SetTheory.PGame.Impartial.not_equiv_zero_iff : ¬(G ≈ 0) ↔ G ‖ 0 :=
+  ⟨(SetTheory.PGame.Impartial.equiv_or_fuzzy_zero G).resolve_left, SetTheory.PGame.Fuzzy.not_equiv⟩
+#align pgame.impartial.not_equiv_zero_iff SetTheory.PGame.Impartial.not_equiv_zero_iff
 -/
 
-#print PGame.Impartial.not_fuzzy_zero_iff /-
+#print SetTheory.PGame.Impartial.not_fuzzy_zero_iff /-
 @[simp]
-theorem not_fuzzy_zero_iff : ¬G ‖ 0 ↔ (G ≈ 0) :=
-  ⟨(equiv_or_fuzzy_zero G).resolve_right, Equiv.not_fuzzy⟩
-#align pgame.impartial.not_fuzzy_zero_iff PGame.Impartial.not_fuzzy_zero_iff
+theorem SetTheory.PGame.Impartial.not_fuzzy_zero_iff : ¬G ‖ 0 ↔ (G ≈ 0) :=
+  ⟨(SetTheory.PGame.Impartial.equiv_or_fuzzy_zero G).resolve_right, SetTheory.PGame.Equiv.not_fuzzy⟩
+#align pgame.impartial.not_fuzzy_zero_iff SetTheory.PGame.Impartial.not_fuzzy_zero_iff
 -/
 
-#print PGame.Impartial.add_self /-
-theorem add_self : G + G ≈ 0 :=
-  (add_congr_left (neg_equiv_self G)).trans (add_left_neg_equiv G)
-#align pgame.impartial.add_self PGame.Impartial.add_self
+#print SetTheory.PGame.Impartial.add_self /-
+theorem SetTheory.PGame.Impartial.add_self : G + G ≈ 0 :=
+  (SetTheory.PGame.add_congr_left (SetTheory.PGame.Impartial.neg_equiv_self G)).trans
+    (SetTheory.PGame.add_left_neg_equiv G)
+#align pgame.impartial.add_self SetTheory.PGame.Impartial.add_self
 -/
 
-#print PGame.Impartial.mk'_add_self /-
+#print SetTheory.PGame.Impartial.mk'_add_self /-
 @[simp]
-theorem mk'_add_self : ⟦G⟧ + ⟦G⟧ = 0 :=
-  Quot.sound (add_self G)
-#align pgame.impartial.mk_add_self PGame.Impartial.mk'_add_self
+theorem SetTheory.PGame.Impartial.mk'_add_self : ⟦G⟧ + ⟦G⟧ = 0 :=
+  Quot.sound (SetTheory.PGame.Impartial.add_self G)
+#align pgame.impartial.mk_add_self SetTheory.PGame.Impartial.mk'_add_self
 -/
 
-#print PGame.Impartial.equiv_iff_add_equiv_zero /-
+#print SetTheory.PGame.Impartial.equiv_iff_add_equiv_zero /-
 /-- This lemma doesn't require `H` to be impartial. -/
-theorem equiv_iff_add_equiv_zero (H : PGame) : (H ≈ G) ↔ (H + G ≈ 0) := by
+theorem SetTheory.PGame.Impartial.equiv_iff_add_equiv_zero (H : SetTheory.PGame) :
+    (H ≈ G) ↔ (H + G ≈ 0) := by
   rw [equiv_iff_game_eq, equiv_iff_game_eq, ← @add_right_cancel_iff _ _ _ (-⟦G⟧)]; simpa
-#align pgame.impartial.equiv_iff_add_equiv_zero PGame.Impartial.equiv_iff_add_equiv_zero
+#align pgame.impartial.equiv_iff_add_equiv_zero SetTheory.PGame.Impartial.equiv_iff_add_equiv_zero
 -/
 
-#print PGame.Impartial.equiv_iff_add_equiv_zero' /-
+#print SetTheory.PGame.Impartial.equiv_iff_add_equiv_zero' /-
 /-- This lemma doesn't require `H` to be impartial. -/
-theorem equiv_iff_add_equiv_zero' (H : PGame) : (G ≈ H) ↔ (G + H ≈ 0) := by
+theorem SetTheory.PGame.Impartial.equiv_iff_add_equiv_zero' (H : SetTheory.PGame) :
+    (G ≈ H) ↔ (G + H ≈ 0) := by
   rw [equiv_iff_game_eq, equiv_iff_game_eq, ← @add_left_cancel_iff _ _ _ (-⟦G⟧), eq_comm]; simpa
-#align pgame.impartial.equiv_iff_add_equiv_zero' PGame.Impartial.equiv_iff_add_equiv_zero'
+#align pgame.impartial.equiv_iff_add_equiv_zero' SetTheory.PGame.Impartial.equiv_iff_add_equiv_zero'
 -/
 
-#print PGame.Impartial.le_zero_iff /-
-theorem le_zero_iff {G : PGame} [G.Impartial] : G ≤ 0 ↔ 0 ≤ G := by
-  rw [← zero_le_neg_iff, le_congr_right (neg_equiv_self G)]
-#align pgame.impartial.le_zero_iff PGame.Impartial.le_zero_iff
+#print SetTheory.PGame.Impartial.le_zero_iff /-
+theorem SetTheory.PGame.Impartial.le_zero_iff {G : SetTheory.PGame} [G.Impartial] : G ≤ 0 ↔ 0 ≤ G :=
+  by rw [← zero_le_neg_iff, le_congr_right (neg_equiv_self G)]
+#align pgame.impartial.le_zero_iff SetTheory.PGame.Impartial.le_zero_iff
 -/
 
-#print PGame.Impartial.lf_zero_iff /-
-theorem lf_zero_iff {G : PGame} [G.Impartial] : G ⧏ 0 ↔ 0 ⧏ G := by
-  rw [← zero_lf_neg_iff, lf_congr_right (neg_equiv_self G)]
-#align pgame.impartial.lf_zero_iff PGame.Impartial.lf_zero_iff
+#print SetTheory.PGame.Impartial.lf_zero_iff /-
+theorem SetTheory.PGame.Impartial.lf_zero_iff {G : SetTheory.PGame} [G.Impartial] : G ⧏ 0 ↔ 0 ⧏ G :=
+  by rw [← zero_lf_neg_iff, lf_congr_right (neg_equiv_self G)]
+#align pgame.impartial.lf_zero_iff SetTheory.PGame.Impartial.lf_zero_iff
 -/
 
-#print PGame.Impartial.equiv_zero_iff_le /-
-theorem equiv_zero_iff_le : (G ≈ 0) ↔ G ≤ 0 :=
-  ⟨And.left, fun h => ⟨h, le_zero_iff.1 h⟩⟩
-#align pgame.impartial.equiv_zero_iff_le PGame.Impartial.equiv_zero_iff_le
+#print SetTheory.PGame.Impartial.equiv_zero_iff_le /-
+theorem SetTheory.PGame.Impartial.equiv_zero_iff_le : (G ≈ 0) ↔ G ≤ 0 :=
+  ⟨And.left, fun h => ⟨h, SetTheory.PGame.Impartial.le_zero_iff.1 h⟩⟩
+#align pgame.impartial.equiv_zero_iff_le SetTheory.PGame.Impartial.equiv_zero_iff_le
 -/
 
-#print PGame.Impartial.fuzzy_zero_iff_lf /-
-theorem fuzzy_zero_iff_lf : G ‖ 0 ↔ G ⧏ 0 :=
-  ⟨And.left, fun h => ⟨h, lf_zero_iff.1 h⟩⟩
-#align pgame.impartial.fuzzy_zero_iff_lf PGame.Impartial.fuzzy_zero_iff_lf
+#print SetTheory.PGame.Impartial.fuzzy_zero_iff_lf /-
+theorem SetTheory.PGame.Impartial.fuzzy_zero_iff_lf : G ‖ 0 ↔ G ⧏ 0 :=
+  ⟨And.left, fun h => ⟨h, SetTheory.PGame.Impartial.lf_zero_iff.1 h⟩⟩
+#align pgame.impartial.fuzzy_zero_iff_lf SetTheory.PGame.Impartial.fuzzy_zero_iff_lf
 -/
 
-#print PGame.Impartial.equiv_zero_iff_ge /-
-theorem equiv_zero_iff_ge : (G ≈ 0) ↔ 0 ≤ G :=
-  ⟨And.right, fun h => ⟨le_zero_iff.2 h, h⟩⟩
-#align pgame.impartial.equiv_zero_iff_ge PGame.Impartial.equiv_zero_iff_ge
+#print SetTheory.PGame.Impartial.equiv_zero_iff_ge /-
+theorem SetTheory.PGame.Impartial.equiv_zero_iff_ge : (G ≈ 0) ↔ 0 ≤ G :=
+  ⟨And.right, fun h => ⟨SetTheory.PGame.Impartial.le_zero_iff.2 h, h⟩⟩
+#align pgame.impartial.equiv_zero_iff_ge SetTheory.PGame.Impartial.equiv_zero_iff_ge
 -/
 
-#print PGame.Impartial.fuzzy_zero_iff_gf /-
-theorem fuzzy_zero_iff_gf : G ‖ 0 ↔ 0 ⧏ G :=
-  ⟨And.right, fun h => ⟨lf_zero_iff.2 h, h⟩⟩
-#align pgame.impartial.fuzzy_zero_iff_gf PGame.Impartial.fuzzy_zero_iff_gf
+#print SetTheory.PGame.Impartial.fuzzy_zero_iff_gf /-
+theorem SetTheory.PGame.Impartial.fuzzy_zero_iff_gf : G ‖ 0 ↔ 0 ⧏ G :=
+  ⟨And.right, fun h => ⟨SetTheory.PGame.Impartial.lf_zero_iff.2 h, h⟩⟩
+#align pgame.impartial.fuzzy_zero_iff_gf SetTheory.PGame.Impartial.fuzzy_zero_iff_gf
 -/
 
-#print PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero /-
-theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0) :=
+#print SetTheory.PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero /-
+theorem SetTheory.PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero :
+    (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0) :=
   by
   refine' ⟨fun hb => _, fun hp i => _⟩
   · rw [equiv_zero_iff_le G, le_zero_lf]
     exact fun i => (hb i).1
   · rw [fuzzy_zero_iff_lf]
     exact hp.1.moveLeft_lf i
-#align pgame.impartial.forall_left_moves_fuzzy_iff_equiv_zero PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero
+#align pgame.impartial.forall_left_moves_fuzzy_iff_equiv_zero SetTheory.PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero
 -/
 
-#print PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero /-
-theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0) :=
+#print SetTheory.PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero /-
+theorem SetTheory.PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero :
+    (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0) :=
   by
   refine' ⟨fun hb => _, fun hp i => _⟩
   · rw [equiv_zero_iff_ge G, zero_le_lf]
     exact fun i => (hb i).2
   · rw [fuzzy_zero_iff_gf]
     exact hp.2.lf_moveRight i
-#align pgame.impartial.forall_right_moves_fuzzy_iff_equiv_zero PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero
+#align pgame.impartial.forall_right_moves_fuzzy_iff_equiv_zero SetTheory.PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero
 -/
 
-#print PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero /-
-theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 :=
+#print SetTheory.PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero /-
+theorem SetTheory.PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero :
+    (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 :=
   by
   refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_gf G).2 (lf_of_le_move_left hi.2), fun hn => _⟩
   rw [fuzzy_zero_iff_gf G, zero_lf_le] at hn 
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_ge _).2 hi⟩
-#align pgame.impartial.exists_left_move_equiv_iff_fuzzy_zero PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero
+#align pgame.impartial.exists_left_move_equiv_iff_fuzzy_zero SetTheory.PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero
 -/
 
-#print PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero /-
-theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 :=
+#print SetTheory.PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero /-
+theorem SetTheory.PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero :
+    (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 :=
   by
   refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_lf G).2 (lf_of_move_right_le hi.1), fun hn => _⟩
   rw [fuzzy_zero_iff_lf G, lf_zero_le] at hn 
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_le _).2 hi⟩
-#align pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero
+#align pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero SetTheory.PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero
 -/
 
 end Impartial
 
-end PGame
+end SetTheory.PGame
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2020 Fox Thomson. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Fox Thomson
-
-! This file was ported from Lean 3 source module set_theory.game.impartial
-! leanprover-community/mathlib commit 9240e8be927a0955b9a82c6c85ef499ee3a626b8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.SetTheory.Game.Basic
 import Mathbin.Tactic.NthRewrite.Default
 
+#align_import set_theory.game.impartial from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
+
 /-!
 # Basic definitions about impartial (pre-)games
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Fox Thomson
 
 ! This file was ported from Lean 3 source module set_theory.game.impartial
-! leanprover-community/mathlib commit 2e0975f6a25dd3fbfb9e41556a77f075f6269748
+! leanprover-community/mathlib commit 9240e8be927a0955b9a82c6c85ef499ee3a626b8
 ! 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.NthRewrite.Default
 /-!
 # Basic definitions about impartial (pre-)games
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 We will define an impartial game, one in which left and right can make exactly the same moves.
 Our definition differs slightly by saying that the game is always equivalent to its negative,
 no matter what moves are played. This allows for games such as poker-nim to be classifed as
Diff
@@ -27,60 +27,83 @@ open scoped PGame
 
 namespace PGame
 
+#print PGame.ImpartialAux /-
 /-- The definition for a impartial game, defined using Conway induction. -/
 def ImpartialAux : PGame → Prop
   | G => (G ≈ -G) ∧ (∀ i, impartial_aux (G.moveLeft i)) ∧ ∀ j, impartial_aux (G.moveRight j)
 decreasing_by pgame_wf_tac
 #align pgame.impartial_aux PGame.ImpartialAux
+-/
 
+#print PGame.impartialAux_def /-
 theorem impartialAux_def {G : PGame} :
     G.ImpartialAux ↔
       (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j) :=
   by rw [impartial_aux]
 #align pgame.impartial_aux_def PGame.impartialAux_def
+-/
 
+#print PGame.Impartial /-
 /-- A typeclass on impartial games. -/
 class Impartial (G : PGame) : Prop where
   out : ImpartialAux G
 #align pgame.impartial PGame.Impartial
+-/
 
+#print PGame.impartial_iff_aux /-
 theorem impartial_iff_aux {G : PGame} : G.Impartial ↔ G.ImpartialAux :=
   ⟨fun h => h.1, fun h => ⟨h⟩⟩
 #align pgame.impartial_iff_aux PGame.impartial_iff_aux
+-/
 
+#print PGame.impartial_def /-
 theorem impartial_def {G : PGame} :
     G.Impartial ↔ (G ≈ -G) ∧ (∀ i, Impartial (G.moveLeft i)) ∧ ∀ j, Impartial (G.moveRight j) := by
   simpa only [impartial_iff_aux] using impartial_aux_def
 #align pgame.impartial_def PGame.impartial_def
+-/
 
 namespace Impartial
 
+#print PGame.Impartial.impartial_zero /-
 instance impartial_zero : Impartial 0 := by rw [impartial_def]; dsimp; simp
 #align pgame.impartial.impartial_zero PGame.Impartial.impartial_zero
+-/
 
+#print PGame.Impartial.impartial_star /-
 instance impartial_star : Impartial star := by rw [impartial_def];
   simpa using impartial.impartial_zero
 #align pgame.impartial.impartial_star PGame.Impartial.impartial_star
+-/
 
+#print PGame.Impartial.neg_equiv_self /-
 theorem neg_equiv_self (G : PGame) [h : G.Impartial] : G ≈ -G :=
   (impartial_def.1 h).1
 #align pgame.impartial.neg_equiv_self PGame.Impartial.neg_equiv_self
+-/
 
+#print PGame.Impartial.mk'_neg_equiv_self /-
 @[simp]
 theorem mk'_neg_equiv_self (G : PGame) [h : G.Impartial] : -⟦G⟧ = ⟦G⟧ :=
   Quot.sound (neg_equiv_self G).symm
 #align pgame.impartial.mk_neg_equiv_self PGame.Impartial.mk'_neg_equiv_self
+-/
 
+#print PGame.Impartial.moveLeft_impartial /-
 instance moveLeft_impartial {G : PGame} [h : G.Impartial] (i : G.LeftMoves) :
     (G.moveLeft i).Impartial :=
   (impartial_def.1 h).2.1 i
 #align pgame.impartial.move_left_impartial PGame.Impartial.moveLeft_impartial
+-/
 
+#print PGame.Impartial.moveRight_impartial /-
 instance moveRight_impartial {G : PGame} [h : G.Impartial] (j : G.RightMoves) :
     (G.moveRight j).Impartial :=
   (impartial_def.1 h).2.2 j
 #align pgame.impartial.move_right_impartial PGame.Impartial.moveRight_impartial
+-/
 
+#print PGame.Impartial.impartial_congr /-
 theorem impartial_congr : ∀ {G H : PGame} (e : G ≡r H) [G.Impartial], H.Impartial
   | G, H => fun e => by
     intro h
@@ -90,7 +113,9 @@ theorem impartial_congr : ∀ {G H : PGame} (e : G ≡r H) [G.Impartial], H.Impa
           impartial_congr (e.move_left_symm i), fun j => impartial_congr (e.move_right_symm j)⟩
 decreasing_by pgame_wf_tac
 #align pgame.impartial.impartial_congr PGame.Impartial.impartial_congr
+-/
 
+#print PGame.Impartial.impartial_add /-
 instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).Impartial
   | G, H => by
     intro hG hH
@@ -108,7 +133,9 @@ instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).
         apply impartial_add
 decreasing_by pgame_wf_tac
 #align pgame.impartial.impartial_add PGame.Impartial.impartial_add
+-/
 
+#print PGame.Impartial.impartial_neg /-
 instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
   | G => by
     intro hG
@@ -122,23 +149,29 @@ instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
       apply impartial_neg
 decreasing_by pgame_wf_tac
 #align pgame.impartial.impartial_neg PGame.Impartial.impartial_neg
+-/
 
 variable (G : PGame) [Impartial G]
 
+#print PGame.Impartial.nonpos /-
 theorem nonpos : ¬0 < G := fun h =>
   by
   have h' := neg_lt_neg_iff.2 h
   rw [neg_zero, lt_congr_left (neg_equiv_self G).symm] at h' 
   exact (h.trans h').False
 #align pgame.impartial.nonpos PGame.Impartial.nonpos
+-/
 
+#print PGame.Impartial.nonneg /-
 theorem nonneg : ¬G < 0 := fun h =>
   by
   have h' := neg_lt_neg_iff.2 h
   rw [neg_zero, lt_congr_right (neg_equiv_self G).symm] at h' 
   exact (h.trans h').False
 #align pgame.impartial.nonneg PGame.Impartial.nonneg
+-/
 
+#print PGame.Impartial.equiv_or_fuzzy_zero /-
 /-- In an impartial game, either the first player always wins, or the second player always wins. -/
 theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 :=
   by
@@ -148,60 +181,86 @@ theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 :=
   · exact ((nonpos G) h).elim
   · exact Or.inr h
 #align pgame.impartial.equiv_or_fuzzy_zero PGame.Impartial.equiv_or_fuzzy_zero
+-/
 
+#print PGame.Impartial.not_equiv_zero_iff /-
 @[simp]
 theorem not_equiv_zero_iff : ¬(G ≈ 0) ↔ G ‖ 0 :=
   ⟨(equiv_or_fuzzy_zero G).resolve_left, Fuzzy.not_equiv⟩
 #align pgame.impartial.not_equiv_zero_iff PGame.Impartial.not_equiv_zero_iff
+-/
 
+#print PGame.Impartial.not_fuzzy_zero_iff /-
 @[simp]
 theorem not_fuzzy_zero_iff : ¬G ‖ 0 ↔ (G ≈ 0) :=
   ⟨(equiv_or_fuzzy_zero G).resolve_right, Equiv.not_fuzzy⟩
 #align pgame.impartial.not_fuzzy_zero_iff PGame.Impartial.not_fuzzy_zero_iff
+-/
 
+#print PGame.Impartial.add_self /-
 theorem add_self : G + G ≈ 0 :=
   (add_congr_left (neg_equiv_self G)).trans (add_left_neg_equiv G)
 #align pgame.impartial.add_self PGame.Impartial.add_self
+-/
 
+#print PGame.Impartial.mk'_add_self /-
 @[simp]
 theorem mk'_add_self : ⟦G⟧ + ⟦G⟧ = 0 :=
   Quot.sound (add_self G)
 #align pgame.impartial.mk_add_self PGame.Impartial.mk'_add_self
+-/
 
+#print PGame.Impartial.equiv_iff_add_equiv_zero /-
 /-- This lemma doesn't require `H` to be impartial. -/
 theorem equiv_iff_add_equiv_zero (H : PGame) : (H ≈ G) ↔ (H + G ≈ 0) := by
   rw [equiv_iff_game_eq, equiv_iff_game_eq, ← @add_right_cancel_iff _ _ _ (-⟦G⟧)]; simpa
 #align pgame.impartial.equiv_iff_add_equiv_zero PGame.Impartial.equiv_iff_add_equiv_zero
+-/
 
+#print PGame.Impartial.equiv_iff_add_equiv_zero' /-
 /-- This lemma doesn't require `H` to be impartial. -/
 theorem equiv_iff_add_equiv_zero' (H : PGame) : (G ≈ H) ↔ (G + H ≈ 0) := by
   rw [equiv_iff_game_eq, equiv_iff_game_eq, ← @add_left_cancel_iff _ _ _ (-⟦G⟧), eq_comm]; simpa
 #align pgame.impartial.equiv_iff_add_equiv_zero' PGame.Impartial.equiv_iff_add_equiv_zero'
+-/
 
+#print PGame.Impartial.le_zero_iff /-
 theorem le_zero_iff {G : PGame} [G.Impartial] : G ≤ 0 ↔ 0 ≤ G := by
   rw [← zero_le_neg_iff, le_congr_right (neg_equiv_self G)]
 #align pgame.impartial.le_zero_iff PGame.Impartial.le_zero_iff
+-/
 
+#print PGame.Impartial.lf_zero_iff /-
 theorem lf_zero_iff {G : PGame} [G.Impartial] : G ⧏ 0 ↔ 0 ⧏ G := by
   rw [← zero_lf_neg_iff, lf_congr_right (neg_equiv_self G)]
 #align pgame.impartial.lf_zero_iff PGame.Impartial.lf_zero_iff
+-/
 
+#print PGame.Impartial.equiv_zero_iff_le /-
 theorem equiv_zero_iff_le : (G ≈ 0) ↔ G ≤ 0 :=
   ⟨And.left, fun h => ⟨h, le_zero_iff.1 h⟩⟩
 #align pgame.impartial.equiv_zero_iff_le PGame.Impartial.equiv_zero_iff_le
+-/
 
+#print PGame.Impartial.fuzzy_zero_iff_lf /-
 theorem fuzzy_zero_iff_lf : G ‖ 0 ↔ G ⧏ 0 :=
   ⟨And.left, fun h => ⟨h, lf_zero_iff.1 h⟩⟩
 #align pgame.impartial.fuzzy_zero_iff_lf PGame.Impartial.fuzzy_zero_iff_lf
+-/
 
+#print PGame.Impartial.equiv_zero_iff_ge /-
 theorem equiv_zero_iff_ge : (G ≈ 0) ↔ 0 ≤ G :=
   ⟨And.right, fun h => ⟨le_zero_iff.2 h, h⟩⟩
 #align pgame.impartial.equiv_zero_iff_ge PGame.Impartial.equiv_zero_iff_ge
+-/
 
+#print PGame.Impartial.fuzzy_zero_iff_gf /-
 theorem fuzzy_zero_iff_gf : G ‖ 0 ↔ 0 ⧏ G :=
   ⟨And.right, fun h => ⟨lf_zero_iff.2 h, h⟩⟩
 #align pgame.impartial.fuzzy_zero_iff_gf PGame.Impartial.fuzzy_zero_iff_gf
+-/
 
+#print PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero /-
 theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0) :=
   by
   refine' ⟨fun hb => _, fun hp i => _⟩
@@ -210,7 +269,9 @@ theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔
   · rw [fuzzy_zero_iff_lf]
     exact hp.1.moveLeft_lf i
 #align pgame.impartial.forall_left_moves_fuzzy_iff_equiv_zero PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero
+-/
 
+#print PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero /-
 theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0) :=
   by
   refine' ⟨fun hb => _, fun hp i => _⟩
@@ -219,7 +280,9 @@ theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) 
   · rw [fuzzy_zero_iff_gf]
     exact hp.2.lf_moveRight i
 #align pgame.impartial.forall_right_moves_fuzzy_iff_equiv_zero PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero
+-/
 
+#print PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero /-
 theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 :=
   by
   refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_gf G).2 (lf_of_le_move_left hi.2), fun hn => _⟩
@@ -227,7 +290,9 @@ theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_ge _).2 hi⟩
 #align pgame.impartial.exists_left_move_equiv_iff_fuzzy_zero PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero
+-/
 
+#print PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero /-
 theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 :=
   by
   refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_lf G).2 (lf_of_move_right_le hi.1), fun hn => _⟩
@@ -235,6 +300,7 @@ theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) 
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_le _).2 hi⟩
 #align pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero
+-/
 
 end Impartial
 
Diff
@@ -29,9 +29,8 @@ namespace PGame
 
 /-- The definition for a impartial game, defined using Conway induction. -/
 def ImpartialAux : PGame → Prop
-  | G =>
-    (G ≈ -G) ∧ (∀ i, impartial_aux (G.moveLeft i)) ∧ ∀ j, impartial_aux (G.moveRight j)decreasing_by
-  pgame_wf_tac
+  | G => (G ≈ -G) ∧ (∀ i, impartial_aux (G.moveLeft i)) ∧ ∀ j, impartial_aux (G.moveRight j)
+decreasing_by pgame_wf_tac
 #align pgame.impartial_aux PGame.ImpartialAux
 
 theorem impartialAux_def {G : PGame} :
@@ -88,9 +87,8 @@ theorem impartial_congr : ∀ {G H : PGame} (e : G ≡r H) [G.Impartial], H.Impa
     exact
       impartial_def.2
         ⟨e.symm.equiv.trans ((neg_equiv_self G).trans (neg_equiv_neg_iff.2 e.equiv)), fun i =>
-          impartial_congr (e.move_left_symm i), fun j =>
-          impartial_congr (e.move_right_symm j)⟩decreasing_by
-  pgame_wf_tac
+          impartial_congr (e.move_left_symm i), fun j => impartial_congr (e.move_right_symm j)⟩
+decreasing_by pgame_wf_tac
 #align pgame.impartial.impartial_congr PGame.Impartial.impartial_congr
 
 instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).Impartial
@@ -107,8 +105,8 @@ instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).
     · apply right_moves_add_cases k
       all_goals
         intro i; simp only [add_move_right_inl, add_move_right_inr]
-        apply impartial_add decreasing_by
-  pgame_wf_tac
+        apply impartial_add
+decreasing_by pgame_wf_tac
 #align pgame.impartial.impartial_add PGame.Impartial.impartial_add
 
 instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
@@ -121,7 +119,8 @@ instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
     · rw [move_left_neg']
       apply impartial_neg
     · rw [move_right_neg']
-      apply impartial_neg decreasing_by pgame_wf_tac
+      apply impartial_neg
+decreasing_by pgame_wf_tac
 #align pgame.impartial.impartial_neg PGame.Impartial.impartial_neg
 
 variable (G : PGame) [Impartial G]
@@ -129,14 +128,14 @@ variable (G : PGame) [Impartial G]
 theorem nonpos : ¬0 < G := fun h =>
   by
   have h' := neg_lt_neg_iff.2 h
-  rw [neg_zero, lt_congr_left (neg_equiv_self G).symm] at h'
+  rw [neg_zero, lt_congr_left (neg_equiv_self G).symm] at h' 
   exact (h.trans h').False
 #align pgame.impartial.nonpos PGame.Impartial.nonpos
 
 theorem nonneg : ¬G < 0 := fun h =>
   by
   have h' := neg_lt_neg_iff.2 h
-  rw [neg_zero, lt_congr_right (neg_equiv_self G).symm] at h'
+  rw [neg_zero, lt_congr_right (neg_equiv_self G).symm] at h' 
   exact (h.trans h').False
 #align pgame.impartial.nonneg PGame.Impartial.nonneg
 
@@ -224,7 +223,7 @@ theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) 
 theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 :=
   by
   refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_gf G).2 (lf_of_le_move_left hi.2), fun hn => _⟩
-  rw [fuzzy_zero_iff_gf G, zero_lf_le] at hn
+  rw [fuzzy_zero_iff_gf G, zero_lf_le] at hn 
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_ge _).2 hi⟩
 #align pgame.impartial.exists_left_move_equiv_iff_fuzzy_zero PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero
@@ -232,7 +231,7 @@ theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔
 theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 :=
   by
   refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_lf G).2 (lf_of_move_right_le hi.1), fun hn => _⟩
-  rw [fuzzy_zero_iff_lf G, lf_zero_le] at hn
+  rw [fuzzy_zero_iff_lf G, lf_zero_le] at hn 
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_le _).2 hi⟩
 #align pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero
Diff
@@ -23,7 +23,7 @@ impartial.
 
 universe u
 
-open PGame
+open scoped PGame
 
 namespace PGame
 
Diff
@@ -56,16 +56,10 @@ theorem impartial_def {G : PGame} :
 
 namespace Impartial
 
-instance impartial_zero : Impartial 0 :=
-  by
-  rw [impartial_def]
-  dsimp
-  simp
+instance impartial_zero : Impartial 0 := by rw [impartial_def]; dsimp; simp
 #align pgame.impartial.impartial_zero PGame.Impartial.impartial_zero
 
-instance impartial_star : Impartial star :=
-  by
-  rw [impartial_def]
+instance impartial_star : Impartial star := by rw [impartial_def];
   simpa using impartial.impartial_zero
 #align pgame.impartial.impartial_star PGame.Impartial.impartial_star
 
@@ -176,17 +170,13 @@ theorem mk'_add_self : ⟦G⟧ + ⟦G⟧ = 0 :=
 #align pgame.impartial.mk_add_self PGame.Impartial.mk'_add_self
 
 /-- This lemma doesn't require `H` to be impartial. -/
-theorem equiv_iff_add_equiv_zero (H : PGame) : (H ≈ G) ↔ (H + G ≈ 0) :=
-  by
-  rw [equiv_iff_game_eq, equiv_iff_game_eq, ← @add_right_cancel_iff _ _ _ (-⟦G⟧)]
-  simpa
+theorem equiv_iff_add_equiv_zero (H : PGame) : (H ≈ G) ↔ (H + G ≈ 0) := by
+  rw [equiv_iff_game_eq, equiv_iff_game_eq, ← @add_right_cancel_iff _ _ _ (-⟦G⟧)]; simpa
 #align pgame.impartial.equiv_iff_add_equiv_zero PGame.Impartial.equiv_iff_add_equiv_zero
 
 /-- This lemma doesn't require `H` to be impartial. -/
-theorem equiv_iff_add_equiv_zero' (H : PGame) : (G ≈ H) ↔ (G + H ≈ 0) :=
-  by
-  rw [equiv_iff_game_eq, equiv_iff_game_eq, ← @add_left_cancel_iff _ _ _ (-⟦G⟧), eq_comm]
-  simpa
+theorem equiv_iff_add_equiv_zero' (H : PGame) : (G ≈ H) ↔ (G + H ≈ 0) := by
+  rw [equiv_iff_game_eq, equiv_iff_game_eq, ← @add_left_cancel_iff _ _ _ (-⟦G⟧), eq_comm]; simpa
 #align pgame.impartial.equiv_iff_add_equiv_zero' PGame.Impartial.equiv_iff_add_equiv_zero'
 
 theorem le_zero_iff {G : PGame} [G.Impartial] : G ≤ 0 ↔ 0 ≤ G := by
Diff
@@ -23,36 +23,36 @@ impartial.
 
 universe u
 
-open Pgame
+open PGame
 
-namespace Pgame
+namespace PGame
 
 /-- The definition for a impartial game, defined using Conway induction. -/
-def ImpartialAux : Pgame → Prop
+def ImpartialAux : PGame → Prop
   | G =>
     (G ≈ -G) ∧ (∀ i, impartial_aux (G.moveLeft i)) ∧ ∀ j, impartial_aux (G.moveRight j)decreasing_by
   pgame_wf_tac
-#align pgame.impartial_aux Pgame.ImpartialAux
+#align pgame.impartial_aux PGame.ImpartialAux
 
-theorem impartialAux_def {G : Pgame} :
+theorem impartialAux_def {G : PGame} :
     G.ImpartialAux ↔
       (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j) :=
   by rw [impartial_aux]
-#align pgame.impartial_aux_def Pgame.impartialAux_def
+#align pgame.impartial_aux_def PGame.impartialAux_def
 
 /-- A typeclass on impartial games. -/
-class Impartial (G : Pgame) : Prop where
+class Impartial (G : PGame) : Prop where
   out : ImpartialAux G
-#align pgame.impartial Pgame.Impartial
+#align pgame.impartial PGame.Impartial
 
-theorem impartial_iff_aux {G : Pgame} : G.Impartial ↔ G.ImpartialAux :=
+theorem impartial_iff_aux {G : PGame} : G.Impartial ↔ G.ImpartialAux :=
   ⟨fun h => h.1, fun h => ⟨h⟩⟩
-#align pgame.impartial_iff_aux Pgame.impartial_iff_aux
+#align pgame.impartial_iff_aux PGame.impartial_iff_aux
 
-theorem impartial_def {G : Pgame} :
+theorem impartial_def {G : PGame} :
     G.Impartial ↔ (G ≈ -G) ∧ (∀ i, Impartial (G.moveLeft i)) ∧ ∀ j, Impartial (G.moveRight j) := by
   simpa only [impartial_iff_aux] using impartial_aux_def
-#align pgame.impartial_def Pgame.impartial_def
+#align pgame.impartial_def PGame.impartial_def
 
 namespace Impartial
 
@@ -61,34 +61,34 @@ instance impartial_zero : Impartial 0 :=
   rw [impartial_def]
   dsimp
   simp
-#align pgame.impartial.impartial_zero Pgame.Impartial.impartial_zero
+#align pgame.impartial.impartial_zero PGame.Impartial.impartial_zero
 
 instance impartial_star : Impartial star :=
   by
   rw [impartial_def]
   simpa using impartial.impartial_zero
-#align pgame.impartial.impartial_star Pgame.Impartial.impartial_star
+#align pgame.impartial.impartial_star PGame.Impartial.impartial_star
 
-theorem neg_equiv_self (G : Pgame) [h : G.Impartial] : G ≈ -G :=
+theorem neg_equiv_self (G : PGame) [h : G.Impartial] : G ≈ -G :=
   (impartial_def.1 h).1
-#align pgame.impartial.neg_equiv_self Pgame.Impartial.neg_equiv_self
+#align pgame.impartial.neg_equiv_self PGame.Impartial.neg_equiv_self
 
 @[simp]
-theorem mk'_neg_equiv_self (G : Pgame) [h : G.Impartial] : -⟦G⟧ = ⟦G⟧ :=
+theorem mk'_neg_equiv_self (G : PGame) [h : G.Impartial] : -⟦G⟧ = ⟦G⟧ :=
   Quot.sound (neg_equiv_self G).symm
-#align pgame.impartial.mk_neg_equiv_self Pgame.Impartial.mk'_neg_equiv_self
+#align pgame.impartial.mk_neg_equiv_self PGame.Impartial.mk'_neg_equiv_self
 
-instance moveLeft_impartial {G : Pgame} [h : G.Impartial] (i : G.LeftMoves) :
+instance moveLeft_impartial {G : PGame} [h : G.Impartial] (i : G.LeftMoves) :
     (G.moveLeft i).Impartial :=
   (impartial_def.1 h).2.1 i
-#align pgame.impartial.move_left_impartial Pgame.Impartial.moveLeft_impartial
+#align pgame.impartial.move_left_impartial PGame.Impartial.moveLeft_impartial
 
-instance moveRight_impartial {G : Pgame} [h : G.Impartial] (j : G.RightMoves) :
+instance moveRight_impartial {G : PGame} [h : G.Impartial] (j : G.RightMoves) :
     (G.moveRight j).Impartial :=
   (impartial_def.1 h).2.2 j
-#align pgame.impartial.move_right_impartial Pgame.Impartial.moveRight_impartial
+#align pgame.impartial.move_right_impartial PGame.Impartial.moveRight_impartial
 
-theorem impartial_congr : ∀ {G H : Pgame} (e : G ≡r H) [G.Impartial], H.Impartial
+theorem impartial_congr : ∀ {G H : PGame} (e : G ≡r H) [G.Impartial], H.Impartial
   | G, H => fun e => by
     intro h
     exact
@@ -97,9 +97,9 @@ theorem impartial_congr : ∀ {G H : Pgame} (e : G ≡r H) [G.Impartial], H.Impa
           impartial_congr (e.move_left_symm i), fun j =>
           impartial_congr (e.move_right_symm j)⟩decreasing_by
   pgame_wf_tac
-#align pgame.impartial.impartial_congr Pgame.Impartial.impartial_congr
+#align pgame.impartial.impartial_congr PGame.Impartial.impartial_congr
 
-instance impartial_add : ∀ (G H : Pgame) [G.Impartial] [H.Impartial], (G + H).Impartial
+instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).Impartial
   | G, H => by
     intro hG hH
     rw [impartial_def]
@@ -115,9 +115,9 @@ instance impartial_add : ∀ (G H : Pgame) [G.Impartial] [H.Impartial], (G + H).
         intro i; simp only [add_move_right_inl, add_move_right_inr]
         apply impartial_add decreasing_by
   pgame_wf_tac
-#align pgame.impartial.impartial_add Pgame.Impartial.impartial_add
+#align pgame.impartial.impartial_add PGame.Impartial.impartial_add
 
-instance impartial_neg : ∀ (G : Pgame) [G.Impartial], (-G).Impartial
+instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
   | G => by
     intro hG
     rw [impartial_def]
@@ -128,23 +128,23 @@ instance impartial_neg : ∀ (G : Pgame) [G.Impartial], (-G).Impartial
       apply impartial_neg
     · rw [move_right_neg']
       apply impartial_neg decreasing_by pgame_wf_tac
-#align pgame.impartial.impartial_neg Pgame.Impartial.impartial_neg
+#align pgame.impartial.impartial_neg PGame.Impartial.impartial_neg
 
-variable (G : Pgame) [Impartial G]
+variable (G : PGame) [Impartial G]
 
 theorem nonpos : ¬0 < G := fun h =>
   by
   have h' := neg_lt_neg_iff.2 h
   rw [neg_zero, lt_congr_left (neg_equiv_self G).symm] at h'
   exact (h.trans h').False
-#align pgame.impartial.nonpos Pgame.Impartial.nonpos
+#align pgame.impartial.nonpos PGame.Impartial.nonpos
 
 theorem nonneg : ¬G < 0 := fun h =>
   by
   have h' := neg_lt_neg_iff.2 h
   rw [neg_zero, lt_congr_right (neg_equiv_self G).symm] at h'
   exact (h.trans h').False
-#align pgame.impartial.nonneg Pgame.Impartial.nonneg
+#align pgame.impartial.nonneg PGame.Impartial.nonneg
 
 /-- In an impartial game, either the first player always wins, or the second player always wins. -/
 theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 :=
@@ -154,64 +154,64 @@ theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 :=
   · exact Or.inl h
   · exact ((nonpos G) h).elim
   · exact Or.inr h
-#align pgame.impartial.equiv_or_fuzzy_zero Pgame.Impartial.equiv_or_fuzzy_zero
+#align pgame.impartial.equiv_or_fuzzy_zero PGame.Impartial.equiv_or_fuzzy_zero
 
 @[simp]
 theorem not_equiv_zero_iff : ¬(G ≈ 0) ↔ G ‖ 0 :=
   ⟨(equiv_or_fuzzy_zero G).resolve_left, Fuzzy.not_equiv⟩
-#align pgame.impartial.not_equiv_zero_iff Pgame.Impartial.not_equiv_zero_iff
+#align pgame.impartial.not_equiv_zero_iff PGame.Impartial.not_equiv_zero_iff
 
 @[simp]
 theorem not_fuzzy_zero_iff : ¬G ‖ 0 ↔ (G ≈ 0) :=
   ⟨(equiv_or_fuzzy_zero G).resolve_right, Equiv.not_fuzzy⟩
-#align pgame.impartial.not_fuzzy_zero_iff Pgame.Impartial.not_fuzzy_zero_iff
+#align pgame.impartial.not_fuzzy_zero_iff PGame.Impartial.not_fuzzy_zero_iff
 
 theorem add_self : G + G ≈ 0 :=
   (add_congr_left (neg_equiv_self G)).trans (add_left_neg_equiv G)
-#align pgame.impartial.add_self Pgame.Impartial.add_self
+#align pgame.impartial.add_self PGame.Impartial.add_self
 
 @[simp]
 theorem mk'_add_self : ⟦G⟧ + ⟦G⟧ = 0 :=
   Quot.sound (add_self G)
-#align pgame.impartial.mk_add_self Pgame.Impartial.mk'_add_self
+#align pgame.impartial.mk_add_self PGame.Impartial.mk'_add_self
 
 /-- This lemma doesn't require `H` to be impartial. -/
-theorem equiv_iff_add_equiv_zero (H : Pgame) : (H ≈ G) ↔ (H + G ≈ 0) :=
+theorem equiv_iff_add_equiv_zero (H : PGame) : (H ≈ G) ↔ (H + G ≈ 0) :=
   by
   rw [equiv_iff_game_eq, equiv_iff_game_eq, ← @add_right_cancel_iff _ _ _ (-⟦G⟧)]
   simpa
-#align pgame.impartial.equiv_iff_add_equiv_zero Pgame.Impartial.equiv_iff_add_equiv_zero
+#align pgame.impartial.equiv_iff_add_equiv_zero PGame.Impartial.equiv_iff_add_equiv_zero
 
 /-- This lemma doesn't require `H` to be impartial. -/
-theorem equiv_iff_add_equiv_zero' (H : Pgame) : (G ≈ H) ↔ (G + H ≈ 0) :=
+theorem equiv_iff_add_equiv_zero' (H : PGame) : (G ≈ H) ↔ (G + H ≈ 0) :=
   by
   rw [equiv_iff_game_eq, equiv_iff_game_eq, ← @add_left_cancel_iff _ _ _ (-⟦G⟧), eq_comm]
   simpa
-#align pgame.impartial.equiv_iff_add_equiv_zero' Pgame.Impartial.equiv_iff_add_equiv_zero'
+#align pgame.impartial.equiv_iff_add_equiv_zero' PGame.Impartial.equiv_iff_add_equiv_zero'
 
-theorem le_zero_iff {G : Pgame} [G.Impartial] : G ≤ 0 ↔ 0 ≤ G := by
+theorem le_zero_iff {G : PGame} [G.Impartial] : G ≤ 0 ↔ 0 ≤ G := by
   rw [← zero_le_neg_iff, le_congr_right (neg_equiv_self G)]
-#align pgame.impartial.le_zero_iff Pgame.Impartial.le_zero_iff
+#align pgame.impartial.le_zero_iff PGame.Impartial.le_zero_iff
 
-theorem lf_zero_iff {G : Pgame} [G.Impartial] : G ⧏ 0 ↔ 0 ⧏ G := by
+theorem lf_zero_iff {G : PGame} [G.Impartial] : G ⧏ 0 ↔ 0 ⧏ G := by
   rw [← zero_lf_neg_iff, lf_congr_right (neg_equiv_self G)]
-#align pgame.impartial.lf_zero_iff Pgame.Impartial.lf_zero_iff
+#align pgame.impartial.lf_zero_iff PGame.Impartial.lf_zero_iff
 
 theorem equiv_zero_iff_le : (G ≈ 0) ↔ G ≤ 0 :=
   ⟨And.left, fun h => ⟨h, le_zero_iff.1 h⟩⟩
-#align pgame.impartial.equiv_zero_iff_le Pgame.Impartial.equiv_zero_iff_le
+#align pgame.impartial.equiv_zero_iff_le PGame.Impartial.equiv_zero_iff_le
 
 theorem fuzzy_zero_iff_lf : G ‖ 0 ↔ G ⧏ 0 :=
   ⟨And.left, fun h => ⟨h, lf_zero_iff.1 h⟩⟩
-#align pgame.impartial.fuzzy_zero_iff_lf Pgame.Impartial.fuzzy_zero_iff_lf
+#align pgame.impartial.fuzzy_zero_iff_lf PGame.Impartial.fuzzy_zero_iff_lf
 
 theorem equiv_zero_iff_ge : (G ≈ 0) ↔ 0 ≤ G :=
   ⟨And.right, fun h => ⟨le_zero_iff.2 h, h⟩⟩
-#align pgame.impartial.equiv_zero_iff_ge Pgame.Impartial.equiv_zero_iff_ge
+#align pgame.impartial.equiv_zero_iff_ge PGame.Impartial.equiv_zero_iff_ge
 
 theorem fuzzy_zero_iff_gf : G ‖ 0 ↔ 0 ⧏ G :=
   ⟨And.right, fun h => ⟨lf_zero_iff.2 h, h⟩⟩
-#align pgame.impartial.fuzzy_zero_iff_gf Pgame.Impartial.fuzzy_zero_iff_gf
+#align pgame.impartial.fuzzy_zero_iff_gf PGame.Impartial.fuzzy_zero_iff_gf
 
 theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0) :=
   by
@@ -220,7 +220,7 @@ theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔
     exact fun i => (hb i).1
   · rw [fuzzy_zero_iff_lf]
     exact hp.1.moveLeft_lf i
-#align pgame.impartial.forall_left_moves_fuzzy_iff_equiv_zero Pgame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero
+#align pgame.impartial.forall_left_moves_fuzzy_iff_equiv_zero PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero
 
 theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0) :=
   by
@@ -229,7 +229,7 @@ theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) 
     exact fun i => (hb i).2
   · rw [fuzzy_zero_iff_gf]
     exact hp.2.lf_moveRight i
-#align pgame.impartial.forall_right_moves_fuzzy_iff_equiv_zero Pgame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero
+#align pgame.impartial.forall_right_moves_fuzzy_iff_equiv_zero PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero
 
 theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 :=
   by
@@ -237,7 +237,7 @@ theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔
   rw [fuzzy_zero_iff_gf G, zero_lf_le] at hn
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_ge _).2 hi⟩
-#align pgame.impartial.exists_left_move_equiv_iff_fuzzy_zero Pgame.Impartial.exists_left_move_equiv_iff_fuzzy_zero
+#align pgame.impartial.exists_left_move_equiv_iff_fuzzy_zero PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero
 
 theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 :=
   by
@@ -245,9 +245,9 @@ theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) 
   rw [fuzzy_zero_iff_lf G, lf_zero_le] at hn
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_le _).2 hi⟩
-#align pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero Pgame.Impartial.exists_right_move_equiv_iff_fuzzy_zero
+#align pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero
 
 end Impartial
 
-end Pgame
+end PGame
 

Changes in mathlib4

mathlib3
mathlib4
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
@@ -30,7 +30,6 @@ namespace PGame
 def ImpartialAux : PGame → Prop
   | G => (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j)
 termination_by G => G -- Porting note: Added `termination_by`
-decreasing_by all_goals pgame_wf_tac
 #align pgame.impartial_aux SetTheory.PGame.ImpartialAux
 
 theorem impartialAux_def {G : PGame} :
@@ -89,7 +88,6 @@ theorem impartial_congr : ∀ {G H : PGame} (_ : G ≡r H) [G.Impartial], H.Impa
       ⟨Equiv.trans e.symm.equiv (Equiv.trans (neg_equiv_self G) (neg_equiv_neg_iff.2 e.equiv)),
         fun i => impartial_congr (e.moveLeftSymm i), fun j => impartial_congr (e.moveRightSymm j)⟩
 termination_by G H => (G, H)
-decreasing_by all_goals pgame_wf_tac
 #align pgame.impartial.impartial_congr SetTheory.PGame.Impartial.impartial_congr
 
 instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).Impartial
@@ -106,7 +104,6 @@ instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).
         intro i; simp only [add_moveRight_inl, add_moveRight_inr]
         apply impartial_add
 termination_by G H => (G, H)
-decreasing_by all_goals pgame_wf_tac
 #align pgame.impartial.impartial_add SetTheory.PGame.Impartial.impartial_add
 
 instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
@@ -120,7 +117,6 @@ instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
     · rw [moveRight_neg']
       apply impartial_neg
 termination_by G => G
-decreasing_by all_goals pgame_wf_tac
 #align pgame.impartial.impartial_neg SetTheory.PGame.Impartial.impartial_neg
 
 variable (G : PGame) [Impartial G]
doc: fix typo (#10409)

Fix minor typo.

Diff
@@ -13,7 +13,7 @@ import Mathlib.Tactic.NthRewrite
 
 We will define an impartial game, one in which left and right can make exactly the same moves.
 Our definition differs slightly by saying that the game is always equivalent to its negative,
-no matter what moves are played. This allows for games such as poker-nim to be classifed as
+no matter what moves are played. This allows for games such as poker-nim to be classified as
 impartial.
 -/
 
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
@@ -29,8 +29,8 @@ namespace PGame
 /-- The definition for an impartial game, defined using Conway induction. -/
 def ImpartialAux : PGame → Prop
   | G => (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j)
-termination_by _ G => G -- Porting note: Added `termination_by`
-decreasing_by pgame_wf_tac
+termination_by G => G -- Porting note: Added `termination_by`
+decreasing_by all_goals pgame_wf_tac
 #align pgame.impartial_aux SetTheory.PGame.ImpartialAux
 
 theorem impartialAux_def {G : PGame} :
@@ -88,8 +88,8 @@ theorem impartial_congr : ∀ {G H : PGame} (_ : G ≡r H) [G.Impartial], H.Impa
     exact impartial_def.2
       ⟨Equiv.trans e.symm.equiv (Equiv.trans (neg_equiv_self G) (neg_equiv_neg_iff.2 e.equiv)),
         fun i => impartial_congr (e.moveLeftSymm i), fun j => impartial_congr (e.moveRightSymm j)⟩
-termination_by _ G H => (G, H)
-decreasing_by pgame_wf_tac
+termination_by G H => (G, H)
+decreasing_by all_goals pgame_wf_tac
 #align pgame.impartial.impartial_congr SetTheory.PGame.Impartial.impartial_congr
 
 instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).Impartial
@@ -105,8 +105,8 @@ instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).
       all_goals
         intro i; simp only [add_moveRight_inl, add_moveRight_inr]
         apply impartial_add
-termination_by _ G H _ _ => (G, H)
-decreasing_by pgame_wf_tac
+termination_by G H => (G, H)
+decreasing_by all_goals pgame_wf_tac
 #align pgame.impartial.impartial_add SetTheory.PGame.Impartial.impartial_add
 
 instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
@@ -119,8 +119,8 @@ instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
       apply impartial_neg
     · rw [moveRight_neg']
       apply impartial_neg
-termination_by _ G _ => G
-decreasing_by pgame_wf_tac
+termination_by G => G
+decreasing_by all_goals pgame_wf_tac
 #align pgame.impartial.impartial_neg SetTheory.PGame.Impartial.impartial_neg
 
 variable (G : PGame) [Impartial G]
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
@@ -20,6 +20,8 @@ impartial.
 
 universe u
 
+namespace SetTheory
+
 open scoped PGame
 
 namespace PGame
@@ -29,56 +31,56 @@ def ImpartialAux : PGame → Prop
   | G => (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j)
 termination_by _ G => G -- Porting note: Added `termination_by`
 decreasing_by pgame_wf_tac
-#align pgame.impartial_aux PGame.ImpartialAux
+#align pgame.impartial_aux SetTheory.PGame.ImpartialAux
 
 theorem impartialAux_def {G : PGame} :
     G.ImpartialAux ↔
       (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j) := by
   rw [ImpartialAux]
-#align pgame.impartial_aux_def PGame.impartialAux_def
+#align pgame.impartial_aux_def SetTheory.PGame.impartialAux_def
 
 /-- A typeclass on impartial games. -/
 class Impartial (G : PGame) : Prop where
   out : ImpartialAux G
-#align pgame.impartial PGame.Impartial
+#align pgame.impartial SetTheory.PGame.Impartial
 
 theorem impartial_iff_aux {G : PGame} : G.Impartial ↔ G.ImpartialAux :=
   ⟨fun h => h.1, fun h => ⟨h⟩⟩
-#align pgame.impartial_iff_aux PGame.impartial_iff_aux
+#align pgame.impartial_iff_aux SetTheory.PGame.impartial_iff_aux
 
 theorem impartial_def {G : PGame} :
     G.Impartial ↔ (G ≈ -G) ∧ (∀ i, Impartial (G.moveLeft i)) ∧ ∀ j, Impartial (G.moveRight j) := by
   simpa only [impartial_iff_aux] using impartialAux_def
-#align pgame.impartial_def PGame.impartial_def
+#align pgame.impartial_def SetTheory.PGame.impartial_def
 
 namespace Impartial
 
 instance impartial_zero : Impartial 0 := by rw [impartial_def]; dsimp; simp
-#align pgame.impartial.impartial_zero PGame.Impartial.impartial_zero
+#align pgame.impartial.impartial_zero SetTheory.PGame.Impartial.impartial_zero
 
 instance impartial_star : Impartial star := by
   rw [impartial_def]; simpa using Impartial.impartial_zero
-#align pgame.impartial.impartial_star PGame.Impartial.impartial_star
+#align pgame.impartial.impartial_star SetTheory.PGame.Impartial.impartial_star
 
 theorem neg_equiv_self (G : PGame) [h : G.Impartial] : G ≈ -G :=
   (impartial_def.1 h).1
-#align pgame.impartial.neg_equiv_self PGame.Impartial.neg_equiv_self
+#align pgame.impartial.neg_equiv_self SetTheory.PGame.Impartial.neg_equiv_self
 
 -- Porting note: Changed `-⟦G⟧` to `-(⟦G⟧ : Quotient setoid)`
 @[simp]
 theorem mk'_neg_equiv_self (G : PGame) [G.Impartial] : -(⟦G⟧ : Quotient setoid) = ⟦G⟧ :=
   Quot.sound (Equiv.symm (neg_equiv_self G))
-#align pgame.impartial.mk_neg_equiv_self PGame.Impartial.mk'_neg_equiv_self
+#align pgame.impartial.mk_neg_equiv_self SetTheory.PGame.Impartial.mk'_neg_equiv_self
 
 instance moveLeft_impartial {G : PGame} [h : G.Impartial] (i : G.LeftMoves) :
     (G.moveLeft i).Impartial :=
   (impartial_def.1 h).2.1 i
-#align pgame.impartial.move_left_impartial PGame.Impartial.moveLeft_impartial
+#align pgame.impartial.move_left_impartial SetTheory.PGame.Impartial.moveLeft_impartial
 
 instance moveRight_impartial {G : PGame} [h : G.Impartial] (j : G.RightMoves) :
     (G.moveRight j).Impartial :=
   (impartial_def.1 h).2.2 j
-#align pgame.impartial.move_right_impartial PGame.Impartial.moveRight_impartial
+#align pgame.impartial.move_right_impartial SetTheory.PGame.Impartial.moveRight_impartial
 
 theorem impartial_congr : ∀ {G H : PGame} (_ : G ≡r H) [G.Impartial], H.Impartial
   | G, H => fun e => by
@@ -88,7 +90,7 @@ theorem impartial_congr : ∀ {G H : PGame} (_ : G ≡r H) [G.Impartial], H.Impa
         fun i => impartial_congr (e.moveLeftSymm i), fun j => impartial_congr (e.moveRightSymm j)⟩
 termination_by _ G H => (G, H)
 decreasing_by pgame_wf_tac
-#align pgame.impartial.impartial_congr PGame.Impartial.impartial_congr
+#align pgame.impartial.impartial_congr SetTheory.PGame.Impartial.impartial_congr
 
 instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).Impartial
   | G, H, _, _ => by
@@ -105,7 +107,7 @@ instance impartial_add : ∀ (G H : PGame) [G.Impartial] [H.Impartial], (G + H).
         apply impartial_add
 termination_by _ G H _ _ => (G, H)
 decreasing_by pgame_wf_tac
-#align pgame.impartial.impartial_add PGame.Impartial.impartial_add
+#align pgame.impartial.impartial_add SetTheory.PGame.Impartial.impartial_add
 
 instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
   | G, _ => by
@@ -119,7 +121,7 @@ instance impartial_neg : ∀ (G : PGame) [G.Impartial], (-G).Impartial
       apply impartial_neg
 termination_by _ G _ => G
 decreasing_by pgame_wf_tac
-#align pgame.impartial.impartial_neg PGame.Impartial.impartial_neg
+#align pgame.impartial.impartial_neg SetTheory.PGame.Impartial.impartial_neg
 
 variable (G : PGame) [Impartial G]
 
@@ -127,13 +129,13 @@ theorem nonpos : ¬0 < G := fun h => by
   have h' := neg_lt_neg_iff.2 h
   rw [neg_zero, lt_congr_left (Equiv.symm (neg_equiv_self G))] at h'
   exact (h.trans h').false
-#align pgame.impartial.nonpos PGame.Impartial.nonpos
+#align pgame.impartial.nonpos SetTheory.PGame.Impartial.nonpos
 
 theorem nonneg : ¬G < 0 := fun h => by
   have h' := neg_lt_neg_iff.2 h
   rw [neg_zero, lt_congr_right (Equiv.symm (neg_equiv_self G))] at h'
   exact (h.trans h').false
-#align pgame.impartial.nonneg PGame.Impartial.nonneg
+#align pgame.impartial.nonneg SetTheory.PGame.Impartial.nonneg
 
 /-- In an impartial game, either the first player always wins, or the second player always wins. -/
 theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 := by
@@ -142,65 +144,65 @@ theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 := by
   · exact Or.inl h
   · exact ((nonpos G) h).elim
   · exact Or.inr h
-#align pgame.impartial.equiv_or_fuzzy_zero PGame.Impartial.equiv_or_fuzzy_zero
+#align pgame.impartial.equiv_or_fuzzy_zero SetTheory.PGame.Impartial.equiv_or_fuzzy_zero
 
 @[simp]
 theorem not_equiv_zero_iff : ¬(G ≈ 0) ↔ G ‖ 0 :=
   ⟨(equiv_or_fuzzy_zero G).resolve_left, Fuzzy.not_equiv⟩
-#align pgame.impartial.not_equiv_zero_iff PGame.Impartial.not_equiv_zero_iff
+#align pgame.impartial.not_equiv_zero_iff SetTheory.PGame.Impartial.not_equiv_zero_iff
 
 @[simp]
 theorem not_fuzzy_zero_iff : ¬G ‖ 0 ↔ (G ≈ 0) :=
   ⟨(equiv_or_fuzzy_zero G).resolve_right, Equiv.not_fuzzy⟩
-#align pgame.impartial.not_fuzzy_zero_iff PGame.Impartial.not_fuzzy_zero_iff
+#align pgame.impartial.not_fuzzy_zero_iff SetTheory.PGame.Impartial.not_fuzzy_zero_iff
 
 theorem add_self : G + G ≈ 0 :=
   Equiv.trans (add_congr_left (neg_equiv_self G)) (add_left_neg_equiv G)
-#align pgame.impartial.add_self PGame.Impartial.add_self
+#align pgame.impartial.add_self SetTheory.PGame.Impartial.add_self
 
 -- Porting note: Changed `⟦G⟧` to `(⟦G⟧ : Quotient setoid)`
 @[simp]
 theorem mk'_add_self : (⟦G⟧ : Quotient setoid) + ⟦G⟧ = 0 :=
   Quot.sound (add_self G)
-#align pgame.impartial.mk_add_self PGame.Impartial.mk'_add_self
+#align pgame.impartial.mk_add_self SetTheory.PGame.Impartial.mk'_add_self
 
 /-- This lemma doesn't require `H` to be impartial. -/
 theorem equiv_iff_add_equiv_zero (H : PGame) : (H ≈ G) ↔ (H + G ≈ 0) := by
   rw [Game.PGame.equiv_iff_game_eq, ← @add_right_cancel_iff _ _ _ ⟦G⟧, mk'_add_self, ← quot_add,
     Game.PGame.equiv_iff_game_eq]
   rfl
-#align pgame.impartial.equiv_iff_add_equiv_zero PGame.Impartial.equiv_iff_add_equiv_zero
+#align pgame.impartial.equiv_iff_add_equiv_zero SetTheory.PGame.Impartial.equiv_iff_add_equiv_zero
 
 /-- This lemma doesn't require `H` to be impartial. -/
 theorem equiv_iff_add_equiv_zero' (H : PGame) : (G ≈ H) ↔ (G + H ≈ 0) := by
   rw [Game.PGame.equiv_iff_game_eq, ← @add_left_cancel_iff _ _ _ ⟦G⟧, mk'_add_self, ← quot_add,
     Game.PGame.equiv_iff_game_eq]
   exact ⟨Eq.symm, Eq.symm⟩
-#align pgame.impartial.equiv_iff_add_equiv_zero' PGame.Impartial.equiv_iff_add_equiv_zero'
+#align pgame.impartial.equiv_iff_add_equiv_zero' SetTheory.PGame.Impartial.equiv_iff_add_equiv_zero'
 
 theorem le_zero_iff {G : PGame} [G.Impartial] : G ≤ 0 ↔ 0 ≤ G := by
   rw [← zero_le_neg_iff, le_congr_right (neg_equiv_self G)]
-#align pgame.impartial.le_zero_iff PGame.Impartial.le_zero_iff
+#align pgame.impartial.le_zero_iff SetTheory.PGame.Impartial.le_zero_iff
 
 theorem lf_zero_iff {G : PGame} [G.Impartial] : G ⧏ 0 ↔ 0 ⧏ G := by
   rw [← zero_lf_neg_iff, lf_congr_right (neg_equiv_self G)]
-#align pgame.impartial.lf_zero_iff PGame.Impartial.lf_zero_iff
+#align pgame.impartial.lf_zero_iff SetTheory.PGame.Impartial.lf_zero_iff
 
 theorem equiv_zero_iff_le : (G ≈ 0) ↔ G ≤ 0 :=
   ⟨And.left, fun h => ⟨h, le_zero_iff.1 h⟩⟩
-#align pgame.impartial.equiv_zero_iff_le PGame.Impartial.equiv_zero_iff_le
+#align pgame.impartial.equiv_zero_iff_le SetTheory.PGame.Impartial.equiv_zero_iff_le
 
 theorem fuzzy_zero_iff_lf : G ‖ 0 ↔ G ⧏ 0 :=
   ⟨And.left, fun h => ⟨h, lf_zero_iff.1 h⟩⟩
-#align pgame.impartial.fuzzy_zero_iff_lf PGame.Impartial.fuzzy_zero_iff_lf
+#align pgame.impartial.fuzzy_zero_iff_lf SetTheory.PGame.Impartial.fuzzy_zero_iff_lf
 
 theorem equiv_zero_iff_ge : (G ≈ 0) ↔ 0 ≤ G :=
   ⟨And.right, fun h => ⟨le_zero_iff.2 h, h⟩⟩
-#align pgame.impartial.equiv_zero_iff_ge PGame.Impartial.equiv_zero_iff_ge
+#align pgame.impartial.equiv_zero_iff_ge SetTheory.PGame.Impartial.equiv_zero_iff_ge
 
 theorem fuzzy_zero_iff_gf : G ‖ 0 ↔ 0 ⧏ G :=
   ⟨And.right, fun h => ⟨lf_zero_iff.2 h, h⟩⟩
-#align pgame.impartial.fuzzy_zero_iff_gf PGame.Impartial.fuzzy_zero_iff_gf
+#align pgame.impartial.fuzzy_zero_iff_gf SetTheory.PGame.Impartial.fuzzy_zero_iff_gf
 
 theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0) := by
   refine' ⟨fun hb => _, fun hp i => _⟩
@@ -208,7 +210,7 @@ theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔
     exact fun i => (hb i).1
   · rw [fuzzy_zero_iff_lf]
     exact hp.1.moveLeft_lf i
-#align pgame.impartial.forall_left_moves_fuzzy_iff_equiv_zero PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero
+#align pgame.impartial.forall_left_moves_fuzzy_iff_equiv_zero SetTheory.PGame.Impartial.forall_leftMoves_fuzzy_iff_equiv_zero
 
 theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0) := by
   refine' ⟨fun hb => _, fun hp i => _⟩
@@ -216,21 +218,21 @@ theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) 
     exact fun i => (hb i).2
   · rw [fuzzy_zero_iff_gf]
     exact hp.2.lf_moveRight i
-#align pgame.impartial.forall_right_moves_fuzzy_iff_equiv_zero PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero
+#align pgame.impartial.forall_right_moves_fuzzy_iff_equiv_zero SetTheory.PGame.Impartial.forall_rightMoves_fuzzy_iff_equiv_zero
 
 theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 := by
   refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_gf G).2 (lf_of_le_moveLeft hi.2), fun hn => _⟩
   rw [fuzzy_zero_iff_gf G, zero_lf_le] at hn
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_ge _).2 hi⟩
-#align pgame.impartial.exists_left_move_equiv_iff_fuzzy_zero PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero
+#align pgame.impartial.exists_left_move_equiv_iff_fuzzy_zero SetTheory.PGame.Impartial.exists_left_move_equiv_iff_fuzzy_zero
 
 theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 := by
   refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_lf G).2 (lf_of_moveRight_le hi.1), fun hn => _⟩
   rw [fuzzy_zero_iff_lf G, lf_zero_le] at hn
   cases' hn with i hi
   exact ⟨i, (equiv_zero_iff_le _).2 hi⟩
-#align pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero
+#align pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero SetTheory.PGame.Impartial.exists_right_move_equiv_iff_fuzzy_zero
 
 end Impartial
 
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) 2020 Fox Thomson. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Fox Thomson
-
-! This file was ported from Lean 3 source module set_theory.game.impartial
-! leanprover-community/mathlib commit 2e0975f6a25dd3fbfb9e41556a77f075f6269748
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.SetTheory.Game.Basic
 import Mathlib.Tactic.NthRewrite
 
+#align_import set_theory.game.impartial from "leanprover-community/mathlib"@"2e0975f6a25dd3fbfb9e41556a77f075f6269748"
+
 /-!
 # Basic definitions about impartial (pre-)games
 
chore: fix grammar in docs (#5668)
Diff
@@ -27,7 +27,7 @@ open scoped PGame
 
 namespace PGame
 
-/-- The definition for a impartial game, defined using Conway induction. -/
+/-- The definition for an impartial game, defined using Conway induction. -/
 def ImpartialAux : PGame → Prop
   | G => (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j)
 termination_by _ G => G -- Porting note: Added `termination_by`
feat: port SetTheory.Game.Impartial (#5517)

Dependencies 6 + 180

181 files ported (96.8%)
83337 lines ported (97.5%)
Show graph

The unported dependencies are