Category instances for semiring, ring, comm_semiring, and comm_ring. #
We introduce the bundled categories:
SemiRing
Ring
CommSemiRing
CommRing
along with the relevant forgetful functors between them.
ring_hom
doesn't actually assume associativity. This alias is needed to make the category
theory machinery work. We use the same trick in category_theory.Mon.assoc_monoid_hom
.
Equations
- SemiRing.bundled_hom = {to_fun := λ (M N : Type u_1) [_inst_1 : semiring M] [_inst_2 : semiring N], ring_hom.to_fun, id := λ (M : Type u_1) [_inst_1 : semiring M], ring_hom.id M, comp := λ (M N P : Type u_1) [_inst_1 : semiring M] [_inst_2 : semiring N] [_inst_3 : semiring P], ring_hom.comp, hom_ext := SemiRing.bundled_hom._proof_1, id_to_fun := SemiRing.bundled_hom._proof_2, comp_to_fun := SemiRing.bundled_hom._proof_3}
Construct a bundled SemiRing from the underlying type and typeclass.
Equations
Typecheck a ring_hom
as a morphism in SemiRing
.
Equations
- SemiRing.of_hom f = f
Equations
Equations
- SemiRing.has_forget_to_Mon = category_theory.bundled_hom.mk_has_forget₂ (λ (R : Type u_1) (hR : semiring R), monoid_with_zero.to_monoid R) (λ (R₁ R₂ : category_theory.bundled semiring), ring_hom.to_monoid_hom) SemiRing.has_forget_to_Mon._proof_1
Equations
- SemiRing.has_forget_to_AddCommMon = {forget₂ := {obj := λ (R : SemiRing), AddCommMon.of ↥R, map := λ (R₁ R₂ : SemiRing) (f : R₁ ⟶ R₂), ring_hom.to_add_monoid_hom f, map_id' := SemiRing.has_forget_to_AddCommMon._proof_1, map_comp' := SemiRing.has_forget_to_AddCommMon._proof_2}, forget_comp := SemiRing.has_forget_to_AddCommMon._proof_3}
Equations
Equations
- Ring.has_forget_to_AddCommGroup = {forget₂ := {obj := λ (R : Ring), AddCommGroup.of ↥R, map := λ (R₁ R₂ : Ring) (f : R₁ ⟶ R₂), ring_hom.to_add_monoid_hom f, map_id' := Ring.has_forget_to_AddCommGroup._proof_1, map_comp' := Ring.has_forget_to_AddCommGroup._proof_2}, forget_comp := Ring.has_forget_to_AddCommGroup._proof_3}
The category of commutative semirings.
Equations
Construct a bundled CommSemiRing from the underlying type and typeclass.
Equations
Typecheck a ring_hom
as a morphism in CommSemiRing
.
Equations
- CommSemiRing.of_hom f = f
Equations
- R.comm_semiring = R.str
The forgetful functor from commutative rings to (multiplicative) commutative monoids.
Equations
- CommSemiRing.has_forget_to_CommMon = category_theory.has_forget₂.mk' (λ (R : CommSemiRing), CommMon.of ↥R) CommSemiRing.has_forget_to_CommMon._proof_1 (λ (R₁ R₂ : CommSemiRing) (f : R₁ ⟶ R₂), ring_hom.to_monoid_hom f) CommSemiRing.has_forget_to_CommMon._proof_2
Construct a bundled CommRing from the underlying type and typeclass.
Equations
Typecheck a ring_hom
as a morphism in CommRing
.
Equations
- CommRing.of_hom f = f
Equations
The forgetful functor from commutative rings to (multiplicative) commutative monoids.
Equations
- CommRing.has_forget_to_CommSemiRing = category_theory.has_forget₂.mk' (λ (R : CommRing), CommSemiRing.of ↥R) CommRing.has_forget_to_CommSemiRing._proof_1 (λ (R₁ R₂ : CommRing) (f : R₁ ⟶ R₂), f) CommRing.has_forget_to_CommSemiRing._proof_2
Equations
- CommRing.category_theory.forget₂.category_theory.full = {preimage := λ (X Y : CommRing) (f : (category_theory.forget₂ CommRing CommSemiRing).obj X ⟶ (category_theory.forget₂ CommRing CommSemiRing).obj Y), f, witness' := CommRing.category_theory.forget₂.category_theory.full._proof_1}
Build an isomorphism in the category Ring
from a ring_equiv
between ring
s.
Equations
- e.to_Ring_iso = {hom := e.to_ring_hom, inv := e.symm.to_ring_hom, hom_inv_id' := _, inv_hom_id' := _}
Build an isomorphism in the category CommRing
from a ring_equiv
between comm_ring
s.
Equations
- e.to_CommRing_iso = {hom := e.to_ring_hom, inv := e.symm.to_ring_hom, hom_inv_id' := _, inv_hom_id' := _}
Build a ring_equiv
from an isomorphism in the category CommRing
.
Ring equivalences between ring
s are the same as (isomorphic to) isomorphisms in Ring
.
Equations
- ring_equiv_iso_Ring_iso = {hom := λ (e : X ≃+* Y), e.to_Ring_iso, inv := λ (i : Ring.of X ≅ Ring.of Y), i.Ring_iso_to_ring_equiv, hom_inv_id' := _, inv_hom_id' := _}
Ring equivalences between comm_ring
s are the same as (isomorphic to) isomorphisms
in CommRing
.
Equations
- ring_equiv_iso_CommRing_iso = {hom := λ (e : X ≃+* Y), e.to_CommRing_iso, inv := λ (i : CommRing.of X ≅ CommRing.of Y), i.CommRing_iso_to_ring_equiv, hom_inv_id' := _, inv_hom_id' := _}