module Cat.Monoidal.Diagram.Comonoid where
module _ {o β} {C : Precategory o β} (Cα΅ : Monoidal-category C) where private module C where open Cat.Reasoning C public open Monoidal-category Cα΅ public
Comonoids in a monoidal categoryπ
A comonoid in a monoidal category is the dual concept of a monoid, similarly consisting of diagrams in centred around an object the comonoid itself.
Instead of a unit we have a βcounitβ map and βcomultiplicationβ map The intuition is that describes a way to destroy data and describes a way to duplicate data. Again, these maps should be compatible with the unitors and associator of the underlying monoidal category:
record Comonoid-on (M : C.Ob) : Type β where no-eta-equality field Ξ΅ : C.Hom M C.Unit Ξ : C.Hom M (M C.β M) Ξ-counitl : (Ξ΅ C.β _) C.β Ξ β‘ C.Ξ»β _ Ξ-counitr : (_ C.βΆ Ξ΅) C.β Ξ β‘ C.Οβ _ Ξ-coassoc : (_ C.βΆ Ξ) C.β Ξ β‘ C.Ξ±β _ C.β (Ξ C.β _) C.β Ξ
The category Comon(C)π
Just as with monoids, the comonoid objects in can be made into a category, which we define here as a category displayed over
_ = is-monoid-hom module _ {o β} {C : Precategory o β} (Cα΅ : Monoidal-category C) where private module C where open Cat.Reasoning C public open Monoidal-category Cα΅ public
This means constructing a predicate on maps
expressing the condition of being a comonoid homomorphism, which is dual
to is-monoid-hom.
record is-comonoid-hom {m n} (f : C.Hom m n) (mo : Comonoid-on Cα΅ m) (no : Comonoid-on Cα΅ n) : Type β where private module m = Comonoid-on mo module n = Comonoid-on no field pres-Ξ΅ : n.Ξ΅ C.β f β‘ m.Ξ΅ pres-Ξ : n.Ξ C.β f β‘ (f C.ββ f) C.β m.Ξ
Again, we see that being a comonoid homomorphism is a pair of propositions and thus is itself a proposition, greatly simplifying the construction of the displayed category.
private unquoteDecl eqv = declare-record-iso eqv (quote is-comonoid-hom) instance H-Level-is-comonoid-hom : β {m n} {f : C .Precategory.Hom m n} {mo no} {k} β H-Level (is-comonoid-hom f mo no) (suc k) H-Level-is-comonoid-hom = prop-instance $ Isoβis-hlevel! 1 eqv open Displayed open Functor open is-comonoid-hom
Comon[_] : Displayed C β β Comon[_] = with-thin-display record where Ob[_] = Comonoid-on Cα΅ Hom[_] = is-comonoid-hom id' = record where pres-Ξ΅ = C.idr _ pres-Ξ = C.idr _ β C.introl C.β.F-id _β'_ {x = x} {y} {z} {f} {g} fh gh = record where pres-Ξ΅ = C.pulll (fh .pres-Ξ΅) β gh .pres-Ξ΅ pres-Ξ = z .Comonoid-on.Ξ C.β f C.β g β‘β¨ C.extendl (fh .pres-Ξ) β©β‘ (f C.ββ f) C.β y .Comonoid-on.Ξ C.β g β‘β¨ (C.reflβ©ββ¨ gh .pres-Ξ) β©β‘ (f C.ββ f) C.β (g C.ββ g) C.β x .Comonoid-on.Ξ β‘Λβ¨ C.pushl (C.β.F-β _ _) β©β‘Λ (f C.β g C.ββ f C.β g) C.β x .Comonoid-on.Ξ β