Cartesian product

If the Cartesian product rows × columns is taken, the cells of the table contain ordered pairs of the form (row value, column value).

[4] 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.

More generally still, one can define the Cartesian product of an indexed family of sets.

The Cartesian product is named after René Descartes,[5] 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.

The standard playing card ranks {A, K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3, 2} form a 13-element set.

The card suits {♠, ♥, ♦, ♣} form a four-element set.

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 x and y coordinates, respectively (see picture).

denoting the real numbers) is thus assigned to the set of all points in the plane.

Since functions are usually defined as a special case of relations, 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.

[4] because the ordered pairs are reversed unless at least one of the following conditions is satisfied:[8] For example: Strictly speaking, the Cartesian product is not associative (unless one of the involved sets is empty).

C = [1,3], D = [2,4], demonstrating 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).

Here are some rules demonstrating distributivity with other operators (see leftmost picture):[8]

If tuples are defined as nested ordered pairs, it can be identified with (X1 × ... × Xn−1) × Xn.

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 X1 × ... × Xn is the set of functions

An example of this is R3 = R × R × R, with R again the set of real numbers,[1] and more generally Rn.

As a special case, the 0-ary Cartesian power of X may be taken to be a singleton set, corresponding to the empty function with codomain X.

Even if each of the Xi is nonempty, the Cartesian product may be empty if the axiom of choice, which is equivalent to the statement that every such product is nonempty, is not assumed.

is the set of all functions from I to X, 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

can be visualized as a vector with countably infinite real number components.

If several sets are being multiplied together (e.g., X1, X2, X3, ...), then some authors[12] choose to abbreviate the Cartesian product as simply ×Xi.

This can be extended to tuples and infinite collections of functions.

This is different from the standard Cartesian product of functions considered as sets.

This is distinct from, although related to, the notion of a Cartesian square in category theory, which is a generalization of the fiber product.

Cartesian product of the sets { x , y , z } and {1,2,3}
Standard 52-card deck
Cartesian coordinates of example points