Cartesian product


In mathematics, specifically set theory, the Cartesian product of two sets and, denoted, is the set of all ordered pairs where is an element of and is an element of. 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 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, whose formulation of analytic geometry gave rise to the concept, which is further generalized in terms of direct product.

Set-theoretic definition

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 and, with the typical Kuratowski's definition of a pair as, an appropriate domain is the set where denotes the power set. Then the Cartesian product of the sets and would be defined as

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 corresponds to 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 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. The set of all such pairs 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, 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,, and be sets.
The Cartesian product is not commutative,
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.
If for example, then .

Intersections, unions, and subsets

The Cartesian product satisfies the following property with respect to intersections.
In most cases, the above statement is not true if we replace intersection with union.
In fact, we have that:
For the set difference, we also have the following identity:
Here are some rules demonstrating distributivity with other operators :
where denotes the absolute complement of.
Other properties related with subsets are:

Cardinality

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,
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.

Cartesian products of several sets

''n''-ary Cartesian product

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

Cartesian ''n''th power

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.
The Cartesian th power of a set, denoted, can be defined as
An example of this is, with again the set of real numbers, and more generally.
The Cartesian th power of a set may be identified with the set of the functions mapping to the -tuples of elements of. As a special case, the Cartesian 0th power of is the singleton set, that has the empty function with codomain as its unique element.

Intersections, unions, complements and subsets

Let Cartesian products be given
and. Then
  1. , if and only if for all ;
  2. , at the same time, if there exists at least one such that, then ;
  3. , moreover, equality is possible only in the following cases:
  4. # or ;
  5. # for all except for one from.
  6. The complement of a Cartesian product can be calculated, if a universe is defined. To simplify the expressions, we introduce the following notation. Let us denote the Cartesian product as a tuple bounded by square brackets; this tuple includes the sets from which the Cartesian product is formed, e.g.:
In n-tuple algebra, such a matrix-like representation of Cartesian products is called a C-n-tuple.
With this in mind, the union of some Cartesian products given in the same universe can be expressed as a matrix bounded by square brackets, in which the rows represent the Cartesian products involved in the union:
Such a structure is called a C-system in NTA.
Then the complement of the Cartesian product will look like the following C-system expressed as a matrix of the dimension :
The diagonal components of this matrix are equal correspondingly to.
In NTA, a diagonal C-system, that represents the complement of a C-n-tuple, can be written concisely as a tuple of diagonal components bounded by inverted square brackets:
This structure is called a D-n-tuple. Then the complement of the C-system is a structure, represented by a matrix of the same dimension and bounded by inverted square brackets, in which all components are equal to the complements of the components of the initial matrix. Such a structure is called a D-system and is calculated, if necessary, as the intersection of the D-n-tuples contained in it. For instance, if the following C-system is given:
then its complement will be the D-system
Let us consider some new relations for structures with Cartesian products obtained in the process of studying the properties of NTA. The structures defined in the same universe are called homotypic ones.
  1. The intersection of C-systems. Assume the homotypic C-systems are given and. Their intersection will yield a C-system containing all non-empty intersections of each C-n-tuple from with each C-n-tuple from.
  2. Checking the inclusion of a C-n-tuple into a D-n-tuple. For the C-n-tuple and the D-n-tuple holds, if and only if, at least for one holds.
  3. Checking the inclusion of a C-n-tuple into a D-system. For the C-n-tuple and the D-system is true, if and only if, for every D-n-tuple from holds.

    Infinite Cartesian products

It is possible to define the Cartesian product of an arbitrary indexed family of sets. If is any index set, and is a family of sets indexed by, then the Cartesian product of the sets in is defined to be
that is, the set of all functions defined on the index set such that the value of the function at a particular index is an element of Xi. 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. may also be denoted.
For each in, the function
defined by is called the -th projection map.
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, the natural numbers: this Cartesian product is the set of all infinite sequences with the -th term in its corresponding set Xi. For example, each element of
can be visualized as a vector with countably infinite real number components. This set is frequently denoted, or.

Other forms

Abbreviated form

If several sets are being multiplied together, then some authors choose to abbreviate the Cartesian product as simply.