In mathematics, specifically set theory, the Cartesian product of two sets A and B, denoted A × B, is the set of all ordered pairs (a, b) where a is an element of A and b is an element of B. In terms of set-builder notation, that is A×B={(a,b)∣a∈A and b∈B}. A table can be created by taking the Cartesian product of a set of rows and a set of columns. If the Cartesian product rows × columns is taken, the cells of the table contain ordered pairs of the form (row value, column value). 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. 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 A and B, with the typical Kuratowski's definition of a pair (a,b) as {{a},{a,b}}, an appropriate domain is the set 𝒫(𝒫(A∪B)) where 𝒫 denotes the power set. Then the Cartesian product of the sets A and B would be defined as A×B={x∈𝒫(𝒫(A∪B))∣∃a∈A ∃b∈B:x=(a,b)}.
Examples
A deck of cards
An illustrative example is the standard 52-card deck. 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. The Cartesian product of these sets returns a 52-element set consisting of 52 ordered pairs, which correspond to all 52 possible playing cards. Ranks × Suits returns a set of the form {(A, ♠), (A, ♥), (A, ♦), (A, ♣), (K, ♠), ..., (3, ♣), (2, ♠), (2, ♥), (2, ♦), (2, ♣)}. Suits × Ranks returns a set of the form {(♠, A), (♠, K), (♠, Q), (♠, J), (♠, 10), ..., (♣, 6), (♣, 5), (♣, 4), (♣, 3), (♣, 2)}. 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 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). 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 (x,y)={{x},{x,y}}. Under this definition, (x,y) is an element of 𝒫(𝒫(X∪Y)), and X×Y 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 A, B, and C be sets. The Cartesian product A × B is not commutative, A×B≠B×A, 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 = {1,2}; B = {3,4} A × B = {1,2} × {3,4} = {(1,3), (1,4), (2,3), (2,4)} B × A = {3,4} × {1,2} = {(3,1), (3,2), (4,1), (4,2)} A = B = {1,2} A × B = B × A = {1,2} × {1,2} = {(1,1), (1,2), (2,1), (2,2)} A = {1,2}; B = ∅ A × B = {1,2} × ∅ = ∅ B × A = ∅ × {1,2} = ∅ Strictly speaking, the Cartesian product is not associative (unless one of the involved sets is empty). (A×B)×C≠A×(B×C) If for example A = {1}, then (A × A) × A = {((1, 1), 1)} ≠ {(1, (1, 1))} = A × (A × A).
Intersections, unions, and subsets
The Cartesian product satisfies the following property with respect to intersections (see middle picture). (A∩B)×(C∩D)=(A×C)∩(B×D) In most cases, the above statement is not true if we replace intersection with union (see rightmost picture). (A∪B)×(C∪D)≠(A×C)∪(B×D) In fact, we have that: (A×C)∪(B×D)=[(A∖B)×C]∪[(A∩B)×(C∪D)]∪[(B∖A)×D] For the set difference, we also have the following identity: (A×C)∖(B×D)=[A×(C∖D)]∪[(A∖B)×C] Here are some rules demonstrating distributivity with other operators (see leftmost picture):
A×(B∩C)=(A×B)∩(A×C),A×(B∪C)=(A×B)∪(A×C),A×(B∖C)=(A×B)∖(A×C), (A×B)∁=(A∁×B∁)∪(A∁×B)∪(A×B∁), where A∁ denotes the absolute complement of A. Other properties related with subsets are:
if A⊆B, then A×C⊆B×C; if both A,B≠∅︀, then A×B⊆C×D⟺A⊆C and B⊆D.
Cardinality
The cardinality of a set is the number of elements of the set. For example, defining two sets: A = {a, b} and B = {5, 6}. Both set A and set B consist of two elements each. Their Cartesian product, written as A × B, results in a new set which has the following elements:
A × B = {(a,5), (a,6), (b,5), (b,6)}. where each element of A is paired with each element of B, 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,
|A × B| = |A| · |B|. In this case, |A × B| = 4 Similarly,
|A × B × C| = |A| · |B| · |C| and so on. The set A × B is infinite if either A or B is infinite, and the other set is not the empty set.
Cartesian products of several sets
… excerpt ends here. Continue reading the full article.





