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] :
S → S → Prop

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

def commute {S : Type u_1} [has_mul S] :
S → S → Prop

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

Equations
theorem commute.eq {S : Type u_1} [has_mul S] {a b : S} :
commute a ba * b = b * a

Equality behind commute a b; useful for rewriting.

theorem add_commute.eq {S : Type u_1} [has_add S] {a b : S} :
add_commute a ba + b = b + a

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

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

Any element commutes with itself.

theorem add_commute.symm {S : Type u_1} [has_add S] {a b : S} :

theorem commute.symm {S : Type u_1} [has_mul S] {a b : S} :
commute a bcommute b a

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

theorem add_commute.symm_iff {S : Type u_1} [has_add S] {a b : S} :

theorem commute.symm_iff {S : Type u_1} [has_mul S] {a b : S} :

@[simp]
theorem commute.mul_right {S : Type u_1} [semigroup S] {a b c : S} :
commute a bcommute a ccommute 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_1} [add_semigroup S] {a b c : S} :
add_commute a badd_commute a cadd_commute a (b + c)

@[simp]
theorem commute.mul_left {S : Type u_1} [semigroup S] {a b c : S} :
commute a ccommute b ccommute (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_1} [add_semigroup S] {a b c : S} :
add_commute a cadd_commute b cadd_commute (a + b) c

theorem commute.right_comm {S : Type u_1} [semigroup S] {b c : S} (h : commute b c) (a : S) :
(a * b) * c = (a * c) * b

theorem add_commute.right_comm {S : Type u_1} [add_semigroup S] {b c : S} (h : add_commute b c) (a : S) :
a + b + c = a + c + b

theorem add_commute.left_comm {S : Type u_1} [add_semigroup S] {a b : S} (h : add_commute a b) (c : S) :
a + (b + c) = b + (a + c)

theorem commute.left_comm {S : Type u_1} [semigroup S] {a b : S} (h : commute a b) (c : S) :
a * b * c = b * a * c

theorem commute.all {S : Type u_1} [comm_semigroup S] (a b : S) :

theorem add_commute.all {S : Type u_1} [add_comm_semigroup S] (a b : S) :

@[simp]
theorem commute.one_right {M : Type u_1} [monoid M] (a : M) :

@[simp]
theorem add_commute.zero_right {M : Type u_1} [add_monoid M] (a : M) :

@[simp]
theorem commute.one_left {M : Type u_1} [monoid M] (a : M) :

@[simp]
theorem add_commute.zero_left {M : Type u_1} [add_monoid M] (a : M) :

theorem add_commute.units_neg_right {M : Type u_1} [add_monoid M] {a : M} {u : add_units M} :

theorem commute.units_inv_right {M : Type u_1} [monoid M] {a : M} {u : units M} :

@[simp]
theorem commute.units_inv_right_iff {M : Type u_1} [monoid M] {a : M} {u : units M} :

@[simp]
theorem add_commute.units_neg_right_iff {M : Type u_1} [add_monoid M] {a : M} {u : add_units M} :

theorem commute.units_inv_left {M : Type u_1} [monoid M] {u : units M} {a : M} :

theorem add_commute.units_neg_left {M : Type u_1} [add_monoid M] {u : add_units M} {a : M} :

@[simp]
theorem commute.units_inv_left_iff {M : Type u_1} [monoid M] {u : units M} {a : M} :

@[simp]
theorem add_commute.units_neg_left_iff {M : Type u_1} [add_monoid M] {u : add_units M} {a : M} :

theorem add_commute.units_coe {M : Type u_1} [add_monoid M] {u₁ u₂ : add_units M} :
add_commute u₁ u₂add_commute u₁ u₂

theorem commute.units_coe {M : Type u_1} [monoid M] {u₁ u₂ : units M} :
commute u₁ u₂commute u₁ u₂

theorem add_commute.units_of_coe {M : Type u_1} [add_monoid M] {u₁ u₂ : add_units M} :
add_commute u₁ u₂add_commute u₁ u₂

theorem commute.units_of_coe {M : Type u_1} [monoid M] {u₁ u₂ : units M} :
commute u₁ u₂commute u₁ u₂

@[simp]
theorem add_commute.units_coe_iff {M : Type u_1} [add_monoid M] {u₁ u₂ : add_units M} :
add_commute u₁ u₂ add_commute u₁ u₂

@[simp]
theorem commute.units_coe_iff {M : Type u_1} [monoid M] {u₁ u₂ : units M} :
commute u₁ u₂ commute u₁ u₂

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} :

theorem add_commute.neg_neg {G : Type u_1} [add_group G] {a b : G} :
add_commute a badd_commute (-a) (-b)

theorem commute.inv_inv {G : Type u_1} [group G] {a b : G} :

@[simp]
theorem add_commute.neg_neg_iff {G : Type u_1} [add_group G] {a b : G} :

@[simp]
theorem commute.inv_inv_iff {G : Type u_1} [group G] {a b : G} :

theorem add_commute.neg_add_cancel {G : Type u_1} [add_group G] {a b : G} :
add_commute a b-a + b + a = b

theorem commute.inv_mul_cancel {G : Type u_1} [group G] {a b : G} :
commute a b(a⁻¹ * b) * a = b

theorem commute.inv_mul_cancel_assoc {G : Type u_1} [group G] {a b : G} :
commute a ba⁻¹ * b * a = b

theorem add_commute.neg_add_cancel_assoc {G : Type u_1} [add_group G] {a b : G} :
add_commute a b-a + (b + a) = b

theorem commute.mul_inv_cancel {G : Type u_1} [group G] {a b : G} :
commute a b(a * b) * a⁻¹ = b

theorem add_commute.add_neg_cancel {G : Type u_1} [add_group G] {a b : G} :
add_commute a ba + b + -a = b

theorem commute.mul_inv_cancel_assoc {G : Type u_1} [group G] {a b : G} :
commute a ba * b * a⁻¹ = b

theorem add_commute.add_neg_cancel_assoc {G : Type u_1} [add_group G] {a b : G} :
add_commute a ba + (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