# Documentation

Mathlib.Algebra.Group.Commute.Defs

# 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 SemiconjBy.

def AddCommute {S : Type u_2} [Add S] (a : S) (b : S) :

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

Instances For
def Commute {S : Type u_2} [Mul S] (a : S) (b : S) :

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

Instances For
theorem AddCommute.eq {S : Type u_2} [Add S] {a : S} {b : S} (h : ) :
a + b = b + a

Equality behind AddCommute a b; useful for rewriting.

theorem Commute.eq {S : Type u_2} [Mul S] {a : S} {b : S} (h : Commute a b) :
a * b = b * a

Equality behind Commute a b; useful for rewriting.

@[simp]
theorem AddCommute.refl {S : Type u_2} [Add S] (a : S) :

Any element commutes with itself.

@[simp]
theorem Commute.refl {S : Type u_2} [Mul S] (a : S) :

Any element commutes with itself.

theorem AddCommute.symm {S : Type u_2} [Add S] {a : S} {b : S} (h : ) :

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

theorem Commute.symm {S : Type u_2} [Mul S] {a : S} {b : S} (h : Commute a b) :

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

theorem AddCommute.semiconjBy {S : Type u_2} [Add S] {a : S} {b : S} (h : ) :
theorem Commute.semiconjBy {S : Type u_2} [Mul S] {a : S} {b : S} (h : Commute a b) :
theorem AddCommute.symm_iff {S : Type u_2} [Add S] {a : S} {b : S} :
theorem Commute.symm_iff {S : Type u_2} [Mul S] {a : S} {b : S} :
instance Commute.instIsReflCommute {S : Type u_2} [Mul S] :
IsRefl S Commute
instance AddCommute.on_isRefl {G : Type u_1} {S : Type u_2} [Add S] {f : GS} :
IsRefl G fun a b => AddCommute (f a) (f b)
theorem AddCommute.on_isRefl.proof_1 {G : Type u_1} {S : Type u_2} [Add S] {f : GS} :
IsRefl G fun a b => AddCommute (f a) (f b)
instance Commute.on_isRefl {G : Type u_1} {S : Type u_2} [Mul S] {f : GS} :
IsRefl G fun a b => Commute (f a) (f b)
@[simp]
theorem AddCommute.add_right {S : Type u_2} [] {a : S} {b : S} {c : S} (hab : ) (hac : ) :

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

