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
The underlying function
toFun : M → NThe proposition that the function preserves 0
map_zero' : toFun 0 = 0
ZeroHom M N
is the type of functions M → N→ 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
The proposition that the function preserves 0
map_zero : ∀ (f : F), ↑f 0 = 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
The underlying function
toFun : M → NThe proposition that the function preserves addition
AddHom M N
is the type of functions M → N→ 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
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
The proposition that the function preserves addition
map_add' : ∀ (x y : M), ZeroHom.toFun toZeroHom (x + y) = ZeroHom.toFun toZeroHom x + ZeroHom.toFun toZeroHom y
M →+ N→+ N
is the type of functions M → N→ N
that preserve the AddZeroClass
structure.
AddMonoidHom
is also used for group homomorphisms.
When possible, instead of parametrizing results over (f : M →+ N)→+ 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→+ 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))
The proposition that the function preserves 0
map_zero : ∀ (f : F), ↑f 0 = 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
The underlying function
toFun : M → NThe proposition that the function preserves 1
map_one' : toFun 1 = 1
OneHom M N
is the type of functions M → N→ 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
The proposition that the function preserves 1
map_one : ∀ (f : F), ↑f 1 = 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)
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
.
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
.
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 }
The underlying function
toFun : M → NThe proposition that the function preserves multiplication
M →ₙ* N→ₙ* N
is the type of functions M → N→ 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)→ₙ* 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→ₙ* 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))
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-preseving 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→ₙ+ N
.
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→ₙ* N
.
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 }
The proposition that the function preserves multiplication
map_mul' : ∀ (x y : M), OneHom.toFun toOneHom (x * y) = OneHom.toFun toOneHom x * OneHom.toFun toOneHom y
M →* N→* N
is the type of functions M → N→ N
that preserve the Monoid
structure.
MonoidHom
is also used for group homomorphisms.
When possible, instead of parametrizing results over (f : M →+ N)→+ 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→* 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))
The proposition that the function preserves 1
map_one : ∀ (f : F), ↑f 1 = 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
- (_ : ZeroHom.toFun (↑f) 0 = 0) = (_ : ZeroHom.toFun (↑f) 0 = 0)
Equations
- MonoidHom.monoidHomClass = MonoidHomClass.mk (_ : ∀ (f : M →* N), OneHom.toFun (↑f) 1 = 1)
Equations
- (_ : ZeroHom.toFun (↑f) 0 = 0) = (_ : ZeroHom.toFun (↑f) 0 = 0)
Equations
- (_ : ∀ (x y : M), AddHom.toFun (↑f) (x + y) = AddHom.toFun (↑f) x + AddHom.toFun (↑f) y) = (_ : ∀ (x y : M), AddHom.toFun (↑f) (x + y) = AddHom.toFun (↑f) x + AddHom.toFun (↑f) y)
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→+ N
.
Equations
- One or more equations did not get rendered due to their size.
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→* N
.
Equations
- One or more equations did not get rendered due to their size.
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
Equations
- map_zsmul'.match_1 motive x h_1 h_2 = Int.casesOn x (fun a => h_1 a) fun a => h_2 a
The proposition that the function preserves 1
map_one' : ZeroHom.toFun toZeroHom 1 = 1The proposition that the function preserves multiplication
map_mul' : ∀ (x y : M), ZeroHom.toFun toZeroHom (x * y) = ZeroHom.toFun toZeroHom x * ZeroHom.toFun toZeroHom y
M →*₀ N→*₀ N
is the type of functions M → N→ N
that preserve
the MonoidWithZero
structure.
MonoidWithZeroHom
is also used for group homomorphisms.
When possible, instead of parametrizing results over (f : M →*₀ N)→*₀ 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→*₀ 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))
The proposition that the function preserves 0
map_zero : ∀ (f : F), ↑f 0 = 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→*₀ N
.
Equations
- One or more equations did not get rendered due to their size.
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 }
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.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) }
Copy of a OneHom
with a new toFun
equal to the old one. Useful to fix definitional
equalities.
Equations
- OneHom.copy f f' h = { toFun := f', map_one' := (_ : f' 1 = 1) }
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) }
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) }
Equations
- One or more equations did not get rendered due to their size.
Equations
- (_ : ZeroHom.toFun (ZeroHom.copy (↑f) f' h) 0 = 0) = (_ : ZeroHom.toFun (ZeroHom.copy (↑f) f' h) 0 = 0)
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.
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.
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.
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→+ N
and an element x : M
, if x
has
a right inverse, then f x
has a right inverse too.
Equations
- AddMonoidHom.map_exists_right_neg.match_1 motive hx h_1 = Exists.casesOn hx fun w h => h_1 w h
Given a monoid homomorphism f : M →* N→* 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→+ 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
Given a monoid homomorphism f : M →* N→* 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
.
Negation on a commutative additive group, considered as an additive monoid homomorphism.
The identity map from an type with zero to itself.
Equations
- ZeroHom.id M = { toFun := fun x => x, map_zero' := (_ : (fun x => x) 0 = (fun x => x) 0) }
Equations
- One or more equations did not get rendered due to their size.
The identity map from an additive monoid to itself.
Equations
- One or more equations did not get rendered due to their size.
The identity map from a monoid to itself.
Equations
- One or more equations did not get rendered due to their size.
The identity map from a MonoidWithZero
to itself.
Equations
- One or more equations did not get rendered due to their size.
Composition of additive monoid morphisms as an additive monoid morphism.
Equations
- One or more equations did not get rendered due to their size.
Composition of monoid morphisms as a monoid morphism.
Composition of MonoidWithZeroHom
s as a MonoidWithZeroHom
.
Equations
- One or more equations did not get rendered due to their size.
Composition of additive monoid homomorphisms is associative.
Composition of monoid homomorphisms is associative.
The monoid of endomorphisms.
Equations
- Monoid.End M = (M →* M)
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
The monoid of endomorphisms.
Equations
- AddMonoid.End A = (A →+ A)
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 }
Given two additive morphisms f
, g
to an additive commutative semigroup, f + g
is the
additive morphism sending x
to f x + g x
.
Equations
- One or more equations did not get rendered due to their size.
Given two mul morphisms f
, g
to a commutative semigroup, f * g
is the mul morphism
sending x
to f x * g x
.
Equations
- One or more equations did not get rendered due to their size.
Given two additive monoid morphisms f
, g
to an additive commutative monoid,
f + g
is the additive monoid morphism sending x
to f x + g x
.
Equations
- One or more equations did not get rendered due to their size.
Given two monoid morphisms f
, g
to a commutative monoid, f * g
is the monoid morphism
sending x
to f x * g x
.
Equations
- One or more equations did not get rendered due to their size.
A homomorphism from an additive group to an additive monoid is injective iff
its kernel is trivial. For the iff statement on the triviality of the kernel,
see injective_iff_map_eq_zero'
.
A homomorphism from a group to a monoid is injective iff its kernel is trivial.
For the iff statement on the triviality of the kernel, see injective_iff_map_eq_one'
.
A homomorphism from an additive group to an additive monoid is injective iff its
kernel is trivial, stated as an iff on the triviality of the kernel. For the implication, see
injective_iff_map_eq_zero
.
A homomorphism from a group to a monoid is injective iff its kernel is trivial,
stated as an iff on the triviality of the kernel.
For the implication, see injective_iff_map_eq_one
.
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 }
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 }
Makes an additive group homomorphism from a proof that the map preserves
the operation fun a b => a + -b
. See also AddMonoidHom.ofMapSub
for a version using
fun a b => a - b
.
Equations
- AddMonoidHom.ofMapAddNeg f map_div = AddMonoidHom.mk' f (_ : ∀ (x y : G), f (x + y) = f x + f y)
Makes a group homomorphism from a proof that the map preserves right division
fun x y => x * y⁻¹⁻¹
. See also MonoidHom.of_map_div
for a version using fun x y => x / y
.
Equations
- MonoidHom.ofMapMulInv f map_div = MonoidHom.mk' f (_ : ∀ (x y : G), f (x * y) = f x * f y)
Define a morphism of additive groups given a map which respects difference.
Equations
- AddMonoidHom.ofMapSub f hf = AddMonoidHom.ofMapAddNeg f (_ : ∀ (a a_1 : G), f (a + -a_1) = f a + -f a_1)
Define a morphism of additive groups given a map which respects ratios.
Equations
- MonoidHom.ofMapDiv f hf = MonoidHom.ofMapMulInv f (_ : ∀ (a a_1 : G), f (a * a_1⁻¹) = f a * (f a_1)⁻¹)
If f
is an additive monoid homomorphism to an additive commutative group, then -f
is the
homomorphism sending x
to -(f x)
.
If f
is a monoid homomorphism to a commutative group, then f⁻¹⁻¹
is the homomorphism sending
x
to (f x)⁻¹⁻¹
.
If f
and g
are monoid homomorphisms to an additive commutative group, then f - g
is the homomorphism sending x
to (f x) - (g x)
.
Equations
- One or more equations did not get rendered due to their size.
If f
and g
are monoid homomorphisms to a commutative group, then f / g
is the homomorphism
sending x
to (f x) / (g x)
.
Equations
- One or more equations did not get rendered due to their size.
Given two monoid with zero morphisms f
, g
to a commutative monoid, f * g
is the monoid
with zero morphism sending x
to f x * g x
.
Equations
- One or more equations did not get rendered due to their size.