Cartesian Products

How can we build the coordinate plane out of nothing but sets? A point in R2\mathbb{R}^2 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 (a,b)(a,b) so that (a,b)=(c,d)(a,b) = (c,d) exactly when a=ca=c and b=db=d, a natural question follows. Given two sets AA and BB, what is the set of all ordered pairs with first coordinate in AA and second coordinate in BB? This set is the Cartesian product A×BA \times B. 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 f:A→Bf : A \to B is nothing more than a special subset of A×BA \times B. A relation on a set is a subset of A×AA \times A. 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 A×BA \times B and of nn-tuples. It proves that A×BA \times B 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.

Key takeaways
  • A×BA \times B is the set of all ordered pairs (a,b)(a,b) with a∈Aa \in A and b∈Bb \in B; it is proved to be a genuine set using Power Set and Separation.
  • A×BA \times B generally differs from B×AB \times A, and ∣A×B∣=∣A∣⋅∣B∣|A \times B| = |A|\cdot|B| for finite sets.
  • Products distribute over unions and intersections: A×(B∪C)=(A×B)∪(A×C)A \times (B \cup C) = (A\times B)\cup(A\times C), and likewise for ∩\cap, on both the left and the right factor.
  • Ordered nn-tuples are built recursively from ordered pairs, e.g. (a,b,c):=((a,b),c)(a,b,c) := ((a,b),c), giving A1×A2×⋯×AnA_1\times A_2\times \cdots \times A_n.
  • The product does not distribute nicely over set difference in a naive symmetric way without care, and A×∅=∅A\times\varnothing = \varnothing for every AA.
  • 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 A×BA\times B (or A×AA\times A), and every function f:A→Bf:A\to B is identified with its graph, a special subset of A×BA\times B 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 X×YX \times Y is built from the Cartesian product of the underlying sets, equipped with a basis generated from open sets in each factor; in linear algebra, Rn\mathbb{R}^n itself is (as a set) the nn-fold product R×⋯×R\mathbb{R}\times\cdots\times\mathbb{R}, 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 A×BA\times B pictured in the figure above. Finally, generalizing the product to infinitely many factors — the product ∏i∈IAi\prod_{i \in I} A_i 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 AiA_i 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 A×BA \times B connect to the Axiom of Choice when we need to pick one output for every input across an infinite domain?

DefinitionCartesian Product

Let AA and BB be sets, and recall the Kuratowski definition of the ordered pair,

(a,b):={{a},{a,b}},(a,b) := \{\{a\},\{a,b\}\},

which satisfies the fundamental property (a,b)=(c,d)  ⟺  a=c and b=d(a,b) = (c,d) \iff a = c \text{ and } b = d. The Cartesian product of AA and BB is the set

A×B:={ (a,b)∣a∈A and b∈B }.A \times B := \{\, (a,b) \mid a \in A \text{ and } b \in B \,\}.

More generally, an ordered nn-tuple (n≥1n \geq 1) is defined recursively by

(a1):=a1,(a1,…,an):=((a1,…,an−1), an) for n≥2,(a_1) := a_1, \qquad (a_1,\dots,a_n) := \big((a_1,\dots,a_{n-1}),\, a_n\big) \text{ for } n \geq 2,

and the nn-fold Cartesian product of sets A1,…,AnA_1,\dots,A_n is

A1×A2×⋯×An:={ (a1,…,an)∣ai∈Ai for each i=1,…,n }.A_1 \times A_2 \times \cdots \times A_n := \{\, (a_1,\dots,a_n) \mid a_i \in A_i \text{ for each } i = 1,\dots,n \,\}.

When all factors equal a single set AA, we write AnA^n for A×A×⋯×AA \times A \times \cdots \times A (nn copies).

Intuition

Think of AA as a set of row-labels and BB as a set of column-labels. The product A×BA \times B 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 A={1,2}A = \{1,2\} and B={x,y,z}B = \{x,y,z\}, then A×BA\times B has six elements, one for every cell of a 2×32\times 3 grid — and this is no coincidence, since ∣A×B∣=∣A∣⋅∣B∣|A\times B| = |A|\cdot|B| for finite sets, which is why the construction is called a "product" at all. The order matters. The pair (1,x)(1,x) lives in A×BA \times B, but (x,1)(x,1) does not — it isn't even well-formed as an element of A×BA\times B unless x∈Ax \in A and 1∈B1 \in B 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.

