Documentation

Mathlib.Algebra.Ring.Commute

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]
theorem Commute.add_right {R : Type u} [Distrib R] {a b c : R} :
Commute a b โ†’ Commute a c โ†’ Commute a (b + c)
@[simp]
theorem Commute.add_left {R : Type u} [Distrib R] {a b c : R} :
Commute a c โ†’ Commute b c โ†’ Commute (a + b) c
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.neg_right {R : Type u} [Mul R] [HasDistribNeg R] {a b : R} :
Commute a b โ†’ Commute a (-b)
@[simp]
theorem Commute.neg_right_iff {R : Type u} [Mul R] [HasDistribNeg R] {a b : R} :
theorem Commute.neg_left {R : Type u} [Mul R] [HasDistribNeg R] {a b : R} :
Commute a b โ†’ Commute (-a) b
@[simp]
theorem Commute.neg_left_iff {R : Type u} [Mul R] [HasDistribNeg R] {a b : R} :
@[simp]
theorem Commute.sub_right {R : Type u} [NonUnitalNonAssocRing R] {a b c : R} :
Commute a b โ†’ Commute a c โ†’ Commute a (b - c)
@[simp]
theorem Commute.sub_left {R : Type u} [NonUnitalNonAssocRing R] {a b c : R} :
Commute a c โ†’ Commute b c โ†’ Commute (a - b) c
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
theorem neg_sq {R : Type u} [Monoid R] [HasDistribNeg R] (a : R) :
(-a) ^ 2 = a ^ 2
theorem neg_one_sq {R : Type u} [Monoid R] [HasDistribNeg R] :
(-1) ^ 2 = 1
theorem neg_pow_two {R : Type u} [Monoid R] [HasDistribNeg R] (a : R) :
(-a) ^ 2 = a ^ 2

Alias of neg_sq.

theorem neg_one_pow_two {R : Type u} [Monoid R] [HasDistribNeg R] :
(-1) ^ 2 = 1

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
theorem neg_one_pow_eq_pow_mod_two {R : Type u} [Ring R] (n : โ„•) :
(-1) ^ n = (-1) ^ (n % 2)
@[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] :
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_sub_one {R : Type u} [NonAssocRing R] (a : R) :
a * a - 1 = (a + 1) * (a - 1)
theorem sq_sub_sq {R : Type u} [CommRing R] (a b : R) :
a ^ 2 - b ^ 2 = (a + b) * (a - b)
theorem pow_two_sub_pow_two {R : Type u} [CommRing R] (a b : R) :
a ^ 2 - b ^ 2 = (a + b) * (a - b)

Alias of sq_sub_sq.

theorem sub_sq {R : Type u} [CommRing R] (a b : R) :
(a - b) ^ 2 = a ^ 2 - 2 * a * b + b ^ 2
theorem sub_pow_two {R : Type u} [CommRing R] (a b : R) :
(a - b) ^ 2 = a ^ 2 - 2 * a * b + b ^ 2

Alias of sub_sq.

theorem sub_sq' {R : Type u} [CommRing R] (a b : R) :
(a - b) ^ 2 = a ^ 2 + b ^ 2 - 2 * a * b
theorem sub_sq_comm {R : Type u} [CommRing R] (a b : R) :
(a - b) ^ 2 = (b - a) ^ 2
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.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หฃ) :

In the unit group of an integral domain, a unit is its own inverse iff the unit is one or one's additive inverse.

@[instance 100]
Equations