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 xsource 14 is an element of a set Asource 14, we write xAsource 15; if not, we write xAsource 15. The set which has no elements is called the empty set and denoted “source 17”.

Definition: Extensionality

If Asource 27 and Bsource 27 are sets, then A=Bsource 27 iff every element of Asource 28 is also an element of Bsource 28, and vice versa.

source 26

Extensionality licenses some notation. In general, when we have some objects a1source 33, …, ansource 33, then {a1,,an}source 33 is the set whose elements are a1,,ansource 34. We emphasise the word “the”, since extensionality tells us that there can be only one such set. Indeed, extensionality also licenses the following: {a,a,b}={a,b}={b,a}.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 S={Ruth}source 49. The set of positive integers less than 4source 50 is {1,2,3}source 50, but it can also be written as {3,2,1}source 51 or even as {1,2,1,2,3}source 51. These are all the same set, by extensionality. For every element of {1,2,3}source 53 is also an element of {3,2,1}source 53 (and of {1,2,1,2,3}source 53), and vice versa.

source 46

Frequently we'll specify a set by some property that its elements share. We'll use the following shorthand notation for that: {x:φ(x)}source 60, where the φ(x)source 60 stands for the property that xsource 61 has to have in order to be counted among the elements of the set.

Example 2

In our example, we could have specified Ssource 66 also as S={x:x is a sibling of Richard}.source 67

source 65

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, 6source 77 is perfect because its proper divisors are 1source 78, 2source 78, and 3source 78, and 6=1+2+3source 78. In fact, 6source 79 is the only positive integer less than 10source 79 that is perfect. So, using extensionality, we can say: {6}={x:x is perfect and 0x10}source 81 We read the notation on the right as “the set of xsource 84's such that xsource 84 is perfect and 0x10source 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 xsource 88's such that φ(x)source 88. So, once the existence of such a set has been established, extensionality justifies calling {x:φ(x)}source 90 the set of xsource 90's such that φ(x)source 90.

source 74

Extensionality gives us a way for showing that sets are identical: to show that A=Bsource 95, show that whenever xAsource 95 then also xBsource 95, and whenever yBsource 96 then also yAsource 96.

Exercise 1

Prove that there is at most one empty set, i.e., show that if Asource 99 and Bsource 99 are sets without elements, then A=Bsource 100.

source 98

Subsets and Power Sets

Definition: Subset

If every element of a set Asource 20 is also an element of Bsource 20, then we say that Asource 21 is a subset of Bsource 21, and write ABsource 21. If Asource 22 is not a subset of Bsource 22 we write ABsource 22. If ABsource 23 but ABsource 23, we write ABsource 23 and say that Asource 24 is a proper subset of Bsource 24.

source 19

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, {a,b}{a,b,c}source 30. But {a,b,e}source 30 is not a subset of {a,b,c}source 31.

source 27

Example 5

The number 2source 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., {0}{0,{0}}source 38 and also {0}{0,{0}}source 38.

source 34

Extensionality gives a criterion of identity for sets: A=Bsource 42 iff every element of Asource 43 is also an element of Bsource 43 and vice versa. The definition of “subset” defines ABsource 44 precisely as the first half of this criterion: every element of Asource 45 is also an element of Bsource 46. Of course the definition also applies if we switch Asource 47 and Bsource 47: that is, BAsource 47 iff every element of Bsource 48 is also an element of Asource 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

A=Bsource 53 iff both ABsource 53 and BAsource 53.

source 52

Now is also a good opportunity to introduce some further bits of helpful notation. In defining when Asource 57 is a subset of Bsource 57 we said that “every element of Asource 58 is …,” and filled the “source 58” with “an element of Bsource 59”. But this is such a common shape of expression that it will be helpful to introduce some formal notation for it.

Definition

(xA)φsource 64 abbreviates x(xAφ)source 64. Similarly, (xA)φsource 65 abbreviates x(xAφ)source 65.

source 63

Using this notation, we can say that ABsource 69 iff (xA)xBsource 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 Asource 76 is called the power set of Asource 77, written (A)source 77. (A)={B:BA}source 78

source 75

Example 6

What are all the possible subsets of {a,b,c}source 84? They are: source 85, {a}source 85, {b}source 85, {c}source 85, {a,b}source 85, {a,c}source 85, {b,c}source 85, {a,b,c}source 86. The set of all these subsets is ({a,b,c})source 87: ({a,b,c})={,{a},{b},{c},{a,b},{b,c},{a,c},{a,b,c}}source 88

source 83

Exercise 2

List all subsets of {a,b,c,d}source 95.

source 94

Exercise 3

Show that if Asource 99 has nsource 99 elements, then (A)source 99 has 2nsource 99 elements.

source 98

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: N={0,1,2,3,}the set of natural numbersZ={,2,1,0,1,2,}the set of integersQ={mn:m,nZ and n0}the set of rationalsR=(,)the set of real numbers (the continuum)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 NZQRsource 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 NZQsource 33, since 1source 34 is an integer but not a natural number, and 12source 35 is rational but not integer. It is less obvious that QRsource 36, i.e., that there are some real numbers which are not rational.

We'll sometimes also use the set of positive integers Z+={1,2,3,}source 40 and the set containing just the first two natural numbers B={0,1}source 42.

source 12

Example 8: Strings

Another interesting example is the set Asource 47 of finite strings over an alphabet Asource 48: any finite sequence of elements of Asource 48 is a string over Asource 49. We include the empty string Λsource 49 among the strings over Asource 50, for every alphabet Asource 50. For instance, B={Λ,0,1,00,01,10,11,000,001,010,011,100,101,110,111,0000,}.source 51 If x=x1xnAsource 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 nsource 56 “letters” from Asource 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. nsource 57 and write len(x)=nsource 58.

source 46

Example 9: Infinite sequences

For any set Asource 63 we may also consider the set Aωsource 63 of infinite sequences of elements of Asource 64. An infinite sequence a1a2a3a4source 65 consists of a one-way infinite list of objects, each one of which is an element of Asource 66.

source 62

Unions and Intersections

Definition: Union

The union of two sets Asource 35 and Bsource 35, written ABsource 35, is the set of all things which are elements of Asource 36, Bsource 36, or both. AB={x:xAxB}source 37

source 34

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., {a,b,c}{a,0,1}={a,b,c,0,1}source 45.

The union of a set and one of its subsets is just the bigger set: {a,b,c}{a}={a,b,c}source 47.

The union of a set with the empty set is identical to the set: {a,b,c}={a,b,c}source 50.

source 42

Exercise 4

Prove that if ABsource 55, then AB=Bsource 55.

source 54

Definition: Intersection

The intersection of two sets Asource 72 and Bsource 72, written ABsource 72, is the set of all things which are elements of both Asource 73 and Bsource 73. AB={x:xAxB}source 74 Two sets are called disjoint if their intersection is empty. This means they have no elements in common.

source 71

Example 11

If two sets have no elements in common, their intersection is empty: {a,b,c}{0,1}=source 83.

If two sets do have elements in common, their intersection is the set of all those: {a,b,c}{a,b,d}={a,b}source 86.

The intersection of a set with one of its subsets is just the smaller set: {a,b,c}{a,b}={a,b}source 89.

The intersection of any set with the empty set is empty: {a,b,c}=source 91.

source 81

Exercise 5

Prove rigorously that if ABsource 96, then AB=Asource 96.

source 95

Definition

If Asource 110 is a set of sets, then Asource 110 is the set of elements of elements of Asource 111: A={x:x belongs to an element of A}, i.e.,={x:there is a BA so that xB}source 112

source 109

Definition

If Asource 121 is a set of sets, then Asource 121 is the set of objects which all elements of Asource 122 have in common: A={x:x belongs to every element of A}, i.e.,={x:for all BA,xB}source 123

source 120

Example 12

Suppose A={{a,b},{a,d,e},{a,d}}source 131. Then A={a,b,d,e}source 132 and A={a}source 132.

source 130

Exercise 6

Show that if Asource 135 is a set and ABsource 135, then ABsource 135.

