fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
equiv_zero_iff_le : (G ≈ 0) ↔ G ≤ 0 := ⟨And.left, fun h => ⟨h, le_zero_iff.1 h⟩⟩
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Impartial.lean
equiv_zero_iff_le
null
fuzzy_zero_iff_lf : G ‖ 0 ↔ G ⧏ 0 := ⟨And.left, fun h => ⟨h, lf_zero_iff.1 h⟩⟩
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Impartial.lean
fuzzy_zero_iff_lf
null
equiv_zero_iff_ge : (G ≈ 0) ↔ 0 ≤ G := ⟨And.right, fun h => ⟨le_zero_iff.2 h, h⟩⟩
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Impartial.lean
equiv_zero_iff_ge
null
fuzzy_zero_iff_gf : G ‖ 0 ↔ 0 ⧏ G := ⟨And.right, fun h => ⟨lf_zero_iff.2 h, h⟩⟩
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Impartial.lean
fuzzy_zero_iff_gf
null
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
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Impartial.lean
forall_leftMoves_fuzzy_iff_equiv_zero
null
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
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Impartial.lean
forall_rightMoves_fuzzy_iff_equiv_zero
null
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 obtain ⟨i, hi⟩ := hn exact ⟨i, (equiv_zero_iff_ge _).2 hi⟩
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Impartial.lean
exists_left_move_equiv_iff_fuzzy_zero
null
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 obtain ⟨i, hi⟩ := hn exact ⟨i, (equiv_zero_iff_le _).2 hi⟩
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Impartial.lean
exists_right_move_equiv_iff_fuzzy_zero
null
noncomputable nim (o : Ordinal.{u}) : PGame.{u} := ⟨o.toType, o.toType, fun x => nim ((enumIsoToType o).symm x).val, fun x => nim ((enumIsoToType o).symm x).val⟩ termination_by o decreasing_by all_goals exact ((enumIsoToType o).symm x).prop
def
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim
The definition of single-heap nim, which can be viewed as a pile of stones where each player can take a positive number of stones from it on their turn.
leftMoves_nim (o : Ordinal) : (nim o).LeftMoves = o.toType := by rw [nim]; rfl
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
leftMoves_nim
null
rightMoves_nim (o : Ordinal) : (nim o).RightMoves = o.toType := by rw [nim]; rfl
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
rightMoves_nim
null
moveLeft_nim_heq (o : Ordinal) : (nim o).moveLeft ≍ fun i : o.toType => nim ((enumIsoToType o).symm i) := by rw [nim]; rfl @[deprecated (since := "2025-07-05")] alias moveLeft_nim_hEq := moveLeft_nim_heq
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
moveLeft_nim_heq
null
moveRight_nim_heq (o : Ordinal) : (nim o).moveRight ≍ fun i : o.toType => nim ((enumIsoToType o).symm i) := by rw [nim]; rfl @[deprecated (since := "2025-07-05")] alias moveRight_nim_hEq := moveRight_nim_heq
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
moveRight_nim_heq
null
noncomputable toLeftMovesNim {o : Ordinal} : Set.Iio o ≃ (nim o).LeftMoves := (enumIsoToType o).toEquiv.trans (Equiv.cast (leftMoves_nim o).symm)
def
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
toLeftMovesNim
Turns an ordinal less than `o` into a left move for `nim o` and vice versa.
noncomputable toRightMovesNim {o : Ordinal} : Set.Iio o ≃ (nim o).RightMoves := (enumIsoToType o).toEquiv.trans (Equiv.cast (rightMoves_nim o).symm) @[simp]
def
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
toRightMovesNim
Turns an ordinal less than `o` into a right move for `nim o` and vice versa.
toLeftMovesNim_symm_lt {o : Ordinal} (i : (nim o).LeftMoves) : toLeftMovesNim.symm i < o := (toLeftMovesNim.symm i).prop @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
toLeftMovesNim_symm_lt
null
toRightMovesNim_symm_lt {o : Ordinal} (i : (nim o).RightMoves) : toRightMovesNim.symm i < o := (toRightMovesNim.symm i).prop @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
toRightMovesNim_symm_lt
null
moveLeft_nim {o : Ordinal} (i) : (nim o).moveLeft i = nim (toLeftMovesNim.symm i).val := (congr_heq (moveLeft_nim_heq o).symm (cast_heq _ i)).symm
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
moveLeft_nim
null
moveLeft_toLeftMovesNim {o : Ordinal} (i) : (nim o).moveLeft (toLeftMovesNim i) = nim i := by simp @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
moveLeft_toLeftMovesNim
null
moveRight_nim {o : Ordinal} (i) : (nim o).moveRight i = nim (toRightMovesNim.symm i).val := (congr_heq (moveRight_nim_heq o).symm (cast_heq _ i)).symm
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
moveRight_nim
null
moveRight_toRightMovesNim {o : Ordinal} (i) : (nim o).moveRight (toRightMovesNim i) = nim i := by simp
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
moveRight_toRightMovesNim
null
@[elab_as_elim] leftMovesNimRecOn {o : Ordinal} {P : (nim o).LeftMoves → Sort*} (i : (nim o).LeftMoves) (H : ∀ a (H : a < o), P <| toLeftMovesNim ⟨a, H⟩) : P i := by rw [← toLeftMovesNim.apply_symm_apply i]; apply H
def
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
leftMovesNimRecOn
A recursion principle for left moves of a nim game.
@[elab_as_elim] rightMovesNimRecOn {o : Ordinal} {P : (nim o).RightMoves → Sort*} (i : (nim o).RightMoves) (H : ∀ a (H : a < o), P <| toRightMovesNim ⟨a, H⟩) : P i := by rw [← toRightMovesNim.apply_symm_apply i]; apply H
def
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
rightMovesNimRecOn
A recursion principle for right moves of a nim game.
isEmpty_nim_zero_leftMoves : IsEmpty (nim 0).LeftMoves := by rw [nim] exact isEmpty_toType_zero
instance
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
isEmpty_nim_zero_leftMoves
null
isEmpty_nim_zero_rightMoves : IsEmpty (nim 0).RightMoves := by rw [nim] exact isEmpty_toType_zero
instance
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
isEmpty_nim_zero_rightMoves
null
nimZeroRelabelling : nim 0 ≡r 0 := Relabelling.isEmpty _
def
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nimZeroRelabelling
`nim 0` has exactly the same moves as `0`.
nim_zero_equiv : nim 0 ≈ 0 := Equiv.isEmpty _
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_zero_equiv
null
noncomputable uniqueNimOneLeftMoves : Unique (nim 1).LeftMoves := (Equiv.cast <| leftMoves_nim 1).unique
instance
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
uniqueNimOneLeftMoves
null
noncomputable uniqueNimOneRightMoves : Unique (nim 1).RightMoves := (Equiv.cast <| rightMoves_nim 1).unique @[simp]
instance
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
uniqueNimOneRightMoves
null
default_nim_one_leftMoves_eq : (default : (nim 1).LeftMoves) = @toLeftMovesNim 1 ⟨0, Set.mem_Iio.mpr zero_lt_one⟩ := rfl @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
default_nim_one_leftMoves_eq
null
default_nim_one_rightMoves_eq : (default : (nim 1).RightMoves) = @toRightMovesNim 1 ⟨0, Set.mem_Iio.mpr zero_lt_one⟩ := rfl @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
default_nim_one_rightMoves_eq
null
toLeftMovesNim_one_symm (i) : (@toLeftMovesNim 1).symm i = ⟨0, Set.mem_Iio.mpr zero_lt_one⟩ := by simp [eq_iff_true_of_subsingleton] @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
toLeftMovesNim_one_symm
null
toRightMovesNim_one_symm (i) : (@toRightMovesNim 1).symm i = ⟨0, Set.mem_Iio.mpr zero_lt_one⟩ := by simp [eq_iff_true_of_subsingleton]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
toRightMovesNim_one_symm
null
nim_one_moveLeft (x) : (nim 1).moveLeft x = nim 0 := by simp
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_one_moveLeft
null
nim_one_moveRight (x) : (nim 1).moveRight x = nim 0 := by simp
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_one_moveRight
null
nimOneRelabelling : nim 1 ≡r star := by rw [nim] refine ⟨?_, ?_, fun i => ?_, fun j => ?_⟩ any_goals dsimp; apply Equiv.ofUnique all_goals simpa [enumIsoToType] using nimZeroRelabelling
def
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nimOneRelabelling
`nim 1` has exactly the same moves as `star`.
nim_one_equiv : nim 1 ≈ star := nimOneRelabelling.equiv @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_one_equiv
null
nim_birthday (o : Ordinal) : (nim o).birthday = o := by induction o using Ordinal.induction with | _ o IH rw [nim, birthday_def] dsimp rw [max_eq_right le_rfl] convert lsub_typein o with i exact IH _ (typein_lt_self i) @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_birthday
null
neg_nim (o : Ordinal) : -nim o = nim o := by induction o using Ordinal.induction with | _ o IH rw [nim]; dsimp; congr <;> funext i <;> exact IH _ (Ordinal.typein_lt_self i)
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
neg_nim
null
impartial_nim (o : Ordinal) : Impartial (nim o) := by induction o using Ordinal.induction with | _ o IH rw [impartial_def, neg_nim] refine ⟨equiv_rfl, fun i => ?_, fun i => ?_⟩ <;> simpa using IH _ (typein_lt_self _)
instance
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
impartial_nim
null
nim_fuzzy_zero_of_ne_zero {o : Ordinal} (ho : o ≠ 0) : nim o ‖ 0 := by rw [Impartial.fuzzy_zero_iff_lf, lf_zero_le] use toRightMovesNim ⟨0, Ordinal.pos_iff_ne_zero.2 ho⟩ simp @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_fuzzy_zero_of_ne_zero
null
nim_add_equiv_zero_iff (o₁ o₂ : Ordinal) : (nim o₁ + nim o₂ ≈ 0) ↔ o₁ = o₂ := by constructor · refine not_imp_not.1 fun hne : _ ≠ _ => (Impartial.not_equiv_zero_iff (nim o₁ + nim o₂)).2 ?_ wlog h : o₁ < o₂ · exact (fuzzy_congr_left add_comm_equiv).1 (this _ _ hne.symm (hne.lt_or_gt.resolve_left h)) rw [Impartial.fuzzy_zero_iff_gf, zero_lf_le] use toLeftMovesAdd (Sum.inr <| toLeftMovesNim ⟨_, h⟩) · simpa using (Impartial.add_self (nim o₁)).2 · rintro rfl exact Impartial.add_self (nim o₁) @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_add_equiv_zero_iff
null
nim_add_fuzzy_zero_iff {o₁ o₂ : Ordinal} : nim o₁ + nim o₂ ‖ 0 ↔ o₁ ≠ o₂ := by rw [iff_not_comm, Impartial.not_fuzzy_zero_iff, nim_add_equiv_zero_iff] @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_add_fuzzy_zero_iff
null
nim_equiv_iff_eq {o₁ o₂ : Ordinal} : (nim o₁ ≈ nim o₂) ↔ o₁ = o₂ := by rw [Impartial.equiv_iff_add_equiv_zero, nim_add_equiv_zero_iff]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_equiv_iff_eq
null
noncomputable grundyValue (G : PGame.{u}) : Nimber.{u} := sInf (Set.range fun i => grundyValue (G.moveLeft i))ᶜ termination_by G
def
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue
The Grundy value of an impartial game is recursively defined as the minimum excluded value (the infimum of the complement) of the Grundy values of either its left or right options. This is the ordinal which corresponds to the game of nim that the game is equivalent to. This function takes a value in `Nimber`. This is a type synonym for the ordinals which has the same ordering, but addition in `Nimber` is such that it corresponds to the grundy value of the addition of games. See that file for more information on nimbers and their arithmetic.
grundyValue_eq_sInf_moveLeft (G : PGame) : grundyValue G = sInf (Set.range (grundyValue ∘ G.moveLeft))ᶜ := by rw [grundyValue]; rfl
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_eq_sInf_moveLeft
null
grundyValue_ne_moveLeft {G : PGame} (i : G.LeftMoves) : grundyValue (G.moveLeft i) ≠ grundyValue G := by conv_rhs => rw [grundyValue_eq_sInf_moveLeft] have := csInf_mem (nonempty_of_not_bddAbove <| Nimber.not_bddAbove_compl_of_small (Set.range fun i => grundyValue (G.moveLeft i))) rw [Set.mem_compl_iff, Set.mem_range, not_exists] at this exact this _
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_ne_moveLeft
null
le_grundyValue_of_Iio_subset_moveLeft {G : PGame} {o : Nimber} (h : Set.Iio o ⊆ Set.range (grundyValue ∘ G.moveLeft)) : o ≤ grundyValue G := by by_contra! ho obtain ⟨i, hi⟩ := h ho exact grundyValue_ne_moveLeft i hi
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
le_grundyValue_of_Iio_subset_moveLeft
null
exists_grundyValue_moveLeft_of_lt {G : PGame} {o : Nimber} (h : o < grundyValue G) : ∃ i, grundyValue (G.moveLeft i) = o := by rw [grundyValue_eq_sInf_moveLeft] at h by_contra ha exact h.not_ge (csInf_le' ha)
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
exists_grundyValue_moveLeft_of_lt
null
grundyValue_le_of_forall_moveLeft {G : PGame} {o : Nimber} (h : ∀ i, grundyValue (G.moveLeft i) ≠ o) : G.grundyValue ≤ o := by contrapose! h exact exists_grundyValue_moveLeft_of_lt h
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_le_of_forall_moveLeft
null
equiv_nim_grundyValue (G : PGame.{u}) [G.Impartial] : G ≈ nim (toOrdinal (grundyValue G)) := by rw [Impartial.equiv_iff_add_equiv_zero, ← Impartial.forall_leftMoves_fuzzy_iff_equiv_zero] intro x apply leftMoves_add_cases x <;> intro i · rw [add_moveLeft_inl, ← fuzzy_congr_left (add_congr_left (Equiv.symm (equiv_nim_grundyValue _))), nim_add_fuzzy_zero_iff] exact grundyValue_ne_moveLeft i · rw [add_moveLeft_inr, ← Impartial.exists_left_move_equiv_iff_fuzzy_zero] obtain ⟨j, hj⟩ := exists_grundyValue_moveLeft_of_lt <| toLeftMovesNim_symm_lt i use toLeftMovesAdd (Sum.inl j) rw [add_moveLeft_inl, moveLeft_nim] exact Equiv.trans (add_congr_left (equiv_nim_grundyValue _)) (hj ▸ Impartial.add_self _) termination_by G
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
equiv_nim_grundyValue
The **Sprague-Grundy theorem** states that every impartial game is equivalent to a game of nim, namely the game of nim corresponding to the game's Grundy value.
grundyValue_eq_iff_equiv_nim {G : PGame} [G.Impartial] {o : Nimber} : grundyValue G = o ↔ G ≈ nim (toOrdinal o) := ⟨by rintro rfl; exact equiv_nim_grundyValue G, by intro h; rw [← nim_equiv_iff_eq]; exact Equiv.trans (Equiv.symm (equiv_nim_grundyValue G)) h⟩ @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_eq_iff_equiv_nim
null
nim_grundyValue (o : Ordinal.{u}) : grundyValue (nim o) = ∗o := grundyValue_eq_iff_equiv_nim.2 PGame.equiv_rfl
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_grundyValue
null
grundyValue_eq_iff_equiv (G H : PGame) [G.Impartial] [H.Impartial] : grundyValue G = grundyValue H ↔ (G ≈ H) := grundyValue_eq_iff_equiv_nim.trans (equiv_congr_left.1 (equiv_nim_grundyValue H) _).symm @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_eq_iff_equiv
null
grundyValue_zero : grundyValue 0 = 0 := grundyValue_eq_iff_equiv_nim.2 (Equiv.symm nim_zero_equiv)
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_zero
null
grundyValue_iff_equiv_zero (G : PGame) [G.Impartial] : grundyValue G = 0 ↔ G ≈ 0 := by rw [← grundyValue_eq_iff_equiv, grundyValue_zero] @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_iff_equiv_zero
null
grundyValue_star : grundyValue star = 1 := grundyValue_eq_iff_equiv_nim.2 (Equiv.symm nim_one_equiv) @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_star
null
grundyValue_neg (G : PGame) [G.Impartial] : grundyValue (-G) = grundyValue G := by rw [grundyValue_eq_iff_equiv_nim, neg_equiv_iff, neg_nim, ← grundyValue_eq_iff_equiv_nim]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_neg
null
grundyValue_eq_sInf_moveRight (G : PGame) [G.Impartial] : grundyValue G = sInf (Set.range (grundyValue ∘ G.moveRight))ᶜ := by obtain ⟨l, r, L, R⟩ := G rw [← grundyValue_neg, grundyValue_eq_sInf_moveLeft] iterate 3 apply congr_arg ext i exact @grundyValue_neg _ (@Impartial.moveRight_impartial ⟨l, r, L, R⟩ _ _)
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_eq_sInf_moveRight
null
grundyValue_ne_moveRight {G : PGame} [G.Impartial] (i : G.RightMoves) : grundyValue (G.moveRight i) ≠ grundyValue G := by convert grundyValue_ne_moveLeft (toLeftMovesNeg i) using 1 <;> simp
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_ne_moveRight
null
le_grundyValue_of_Iio_subset_moveRight {G : PGame} [G.Impartial] {o : Nimber} (h : Set.Iio o ⊆ Set.range (grundyValue ∘ G.moveRight)) : o ≤ grundyValue G := by by_contra! ho obtain ⟨i, hi⟩ := h ho exact grundyValue_ne_moveRight i hi
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
le_grundyValue_of_Iio_subset_moveRight
null
exists_grundyValue_moveRight_of_lt {G : PGame} [G.Impartial] {o : Nimber} (h : o < grundyValue G) : ∃ i, grundyValue (G.moveRight i) = o := by rw [← grundyValue_neg] at h obtain ⟨i, hi⟩ := exists_grundyValue_moveLeft_of_lt h use toLeftMovesNeg.symm i rwa [← grundyValue_neg, ← moveLeft_neg]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
exists_grundyValue_moveRight_of_lt
null
grundyValue_le_of_forall_moveRight {G : PGame} [G.Impartial] {o : Nimber} (h : ∀ i, grundyValue (G.moveRight i) ≠ o) : G.grundyValue ≤ o := by contrapose! h exact exists_grundyValue_moveRight_of_lt h
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_le_of_forall_moveRight
null
grundyValue_nim_add_nim (x y : Ordinal) : grundyValue (nim x + nim y) = ∗x + ∗y := by apply (grundyValue_le_of_forall_moveLeft _).antisymm (le_grundyValue_of_Iio_subset_moveLeft _) · intro i apply leftMoves_add_cases i <;> intro j <;> have := (toLeftMovesNim_symm_lt j).ne · simpa [grundyValue_nim_add_nim (toLeftMovesNim.symm j) y] · simpa [grundyValue_nim_add_nim x (toLeftMovesNim.symm j)] · intro k hk obtain h | h := Nimber.lt_add_cases hk · let a := toOrdinal (k + ∗y) use toLeftMovesAdd (Sum.inl (toLeftMovesNim ⟨a, h⟩)) simp [a, grundyValue_nim_add_nim a y] · let a := toOrdinal (k + ∗x) use toLeftMovesAdd (Sum.inr (toLeftMovesNim ⟨a, h⟩)) simp [a, grundyValue_nim_add_nim x a, add_comm (∗x)] termination_by (x, y)
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_nim_add_nim
The Grundy value of the sum of two nim games equals their nimber addition.
nim_add_nim_equiv (x y : Ordinal) : nim x + nim y ≈ nim (toOrdinal (∗x + ∗y)) := by rw [← grundyValue_eq_iff_equiv_nim, grundyValue_nim_add_nim] @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
nim_add_nim_equiv
null
grundyValue_add (G H : PGame) [G.Impartial] [H.Impartial] : grundyValue (G + H) = grundyValue G + grundyValue H := by rw [← (grundyValue G).toOrdinal_toNimber, ← (grundyValue H).toOrdinal_toNimber, ← grundyValue_nim_add_nim, grundyValue_eq_iff_equiv] exact add_congr (equiv_nim_grundyValue G) (equiv_nim_grundyValue H)
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Game.Impartial", "Mathlib.SetTheory.Nimber.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Nim.lean
grundyValue_add
null
noncomputable toPGame (o : Ordinal.{u}) : PGame.{u} := ⟨o.toType, PEmpty, fun x => ((enumIsoToType o).symm x).val.toPGame, PEmpty.elim⟩ termination_by o decreasing_by exact ((enumIsoToType o).symm x).prop @[simp]
def
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame
Converts an ordinal into the corresponding pre-game.
toPGame_leftMoves (o : Ordinal) : o.toPGame.LeftMoves = o.toType := by rw [toPGame, LeftMoves] @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_leftMoves
null
toPGame_rightMoves (o : Ordinal) : o.toPGame.RightMoves = PEmpty := by rw [toPGame, RightMoves]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_rightMoves
null
isEmpty_zero_toPGame_leftMoves : IsEmpty (toPGame 0).LeftMoves := by rw [toPGame_leftMoves]; infer_instance
instance
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
isEmpty_zero_toPGame_leftMoves
null
isEmpty_toPGame_rightMoves (o : Ordinal) : IsEmpty o.toPGame.RightMoves := by rw [toPGame_rightMoves]; infer_instance
instance
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
isEmpty_toPGame_rightMoves
null
noncomputable toLeftMovesToPGame {o : Ordinal} : Set.Iio o ≃ o.toPGame.LeftMoves := (enumIsoToType o).toEquiv.trans (Equiv.cast (toPGame_leftMoves o).symm) @[simp]
def
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toLeftMovesToPGame
Converts an ordinal less than `o` into a move for the `PGame` corresponding to `o`, and vice versa.
toLeftMovesToPGame_symm_lt {o : Ordinal} (i : o.toPGame.LeftMoves) : ↑(toLeftMovesToPGame.symm i) < o := (toLeftMovesToPGame.symm i).prop @[nolint unusedHavesSuffices]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toLeftMovesToPGame_symm_lt
null
toPGame_moveLeft_hEq {o : Ordinal} : o.toPGame.moveLeft ≍ fun x : o.toType => ((enumIsoToType o).symm x).val.toPGame := by rw [toPGame] rfl @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_moveLeft_hEq
null
toPGame_moveLeft' {o : Ordinal} (i) : o.toPGame.moveLeft i = (toLeftMovesToPGame.symm i).val.toPGame := (congr_heq toPGame_moveLeft_hEq.symm (cast_heq _ i)).symm
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_moveLeft'
null
toPGame_moveLeft {o : Ordinal} (i) : o.toPGame.moveLeft (toLeftMovesToPGame i) = i.val.toPGame := by simp
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_moveLeft
null
noncomputable zeroToPGameRelabelling : toPGame 0 ≡r 0 := Relabelling.isEmpty _
def
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
zeroToPGameRelabelling
`0.toPGame` has the same moves as `0`.
toPGame_zero : toPGame 0 ≈ 0 := zeroToPGameRelabelling.equiv
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_zero
null
noncomputable uniqueOneToPGameLeftMoves : Unique (toPGame 1).LeftMoves := (Equiv.cast <| toPGame_leftMoves 1).unique @[simp]
instance
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
uniqueOneToPGameLeftMoves
null
one_toPGame_leftMoves_default_eq : (default : (toPGame 1).LeftMoves) = @toLeftMovesToPGame 1 ⟨0, Set.mem_Iio.mpr zero_lt_one⟩ := rfl @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
one_toPGame_leftMoves_default_eq
null
to_leftMoves_one_toPGame_symm (i) : (@toLeftMovesToPGame 1).symm i = ⟨0, Set.mem_Iio.mpr zero_lt_one⟩ := by simp [eq_iff_true_of_subsingleton]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
to_leftMoves_one_toPGame_symm
null
one_toPGame_moveLeft (x) : (toPGame 1).moveLeft x = toPGame 0 := by simp
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
one_toPGame_moveLeft
null
noncomputable oneToPGameRelabelling : toPGame 1 ≡r 1 := ⟨Equiv.ofUnique _ _, Equiv.equivOfIsEmpty _ _, fun i => by simpa using zeroToPGameRelabelling, isEmptyElim⟩
def
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
oneToPGameRelabelling
`1.toPGame` has the same moves as `1`.
toPGame_one : toPGame 1 ≈ 1 := oneToPGameRelabelling.equiv
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_one
null
toPGame_lf {a b : Ordinal} (h : a < b) : a.toPGame ⧏ b.toPGame := by convert moveLeft_lf (toLeftMovesToPGame ⟨a, h⟩); rw [toPGame_moveLeft]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_lf
null
toPGame_le {a b : Ordinal} (h : a ≤ b) : a.toPGame ≤ b.toPGame := by refine le_iff_forall_lf.2 ⟨fun i => ?_, isEmptyElim⟩ rw [toPGame_moveLeft'] exact toPGame_lf ((toLeftMovesToPGame_symm_lt i).trans_le h)
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_le
null
toPGame_lt {a b : Ordinal} (h : a < b) : a.toPGame < b.toPGame := ⟨toPGame_le h.le, toPGame_lf h⟩
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_lt
null
toPGame_nonneg (a : Ordinal) : 0 ≤ a.toPGame := zeroToPGameRelabelling.ge.trans <| toPGame_le <| Ordinal.zero_le a @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_nonneg
null
toPGame_lf_iff {a b : Ordinal} : a.toPGame ⧏ b.toPGame ↔ a < b := ⟨by contrapose; rw [not_lt, not_lf]; exact toPGame_le, toPGame_lf⟩ @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_lf_iff
null
toPGame_le_iff {a b : Ordinal} : a.toPGame ≤ b.toPGame ↔ a ≤ b := ⟨by contrapose; rw [not_le, PGame.not_le]; exact toPGame_lf, toPGame_le⟩ @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_le_iff
null
toPGame_lt_iff {a b : Ordinal} : a.toPGame < b.toPGame ↔ a < b := ⟨by contrapose; rw [not_lt]; exact fun h => not_lt_of_ge (toPGame_le h), toPGame_lt⟩ @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_lt_iff
null
toPGame_equiv_iff {a b : Ordinal} : (a.toPGame ≈ b.toPGame) ↔ a = b := by change _ ≤ _ ∧ _ ≤ _ ↔ _ rw [le_antisymm_iff, toPGame_le_iff, toPGame_le_iff]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_equiv_iff
null
toPGame_injective : Function.Injective Ordinal.toPGame := fun _ _ h => toPGame_equiv_iff.1 <| equiv_of_eq h @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_injective
null
toPGame_inj {a b : Ordinal} : a.toPGame = b.toPGame ↔ a = b := toPGame_injective.eq_iff
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGame_inj
null
@[simps] noncomputable toPGameEmbedding : Ordinal.{u} ↪o PGame.{u} where toFun := Ordinal.toPGame inj' := toPGame_injective map_rel_iff' := @toPGame_le_iff
def
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toPGameEmbedding
The order embedding version of `toPGame`.
noncomputable toGame : Ordinal.{u} ↪o Game.{u} where toFun o := ⟦o.toPGame⟧ inj' a b := by simpa [AntisymmRel] using le_antisymm map_rel_iff' := toPGame_le_iff @[simp]
def
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toGame
Converts an ordinal into the corresponding game.
mk_toPGame (o : Ordinal) : ⟦o.toPGame⟧ = o.toGame := rfl @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
mk_toPGame
null
toGame_zero : toGame 0 = 0 := game_eq toPGame_zero @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toGame_zero
null
toGame_one : toGame 1 = 1 := game_eq toPGame_one
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toGame_one
null
toGame_injective : Function.Injective toGame := toGame.injective @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Game.Basic", "Mathlib.SetTheory.Ordinal.NaturalOps", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Game/Ordinal.lean
toGame_injective
null