| • Science | • People | • Locations | • Timeline |
Two ordered pairs (a1, b1) and (a2, b2) are equal if and only if a1 = a2 and b1 = b2.
The set of all ordered pairs whose first element is in some set X and second element in some set Y is called the Cartesian product of X and Y, and written X × Y. Subsets of X × Y are binary relations.
Ordered triples and n-tuples (ordered lists of n terms) are defined recursively from this definition: an ordered triple (a,b,c) can be defined as (a , (b,c) ): two nested pairs. This approach is mirrored in programming languages: It is possible to represent a list of elements as a construction of nested ordered pairs. For example, the list (1 2 3 4 5) becomes (1, (2, (3, (4, (5, {}))))). The Lisp programming language uses such lists as its primary data structure.
In axiomatic set theory, where all mathematical objects are given set-theoretic definitions, the ordered pair (a, b) is defined as the set { {a}, {a, b} }. The statement that x is the first element of an ordered pair p can then be formulated as
and that x is the second element of p as
Note that this definition is still valid for the ordered pair p = (x,x) = { {x}, {x,x} } = { {x}, {x} } = { {x} }; in this case the statement (∀ Y1 ∈ p, ∀ Y2 ∈ p : Y1 ≠ Y2 → (x ∉ Y1 ∨ x ∉ Y2)) is trivially true, since it is never the case that Y1 ≠ Y2.
In the usual Zermelo-Fraenkel formulation of set theory including the axiom of regularity, ordered pairs (a, b) can also be defined as the set
although we want (x,x) ≠ (z,z).
Set theory