statement
stringlengths
1
2.88k
proof
stringlengths
0
13.9k
type
stringclasses
10 values
symbolic_name
stringlengths
1
131
library
stringclasses
417 values
filename
stringlengths
17
80
imports
listlengths
0
16
deps
listlengths
0
64
docstring
stringlengths
0
10.2k
source_url
stringclasses
1 value
commit
stringclasses
1 value
mul_assoc_equiv (x y z : pgame) : x * y * z ≈ x * (y * z)
quotient.exact $ quot_mul_assoc _ _ _
theorem
pgame.mul_assoc_equiv
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "pgame" ]
`x * y * z` is equivalent to `x * (y * z).`
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv_ty (l r : Type u) : bool → Type u | zero : inv_ty ff | left₁ : r → inv_ty ff → inv_ty ff | left₂ : l → inv_ty tt → inv_ty ff | right₁ : l → inv_ty ff → inv_ty tt | right₂ : r → inv_ty tt → inv_ty tt
inductive
pgame.inv_ty
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[]
Because the two halves of the definition of `inv` produce more elements on each side, we have to define the two families inductively. This is the indexing set for the function, and `inv_val` is the function part.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
unique_inv_ty (l r : Type u) [is_empty l] [is_empty r] : unique (inv_ty l r ff)
{ uniq := by { rintro (a|a|a), refl, all_goals { exact is_empty_elim a } }, ..inv_ty.inhabited l r }
instance
pgame.unique_inv_ty
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "is_empty", "is_empty_elim", "unique" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv_val {l r} (L : l → pgame) (R : r → pgame) (IHl : l → pgame) (IHr : r → pgame) : ∀ {b}, inv_ty l r b → pgame
| _ inv_ty.zero := 0 | _ (inv_ty.left₁ i j) := (1 + (R i - mk l r L R) * inv_val j) * IHr i | _ (inv_ty.left₂ i j) := (1 + (L i - mk l r L R) * inv_val j) * IHl i | _ (inv_ty.right₁ i j) := (1 + (L i - mk l r L R) * inv_val j) * IHl i | _ (inv_ty.right₂ i j) := (1 + (R i - mk l r L R) * inv_val j) * IHr i
def
pgame.inv_val
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "pgame" ]
Because the two halves of the definition of `inv` produce more elements of each side, we have to define the two families inductively. This is the function part, defined by recursion on `inv_ty`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv_val_is_empty {l r : Type u} {b} (L R IHl IHr) (i : inv_ty l r b) [is_empty l] [is_empty r] : inv_val L R IHl IHr i = 0
begin cases i with a _ a _ a _ a, { refl }, all_goals { exact is_empty_elim a } end
theorem
pgame.inv_val_is_empty
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "is_empty", "is_empty_elim" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv' : pgame → pgame
| ⟨l, r, L, R⟩ := let l' := {i // 0 < L i}, L' : l' → pgame := λ i, L i.1, IHl' : l' → pgame := λ i, inv' (L i.1), IHr := λ i, inv' (R i) in ⟨inv_ty l' r ff, inv_ty l' r tt, inv_val L' R IHl' IHr, inv_val L' R IHl' IHr⟩
def
pgame.inv'
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "pgame" ]
The inverse of a positive surreal number `x = {L | R}` is given by `x⁻¹ = {0, (1 + (R - x) * x⁻¹L) * R, (1 + (L - x) * x⁻¹R) * L | (1 + (L - x) * x⁻¹L) * L, (1 + (R - x) * x⁻¹R) * R}`. Because the two halves `x⁻¹L, x⁻¹R` of `x⁻¹` are used in their own definition, the sets and elements are inductively generated.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
zero_lf_inv' : ∀ (x : pgame), 0 ⧏ inv' x
| ⟨xl, xr, xL, xR⟩ := by { convert lf_mk _ _ inv_ty.zero, refl }
theorem
pgame.zero_lf_inv'
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv'_zero : inv' 0 ≡r 1
begin change mk _ _ _ _ ≡r 1, refine ⟨_, _, λ i, _, is_empty.elim _⟩, { apply equiv.equiv_punit (inv_ty _ _ _), apply_instance }, { apply equiv.equiv_pempty (inv_ty _ _ _), apply_instance }, { simp }, { dsimp, apply_instance } end
def
pgame.inv'_zero
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "equiv.equiv_pempty", "equiv.equiv_punit", "is_empty.elim" ]
`inv' 0` has exactly the same moves as `1`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv'_zero_equiv : inv' 0 ≈ 1
inv'_zero.equiv
theorem
pgame.inv'_zero_equiv
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv'_one : inv' 1 ≡r (1 : pgame.{u})
begin change relabelling (mk _ _ _ _) 1, haveI : is_empty {i : punit.{u+1} // (0 : pgame.{u}) < 0}, { rw lt_self_iff_false, apply_instance }, refine ⟨_, _, λ i, _, is_empty.elim _⟩; dsimp, { apply equiv.equiv_punit }, { apply equiv.equiv_of_is_empty }, { simp }, { apply_instance } end
def
pgame.inv'_one
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "equiv.equiv_of_is_empty", "equiv.equiv_punit", "is_empty", "is_empty.elim", "lt_self_iff_false" ]
`inv' 1` has exactly the same moves as `1`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv'_one_equiv : inv' 1 ≈ 1
inv'_one.equiv
theorem
pgame.inv'_one_equiv
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv_eq_of_equiv_zero {x : pgame} (h : x ≈ 0) : x⁻¹ = 0
by { classical, exact if_pos h }
theorem
pgame.inv_eq_of_equiv_zero
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv_zero : (0 : pgame)⁻¹ = 0
inv_eq_of_equiv_zero (equiv_refl _)
theorem
pgame.inv_zero
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "inv_zero", "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv_eq_of_pos {x : pgame} (h : 0 < x) : x⁻¹ = inv' x
by { classical, exact (if_neg h.lf.not_equiv').trans (if_pos h) }
theorem
pgame.inv_eq_of_pos
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv_eq_of_lf_zero {x : pgame} (h : x ⧏ 0) : x⁻¹ = -inv' (-x)
by { classical, exact (if_neg h.not_equiv).trans (if_neg h.not_gt) }
theorem
pgame.inv_eq_of_lf_zero
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv_one : 1⁻¹ ≡r 1
by { rw inv_eq_of_pos pgame.zero_lt_one, exact inv'_one }
def
pgame.inv_one
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[ "inv_one", "pgame.zero_lt_one" ]
`1⁻¹` has exactly the same moves as `1`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
inv_one_equiv : 1⁻¹ ≈ 1
inv_one.equiv
theorem
pgame.inv_one_equiv
set_theory.game
src/set_theory/game/basic.lean
[ "set_theory.game.pgame", "tactic.abel" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday : pgame.{u} → ordinal.{u}
| ⟨xl, xr, xL, xR⟩ := max (lsub.{u u} $ λ i, birthday (xL i)) (lsub.{u u} $ λ i, birthday (xR i))
def
pgame.birthday
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
The birthday of a pre-game is inductively defined as the least strict upper bound of the birthdays of its left and right games. It may be thought as the "step" in which a certain game is constructed.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_def (x : pgame) : birthday x = max (lsub.{u u} (λ i, birthday (x.move_left i))) (lsub.{u u} (λ i, birthday (x.move_right i)))
by { cases x, rw birthday, refl }
theorem
pgame.birthday_def
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_move_left_lt {x : pgame} (i : x.left_moves) : (x.move_left i).birthday < x.birthday
by { cases x, rw birthday, exact lt_max_of_lt_left (lt_lsub _ i) }
theorem
pgame.birthday_move_left_lt
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "lt_max_of_lt_left", "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_move_right_lt {x : pgame} (i : x.right_moves) : (x.move_right i).birthday < x.birthday
by { cases x, rw birthday, exact lt_max_of_lt_right (lt_lsub _ i) }
theorem
pgame.birthday_move_right_lt
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "lt_max_of_lt_right", "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_birthday_iff {x : pgame} {o : ordinal} : o < x.birthday ↔ (∃ i : x.left_moves, o ≤ (x.move_left i).birthday) ∨ (∃ i : x.right_moves, o ≤ (x.move_right i).birthday)
begin split, { rw birthday_def, intro h, cases lt_max_iff.1 h with h' h', { left, rwa lt_lsub_iff at h' }, { right, rwa lt_lsub_iff at h' } }, { rintro (⟨i, hi⟩ | ⟨i, hi⟩), { exact hi.trans_lt (birthday_move_left_lt i) }, { exact hi.trans_lt (birthday_move_right_lt i) } } end
theorem
pgame.lt_birthday_iff
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "ordinal", "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
relabelling.birthday_congr : ∀ {x y : pgame.{u}}, x ≡r y → birthday x = birthday y
| ⟨xl, xr, xL, xR⟩ ⟨yl, yr, yL, yR⟩ r := begin unfold birthday, congr' 1, all_goals { apply lsub_eq_of_range_eq.{u u u}, ext i, split }, all_goals { rintro ⟨j, rfl⟩ }, { exact ⟨_, (r.move_left j).birthday_congr.symm⟩ }, { exact ⟨_, (r.move_left_symm j).birthday_congr⟩ }, { exact ⟨_, (r.move_right j)...
theorem
pgame.relabelling.birthday_congr
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_eq_zero {x : pgame} : birthday x = 0 ↔ is_empty x.left_moves ∧ is_empty x.right_moves
by rw [birthday_def, max_eq_zero, lsub_eq_zero_iff, lsub_eq_zero_iff]
theorem
pgame.birthday_eq_zero
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "is_empty", "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_zero : birthday 0 = 0
by simp [pempty.is_empty]
theorem
pgame.birthday_zero
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_one : birthday 1 = 1
by { rw birthday_def, simp }
theorem
pgame.birthday_one
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_star : birthday star = 1
by { rw birthday_def, simp }
theorem
pgame.birthday_star
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
neg_birthday : ∀ x : pgame, (-x).birthday = x.birthday
| ⟨xl, xr, xL, xR⟩ := begin rw [birthday_def, birthday_def, max_comm], congr; funext; apply neg_birthday end
theorem
pgame.neg_birthday
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_pgame_birthday (o : ordinal) : o.to_pgame.birthday = o
begin induction o using ordinal.induction with o IH, rw [to_pgame_def, pgame.birthday], simp only [lsub_empty, max_zero_right], nth_rewrite 0 ←lsub_typein o, congr' with x, exact IH _ (typein_lt_self x) end
theorem
pgame.to_pgame_birthday
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "ordinal", "ordinal.induction", "pgame.birthday" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_birthday : ∀ x : pgame, x ≤ x.birthday.to_pgame
| ⟨xl, _, xL, _⟩ := le_def.2 ⟨λ i, or.inl ⟨to_left_moves_to_pgame ⟨_, birthday_move_left_lt i⟩, by simp [le_birthday (xL i)]⟩, is_empty_elim⟩
theorem
pgame.le_birthday
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
neg_birthday_le : -x.birthday.to_pgame ≤ x
by simpa only [neg_birthday, ←neg_le_iff] using le_birthday (-x)
theorem
pgame.neg_birthday_le
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_add : ∀ x y : pgame.{u}, (x + y).birthday = x.birthday ♯ y.birthday
| ⟨xl, xr, xL, xR⟩ ⟨yl, yr, yL, yR⟩ := begin rw [birthday_def, nadd_def], simp only [birthday_add, lsub_sum, mk_add_move_left_inl, move_left_mk, mk_add_move_left_inr, mk_add_move_right_inl, move_right_mk, mk_add_move_right_inr], rw max_max_max_comm, congr; apply le_antisymm, any_goals { exact max_le_iff...
theorem
pgame.birthday_add
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "lt_max_of_lt_left", "lt_max_of_lt_right", "max_max_max_comm" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_add_zero : (a + 0).birthday = a.birthday
by simp
theorem
pgame.birthday_add_zero
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_zero_add : (0 + a).birthday = a.birthday
by simp
theorem
pgame.birthday_zero_add
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_add_one : (a + 1).birthday = order.succ a.birthday
by simp
theorem
pgame.birthday_add_one
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "order.succ" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_one_add : (1 + a).birthday = order.succ a.birthday
by simp
theorem
pgame.birthday_one_add
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[ "order.succ" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_nat_cast : ∀ n : ℕ, birthday n = n
| 0 := birthday_zero | (n + 1) := by simp [birthday_nat_cast]
theorem
pgame.birthday_nat_cast
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_add_nat (n : ℕ) : (a + n).birthday = a.birthday + n
by simp
theorem
pgame.birthday_add_nat
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
birthday_nat_add (n : ℕ) : (↑n + a).birthday = a.birthday + n
by simp
theorem
pgame.birthday_nat_add
set_theory.game
src/set_theory/game/birthday.lean
[ "set_theory.game.ordinal", "set_theory.ordinal.natural_ops" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
shift_up : ℤ × ℤ ≃ ℤ × ℤ
(equiv.refl ℤ).prod_congr (equiv.add_right (1 : ℤ))
def
pgame.domineering.shift_up
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "equiv.refl" ]
The equivalence `(x, y) ↦ (x, y+1)`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
shift_right : ℤ × ℤ ≃ ℤ × ℤ
(equiv.add_right (1 : ℤ)).prod_congr (equiv.refl ℤ)
def
pgame.domineering.shift_right
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "equiv.refl" ]
The equivalence `(x, y) ↦ (x+1, y)`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
board
finset (ℤ × ℤ)
def
pgame.domineering.board
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset" ]
A Domineering board is an arbitrary finite subset of `ℤ × ℤ`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
left (b : board) : finset (ℤ × ℤ)
b ∩ b.map shift_up
def
pgame.domineering.left
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset" ]
Left can play anywhere that a square and the square below it are open.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
right (b : board) : finset (ℤ × ℤ)
b ∩ b.map shift_right
def
pgame.domineering.right
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset" ]
Right can play anywhere that a square and the square to the left are open.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
mem_left {b : board} (x : ℤ × ℤ) : x ∈ left b ↔ x ∈ b ∧ (x.1, x.2 - 1) ∈ b
finset.mem_inter.trans (and_congr iff.rfl finset.mem_map_equiv)
lemma
pgame.domineering.mem_left
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.mem_map_equiv" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
mem_right {b : board} (x : ℤ × ℤ) : x ∈ right b ↔ x ∈ b ∧ (x.1 - 1, x.2) ∈ b
finset.mem_inter.trans (and_congr iff.rfl finset.mem_map_equiv)
lemma
pgame.domineering.mem_right
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.mem_map_equiv" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
move_left (b : board) (m : ℤ × ℤ) : board
(b.erase m).erase (m.1, m.2 - 1)
def
pgame.domineering.move_left
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[]
After Left moves, two vertically adjacent squares are removed from the board.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
move_right (b : board) (m : ℤ × ℤ) : board
(b.erase m).erase (m.1 - 1, m.2)
def
pgame.domineering.move_right
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[]
After Left moves, two horizontally adjacent squares are removed from the board.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fst_pred_mem_erase_of_mem_right {b : board} {m : ℤ × ℤ} (h : m ∈ right b) : (m.1 - 1, m.2) ∈ b.erase m
begin rw mem_right at h, apply finset.mem_erase_of_ne_of_mem _ h.2, exact ne_of_apply_ne prod.fst (pred_ne_self m.1), end
lemma
pgame.domineering.fst_pred_mem_erase_of_mem_right
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.mem_erase_of_ne_of_mem", "ne_of_apply_ne", "pred_ne_self" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
snd_pred_mem_erase_of_mem_left {b : board} {m : ℤ × ℤ} (h : m ∈ left b) : (m.1, m.2 - 1) ∈ b.erase m
begin rw mem_left at h, apply finset.mem_erase_of_ne_of_mem _ h.2, exact ne_of_apply_ne prod.snd (pred_ne_self m.2), end
lemma
pgame.domineering.snd_pred_mem_erase_of_mem_left
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.mem_erase_of_ne_of_mem", "ne_of_apply_ne", "pred_ne_self" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
card_of_mem_left {b : board} {m : ℤ × ℤ} (h : m ∈ left b) : 2 ≤ finset.card b
begin have w₁ : m ∈ b := (finset.mem_inter.1 h).1, have w₂ : (m.1, m.2 - 1) ∈ b.erase m := snd_pred_mem_erase_of_mem_left h, have i₁ := finset.card_erase_lt_of_mem w₁, have i₂ := nat.lt_of_le_of_lt (nat.zero_le _) (finset.card_erase_lt_of_mem w₂), exact nat.lt_of_le_of_lt i₂ i₁, end
lemma
pgame.domineering.card_of_mem_left
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.card", "finset.card_erase_lt_of_mem" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
card_of_mem_right {b : board} {m : ℤ × ℤ} (h : m ∈ right b) : 2 ≤ finset.card b
begin have w₁ : m ∈ b := (finset.mem_inter.1 h).1, have w₂ := fst_pred_mem_erase_of_mem_right h, have i₁ := finset.card_erase_lt_of_mem w₁, have i₂ := nat.lt_of_le_of_lt (nat.zero_le _) (finset.card_erase_lt_of_mem w₂), exact nat.lt_of_le_of_lt i₂ i₁, end
lemma
pgame.domineering.card_of_mem_right
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.card", "finset.card_erase_lt_of_mem" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
move_left_card {b : board} {m : ℤ × ℤ} (h : m ∈ left b) : finset.card (move_left b m) + 2 = finset.card b
begin dsimp [move_left], rw finset.card_erase_of_mem (snd_pred_mem_erase_of_mem_left h), rw finset.card_erase_of_mem (finset.mem_of_mem_inter_left h), exact tsub_add_cancel_of_le (card_of_mem_left h), end
lemma
pgame.domineering.move_left_card
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.card", "finset.card_erase_of_mem", "finset.mem_of_mem_inter_left", "tsub_add_cancel_of_le" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
move_right_card {b : board} {m : ℤ × ℤ} (h : m ∈ right b) : finset.card (move_right b m) + 2 = finset.card b
begin dsimp [move_right], rw finset.card_erase_of_mem (fst_pred_mem_erase_of_mem_right h), rw finset.card_erase_of_mem (finset.mem_of_mem_inter_left h), exact tsub_add_cancel_of_le (card_of_mem_right h), end
lemma
pgame.domineering.move_right_card
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.card", "finset.card_erase_of_mem", "finset.mem_of_mem_inter_left", "tsub_add_cancel_of_le" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
move_left_smaller {b : board} {m : ℤ × ℤ} (h : m ∈ left b) : finset.card (move_left b m) / 2 < finset.card b / 2
by simp [←move_left_card h, lt_add_one]
lemma
pgame.domineering.move_left_smaller
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.card", "lt_add_one" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
move_right_smaller {b : board} {m : ℤ × ℤ} (h : m ∈ right b) : finset.card (move_right b m) / 2 < finset.card b / 2
by simp [←move_right_card h, lt_add_one]
lemma
pgame.domineering.move_right_smaller
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.card", "lt_add_one" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
state : state board
{ turn_bound := λ s, s.card / 2, L := λ s, (left s).image (move_left s), R := λ s, (right s).image (move_right s), left_bound := λ s t m, begin simp only [finset.mem_image, prod.exists] at m, rcases m with ⟨_, _, ⟨h, rfl⟩⟩, exact move_left_smaller h end, right_bound := λ s t m, begin simp ...
instance
pgame.domineering.state
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "finset.mem_image" ]
The instance describing allowed moves on a Domineering board.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
domineering (b : domineering.board) : pgame
pgame.of_state b
def
pgame.domineering
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[ "pgame", "pgame.of_state" ]
Construct a pre-game from a Domineering board.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
short_domineering (b : domineering.board) : short (domineering b)
by { dsimp [domineering], apply_instance }
instance
pgame.short_domineering
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[]
All games of Domineering are short, because each move removes two squares.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
domineering.one
domineering ([(0,0), (0,1)].to_finset)
def
pgame.domineering.one
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[]
The Domineering board with two squares arranged vertically, in which Left has the only move.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
domineering.L
domineering ([(0,2), (0,1), (0,0), (1,0)].to_finset)
def
pgame.domineering.L
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[]
The `L` shaped Domineering board, in which Left is exactly half a move ahead.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
short_one : short domineering.one
by { dsimp [domineering.one], apply_instance }
instance
pgame.short_one
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
short_L : short domineering.L
by { dsimp [domineering.L], apply_instance }
instance
pgame.short_L
set_theory.game
src/set_theory/game/domineering.lean
[ "set_theory.game.state" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
impartial_aux : pgame → Prop
| G := G ≈ -G ∧ (∀ i, impartial_aux (G.move_left i)) ∧ ∀ j, impartial_aux (G.move_right j) using_well_founded { dec_tac := pgame_wf_tac }
def
pgame.impartial_aux
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
The definition for a impartial game, defined using Conway induction.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
impartial_aux_def {G : pgame} : G.impartial_aux ↔ G ≈ -G ∧ (∀ i, impartial_aux (G.move_left i)) ∧ ∀ j, impartial_aux (G.move_right j)
by rw impartial_aux
lemma
pgame.impartial_aux_def
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
impartial (G : pgame) : Prop
(out : impartial_aux G)
class
pgame.impartial
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
A typeclass on impartial games.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
impartial_iff_aux {G : pgame} : G.impartial ↔ G.impartial_aux
⟨λ h, h.1, λ h, ⟨h⟩⟩
lemma
pgame.impartial_iff_aux
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
impartial_def {G : pgame} : G.impartial ↔ G ≈ -G ∧ (∀ i, impartial (G.move_left i)) ∧ ∀ j, impartial (G.move_right j)
by simpa only [impartial_iff_aux] using impartial_aux_def
lemma
pgame.impartial_def
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
impartial_zero : impartial 0
by { rw impartial_def, dsimp, simp }
instance
pgame.impartial.impartial_zero
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
impartial_star : impartial star
by { rw impartial_def, simpa using impartial.impartial_zero }
instance
pgame.impartial.impartial_star
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
neg_equiv_self (G : pgame) [h : G.impartial] : G ≈ -G
(impartial_def.1 h).1
lemma
pgame.impartial.neg_equiv_self
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
mk_neg_equiv_self (G : pgame) [h : G.impartial] : -⟦G⟧ = ⟦G⟧
quot.sound (neg_equiv_self G).symm
lemma
pgame.impartial.mk_neg_equiv_self
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
move_left_impartial {G : pgame} [h : G.impartial] (i : G.left_moves) : (G.move_left i).impartial
(impartial_def.1 h).2.1 i
instance
pgame.impartial.move_left_impartial
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
move_right_impartial {G : pgame} [h : G.impartial] (j : G.right_moves) : (G.move_right j).impartial
(impartial_def.1 h).2.2 j
instance
pgame.impartial.move_right_impartial
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
impartial_congr : ∀ {G H : pgame} (e : G ≡r H) [G.impartial], H.impartial
| G H := λ e, begin introI h, exact impartial_def.2 ⟨e.symm.equiv.trans ((neg_equiv_self G).trans (neg_equiv_neg_iff.2 e.equiv)), λ i, impartial_congr (e.move_left_symm i), λ j, impartial_congr (e.move_right_symm j)⟩ end using_well_founded { dec_tac := pgame_wf_tac }
theorem
pgame.impartial.impartial_congr
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
impartial_add : ∀ (G H : pgame) [G.impartial] [H.impartial], (G + H).impartial
| G H := begin introsI hG hH, rw impartial_def, refine ⟨(add_congr (neg_equiv_self _) (neg_equiv_self _)).trans (neg_add_relabelling _ _).equiv.symm, λ k, _, λ k, _⟩, { apply left_moves_add_cases k, all_goals { intro i, simp only [add_move_left_inl, add_move_left_inr], apply impartial_add } },...
instance
pgame.impartial.impartial_add
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "equiv.symm", "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
impartial_neg : ∀ (G : pgame) [G.impartial], (-G).impartial
| G := begin introI hG, rw impartial_def, refine ⟨_, λ i, _, λ i, _⟩, { rw neg_neg, exact (neg_equiv_self G).symm }, { rw move_left_neg', apply impartial_neg }, { rw move_right_neg', apply impartial_neg } end using_well_founded { dec_tac := pgame_wf_tac }
instance
pgame.impartial.impartial_neg
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nonpos : ¬ 0 < G
λ h, begin 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 end
lemma
pgame.impartial.nonpos
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nonneg : ¬ G < 0
λ h, begin 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 end
lemma
pgame.impartial.nonneg
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
equiv_or_fuzzy_zero : G ≈ 0 ∨ G ‖ 0
begin 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 } end
lemma
pgame.impartial.equiv_or_fuzzy_zero
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
In an impartial game, either the first player always wins, or the second player always wins.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
not_equiv_zero_iff : ¬ G ≈ 0 ↔ G ‖ 0
⟨(equiv_or_fuzzy_zero G).resolve_left, fuzzy.not_equiv⟩
lemma
pgame.impartial.not_equiv_zero_iff
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
not_fuzzy_zero_iff : ¬ G ‖ 0 ↔ G ≈ 0
⟨(equiv_or_fuzzy_zero G).resolve_right, equiv.not_fuzzy⟩
lemma
pgame.impartial.not_fuzzy_zero_iff
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_self : G + G ≈ 0
(add_congr_left (neg_equiv_self G)).trans (add_left_neg_equiv G)
lemma
pgame.impartial.add_self
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "add_self" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
mk_add_self : ⟦G⟧ + ⟦G⟧ = 0
quot.sound (add_self G)
lemma
pgame.impartial.mk_add_self
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "add_self" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
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 }
lemma
pgame.impartial.equiv_iff_add_equiv_zero
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
This lemma doesn't require `H` to be impartial.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
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 }
lemma
pgame.impartial.equiv_iff_add_equiv_zero'
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
This lemma doesn't require `H` to be impartial.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_zero_iff {G : pgame} [G.impartial] : G ≤ 0 ↔ 0 ≤ G
by rw [←zero_le_neg_iff, le_congr_right (neg_equiv_self G)]
lemma
pgame.impartial.le_zero_iff
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "le_zero_iff", "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lf_zero_iff {G : pgame} [G.impartial] : G ⧏ 0 ↔ 0 ⧏ G
by rw [←zero_lf_neg_iff, lf_congr_right (neg_equiv_self G)]
lemma
pgame.impartial.lf_zero_iff
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[ "pgame" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
equiv_zero_iff_le: G ≈ 0 ↔ G ≤ 0
⟨and.left, λ h, ⟨h, le_zero_iff.1 h⟩⟩
lemma
pgame.impartial.equiv_zero_iff_le
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fuzzy_zero_iff_lf : G ‖ 0 ↔ G ⧏ 0
⟨and.left, λ h, ⟨h, lf_zero_iff.1 h⟩⟩
lemma
pgame.impartial.fuzzy_zero_iff_lf
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
equiv_zero_iff_ge : G ≈ 0 ↔ 0 ≤ G
⟨and.right, λ h, ⟨le_zero_iff.2 h, h⟩⟩
lemma
pgame.impartial.equiv_zero_iff_ge
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fuzzy_zero_iff_gf : G ‖ 0 ↔ 0 ⧏ G
⟨and.right, λ h, ⟨lf_zero_iff.2 h, h⟩⟩
lemma
pgame.impartial.fuzzy_zero_iff_gf
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
forall_left_moves_fuzzy_iff_equiv_zero : (∀ i, G.move_left i ‖ 0) ↔ G ≈ 0
begin refine ⟨λ hb, _, λ hp i, _⟩, { rw [equiv_zero_iff_le G, le_zero_lf], exact λ i, (hb i).1 }, { rw fuzzy_zero_iff_lf, exact hp.1.move_left_lf i } end
lemma
pgame.impartial.forall_left_moves_fuzzy_iff_equiv_zero
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
forall_right_moves_fuzzy_iff_equiv_zero : (∀ j, G.move_right j ‖ 0) ↔ G ≈ 0
begin refine ⟨λ hb, _, λ hp i, _⟩, { rw [equiv_zero_iff_ge G, zero_le_lf], exact λ i, (hb i).2 }, { rw fuzzy_zero_iff_gf, exact hp.2.lf_move_right i } end
lemma
pgame.impartial.forall_right_moves_fuzzy_iff_equiv_zero
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.move_left i ≈ 0) ↔ G ‖ 0
begin refine ⟨λ ⟨i, hi⟩, (fuzzy_zero_iff_gf G).2 (lf_of_le_move_left hi.2), λ 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⟩ end
lemma
pgame.impartial.exists_left_move_equiv_iff_fuzzy_zero
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.move_right j ≈ 0) ↔ G ‖ 0
begin refine ⟨λ ⟨i, hi⟩, (fuzzy_zero_iff_lf G).2 (lf_of_move_right_le hi.1), λ 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⟩ end
lemma
pgame.impartial.exists_right_move_equiv_iff_fuzzy_zero
set_theory.game
src/set_theory/game/impartial.lean
[ "set_theory.game.basic", "tactic.nth_rewrite" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nim_def (o : ordinal) : nim o = pgame.mk o.out.α o.out.α (λ o₂, nim (ordinal.typein (<) o₂)) (λ o₂, nim (ordinal.typein (<) o₂))
by { rw nim, refl }
lemma
pgame.nim_def
set_theory.game
src/set_theory/game/nim.lean
[ "data.nat.bitwise", "set_theory.game.birthday", "set_theory.game.impartial" ]
[ "ordinal", "ordinal.typein" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
left_moves_nim (o : ordinal) : (nim o).left_moves = o.out.α
by { rw nim_def, refl }
lemma
pgame.left_moves_nim
set_theory.game
src/set_theory/game/nim.lean
[ "data.nat.bitwise", "set_theory.game.birthday", "set_theory.game.impartial" ]
[ "ordinal" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
right_moves_nim (o : ordinal) : (nim o).right_moves = o.out.α
by { rw nim_def, refl }
lemma
pgame.right_moves_nim
set_theory.game
src/set_theory/game/nim.lean
[ "data.nat.bitwise", "set_theory.game.birthday", "set_theory.game.impartial" ]
[ "ordinal" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
move_left_nim_heq (o : ordinal) : (nim o).move_left == λ i : o.out.α, nim (typein (<) i)
by { rw nim_def, refl }
lemma
pgame.move_left_nim_heq
set_theory.game
src/set_theory/game/nim.lean
[ "data.nat.bitwise", "set_theory.game.birthday", "set_theory.game.impartial" ]
[ "ordinal" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83