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
.
Two elements additively commute if a + b = b + a
Equations
- AddCommute a b = AddSemiconjBy a b b
Equality behind add_commute a b
; useful for rewriting.
Any element commutes with itself.
If a
commutes with b
, then b
commutes with a
.
Equations
- (_ : IsRefl G fun a b => AddCommute (f a) (f b)) = (_ : IsRefl G fun a b => AddCommute (f a) (f b))
If a
commutes with both b
and c
, then it commutes with their sum.
If both a
and b
commute with c
, then their product commutes with c
.
If the sum of two commuting elements is an additive unit, then the left summand is an additive unit.
Equations
- (_ : AddCommute b a) = (_ : AddCommute b a)
If the sum of two commuting elements is an additive unit, then the right summand is an additive unit.
Equations
- AddUnits.rightOfAdd u a b hu hc = AddUnits.leftOfAdd u b a (_ : b + a = ↑u) (_ : AddCommute b a)
If the product of two commuting elements is a unit, then the right multiplier is a unit.
Equations
- Units.rightOfMul u a b hu hc = Units.leftOfMul u b a (_ : b * a = ↑u) (_ : Commute b a)
Equations
- AddCommute.isAddUnit_add_iff.match_1 motive x h_1 = Exists.casesOn x fun w h => h_1 w h