mathlibdocumentation

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
• b = b
def commute {S : Type u_1} [has_mul S] (a b : S) :
Prop

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

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

Equality behind commute a b; useful for rewriting.

@[protected]
theorem add_commute.eq {S : Type u_1} [has_add S] {a b : S} (h : b) :
a + b = b + a
@[protected, simp]
theorem add_commute.refl {S : Type u_1} [has_add S] (a : S) :
a
@[protected, simp]
theorem commute.refl {S : Type u_1} [has_mul S] (a : S) :
a

Any element commutes with itself.

@[protected]
theorem add_commute.symm {S : Type u_1} [has_add S] {a b : S} (h : b) :
a
@[protected]
theorem commute.symm {S : Type u_1} [has_mul S] {a b : S} (h : b) :
a

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

@[protected]
theorem commute.semiconj_by {S : Type u_1} [has_mul S] {a b : S} (h : b) :
b b
@[protected]
theorem add_commute.semiconj_by {S : Type u_1} [has_add S] {a b : S} (h : b) :
b
@[protected]
theorem add_commute.symm_iff {S : Type u_1} [has_add S] {a b : S} :
b a
@[protected]
theorem commute.symm_iff {S : Type u_1} [has_mul S] {a b : S} :
b a
@[simp]
theorem commute.mul_right {S : Type u_1} [semigroup S] {a b c : S} (hab : b) (hac : c) :
(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} {a b c : S} (hab : b) (hac : c) :
(b + c)
@[simp]
theorem commute.mul_left {S : Type u_1} [semigroup S] {a b c : S} (hac : c) (hbc : 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_1} {a b c : S} (hac : c) (hbc : c) :
@[protected]
theorem commute.right_comm {S : Type u_1} [semigroup S] {b c : S} (h : c) (a : S) :
(a * b) * c = (a * c) * b
@[protected]
theorem add_commute.right_comm {S : Type u_1} {b c : S} (h : c) (a : S) :
a + b + c = a + c + b
@[protected]
theorem add_commute.left_comm {S : Type u_1} {a b : S} (h : b) (c : S) :
a + (b + c) = b + (a + c)
@[protected]
theorem commute.left_comm {S : Type u_1} [semigroup S] {a b : S} (h : b) (c : S) :
a * b * c = b * a * c
@[protected]
theorem commute.all {S : Type u_1} (a b : S) :
b
@[protected]
theorem add_commute.all {S : Type u_1} (a b : S) :
b
@[simp]
theorem commute.one_right {M : Type u_1} (a : M) :
1
@[simp]
theorem add_commute.zero_right {M : Type u_1} (a : M) :
0
@[simp]
theorem commute.one_left {M : Type u_1} (a : M) :
a
@[simp]
theorem add_commute.zero_left {M : Type u_1} (a : M) :
a
@[simp]
theorem add_commute.pow_right {M : Type u_1} [add_monoid M] {a b : M} (h : b) (n : ) :
(n b)
@[simp]
theorem commute.pow_right {M : Type u_1} [monoid M] {a b : M} (h : b) (n : ) :
(b ^ n)
@[simp]
theorem commute.pow_left {M : Type u_1} [monoid M] {a b : M} (h : b) (n : ) :
commute (a ^ n) b
@[simp]
theorem add_commute.pow_left {M : Type u_1} [add_monoid M] {a b : M} (h : b) (n : ) :
@[simp]
theorem commute.pow_pow {M : Type u_1} [monoid M] {a b : M} (h : b) (m n : ) :
commute (a ^ m) (b ^ n)
@[simp]
theorem add_commute.pow_pow {M : Type u_1} [add_monoid M] {a b : M} (h : b) (m n : ) :
@[simp]
theorem commute.self_pow {M : Type u_1} [monoid M] (a : M) (n : ) :
(a ^ n)
@[simp]
theorem add_commute.self_pow {M : Type u_1} [add_monoid M] (a : M) (n : ) :
(n a)
@[simp]
theorem commute.pow_self {M : Type u_1} [monoid M] (a : M) (n : ) :
commute (a ^ n) a
@[simp]
theorem add_commute.pow_self {M : Type u_1} [add_monoid M] (a : M) (n : ) :
@[simp]
theorem add_commute.pow_pow_self {M : Type u_1} [add_monoid M] (a : M) (m n : ) :
@[simp]
theorem commute.pow_pow_self {M : Type u_1} [monoid M] (a : M) (m n : ) :
commute (a ^ m) (a ^ n)
theorem pow_succ' {M : Type u_1} [monoid M] (a : M) (n : ) :
a ^ (n + 1) = (a ^ n) * a
theorem succ_nsmul' {M : Type u_1} [add_monoid M] (a : M) (n : ) :
(n + 1) a = n a + a
u (-u)
theorem commute.units_inv_right {M : Type u_1} [monoid M] {a : M} {u : Mˣ} :
u u⁻¹
@[simp]
theorem commute.units_inv_right_iff {M : Type u_1} [monoid M] {a : M} {u : Mˣ} :
@[simp]
(-u) u
theorem commute.units_inv_left {M : Type u_1} [monoid M] {a : M} {u : Mˣ} :
a a
a a
@[simp]
theorem commute.units_inv_left_iff {M : Type u_1} [monoid M] {a : M} {u : Mˣ} :
a a
@[simp]
a a
u₂ u₂
theorem commute.units_coe {M : Type u_1} [monoid M] {u₁ u₂ : Mˣ} :
commute u₁ u₂commute u₁ u₂
u₂ u₂
theorem commute.units_of_coe {M : Type u_1} [monoid M] {u₁ u₂ : Mˣ} :
commute u₁ u₂commute u₁ u₂
@[simp]
u₂ u₂
@[simp]
theorem commute.units_coe_iff {M : Type u_1} [monoid M] {u₁ u₂ : Mˣ} :
commute u₁ u₂ commute u₁ u₂
theorem commute.is_unit_mul_iff {M : Type u_1} [monoid M] {a b : M} (h : b) :
is_unit (a * b)
@[simp]
theorem is_unit_add_self_iff {M : Type u_1} [add_monoid M] {a : M} :
@[simp]
theorem is_unit_mul_self_iff {M : Type u_1} [monoid M] {a : M} :
is_unit (a * a)
theorem add_commute.neg_right {G : Type u_1} [add_group G] {a b : G} :
b (-b)
theorem commute.inv_right {G : Type u_1} [group G] {a b : G} :
b 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} :
(-b) b
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} :
b b
@[simp]
theorem commute.inv_left_iff {G : Type u_1} [group G] {a b : G} :
b b
@[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} :
theorem commute.inv_inv {G : Type u_1} [group G] {a b : G} :
b b⁻¹
@[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} :
@[protected]
-a + b + a = b
@[protected]
theorem commute.inv_mul_cancel {G : Type u_1} [group G] {a b : G} (h : b) :
(a⁻¹ * b) * a = b
theorem commute.inv_mul_cancel_assoc {G : Type u_1} [group G] {a b : G} (h : b) :
a⁻¹ * b * a = b
-a + (b + a) = b
@[protected]
theorem commute.mul_inv_cancel {G : Type u_1} [group G] {a b : G} (h : b) :
(a * b) * a⁻¹ = b
@[protected]
a + b + -a = b
theorem commute.mul_inv_cancel_assoc {G : Type u_1} [group G] {a b : G} (h : b) :
a * b * 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} (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} (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} (a b : G) :
-a + b + a = b
@[simp]
theorem neg_add_cancel_comm_assoc {G : Type u_1} (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