Semirings and rings #
This file gives lemmas about semirings, rings and domains.
This is analogous to Mathlib/Algebra/Group/Basic.lean,
the difference being that the former is about + and * separately, while
the present file is about their interaction.
For the definitions of semirings and rings see Mathlib/Algebra/Ring/Defs.lean.
@[simp]
@[simp]
theorem
Commute.mul_self_sub_mul_self_eq
{R : Type u}
[NonUnitalNonAssocRing R]
{a b : R}
(h : Commute a b)
:
a * a - b * b = (a + b) * (a - b)
Representation of a difference of two squares of commuting elements as a product.
theorem
Commute.mul_self_sub_mul_self_eq'
{R : Type u}
[NonUnitalNonAssocRing R]
{a b : R}
(h : Commute a b)
:
a * a - b * b = (a - b) * (a + b)
theorem
Commute.mul_self_eq_mul_self_iff
{R : Type u}
[NonUnitalNonAssocRing R]
[NoZeroDivisors R]
{a b : R}
(h : Commute a b)
:
a * a = b * b โ a = b โจ a = -b
@[simp]
@[simp]
theorem
Commute.neg_one_right
{R : Type u}
[MulOneClass R]
[HasDistribNeg R]
(a : R)
:
Commute a (-1)
@[simp]
@[simp]
theorem
Commute.add_sq
{R : Type u}
[Semiring R]
{a b : R}
(h : Commute a b)
:
(a + b) ^ 2 = a ^ 2 + 2 * a * b + b ^ 2
theorem
Commute.sq_sub_sq
{R : Type u}
[Ring R]
{a b : R}
(h : Commute a b)
:
a ^ 2 - b ^ 2 = (a + b) * (a - b)
theorem
Commute.sub_sq
{R : Type u}
[Ring R]
{a b : R}
(h : Commute a b)
:
(a - b) ^ 2 = a ^ 2 - 2 * a * b + b ^ 2
theorem
Commute.sq_eq_sq_iff_eq_or_eq_neg
{R : Type u}
[Ring R]
{a b : R}
[NoZeroDivisors R]
(h : Commute a b)
:
a ^ 2 = b ^ 2 โ a = b โจ a = -b
theorem
neg_one_pow_eq_or
(R : Type u)
[Monoid R]
[HasDistribNeg R]
(n : โ)
:
(-1) ^ n = 1 โจ (-1) ^ n = -1
theorem
neg_pow
{R : Type u}
[Monoid R]
[HasDistribNeg R]
(a : R)
(n : โ)
:
(-a) ^ n = (-1) ^ n * a ^ n
theorem
neg_pow'
{R : Type u}
[Monoid R]
[HasDistribNeg R]
(a : R)
(n : โ)
:
(-a) ^ n = a ^ n * (-1) ^ n
Alias of neg_sq.
Alias of neg_one_sq.
@[simp]
theorem
neg_one_pow_mul_eq_zero_iff
{R : Type u}
[Ring R]
{a : R}
{n : โ}
:
(-1) ^ n * a = 0 โ a = 0
@[simp]
theorem
mul_neg_one_pow_eq_zero_iff
{R : Type u}
[Ring R]
{a : R}
{n : โ}
:
a * (-1) ^ n = 0 โ a = 0
@[simp]
theorem
sq_eq_one_iff
{R : Type u}
[Ring R]
{a : R}
[NoZeroDivisors R]
:
a ^ 2 = 1 โ a = 1 โจ a = -1
theorem
sq_ne_one_iff
{R : Type u}
[Ring R]
{a : R}
[NoZeroDivisors R]
:
a ^ 2 โ 1 โ a โ 1 โง a โ -1
theorem
mul_self_sub_mul_self
{R : Type u}
[NonUnitalNonAssocCommRing R]
(a b : R)
:
a * a - b * b = (a + b) * (a - b)
Representation of a difference of two squares in a commutative ring as a product.
theorem
mul_self_eq_mul_self_iff
{R : Type u}
[NonUnitalNonAssocCommRing R]
[NoZeroDivisors R]
{a b : R}
:
a * a = b * b โ a = b โจ a = -b
theorem
mul_self_eq_one_iff
{R : Type u}
[NonAssocRing R]
[NoZeroDivisors R]
{a : R}
:
a * a = 1 โ a = 1 โจ a = -1
Alias of sq_sub_sq.
Alias of sub_sq.
theorem
sq_eq_sq_iff_eq_or_eq_neg
{R : Type u}
[CommRing R]
[NoZeroDivisors R]
{a b : R}
:
a ^ 2 = b ^ 2 โ a = b โจ a = -b
theorem
eq_or_eq_neg_of_sq_eq_sq
{R : Type u}
[CommRing R]
[NoZeroDivisors R]
(a b : R)
:
a ^ 2 = b ^ 2 โ a = b โจ a = -b
theorem
Units.sq_eq_sq_iff_eq_or_eq_neg
{R : Type u}
[CommRing R]
[NoZeroDivisors R]
{a b : Rหฃ}
:
a ^ 2 = b ^ 2 โ a = b โจ a = -b
theorem
Units.eq_or_eq_neg_of_sq_eq_sq
{R : Type u}
[CommRing R]
[NoZeroDivisors R]
(a b : Rหฃ)
(h : a ^ 2 = b ^ 2)
:
a = b โจ a = -b
theorem
Units.inv_eq_self_iff
{R : Type u}
[Ring R]
[NoZeroDivisors R]
(u : Rหฃ)
:
uโปยน = u โ u = 1 โจ u = -1
In the unit group of an integral domain, a unit is its own inverse iff the unit is one or one's additive inverse.
@[implicit_reducible, instance 100]