Guest post by Evangelia Aleiferi

We begin the second series of the Kan Extension Seminar by discussing the paper The Category Theoretic Understanding of Universal Algebra: Lawvere Theories and Monads by Martin Hyland and John Power, published in 2007. The subject of the above is to give a historical survey on the two main category theoretic formulations of universal algebra, the first being Lawvere theories and the second the theory of monads. Lawvere theories were introduced by William Lawvere in 1963 as part of his doctoral thesis, in order to provide an elegant categorical base for studying universal algebra, while monads were structures that had been already used in different areas of mathematics.

The article starts with the definition of a Lawvere theory and the category of its models, together with some of their properties. Later the authors proceed to relate the notion of monad to Lawvere theories and they give an explanation as to why they were dominantly used in the understanding of universal algebra, compared to Lawvere theories. Lastly they describe how monads and Lawvere theories can be used in formulating computational effects, motivated by the work of Moggi and Plotkin, and they propose future developments based on the connection between computational effects and universal algebra.

At this point, I would like to take the opportunity to thank Emily Riehl, Alexander Campbell and Brendan Fong for organizing the Kan Extension Seminar, as well as all the other participants for being such a great motivation!

Lawvere theories

Until 1963 the traditional way to conceptualize the general theory of algebraic structures was in terms of equational logic. In his doctoral thesis under the supervision of Samuel Eilenberg, Bill Lawvere attempted the unification of our understanding of universal algebra by using category theory. The advantage of this point of view over the previous one was that we can collect all the information about the operations themselves together with the axioms they are subject to, into a finite product preserving functor. In particular the definition was given as follows:

A Lawvere theory is a small category L L with finite products, together with a strict finite-product preserving identity-on-objects functor I : ℵ 0 op → L I:\aleph_0^{op} \to L , where ℵ 0 \aleph_0 is a skeleton of the category of finite sets.

We think of the arrows of a Lawvere theory as the collection of operations in a theory, and in particular, we think the hom-sets L ( n , 1 ) L(n,1) as the collections of the n-ary operations we can define. Lawvere theories, together with finite-product preserving commuting triangles between them, form a category Law \mathit{Law} . Moreover, Law \mathit{Law} has coproducts given by the quotient of the disjoint union of the operations of two Lawvere theories, over their equational axioms.

Examples of algebraic structures are in this case described as models of a specific Lawvere theory L L . That is, finite-product preserving functors M : L → C M:L \to C , to any category C C with finite products, among which Set \mathit{Set} is of primary interest. In their turn, models together with natural transformations between them form a category Mod ( L , C ) \mathit{Mod}(L,C) . We will talk more about the semantics of a Lawvere theory later on, when we will make the connection to monads. For the moment, we will restrict ourselves to describing a symmetric monoidal structure on Law Law :

Let L L and L ′ L' be two Lawvere theories. Their tensor product L ⊗ L ′ L \otimes L' will contain any operations f : n → m f:n \to m and f ′ : n ′ → m ′ f': n' \to m' of L L and L ′ L' respectively, subject to the following equations:

n × n ′ ⟶ n × f ′ n × m ′ f × n ′ ↓ ↓ f × m ′ m × n ′ ⟶ m × f ′ m × m ′ . \begin{matrix} n\times n' & \overset{n \times f'}{\longrightarrow} & n \times m' \\ {}_{f \times n'}\downarrow && \downarrow_{f \times m'} \\m \times n' & \underset{m \times f'}{\longrightarrow} & m \times m'. \\ \end{matrix}

The unit of the monoidal structure is given by the so called theory of an object, i.e. the category ℵ 0 op \aleph_0^{op} itself, considered as a Lawvere theory with the identity functor. An interesting aspect of the tensor product of two Lawvere theories is the behaviour of its models. One can prove that the models of the tensor product L ⊗ L ′ L \otimes L' in any categroy C C with finite products are equivalent, with respect to the underlying set functor given by the evaluation at 1, to the models of L L in the category Mod ( L ′ , C ) \mathit{Mod}(L',C) . The last can be applied to the Lawvere theory of a group, in order to show that its tensor product with itself is isomorphic to the Lawvere theory of an Abelian group.

Monads and their connection to Lawvere theories

The motivation for formulating universal algebra in terms of monads can be found in the well known “Categories for the Working Mathematician”. It was the observation of Eilenberg and Moore, back in 1965, of the fact that the category of algebras of the monad that arises from the free group functor, is exactly the category of groups. Three years after Lawvere’s thesis was submitted, Linton made the connection to monads as follows:

On the one hand, for any given Lawvere theory L L , the underlying set functor U L : Mod ( L , Set ) → Set U_L:\mathit{Mod}(L,\mathit{Set}) \to \mathit{Set} , given by M ↦ M ( 1 ) M \mapsto M(1) , had been proven by Lawvere to have a left adjoint. This adjunction will give rise to a monad T L T_L on Set Set . Linton showed that the category Mod ( L , Set ) \mathit{Mod}(L,Set) of models in Set Set is equivalent to the category of T L T_L -algebras.

On the other hand, if we consider any monad T T on Set Set , one can prove that the opposite of the Kleisli category Kl ( T ) \mathit{Kl}(T) becomes a Lawvere theory by restricting to the category ℵ 0 op \aleph_0^{op} the finite-product preserving canonical functor Set op → Kl ( T ) op \mathit{Set}^{op} \rightarrow \mathit{Kl}(T)^{op} .

Moreover, both of these mappings turn out to be functorial. We can observe that if we start with a Lawvere theory L L and consider its monad T L T_L , then the Lawvere theory Kl ( T L ) op \mathit{Kl}(T_L)^{op} is isomorphic to L L in Law \mathit{Law} . By that, we can consider Law \mathit{Law} as a full subcategory of the category of monads, whose inclusion functor has a right adjoint.

Which approach is better?

History showed that category theorists favored the one in terms of monads. However there are a few drawbacks to that approach. For instance, there is an equivalence of categories between the category of monads on Set \mathit{Set} and the category of large Lawvere theories, i.e. locally small categories with a strict identity-on-objects product preserving functor from the opposite of a skeleton of Set \mathit{Set} . This encompasses monads without rank, which do not preserve all κ \kappa -filtered colimits for any cardinal κ \kappa . This is due do the fact that while we are able to introduce a notion of sum between Lawvere theories (given by their coproduct), as well as a notion of a tensor product, we cannot necessarily do the same for monads without rank, which means that we are moving away from the “algebraic nature” of Lawvere theories.

Thus, why did monads gain prominence over Lawvere theories in understanding unversal algebra? Here are some possible explanations:

While we can consider monads over a general category and then study Set \mathit{Set} as an example of primary interest, Lawvere theories require some notion of finiteness, which does not exist in general. One could use the notion of locally finitely presentable categories but this did not exist until some years later. It would be easier to visualize earlier a generalisation of Lawvere theories in terms of enriched categories, however this area of category theory was not yet widely developed. It was only after the early 80s that we could define Lawvere theories enriched in a locally finitely presentable monoidal closed category V V and consider its models as V V -functors. Concepts in categorical logic that appear to be closely related to Lawvere theories came to light much later.

Computational effects and universal algebra

Another significant use of monads came from computer science and specifically by Eugenio Moggi’s PhD thesis defense under the supervision of Plotkin in 1987. Moggi introduced his notions of computations and he wanted to give a general semantics of them by using mathematical theory. The actual formulation came a couple of years later, when he used monads to describe computational effects. An alternative suggestion to unify computational effects, related though to the previous one, came in 2002 by Hyland, Plotkin and Power, and it was in terms of Lawvere theories. The argument will become clearer by the use of an example:

Consider a finite set of values Val \mathit{Val} and a finite set of locations Loc \mathit{Loc} . Then the side-effects Lawvere theory L S L_S , when S = Val Loc S=\mathit{Val}^{\mathit{Loc}} , is the free Lawvere theory generated by the operations lookup : Val → Loc \mathit{lookup}:\mathit{Val} \to \mathit{Loc} and update : 1 → Loc × Val \mathit{update}:1\to \mathit{Loc} \times \mathit{Val} , as it was defined in Notions of Computation Determine Monads, by Plotkin and Power. Then the underlying set functor U : Mod ( L S , Set ) → Set U:\mathit{Mod}(L_S,Set) \to \mathit{Set} , given by evaluation at 1 1 , will give rise to a monad, which in its turn, coincides with Moggi’s side effect monad ( S × − ) S (S\times -)^S . An interesting result relative to the one for the tensor product of the Lawvere theory of a group is the following: The side-effects theory for S = Val Loc S=\mathit{Val}^{\mathit{Loc}} is the Loc \mathit{Loc} -fold tensor product of the side-effects theory for S = Val S=\mathit{Val} .

Around this time, Hyland, Plotkin and Power, motivated by observations like the above, showed that computational effects can be regarded as instance of universal algebra. However continuations are an exception to that. This is due to the fact that the continuations monad has no rank so it doesn’t really fit into the setting of Lawvere theories, for the reasons discussed above. This indicates a fruitful area for future work.