Figure
The grid picture of A × B for A = {1,2}, B = {x,y,z}
1 2 A x y z B (1,x) (2,x) (1,y) (2,y) (1,z) (2,z) A × B has |A|·|B| = 2·3 = 6 elements

Why A × B is a legitimate set

Before proving identities about A×BA\times B, we must confirm it deserves to be called a set at all — the defining formula "{(a,b)∣a∈A,b∈B}\{(a,b) \mid a\in A, b\in B\}" is not automatically a set by naive comprehension; in ZFC, unrestricted comprehension is forbidden (it leads to Russell's paradox), so we must show A×BA\times B can be carved out, via the Axiom of Separation, from some set we already know to exist.

TheoremExistence of the Cartesian Product

For any sets AA and BB, the collection

A×B={ (a,b)∣a∈A, b∈B }A \times B = \{\, (a,b) \mid a \in A,\ b \in B \,\}

is a set. That is, its existence follows from the axioms of Pairing, Union, Power Set, and Separation (equivalently, Replacement).

Proof

We use the Kuratowski encoding (a,b)={{a},{a,b}}(a,b) = \{\{a\},\{a,b\}\}, and we show that every such pair, for a∈Aa \in A and b∈Bb \in B, is an element of P(P(A∪B))\mathcal{P}(\mathcal{P}(A \cup B)); Separation then extracts exactly the pairs we want from this larger set.

Step 1 (Pairing and Union give A∪BA \cup B). By the Axiom of Union applied to {A,B}\{A,B\} (which exists by Pairing), the set A∪BA \cup B exists.

Step 2 (elements of pairs lie in A∪BA \cup B). If a∈Aa \in A and b∈Bb \in B, then a∈A∪Ba \in A \cup B and b∈A∪Bb \in A \cup B. By Pairing, {a}\{a\} and {a,b}\{a,b\} are sets, and both are subsets of A∪BA \cup B (a subset need not be a proper subset): {a}⊆A∪B\{a\} \subseteq A \cup B since a∈A∪Ba \in A \cup B, and {a,b}⊆A∪B\{a,b\} \subseteq A\cup B since a,b∈A∪Ba,b \in A \cup B.

Step 3 (pairs of subsets lie in the power set). By the definition of power set, X⊆A∪BX \subseteq A \cup B means precisely X∈P(A∪B)X \in \mathcal{P}(A \cup B). So Step 2 gives

{a}∈P(A∪B),{a,b}∈P(A∪B).\{a\} \in \mathcal{P}(A \cup B), \qquad \{a,b\} \in \mathcal{P}(A \cup B).

Step 4 (the pair itself lies in a further power set). Since {a}\{a\} and {a,b}\{a,b\} are both elements of P(A∪B)\mathcal{P}(A\cup B), the set {{a},{a,b}}\{\{a\},\{a,b\}\} (which exists by Pairing again) is a subset of P(A∪B)\mathcal{P}(A\cup B). Hence

(a,b)={{a},{a,b}}∈P(P(A∪B)).(a,b) = \{\{a\},\{a,b\}\} \in \mathcal{P}\big(\mathcal{P}(A \cup B)\big).

Step 5 (Separation extracts the product). Let U:=P(P(A∪B))U := \mathcal{P}(\mathcal{P}(A\cup B)), which is a set by two applications of the Power Set axiom. By Step 4, every ordered pair (a,b)(a,b) with a∈Aa \in A, b∈Bb \in B is an element of UU. By the Axiom of Separation, applied to UU with the formula

φ(p):≡∃a∃b (a∈A∧b∈B∧p=(a,b)),\varphi(p) :\equiv \exists a \exists b \,(a \in A \wedge b \in B \wedge p = (a,b)),

the collection

A×B={ p∈U∣φ(p) }A \times B = \{\, p \in U \mid \varphi(p) \,\}

is a set. (Here p=(a,b)p = (a,b) abbreviates the formula asserting that pp is the Kuratowski pair of aa and bb, which is expressible purely in terms of ∈\in and ==, so φ\varphi is a legitimate first-order formula and Separation applies.) This establishes A×BA \times B as a set, and it consists exactly of those p∈Up \in U satisfying φ\varphi, i.e. exactly the pairs (a,b)(a,b) with a∈Aa \in A, b∈Bb \in B, as required. ■\blacksquare

∎
CorollaryExistence of finite products and tuples

For any sets A1,…,AnA_1,\dots,A_n (n≥2n \geq 2), the nn-fold product A1×⋯×AnA_1 \times \cdots \times A_n exists as a set.

Proof

By induction on nn, using the recursive definition (a1,…,an)=((a1,…,an−1),an)(a_1,\dots,a_n) = ((a_1,\dots,a_{n-1}), a_n). Base case n=2n=2: this is exactly the Theorem above. Inductive step: suppose A1×⋯×An−1A_1 \times \cdots \times A_{n-1} exists as a set (inductive hypothesis). Let P:=A1×⋯×An−1P := A_1 \times \cdots \times A_{n-1}. By the Theorem applied to the sets PP and AnA_n, the product P×AnP \times A_n exists as a set. By definition,

A1×⋯×An={ ((a1,…,an−1),an)∣(a1,…,an−1)∈P, an∈An }=P×An,A_1 \times \cdots \times A_n = \{\, ((a_1,\dots,a_{n-1}), a_n) \mid (a_1,\dots,a_{n-1}) \in P,\ a_n \in A_n\,\} = P \times A_n,

which is a set by the case just handled. This completes the induction. ■\blacksquare

∎

The core identities

We now record and prove the identities relating ×\times to ∪\cup and ∩\cap. Throughout, A,B,CA, B, C denote arbitrary sets.

TheoremDistributivity of Cartesian Product over Union and Intersection

For all sets A,B,CA, B, C: 1. A×(B∪C)=(A×B)∪(A×C)A \times (B \cup C) = (A \times B) \cup (A \times C). 2. A×(B∩C)=(A×B)∩(A×C)A \times (B \cap C) = (A \times B) \cap (A \times C). 3. (A∪B)×C=(A×C)∪(B×C)(A \cup B) \times C = (A \times C) \cup (B \times C). 4. (A∩B)×C=(A×C)∩(B×C)(A \cap B) \times C = (A \times C) \cap (B \times C). 5. A×∅=∅×A=∅A \times \varnothing = \varnothing \times A = \varnothing. 6. If A⊆CA \subseteq C and B⊆DB \subseteq D, then A×B⊆C×DA \times B \subseteq C \times D.

Proof

Each set identity is proved by mutual inclusion, i.e. by showing both directions of ⊆\subseteq 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: (x,y)∈X×Y  ⟺  x∈X∧y∈Y(x,y) \in X \times Y \iff x \in X \wedge y \in Y, which follows immediately from the Kuratowski definition and the Theorem above.

(1) A×(B∪C)=(A×B)∪(A×C)A \times (B \cup C) = (A \times B) \cup (A \times C). Let pp be an arbitrary element. We show p∈A×(B∪C)  ⟺  p∈(A×B)∪(A×C)p \in A\times(B\cup C) \iff p \in (A\times B)\cup(A\times C). Since every element of a Cartesian product is an ordered pair, write p=(a,b)p = (a,b) where a priori aa ranges over the union AA's "first-coordinate slot" and bb over (B∪C)(B\cup C)'s slot — more carefully, we reason with the biconditional chain:

(a,y)∈A×(B∪C)  ⟺  a∈A ∧ y∈B∪C(defn. of ×)  ⟺  a∈A ∧ (y∈B∨y∈C)(defn. of ∪)  ⟺  (a∈A∧y∈B)∨(a∈A∧y∈C)(distributivity of ∧ over ∨, propositional logic)  ⟺  (a,y)∈A×B ∨ (a,y)∈A×C(defn. of ×)  ⟺  (a,y)∈(A×B)∪(A×C).(defn. of ∪)\begin{aligned} (a,y) \in A \times (B\cup C) &\iff a \in A \ \wedge\ y \in B \cup C &&\text{(defn.\ of }\times\text{)}\\ &\iff a \in A \ \wedge\ (y \in B \vee y \in C) &&\text{(defn.\ of }\cup\text{)}\\ &\iff (a \in A \wedge y \in B) \vee (a \in A \wedge y \in C) &&\text{(distributivity of }\wedge\text{ over }\vee\text{, propositional logic)}\\ &\iff (a,y) \in A\times B \ \vee\ (a,y) \in A \times C &&\text{(defn.\ of }\times\text{)}\\ &\iff (a,y) \in (A\times B) \cup (A\times C). &&\text{(defn.\ of }\cup\text{)} \end{aligned}

Every element of A×(B∪C)A\times(B\cup C) has the form (a,y)(a,y) with a∈Aa\in A, and this chain applies to it, and conversely every element of (A×B)∪(A×C)(A\times B)\cup(A\times C) 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) A×(B∩C)=(A×B)∩(A×C)A \times (B \cap C) = (A \times B) \cap (A \times C). Identical strategy, replacing ∨\vee with ∧\wedge and using distributivity of ∧\wedge over ∧\wedge (trivial) — more precisely:

(a,y)∈A×(B∩C)  ⟺  a∈A ∧ y∈B∩C  ⟺  a∈A ∧ (y∈B∧y∈C)  ⟺  (a∈A∧y∈B)∧(a∈A∧y∈C)(idempotence of ∧: P  ⟺  P∧P, applied to a∈A)  ⟺  (a,y)∈A×B ∧ (a,y)∈A×C  ⟺  (a,y)∈(A×B)∩(A×C).\begin{aligned} (a,y) \in A \times (B\cap C) &\iff a \in A \ \wedge\ y \in B \cap C \\ &\iff a \in A \ \wedge\ (y \in B \wedge y \in C) \\ &\iff (a \in A \wedge y \in B) \wedge (a \in A \wedge y \in C) &&\text{(idempotence of }\wedge\text{: } P \iff P\wedge P\text{, applied to }a\in A\text{)}\\ &\iff (a,y) \in A\times B \ \wedge\ (a,y) \in A \times C \\ &\iff (a,y) \in (A\times B) \cap (A\times C). \end{aligned}

As before, extensionality yields equality of the two sets.

(3) (A∪B)×C=(A×C)∪(B×C)(A \cup B) \times C = (A \times C) \cup (B \times C). Symmetric to (1), distributing on the first coordinate:

(x,c)∈(A∪B)×C  ⟺  x∈A∪B ∧ c∈C  ⟺  (x∈A∨x∈B)∧c∈C  ⟺  (x∈A∧c∈C)∨(x∈B∧c∈C)(distributivity of ∧ over ∨)  ⟺  (x,c)∈A×C ∨ (x,c)∈B×C  ⟺  (x,c)∈(A×C)∪(B×C).\begin{aligned} (x,c) \in (A\cup B) \times C &\iff x \in A \cup B \ \wedge\ c \in C \\ &\iff (x \in A \vee x \in B) \wedge c \in C \\ &\iff (x\in A \wedge c \in C) \vee (x \in B \wedge c \in C) &&\text{(distributivity of }\wedge\text{ over }\vee\text{)}\\ &\iff (x,c) \in A \times C \ \vee\ (x,c) \in B \times C \\ &\iff (x,c) \in (A\times C) \cup (B\times C). \end{aligned}

