# Categorical products and coproducts

2016-10-12 ( 2016-09-22)## Universal property of coproducts

Let $X_1, X_2$ be objects of the category $\vC$. The **coproduct** of $X_1$ and $X_2$ (if it exists) is a space $X_1 \coprod X_2$ and two morphisms
$j_1 \from X_1 \to X_1 \coprod X_2$,
$j_2 \from X_2 \to X_1 \coprod X_2$ such that the following diagram
commutes *(the first is with MathJax AMScd, the second is an embedded SVG produced with xypic)*:

$\require{AMScd}$
\begin{CD}
X_1 @>{j_1}>> X_1 \coprod X_2 @<{j_2}<< X_2 \\

@| @VVhV @| \\

X_1 @>{h_1}>> Z @<{h_2}<< X_2 \\

\end{CD}

Given a set $S$ of indices, the **coproduct** of a family
$X _ {s}$,
$s\in S$, of objects is (if it exists) the
space $\coprod _ {s \in S} X _ s $, together with
morphisms $j _ \alpha
\from X _ \alpha \to \coprod _ {s \in S} X_ s$,
such that for each $Z$ and each family of morphisms
$h_ \alpha \from X_ \alpha \to Z$
there exists a unique $h\from \coprod_ {s \in S} X_ s \to Z$
such that for each $\alpha \in S$ on has $hj_ \alpha = h_ \alpha$, i.e. the following diagram commutes:

- (1)
- The coproduct in $\mathbf{Top}_*$ is the wedge of the pointed spaces.

*Proof*:
For each $\alpha \in S$, let $x_ \alpha \in X_ \alpha$ denote
the base-point of $X_ \alpha$.
Let $\bigvee_ {s \in S} X_ s$
denote the disjoint union of all $X_ \alpha$, quotient after
the equivalence relation with a single non-trivial
equivalence class with all base-points
$x_ s$, and with the quotient topology.

Given $h_ \alpha$, pointed maps, $h_ \alpha (x_ \alpha) = z_ 0$,
where $z_ 0$ is the base-point of $Z$. Hence
the map defined on the disjoint union (which is continuous)
induces a (continuous) map on the quotient
$h \from \bigvee_ {s \in S} X_ s \to Z$.
*(/Proof)*

## Products

Reversing arrows, one define the **product**, denoted by
$\prod_ {s \in S} X_ s$,
together with projections
$p_ \alpha \from \prod_ {s \in S} X_ s \to X_ \alpha$,
in any category
$\mathbf{C}$, with the same universal property.

By definition, the product topology in $\mathbf{Top}$ is the topology on the categorical product, i.e. the topology on $\prod_ {s \in S} X_ s$ such that a function $f\from Z \to \prod_ {s \in S} X_ s$ is continuous if and only if its components $f_ \alpha = p_ \alpha f$ are continuous.

One can show that the **product topology** is generated by the base
of all subsets of type
$\prod_ {s \in S} U_ s
\subset
\prod_ {s \in S} X_ s$,
where for each $\alpha\in S$ the subspace $U_ \alpha \subset X_ \alpha$
is an open subset of $X_ \alpha$,
and for all but a **finite number** of $\alpha$'s the equality
$U_ \alpha = X_ \alpha$ holds.
The topology generated by subsets $\prod_ {s \in S} U_ s$
without the finiteness condition is the **box topology**,
which is not equivalent to the product topology.

- (2)
- The product in $\mathbf{Top}_ *$ is the cartesian product,
with the
**product topology**. The base point of $\prod_ {s \in S } (X_ s, \hat x_ s) $ is $(\hat x_ s)_ {s \in S}$.

*Proof*:
Let $(x_ s)_ {s \in S}$ denote a generic element of
the product
$ \prod_ {s \in S } (X_ s, \hat x_ s) $,
with
$x_ s \in X_ s$ for each $s \in S$.
Given maps $h_ \alpha$, the map $h$ defined by
$h(z) = (h_ \alpha(z))_ {\alpha\in S}$ is well-defined and continuous
in $\mathbf{Top}$. Furthermore, if $\hat z\in Z$ is the base-point,
then $h_ \alpha(\hat z) = \hat x_ \alpha$ for each $\alpha$,
hence
$h(\hat z)$ is the base-point in $\prod_ {\alpha \in S } (X_ \alpha, \hat x_ \alpha)$.
*(/Proof)*

If $X_ \alpha$ does not depend upon $\alpha$, then the product $\prod_ {\alpha \in S} X_ \alpha$ is also denoted as $X^S$ and is the space of all functions $S \to X$. The projections $p_ \alpha \from X^S \to X$ are therefore the evaluations $x \in X^S \mapsto x(\alpha) \in X$. Hence a sequence $x_ n$ of functions $S \to X$ converges in the product topology if and only if for each projection $p_ \alpha$ the projection $p_ \alpha(x_ n)$ converges, which means that $x_ n(\alpha)$ converges for each $\alpha$, or that $x_n$ converges pointwise.

## Free abelian groups

The free abelian group (i.e., $\ZZ$-module) generated by the set $S$ is the coproduct in $\mathbf{Ab}$ $$ \ZZ [ S ] = \coprod_ {\alpha \in S} \ZZ = \bigoplus_ { \alpha \in S} \ZZ , $$ since the coproduct in $\mathbf{Ab}$ is the direct sum $\bigoplus$.

