Finish functor section

This commit is contained in:
Leon Vatthauer 2024-03-26 08:09:53 +01:00
parent dfccca8326
commit 64cbc50601
Signed by: leonv
SSH key fingerprint: SHA256:G4+ddwoZmhLPRB1agvXzZMXIzkVJ36dUYZXf5NxT+u8
3 changed files with 117 additions and 0 deletions

View file

@ -36,3 +36,4 @@ hom-functor
monoids
n-ary
Cocartesian
Yoneda

Binary file not shown.

View file

@ -379,6 +379,122 @@ Isomorphisms of categories are the isomorphisms in the quasi-category $\emph{CAT
\end{example}
\section{Natural Transformations}
Natural transformation are morphisms between functors. The definition of ``naturality'' was one of the original goals of category theory.
\begin{definition}[Natural Transformation]
Given two functors $F, G : \C \rightarrow \D$.
A natural transformation $\alpha : F \rightarrow G$ between these functors is a family of morphisms $(\alpha_C : FC \rightarrow GC)_{C\in\obj{\C}}$, such that for any $f : A \rightarrow B$ the diagram
% https://q.uiver.app/#q=WzAsNCxbMCwwLCJGQSJdLFsyLDAsIkZCIl0sWzAsMiwiR0EiXSxbMiwyLCJHQiJdLFswLDEsIkZmIl0sWzIsMywiR2YiXSxbMCwyLCJcXGFscGhhX0EiLDJdLFsxLDMsIlxcYWxwaGFfQiJdXQ==
\[
\begin{tikzcd}
FA && FB \\
\\
GA && GB
\arrow["Ff", from=1-1, to=1-3]
\arrow["Gf", from=3-1, to=3-3]
\arrow["{\alpha_A}"', from=1-1, to=3-1]
\arrow["{\alpha_B}", from=1-3, to=3-3]
\end{tikzcd}
\]
commutes.
\end{definition}
\begin{example} Examples of natural transformations include:
\begin{enumerate}
\item The obvious function $flatten : Tree\;A \rightarrow List\;A$:
% https://q.uiver.app/#q=WzAsNCxbMCwwLCJUcmVlXFw7QSJdLFsyLDAsIlRyZWVcXDtCIl0sWzAsMiwiTGlzdFxcO0EiXSxbMiwyLCJMaXN0XFw7QiJdLFswLDIsImZsYXR0ZW5fQSIsMl0sWzEsMywiZmxhdHRlbl9CIl0sWzIsMywibGlzdFxcO2YiXSxbMCwxLCJ0cmVlXFw7ZiJdXQ==
\[
\begin{tikzcd}
{Tree\;A} && {Tree\;B} \\
\\
{List\;A} && {List\;B}
\arrow["{flatten_A}"', from=1-1, to=3-1]
\arrow["{flatten_B}", from=1-3, to=3-3]
\arrow["{list\;f}", from=3-1, to=3-3]
\arrow["{tree\;f}", from=1-1, to=1-3]
\end{tikzcd}
\]
\item For $Id, Q : Set \rightarrow Set$ we have $\delta : Id \rightarrow Q$ given by $\delta_X (x) = (x,x)$.
\item On $\mathcal{P}$ we can define natural transformations $\eta : Id \rightarrow \mathcal{P}$ and $\mu : \mathcal{P}\mathcal{P} \rightarrow \mathcal{P}$ by:
\begin{alignat*}{1}
\eta_X : X & \rightarrow \mathcal{P}X \\
x & \mapsto \{x\}
\end{alignat*}
and
\begin{alignat*}{1}
\mu_X : \mathcal{P}\mathcal{P}X & \rightarrow \mathcal{P}X \\
Z & \mapsto \bigcup Z.
\end{alignat*}
\item Between $Q$ and $\mathcal{P}$ we can consider $\alpha,\beta : Q \rightarrow \mathcal{P}$ given by
\begin{alignat*}{2}
& \alpha_X(x,y) & & = \{x,y\} \\
& \beta_X(x,y) & & = \{x\}.
\end{alignat*}
\end{enumerate}
\end{example}
Functors $\C \rightarrow \D$ together with natural transformations as morphisms form a quasi-category $[\C,\D]$, that is called the functor category. If $\C$ is small, then $[\C,\D]$ is a category, where identity and composition are defined component wise.
\begin{example} Let us examine concrete examples of functor categories:
\begin{enumerate}
\item $[2, \C] \cong \C \times \C$, where $2$ is the \emph{discrete} category with two objects, i.e.\ $2$ has no morphisms besides the identities.
\item Let $\rightarrow$ be the category with 2 objects and a single non-trivial morphism $m$. $[\rightarrow, \C$ is the \emph{category of morphisms} of $\C$, where morphisms $Fm \rightarrow Gm$ are pairs of morphisms $(f,g)$ where
% https://q.uiver.app/#q=WzAsNCxbMCwwLCJGMCJdLFsyLDAsIkYxIl0sWzAsMiwiRzAiXSxbMiwyLCJHMSJdLFswLDEsIkZtIl0sWzIsMywiR20iXSxbMCwyLCJmIiwyXSxbMSwzLCJnIl1d
\[
\begin{tikzcd}
F0 && F1 \\
\\
G0 && G1
\arrow["Fm", from=1-1, to=1-3]
\arrow["Gm", from=3-1, to=3-3]
\arrow["f"', from=1-1, to=3-1]
\arrow["g", from=1-3, to=3-3]
\end{tikzcd}
\]
commutes.
\end{enumerate}
\end{example}
\begin{definition}[Natural Isomorphism]
Isomorphisms in $[\C,\D]$ are called \emph{natural isomorphisms}.
\end{definition}
\begin{proposition}
$\alpha : F \rightarrow G$ is a natural isomorphism \emph{iff} every $\alpha_C$ is an isomorphism.
\end{proposition}
\begin{example} Let us consider some examples of natural isomorphisms:
\begin{enumerate}
\item In $[\emph{Set},\emph{Set}]$ is $Id \cong \emph{Set}(1,-)$, since of course $Id\;X = X \cong X^1 = \emph{Set}(1,X)$.
\item Also in $[\emph{Set},\emph{Set}]$ is $Q \cong \emph{Set}(2,-)$, similarly is $\lambda X.2\times X \cong \lambda X. X + X$.
\item The forgetful functor $U : \emph{Pos} \rightarrow \emph{Set}$ is naturally isomorphic to $\emph{Pos}(1,-)$, because the constant mapping $x : 1 \rightarrow X$ is monotonous for every element $x$ of a poset.
\end{enumerate}
\end{example}
\begin{proposition}[Yoneda Lemma]
Let $A \in \obj{\C}$ and $G : \C \rightarrow \emph{Set}$. Then the natural transformations
\[\C(A,-) \rightarrow G\]
are in bijection with the elements of the set $GA$.
\end{proposition}
\begin{proof}
The mappings are
\begin{alignat*}{1}
& Z : GA \rightarrow [\C , \emph{Set}](\C(A,-), G) \\
& Z\;x\;h = G\;h\;x
\end{alignat*}
and
\begin{alignat*}{1}
& Y : [\C , \emph{Set}](\C(A,-), G) \rightarrow GA \\
& Y\;\alpha = \alpha_A\;id_A
\end{alignat*}
\end{proof}
\begin{example}
Let us consider an application of the Yoneda Lemma: how many natural transformations $Id \rightarrow Q$ are there?
Recall that $Id \cong \emph{Set}(1,-)$, and by Yoneda there is exactly $\vert Q1 \vert = 1$ natural transformation $\emph{Set}(1,-) \rightarrow Q$, thus the number of natural transformations $Id \rightarrow Q$ is $1$.
Furthermore, consider the number of natural transformations $Q \rightarrow Q$. Recall that $Q \cong \emph{Set}(2, -)$, and by Yoneda there are $\vert Q2 \vert = 4$ natural transformations $\emph{Set}(2, -) \rightarrow Q$, thus the number of natural transformations $Q \rightarrow Q$ is $4$.
\end{example}
\section{Functor Algebras}
\section{Functor Coalgebras}
\section{(co)Limits} % chktex 36