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

\newpage
\section{Definitions and Examples}

\begin{fcdefn}[Category]
  % Definition 1.1
  \glssymboldefn{category}%
  \glsnoundefn{cat}{category}{categories}
  A \emph{category} $\mathcal{C}$ consists of:
  \begin{cenum}[(a)]
    \item a collection $\obinternal \mathcal{C}$
      of \emph{objects} $A, B, C, \ldots$.
    \item a collection $\morinternal \mathcal{C}$
      of \emph{morphisms} $f, g, h, \ldots$.
    \item two operations $\dominternal$,
      $\codinternal$ from $\morinternal \mathcal{C}$ to
      $\obinternal \mathcal{C}$: we write $f : A
      \to B$ for ``$f$ is a morphism and
      $\dominternal f = A$ and $\codinternal f =
      B$''.
    \item an operation from $\obinternal
      \mathcal{C}$ to $\morinternal \mathcal{C}$
      sending $A$ to $\identity{A} : A \to A$.
    \item a partial binary operation $(f, g)
      \mapsto fg$ on $\morinternal \mathcal{C}$,
      such that $fg$ is defined if and only if
      $\dominternal f = \codinternal g$, and in
      this case we have $\dominternal fg =
      \dominternal g$ and $\codinternal fg =
      \codinternal f$.
  \end{cenum}
  These are subject to the axioms:
  \begin{cenum}[(a)]
    \setcounter{enumi}{5}
    \item $f \identity{A} = f$ and $\identity{A}
      g = g$ when the composites are defined.
    \item $f(gh) = (fg)h$ whenever $fg$ and $gh$
      are defined.
  \end{cenum}
\end{fcdefn}

\begin{remark}
  % Remark 1.2
  \phantom{}
  \begin{enumerate}[(a)]
    \item \glsadjdefn{small}{small}{\gls{cat}}%
      $\ob C$ and $\mor C$ needn't be sets. If
      they are, we call $\mathcal{C}$ a
      \emph{small} category.
    \item We could formalise the definition
      without mentioning objects, but we don't.
    \item $fg$ means ``first $g$, then $f$''.
  \end{enumerate}
\end{remark}

\begin{example}
  \label{eg:1.3}
  % Example 1.3
  \phantom{}
  \glssymboldefn{catexamples}%
  \begin{enumerate}[(a)]
    \item $\mathbf{Set} = $ \gls{cat} of all sets
      and the functions between them. (Formally, a
      morphism of $\mathbf{Set}$ is a pair $(f,
      B)$ where $f$ is a set-theoretic function,
      and $B$ is its codomain.)
    \item We have \glspl{cat}:
      \begin{itemize}
        \item $\mathbf{Group}$ of groups and group
          homomorphisms
        \item $\mathbf{Rng}$ of rings and
          homomorphisms
        \item $\mathbf{Vect}_k$ of vector spaces
          over a field $k$
        \item and so on
      \end{itemize}
    \item We have \glspl{cat}
      \begin{itemize}
        \item $\mathbf{Top}$ of topological spaces
          and continuous maps
        \item $\mathbf{Met}$ of metric spaces and
          non-expansive maps (i.e. $f$ such that
          $d(f(x), f(y)) \le d(x, y)$)
        \item $\mathbf{Mfd}$ of smooth manifolds
          and $C^\infty$ maps
      \end{itemize}
      Also $\mathbf{TopGp}$ for topological groups
      and continuous homomorphisms, etc...
    \item We have a \gls{cat} $\mathbf{Htpy}$ with
      the same objects as $\Top$, but morphisms $X
      \to Y$ are homotopy classes of continuous
      maps.

      In general, given $\mathcal{C}$ and an
      equivalence relation $\equiv$ on $\mor
      \mathcal{C}$ such that
      \[ f \equiv g \implies \dom f = \dom g
      \text{ and } \cod f = \cod g \]
      and
      \[ f \equiv g \implies fg \equiv gh \text{
      and } kf \equiv kg \text{ when the
      composites are defined} \]
      we can form a \emph{quotient} category
      $\mathcal{C} / \equiv$.
    \item The \gls{cat} $\mathbf{Rel}$ has the
      same objects as $\Set$, but morphisms $A \to
      B$ are relations $R \subseteq A \times B$,
      with composition defined by
      \[ R \circ S = \{(a, c) \st (\exists b) (a,
      b) \in S \wedge (b, c) \in R\} .\]
      We can also define the \gls{cat}
      $\mathbf{Part}$ of sets with partial
      functions.
    \item 
% \begin{fcdefn*}[Opposite category]
        \glssymboldefn{opcat}%
        For any \gls{cat} $\mathcal{C}$, the
        \emph{opposite category}
        $\mathcal{C}^{\mathrm{op}}$ has the same
        objects and morphisms as $\mathcal{C}$ but
        $\dom$ and $\cod$ are interchanged and
        composition is reversed.

        This yields a \emph{duality principle}: if
        $P$ is a true statement about \glspl{cat},
        so is $P^*$ obtained by reversing arrows in
        $P$.
% \end{fcdefn*}
    \item A (small) category with one object $*$ is
      a \emph{monoid} (a semigroup with an
      identity). In particular, a group is a
      $1-$object small \gls{cat} whose
      morphisms are all isomorphisms.
    \item A \emph{groupoid} is a \gls{cat} whose
      morphisms are all isomorphisms. For example,
      the \emph{fundamental groupoid} $\pi_1(X)$
      of a topological space $X$ has points of $X$
      as objects, and morphisms $x \to y$ are
      homotopy classes of paths from $x$ to $y$
      (c.f. the fundamental group $\pi_1(X, x)$).
    \item A \emph{discrete} category is one whose
      only morphisms are identities. If
      $\mathcal{C}$ is such that for any pair of
      objects $(A, B)$ there is at most one
      morphism $A \to B$ then $\mor \mathcal{C}$
      becomes a reflexive, transitive relation on
      $\ob \mathcal{C}$. We call such a
      $\mathcal{C}$ a \emph{preorder}. In
      particular, a \emph{poset} is a small preorder
      whose only isomorphisms are identities.
    \item Given a field $k$, the \gls{cat}
      $\mathbf{Mat}_k$ has natural numbers as
      objects, and morphisms $n \to p$ are $p
      \times n$ matrices, with entries from $k$,
      and composition is matrix multiplication.
  \end{enumerate}
\end{example}
