Does category theory provide a rigorous definition of the cartesian product? Let $X$ and $Y$ be sets. As far as I know, the defining property of the cartesian product
\begin{equation}
X\times Y=\left\{(x,y):x\in X\text{ and }y\in Y\right\}
\end{equation}
is the "universal property"
\begin{equation}
(x,y)=(x',y')\Leftrightarrow x=x'\text{ and }y=y'
\end{equation}
for all $x,x'\in X$ and $y,y'\in Y$. It is known that the definition $(x,y):=\{\{x\},\{x,y\}\}$ has the above property. But I guess this is only one of many possible definitions.
I have no background in category theory, but I got the impression that it is always needed to get the full picture when dealing with something that has a universal property (e.g. the tensor product), that's why I thought that it might help me get a more precise definition of the cartesian product.
If your answer contains terms specific to category theory, it would be much appreciated if you also gave some reference, so that I have a starting point for a rigorous introduction to the topic.
 A: The categorical version looks like this.  Let two sets $X,Y$ be given. A product of $X$ and $Y$ is  (1) a set $P$, (2) a map $\pi_X : P \to X$, (3) a map $\pi_Y : P\to Y$, such that:  For every set $Z$, and every pair of maps $f : Z \to X$, $g : Z \to Y$, there is a unique map $h : Z \to P$ such that $ f = \pi_X \circ h$ and $g = \pi_Y \circ h$.
One then proves the idea with ordered pairs does define such a product.  I that case $\pi_X(x,y) = x$, $\pi_Y(x,y) = y$, $h(x,y) = (f(x),g(x))$.
A: Here's a different formulation of the universal property. It should be equivalent to the other answer in the sense that sets that have the following property also have the universal property described in the other answer and vice versa.
Consider a set $I$ and let $X_i$ be a set for all $i\in I$.
\begin{equation*}
    X:=\bigcup_{i\in I}X_i
\end{equation*}
Now, let $M$ be the set of all maps from $I$ to $X$ and
\begin{equation*}
    \mathcal{M}=\{x\in M:x_i\in X_i\text{ for all }i\in I\}.
\end{equation*}

A Cartesian product of the family $\{X_i:i\in I\}$ consists of a set $P$ and a family of maps $\{\pi_i\colon P\to X_i:i\in I\}$ such that the map $f\colon P\to\mathcal{M}$ that assigns to each $x\in P$ the map
\begin{align*}
    f(x)\colon I&\to X\\
    i&\mapsto\pi_i(x)
\end{align*}
is bijective. We identify $x\in P$ with $f(x)$.

Let $P$ to $P'$ be Cartesian products of $\{X_i:i\in I\}$. Then there is exactly one natural bijection from $P$ to $P'$:
According to the definition of Cartesian products, we can construct bijective maps $f\colon P\to\mathcal{M}$ and $f'\colon P'\to\mathcal{M}$. The map $f^{-1}\circ f'\colon P'\to P$ is the natural bijection that allows us to identify elements of $P$ and $P'$ that correspond the same element of $\mathcal{M}$: If $x'\in P'$ and $x=F(x')$, $f(x)=f'(x')\in\mathcal{M}$.
Comment. I think this is a very natural way to describe the universal property: It often happens that the Cartesian product is defined as $\mathcal{M}$, just like the tensor product is sometimes defined as the set of multilinear maps. In both cases, the universal property can be described making use of the "naive" definitions.
