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

    \item If $\mathcal{C}$ is a preorder, every
      morphism is its own \gls{image}, and
      \glspl{cover} are isomorphisms. So
      $\mathcal{C}$ is \gls{regc} if and only if
      it has finite meets.
    \item $\Top$ has \glspl{image} and
      co\glspl{image}: given $X \stackrel{f}{\to}
      Y$, its \gls{image} (respectively
      co\gls{image}) is its set-theoretic image
      topologised as a quotient of $X$
      (respectively subspace of $Y$). $\Top$ isn't
      \gls{regc}, but it is co\gls{regc}.
  \end{enumerate}
\end{example}

\begin{fcprop}[]
  \label{prop:7.5}
  % Proposition 7.5
  Assuming:
  - $\mathcal{C}$ a \gls{regc}
  Then:
  \glspl{cover} coincide with \gls{regc}
  \glspl{epi}.
\end{fcprop}

\begin{iffproof}
  \leftimpl
  \glsref[reg]{Regular} \gls{epi} implies strong
  \gls{epi} by Exercise 2\.14.
  \rightimpl
  Suppose $A \stackrel{f}{\covers} B$ is a
  \gls{cover}; let $R \twofuncs ab A$ be its
  kernel-pair, i.e. the \gls{pullb} of
  \begin{picmath}
    \begin{tikzcd}
      & A \ar[d, "f"] \\
      A \ar[r, "f"]
      & B
    \end{tikzcd}
  \end{picmath}
  Suppose given $g : A \to C$ with $ga = gb$; form
  the \gls{image} $A \stackrel{e}{\covers}
  \stackrel{(h, k)}{\monic} B \times C$ of $A
  \stackrel{(f, g)}{\to} B \times C$. We'll show
  $h$ is an isomorphism, so that $kh^{-1}$ is a
  factorisation of $g$ through $f$. $h$ is a
  \gls{cover} since $he = f$ is, so we need to
  prove $h$ is \gls{monic}.

  Let $D \twofuncs lm I$ such that $hl = hm$; form
  the \gls{pullb}
  \begin{picmath}
    \begin{tikzcd}
      P \ar[r, "p"] \ar[d, "(q{,} r)"]
      & D \ar[d, "(e{,} m)"] \\
      A \times A \ar[r, "e \times e"]
      & I \times I
    \end{tikzcd}
  \end{picmath}
  $e \times e$ factors as $A \times A \stackrel{1
  \times e}{\covers} A \times I \stackrel{e \times
  1}{\covers} I \times I$, so $e \times e$ is a
  \gls{cover}, and $p$ is a \gls{cover}.

  Now $fq = heq = hlp = hmp = her = fr$ so $(q,
  r)$ factors through $(a, b)$. But $(h, k) ea =
  (f, g)a = (f, g)b = (h, k) eb$ and $(h, k)$ is
  \gls{monic}, so $ea = eb$, so $eq = er$, i.e.
  $lp = mp$. Also $p$ is \gls{epic}, so $l = m$.
\end{iffproof}

\glssymboldefn{relation}%
\glsnoundefn{rel}{relation}{relations}%
By a \emph{relation} $A \looparrowright B$ in a
\gls{cat} $\mathcal{C}$ with finite \glspl{prod},
we mean an isomorphism class of \glspl{subobj} $R
\monic A \times B$.

If $\mathcal{C}$ has
\glspl{image}, we define the composite of $A
\stackrel{R}{\looparrowright} B
\stackrel{S}{\looparrowright} C$ by forming the
\gls{pullb}
\begin{picmath}
  \begin{tikzcd}
    P \ar[r, "q"] \ar[d, "p"]
    & S \ar[r, "d"] \ar[d, "c"]
    & C \\
    R \ar[r, "b"] \ar[d, "a"]
    & B \\
    A
  \end{tikzcd}
\end{picmath}
forming the \gls{image} of $(ap, dq) : P \to A
\times C$.

This is well-defined up to isomorphism and has the
$A \stackrel{(\identity{A}, \identity{A})}{\monic}
A \times A$ as $2$-sided identities.

\begin{fclemma}[]
  \label{lemma:7.6}
  % Lemma 7.6
  \begin{iffc}
    \lhs
    Composition of \glspl{rel} in $\mathcal{C}$ is
    associative
    \rhs
    $\mathcal{C}$ is \gls{regc}.
  \end{iffc}
\end{fclemma}

\begin{iffproof}
  \rightimpl
  Suppose given $A \stackrel{f}{\to} B
  \stackrel{e}{\glsref[relation_symbol]{\leftarrowtriangle}} C$.
  Consider the \glspl{rel}
  \begin{picmath}
    \begin{tikzcd}
      & A \ar[ld, "\identity{A}"]
      \ar[rd, "f"]
      &
      & C \ar[ld, "e"]
      \ar[rd, "\identity{A}"]
      &
      & C \ar[ld, "\identity{A}"]
      \ar[rd, "!_C"] \\
      A
      &
      & B
      &
      & C
      &
      & 1
    \end{tikzcd}
  \end{picmath}
  Composing the right hand pair first, we get
  \begin{picmath}
    \begin{tikzcd}
      & B \ar[ld, "\identity{B}"]
      \ar[rd, "!_B"] \\
      B
      &
      & 1
    \end{tikzcd}
  \end{picmath}
  and thus we get
  \begin{picmath}
    \begin{tikzcd}
      & A \ar[ld, "\identity{A}"]
      \ar[rd, "!_A"] \\
      A
      &
      & 1
    \end{tikzcd}
  \end{picmath}
  Composing the left hand pair first, we begin by
  forming the \gls{pullb}
  \begin{picmath}
    \begin{tikzcd}
      & P \ar[ld, "p"] \ar[rd, "q"] \\
      A \ar[rd, "f"]
      &
      & C \ar[ld, "e", {-Triangle[open]}] \\
      & B
    \end{tikzcd}
  \end{picmath}
  and we endup with the \gls{image} of $(p, !_P) :
  P \to A \times 1$; so $p$ must be a \gls{cover}.

  \leftimpl
  Suppose given \glspl{rel} $A
  \stackrel{R}{\torel} B \stackrel{S}{\torel} C
  \stackrel{T}{\torel} D$. If we form the
  \glspl{pullb}
  \begin{picmath}
    \begin{tikzcd}
      U \ar[r] \ar[d]
      & Q \ar[r] \ar[d]
      & T \ar[r] \ar[d]
      & D \\
      P \ar[r] \ar[d]
      & S \ar[r] \ar[d]
      & C \\
      R \ar[r] \ar[d]
      & B \\
      A
    \end{tikzcd}
  \end{picmath}
  then both $T \circ (S \circ R)$ and $(T \circ S)
  \circ R$ are the \gls{image} of $U \to A \times
  D$.
\end{iffproof}

\glssymboldefn{Relc}%
We write $\Reln(\mathcal{C})$ for the \gls{cat}
whose objects are those of $\mathcal{C}$ and whose
morphisms are \glspl{rel}. Note that $\Reln(\Set)$ is
just $\Rel$ as defined in \cref{eg:1.3}(e).

\glssymboldefn{bull}%
\glssymboldefn{circ}%
We have a \gls{faith} \gls{func} $\mathcal{C} \to
\Reln(\mathcal{C})$ which is the identity on
objects and sends $A \stackrel{f}{\to} B$ to $A
\stackrel{(1, f)}{\monic} A \times B$ (for
\gls{faith}ness, see Exercise 4.22(i)). We write
$f_\bullet$ for $(\identity{A}, f)$.

Note that there's an isomporphism
$\Reln(\mathcal{C}) \to \Reln(\mathcal{C}^\op)$
which is the identity on objects and sends $R
\stackrel{(a, b)}{\monic} A \times B$ to $R
\stackrel{(b, a)}{\monic} B \times A$; we denote
this by $R^\circ$, and write $f^\bullet$ for
$(f_\bull)^\circ$.

Also, $\Reln(\mathcal{C})$ is enriched over
$\mathbf{Poset}$ (provided $\Reln(\mathcal{C})$ is
\gls{locsm}, i.e. $\mathcal{C}$ is \gls{wp}), i.e.
each $\Reln(\mathcal{C})(A, B)$ has a partial
order which is preserved by composition.

We say $A \stackrel{R}{\torel} B$ is \emph{left
adjoint} to $B \stackrel{S}{\torel} A$ if
$\identity{A} \le S \circ R$ and $R \circ S \le
\identity{B}$.

\begin{fcprop}[]
  \begin{iffc}
    \lhs
    $A \stackrel{R}{\torel} B$ is a left adjoint
    in $\Reln(\mathcal{C})$
    \rhs
    it is of the form $f_\bull$.
  \end{iffc}
\end{fcprop}

\begin{iffproof}
  \leftimpl
  We show $(f_\bull \adjoint f^\bull)$: the
  composite $f^\bull f_\bull$ is just the
  kernel-pair $R \stackrel{(a, b)}{\monic} A
  \times A$ of $f$, and $A
  \stackrel{(\identity{A}, \identity{A})}{\monic}
  A \times A$ factors through it. Also $f_\bull
  f^\bull$ is the \gls{image} of
  \begin{picmath}
    \begin{tikzcd}
      A \ar[rr, "(f{,} f)"] \ar[rd, "f"]
      &
      & B \times B \\
      & B \ar[ud, "(\identity{B}{,} \identity{B})"]
    \end{tikzcd}
  \end{picmath}
  so it contains $(\identity{B}, \identity{B})$.

  \rightimpl
  Conversely, suppose $R \stackrel{(a, b)}{\monic}
  A \times B$ has a \gls{radj} $R' \stackrel{(b',
  a')}{\monic} B \times A$. In forming $R' \circ
  R$, we take the \gls{pullb}
  \begin{picmath}
    \begin{tikzcd}
      P \ar[r, "p'"] \ar[d, "p"]
      & R' \ar[d, "b'"] \\
      R \ar[r, "b"]
      & B
    \end{tikzcd}
  \end{picmath}
  So the \gls{image} of $(ap, a'p')$ contains $A
  \stackrel{(\identity{A}, \identity{A})}{\to} A
  \times A$, so $ap$ factors as a \gls{cover}
  followed by a \gls{splitme} \gls{epi}, so $a$ is
  a \gls{cover}.

  Now, in the \gls{pullb}
  \begin{picmath}
    \begin{tikzcd}
      Q \ar[r, "q"] \ar[d, "q"]
      & R' \ar[d, "a'"] \\
      R \ar[r, "a"]
      & A
    \end{tikzcd}
  \end{picmath}
  $q$ and $q'$ are \glspl{cover}, but the
  \gls{image} of $(bq, b'q)$ is contained in
  $(\identity{B}, \identity{B})$ so $bq = b'q'$.
  But $aq = a'q'$, so $R' = R^\ucirc$, $a = a'$,
  $b = b'$ and $q = q'$. So $a$ is \gls{monic},
  and hence an isomorphism, so $R = (ba^{-1})$.
\end{iffproof}
