Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 5dabef8

Browse files
vihdzpfpvandoornalreadydonecollares
committed
feat(set_theory/game/basic): Basic lemmas on inv (#13840)
Note that we've redefined `inv` so that `inv x = 0` when `x ≈ 0`. This is because, in order to lift it to an operation on surreals, we need to prove that equivalent numeric games give equivalent numeric values, and this isn't the case otherwise. Co-authored-by: Floris van Doorn <fpvdoorn@gmail.com> Co-authored-by: Junyan Xu <junyanxumath@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>
1 parent 69686e7 commit 5dabef8

File tree

1 file changed

+64
-2
lines changed

1 file changed

+64
-2
lines changed

src/set_theory/game/basic.lean

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ open function pgame
2626
universes u
2727

2828
local infix ` ≈ ` := pgame.equiv
29+
local infix ` ⧏ `:50 := pgame.lf
2930
local infix ` ≡r `:50 := pgame.relabelling
3031

3132
instance pgame.setoid : setoid pgame :=
@@ -501,8 +502,15 @@ inductive inv_ty (l r : Type u) : bool → Type u
501502
| right₁ : l → inv_ty ff → inv_ty tt
502503
| right₂ : r → inv_ty tt → inv_ty tt
503504

505+
instance (l r : Type u) [is_empty l] [is_empty r] : is_empty (inv_ty l r tt) :=
506+
by rintro (_|_|_|a|a); exact is_empty_elim a⟩
507+
504508
instance (l r : Type u) : inhabited (inv_ty l r ff) := ⟨inv_ty.zero⟩
505509

510+
instance unique_inv_ty (l r : Type u) [is_empty l] [is_empty r] : unique (inv_ty l r ff) :=
511+
{ uniq := by { rintro (a|a|a), refl, all_goals { exact is_empty_elim a } },
512+
..inv_ty.inhabited l r }
513+
506514
/-- Because the two halves of the definition of `inv` produce more elements
507515
of each side, we have to define the two families inductively.
508516
This is the function part, defined by recursion on `inv_ty`. -/
@@ -514,6 +522,14 @@ def inv_val {l r} (L : l → pgame) (R : r → pgame)
514522
| _ (inv_ty.right₁ i j) := (1 + (L i - mk l r L R) * inv_val j) * IHl i
515523
| _ (inv_ty.right₂ i j) := (1 + (R i - mk l r L R) * inv_val j) * IHr i
516524

525+
@[simp] theorem inv_val_is_empty {l r : Type u} {b} (L R IHl IHr) (i : inv_ty l r b)
526+
[is_empty l] [is_empty r] : inv_val L R IHl IHr i = 0 :=
527+
begin
528+
cases i with a _ a _ a _ a,
529+
{ refl },
530+
all_goals { exact is_empty_elim a }
531+
end
532+
517533
/-- The inverse of a positive surreal number `x = {L | R}` is
518534
given by `x⁻¹ = {0,
519535
(1 + (R - x) * x⁻¹L) * R, (1 + (L - x) * x⁻¹R) * L |
@@ -529,10 +545,56 @@ def inv' : pgame → pgame
529545
⟨inv_ty l' r ff, inv_ty l' r tt,
530546
inv_val L' R IHl' IHr, inv_val L' R IHl' IHr⟩
531547

532-
/-- The inverse of a surreal number in terms of the inverse on positive surreals. -/
548+
theorem zero_lf_inv' : ∀ (x : pgame), 0 ⧏ inv' x
549+
| ⟨xl, xr, xL, xR⟩ := by { convert lf_mk _ _ inv_ty.zero, refl }
550+
551+
/-- `inv' 0` has exactly the same moves as `1`. -/
552+
def inv'_zero : inv' 0 ≡r 1 :=
553+
begin
554+
change mk _ _ _ _ ≡r 1,
555+
refine ⟨_, _, λ i, _, is_empty_elim⟩; dsimp,
556+
{ apply equiv.equiv_punit },
557+
{ apply equiv.equiv_pempty },
558+
{ simp }
559+
end
560+
561+
theorem inv'_zero_equiv : inv' 01 := inv'_zero.equiv
562+
563+
/-- `inv' 1` has exactly the same moves as `1`. -/
564+
def inv'_one : inv' 1 ≡r (1 : pgame.{u}) :=
565+
begin
566+
change relabelling (mk _ _ _ _) 1,
567+
haveI : is_empty {i : punit.{u+1} // (0 : pgame.{u}) < 0},
568+
{ rw lt_self_iff_false, apply_instance },
569+
refine ⟨_, _, λ i, _, is_empty_elim⟩; dsimp,
570+
{ apply equiv.equiv_punit },
571+
{ apply equiv.equiv_pempty },
572+
{ simp }
573+
end
574+
575+
theorem inv'_one_equiv : inv' 11 := inv'_one.equiv
576+
577+
/-- The inverse of a pre-game in terms of the inverse on positive pre-games. -/
533578
noncomputable instance : has_inv pgame :=
534-
by { classical, exact λ x, if x = 0 then 0 else if 0 < x then inv' x else inv' (-x) }⟩
579+
by { classical, exact λ x, if x 0 then 0 else if 0 < x then inv' x else -inv' (-x) }⟩
535580

536581
noncomputable instance : has_div pgame := ⟨λ x y, x * y⁻¹⟩
537582

583+
theorem inv_eq_of_equiv_zero {x : pgame} (h : x ≈ 0) : x⁻¹ = 0 := if_pos h
584+
585+
@[simp] theorem inv_zero : (0 : pgame)⁻¹ = 0 :=
586+
inv_eq_of_equiv_zero (equiv_refl _)
587+
588+
theorem inv_eq_of_pos {x : pgame} (h : 0 < x) : x⁻¹ = inv' x :=
589+
(if_neg h.lf.not_equiv').trans (if_pos h)
590+
591+
theorem inv_eq_of_lf_zero {x : pgame} (h : x ⧏ 0) : x⁻¹ = -inv' (-x) :=
592+
(if_neg h.not_equiv).trans (if_neg h.not_gt)
593+
594+
/-- `1⁻¹` has exactly the same moves as `1`. -/
595+
def inv_one : 1⁻¹ ≡r 1 :=
596+
by { rw inv_eq_of_pos zero_lt_one, exact inv'_one }
597+
598+
theorem inv_one_equiv : 1⁻¹ ≈ 1 := inv_one.equiv
599+
538600
end pgame

0 commit comments

Comments
 (0)