My textbook:
Thus, given sets $X$ and $Y$, pair of maps $\langle p, q\rangle, p : X \times Y \mapsto X, q : X \times Y \mapsto Y$ is universal among pairs of functions from some set to the $X$ and $Y$, because any other such pair $\langle f, g\rangle$ factors uniquely (via $h$) through the pair $\langle p, q\rangle $. This property describes cartesian product uniquely up to bijection.
My first question is about the last words in the quote above: bijection from where to where? Looks like there is only one possible answer: from what my textbook names 'some set' (let it be $S$) to $X \times Y$? In other words, $h : S \mapsto X \times Y$ is a bijective map and it indeed determined by abovementioned $\langle p, q\rangle$.
However, assuming I wasn't wrong so far, second question rises up: does the phrase 'uniquely up to bijection' mean that there exists exactly one bijection between arbitrary 'some set' $S$ and $X \times Y$?
So, the direct (Cartesian) product $X\times Y$ has maps $p:X\times Y\to X, p(x,y)=x$ and $q:X\times Y\to Y, q(x,y)=y$. It also has the property that:
That is the "universal" property. It can be proven fairly easily:
Okay. Now, this universal property guarantees uniqueness of the direct product up to bijection. This means that, for any other set and pair of maps satisfying the same universal property, there is a bijection of that set with $X\times Y$.
How does it work? I will show a proof below (a fairly tedious one, please keep with me). However, what is important here to realise is:
The second point is important because you can then generalise the proof and use it with other objects (e.g. not necessary sets with maps, but, say, groups with group homomorphisms, or vector spaces with linear maps, or topological spaces with homeomorphisms) - bringing us into the domain of the category theory
Proof that the direct product is unique up to a bijection
So, suppose two different sets $\Pi_1$ and $\Pi_2$ have the universal property, i.e. they have functions $p_1:\Pi_1\to X, p_2:\Pi_2\to X, q_1:\Pi_1\to Y$ and $q_2:\Pi_2\to Y$, such that for any set $S$ and functions $f:S\to X, g:S\to Y$ there exists a unique map $h_1:S\to\Pi_1$ such that $p_1\circ h_1=f, q_1\circ h_1=g$, and also a unique map $h_2:S\to\Pi_2$ such that $p_2\circ h_2=f, q_2\circ h_2=g$. So far I am just repeating what we are assuming.
Right, so the trick is now to:
The first point gives us a unique map $h_2:\Pi_2\to\Pi_1$ such that $p_1\circ h_2=p_2$, $q_1\circ h_2=q_2$. The second point gives us a unique map $h_1:\Pi_1\to\Pi_2$ such that $p_2\circ h_1=p_1$, $q_2\circ h_1=q_1$. Finally, it is trivial that, for the third point, the identity on $\Pi_1$ plays the role of that unique map (because $p_1\circ I_{\Pi_1}=p_1$ and $q_1\circ I_{\Pi_1}=q_1$). We emphasise the fact that it is unique.
Now, for the final blow, notice that $h_2\circ h_1$ is another map from $\Pi_1$ to itself satisfying the same conditions. Namely:
$$p_1\circ h_2\circ h_1=p_2\circ h_1=p_1$$ $$q_1\circ h_2\circ h_1=q_2\circ h_1=q_1$$
Because of uniqueness, this means that $h_2\circ h_1=I_{\Pi_1}$.
It is now easy to complete the proof in the opposite direction, using the fourth point above, and conclude that $h_1\circ h_2=I_{\Pi_2}$. Thus, $h_1$ and $h_2$ are mutually inverse to each other and so they are bijections of $\Pi_1$ and $\Pi_2$.