The monad from an adjunctionπ
module Cat.Functor.Adjoint.Monad {oβ hβ oβ hβ : _} {C : Precategory oβ hβ} {D : Precategory oβ hβ} {L : Functor C D} {R : Functor D C} (Lβ£R : L β£ R) where
private module C = Precategory C module D = Precategory D module L = Functor L module R = Functor R module adj = _β£_ Lβ£R
Every adjunction gives rise to a monad, where the underlying functor is
AdjunctionβMonad : Monad C AdjunctionβMonad .M = R Fβ L
The unit of the monad is just adjunction monad, and the multiplication comes from the counit.
AdjunctionβMonad .unit = adj.unit AdjunctionβMonad .mult = NT (Ξ» x β R.β (adj.Ξ΅ (L.β x))) Ξ» x y f β R.β (adj.Ξ΅ (L.β y)) C.β R.β (L.β (R.β (L.β f))) β‘β¨ sym (R.F-β _ _) β©β‘ R.β (adj.Ξ΅ (L.β y) D.β L.β (R.β (L.β f))) β‘β¨ ap R.β (adj.counit.is-natural _ _ _) β©β‘ R.β (L.β f D.β adj.Ξ΅ (L.β x)) β‘β¨ R.F-β _ _ β©β‘ _ β
The monad laws follow from the zig-zag identities. In fact, the right-ident
ity law
is exactly the zag
identity.
AdjunctionβMonad .right-ident {x} = adj.zag
The others are slightly more involved.
AdjunctionβMonad .left-ident {x} = path where abstract path : R.β (adj.Ξ΅ (L.Fβ x)) C.β R.β (L.β (adj.Ξ· x)) β‘ C.id path = R.β (adj.Ξ΅ _) C.β R.β (L.β (adj.Ξ· _)) β‘β¨ sym (R.F-β _ _) β©β‘ R.β (adj.Ξ΅ _ D.β L.β (adj.Ξ· _)) β‘β¨ ap R.β adj.zig β©β‘ R.β D.id β‘β¨ R.F-id β©β‘ C.id β AdjunctionβMonad .mult-assoc {x} = path where abstract path : R.β (adj.Ξ΅ _) C.β R.β (L.β (R.β (adj.Ξ΅ (L.Fβ x)))) β‘ R.β (adj.Ξ΅ _) C.β R.β (adj.Ξ΅ (L .Fβ (R.Fβ (L.Fβ x)))) path = R.β (adj.Ξ΅ _) C.β R.β (L.β (R.β (adj.Ξ΅ _))) β‘β¨ sym (R.F-β _ _) β©β‘ R.β (adj.Ξ΅ _ D.β L.β (R.β (adj.Ξ΅ _))) β‘β¨ ap R.β (adj.counit.is-natural _ _ _) β©β‘ R.β (adj.Ξ΅ _ D.β adj.Ξ΅ _) β‘β¨ R.F-β _ _ β©β‘ R.β (adj.Ξ΅ _) C.β R.β (adj.Ξ΅ _) β