%! TEX root = CT.tex
% vim: tw=50
% 22/11/2024 09AM

\begin{fccoro}[]
  \label{coro:6.6}
  % Corollary 6.6
  Assuming:
  - $\mathcal{C}$ a \gls{cat} of finitary
  algebras as in \cref{eg:5.14}(a)
  Thens:[(i)]
  - The forgetful \gls{func} $U :
  \mathcal{C} \to \Set$ \gls{creates}
  \gls{filted} \glspl{colim}.
  - \glsref[filted]{Filtered} \glspl{colim}
  \gls{lcomm} with finite \glspl{lim} in
  $\mathcal{C}$.
\end{fccoro}

\begin{proof}
  \phantom{}
  \begin{enumerate}[(i)]
    \item This is just like \cref{eg:5.14}(a):
      Given a \gls{filted} \gls{diag} $D : J \to
      \mathcal{C}$ and a \gls{colim} for $UD$ with
      apex $L$, then $L^n$ is the \gls{colim} of
      $UD^n$ for all $n$, so each $n$-ary
      operation on the $D(j)$'s induces an $n$-ary
      operation on $L$, and $L$ also inherits all
      the equations defining $\mathcal{C}$, so
      there's a unique lifting of the \gls{colim}
      \gls{cone} under $UD$ to a \gls{colim}
      \gls{cone} for $D$.
    \item Follows from (i) and \cref{thm:6.5},
      since $U$ also \gls{creates} finite
      \glspl{lim} (and \gls{reflects}
      isomorphisms). \qedhere
  \end{enumerate}
\end{proof}

Similar results hold for \glspl{cat} such as
$\Cat$.

\begin{example}
  \label{eg:6.7}
  % Example 6.7
  Consider the \gls{diag}
  \begin{picmath}
    \begin{tikzcd}
      \cdots \ar[r, "s"]
      & \Nbb \ar[d] \ar[r, "s"]
      & \Nbb \ar[d] \ar[r, "s"]
      & \Nbb \ar[d] \\
      \cdots \ar[r, "1"]
      & 1 \ar[r, "1"]
      & 1 \ar[r, "1"]
      & 1
    \end{tikzcd}
  \end{picmath}
  of shape $\Nbb^\op \times \mathbf{2}$ in $\Set$.
  The \gls{invlim} of the top row is $\emptyset$,
  but that of the bottom row is $1$. So
  $\lim_{\Nbb^\op} \funccat[\Nbb^\op, \Set] \to
  \Set$ doesn't preserve \glspl{epi}; equivalently
  $\colim_{\Nbb} : \funccat[\Nbb, \Set^\op] \to
  \Set^{\op}$ doesn't preserve \glspl{mono}. Thus
  by \cref{remark:4.8}, \gls{dired} \glspl{colim}
  don't \gls{lcomm} with \glspl{pullb} in $\Set^\op$.
\end{example}

Given a \gls{func} $F : \mathcal{C} \to \Set$, the
\emph{category of elements} of $F$ is $(1 \darr
F)$: its objects are pairs $(A, x)$ with $x \in
FA$ and morphisms $(A, x) \to (B, y)$ are
morphisms $f : A \to B$ such that $(Ff)(x) = y$.

\begin{fcprop}[]
  \label{prop:6.8}
  % Proposition 6.8
  Assuming:
  - $\mathcal{C}$ a \gls{small} \gls{cat}
  - $\mathcal{C}$ has finite \glspl{lim}
  - $F : \mathcal{C} \to \Set$ a \gls{func}
  Then:
  the following are equivalent:
  \begin{cenum}[(i)]
    \item $F$ \gls{preses} finite \glspl{lim}.
    \item $(1 \darr F)$ is co\gls{filted}.
    \item $F$ is expresible as a \gls{filted}
      \gls{colim} of \gls{reple} \glspl{func}.
  \end{cenum}
\end{fcprop}

\begin{proof}
  \phantom{}
  \begin{enumerate}[(ii) $\Rightarrow$ (ii)]
    \item[(i) $\Rightarrow$ (ii)] By
      \cref{lemma:4.10}, $(1 \darr F)$ has finite
      \glspl{lim} so $(1 \darr F)^\op$ is
      \gls{filted}.
    \item[(ii) $\Rightarrow$ (iii)] Consider the
      \gls{diag} $(1 \darr F)^\op
      \stackrel{U}{\to} \mathcal{C}^\op
      \stackrel{Y}{\to} \funccat[\mathcal{C},
      \Set]$ where $U$ is the forgetful \gls{func}
      and $Y$ is the \gls{yonem}. A \gls{cone}
      under this \gls{diag} (with apex $G$, say)
      yields a family of morphisms $\mathcal{C}(A,
      \blank) \stackrel{\lambda_{(A, x)}}{\to} G$
      for each $x \in FA$, subject to
      compatibility conditions which say that
      $(Gf) \Phi(\lambda_{(A, x)}) =
      \Phi(\lambda_{(B, y)})$ for every $f : (A,
      x) \to (B, y)$ in $(1 \darr F)$, i.e. such
      that $x \mapsto \Phi(\lambda_{(A, x)})$ is a
      \gls{natt} $F \to G$. So the \gls{cone}
      $(\mathcal{C}(A, \blank)
      \stackrel{\Psi(x)}{\to} F \mid (A, x) \in
      \ob(1 \darr F))$ has the universal property
      of a \gls{colim} for the \gls{diag}.
    \item[(iii) $\Rightarrow$ (i)]
      \glsref[func]{Functors} of the form
      $\mathcal{C}(A, \blank)$ preserve any
      \glspl{lim} which exist, so this follows
      from \cref{thm:6.5} plus the fact that
      \glspl{colim} in $\funccat[\mathcal{C},
      \Set]$ are computed pointwise. \qedhere
  \end{enumerate}
