File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ theorem units_ne_iff_eq_neg {u u' : ℤˣ} : u ≠ u' ↔ u = -u' := by
42
42
rcases units_eq_one_or u' with rfl | rfl <;>
43
43
decide
44
44
45
+ theorem isUnit_ne_iff_eq_neg {u u' : ℤ} (hu : IsUnit u) (hu' : IsUnit u') : u ≠ u' ↔ u = -u' := by
46
+ simpa only [Ne, Units.ext_iff] using units_ne_iff_eq_neg (u := hu.unit) (u' := hu'.unit)
47
+
45
48
theorem isUnit_eq_one_or {a : ℤ} : IsUnit a → a = 1 ∨ a = -1
46
49
| ⟨_, hx⟩ => hx ▸ (units_eq_one_or _).imp (congr_arg Units.val) (congr_arg Units.val)
47
50
#align int.is_unit_eq_one_or Int.isUnit_eq_one_or
@@ -53,10 +56,8 @@ theorem isUnit_iff {a : ℤ} : IsUnit a ↔ a = 1 ∨ a = -1 := by
53
56
· exact isUnit_one.neg
54
57
#align int.is_unit_iff Int.isUnit_iff
55
58
56
- theorem isUnit_eq_or_eq_neg {a b : ℤ} (ha : IsUnit a) (hb : IsUnit b) : a = b ∨ a = -b := by
57
- rcases isUnit_eq_one_or hb with (rfl | rfl)
58
- · exact isUnit_eq_one_or ha
59
- · rwa [or_comm, neg_neg, ← isUnit_iff]
59
+ theorem isUnit_eq_or_eq_neg {a b : ℤ} (ha : IsUnit a) (hb : IsUnit b) : a = b ∨ a = -b :=
60
+ or_iff_not_imp_left.mpr (isUnit_ne_iff_eq_neg ha hb).mp
60
61
#align int.is_unit_eq_or_eq_neg Int.isUnit_eq_or_eq_neg
61
62
62
63
theorem eq_one_or_neg_one_of_mul_eq_one {z w : ℤ} (h : z * w = 1 ) : z = 1 ∨ z = -1 :=
You can’t perform that action at this time.
0 commit comments