The Cartesian product is a construction in set theory that combines sets by forming all ordered selections of their elements. For two sets and , it is written and consists of every ordered pair with and . The construction extends to finite lists and arbitrary indexed families of sets. Unlike numerical multiplication, its result is a set whose elements retain their coordinate positions. (homepages.ucl.ac.uk)
Definition and examples
Formally,
The defining property of ordered pairs is
Thus order matters within each pair, although the order in which the pairs are listed does not matter. Coordinates may be numbers, symbols, sets, or other mathematical objects. (homepages.ucl.ac.uk)
For example, if and , then
Each element of is paired with every element of , so the product has six elements. The factors need not be disjoint, and repeated coordinates are permitted: belongs to . (math.libretexts.org)
In geometry, the product of the real numbers with themselves,
provides the coordinate representation of the plane. More generally, , equipped with its usual geometric structure, represents -dimensional Euclidean space. (math.libretexts.org)
Basic properties
If either factor is the empty set, the product is empty:
Conversely, two nonempty factors have a nonempty product, since choosing one element from each produces an ordered pair. (math.unm.edu)
Cartesian products are not generally commutative as literal sets: need not equal . Nevertheless, coordinate reversal,
is a bijection between them. Similarly, and contain differently nested pairs, but the reassociation map
is a natural bijection. Mathematical notation often suppresses these distinctions by identifying both with ordered triples. (math.cmu.edu)
Products distribute over union and intersection in either coordinate. For example,
These identities follow by checking coordinate membership. (math.libretexts.org)
For finite sets, the cardinality satisfies
There are possible second coordinates for each of the first coordinates. This is an instance of the multiplication principle in combinatorics. (homepages.ucl.ac.uk)
Finite and indexed products
For sets , the finite product is
Its elements are ordered tuples. When all factors are the same set , the notation is customary. If the factors are finite, their cardinalities multiply. (math.unm.edu)
For an arbitrary index set , a product element is described as a function selecting one coordinate from each factor:
This definition accommodates infinite families without requiring a finite tuple notation. When is empty, there is exactly one such function—the empty function—so the empty product is a singleton. (public.csusm.edu)
A finite product of nonempty sets is nonempty without any additional choice principle. For arbitrary families, the assertion that every product of nonempty sets is nonempty is equivalent, in Zermelo–Fraenkel set theory, to the axiom of choice. (math.uwaterloo.ca)
Relations, functions, and projections
A binary relation from to is a subset of : it specifies which pairs satisfy a particular condition. A function has a graph
with exactly one output paired with each input. Cartesian products therefore supply the ambient sets used to describe relations and function graphs. (math.cmu.edu)
The coordinate projections are
They express a universal property: given functions and , there is a unique function
such that and , where denotes function composition. This characterizes the product through its relationship with maps into the factors. (public.csusm.edu)
Additional structures and computing
For topological spaces, the Cartesian product of the underlying sets carries the product topology. In a finite product, products of open sets form a basis. For an infinite product, basic open sets restrict only finitely many coordinates, leaving every other coordinate unrestricted. The underlying set construction and the topology placed on it are distinct ingredients. (public.csusm.edu)
In a relational database, a cross join implements a Cartesian product of rows. An SQL expression such as T1 CROSS JOIN T2 combines every row of the first table with every row of the second, retaining the columns from both. If the tables contain and rows, the result contains rows before filtering. SQL tables may retain duplicate rows, so this operation follows SQL’s row semantics rather than necessarily behaving as a duplicate-free mathematical set. (postgresql.org)