(4) (A∩B)×C=(A×C)∩(B×C)(A \cap B) \times C = (A \times C) \cap (B \times C). Symmetric to (2):

(x,c)∈(A∩B)×C  ⟺  (x∈A∧x∈B)∧c∈C  ⟺  (x∈A∧c∈C)∧(x∈B∧c∈C)  ⟺  (x,c)∈A×C ∧ (x,c)∈B×C  ⟺  (x,c)∈(A×C)∩(B×C).\begin{aligned} (x,c) \in (A\cap B)\times C &\iff (x\in A \wedge x \in B)\wedge c\in C\\ &\iff (x \in A \wedge c\in C)\wedge (x\in B\wedge c\in C)\\ &\iff (x,c)\in A\times C \ \wedge\ (x,c) \in B\times C\\ &\iff (x,c) \in (A\times C)\cap(B\times C). \end{aligned}

(5) A×∅=∅A \times \varnothing = \varnothing (and symmetrically ∅×A=∅\varnothing \times A = \varnothing). Suppose, for contradiction, A×∅≠∅A \times \varnothing \neq \varnothing. Then there exists p∈A×∅p \in A\times \varnothing, so p=(a,b)p = (a,b) with a∈Aa \in A and b∈∅b \in \varnothing. But ∅\varnothing has no elements, so b∈∅b \in \varnothing is false — contradiction. Hence no such pp exists, i.e. A×∅=∅A \times \varnothing = \varnothing. The same argument with the roles of coordinates swapped gives ∅×A=∅\varnothing \times A = \varnothing.

