The monad from an adjunction🔗
module
.Functor.Adjoint.Monad
Cat{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
Every adjunction gives rise to a monad, where the underlying functor is .
: Monad C
Adjunction→Monad .M = R F∘ L Adjunction→Monad
The unit of the monad is just adjunction monad, and the multiplication comes from the counit.
.unit = adj.unit
Adjunction→Monad .mult = NT (λ x → R.₁ (η adj.counit (L.₀ x))) λ x y f →
Adjunction→Monad .₁ (adj.counit.ε (L.₀ y)) C.∘ R.₁ (L.₁ (R.₁ (L.₁ f))) ≡⟨ sym (R.F-∘ _ _) ⟩
R.₁ (adj.counit.ε (L.₀ y) D.∘ L.₁ (R.₁ (L.₁ f))) ≡⟨ ap R.₁ (adj.counit.is-natural _ _ _) ⟩
R.₁ (L.₁ f D.∘ adj.counit.ε (L.₀ x)) ≡⟨ R.F-∘ _ _ ⟩
R_ ∎
The monad laws follow from the zig-zag identities. In fact, the right-ident
ity law is exactly the zag
identity.
.right-ident {x} = adj.zag Adjunction→Monad
The others are slightly more involved.
.left-ident {x} = path where abstract
Adjunction→Monad : R.₁ (adj.counit.ε (L.F₀ x)) C.∘ R.₁ (L.₁ (adj.unit.η x)) ≡ C.id
path =
path .₁ (adj.counit.ε _) C.∘ R.₁ (L.₁ (adj.unit.η _)) ≡⟨ sym (R.F-∘ _ _) ⟩
R.₁ (adj.counit.ε _ D.∘ L.₁ (adj.unit.η _)) ≡⟨ ap R.₁ adj.zig ⟩
R.₁ D.id ≡⟨ R.F-id ⟩
R.id ∎
C
.mult-assoc {x} = path where abstract
Adjunction→Monad : R.₁ (adj.counit.ε _) C.∘ R.₁ (L.₁ (R.₁ (adj.counit.ε (L.F₀ x))))
path .₁ (adj.counit.ε _) C.∘ R.₁ (adj.counit.ε (L .F₀ (R.F₀ (L.F₀ x))))
≡ R=
path .₁ (adj.counit.ε _) C.∘ R.₁ (L.₁ (R.₁ (adj.counit.ε _))) ≡⟨ sym (R.F-∘ _ _) ⟩
R.₁ (adj.counit.ε _ D.∘ L.₁ (R.₁ (adj.counit.ε _))) ≡⟨ ap R.₁ (adj.counit.is-natural _ _ _) ⟩
R.₁ (adj.counit.ε _ D.∘ adj.counit.ε _) ≡⟨ R.F-∘ _ _ ⟩
R.₁ (adj.counit.ε _) C.∘ R.₁ (adj.counit.ε _) ∎ R