Reading preferences
Optional display controls need JavaScript. All reading content and navigation work without it.
How to use Read
Read follows the source chapter in ordinary reading order. Mathematics remains native MathML so a compatible screen reader or braille system can navigate its internal structure. Use the small source links for exact provenance.
Extensionality
A set is a collection of objects, considered as a single object. The objects making up the set are called elements or members of the set. If source 14 is an element of a set source 14, we write source 15; if not, we write source 15. The set which has no elements is called the empty set and denoted “source 17”.
Definition: Extensionality
If source 27 and source 27 are sets, then source 27 iff every element of source 28 is also an element of source 28, and vice versa.
Extensionality licenses some notation. In general, when we have some objects source 33, …, source 33, then source 33 is the set whose elements are source 34. We emphasise the word “the”, since extensionality tells us that there can be only one such set. Indeed, extensionality also licenses the following: source 38 This delivers on the point that, when we consider sets, we don't care about the order of their elements, or how many times they are specified.
Example 1
Whenever you have a bunch of objects, you can collect them together in a set. The set of Richard's siblings, for instance, is a set that contains one person, and we could write it as source 49. The set of positive integers less than source 50 is source 50, but it can also be written as source 51 or even as source 51. These are all the same set, by extensionality. For every element of source 53 is also an element of source 53 (and of source 53), and vice versa.
Frequently we'll specify a set by some property that its elements share. We'll use the following shorthand notation for that: source 60, where the source 60 stands for the property that source 61 has to have in order to be counted among the elements of the set.
Example 2
In our example, we could have specified source 66 also as source 67
Example 3
A number is called perfect iff it is equal to the sum of its proper divisors (i.e., numbers that evenly divide it but aren't identical to the number). For instance, source 77 is perfect because its proper divisors are source 78, source 78, and source 78, and source 78. In fact, source 79 is the only positive integer less than source 79 that is perfect. So, using extensionality, we can say: source 81 We read the notation on the right as “the set of source 84's such that source 84 is perfect and source 85”. The identity here confirms that, when we consider sets, we don't care about how they are specified. And, more generally, extensionality guarantees that there is at most one set of source 88's such that source 88. So, once the existence of such a set has been established, extensionality justifies calling source 90 the set of source 90's such that source 90.
Extensionality gives us a way for showing that sets are identical: to show that source 95, show that whenever source 95 then also source 95, and whenever source 96 then also source 96.
Exercise 1
Prove that there is at most one empty set, i.e., show that if source 99 and source 99 are sets without elements, then source 100.
Subsets and Power Sets
Definition: Subset
If every element of a set source 20 is also an element of source 20, then we say that source 21 is a subset of source 21, and write source 21. If source 22 is not a subset of source 22 we write source 22. If source 23 but source 23, we write source 23 and say that source 24 is a proper subset of source 24.
Example 4
Every set is a subset of itself, and source 28 is a subset of every set. The set of natural even numbers is a subset of the set of natural numbers. Also, source 30. But source 30 is not a subset of source 31.
Example 5
The number source 35 is an element of the set of integers, whereas the set of even numbers is a subset of the set of integers. However, a set may happen to both be an element and a subset of some other set, e.g., source 38 and also source 38.
Extensionality gives a criterion of identity for sets: source 42 iff every element of source 43 is also an element of source 43 and vice versa. The definition of “subset” defines source 44 precisely as the first half of this criterion: every element of source 45 is also an element of source 46. Of course the definition also applies if we switch source 47 and source 47: that is, source 47 iff every element of source 48 is also an element of source 48. And that, in turn, is exactly the “vice versa” part of extensionality. In other words, extensionality entails that sets are equal iff they are subsets of one another.
Proposition
Now is also a good opportunity to introduce some further bits of helpful notation. In defining when source 57 is a subset of source 57 we said that “every element of source 58 is …,” and filled the “source 58” with “an element of source 59”. But this is such a common shape of expression that it will be helpful to introduce some formal notation for it.
Definition
source 64 abbreviates source 64. Similarly, source 65 abbreviates source 65.
Using this notation, we can say that source 69 iff source 69.
Now we move on to considering a certain kind of set: the set of all subsets of a given set.
Definition: Power Set
The set consisting of all subsets of a set source 76 is called the power set of source 77, written source 77. source 78
Example 6
What are all the possible subsets of source 84? They are: source 85, source 85, source 85, source 85, source 85, source 85, source 85, source 86. The set of all these subsets is source 87: source 88
Exercise 2
List all subsets of source 95.
Exercise 3
Show that if source 99 has source 99 elements, then source 99 has source 99 elements.
Some Important Sets
Example 7
We will mostly be dealing with sets whose elements are mathematical objects. Four such sets are important enough to have specific names: source 16 These are all infinite sets, that is, they each have infinitely many elements.
As we move through these sets, we are adding more numbers to our stock. Indeed, it should be clear that source 30: after all, every natural number is an integer; every integer is a rational; and every rational is a real. Equally, it should be clear that source 33, since source 34 is an integer but not a natural number, and source 35 is rational but not integer. It is less obvious that source 36, i.e., that there are some real numbers which are not rational.
We'll sometimes also use the set of positive integers source 40 and the set containing just the first two natural numbers source 42.
Example 8: Strings
Another interesting example is the set source 47 of finite strings over an alphabet source 48: any finite sequence of elements of source 48 is a string over source 49. We include the empty string source 49 among the strings over source 50, for every alphabet source 50. For instance, source 51 If source 56 is a stringReader correction: the source has no space between the displayed formula and ‘is’. This reader restores the space; the source file is unchanged. consisting of source 56 “letters” from source 57, then we say the length of the string isReader correction: the source omits ‘the’ before ‘length’. This reader supplies it; the source file is unchanged. source 57 and write source 58.
Example 9: Infinite sequences
For any set source 63 we may also consider the set source 63 of infinite sequences of elements of source 64. An infinite sequence source 65 consists of a one-way infinite list of objects, each one of which is an element of source 66.
Unions and Intersections
Definition: Union
The union of two sets source 35 and source 35, written source 35, is the set of all things which are elements of source 36, source 36, or both. source 37
Example 10
Since the multiplicity of elements doesn't matter, the union of two sets which have an element in common contains that element only once, e.g., source 45.
The union of a set and one of its subsets is just the bigger set: source 47.
The union of a set with the empty set is identical to the set: source 50.
Exercise 4
Definition: Intersection
The intersection of two sets source 72 and source 72, written source 72, is the set of all things which are elements of both source 73 and source 73. source 74 Two sets are called disjoint if their intersection is empty. This means they have no elements in common.
Example 11
If two sets have no elements in common, their intersection is empty: source 83.
If two sets do have elements in common, their intersection is the set of all those: source 86.
The intersection of a set with one of its subsets is just the smaller set: source 89.
The intersection of any set with the empty set is empty: source 91.
Exercise 5
Definition
If source 110 is a set of sets, then source 110 is the set of elements of elements of source 111: source 112
Definition
If source 121 is a set of sets, then source 121 is the set of objects which all elements of source 122 have in common: source 123
Example 12
Suppose source 131. Then source 132 and source 132.
Exercise 6
Show that if source 135 is a set and source 135, then source 135.
We could also do the same for a sequence of sets source 138, source 138, … source 139
When we have an index of sets, i.e., some set source 144 such that we are considering source 145 for each source 145, we may also use these abbreviations: source 147
Finally, we may want to think about the set of all elements in source 152 which are not in source 153. We can depict this as in the difference diagram.
Difference A minus B: elements in A but not B. The highlighted region is the part of A outside B, containing elements in A that are not in B.
- Set A
- The left boundary.
- Set B
- The right boundary.
- Highlighted region
- The highlighted region is the part of A outside B, containing elements in A that are not in B.
Definition: Difference
The set difference source 163 is the set of all elements of source 164 which are not also elements of source 164, i.e., source 165
Exercise 7
Prove that if source 171, then source 171.
Pairs, Tuples, Cartesian Products
Definition: Ordered pair
Exercise 8
Using the ordered-pair definition, prove that source 34 iff both source 35 and source 35.
Definition: Cartesian product
Given sets source 53 and source 53, their Cartesian product source 53 is defined by source 55
Example 13
If source 61, and source 61, then their product is source 62
Example 14
If source 69 is a set, the product of source 69 with itself, source 69, is also written source 70. It is the set of all pairs source 70 with source 71. The set of all triples source 71 is source 71, and so on. We can give a recursive definition: source 73
Exercise 9
List all elements of source 80.
Proposition
If source 84 has source 84 elements and source 84 has source 84 elements, then source 84 has source 85 elements.
Proof
For every element source 89 in source 89, there are source 89 elements of the form source 90. Let source 90. Since whenever source 91, source 91, source 92. But if source 92, then source 93, and so has source 94 elements.
To visualize this, arrange the elements of source 96 in a grid: source 97 Since the source 105 are all different, and the source 105 are all different, no two of the pairs in this grid are the same, and there are source 106 of them.
End of proof.
Exercise 10
Show, by induction on source 111, that for all source 111, if source 111 has source 111 elements, then source 112 has source 112 elements.
Example 15
If source 116 is a set, a word over source 116 is any sequence of elements of source 117. A sequence can be thought of as an source 117-tuple of elements of source 118. For instance, if source 118, then the sequence “source 119” can be thought of as the triple source 119. Words, i.e., sequences of symbols, are of crucial importance in computer science. By convention, we count elements of source 121 as sequences of length source 122, and source 122 as the sequence of length source 122. The set of all words over source 123 then is source 124
Russell's Paradox
Extensionality licenses the notation source 13, for the set of source 14's such that source 14. However, all that extensionality really licenses is the following thought. If there is a set whose members are all and only the source 16's, then there is only one such set. Otherwise put: having fixed some source 18, the set source 18 is unique, if it exists.
But this conditional is important Crucially, not every property lends itself to comprehension. That is, some properties do not define sets. If they all did, then we would run into outright contradictions. The most famous example of this is Russell's Paradox.
Sets may be elements of other sets—for instance, the power set of a set source 28 is made up of sets. And so it makes sense to ask or investigate whether a set is an element of another set. Can a set be a member of itself? Nothing about the idea of a set seems to rule this out. For instance, if all sets form a collection of objects, one might think that they can be collected into a single set—the set of all sets. And it, being a set, would be an element of the set of all sets.
Russell's Paradox arises when we consider the property of not having itself as an element, of being non-self-membered. What if we suppose that there is a set of all sets that do not have themselves as an element? Does source 40 exist? It turns out that we can prove that it does not.
Theorem: Russell's Paradox
There is no set source 46.
Proof
If source 50 exists, then source 51 iff source 51, which is a contradiction.
End of proof.