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
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
.
- toFun : α → β
Instances For
α →ₙ+* β
denotes the type of non-unital ring homomorphisms from α
to β
.
Equations
- «term_→ₙ+*_» = Lean.ParserDescr.trailingNode `«term_→ₙ+*_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " →ₙ+* ") (Lean.ParserDescr.cat `term 25))
Instances For
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 α →ₙ+* β
.
Equations
- ↑f = { toMulHom := ↑f, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Any type satisfying NonUnitalRingHomClass
can be cast into NonUnitalRingHom
via
NonUnitalRingHomClass.toNonUnitalRingHom
.
Equations
- instCoeTCNonUnitalRingHom = { coe := NonUnitalRingHomClass.toNonUnitalRingHom }
Equations
- ⋯ = ⋯
Copy of a RingHom
with a new toFun
equal to the old one. Useful to fix definitional
equalities.
Equations
- f.copy f' h = { toMulHom := f.copy f' h, map_zero' := ⋯, map_add' := ⋯ }
Instances For
The identity non-unital ring homomorphism from a non-unital semiring to itself.
Equations
- NonUnitalRingHom.id α = { toFun := id, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Equations
- NonUnitalRingHom.instZero = { zero := { toFun := 0, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ } }
Equations
- NonUnitalRingHom.instInhabited = { default := 0 }
Composition of non-unital ring homomorphisms is a non-unital ring homomorphism.
Equations
- g.comp f = { toMulHom := g.comp f.toMulHom, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Composition of non-unital ring homomorphisms is associative.
Equations
- NonUnitalRingHom.instMonoidWithZero = MonoidWithZero.mk ⋯ ⋯
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
.
- toFun : α → β
Instances For
α →+* β
denotes the type of ring homomorphisms from α
to β
.
Equations
- «term_→+*_» = Lean.ParserDescr.trailingNode `«term_→+*_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " →+* ") (Lean.ParserDescr.cat `term 25))
Instances For
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
Turn an element of a type F
satisfying RingHomClass F α β
into an actual
RingHom
. This is declared as the default coercion from F
to α →+* β
.
Equations
- ↑f = { toMonoidHom := ↑f, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Any type satisfying RingHomClass
can be cast into RingHom
via RingHomClass.toRingHom
.
Equations
- instCoeTCRingHom = { coe := RingHomClass.toRingHom }
Equations
- ⋯ = ⋯
Throughout this section, some Semiring
arguments are specified with {}
instead of []
.
See note [implicit instance arguments].
Equations
- ⋯ = ⋯
Equations
- RingHom.coeToMonoidHom = { coe := RingHom.toMonoidHom }
Copy of a RingHom
with a new toFun
equal to the old one. Useful to fix definitional
equalities.
Equations
- f.copy f' h = { toMonoidHom := f.toMonoidWithZeroHom.copy f' h, map_zero' := ⋯, map_add' := ⋯ }
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.
Equations
- RingHom.mk' f map_add = { toFun := (↑(AddMonoidHom.mk' (⇑f) map_add)).toFun, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
The identity ring homomorphism from a semiring to itself.
Equations
- RingHom.id α = { toFun := id, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Equations
- RingHom.instInhabited = { default := RingHom.id α }
Composition of ring homomorphisms is a ring homomorphism.
Equations
Instances For
Composition of semiring homomorphisms is associative.
Equations
- RingHom.instOne = { one := RingHom.id α }
Equations
- RingHom.instMul = { mul := RingHom.comp }
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
.
Equations
- f.mkRingHomOfMulSelfOfTwoNeZero h h_two h_one = { toFun := (↑f).toFun, map_one' := h_one, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }