Skip to content
The Lumenary
First-year graduateGraduate 120 min

Monoidal categories

Composition puts processes in sequence; a tensor product puts them side by side — and the laws of "side by side" are pentagons, hexagons and braids.

Formally verified · 12 LeanComputationally tested · 2 PythonAI-drafted · awaiting human reviewMathematically reviewed: Awaiting human review
MotivationH

Side by side

Composition g∘fg \circ f puts two processes in sequence. Much of mathematics and physics also needs to put things in parallel: two independent choices form a pair (x,y)∈X×Y(x, y) \in X \times Y; a quantum system made of two subsystems has state space V⊗WV \otimes W; two electrical circuits sit next to each other on a board; two strands of a braid hang side by side; two programs run on separate inputs. Each situation has a binary operation on objects and on morphisms, f⊗g:A⊗B→A′⊗B′f \otimes g : A \otimes B \to A' \otimes B', together with a "do nothing" object II.

Such an operation is almost never associative on the nose. The sets (X×Y)×Z(X \times Y) \times Z and X×(Y×Z)X \times (Y \times Z) are different (their elements are ((x,y),z)((x, y), z) and (x,(y,z))(x, (y, z))), though canonically isomorphic. A monoidal category keeps these canonical isomorphisms as data and asks for exactly the right laws between them: Mac Lane's pentagon and triangle. The surprise is that two small diagrams are enough to make every formal diagram built from these canonical isomorphisms commute — the coherence theorem. Asking for "commutativity up to isomorphism" leads to braidings, the hexagon axioms, and a genuine fork in the road: braidings that square to the identity (symmetric) and braidings that do not, the latter governed by Artin's braid groups and found in quantum groups, knot invariants and anyonic physics.

This lesson builds on natural transformations and products and coproducts.

IntuitionH

Strings, boxes and bracketings

Draw an object as a vertical string and a morphism f:A→Bf : A \to B as a box on a string, read from bottom to top. Composition stacks boxes vertically; the tensor product places strings and boxes side by side; the unit II is drawn as no string at all. Functoriality of ⊗\otimes, the interchange law

(g⊗g′)∘(f⊗f′)=(g∘f)⊗(g′∘f′),(g \otimes g') \circ (f \otimes f') = (g \circ f) \otimes (g' \circ f'),

says that boxes on different strings slide freely past each other in height. A braiding cA,B:A⊗B→B⊗Ac_{A,B} : A \otimes B \to B \otimes A is drawn as a crossing of two strings — and whether cB,A∘cA,Bc_{B,A} \circ c_{A,B} is the identity is the question of whether a doubly-crossed pair of strings can be pulled straight.

fgfg=braidingtwice≠identity
String diagrams, read bottom to top. Left: the interchange law — boxes on different strings slide past each other, so both pictures equal f ⊗ g. Right: a braiding is a crossing; braiding twice need not equal the identity (straight strings), which is the difference between braided and symmetric.

Bracketings are the other half of the picture. A word A1⊗⋯⊗AnA_1 \otimes \cdots \otimes A_n can be bracketed in Cn−1C_{n-1} ways (the Catalan numbers 1,1,2,5,14,42,…1, 1, 2, 5, 14, 42, \dots), and single applications of the associator connect them into a graph: for n=4n = 4 it is a pentagon, for n=5n = 5 the 1-skeleton of a 3-dimensional polytope with 14 vertices and 21 edges (Stasheff's associahedron; the underlying order is Tamari's lattice). Coherence says that if the pentagon commutes, then every 2-dimensional face of every associahedron does, so any two paths of associators between two bracketings agree.

DefinitionsH

Monoidal, braided and symmetric

Definition— monoidal category

A monoidal category (C,⊗,I,α,λ,ρ)(\mathcal{C}, \otimes, I, \alpha, \lambda, \rho) is a category C\mathcal{C} with a functor ⊗:C×C→C\otimes : \mathcal{C} \times \mathcal{C} \to \mathcal{C}, an object II (the unit), and natural isomorphisms

αA,B,C:(A⊗B)⊗C→ ≅ A⊗(B⊗C),λA:I⊗A→ ≅ A,ρA:A⊗I→ ≅ A\alpha_{A,B,C} : (A \otimes B) \otimes C \xrightarrow{\ \cong\ } A \otimes (B \otimes C), \qquad \lambda_A : I \otimes A \xrightarrow{\ \cong\ } A, \qquad \rho_A : A \otimes I \xrightarrow{\ \cong\ } A

(the associator and the left and right unitors) such that the pentagon and triangle diagrams below commute for all objects. It is strict if α\alpha, λ\lambda, ρ\rho are identities.

((W⊗X)⊗Y)⊗Z((W \otimes X) \otimes Y) \otimes Z
(W⊗(X⊗Y))⊗Z(W \otimes (X \otimes Y)) \otimes Z
(W⊗X)⊗(Y⊗Z)(W \otimes X) \otimes (Y \otimes Z)
W⊗((X⊗Y)⊗Z)W \otimes ((X \otimes Y) \otimes Z)
W⊗(X⊗(Y⊗Z))W \otimes (X \otimes (Y \otimes Z))
αW,X,Y⊗Z\alpha_{W,X,Y} \otimes Z
αW,X⊗Y,Z\alpha_{W,X \otimes Y,Z}
W⊗αX,Y,ZW \otimes \alpha_{X,Y,Z}
αW⊗X,Y,Z\alpha_{W \otimes X,Y,Z}
αW,X,Y⊗Z\alpha_{W,X,Y \otimes Z}
The pentagon axiom: the two ways of moving all brackets to the right agree.
(X⊗I)⊗Y(X \otimes I) \otimes Y
X⊗(I⊗Y)X \otimes (I \otimes Y)
X⊗YX \otimes Y
αX,I,Y\alpha_{X,I,Y}
ρX⊗Y\rho_X \otimes Y
X⊗λYX \otimes \lambda_Y
The triangle axiom.

Definition— monoidal functor

A (strong) monoidal functor (F,ϕ,ϕ0):C→D(F, \phi, \phi_0) : \mathcal{C} \to \mathcal{D} is a functor with natural isomorphisms ϕA,B:FA⊗FB→F(A⊗B)\phi_{A,B} : FA \otimes FB \to F(A \otimes B) and ϕ0:I→FI\phi_0 : I \to FI compatible with the associators and unitors. If ϕ,ϕ0\phi, \phi_0 are merely morphisms it is lax monoidal. A monoidal equivalence is a strong monoidal functor that is an equivalence of categories.

Definition— braiding; symmetric monoidal category

A braiding on a monoidal category is a natural isomorphism cA,B:A⊗B→B⊗Ac_{A,B} : A \otimes B \to B \otimes A satisfying the two hexagon axioms; with the associators suppressed they read

cA,B⊗C=(B⊗cA,C)∘(cA,B⊗C),cA⊗B,C=(cA,C⊗B)∘(A⊗cB,C),c_{A, B \otimes C} = (B \otimes c_{A,C}) \circ (c_{A,B} \otimes C), \qquad c_{A \otimes B, C} = (c_{A,C} \otimes B) \circ (A \otimes c_{B,C}),

i.e. moving AA past B⊗CB \otimes C is moving it past BB then past CC, and likewise on the other side. A braided monoidal category is symmetric if cB,A∘cA,B=idA⊗Bc_{B,A} \circ c_{A,B} = \mathrm{id}_{A \otimes B} for all A,BA, B.

