module Cat.Monoidal.Base where

Monoidal categoriesπŸ”—

record Monoidal-category {o β„“} (C : Precategory o β„“) : Type (o βŠ” β„“) where
  open Cr C

A monoidal category is a vertical categorification of the concept of monoid: We replace the identities in a monoid by isomorphisms. For this to make sense, a monoidal category must have an underlying precategory, rather than an underlying set; Similarly, the multiplication operation must be a multiplication functor, and we have to throw on some coherence data on top, to make sure everything works out.

We start with a category together with a chosen functor, the tensor product, and a distinguished object the tensor unit. These take the place of the multiplication operation and identity element, respectively.

    -βŠ—-  : Functor (C Γ—αΆœ C) C
    Unit : Ob

We replace the associativity and unit laws by associativity and unitor morphisms, which are natural isomorphisms (in components)

The morphism is called the associator, and (resp. are the right unitor (resp. left unitor).

    unitor-l : Cr._β‰…_ Cat[ C , C ] Id (-βŠ—-.Right Unit)
    unitor-r : Cr._β‰…_ Cat[ C , C ] Id (-βŠ—-.Left Unit)

    associator : Cr._β‰…_ Cat[ C Γ—αΆœ C Γ—αΆœ C , C ]
      (compose-assocΛ‘ {O = ⊀} {H = Ξ» _ _ β†’ C} -βŠ—-)
      (compose-assocΚ³ {O = ⊀} {H = Ξ» _ _ β†’ C} -βŠ—-)

The final data we need are coherences relating the left and right unitors (the triangle identity; despite the name, nothing to do with adjunctions), and one for reducing sequences of associators, the pentagon identity. As for where the name β€œpentagon” comes from, the path pentagon witnesses commutativity of the diagram

which we have drawn less like a regular pentagon and more like a children’s drawing of a house, so that it fits on the page horizontally.

    triangle : βˆ€ {A B} β†’ (ρ← β—€ B) ∘ α← A Unit B ≑ A β–Ά λ←

      : βˆ€ {A B C D}
      β†’ (α← A B C β—€ D) ∘ α← A (B βŠ— C) D ∘ (A β–Ά α← B C D)
      ≑ α← (A βŠ— B) C D ∘ α← A B (C βŠ— D)


Just as a monoid can be promoted to a 1-object category, with the underlying set of the monoid becoming the single we can deloop a monoidal category into a bicategory with a single object, where the sole category is given by the monoidal category.

  : βˆ€ {o β„“} {C : Precategory o β„“} β†’ Monoidal-category C β†’ Prebicategory lzero o β„“
Deloop {C = C} mon = bi where
  open Prebicategory
  module M = Monoidal-category mon
  bi : Prebicategory _ _ _
  bi .Ob = ⊀
  bi .Hom _ _ = C
  bi .id = M.Unit
  bi .compose = M.-βŠ—-
  bi .unitor-l = M.unitor-l
  bi .unitor-r = M.unitor-r
  bi .associator = M.associator
  bi .triangle _ _ = M.triangle
  bi .pentagon _ _ _ _ = M.pentagon

This makes the idea that a monoidal category is β€œjust” the categorified version of a monoid precisely, and it’s generally called the delooping hypothesis: A monoidal is the same as an with a single object.

Endomorphism categoriesπŸ”—

In the same way that, if you have a category making a choice of object canonically gives you a monoid of endomorphisms having a bicategory and choosing an object canonically gives you a choice of monoidal category,

  : βˆ€ {o β„“ β„“'} (B : Prebicategory o β„“ β„“')
  β†’ (a : Prebicategory.Ob B)
  β†’ Monoidal-category (Prebicategory.Hom B a a)
Endomorphisms B a = mon where
  open Monoidal-category
  module B = Prebicategory B
  mon : Monoidal-category (B.Hom a a)
  mon .-βŠ—- = B.compose
  mon .Unit =
  mon .unitor-l = B.unitor-l
  mon .unitor-r = B.unitor-r
  mon .associator = to-natural-iso $ ni where
    open make-natural-iso
    open Cr
    ni : make-natural-iso _ _
    ni .eta _ = B.Ξ±β†’ _ _ _
    ni .inv _ = B.α← _ _ _
    ni .eta∘inv _ = Cr.invl _ B.associator Ξ·β‚š _
    ni .inv∘eta _ = Cr.invr _ B.associator Ξ·β‚š _
    ni .natural x y f = sym $ B.associator .is-natural _ _ _
  mon .triangle = B.triangle _ _
  mon .pentagon = B.pentagon _ _ _ _


While the triangle and pentagon identities turn out to be sufficient to derive all the desired coherence in a monoidal category, this is not exactly trivial. We prove a few basic identities that follow from the axioms.


The proofs in this section are from Kelly (1964), but the visualisation as a triangular prism takes inspiration from the previous formalisation in agda-categories.

First, we will show that the two ways of going (using the unitor on or on are coherent. We do this by pasting isomorphisms together to form a triangular prism with given sides and lid, as in the following diagram:

We obtain the commutativity of the bottom triangle, which yields the desired equation since is an equivalence.

  triangle-λ← : βˆ€ {A B} β†’ λ← ∘ Ξ±β†’ Unit A B ≑ λ← βŠ—β‚ id
  triangle-λ← {A} {B} = push-eqⁿ (unitor-l ni⁻¹) $
    β–Ά.F-∘ _ _ βˆ™ ap to (Iso-prism base sq1 sq2 sq3)
      base : β—€.F-map-iso (Ξ±β‰… Iso⁻¹) ∘Iso β—€.F-map-iso (β—€.F-map-iso (ρ≅ Iso⁻¹))
           ≑ β—€.F-map-iso (β–Ά.F-map-iso (Ξ»β‰… Iso⁻¹))
      base = β‰…-path (β—€.collapse triangle)

      sq1 : β—€.F-map-iso (Ξ±β‰… Iso⁻¹) ∘Iso Ξ±β‰… ∘Iso Ξ±β‰… ≑ Ξ±β‰… ∘Iso β–Ά.F-map-iso Ξ±β‰…
      sq1 = β‰…-path (rswizzle (sym pentagon-Ξ±β†’ βˆ™ assoc _ _ _)
        (β—€.annihilate (Ξ±β‰… .invl)))

      sq2 : β—€.F-map-iso (β—€.F-map-iso (ρ≅ Iso⁻¹)) ∘Iso Ξ±β‰…
          ≑ (Ξ±β‰… ∘Iso Ξ±β‰…) ∘Iso β–Ά.F-map-iso (Ξ»β‰… Iso⁻¹)
      sq2 = β‰…-path $
        Ξ±β†’ _ _ _ ∘ ((ρ← βŠ—β‚ id) βŠ—β‚ id)    β‰‘βŸ¨ associator .Isoⁿ.to .is-natural _ _ _ βŸ©β‰‘
        (ρ← βŠ—β‚ ⌜ id βŠ—β‚ id ⌝) ∘ Ξ±β†’ _ _ _  β‰‘βŸ¨ ap! βŠ—.F-id βŸ©β‰‘
        (ρ← βŠ—β‚ id) ∘ Ξ±β†’ _ _ _            β‰‘Λ˜βŸ¨ pulll triangle-Ξ±β†’ βŸ©β‰‘Λ˜
        (id βŠ—β‚ λ←) ∘ Ξ±β†’ _ _ _ ∘ Ξ±β†’ _ _ _ ∎

      sq3 : β—€.F-map-iso (β–Ά.F-map-iso (Ξ»β‰… Iso⁻¹)) ∘Iso Ξ±β‰…
          ≑ Ξ±β‰… ∘Iso β–Ά.F-map-iso (β—€.F-map-iso (Ξ»β‰… Iso⁻¹))
      sq3 = β‰…-path (associator .Isoⁿ.to .is-natural _ _ _)

As a consequence, we get that the two unitors agree:

  λ≑ρ : λ← {Unit} ≑ ρ← {Unit}
  λ≑ρ = push-eqⁿ (unitor-r ni⁻¹) $
    (λ← βŠ—β‚ id)            β‰‘Λ˜βŸ¨ triangle-λ← βŸ©β‰‘Λ˜
    λ← ∘ Ξ±β†’ _ _ _         β‰‘βŸ¨ (insertl (Ξ»β‰… .invl) Β·Β· refl⟩∘⟨ sym (unitor-l .Isoⁿ.from .is-natural _ _ _) Β·Β· cancell (Ξ»β‰… .invl)) ⟩∘⟨refl βŸ©β‰‘
    (id βŠ—β‚ λ←) ∘ Ξ±β†’ _ _ _ β‰‘βŸ¨ triangle-Ξ±β†’ βŸ©β‰‘
    (ρ← βŠ—β‚ id)            ∎


  • Kelly, G. M. 1964. β€œOn MacLane’s Conditions for Coherence of Natural Associativities, Commutativities, Etc.” Journal of Algebra 1 (4): 397–402.