
In
mathematics, specifically
set theory
Set theory is the branch of mathematical logic that studies sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory, as a branch of mathematics, is mostly concer ...
, the Cartesian product of two
sets ''A'' and ''B'', denoted ''A''×''B'', is the set of all
ordered pairs where ''a'' is in ''A'' and ''b'' is in ''B''.
In terms of
set-builder notation, that is
:
A table can be created by taking the Cartesian product of a set of rows and a set of columns. If the Cartesian product is taken, the cells of the table contain ordered pairs of the form .
One can similarly define the Cartesian product of ''n'' sets, also known as an ''n''-fold Cartesian product, which can be represented by an ''n''-dimensional array, where each element is an ''n''-
tuple
In mathematics, a tuple is a finite ordered list (sequence) of elements. An -tuple is a sequence (or ordered list) of elements, where is a non-negative integer. There is only one 0-tuple, referred to as ''the empty tuple''. An -tuple is defi ...
. An ordered pair is a
2-tuple or couple. More generally still, one can define the Cartesian product of an
indexed family of sets.
The Cartesian product is named after
René Descartes
René Descartes ( or ; ; Latinized: Renatus Cartesius; 31 March 1596 – 11 February 1650) was a French philosopher, scientist, and mathematician, widely considered a seminal figure in the emergence of modern philosophy and science. Mathe ...
, whose formulation of
analytic geometry gave rise to the concept, which is further generalized in terms of
direct product.
Examples
A deck of cards

An illustrative example is the
standard 52-card deck. The
standard playing card ranks form a 13-element set. The card suits form a four-element set. The Cartesian product of these sets returns a 52-element set consisting of 52
ordered pairs, which correspond to all 52 possible playing cards.
returns a set of the form .
returns a set of the form .
These two sets are distinct, even
disjoint, but there is a natural
bijection between them, under which (3, ♣) corresponds to (♣, 3) and so on.
A two-dimensional coordinate system

The main historical example is the
Cartesian plane in
analytic geometry. In order to represent geometrical shapes in a numerical way, and extract numerical information from shapes' numerical representations,
René Descartes
René Descartes ( or ; ; Latinized: Renatus Cartesius; 31 March 1596 – 11 February 1650) was a French philosopher, scientist, and mathematician, widely considered a seminal figure in the emergence of modern philosophy and science. Mathe ...
assigned to each point in the plane a pair of
real number
In mathematics, a real number is a number that can be used to measurement, measure a ''continuous'' one-dimensional quantity such as a distance, time, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small var ...
s, called its
coordinates. Usually, such a pair's first and second components are called its ''x'' and ''y'' coordinates, respectively (see picture). The set of all such pairs (i.e., the Cartesian product , with ℝ denoting the real numbers) is thus assigned to the set of all points in the plane.
Most common implementation (set theory)
A formal definition of the Cartesian product from
set-theoretical principles follows from a definition of
ordered pair. The most common definition of ordered pairs,
Kuratowski's definition, is
. Under this definition,
is an element of
, and
is a subset of that set, where
represents the
power set operator. Therefore, the existence of the Cartesian product of any two sets in
ZFC follows from the axioms of
pairing,
union,
power set, and
specification. Since
functions are usually defined as a special case of
relations
Relation or relations may refer to:
General uses
*International relations, the study of interconnection of politics, economics, and law on a global level
*Interpersonal relationship, association or acquaintance between two or more people
*Public ...
, and relations are usually defined as subsets of the Cartesian product, the definition of the two-set Cartesian product is necessarily prior to most other definitions.
Non-commutativity and non-associativity
Let ''A'', ''B'', ''C'', and ''D'' be sets.
The Cartesian product is not
commutative,
:
because the
ordered pairs are reversed unless at least one of the following conditions is satisfied:
* ''A'' is equal to ''B'', or
* ''A'' or ''B'' is the
empty set.
For example:
: ''A'' = ; ''B'' =
:: ''A'' × ''B'' = × =
:: ''B'' × ''A'' = × =
: ''A'' = ''B'' =
:: ''A'' × ''B'' = ''B'' × ''A'' = × =
: ''A'' = ; ''B'' = ∅
:: ''A'' × ''B'' = × ∅ = ∅
:: ''B'' × ''A'' = ∅ × = ∅
Strictly speaking, the Cartesian product is not
associative (unless one of the involved sets is empty).
:
If for example ''A'' = , then .
Intersections, unions, and subsets
The Cartesian product satisfies the following property with respect to
intersections
In mathematics, the intersection of two or more objects is another object consisting of everything that is contained in all of the objects simultaneously. For example, in Euclidean geometry, when two lines in a plane are not parallel, their ...
(see middle picture).
:
In most cases, the above statement is not true if we replace intersection with
union (see rightmost picture).
In fact, we have that: