TITLE: Presenting Lawvere theories?
QUESTION [6 upvotes]: (Re)Reading Lawvere theories versus classical universal algebra, I was reminded of a question I have had for quite some time:

What is the best way to present Lawvere theories?

By present, I mean give a (mathematical) description of the theory, by means of syntax.  The Lawvere theory will be the denotation of that syntax.
I believe I understand the technical advantages that they provide over classical universal algebra (basically in terms of proving theorems over the models).  My 'problem' is that I am trying to mechanize (parts of) mathematics.  And to do that, one needs examples, which means constructing particular theories; more precisely, that means writing something down, in finite terms which denotes a theory.
Lawvere theories seems to largely abstract this away, unlike classical universal algebra, which gives quite explicit tools for writing things down explicitly.  With Lawvere theories, I am reduced to figuring out how to present a small category with finite products such that every object is isomorphic to a finite product of copies of a distinguished object x.  I have read quite a bit of CT, and I have yet to find a book which gives me tools as convenient as those of universal algebra for that purpose.

REPLY [4 votes]: Developing @AndrejBauer's suggestion to present them as single-sorted equational theories, you could write something like:

Let $\mathsf{Grp}$ denote the Lawvere theory with the following
  presentation.
Generators:

$c : 2 \rightarrow 1$
$e : 0 \rightarrow 1$
$i : 1 \rightarrow 1$

Relations:

$c(c(x,y),z) \equiv (x,c(y,z))$
$c(e,x) \equiv x,\;\; c(x,e) \equiv x$
$c(i(x),x) \equiv e, \;\; c(x,i(x)) \equiv e$


But, perhaps you were looking for something a little deeper.

REPLY [3 votes]: One way to present a Lawvere theory would be via a finite-product sketch. A finite-product sketch $(\mathcal{A}, \mathbb{L})$ is a small category $\mathcal{A}$ equipped with a collection $\mathbb{L}$ of cones over finite discrete diagrams in $\mathcal{A}$; a model in a category $\mathcal{E}$ is a functor $\mathcal{A} \to \mathcal{E}$ which sends the cones in $\mathbb{L}$ to product cones. A Lawvere theory $\mathcal{T}$ can naturally be regarded as a sketch $(\mathcal{T},\mathbb{L})$ where $\mathbb{L}$ consists of all the finite product cones; the sketch $(\mathcal{T},\mathbb{L})$ has the same models as the Lawvere theory $\mathcal{T}$.
Conversely, every sketch $(\mathcal{A},\mathbb{L})$ ``freely generates" a Lawvere theory $\mathcal{T}$ with the same models. One way to put it is this. The sketches form a 2-category $Sketch$ where a 1-cell $(\mathcal{A},\mathbb{L}) \to (\mathcal{A}',\mathbb{L}')$ is a functor $\mathcal{A} \to \mathcal{A}'$ which sends cones in $\mathbb{L}$ to cones in $\mathbb{L}'$, and 2-cells are natural transformations. Lawvere theories also form a 2-category $Law$ where 1-cells are product-preserving functors and 2-cells are natural transformations. By regarding a Lawvere theory as a sketch, we obtain a fully-faithful 2-functor $Law \to Sketch$, and this 2-functor has a left 2-adjoint.
A single-sorted sketch is a sketch $(\mathcal{A},\mathbb{L})$ equipped with a designated object $A_0$ such that for every object $A \in \mathcal{A}$, there is a cone in $\mathbb{L}$ with vertex $A$ and all of its legs equal to $A_0$. Modifying the notion of 1-cell in $Sketch$ accordingly yields a similar relation to 1-sorted Lawvere theories.
For example, a sketch for the category of groups might consist of the opposite of the category of free groups on $\leq 3$ generators, with all product diagrams indicated.
We could get even more syntactic and, following Barr and Wells (see Chapter 4 - a great resource on sketches) define a sketch to consist merely of a reflexive graph $\mathcal{G}$ eqipped with certain diagrams $\mathbb{D}$ in the free category on $\mathcal{G}$ and certain (finite-product) cones $\mathbb{L}$ in the free category on $\mathcal{G}$; a model in a category $\mathcal{E}$ is a morphism of reflexive graphs from $\mathcal{G}$ to the underlying reflexive graph of $\mathcal{E}$ which sends the diagrams of $\mathbb{D}$ to commutative diagrams and the cones of $\mathbb{L}$ to limiting cones. We can view Barr-Wells sketches as containing $Sketch$ and $Law$ as reflective subcategories just as before.
If we use a Barr-Wells sketch, we can give a truly finite presentation of the theory of groups. It is a reflexive graph with objects $G^0,G^1,G^2,G^3$ with arrows $e:G^0 \to G^1$, $m:G^2 \to G^1$, $i: G^1 \to G^1$, various projection arrows, cones which are designated by $\mathbb{L}$ to make $G^i$ into a product of $i$ copies of $G^1$, and one diagram each for associativity, left and right unitality, and left and right inverse laws.