module Cat.Diagram.Comonad where

ComonadsπŸ”—

A comonad on a category is dual to a monad on instead of a unit and multiplication we have a counit and comultiplication More generally, we can define what it means to equip a fixed functor with the structure of a comonad.

  record Comonad-on (W : Functor C C) : Type (o βŠ” β„“) where
    field
      counit : W => Id
      comult : W => (W F∘ W)

We also have equations governing the counit and comultiplication. Unsurprisingly, these are dual to the equations of a monad.

    field
      Ξ΄-idl   : βˆ€ {x} β†’ W₁ (Ξ΅ x) ∘ Ξ΄ x ≑ id
      Ξ΄-idr   : βˆ€ {x} β†’ Ξ΅ (Wβ‚€ x) ∘ Ξ΄ x ≑ id
      Ξ΄-assoc : βˆ€ {x} β†’ W₁ (Ξ΄ x) ∘ Ξ΄ x ≑ Ξ΄ (Wβ‚€ x) ∘ Ξ΄ x