Skip to content
The Lumenary
Wonder TrailOptional · never gradedStarts from Functions

The product, by its maps

1

The question

Can you describe the set of pairs A×BA \times B without ever looking inside it — only by how functions go into it?

Try the experiment before reading on. There’s no wrong way to explore.

2

Experiment

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 × B123
red
blue
3

Hints, if you want them

    4

    What’s going on

    What’s going on

    The product A×BA \times B comes with two projections, π1(a,b)=a\pi_1(a, b) = a and π2(a,b)=b\pi_2(a, b) = b. Given any set ZZ and any functions f:Z→Af : Z \to A and g:Z→Bg : Z \to B, there is a function

    ⟨f,g⟩:Z→A×B,z↦(f(z),g(z)),\langle f, g \rangle : Z \to A \times B, \qquad z \mapsto \big(f(z), g(z)\big),

    with π1∘⟨f,g⟩=f\pi_1 \circ \langle f, g \rangle = f and π2∘⟨f,g⟩=g\pi_2 \circ \langle f, g \rangle = g. The experiment shows more: it is the only such function. Any hh with π1∘h=f\pi_1 \circ h = f and π2∘h=g\pi_2 \circ h = g must send zz to the pair with first coordinate f(z)f(z) and second coordinate g(z)g(z) — that is, h=⟨f,g⟩h = \langle f, g \rangle.

    fst_comp_pairLean 4Proved here from basic factsFormally verified
    /-- Following `pair f g` by the first projection gives back `f`. -/
    theorem fst_comp_pair (f : Z → A) (g : Z → B) : Prod.fst ∘ pair f g = f := rfl
    Axioms used: No axiomsformal/Lumenary/Category.leanTry it in the Lean web editor
    pair_uniqueLean 4Proved here from basic factsFormally verified
    /-- **Universal property of the product, uniqueness half.** Any `h : Z → A × B` whose two
    coordinates are `f` and `g` *is* `pair f g`. Together with `fst_comp_pair` and
    `snd_comp_pair` (existence), this says: maps into `A × B` are the same thing as pairs of
    maps into `A` and into `B`. -/
    theorem pair_unique {f : Z → A} {g : Z → B} (h : Z → A × B)
        (hf : Prod.fst ∘ h = f) (hg : Prod.snd ∘ h = g) : h = pair f g := by
      funext z
      show h z = (f z, g z)
      rw [← hf, ← hg]
      -- The goal is now `h z = ((h z).1, (h z).2)`: every pair is built from its coordinates.
      rfl
    Axioms used: Quot.soundformal/Lumenary/Category.leanTry it in the Lean web editor

    This "exists and is unique" statement is called the universal property of the product. It describes A×BA \times B entirely through its relationships with all other sets, without mentioning ordered pairs at all. In any category, an object with two arrows satisfying this property is called a product of AA and BB.

    The universal property pins the product down up to isomorphism: any two products of AA and BB are related by a unique isomorphism compatible with the projections — though they need not be literally equal. In the category of subsets of a set ordered by ⊆\subseteq, the product of AA and BB turns out to be A∩BA \cap B; in other categories products look different again. Universal properties like this one are the starting point for limits, adjunctions and the Yoneda lemma.

    Formally verified · 4 LeanAI-drafted · awaiting human review
    5

    Where this leads