\documentclass{article}
\input{packages}
\input{def}

\lecture{Limits}

\begin{document}
\maketitle

\begin{definition}[Product 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 \with \ob{C}_2$ (although more traditionally with $\ob{C}_1 \times \ob{C}_2$), along with morphisms $\pi_1 : \ob{C}_1 \with \ob{C}_2 \mto \ob{C}_1$ and $\pi_2 : \ob{C}_1 \with \ob{C}_2 \mto \ob{C}_2$ with the property that, for any object $\ob{C}$ and morphisms $\mo{f}_1 : \ob{C} \mto \ob{C}_1$ and $\mo{f}_2 : \ob{C} \mto \ob{C}_2$, there exists a unique morphism, denoted $\langle \mo{f}_1, \mo{f}_2 \rangle$, making the following diagram commute:
\begin{center}
\begin{tikzpicture}
\node(c) at (-1,0) {$\ob{C}$};
\node(p) at (1,0) {$\ob{C}_1 \with \ob{C}_2$};
\node(c1) at (1,2) {$\ob{C}_1$};
\node(c2) at (1,-2) {$\ob{C}_2$};
\draw[->] (c) -- node[above left] {$\mo{f}_1$} (c1);
\draw[->] (c) -- node[below left] {$\mo{f}_2$} (c2);
\draw[->] (p) -- node[right] {$\pi_1$} (c1);
\draw[->] (p) -- node[right] {$\pi_2$} (c2);
\draw[dashed,->] (c) -- node[above,near end]{$\langle \mo{f}_1, \mo{f}_2 \rangle$} (p);
\end{tikzpicture}
\end{center}
\end{definition}

\begin{example}
In $\cat{Set}$, $A \times B$ with the projection functions is the product of $A$ and $B$.
In $\cat{Mon}$, $\alg{A} \with \alg{B}$ with the projection homomorphisms is the product of $\alg{A}$ and $\alg{B}$.
In $\cat{Rel}(2)$, $\langle A \times B, \lambda \langle p_1, p_2 \rangle.\; \pi_1(p_1) \mathrel{R} \pi_1(p_2) \wedge \pi_2(p_1) \mathrel{S} \pi_2(p_2) \rangle$ with the relation-preserving projection functions is the product of $\langle A, R \rangle$ and $\langle B, S \rangle$.
In $\cat{Cat}$, $\cat{A} \times \cat{B}$ with the projection functors is the product of $\cat{A}$ and $\cat{B}$.
In $\cat{Rel}$, the disjoint union of $A$ and $B$ is the product of $A$ and $B$.
\end{example}

\begin{definition}[Terminal Object of $\cat{C}$]
An object, denoted $\top$ (although more traditionally with $1$), with the property that, for any object $\ob{C}$, there exists a unique morphism, denoted $\langle \rangle$, from $\ob{C}$ to $\top$.
\end{definition}

\begin{example}
In $\cat{Set}$, any singleton set is a terminal object.
In $\cat{Mon}$, any singleton monoid is a terminal monoid.
In $\cat{Rel}(2)$, $\langle \mathbb{1}, \top \rangle$ is the terminal binary relation.
In $\cat{Cat}$, any category with only one object and one morphism is the terminal category.
In $\cat{Rel}$, the empty set is the terminal object.
\end{example}

\begin{notation}
The unique morphism from an object $\ob{C}$ to the terminal object is also denoted with $\mathord{!}_\ob{C}$.
\end{notation}

\begin{definition}[Equalizer of morphisms $\mo{f}_1, \mo{f}_2 : \ob{C}_1 \mto \ob{C}_2$]
An object $\ob{E}$ along with a morphism $\pi : \ob{E} \mto \ob{C}_1$ such that $\pi \cocomp \mo{f}_1 = \pi \cocomp \mo{f}_2$ and with the property that, for any other object $\ob{C}$ and morphism $\mo{f} : \ob{C} \mto \ob{C}_1$ such that $\mo{f} \cocomp \mo{f}_1 = \mo{f} \cocomp \mo{f}_2$, there exists a unique morphism $\langle\mo{f}\rangle : \ob{C} \mto \ob{E}$ such that $\langle\mo{f}\rangle \cocomp \pi = \mo{f}$.
\end{definition}

\begin{example}
In $\cat{Set}$, the equalizer of functions $f_1, f_2 : X \to Y$ is the set $\{ x : X \mid f_1(x) = f_2(x) \}$ along with the obvious inclusion function to $X$.
In $\cat{Mon}$, one restricts to the operators to the above subset, which ends up still forming a well-defined monoid because the functions are monoid homomorphisms.
In $\cat{Rel}(2)$, one restricts the relation to the above subset.
In $\cat{Cat}$, one builds the equalizer for the components on objects and then for the components on morphisms and then restricts the operators to those subsets, which ends up forming a well-defined category because of distributivity and identity preservation.
$\cat{Rel}$ does not have equalizers for some pairs of binary relations.
\end{example}

\begin{definition}[Pullback of morhisms $\mo{f}_1 : \ob{C}_1 \mto \ob{C}_3$ and $\mo{f}_2 : \ob{C}_2 \mto \ob{C}_3$]
An object $\ob{P}$ along with morphisms $\pi_1 : \ob{P} \mto \ob{C}_1$ and $\pi_2 : \ob{P} \mto \ob{C}_2$ such that $\pi_1 \cocomp \mo{f}_1 = \pi_2 \cocomp \mo{f}_2$ and with the property that, for any object $\ob{C}$ and morphisms $\mo{g}_1 : \ob{C} \mto \ob{C}_1$ and $\mo{g}_2 : \ob{C} \mto \ob{C}_2$ such that $\mo{g}_1 \cocomp \mo{f}_1 = \mo{g}_2 \cocomp \mo{f}_1$, there exists a unique morphism, denoted $\langle \mo{g}_1, \mo{g}_2 \rangle$, 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 left] {$\mo{g}_1$} (c1);
\draw[->] (c) -- node[below left] {$\mo{g}_2$} (c2);
\draw[->] (p) -- node[right] {$\pi_1$} (c1);
\draw[->] (p) -- node[right] {$\pi_2$} (c2);
\draw[->] (c1) -- node[above right] {$\mo{f}_1$} (c3);
\draw[->] (c2) -- node[below right] {$\mo{f}_2$} (c3);
\draw[dashed,->] (c) -- node[above]{$\langle \mo{g}_1, \mo{g}_2 \rangle$} (p);
\end{tikzpicture}
\end{center}
\end{definition}

