# Notes on Lawvere Theories

$\require{AMScd} \require{AMSmath} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\id}{\mathrm{id}} \newcommand{\str}[2]{#1–\mathbf{Str}(\mc #2)} \newcommand{\model}{\mathrm{Mod}} \newcommand{\clsf}{\mathrm{Cl}} \newcommand{\hom}{\mathrm{Hom}}$

In a way, this post is a continuation of my notes on functorial semantics for algebraic theories. My main sources are (still) Steve Awodey’s notes lecture notes on categorical logic, and the ncatlab article on algebraic theories. I also read parts of Filip Bár’s Notes on Adjunctions, Monads, and Lawvere Theories.

#### Lawvere Algebraic Theories

The discussion from last time can be continued in a more abstract setting: We went from algebraic theories to their classifying category and saw that we can essentially replace the theory with its classifying category. The classifying category itself had the property that each of its objects is a product of the basic objects corresponding to sorts. So we can just as well define a theory to be just that, and this is then a (multisorted) Lawvere algebraic theory (LAT, or algebraic Lawvere theory?). Explicitly, such a theory is a locally small category with products and a set of distinguished objects $S$ (representing the sorts) such that each object of the category is a (finite) product of these (the non-finite case of course corresponds to infinitary operations). In line with this is the definition of a model of a LAT $\mc T$ is a (finite-)product preserving functor $\mc T \to \mc C$, and the homomorphisms of the models are just the natural transformations between the functors.

Immediate examples come from taking the full subcategory generated by an object along with all of its finite powers or any category $\clsf(T)$ for $T$ an algebraic theory. A more intriguing example is the given by all powers of $\mathbf{N}$ along with the computable functions $\mathbf N^k \to \mathbf N^l$.

Given an $S$-sorted LAT $\mc T$, we can consider the category of $Set$-models $\model(\mc T) = \hom(\mc T, Set)$. There is a functor $U \colon \model(\mc T) \to Set^S$ that is given by evaluating a functor $\mc T \to Set$ at each of the sorts of $S$. Conversely, we have a functor $F \colon Set^S \to \model(\mc T)$ defined via $F(P) = \hom(\prod_{s \in S} s^{P(s)}, -)$, which is just the free model on the given sets (in the case of finitary theories, replace $Set$ with the category of finite sets). Checking that $F \dashv U$ requires little more than an application of the Yoneda lemma.

The monad induced by this adjunction is the monad of the Lawvere theory $\mc T$ (you can also go the other way around and construct the Lawvere theory of a monad by taking the opposite of the monad’s Kleisli category). As a reminder, the Kleisi-category $\mathrm{Kl}(N)$ of a monad $N$ is the full subcategory of the free algebras in the monad’s Eilenberg-Moore category. It is then no surprise that $\mc T \simeq \mathrm{Kl}(UF)^{op}$: in fact, this is what we stated above, since the contravariant Yoneda-embedding is full and faithful. This last point is sometimes referred to as Lawvere duality and says that the theory is dual to its models.