Definition— monoid object

A monoid object in a monoidal category is an object MM with morphisms μ:M⊗M→M\mu : M \otimes M \to M and η:I→M\eta : I \to M such that μ∘(μ⊗M)=μ∘(M⊗μ)∘αM,M,M\mu \circ (\mu \otimes M) = \mu \circ (M \otimes \mu) \circ \alpha_{M,M,M} and μ∘(η⊗M)=λM\mu \circ (\eta \otimes M) = \lambda_M, μ∘(M⊗η)=ρM\mu \circ (M \otimes \eta) = \rho_M. A morphism of monoid objects is a morphism commuting with μ\mu and η\eta.

Definition— closed monoidal category

A monoidal category is (right) closed if every functor −⊗A- \otimes A has a right adjoint [A,−][A, -], the internal hom: C(B⊗A,C)≅C(B,[A,C])\mathcal{C}(B \otimes A, C) \cong \mathcal{C}(B, [A, C]) naturally in BB and CC.

Worked examplesH

Examples

Example— Cartesian: (Set, ×, 1)

X⊗Y=X×YX \otimes Y = X \times Y, I={∗}I = \{*\}, α((x,y),z)=(x,(y,z))\alpha((x, y), z) = (x, (y, z)), λ(∗,x)=x\lambda(*, x) = x, ρ(x,∗)=x\rho(x, *) = x, and the braiding c(x,y)=(y,x)c(x, y) = (y, x). More generally any category with finite products is monoidal under ×\times with the terminal object as unit (a cartesian monoidal category), and symmetric. It is closed: [Y,Z]=ZY[Y, Z] = Z^Y and currying is the adjunction.

Example— Cocartesian: (Set, ⊔, ∅)

X⊗Y=X⊔YX \otimes Y = X \sqcup Y (disjoint union, e.g. X×{0}∪Y×{1}X \times \{0\} \cup Y \times \{1\}), I=∅I = \varnothing; the associator and unitors are the evident relabellings, and the braiding swaps the tags 0,10, 1. Any category with finite coproducts is monoidal under ⊔\sqcup with the initial object as unit. This structure is not closed: −⊔Y- \sqcup Y does not preserve the initial object (for Y≠∅Y \neq \varnothing), so it has no right adjoint.

Example— Linear: (Vect_k, ⊗, k)

V⊗WV \otimes W is the tensor product over a field kk, I=kI = k, α((u⊗v)⊗w)=u⊗(v⊗w)\alpha((u \otimes v) \otimes w) = u \otimes (v \otimes w), λ(c⊗v)=cv\lambda(c \otimes v) = cv, and the braiding c(v⊗w)=w⊗vc(v \otimes w) = w \otimes v, all defined on pure tensors and extended linearly (well defined by the universal property). It is symmetric and closed with [V,W]=Homk(V,W)[V, W] = \mathrm{Hom}_k(V, W). Here ⊗\otimes is not a categorical product: a linear map U→V⊗WU \to V \otimes W is not a pair of maps, and there are no natural projections V⊗W→VV \otimes W \to V. The same holds for (Ab,⊗Z,Z)(\cat{Ab}, \otimes_{\Z}, \Z), for RR-modules over a commutative ring, and for (Hilb,⊗,C)(\cat{Hilb}, \otimes, \C).

Example— Endofunctors: a strict, non-symmetric monoidal category

For any category C\mathcal{C}, the functor category [C,C][\mathcal{C}, \mathcal{C}] is strict monoidal with F⊗G=F∘GF \otimes G = F \circ G and I=idCI = \mathrm{id}_{\mathcal{C}}; on natural transformations ⊗\otimes is horizontal composition. It is usually not braided: F∘G≇G∘FF \circ G \not\cong G \circ F in general. Monoid objects here are exactly monads (see monads).

Example— Graded vector spaces with a twisted associator

Let GG be a group and ω:G3→k×\omega : G^3 \to k^\times a function. VecGω\mathrm{Vec}_G^\omega is the category of finite-dimensional GG-graded vector spaces with (V⊗W)g=⨁hh′=gVh⊗Wh′(V \otimes W)_g = \bigoplus_{hh' = g} V_h \otimes W_{h'}, unit the one-dimensional space δe\delta_e in degree ee, and associator acting on Va⊗Vb⊗VcV_a \otimes V_b \otimes V_c as multiplication by ω(a,b,c)\omega(a, b, c). On the simple objects δa\delta_a the pentagon axiom becomes the 3-cocycle condition

ω(b,c,d) ω(a,bc,d) ω(a,b,c)=ω(ab,c,d) ω(a,b,cd),\omega(b, c, d)\, \omega(a, bc, d)\, \omega(a, b, c) = \omega(ab, c, d)\, \omega(a, b, cd),

and the triangle axiom (with identity unitors) the normalisation ω(a,e,c)=1\omega(a, e, c) = 1. For G=Z/nG = \Z/n and ζ=e2πi/n\zeta = e^{2\pi i/n}, the cochains ωp(a,b,c)=ζ p a carry(b,c)\omega_p(a, b, c) = \zeta^{\,p\, a\, \mathrm{carry}(b, c)}, where carry(b,c)=1\mathrm{carry}(b, c) = 1 if b+c≥nb + c \ge n (for representatives 0≤b,c<n0 \le b, c \lt n) and 00 otherwise, are 3-cocycles. Proof: write the condition additively in exponents. The number of wrap-arounds in computing b+c+db + c + d does not depend on the bracketing, so carry(b,c)+carry(b+c,d)=carry(c,d)+carry(b,c+d)\mathrm{carry}(b, c) + \mathrm{carry}(b + c, d) = \mathrm{carry}(c, d) + \mathrm{carry}(b, c + d); substituting, the two sides differ by p (a+b−[a+b]) carry(c,d)=p n carry(a,b) carry(c,d)≡0(modn)p\,(a + b - [a + b])\,\mathrm{carry}(c, d) = p\,n\,\mathrm{carry}(a, b)\,\mathrm{carry}(c, d) \equiv 0 \pmod n. These cochains represent all of H3(Z/n,C×)≅Z/nH^3(\Z/n, \C^\times) \cong \Z/n: up to changing the tensor-product isomorphisms by a 2-cochain, there are exactly nn associators on Z/n\Z/n-graded vector spaces with δa⊗δb=δa+b\delta_a \otimes \delta_b = \delta_{a+b}.

Example— Representations

For a group GG, finite-dimensional representations form a symmetric monoidal category Rep(G)\mathrm{Rep}(G) with g⋅(v⊗w)=gv⊗gwg \cdot (v \otimes w) = gv \otimes gw and the trivial representation as unit. For a Hopf algebra HH the comultiplication makes Rep(H)\mathrm{Rep}(H) monoidal, and an RR-matrix (a quasi-triangular structure) makes it braided. For the quantum group Uq(sl2)U_q(\mathfrak{sl}_2) at generic qq the resulting braiding is not symmetric (see the second experiment).

Example— Braids

The braid category B\mathcal{B} has objects 0,1,2,…0, 1, 2, \dots, morphisms n→nn \to n the elements of Artin's braid group BnB_n (none between different nn), and m⊗n=m+nm \otimes n = m + n by placing braids side by side. The crossing σ∈B2\sigma \in B_2 is a braiding 1⊗1→1⊗11 \otimes 1 \to 1 \otimes 1. Since B2≅ZB_2 \cong \Z is generated by σ\sigma, σ2≠id\sigma^2 \neq \mathrm{id}: B\mathcal{B} is braided but not symmetric. By a theorem of Joyal and Street, B\mathcal{B} is the free braided monoidal category on one object.

