# Understanding the Cartesian product is the set of functions [duplicate]

According Wikipedia, "if a tuple is defined as a function on ${1, 2, ..., n}$ that takes its value at $i$ to be the $i$th element of the tuple, then the Cartesian product $X_1×...×X_n$ is the set of functions ${\displaystyle \{x:\{1,\ldots ,n\}\to X_{1}\cup \ldots \cup X_{n}\ |\ x(i)\in X_{i}\ {\text{for every}}\ i\in \{1,\ldots ,n\}\}.}$"

For me, it is hard to understand the above definition. Could you give some example to illustrate the concept? For example, let $X_1 = \{1,2\},X_2=\{a,b\}$. Then, $X_1×X_2= \{?\}$.

## marked as duplicate by Asaf Karagila♦ set-theory StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jul 21 '18 at 7:23

• $X_1 \times X_2 = \{ (1,a), (1,b), (2,a), (2,b) \}$ – tp1 Jul 21 '18 at 7:00
• @tp1 That is another definiton of $X_1\times X_2$. I don't see the relevance. – drhab Jul 21 '18 at 7:51
• @drhab: normally cartesian product is defined using pair constructor function and element accessor functions: $ct : 1 \rightarrow X_1 \times X_2$ and $a_i : X_1 \times X_2 \rightarrow X_i$, and you'll get $x(i) \in X_i$ from that. – tp1 Jul 21 '18 at 8:37

We are looking for functions $f:\{1,2\}\to\{1,2,a,b\}$ such $f(1)\in X_1=\{1,2\}$ and $f(2)\in X_2=\{a,b\}$.

There are $4$ such functions and writing each function as a set of ordered pairs they are:

• $f_{1,a}:=\{\langle 1,1\rangle,\langle 2,a\rangle\}$
• $f_{1,b}:=\{\langle 1,1\rangle,\langle 2,b\rangle\}$
• $f_{2,a}:=\{\langle 1,2\rangle,\langle 2,a\rangle\}$
• $f_{2,b}:=\{\langle 1,2\rangle,\langle 2,b\rangle\}$

Then according to the mentioned definition:$$X_1\times X_2=\{f_{1,a},f_{1,b},f_{2,a},f_{2,b}\}=$$$$\{\{\langle 1,1\rangle,\langle 2,a\rangle\},\{\langle 1,1\rangle,\langle 2,b\rangle\},\{\langle 1,2\rangle,\langle 2,a\rangle\},\{\langle 1,2\rangle,\langle 2,b\rangle\}\}$$

We can go even further by writing order pair $\langle r,s\rangle$ as $\{\{r\},\{r,s\}\}$ according to the definition of Kuratowski, but I don't think that that will increase your understanding.

Note that we get back the "familiar" definition of $X_1\times X_2$ just by replacing $f_{1,a},f_{1,b},f_{2,a},f_{2,b}$ by $\langle 1,a\rangle,\langle 1,b\rangle,\langle 2,a\rangle,\langle 2,b\rangle$ respectively.

In terms of the definition you've quoted, in your example $X_1\times X_2$ is the set of all functions $x$ from $\{\,1,2\,\}$ to $\{\,1,2,a,b\,\}$ such that $x(1)$ is in $\{\,1,2\,\}$ and $x(2)$ is in $\{\,a,b,\,\}$. There are four such functions, which I'll call $x_1,x_2,x_3,x_4$, given by

$x_1(1)=1,x_1(2)=a$
$x_2(1)=1,x_2(2)=b$
$x_3(1)=2,x_3(2)=a$
$x_4(1)=2,x_4(2)=b$