mathlib documentation

algebra.group.commute

Commuting pairs of elements in monoids #

We define the predicate commute a b := a * b = b * a and provide some operations on terms (h : commute a b). E.g., if a, b, and c are elements of a semiring, and that hb : commute a b and hc : commute a c. Then hb.pow_left 5 proves commute (a ^ 5) b and (hb.pow_right 2).add_right (hb.mul_right hc) proves commute a (b ^ 2 + b * c).

Lean does not immediately recognise these terms as equations, so for rewriting we need syntax like rw [(hb.pow_left 5).eq] rather than just rw [hb.pow_left 5].

This file defines only a few operations (mul_left, inv_right, etc). Other operations (pow_right, field inverse etc) are in the files that define corresponding notions.

Implementation details #

Most of the proofs come from the properties of semiconj_by.

def add_commute {S : Type u_1} [has_add S] (a b : S) :
Prop

Two elements additively commute if a + b = b + a

Equations
def commute {S : Type u_1} [has_mul S] (a b : S) :
Prop

Two elements commute if a * b = b * a.

Equations
@[protected]
theorem commute.eq {S : Type u_2} [has_mul S] {a b : S} (h : commute a b) :
a * b = b * a

Equality behind commute a b; useful for rewriting.

@[protected]
theorem add_commute.eq {S : Type u_2} [has_add S] {a b : S} (h : add_commute a b) :
a + b = b + a

Equality behind add_commute a b; useful for rewriting.

@[protected, simp, refl]
theorem add_commute.refl {S : Type u_2} [has_add S] (a : S) :

Any element commutes with itself.

@[protected, simp, refl]
theorem commute.refl {S : Type u_2} [has_mul S] (a : S) :

Any element commutes with itself.

@[protected, symm]
theorem add_commute.symm {S : Type u_2} [has_add S] {a b : S} (h : add_commute a b) :

If a commutes with b, then b commutes with a.

@[protected, symm]
theorem commute.symm {S : Type u_2} [has_mul S] {a b : S} (h : commute a b) :

If a commutes with b, then b commutes with a.

@[protected]
theorem commute.semiconj_by {S : Type u_2} [has_mul S] {a b : S} (h : commute a b) :
@[protected]
theorem add_commute.semiconj_by {S : Type u_2} [has_add S] {a b : S} (h : add_commute a b) :
@[protected]
theorem add_commute.symm_iff {S : Type u_2} [has_add S] {a b : S} :
@[protected]
theorem commute.symm_iff {S : Type u_2} [has_mul S] {a b : S} :
@[simp]
theorem commute.mul_right {S : Type u_2} [semigroup S] {a b c : S} (hab : commute a b) (hac : commute a c) :
commute a (b * c)

If a commutes with both b and c, then it commutes with their product.

@[simp]
theorem add_commute.add_right {S : Type u_2} [add_semigroup S] {a b c : S} (hab : add_commute a b) (hac : add_commute a c) :
add_commute a (b + c)

If a commutes with both b and c, then it commutes with their sum.

@[simp]
theorem commute.mul_left {S : Type u_2} [semigroup S] {a b c : S} (hac : commute a c) (hbc : commute b c) :
commute (a * b) c

If both a and b commute with c, then their product commutes with c.

@[simp]
theorem add_commute.add_left {S : Type u_2} [add_semigroup S] {a b c : S} (hac : add_commute a c) (hbc : add_commute b c) :
add_commute (a + b) c

If both a and b commute with c, then their product commutes with c.

