Units (i.e., invertible elements) of a monoid #
An element of a Monoid
is a unit if it has a two-sided inverse.
Main declarations #
Units M
: the group of units (i.e., invertible elements) of a monoid.IsUnit x
: a predicate asserting thatx
is a unit (i.e., invertible element) of a monoid.
For both declarations, there is an additive counterpart: AddUnits
and IsAddUnit
.
See also Prime
, Associated
, and Irreducible
in Mathlib.Algebra.Associated
.
Notation #
We provide Mˣ
as notation for Units M
,
resembling the notation $R^{\times}$ for the units of a ring, which is common in mathematics.
TODO #
The results here should be used to golf the basic Group
lemmas.
Units of a Monoid
, bundled version. Notation: αˣ
.
An element of a Monoid
is a unit if it has a two-sided inverse.
This version bundles the inverse element so that it can be computed.
For a predicate see IsUnit
.
Equations
- «term_ˣ» = Lean.ParserDescr.trailingNode `«term_ˣ» 1024 1024 (Lean.ParserDescr.symbol "ˣ")
Instances For
A unit can be interpreted as a term in the base Monoid
.
Equations
- Units.instCoeHead = { coe := Units.val }
An additive unit can be interpreted as a term in the base AddMonoid
.
Equations
- AddUnits.instCoeHead = { coe := AddUnits.val }
The inverse of a unit in a Monoid
.
Equations
- Units.instInv = { inv := fun (u : αˣ) => { val := u.inv, inv := ↑u, val_inv := ⋯, inv_val := ⋯ } }
The additive inverse of an additive unit in an AddMonoid
.
Equations
- AddUnits.instNeg = { neg := fun (u : AddUnits α) => { val := u.neg, neg := ↑u, val_neg := ⋯, neg_val := ⋯ } }
Units have decidable equality if the base Monoid
has decidable equality.
Equations
- x✝¹.instDecidableEq x✝ = decidable_of_iff' (↑x✝¹ = ↑x✝) ⋯
Additive units have decidable equality
if the base AddMonoid
has deciable equality.
Equations
- x✝¹.instDecidableEq x✝ = decidable_of_iff' (↑x✝¹ = ↑x✝) ⋯
Units of a monoid have a unit
Equations
- Units.instOne = { one := { val := 1, inv := 1, val_inv := ⋯, inv_val := ⋯ } }
Additive units of an additive monoid have a zero.
Equations
- AddUnits.instZero = { zero := { val := 0, neg := 0, val_neg := ⋯, neg_val := ⋯ } }
Units of a monoid have a multiplication and multiplicative identity.
Equations
Additive units of an additive monoid have an addition and an additive identity.
Equations
Units of a monoid are inhabited because 1
is a unit.
Equations
- Units.instInhabited = { default := 1 }
Additive units of an additive monoid are inhabited because 0
is an additive unit.
Equations
- AddUnits.instInhabited = { default := 0 }
Additive units of an additive monoid have a representation of the base value in
the AddMonoid
.
Equations
- AddUnits.instRepr = { reprPrec := reprPrec ∘ AddUnits.val }
Equations
- AddUnits.instAddMonoid = AddMonoid.mk ⋯ ⋯ (fun (n : ℕ) (a : AddUnits α) => { val := n • ↑a, neg := n • ↑(-a), val_neg := ⋯, neg_val := ⋯ }) ⋯ ⋯
Units of a monoid form a DivInvMonoid
.
Equations
- Units.instDivInvMonoid = DivInvMonoid.mk ⋯ (fun (n : ℤ) (a : αˣ) => match n, a with | Int.ofNat n, a => a ^ n | Int.negSucc n, a => (a ^ n.succ)⁻¹) ⋯ ⋯ ⋯
Additive units of an additive monoid form a SubNegMonoid
.
Equations
- AddUnits.instSubNegAddMonoid = SubNegMonoid.mk ⋯ (fun (n : ℤ) (a : AddUnits α) => match n, a with | Int.ofNat n, a => n • a | Int.negSucc n, a => -(n.succ • a)) ⋯ ⋯ ⋯
Units of a monoid form a group.
Equations
Additive units of an additive monoid form an additive group.
Equations
Units of a commutative monoid form a commutative group.
Equations
Additive units of an additive commutative monoid form an additive commutative group.
Equations
For a, b
in a CommMonoid
such that a * b = 1
, makes a unit out of a
.
Equations
- Units.mkOfMulEqOne a b hab = { val := a, inv := b, val_inv := hab, inv_val := ⋯ }
Instances For
For a, b
in an AddCommMonoid
such that a + b = 0
, makes an addUnit out of a
.
Equations
- AddUnits.mkOfAddEqZero a b hab = { val := a, neg := b, val_neg := hab, neg_val := ⋯ }
Instances For
Partial division. It is defined when the
second argument is invertible, and unlike the division operator
in DivisionRing
it is not totalized at zero.
Equations
- «term_/ₚ_» = Lean.ParserDescr.trailingNode `«term_/ₚ_» 70 70 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " /ₚ ") (Lean.ParserDescr.cat `term 71))
Instances For
The element of the group of units, corresponding to an element of a monoid which is a unit. When
α
is a DivisionMonoid
, use IsUnit.unit'
instead.
Equations
- h.unit = (Classical.choose h).copy a ⋯ ↑(Classical.choose h)⁻¹ ⋯
Instances For
"The element of the additive group of additive units, corresponding to an element of
an additive monoid which is an additive unit. When α
is a SubtractionMonoid
, use
IsAddUnit.addUnit'
instead.
Equations
- h.addUnit = (Classical.choose h).copy a ⋯ ↑(-Classical.choose h) ⋯
Instances For
The element of the group of units, corresponding to an element of a monoid which is a unit. As
opposed to IsUnit.unit
, the inverse is computable and comes from the inversion on α
. This is
useful to transfer properties of inversion in Units α
to α
. See also toUnits
.
Instances For
The element of the additive group of additive units, corresponding to an element of
an additive monoid which is an additive unit. As opposed to IsAddUnit.addUnit
, the negation is
computable and comes from the negation on α
. This is useful to transfer properties of negation
in AddUnits α
to α
. See also toAddUnits
.
Instances For
Constructs an inv operation for a Monoid
consisting only of units.
Equations
- invOfIsUnit h = { inv := fun (a : M) => ↑⋯.unit⁻¹ }
Instances For
Constructs a CommGroup
structure on a CommMonoid
consisting only of units.