module Cat.Monoidal.Base where
Monoidal categories🔗
record Monoidal-category {o ℓ} (C : Precategory o ℓ) : Type (o ⊔ ℓ) where no-eta-equality 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.
field -⊗- : Bifunctor C C C Unit : Ob
module -⊗- = Bifunctor -⊗- hiding (_◀_ ; _▶_ ; F₀) open Bifunctor -⊗- public using (_◀_ ; _▶_) renaming (F₀ to infixr 25 _⊗_ ; _◆_ to infix 25 _⊗₁_)
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).
field 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 = ⊤} (λ _ _ → C) -⊗-) (compose-assocʳ {O = ⊤} (λ _ _ → C) -⊗-)
module unitor-l = Cr._≅_ _ unitor-l module unitor-r = Cr._≅_ _ unitor-r module associator = Cr._≅_ _ associator private open module λ← = _=>_ unitor-l.from public using () renaming (η to λ←) open module λ→ = _=>_ unitor-l.to public using () renaming (η to λ→) open module ρ← = _=>_ unitor-r.from public using () renaming (η to ρ←) open module ρ→ = _=>_ unitor-r.to public using () renaming (η to ρ→) open module α→ = _=>_ associator.to public using () renaming (η to α→) open module α← = _=>_ associator.from public using () renaming (η to α←) λ≅ : ∀ {X} → X ≅ Unit ⊗ X λ≅ = isoⁿ→iso unitor-l _ ρ≅ : ∀ {X} → X ≅ X ⊗ Unit ρ≅ = isoⁿ→iso unitor-r _ α≅ : ∀ {A B C} → (A ⊗ B) ⊗ C ≅ A ⊗ (B ⊗ C) α≅ = isoⁿ→iso associator _ module ⊗ = Fr (Uncurry -⊗-) module ▶ {A} = Fr (-⊗-.Right A) hiding (F₀ ; F₁) module ◀ {A} = Fr (-⊗-.Left A) hiding (F₀ ; F₁)
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.
field triangle : ∀ {A B} → (ρ← _ ◀ B) ∘ α← (A , Unit , B) ≡ A ▶ λ← _ pentagon : ∀ {A B C D} → (α← (A , B , C) ◀ D) ∘ α← (A , B ⊗ C , D) ∘ (A ▶ α← (B , C , D)) ≡ α← (A ⊗ B , C , D) ∘ α← (A , B , C ⊗ D)
triangle-α→ : ∀ {A B} → (A ▶ λ← _) ∘ α→ _ ≡ ρ← _ ◀ B triangle-α→ = rswizzle (sym triangle) (α≅ .invr) pentagon-α→ : ∀ {A B C D} → (A ▶ α→ (B , C , D)) ∘ α→ (A , B ⊗ C , D) ∘ (α→ (A , B , C) ◀ D) ≡ α→ (A , B , C ⊗ D) ∘ α→ (A ⊗ B , C , D) pentagon-α→ = inverse-unique₀ (▶.F-map-iso (α≅ Iso⁻¹) ∙Iso α≅ Iso⁻¹ ∙Iso ◀.F-map-iso (α≅ Iso⁻¹)) (α≅ Iso⁻¹ ∙Iso α≅ Iso⁻¹) (sym (assoc _ _ _) ∙ pentagon)
Deloopings🔗
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.
Deloop : ∀ {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,
Endomorphisms : ∀ {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 = B.id 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 $ Cr.to B.associator .is-natural _ _ _ mon .triangle = B.triangle _ _ mon .pentagon = B.pentagon _ _ _ _
Properties🔗
module Monoidal {o ℓ} {C : Precategory o ℓ} (M : Monoidal-category C) where open Cr C open Monoidal-category M public
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) ≡ λ← _ ◀ _ triangle-λ← {A} {B} = push-eqⁿ (unitor-l ni⁻¹) $ ▶.F-∘ _ _ ∙ ap to (Iso-prism base sq1 sq2 sq3) ∙ ap ▶.₁ (▶.elimr refl) where 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 $ α→ _ ∘ ((ρ← _ ◀ _) ◀ _) ≡⟨ ap₂ _∘_ refl (ap (_◀ _) (-⊗-.lmap-◆ _) ∙ -⊗-.lmap-◆ _) ⟩≡ α→ _ ∘ ((ρ← _ ⊗₁ id) ⊗₁ id) ≡⟨ associator .Isoⁿ.to .is-natural _ _ _ ⟩≡ (ρ← _ ⊗₁ ⌜ id ⊗₁ id ⌝) ∘ α→ _ ≡⟨ ap! -⊗-.◆-id ⟩≡ (ρ← _ ⊗₁ id) ∘ α→ _ ≡˘⟨ ap₂ _∘_ (-⊗-.lmap-◆ _) refl ⟩≡˘ (ρ← _ ◀ _) ∘ α→ _ ≡˘⟨ pulll triangle-α→ ⟩≡˘ (_ ▶ λ← _) ∘ α→ _ ∘ α→ _ ∎ sq3 : ◀.F-map-iso (▶.F-map-iso (λ≅ Iso⁻¹)) ∙Iso α≅ ≡ α≅ ∙Iso ▶.F-map-iso (▶.F-map-iso id-iso ∙Iso ◀.F-map-iso (λ≅ Iso⁻¹)) sq3 = ≅-path $ ap₂ _∘_ refl (ap (_◀ _) (-⊗-.rmap-◆ _) ∙ -⊗-.lmap-◆ _) ∙ associator .Isoⁿ.to .is-natural _ _ _ ∙ ap₂ _∘_ (eliml ◀.F-id) refl
As a consequence, we get that the two unitors agree:
λ≡ρ : λ← Unit ≡ ρ← Unit λ≡ρ = push-eqⁿ (unitor-r ni⁻¹) $ λ← _ ◀ _ ≡˘⟨ triangle-λ← ⟩≡˘ λ← _ ∘ α→ _ ≡⟨ ap₂ _∘_ (insertl (λ≅ .invl) ∙∙ ap₂ _∘_ refl (sym (unitor-l .Isoⁿ.from .is-natural _ _ _)) ∙∙ cancell (λ≅ .invl)) refl ⟩≡ (_ ▶ λ← _) ∘ α→ _ ≡⟨ triangle-α→ ⟩≡ (ρ← _ ◀ _) ∎
References
- Kelly, G. M. 1964. “On MacLane’s Conditions for Coherence of Natural Associativities, Commutativities, Etc.” Journal of Algebra 1 (4): 397–402. https://doi.org/https://doi.org/10.1016/0021-8693(64)90018-3.