Structure From Bare Collections
Sets alone have no structure, but structure can be built from them.
The ordered pair is the first step, and unlike a set it is sensitive to order: . The Cartesian product is the set of all ordered pairs with first element from and second from , so .
A relation from to is any subset of , nothing more. Relations on a single set are classified by three properties:
| Property | Holds when |
|---|---|
| Reflexive | Every element relates to itself |
| Symmetric | If relates to then relates to |
| Transitive | If to and to then to |
A relation with all three is an equivalence relation, and it partitions the set into disjoint equivalence classes. "Has the same birthday as" is an equivalence relation; "is taller than" is transitive but neither reflexive nor symmetric.
A function from to is a relation assigning exactly one element of to each element of . It is injective if distinct inputs give distinct outputs, surjective if every element of is hit, and bijective if both.
Two counting results carry surprising weight. The power set is the set of all subsets of , and
because each element is independently in or out. A 3-element set has 8 subsets. And the number of functions from to is , since each of the inputs independently gets one of outputs.
Cantor's theorem says for every set, finite or infinite. Since always, there is no largest set and no largest infinity, the power set of any infinity is a strictly bigger one. This is where set theory stops being bookkeeping and starts producing results nobody expected.
Common pitfall: thinking every relation is a function. A function must assign exactly one output to each input, no more, no fewer. "Is a parent of" relates one person to several children, so it is a perfectly good relation and not a function at all.