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
- toFun : M → N
The underlying function
- map_zero' : ZeroHom.toFun s 0 = 0
The proposition that the function preserves 0
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
.
Instances For
- coe : F → M → N
- coe_injective' : Function.Injective FunLike.coe
- map_zero : ∀ (f : F), ↑f 0 = 0
The proposition that the function preserves 0
ZeroHomClass F M N
states that F
is a type of zero-preserving homomorphisms.
You should extend this typeclass when you extend ZeroHom
.
Instances
- toFun : M → N
The underlying function
- map_add' : ∀ (x y : M), AddHom.toFun s (x + y) = AddHom.toFun s x + AddHom.toFun s y
The proposition that the function preserves addition
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
.
Instances For
- coe : F → M → N
- coe_injective' : Function.Injective FunLike.coe
The proposition that the function preserves addition
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
.
Instances
- toFun : M → N
- map_zero' : ZeroHom.toFun (↑s) 0 = 0
- map_add' : ∀ (x y : M), ZeroHom.toFun (↑s) (x + y) = ZeroHom.toFun (↑s) x + ZeroHom.toFun (↑s) y
The proposition that the function preserves addition
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
.
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
- coe : F → M → N
- coe_injective' : Function.Injective FunLike.coe
- map_zero : ∀ (f : F), ↑f 0 = 0
The proposition that the function preserves 0
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
- toFun : M → N
The underlying function
- map_one' : OneHom.toFun s 1 = 1
The proposition that the function preserves 1
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
.
Instances For
- coe : F → M → N
- coe_injective' : Function.Injective FunLike.coe
- map_one : ∀ (f : F), ↑f 1 = 1
The proposition that the function preserves 1
OneHomClass F M N
states that F
is a type of one-preserving homomorphisms.
You should extend this typeclass when you extend OneHom
.
Instances
Equations
- ZeroHom.zeroHomClass = ZeroHomClass.mk (_ : ∀ (self : ZeroHom M N), ZeroHom.toFun self 0 = 0)
Equations
- OneHom.oneHomClass = OneHomClass.mk (_ : ∀ (self : OneHom M N), OneHom.toFun self 1 = 1)
In principle this could be an instance, but in practice it causes performance issues.
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 }
- toFun : M → N
The underlying function
- map_mul' : ∀ (x y : M), MulHom.toFun s (x * y) = MulHom.toFun s x * MulHom.toFun s y
The proposition that the function preserves multiplication
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
.
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
- coe : F → M → N
- coe_injective' : Function.Injective FunLike.coe
The proposition that the function preserves multiplication
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
.
Instances
AddHom
is a type of addition-preserving homomorphisms
Equations
- AddHom.addHomClass = AddHomClass.mk (_ : ∀ (self : AddHom M N) (x y : M), AddHom.toFun self (x + y) = AddHom.toFun self x + AddHom.toFun self y)
MulHom
is a type of multiplication-preserving homomorphisms
Equations
- MulHom.mulHomClass = MulHomClass.mk (_ : ∀ (self : M →ₙ* N) (x y : M), MulHom.toFun self (x * y) = MulHom.toFun self x * MulHom.toFun self y)
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 }
- toFun : M → N
- map_one' : OneHom.toFun (↑s) 1 = 1
- map_mul' : ∀ (x y : M), OneHom.toFun (↑s) (x * y) = OneHom.toFun (↑s) x * OneHom.toFun (↑s) y
The proposition that the function preserves multiplication
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
.
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
- coe : F → M → N
- coe_injective' : Function.Injective FunLike.coe
- map_one : ∀ (f : F), ↑f 1 = 1
The proposition that the function preserves 1
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
- AddMonoidHom.addMonoidHomClass = AddMonoidHomClass.mk (_ : ∀ (f : M →+ N), ZeroHom.toFun (↑f) 0 = 0)
Equations
- MonoidHom.monoidHomClass = MonoidHomClass.mk (_ : ∀ (f : M →* N), OneHom.toFun (↑f) 1 = 1)
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
- map_nsmul.match_1 motive x h_1 h_2 = Nat.casesOn x (h_1 ()) fun n => h_2 n
Instances For
Equations
- map_zsmul'.match_1 motive x h_1 h_2 = Int.casesOn x (fun a => h_1 a) fun a => h_2 a
Instances For
- toFun : M → N
- map_zero' : ZeroHom.toFun (↑s) 0 = 0
- map_one' : ZeroHom.toFun (↑s) 1 = 1
The proposition that the function preserves 1
- map_mul' : ∀ (x y : M), ZeroHom.toFun (↑s) (x * y) = ZeroHom.toFun (↑s) x * ZeroHom.toFun (↑s) y
The proposition that the function preserves multiplication
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
.
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
- coe : F → M → N
- coe_injective' : Function.Injective FunLike.coe
- map_one : ∀ (f : F), ↑f 1 = 1
- map_zero : ∀ (f : F), ↑f 0 = 0
The proposition that the function preserves 0
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
- MonoidWithZeroHom.monoidWithZeroHomClass = MonoidWithZeroHomClass.mk (_ : ∀ (f : M →*₀ N), ZeroHom.toFun (↑f) 0 = 0)
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 FunLike.congr_fun
instead.
Deprecated: use FunLike.congr_fun
instead.
Deprecated: use FunLike.congr_fun
instead.
Deprecated: use FunLike.congr_arg
instead.
Deprecated: use FunLike.congr_arg
instead.
Deprecated: use FunLike.congr_arg
instead.
Deprecated: use FunLike.congr_arg
instead.
Deprecated: use FunLike.congr_arg
instead.
Deprecated: use FunLike.congr_arg
instead.
Deprecated: use FunLike.congr_arg
instead.
Deprecated: use FunLike.coe_injective
instead.
Deprecated: use FunLike.coe_injective
instead.
Deprecated: use FunLike.coe_injective
instead.
Deprecated: use FunLike.ext_iff
instead.
Deprecated: use FunLike.ext_iff
instead.
Deprecated: use FunLike.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
.
Equations
- AddMonoidHom.map_exists_right_neg.match_1 motive hx h_1 = Exists.casesOn hx fun w h => h_1 w h
Instances For
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
.
Equations
- AddMonoidHom.map_exists_left_neg.match_1 motive hx h_1 = Exists.casesOn hx fun w h => h_1 w h
Instances For
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 => x, map_zero' := (_ : (fun x => x) 0 = (fun x => 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
- One or more equations did not get rendered due to their size.
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.instMonoidHomClassEnd M = MonoidHom.monoidHomClass
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.instAddMonoidHomClassEnd A = AddMonoidHom.addMonoidHomClass
0
is the additive monoid homomorphism sending all elements to 0
.
1
is the monoid homomorphism sending all elements to 1
.
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.