Let $T$ be a first order theory, $M$ its elementary class and consider its forgetfull functor $$M \stackrel{U}{\to} \text{Set}. $$


I would like to characterize those theories such that $U$ has a left adjoint. In fact this can be done.




---



> 
> If $M$ is cocomplete then $U$ has a left adjoint iff $T$ is equivalent to a limit theory in $L\_{\omega}$.
> 
> 
> 


Proof: This is quite an exercise. I will prove just the necessity. If $F$ exists then $F(\{\cdot\})$ is finitely presentable and also a strong generator of $M$ (here I am using that $U$ always commutes with directed colimits when T is first order), thus $M$ is finitely locally presentable. By the characterization theorem of finitely locally presentable categories, $T$ is equivalent to a limit theory.




---



> 
> (Q1): What if $M$ is not cocomplete?
> 
> 
> 


In fact if the adjoint exist, $M$ must be finitely accessible but I do not know any characterization theorem for finitely accessible categories. This is anyway a strong request on the elementary class.



> 
> If U has a left adjoint then $M$ is finitely accessible.
> 
> 
> 


Now there are two natural questions.



> 
> (Q2): Is the other implication true?
> 
> 
> (Q3): What happens if one replaces $M$ with an abstract elementary class?
> 
> 
> 



Free objects in first order theories
Here's a second attempt at answering the "homomorphism" version of Q3.


**Proposition:** Suppose that $U: \mathrm{Hom}(T) \to \mathsf{Set}$ has a left adjoint $F$. Expand $T$ by those definable functions in $T$ which are preserved by all homomorphisms between models of $T$ to obtain a theory $T'$. Let $V(T')$ be the varietal hull of $T$, i.e. it has all the function symbols of $T'$ but not the relation symbols, and is axiomatized by the universally quantified equations that hold in $T'$. Then


1. The reduct of $F$ to just the $T'$-function symbols is the usual free functor $\mathsf{Set} \to \mathrm{Hom}(V(T'))$ (this specifies the interpretation of the $T'$-function symbols in $F(n)$).
2. If $\phi$ is an atomic formula in $T'$, then $\forall \bar x. \phi(\bar x)$ holds if and only if $\phi(\bar e)$ holds in $F(n)$, where $\bar e$ are the generators of $F(n)$ (this specifies the interpretation of the $T'$-relation symbols in $F(n)$).


Conversely, if $V$ is a variety, $T'$ is an expansion of $V$ with the same function symbols, and $T$ is a reduct of $T$ with the same relation symbols and $\mathrm{Hom}(T) = \mathrm{Hom}(T')$, then the free $V$-algebra functor lifts to a left adjoint to $U: \mathrm{Hom}(T') \to \mathsf{Set}$ if and only if the $\mathrm{Lang}(T')$-structure on $F(n)$ defined by (2) models $T'$.


**Proof:** Let us prove the first part. For $\bar a \in M \in \mathrm{Hom}(T)$, let $\langle \bar a \rangle: F(n) \to M$ denote the unique homomorphism such that $ \langle \bar a \rangle(\bar e) = \bar a$. For $t \in F(n)$, let $[t]\_M (\bar a) = \langle \bar a \rangle(t)$. Let $\mathbf{R}(\bar x, \bar{\mathbf{y}}) = \wedge\wedge\_i R\_i(\bar x,\bar{\mathbf{y}})$ be the infinite conjunction of all positive quantifier-free formulas $R\_i(\bar x, \bar{\mathbf{y}})$ such that $F(n) \models R\_i(\bar e,\bar{\mathbf{t}})$, where $\bar{\mathbf{t}}$ is a fixed enumeration of the elements of $F(n)$. The uniqueness of the homomorphism $\langle \bar a \rangle$ for each $\bar a$ tells us that $T \vdash \forall \bar x,\bar{\mathbf{y}},\bar{\mathbf{y}}'. \mathbf{R}(\bar x,\bar{\mathbf{y}}) \wedge \mathbf{R}(\bar x, \bar{\mathbf{y}}') \to \wedge \wedge\_i \mathbf{y}\_i = \mathbf{y}'\_i$. For any $t \in F(n)$, it follows by compactness that we have $T \vdash \forall \bar x, \bar y, \bar y'. R\_t(\bar x,y,\bar y) \wedge R\_t(\bar x,y',\bar y) \to y = y'$ for some (positive, quantifier-free) $R\_t(\bar x, y, \bar y)$, and that in fact $\exists \bar y. R\_t(\bar x, y,\bar y)$ is a definition of $y=[t](\bar x)$ valid in all models of $T$. So there is a function symbol $f(\bar x)$ in $T'$ such that $f(\bar a) = [t](\bar a)$ for all $\bar a$ and in particular, $f(\bar e) = [t](\bar e) = t$.


This tells us that every $t \in F(n)$ is representable as $t = f(\bar e)$ for some function $f(\bar x)$ in $T'$. Now if $f(\bar e) = g(\bar e)$ holds for two functions $f(\bar x)$ and $g(\bar x)$ in $T'$, then for any $\bar a \in M^n$ we have $f(\bar a) = f(\langle \bar a \rangle(\bar e)) = \langle \bar a \rangle(f(\bar e)) = \langle \bar a \rangle (g(\bar e)) = g(\langle \bar a \rangle(\bar e)) = g(\bar a)$, so the universal equation $\forall \bar x . f(\bar x) = g(\bar x)$ holds in $V(T')$. Conversely, of course, if $\forall \bar x. f(\bar x) = g(\bar x)$ holds, then in particular $f(\bar e) = g(\bar e)$ holds. This proves (1). Then (2) follows by similar reasoning. 


(As a side note, given that $F$ exists, the functions of $T'$ are precisely those definable in $T$ by formulas of the form $f(\bar x) = y \leftrightarrow \exists \bar y . R(\bar x, y, \bar y)$ with $R$ a positive quantifier-free formula; we have shown one direction, while the other holds for any theory $T$.)


The converse is clear.


