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
lt_congr_imp {x₁ y₁ x₂ y₂ : PGame} (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) (h : x₁ < y₁) : x₂ < y₂ := hx.2.trans_lt (h.trans_le hy.1)
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lt_congr_imp
null
lt_congr {x₁ y₁ x₂ y₂ : PGame} (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ < y₁ ↔ x₂ < y₂ := ⟨lt_congr_imp hx hy, lt_congr_imp (Equiv.symm hx) (Equiv.symm hy)⟩
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lt_congr
null
lt_congr_left {x₁ x₂ y : PGame} (hx : x₁ ≈ x₂) : x₁ < y ↔ x₂ < y := lt_congr hx equiv_rfl
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lt_congr_left
null
lt_congr_right {x y₁ y₂ : PGame} (hy : y₁ ≈ y₂) : x < y₁ ↔ x < y₂ := lt_congr equiv_rfl hy
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lt_congr_right
null
lt_or_equiv_of_le {x y : PGame} (h : x ≤ y) : x < y ∨ (x ≈ y) := and_or_left.mp ⟨h, (em <| y ≤ x).symm.imp_left PGame.not_le.1⟩
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lt_or_equiv_of_le
null
lf_or_equiv_or_gf (x y : PGame) : x ⧏ y ∨ (x ≈ y) ∨ y ⧏ x := by rw [or_iff_not_imp_left] intro h rcases lt_or_equiv_of_le (PGame.not_lf.1 h) with h' | h' · exact Or.inr h'.lf · exact Or.inl (Equiv.symm h')
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lf_or_equiv_or_gf
null
equiv_congr_left {y₁ y₂ : PGame} : (y₁ ≈ y₂) ↔ ∀ x₁, (x₁ ≈ y₁) ↔ (x₁ ≈ y₂) := ⟨fun h _ => ⟨fun h' => Equiv.trans h' h, fun h' => Equiv.trans h' (Equiv.symm h)⟩, fun h => (h y₁).1 <| equiv_rfl⟩
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
equiv_congr_left
null
equiv_congr_right {x₁ x₂ : PGame} : (x₁ ≈ x₂) ↔ ∀ y₁, (x₁ ≈ y₁) ↔ (x₂ ≈ y₁) := ⟨fun h _ => ⟨fun h' => Equiv.trans (Equiv.symm h) h', fun h' => Equiv.trans h h'⟩, fun h => (h x₂).2 <| equiv_rfl⟩
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
equiv_congr_right
null
Equiv.of_exists {x y : PGame} (hl₁ : ∀ i, ∃ j, x.moveLeft i ≈ y.moveLeft j) (hr₁ : ∀ i, ∃ j, x.moveRight i ≈ y.moveRight j) (hl₂ : ∀ j, ∃ i, x.moveLeft i ≈ y.moveLeft j) (hr₂ : ∀ j, ∃ i, x.moveRight i ≈ y.moveRight j) : x ≈ y := by constructor <;> refine le_def.2 ⟨?_, ?_⟩ <;> intro i · obtain ⟨j, hj⟩ := hl₁ i exact Or.inl ⟨j, Equiv.le hj⟩ · obtain ⟨j, hj⟩ := hr₂ i exact Or.inr ⟨j, Equiv.le hj⟩ · obtain ⟨j, hj⟩ := hl₂ i exact Or.inl ⟨j, Equiv.ge hj⟩ · obtain ⟨j, hj⟩ := hr₁ i exact Or.inr ⟨j, Equiv.ge hj⟩
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Equiv.of_exists
null
Equiv.of_equiv {x y : PGame} (L : x.LeftMoves ≃ y.LeftMoves) (R : x.RightMoves ≃ y.RightMoves) (hl : ∀ i, x.moveLeft i ≈ y.moveLeft (L i)) (hr : ∀ j, x.moveRight j ≈ y.moveRight (R j)) : x ≈ y := by apply Equiv.of_exists <;> intro i exacts [⟨_, hl i⟩, ⟨_, hr i⟩, ⟨_, by simpa using hl (L.symm i)⟩, ⟨_, by simpa using hr (R.symm i)⟩]
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Equiv.of_equiv
null
Fuzzy (x y : PGame) : Prop := x ⧏ y ∧ y ⧏ x @[inherit_doc] scoped infixl:50 " ‖ " => PGame.Fuzzy @[symm]
def
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Fuzzy
The fuzzy, confused, or incomparable relation on pre-games. If `x ‖ 0`, then the first player can always win `x`.
Fuzzy.swap {x y : PGame} : x ‖ y → y ‖ x := And.symm
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Fuzzy.swap
null
Fuzzy.swap_iff {x y : PGame} : x ‖ y ↔ y ‖ x := ⟨Fuzzy.swap, Fuzzy.swap⟩
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Fuzzy.swap_iff
null
fuzzy_irrefl (x : PGame) : ¬x ‖ x := fun h => lf_irrefl x h.1
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
fuzzy_irrefl
null
lf_iff_lt_or_fuzzy {x y : PGame} : x ⧏ y ↔ x < y ∨ x ‖ y := by simp only [lt_iff_le_and_lf, Fuzzy, ← PGame.not_le] tauto
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lf_iff_lt_or_fuzzy
null
lf_of_fuzzy {x y : PGame} (h : x ‖ y) : x ⧏ y := lf_iff_lt_or_fuzzy.2 (Or.inr h) alias Fuzzy.lf := lf_of_fuzzy
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lf_of_fuzzy
null
lt_or_fuzzy_of_lf {x y : PGame} : x ⧏ y → x < y ∨ x ‖ y := lf_iff_lt_or_fuzzy.1
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lt_or_fuzzy_of_lf
null
Fuzzy.not_equiv {x y : PGame} (h : x ‖ y) : ¬(x ≈ y) := fun h' => h'.1.not_gf h.2
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Fuzzy.not_equiv
null
Fuzzy.not_equiv' {x y : PGame} (h : x ‖ y) : ¬(y ≈ x) := fun h' => h'.2.not_gf h.2
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Fuzzy.not_equiv'
null
not_fuzzy_of_le {x y : PGame} (h : x ≤ y) : ¬x ‖ y := fun h' => h'.2.not_ge h
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
not_fuzzy_of_le
null
not_fuzzy_of_ge {x y : PGame} (h : y ≤ x) : ¬x ‖ y := fun h' => h'.1.not_ge h
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
not_fuzzy_of_ge
null
Equiv.not_fuzzy {x y : PGame} (h : x ≈ y) : ¬x ‖ y := not_fuzzy_of_le h.1
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Equiv.not_fuzzy
null
Equiv.not_fuzzy' {x y : PGame} (h : x ≈ y) : ¬y ‖ x := not_fuzzy_of_le h.2
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Equiv.not_fuzzy'
null
fuzzy_congr {x₁ y₁ x₂ y₂ : PGame} (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ ‖ y₁ ↔ x₂ ‖ y₂ := show _ ∧ _ ↔ _ ∧ _ by rw [lf_congr hx hy, lf_congr hy hx]
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
fuzzy_congr
null
fuzzy_congr_imp {x₁ y₁ x₂ y₂ : PGame} (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ ‖ y₁ → x₂ ‖ y₂ := (fuzzy_congr hx hy).1
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
fuzzy_congr_imp
null
fuzzy_congr_left {x₁ x₂ y : PGame} (hx : x₁ ≈ x₂) : x₁ ‖ y ↔ x₂ ‖ y := fuzzy_congr hx equiv_rfl
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
fuzzy_congr_left
null
fuzzy_congr_right {x y₁ y₂ : PGame} (hy : y₁ ≈ y₂) : x ‖ y₁ ↔ x ‖ y₂ := fuzzy_congr equiv_rfl hy @[trans]
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
fuzzy_congr_right
null
fuzzy_of_fuzzy_of_equiv {x y z : PGame} (h₁ : x ‖ y) (h₂ : y ≈ z) : x ‖ z := (fuzzy_congr_right h₂).1 h₁ @[trans]
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
fuzzy_of_fuzzy_of_equiv
null
fuzzy_of_equiv_of_fuzzy {x y z : PGame} (h₁ : x ≈ y) (h₂ : y ‖ z) : x ‖ z := (fuzzy_congr_left h₁).2 h₂
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
fuzzy_of_equiv_of_fuzzy
null
lt_or_equiv_or_gt_or_fuzzy (x y : PGame) : x < y ∨ (x ≈ y) ∨ y < x ∨ x ‖ y := by rcases le_or_gf x y with h₁ | h₁ <;> rcases le_or_gf y x with h₂ | h₂ · right left exact ⟨h₁, h₂⟩ · left exact ⟨h₁, h₂⟩ · right right left exact ⟨h₂, h₁⟩ · right right right exact ⟨h₂, h₁⟩
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lt_or_equiv_or_gt_or_fuzzy
Exactly one of the following is true (although we don't prove this here).
lt_or_equiv_or_gf (x y : PGame) : x < y ∨ (x ≈ y) ∨ y ⧏ x := by rw [lf_iff_lt_or_fuzzy, Fuzzy.swap_iff] exact lt_or_equiv_or_gt_or_fuzzy x y /-! ### Interaction of relabelling with order -/
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
lt_or_equiv_or_gf
null
Relabelling.le {x y : PGame} (r : x ≡r y) : x ≤ y := le_def.2 ⟨fun i => Or.inl ⟨_, (r.moveLeft i).le⟩, fun j => Or.inr ⟨_, (r.moveRightSymm j).le⟩⟩ termination_by x
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Relabelling.le
null
Relabelling.ge {x y : PGame} (r : x ≡r y) : y ≤ x := r.symm.le
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Relabelling.ge
null
Relabelling.equiv {x y : PGame} (r : x ≡r y) : x ≈ y := ⟨r.le, r.ge⟩
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Relabelling.equiv
A relabelling lets us prove equivalence of games.
Equiv.isEmpty (x : PGame) [IsEmpty x.LeftMoves] [IsEmpty x.RightMoves] : x ≈ 0 := (Relabelling.isEmpty x).equiv
theorem
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
Equiv.isEmpty
null
le_insertLeft (x x' : PGame) : x ≤ insertLeft x x' := by rw [le_def] constructor · intro i left rcases x with ⟨xl, xr, xL, xR⟩ simp only [insertLeft, leftMoves_mk, moveLeft_mk, Sum.exists, Sum.elim_inl] left use i · intro j right rcases x with ⟨xl, xr, xL, xR⟩ simp only [rightMoves_mk, moveRight_mk, insertLeft] use j
lemma
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
le_insertLeft
A new left option cannot hurt Left.
insertRight_le (x x' : PGame) : insertRight x x' ≤ x := by rw [le_def] constructor · intro j left rcases x with ⟨xl, xr, xL, xR⟩ simp only [leftMoves_mk, moveLeft_mk, insertRight] use j · intro i right rcases x with ⟨xl, xr, xL, xR⟩ simp only [insertRight, rightMoves_mk, moveRight_mk, Sum.exists, Sum.elim_inl] left use i
lemma
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
insertRight_le
A new right option cannot hurt Right.
insertLeft_equiv_of_lf {x x' : PGame} (h : x' ⧏ x) : insertLeft x x' ≈ x := by rw [equiv_def] constructor · rw [le_def] constructor · intro i rcases x with ⟨xl, xr, xL, xR⟩ simp only [insertLeft, moveLeft_mk] at i ⊢ rcases i with i | _ · rw [Sum.elim_inl] left use i · rw [Sum.elim_inr] simpa only [lf_iff_exists_le] using h · intro j right rcases x with ⟨xl, xr, xL, xR⟩ simp only [insertLeft, moveRight_mk] use j · apply le_insertLeft
lemma
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
insertLeft_equiv_of_lf
Adding a gift horse left option does not change the value of `x`. A gift horse left option is a game `x'` with `x' ⧏ x`. It is called "gift horse" because it seems like Left has gotten the "gift" of a new option, but actually the value of the game did not change.
insertRight_equiv_of_lf {x x' : PGame} (h : x ⧏ x') : insertRight x x' ≈ x := by rw [equiv_def] constructor · apply insertRight_le · rw [le_def] constructor · intro j left rcases x with ⟨xl, xr, xL, xR⟩ simp only [insertRight, moveLeft_mk] use j · intro i rcases x with ⟨xl, xr, xL, xR⟩ simp only [insertRight, moveRight_mk] at i ⊢ rcases i with i | _ · rw [Sum.elim_inl] right use i · rw [Sum.elim_inr] simpa only [lf_iff_exists_le] using h
lemma
SetTheory
[ "Mathlib.Logic.Small.Defs", "Mathlib.Order.GameAdd", "Mathlib.SetTheory.PGame.Basic", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/PGame/Order.lean
insertRight_equiv_of_lf
Adding a gift horse right option does not change the value of `x`. A gift horse right option is a game `x'` with `x ⧏ x'`. It is called "gift horse" because it seems like Right has gotten the "gift" of a new option, but actually the value of the game did not change.
Numeric : PGame → Prop | ⟨_, _, L, R⟩ => (∀ i j, L i < R j) ∧ (∀ i, Numeric (L i)) ∧ ∀ j, Numeric (R j)
def
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
Numeric
A pre-game is numeric if everything in the L set is less than everything in the R set, and all the elements of L and R are also numeric.
numeric_def {x : PGame} : Numeric x ↔ (∀ i j, x.moveLeft i < x.moveRight j) ∧ (∀ i, Numeric (x.moveLeft i)) ∧ ∀ j, Numeric (x.moveRight j) := by cases x; rfl
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
numeric_def
null
mk {x : PGame} (h₁ : ∀ i j, x.moveLeft i < x.moveRight j) (h₂ : ∀ i, Numeric (x.moveLeft i)) (h₃ : ∀ j, Numeric (x.moveRight j)) : Numeric x := numeric_def.2 ⟨h₁, h₂, h₃⟩
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
mk
null
left_lt_right {x : PGame} (o : Numeric x) (i : x.LeftMoves) (j : x.RightMoves) : x.moveLeft i < x.moveRight j := by cases x; exact o.1 i j
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
left_lt_right
null
moveLeft {x : PGame} (o : Numeric x) (i : x.LeftMoves) : Numeric (x.moveLeft i) := by cases x; exact o.2.1 i
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
moveLeft
null
moveRight {x : PGame} (o : Numeric x) (j : x.RightMoves) : Numeric (x.moveRight j) := by cases x; exact o.2.2 j
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
moveRight
null
isOption {x' x} (h : IsOption x' x) (hx : Numeric x) : Numeric x' := by cases h · apply hx.moveLeft · apply hx.moveRight
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
isOption
null
@[elab_as_elim] numeric_rec {C : PGame → Prop} (H : ∀ (l r) (L : l → PGame) (R : r → PGame), (∀ i j, L i < R j) → (∀ i, Numeric (L i)) → (∀ i, Numeric (R i)) → (∀ i, C (L i)) → (∀ i, C (R i)) → C ⟨l, r, L, R⟩) : ∀ x, Numeric x → C x | ⟨_, _, _, _⟩, ⟨h, hl, hr⟩ => H _ _ _ _ h hl hr (fun i => numeric_rec H _ (hl i)) fun i => numeric_rec H _ (hr i)
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
numeric_rec
null
Relabelling.numeric_imp {x y : PGame} (r : x ≡r y) (ox : Numeric x) : Numeric y := by induction x using PGame.moveRecOn generalizing y with | _ x IHl IHr apply Numeric.mk (fun i j => ?_) (fun i => ?_) fun j => ?_ · rw [← lt_congr (r.moveLeftSymm i).equiv (r.moveRightSymm j).equiv] apply ox.left_lt_right · exact IHl _ (r.moveLeftSymm i) (ox.moveLeft _) · exact IHr _ (r.moveRightSymm j) (ox.moveRight _)
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
Relabelling.numeric_imp
null
Relabelling.numeric_congr {x y : PGame} (r : x ≡r y) : Numeric x ↔ Numeric y := ⟨r.numeric_imp, r.symm.numeric_imp⟩
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
Relabelling.numeric_congr
Relabellings preserve being numeric.
lf_asymm {x y : PGame} (ox : Numeric x) (oy : Numeric y) : x ⧏ y → ¬y ⧏ x := by refine numeric_rec (C := fun x => ∀ z (_oz : Numeric z), x ⧏ z → ¬z ⧏ x) (fun xl xr xL xR hx _oxl _oxr IHxl IHxr => ?_) x ox y oy refine numeric_rec fun yl yr yL yR hy oyl oyr _IHyl _IHyr => ?_ rw [mk_lf_mk, mk_lf_mk]; rintro (⟨i, h₁⟩ | ⟨j, h₁⟩) (⟨i, h₂⟩ | ⟨j, h₂⟩) · exact IHxl _ _ (oyl _) (h₁.moveLeft_lf _) (h₂.moveLeft_lf _) · exact (le_trans h₂ h₁).not_gf (lf_of_lt (hy _ _)) · exact (le_trans h₁ h₂).not_gf (lf_of_lt (hx _ _)) · exact IHxr _ _ (oyr _) (h₁.lf_moveRight _) (h₂.lf_moveRight _)
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
lf_asymm
null
le_of_lf {x y : PGame} (h : x ⧏ y) (ox : Numeric x) (oy : Numeric y) : x ≤ y := not_lf.1 (lf_asymm ox oy h) alias LF.le := le_of_lf
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
le_of_lf
null
lt_of_lf {x y : PGame} (h : x ⧏ y) (ox : Numeric x) (oy : Numeric y) : x < y := (lt_or_fuzzy_of_lf h).resolve_right (not_fuzzy_of_le (h.le ox oy)) alias LF.lt := lt_of_lf
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
lt_of_lf
null
lf_iff_lt {x y : PGame} (ox : Numeric x) (oy : Numeric y) : x ⧏ y ↔ x < y := ⟨fun h => h.lt ox oy, lf_of_lt⟩
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
lf_iff_lt
null
le_iff_forall_lt {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) : x ≤ y ↔ (∀ i, x.moveLeft i < y) ∧ ∀ j, x < y.moveRight j := by refine le_iff_forall_lf.trans (and_congr ?_ ?_) <;> refine forall_congr' fun i => lf_iff_lt ?_ ?_ <;> apply_rules [Numeric.moveLeft, Numeric.moveRight]
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
le_iff_forall_lt
Definition of `x ≤ y` on numeric pre-games, in terms of `<`
lt_iff_exists_le {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) : x < y ↔ (∃ i, x ≤ y.moveLeft i) ∨ ∃ j, x.moveRight j ≤ y := by rw [← lf_iff_lt ox oy, lf_iff_exists_le]
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
lt_iff_exists_le
Definition of `x < y` on numeric pre-games, in terms of `≤`
lt_of_exists_le {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) : ((∃ i, x ≤ y.moveLeft i) ∨ ∃ j, x.moveRight j ≤ y) → x < y := (lt_iff_exists_le ox oy).2
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
lt_of_exists_le
null
lt_def {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) : x < y ↔ (∃ i, (∀ i', x.moveLeft i' < y.moveLeft i) ∧ ∀ j, x < (y.moveLeft i).moveRight j) ∨ ∃ j, (∀ i, (x.moveRight j).moveLeft i < y) ∧ ∀ j', x.moveRight j < y.moveRight j' := by rw [← lf_iff_lt ox oy, lf_def] refine or_congr ?_ ?_ <;> refine exists_congr fun x_1 => ?_ <;> refine and_congr ?_ ?_ <;> refine forall_congr' fun i => lf_iff_lt ?_ ?_ <;> apply_rules [Numeric.moveLeft, Numeric.moveRight]
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
lt_def
The definition of `x < y` on numeric pre-games, in terms of `<` two moves later.
not_fuzzy {x y : PGame} (ox : Numeric x) (oy : Numeric y) : ¬Fuzzy x y := fun h => not_lf.2 ((lf_of_fuzzy h).le ox oy) h.2
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
not_fuzzy
null
lt_or_equiv_or_gt {x y : PGame} (ox : Numeric x) (oy : Numeric y) : x < y ∨ (x ≈ y) ∨ y < x := ((lf_or_equiv_or_gf x y).imp fun h => h.lt ox oy) <| Or.imp_right fun h => h.lt oy ox
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
lt_or_equiv_or_gt
null
numeric_of_isEmpty (x : PGame) [IsEmpty x.LeftMoves] [IsEmpty x.RightMoves] : Numeric x := Numeric.mk isEmptyElim isEmptyElim isEmptyElim
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
numeric_of_isEmpty
null
numeric_of_isEmpty_leftMoves (x : PGame) [IsEmpty x.LeftMoves] : (∀ j, Numeric (x.moveRight j)) → Numeric x := Numeric.mk isEmptyElim isEmptyElim
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
numeric_of_isEmpty_leftMoves
null
numeric_of_isEmpty_rightMoves (x : PGame) [IsEmpty x.RightMoves] (H : ∀ i, Numeric (x.moveLeft i)) : Numeric x := Numeric.mk (fun _ => isEmptyElim) H isEmptyElim
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
numeric_of_isEmpty_rightMoves
null
numeric_zero : Numeric 0 := numeric_of_isEmpty 0
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
numeric_zero
null
numeric_one : Numeric 1 := numeric_of_isEmpty_rightMoves 1 fun _ => numeric_zero
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
numeric_one
null
Numeric.neg : ∀ {x : PGame} (_ : Numeric x), Numeric (-x) | ⟨_, _, _, _⟩, o => ⟨fun j i => neg_lt_neg_iff.2 (o.1 i j), fun j => (o.2.2 j).neg, fun i => (o.2.1 i).neg⟩
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
Numeric.neg
null
insertLeft_numeric {x x' : PGame} (x_num : x.Numeric) (x'_num : x'.Numeric) (h : x' ≤ x) : (insertLeft x x').Numeric := by rw [le_iff_forall_lt x'_num x_num] at h unfold Numeric at x_num ⊢ rcases x with ⟨xl, xr, xL, xR⟩ simp only [insertLeft, Sum.forall, forall_const, Sum.elim_inl, Sum.elim_inr] at x_num ⊢ constructor · simp only [x_num.1, implies_true, true_and] simp only [rightMoves_mk, moveRight_mk] at h exact h.2 · simp only [x_num, implies_true, x'_num, and_self]
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
insertLeft_numeric
Inserting a smaller numeric left option into a numeric game results in a numeric game.
insertRight_numeric {x x' : PGame} (x_num : x.Numeric) (x'_num : x'.Numeric) (h : x ≤ x') : (insertRight x x').Numeric := by rw [← neg_neg (x.insertRight x'), ← neg_insertLeft_neg] apply Numeric.neg exact insertLeft_numeric (Numeric.neg x_num) (Numeric.neg x'_num) (neg_le_neg_iff.mpr h)
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
insertRight_numeric
Inserting a larger numeric right option into a numeric game results in a numeric game.
moveLeft_lt {x : PGame} (o : Numeric x) (i) : x.moveLeft i < x := (moveLeft_lf i).lt (o.moveLeft i) o
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
moveLeft_lt
null
moveLeft_le {x : PGame} (o : Numeric x) (i) : x.moveLeft i ≤ x := (o.moveLeft_lt i).le
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
moveLeft_le
null
lt_moveRight {x : PGame} (o : Numeric x) (j) : x < x.moveRight j := (lf_moveRight j).lt o (o.moveRight j)
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
lt_moveRight
null
le_moveRight {x : PGame} (o : Numeric x) (j) : x ≤ x.moveRight j := (o.lt_moveRight j).le
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
le_moveRight
null
add : ∀ {x y : PGame} (_ : Numeric x) (_ : Numeric y), Numeric (x + y) | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, ox, oy => ⟨by rintro (ix | iy) (jx | jy) · exact add_lt_add_right (ox.1 ix jx) _ · exact (add_lf_add_of_lf_of_le (lf_mk _ _ ix) (oy.le_moveRight jy)).lt ((ox.moveLeft ix).add oy) (ox.add (oy.moveRight jy)) · exact (add_lf_add_of_lf_of_le (mk_lf _ _ jx) (oy.moveLeft_le iy)).lt (ox.add (oy.moveLeft iy)) ((ox.moveRight jx).add oy) · exact add_lt_add_left (oy.1 iy jy) ⟨xl, xr, xL, xR⟩, by constructor · rintro (ix | iy) · exact (ox.moveLeft ix).add oy · exact ox.add (oy.moveLeft iy) · rintro (jx | jy) · apply (ox.moveRight jx).add oy · apply ox.add (oy.moveRight jy)⟩ termination_by x y => (x, y) -- Porting note: Added `termination_by`
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
add
null
sub {x y : PGame} (ox : Numeric x) (oy : Numeric y) : Numeric (x - y) := ox.add oy.neg
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
sub
null
numeric_nat : ∀ n : ℕ, Numeric n | 0 => numeric_zero | n + 1 => (numeric_nat n).add numeric_one
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
numeric_nat
Pre-games defined by natural numbers are numeric.
numeric_toPGame (o : Ordinal) : o.toPGame.Numeric := by induction o using Ordinal.induction with | _ o IH apply numeric_of_isEmpty_rightMoves simpa using fun i => IH _ (Ordinal.toLeftMovesToPGame_symm_lt i)
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
numeric_toPGame
Ordinal games are numeric.
Surreal := Quotient (inferInstanceAs <| Setoid (Subtype Numeric))
def
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
Surreal
The type of surreal numbers. These are the numeric pre-games quotiented by the equivalence relation `x ≈ y ↔ x ≤ y ∧ y ≤ x`. In the quotient, the order becomes a total order.
mk (x : PGame) (h : x.Numeric) : Surreal := ⟦⟨x, h⟩⟧
def
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
mk
Construct a surreal number from a numeric pre-game.
mk_eq_mk {x y : PGame.{u}} {hx hy} : mk x hx = mk y hy ↔ x ≈ y := Quotient.eq
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
mk_eq_mk
null
mk_eq_zero {x : PGame.{u}} {hx} : mk x hx = 0 ↔ x ≈ 0 := Quotient.eq
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
mk_eq_zero
null
lift {α} (f : ∀ x, Numeric x → α) (H : ∀ {x y} (hx : Numeric x) (hy : Numeric y), x.Equiv y → f x hx = f y hy) : Surreal → α := Quotient.lift (fun x : { x // Numeric x } => f x.1 x.2) fun x y => H x.2 y.2
def
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
lift
Lift an equivalence-respecting function on pre-games to surreals.
lift₂ {α} (f : ∀ x y, Numeric x → Numeric y → α) (H : ∀ {x₁ y₁ x₂ y₂} (ox₁ : Numeric x₁) (oy₁ : Numeric y₁) (ox₂ : Numeric x₂) (oy₂ : Numeric y₂), x₁.Equiv x₂ → y₁.Equiv y₂ → f x₁ y₁ ox₁ oy₁ = f x₂ y₂ ox₂ oy₂) : Surreal → Surreal → α := lift (fun x ox => lift (fun y oy => f x y ox oy) fun _ _ => H _ _ _ _ equiv_rfl) fun _ _ h => funext <| Quotient.ind fun _ => H _ _ _ _ h equiv_rfl
def
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
lift₂
Lift a binary equivalence-respecting function on pre-games to surreals.
instLE : LE Surreal := ⟨lift₂ (fun x y _ _ => x ≤ y) fun _ _ _ _ hx hy => propext (le_congr hx hy)⟩ @[simp]
instance
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
instLE
null
mk_le_mk {x y : PGame.{u}} {hx hy} : mk x hx ≤ mk y hy ↔ x ≤ y := Iff.rfl
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
mk_le_mk
null
zero_le_mk {x : PGame.{u}} {hx} : 0 ≤ mk x hx ↔ 0 ≤ x := Iff.rfl
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
zero_le_mk
null
instLT : LT Surreal := ⟨lift₂ (fun x y _ _ => x < y) fun _ _ _ _ hx hy => propext (lt_congr hx hy)⟩
instance
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
instLT
null
mk_lt_mk {x y : PGame.{u}} {hx hy} : mk x hx < mk y hy ↔ x < y := Iff.rfl
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
mk_lt_mk
null
zero_lt_mk {x : PGame.{u}} {hx} : 0 < mk x hx ↔ 0 < x := Iff.rfl
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
zero_lt_mk
null
mk_moveLeft_lt_mk {x : PGame} (o : Numeric x) (i) : Surreal.mk (x.moveLeft i) (Numeric.moveLeft o i) < Surreal.mk x o := Numeric.moveLeft_lt o i
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
mk_moveLeft_lt_mk
Same as `moveLeft_lt`, but for `Surreal` instead of `PGame`
mk_lt_mk_moveRight {x : PGame} (o : Numeric x) (j) : Surreal.mk x o < Surreal.mk (x.moveRight j) (Numeric.moveRight o j) := Numeric.lt_moveRight o j
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
mk_lt_mk_moveRight
Same as `lt_moveRight`, but for `Surreal` instead of `PGame`
toGame : Surreal →+o Game where toFun := lift (fun x _ => ⟦x⟧) fun _ _ => Quot.sound map_zero' := rfl map_add' := by rintro ⟨_, _⟩ ⟨_, _⟩; rfl monotone' := by rintro ⟨_, _⟩ ⟨_, _⟩; exact id @[simp]
def
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
toGame
Addition on surreals is inherited from pre-game addition: the sum of `x = {xL | xR}` and `y = {yL | yR}` is `{xL + y, x + yL | xR + y, x + yR}`. -/ instance : Add Surreal := ⟨Surreal.lift₂ (fun (x y : PGame) ox oy => ⟦⟨x + y, ox.add oy⟩⟧) fun _ _ _ _ hx hy => Quotient.sound (add_congr hx hy)⟩ /-- Negation for surreal numbers is inherited from pre-game negation: the negation of `{L | R}` is `{-R | -L}`. -/ instance : Neg Surreal := ⟨Surreal.lift (fun x ox => ⟦⟨-x, ox.neg⟩⟧) fun _ _ a => Quotient.sound (neg_equiv_neg_iff.2 a)⟩ instance addCommGroup : AddCommGroup Surreal where add := (· + ·) add_assoc := by rintro ⟨_⟩ ⟨_⟩ ⟨_⟩; exact Quotient.sound add_assoc_equiv zero := 0 zero_add := by rintro ⟨a⟩; exact Quotient.sound (zero_add_equiv a) add_zero := by rintro ⟨a⟩; exact Quotient.sound (add_zero_equiv a) neg := Neg.neg neg_add_cancel := by rintro ⟨a⟩; exact Quotient.sound (neg_add_cancel_equiv a) add_comm := by rintro ⟨_⟩ ⟨_⟩; exact Quotient.sound add_comm_equiv nsmul := nsmulRec zsmul := zsmulRec instance partialOrder : PartialOrder Surreal where le := (· ≤ ·) lt := (· < ·) le_refl := by rintro ⟨_⟩; apply @le_rfl PGame le_trans := by rintro ⟨_⟩ ⟨_⟩ ⟨_⟩; apply @le_trans PGame lt_iff_le_not_ge := by rintro ⟨_, ox⟩ ⟨_, oy⟩; apply @lt_iff_le_not_ge PGame le_antisymm := by rintro ⟨_⟩ ⟨_⟩ h₁ h₂; exact Quotient.sound ⟨h₁, h₂⟩ instance isOrderedAddMonoid : IsOrderedAddMonoid Surreal where add_le_add_left := by rintro ⟨_⟩ ⟨_⟩ hx ⟨_⟩; exact @add_le_add_left PGame _ _ _ _ _ hx _ lemma mk_add {x y : PGame} (hx : x.Numeric) (hy : y.Numeric) : Surreal.mk (x + y) (hx.add hy) = Surreal.mk x hx + Surreal.mk y hy := by rfl lemma mk_sub {x y : PGame} (hx : x.Numeric) (hy : y.Numeric) : Surreal.mk (x - y) (hx.sub hy) = Surreal.mk x hx - Surreal.mk y hy := by rfl lemma zero_def : 0 = mk 0 numeric_zero := by rfl noncomputable instance : LinearOrder Surreal := { Surreal.partialOrder with le_total := by rintro ⟨⟨x, ox⟩⟩ ⟨⟨y, oy⟩⟩ exact or_iff_not_imp_left.2 fun h => (PGame.not_le.1 h).le oy ox toDecidableLE := Classical.decRel _ } instance : AddMonoidWithOne Surreal := AddMonoidWithOne.unary /-- Casts a `Surreal` number into a `Game`.
zero_toGame : toGame 0 = 0 := rfl @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
zero_toGame
null
one_toGame : toGame 1 = 1 := rfl @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
one_toGame
null
nat_toGame : ∀ n : ℕ, toGame n = n := map_natCast' _ one_toGame
theorem
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
nat_toGame
null
bddAbove_range_of_small {ι : Type*} [Small.{u} ι] (f : ι → Surreal.{u}) : BddAbove (Set.range f) := by induction f using Quotient.induction_on_pi with | _ f let g : ι → PGame.{u} := Subtype.val ∘ f have hg (i) : (g i).Numeric := Subtype.prop _ conv in (⟦f _⟧) => change mk (g i) (hg i) clear_value g clear f let x : PGame.{u} := ⟨Σ i, (g <| (equivShrink.{u} ι).symm i).LeftMoves, PEmpty, fun x ↦ moveLeft _ x.2, PEmpty.elim⟩ refine ⟨mk x (.mk (by simp [x]) (fun _ ↦ (hg _).moveLeft _) (by simp [x])), Set.forall_mem_range.2 fun i ↦ ?_⟩ rw [mk_le_mk, ← (equivShrink ι).symm_apply_apply i, le_iff_forall_lf] simpa [x] using fun j ↦ @moveLeft_lf x ⟨equivShrink ι i, j⟩
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
bddAbove_range_of_small
A small family of surreals is bounded above.
bddAbove_of_small (s : Set Surreal.{u}) [Small.{u} s] : BddAbove s := by simpa using bddAbove_range_of_small (Subtype.val : s → Surreal.{u})
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
bddAbove_of_small
A small set of surreals is bounded above.
bddBelow_range_of_small {ι : Type*} [Small.{u} ι] (f : ι → Surreal.{u}) : BddBelow (Set.range f) := by induction f using Quotient.induction_on_pi with | _ f let g : ι → PGame.{u} := Subtype.val ∘ f have hg (i) : (g i).Numeric := Subtype.prop _ conv in (⟦f _⟧) => change mk (g i) (hg i) clear_value g clear f let x : PGame.{u} := ⟨PEmpty, Σ i, (g <| (equivShrink.{u} ι).symm i).RightMoves, PEmpty.elim, fun x ↦ moveRight _ x.2⟩ refine ⟨mk x (.mk (by simp [x]) (by simp [x]) (fun _ ↦ (hg _).moveRight _) ), Set.forall_mem_range.2 fun i ↦ ?_⟩ rw [mk_le_mk, ← (equivShrink ι).symm_apply_apply i, le_iff_forall_lf] simpa [x] using fun j ↦ @lf_moveRight x ⟨equivShrink ι i, j⟩
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
bddBelow_range_of_small
A small family of surreals is bounded below.
bddBelow_of_small (s : Set Surreal.{u}) [Small.{u} s] : BddBelow s := by simpa using bddBelow_range_of_small (Subtype.val : s → Surreal.{u})
lemma
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
bddBelow_of_small
A small set of surreals is bounded below.
noncomputable toSurreal : Ordinal ↪o Surreal where toFun o := mk _ (numeric_toPGame o) inj' a b h := toPGame_equiv_iff.1 (by apply Quotient.exact h) -- Porting note: Added `by apply` map_rel_iff' := @toPGame_le_iff
def
SetTheory
[ "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.SetTheory.Game.Ordinal", "Mathlib.Tactic.Linter.DeprecatedModule" ]
Mathlib/SetTheory/Surreal/Basic.lean
toSurreal
Converts an ordinal into the corresponding surreal.
powHalf : ℕ → PGame | 0 => 1 | n + 1 => ⟨PUnit, PUnit, 0, fun _ => powHalf n⟩ @[simp]
def
SetTheory
[ "Mathlib.Algebra.Algebra.Defs", "Mathlib.Algebra.Order.Group.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.GroupTheory.MonoidLocalization.Away", "Mathlib.RingTheory.Localization.Defs", "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Surreal.Multiplication", "Mathlib.Tactic.Linarith", "Mathl...
Mathlib/SetTheory/Surreal/Dyadic.lean
powHalf
For a natural number `n`, the pre-game `powHalf (n + 1)` is recursively defined as `{0 | powHalf n}`. These are the explicit expressions of powers of `1 / 2`. By definition, we have `powHalf 0 = 1` and `powHalf 1 ≈ 1 / 2` and we prove later on that `powHalf (n + 1) + powHalf (n + 1) ≈ powHalf n`.
powHalf_zero : powHalf 0 = 1 := rfl
theorem
SetTheory
[ "Mathlib.Algebra.Algebra.Defs", "Mathlib.Algebra.Order.Group.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.GroupTheory.MonoidLocalization.Away", "Mathlib.RingTheory.Localization.Defs", "Mathlib.SetTheory.Game.Birthday", "Mathlib.SetTheory.Surreal.Multiplication", "Mathlib.Tactic.Linarith", "Mathl...
Mathlib/SetTheory/Surreal/Dyadic.lean
powHalf_zero
null