HomeBlogNotesFood

home/blog/supplements/monads/monoidal-categories

Monoids and monoidal categories


In the main post, we talked about groups and monoids in the context of functors and what it means to have a monoid in a category of endofunctors. But eh particular interpretation of a monoid that we used for endofunctors is kind of a specific case of a more general pattern in categories. The core elements are still the same, but certain parts of what we said for endofunctors can be generalized using the notion of an aptly named “monoidal” category, which we’ll discuss here.

A monoidal category is characterized by a particular functor, which is the “tensor” product . The (categorical) tensor product isn’t an endofunctor–rather than mapping directly from a category to itself, it instead maps two things (objects or morphisms) from a category back to a single object or morphism in the category. It also isn’t really related directly to tensors. Instead it captures the idea of what that kind of product does, which is to say that it combines things together. Just like the linear-algebraic tensor product of two vectors in (possibly) different vector spaces produces a vector in their joint space, the categorical tensor product takes two objects (or morphisms, considering its status as a bifunctor), and joins them together into a single object or morphism that exists within the same category. In other terms, for some category ,

must also have some object that acts as an “identity” or “unit” under , which is to say that it effectively does nothing.

What does “nothing” mean here? The precise way to say it is that these two commutative diagrams must be satisfied:

Intuitively, we say that is an “associator” natural isomorphism–its only job is to shuffle around the order in which is applied (note the parentheses) while acting trivially on the objects themselves. and (for left and right) are “unitor” natural isomorphisms that act on a monoidal prouct of an object with the unit, returning the product back to the ordinary object–kind of like “dividing” by the unit. Requiring that the diagrams commute imposes the condition that is associative, and that the product of an object with the unit actually is trivial.

If and can be defined for some category with the above properties, then the category together with and is called “monoidal.” In the category of natural numbers, ordinary multiplication can be viewed as a tensor product, with being the unit; in , the categorical tensor product and linear-algebraic tensor product coincide, with any one-dimensional vector space being acceptable as a unit. To help disambiguate in the general case is often just called the “monoidal product.” Monoidal categories are relevant to, for example, the categorical study of physics. Categorical quantum mechanics is the textbook case, where describes how to compose physical systems (e.g. describing the dynamics of two particles in terms of those for both particles individually). The constraints encoded by the diagrams above then align with the intuition that the laws of physics be principally invariant with respect to the number and order of the physical systems being combined.

So then when it comes to monoids, recall that we have a single object in some category with potentially many endomorphisms,

But this is for the case where a monoid is modeled using an entire category. A more flexible model uses a monoid object, where the monoid is only a single object in a larger category, as was the case for monads.

For monads, the object is an endofunctor that is constrained with two natural transformations and . For general monoids, we only want to think about as a plain object in some category. The question is, what do and back-translate“ to in this picture?

If is an object, then it makes sense for and to be morphisms. Additionally, should point from the combination of with itself back to , and should point from some kind of unit object to . Given the discussion of monoidal categories above, you can probably guess that the “combination” and “unit object” correspond to the monoidal product and the monoidal unit . Thus we have

Then, the coherence conditions for this monoid are back-translated to two commuting diagrams,