\documentclass{article}
\input{packages}
\input{def}

\lecture{Colimits}

\begin{document}
\maketitle

\begin{definition}[Coproduct of $\ob{C}_1$ and $\ob{C}_2$, where $\ob{C}_1$ and $\ob{C}_2$ are objects of $\cat{C}$]
An object, denoted $\ob{C}_1 \oplus \ob{C}_2$ (although more traditionally with $\ob{C}_1 + \ob{C}_2$), along with morphisms $\kappa_1 : \ob{C}_1 \mto \ob{C}_1 \oplus \ob{C}_2$ and $\kappa_2 : \ob{C}_2 \mto \ob{C}_1 \oplus \ob{C}_2$ with the property that, for any object $\ob{C}$ and morphisms $\mo{f}_1 : \ob{C}_1 \mto \ob{C}$ and $\mo{f}_2 : \ob{C}_2 \mto \ob{C}$, there exists a unique morphism, denoted $[ \mo{f}_1, \mo{f}_2 ]$, making the following diagram commute:
\begin{center}
\begin{tikzpicture}
\node(c) at (1,0) {$\ob{C}$};
\node(p) at (-1,0) {$\ob{C}_1 \oplus \ob{C}_2$};
\node(c1) at (-1,2) {$\ob{C}_1$};
\node(c2) at (-1,-2) {$\ob{C}_2$};
\draw[->] (c1) -- node[above right] {$\mo{f}_1$} (c);
\draw[->] (c2) -- node[below right] {$\mo{f}_2$} (c);
\draw[->] (c1) -- node[left] {$\kappa_1$} (p);
\draw[->] (c2) -- node[left] {$\kappa_2$} (p);
\draw[dashed,->] (p) -- node[above,near start]{$[ \mo{f}_1, \mo{f}_2 ]$} (c);
\end{tikzpicture}
\end{center}
\end{definition}

\begin{example}
In $\cat{Set}$, $A \oplus B$ is the disjoint union $A+B$ of $A$ and $B$.
In $\cat{Mon}$, $\alg{A} \oplus \alg{B}$ is the set of alternating lists of $A$ and $B$ non-identity elements with a variant of concatonenation as its multiplication.
In $\cat{Rel}(2)$, the coproduct of $\langle A, \sqsubset_1 \rangle$ and $\langle B, \sqsubset_2 \rangle$ is the disjoint union of the two sets where left elements are related by $\sqsubset_1$ and right elements are related by $\sqsubset_2$ and no left and right elements are related to each other.
In $\cat{Cat}$, $\cat{A} \otimes \cat{B}$ uses the disjoint union of the objects and uses alternating paths for morphisms.
In $\cat{Rel}$, the disjoint union of $A$ and $B$ is the coproduct of $A$ and $B$.
\end{example}

\begin{definition}[Initial Object of $\cat{C}$]
An object, denoted $0$, with the property that, for any object $\ob{C}$, there exists a unique morphism, denoted $[ ]$, from $0$ to $\ob{C}$.
\end{definition}

\begin{example}
In $\cat{Set}$, any empty set is an initial object.
In $\cat{Mon}$, any singleton monoid is an initial monoid.
In $\cat{Rel}(2)$, $\langle \mathbb{0}, \bot \rangle$ is the initial binary relation.
In $\cat{Cat}$, any category with no objects is an initial category.
In $\cat{Rel}$, any empty set is an initial object.
\end{example}

\begin{definition}[Coequalizer of morphisms $\mo{f}_1, \mo{f}_2 : \ob{C}_1 \mto \ob{C}_2$]
An object $\ob{E}$ along with a morphism $\kappa : \ob{C}_1 \mto \ob{E}$ such that $\mo{f}_1 \cocomp \kappa = \mo{f}_2 \cocomp \kappa$ and with the property that, for any other object $\ob{C}$ and morphism $\mo{f} : \ob{C}_1 \mto \ob{C}$ such that $\mo{f}_1 \cocomp \mo{f} = \mo{f}_2 \cocomp \mo{f}$, there exists a unique morphism $[\mo{f}] : \ob{E} \mto \ob{C}$ such that $[\mo{f}] \cocomp \kappa = \mo{f}$.
\end{definition}

\begin{example}
In $\cat{Set}$, the coequalizer of functions $f_1, f_2 : X \to Y$ is the set $\frac{Y}{\approx}$ where $y_1 \approx y_2$ is defined as $\exists x.\; f_1(x) = y_1 \wedge f_2(x) = y_2$.
In $\cat{Mon}$, one uses the above construction except furthermore requires $\approx$ to satisfy $\forall y_1, y_1', y_2, y_2'.\; y_1 \approx y_1' \wedge y_2 \approx y_2' \imply y_1*y_2 \approx y_1'*y_2'$.
In $\cat{Rel}(2)$, the coequalizer of functions $f_1, f_2 : X \to Y$ is the set $\frac{Y}{\approx}$ where $y_1 \approx y_2$ is defined as $\exists x.\; f_1(x) = y_1 \wedge f_2(x) = y_2$, and two equivalence classes are related if any of their elements are related.
In $\cat{Cat}$, one builds the coequalizer for the components on objects and then combines the above techniques to build equivalence classes of morphisms.
$\cat{Rel}$ does not have coequalizers for some pairs of binary relations.
\end{example}

\begin{definition}[Pushout of morhisms $\mo{f}_1 : \ob{C}_3 \mto \ob{C}_1$ and $\mo{f}_2 : \ob{C}_3 \mto \ob{C}_2$]
An object $\ob{P}$ along with morphisms $\kappa_1 : \ob{C}_1 \mto \ob{P}$ and $\kappa_2 : \ob{C}_2 \mto \ob{P}$ such that $\mo{f}_1 \cocomp \kappa_1 = \mo{f}_2 \cocomp \kappa_2$ and with the property that, for any object $\ob{C}$ and morphisms $\mo{g}_1 : \ob{C}_1 \mto \ob{C}$ and $\mo{g}_2 : \ob{C}_2 \mto \ob{C}$ such that $\mo{f}_1 \cocomp \mo{g}_1 = \mo{f}_2 \cocomp \mo{g}_1$, there exists a unique morphism, denoted $[ \mo{g}_1, \mo{g}_2 ]$, making the following diagram commute:
\begin{center}
\begin{tikzpicture}
\node(c) at (2,0) {$\ob{C}$};
\node(p) at (0,0) {$\ob{P}$};
\node(c1) at (0,2) {$\ob{C}_1$};
\node(c2) at (0,-2) {$\ob{C}_2$};
\node(c3) at (-2,0) {$\ob{C}_3$};
\draw[<-] (c) -- node[above right] {$\mo{g}_1$} (c1);
\draw[<-] (c) -- node[below right] {$\mo{g}_2$} (c2);
\draw[<-] (p) -- node[left] {$\kappa_1$} (c1);
\draw[<-] (p) -- node[left] {$\kappa_2$} (c2);
\draw[<-] (c1) -- node[above left] {$\mo{f}_1$} (c3);
\draw[<-] (c2) -- node[below left] {$\mo{f}_2$} (c3);
\draw[dashed,<-] (c) -- node[above]{$[ \mo{g}_1, \mo{g}_2 ]$} (p);
\end{tikzpicture}
\end{center}
\end{definition}

\begin{example}
In $\cat{Set}$, the pushout of functions $f_1 : Z \to X$ and $f_2 : Z \to Y$ is the set $\frac{X+Y}{\approx}$, where $\approx$ is the weakest equivalence such that $\forall z : Z.\; \texttt{inl}(f_1(z)) \approx \texttt{inr}(f_2(z))$, along with the obvious coprojection functions.
\end{example}

\begin{exercise}
Note that the construction of pushouts in $\cat{Set}$ is built from a coproduct and a coequalizer.
Prove that if a category has coproducts for all objects and equalizers for all parallel morphism pairs, then it has pullbacks for all morphism pairs with the same codomain.
\end{exercise}

\begin{definition}[Colimit of a functor $D : \cat{S} \mto \cat{C}$]
An object $\ob{L}$ of $\cat{C}$ along with a natural transformation $\kappa : D \nto \ob{L}$ with the property that, for any object $\ob{C}$ and natural transformation $\alpha : D \nto \ob{C}$, there exists a unique morphism $[ \alpha ] : \ob{L} \mto \ob{C}$ such that $\kappa \cocomp [ \alpha ]$ equals $\alpha$.
\end{definition}

