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

\begin{fcdefn}[Skeleton]
  % Definition 1.13
  \glsnoundefn{skon}{skeleton}{skeletons}%
  \glsadjdefn{skal}{skeletal}{\gls{cat}}%
  By a \emph{skeleton} of a \gls{cat}
  $\mathcal{C}$, we mean a \gls{full} subcategory
  containing just one object from each isomorphism
  class.

  We say $\mathcal{C}$ is \emph{skeletal}
  if it's a skeleton of itself.
\end{fcdefn}

\begin{example*}
  $\Mat_k$ is a \gls{skal} \gls{cat}; it's
  isomorphic to the \gls{skon} of
  $\mathbf{fdVect}_k$ consisting of the spaces
  $k^n$.
\end{example*}

However, working with \gls{skal} \glspl{cat}
involves heavy use of the axiom of choice.

\begin{fcdefn}[Monomorphism / epimorphism]
  % Definition 1.14
  \glsadjdefn{epic}{epic}{arrow}%
  \glsadjdefn{monic}{monic}{arrow}%
  \glsnoundefn{mono}{monomorphism}{monomorphisms}%
  \glsnoundefn{epi}{epimorphism}{epimorphisms}%
  \glsadjdefn{bal}{balanced}{\gls{cat}}%
  \glssymboldefn{monoepi}%
  Let $f : A \to B$ be a morphism in a \gls{cat}
  $\mathcal{C}$. We say $f$ is a
  \emph{monomorphism} (or \emph{monic}) if, given
  $C \twofuncs gh A$, $fg = fh \implies g = h$.
  We say $f$ is an \emph{epimorphism} (or
  \emph{epic}) if it's a monomorphism in
  $\mathcal{C}^\op$.

  We write $A \stackrel{f}{\rightarrowtail} B$ to
  indicate that $f$ is monic, and $A
  \stackrel{f}{\twoheadrightarrow} B$ to indicate
  that it's epic.

  We say $\mathcal{C}$ is \emph{balanced} if every
  arrow which is monic and epic is an isomorphism.
\end{fcdefn}

\glsadjdefn{splitme}{split}{mono / epi}%
We will call a \gls{monic} morphism $e$ \emph{split}
if it has a left inverse (and similarly we may
define the notion of split \gls{epic}).

\begin{example}
  % Example 1.15
  \phantom{}
  \begin{enumerate}[(a)]
    \item In $\Set$, \gls{monic} $\iff$
      injective ($\Leftarrow$ obvious; for
      $\Rightarrow$ consider morphisms $\{*\} \to
      A$). Also, \gls{epic} $\iff$ surjective
      ($\Leftarrow$ obvious; for $\Rightarrow$
      consider morphisms $B \to \{0, 1\}$).
    \item In $\Gp$, \gls{monic} $\iff$ injective
      (for $\Rightarrow$ consider homomorphisms
      $\Zbb \to G$), and \gls{epic} $\iff$
      surjective (but $\Rightarrow$ is quite
      non-trivial -- it uses free products with
      amalgamation).
    \item In $\Rng$, \gls{monic} $\iff$ injective,
      but \gls{epic} does not imply surjective
      (for example, consider $\Zbb \injto \Qbb$).
    \item In $\Top$, \gls{monic} $\iff$ injective
      and \gls{epic} $\iff$ surjective (as in
      $\Set$) but $\Top$ isn't balanced.
    \item In preorder, all morphisms are
      \gls{monic} and \gls{epic}, so a preorder is
      \gls{bal} if and only if it's an equivalence
      relation.
  \end{enumerate}
\end{example}

\newpage
\section{The Yoneda Lemma}

\begin{fcdefn}[Locally small]
  % Definiton 2.1
  \glsadjdefn{locsm}{locally small}{\gls{cat}}%
  \glssymboldefn{morphs}%
  We say a \gls{cat} $\mathcal{C}$ is
  \emph{locally small} if, for any two objects $A$
  and $B$, the morphisms $A \to B$ in
  $\mathcal{C}$ are parameterised by a set
  $\mathcal{C}(A, B)$.
\end{fcdefn}

\glssymboldefn{morphf}%
If $A$ is an object of a \gls{locsm} \gls{cat}
$\mathcal{C}$, we have a \gls{func}
$\mathcal{C}(A, \bullet) : \mathcal{C} \to \Set$
sending $B$ to $\morphs\mathcal{C}(A, B)$ and a morphism
$B \stackrel{g}{\to} C$ to the mapping $(f \mapsto
gf) : \morphs\mathcal{C}(A, B) \to
\morphs\mathcal{C}(A, C)$ (this is
\glsref[func]{functorial} since composition in
$\mathcal{C}$ is associative).

Dually, we have $\mathcal{C}(\bullet, B) :
\mathcal{C}^\op \to \Set$.

\begin{fclemma}[Yoneda]
  \label{yoneda}
  % Lemma 2.2
  Assuming:
  - $\mathcal{C}$ is a \gls{locsm} \gls{cat}
  - $A \in \ob \mathcal{C}$
  - $F : \mathcal{C} \to \Set$ a \gls{func}
  Thens:[(i)]
  - There is a bijection between
  \glspl{natt} $\morphf\mathcal{C}(A,
  \bullet) \to F$ and elements of $FA$.
  - Moreover, this bijection is \gls{natal}
  in $A$ and $F$.
