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

Commit 68dc07f

Browse files
committed
refactor(set_theory/game/pgame): rename and add theorems like -y ≤ -x ↔ x ≤ y (#14653)
For `*` in `le`, `lf`, `lt`, we rename `neg_*_iff : -y * -x ↔ x * y` to `neg_*_neg_iff`, and add the theorems `neg_*_iff : -y * x ↔ x * -y`. We further add many missing corresponding theorems for equivalence and fuzziness.
1 parent a912392 commit 68dc07f

File tree

5 files changed

+69
-30
lines changed

5 files changed

+69
-30
lines changed

src/set_theory/game/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace game
4444

4545
instance : add_comm_group game :=
4646
{ zero := ⟦0⟧,
47-
neg := quot.lift (λ x, ⟦-x⟧) (λ x y h, quot.sound (@neg_congr x y h)),
47+
neg := quot.lift (λ x, ⟦-x⟧) (λ x y h, quot.sound ((@neg_equiv_neg_iff x y).2 h)),
4848
add := quotient.lift₂ (λ x y : pgame, ⟦x + y⟧)
4949
(λ x₁ y₁ x₂ y₂ hx hy, quot.sound (pgame.add_congr hx hy)),
5050
add_zero := by { rintro ⟨x⟩, exact quot.sound (add_zero_equiv x) },

src/set_theory/game/birthday.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,6 @@ le_def.2 ⟨λ i, or.inl ⟨to_left_moves_to_pgame ⟨_, birthday_move_left_lt i
135135
by simp [le_birthday (xL i)]⟩, is_empty_elim⟩
136136

137137
theorem neg_birthday_le (x : pgame) : -x.birthday.to_pgame ≤ x :=
138-
let h := le_birthday (-x) in by rwa [neg_birthday, neg_le_iff, neg_neg] at h
138+
let h := le_birthday (-x) in by rwa [neg_birthday, neg_le_iff] at h
139139

140140
end pgame

src/set_theory/game/impartial.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ theorem impartial_congr : ∀ {G H : pgame} (e : relabelling G H) [G.impartial],
6363
| G H e := begin
6464
introI h,
6565
rw impartial_def,
66-
refine ⟨e.symm.equiv.trans ((neg_equiv_self G).trans (neg_congr e.equiv)),
66+
refine ⟨e.symm.equiv.trans ((neg_equiv_self G).trans (neg_equiv_neg_iff.2 e.equiv)),
6767
λ i, _, λ j, _⟩;
6868
cases e with _ _ L R hL hR,
6969
{ convert impartial_congr (hL (L.symm i)),
@@ -107,14 +107,14 @@ using_well_founded { dec_tac := pgame_wf_tac }
107107

108108
lemma nonpos (G : pgame) [G.impartial] : ¬ 0 < G :=
109109
λ h, begin
110-
have h' := neg_lt_iff.2 h,
110+
have h' := neg_lt_neg_iff.2 h,
111111
rw [pgame.neg_zero, lt_congr_left (neg_equiv_self G).symm] at h',
112112
exact (h.trans h').false
113113
end
114114

115115
lemma nonneg (G : pgame) [G.impartial] : ¬ G < 0 :=
116116
λ h, begin
117-
have h' := neg_lt_iff.2 h,
117+
have h' := neg_lt_neg_iff.2 h,
118118
rw [pgame.neg_zero, lt_congr_right (neg_equiv_self G).symm] at h',
119119
exact (h.trans h').false
120120
end

src/set_theory/game/pgame.lean

Lines changed: 62 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -899,58 +899,97 @@ def relabelling.neg_congr : ∀ {x y : pgame}, x.relabelling y → (-x).relabell
899899
λ i, relabelling.neg_congr (by simpa using R_relabelling (R_equiv i)),
900900
λ i, relabelling.neg_congr (by simpa using L_relabelling (L_equiv.symm i))⟩
901901

902-
@[simp] theorem neg_le_iff : Π {x y : pgame}, -y ≤ -x ↔ x ≤ y
902+
@[simp] theorem neg_le_neg_iff : Π {x y : pgame}, -y ≤ -x ↔ x ≤ y
903903
| (mk xl xr xL xR) (mk yl yr yL yR) :=
904904
begin
905905
rw [le_def, le_def], dsimp,
906906
refine ⟨λ h, ⟨λ i, _, λ j, _⟩, λ h, ⟨λ i, _, λ j, _⟩⟩,
907907
{ rcases h.right i with ⟨w, h⟩ | ⟨w, h⟩,
908-
{ refine or.inr ⟨to_left_moves_neg.symm w, neg_le_iff.1 _⟩,
908+
{ refine or.inr ⟨to_left_moves_neg.symm w, neg_le_neg_iff.1 _⟩,
909909
rwa [move_right_neg_symm, neg_neg] },
910-
{ exact or.inl ⟨w, neg_le_iff.1 h⟩ } },
910+
{ exact or.inl ⟨w, neg_le_neg_iff.1 h⟩ } },
911911
{ rcases h.left j with ⟨w, h⟩ | ⟨w, h⟩,
912-
{ exact or.inr ⟨w, neg_le_iff.1 h⟩ },
913-
{ refine or.inl ⟨to_right_moves_neg.symm w, neg_le_iff.1 _⟩,
912+
{ exact or.inr ⟨w, neg_le_neg_iff.1 h⟩ },
913+
{ refine or.inl ⟨to_right_moves_neg.symm w, neg_le_neg_iff.1 _⟩,
914914
rwa [move_left_neg_symm, neg_neg] } },
915915
{ rcases h.right i with ⟨w, h⟩ | ⟨w, h⟩,
916916
{ refine or.inr ⟨to_right_moves_neg w, _⟩,
917-
convert neg_le_iff.2 h,
917+
convert neg_le_neg_iff.2 h,
918918
rw move_right_neg },
919-
{ exact or.inl ⟨w, neg_le_iff.2 h⟩ } },
919+
{ exact or.inl ⟨w, neg_le_neg_iff.2 h⟩ } },
920920
{ rcases h.left j with ⟨w, h⟩ | ⟨w, h⟩,
921-
{ exact or.inr ⟨w, neg_le_iff.2 h⟩ },
921+
{ exact or.inr ⟨w, neg_le_neg_iff.2 h⟩ },
922922
{ refine or.inl ⟨to_left_moves_neg w, _⟩,
923-
convert neg_le_iff.2 h,
923+
convert neg_le_neg_iff.2 h,
924924
rw move_left_neg } }
925925
end
926926
using_well_founded { dec_tac := pgame_wf_tac }
927927

928-
theorem neg_congr {x y : pgame} (h : x ≈ y) : -x ≈ -y :=
929-
⟨neg_le_iff.2 h.2, neg_le_iff.2 h.1
928+
@[simp] theorem neg_lf_neg_iff {x y : pgame} : -y ⧏ -x ↔ x ⧏ y :=
929+
by rw [←pgame.not_le, ←pgame.not_le, not_iff_not, neg_le_neg_iff]
930930

931-
@[simp] theorem neg_lf_iff {x y : pgame} : -y -x ↔ x y :=
932-
by rw [←pgame.not_le, ←pgame.not_le, not_iff_not, neg_le_iff]
931+
@[simp] theorem neg_lt_neg_iff {x y : pgame} : -y < -x ↔ x < y :=
932+
by rw [lt_iff_le_and_lf, lt_iff_le_and_lf, neg_le_neg_iff, neg_lf_neg_iff]
933933

934-
@[simp] theorem neg_lt_iff {x y : pgame} : -y < -x ↔ x < y :=
935-
by rw [lt_iff_le_and_lf, lt_iff_le_and_lf, neg_le_iff, neg_lf_iff]
934+
@[simp] theorem neg_equiv_neg_iff {x y : pgame} : -x ≈ -y ↔ x ≈ y :=
935+
by rw [equiv, equiv, neg_le_neg_iff, neg_le_neg_iff, and.comm]
936+
937+
@[simp] theorem neg_fuzzy_neg_iff {x y : pgame} : -x ∥ -y ↔ x ∥ y :=
938+
by rw [fuzzy, fuzzy, neg_lf_neg_iff, neg_lf_neg_iff, and.comm]
939+
940+
theorem neg_le_iff {x y : pgame} : -y ≤ x ↔ -x ≤ y :=
941+
by rw [←neg_neg x, neg_le_neg_iff, neg_neg]
942+
943+
theorem neg_lf_iff {x y : pgame} : -y ⧏ x ↔ -x ⧏ y :=
944+
by rw [←neg_neg x, neg_lf_neg_iff, neg_neg]
945+
946+
theorem neg_lt_iff {x y : pgame} : -y < x ↔ -x < y :=
947+
by rw [←neg_neg x, neg_lt_neg_iff, neg_neg]
948+
949+
theorem neg_equiv_iff {x y : pgame} : -x ≈ y ↔ x ≈ -y :=
950+
by rw [←neg_neg y, neg_equiv_neg_iff, neg_neg]
951+
952+
theorem neg_fuzzy_iff {x y : pgame} : -x ∥ y ↔ x ∥ -y :=
953+
by rw [←neg_neg y, neg_fuzzy_neg_iff, neg_neg]
954+
955+
theorem le_neg_iff {x y : pgame} : y ≤ -x ↔ x ≤ -y :=
956+
by rw [←neg_neg x, neg_le_neg_iff, neg_neg]
957+
958+
theorem lf_neg_iff {x y : pgame} : y ⧏ -x ↔ x ⧏ -y :=
959+
by rw [←neg_neg x, neg_lf_neg_iff, neg_neg]
960+
961+
theorem lt_neg_iff {x y : pgame} : y < -x ↔ x < -y :=
962+
by rw [←neg_neg x, neg_lt_neg_iff, neg_neg]
936963

937964
@[simp] theorem neg_le_zero_iff {x : pgame} : -x ≤ 00 ≤ x :=
938-
by { convert neg_le_iff, rw pgame.neg_zero }
965+
by rw [neg_le_iff, pgame.neg_zero]
939966

940967
@[simp] theorem zero_le_neg_iff {x : pgame} : 0 ≤ -x ↔ x ≤ 0 :=
941-
by { convert neg_le_iff, rw pgame.neg_zero }
968+
by rw [le_neg_iff, pgame.neg_zero]
942969

943970
@[simp] theorem neg_lf_zero_iff {x : pgame} : -x ⧏ 00 ⧏ x :=
944-
by { convert neg_lf_iff, rw pgame.neg_zero }
971+
by rw [neg_lf_iff, pgame.neg_zero]
945972

946973
@[simp] theorem zero_lf_neg_iff {x : pgame} : 0 ⧏ -x ↔ x ⧏ 0 :=
947-
by { convert neg_lf_iff, rw pgame.neg_zero }
974+
by rw [lf_neg_iff, pgame.neg_zero]
948975

949976
@[simp] theorem neg_lt_zero_iff {x : pgame} : -x < 00 < x :=
950-
by { convert neg_lt_iff, rw pgame.neg_zero }
977+
by rw [neg_lt_iff, pgame.neg_zero]
951978

952979
@[simp] theorem zero_lt_neg_iff {x : pgame} : 0 < -x ↔ x < 0 :=
953-
by { convert neg_lt_iff, rw pgame.neg_zero }
980+
by rw [lt_neg_iff, pgame.neg_zero]
981+
982+
@[simp] theorem neg_equiv_zero_iff {x : pgame} : -x ≈ 0 ↔ x ≈ 0 :=
983+
by rw [neg_equiv_iff, pgame.neg_zero]
984+
985+
@[simp] theorem neg_fuzzy_zero_iff {x : pgame} : -x ∥ 0 ↔ x ∥ 0 :=
986+
by rw [neg_fuzzy_iff, pgame.neg_zero]
987+
988+
@[simp] theorem zero_equiv_neg_iff {x : pgame} : 0 ≈ -x ↔ 0 ≈ x :=
989+
by rw [←neg_equiv_iff, pgame.neg_zero]
990+
991+
@[simp] theorem zero_fuzzy_neg_iff {x : pgame} : 0 ∥ -x ↔ 0 ∥ x :=
992+
by rw [←neg_fuzzy_iff, pgame.neg_zero]
954993

955994
/-- The sum of `x = {xL | xR}` and `y = {yL | yR}` is `{xL + y, x + yL | xR + y, x + yR}`. -/
956995
instance : has_add pgame.{u} := ⟨λ x y, begin
@@ -1208,7 +1247,7 @@ end
12081247

12091248
theorem zero_le_add_left_neg (x : pgame) : 0 ≤ -x + x :=
12101249
begin
1211-
rw [←neg_le_iff, pgame.neg_zero],
1250+
rw [←neg_le_neg_iff, pgame.neg_zero],
12121251
exact neg_add_le.trans (add_left_neg_le_zero _)
12131252
end
12141253

@@ -1299,7 +1338,7 @@ theorem add_congr_right {x y z : pgame} : y ≈ z → x + y ≈ x + z :=
12991338
add_congr equiv_rfl
13001339

13011340
theorem sub_congr {w x y z : pgame} (h₁ : w ≈ x) (h₂ : y ≈ z) : w - y ≈ x - z :=
1302-
add_congr h₁ (neg_congr h₂)
1341+
add_congr h₁ (neg_equiv_neg_iff.2 h₂)
13031342

13041343
theorem sub_congr_left {x y z : pgame} (h : x ≈ y) : x - z ≈ y - z :=
13051344
sub_congr h equiv_rfl

src/set_theory/surreal/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ theorem numeric_zero : numeric 0 := numeric_of_is_empty 0
164164
theorem numeric_one : numeric 1 := numeric_of_is_empty_right_moves 1 $ λ _, numeric_zero
165165

166166
theorem numeric.neg : Π {x : pgame} (o : numeric x), numeric (-x)
167-
| ⟨l, r, L, R⟩ o := ⟨λ j i, neg_lt_iff.2 (o.1 i j), λ j, (o.2.2 j).neg, λ i, (o.2.1 i).neg⟩
167+
| ⟨l, r, L, R⟩ o := ⟨λ j i, neg_lt_neg_iff.2 (o.1 i j), λ j, (o.2.2 j).neg, λ i, (o.2.1 i).neg⟩
168168

169169
theorem numeric.move_left_lt {x : pgame} (o : numeric x) (i) : x.move_left i < x :=
170170
(pgame.move_left_lf i).lt (o.move_left i) o
@@ -274,7 +274,7 @@ the negation of `{L | R}` is `{-R | -L}`. -/
274274
instance : has_neg surreal :=
275275
⟨surreal.lift
276276
(λ x ox, ⟦⟨-x, ox.neg⟩⟧)
277-
(λ _ _ _ _ a, quotient.sound (pgame.neg_congr a))⟩
277+
(λ _ _ _ _ a, quotient.sound (pgame.neg_equiv_neg_iff.2 a))⟩
278278

279279
instance : ordered_add_comm_group surreal :=
280280
{ add := (+),

0 commit comments

Comments
 (0)