In mathematics, specifically set theory, the Cartesian product of two sets and, denoted, is the set of all ordered pairs where is in and is in . In terms of set-builder notation, that is[1] [2]
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 .[3]
One can similarly define the Cartesian product of sets, also known as an -fold Cartesian product, which can be represented by an -dimensional array, where each element is an -tuple. 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,[4] whose formulation of analytic geometry gave rise to the concept, which is further generalized in terms of direct product.
A rigorous definition of the Cartesian product requires a domain to be specified in the set-builder notation. In this case the domain would have to contain the Cartesian product itself. For defining the Cartesian product of the sets
A
B
(a,b)
\{\{a\},\{a,b\}\}
l{P}(l{P}(A\cupB))
l{P}
A
B
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.
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 assigned to each point in the plane a pair of real numbers, called its coordinates. Usually, such a pair's first and second components are called its and coordinates, respectively (see picture). The set of all such pairs (i.e., the Cartesian product
\R x \R
\R
See main article: article and Implementation of mathematics in 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
(x,y)=\{\{x\},\{x,y\}\}
(x,y)
l{P}(l{P}(X\cupY))
X x Y
l{P}
Let,,, and be sets.
The Cartesian product is not commutative,[3] because the ordered pairs are reversed unless at least one of the following conditions is satisfied:
For example:
;
Strictly speaking, the Cartesian product is not associative (unless one of the involved sets is empty).If for example, then .
See also: List of set identities and relations.
The Cartesian product satisfies the following property with respect to intersections (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:
For the set difference, we also have the following identity:
Here are some rules demonstrating distributivity with other operators (see leftmost picture):[7] where
A\complement
Other properties related with subsets are:
The cardinality of a set is the number of elements of the set. For example, defining two sets: and . Both set and set consist of two elements each. Their Cartesian product, written as, results in a new set which has the following elements:
.
where each element of is paired with each element of, and where each pair makes up one element of the output set.The number of values in each element of the resulting set is equal to the number of sets whose Cartesian product is being taken; 2 in this case.The cardinality of the output set is equal to the product of the cardinalities of all the input sets. That is,
.[3] In this case,
Similarly,
and so on.
The set is infinite if either or is infinite, and the other set is not the empty set.[9]
The Cartesian product can be generalized to the -ary Cartesian product over sets as the set
of -tuples. If tuples are defined as nested ordered pairs, it can be identified with . If a tuple is defined as a function on that takes its value at to be the -th element of the tuple, then the Cartesian product is the set of functions
The Cartesian square of a set is the Cartesian product .An example is the 2-dimensional plane where is the set of real numbers: is the set of all points where and are real numbers (see the Cartesian coordinate system).
The -ary Cartesian power of a set, denoted
Xn
An example of this is, with again the set of real numbers, and more generally .
The -ary Cartesian power of a set is isomorphic to the space of functions from an -element set to . As a special case, the 0-ary Cartesian power of may be taken to be a singleton set, corresponding to the empty function with codomain .
See main article: Direct product.
It is possible to define the Cartesian product of an arbitrary (possibly infinite) indexed family of sets. If is any index set, and
\{Xi\}i\in
\{Xi\}i\in
\prodi\inXi
X
{}i\inXi
For each in, the functiondefined by
\pij(f)=f(j)
Cartesian power is a Cartesian product where all the factors Xi are the same set . In this case,is the set of all functions from to, and is frequently denoted XI. This case is important in the study of cardinal exponentiation. An important special case is when the index set is
N
R\omega
RN
If several sets are being multiplied together (e.g.,), then some authors[11] choose to abbreviate the Cartesian product as simply .
If is a function from to and is a function from to, then their Cartesian product is a function from to with
This can be extended to tuples and infinite collections of functions.This is different from the standard Cartesian product of functions considered as sets.
Let
A
B\subseteqA
B
A
B x A
B
A
Normally,
A
B
N
B
B x N
Although the Cartesian product is traditionally applied to sets, category theory provides a more general interpretation of the product of mathematical structures. This is distinct from, although related to, the notion of a Cartesian square in category theory, which is a generalization of the fiber product.
Exponentiation is the right adjoint of the Cartesian product; thus any category with a Cartesian product (and a final object) is a Cartesian closed category.
In graph theory, the Cartesian product of two graphs and is the graph denoted by, whose vertex set is the (ordinary) Cartesian product and such that two vertices and are adjacent in, if and only if and is adjacent with ′ in, or and is adjacent with ′ in . The Cartesian product of graphs is not a product in the sense of category theory. Instead, the categorical product is known as the tensor product of graphs.