source 134

We could also do the same for a sequence of sets A1source 138, A2source 138, … iAi={x:x belongs to one of the Ai}iAi={x:x belongs to every Ai}.source 139

When we have an index of sets, i.e., some set Isource 144 such that we are considering Aisource 145 for each iIsource 145, we may also use these abbreviations: iIAi={Ai:iI}iIAi={Ai:iI}source 147

Finally, we may want to think about the set of all elements in Asource 152 which are not in Bsource 153. We can depict this as in the difference diagram.

The difference ABsource 157 of two sets is the set of those elements of Asource 158 which are not also elements of Bsource 158.
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. AB

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.

source 155

Definition: Difference

The set difference ABsource 163 is the set of all elements of Asource 164 which are not also elements of Bsource 164, i.e., AB={x:xA and xB}.source 165

source 162

Exercise 7

Prove that if ABsource 171, then BAsource 171.

source 170

Pairs, Tuples, Cartesian Products

Definition: Ordered pair

a,b={{a},{a,b}}source 30.

source 29

Exercise 8

Using the ordered-pair definition, prove that a,b=c,dsource 34 iff both a=csource 35 and b=dsource 35.

source 33

Definition: Cartesian product

Given sets Asource 53 and Bsource 53, their Cartesian product A×Bsource 53 is defined by A×B={x,y:xA and yB}.source 55

source 52

Example 13

If A={0,1}source 61, and B={1,a,b}source 61, then their product is A×B={0,1,0,a,0,b,1,1,1,a,1,b}.source 62

source 60

Example 14

If Asource 69 is a set, the product of Asource 69 with itself, A×Asource 69, is also written A2source 70. It is the set of all pairs x,ysource 70 with x,yAsource 71. The set of all triples x,y,zsource 71 is A3source 71, and so on. We can give a recursive definition: A1=AAk+1=Ak×Asource 73

source 68

Exercise 9

List all elements of {1,2,3}3source 80.

source 79

Proposition

If Asource 84 has nsource 84 elements and Bsource 84 has msource 84 elements, then A×Bsource 84 has nmsource 85 elements.

source 83

Proof

For every element xsource 89 in Asource 89, there are msource 89 elements of the form x,yA×Bsource 90. Let Bx={x,y:yB}source 90. Since whenever x1x2source 91, x1,yx2,ysource 91, Bx1Bx2=source 92. But if A={x1,,xn}source 92, then A×B=Bx1Bxnsource 93, and so has nmsource 94 elements.

To visualize this, arrange the elements of A×Bsource 96 in a grid: Bx1={x1,y1x1,y2x1,ym}Bx2={x2,y1x2,y2x2,ym}Bxn={xn,y1xn,y2xn,ym}source 97 Since the xisource 105 are all different, and the yjsource 105 are all different, no two of the pairs in this grid are the same, and there are nmsource 106 of them.

End of proof.

Exercise 10

Show, by induction on ksource 111, that for all k1source 111, if Asource 111 has nsource 111 elements, then Aksource 112 has nksource 112 elements.

source 110

Example 15

If Asource 116 is a set, a word over Asource 116 is any sequence of elements of Asource 117. A sequence can be thought of as an nsource 117-tuple of elements of Asource 118. For instance, if A={a,b,c}source 118, then the sequence “bacsource 119” can be thought of as the triple b,a,csource 119. Words, i.e., sequences of symbols, are of crucial importance in computer science. By convention, we count elements of Asource 121 as sequences of length 1source 122, and source 122 as the sequence of length 0source 122. The set of all words over Asource 123 then is A={}AA2A3source 124

source 115

Russell's Paradox

Extensionality licenses the notation {x:φ(x)}source 13, for the set of xsource 14's such that φ(x)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 {x:φ(x)}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 Asource 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 R={x:xx}source 40 exist? It turns out that we can prove that it does not.

Theorem: Russell's Paradox

There is no set R={x:xx}source 46.

source 45

Proof

If R={x:xx}source 50 exists, then RRsource 51 iff RRsource 51, which is a contradiction.

End of proof.