ProofH

Theorems

Theorem— Proposition 1 ((Set, ×, 1) is symmetric monoidal)

With the structure maps above, (Set,×,{∗})(\cat{Set}, \times, \{*\}) satisfies the pentagon, triangle and hexagon axioms, and cY,X∘cX,Y=idc_{Y,X} \circ c_{X,Y} = \mathrm{id}.

Proof

Naturality of α,λ,ρ,c\alpha, \lambda, \rho, c is immediate from the formulas. Pentagon: both composites send (((w,x),y),z)(((w, x), y), z) to (w,(x,(y,z)))(w, (x, (y, z))) — the upper path via ((w,x),(y,z))((w, x), (y, z)), the lower via ((w,(x,y)),z)((w, (x, y)), z) and (w,((x,y),z))(w, ((x, y), z)). Triangle: both sides send ((x,∗),y)((x, *), y) to (x,y)(x, y). Hexagon (first form, associators included): both sides send ((x,y),z)((x, y), z) to (y,(z,x))(y, (z, x)); the second is similar. Symmetry: c(c(x,y))=c(y,x)=(x,y)c(c(x, y)) = c(y, x) = (x, y). The same element-chasing proves the claims for (Set,⊔,∅)(\cat{Set}, \sqcup, \varnothing), and for (Vectk,⊗,k)(\cat{Vect}_k, \otimes, k) it suffices to check on pure tensors u⊗v⊗wu \otimes v \otimes w, which span.

∎

The next result is the first sign that "commutativity" is forced one dimension up.

Theorem— Theorem 2 (Eckmann–Hilton)

Let XX be a set with two binary operations ⋅\cdot and ∗\ast, with units 1⋅1_\cdot and 1∗1_\ast, satisfying the interchange law (a∗b)⋅(c∗d)=(a⋅c)∗(b⋅d)(a \ast b) \cdot (c \ast d) = (a \cdot c) \ast (b \cdot d). Then 1⋅=1∗1_\cdot = 1_\ast, the two operations coincide, and they are commutative (and associative).

Proof

Put a=d=1∗a = d = 1_\ast, b=c=1⋅b = c = 1_\cdot: the left side is (1∗∗1⋅)⋅(1⋅∗1∗)=1⋅⋅1⋅=1⋅(1_\ast \ast 1_\cdot) \cdot (1_\cdot \ast 1_\ast) = 1_\cdot \cdot 1_\cdot = 1_\cdot and the right side is (1∗⋅1⋅)∗(1⋅⋅1∗)=1∗∗1∗=1∗(1_\ast \cdot 1_\cdot) \ast (1_\cdot \cdot 1_\ast) = 1_\ast \ast 1_\ast = 1_\ast. Call the common unit 11. Then

a⋅b=(a∗1)⋅(1∗b)=(a⋅1)∗(1⋅b)=a∗b,a⋅b=(1∗a)⋅(b∗1)=(1⋅b)∗(a⋅1)=b∗a=b⋅a.a \cdot b = (a \ast 1) \cdot (1 \ast b) = (a \cdot 1) \ast (1 \cdot b) = a \ast b, \qquad a \cdot b = (1 \ast a) \cdot (b \ast 1) = (1 \cdot b) \ast (a \cdot 1) = b \ast a = b \cdot a .

Associativity follows similarly: (a⋅b)⋅c=(a∗b)⋅(1∗c)=(a⋅1)∗(b⋅c)=a⋅(b⋅c)(a \cdot b) \cdot c = (a \ast b) \cdot (1 \ast c) = (a \cdot 1) \ast (b \cdot c) = a \cdot (b \cdot c).

∎

Theorem— Theorem 3 (End(I) is commutative; Kelly, Kelly–Laplaza)

In any monoidal category, λI=ρI:I⊗I→I\lambda_I = \rho_I : I \otimes I \to I, and the monoid End(I)\mathrm{End}(I) is commutative.

Proof

That λI=ρI\lambda_I = \rho_I follows from the pentagon and triangle axioms (Kelly 1964; the commutativity of End(I)\mathrm{End}(I) is recorded by Kelly and Laplaza, 1980); a proof is in Etingof–Gelaki–Nikshych–Ostrik, Tensor Categories, §2.2, and Mathlib proves it as unitors_equal. Write u=λI=ρIu = \lambda_I = \rho_I. For f,g∈End(I)f, g \in \mathrm{End}(I), naturality of λ\lambda and ρ\rho gives

u∘(I⊗g)=g∘u,u∘(f⊗I)=f∘u,u \circ (I \otimes g) = g \circ u, \qquad u \circ (f \otimes I) = f \circ u ,

and the interchange law gives (f⊗I)∘(I⊗g)=f⊗g=(I⊗g)∘(f⊗I)(f \otimes I) \circ (I \otimes g) = f \otimes g = (I \otimes g) \circ (f \otimes I). Hence

g∘f∘u=g∘u∘(f⊗I)=u∘(I⊗g)∘(f⊗I)=u∘(f⊗I)∘(I⊗g)=f∘u∘(I⊗g)=f∘g∘u,g \circ f \circ u = g \circ u \circ (f \otimes I) = u \circ (I \otimes g) \circ (f \otimes I) = u \circ (f \otimes I) \circ (I \otimes g) = f \circ u \circ (I \otimes g) = f \circ g \circ u ,

and since uu is invertible, g∘f=f∘gg \circ f = f \circ g.

∎

This is Eckmann–Hilton in disguise: on End(I)\mathrm{End}(I), composition and ⊗\otimes (transported along uu) are two unital operations satisfying interchange. For example, End(I)=k\mathrm{End}(I) = k in Vectk\cat{Vect}_k, and in [C,C][\mathcal{C}, \mathcal{C}] it is the commutative monoid of natural transformations id⇒id\mathrm{id} \Rightarrow \mathrm{id} (the centre of C\mathcal{C}).