(6) Monotonicity: if A⊆CA \subseteq C and B⊆DB \subseteq D then A×B⊆C×DA\times B \subseteq C \times D. Let (a,b)∈A×B(a,b) \in A \times B be arbitrary. Then a∈Aa \in A and b∈Bb \in B by definition of ×\times. Since A⊆CA \subseteq C, a∈Aa \in A implies a∈Ca \in C. Since B⊆DB \subseteq D, b∈Bb\in B implies b∈Db \in D. Hence a∈Ca \in C and b∈Db\in D, so (a,b)∈C×D(a,b) \in C \times D by definition of ×\times. As (a,b)(a,b) was an arbitrary element of A×BA\times B, this shows A×B⊆C×DA \times B \subseteq C\times D. ■\blacksquare

∎

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 ×\times, to a corresponding tautology of first-order/propositional logic (∧\wedge distributing over ∨\vee, and idempotence of ∧\wedge). This is non-circular: it uses only the definitions of ×,∪,∩,∅\times, \cup, \cap, \varnothing and elementary logic, never any theorem depending on the result being proved.

Worked examples

Example 1 (a genuinely asymmetric numeric check). Let

A={1,2},B={2,3},C={3,4,5}.A = \{1,2\}, \qquad B = \{2,3\}, \qquad C = \{3,4,5\}.

We verify identity (1), A×(B∪C)=(A×B)∪(A×C)A \times (B\cup C) = (A\times B)\cup(A\times C), by brute enumeration — this is a completeness check on the proof, not a substitute for it. First, B∪C={2,3}∪{3,4,5}={2,3,4,5}B \cup C = \{2,3\}\cup\{3,4,5\} = \{2,3,4,5\}. So

A×(B∪C)={1,2}×{2,3,4,5}A \times (B\cup C) = \{1,2\}\times\{2,3,4,5\}

has ∣A∣⋅∣B∪C∣=2⋅4=8|A|\cdot|B\cup C| = 2\cdot 4 = 8 elements:

{(1,2),(1,3),(1,4),(1,5),(2,2),(2,3),(2,4),(2,5)}.\{(1,2),(1,3),(1,4),(1,5),(2,2),(2,3),(2,4),(2,5)\}.

Next compute the two pieces on the right side. We have

A×B={1,2}×{2,3}={(1,2),(1,3),(2,2),(2,3)},A\times B = \{1,2\}\times\{2,3\} = \{(1,2),(1,3),(2,2),(2,3)\},
A×C={1,2}×{3,4,5}={(1,3),(1,4),(1,5),(2,3),(2,4),(2,5)}.A\times C = \{1,2\}\times\{3,4,5\} = \{(1,3),(1,4),(1,5),(2,3),(2,4),(2,5)\}.

Their union is

(A×B)∪(A×C)={(1,2),(1,3),(2,2),(2,3)}∪{(1,3),(1,4),(1,5),(2,3),(2,4),(2,5)}.(A\times B)\cup(A\times C) = \{(1,2),(1,3),(2,2),(2,3)\}\cup\{(1,3),(1,4),(1,5),(2,3),(2,4),(2,5)\}.

Taking the union means listing each pair once even though (1,3)(1,3) and (2,3)(2,3) appear in both sets (since 3∈B∩C3 \in B \cap C). The result is

{(1,2),(1,3),(1,4),(1,5),(2,2),(2,3),(2,4),(2,5)},\{(1,2),(1,3),(1,4),(1,5),(2,2),(2,3),(2,4),(2,5)\},

which has exactly 88 elements (∣A×B∣+∣A×C∣−∣A×B∩A×C∣=4+6−2=8|A\times B|+|A\times C|-|A\times B \cap A\times C| = 4+6-2=8, matching by inclusion–exclusion since (1,3),(2,3)(1,3),(2,3) are shared). Comparing element-by-element with A×(B∪C)A\times(B\cup C) 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 B∩C={3}B\cap C = \{3\} — a feature a careless symmetric example (say B=CB=C) would never expose.

Example 2 (intersection identity with a genuinely nonempty but non-trivial overlap, and a 3-tuple check). Let

