Math + You = 1

Courses Preparation course

Set theory: What is the Cartesian product?

The Cartesian product is an essential notion to know in set theory. Let's discover its definition together.

Definition of the Cartesian product

We call Cartesian product of two sets A and B (it is denoted A x B) the set of couples (a;b) where a is an element of A and b an element of B. Mathematically, this is written:

A \times B = \{(a,b) ,a \in A, b\in B\}

When A and B are finite, the cardinality of A x B is the product of the cardinality of A and the cardinality of B. So if the cardinality of A is p, that of B is q then the cardinality of A x B is pq.

\#(A\times B) = \#A \times \#B

Here is some additional information:

  • The Cartesian product is not commutative, E x F is generally different from F x E, they are also different when F is different from E
  • If F = E, we can replace the notation E x E by E2
  • We can define a Cartesian product with n terms:
A_1 \times \ldots \times A_n = \{ (a_1,\ldots,a_n), a_1 \in A_1, \ldots, a_n \in A_n \}
  • And if all the A'si are equal to A, we also have the following notation: A1 x … x An = An which is much more condensed.


  • If A = {a,b} and B = {1,2,3} then the set A x B resulting from the Cartesian product is made up of the following 6 elements: A x B = {(a,1); (a,2); (a,3); (b,1); (b,2); (b,3)}. Note that B x A is quite different from A x B and equals {(1,a); (2,a); (3,a); (1,b); (2,b); (3,b)}
  • If A and B are equal to the set of real numbers, we define


\mathbb{R}^2 = \{(a,b), a \in \R, b\in \R\}

The Cartesian Product in SQL

To make the connection with the SQL, the joint cross join corresponds exactly to the Cartesian product. If we have a first table of k rows and a second table of l rows then the cross join between these two tables gives a table of kxl rows corresponding to the Cartesian product of the 2 rows.


    • Hello,
      And thank you for your question! The answer is quite simple:
      We define E^n as E x E^(n-1). By induction we get that it is E x E x … x E n times
      E^(2n) so it's E x E x … x E 2n times
      We therefore have: E^nx E^n = E x E x .. x E 2n times = E^(2n)
      Does that answer your question?

      • I'm sorry but the \= was for \not=
        It was my high school teacher who told me that and I didn't really understand. I understand that they are equal up to an isomorphism but not why they are not equal. Thanks in advance and have a good evening.

Leave comments