Homomorphisms of semirings and rings #
This file defines bundled homomorphisms of (non-unital) semirings and rings. As with monoid and
groups, we use the same structure RingHom a β
, a.k.a. α →+* β
, for both types of homomorphisms.
Main definitions #
NonUnitalRingHom
: Non-unital (semi)ring homomorphisms. Additive monoid homomorphism which preserve multiplication.RingHom
: (Semi)ring homomorphisms. Monoid homomorphisms which are also additive monoid homomorphism.
Notations #
→ₙ+*
: Non-unital (semi)ring homs→+*
: (Semi)ring 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
SemiringHom
-- the idea is thatRingHom
is used. The constructor for aRingHom
between semirings needs a proof ofmap_zero
,map_one
andmap_add
as well asmap_mul
; a separate constructorRingHom.mk'
will construct ring homs between rings from monoid homs given only a proof that addition is preserved.
Tags #
RingHom
, SemiringHom
- toFun : α → β
- map_mul' : ∀ (x y : α), MulHom.toFun s.toMulHom (x * y) = MulHom.toFun s.toMulHom x * MulHom.toFun s.toMulHom y
- map_zero' : MulHom.toFun s.toMulHom 0 = 0
The proposition that the function preserves 0
- map_add' : ∀ (x y : α), MulHom.toFun s.toMulHom (x + y) = MulHom.toFun s.toMulHom x + MulHom.toFun s.toMulHom y
The proposition that the function preserves addition
Bundled non-unital semiring homomorphisms α →ₙ+* β
; use this for bundled non-unital ring
homomorphisms too.
When possible, instead of parametrizing results over (f : α →ₙ+* β)
,
you should parametrize over (F : Type*) [NonUnitalRingHomClass F α β] (f : F)
.
When you extend this structure, make sure to extend NonUnitalRingHomClass
.
Instances For
α →ₙ+* β
denotes the type of non-unital ring homomorphisms from α
to β
.
Instances For
Reinterpret a non-unital ring homomorphism f : α →ₙ+* β
as an additive
monoid homomorphism α →+ β
. The simp
-normal form is (f : α →+ β)
.
Instances For
- coe : F → α → β
- coe_injective' : Function.Injective FunLike.coe
The proposition that the function preserves addition
- map_zero : ∀ (f : F), ↑f 0 = 0
The proposition that the function preserves 0
NonUnitalRingHomClass F α β
states that F
is a type of non-unital (semi)ring
homomorphisms. You should extend this class when you extend NonUnitalRingHom
.
Instances
Turn an element of a type F
satisfying NonUnitalRingHomClass F α β
into an actual
NonUnitalRingHom
. This is declared as the default coercion from F
to α →ₙ+* β
.
Instances For
Any type satisfying NonUnitalRingHomClass
can be cast into NonUnitalRingHom
via
NonUnitalRingHomClass.toNonUnitalRingHom
.
Copy of a RingHom
with a new toFun
equal to the old one. Useful to fix definitional
equalities.
Instances For
The identity non-unital ring homomorphism from a non-unital semiring to itself.
Instances For
Composition of non-unital ring homomorphisms is a non-unital ring homomorphism.
Instances For
Composition of non-unital ring homomorphisms is associative.
- toFun : α → β
- map_one' : OneHom.toFun (↑↑s) 1 = 1
- map_mul' : ∀ (x y : α), OneHom.toFun (↑↑s) (x * y) = OneHom.toFun (↑↑s) x * OneHom.toFun (↑↑s) y
- map_zero' : OneHom.toFun (↑↑s) 0 = 0
The proposition that the function preserves 0
- map_add' : ∀ (x y : α), OneHom.toFun (↑↑s) (x + y) = OneHom.toFun (↑↑s) x + OneHom.toFun (↑↑s) y
The proposition that the function preserves addition
Bundled semiring homomorphisms; use this for bundled ring homomorphisms too.
This extends from both MonoidHom
and MonoidWithZeroHom
in order to put the fields in a
sensible order, even though MonoidWithZeroHom
already extends MonoidHom
.
Instances For
α →+* β
denotes the type of ring homomorphisms from α
to β
.
Instances For
Reinterpret a ring homomorphism f : α →+* β
as a monoid with zero homomorphism α →*₀ β
.
The simp
-normal form is (f : α →*₀ β)
.
Instances For
Reinterpret a ring homomorphism f : α →+* β
as an additive monoid homomorphism α →+ β
.
The simp
-normal form is (f : α →+ β)
.
Instances For
Reinterpret a ring homomorphism f : α →+* β
as a non-unital ring homomorphism α →ₙ+* β
. The
simp
-normal form is (f : α →ₙ+* β)
.
Instances For
- coe : F → α → β
- coe_injective' : Function.Injective FunLike.coe
- map_one : ∀ (f : F), ↑f 1 = 1
The proposition that the function preserves addition
- map_zero : ∀ (f : F), ↑f 0 = 0
The proposition that the function preserves 0
RingHomClass F α β
states that F
is a type of (semi)ring homomorphisms.
You should extend this class when you extend RingHom
.
This extends from both MonoidHomClass
and MonoidWithZeroHomClass
in
order to put the fields in a sensible order, even though
MonoidWithZeroHomClass
already extends MonoidHomClass
.
Instances
Ring homomorphisms preserve bit1
.
Turn an element of a type F
satisfying RingHomClass F α β
into an actual
RingHom
. This is declared as the default coercion from F
to α →+* β
.
Instances For
Any type satisfying RingHomClass
can be cast into RingHom
via RingHomClass.toRingHom
.
Throughout this section, some Semiring
arguments are specified with {}
instead of []
.
See note [implicit instance arguments].
Copy of a RingHom
with a new toFun
equal to the old one. Useful to fix definitional
equalities.
Instances For
Ring homomorphisms map zero to zero.
Ring homomorphisms map one to one.
Ring homomorphisms preserve addition.
Ring homomorphisms preserve multiplication.
f : α →+* β
has a trivial codomain iff f 1 = 0
.
f : α →+* β
has a trivial codomain iff it has a trivial range.
f : α →+* β
doesn't map 1
to 0
if β
is nontrivial
If there is a homomorphism f : α →+* β
and β
is nontrivial, then α
is nontrivial.
Ring homomorphisms preserve additive inverse.
Ring homomorphisms preserve subtraction.
Makes a ring homomorphism from a monoid homomorphism of rings which preserves addition.
Instances For
The identity ring homomorphism from a semiring to itself.
Instances For
Composition of ring homomorphisms is a ring homomorphism.
Instances For
Composition of semiring homomorphisms is associative.
Make a ring homomorphism from an additive group homomorphism from a commutative ring to an
integral domain that commutes with self multiplication, assumes that two is nonzero and 1
is sent
to 1
.