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.→*₀
: BundledMonoidWithZero
homs. Also use forGroupWithZero
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
AddHom M N
is the type of functions M → N
that preserve addition.
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
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
- map_zero' : (↑self).toFun 0 = 0
The proposition that the function preserves addition
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
Equations
- (_ : ZeroHomClass (ZeroHom M N) M N) = (_ : ZeroHomClass (ZeroHom M N) M N)
Equations
- (_ : OneHomClass (OneHom M N) M N) = (_ : OneHomClass (OneHom M N) M N)
In principle this could be an instance, but in practice it causes performance issues.
Equations
- (_ : Subsingleton (ZeroHom M N)) = (_ : Subsingleton (ZeroHom M N))
Equations
- (_ : Subsingleton (OneHom M N)) = (_ : Subsingleton (OneHom M N))
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
.
Instances For
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
.
Instances For
Any type satisfying ZeroHomClass
can be cast into ZeroHom
via
ZeroHomClass.toZeroHom
.
Equations
- instCoeTCZeroHom = { coe := ZeroHomClass.toZeroHom }
Any type satisfying OneHomClass
can be cast into OneHom
via OneHomClass.toOneHom
.
Equations
- instCoeTCOneHom = { coe := OneHomClass.toOneHom }
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
AddHom
is a type of addition-preserving homomorphisms
Equations
- (_ : AddHomClass (AddHom M N) M N) = (_ : AddHomClass (AddHom M N) M N)
MulHom
is a type of multiplication-preserving homomorphisms
Equations
- (_ : MulHomClass (M →ₙ* N) M N) = (_ : MulHomClass (M →ₙ* N) M N)
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
.
Instances For
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
.
Instances For
Any type satisfying AddHomClass
can be cast into AddHom
via
AddHomClass.toAddHom
.
Equations
- instCoeTCAddHom = { coe := AddHomClass.toAddHom }
Any type satisfying MulHomClass
can be cast into MulHom
via MulHomClass.toMulHom
.
Equations
- instCoeTCMulHom = { coe := MulHomClass.toMulHom }
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
- map_one' : (↑self).toFun 1 = 1
The proposition that the function preserves multiplication
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
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- (_ : AddMonoidHomClass (M →+ N) M N) = (_ : AddMonoidHomClass (M →+ N) M N)
Equations
- (_ : MonoidHomClass (M →* N) M N) = (_ : MonoidHomClass (M →* N) M N)
Equations
- (_ : Subsingleton (M →+ N)) = (_ : Subsingleton (M →+ N))
Equations
- (_ : Subsingleton (M →* N)) = (_ : Subsingleton (M →* N))
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
- One or more equations did not get rendered due to their size.
Instances For
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
- One or more equations did not get rendered due to their size.
Instances For
Any type satisfying AddMonoidHomClass
can be cast into AddMonoidHom
via
AddMonoidHomClass.toAddMonoidHom
.
Equations
- instCoeTCAddMonoidHom = { coe := AddMonoidHomClass.toAddMonoidHom }
Any type satisfying MonoidHomClass
can be cast into MonoidHom
via
MonoidHomClass.toMonoidHom
.
Equations
- instCoeTCMonoidHom = { coe := MonoidHomClass.toMonoidHom }
Additive group homomorphisms preserve subtraction.
Group homomorphisms preserve division.
Equations
- (_ : motive x) = (_ : motive x)
Instances For
M →*₀ N
is the type of functions M → N
that preserve
the MonoidWithZero
structure.
MonoidWithZeroHom
is also used for group homomorphisms.
When possible, instead of parametrizing results over (f : M →*₀ N)
,
you should parametrize over (F : Type*) [MonoidWithZeroHomClass F M N] (f : F)
.
When you extend this structure, make sure to extend MonoidWithZeroHomClass
.
- toFun : M → N
- map_zero' : (↑self).toFun 0 = 0
- map_one' : (↑self).toFun 1 = 1
The proposition that the function preserves 1
The proposition that the function preserves multiplication
Instances For
M →*₀ N
denotes the type of zero-preserving 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
MonoidWithZeroHomClass F M N
states that F
is a type of
MonoidWithZero
-preserving homomorphisms.
You should also extend this typeclass when you extend MonoidWithZeroHom
.
Instances
Equations
- One or more equations did not get rendered due to their size.
Equations
- (_ : MonoidWithZeroHomClass (M →*₀ N) M N) = (_ : MonoidWithZeroHomClass (M →*₀ N) M N)
Equations
- (_ : Subsingleton (M →*₀ N)) = (_ : Subsingleton (M →*₀ N))
Turn an element of a type F
satisfying MonoidWithZeroHomClass F M N
into an actual
MonoidWithZeroHom
. This is declared as the default coercion from F
to M →*₀ N
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Any type satisfying MonoidWithZeroHomClass
can be cast into MonoidWithZeroHom
via
MonoidWithZeroHomClass.toMonoidWithZeroHom
.
Equations
- instCoeTCMonoidWithZeroHom = { coe := MonoidWithZeroHomClass.toMonoidWithZeroHom }
Bundled morphisms can be down-cast to weaker bundlings
AddMonoidHom
down-cast to a ZeroHom
, forgetting the additive property
Equations
- AddMonoidHom.coeToZeroHom = { coe := AddMonoidHom.toZeroHom }
MonoidHom
down-cast to a OneHom
, forgetting the multiplicative property.
Equations
- MonoidHom.coeToOneHom = { coe := MonoidHom.toOneHom }
AddMonoidHom
down-cast to an AddHom
, forgetting the 0-preserving property.
Equations
- AddMonoidHom.coeToAddHom = { coe := AddMonoidHom.toAddHom }
MonoidHom
down-cast to a MulHom
, forgetting the 1-preserving property.
Equations
- MonoidHom.coeToMulHom = { coe := MonoidHom.toMulHom }
MonoidWithZeroHom
down-cast to a MonoidHom
, forgetting the 0-preserving property.
Equations
- MonoidWithZeroHom.coeToMonoidHom = { coe := MonoidWithZeroHom.toMonoidHom }
MonoidWithZeroHom
down-cast to a ZeroHom
, forgetting the monoidal property.
Equations
- MonoidWithZeroHom.coeToZeroHom = { coe := MonoidWithZeroHom.toZeroHom }
Makes an additive group homomorphism from a proof that the map preserves addition.
Equations
- AddMonoidHom.mk' f map_mul = { toZeroHom := { toFun := f, map_zero' := (_ : f 0 = 0) }, map_add' := map_mul }
Instances For
Makes a group homomorphism from a proof that the map preserves multiplication.
Equations
- MonoidHom.mk' f map_mul = { toOneHom := { toFun := f, map_one' := (_ : f 1 = 1) }, map_mul' := map_mul }
Instances For
Deprecated: use DFunLike.congr_fun
instead.
Deprecated: use DFunLike.congr_fun
instead.
Deprecated: use DFunLike.congr_fun
instead.
Deprecated: use DFunLike.congr_arg
instead.
Deprecated: use DFunLike.congr_arg
instead.
Deprecated: use DFunLike.congr_arg
instead.
Deprecated: use DFunLike.congr_arg
instead.
Deprecated: use DFunLike.congr_arg
instead.
Deprecated: use DFunLike.congr_arg
instead.
Deprecated: use DFunLike.congr_arg
instead.
Deprecated: use DFunLike.coe_injective
instead.
Deprecated: use DFunLike.coe_injective
instead.
Deprecated: use DFunLike.coe_injective
instead.
Deprecated: use DFunLike.ext_iff
instead.
Deprecated: use DFunLike.ext_iff
instead.
Deprecated: use DFunLike.ext_iff
instead.
Copy of a ZeroHom
with a new toFun
equal to the old one. Useful to fix
definitional equalities.
Equations
- ZeroHom.copy f f' h = { toFun := f', map_zero' := (_ : f' 0 = 0) }
Instances For
Copy of an AddHom
with a new toFun
equal to the old one. Useful to fix
definitional equalities.
Equations
- AddHom.copy f f' h = { toFun := f', map_add' := (_ : ∀ (x y : M), f' (x + y) = f' x + f' y) }
Instances For
Copy of a MulHom
with a new toFun
equal to the old one. Useful to fix definitional
equalities.
Equations
- MulHom.copy f f' h = { toFun := f', map_mul' := (_ : ∀ (x y : M), f' (x * y) = f' x * f' y) }
Instances For
Copy of an AddMonoidHom
with a new toFun
equal to the old one. Useful to fix
definitional equalities.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Copy of a MonoidHom
with a new toFun
equal to the old one. Useful to fix
definitional equalities.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Copy of a MonoidHom
with a new toFun
equal to the old one. Useful to fix
definitional equalities.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If f
is an additive monoid homomorphism then f 0 = 0
.
If f
is a monoid homomorphism then f 1 = 1
.
If f
is an additive monoid homomorphism then f (a + b) = f a + f b
.
If f
is a monoid homomorphism then f (a * b) = f a * f b
.
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 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 left inverse, then f x
has a left inverse too. For elements invertible on both sides see
IsAddUnit.map
.
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
.
The identity map from a type with zero to itself.
Equations
- ZeroHom.id M = { toFun := fun (x : M) => x, map_zero' := (_ : (fun (x : M) => x) 0 = (fun (x : M) => x) 0) }
Instances For
The identity map from an additive monoid to itself.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The identity map from a monoid to itself.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The identity map from a MonoidWithZero
to itself.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Composition of additive monoid morphisms as an additive monoid morphism.
Equations
Instances For
Composition of monoid morphisms as a monoid morphism.
Equations
Instances For
Composition of MonoidWithZeroHom
s as a MonoidWithZeroHom
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Composition of additive monoid homomorphisms is associative.
Composition of monoid homomorphisms is associative.
Equations
- Monoid.End.instMonoidEnd M = Monoid.mk (_ : ∀ (f : M →* M), MonoidHom.comp (MonoidHom.id M) f = f) (_ : ∀ (f : M →* M), MonoidHom.comp f (MonoidHom.id M) = f) npowRec
Equations
- Monoid.End.instInhabitedEnd M = { default := 1 }
Equations
- Monoid.End.instFunLikeEnd M = MonoidHom.instFunLike
Equations
- (_ : MonoidHomClass (Monoid.End M) M M) = (_ : MonoidHomClass (M →* M) M M)
Equations
- AddMonoid.End.monoid A = Monoid.mk (_ : ∀ (f : A →+ A), AddMonoidHom.comp (AddMonoidHom.id A) f = f) (_ : ∀ (f : A →+ A), AddMonoidHom.comp f (AddMonoidHom.id A) = f) npowRec
Equations
- AddMonoid.End.instInhabitedEnd A = { default := 1 }
Equations
- AddMonoid.End.instFunLikeEnd A = AddMonoidHom.instFunLike
Equations
- (_ : AddMonoidHomClass (AddMonoid.End A) A A) = (_ : AddMonoidHomClass (A →+ A) A A)
0
is the additive monoid homomorphism sending all elements to 0
.
Equations
- One or more equations did not get rendered due to their size.
1
is the monoid homomorphism sending all elements to 1
.
Equations
- One or more equations did not get rendered due to their size.
Equations
- instInhabitedAddHomToAdd = { default := 0 }
Equations
- instInhabitedMulHomToMul = { default := 1 }
Equations
- instInhabitedAddMonoidHom = { default := 0 }
Equations
- instInhabitedMonoidHom = { default := 1 }
Equations
- instInhabitedMonoidWithZeroHom = { default := MonoidWithZeroHom.id M }
Additive group homomorphisms preserve negation.
Group homomorphisms preserve inverse.
Additive group homomorphisms preserve subtraction.
Group homomorphisms preserve division.