An ordered pair is a pair of objects where order matters: unless . Two ordered pairs are equal if and only if their first components agree and their second components agree: if and only if and .
Order is the whole point. The pair is different from . A plain set {3, 5} is the same as {5, 3} — sets have no order. An ordered pair records which came first and which came second.
In set theory, ordered pairs are constructed from sets using the Kuratowski definition: . This encoding ensures the order condition holds using only the axioms of set theory. The construction looks odd but it works: you can prove from it that if and only if and .
The Cartesian product is the set of all ordered pairs with and . If A has 3 elements and B has 4, then has 12 ordered pairs.
Ordered pairs are the building blocks of binary relations and functions. A binary relation on is a subset of — a collection of ordered pairs specifying which elements are related. A function is a binary relation where each element of A appears in exactly one pair.
Ordered n-tuples extend the idea to any finite length. A triple is an ordered pair where one component is itself an ordered pair: . This nesting lets you build tuples of any length from pairs alone.
In a category, the Cartesian product generalizes to the categorical product, defined by a universal property rather than by element-level construction. The ordered pair generalizes to a pair of projection morphisms. The set-theoretic and categorical definitions agree in Set and diverge in other categories.