You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -429,14 +430,14 @@ \section{Categories and Examples}
429
430
\end{enumerate}
430
431
\end{dfn}
431
432
432
-
\begin{intu} So what does a category represent? There are (at least) $3$ possible ways how one can think about this definition:
433
-
\begin{enumerate}
434
-
\item A category represents a type system in the sense that the objects are the types and each hom-set is the type\footnote{In this case, each hom-set is a type, so isn't each hom-set an object again? Categories which satisfy such a property are called \textit{cartesian closed}.} of functions. See \cref{example:hask}.
435
-
\item A category represents a \textit{bag} of instances of a particular mathematical structure (e.g. sets with a notion of addition). The objects are then instances of such a mathematical theory (e.g. $(\mathbb{N},+)$) and the morphisms are structure preserving functions (e.g. functions $f$ which satisfy $f(x+y) = f(x) + f(y)$). See \cref{example:set,example:poset,monoidcategory}.
436
-
\item A category represents a directed graph in the sense that an object is a vertex and a morphism is an edge.
437
-
\item Anything (almost at least) can be seen as a category in some exotic way.
438
-
\end{enumerate}
439
-
\end{intu}
433
+
%\begin{intu} So what does a category represent? There are (at least) $3$ possible ways how one can think about this definition:
434
+
%\begin{enumerate}
435
+
%\item A category represents a type system in the sense that the objects are the types and each hom-set is the type\footnote{In this case, each hom-set is a type, so isn't each hom-set an object again? Categories which satisfy such a property are called \textit{cartesian closed}.} of functions. See \cref{example:hask}.
436
+
%\item A category represents a \textit{bag} of instances of a particular mathematical structure (e.g. sets with a notion of addition). The objects are then instances of such a mathematical theory (e.g. $(\mathbb{N},+)$) and the morphisms are structure preserving functions (e.g. functions $f$ which satisfy $f(x+y) = f(x) + f(y)$). See \cref{example:set,example:poset,monoidcategory}.
437
+
%\item A category represents a directed graph in the sense that an object is a vertex and a morphism is an edge.
438
+
%\item Anything (almost at least) can be seen as a category in some exotic way.
439
+
%\end{enumerate}
440
+
%\end{intu}
440
441
441
442
\begin{nota} Let $\CC$ be a category.
442
443
\begin{itemize}
@@ -832,7 +833,7 @@ \section{Categories and Examples}
832
833
More generally for each field $\mathbb{F}$, one can define $\MAT_\mathbb{F}$, where a morphism $f : m \to n$ is a an $n \times m$ matrix over the field $\mathbb{F}$.
833
834
\end{enumerate}
834
835
835
-
Can you think of other categories that have natural numbers as their collection of objects? What about a category, where a morphism $f : m \to n$ is a monotonically increasing (decreasing) function from $[m]$ to $[n]$?
836
+
Can you think of other categories that have natural numbers as their collection of objects? What about a category, where a morphism $f : m \to n$ is a monotonously increasing (decreasing) function from $[m]$ to $[n]$?
\begin{exer}[\cref{sol:iso_in_posetcategory}]\label{exer:iso_in_posetcategory} Let $(X,\leq)$ be a poset. Can you characterize/describe the isomorphisms in $\POS(X,\leq)$?
\begin{exer}\label{ex:poset_functors} Let $(X,\leq_X)$ and $(Y,\leq_Y)$ be preordered sets. Can you characterize/describe the functors from $\PREtoCAT(X,\leq_X)$ to $\PREtoCAT(Y,\leq_Y)$ ? Before writing out the definitions, what would you expect the answer to be?
1748
+
\begin{exer}\label{ex:poset_functors}
1749
+
Let $(X,\leq_X)$ and $(Y,\leq_Y)$ be preordered sets.
1750
+
Describe the functors from $\PREtoCAT(X,\leq_X)$ to $\PREtoCAT(Y,\leq_Y)$.
1751
+
Before writing out the definitions, what would you expect the answer to be?
\begin{exer}\label{ex:monoid_functors} Let $(M,m,e)$ be a monoid and let $\MONtoCAT(M,m,e)$ be its corresponding category as defined in \cref{monoidcategory}. Can you characterize/describe the functors from $\MONtoCAT(M,m,e)$ to $\SET$?
1770
+
\begin{exer}\label{ex:monoid_functors}
1771
+
Let $(M,m,e)$ be a monoid and let $\MONtoCAT(M,m,e)$ be its corresponding category as defined in \cref{monoidcategory}.
1772
+
Describe the functors from $\MONtoCAT(M,m,e)$ to $\SET$.
\begin{exer} Let $(M,m,e)$ be a monoid and let $\MONtoCAT(M,m,e)$ be its corresponding category. Recall from \cref{ex:monoid_functors} that a functor from $\MONtoCAT(M,m,e)$ to $\SET$ is a set $X$ together with an action of $M$ on $X$, i.e. a function $\mu: M\times X\to X$ such that
We will call a set $ X $ with an action of $ M $ on $ X $ an $ M $-set.
1947
-
Characterize/describe the natural transformations between $M$-sets.
1951
+
\begin{exer}
1952
+
Let $(M,m,e)$ be a monoid and let $\MONtoCAT(M,m,e)$ be its corresponding category. Recall from \cref{ex:monoid_functors} that a functor from $\MONtoCAT(M,m,e)$ to $\SET$ is a set $X$ together with an action of $M$ on $X$, i.e. a function $\mu: M\times X\to X$ such that
We will call a set $ X $ with an action of $ M $ on $ X $ an $ M $-set.
1957
+
Describe the natural transformations between $M$-sets.
1948
1958
\end{exer}
1949
1959
1950
-
\begin{exer} Let $(X,\leq_X)$ and $(Y,\leq_Y)$ be posets. Recall from \cref{ex:poset_functors} that a functor between posets corresponds with an order-preserving function, i.e. $x_1\leq_X x_2\implies f(x_1) \leq_Y f(x_2)$. Characterize/describe the natural transformations between order-preserving functions.
1960
+
\begin{exer}
1961
+
Let $(X,\leq_X)$ and $(Y,\leq_Y)$ be posets.
1962
+
Recall from \cref{ex:poset_functors} that a functor between posets corresponds with an order-preserving function, i.e. $x_1\leq_X x_2\implies f(x_1) \leq_Y f(x_2)$.
1963
+
Describe the natural transformations between order-preserving functions.
Copy file name to clipboardExpand all lines: tex/data.tex
+20-15Lines changed: 20 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,13 @@ \section{Examples}
14
14
| $\Zero$ : $\NN$
15
15
| $\Succ$ : $\NN \to \NN$
16
16
\end{lstlisting}
17
-
and the following category:
17
+
18
+
This inductive datatype comes with the following recursion principle:
19
+
20
+
21
+
22
+
23
+
and the following category:
18
24
\begin{itemize}
19
25
\item Objects are triples $(X, z \in X, s : X \to X)$ with $X$ a set/type;
20
26
\item Morphisms from $(X, z \in X, s : X \to X)$ to $(X', z' \in X', s' : X' \to X')$ are functions
@@ -214,9 +220,8 @@ \section{Datatypes as Initial Algebras}
214
220
215
221
216
222
\begin{exer}
217
-
Let $F$ be the endofunctor defined as in \cref{example:algebra_of_monoids},
218
-
i.e. the endofunctor whose algebras correspond with monoids.
219
-
Characterize/describe the $F$-algebra homomorphisms.
223
+
Let $F$ be the endofunctor defined as in \cref{example:algebra_of_monoids}, i.e., the endofunctor whose algebras correspond to monoids.
224
+
Describe the $F$-algebra homomorphisms.
220
225
\end{exer}
221
226
222
227
\begin{dfn}\label{definition:category_of_Falgebras} Let $F:\CC\to\CC$ be an endofunctor. The \textbf{category of $F$-algebras}, denoted by $\ALG{F}$, is defined by the following data:
@@ -280,25 +285,25 @@ \section{Datatypes as Initial Algebras}
280
285
\end{exer}
281
286
282
287
\begin{exer}\label{exer:bool_as_initial_algebra}
283
-
Let $\mathbf{Bool}$ be the inductive data type generated by the following two constructors:
284
-
\begin{lstlisting}
288
+
Let $\mathbf{Bool}$ be the inductive data type generated by the following two constructors:
289
+
\begin{lstlisting}
285
290
True : Bool
286
291
False : Bool
287
-
\end{lstlisting}
288
-
Define an endofunctor $F:\SET\to\SET$ such that the $F$-algebras can be characterized as triples $(X, b_1, b_2)$ with $X$ a set and $b_1,b_2\in X$.
289
-
290
-
Moreover, show that $(\mathsf{Bool}, \mathsf{True}, \mathsf{False})$ is an initial object in $\ALG{F}$.
292
+
\end{lstlisting}
293
+
Define an endofunctor $F:\SET\to\SET$ such that the $F$-algebras can be described as triples $(X, b_1, b_2)$ with $X$ a set and $b_1,b_2\in X$.
294
+
295
+
Moreover, show that $(\mathsf{Bool}, \mathsf{True}, \mathsf{False})$ is an initial object in $\ALG{F}$.
The disjoint union (i.e., the coproduct) of two sets $X$ and $Y$ can also be characterized as an inductive data type; indeed, it is generated by the following two constructors:
295
-
\begin{lstlisting}
299
+
The disjoint union (i.e., the coproduct) of two sets $X$ and $Y$ can also be described as an inductive data type; indeed, it is generated by the following two constructors:
300
+
\begin{lstlisting}
296
301
f : X -> X+Y
297
302
g : Y -> X+Y
298
-
\end{lstlisting}
299
-
Define an endofunctor $F:\SET\to\SET$ such that the $F$-algebras can be characterized as triples $(C, i_l, i_r)$ with $C$ a set and $i_l : X\to C, i_r : Y\to C$ be functions.
303
+
\end{lstlisting}
304
+
Define an endofunctor $F:\SET\to\SET$ such that the $F$-algebras can be described as triples $(C, i_l, i_r)$ with $C$ a set and $i_l : X\to C, i_r : Y\to C$ be functions.
300
305
301
-
Moreover, show that $(X + Y, \inl, \inr)$ is the initial object in $\ALG{F}$, where $X+Y$ is the disjoint union of $X$ and $Y$ (i.e. the coproduct in $\SET$) and $\inl:X\to X+Y, \inr:Y\to X+Y$ the canonical inclusions.
306
+
Moreover, show that $(X + Y, \inl, \inr)$ is the initial object in $\ALG{F}$, where $X+Y$ is the disjoint union of $X$ and $Y$ (i.e. the coproduct in $\SET$) and $\inl:X\to X+Y, \inr:Y\to X+Y$ the canonical inclusions.
0 commit comments