Cartesian Products
How can we build the coordinate plane out of nothing but sets? A point in is a pair of real numbers. But "pair" is not itself a primitive notion in set theory. It has to be manufactured from sets we already trust. Once we know how to encode an ordered pair so that exactly when and , a natural question follows. Given two sets and , what is the set of all ordered pairs with first coordinate in and second coordinate in ? This set is the Cartesian product . It is named after René Descartes, whose coordinate geometry made the pairing of numbers into a picture worth living in. The Cartesian product matters because it is the algebraic engine behind relations and functions. A function is nothing more than a special subset of . A relation on a set is a subset of . A graph, a group action, an equivalence — all of these are dressed-up subsets of a Cartesian product. Without a rigorous product construction, none of these ideas has a home in pure set theory. This article treats the product as an object built from sets we already have. It proves that it exists as a set, not just a "collection." It also works out the exact identities that let you distribute products over unions and intersections. The big picture is that Cartesian products give us a systematic way to combine sets into structured, ordered collections. This is the first genuinely two-dimensional construction in the whole hierarchy of set-building tools. After pairing, union, and power set, the product is the tool that lets sets talk about position and coordinates. It generalizes smoothly to finite tuples of arbitrary length. With more delicate machinery involving the Axiom of Choice, it also extends to products of infinitely many sets at once. This article gives the precise definition of and of -tuples. It proves that is a legitimate set under the axioms of set theory. It establishes the core distributive identities relating products to unions and intersections. It works through concrete numerical examples to make every identity tangible. It closes by placing the Cartesian product in its proper context. There, it serves as a stepping stone toward relations, functions, and eventually the Axiom of Choice.
- is the set of all ordered pairs with and ; it is proved to be a genuine set using Power Set and Separation.
- generally differs from , and for finite sets.
- Products distribute over unions and intersections: , and likewise for , on both the left and the right factor.
- Ordered -tuples are built recursively from ordered pairs, e.g. , giving .
- The product does not distribute nicely over set difference in a naive symmetric way without care, and for every .
- Key idea: the Cartesian product turns two sets into one new set of ordered, structured pairs, and it is the raw material out of which relations and functions are defined.
Where this lives today
Cartesian products are the silent scaffolding underneath enormous swaths of mathematics and its applications. In pure mathematics, every relation is by definition a subset of a Cartesian product (or ), and every function is identified with its graph, a special subset of in which each first coordinate appears exactly once — this is the standard route by which functions are given a fully set-theoretic definition, building directly on the material here. In topology, the product topology on is built from the Cartesian product of the underlying sets, equipped with a basis generated from open sets in each factor; in linear algebra, itself is (as a set) the -fold product , with vector addition and scalar multiplication added on top. In computer science and databases, the relational model represents a database table as a subset of a Cartesian product of "domains" (columns), and the SQL `CROSS JOIN` operation literally computes a Cartesian product of two tables. In probability theory, the product sample space for two independent experiments is the Cartesian product of the two individual sample spaces, and product measures are built by extending measures compatibly across such products. In cryptography and coding theory, product constructions (e.g. product codes, where a message array is encoded by treating rows and columns as independent codewords) exploit exactly the "grid" structure of pictured in the figure above. Finally, generalizing the product to infinitely many factors — the product of a possibly infinite family of sets — requires selecting one element from each factor simultaneously, and proving this can always be done for arbitrary nonempty is precisely the content of the Axiom of Choice, one of the deepest and most consequential axioms among the axioms of set theory.
Ask the tutor: How does the definition of a function as a special subset of connect to the Axiom of Choice when we need to pick one output for every input across an infinite domain?
Let and be sets, and recall the Kuratowski definition of the ordered pair,
which satisfies the fundamental property . The Cartesian product of and is the set
More generally, an ordered -tuple () is defined recursively by
and the -fold Cartesian product of sets is
When all factors equal a single set , we write for ( copies).
Intuition
Think of as a set of row-labels and as a set of column-labels. The product is the entire grid of cells you get by choosing one label from each: it is exactly the abstract version of a multiplication table or a coordinate grid. If and , then has six elements, one for every cell of a grid — and this is no coincidence, since for finite sets, which is why the construction is called a "product" at all. The order matters. The pair lives in , but does not — it isn't even well-formed as an element of unless and as well. This asymmetry is the entire point: a Cartesian product remembers which coordinate came from which set, and this is exactly the structure needed to define a function's graph, since a function must assign to each input exactly one output, and the graph is a very particular kind of subset of the product where each first coordinate appears only once.
Why A × B is a legitimate set
Before proving identities about , we must confirm it deserves to be called a set at all — the defining formula "" is not automatically a set by naive comprehension; in ZFC, unrestricted comprehension is forbidden (it leads to Russell's paradox), so we must show can be carved out, via the Axiom of Separation, from some set we already know to exist.
For any sets and , the collection
is a set. That is, its existence follows from the axioms of Pairing, Union, Power Set, and Separation (equivalently, Replacement).
We use the Kuratowski encoding , and we show that every such pair, for and , is an element of ; Separation then extracts exactly the pairs we want from this larger set.
Step 1 (Pairing and Union give ). By the Axiom of Union applied to (which exists by Pairing), the set exists.
Step 2 (elements of pairs lie in ). If and , then and . By Pairing, and are sets, and both are subsets of (a subset need not be a proper subset): since , and since .
Step 3 (pairs of subsets lie in the power set). By the definition of power set, means precisely . So Step 2 gives
Step 4 (the pair itself lies in a further power set). Since and are both elements of , the set (which exists by Pairing again) is a subset of . Hence
Step 5 (Separation extracts the product). Let , which is a set by two applications of the Power Set axiom. By Step 4, every ordered pair with , is an element of . By the Axiom of Separation, applied to with the formula
the collection
is a set. (Here abbreviates the formula asserting that is the Kuratowski pair of and , which is expressible purely in terms of and , so is a legitimate first-order formula and Separation applies.) This establishes as a set, and it consists exactly of those satisfying , i.e. exactly the pairs with , , as required.
∎For any sets (), the -fold product exists as a set.
By induction on , using the recursive definition . Base case : this is exactly the Theorem above. Inductive step: suppose exists as a set (inductive hypothesis). Let . By the Theorem applied to the sets and , the product exists as a set. By definition,
which is a set by the case just handled. This completes the induction.
∎The core identities
We now record and prove the identities relating to and . Throughout, denote arbitrary sets.
For all sets : 1. . 2. . 3. . 4. . 5. . 6. If and , then .
Each set identity is proved by mutual inclusion, i.e. by showing both directions of using the extensionality of sets: two sets are equal iff they have the same elements. Throughout, we repeatedly use the defining property of the Cartesian product: , which follows immediately from the Kuratowski definition and the Theorem above.
(1) . Let be an arbitrary element. We show . Since every element of a Cartesian product is an ordered pair, write where a priori ranges over the union 's "first-coordinate slot" and over 's slot — more carefully, we reason with the biconditional chain:
Every element of has the form with , and this chain applies to it, and conversely every element of is such a pair too, so the two sets have exactly the same elements. By the Axiom of Extensionality, the two sets are equal.
(2) . Identical strategy, replacing with and using distributivity of over (trivial) — more precisely:
As before, extensionality yields equality of the two sets.
(3) . Symmetric to (1), distributing on the first coordinate:
(4) . Symmetric to (2):
(5) (and symmetrically ). Suppose, for contradiction, . Then there exists , so with and . But has no elements, so is false — contradiction. Hence no such exists, i.e. . The same argument with the roles of coordinates swapped gives .
(6) Monotonicity: if and then . Let be arbitrary. Then and by definition of . Since , implies . Since , implies . Hence and , so by definition of . As was an arbitrary element of , this shows .
∎Note that the proof technique used throughout is extensionality-based double inclusion together with propositional logic: each product identity is reduced, via the defining biconditional for , to a corresponding tautology of first-order/propositional logic ( distributing over , and idempotence of ). This is non-circular: it uses only the definitions of and elementary logic, never any theorem depending on the result being proved.
Worked examples
Example 1 (a genuinely asymmetric numeric check). Let
We verify identity (1), , by brute enumeration — this is a completeness check on the proof, not a substitute for it. First, . So
has elements:
Next compute the two pieces on the right side. We have
Their union is
Taking the union means listing each pair once even though and appear in both sets (since ). The result is
which has exactly elements (, matching by inclusion–exclusion since are shared). Comparing element-by-element with computed above, the two sets are identical. This confirms identity (1) concretely and, importantly, shows the union operation must correctly merge the overlap coming from — a feature a careless symmetric example (say ) would never expose.
Example 2 (intersection identity with a genuinely nonempty but non-trivial overlap, and a 3-tuple check). Let
We verify identity (2), . Since ,
a set of pairs. Now compute both large products:
Intersecting these two 9-element sets keeps exactly the pairs appearing in both lists — that is, pairs with :
which is exactly , confirming the identity with matching elements on each side (not , illustrating that intersecting the products is strictly smaller than either factor product, as it must be since ). As a bonus, we build a genuine -tuple example to illustrate the recursive tuple definition. Take , , . Then
First , a -element set. Then
and by the recursive definition, , and so on, giving the expected
with elements, exactly matching .
The theorem above proves distributivity of over and with the first (or second) factor held fixed. One might be tempted to conjecture a similarly clean identity mixing different factors on both sides, such as the false claim:
This drops the "one factor is held fixed" structure of the genuine identities and replaces it with an unjustified guess about how products interact with subtraction across both coordinates simultaneously. It is false in general.
Concrete counterexample. Let
Compute the left side:
So
a set with 3 elements. Now compute the right side:
so
a set with only 1 element. Since (they don't even have the same cardinality, ), the conjectured identity fails. The correct statement, which is provable exactly as in the Theorem, is only the one-sided version with a common factor, e.g.
which holds by the same double-inclusion technique used above (the reader can verify this using and distributing over the resulting conjunction). The failure of the two-sided guess shows precisely why the hypothesis "one factor is shared" in the genuine distributive laws cannot be dropped or replaced by "corresponding operation on each factor separately."
Scope, edge cases & common traps
| Situation | What holds | What fails / must be checked |
|---|---|---|
| ; identities specialize but reveal nothing new | Don't use as your only test case — it hides ordering bugs | |
| One factor empty | for every , even | implies or (converse of the above) |
| Commutativity | none in general: unless or one is empty | Never assume ; only true if |
| Associativity | as sets (different element shapes) | Usually identified "up to relabeling," but not literally equal — this is why tuples are defined recursively rather than via a single flattening axiom |
| Distributing over (difference) | holds with a shared factor | Mixing all four sets independently, as in the counterexample, fails |
| Infinite index sets | Finite products extend to arbitrary products | Existence of a choice function selecting one element from each nonempty needs the Axiom of Choice when is infinite |
The mathematician behind it
Origins · 1 minRené Descartes and how this was discovered
Descartes was a French philosopher and mathematician whose La Géométrie (1637) introduced the systematic use of coordinates to translate geometric problems into algebraic ones — and vice versa. By representing a point in the plane as an ordered pair of numbers, and a curve as an equation relating those numbers, Descartes fused geometry and algebra into what we now call analytic geometry. The set-theoretic Cartesian product is the direct abstract descendant of his coordinate idea: instead of pairs of real numbers specifically, we allow pairs drawn from any two sets whatsoever, with the ordered pair itself later given a rigorous foundation by Kuratowski in the 20th century.
Is the same set as ?
No, not in general. Elements of are pairs with , , while elements of are pairs with , . If , then as ordered pairs (this is exactly the content of the Kuratowski property ), so unless or one of is empty, and contain genuinely different elements and are unequal sets. There is, however, always a natural bijection sending , so the two products are equal in cardinality but not as literal sets.
Why isn't literally the same set as ?
Because the Kuratowski encoding makes an element of have the shape , while an element of has the shape — these are different sets as raw objects (one has an ordered pair as first coordinate, the other has one as second coordinate). They are naturally in bijection via , and in practice mathematicians identify them "up to relabeling" and just write . But the definition of the -tuple given in this article resolves the ambiguity by fixing a specific convention: nest pairs from the left, i.e. , so that is unambiguous as a literal set.
Does imply ?
Only if . If is nonempty, pick any ; then for any , (using the defining biconditional for twice), so by extensionality. But if , then for every and whatsoever (by identity (5) in the Theorem), so the implication fails completely — and can be wildly different sets while both trivially equal .
How does the Cartesian product relate to functions and relations?
A relation from to is defined to be any subset ; writing is shorthand for . A function is then defined as a relation satisfying two extra conditions: for every there exists some with (totality), and if and then (single-valuedness). This is exactly how "function" is reduced to pure set theory: the familiar notation is just shorthand for . So every relation and every function is, by definition, a particular kind of subset of a Cartesian product, making the ambient universe in which all such structures live.
Why does the Axiom of Choice become relevant for infinite Cartesian products?
For finitely many sets, one can always explicitly construct an element of (assuming each nonempty) just by picking elements one at a time — finitely many choices require no special axiom. For an infinite family , the product is defined as the set of functions with domain such that for every — essentially "infinite tuples." Showing this product is nonempty whenever every is nonempty requires simultaneously selecting one element from each of possibly infinitely many sets with no explicit rule for doing so, and this is precisely the assertion of the Axiom of Choice. In fact "the infinite product of nonempty sets is nonempty" is one of the standard equivalent formulations of the Axiom of Choice itself.
Is the empty set ever an element of A × B?
Yes, this is possible and unrelated to whether itself is empty. If (i.e. happens to be an element of , as can occur since sets can contain other sets, including ) and is nonempty, say , then is a perfectly good, non-empty element of ; note this ordered pair itself is not the empty set (it has two elements, or one if , which happens iff ). The set is empty as a whole if and only if or , by identity (5) of the Theorem together with its converse (proved via contraposition: if both are nonempty, pick , then , so ).