@[simp]
theorem Commute.mul_right {S : Type u_2} [] {a : S} {b : S} {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 AddCommute.add_left {S : Type u_2} [] {a : S} {b : S} {c : S} (hac : ) (hbc : ) :

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

@[simp]
theorem Commute.mul_left {S : Type u_2} [] {a : S} {b : S} {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.

theorem AddCommute.right_comm {S : Type u_2} [] {b : S} {c : S} (h : ) (a : S) :
a + b + c = a + c + b
theorem Commute.right_comm {S : Type u_2} [] {b : S} {c : S} (h : Commute b c) (a : S) :
a * b * c = a * c * b
theorem AddCommute.left_comm {S : Type u_2} [] {a : S} {b : S} (h : ) (c : S) :
a + (b + c) = b + (a + c)
theorem Commute.left_comm {S : Type u_2} [] {a : S} {b : S} (h : Commute a b) (c : S) :
a * (b * c) = b * (a * c)
theorem AddCommute.add_add_add_comm {S : Type u_2} [] {b : S} {c : S} (hbc : ) (a : S) (d : S) :
a + b + (c + d) = a + c + (b + d)
theorem Commute.mul_mul_mul_comm {S : Type u_2} [] {b : S} {c : S} (hbc : Commute b c) (a : S) (d : S) :
a * b * (c * d) = a * c * (b * d)
theorem AddCommute.all {S : Type u_2} [] (a : S) (b : S) :
theorem Commute.all {S : Type u_2} [] (a : S) (b : S) :
@[simp]
theorem AddCommute.zero_right {M : Type u_2} [] (a : M) :
@[simp]
theorem Commute.one_right {M : Type u_2} [] (a : M) :
@[simp]
theorem AddCommute.zero_left {M : Type u_2} [] (a : M) :
@[simp]
theorem Commute.one_left {M : Type u_2} [] (a : M) :
@[simp]
theorem AddCommute.nsmul_right {M : Type u_2} [] {a : M} {b : M} (h : ) (n : ) :
@[simp]
theorem Commute.pow_right {M : Type u_2} [] {a : M} {b : M} (h : Commute a b) (n : ) :
Commute a (b ^ n)
@[simp]
theorem AddCommute.nsmul_left {M : Type u_2} [] {a : M} {b : M} (h : ) (n : ) :
@[simp]
theorem Commute.pow_left {M : Type u_2} [] {a : M} {b : M} (h : Commute a b) (n : ) :
Commute (a ^ n) b
@[simp]
theorem AddCommute.nsmul_nsmul {M : Type u_2} [] {a : M} {b : M} (h : ) (m : ) (n : ) :
@[simp]
theorem Commute.pow_pow {M : Type u_2} [] {a : M} {b : M} (h : Commute a b) (m : ) (n : ) :
Commute (a ^ m) (b ^ n)
theorem AddCommute.self_nsmul {M : Type u_2} [] (a : M) (n : ) :
theorem Commute.self_pow {M : Type u_2} [] (a : M) (n : ) :
Commute a (a ^ n)
theorem AddCommute.nsmul_self {M : Type u_2} [] (a : M) (n : ) :
theorem Commute.pow_self {M : Type u_2} [] (a : M) (n : ) :
Commute (a ^ n) a
theorem AddCommute.nsmul_nsmul_self {M : Type u_2} [] (a : M) (m : ) (n : ) :
theorem Commute.pow_pow_self {M : Type u_2} [] (a : M) (m : ) (n : ) :
Commute (a ^ m) (a ^ n)
theorem succ_nsmul' {M : Type u_2} [] (a : M) (n : ) :
(n + 1) a = n a + a
theorem pow_succ' {M : Type u_2} [] (a : M) (n : ) :
a ^ (n + 1) = a ^ n * a
theorem AddCommute.add_neg {G : Type u_1} {a : G} {b : G} (hab : ) :
-(a + b) = -a + -b
theorem Commute.mul_inv {G : Type u_1} [] {a : G} {b : G} (hab : Commute a b) :
(a * b)⁻¹ = a⁻¹ * b⁻¹
theorem AddCommute.neg {G : Type u_1} {a : G} {b : G} (hab : ) :
-(a + b) = -a + -b
theorem Commute.inv {G : Type u_1} [] {a : G} {b : G} (hab : Commute a b) :
(a * b)⁻¹ = a⁻¹ * b⁻¹
theorem AddCommute.add_neg_cancel {G : Type u_1} [] {a : G} {b : G} (h : ) :
a + b + -a = b
theorem Commute.mul_inv_cancel {G : Type u_1} [] {a : G} {b : G} (h : Commute a b) :
a * b * a⁻¹ = b
theorem AddCommute.add_neg_cancel_assoc {G : Type u_1} [] {a : G} {b : G} (h : ) :
a + (b + -a) = b
theorem Commute.mul_inv_cancel_assoc {G : Type u_1} [] {a : G} {b : G} (h : Commute a b) :
a * (b * a⁻¹) = b
@[simp]
theorem add_neg_cancel_comm {G : Type u_1} [] (a : G) (b : G) :
a + b + -a = b
@[simp]
theorem mul_inv_cancel_comm {G : Type u_1} [] (a : G) (b : G) :
a * b * a⁻¹ = b
@[simp]
theorem add_neg_cancel_comm_assoc {G : Type u_1} [] (a : G) (b : G) :
a + (b + -a) = b
@[simp]
theorem mul_inv_cancel_comm_assoc {G : Type u_1} [] (a : G) (b : G) :
a * (b * a⁻¹) = b