\begin{example}
In $\cat{Set}$, the pullback of functions $f_1 : X \to Z$ and $f_2 : Y \to Z$ is the set $\{ \langle x, y \rangle : X \times Y \mid f_1(x) = f_2(y) \}$ along with the obvious projection functions.
\end{example}

\begin{exercise}
Note that the construction of pullbacks in $\cat{Set}$ is built from a product and an equalizer.
Prove that if a category has products 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}[Limit of a functor $D : \cat{S} \mto \cat{C}$]
An object $\ob{L}$ of $\cat{C}$ along with a natural transformation $\pi : \ob{L} \nto D$ with the property that, for any object $\ob{C}$ and natural transformation $\alpha : \ob{C} \nto D$, there exists a unique morphism $\langle \alpha \rangle : \ob{C} \mto \ob{L}$ such that $\langle \alpha \rangle \cocomp \pi$ 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}
Products correspond to limits of diagrams with scheme $\mathbb{2}$, the category with 2 objects and only identity morphisms.
Terminal objects correspond to limits of the diagram with scheme $\cat{0}$, the category with no objects or morphisms.
Equalizers correspond to limits of diagrams with the scheme $\bullet_1 \xtwomto{} \bullet_2$.
Pullbacks correspond to limits of diagrams with the scheme $\bullet_1 \mto \bullet_3 \mfrom \bullet_2$.
\end{example}

\begin{exercise}
Prove that a category has limits 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 right adjoint.
\end{exercise}

\begin{remark}
Given a functor $D : \cat{S} \mto \cat{C}$, a limit is a functor $L : \cat{1} \mto \cat{C}$ and natural transformation $\pi : \bang_\cat{S} \cocomp L \nto D$
with the property that, for any functor $C : \cat{1} \mto \cat{C}$ and natural transformation $\alpha : \bang_\cat{S} \cocomp L \nto D$, there exists a unique natural transformation $\langle \alpha \rangle : C \nto L$ 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]{$\langle \alpha \rangle$} (L);
\draw[double,double equal sign distance,-implies,shorten <=8pt,shorten >=2pt] (t) -- node[left]{$\pi$} (D);
\end{tikzpicture}
\end{center}
\end{remark}

\begin{definition}[Finitely Complete]
A category that has a limit 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 complete if and only if it has a terminal objects, products, and equalizers.
\end{exercise}

\begin{definition}[Preserves $\cat{S}$-Limits]
A functor $F : \cat{C} \mto \cat{D}$ with the property that, for any $D$, $L$, and $\pi$, if $L : \cat{1} \mto \cat{C}$ and $\pi : \bang \cocomp L \nto D$ is a limit of $D : \cat{S} \mto \cat{C}$, then $L \cocomp F$ and the following natural transforation is a limit 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]{$\pi$} (D);
\draw[->] (c) -- node[above]{$F$} (d);
\end{tikzpicture}
\end{center}
\end{definition}

\begin{definition}[(Finitely) Continuous]
A functor that preserves all limits is called \emph{continuous}.
A functor that preserves all finite limits is called \emph{finitely} continuous.
\end{definition}

\begin{exercise}
Prove that every right-adjoint functor is continuous.
\end{exercise}

\end{document}