Homomorphisms of semirings and rings #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines bundled homomorphisms of (non-unital) semirings and rings. As with monoid and
groups, we use the same structure ring_hom a β
, a.k.a. α →+* β
, for both types of homomorphisms.
The unbundled homomorphisms are defined in deprecated.ring
. They are deprecated and the plan is to
slowly remove them from mathlib.
Main definitions #
non_unital_ring_hom
: Non-unital (semi)ring homomorphisms. Additive monoid homomorphism which preserve multiplication.ring_hom
: (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
semiring_hom
-- the idea is thatring_hom
is used. The constructor for aring_hom
between semirings needs a proof ofmap_zero
,map_one
andmap_add
as well asmap_mul
; a separate constructorring_hom.mk'
will construct ring homs between rings from monoid homs given only a proof that addition is preserved.
Tags #
ring_hom
, semiring_hom
- to_fun : α → β
- map_mul' : ∀ (x y : α), self.to_fun (x * y) = self.to_fun x * self.to_fun y
- map_zero' : self.to_fun 0 = 0
- map_add' : ∀ (x y : α), self.to_fun (x + y) = self.to_fun x + self.to_fun y
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*) [non_unital_ring_hom_class F α β] (f : F)
.
When you extend this structure, make sure to extend non_unital_ring_hom_class
.
Instances for non_unital_ring_hom
Reinterpret a non-unital ring homomorphism f : α →ₙ+* β
as a semigroup
homomorphism α →ₙ* β
. The simp
-normal form is (f : α →ₙ* β)
.
Reinterpret a non-unital ring homomorphism f : α →ₙ+* β
as an additive
monoid homomorphism α →+ β
. The simp
-normal form is (f : α →+ β)
.
- coe : F → Π (a : α), (λ (_x : α), β) a
- coe_injective' : function.injective non_unital_ring_hom_class.coe
- map_mul : ∀ (f : F) (x y : α), ⇑f (x * y) = ⇑f x * ⇑f y
- map_add : ∀ (f : F) (x y : α), ⇑f (x + y) = ⇑f x + ⇑f y
- map_zero : ∀ (f : F), ⇑f 0 = 0
non_unital_ring_hom_class F α β
states that F
is a type of non-unital (semi)ring
homomorphisms. You should extend this class when you extend non_unital_ring_hom
.
Instances of this typeclass
Instances of other typeclasses for non_unital_ring_hom_class
- non_unital_ring_hom_class.has_sizeof_inst
Throughout this section, some semiring
arguments are specified with {}
instead of []
.
See note [implicit instance arguments].
Equations
- non_unital_ring_hom.non_unital_ring_hom_class = {coe := non_unital_ring_hom.to_fun rβ, coe_injective' := _, map_mul := _, map_add := _, map_zero := _}
Helper instance for when there's too many metavariables to apply fun_like.has_coe_to_fun
directly.
Equations
Copy of a ring_hom
with a new to_fun
equal to the old one. Useful to fix definitional
equalities.
The identity non-unital ring homomorphism from a non-unital semiring to itself.
Equations
Composition of non-unital ring homomorphisms is a non-unital ring homomorphism.
Composition of non-unital ring homomorphisms is associative.
Equations
- non_unital_ring_hom.monoid_with_zero = {mul := non_unital_ring_hom.comp rα, mul_assoc := _, one := non_unital_ring_hom.id α rα, one_mul := _, mul_one := _, npow := monoid.npow._default (non_unital_ring_hom.id α) non_unital_ring_hom.comp non_unital_ring_hom.id_comp non_unital_ring_hom.comp_id, npow_zero' := _, npow_succ' := _, zero := 0, zero_mul := _, mul_zero := _}
Reinterpret a ring homomorphism f : α →+* β
as an additive monoid homomorphism α →+ β
.
The simp
-normal form is (f : α →+ β)
.
Reinterpret a ring homomorphism f : α →+* β
as a monoid homomorphism α →* β
.
The simp
-normal form is (f : α →* β)
.
Reinterpret a ring homomorphism f : α →+* β
as a non-unital ring homomorphism α →ₙ+* β
. The
simp
-normal form is (f : α →ₙ+* β)
.
- to_fun : α → β
- map_one' : self.to_fun 1 = 1
- map_mul' : ∀ (x y : α), self.to_fun (x * y) = self.to_fun x * self.to_fun y
- map_zero' : self.to_fun 0 = 0
- map_add' : ∀ (x y : α), self.to_fun (x + y) = self.to_fun x + self.to_fun y
Bundled semiring homomorphisms; use this for bundled ring homomorphisms too.
This extends from both monoid_hom
and monoid_with_zero_hom
in order to put the fields in a
sensible order, even though monoid_with_zero_hom
already extends monoid_hom
.
Instances for ring_hom
- ring_hom.has_sizeof_inst
- ring_hom.has_coe_t
- ring_hom.ring_hom_class
- ring_hom.has_coe_to_fun
- ring_hom.has_coe_monoid_hom
- ring_hom.inhabited
- ring_hom.monoid
- nat.unique_ring_hom
- ring_hom.int.subsingleton_ring_hom
- rat.subsingleton_ring_hom
- ring_hom.apply_distrib_mul_action
- ring_hom.apply_has_faithful_smul
- ring_equiv.has_coe_to_ring_hom
- mul_semiring_action_hom.has_coe
- ring_hom.has_involutive_star
- alg_hom.coe_ring_hom
- SemiRing.bundled_hom
- zmod.subsingleton_ring_hom
Reinterpret a ring homomorphism f : α →+* β
as a monoid with zero homomorphism α →*₀ β
.
The simp
-normal form is (f : α →*₀ β)
.
- coe : F → Π (a : α), (λ (_x : α), β) a
- coe_injective' : function.injective ring_hom_class.coe
- map_mul : ∀ (f : F) (x y : α), ⇑f (x * y) = ⇑f x * ⇑f y
- map_one : ∀ (f : F), ⇑f 1 = 1
- map_add : ∀ (f : F) (x y : α), ⇑f (x + y) = ⇑f x + ⇑f y
- map_zero : ∀ (f : F), ⇑f 0 = 0
ring_hom_class F α β
states that F
is a type of (semi)ring homomorphisms.
You should extend this class when you extend ring_hom
.
This extends from both monoid_hom_class
and monoid_with_zero_hom_class
in
order to put the fields in a sensible order, even though
monoid_with_zero_hom_class
already extends monoid_hom_class
.
Instances of this typeclass
Instances of other typeclasses for ring_hom_class
- ring_hom_class.has_sizeof_inst
Ring homomorphisms preserve bit1
.
Equations
- ring_hom_class.to_non_unital_ring_hom_class = {coe := ring_hom_class.coe _inst_3, coe_injective' := _, map_mul := _, map_add := _, map_zero := _}
Throughout this section, some semiring
arguments are specified with {}
instead of []
.
See note [implicit instance arguments].
Equations
- ring_hom.ring_hom_class = {coe := ring_hom.to_fun rβ, coe_injective' := _, map_mul := _, map_one := _, map_add := _, map_zero := _}
Helper instance for when there's too many metavariables to apply fun_like.has_coe_to_fun
directly.
Equations
Equations
Copy of a ring_hom
with a new to_fun
equal to the old one. Useful to fix definitional
equalities.
Ring homomorphisms map zero to zero.
Ring homomorphisms map one to one.
Ring homomorphisms preserve addition.
Ring homomorphisms preserve multiplication.
Ring homomorphisms preserve bit0
.
Ring homomorphisms preserve bit1
.
f : α →+* β
has a trivial codomain iff f 1 = 0
.
f : α →+* β
has a trivial codomain iff it has a trivial range.
f : α →+* β
has a trivial codomain iff its range is {0}
.
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.
The identity ring homomorphism from a semiring to itself.
Equations
Instances for ring_hom.id
- alg_hom_class.linear_map_class
- alg_equiv_class.to_linear_equiv_class
- non_unital_alg_hom_class.linear_map_class
- ring_hom_inv_pair.ids
- ring_hom_inv_pair.triples
- ring_hom_inv_pair.triples₂
- ring_hom_comp_triple.ids
- ring_hom_comp_triple.right_ids
- ring_hom_surjective.ids
- ring_hom_isometric.ids
- quadratic_form.isometric_map.semilinear_map_class
- Module.linear_map_class
- QuadraticModule.linear_map_class
Equations
- ring_hom.inhabited = {default := ring_hom.id α rα}
Composition of ring homomorphisms is a ring homomorphism.
Composition of semiring homomorphisms is associative.
Equations
- ring_hom.monoid = {mul := ring_hom.comp rα, mul_assoc := _, one := ring_hom.id α rα, one_mul := _, mul_one := _, npow := npow_rec (mul_one_class.to_has_mul (α →+* α)), npow_zero' := _, npow_succ' := _}
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
.