Theorem— Theorem 4 (Mac Lane's coherence theorem, 1963)

(a) In a monoidal category, every formal diagram built from components of α\alpha, λ\lambda, ρ\rho, their inverses, identities and ⊗\otimes commutes. Precisely: in the free monoidal category on a set of objects, any two parallel morphisms are equal. (b) Every monoidal category is monoidally equivalent to a strict monoidal category.

Proof sketch and reference. For (a), send every bracketed word to its normal form (all brackets to the right, units deleted); one shows that the canonical map from a word to its normal form is well defined, using the pentagon to commute any two associator moves and the triangle to handle units. Then any two canonical paths w→w′w \to w' both factor through the normal form, hence agree. Mac Lane's original argument contains this; a careful account is in Mac Lane, CWM, VII.2 (coherence) and XI.3 (strictification), and Mathlib formalises (a) (FreeMonoidalCategory.subsingleton_hom). For (b), replace C\mathcal{C} by the category of finite lists of objects of C\mathcal{C}, with concatenation as a strict tensor product and morphisms computed after tensoring out (EGNO, §2.8). Coherence is about formal diagrams: in (Set,×)(\cat{Set}, \times) the swap X×X→X×XX \times X \to X \times X and the identity are both "canonical", yet different — they come from different formal expressions.

For braided categories the analogue is that formal diagrams commute when their underlying braids are equal (Joyal–Street); for symmetric ones, when their underlying permutations are equal.

Theorem— Proposition 5 (monoid objects)

Monoid objects in (Set,×,1)(\cat{Set}, \times, 1) are monoids; in (Ab,⊗Z,Z)(\cat{Ab}, \otimes_{\Z}, \Z) they are rings; in (Vectk,⊗,k)(\cat{Vect}_k, \otimes, k) they are kk-algebras; in ([C,C],∘,id)([\mathcal{C}, \mathcal{C}], \circ, \mathrm{id}) they are monads; in (Set,⊔,∅)(\cat{Set}, \sqcup, \varnothing) every object has exactly one monoid structure.

Proof

In Set\cat{Set}, μ:M×M→M\mu : M \times M \to M is a binary operation and η:{∗}→M\eta : \{*\} \to M picks an element; the axioms, evaluated on elements, are associativity and the unit laws. In Ab\cat{Ab}, a homomorphism μ:M⊗M→M\mu : M \otimes M \to M is the same as a biadditive map M×M→MM \times M \to M (universal property of ⊗\otimes), i.e. a multiplication distributing over addition, and η:Z→M\eta : \Z \to M is determined by 1:=η(1)1 := \eta(1); the axioms (checked on pure tensors) are associativity and the unit laws, so MM is a ring. Replacing Z\Z by kk gives kk-algebras. In endofunctors, μ:T∘T⇒T\mu : T \circ T \Rightarrow T and η:id⇒T\eta : \mathrm{id} \Rightarrow T, and the axioms are the monad laws. In (Set,⊔,∅)(\cat{Set}, \sqcup, \varnothing), η:∅→M\eta : \varnothing \to M is unique and the unit laws force μ:M⊔M→M\mu : M \sqcup M \to M to be the identity on each copy (the codiagonal); it is associative.

∎

Theorem— Proposition 6 (monoids in monoids are commutative)

A monoid object in the cartesian monoidal category (Mon,×,1)(\cat{Mon}, \times, 1) is a commutative monoid, and its two multiplications coincide.

Proof

A monoid object in Mon\cat{Mon} is a monoid (M,⋅,1)(M, \cdot, 1) whose multiplication ∗:M×M→M\ast : M \times M \to M and unit are monoid homomorphisms. "∗\ast is a homomorphism" is exactly the interchange law (a⋅c)∗(b⋅d)=(a∗b)⋅(c∗d)(a \cdot c) \ast (b \cdot d) = (a \ast b) \cdot (c \ast d), so Eckmann–Hilton applies: ∗=⋅\ast = \cdot and both are commutative.

∎

Formal mathematicsF

Monoidal categories in Lean

Mathlib's MonoidalCategory has the pentagon and triangle as fields. Mathlib writes composition in diagrammatic order, f ≫ g for g∘fg \circ f, and uses whiskering: X ◁ g is X⊗gX \otimes g and f ▷ Y is f⊗Yf \otimes Y.

pentagonLean 4Applies a library theoremFormally verified
/-- **The pentagon axiom.** The two ways of rebracketing `((W ⊗ X) ⊗ Y) ⊗ Z` into
`W ⊗ (X ⊗ (Y ⊗ Z))` using associators agree. In Mathlib this is a field of `MonoidalCategory`
(composition is written `≫`, in diagrammatic order, and `f ▷ Z`, `W ◁ g` are whiskerings). -/
theorem pentagon (W X Y Z : C) :
    (α_ W X Y).hom ▷ Z ≫ (α_ W (X ⊗ Y) Z).hom ≫ W ◁ (α_ X Y Z).hom =
      (α_ (W ⊗ X) Y Z).hom ≫ (α_ W X (Y ⊗ Z)).hom :=
  MonoidalCategory.pentagon W X Y Z
Axioms used: No axiomsformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor
triangleLean 4Applies a library theoremFormally verified
/-- **The triangle axiom**: `(X ⊗ I) ⊗ Y ⟶ X ⊗ (I ⊗ Y) ⟶ X ⊗ Y` equals `ρ_X ⊗ Y`.
A field of Mathlib's `MonoidalCategory`. -/
theorem triangle (X Y : C) :
    (α_ X (𝟙_ C) Y).hom ≫ X ◁ (λ_ Y).hom = (ρ_ X).hom ▷ Y :=
  MonoidalCategory.triangle X Y
Axioms used: No axiomsformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor
unitors_equalLean 4Applies a library theoremFormally verified
/-- **Kelly's identity** `λ_I = ρ_I : I ⊗ I ⟶ I`. It is *not* an axiom: it follows from the
pentagon and triangle axioms (Kelly 1964). Mathlib's `unitors_equal`. -/
theorem unitors_equal : (λ_ (𝟙_ C)).hom = (ρ_ (𝟙_ C)).hom :=
  CategoryTheory.MonoidalCategory.unitors_equal
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor

The proof of Theorem 3 is formalised step by step: naturality of the unitors, the interchange law (Mathlib's whisker_exchange), and cancellation of the isomorphism uu.

end_unit_commLean 4Proved here from basic factsFormally verified
/-- **The endomorphisms of the unit object commute.** For `f g : I ⟶ I`, `f ≫ g = g ≫ f`.

Human proof. Write `u = λ_I = ρ_I : I ⊗ I ≅ I` (Kelly's identity). Naturality of the unitors says
`I ◁ g` is `g` conjugated by `u`, and `f ▷ I` is `f` conjugated by `u`. The interchange law says
`I ◁ g` and `f ▷ I` commute (both orders equal `f ⊗ g`). Conjugating back by `u`, `g` and `f`
commute. -/
theorem end_unit_comm (f g : 𝟙_ C ⟶ 𝟙_ C) : f ≫ g = g ≫ f := by
  -- naturality of the unitors at `g` and at `f`
  have hl : 𝟙_ C ◁ g ≫ (λ_ (𝟙_ C)).hom = (λ_ (𝟙_ C)).hom ≫ g :=
    MonoidalCategory.leftUnitor_naturality g
  have hr : f ▷ 𝟙_ C ≫ (λ_ (𝟙_ C)).hom = (λ_ (𝟙_ C)).hom ≫ f := by
    rw [unitors_equal]
    exact MonoidalCategory.rightUnitor_naturality f
  -- the interchange law: `I ◁ g ≫ f ▷ I = f ▷ I ≫ I ◁ g`
  have hx : 𝟙_ C ◁ g ≫ f ▷ 𝟙_ C = f ▷ 𝟙_ C ≫ 𝟙_ C ◁ g := whisker_exchange f g
  -- conjugate back by the isomorphism `λ_I`
  have key : (λ_ (𝟙_ C)).hom ≫ g ≫ f = (λ_ (𝟙_ C)).hom ≫ f ≫ g := by
    calc (λ_ (𝟙_ C)).hom ≫ g ≫ f = (𝟙_ C ◁ g ≫ (λ_ (𝟙_ C)).hom) ≫ f := by
          rw [hl, Category.assoc]
      _ = 𝟙_ C ◁ g ≫ (f ▷ 𝟙_ C ≫ (λ_ (𝟙_ C)).hom) := by rw [Category.assoc, hr]
      _ = (𝟙_ C ◁ g ≫ f ▷ 𝟙_ C) ≫ (λ_ (𝟙_ C)).hom := by rw [Category.assoc]
      _ = (f ▷ 𝟙_ C ≫ 𝟙_ C ◁ g) ≫ (λ_ (𝟙_ C)).hom := by rw [hx]
      _ = f ▷ 𝟙_ C ≫ ((λ_ (𝟙_ C)).hom ≫ g) := by rw [Category.assoc, hl]
      _ = (λ_ (𝟙_ C)).hom ≫ f ≫ g := by rw [← Category.assoc, hr, Category.assoc]
  exact ((cancel_epi (λ_ (𝟙_ C)).hom).mp key).symm
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor
eckmann_hiltonLean 4Proved here from basic factsFormally verified
/-- **The Eckmann–Hilton argument.** Suppose a type carries two binary operations `m₁`, `m₂`
with units `e₁`, `e₂`, satisfying the interchange law
`m₁ (m₂ a b) (m₂ c d) = m₂ (m₁ a c) (m₁ b d)`. Then the units agree, the operations agree, and
the operation is commutative. (Mathlib: `EckmannHilton.one`, `EckmannHilton.mul`,
`EckmannHilton.mul_comm`.)

Proof. Interchange with `(a, b, c, d) = (e₂, e₁, e₁, e₂)` gives `e₁ = e₂ =: e`. Then
`m₁ a b = m₁ (m₂ a e) (m₂ e b) = m₂ (m₁ a e) (m₁ e b) = m₂ a b`, and
`m₁ a b = m₁ (m₂ e a) (m₂ b e) = m₂ (m₁ e b) (m₁ a e) = m₂ b a = m₁ b a`. -/
theorem eckmann_hilton {X : Type u} (m₁ m₂ : X → X → X) (e₁ e₂ : X)
    (h₁l : ∀ x, m₁ e₁ x = x) (h₁r : ∀ x, m₁ x e₁ = x)
    (h₂l : ∀ x, m₂ e₂ x = x) (h₂r : ∀ x, m₂ x e₂ = x)
    (interchange : ∀ a b c d, m₁ (m₂ a b) (m₂ c d) = m₂ (m₁ a c) (m₁ b d)) :
    e₁ = e₂ ∧ m₁ = m₂ ∧ ∀ a b, m₁ a b = m₁ b a := by
  have units : e₁ = e₂ := by
    have h := interchange e₂ e₁ e₁ e₂
    rw [h₂l, h₂r, h₁l, h₁r, h₁l, h₂l] at h
    exact h
  subst units
  have same : m₁ = m₂ := by
    funext a b
    calc m₁ a b = m₁ (m₂ a e₁) (m₂ e₁ b) := by rw [h₂r, h₂l]
      _ = m₂ (m₁ a e₁) (m₁ e₁ b) := interchange a e₁ e₁ b
      _ = m₂ a b := by rw [h₁r, h₁l]
  refine ⟨rfl, same, fun a b => ?_⟩
  calc m₁ a b = m₁ (m₂ e₁ a) (m₂ b e₁) := by rw [h₂l, h₂r]
    _ = m₂ (m₁ e₁ b) (m₁ a e₁) := interchange e₁ a b e₁
    _ = m₂ b a := by rw [h₁l, h₁r]
    _ = m₁ b a := by rw [same]
Axioms used: Quot.soundformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor

Mac Lane's coherence theorem is in Mathlib for the free monoidal category:

coherenceLean 4Applies a library theoremFormally verified
/-- **Mac Lane's coherence theorem**, in Mathlib's form: in the free monoidal category on a type
`C` (objects are formal bracketed words in `C` and `I`, morphisms are built from associators,
unitors and identities), any two parallel morphisms are equal.
Mathlib's `FreeMonoidalCategory.subsingleton_hom`. -/
theorem coherence (C : Type u) (X Y : FreeMonoidalCategory C) (f g : X ⟶ Y) : f = g :=
  Subsingleton.elim f g
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor
types_symmetricLean 4Proved here from basic factsFormally verified
/-- **`(Type, ×, PUnit)` is symmetric.** The braiding `X × Y ≅ Y × X` swaps the coordinates, so
braiding twice is the identity. Checked on elements: `(x, y) ↦ (y, x) ↦ (x, y)`. -/
theorem types_symmetric (X Y : Type u) :
    (β_ X Y).hom ≫ (β_ Y X).hom = 𝟙 (X ⊗ Y) := by
  ext ⟨x, y⟩ <;> rfl
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor
monoid_objects_in_typesLean 4Applies a library theoremFormally verified
/-- **Monoid objects in `(Type, ×, PUnit)` are monoids.** The category of monoid objects is
equivalent to the category of monoids (Mathlib's `Mon.monTypeEquivalenceMon`). -/
theorem monoid_objects_in_types : Nonempty (Mon (Type u) ≌ MonCat.{u}) :=
  ⟨monTypeEquivalenceMon⟩
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor
monads_are_monoidsLean 4Applies a library theoremFormally verified
/-- **Monads are monoid objects in the strict monoidal category `(C ⥤ C, ∘, 𝟭)`**
(Mathlib's `Monad.monadMonEquiv`). -/
theorem monads_are_monoids (C : Type u) [Category.{v} C] :
    Nonempty (Monad C ≌ Mon (C ⥤ C)) :=
  ⟨Monad.monadMonEquiv C⟩
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor

Finally, the twisted associator on Z/3\Z/3-graded vector spaces. We record the exponent of ζ=e2πi/3\zeta = e^{2\pi i/3}, so the multiplicative cocycle condition becomes an additive identity in Z/3\Z/3 that Lean checks in all 243 cases; a naive alternative fails.

carryCochainLean 4Formally verified
/-- The **carry cochain** on `ℤ/3` with parameter `p`: `ω(a, b, c) = p · a · carry(b, c)` in
`ℤ/3`, where `carry(b, c) = 1` if `b + c` wraps around (as integers `b + c ≥ 3`) and `0`
otherwise. Read `ω(a, b, c)` as the exponent of the cube root of unity `ζ = e^{2πi/3}` that
the associator `(δ_a ⊗ δ_b) ⊗ δ_c ⟶ δ_a ⊗ (δ_b ⊗ δ_c)` multiplies by, in the category of
`ℤ/3`-graded vector spaces. -/
def carryCochain (p : Fin 3) (a b c : Fin 3) : Fin 3 :=
  p * a * (if 3 ≤ b.val + c.val then 1 else 0)
Axioms used: propextformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor
carry_pentagonLean 4Proved here from basic factsFormally verified
/-- **The pentagon holds for the twisted associator.** For simple objects the pentagon axiom of
`Vec_{ℤ/3}^ω` says exactly that `ω` is a 3-cocycle:
`ω(b,c,d) + ω(a,b+c,d) + ω(a,b,c) = ω(a+b,c,d) + ω(a,b,c+d)` (exponents of `ζ`, added in `ℤ/3`).
We check it for all `3 · 3⁴ = 243` cases by computation (`decide`). The lesson gives the general
proof for `ℤ/n`. -/
theorem carry_pentagon : ∀ p a b c d : Fin 3,
    carryCochain p b c d + carryCochain p a (b + c) d + carryCochain p a b c =
      carryCochain p (a + b) c d + carryCochain p a b (c + d) := by
  decide
Axioms used: propextformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor
naive_not_cocycleLean 4Proved here from basic factsFormally verified
/-- **A naive associator fails the pentagon.** Twisting by the carry of the *first* two indices,
`ω'(a, b, c) = carry(a, b)`, does *not* satisfy the cocycle condition:
`(a, b, c, d) = (1, 2, 0, 0)` is a counterexample (the two sides are `2` and `1` in `ℤ/3`).
Checked by computation. -/
theorem naive_not_cocycle :
    let ω' : Fin 3 → Fin 3 → Fin 3 → Fin 3 := fun a b _ => if 3 ≤ a.val + b.val then 1 else 0
    ¬ ∀ a b c d : Fin 3,
      ω' b c d + ω' a (b + c) d + ω' a b c = ω' (a + b) c d + ω' a b (c + d) := by
  decide
Axioms used: propextformal/Lumenary/MonoidalCategories.leanTry it in the Lean web editor

What is and is not formalised. Independently proved: the commutativity of End(I)\mathrm{End}(I) (from Kelly's identity, which is taken from Mathlib), Eckmann–Hilton, symmetry of the cartesian braiding on types, and the cocycle computations for Z/3\Z/3. From Mathlib: the axioms, Kelly's identity, coherence for free monoidal categories, monoid objects in types, and monads as monoids. Not formalised here: strictification, the general cocycle identity for Z/n\Z/n (proved above in prose), the construction of VecGω\mathrm{Vec}_G^\omega itself, and braided-but-not-symmetric examples.

ComputationC

Associahedra, cocycles and R-matrices

The first experiment builds the associahedra (bracketings and associator moves) for up to six objects, checks the cocycle condition for the carry cochains on Z/n\Z/n for n≤6n \le 6, and then tests coherence directly: for every grading of five simple objects in VecZ/3ω\mathrm{Vec}_{\Z/3}^\omega, all paths of associators between bracketings carry the same total twist — and for a naive twist, many gradings fail.

Pentagons, associahedra and a twisted associatorPythonExact computationExhaustive finite checkCounterexampleComputationally tested
"""Pentagons, associahedra and a twisted associator.

Bracketings of n objects are the vertices of the associahedron; one
application of an associator (X Y) Z -> X (Y Z) inside a bracketing is an
edge. For n = 4 the graph is the pentagon. Mac Lane's coherence theorem says
that once the pentagon commutes, every diagram of associators commutes.

We test this in the category of Z/n-graded vector spaces with associator
twisted by a function w(a, b, c) in Z/n (the exponent of a root of unity).
The pentagon for simple objects is the 3-cocycle condition. For the carry
cochain w(a, b, c) = p * a * carry(b, c) it holds, and then every path
between two bracketings of five graded objects has the same total twist;
for a naive guess it fails, and so does path-independence. Exact integer
arithmetic; exhaustive over the finite ranges stated.
"""

import itertools

def bracketings(leaves):
    """All full bracketings of a tuple of leaves, as nested pairs."""
    if len(leaves) == 1:
        return [leaves[0]]
    out = []
    for k in range(1, len(leaves)):
        for left in bracketings(leaves[:k]):
            for right in bracketings(leaves[k:]):
                out.append((left, right))
    return out

def moves(tree):
    """All (result, (x, y, z)) for one associator ((x y) z) -> (x (y z))."""
    out = []
    if isinstance(tree, tuple):
        left, right = tree
        if isinstance(left, tuple):
            x, y = left
            out.append(((x, (y, right)), (x, y, right)))
        out += [((new, right), xyz) for new, xyz in moves(left)]
        out += [((left, new), xyz) for new, xyz in moves(right)]
    return out

def associahedron(n):
    """(number of vertices, number of edges) for bracketings of n objects."""
    trees = bracketings(tuple(range(n)))
    edges = sum(len(moves(t)) for t in trees)
    return len(trees), edges

def carry(b, c, n):
    """1 if b + c wraps around modulo n, else 0."""
    return 1 if b + c >= n else 0

def carry_cochain(p, n):
    """The cochain w(a, b, c) = p * a * carry(b, c) mod n."""
    return lambda a, b, c: p * a * carry(b, c, n) % n

def naive_cochain(n):
    """A wrong guess: twist by the carry of the first two indices."""
    return lambda a, b, c: carry(a, b, n)

def cocycle_failures(w, n):
    """Quadruples (a, b, c, d) where the pentagon (cocycle) condition fails."""
    bad = []
    for a, b, c, d in itertools.product(range(n), repeat=4):
        lhs = w(b, c, d) + w(a, (b + c) % n, d) + w(a, b, c)
        rhs = w((a + b) % n, c, d) + w(a, b, (c + d) % n)
        if (lhs - rhs) % n:
            bad.append((a, b, c, d))
    return bad

def path_independent(w, grades, n):
    """True if all associator paths between bracketings carry the same twist.

    The twist of a move ((x y) z) -> (x (y z)) is w(deg x, deg y, deg z);
    going backwards along a move contributes minus that twist. Leaves are
    tagged with their position, and grades[i] is the grade of leaf i. We
    try to assign each bracketing a "potential" consistent with every edge.
    """
    trees = bracketings(tuple(range(len(grades))))

    def deg(t):
        if isinstance(t, tuple):
            return (deg(t[0]) + deg(t[1])) % n
        return grades[t] % n

    neighbours = {t: [] for t in trees}
    for tree in trees:
        for new, (x, y, z) in moves(tree):
            twist = w(deg(x), deg(y), deg(z))
            neighbours[tree].append((new, twist))
            neighbours[new].append((tree, -twist))
    potential = {trees[0]: 0}
    frontier = [trees[0]]
    while frontier:
        tree = frontier.pop()
        for new, twist in neighbours[tree]:
            value = (potential[tree] + twist) % n
            if new not in potential:
                potential[new] = value
                frontier.append(new)
            elif potential[new] != value:
                return False
    return len(potential) == len(trees)

def main():
    print("Associahedra: bracketings (vertices) and associator moves (edges)")
    for n in range(2, 7):
        v, e = associahedron(n)
        print(f"  {n} objects: {v:3d} bracketings, {e:3d} moves")
    print("Pentagon = 3-cocycle condition for w(a,b,c) = p*a*carry(b,c) mod n")
    for n in range(2, 7):
        bad = sum(len(cocycle_failures(carry_cochain(p, n), n))
                  for p in range(n))
        print(f"  Z/{n}: all {n} values of p, {n ** 4} quadruples each: "
              f"{bad} failures")
    naive = cocycle_failures(naive_cochain(3), 3)
    print(f"  naive w(a,b,c) = carry(a,b) on Z/3: {len(naive)} failures, "
          f"first {naive[0]}")
    print("Coherence: all paths in the associahedron for 5 graded objects")
    grades = list(itertools.product(range(3), repeat=5))
    good = sum(path_independent(carry_cochain(1, 3), g, 3) for g in grades)
    bad = sum(path_independent(naive_cochain(3), g, 3) for g in grades)
    print(f"  carry cochain, p = 1: {good} of {len(grades)} gradings "
          "path-independent")
    print(f"  naive cochain:        {bad} of {len(grades)} gradings "
          "path-independent")
    print()
    print("Epistemic status: exact, exhaustive checks over the finite ranges "
          "shown.\nThey illustrate Mac Lane's coherence theorem (pentagon => "
          "all diagrams\ncommute) in one family of examples; the theorem "
          "itself, and the cocycle\nidentity for every n, are proved in the "
          "lesson, not here.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The second experiment checks, symbolically in qq, that the Uq(sl2)U_q(\mathfrak{sl}_2) R-matrix satisfies the braid relation and the Hecke relation, and squares to the identity only for q=±1q = \pm 1.

A braided but not symmetric R-matrixPythonSymbolic computationComputationally tested
"""A braiding that is not symmetric: the R-matrix of the quantum group.

On V = C^2 (basis e1, e2) take the 4 x 4 matrix acting on V (x) V
    R(q) = [[q, 0, 0, 0], [0, 0, 1, 0], [0, 1, q - 1/q, 0], [0, 0, 0, q]].
Up to a scalar it is the braiding c_{V,V} of the category of representations
of the quantum group U_q(sl_2). At q = 1 it is the swap of tensor factors,
the symmetric braiding of vector spaces. SymPy checks, with q a symbol:
* the braid (Yang-Baxter) relation on V (x) V (x) V, which every braiding in a
  braided monoidal category satisfies;
* the Hecke relation (R - q)(R + 1/q) = 0;
* that R^2 = 1 exactly when q^2 = 1, so for other q braiding twice is not the
  identity: the category is braided but not symmetric.
"""

import sympy

Q = sympy.symbols("q", nonzero=True)

def r_matrix(q):
    """The braiding matrix R(q) on V (x) V, basis e11, e12, e21, e22."""
    return sympy.Matrix([[q, 0, 0, 0],
                         [0, 0, 1, 0],
                         [0, 1, q - sympy.Integer(1) / q, 0],
                         [0, 0, 0, q]])

def swap():
    """The symmetric braiding of vector spaces: v (x) w -> w (x) v."""
    return sympy.Matrix([[1, 0, 0, 0],
                         [0, 0, 1, 0],
                         [0, 1, 0, 0],
                         [0, 0, 0, 1]])

def on_first_two(m):
    """m (x) id_V acting on V (x) V (x) V."""
    return sympy.kronecker_product(m, sympy.eye(2))

def on_last_two(m):
    """id_V (x) m acting on V (x) V (x) V."""
    return sympy.kronecker_product(sympy.eye(2), m)

def braid_defect(m):
    """(m1 m2 m1 - m2 m1 m2), simplified, for m1 = m (x) 1, m2 = 1 (x) m."""
    a, b = on_first_two(m), on_last_two(m)
    return sympy.simplify(a * b * a - b * a * b)

def hecke_defect(m, q):
    """(m - q)(m + 1/q), simplified."""
    eye = sympy.eye(m.shape[0])
    return sympy.simplify((m - q * eye) * (m + eye / q))

def square_minus_identity(m):
    """m^2 - 1, simplified."""
    return sympy.simplify(m * m - sympy.eye(m.shape[0]))

def main():
    r = r_matrix(Q)
    print("R(q) on V (x) V, basis e1e1, e1e2, e2e1, e2e2:")
    for row in r.tolist():
        print("   " + "  ".join(f"{str(x):>7}" for x in row))
    print(f"R(1) is the swap of tensor factors:          "
          f"{r_matrix(1) == swap()}")
    zero8 = sympy.zeros(8, 8)
    print(f"braid relation R1 R2 R1 = R2 R1 R2 (8 x 8):  "
          f"{braid_defect(r) == zero8}")
    print(f"Hecke relation (R - q)(R + 1/q) = 0:         "
          f"{hecke_defect(r, Q) == sympy.zeros(4, 4)}")
    diff = square_minus_identity(r)
    print(f"R^2 - 1 = (q - 1/q) R:                       "
          f"{sympy.simplify(diff - (Q - 1 / Q) * r) == sympy.zeros(4, 4)}")
    roots = sympy.solve([x for x in diff if x != 0], Q, dict=True)
    print(f"values of q with R^2 = 1:                    "
          f"{sorted(s[Q] for s in roots)}")
    r2 = r_matrix(sympy.Integer(2))
    print(f"q = 2: R^2 = 1? {square_minus_identity(r2) == sympy.zeros(4, 4)}"
          f";  braid relation? {braid_defect(r2) == zero8}")
    print()
    print("Epistemic status: exact symbolic verification of matrix "
          "identities, as\nreliable as SymPy's simplification of rational "
          "functions of q. It checks\nconsequences of the braiding axioms on "
          "one representation; that these\nmatrices come from a braided "
          "monoidal category (Drinfeld, Jimbo) is a\ntheorem cited in the "
          "lesson, not proved here.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Exercises

Exercises

1. Monoidal categories

Warm-upHuman

In the monoidal category (Set,⊔,I)(\mathbf{Set}, \sqcup, I) whose tensor product is disjoint union, what must the unit object II be (up to isomorphism)?

Choose one

2. Monoidal categories

Warm-upHuman

How many different full bracketings are there of the word A⊗B⊗C⊗D⊗EA \otimes B \otimes C \otimes D \otimes E (keeping the order of the letters)? These are the vertices of the 3-dimensional associahedron.

3. Monoidal categories

CoreHuman

The proof that End(I)\mathrm{End}(I) is commutative uses that I⊗gI \otimes g and f⊗If \otimes I commute, for f,g:I→If, g : I \to I. Which fact gives this?

Choose one

4. Monoidal categories

CoreHuman

What is a monoid object in (Ab,⊗Z,Z)(\mathbf{Ab}, \otimes_{\mathbb{Z}}, \mathbb{Z})?

Choose one

5. Monoidal categories

CoreHuman

Which of these braided monoidal categories is not symmetric?

Choose one

6. Monoidal categories

StretchHuman

A monoid object in (Mon,×,1)(\mathbf{Mon}, \times, 1) is a monoid (M,⋅,1)(M, \cdot, 1) together with a multiplication ∗:M×M→M\ast : M \times M \to M and unit that are monoid homomorphisms. What can you conclude?

Choose one

7. Monoidal categories

CoreFormal

Which Lean statement (in Mathlib's notation, ≫ = composition in diagrammatic order) formalises "End(I)\mathrm{End}(I) is commutative"?

Choose one

8. Monoidal categories

StretchComputational

An associator on Z/n\mathbb{Z}/n-graded vector spaces is given by exponents w(a,b,c)∈Z/nw(a, b, c) \in \mathbb{Z}/n of ζ=e2πi/n\zeta = e^{2\pi i/n}. Write is_cocycle(w, n) that returns True exactly when the pentagon (3-cocycle) condition

w(b,c,d)+w(a,b+c,d)+w(a,b,c)≡w(a+b,c,d)+w(a,b,c+d)(modn)w(b, c, d) + w(a, b + c, d) + w(a, b, c) \equiv w(a + b, c, d) + w(a, b, c + d) \pmod n

holds for all a,b,c,d∈{0,…,n−1}a, b, c, d \in \{0, \dots, n - 1\} (sums of grades taken mod nn).

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Common misconceptionsH

Common misconceptions

Misconception

"Every braided monoidal category is symmetric." A braiding need not square to the identity. In the braid category σ2≠id\sigma^2 \neq \mathrm{id} because B2≅ZB_2 \cong \Z; in Rep(Uq(sl2))\mathrm{Rep}(U_q(\mathfrak{sl}_2)) at generic qq the R-matrix satisfies R2=1+(q−q−1)R≠1R^2 = 1 + (q - q^{-1})R \neq 1. Symmetric is a property; braided is extra structure, and a monoidal category may carry several braidings.

Misconception

"The monoidal product is the cartesian product." ⊗\otimes in Vectk\cat{Vect}_k, Ab\cat{Ab} or Hilb\cat{Hilb} is not a product: there are no natural projections V⊗W→VV \otimes W \to V and no natural diagonal V→V⊗VV \to V \otimes V (copying v+wv + w would give (v+w)⊗(v+w)≠v⊗v+w⊗w(v + w) \otimes (v + w) \neq v \otimes v + w \otimes w — the linear-algebra core of the quantum no-cloning theorem). Cartesian monoidal categories are a special case, characterised by natural diagonals and projections.

Misconception

"Coherence means every diagram commutes." Only formal diagrams built from α,λ,ρ\alpha, \lambda, \rho commute. If two different formal expressions happen to evaluate to the same object (e.g. X⊗XX \otimes X), the canonical maps between them may differ: the symmetry of X×XX \times X is not the identity.

Misconception

"By strictification we may always assume the associator is the identity and the category is skeletal." Every monoidal category is equivalent to a strict one, but not always to one that is both strict and skeletal: an observation of Isbell (discussed in Mac Lane's book) shows that the skeleton of (Set,×)(\cat{Set}, \times) cannot be made strict. Likewise in VecZ/nωp\mathrm{Vec}_{\Z/n}^{\omega_p} with p≢0(modn)p \not\equiv 0 \pmod n the associator cannot be made the identity while keeping one object per isomorphism class: a strict model needs many isomorphic copies of each simple object.

ViewpointsH

Viewpoints

Topology— Loops, configuration spaces and E_n

Eckmann and Hilton found their argument for homotopy groups: for n≥2n \ge 2, πn(X)\pi_n(X) has two composition laws (concatenate in the first or the second coordinate of [0,1]n[0,1]^n) satisfying interchange, so πn(X)\pi_n(X) is abelian, while π1\pi_1 need not be. The same mechanism stratifies monoidal structures: a monoidal category is an "E1E_1-algebra" in categories (objects can be multiplied along a line), a braided monoidal category an E2E_2-algebra (in the plane, where points can circle each other), and for n≥3n \ge 3 an EnE_n-structure on a 1-category is just a symmetric monoidal structure. The braid group BnB_n is the fundamental group of the space of nn unordered distinct points in R2\R^2 (Fox–Neuwirth 1962); in R3\R^3 that fundamental group is the symmetric group SnS_n, because a double exchange can be undone in three dimensions. This is the topological reason why braidings are "2-dimensional" and symmetries "3-dimensional and up" (see the fundamental group and homotopy theory).

Geometry— String diagrams and knot invariants

Joyal and Street (1991) proved that string diagrams are a sound and complete calculus: an equation between morphisms of the free monoidal category on a set of generating boxes holds if and only if the corresponding planar diagrams are isotopic (in the plane, keeping endpoints fixed). For braided categories the diagrams live in 3-dimensional space and isotopy is of braids and tangles; for symmetric categories strings may pass through each other. Adding duals and a twist gives ribbon categories, whose diagrams are framed tangles; Reshetikhin and Turaev (1990) turned this into invariants of framed links and 3-manifolds from quantum groups — the Jones polynomial arises from the R-matrix of Uq(sl2)U_q(\mathfrak{sl}_2) in the second experiment (see knot theory and low-dimensional topology).

Physics— Composite systems, no-cloning and anyons

In quantum mechanics the state space of a composite system is H1⊗H2\mathcal{H}_1 \otimes \mathcal{H}_2, and entangled states are exactly the elements that are not pure tensors — a phenomenon impossible in a cartesian category, where every map into A×BA \times B is a pair. Abramsky and Coecke (2004) recast quantum protocols such as teleportation as calculations in symmetric monoidal categories with duals, drawn with string diagrams (see quantum mechanics). Exchange statistics are a braiding: in three spatial dimensions exchanging two identical particles twice is trivial, giving bosons and fermions (the symmetric case, with the sign rule of super vector spaces for fermions); in two spatial dimensions it need not be, and quasiparticles called anyons are described by braided (modular) tensor categories (Leinaas and Myrheim 1977; Wilczek 1982). Kitaev (2003) proposed using non-abelian anyons for fault-tolerant quantum computation.

Algebra— Cohomology, Hopf algebras and Tannaka duality

The associators on GG-graded vector spaces with δg⊗δh=δgh\delta_g \otimes \delta_h = \delta_{gh} are classified by H3(G,k×)H^3(G, k^\times), so group cohomology measures exactly how non-associative (up to coherent isomorphism) such a category can be; braidings on them are classified by Eilenberg–Mac Lane's abelian cohomology. For an algebra HH, monoidal structures on Rep(H)\mathrm{Rep}(H) compatible with the forgetful functor correspond to bialgebra structures, and braidings to R-matrices (Drinfeld). Conversely, Tannaka–Krein duality recovers a group from its symmetric monoidal category of representations with the forgetful functor; Deligne (2002) showed that, over an algebraically closed field of characteristic 0, symmetric tensor categories of moderate growth are representation categories of affine supergroups (see representation theory).

Category theory— One object, one dimension up

A monoidal category is a bicategory with one object: objects of C\mathcal{C} become 1-cells, ⊗\otimes becomes composition of 1-cells, and morphisms become 2-cells. Iterating: a braided monoidal category is a tricategory with one object and one 1-cell, and the Eckmann–Hilton argument explains why one-object, one-1-cell 2-categories are commutative monoids. Monoidal categories are also the natural bases for enrichment: replacing hom-sets by hom-objects in a monoidal category V\mathcal{V} gives additive categories, 2-categories and Lawvere's metric spaces (see enriched categories and higher categories).

History & global context

History and global context

  • Products of spaces, tensor products of modules and convolution of functions were used long before the axioms; the interchange law appeared in Beno Eckmann and Peter Hilton's work on group-like structures (1962), and the bracketings of a product were studied by Dov Tamari (1951) and, as cell complexes, by Jim Stasheff (1963) in his theory of A∞A_\infty-spaces.
  • Jean Bénabou (1963, "catégories avec multiplication") and Saunders Mac Lane (1963, "Natural associativity and commutativity") introduced monoidal categories; Mac Lane proved the coherence theorem and found the pentagon and hexagon. G. Max Kelly (1964) showed that some of Mac Lane's axioms were redundant, and with Samuel Eilenberg developed closed categories (1966).
  • André Joyal and Ross Street introduced braided monoidal categories (circulated 1986, published 1993) and the geometry of string diagrams (1991). Vladimir Drinfeld and Michio Jimbo introduced quantum groups (1985–86), and Nicolai Reshetikhin and Vladimir Turaev (1990–91) built link and 3-manifold invariants from their braided categories of representations, following Vaughan Jones's discovery of his polynomial (1984).
  • Samson Abramsky and Bob Coecke (2004) began categorical quantum mechanics; Alexei Kitaev (2003) and Michael Freedman and collaborators connected braided categories to topological quantum computation.
Further reading

Further reading

  • Pavel Etingof, Shlomo Gelaki, Dmitri Nikshych and Victor Ostrik, Tensor Categories (2015) — the standard modern reference, Chapters 1–2 and 8.
  • Saunders Mac Lane, Categories for the Working Mathematician (2nd edition, 1998), Chapters VII and XI — monoidal categories and coherence.
  • André Joyal and Ross Street, "Braided tensor categories", Advances in Mathematics 102 (1993), and "The geometry of tensor calculus I", Advances in Mathematics 88 (1991).
  • Christian Kassel, Quantum Groups (1995) — braided categories, R-matrices and knot invariants.
  • Chris Heunen and Jamie Vicary, Categories for Quantum Theory (2019) — monoidal categories and string diagrams for physics.
  • Emily Riehl, Category Theory in Context (2016), for the background on functors and adjunctions.