\end{proof}

Given a \gls{cat} $\mathcal{C}$ with \gls{filted}
\glspl{colim}, we say $F : \mathcal{C} \to
\mathcal{D}$ is \emph{finitary} if it \gls{preses}
\gls{filted} \glspl{colim}. If $\mathcal{C} =
\Set$, then a finitary $F$ is determined by its
restriction to $\Set_f$, since any set is the
\gls{dired} union of its finite subsets.

In fact the restriction \gls{func}
$\funccat[\Set, \mathcal{D}] \to \funccat[\Set_f,
\mathcal{D}]$ has a \gls{ladj} (the \emph{left Kan
extension} \gls{func}) and the finitary
\glspl{func} are those in the image of this
\gls{ladj} (up to isomorphism).

\glssymboldefn{Setf}%
For a \gls{cat} $\mathcal{C}$ as in \cref{eg:5.14}(a)
or \cref{coro:6.6}, the corresponding \gls{monad}
$\Tbb$ on $\Set$ is finitary. From now on,
$\Set_f$ will denote the \gls{skon} of the
\gls{cat} of finite sets whose objects are the
sets $[n] = \{1, 2, \ldots, n\}$.

\begin{fcdefn}[Lawvere theory]
  \glsnoundefn{Lt}{Lawvere theory}{Lawvere
  theories}%
  \glsnoundefn{model}{model}{models}%
  \label{defn:6.9}
  % Definition 6.9
  By a \emph{Lawvere theory}, we mean a
  \gls{small} \gls{cat} $\mathcal{T}$ together with a
  \gls{func} $\Setf \to \mathcal{T}$ which is bijective
  on objects and \gls{preses} finite
  \glspl{coprod}. A \emph{model} of a Lawvere
  theory $\mathcal{T}$ in any \gls{cat} $\mathcal{C}$
  with finite products is a \gls{func} $M :
  \mathcal{T}^\op \to \mathcal{C}$ preserving finite
  \glspl{prod}.
\end{fcdefn}

For example, if $\Tbb$ is a \gls{monad} on $\Set$,
the \gls{full} sub\gls{cat} of $\Set_{\Tbb}$ whose
objects are the sets $[n]$ is a \gls{Lt}.

\begin{fclemma}[]
  \label{lemma:6.10}
  % Lemma 6.10
  Assuming:
  - $\mathcal{T}$ a \gls{Lt}
  Then:
  the \gls{cat} of $\mathcal{T}$-\glspl{model} in $\Set$
  is (\gls{equivt} to) a finitary algebra
  \gls{cat} in the sense of \cref{eg:5.14}(a).
\end{fclemma}

\begin{proof}
  Given a \gls{model} $M : \mathcal{T}^\op \to \Set$, we
  have $M[n] \cong M[1]^n$ for all $n$. Also, any
  morphism $M[1]^n \to M[1]^p$ induced by a
  morphism $[p] \to [n]$ in $\mathcal{T}$ is determined
  by its composites with the projections $M[1]^p
  \to M[1]$, so specifying $M$ on morphisms is
  determined by its effect on morphisms with
  domain $[1]$.

  So, given a set $A$, specifying a \gls{model}
  $M$ with $M[1] = A$ is equivalent to specifying
  operations $\alpha_A : A^n \to A$ for each
  $\alpha : [1] \to [n]$ in $\mathcal{T}$, subject to
  $(v_i)_A(a_1, \ldots, a_n) = a_i$ whenever $v_i
  : [1] \to [n]$ is the $i$-th coprojection, and
  \begin{picmath}
    \begin{tikzcd}
      A^p \ar[r, "((\beta_1)_A{,} \ldots{,}
      (\beta_n)_A)"] \ar[rd, "\gamma_A"]
      & A^n \ar[d, "\alpha_A"] \\
      & A
    \end{tikzcd}
  \end{picmath}
  commutes whenever
  \begin{picmath}
    \begin{tikzcd}
      {[}1] \ar[r, "\alpha"]
      \ar[rd, "\sigma"]
      & {[}n] \ar[d, "(\beta_1{,} \ldots{,} \beta_n)"] \\
      & {[}p]
    \end{tikzcd}
  \end{picmath}
  commutes.
\end{proof}