\begin{definition}[Scheme and Diagram]
Given $D : \cat{S} \mto \cat{C}$, the category $\cat{S}$ is called the scheme and the functor $D$ is called the diagram in $\cat{C}$.
\end{definition}

\begin{example}
Coproducts correspond to colimits of diagrams with scheme $\mathbb{2}$, the category with 2 objects and only identity morphisms.
Initial objects correspond to colimits of the diagram with scheme $\cat{0}$, the category with no objects or morphisms.
Coequalizers correspond to colimits of diagrams with the scheme $\bullet_1 \xtwomto{} \bullet_2$.
Pushouts correspond to colimits of diagrams with the scheme $\bullet_1 \mfrom \bullet_3 \mto \bullet_2$.
\end{example}

\begin{exercise}
Prove that a category has colimits for all diagrams with scheme~$\cat{S}$ if and only if the functor $\Delta$ from $\cat{C}$ to $\cat{S} \expto \cat{C}$, mapping each object to its corresponding constant functor and each morphism to its corresponding constant natural transformation, has a left adjoint.
\end{exercise}

\begin{remark}
Given a functor $D : \cat{S} \mto \cat{C}$, a colimit is a functor $L : \cat{1} \mto \cat{C}$ and natural transformation $\kappa : D \nto \bang_\cat{S} \cocomp L$
with the property that, for any functor $C : \cat{1} \mto \cat{C}$ and natural transformation $\alpha : D \nto \bang_\cat{S} \cocomp L$, there exists a unique natural transformation $[ \alpha ] : L \nto C$ such that the natural transformation specified in the following diagram equals $\alpha$:
\begin{center}
\begin{tikzpicture}
\node(s) at (-2,1) {$\cat{S}$};
\node(c) at (2,1) {$\cat{C}$};
\node(t) at (0,-1) {$\cat{1}$};
\draw[->] (s) -- node[above]{$D$} node(D){} (c);
\draw[->] (s) -- node[below left]{$\bang$} (t);
\draw[->] (t) to[bend left=30] node[above left]{$L$} node(L){} (c);
\draw[->] (t) to[bend right=30] node[below right]{$C$} node(C){} (c);
\draw[double,double equal sign distance,implies-] (C) -- node[above right]{$[ \alpha ]$} (L);
\draw[double,double equal sign distance,implies-,shorten <=8pt,shorten >=2pt] (t) -- node[left]{$\kappa$} (D);
\end{tikzpicture}
\end{center}
\end{remark}

\begin{definition}[Finitely Cocomplete]
A category that has a colimit for all diagrams with finite schemes, meaning the scheme has a finite set of objects and morphisms.
\end{definition}

\begin{exercise}
Prove that a category is finitely cocomplete if and only if it has a initial objects, coproducts, and coequalizers.
\end{exercise}

\begin{definition}[Preserves $\cat{S}$-Colimits]
A functor $F : \cat{C} \mto \cat{D}$ with the property that, for any $D$, $L$, and $\kappa$, if $L : \cat{1} \mto \cat{C}$ and $\kappa : D \nto \bang \cocomp L$ is a colimit of $D : \cat{S} \mto \cat{C}$, then $L \cocomp F$ and the following natural transforation is a colimit of $D \cocomp F$:
\begin{center}
\begin{tikzpicture}
\node(s) at (-2,1) {$\cat{S}$};
\node(c) at (0,1) {$\cat{C}$};
\node(t) at (0,0) {$\cat{1}$};
\node(d) at (2,1) {$\cat{D}$};
\draw[->] (s) -- node[above]{$D$} node(D){} (c);
\draw[->] (s) -- node[below left]{$\bang$} (t);
\draw[->] (t) -- node[right]{$L$} (c);
\draw[double,double equal sign distance,implies-,shorten <=8pt,shorten >=2pt] (t) -- node[above right]{$\kappa$} (D);
\draw[->] (c) -- node[above]{$F$} (d);
\end{tikzpicture}
\end{center}
\end{definition}

\begin{definition}[(Finitely) Cocontinuous]
A functor that preserves all colimits is called \emph{cocontinuous}.
A functor that preserves all finite colimits is called \emph{finitely} cocontinuous.
\end{definition}

\begin{exercise}
Prove that every left-adjoint functor is cocontinuous.
\end{exercise}

\end{document}