The free (non-abelian) group generated by the set $S$ is $$ F(S) = \coprod_{\alpha \in S} \ZZ = \ZZ * \ZZ * \cdots $$ where the coproduct is taken in the category of groups $\mathbf{Grp}$, and hence it is the free product $*$.

## Posets

A *poset* (Partially Ordered Set) is a category $\mathbf{P}$ in which
hom-sets have either 0 or 1 element,
and such that if there exist morphisms
$A\to B$ and $B\to A$, then $A=B$.

So, if $A$ and $B$ are objects one can define [ A \leq B \iff \mathbf{P}(A,B) = \hom_{\mathbf{P}}(A,B) \neq \emptyset ]

- (3)
- The relation $A \leq B$ in $\mathbf{P}$ is reflexive, antisymmetric and transitive.

*Proof:*
Since $1_A \in \hom(A,A)$, the inequality $A\leq A$ holds.
If $A\leq B$ and $B\leq A$, then there are morphisms
$A\to B$ and $B \to A$,
and by assumpion $A=B$.
Transitivity follows from the existence of composition
of morphisms in any category.
*(/Proof)*

- (4)
- The coproduct in $\mathbf{P}$ of a family $X_ \alpha$ of objects is (if it exists) the supremum $\sup_ {s \in S} (X_ s)$ in $\mathbf{P}$; the product in $\mathbf{P}$ of a family $X_ \alpha$ of objects is (if it exists) the infimum $\inf_ {s \in S} (X_ s)$.

*Proof:*
Because of the $j_ \alpha \from X_ \alpha \to \coprod_ {s \in S} X_ s$,
the coproduct
is an upper bound,
i.e. $X_ \alpha \leq \coprod_ {s \in S} X_ s$ for each $\alpha \in S$.
If $Z$ is any other upper bound, i.e. an object such that
for each $\alpha \in S$ the inequality $X_ \alpha \leq Z$ holds,
then there exists $h \from \coprod_ {s \in S} X_ s \to Z$,
and hence
$\coprod_ {s \in S} X_ s \leq Z$, i.e. the coproduct is the
minimum of the upper bounds.

Reversing arrows in $\mathbf{P}$ one obtains the result for the
product.
*(/Proof)*

$\newcommand{\bD}{\mathbf{D}}$ $\newcommand{\bC}{\mathbf{C}}$ $\newcommand{\bP}{\mathbf{P}}$

**Example:**
Consider the poset $\bP$ of all subsets of a set $S$,
with $A\leq B$ if and only if $A\subseteq B \subseteq S$.
Then the coproduct and the product are the union and intersection
of the sets,
respectively:
$$
\coprod_ {\alpha} X_ \alpha = \bigcup_ \alpha X_ \alpha
$$
$$
\prod_ {\alpha} X_ \alpha = \bigcap_ \alpha X_ \alpha
$$

## Coproducts for the Working Mathematician

Categories for the Working Mathematician is the go-to reference for anything categorical.
Let $\bC, \bD$ be categories, and $F\from \bC \to \bD$ a functor.
The **comma category** $X \downarrow F$ of objects $F$-under $X$,
for $X$ object in $\bD$,
has as objects the pairs $(f,Y)$ with $Y\in \bC$ and
$f\from X \to F(Y)$,
and as morphisms (arrows) $h \from (f,Y) \to (f',Y')$
all morhpisms $h\from Y \to Y'$ su h that $f'=F(h) f$
as in the following diagram.

**initial object**, then this is termed the

**universal arrow**from $X$ to $F$.

- (5)
- The coproduct of two objects $X_ 1,X_ 2$ in $\bC$ is the initial object of the comma category $(X_ 1,X_ 2) \downarrow \Delta$, where $\Delta\from \bC \to \bC\times \bC$ is the diagonal functor. Hence it is the universal arrow from $(X_1,X_2)$ to $\Delta$.

*Proof:*
Consider the diagonal functor
$F=\Delta \from \bC \to \bD = \bC \times \bC $ (which sends
$Y$ to $(Y,Y)$ for each object $Y$ of the category $\bC$,
and morphisms accordingly).
Given an element $X=(X_ 1,X_ 2) \in \bD = \bC\times \bC$,
the initial object (if it exists) of the comma category
$(X_ 1,X_ 2) \downarrow \Delta$ is exactly the coproduct
$X_ 1 \coprod X_ 2$ in $\bC$.
In fact, an initial object is an object
$(j,A) \in (X_ 1,X_ 2) \downarrow \Delta$
such that for each object
$(h,Z) \in (X_ 1,X_ 2) \downarrow \Delta$
there exists a unique morphism
$(j,A) \to (h,Z)$.
In other words,
an initial object is a pair $(j,A)$ with $A\in \bC$
and $j \from (X_ 1, X_ 2) \to (A,A)$ such that
for each
$(h,Z)$, with $h\from (X_ 1, X_ 2) \to (Z,Z)$ there exists a unique
morphism $f \from (j,A) \to (h,Z)$,
i.e. a unique morphism
$f \from A \to Z$
such that the composition
$ \Delta(f) j\from (X_ 1,X_ 2) \to (A,A) \to (Z,Z)$
is equal to $h$.
*(/Proof)*