Lecture 2

Sets and functions

Having spent the best part of an hour trying to persuade you that mathematics is not about numbers, most of this semester will now be about numbers.

But in order to study them properly, we’ll need to start at the beginning, by talking about sets.

Sets of numbers

One problem with numbers is that there are several different sorts of them.

We’re probably used to several sorts already:

natural numbers


rational numbers

real numbers

complex numbers

We’ll go into more detail later in the course.

We often need to say which we mean, in order to avoid confusion and error. For example, it’s certainly possible that I might invite 33 friends over for dinner, but it’s hard to invite 5-5 friends or 3/43/4 friends or 2\sqrt{2} friends over.

The natural numbers

The natural numbers are all the numbers you might find by counting.

The set of natural numbers is written N\mathbb{N} (that’s just a letter N, written in a style called “blackboard bold”); in set notation, we might write N={0,1,2,3,}.\mathbb{N}= \left\{ 0, 1, 2, 3, \ldots \right\}.

That “\ldots” is often pronounced “dot-dot-dot”, but it has the meaning of “and so on”. When we use this symbol, we must be sure that the reader will be sure how to go on from here. Here I hope it really is clear: we go on with 44, 55, 66, adding one each time as we go, and we are to go on without end.

We’ll see many more of those curly brackets later!

Actually, some mathematicians use the phrase “natural numbers” slightly differently, to denote the set {1,2,3,}.\left\{ 1, 2, 3, \ldots \right\}. In other words, they leave out 0.

Our convention in this module will be that 0N0\in\mathbb{N}: that zero is a natural number.

If we’re trying to work inside the natural numbers, we can add and multiply all we want, but subtraction and division are a pain: for example we can’t do

353-5, or 2/72/7.

Working with a bigger system of numbers can cure this.

The integers

The integers are all the whole numbers, positive, negative and zero. The set of integers is denoted by Z\mathbb{Z} (why Z? The German word for “number” is “Zahl”). So we might write Z={,2,1,0,1,2,}.\mathbb{Z}= \left\{ \ldots, -2, -1, 0, 1, 2, \ldots \right\}. Here we have to go on in both directions without end.

Every natural number is an integer. This means that NZ,\mathbb{N}\subset \mathbb{Z}, or, in words, “the set of naturals is contained in the set of integers”.

We often use the handy words non-negative, meaning “not negative” (in other words, positive or zero) and non-positive, meaning “not positive” (in other words, negative or zero).

So the natural numbers are the same thing as the nonnegative integers.

If we’re working in the integers, we can add, subtract and multiply all we want. Division is still a problem: for example, we can’t do


The rational numbers

The rational numbers (sometimes just called the rationals), are the numbers that can be written as fractions ab\frac{a}{b}, where aa and bb are integers and b0b\neq 0.

Fractions can be written in many different ways: for example, we have 12=24=510=36.\frac{1}{2} = \frac{2}{4} = \frac{5}{10} = \frac{-3}{-6}.

In general, fractions ab=cd\frac{a}{b} = \frac{c}{d} are equal if


We write Q\mathbb{Q} for the set of rational numbers (Q stands for “quotient”, which is a name for what you get when you do division).

Of course, any integer nn can be regarded as a rational (we can take n1\frac{n}{1}), so ZQ.\mathbb{Z}\subset\mathbb{Q}.

If we’re working in the rationals, we can add, subtract, multiply and divide all we want. (Well, we can’t divide by zero, but who wants to divide by zero?).

There are still many things we might want to do but can’t do in the rationals though: square roots, logarithms, trigonometry, and suchlike.

The real numbers

The real numbers R\mathbb{R} are perhaps the most general sort of numbers you’ll have used by now (or perhaps not). They contain lots of the numbers you care about, for example: πR,log1729R,5R,sin(37)R.\pi\in\mathbb{R},\qquad \log 1729\in\mathbb{R},\qquad \sqrt{5}\in\mathbb{R},\qquad \sin(37^\circ)\in\mathbb{R}.

One could define R\mathbb{R} as the set of all possible decimal expansions, but there are problems with this:

Producing a good and useful definition of R\mathbb{R} is quite tricky, and there wasn’t one until about 1870. We’ll see one later in the course.

Sets in general

Now we have all these collections of numbers, it’s good to have a language to discuss them with.

A set is a collection of objects. The objects in a set are often called its elements.

Given a set SS, we write:

Listing elements

If we have a small set, it might be practical to define it by listing its elements; we do so in curly brackets. Here’s an example set: T={Tinky Winky,Dipsy,Laa-Laa,Po}.T = \left\{ \textrm{Tinky Winky}, \textrm{Dipsy}, \textrm{Laa-Laa}, \textrm{Po}\right\}. Let’s write some examples of facts about TT using our notation:

PoT,Noo-nooT,T=4\textrm{Po}\in T, \qquad \textrm{Noo-noo}\notin T, \qquad |T| = 4

Note that sets don’t have any ordering on them. If we find it more convenient to list Teletubbies according to alphabetic order, we can write T={Dipsy,Laa-Laa,Po,Tinky Winky},T = \left\{ \textrm{Dipsy}, \textrm{Laa-Laa}, \textrm{Po}, \textrm{Tinky Winky}\right\}, and in doing so we are defining exactly the same set TT.

Also note that an element is either in a set, or not in it. So we could, if we wanted, define exactly the same set again by writing T={Dipsy,Laa-Laa,Po,Po,Po,Po,Po,Tinky Winky,Dipsy}.T = \left\{ \textrm{Dipsy}, \textrm{Laa-Laa}, \textrm{Po}, \textrm{Po}, \textrm{Po}, \textrm{Po}, \textrm{Po}, \textrm{Tinky Winky}, \textrm{Dipsy} \right\}. However, there are few good reasons to write something like that.

Empty sets

The empty set, which could be written {}\left\{\right\}, is more commonly written \emptyset. It has size given by =0|\emptyset|=0.

Note that \emptyset is very different to {}\left\{ \emptyset \right\}. The former, as I mentioned, has no elements; the latter has exactly one element.

That shouldn’t confuse you. They’re different for pretty much the same reason that “an empty bag” is not the same thing as “a bag which contains an empty bag and nothing else”.


If AA and BB are sets, we write ABA\subset B to mean “if xx is a member of AA then xx is also a member of BB”. We say that AA is a subset of BB, or that AA is contained in BB.

The symbols “\in” and “\subset” are different, and using the wrong one tends to result in nonsense.

For example, we might write MathematiciansPeople,\textrm{Mathematicians}\subset\textrm{People}, which says “all mathematicians are people”. If we used the symbol “\in” instead, that would mean that “mathematicians is a person”. It’s not a mistake you’d make speaking English, and if you’re using symbols you should aim to be no less precise.

Notice that, for every set AA we have AAandA.A\subset A\qquad\text{and}\qquad \emptyset\subset A.