Monoid and group homomorphisms #
This file defines the bundled structures for monoid and group homomorphisms. Namely, we define
MonoidHom
(resp., AddMonoidHom
) to be bundled homomorphisms between multiplicative (resp.,
additive) monoids or groups.
We also define coercion to a function, and usual operations: composition, identity homomorphism, pointwise multiplication and pointwise inversion.
This file also defines the lesser-used (and notation-less) homomorphism types which are used as building blocks for other homomorphisms:
Notations #
→+
: BundledAddMonoid
homs. Also use forAddGroup
homs.→*
: BundledMonoid
homs. Also use forGroup
homs.→ₙ+
: BundledAddSemigroup
homs.→ₙ*
: BundledSemigroup
homs.
Implementation notes #
There's a coercion from bundled homs to fun, and the canonical notation is to use the bundled hom as a function via this coercion.
There is no GroupHom
-- the idea is that MonoidHom
is used.
The constructor for MonoidHom
needs a proof of map_one
as well
as map_mul
; a separate constructor MonoidHom.mk'
will construct
group homs (i.e. monoid homs between groups) given only a proof
that multiplication is preserved,
Implicit {}
brackets are often used instead of type class []
brackets. This is done when the
instances can be inferred because they are implicit arguments to the type MonoidHom
. When they
can be inferred from the type it is faster to use this method than to use type class inference.
Historically this file also included definitions of unbundled homomorphism classes; they were
deprecated and moved to Deprecated/Group
.
Tags #
MonoidHom, AddMonoidHom
ZeroHom M N
is the type of functions M → N
that preserve zero.
When possible, instead of parametrizing results over (f : ZeroHom M N)
,
you should parametrize over (F : Type*) [ZeroHomClass F M N] (f : F)
.
When you extend this structure, make sure to also extend ZeroHomClass
.
- toFun : M → N
The underlying function
- map_zero' : self.toFun 0 = 0
The proposition that the function preserves 0
Instances For
ZeroHomClass F M N
states that F
is a type of zero-preserving homomorphisms.
You should extend this typeclass when you extend ZeroHom
.
- map_zero (f : F) : f 0 = 0
The proposition that the function preserves 0
Instances
M →ₙ+ N
is the type of functions M → N
that preserve addition. The ₙ
in the notation
stands for "non-unital" because it is intended to match the notation for NonUnitalAlgHom
and
NonUnitalRingHom
, so a AddHom
is a non-unital additive monoid hom.
When possible, instead of parametrizing results over (f : AddHom M N)
,
you should parametrize over (F : Type*) [AddHomClass F M N] (f : F)
.
When you extend this structure, make sure to extend AddHomClass
.
- toFun : M → N
The underlying function
The proposition that the function preserves addition
Instances For
M →ₙ+ N
denotes the type of addition-preserving maps from M
to N
.
Equations
- «term_→ₙ+_» = Lean.ParserDescr.trailingNode `«term_→ₙ+_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " →ₙ+ ") (Lean.ParserDescr.cat `term 25))
Instances For
AddHomClass F M N
states that F
is a type of addition-preserving homomorphisms.
You should declare an instance of this typeclass when you extend AddHom
.
The proposition that the function preserves addition
Instances
M →+ N
is the type of functions M → N
that preserve the AddZeroClass
structure.
AddMonoidHom
is also used for group homomorphisms.
When possible, instead of parametrizing results over (f : M →+ N)
,
you should parametrize over (F : Type*) [AddMonoidHomClass F M N] (f : F)
.
When you extend this structure, make sure to extend AddMonoidHomClass
.
- toFun : M → N
Instances For
M →+ N
denotes the type of additive monoid homomorphisms from M
to N
.
Equations
- «term_→+_» = Lean.ParserDescr.trailingNode `«term_→+_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " →+ ") (Lean.ParserDescr.cat `term 25))
Instances For
AddMonoidHomClass F M N
states that F
is a type of AddZeroClass
-preserving
homomorphisms.
You should also extend this typeclass when you extend AddMonoidHom
.
Instances
OneHom M N
is the type of functions M → N
that preserve one.
When possible, instead of parametrizing results over (f : OneHom M N)
,
you should parametrize over (F : Type*) [OneHomClass F M N] (f : F)
.
When you extend this structure, make sure to also extend OneHomClass
.
- toFun : M → N
The underlying function
- map_one' : self.toFun 1 = 1
The proposition that the function preserves 1
Instances For
OneHomClass F M N
states that F
is a type of one-preserving homomorphisms.
You should extend this typeclass when you extend OneHom
.
- map_one (f : F) : f 1 = 1
The proposition that the function preserves 1
Instances
In principle this could be an instance, but in practice it causes performance issues.
Turn an element of a type F
satisfying OneHomClass F M N
into an actual
OneHom
. This is declared as the default coercion from F
to OneHom M N
.
Equations
- ↑f = { toFun := ⇑f, map_one' := ⋯ }
Instances For
Turn an element of a type F
satisfying ZeroHomClass F M N
into an actual
ZeroHom
. This is declared as the default coercion from F
to ZeroHom M N
.
Equations
- ↑f = { toFun := ⇑f, map_zero' := ⋯ }
Instances For
Any type satisfying OneHomClass
can be cast into OneHom
via OneHomClass.toOneHom
.
Equations
- instCoeTCOneHomOfOneHomClass = { coe := OneHomClass.toOneHom }
Any type satisfying ZeroHomClass
can be cast into ZeroHom
via
ZeroHomClass.toZeroHom
.
Equations
- instCoeTCZeroHomOfZeroHomClass = { coe := ZeroHomClass.toZeroHom }
M →ₙ* N
is the type of functions M → N
that preserve multiplication. The ₙ
in the notation
stands for "non-unital" because it is intended to match the notation for NonUnitalAlgHom
and
NonUnitalRingHom
, so a MulHom
is a non-unital monoid hom.
When possible, instead of parametrizing results over (f : M →ₙ* N)
,
you should parametrize over (F : Type*) [MulHomClass F M N] (f : F)
.
When you extend this structure, make sure to extend MulHomClass
.
- toFun : M → N
The underlying function
The proposition that the function preserves multiplication
Instances For
M →ₙ* N
denotes the type of multiplication-preserving maps from M
to N
.
Equations
- «term_→ₙ*_» = Lean.ParserDescr.trailingNode `«term_→ₙ*_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " →ₙ* ") (Lean.ParserDescr.cat `term 25))
Instances For
MulHomClass F M N
states that F
is a type of multiplication-preserving homomorphisms.
You should declare an instance of this typeclass when you extend MulHom
.
The proposition that the function preserves multiplication
Instances
MulHom
is a type of multiplication-preserving homomorphisms
AddHom
is a type of addition-preserving homomorphisms
Turn an element of a type F
satisfying MulHomClass F M N
into an actual
MulHom
. This is declared as the default coercion from F
to M →ₙ* N
.
Equations
- ↑f = { toFun := ⇑f, map_mul' := ⋯ }
Instances For
Turn an element of a type F
satisfying AddHomClass F M N
into an actual
AddHom
. This is declared as the default coercion from F
to M →ₙ+ N
.
Equations
- ↑f = { toFun := ⇑f, map_add' := ⋯ }
Instances For
Any type satisfying MulHomClass
can be cast into MulHom
via MulHomClass.toMulHom
.
Equations
- instCoeTCMulHomOfMulHomClass = { coe := MulHomClass.toMulHom }
Any type satisfying AddHomClass
can be cast into AddHom
via
AddHomClass.toAddHom
.
Equations
- instCoeTCAddHomOfAddHomClass = { coe := AddHomClass.toAddHom }
M →* N
is the type of functions M → N
that preserve the Monoid
structure.
MonoidHom
is also used for group homomorphisms.
When possible, instead of parametrizing results over (f : M →* N)
,
you should parametrize over (F : Type*) [MonoidHomClass F M N] (f : F)
.
When you extend this structure, make sure to extend MonoidHomClass
.
- toFun : M → N
Instances For
M →* N
denotes the type of monoid homomorphisms from M
to N
.
Equations
- «term_→*_» = Lean.ParserDescr.trailingNode `«term_→*_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " →* ") (Lean.ParserDescr.cat `term 25))
Instances For
MonoidHomClass F M N
states that F
is a type of Monoid
-preserving homomorphisms.
You should also extend this typeclass when you extend MonoidHom
.
Instances
Turn an element of a type F
satisfying MonoidHomClass F M N
into an actual
MonoidHom
. This is declared as the default coercion from F
to M →* N
.
Equations
- ↑f = { toFun := (↑f).toFun, map_one' := ⋯, map_mul' := ⋯ }
Instances For
Turn an element of a type F
satisfying AddMonoidHomClass F M N
into an
actual MonoidHom
. This is declared as the default coercion from F
to M →+ N
.
Equations
- ↑f = { toFun := (↑f).toFun, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Any type satisfying MonoidHomClass
can be cast into MonoidHom
via
MonoidHomClass.toMonoidHom
.
Equations
- instCoeTCMonoidHomOfMonoidHomClass = { coe := MonoidHomClass.toMonoidHom }
Any type satisfying AddMonoidHomClass
can be cast into AddMonoidHom
via
AddMonoidHomClass.toAddMonoidHom
.
Equations
- instCoeTCAddMonoidHomOfAddMonoidHomClass = { coe := AddMonoidHomClass.toAddMonoidHom }
Group homomorphisms preserve division.
Additive group homomorphisms preserve subtraction.
Bundled morphisms can be down-cast to weaker bundlings
MonoidHom
down-cast to a OneHom
, forgetting the multiplicative property.
Equations
- MonoidHom.coeToOneHom = { coe := MonoidHom.toOneHom }
AddMonoidHom
down-cast to a ZeroHom
, forgetting the additive property
Equations
- AddMonoidHom.coeToZeroHom = { coe := AddMonoidHom.toZeroHom }
MonoidHom
down-cast to a MulHom
, forgetting the 1-preserving property.
Equations
- MonoidHom.coeToMulHom = { coe := MonoidHom.toMulHom }
AddMonoidHom
down-cast to an AddHom
, forgetting the 0-preserving property.
Equations
- AddMonoidHom.coeToAddHom = { coe := AddMonoidHom.toAddHom }
Makes a group homomorphism from a proof that the map preserves multiplication.
Equations
- MonoidHom.mk' f map_mul = { toFun := f, map_one' := ⋯, map_mul' := map_mul }
Instances For
Makes an additive group homomorphism from a proof that the map preserves addition.
Equations
- AddMonoidHom.mk' f map_mul = { toFun := f, map_zero' := ⋯, map_add' := map_mul }
Instances For
Copy of a MonoidHom
with a new toFun
equal to the old one. Useful to fix
definitional equalities.
Equations
- f.copy f' h = { toOneHom := (↑f).copy f' h, map_mul' := ⋯ }
Instances For
Copy of an AddMonoidHom
with a new toFun
equal to the old one. Useful to fix
definitional equalities.
Equations
- f.copy f' h = { toZeroHom := (↑f).copy f' h, map_add' := ⋯ }
Instances For
If f
is a monoid homomorphism then f 1 = 1
.
If f
is an additive monoid homomorphism then f 0 = 0
.
If f
is a monoid homomorphism then f (a * b) = f a * f b
.
If f
is an additive monoid homomorphism then f (a + b) = f a + f b
.
Given a monoid homomorphism f : M →* N
and an element x : M
, if x
has a right inverse,
then f x
has a right inverse too. For elements invertible on both sides see IsUnit.map
.
Given an AddMonoid homomorphism f : M →+ N
and an element x : M
, if x
has
a right inverse, then f x
has a right inverse too.
Given a monoid homomorphism f : M →* N
and an element x : M
, if x
has a left inverse,
then f x
has a left inverse too. For elements invertible on both sides see IsUnit.map
.
Given an AddMonoid homomorphism f : M →+ N
and an element x : M
, if x
has
a left inverse, then f x
has a left inverse too. For elements invertible on both sides see
IsAddUnit.map
.
The identity map from a type with zero to itself.
Equations
- ZeroHom.id M = { toFun := fun (x : M) => x, map_zero' := ⋯ }
Instances For
The identity map from a monoid to itself.
Equations
- MonoidHom.id M = { toFun := fun (x : M) => x, map_one' := ⋯, map_mul' := ⋯ }
Instances For
The identity map from an additive monoid to itself.
Equations
- AddMonoidHom.id M = { toFun := fun (x : M) => x, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Composition of monoid morphisms as a monoid morphism.
Instances For
Composition of additive monoid morphisms as an additive monoid morphism.
Instances For
Makes a multiplicative inverse from a bijection which preserves multiplication.
Equations
- f.inverse g h₁ h₂ = { toFun := g, map_mul' := ⋯ }
Instances For
Makes an additive inverse from a bijection which preserves addition.
Equations
- f.inverse g h₁ h₂ = { toFun := g, map_add' := ⋯ }
Instances For
The inverse of a bijective MonoidHom
is a MonoidHom
.
Equations
- f.inverse g h₁ h₂ = { toFun := g, map_one' := ⋯, map_mul' := ⋯ }
Instances For
The inverse of a bijective AddMonoidHom
is an AddMonoidHom
.
Equations
- f.inverse g h₁ h₂ = { toFun := g, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Equations
- Monoid.End.instFunLike M = MonoidHom.instFunLike
Equations
- Monoid.End.instOne M = { one := MonoidHom.id M }
Equations
- Monoid.End.instMul M = { mul := MonoidHom.comp }
Equations
- Monoid.End.inst M = Monoid.mk ⋯ ⋯ (fun (n : ℕ) (f : Monoid.End M) => MonoidHom.copy (npowRec n f) (⇑f)^[n] ⋯) ⋯ ⋯
Equations
- Monoid.End.instInhabited M = { default := 1 }
Equations
- AddMonoid.End.instFunLike A = AddMonoidHom.instFunLike
Equations
- AddMonoid.End.instOne A = { one := AddMonoidHom.id A }
Equations
- AddMonoid.End.instMul A = { mul := AddMonoidHom.comp }
Equations
- AddMonoid.End.monoid A = Monoid.mk ⋯ ⋯ (fun (n : ℕ) (f : AddMonoid.End A) => AddMonoidHom.copy (npowRec n f) (⇑f)^[n] ⋯) ⋯ ⋯
Equations
- AddMonoid.End.instInhabited A = { default := 1 }
1
is the multiplicative homomorphism sending all elements to 1
.
Equations
- instOneMulHom = { one := { toFun := fun (x : M) => 1, map_mul' := ⋯ } }
0
is the additive homomorphism sending all elements to 0
Equations
- instZeroAddHom = { zero := { toFun := fun (x : M) => 0, map_add' := ⋯ } }
1
is the monoid homomorphism sending all elements to 1
.
Equations
- instOneMonoidHom = { one := { toFun := fun (x : M) => 1, map_one' := ⋯, map_mul' := ⋯ } }
0
is the additive monoid homomorphism sending all elements to 0
.
Equations
- instZeroAddMonoidHom = { zero := { toFun := fun (x : M) => 0, map_zero' := ⋯, map_add' := ⋯ } }
Equations
- instInhabitedMulHom = { default := 1 }
Equations
- instInhabitedAddHom = { default := 0 }
Equations
- instInhabitedMonoidHom = { default := 1 }
Equations
- instInhabitedAddMonoidHom = { default := 0 }
Group homomorphisms preserve inverse.
Additive group homomorphisms preserve negation.
Group homomorphisms preserve division.
Additive group homomorphisms preserve subtraction.