module Cat.Bi.Diagram.Monad where
Monads in a bicategory🔗
Recall that a monad on a category consists of a functor and natural transformations While the words “functor” and “natural transformation” are specific to the setup where is a category, if we replace those with “1-cell” and “2-cell”, then the definition works in any bicategory!
record Monad (a : B.Ob) : Type (ℓ ⊔ ℓ') where
field
: a B.↦ a
M : (M B.⊗ M) B.⇒ M
μ : B.id B.⇒ M η
The setup is, in a sense, a lot more organic when phrased in an arbitrary bicategory: Rather than dealing with the specificities of natural transformations and the category we abstract all of that away into the setup of the bicategory All we need is that the multiplication be compatible with the associator and the unit must be appropriately compatible with the left and right unitors
: μ B.∘ (M B.▶ μ) ≡ μ B.∘ (μ B.◀ M) B.∘ B.α← M M M
μ-assoc : μ B.∘ (M B.▶ η) ≡ B.ρ← M
μ-unitr : μ B.∘ (η B.◀ M) ≡ B.λ← M μ-unitl
We can draw these compatibility conditions as pretty commputative diagrams. The commutative altar (on top) indicates associativity of multiplication, or more abstractly, compatibility of the multiplication with the associator. The commutative upside-down triangle indicates mutual compatibility of the multiplication and unit with the unitors.
In Cat🔗
To prove that this is an actual generalisation of the 1-categorical notion, we push some symbols around and prove that a monad in the bicategory is the same thing as a monad on some category. Things are set up so that this is almost definitional, but the compatibility paths have to be adjusted slightly. Check it out below:
module _ {o ℓ} {C : Precategory o ℓ} where
open Cat.Monad
open Monad
private module C = Cr C
: Monad (Cat _ _) C → Cat.Monad C
Bicat-monad→monad = monad' where
Bicat-monad→monad monad private module M = Monad monad
: Cat.Monad C
monad' .M = M.M
monad' .unit = M.η
monad' .mult = M.μ
monad' .left-ident {x} =
monad' (M.μ .η x C.∘_) (C.intror refl)
ap .μ-unitr ηₚ x
∙ M.right-ident {x} =
monad' (M.μ .η x C.∘_) (C.introl (M.M .Functor.F-id))
ap .μ-unitl ηₚ x
∙ M.mult-assoc {x} =
monad' (M.μ .η x C.∘_) (C.intror refl)
ap .μ-assoc ηₚ x
·· M(M.μ .η x C.∘_) (C.elimr refl ∙ C.eliml (M.M .Functor.F-id))
·· ap
: Cat.Monad C → Monad (Cat _ _) C
Monad→bicat-monad = monad' where
Monad→bicat-monad monad private module M = Cat.Monad monad
: Monad (Cat _ _) C
monad' .M = M.M
monad' .μ = M.mult
monad' .η = M.unit
monad' .μ-assoc = ext λ _ →
monad' (M.μ _ C.∘_) (C.elimr refl)
ap .mult-assoc
·· M(M.μ _ C.∘_) (C.introl (M.M-id) ∙ C.intror refl)
·· ap .μ-unitr = ext λ _ →
monad' (M.μ _ C.∘_) (C.elimr refl)
ap .left-ident
∙ M.μ-unitl = ext λ _ →
monad' (M.μ _ C.∘_) (C.eliml M.M-id)
ap .right-ident ∙ M