A={a,b,c},B={1,2,3},C={2,3,4}.A = \{a,b,c\}, \qquad B = \{1,2,3\}, \qquad C = \{2,3,4\}.

We verify identity (2), A×(B∩C)=(A×B)∩(A×C)A\times(B\cap C) = (A\times B)\cap(A\times C). Since B∩C={2,3}B \cap C = \{2,3\},

A×(B∩C)={a,b,c}×{2,3}={(a,2),(a,3),(b,2),(b,3),(c,2),(c,3)},A \times (B\cap C) = \{a,b,c\}\times\{2,3\} = \{(a,2),(a,3),(b,2),(b,3),(c,2),(c,3)\},

a set of 3⋅2=63 \cdot 2 = 6 pairs. Now compute both large products:

A×B={(a,1),(a,2),(a,3),(b,1),(b,2),(b,3),(c,1),(c,2),(c,3)}(9 pairs),A\times B = \{(a,1),(a,2),(a,3),(b,1),(b,2),(b,3),(c,1),(c,2),(c,3)\} \quad (9 \text{ pairs}),
A×C={(a,2),(a,3),(a,4),(b,2),(b,3),(b,4),(c,2),(c,3),(c,4)}(9 pairs).A\times C = \{(a,2),(a,3),(a,4),(b,2),(b,3),(b,4),(c,2),(c,3),(c,4)\} \quad (9 \text{ pairs}).

Intersecting these two 9-element sets keeps exactly the pairs appearing in both lists — that is, pairs (x,y)(x,y) with y∈{1,2,3}∩{2,3,4}={2,3}y \in \{1,2,3\}\cap\{2,3,4\} = \{2,3\}:

(A×B)∩(A×C)={(a,2),(a,3),(b,2),(b,3),(c,2),(c,3)},(A\times B)\cap(A\times C) = \{(a,2),(a,3),(b,2),(b,3),(c,2),(c,3)\},

which is exactly A×(B∩C)A\times(B\cap C), confirming the identity with 66 matching elements on each side (not 99, illustrating that intersecting the products is strictly smaller than either factor product, as it must be since B∩C⊊B,CB \cap C \subsetneq B, C). As a bonus, we build a genuine 33-tuple example to illustrate the recursive tuple definition. Take A1={a,b}A_1 = \{a,b\}, A2={1,2}A_2=\{1,2\}, A3={α}A_3=\{\alpha\}. Then

A1×A2×A3=(A1×A2)×A3.A_1\times A_2 \times A_3 = (A_1\times A_2)\times A_3.

First A1×A2={(a,1),(a,2),(b,1),(b,2)}A_1 \times A_2 = \{(a,1),(a,2),(b,1),(b,2)\}, a 44-element set. Then

(A1×A2)×A3={((a,1),α),((a,2),α),((b,1),α),((b,2),α)},(A_1\times A_2)\times A_3 = \big\{\big((a,1),\alpha\big),\big((a,2),\alpha\big),\big((b,1),\alpha\big),\big((b,2),\alpha\big)\big\},

and by the recursive definition, ((a,1),α)=:(a,1,α)((a,1),\alpha) =: (a,1,\alpha), and so on, giving the expected

A1×A2×A3={(a,1,α),(a,2,α),(b,1,α),(b,2,α)}A_1\times A_2\times A_3 = \{(a,1,\alpha),(a,2,\alpha),(b,1,\alpha),(b,2,\alpha)\}

with 2⋅2⋅1=42\cdot 2\cdot 1 = 4 elements, exactly matching ∣A1∣⋅∣A2∣⋅∣A3∣|A_1|\cdot|A_2|\cdot|A_3|.

Counterexamplewhy we need "same first factor" for the distributive law over set difference to hold as stated

The theorem above proves distributivity of ×\times over ∪\cup and ∩\cap 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:

(A×B)∖(C×D)(A∖C)×(B∖D).(A \times B) \setminus (C \times D) \stackrel{?}{=} (A\setminus C)\times(B\setminus D).

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

A={1,2},B={1,2},C={1},D={2}.A = \{1,2\}, \quad B=\{1,2\}, \quad C = \{1\}, \quad D = \{2\}.

Compute the left side:

A×B={(1,1),(1,2),(2,1),(2,2)},C×D={(1,2)}.A\times B = \{(1,1),(1,2),(2,1),(2,2)\}, \qquad C\times D = \{(1,2)\}.

So

(A×B)∖(C×D)={(1,1),(2,1),(2,2)},(A\times B)\setminus (C\times D) = \{(1,1),(2,1),(2,2)\},

a set with 3 elements. Now compute the right side:

A∖C={2},B∖D={1},A\setminus C = \{2\}, \qquad B \setminus D = \{1\},

so

(A∖C)×(B∖D)={2}×{1}={(2,1)},(A\setminus C)\times(B\setminus D) = \{2\}\times\{1\} = \{(2,1)\},

a set with only 1 element. Since {(1,1),(2,1),(2,2)}≠{(2,1)}\{(1,1),(2,1),(2,2)\} \neq \{(2,1)\} (they don't even have the same cardinality, 3≠13 \neq 1), 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.

A×(B∖C)=(A×B)∖(A×C),A \times (B \setminus C) = (A\times B)\setminus(A\times C),

which holds by the same double-inclusion technique used above (the reader can verify this using y∈B∖C  ⟺  y∈B∧y∉Cy \in B\setminus C \iff y\in B \wedge y \notin C and distributing ∧\wedge 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

SituationWhat holdsWhat fails / must be checked
A=BA = BA×A=A2A\times A = A^2; identities specialize but reveal nothing newDon't use A=BA=B as your only test case — it hides ordering bugs
One factor emptyA×∅=∅×A=∅A\times\varnothing=\varnothing\times A=\varnothing for every AA, even A=∅A=\varnothingA×B=∅A\times B=\varnothing implies A=∅A=\varnothing or B=∅B=\varnothing (converse of the above)
Commutativitynone in general: A×B≠B×AA\times B \neq B\times A unless A=BA=B or one is emptyNever assume (a,b)=(b,a)(a,b)=(b,a); only true if a=ba=b
AssociativityA×(B×C)≠(A×B)×CA\times(B\times C) \neq (A\times B)\times C 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 ∖\setminus (difference)A×(B∖C)=(A×B)∖(A×C)A\times(B\setminus C) = (A\times B)\setminus(A\times C) holds with a shared factorMixing all four sets independently, as in the counterexample, fails
Infinite index setsFinite products extend to arbitrary products ∏i∈IAi\prod_{i\in I} A_iExistence of a choice function selecting one element from each nonempty AiA_i needs the Axiom of Choice when II is infinite

The mathematician behind it

Origins · 1 minRené Descartes and how this was discovered
RD
René Descartes
1596–1650 · Analytic geometry and the invention of coordinates

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.

History
- 1637 — Descartes publishes La Géométrie, introducing coordinate axes and representing points as ordered pairs of numbers.
- 1895 — Georg Cantor develops the foundations of set theory, including cardinal arithmetic that would later formalize ∣A×B∣=∣A∣⋅∣B∣|A\times B| = |A|\cdot|B|.
- 1910 — Whitehead and Russell, in Principia Mathematica, treat ordered pairs and relations using ad hoc devices lacking a purely set-theoretic reduction.
- 1921 — Kazimierz Kuratowski gives the now-standard set-theoretic definition (a,b)={{a},{a,b}}(a,b) = \{\{a\},\{a,b\}\}, making the Cartesian product fully rigorous within ZF-style set theory.
- 1920s–1930s — Zermelo–Fraenkel axioms (with Skolem's refinements) settle the axiomatic basis (Pairing, Union, Power Set, Separation) needed to prove A×BA\times B exists as a set, as used in the Theorem above.
Is A×BA \times B the same set as B×AB \times A?

No, not in general. Elements of A×BA\times B are pairs (a,b)(a,b) with a∈Aa\in A, b∈Bb \in B, while elements of B×AB\times A are pairs (b,a)(b,a) with b∈Bb\in B, a∈Aa \in A. If a≠ba \neq b, then (a,b)≠(b,a)(a,b) \neq (b,a) as ordered pairs (this is exactly the content of the Kuratowski property (x,y)=(u,v)  ⟺  x=u∧y=v(x,y)=(u,v)\iff x=u\wedge y=v), so unless A=BA = B or one of A,BA,B is empty, A×BA\times B and B×AB\times A contain genuinely different elements and are unequal sets. There is, however, always a natural bijection A×B→B×AA\times B \to B\times A sending (a,b)↦(b,a)(a,b)\mapsto(b,a), so the two products are equal in cardinality but not as literal sets.

Why isn't (A×B)×C(A\times B)\times C literally the same set as A×(B×C)A\times(B\times C)?

Because the Kuratowski encoding makes an element of (A×B)×C(A\times B)\times C have the shape ((a,b),c)((a,b),c), while an element of A×(B×C)A\times(B\times C) has the shape (a,(b,c))(a,(b,c)) — 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 ((a,b),c)↦(a,(b,c))((a,b),c)\mapsto(a,(b,c)), and in practice mathematicians identify them "up to relabeling" and just write A×B×CA\times B\times C. But the definition of the nn-tuple given in this article resolves the ambiguity by fixing a specific convention: nest pairs from the left, i.e. (a1,…,an):=((a1,…,an−1),an)(a_1,\dots,a_n) := ((a_1,\dots,a_{n-1}),a_n), so that A1×⋯×AnA_1\times\cdots\times A_n is unambiguous as a literal set.

Does A×B=A×CA \times B = A \times C imply B=CB = C?

Only if A≠∅A \neq \varnothing. If AA is nonempty, pick any a0∈Aa_0 \in A; then for any bb, b∈B  ⟺  (a0,b)∈A×B=A×C  ⟺  (a0,b)∈A×C  ⟺  b∈Cb \in B \iff (a_0,b) \in A\times B = A\times C \iff (a_0,b)\in A\times C \iff b \in C (using the defining biconditional for ×\times twice), so B=CB = C by extensionality. But if A=∅A = \varnothing, then A×B=∅=A×CA\times B = \varnothing = A\times C for every BB and CC whatsoever (by identity (5) in the Theorem), so the implication fails completely — BB and CC can be wildly different sets while A×B=A×CA\times B = A\times C both trivially equal ∅\varnothing.

How does the Cartesian product relate to functions and relations?

A relation from AA to BB is defined to be any subset R⊆A×BR \subseteq A\times B; writing aRbaRb is shorthand for (a,b)∈R(a,b)\in R. A function f:A→Bf: A \to B is then defined as a relation f⊆A×Bf\subseteq A\times B satisfying two extra conditions: for every a∈Aa\in A there exists some b∈Bb\in B with (a,b)∈f(a,b)\in f (totality), and if (a,b)∈f(a,b)\in f and (a,b′)∈f(a,b')\in f then b=b′b=b' (single-valuedness). This is exactly how "function" is reduced to pure set theory: the familiar notation f(a)=bf(a)=b is just shorthand for (a,b)∈f(a,b)\in f. So every relation and every function is, by definition, a particular kind of subset of a Cartesian product, making A×BA\times B 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 A1×⋯×AnA_1\times\cdots\times A_n (assuming each AiA_i nonempty) just by picking elements one at a time — finitely many choices require no special axiom. For an infinite family {Ai}i∈I\{A_i\}_{i\in I}, the product ∏i∈IAi\prod_{i\in I}A_i is defined as the set of functions ff with domain II such that f(i)∈Aif(i)\in A_i for every ii — essentially "infinite tuples." Showing this product is nonempty whenever every AiA_i 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 A×BA\times B itself is empty. If ∅∈A\varnothing \in A (i.e. ∅\varnothing happens to be an element of AA, as can occur since sets can contain other sets, including ∅\varnothing) and BB is nonempty, say b0∈Bb_0\in B, then (∅,b0)={{∅},{∅,b0}}(\varnothing, b_0) = \{\{\varnothing\},\{\varnothing,b_0\}\} is a perfectly good, non-empty element of A×BA\times B; note this ordered pair itself is not the empty set (it has two elements, or one if {∅}={∅,b0}\{\varnothing\}=\{\varnothing,b_0\}, which happens iff b0=∅b_0=\varnothing). The set A×BA\times B is empty as a whole if and only if A=∅A=\varnothing or B=∅B=\varnothing, by identity (5) of the Theorem together with its converse (proved via contraposition: if both are nonempty, pick a∈A,b∈Ba\in A, b\in B, then (a,b)∈A×B(a,b)\in A\times B, so A×B≠∅A\times B\neq\varnothing).

Before this

Where this leads