[Math] Prove that in any category a product(if exists) is associative up to isomorphism.

category-theory

I have a question regarding an exercise(p.38, ex.5.9) from Aluffi's Algebra textbook.

Let C be a category with products. Find a reasonable candidate for the universal property that the product $A \times B \times C$ ought to satisfy, and prove that both $(A \times B) \times C$ and $A \times (B \times C)$ satisfy the universal property.Deduce that $(A \times B) \times C$ and $A \times (B \times C)$ are necessarily isomorphic.

$A \times B \times C$ is defined an object of category C satisfying( together with morphisms $\pi''_A:A \times B \times C \to A, \pi''_B:A \times B \times C \to B$ and $\pi''_C:A \times B \times C \to C$ the following universal property:
$\forall$ objects $X$ of the category C and morphisms from $X$ to $A(f_0),B(g_0)$ and $C(h_0)\ \exists!$ morphism $\omega$ such that

$\pi''_A\omega=f_0\\
\pi''_B\omega=g_0 \ \ (1)\\
\pi''_C\omega=h_0$

Now, I want to prove that $(A \times B) \times C$ also satisfies this property together with morphisms $\pi_A\pi'_{A \times B}, \pi_B\pi'_{A \times B}$ and $\pi'_C$.

$(A \times B) \times C$ has it's own property. $\forall$ objects $X_1$(of the category C) and morphisms $f_1:X_1 \to A \times B, h_1:X_1 \to C \ \exists! \ \phi:X_1 \to (A \times B) \times C$ such that the following diagram
$$ \begin{array}{ccccc}
A \times B & \stackrel {\pi'_{A \times B}} \leftarrow & (A \times B) \times C & \stackrel{\pi'_C} \to & C \\
& {}_{f_1} \nwarrow & \ \ \ \ \ \uparrow {}_{\phi} & \nearrow {}_{h_1} & \\
& & X_1 & &
\end{array} $$
commutes.

And, finally, we have the universal property of $A \times B:
\forall X_2$ and morphisms $f_2:X_2 \to A, g_2:X_2 \to B$ we have a unique morphism $\upsilon:X_2 \to A \times B$ such that the following diagram
$$ \begin{array}{ccccc}
A & \stackrel {\pi_A} \leftarrow & A \times B & \stackrel{\pi_B} \to & B \\
& {}_{f_2} \nwarrow & \ \ \ \ \ \uparrow {}_{\upsilon} & \nearrow {}_{g_2} & \\
& & X_1 & &
\end{array} $$
commutes.
From the universal properties of $A \times (B \times C)$ and $A \times B$ follows that $\forall$ objects $X$ and morphisms $f,g$ and $h$ we have a unique morphism $\psi:X \to (A \times B) \times C$ such that
$\pi_A\pi'_{A \times B}\psi = f\\\pi'_C\psi = h$.

Now, how do we prove that an analogue of $(1)$ goes for $(A \times B) \times C$ as well?

Best Answer

Theorem: $(X_1 \times X_2) \times X_3$ together with the obvious projection arrows forms a ternary product of $X_1, X_2, X_3$.

Proof Assume $[X_1 \times X_2, \pi_1, \pi_2]$ is a product of $X_1$ with $X_2$, and $[(X_1 \times X_2) \times X_3, \rho_1, \rho_2]$ is a product of $X_1 \times X_2$ with $X_3$.

Take any object $S$ and arrows $f_i\colon S \to X_i$. By our first assumption, (a) there is a unique $u \colon S \to X_1 \times X_2$ such that $f_1 = \pi_1\circ u$, $f_2 = \pi_2\circ u$. So by our second assumption (b) there is then a unique $v \colon S \to (X_1 \times X_2) \times X_3$ such that $u = \rho_1 \circ v$, $f_3= \rho_2\circ v$.

Therefore $f_1 = \pi_1\circ \rho_1 \circ v$, $f_2 = \pi_2 \circ \rho_1 \circ v$, $f_3 = \rho_2 \circ v$

So now consider $[(X_1 \times X_2) \times X_3, \pi_1 \circ \rho_1, \pi_2 \circ \rho_1, \rho_2]$. This, we claim, is indeed a ternary product of $X_1, X_2, X_3$. We've just proved that $S$ and arrows $f_i\colon S \to X_i$ factor through the product via the arrow $v$. It remains to confirm $v$'s uniqueness in this new role.

Suppose we have $w \colon S \to (X_1 \times X_2) \times X_3$ where $f_1 = \pi_1 \circ \rho_1 \circ w$, $f_2 = \pi_2 \circ \rho_1 \circ w$, $f_3 = \rho_2 \circ w$. Then $\rho_1 \circ w\colon S \to X_1 \times X_2$ is such that $f_1 = \pi_1\circ (\rho_1 \circ w)$, $f_2 = \pi_2\circ (\rho_1 \circ w).$ Hence by (a), $u = \rho_1 \circ w$. But now invoking (b), that together with $f_3 = \rho_2 \circ w$ entails $w = v$. $\quad\Box$

(That's Theorem 76 in these Notes on Basic Category Theory.)