\end{fclemma}

\begin{proof}
  \phantom{}
  \begin{enumerate}[(i)]
    \item Given $\alpha : \morphf \mathcal{C}(A,
      \bullet) \to F$, we define $\Phi(\alpha) =
      \alpha_A(\identity A) \in FA$.

      Given $x \in FA$, we define $\Psi(x) :
      \morphf \mathcal{C}(A, \bullet) \to F$ by
      $\Psi(x)_B(f : A \to B) = Ff(x) \in FB$.
      This is natural in $B$ since $F$ is a
      \gls{func}: given $g : B \to C$ we have
      \[
        (Fg)\Psi(x)_B(f) = (Fg)(Ff)(x)
        = F(gf)(x) = \Psi(x)_C(gf)
      .\]

      For any $x$, $\Phi \Psi(x) =
      \Psi(x)_A(\identity A) = F\identity A(x) =
      x$.

      For any $\alpha$, $\Psi \Phi(\alpha)_B (f) =
      Ff(\alpha_A(\identity A)) = \alpha_B(\morphf
      \mathcal{C}(A, f)(\identity A) =
      \alpha_B(f)$ for all $f : A \to B$. So $\Psi
      \Phi(\alpha) = \alpha$.
    \item Later. Seeing examples of usage of (i)
      is interesting first. \qedhere
  \end{enumerate}
\end{proof}

\begin{fccoro}[]
  % Corollary 2.3
  Assuming:
  - $\mathcal{C}$ a \gls{locsm} \gls{cat}
  Then:
  $A \mapsto \morphf \mathcal{C}(A,
  \bullet)$ is a \gls{full} and \gls{faith}
  \gls{func} $\mathcal{C}^\op \to
  \funccat[\mathcal{C}, \Set]$.
\end{fccoro}

\begin{proof}
  Substitute $\morphf \mathcal{C}(B, \bullet)$ for
  $F$ in \cref{yoneda}(i): we have a bijection
  from $\morphs \mathcal{C}(B, A)$ to the
  collection of \glspl{natt} $\morphf
  \mathcal{C}(A, \bullet) \to \morphf
  \mathcal{C}(B, \bullet)$.

  For a given $f$, the \gls{natt} $
  \mathcal{C}(f, \bullet)$ sends $g : B \to C$
  to $gf$, so this is \gls{funcal} by
  associativity of composition $\mathcal{C}$.

  \glsnoundefn{yonem}{Yoneda embedding}{Yoneda
  embeddings}%
  Similarly, we have a \gls{full} and \gls{faith}
  \gls{func} $\mathcal{C} \to
  \funccat[\mathcal{C}^\op, \Set]$ sending $A$ to
  $\morphf \mathcal{C}(\bullet, A)$. We call this
  the \emph{Yoneda embedding}: it allows us to
  regard any \gls{locsm} \gls{cat} $\mathcal{C}$ as
  a \gls{full} subcategory of a $\Set$-valued
  \gls{func} \gls{cat}.
\end{proof}

Compare with Cayley's Theorem in group theory
(every group is isomorphic to a subgroup of a
permutation group) and `Dedekind's Theorem' (every
poset is isomorphic to a sub-poset of a power
set).

\begin{fcdefn}[Representable]
  % Definition 2.4
  \glsnoundefn{rep}{representation}{representations}%
  \glsnoundefn{reped}{represented}{}%
  \glsadjdefn{reple}{representable}{\gls{func}}%
  We say a \gls{func} $F : \mathcal{C} \to \Set$
  is \emph{representable} if it's isomorphic to a
  $\morphf \mathcal{C}(A, \bullet)$ for some $A$.
  By a \emph{representation} of $F$, we mean a
  pair $(A, x)$ where $x \in FA$ is such that
  $\Phi(x)$ is an isomorphism. We call $x$ a
  \emph{universal element} of $F$.
\end{fcdefn}

\begin{corollary}
  % Corollary 2.5
  Suppose $(A, x)$ and $(B, y)$ are both
  \glspl{rep} of $F$. Then there is a unique
  isomorphism $A \stackrel{f}{\to} B$ such that
  $(Ff)(x) = y$.
\end{corollary}

\begin{proof}
  $(Ff)(x) = g$ is equivalent to saying that
  \begin{picmath}
    \begin{tikzcd}
      \morphf\mathcal{C}(B, \bullet)
      \ar[rr, "\mathcal{C}(f{,} \bullet)"]
      \ar[rd, "\Phi(y)", swap]
      & & \morphf \mathcal{C}(A, \bullet)
      \ar[ld, "\Phi(x)"] \\
      & F
    \end{tikzcd}
  \end{picmath}
  commutes, so $f$ must be the unique isomorphism,
  whose image under \nameref{yoneda} is
  $\Phi(x)^{-1} \Phi(y)$.
\end{proof}
