--- title: Exercises in Category Theory — 1.1 published: 2016-01-29 tags: Category Theory ---
Sets and functions do form a category $\ca{Set}$.
The objects of $\ca{Set}$ are sets and its arrows are functions. For any set $A$ we construct \idarr{A} by restricting \id to $A$: $$\idarr{A} = \id \upharpoonright A$$ $\circ$ is indeed associative.
Each [poset](https://en.wikipedia.org/wiki/Partially_ordered_set) is a category.
The objects of each poset are its elements and we construct an arrow $\begin{tikzcd} a \arrow[r, "\leq"] & b \end{tikzcd}$ for every pair of objects $(a, b)$ iff $a \leq b$. Reflexivity ($a \leq a$) and transitivity ($a \leq b \land b \leq c \implies a \leq c$) provide a construction for \idarr{a} and $\circ$, respectively.
Each [monoid](https://en.wikipedia.org/wiki/Monoid) is a category.
The objects of each monoid are its elements and we construct for every pair of elements $(a, b)$ an arrow $\begin{tikzcd} a \arrow[r, "\cdot b"] & a \cdot b \end{tikzcd}$. The existence of an identity element and associativity, as required by the monoid structure, immediately provide us with a construction for \id and associativity of $\circ$.