Contents / Set Theory / Naive Set Theory
Chapter 1
Naive Set Theory
Sets, membership and the double-inclusion method that follows from extensionality; why membership and inclusion are genuinely different relations; Russell's paradox derived in full, with the failing assumption located and separation shown to repair it; power sets with the count 2 to the n; Cantor's theorem by the diagonal set; and the union, intersection, distributive and De Morgan laws proved by element chasing, including arbitrary indexed families.
Introduction
Almost every object in modern mathematics is, if you push hard enough, a set. A function is a set of ordered pairs; an ordered pair is a set of sets; a natural number can be built as a set, a real number as a set of rationals, a vector space as a set with two sets of operations laid over it. The reason to care about the theory in this chapter is not that sets are interesting in themselves — for most of the chapter they will look almost insultingly simple — but that they are the substrate everything else is written on, and a substrate with a crack in it cracks everything above it.
There was a crack. The naive theory, as Cantor and Frege used it, rested on one enormously plausible principle: any property whatsoever carves out the set of things having that property. In 1901 Bertrand Russell wrote down a property — is not a member of itself — for which that principle is flatly contradictory. The resulting paradox is short enough to fit in three lines and destroyed a life's work. Section Russell's paradox and what it kills gives it in full, together with the precise diagnosis of which assumption fails, because a paradox you cannot locate is a paradox you will walk into again.
Everything else here is the working vocabulary: membership, equality, inclusion, the empty set, power sets, unions and intersections, differences and products. Two themes run through all of it. The first is extensionality: a set is nothing but its members, which makes set equality provable rather than a matter of how the set was described, and which converts every equality claim into two inclusion claims. That conversion — the double inclusion technique — is the single method used most often in this chapter and in the rest of mathematics. The second is that membership and inclusion are different relations, sharing almost no properties, and that conflating them is the most reliable source of wrong answers in the subject.
We work naively but not carelessly: axioms are named where they are used, and where the naive picture would mislead, the repair is stated. Throughout, , is the integers, the rationals and the reals.
1.1What a set is, and when two sets are equal
Membership is taken as primitive: it is not defined in terms of anything simpler, in the same way that "point" is primitive in geometry. What we do instead is say how membership behaves, and the first and most important such statement is that a set is determined by nothing except which objects are in it.
Definition 1.1 (Set and membership). A set is a collection of objects, considered as a single object in its own right. The objects belonging to a set are its elements or members, and we write
to mean that is an element of , and to mean that it is not. For every object and every set , exactly one of and holds.
That last sentence is the whole of the "well-defined" requirement stated honestly. It is not a demand that we be able to decide which of the two holds — nobody can currently decide whether the Euler–Mascheroni constant belongs to the set of rational numbers — only that one of them does hold.
Definition 1.2 (Extensionality). Two sets and are equal, written , precisely when they have the same elements:
Intuition. A set is a membership list and nothing more. Not how the list was compiled, not what order the names are in, not how many times a name was written down. , , and are four descriptions of one set, in exactly the way that "the capital of France" and "the city on the Seine with the iron tower" are two descriptions of one city.
Extensionality is doing more work than it looks. It tells us that repetition and order are invisible, which is why . It tells us that two sets given by wildly different descriptions may nevertheless be the same set, so "are these equal?" is a mathematical question with a proof, not a bookkeeping question. And it hands us a proof technique, by splitting a biconditional into two implications.
Theorem 1.3 (Double inclusion). Let and be sets. Then if and only if both of the following hold:
- every element of is an element of ;
- every element of is an element of .
Proof. Suppose . By Definition Extensionality, for every we have . In particular, if then , which is (1), and if then , which is (2).
Conversely, suppose (1) and (2) hold, and let be arbitrary. By (1), implies ; by (2), implies . The two implications together give . Since was arbitrary, Definition Extensionality yields .∎
This is the workhorse of the entire subject, so it is worth naming the shape of the argument it licenses. To prove : take an arbitrary , and reason your way to ; then take an arbitrary and reason your way back. Nothing else is needed, and nothing less will do — showing only (1) proves the weaker statement that is contained in , which is a different claim. Every algebraic identity in this chapter, from associativity of union to De Morgan's laws, is proved this way, and the proofs are so uniform that after three of them you can write the fourth without thinking.
Example 1.4 (Two descriptions, one set). Let and . Show that .
Solution.
- Take . Then is an integer with , so , that is . A product of integers is zero only if a factor is, so or ; either way .
- Take . If then ; if then . In both cases is an integer satisfying , so .
- Both inclusions hold, so by Theorem Double inclusion, .
Pitfall. "Same number of elements" is not "equal". and both have two elements and are different sets. Equality is about which objects, never about how many.
1.2Writing sets down: roster and set-builder notation
Extensionality says a set is its members; notation is the business of specifying those members on a page. There are exactly two ways, and the choice between them is the choice between listing and describing.
Definition 1.5 (Roster and set-builder notation). Roster notation specifies a set by listing its elements between braces, as in ; an ellipsis stands for an unambiguous continuation, as in or .
Set-builder notation specifies a set by a property. If is a set and a property, then
denotes the set of exactly those elements of for which holds. The variant denotes the set of all values as ranges over .
Notation. The colon is read "such that"; many authors write a vertical bar instead, . Both are universal and neither is more correct. The braces are part of the name of the set: is a set with one element, while is a number, and they are never interchangeable.
The clause before the colon is not decoration, and it is the difference between safe and unsafe notation. Writing with no restriction — "the set of all things with property " — is exactly the principle that Russell's paradox destroys. The restricted form always carves a new set out of a set we already have, and that restriction is what keeps it consistent. We will make this precise in Definition Separation.
1.3Sets that already surround you
Before anything is proved about sets in general, it is worth fixing the standard examples, since nearly every later illustration is drawn from them.
The number systems are nested: , each obtained from the last by demanding that some operation always succeed — subtraction, then division, then taking limits, then extracting roots. Intervals such as are sets of reals defined by set-builder notation, and the difference between and is a difference of exactly two elements with enormous consequences in analysis.
Sets are not confined to numbers. The solution set of an equation, the set of vertices of a graph, the set of continuous functions , the set of matrices over , the set of prime factors of — all are sets, and in each case the elements are objects that are themselves complicated. There is no requirement that the elements of a set resemble one another. is a perfectly good four-element set containing an integer, a real number, an infinite set of rationals, and a one-element set.
Example 1.6 (Counting a set given by a property). How many elements does have?
Solution.
- A divisor of has the form with and .
- That gives choices, and distinct pairs give distinct divisors by uniqueness of prime factorisation.
- Explicitly, , which has elements.
1.4Nothing: the empty set
A collection is allowed to be empty, and the set with no elements turns out to be the most heavily used set in mathematics — it is the default answer, the base case of a hundred inductions, and the value of any intersection of sets with nothing in common.
Definition 1.7 (Empty set). The empty set is the set with no elements. It is written or , and it is characterised by
The definite article in "the empty set" is a claim, not a courtesy, and extensionality is what justifies it.
Theorem 1.8 (Uniqueness of the empty set). There is at most one set with no elements: if and both have no elements, then .
Proof. We verify the condition in Definition Extensionality. Let be an arbitrary object. Since has no elements, is false; since has no elements, is false. Two false statements are equivalent, so holds. As was arbitrary, extensionality gives .∎
The proof is worth pausing over because it is the first appearance of an argument style that trips people up: both sides of the biconditional are false, and the biconditional is therefore true. Nothing was checked about any actual element, because there are none to check. The same style — a universally quantified statement about the members of an empty collection is automatically true — is called vacuous truth, and it returns immediately in Proposition The empty set is contained in everything.
Pitfall. , and are three different sets. The first has no elements. The second has exactly one element, namely , so it is not empty — a box containing an empty box is not an empty box. The third has one element, the number . Only the first satisfies .
Example 1.9 (Empty or not?). Determine which of the following are empty: , , , .
Solution.
- is empty: squares of reals are non-negative, so no real satisfies .
- is not empty: and belong to it, so .
- is empty: the classical irrationality of says no rational squares to .
- is not empty: it has one element. Its cardinality is , not .
Remark. and differ only in the ambient set the elements are drawn from, and one is empty while the other has two elements. This is a reminder that in the set carries real information; suppressing it is the beginning of the trouble in the next section.
1.5Russell's paradox and what it kills
Naive set theory, as practised before 1901, ran on a single generative principle: any property determines a set. It is hard to overstate how natural this is. If you can say what it is to be a prime, there ought to be the set of primes; if you can say what it is to be a group, there ought to be the set of groups. Frege built the foundations of arithmetic on it. Written out, it is the following schema.
Definition 1.10 (Unrestricted comprehension). Unrestricted comprehension is the principle that for every property there exists a set
whose elements are exactly the objects satisfying ; that is, for every object ,
Note the quantifier: every property, with no ambient set to draw from. Russell's observation is that one particular, entirely unexotic property makes the principle contradict itself.
Theorem 1.11 (Russell's paradox). Unrestricted comprehension is inconsistent.
Proof. Apply Definition Unrestricted comprehension to the property given by " ", which says that is not a member of itself. It yields a set
with the defining property that for every object ,
Now is itself an object, so we may take in . This gives
Write for the statement . We have derived . If is true then is true, so is false; if is false then is true, so is true. Each case yields its own negation, so both and hold, a contradiction. The contradiction was derived from the comprehension principle alone, using no further assumption, so that principle is inconsistent.∎
Intuition. The barber version: in a village the barber shaves exactly those men who do not shave themselves. Who shaves the barber? If he shaves himself, he is one of the men who shave themselves, whom he does not shave. If he does not, he is one of the men who do not shave themselves, whom he does shave. The resolution there is easy — no such barber exists, and the story was a lie. The resolution in set theory is exactly the same shape and much more expensive: no such set exists, and the principle that promised us one was the lie.
Locating the failure precisely matters more than the paradox itself. Three assumptions were in play: that the property " " is a legitimate property, that a property determines a set, and that classical logic applies. The property is unimpeachable — it is built from membership and negation, the two most basic ingredients available. Abandoning classical logic is a heavy price with no compensating benefit here. So the assumption that fails is the middle one: a property, on its own, does not determine a set.
Definition 1.12 (Separation). The axiom schema of separation (or restricted comprehension) replaces unrestricted comprehension with: for every set and every property , there exists a set
whose elements are exactly those satisfying .
Separation cannot build something out of nothing; it can only carve a subcollection out of a set already in hand. Run Russell's argument against it and watch it fail harmlessly: given a set , separation produces , and asking whether now yields . That is no longer a contradiction; it is a proof, by the same case analysis as above, that . No paradox — instead, a theorem.
Corollary 1.13 (There is no set of all sets). There is no set such that every set is an element of .
Proof. Suppose such a existed. By Definition Separation applied to and the property , the collection
is a set. Being a set, by the assumed universality of . Now ask whether .
If , then by the definition of its members satisfy , so — contradiction. If , then satisfies both conditions for membership in , namely and , so — contradiction. Both cases are impossible, so no such exists.∎
Remark. The cost of the repair is that the universe of sets is not itself a set. Collections too large to be sets — the sets, the ordinals, the groups — are called proper classes; they can be talked about, but never used as elements. Zermelo–Fraenkel set theory is essentially the list of the constructions we are allowed: separation, pairing, union, power set, infinity, replacement. Every one of them builds a new set from sets already present. Nothing in this chapter beyond this section needs the axioms by name, but every construction we perform is one of them.
Example 1.14 (Diagnosing an illegitimate definition). Is , the collection of all one-element sets, a set?
Solution.
- It is defined by unrestricted comprehension, with no ambient set, so it is not automatically legitimate.
- It is in fact a proper class. If it were a set , then would be a set, and contains for every object , since for every . That makes a set of all sets, contradicting Corollary There is no set of all sets.
- So no: the collection is too large to be a set.
1.6Membership as a relation
We have used constantly; now we examine it as an object of study. A relation is a thing that either holds or fails between two objects, and the useful questions to ask about any relation are the standard ones: is it reflexive, symmetric, antisymmetric, transitive? For most relations you meet — equality, , congruence mod , divisibility — the answers are yes to several. For the answers are no across the board, and that is precisely what distinguishes it from the inclusion relation of the next section.
Notation. The membership relation holds between an object and a set exactly when is one of the objects collected in . It is the only primitive relation of set theory: every other notion in this chapter — equality, inclusion, union, intersection, power set — is defined from together with logic.
Intuition. Membership is a one-level relation: it sees only the outermost braces. Asking is asking whether appears in the top-level list of , never whether appears somewhere nested deeper. In the top-level list has two entries, and . The number is buried one level down, so , even though is written inside the braces of on the page.
Example 1.15 (Reading membership off nested braces). Let . Decide whether each of , , , holds, and give .
Solution.
- The top-level entries of are the three objects , and . These are pairwise distinct: a number, a set whose element is a number, and a set whose element is a set. So .
- : yes, it is the first entry. : yes, the second. : yes, the third.
- : no. This two-element set is not one of the three listed entries, so it is not a member — although we will see in Section Subsets and inclusion that it is a subset.
1.7Membership has none of the usual properties
Relations that behave well tend to be reflexive and transitive, and it is tempting to assume is too, especially since (coming next) is both. The temptation must be resisted explicitly, with counterexamples, because the error is invisible once it is made.
Proposition 1.16 (Membership is neither reflexive, symmetric, antisymmetric nor transitive).
- There is a set with , so is not reflexive.
- There are sets with and , so is not symmetric.
- There are sets with and , so is not antisymmetric.
- There are sets with and but , so is not transitive.
Proof. For (1), take . By Definition Empty set, no object at all is a member of , and in particular .
For (2), take and . Then , while because is a number and has no elements at all.
For (3), antisymmetry would say that and force . Suppose and with ; then and while , so antisymmetry fails. (In Zermelo–Fraenkel set theory the axiom of foundation rules such a pair out, but nothing in the definition of itself excludes it: antisymmetry is not a property of the relation, it is an extra axiom.)
For (4), take , and . Then since is the sole element of , and since is the sole element of . But the only element of is , and — one is a number, the other a set — so .∎
Part (4) is the one that does damage in practice. The chain does not collapse; each steps exactly one level of braces, and two steps land you two levels away, not one. Contrast this with the inclusion relation, which is transitive precisely because it is a statement about all elements rather than about one level of structure.
Remark. The axiom of foundation (or regularity) asserts that every non-empty set has an element disjoint from it; a consequence is that no set is a member of itself and there are no cycles . So in the standard universe never happens — which, incidentally, means Russell's would have had to be the set of all sets, another way of seeing that it is too big to exist.
1.8Subsets and inclusion
Inclusion is the relation that compares two sets wholesale, and unlike membership it is exactly as well behaved as one could hope.
Definition 1.17 (Subset). Let and be sets. We say is a subset of , or that is included in , written , if every element of is an element of :
We write when this fails, that is, when some has and . Such an is a witness to the failure.
The definition tells you immediately how to prove and how to disprove an inclusion, and the asymmetry between the two is worth stating. To prove you must argue about an arbitrary element: "let ; then ... ; hence . " To disprove it you need only exhibit one witness. One object settles a negative; no finite number of objects settles a positive, unless happens to be finite and you check them all.
Proposition 1.18 (The empty set is contained in everything). For every set , we have . Moreover is the only set contained in every set.
Proof. By Definition Subset, means: for every , if then . Fix any . The hypothesis is false, by Definition Empty set. An implication with a false hypothesis is true, whatever its conclusion — this is the truth table of , and it is what vacuous truth names. So the implication holds for this , and since was arbitrary, it holds for all . Hence .
For the second claim, suppose for every set . Taking gives , and every element of would then be an element of ; since has none, has none, so by Theorem Uniqueness of the empty set.∎
Intuition. Why should "every element of lies in " count as true when there is nothing to check? Because the only way it could be false is for some element of to lie outside , and there is no element of to serve as the counterexample. A statement with no possible counterexample is true. Compare: "every unicorn in this room is purple" cannot be refuted, because refuting it requires producing a non-purple unicorn in this room.
Theorem 1.19 (Inclusion is a partial order). For all sets , , :
- Reflexivity. .
- Antisymmetry. If and , then .
- Transitivity. If and , then .
- Singletons. if and only if .
Proof. (1) Let . Then . The implication holds trivially for every , so .
(2) The hypothesis says every element of lies in , and says every element of lies in . These are exactly conditions (1) and (2) of Theorem Double inclusion, which gives .
(3) Let be arbitrary. Since , we get . Since , we get . Thus every element of is an element of , which is .
(4) Suppose . Since , the inclusion applied to this element gives . Conversely suppose , and let be arbitrary; the only element of is , so and hence . Thus .∎
Parts (1)–(3) say that is a partial order — "partial" because two sets need not be comparable at all: and satisfy neither inclusion. Part (2) is the formal statement that double inclusion works, and it is why almost every equality proof in the rest of the chapter is presented as two inclusions. Part (4) is the bridge between the two relations, and the cleanest statement of how they differ: and say the same thing, while and say something else entirely.
Example 1.20 (Proving and disproving inclusions). Let and . Show and show .
Solution.
- For the inclusion, let . Then for some integer , so with , hence and . As was arbitrary, .
- For the failure, we need one witness. Take : it lies in since , and it does not lie in since has no integer solution. So .
- Together these say the inclusion is strict.
1.9Proper subsets
Inclusion as defined allows ; often we want to say a set sits strictly inside another.
Definition 1.21 (Proper subset). is a proper subset of , written , if and . Equivalently, every element of lies in and there is at least one element of that does not lie in .
Pitfall. The symbol is genuinely ambiguous in the literature: some authors use it for ordinary inclusion, exactly as , and others reserve it for proper inclusion. Use and , which nobody misreads, and when you meet in a text, check its conventions before assuming either meaning.
The two characterisations in the definition agree because failing to be equal, given , can only happen through the other inclusion failing: by Theorem Inclusion is a partial order part (2), if also held we would have . So if and only if and , and the latter is exactly the existence of a witness in .
Proper inclusion is transitive — if then by transitivity of , and because an element of lies in but not — and irreflexive, since is false. It is therefore a strict partial order, with related to it exactly as is to .
1.10Elements versus subsets
This is the section that decides whether the rest of the subject will make sense. Two relations, written with similar symbols, are constantly confused, and the confusion is not a matter of sloppy notation — it produces genuinely wrong answers about cardinalities, power sets and proofs.
The difference in one line: says is one of the entries in 's list; says every entry of 's list also appears in 's list. Membership compares an object with a set; inclusion compares a set with a set. They have no properties in common: is reflexive, antisymmetric and transitive, and by Proposition Membership is neither reflexive, symmetric, antisymmetric nor transitive, is none of the three.
It is possible for an object to stand in both relations to the same set, and possible for it to stand in exactly one. All four combinations are realisable, and knowing an example of each is the fastest way to keep them apart.
Example 1.22 (All four combinations). Find, for the object and set in each case: (a) and ; (b) but ; (c) but ; (d) neither.
Solution.
- (a) Both. Take and . Then , since is listed as an entry. And , since the only element of is , which is also an entry of .
- (b) Member but not subset. Take and . Then . But is not even a sensible claim about a number, and read literally it is false: is not a set with all its elements in .
- (c) Subset but not member. Take and . Every element of , namely , lies in , so . But the entries of are and , and is neither, so .
- (d) Neither. Take and : it is not an entry of , and its element is not in .
Pitfall. Every set satisfies , but essentially never holds. Writing is a common slip for , and the first is false while the second is true.
1.11Sets inside the rest of mathematics
The element/subset distinction is not a curiosity of set theory; it is the distinction between a point and a subspace, a vector and a subgroup, a number and an interval, and it appears wherever mathematics has structure.
In linear algebra, a vector is an element of , while the line is a subset, indeed a subspace. The statement " is a subspace" is a type error. In group theory, is an element and is the subgroup it generates; in topology, a point belongs to a space and an open neighbourhood contains it. In each case the object and the one-element set around it are different, and Theorem Inclusion is a partial order part (4) is the translation between them.
Where the distinction genuinely blurs is in the von Neumann construction of the natural numbers, which is worth seeing once because it shows sets doing real work. Define
So , , , and in general . Each natural number is the set of all smaller natural numbers, so : the number is its own cardinality. And here, exceptionally, the two relations coincide in a useful way — and both say exactly .
Example 1.23 (Computing inside the von Neumann numbers). With and , write out in full braces, and determine , the number of subsets of , and whether and .
Solution.
- , , , and , that is .
- , its elements being , and .
- The number of subsets is .
- holds, since is listed among . And holds, since the only element of is , which is in . Both, as promised, because .
1.12Working with subsets
Two kinds of question come up constantly: deciding whether a proposed inclusion holds, and counting subsets of a given shape. Both are drill, and both reward doing a few by hand.
Example 1.24 (Which inclusions hold?). Let . Decide each of: , , , .
Solution.
- : the elements and are both entries of , so yes.
- : the entries of are , and , and the third is exactly this set, so yes. This is a set that is simultaneously a member and a subset.
- : its sole element is , which by (2) is an entry of , so yes.
- : this requires , and the entries of are , , — none equals . So no.
1.13The power set
Having compared sets by inclusion, we now gather all the subsets of a set into a single object. This is the first construction in the chapter that genuinely increases size, and the axiom that permits it is separate from all the others for exactly that reason.
Definition 1.25 (Power set). The power set of a set , written or , is the set whose elements are precisely the subsets of :
That is, for every set ,
The displayed biconditional is the only fact about power sets ever used, and it is a translation device: it converts a membership statement about into an inclusion statement about , and back. Every proof in this section is that translation applied once or twice.
Pitfall. Every element of is a set, even when the elements of are not. For we get ; the number is not an element of , though the set is. Writing is the classic error.
Two elements are present no matter what is: by Proposition The empty set is contained in everything, and by reflexivity of inclusion. In particular is never empty — even has one element, which is the cleanest illustration that a set of one empty thing is not empty.
Example 1.26 (Small power sets). Write out , and , and give the size of each.
Solution.
- The only subset of is itself, so , of size .
- The subsets of are and , so , of size .
- is a one-element set, so its power set is , of size .
1.14How big the power set is
For finite sets the size of is determined by the size of , and the formula is the reason for the alternative notation .
Notation. A set is finite with cardinality if its elements can be listed as without repetition; equivalently, if there is a bijection between and . A set that is not finite is infinite.
Theorem 1.27 (The power set of a finite set). If is finite with , then is finite with
Proof. List the elements of as without repetition. Let be the set of binary strings with each . Define a map by sending a subset to its indicator string, whose -th entry is
is injective. Suppose . Then for each , holds exactly when does. Since every element of is some , and and are subsets of , the sets and have the same elements, so by Definition Extensionality.
is surjective. Given a string , put . This is a subset of , and its indicator string is the given one, so is the given string.
Hence is a bijection and . A string in is built by choosing each of the entries independently from a two-element set, so by the multiplication principle.∎
Intuition. Building a subset is independent yes/no decisions, one per element: is in? is in? Every pattern of answers gives a different subset and every subset arises from exactly one pattern, so there are as many subsets as patterns, which is .
Corollary 1.28 (Subsets by size). If , the number of subsets of with exactly elements is , and consequently
Proof. A -element subset of is a choice of of the listed elements with order disregarded, and the number of such choices is by definition of the binomial coefficient. Every subset has exactly one size with , so sorting by size partitions it into the classes counted by . Summing the sizes of the parts gives , which is by Theorem The power set of a finite set.∎
1.15Power sets computed
Iterating the power set operation produces very large sets very quickly, and the towers are worth computing once so the growth is not a surprise.
Example 1.30 (A tower of power sets). Let . Compute , , and the number of elements of that have exactly two elements.
Solution.
- , so by Theorem The power set of a finite set.
- Applying the theorem again to the eight-element set gives .
- A two-element element of is a two-element subset of the eight-element set , and there are of these by Corollary Subsets by size.
1.16The power set and inclusion
The power set operation converts inclusion into membership, and it does so order-preservingly: bigger sets have bigger power sets, and the correspondence is exact in both directions.
Proposition 1.31 (Power sets respect inclusion). For all sets and , the following are equivalent:
- ;
- ;
- .
Proof. (1) (2) is Definition Power set applied with .
(1) (3). Assume and let be arbitrary. Then , and combining with gives by transitivity of inclusion, Theorem Inclusion is a partial order part (3). Hence , and since was arbitrary, .
(3) (1). Assume . Since by reflexivity, , so the assumed inclusion gives , which by Definition Power set is .∎
The step that makes (3) (1) work is applying the hypothesis to the single largest element of , namely itself. This is a standard move: a statement about all subsets is often cracked open by feeding it the whole set, or the empty set, or a singleton.
1.17Cantor's theorem: the power set is always bigger
For a finite set , so the power set is strictly larger. The remarkable fact, and the beginning of the theory of infinite cardinalities, is that this remains true for infinite sets — with the same one-line proof, which needs no notion of counting at all. The argument compares sizes by asking whether a map can hit everything.
Notation. A function is a surjection, or is onto, if every equals for at least one . If a surjection exists we say is no larger than ; if none exists, is strictly larger.
Theorem 1.32 (Cantor's theorem). For every set there is no surjection .
Proof. Let be any function. We produce a subset of that is not in the image of . Define the diagonal set
This is a legitimate set by Definition Separation: it is carved out of the set by a property, namely , which makes sense because is a subset of and is an element of . By construction , so .
Suppose, for contradiction, that for some . Ask whether .
- If , then by the defining property of we have . But , so — contradiction.
- If , then fails the defining property, so . But , so — contradiction.
Both alternatives are impossible, so no such exists. Hence is an element of outside the image of , and is not a surjection. Since was arbitrary, no surjection exists.∎
The resemblance to Theorem Russell's paradox is not an accident: both hinge on the self-referential set . The difference is what the argument is allowed to conclude. Russell had a set that was forced to be a member of itself and not, and the conclusion was that the theory was broken. Cantor has a set that would be for some , and the conclusion is merely that no such exists — one hypothesis, the surjectivity of , is available to blame. A contradiction with something to blame is a theorem; a contradiction with nothing to blame is a paradox.
Corollary 1.34 (No largest cardinality). There is no set such that every set injects into ; equivalently, for every set there is a strictly larger set.
Proof. Given any set , form . The map from into is injective, since forces by extensionality, so is at least as large as . By Theorem Cantor's theorem there is no surjection , hence in particular no bijection, so the two are not of equal size. Therefore is strictly larger than , and the process never terminates in a largest set.∎
Remark. Applied to , Cantor's theorem says is uncountable — there is no list containing every set of natural numbers. Since corresponds to the binary expansions of reals in , this is the uncountability of , and the diagonal set is the familiar "change every digit on the diagonal" construction in disguise. Whether any cardinality lies strictly between and is the continuum hypothesis, which Gödel and Cohen showed the standard axioms can neither prove nor refute.
Example 1.35 (Cantor's argument on a concrete list). Let and define , , . Compute the diagonal set and check it is missing from the list.
Solution.
- , so . , so . , so .
- Hence .
- The list is , and is none of them, as guaranteed. Indeed has elements while the list has at most , so at least subsets are missed.
1.18Union
We now turn from comparing sets to combining them. The two basic operations are union and intersection, defined by "or" and "and" respectively, and every algebraic law they satisfy is inherited from the corresponding law of logic.
Definition 1.36 (Union). The union of sets and is
the set of objects belonging to at least one of them. Membership is characterised by
Notation. The "or" is always inclusive: an lying in both and lies in , and lies there once, because extensionality makes repetition invisible. English "or" is often exclusive — "tea or coffee" — and mathematical "or" never is.
1.19The algebra of union
Union obeys the laws you would expect of an addition-like operation, with playing the role of zero — but with idempotence replacing anything like cancellation. All of the proofs have the same three-line form, so the first is given in full and the pattern then stated once.
Theorem 1.37 (Laws of union). For all sets , , :
- Commutativity. .
- Associativity. .
- Idempotence. .
- Identity. .
- Monotonicity and absorption. , and if and only if .
Proof. (1) Let be arbitrary. Then iff ( or ) iff ( or ) iff , the middle step being the commutativity of "or". By extensionality the sets are equal.
(2) iff (( or ) or ) iff ( or ( or )) iff , using associativity of "or" in the middle. Extensionality finishes it.
(3) iff ( or ) iff .
(4) iff ( or ). The second disjunct is always false by Definition Empty set, and " or false" is equivalent to , so this holds iff .
(5) If then " or " holds, so ; hence . For the second claim, suppose . Then by what we just proved. Conversely suppose . We show two inclusions. If then or ; in the first case by hypothesis, and in the second directly, so and . And by the first part with the roles of and exchanged, using (1). By Theorem Double inclusion, .∎
Associativity is what licenses writing with no brackets, and together with commutativity it says the union of a finite list does not depend on the order or the grouping — which is what makes the indexed notation of Section Unions of arbitrary families well defined.
1.20Unions computed
Example 1.38 (Counting a union). In a class of students, study French and study German, and study both. How many study at least one of the two?
Solution.
- Let and be the sets of students studying each language, so , , .
- Adding counts each of the students in both twice, so subtract the overcount once: .
- So students study at least one, and study neither.
1.21Unions of arbitrary families
Union of two sets extends to any collection at all, finite or infinite, and the extension is an axiom rather than a definition made from the binary case — you cannot reach an infinite union by applying a binary operation finitely often.
Definition 1.39 (Indexed union). Let be a set and let be a set for each ; we call an indexed family. Its union is
so that if and only if there exists with . When this is .
The union axiom of Zermelo–Fraenkel is precisely the assertion that this collection is a set. Note the logical shape: membership in a union is an existence statement, and so proving means exhibiting one index, while proving means handling every index at once.
Proposition 1.40 (Union over the empty family). If then .
Proof. By Definition Indexed union, holds if and only if there exists with . There exists no at all, so the existence statement is false for every . Thus the union has no elements, and by Theorem Uniqueness of the empty set it is .∎
Unlike the analogous question for intersections in Section Intersections of arbitrary families, this causes no trouble whatsoever: an existence statement over an empty range is false, which is exactly what we want, and the answer is the identity element for union, exactly as the empty sum is .
Example 1.41 (Indexing by a finite set of divisors). For let . Compute .
Solution.
- , , .
- The pairwise overlaps are the multiples of , and : , and elements. The triple overlap is the multiples of : element.
- Inclusion–exclusion gives . So of the first positive integers are divisible by , or .
1.22Intersection
Where union asks for "at least one", intersection asks for "both", and the shift from "or" to "and" changes every law accordingly. Intersection is the operation that can produce the empty set out of two non-empty inputs, which union never does.
Definition 1.42 (Intersection and disjointness). The intersection of sets and is
so that if and only if both and . If the sets are called disjoint; a family of sets is pairwise disjoint if any two distinct members of it are disjoint.
Note that can be formed by separation from alone — it is — so intersection, unlike union, needs no axiom of its own. This is the first of many places where the two operations, superficially symmetric, turn out not to be.
1.23The algebra of intersection
The laws mirror those for union, with now acting as an annihilator rather than an identity, and with the inclusion in part (5) pointing the other way.
Theorem 1.43 (Laws of intersection). For all sets , , :
- Commutativity. .
- Associativity. .
- Idempotence. .
- Annihilation. .
- Monotonicity and absorption. , and if and only if .
- Absorption across the operations. and .
Proof. (1)–(3) are the arguments of Theorem Laws of union with "or" replaced by "and" throughout, using the commutativity, associativity and idempotence of conjunction.
(4) iff ( and ). The second conjunct is always false, and " and false" is false, so no qualifies and the intersection is empty.
(5) If then in particular , so . Now suppose ; then by the same argument applied with the roles exchanged. Conversely suppose . We have already; and if then by hypothesis, so , giving . Double inclusion gives equality.
(6) For the first, by (5), so by Theorem Laws of union part (5). For the second, by that same part, so by (5) here.∎
Parts (5) of the two theorems together give three equivalent ways of saying : as an inclusion, as , and as . In a Boolean algebra this is how the order is defined from the operations, and it is why every fact about can be turned into an algebraic identity.
1.24Intersections computed
Example 1.44 (Intersecting described sets). Compute .
Solution.
- An integer lies in both exactly when it is a multiple of and of , that is, a common multiple of and .
- The common multiples of two integers are exactly the multiples of their least common multiple, and .
- So the intersection is . It is not the multiples of : the product is not the right answer when the two numbers share a factor.
Example 1.45 (Nested intervals). Compute .
Solution.
- Suppose belongs to every . Then and for every .
- By the Archimedean property there is an with , contradicting . So no such exists.
- The intersection is , even though every set in the family is non-empty and each contains the next. Shrinking non-empty open intervals need not have a common point.
1.25Intersections of arbitrary families
Indexed intersection is defined by the same pattern as indexed union, with "for at least one " replaced by "for every " — and the change of quantifier is exactly what makes the empty index set a genuine problem here when it was harmless there.
Definition 1.46 (Indexed intersection). For an indexed family with ,
Proposition 1.47 (Why the empty index set is excluded). Let . Then the condition " for every " holds for every object whatsoever. Consequently would have to contain every set, and by Corollary There is no set of all sets it is not a set.
Proof. The condition is a universally quantified statement ranging over . It fails for a given only if some has , and there is no at all; so by vacuous truth the condition holds for every , exactly as in Proposition The empty set is contained in everything. The collection defined by the condition therefore contains every object, in particular every set, and no set has that property by Corollary There is no set of all sets.∎
The repair is a convention, and it is the right one: intersections are always taken relative to a fixed ambient set. If every is a subset of a universe , define , which for evaluates to . This is consistent with the general pattern — union over nothing is the smallest set, intersection over nothing is the largest — and it works precisely because is a set rather than the universe of all sets.
1.26Difference and complement
Subtraction of sets is removal of members, and it needs no new principle: it is separation applied with the property "not in ".
Definition 1.48 (Difference, complement, symmetric difference). For sets and ,
is the difference. When all sets under discussion are subsets of a fixed universe , the complement of is . The symmetric difference is
the set of objects in exactly one of the two.
Pitfall. does not require . Elements of that were never in are simply ignored: , and the stray changes nothing. Nor is difference commutative — here — or associative.
Example 1.50 (Differences and symmetric difference). For and compute , , and .
Solution.
- : the elements of not in .
- .
- , of size .
- As a check, : the shared elements are removed from both counts.
1.27Distributive and De Morgan laws
Union and intersection each distribute over the other — a symmetry that addition and multiplication of numbers do not have, since in general. And complementation exchanges the two operations, which is De Morgan's contribution. Both proofs are pure element chasing: unfold the definitions into logic, apply a law of logic, fold back up.
Theorem 1.51 (Distributive laws). For all sets , , :
Proof. For the first, take any and chase it both ways.
() Suppose . Then , and or . In the first case and , so ; in the second . Either way .
() Suppose . Then or . In the first case and , so and ; in the second, and , so again and . Either way .
By Theorem Double inclusion the two sets are equal. The second identity is the same argument with "and" and "or" exchanged throughout: says or ( and ), which by the distributivity of "or" over "and" is equivalent to ( or ) and ( or ), that is .∎
Theorem 1.52 (De Morgan's laws). Let , be subsets of a universe , and write . Then
More generally, for any non-empty indexed family of subsets of ,
Proof. Let . Then means , that is, it is not the case that ( or ). By the logical law , this is equivalent to: and , that is, and , that is, . Extensionality gives the first identity, and the second follows by the companion law .
For the indexed version, means there is no with , which is precisely: for every , ; that is, for every , which is . The other identity is the same argument with the quantifiers exchanged, using that "not for all" is "there exists not".∎
Intuition. De Morgan in words: to fail to be in either of two sets is to be outside both; to fail to be in both is to be outside at least one. The complement swaps "or" with "and", exactly as negation swaps them in logic — which is no coincidence, since , and are , and acting on membership conditions.
Example 1.53 (Simplifying with the laws). Simplify , working inside a universe .
Solution.
- By the second distributive law read backwards, .
- , since no lies both in and outside it.
- So the expression is by Theorem Laws of union part (4).
Example 1.54 (Inclusion–exclusion for three sets). In a survey of people, read newspaper , read , read , read both and , both and , both and , and read all three. How many read none?
Solution.
- Inclusion–exclusion gives .
- By De Morgan, the readers of none form , whose size is .
- So people read none of the three.
1.28Ordered pairs and Cartesian products
Sets are unordered, so to do geometry, define functions or record relations we need a device that remembers order. One is available without new axioms.
Definition 1.55 (Ordered pair and Cartesian product). The ordered pair is defined by Kuratowski's construction ; its defining property is that if and only if and . The Cartesian product of sets and is
We write for .
Proposition 1.56 (Size and distributivity of the product). For finite sets , we have . Moreover, for all sets , , ,
Proof. For the count: an element of is determined by choosing a first coordinate in ways and a second in ways, and distinct choices give distinct pairs by the defining property of ordered pairs; the multiplication principle gives .
For the first identity, iff and ( or ), which by distributivity of "and" over "or" is ( and ) or ( and ), that is . Since every element of either side is an ordered pair, extensionality applies and the sets are equal. The second identity is the same computation with "or" replaced by "and".∎
Pitfall. and are different sets unless or one of them is empty: . And is a product, whereas is a sum — mixing the two is a standard slip in counting problems.
Example 1.57 (Counting pairs and relations). Let and . Compute , , and the number of subsets of .
Solution.
- .
- .
- A subset of is a relation from to ; there are of them, by Theorem The power set of a finite set.
- Confusing with . is true and is not; is true and is not. The correct translation is Theorem Inclusion is a partial order part (4): if and only if .
- Treating as transitive. From and it does not follow that . Only chains.
- Confusing with . The first has cardinality , the second cardinality . Consequently has one element, not none.
- Forgetting that and are subsets of . Both belong to always; "proper subsets" excludes but never .
- Writing . The formula is . For the difference is against .
- Counting a union by adding. only when and are disjoint; in general subtract .
- Proving only one inclusion. Showing proves containment, not equality. Every equality proof needs both directions, or an explicit chain of equalities each of which is reversible.
- Using unrestricted set-builder notation. with no ambient set is the form that produces Russell's paradox. Always write .
- Assuming every collection is a set. "The set of all sets", "the set of all groups" and "the set of all one-element sets" are proper classes, and reasoning with them as sets proves false things.
- Intersecting an empty family. is only meaningful relative to a fixed universe , where it equals . Unrestricted, it is not a set.
- Assuming requires , or that is commutative. Neither holds: elements of outside are simply ignored, and is rarely .
- Reading "or" exclusively. includes the case . There is no "but not both" hidden in the definition.