Section 1.2
Products, coproducts, and sets of maps
We have seen how to take the product $X \times Y$ of two sets $X$ and $Y$. We just take all possible pairs $(x, y)$ for $x \in X$ and $y \in Y$. This can be easily generalized to products of more sets. If we have sets $X_1, \ldots, X_n$, we should be able to take
$$ \prod_{i=1}^{n} X_i = X_1 \times X_2 \times \cdots \times X_n = \lbrace (x_1, \ldots, x_n) : x_1 \in X_1, \ldots, x_n \in X_n \rbrace . $$
Note that if $X_1, \ldots, X_n$ are finite sets, then $X_1 \times \cdots \times X_n$ is also a finite set and
$$ \lvert X_1 \times X_2 \times \cdots \times X_n \rvert = \lvert X_1 \rvert \lvert X_2 \rvert \cdots \lvert X_n \rvert. $$
This explains why we call this a product set.
Show that the canonical map
$$ X \times Y \times Z \to (X \times Y) \times Z; \quad (x, y, z) \mapsto ((x, y), z) $$
is a bijection. We can easily think of doing more complicated things by placing parentheses differently.
We can also start taking infinite products in a similar way. Let $I$ be a set, which indexes sets. That is, for each element $i \in I$ there is going to be a set $X_i$, of which we will try to take a product. This indexing set $I$ can be infinite like $\mathbb{Z}_{\ge 0} = \lbrace 0, 1, \ldots\rbrace $ or very infinite like $\mathbb{R}$. Given this data, we can define their product.
Let $I$ be an indexing set, and for each $i \in I$ let $X_i$ be a set. The product of $X_i$ is defined as
$$ \prod_{i \in I}^{} X_i = \lbrace (x_i)_{i \in I} : x_i \in X_i \rbrace $$
where $(x_i)_{i \in I}$ is an infinite tuple indexed by $I$. If you want to be super rigorous, you can think of the infinite tuple as a map $\varphi : I \to \bigcup_{i \in I} X_i$ such that $\varphi(i) \in X_i$ for all $i \in I$.
If $I = \emptyset$, what is $\prod_{i \in I}^{} X_i$? How many elements does it have?
Show that if there exists an $i_0 \in I$ such that $X_{i_0} = \emptyset$, then the product is $\prod_{i \in I} X_i = \emptyset$.
On the other hand, what if all the sets $X_i$ are nonempty?
Let $I$ be an indexing set, and for each $i \in I$ let $X_i \neq \emptyset$ be a nonempty set. Then their product $\prod_{i \in I} X_i$ is also nonempty.
A product of sets comes with canonical projections maps defined as, for each $i_0 \in I$,
$$ \pi_{i_0} : \prod_{i \in I}^{} X_i \to X_{i_0}; \quad (x_i)_{i \in I} \mapsto x_{i_0}. $$
Suppose $X_i$ are all nonempty. Assuming the Axiom of Choice, show that each projection map $\pi_{i_0}$ is surjective.
There is a dual notion of products, called coproducts. A funny habit of mathematicians is that they put the prefix “co-” in front of a word to make another word that describes the notion that is dual to the original one. It might not seem very clear at this point why the coproduct is the dual notion of the product, but we will see it in the next section. It is amazing how a lot of mathematics comes in dual pairs.
Let $I$ be an indexing set, and for each $i \in I$ let $X_i$ be a set. The coproduct of $X_i$ or the disjoint union of $X_i$ is defined as
$$ \coprod_{i \in I}^{} X_i = \lbrace (i, x) : i \in I, \, x \in X_i \rbrace \subseteq I \times \bigcup_{i \in I} X_i. $$
The coproduct also comes with canonical maps, this time from the individual sets to the coproduct. For each $i_0 \in I$, define the inclusion map
$$ \iota_{i_0} : X_{i_0} \to \coprod_{i \in I} X_i; \quad x \mapsto (i_0, x). $$
Convince yourself if $X_1, \ldots, X_n$ are finite sets, then $X_1 \amalg \cdots \amalg X_n$ is also a finite set and
$$ \lvert X_1 \amalg X_2 \amalg \cdots \amalg X_n \rvert = \lvert X_1 \rvert + \lvert X_2 \rvert + \cdots + \lvert X_n \rvert. $$
If $I = \emptyset$, what is $\coprod_{i \in I} X_i$?
Show that each $\iota_{i_0}$ is always injective, without any assumptions.
Before moving on, let me introduce one more construction. Given two sets $X$ and $Y$, the maps from $X$ to $Y$ themselves form a set.
Let $X$ and $Y$ be sets. The set of maps from $X$ to $Y$ is denoted by $Y^X$ or $\Mor_\mathsf{Set}(X, Y)$.
The sans-serif $\mathsf{Set}$ indicates that we are working with sets, not some other mathematical structure, and $\Mor$ stands for morphisms, which are just maps when we work with sets. In algebra, it is important to always be aware of what “type” of mathematical object we are working with, and this will be a sort of reminder. For the rationale behind the other notation, do the following exercise.
Let $X$ and $Y$ be finite sets. Convince yourself that $Y^X$ is finite and $\lvert Y^X \rvert = \lvert Y \rvert^{\lvert X \rvert}$.
The next exercise can be confusing at first, but it is a crucial idea in mathematics that you can sometimes play around with maps like this. We will see the same idea over and over in different contexts.
Let $X$, $Y$, and $Z$ be sets. Show that the map
$$ \begin{aligned} \Mor_\mathsf{Set}(X, \Mor_\mathsf{Set}(Y, Z)) &\to \Mor_\mathsf{Set}(X \times Y, Z); \\ (x \mapsto (f_x : y \mapsto z)) &\mapsto ((x, y) \mapsto z = f_x(y)) \end{aligned} $$
is a bijection. This map can be described alternatively as sending a map $f : X \to \Mor_\mathsf{Set}(Y, Z)$ to $(x, y) \mapsto (f(x))(y)$.