@[protected]
theorem commute.right_comm {S : Type u_2} [semigroup S] {b c : S} (h : commute b c) (a : S) :
a * b * c = a * c * b
@[protected]
theorem add_commute.right_comm {S : Type u_2} [add_semigroup S] {b c : S} (h : add_commute b c) (a : S) :
a + b + c = a + c + b
@[protected]
theorem add_commute.left_comm {S : Type u_2} [add_semigroup S] {a b : S} (h : add_commute a b) (c : S) :
a + (b + c) = b + (a + c)
@[protected]
theorem commute.left_comm {S : Type u_2} [semigroup S] {a b : S} (h : commute a b) (c : S) :
a * (b * c) = b * (a * c)
@[protected]
theorem commute.all {S : Type u_1} [comm_semigroup S] (a b : S) :
@[protected]
theorem add_commute.all {S : Type u_1} [add_comm_semigroup S] (a b : S) :
@[simp]
theorem commute.one_right {M : Type u_2} [mul_one_class M] (a : M) :
@[simp]
theorem add_commute.zero_right {M : Type u_2} [add_zero_class M] (a : M) :
@[simp]
theorem commute.one_left {M : Type u_2} [mul_one_class M] (a : M) :
@[simp]
theorem add_commute.zero_left {M : Type u_2} [add_zero_class M] (a : M) :
@[simp]
theorem add_commute.nsmul_right {M : Type u_2} [add_monoid M] {a b : M} (h : add_commute a b) (n : ) :
@[simp]
theorem commute.pow_right {M : Type u_2} [monoid M] {a b : M} (h : commute a b) (n : ) :
commute a (b ^ n)
@[simp]
theorem commute.pow_left {M : Type u_2} [monoid M] {a b : M} (h : commute a b) (n : ) :
commute (a ^ n) b
@[simp]
theorem add_commute.nsmul_left {M : Type u_2} [add_monoid M] {a b : M} (h : add_commute a b) (n : ) :
@[simp]
theorem add_commute.nsmul_nsmul {M : Type u_2} [add_monoid M] {a b : M} (h : add_commute a b) (m n : ) :
add_commute (m a) (n b)
@[simp]
theorem commute.pow_pow {M : Type u_2} [monoid M] {a b : M} (h : commute a b) (m n : ) :
commute (a ^ m) (b ^ n)
@[simp]
theorem commute.self_pow {M : Type u_2} [monoid M] (a : M) (n : ) :
commute a (a ^ n)
@[simp]
theorem add_commute.self_nsmul {M : Type u_2} [add_monoid M] (a : M) (n : ) :
@[simp]
theorem commute.pow_self {M : Type u_2} [monoid M] (a : M) (n : ) :
commute (a ^ n) a
@[simp]
theorem add_commute.nsmul_self {M : Type u_2} [add_monoid M] (a : M) (n : ) :
@[simp]
theorem add_commute.nsmul_nsmul_self {M : Type u_2} [add_monoid M] (a : M) (m n : ) :
add_commute (m a) (n a)
@[simp]
theorem commute.pow_pow_self {M : Type u_2} [monoid M] (a : M) (m n : ) :
commute (a ^ m) (a ^ n)
theorem pow_succ' {M : Type u_2} [monoid M] (a : M) (n : ) :
a ^ (n + 1) = a ^ n * a
theorem succ_nsmul' {M : Type u_2} [add_monoid M] (a : M) (n : ) :
(n + 1) a = n a + a
theorem add_commute.add_units_neg_right {M : Type u_2} [add_monoid M] {a : M} {u : add_units M} :
theorem commute.units_inv_right {M : Type u_2} [monoid M] {a : M} {u : Mˣ} :
@[simp]
theorem add_commute.add_units_neg_right_iff {M : Type u_2} [add_monoid M] {a : M} {u : add_units M} :
@[simp]
theorem commute.units_inv_right_iff {M : Type u_2} [monoid M] {a : M} {u : Mˣ} :
theorem commute.units_inv_left {M : Type u_2} [monoid M] {a : M} {u : Mˣ} :
theorem add_commute.add_units_neg_left {M : Type u_2} [add_monoid M] {a : M} {u : add_units M} :
@[simp]
theorem add_commute.add_units_neg_left_iff {M : Type u_2} [add_monoid M] {a : M} {u : add_units M} :
@[simp]
theorem commute.units_inv_left_iff {M : Type u_2} [monoid M] {a : M} {u : Mˣ} :
theorem add_commute.add_units_coe {M : Type u_2} [add_monoid M] {u₁ u₂ : add_units M} :
add_commute u₁ u₂add_commute u₁ u₂
theorem commute.units_coe {M : Type u_2} [monoid M] {u₁ u₂ : Mˣ} :
commute u₁ u₂commute u₁ u₂
theorem add_commute.add_units_of_coe {M : Type u_2} [add_monoid M] {u₁ u₂ : add_units M} :
add_commute u₁ u₂add_commute u₁ u₂
theorem commute.units_of_coe {M : Type u_2} [monoid M] {u₁ u₂ : Mˣ} :
commute u₁ u₂commute u₁ u₂
@[simp]
theorem commute.units_coe_iff {M : Type u_2} [monoid M] {u₁ u₂ : Mˣ} :
commute u₁ u₂ commute u₁ u₂
@[simp]
theorem add_commute.add_units_coe_iff {M : Type u_2} [add_monoid M] {u₁ u₂ : add_units M} :
add_commute u₁ u₂ add_commute u₁ u₂
theorem add_commute.is_add_unit_add_iff {M : Type u_2} [add_monoid M] {a b : M} (h : add_commute a b) :
theorem commute.is_unit_mul_iff {M : Type u_2} [monoid M] {a b : M} (h : commute a b) :
@[simp]
theorem is_add_unit_add_self_iff {M : Type u_2} [add_monoid M] {a : M} :
@[simp]
theorem is_unit_mul_self_iff {M : Type u_2} [monoid M] {a : M} :
theorem add_commute.neg_neg {G : Type u_1} [subtraction_monoid G] {a b : G} :
add_commute a badd_commute (-a) (-b)
theorem commute.inv_inv {G : Type u_1} [division_monoid G] {a b : G} :
@[simp]
theorem add_commute.neg_neg_iff {G : Type u_1} [subtraction_monoid G] {a b : G} :
@[simp]
theorem commute.inv_inv_iff {G : Type u_1} [division_monoid G] {a b : G} :
theorem add_commute.neg_right {G : Type u_1} [add_group G] {a b : G} :
theorem commute.inv_right {G : Type u_1} [group G] {a b : G} :
commute a bcommute a b⁻¹
@[simp]
theorem commute.inv_right_iff {G : Type u_1} [group G] {a b : G} :
@[simp]
theorem add_commute.neg_right_iff {G : Type u_1} [add_group G] {a b : G} :
theorem add_commute.neg_left {G : Type u_1} [add_group G] {a b : G} :
theorem commute.inv_left {G : Type u_1} [group G] {a b : G} :
commute a bcommute a⁻¹ b
@[simp]
theorem commute.inv_left_iff {G : Type u_1} [group G] {a b : G} :
@[simp]
theorem add_commute.neg_left_iff {G : Type u_1} [add_group G] {a b : G} :
@[protected]
theorem add_commute.neg_add_cancel {G : Type u_1} [add_group G] {a b : G} (h : add_commute a b) :
-a + b + a = b
@[protected]
theorem commute.inv_mul_cancel {G : Type u_1} [group G] {a b : G} (h : commute a b) :
a⁻¹ * b * a = b
theorem commute.inv_mul_cancel_assoc {G : Type u_1} [group G] {a b : G} (h : commute a b) :
a⁻¹ * (b * a) = b
theorem add_commute.neg_add_cancel_assoc {G : Type u_1} [add_group G] {a b : G} (h : add_commute a b) :
-a + (b + a) = b
@[protected]
theorem commute.mul_inv_cancel {G : Type u_1} [group G] {a b : G} (h : commute a b) :
a * b * a⁻¹ = b
@[protected]
theorem add_commute.add_neg_cancel {G : Type u_1} [add_group G] {a b : G} (h : add_commute a b) :
a + b + -a = b
theorem commute.mul_inv_cancel_assoc {G : Type u_1} [group G] {a b : G} (h : commute a b) :
a * (b * a⁻¹) = b
theorem add_commute.add_neg_cancel_assoc {G : Type u_1} [add_group G] {a b : G} (h : add_commute a b) :
a + (b + -a) = b
@[simp]
theorem mul_inv_cancel_comm {G : Type u_1} [comm_group G] (a b : G) :
a * b * a⁻¹ = b
@[simp]
theorem add_neg_cancel_comm {G : Type u_1} [add_comm_group G] (a b : G) :
a + b + -a = b
@[simp]
theorem mul_inv_cancel_comm_assoc {G : Type u_1} [comm_group G] (a b : G) :
a * (b * a⁻¹) = b
@[simp]
theorem add_neg_cancel_comm_assoc {G : Type u_1} [add_comm_group G] (a b : G) :
a + (b + -a) = b
@[simp]
theorem inv_mul_cancel_comm {G : Type u_1} [comm_group G] (a b : G) :
a⁻¹ * b * a = b
@[simp]
theorem neg_add_cancel_comm {G : Type u_1} [add_comm_group G] (a b : G) :
-a + b + a = b
@[simp]
theorem neg_add_cancel_comm_assoc {G : Type u_1} [add_comm_group G] (a b : G) :
-a + (b + a) = b
@[simp]
theorem inv_mul_cancel_comm_assoc {G : Type u_1} [comm_group G] (a b : G) :
a⁻¹ * (b * a) = b