Module docstring
{"# Theorems about invertible elements in rings
"}
{"# Theorems about invertible elements in rings
"}
invertibleNeg
definition
[Mul R] [One R] [HasDistribNeg R] (a : R) [Invertible a] : Invertible (-a)
/-- `-⅟a` is the inverse of `-a` -/
def invertibleNeg [Mul R] [One R] [HasDistribNeg R] (a : R) [Invertible a] : Invertible (-a) :=
⟨-⅟ a, by simp, by simp⟩
invOf_neg
theorem
[Monoid R] [HasDistribNeg R] (a : R) [Invertible a] [Invertible (-a)] : ⅟ (-a) = -⅟ a
@[simp]
theorem invOf_neg [Monoid R] [HasDistribNeg R] (a : R) [Invertible a] [Invertible (-a)] :
⅟ (-a) = -⅟ a :=
invOf_eq_right_inv (by simp)
one_sub_invOf_two
theorem
[Ring R] [Invertible (2 : R)] : 1 - (⅟ 2 : R) = ⅟ 2
@[simp]
theorem one_sub_invOf_two [Ring R] [Invertible (2 : R)] : 1 - (⅟ 2 : R) = ⅟ 2 :=
(isUnit_of_invertible (2 : R)).mul_right_inj.1 <| by
rw [mul_sub, mul_invOf_self, mul_one, ← one_add_one_eq_two, add_sub_cancel_right]
invOf_two_add_invOf_two
theorem
[NonAssocSemiring R] [Invertible (2 : R)] : (⅟ 2 : R) + (⅟ 2 : R) = 1
@[simp]
theorem invOf_two_add_invOf_two [NonAssocSemiring R] [Invertible (2 : R)] :
(⅟ 2 : R) + (⅟ 2 : R) = 1 := by rw [← two_mul, mul_invOf_self]
pos_of_invertible_cast
theorem
[NonAssocSemiring R] [Nontrivial R] (n : ℕ) [Invertible (n : R)] : 0 < n
theorem pos_of_invertible_cast [NonAssocSemiring R] [Nontrivial R] (n : ℕ) [Invertible (n : R)] :
0 < n :=
Nat.zero_lt_of_ne_zero fun h => Invertible.ne_zero (n : R) (h ▸ Nat.cast_zero)
invOf_add_invOf
theorem
[Semiring R] (a b : R) [Invertible a] [Invertible b] : ⅟ a + ⅟ b = ⅟ a * (a + b) * ⅟ b
theorem invOf_add_invOf [Semiring R] (a b : R) [Invertible a] [Invertible b] :
⅟a + ⅟b = ⅟a * (a + b) * ⅟b := by
rw [mul_add, invOf_mul_self, add_mul, one_mul, mul_assoc, mul_invOf_self, mul_one, add_comm]
invOf_sub_invOf
theorem
[Ring R] (a b : R) [Invertible a] [Invertible b] : ⅟ a - ⅟ b = ⅟ a * (b - a) * ⅟ b
/-- A version of `inv_sub_inv'` for `invOf`. -/
theorem invOf_sub_invOf [Ring R] (a b : R) [Invertible a] [Invertible b] :
⅟a - ⅟b = ⅟a * (b - a) * ⅟b := by
rw [mul_sub, invOf_mul_self, sub_mul, one_mul, mul_assoc, mul_invOf_self, mul_one]
Ring.inverse_add_inverse
theorem
[Semiring R] {a b : R} (h : IsUnit a ↔ IsUnit b) :
Ring.inverse a + Ring.inverse b = Ring.inverse a * (a + b) * Ring.inverse b
/-- A version of `inv_add_inv'` for `Ring.inverse`. -/
theorem Ring.inverse_add_inverse [Semiring R] {a b : R} (h : IsUnitIsUnit a ↔ IsUnit b) :
Ring.inverse a + Ring.inverse b = Ring.inverse a * (a + b) * Ring.inverse b := by
by_cases ha : IsUnit a
· have hb := h.mp ha
obtain ⟨ia⟩ := ha.nonempty_invertible
obtain ⟨ib⟩ := hb.nonempty_invertible
simp_rw [inverse_invertible, invOf_add_invOf]
· have hb := h.not.mp ha
simp [inverse_non_unit, ha, hb]
Ring.inverse_sub_inverse
theorem
[Ring R] {a b : R} (h : IsUnit a ↔ IsUnit b) :
Ring.inverse a - Ring.inverse b = Ring.inverse a * (b - a) * Ring.inverse b
/-- A version of `inv_sub_inv'` for `Ring.inverse`. -/
theorem Ring.inverse_sub_inverse [Ring R] {a b : R} (h : IsUnitIsUnit a ↔ IsUnit b) :
Ring.inverse a - Ring.inverse b = Ring.inverse a * (b - a) * Ring.inverse b := by
by_cases ha : IsUnit a
· have hb := h.mp ha
obtain ⟨ia⟩ := ha.nonempty_invertible
obtain ⟨ib⟩ := hb.nonempty_invertible
simp_rw [inverse_invertible, invOf_sub_invOf]
· have hb := h.not.mp ha
simp [inverse_non_unit, ha, hb]