A journey is two functions
A minibus leaves Kampala's old taxi park at 7:00 and heads for Entebbe. A phone on the dashboard records where it is every minute: a latitude and a longitude. So the journey is one function
whose outputs are pairs. But the phone could equally store two separate columns in a spreadsheet: one function and another . Nothing is lost either way. One function into pairs is the same information as two functions.
That modest observation — true for every journey, every spreadsheet with two columns, every point moving in a plane — turns out to describe the set of pairs completely. Mathematicians call this kind of description a universal property, and it is one of the central ideas of modern mathematics. This lesson is your first meeting with one.
Describing a set from the outside
Usually we describe a set by listing or characterising its elements: is the set of ordered pairs with and .
A universal property describes it instead by how it connects to everything else through functions. For the connections are:
- Two functions out of it, the projections, which read off the first and second coordinates.
- A rule for functions into it: whenever you have a function to and a function to from the same set , they combine into exactly one function from to that "projects back" to them.
Projections, pairing and the universal property
Throughout, and are sets. Recall from Composition that means "first , then ".
Definition— projections
The projections of are the functions
Definition— pairing
Let be a set, and let and . Their pairing is the function
Feeding the pairing into a projection gives back the original functions: for every ,
So and . A function that satisfies equations like these is called compatible with and .
Definition— product (universal property)
Let be a set with two functions and . We say that is a product of and , or has the universal property of the product, if:
for every set and every pair of functions , , there is exactly one function with
"Exactly one" packs in two demands. Existence: at least one such . Uniqueness: no more than one. Both matter, as the non-examples below show.
A universal property, in general, describes an object by how it relates, through maps, to all other objects of the same kind. The product is the first and simplest example; you will meet many more.
The picture, and two explorations
The universal property is usually drawn as a diagram. The dashed arrow is the one whose existence and uniqueness are claimed; the two triangles commute, meaning that following the arrows along either route gives the same function.
In the first exploration, has three elements, is a set of two colours and . Choose and , then try to build a function that projects back to them. Try hard to find a second one that works. Why can't you?
The product, by its maps
Choose maps f : Z → A and g : Z → B. Then try to build a map h : Z → A × B that projects back to f and g.
f : Z → A
g : Z → B
⟨f, g⟩ : Z → A × B
p ↦ (red, 2) q ↦ (blue, 2) r ↦ (red, 3)
Your turn: choose h(p), h(q), h(r) by clicking cells.
| A × B | 1 | 2 | 3 |
|---|---|---|---|
| red | |||
| blue |
In the second, a point moves in the plane. Its position at time is the pair : one function of into , built by pairing two functions of into . Change and and watch how the two coordinate functions together determine the whole curve — and how the curve determines them back.
One curve = two coordinate functions
A point moves along the curve as t changes: x and y are both functions of t.
- t ↦ (cos at, sin bt)
- (0.707, 1)
Examples and non-examples
Example— Computing a pairing
Let , and . Define , , and . Then
Projecting the three pairs onto their first coordinates gives back red, blue, blue — the values of — and onto their second coordinates gives — the values of .
Example— A curve in the plane
The unit circle traced at constant speed is , . In the language of this lesson, , and , . Every parametric curve in the plane is the pairing of its two coordinate functions — that is exactly what "parametric" means.
Example— A product that is not made of pairs
Let and , and let with
The table of is , , , , , : every combination of a colour and a number occurs for exactly one . So, given and , the only compatible sends to the unique with and . Hence is a product of and — even though its elements are numbers, not pairs.
Example— Swapping the order
, with and , is also a product of and : the unique compatible is . A product is not "the set of pairs in a particular order"; it is any set with two maps that behave correctly.
Example— Non-example: existence fails
Take , with and the constant function with value . If ever takes a value other than , there is no compatible at all, because is always constant . Too few elements: some pairs of maps cannot be combined.
Example— Non-example: uniqueness fails
Take , with and reading off the first and second coordinates and ignoring the extra bit. Now every pair has a compatible — but not just one: at each point we may choose the extra bit freely. If has elements, there are compatible maps. Too many elements: the combination is not determined.
The theorems, with proofs
Theorem— Theorem 1 (the product of sets)
, with the projections and , is a product of and . For and , the unique compatible function is .
Proof
Existence. We computed above that and .
Uniqueness. Suppose also satisfies and . Fix . The element is some pair . Then and , so . As this holds for every , .
∎
The uniqueness proof used one fact about pairs: a pair is determined by its two coordinates. That is the whole content of the universal property.
Theorem— Theorem 2 (maps into a product)
For every set , the rule is a bijection from the set of functions to the set of pairs of functions . Its inverse is .
Proof
Starting from a pair , pairing and then projecting gives . Starting from , projecting and then pairing gives , which is compatible with and — and so is itself. By the uniqueness in Theorem 1, . Both round trips are the identity, so the two rules are inverse bijections.
∎
Theorem— Corollary (counting)
If , and are finite, then .
Proof
A function from a set with elements to a set with elements chooses one of outputs for each of the inputs, so there are of them. The left side counts functions ; the right side counts pairs of functions and . Theorem 2 matches them up one-to-one, so the two numbers are equal.
∎
Of course also follows from the rule . The point is that the universal property explains this algebra: the familiar exponent law is a shadow of a bijection between sets of functions.
Now the main theorem: the universal property determines the product up to a unique compatible bijection. We first isolate the key trick.
Theorem— Lemma (the only compatible self-map)
Let be a product of and , and let satisfy and . Then .
Proof
Apply the universal property of with , and : there is exactly one with and . Both and have this property. Since there is only one such map, .
∎
Theorem— Theorem 3 (uniqueness up to unique bijection)
Let be a product of and . Then is a bijection with and , and it is the only function compatible with and .
Proof
is compatible with and by the definition of pairing, and by Theorem 1 (applied with ) it is the only compatible function . It remains to show that is a bijection; we do this by finding an inverse.
Apply the universal property of to the set and the projections , : there is a function with and .
- is compatible with and : , and likewise . By the Lemma, .
- is compatible with and : , and likewise for . The identity of is also compatible, so by the uniqueness in Theorem 1 (with ), .
So is a two-sided inverse of , and is a bijection.
∎
Note
Testing one point at a time. Take , a set with one element. A function is just a choice of an element of . So the universal property for this one says: for every and there is exactly one with and — that is, is a bijection. Conversely, if is a bijection, the universal property holds for every (choose point by point). So for sets, it is enough to test one-element sets. In other settings, such as groups, "points" do not see everything and the property must really be tested on every .
The universal property in Lean
In Lean we work with types and functions, the type-theoretic counterpart of sets and functions. The product type A × B comes with Prod.fst and Prod.snd, our and . Here is the pairing and the two equations, which hold by computation (rfl):
/-- The **pairing** `⟨f, g⟩ : X → A × B` of `f : X → A` and `g : X → B` sends `x` to the
ordered pair `(f x, g x)`. -/
def pair {X A B : Type u} (f : X → A) (g : X → B) : X → A × B :=
fun x => (f x, g x)/-- First projection after pairing gives back `f`: `π₁ ∘ ⟨f, g⟩ = f`. Both sides send `x` to
`f x`, so Lean accepts `rfl` ("true by computation"). -/
theorem fst_comp_pair {X A B : Type u} (f : X → A) (g : X → B) :
Prod.fst ∘ pair f g = f :=
rfl/-- Second projection after pairing gives back `g`: `π₂ ∘ ⟨f, g⟩ = g`. -/
theorem snd_comp_pair {X A B : Type u} (f : X → A) (g : X → B) :
Prod.snd ∘ pair f g = g :=
rflUniqueness follows the human proof line by line: compare at each x, and use that a pair is determined by its coordinates (Prod.ext).
/-- **Uniqueness.** If `h : X → A × B` satisfies `π₁ ∘ h = f` and `π₂ ∘ h = g`, then
`h = ⟨f, g⟩`. Proof, as in the lesson: for each `x`, the pair `h x` has first coordinate
`f x` and second coordinate `g x`, and a pair is determined by its two coordinates
(`Prod.ext`). -/
theorem pair_unique {X A B : Type u} {f : X → A} {g : X → B} (h : X → A × B)
(h₁ : Prod.fst ∘ h = f) (h₂ : Prod.snd ∘ h = g) : h = pair f g := by
funext x
apply Prod.ext
· -- first coordinates: `(h x).1 = f x`
exact congrFun h₁ x
· -- second coordinates: `(h x).2 = g x`
exact congrFun h₂ xTheorem 2 becomes an equivalence — Lean's word for a bijection packaged with its inverse and the two round-trip proofs. Mathlib already contains it, and the counting corollary follows by comparing cardinalities:
/-- Functions `X → A × B` correspond one-to-one with pairs of functions `(X → A, X → B)`.
Forward: compose with the two projections. Backward: pair. The two round trips are the
identity: one by `fst_comp_pair`/`snd_comp_pair`, the other by `pair_unique`. -/
def mapsIntoProdEquiv (X A B : Type u) : (X → A × B) ≃ (X → A) × (X → B) where
toFun h := (Prod.fst ∘ h, Prod.snd ∘ h)
invFun fg := pair fg.1 fg.2
left_inv h := (pair_unique h rfl rfl).symm
right_inv _ := rfl/-- Mathlib already has this correspondence, for dependent functions too:
`Equiv.arrowProdEquivProdArrow`. Here we just specialise it to ordinary functions. -/
def mapsIntoProdEquivLibrary (X A B : Type u) : (X → A × B) ≃ (X → A) × (X → B) :=
Equiv.arrowProdEquivProdArrow X (fun _ => A) (fun _ => B)/-- **Counting.** For finite types, `|A × B|^|X| = |A|^|X| · |B|^|X|`. The left side counts
functions `X → A × B`, the right side counts pairs of functions, and `mapsIntoProdEquiv`
matches them up one-to-one. -/
theorem card_maps_into_prod (X A B : Type u) [Fintype X] [DecidableEq X] [Fintype A]
[Fintype B] :
Fintype.card (A × B) ^ Fintype.card X =
Fintype.card A ^ Fintype.card X * Fintype.card B ^ Fintype.card X := by
calc Fintype.card (A × B) ^ Fintype.card X
= Fintype.card (X → A × B) := Fintype.card_fun.symm
_ = Fintype.card ((X → A) × (X → B)) := Fintype.card_congr (mapsIntoProdEquiv X A B)
_ = Fintype.card (X → A) * Fintype.card (X → B) := Fintype.card_prod _ _
_ = Fintype.card A ^ Fintype.card X * Fintype.card B ^ Fintype.card X := by
rw [Fintype.card_fun, Fintype.card_fun]Now the universal property itself, as a definition. ∃! is Lean's "there exists exactly one".
/-- `IsProduct p q` says that the type `P` with maps `p : P → A` and `q : P → B` has the
**universal property of the product**: for every type `X` and every pair of maps
`f : X → A`, `g : X → B` there is **exactly one** `h : X → P` with `p ∘ h = f` and
`q ∘ h = g`. (`∃!` is Lean's "there exists exactly one".) -/
def IsProduct {A B P : Type u} (p : P → A) (q : P → B) : Prop :=
∀ (X : Type u) (f : X → A) (g : X → B), ∃! h : X → P, p ∘ h = f ∧ q ∘ h = g/-- The set of ordered pairs `A × B`, with its two projections, has the universal property:
existence is the pairing `⟨f, g⟩`, uniqueness is `pair_unique`. -/
theorem prod_isProduct (A B : Type u) : IsProduct (Prod.fst : A × B → A) Prod.snd := by
intro X f g
refine ⟨pair f g, ⟨fst_comp_pair f g, snd_comp_pair f g⟩, ?_⟩
rintro h ⟨h₁, h₂⟩
exact pair_unique h h₁ h₂/-- A *different* type can be a product of `A` and `B`: `B × A`, with the first map reading
off the **second** coordinate and the second map the **first**. Given `f` and `g`, the unique
compatible map is `x ↦ (g x, f x)`. -/
theorem swap_isProduct (A B : Type u) : IsProduct (Prod.snd : B × A → A) Prod.fst := by
intro X f g
refine ⟨fun x => (g x, f x), ⟨rfl, rfl⟩, ?_⟩
rintro h ⟨h₁, h₂⟩
funext x
exact Prod.ext (congrFun h₂ x) (congrFun h₁ x)And the main theorem, in two steps exactly as in the proof above:
/-- **The key trick.** If `(P, p, q)` is a product and `k : P → P` is compatible with the maps
(`p ∘ k = p` and `q ∘ k = q`), then `k` is the identity. Reason: apply the universal property
with `X = P`, `f = p`, `g = q`. Both `k` and `id` are compatible maps, and there is only one. -/
theorem eq_id_of_isProduct {A B P : Type u} {p : P → A} {q : P → B} (hP : IsProduct p q)
(k : P → P) (hk₁ : p ∘ k = p) (hk₂ : q ∘ k = q) : k = id := by
obtain ⟨_, _, huniq⟩ := hP P p q
have hk : k = _ := huniq k ⟨hk₁, hk₂⟩
have hid : id = _ := huniq id ⟨rfl, rfl⟩
exact hk.trans hid.symm/-- **A product is determined up to a unique compatible bijection.** If `(P, p, q)` has the
universal property, then `⟨p, q⟩ : P → A × B` is a bijection. (It is compatible with the maps
by `fst_comp_pair`/`snd_comp_pair`, and it is the *only* compatible map by `pair_unique`.)
Proof, as in the lesson. The universal property of `P`, applied to the projections of `A × B`,
gives `ψ : A × B → P` with `p ∘ ψ = π₁` and `q ∘ ψ = π₂`. Then `ψ ∘ ⟨p, q⟩ : P → P` is
compatible with `p` and `q`, so it is the identity by `eq_id_of_isProduct`; and
`⟨p, q⟩ ∘ ψ : A × B → A × B` is compatible with the projections, so it is the identity by
`pair_unique`. A map with a two-sided inverse is a bijection. -/
theorem isProduct_bijective {A B P : Type u} {p : P → A} {q : P → B} (hP : IsProduct p q) :
Function.Bijective (pair p q) := by
obtain ⟨ψ, ⟨hψ₁, hψ₂⟩, _⟩ := hP (A × B) (Prod.fst : A × B → A) (Prod.snd : A × B → B)
rw [Function.bijective_iff_has_inverse]
refine ⟨ψ, ?_, ?_⟩
· -- `ψ ∘ ⟨p, q⟩ = id` on `P`
have h : ψ ∘ pair p q = id := by
apply eq_id_of_isProduct hP
· calc p ∘ (ψ ∘ pair p q) = (p ∘ ψ) ∘ pair p q := rfl
_ = Prod.fst ∘ pair p q := by rw [hψ₁]
_ = p := fst_comp_pair p q
· calc q ∘ (ψ ∘ pair p q) = (q ∘ ψ) ∘ pair p q := rfl
_ = Prod.snd ∘ pair p q := by rw [hψ₂]
_ = q := snd_comp_pair p q
exact congrFun h
· -- `⟨p, q⟩ ∘ ψ = id` on `A × B`
have h : pair p q ∘ ψ = id := by
have hu : pair p q ∘ ψ = pair (Prod.fst : A × B → A) (Prod.snd : A × B → B) :=
pair_unique (pair p q ∘ ψ) hψ₁ hψ₂
rw [hu]
rfl
exact congrFun hFinally, the two fake products. Each one fails one half of "exactly one":
/-- **Existence can fail.** Take `A = B = Unit` (one element each) and `P = Empty`. There is no
map at all from `Unit` to `Empty`, so the pair of maps `Unit → Unit` cannot factor through `P`. -/
theorem not_isProduct_empty :
¬ IsProduct (fun e : Empty => (Empty.elim e : Unit)) (fun e : Empty => (Empty.elim e : Unit)) := by
intro hP
obtain ⟨h, _, _⟩ := hP Unit id id
exact (h ()).elim/-- **Uniqueness can fail.** Take `A = B = Unit` and `P = Bool` (two elements), with the only
possible maps `P → Unit`. Then *both* constant maps `Unit → Bool` are compatible, so there is
not exactly one. The universal property needs its "exactly". -/
theorem not_isProduct_bool : ¬ IsProduct (fun _ : Bool => ()) (fun _ : Bool => ()) := by
intro hP
obtain ⟨_, _, huniq⟩ := hP Unit id id
have ht : (fun _ : Unit => true) = _ := huniq (fun _ => true) ⟨rfl, rfl⟩
have hf : (fun _ : Unit => false) = _ := huniq (fun _ => false) ⟨rfl, rfl⟩
have h : (fun _ : Unit => true) = (fun _ : Unit => false) := ht.trans hf.symm
exact Bool.noConfusion (congrFun h ())Counting compatible maps
"""Testing the universal property of the product on small finite sets.
A candidate product is a set P with two maps p : P -> A and q : P -> B.
For every pair of functions f : X -> A and g : X -> B we count the maps
h : X -> P with p(h(x)) = f(x) and q(h(x)) = g(x) for all x, by listing all
maps X -> P. The universal property says the count is always exactly 1.
We test the set of ordered pairs, a 6-element product that is not made of
pairs, and two fakes: one where some counts are 0 (existence fails) and one
where counts are 4 (uniqueness fails). This is exhaustive-finite evidence
for the small sets X used here; the lesson's proof covers every X.
Runs unchanged in the browser (Pyodide) using only the standard library.
"""
from collections import Counter
from itertools import product
import textwrap
A = ("red", "blue")
B = (1, 2, 3)
def all_functions(domain, codomain):
"""Every function domain -> codomain, as a tuple of values in domain order."""
return list(product(codomain, repeat=len(domain)))
def count_compatible(domain, P, p, q, f, g):
"""Number of h : domain -> P with p(h(x)) = f(x) and q(h(x)) = g(x).
``f``, ``g`` are tuples of values (one per element of ``domain``); ``p``,
``q`` are dicts on P. Every map h : domain -> P is listed and tested.
"""
count = 0
for h in product(P, repeat=len(domain)):
if all(p[h[i]] == f[i] and q[h[i]] == g[i] for i in range(len(domain))):
count += 1
return count
def profile(domain, P, p, q):
"""Counter {number of compatible h: how many pairs (f, g) have it}."""
fs = all_functions(domain, A)
gs = all_functions(domain, B)
return Counter(count_compatible(domain, P, p, q, f, g) for f in fs for g in gs)
def is_product_on(domain, P, p, q):
"""True if every pair (f, g) on ``domain`` has exactly one compatible h."""
return set(profile(domain, P, p, q)) == {1}
def candidates():
"""The four candidate products (name, P, p, q) studied in the lesson."""
pairs = list(product(A, B))
six = list(range(1, 7))
triples = [(a, b, c) for a, b in pairs for c in (0, 1)]
return [
("ordered pairs A x B", pairs,
{u: u[0] for u in pairs}, {u: u[1] for u in pairs}),
("numbers 1..6", six,
{k: "red" if k <= 3 else "blue" for k in six},
{k: (k - 1) % 3 + 1 for k in six}),
("A with q constant 1", list(A),
{a: a for a in A}, {a: 1 for a in A}),
("A x B x {0, 1}", triples,
{u: u[0] for u in triples}, {u: u[1] for u in triples}),
]
def main():
X = ("x", "y")
print(f"A = {{red, blue}}, B = {{1, 2, 3}}, X = {{x, y}}")
n_pairs = len(all_functions(X, A)) * len(all_functions(X, B))
print(f"pairs of functions (f, g): {n_pairs}")
print("candidate P |P| compatible h per (f, g) product?")
for name, P, p, q in candidates():
prof = profile(X, P, p, q)
if len(prof) == 1:
counts = "{} for all {}".format(*next(iter(prof.items())))
else:
counts = ", ".join(f"{k} for {v}" for k, v in sorted(prof.items()))
verdict = "yes" if set(prof) == {1} else "no"
print(f"{name:<25} {len(P):>3} {counts:<24} {verdict}")
print()
print("Listing maps: |A x B|^|X| = |A|^|X| * |B|^|X|")
pairs = candidates()[0][1]
for n in range(5):
dom = tuple(range(n))
lhs = len(all_functions(dom, pairs))
rhs = len(all_functions(dom, A)) * len(all_functions(dom, B))
print(f" |X| = {n}: {lhs:>5} maps X -> A x B, {rhs:>5} pairs (f, g)")
X3 = ("x", "y", "z")
name, P, p, q = candidates()[1]
print(f"With |X| = 3, '{name}' still gives one h each time: "
f"{is_product_on(X3, P, p, q)}")
print()
print(textwrap.fill(
"Epistemic status: exhaustive-finite. Every pair (f, g) and every map "
"h was checked, but only for X with 2 or 3 elements and these "
"particular A and B. The universal property is about every set X; "
"the lesson proves it for ordered pairs, and proves that any two "
"products are matched by exactly one compatible bijection.",
width=78,
))
if __name__ == "__main__":
main()The two genuine products give for all pairs. The candidate with too few elements gives for most pairs (existence fails); the one with an extra bit gives for every pair (uniqueness fails; with there are two free bits). This is exhaustive-finite evidence: complete for these particular small sets, silent about all others. The proofs above are what cover every .
Exercises
1. Products by maps: a first universal property
Warm-upHumanLet , with and , and with . What is ?
2. Products by maps: a first universal property
Warm-upHumanLet , and . How many functions are there?
3. Products by maps: a first universal property
CoreHumanLet . Which of these are products of and ? (Choose all that apply.)
4. Products by maps: a first universal property
CoreHumanIn the proof of Theorem 3 we showed that . Which fact justifies that final equality?
5. Products by maps: a first universal property
CoreHumanLet , with and . Let have elements and fix and . How many functions satisfy and ?
6. Products by maps: a first universal property
CoreFormalGiven p : P → A, q : P → B, f : X → A and g : X → B, which Lean proposition says "there is exactly one compatible with and "?
7. Products by maps: a first universal property
CoreComputationalRepresent a finite function as a Python dict. Write pairing(f, g), which takes two dicts with the same keys and returns the dict , and components(h), which takes a dict whose values are pairs and returns the two dicts . Check that the two are inverse to each other (Theorem 2).
8. Products by maps: a first universal property
StretchHumanLet and , and suppose a set with maps and has the universal property of the product. How many elements must have?
9. Products by maps: a first universal property
StretchHumanMake the positive integers into a category: there is one arrow exactly when divides (and no arrow otherwise). A product of and is a number with arrows and such that every with arrows and has an arrow (uniqueness is automatic, as there is at most one arrow between two numbers). What is ?
Common misconceptions
Misconception
"The universal property defines some new object, different from ." It describes by its behaviour. The set of ordered pairs has the property (Theorem 1), and anything else with the property is matched with it by exactly one compatible bijection (Theorem 3).
Misconception
Forgetting the uniqueness part. "There is a compatible " is not enough: has compatible maps for every but is not a product. Uniqueness is what makes the proof of Theorem 3 work — the Lemma is nothing but uniqueness.
Misconception
"Only the set of ordered pairs is really a product." Any set with two maps having the property serves equally well, like in the examples, or with swapped maps. Even "ordered pair" itself is defined in more than one way in set theory (see below); the universal property is what all the definitions agree on.
Misconception
Confusing with . For and , the map sends to : two inputs, processed separately. The pairing takes one input and feeds it to both. They are related by , where (when ).
Misconception
"Unique up to bijection" means "equal". and are different sets. What is unique is the compatible bijection between them — so we may treat them as interchangeable, as long as we use that bijection to translate.
The same idea, seen by others
Geometry— Coordinates are projections
When Descartes and Fermat put coordinates on the plane, they identified it with : a point is its pair of coordinates, and the two coordinate functions are the projections. A curve is the pairing of its coordinate functions, and every statement about the curve can be translated into two statements about real functions. In three dimensions has three projections, and a path in space is three functions of time — exactly what a GPS receiver records (adding altitude).
Topology— Continuity, one coordinate at a time
A map is continuous if and only if both coordinate functions and are continuous. So is continuous because and are. This is the universal property again, now for continuous maps: for spaces and , the product topology on is chosen precisely so that continuous maps correspond to pairs of continuous maps , . (It is the coarsest topology making both projections continuous.) See point-set topology.
Algebra— Direct products of groups
For groups and , the set with componentwise operation is again a group, and a homomorphism is the same as a pair of homomorphisms and . For example, pairs two homomorphisms and ; it sends exactly the multiples of to , and this leads to the Chinese remainder theorem , an isomorphism you can check in structure-preserving maps.
Probability— Random vectors, and a warning
Two random variables on the same sample space pair up into one random vector , and every random vector arises this way. But the distributions of and do not determine the distribution of . Toss a fair coin: let for heads and for tails, and compare with . In both cases is a fair variable, yet takes the values in the first case and in the second. The universal property is about functions on the same , not about distributions — which is exactly why independence and correlation are interesting (conditional probability and independence).
Logic— 'And' has the same property
Order propositions by implication. Then behaves exactly like a product: holds if and only if both and hold, and implies each of and (the "projections"). In a proof assistant such as Lean this is literal: a proof of is a pair of proofs, written ⟨hp, hq⟩. See First steps in Lean.
Wonder Trails
Set-theoretic connection: what is an ordered pair?
In set theory everything is a set, so an ordered pair must be one too. The standard choice, due to Kazimierz Kuratowski (1921), is
One proves that exactly when and — the one fact our uniqueness proof used. But this is not the only choice: Norbert Wiener proposed a different encoding in 1914, and others work too. Each encoding produces a different set "", but every one of them satisfies the universal property, so by Theorem 3 they are all matched by unique compatible bijections. The encoding is an implementation; the universal property is the specification.
Products in any category
In a category (see Composition), a product of objects and is an object with arrows , such that for every object and arrows , there is exactly one arrow with and . Our definition is the case of the category of sets, and the proof of Theorem 3 works word for word in every category: any two products of and are isomorphic by a unique isomorphism compatible with the projections.
The same words describe very different things:
- In sets: the Cartesian product. In groups: the direct product. In spaces: the product space.
- In the positive integers ordered by divisibility (an arrow means divides ), a product of and is a number that divides both, and is divisible by every number dividing both: .
- In the subsets of a set ordered by , the product of and is .
Turning all the arrows around gives the coproduct: in sets, the disjoint union; for divisibility, the least common multiple. These ideas continue in universal properties, products and coproducts and, eventually, the Yoneda lemma, which says that every object is determined up to isomorphism by the maps into it.
History and global context
- Coordinates. Describing a position by two numbers is ancient. Ptolemy's Geography (2nd century, Alexandria) listed places by longitude and latitude; in 9th-century Baghdad, al-Khwārizmī's Book of the Description of the Earth tabulated coordinates for thousands of places; in 3rd-century China, the cartographer Pei Xiu set out principles of mapmaking that included a scale and a rectangular grid. In 17th-century France, René Descartes (La Géométrie, 1637) and Pierre de Fermat turned coordinates into a method for geometry.
- Ordered pairs as sets. Norbert Wiener (1914) and Kazimierz Kuratowski (1921) showed how to define ordered pairs inside set theory.
- Universal properties. In the late 1940s, mathematicians began describing constructions by their maps rather than their elements. Pierre Samuel's 1948 paper On universal mappings and free topological groups used "universal mappings"; Saunders Mac Lane's papers on duality for groups (1948–1950) characterised products and free products by such properties, building on the theory of categories that he and Samuel Eilenberg had introduced in 1945. The style was taken up by the Bourbaki group and by Daniel Kan's adjoint functors (1958), and is now everywhere.
Further reading
- F. William Lawvere and Stephen H. Schanuel, Conceptual Mathematics: A First Introduction to Categories (1997; 2nd edition 2009) — products appear early, with many pictures.
- Eugenia Cheng, The Joy of Abstraction (2022) — a gentle, carefully explained route to universal properties.
- Tom Leinster, Basic Category Theory (2014) — universal properties in the introduction, products in chapter 5.
- Saunders Mac Lane, Categories for the Working Mathematician (1971; 2nd edition 1998), for the professional account.