MA103 Lecture Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 130
At a glance
Powered by AI
The document provides lecture notes for an introduction to abstract mathematics course, covering topics such as mathematical statements, logic, sets and proofs.

The first half of the course covers mathematical statements and proof, basic logic, if-then statements, logical equivalence, converse and contrapositive statements, working backwards to obtain proofs, sets, quantifiers and proof by contradiction.

Mathematical statements are introduced along with examples. Different methods of proving statements such as direct proof, proof by contradiction and constructive proof are discussed. The importance of logical reasoning is emphasized.

MA103 Introduction to Abstract Mathematics Lecture Notes, First Half1

Michaelmas term

c Martin Anthony 2012

ii

Contents

Contents
Preface 1 Introduction 1.1 This course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 1.1.2 1.1.3 1.2 1.3 1.4 Aims . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Learning objectives . . . . . . . . . . . . . . . . . . . . . . . . . . Topics covered (rst half of the course) . . . . . . . . . . . . . . . 1 3 3 4 4 4 4 5 5 7 7 7 7 9 12 13 14 16 17 18 18 19 20 20 20 21 21 21 22

Moodle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Activities and sample exercises . . . . . . . . . . . . . . . . . . . . . . .

2 Mathematical statements, proof, logic and sets 2.1 2.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mathematical statements and proof . . . . . . . . . . . . . . . . . . . . . 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.4 2.5 2.6 2.7 2.8 2.9 Examples of Mathematical Statements . . . . . . . . . . . . . . . Introduction to proving statements . . . . . . . . . . . . . . . . . Negation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conjunction and disjunction . . . . . . . . . . . . . . . . . . . . .

Some basic logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

If-then statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Logical equivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Converse statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contrapositive statements . . . . . . . . . . . . . . . . . . . . . . . . . . Working backwards to obtain a proof . . . . . . . . . . . . . . . . . . . . Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unions and intersections . . . . . . . . . . . . . . . . . . . . . . . Universal sets and complements . . . . . . . . . . . . . . . . . . . Sets and logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cartesian products . . . . . . . . . . . . . . . . . . . . . . . . . .

iii

Contents

2.9.7

Power sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

22 22 24 25 25 25 26 27 28 29 30 31 31 35 35 35 36 37 37 37 38 39 40 40 42 42 43 44 45 49 49 49 49 50

2.10 Quantiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.11 Proof by contradiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.12 Some terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.13 General advice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.13.2 How to write mathematics . . . . . . . . . . . . . . . . . . . . . . 2.13.3 How to do mathematics . . . . . . . . . . . . . . . . . . . . . . . 2.13.4 How to become better in mathematics . . . . . . . . . . . . . . . 2.14 Learning outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.15 Sample exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.16 Comments on selected activities . . . . . . . . . . . . . . . . . . . . . . . 2.17 Solutions to exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Natural numbers and proof by induction 3.1 3.2 3.3 3.4 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Natural numbers: an axiomatic approach . . . . . . . . . . . . . . . . . . Least and greatest members and the well-ordering principle . . . . . . . . The principle of induction . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1 3.4.2 3.4.3 3.5 3.6 3.7 3.8 3.9 Proof by induction . . . . . . . . . . . . . . . . . . . . . . . . . . An example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Summation formulae . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Recursively dened sequences . . . . . . . . . . . . . . . . . . . . . . . . Using the axioms for the natural numbers . . . . . . . . . . . . . . . . . Why the Principle works . . . . . . . . . . . . . . . . . . . . . . . . . . . Learning outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.10 Sample exercises

3.11 Comments on selected activities . . . . . . . . . . . . . . . . . . . . . . . 3.12 Solutions to exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Functions and counting 4.1 4.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.1 4.2.2 Basic denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . Composition of functions . . . . . . . . . . . . . . . . . . . . . . .

iv

Contents

4.3 4.4

Bijections, surjections and injections . . . . . . . . . . . . . . . . . . . . 4.3.1 4.4.1 4.4.2 An example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Denition, and existence . . . . . . . . . . . . . . . . . . . . . . . Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inverse functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

50 51 52 52 52 53 54 54 55 57 58 58 59 60 60 63 63 63 63 64 64 66 68 69 69 70 70 71 73 73 73 73 74 75

4.5 4.6

Counting as a bijection . . . . . . . . . . . . . . . . . . . . . . . . . . . . The pigeonhole principle . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6.1 4.6.2 The principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Some applications of the Pigeonhole Principle . . . . . . . . . . .

4.7 4.8 4.9

A generalised form of PP . . . . . . . . . . . . . . . . . . . . . . . . . . . Innite sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Learning outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.10 Sample exercises

4.11 Comments on selected activities . . . . . . . . . . . . . . . . . . . . . . . 4.12 Solutions to exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Equivalence relations and the integers 5.1 5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Equivalence relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 5.2.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 Relations in general . . . . . . . . . . . . . . . . . . . . . . . . . . The special properties of equivalence relations . . . . . . . . . . .

Equivalence classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Construction of the integers from the natural numbers . . . . . . . . . . Properties of the integers . . . . . . . . . . . . . . . . . . . . . . . . . . . Ordering the integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Learning outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sample exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comments on selected activities . . . . . . . . . . . . . . . . . . . . . . .

5.10 Solutions to exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Divisibility and prime numbers 6.1 6.2 6.3 6.4 6.5 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Divisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quotients and remainders . . . . . . . . . . . . . . . . . . . . . . . . . . Representation of integers with respect to a base . . . . . . . . . . . . . . Greatest common divisor . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contents

6.6 6.7 6.8 6.9

The Euclidean algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . Some consequences of the Euclidean algorithm . . . . . . . . . . . . . . . Prime numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Prime factorization: the Fundamental Theorem of Arithmetic . . . . . . . 6.9.1 6.9.2 The Fundamental Theorem . . . . . . . . . . . . . . . . . . . . . Proof of the Fundamental Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

76 77 78 79 79 79 80 81 82 83 87 87 87 87 89 90 91 92 92 93 94 95 95 96 99 99 99 99 100 100 102 102 103 105

6.10 Learning outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.11 Sample exercises 6.12 Comments on selected activities . . . . . . . . . . . . . . . . . . . . . . . 6.13 Solutions to exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Congruence and modular arithmetic 7.1 7.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Congruence modulo m . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.1 7.2.2 7.3 7.4 7.5 The congruence relation . . . . . . . . . . . . . . . . . . . . . . . Congruence classes . . . . . . . . . . . . . . . . . . . . . . . . . .

Zm and its arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Invertible elements in Zm . . . . . . . . . . . . . . . . . . . . . . . . . . . Solving equations in Zm . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.5.1 7.5.2 Single linear equations . . . . . . . . . . . . . . . . . . . . . . . . Systems of linear equations . . . . . . . . . . . . . . . . . . . . .

7.6 7.7 7.8 7.9

Learning outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sample exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comments on selected activities . . . . . . . . . . . . . . . . . . . . . . . Solutions to exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8 Rational, real and complex numbers 8.1 8.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rational numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.1 8.2.2 8.2.3 8.3 8.3.1 8.3.2 8.3.3 An important equivalence relation . . . . . . . . . . . . . . . . . . Rational numbers as equivalence classes . . . . . . . . . . . . . . Doing arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . Real numbers: a sketchy introduction . . . . . . . . . . . . . . . Rationality and repeating patterns . . . . . . . . . . . . . . . . . Irrational numbers . . . . . . . . . . . . . . . . . . . . . . . . . .

Rational numbers and real numbers . . . . . . . . . . . . . . . . . . . . .

vi

Contents

8.3.4 8.4 8.4.1 8.4.2 8.5 8.5.1 8.5.2 8.5.3 8.5.4 8.5.5 8.5.6 8.5.7 8.6 8.7 8.8 8.9

Density of the rational numbers . . . . . . . . . . . . . . . . . . Countability of the rationals . . . . . . . . . . . . . . . . . . . . . Uncountability of the real numbers . . . . . . . . . . . . . . . . . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Complex numbers: a formal approach . . . . . . . . . . . . . . . . Complex numbers: a more usual approach . . . . . . . . . . . . . Roots of polynomials . . . . . . . . . . . . . . . . . . . . . . . . . The complex plane . . . . . . . . . . . . . . . . . . . . . . . . . . Polar form of z . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exponential form of z . . . . . . . . . . . . . . . . . . . . . . . .

105 106 107 110 110 110 110 111 113 114 114 116 118 119 119 121

Countability of rationals and uncountability of real numbers . . . . . . .

Complex numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Learning outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sample exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comments on selected activities . . . . . . . . . . . . . . . . . . . . . . . Solutions to exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

vii

Contents

viii

Preface
The text of these notes is mainly an edited version of the rst half of a subject guide I wrote for the University of London International Programmes. I thank Michele Harvey for her help with the material on complex numbers. I am grateful to Keith Martin, Jan van den Heuvel and Amol Sasane for carefully reading a draft of the subject guide and for suggesting ways in which to improve it. These notes also incorporate materials written in previous years by Jan van den Heuvel and Graham Brightwell and I am grateful to them for allowing me to use these. Thanks also to Mark Baltovic for help with typesetting.

Preface

Chapter 1 Introduction
In this very brief introduction, I aim to give you an idea of the nature of this subject and to advise on how best to approach it. I also give general information about these notes and recommended reading.

1.1

This course

In Introduction to Abstract Mathematics the emphasis is on theory rather than method: we will want to understand why certain techniques work, and how we might be able to prove that they do, for example. The main central topic in this course is proof. This course is an introduction to formal mathematical reasoning, in which proof is central. We will meet the fundamental concepts and constructions of mathematics and see how to formulate mathematical statements in precise terms, and we will see how such statements can be proved or disproved. In this course, we need to work with precise denitions and statements, and you will need to know these. Not only will you need to know these, but you will have to understand them, and be able (through the use of them) to demonstrate that you understand them. Simply learning the denitions without understanding what they mean is not going to be adequate. I hope that these words of warning dont discourage you, but I think its important to make it clear that this is a subject at a higher conceptual level than most of the mathematics you are likely to have studied before. In this course, you will learn how to prove mathematical statements precisely. This is a very dierent sort of mathematics from that which you will have encountered in many other mathematics courses you have previously taken, where the emphasis is on solving problems through calculation. In Abstract Mathematics, one has to be able to produce convincing mathematical arguments as to why a given mathematical statement is true or false. For example, a prime number is a positive integer greater than 1 that is only divisible by itself and the number 1 (so 7 is a prime number, but 8 is not). The statement There are innitely many prime numbers is a mathematical statement, and it is either true (there are innitely many prime numbers) or false (there are only a nitely many prime numbers). In fact, the statement is true. But why? Theres no quick calculation we can do to establish the truth of the statement. What is needed is a proof: a watertight, logical argument. This is the type of problem we consider in this course.

1. Introduction

1.1.1

Aims

The course is designed to enable you to: develop your ability to think in a critical manner; formulate and develop mathematical arguments in a logical manner; improve your skill in acquiring new understanding and expertise; acquire an understanding of basic abstract mathematics, and the role of logical argument in mathematics.

1.1.2

Learning objectives

Having taken this subject, you should: have a knowledge of basic mathematical concepts in discrete mathematics, algebra, and real analysis; be able to use formal notation correctly and in connection with precise statements in English; be able to solve mathematical problems in discrete mathematics, algebra and real analysis; be able to nd and formulate simple proofs.

1.1.3

Topics covered (rst half of the course)

Descriptions of topics to be covered appear in the relevant chapters. However, it is useful to give a brief overview at this stage. These notes cover the rst half of this course. Here, we are concerned primarily with proof, logic, and number systems. We will rst investigate how precise mathematical statements can be formulated, and here we will use the language and symbols of mathematical logic. We will then study how one can prove or disprove mathematical statements. Next, we look at some important ideas connected with functions, relations, and numbers. For example, we will look at prime numbers and learn what special properties these important numbers have, and how one may prove such properties.

1.2

Moodle

All information and materials for this course are on Moodle: http://moodle.lse.ac.uk/course/view.php?id=1989 On the course Moodle page, you will nd assignments, solutions, lecture notes, and so on.

1.3. Reading

1.3

Reading

There are many books that would be useful for this subject, since abstract mathematics is a components of almost all university-level mathematics degree programmes. For the rst half of the course (the part covered by these notes), the following two books are recommended.

R R

Biggs, Norman L., Discrete Mathematics. (Clarendon Press: Oxford, 2002) Second edition. [ISBN 0198507178]. Eccles, P.J., An Introduction to Mathematical Reasoning: numbers, sets and functions. (Cambridge University Press, 1997). [ISBN 0521597188].

There is one topic that neither of these covers, which is the topic of Complex Numbers. However, this is a topic that is well-covered in a number of other textbooks and I have included a fairly full treatment of it in these notes to compensate for the fact that it is not covered in these two recommended textbooks.

1.4

Activities and sample exercises

Throughout the chapters of these notes, youll nd activities. These are things for you to do or think about as you read, just to rearm that youve understood the material. At the end of each chapter of these notes you will nd some sample exercises together with solutions. These are not the exercises that will be assigned for classes, but are additional to those. They are a very useful resource. You should try them once you think you have mastered a particular chapter. Really try them: dont just simply read the solutions provided. Make a serious attempt before consulting the solutions. Note that the solutions are often just sketch solutions, to indicate to you how to answer the questions.

1. Introduction

Chapter 2 Mathematical statements, proof, logic and sets

R R
2.1

Biggs, N.L. Discrete Mathematics. Chapters 13. Eccles, P.J. An Introduction to Mathematical Reasoning. Chapters 14 and 6.

Introduction

In this important chapter, we set the ground for much of what follows in this course. Abstract Mathematics is about making precise mathematical statements and establishing, by proof or disproof, whether these statements are true or false. In this chapter we look at what this means, concentrating on fairly simple types of mathematical statement, in order to emphasise techniques of proof. In later chapters (such as those on numbers, analysis and algebra) we will use these proof techniques extensively. You might think that some of the things we prove in this chapter are very obvious and hardly merit proving, but proving even obvious statements can be quite tricky sometimes, and it is good preparation for proving more complicated things later.

2.2

Mathematical statements and proof

To introduce the topics of mathematical statement and proof, we start by giving some explicit examples. Later in the chapter we give some general theory and principles. Our discussion of the general theory is limited because this is not a course in logic, as such. What we do need is enough logic to understand what mathematical statements mean and how we might prove or disprove them.

2.2.1

Examples of Mathematical Statements

Consider the following statements (in which, you should recall that the natural numbers are the positive integers): (a) 20 is divisible by 4. (b) 21 is not divisible by 7. (c) 21 is divisible by 4. (d) 21 is divisible by 3 or 5.

2. Mathematical statements, proof, logic and sets

(e) 50 is divisible by 2 and 5.

(f) n2 is even. (g) For every natural number n, the number n2 + n is even. (h) There is a natural number n such that 2n = 2n . (i) If n is even, then n2 is even. (j) For all odd numbers n, n2 is odd. (k) For natural numbers n, n2 is even if and only if n is even. (l) There are no natural numbers m and n such that 2 = m/n. These are all mathematical statements, of dierent sorts (all of which will be discussed in more detail in the remainder of this chapter). Statements (a) to (e) are straightforward propositions about certain numbers, and these are either true or false. Statements (d) and (e) are examples of compound statements. Statement (d) is true precisely when either one (or both) of the statements 21 is divisible by 3 and 21 is divisible by 5 is true. Statement (e) is true precisely when both of the statements 50 is divisible by 2 and 50 is divisible by 5 are true. Statement (f) is dierent, because the number n is not specied and whether the statement is true or false will depend on the value of the so-called free variable n. Such a statement is known as a predicate. Statement (g) makes an assertion about all natural numbers and is an example of a universal statement. Statement (h) asserts the existence of a particular number and is an example of an existential statement. Statement (i) can be considered as an assertion about all even numbers, and so it is a universal statement, where the universe is all even numbers. But it can also be considered as an implication, asserting that if n happens to be even, then n2 is even. Statement (j) is a universal statement about all odd numbers. It can also be thought of (or rephrased) as an implication, for it says precisely the same as if n is odd, then n2 is odd. Statement (k) is an if and only if statement: what it says is that n2 is even, for a natural number n, precisely when n is even. But this means two things: namely that n2 is even if n is even, and n is even if n2 is even. Equivalently, it means that n2 is even if n is even and that n2 is odd if n is odd. So statement (k) will be true precisely if (i) and (j) are true. Statement (l) asserts the non-existence of a certain pair of numbers (m, n). Another way of thinking about this statement is that it says that for all choices of (m, n), it is not the case that m/n = 2. (This is an example of the general rule that a non-existence statement can be thought of as a universal statement, something to be discussed later in more detail.) Its probably worth giving some examples of things that are not proper mathematical statements.

2.2. Mathematical statements and proof

6 is a nice number is not a mathematical statement. This is because nice number has no mathematical meaning. However, if, beforehand, we had dened nice number in some way, then this would not be a problem. For example, suppose we said: Let us say that a number is nice if it is the sum of all the positive numbers that divide it and are less than it. Then 6 is a nice number would be a proper mathematical statement, and it would be true, because 6 has positive divisors 1, 2, 3, 6 and 6 = 1 + 2 + 3. But without dening what nice means, its not a mathematical statement. Denitions are important. n2 + n is not a mathematical statement, because it does not say anything about n2 + n. It is not a mathematical statement in the same way that David Cameron is not a sentence: it makes no assertion about what David Cameron is or does. However, n2 + n > 0 is an example of a predicate with free variable n and, for a particular value of n, this is a mathematical statement. Likewise, for all natural numbers n, n2 + n > 0 is a mathematical statement.

2.2.2

Introduction to proving statements

Weve seen, above, various types of mathematical statement, and such statements are either true or false. But how would we establish the truth or falsity of these? We can, even at this early stage, prove (by which we mean establish the truth of) or disprove (by which we mean establish the falsity of) most of the statements given above. Heres how we can do this. (a) 20 is divisible by 4. This statement is true. Yes, yes, I know its obvious, but stay with me. To give a proper proof, we need rst to understand exactly what the word divisible means. You will probably most likely think that this means that when we divide 20 by 4 we get no remainder. This is correct: in general, for natural numbers n and d, to say that n is divisible by d (or, equivalently, that n is a multiple of d) means precisely that there is some natural number m for which n = md. Since 20 = 5 4, we see that 20 is divisible by 4. And thats a proof! Its utterly convincing, watertight, and not open to debate. Nobody can argue with it, not even a sociologist! Isnt this fun? Well, maybe its not that impressive in such a simple situation, but we will certainly prove more impressive results later. (b) 21 is not divisible by 7. This is false. Its false because 21 is divisible by 7, because 21 = 3 7. (c) 21 is divisible by 4. This is false, as can be established in a number of ways. First, we note that if the natural number m satises m 5, then m 4 will be no more than 20. And if m 6 then m 4 will be at least 24. Well, any natural number m is either at most 5 or at least 6 so, for all possible m, we do not have m 4 = 21 and hence there is no natural number m for which m 4 = 21. In other words, 21 is not divisible by 4. Another argument (which is perhaps more straightforward, but which relies on

2. Mathematical statements, proof, logic and sets

properties of rational numbers rather than just simple properties of natural numbers) is to note that 21/4 = 5.25, and this is not a natural number, so 21 is not divisible by 4. (This second approach is the same as showing that 21 has remainder 1, not 0, when we divide by 4.) (d) 21 is divisible by 3 or 5. As we noted above, this is a compound statement and it will be true precisely when one (or both) of the following statements is true: (i) 21 is divisible by 3 (ii) 21 is divisible by 5. Statement (i) is true, because 21 = 7 3. Statement (ii) is false. Because at least one of these two statements is true, statement (d) is true. (e) 50 is divisible by 2 and 5. This is true. Again, this is a compound statement and it is true precisely if both of the following statements are true: (i) 50 is divisible by 2 (ii) 50 is divisible by 5. Statements (i) and (ii) are indeed true because 50 = 25 2 and 50 = 10 5. So statement (e) is true. (f) n2 is even As mentioned above, whether this is true or false depends on the value of n. For example, if n = 2 then n2 = 4 is even, but if n = 3 then n2 = 9 is odd. So, unlike the other statements (which are propositions), this is a predicate P (n). The predicate will become a proposition when we assign a particular value to n to it, and the truth or falsity of the proposition can then be established. Statements (i), (j), (k) below do this comprehensively. (g) For every natural number n, the number n2 + n is even Heres our rst non-immediate, non-trivial, proof. How on earth can we prove this, if it is true, or disprove it, if it is false? Suppose it was false. How would you convince someone of that? Well, the statement says that for every natural number n, n2 + n is even. So if you managed (somehow!) to nd a particular N for which N 2 + N happened to be odd, you could prove the statement false by simply observing that When n = N , it is not the case that n2 + n is even. And that would be the end of it. So, in other words, if a universal statement about natural numbers is false, you can prove it is false by showing that its conclusion is false for some particular value of n. But suppose the statement is true. How could you prove it. Well, you could prove it for n = 1, then n = 2, then n = 3, and so on, but at some point you would expire and there would still be numbers n that you hadnt yet proved it for. And that simply wouldnt do, because if you proved it true for the rst 9999 numbers, it might be false when n = 10000. So what you need is a more sophisticated, general argument that shows the statement is true for any arbitrary n.

10

2.2. Mathematical statements and proof

Now, it turns out that this statement is true. So we need a nice general argument to establish this. Well, heres one approach. We can note that n2 + n = n(n + 1). The numbers n and n + 1 are consecutive natural numbers. So one of them is odd and one of them is even. When you multiply any odd number and any even number together, you get an even number, so n2 + n is even. Are you convinced? Maybe not? We really should be more explicit. Suppose n is even. What that means is that, for some integer k , n = 2k . Then n + 1 = 2k + 1 and hence n(n + 1) = 2k (2k + 1) = 2 (k (2k + 1)) . Because k (2k + 1) is an integer, this shows that n2 + n = n(n + 1) is divisible by 2; that is, it is even. We supposed here that n was even. But it might be odd, in which case we would have n = 2k + 1 for some integer k . Then n(n + 1) = (2k + 1)(2k + 2) = 2 ((2k + 1)(k + 1)) , which is, again, even, because (2k + 1)(k + 1) is an integer. Right, were really proving things now. This is a very general statement, asserting something about all natural numbers, and we have managed to prove it. I nd that quite satisfying, dont you? (h) There is a natural number n such that 2n = 2n . This is an existential statement, asserting that there exists n with 2n = 2n . Before diving in, lets pause for a moment and think about how we might deal with such statements. If an existential statement like this is true we would need only to show that its conclusion (which in this case is 2n = 2n ) holds for some particular n. That is, we need only nd an n that works. If the statement is false, we have a lot more work to do in order to prove that it is false. For, to show that it is false, we would need to show that, for no value of n does the conclusion holds. Equivalently, for every n, the conclusion fails. So wed need to prove a universal statement and, as we saw in the previous example, that would require us to come up with a suitably general argument. In fact, this statement is true. This is because when n = 1 we have 2n = 2 = 21 = 2n . (i) If n is even, then n2 is even This is true. The most straightforward way to prove this is to assume that n is some (that is, any) even number and then show that n2 is even. So suppose n is even. Then n = 2k for some integer k and hence n2 = (2k )2 = 4k 2 . This is even because it is 2(2k 2 ) and 2k 2 is an integer. (j) For all odd numbers n, n2 is odd. This is true. The most straightforward way to prove this is to assume that n is any odd number and then show that n2 is also odd. So suppose n is odd. Then n = 2k + 1 for some integer k and hence n2 = (2k + 1)2 = 4k 2 + 4k + 1. To establish that this is odd, we need to show that it can be written in the form 2K + 1 for some integer K . Well, 4k 2 + 4k + 1 = 2(2k 2 + 2k ) + 1. This is indeed of the form 2K + 1, where K is the integer 2k 2 + 2k . Hence n2 is odd.

11

2. Mathematical statements, proof, logic and sets

Another way to prove this result is to prove that if n2 is even then n must be even. We wont do that right now, because to do it properly requires a result we meet later concerning the factorisation of numbers into prime numbers. But think about the strategy for a moment. Suppose we were able to prove the following statement, which well call Q: Q: if n2 is even then n is even. Why would that establish what we want (namely that if n is odd then n2 is odd). Well, one way is to observe that Q is whats called the contrapositive of statement (j) that were trying to prove, and the contrapositive is logically equivalent to the initial statement. (This is a bit of formal logic, and we will discuss this more later). But theres another way of thinking about it, which is perhaps easier to understand at this stage. Suppose we have proved statement Q and suppose that n is odd. Then it must be the case that n2 is odd. For, if n2 was not odd, it would be even and then Q would tell us that this means n is even. But we have assumed n is odd. It cannot be both even and odd, so we have reached a contradiction. By assuming that the opposite conclusion holds (n2 even) we have shown that something impossible happens. This type of argument is known as a proof by contradiction and it is often very powerful. We will see more about this later. (k) For natural numbers n, n2 is even if and only if n is even. This is true. What we have shown in proving (i) and (j) is that if n is even then n2 is even, and if n is odd then n2 is odd. The rst, (statement (i)) establishes that if n is even, then n2 is even. The second of these (statement (j)) establishes that n2 is even only if n is even. This is because it shows that n2 is odd if n is odd, from which it follows that if n2 is even, n must not have been odd, and therefore must have been even. If and only if statements if this type are very important. As we see here, the proof of such statements breaks down into the proof of two If-then statements. (l) There are no natural numbers m and n such that 2 = m/n. This is, in fact, true, though we defer the proof for now, until we know more about factorisation of numbers into prime numbers. We merely comment that the easiest way to prove the statement is to use a proof by contradiction. These examples hopefully demonstrate that there are a wide range of statements and proof techniques, and in the rest of this chapter we will explore these further. Right now, one thing I hope comes out very clearly from these examples is that to prove a mathematical statement, you need to know precisely what it means. Well, that sounds obvious, but you can see how detailed we had to be about the meanings (that is, the denitions) of the terms divisible, even and odd. Denitions are very important.

2.3

Some basic logic

Mathematical statements can be true or false Lets denote true by T and false by F. Given a statement, or a number of statements, it is possible to form other statements. This was indicated in some of the examples above (such as the compound statements).

12

2.3. Some basic logic

A technique known as the use of truth tables enables us to dene logical operations on statements, and to determine when such statements are true. This is all a bit vague, so lets get down to some concrete examples.

2.3.1

Negation

The simplest way to take a statement and form another statement is to negate the statement. The negation of a statement P is the statement P (sometimes just denoted not P ), which is dened to be true exactly when P is false. This can be described in the very simple truth table, Table 2.1: P T F P F T

Table 2.1: The truth table for negation or not

What does the table signify? Quite simply, it tells us that if P is true then P is false and if P is false then P is true. Example 2.1 If P is 20 is divisible by 3 then P is 20 is not divisible by 3. Here, P is false and P is true. It has, I hope, been indicated in the examples earlier in this chapter, that to disprove a universal statement about natural numbers amounts to proving an existential statement. That is, if we want to disprove a statement of the form for all natural numbers n, property p(n) holds (where p(n) is some predicate, such as n2 is even) we need only produce some N for which p(N ) fails. Such an N is called a counterexample. Equally, to disprove an existential statement of the form there is some n such that property p(n) holds, one would have to show that for every n, p(n) fails. That is, to disprove an existential statement amounts to proving a universal one. But, now that we have the notion of the negation of a statement we can phrase this a little more formally. Proving that a statement P is false is equivalent to proving that the negation P is true. In the language of logic, therefore, we have the following: The negation of a universal statement is an existential statement. The negation of an existential statement is a universal statement. More precisely, The negation of the universal statement for all n, property p(n) holds is the existential statement there is n such that property p(n) does not hold. The negation of the existential statement there is n such that property p(n) holds is the universal statement for all n, property p(n) does not hold. We could be a little more formal about this, by dening the negation of a predicate p(n) (which, recall, only has a denitive true or false value once n is specied) to be the

13

2. Mathematical statements, proof, logic and sets

predicate p(n) which is true (for any particular n) precisely when p(n) is false. Then we might say that

The negation of the universal statement for all n, p(n) is true is the existential statement there is n such that p(n) is true. The negation of the existential statement there is n such that p(n) is true is the universal statement for all n, p(n) is true. Now, lets not get confused here. None of this is really dicult or new. We meet such logic in everyday life. If I say It rains every day in London then either this statement is true or it is false. If it is false, it is because on (at least) one day it does not rain. The negation (or disproof) of the statement On every, it rains in London is simply There is a day on which it does not rain in London. The former is a universal statement (On every day, . . .) and the latter is an existential statement (there is . . .). Or, consider the statement There is a student who enjoys reading these lecture notes. This is an existential statement (There is . . .). This is false if No student enjoys reading these lecture notes. Another way of phrasing this last statement is Every student reading these lecture notes does not enjoy it. This is a more awkward expression, but it emphasises that the negation of the initial, existential statement, is a universal one (Every student . . .). The former is an existential statement (there is something I will write that . . .) and the latter is a universal statement (everything I write will . . .). This second example is a little more complicated, but it serves to illustrate the point that much of logic is simple common sense.

2.3.2

Conjunction and disjunction

There are two very basic ways of combining propositions: through the use of and (known as conjunction) and the use of or (known as disjunction). Suppose that P and Q are two mathematical statements. Then P and Q, also denoted P Q, and called the conjunction of P and Q, is the statement that is true precisely when both P and Q are true. For example, statement (e) above, which is 50 is divisible by 2 and 5 is the conjunction of the two statements 50 is divisible by 2 50 is divisible by 5. Statement (e) is true because both of these two statements are true. Table 2.2 gives the truth table for the conjunction P and Q:

14

2.3. Some basic logic

P T T F F

Q T F T F

P Q T F F F

Table 2.2: The truth table for and

What Table 2.2 says is simply that P Q is true precisely when both P and Q are true (and in no other circumstances). Suppose that P and Q are two mathematical statements. Then P or Q, also denoted P Q, and called the disjunction of P and Q, is the statement that is true precisely when P , or Q, or both, are true. For example, statement (d) above, which is 21 is divisible by 3 or 5 is the disjunction of the two statements 21 is divisible by 3 21 is divisible by 5. Statement (d) is true because at least one (namely the rst) of these two statements is true. Note one important thing about the mathematical interpretation of the word or. It is always used in the inclusive-or sense. So P Q is true in the case when P is true, or Q is true, or both. In some ways, this use of the word or contrasts with its use in normal everyday language, where it is often used to specify a choice between mutually exclusive alternatives. (For example Youre either with us or against us.) But if I say Tomorrow I will wear brown trousers or I will wear a yellow shirt then, in the mathematical way in which the word or is used, the statement would be true if I wore brown trousers and any shirt, any trousers and a yellow shirt, and also if I wore brown trousers and a yellow shirt. You might have your doubts about my dress sense in this last case, but, logically, it makes my statement true. Table 2.2 gives the truth table for the disjunction P and Q: P T T F F Q T F T F P Q T T T F

Table 2.3: The truth table for or

What Table 2.3 says is simply that P Q is true precisely when at least one of P and Q is true.

15

2. Mathematical statements, proof, logic and sets

2.4

If-then statements

It is very important to understand the formal meaning of the word if in mathematics. The word is often used rather sloppily in everyday life, but has a very precise mathematical meaning. Let me give you an example. Suppose I tell you If it rains, then I wear a raincoat, and suppose that this is a true statement. Well, then, suppose it rains. You can certainly conclude I will wear a raincoat. But what if it does not rain? Well, you cant conclude anything. My statement only tells you about what happens if it rains. If it does not, then I might, or I might not, wear a raincoat: and whether I do or not does not aect the truth of the statement I made. You have to be clear about this: an if-then statement only tells you about what follows if something particular happens. More formally, suppose P and Q are mathematical statements (each of which can therefore be either true or false). Then we can form the statement denoted P Q (P implies Q or, equivalently, if P , then Q), which has as its truth table Table 2.4. (This type of statement is known as an if-then statement or an implication.) P T T F F Q T F T F P Q T F T T

Table 2.4: The truth table for P Q

Note that the statement P Q is false only when P is true but Q is false. (To go back to the previous example, the statement If it rains, I wear a raincoat is false precisely if it does rain but I do not wear a raincoat.) This is tricky, so you may have to spend a little time understanding it. As Ive suggested, perhaps the easiest way is to think about when a statement if P , then Q is false. The statement P Q can also be written as Q P . There are dierent ways of describing P Q, such as: if P then Q P implies Q P is sucient for Q Q if P P only if Q Q whenever P Q is necessary for P . All these mean the same thing. The rst two are the ones I will use most frequently. If P Q and Q P then this means that Q will be true precisely when P is. That is Q is true if and only if P is. We use the single piece of notation P Q instead of the

16

2.5. Logical equivalence

two separate P Q and Q P . There are several phrases for describing what P Q means, such as: P if and only if Q (sometimes abbreviated to P i Q) P is equivalent to Q P is necessary and sucient for Q Q is necessary and sucient for P . The truth table is shown in Table 2.5, where we have also indicated the truth or falsity of P Q and Q P to emphasise that P Q is the same as the conjunction (P Q) (Q P ). P Q T T T F F T F F P Q QP T T F T T F T T P Q T F F T

Table 2.5: The truth table for P Q

What the table shows is that P Q is true precisely when P and Q are either both true or both false. Activity 2.1 Look carefully at the truth table and understand why the values for P Q are as they are. In particular, try to explain in words why the truth table is the way it is.

2.5

Logical equivalence

Two statements are logically equivalent if when either one is true, so is the other, and if either one is false, so is the other. For example, for statements P and Q, the statements (P Q) and P Q are logically equivalent. We can see this from the truth table, Table 2.6, which shows that, in all cases, the two statements take the same logical value T or F ). (This value is highlighted in bold.) P T T F F Q T F T F P Q T T T F (P Q) F F F T P F F T T Q F T F T P Q F F F T

Table 2.6: The truth tables for (P Q) and P Q

17

2. Mathematical statements, proof, logic and sets

The fact that (P Q) and P Q are logically equivalent is quite easy to understand. The statement P Q is true if and only if at least one of P, Q is true. The statement is therefore false precisely when both P and Q are false, which means P and Q are both true, which means P Q is true. Again, we can understand these things fairly easily with some common sense. If I tell you I will wear brown trousers or I will wear a yellow shirt then this is a false statement only if I do not wear brown trousers and I do not wear a yellow shirt. Now that we know the meaning of , we can see that to say that (P Q) and P Q are logically equivalent is to say that (P Q) P Q. Activity 2.2 Show that the statements (P Q) and P Q are logically equivalent. [This shows that the negation of P Q is P Q. That is, (P Q) is equivalent to P Q.]

2.6

Converse statements

Given an implication P Q, the reverse implication Q P is known as its converse. Generally, there is no reason why the converse should be true just because the implication is. For example, consider the statement If it is Tuesday, then I buy the Guardian newspaper. The converse is If I buy the Guardian newspaper, then it is Tuesday. Well, I might buy that newspaper on other days too, in which case the implication can be true but the converse false. Weve seen, in fact, that if both P Q and Q P then we have a special notation, P Q, for this situation. Generally, then, the truth or falsity of the converse Q P has to be determined separately from that of the implication P Q. Activity 2.3 What is the converse of the statement if the natural number n divides 4 then n divides 12 ? Is the converse true? Is the original statement true?

2.7

Contrapositive statements

The contrapositive of an implication P Q is the statement Q P . The contrapositive is logically equivalent to the implication, as Table 2.7 shows. (The columns highlighted in bold are identical.) P T T F F Q T F T F P Q T F T T P F F T T Q F T F T Q P T F T T

Table 2.7: The truth tables for P Q and Q P .

18

2.8. Working backwards to obtain a proof

If you think about it, the equivalence of the implication and its contrapositive makes sense. For, Q P says that if Q is false, P is false also. So, it tells us that we cannot have Q false and P true, which is precisely the same information as is given by P Q. So whats the point of this? Well, sometimes you might want to prove P Q and it will, in fact, be easier to prove instead the equivalent (contrapositive) statement Q P . See Biggs, section 3.5 for an example.

2.8

Working backwards to obtain a proof

Weve already seen, in the examples earlier in this chapter, how some statements may be proved directly. For example, in order to prove a universal statement for all n, P (n) about natural numbers, we would need to provide a proof that starts by assuming that n is any given (that is, arbitrary) natural number and show the desired conclusion holds. To disprove such a statement (which is the same as proving its negation), we would simply need to nd a single value of n for which P (n) is false (and such an n is known as a counterexample). However, some statements are dicult to prove directly. It is sometimes easier to work backwards. Suppose you are asked to prove something, such as an inequality or equation. It might be easier to see how to do so if the end-result (the inequality or equation you are required to prove) is simplied, or expanded, or re-written in some way. Heres an example. Example 2.2 Prove the statement that: if a, b are real numbers and a = b, then ab < (a2 + b2 )/2. Its certainly not immediately obvious how to approach this. But lets start with what we want to prove. This is the inequality ab < (a2 + b2 )/2, which can be rewritten as a2 + b2 2ab > 0. Now, this can be simplied as (a b)2 > 0 and maybe now you can see why it is true: the given fact that a = b means that a b = 0 and hence (a b)2 is a positive number. So we see why the statement is true. To write down a nice proof, we can now reverse this argument, as follows: Proof Since a = b, a b = 0 and, hence, (a b)2 > 0. But (a b)2 = a2 + b2 2ab. So we have a2 + b2 > 2ab and, therefore, ab < (a2 + b2 )/2, as required. There are a few things to note here. First, mathematics is a language and what you write has to make good sense. Often, it is tempting to make too much use of symbols rather than words. But the words used in this proof, and the punctuation, make it easy to read and give it a structure and an argument. You should nd yourself using words like so, hence, therefore, since, because, and so on. Do use words and punctuation and, whatever you do, do not replace them by symbols of your own invention! A second thing to note is the use of the symbol . There is nothing particularly special about this symbol: others could be used. What it achieves is that it indicates that the proof is nished. There is no need to use such a symbol, but you will nd that textbooks do make much use of symbols to indicate when proofs have ended. It enables the text to be more readable, with proofs not running into the main body of the text. Largely, these are matters of style, and you will develop these as you practice and read the textbooks.

19

2. Mathematical statements, proof, logic and sets

2.9

Sets
Basics

2.9.1

You have probably already met some basic ideas about sets and there is not too much more to add at this stage, but they are such an important idea in abstract mathematics that they are worth discussing here. Loosely speaking, a set may be thought of as a collection of objects. A set is usually described by listing or describing its members inside curly brackets. For example, when we write A = {1, 2, 3}, we mean that the objects belonging to the set A are the numbers 1, 2, 3 (or, equivalently, the set A consists of the numbers 1, 2 and 3). Equally (and this is what we mean by describing its members), this set could have been written as A = {n | n is a whole number and 1 n 3}. Here, the symbol | stands for such that. Often, the symbol : is used instead, so that we might write A = {n : n is a whole number and 1 n 3}. When x is an object in a set A, we write x A and say x belongs to A or x is a member of A. If x is not in A we write x A. As another example, the set B = {x N | x is even} has as its members the set of positive even integers. Here we are specifying the set by describing the dening property of its members. Sometimes it is useful to give a constructional description of a set. For example, C = {n2 | n N} is the set of natural numbers known as the perfect squares. The set which has no members is called the empty set and is denoted by . The empty set may seem like a strange concept, but it has its uses.

2.9.2

Subsets

We say that the set S is a subset of the set T , and we write S T , if every member of S is a member of T . For example, {1, 2, 5} {1, 2, 4, 5, 6, 40}. (Be aware that some texts use where we use .) What this means is that the statement xSxT is true. A rather obvious, but sometimes useful, observation is that, given two sets A and B , A = B if and only if A B and B A. So to prove two sets are equal, we can prove that each of these two containments holds. That might seem clumsy, but it is, in many cases, the best approach. For any set A, the empty set, , is a subset of A. You might think this is strange, because what it means is that every member of is also a member of A. But has no members! The point, however, is that there is no object in that is not also in A (because there are no objects at all in ).

20

2.9. Sets

2.9.3

Unions and intersections

Given two sets A and B , the union A B is the set whose members belong to A or B (or both A and B ): that is, A B = {x | x A or x B }. Equivalently, to use the notation weve learned, x A B (x A) (x B ). Example 2.3 If A = {1, 2, 3, 5} and B = {2, 4, 5, 7}, then A B = {1, 2, 3, 4, 5, 7}. Similarly, we dene the intersection A B to be the set whose members belong to both A and B : A B = {x | x A and x B }. So, x A B (x A) (x B ).

2.9.4

Universal sets and complements

Weve been a little informal about what the possible objects in a set might be. Ocially, we always work with respect to some universal set E . For example, if we are thinking about sets of natural numbers, the universal set (the possible candidates for membership of the sets we might want to consider) is the set N of all natural numbers. This might seem like an unnecessary complication, but it is essential. Suppose I tell you that the set A is the set of all even natural numbers. What are the objects that do not belong to A? Well, in the context of natural numbers, it is all odd natural numbers. The context is important (and it is this that is encapsulated in the universal set). Without that context (or universal set), then there are many other objects that we could say do not belong to A, such as negative integers, apples, bananas and elephants. (I could go on, but I hope you get the point!) Given a universal set E and a subset A of E , the complement of A (sometimes called the complement of A in E ) is denoted by E \ A and is E \ A = {x E | x A}. or Ac (with If the universal set is clear, the complement of A is sometimes denoted by A textbooks diering in their notation). Suppose A is any subset of E . Because each member of E is either a member of A, or is not a member of A, it follows that A (E \ A) = E.

2.9.5

Sets and logic

There are a great many comparisons and analogies between set theory and logic. Using the shorthand notation for complements, one of the De-Morgan laws of complementation is that B. AB =A

21

2. Mathematical statements, proof, logic and sets

This looks a little like the fact (observed in an earlier Learning Activity) that (P Q) is equivalent to P Q. And this is more than a coincidence. The negation operation, the conjunction operation, and the disjunction operation on statements behave entirely in the same way as the complementation, intersection, and union operations (in turn) on sets. In fact, when you start to prove things about sets, you often end up giving arguments that are based in logic. B ? We could argue as follows: For example, how would we prove that A B = A x A B xAB (x A B ) ((x A) (x B )) (x A) (x B ) ) (x B ) (x A B. xA

What the result says is, in fact, easy to understand: if x is not in both A and B , then thats precisely because it fails to be in (at least) one of them. For two sets A and B (subsets of a universal set E ), the complement of B in A, denoted by A \ B , is the set of objects that belong to A but not to B . That is, A \ B = {x A | x B }. Activity 2.4 Prove that A \ B = A (E \ B ).

2.9.6

Cartesian products

For sets A and B , the Cartesian product A B is the set of all ordered pairs (a, b), where a A and b B . For example, if A = B = R then A B = R R is the set of all ordered pairs of real numbers, usually denoted by R2 .

2.9.7

Power sets

For a set A, the set of all subsets of A, denoted P (A), is called the power set of A. Note that the power set is a set of sets. For example, if A = {1, 2, 3}, then P (A) = {, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}} . Activity 2.5 Write down the power set of the set A = {1, 2, 3, 4}. Activity 2.6 Suppose that A has n members, where n N. How many members does P (A) have?

2.10

Quantiers

We have already met the ideas of universal and existential statements involving natural numbers. More generally, given any set E , a universal statement on E is one of the form

22

2.10. Quantiers

for all x E , P (x). This statement is true if P (x) is true for all x in E , and it is false if there is some x in E (known as a counterexample) such that P (x) is false. We have a special symbol that is used in universal statements: the symbol means for all. So the typical universal statement can be written as x E, P (x). (The comma is not necessary, but I think it looks better.) An existential statement on E is one of the form there is x E such that P (x), which is true if there is some x E for which P (x) is true, and is false if for every x E , P (x) is false. Again, we have a useful symbol, , meaning there exists. So the typical existential statement can be written as x E, P (x). Here, we have omitted the phrase such that, but this is often included if the statement reads better with it. For instance, we could write n N, n2 2n + 1 = 0, but it would probably be easier to read n N such that n2 2n + 1 = 0. Often such that is abbreviated to s.t.. (By the way, this statement is true because n = 1 satises n2 2n + 1 = 0.) We have seen that the negation of a universal statement is an existential statement and vice versa. In symbols, (x E, P (x)) is logically equivalent to x E, P (x); and (x E, P (x)) is logically equivalent to x E, P (x). With these observations, we can now form the negations of more complex statements. Consider the statement n N, m N, m > n. Activity 2.7 What does the statement n N, m N, m > n mean? Is it true? What would the negation of the statement be? Lets take it gently. First, notice that the statement is n N, (m N, m > n). The parentheses here do not change the meaning. According to the rules for negation of universal statements, the negation of this is n N, (m N, m > n). But what is (m N, m > n)? According to the rules for negating existential statements, this is equivalent to m N, (m > n). What is (m > n)? Well, its just m n. So what we see is that the negation of the initial statement is n N, m N, m n. We can put this argument more succinctly, as follows: (n N(m N, m > n)) n N, (m N, m > n) n N, m N, (m > n) n N, m N, m n.

23

2. Mathematical statements, proof, logic and sets

2.11

Proof by contradiction

Weve seen a small example of proof by contradiction earlier in the chapter. Suppose you want to prove P Q. One way to do this is by contradiction. What this means is that you suppose P is true but Q is false (in other words, that the statement P Q is false) and you show that, somehow, this leads to a conclusion that you know, denitely, to be false. Heres an example. Example 2.4 There are no integers m, n such that 6m + 8n = 1099. To prove this by contradiction, we can argue as follows: Suppose that integers m, n do exist such that 6m + 8n = 1099. Then since 6 is even, 6n is also even; and, since 8 is even, 8n is even. Hence 6m + 8n, as a sum of two even numbers, is even. But this means 1099 = 6m + 8n is an even number. But, in fact, it is not even, so we have a contradiction. It follows that m, n of the type required do not exist. This sort of argument can be a bit perplexing when you rst meet it. Whats going on in the example just given? Well, what we show is that if such m, n exist, then something impossible happens: namely the number 1099 is both even and odd. Well, this cant be. If supposing something leads to a conclusion you know to be false, then the initial supposition must be false. So the conclusion is that such integers m, n do not exist. Probably the most famous proof by contradiction is Eulers proof that there are innitely many prime numbers. A prime number is a natural number greater than 1 which is only divisible by 1 and itself. Such numbers have been historically of huge importance in mathematics, and they are also very useful in a number of important applications, such as information security. The rst few prime numbers are 2, 3, 5, 7, 11, . . .. A natural question is: does this list go on forever, or is there a largest prime number? In fact, the list goes on forever: there are innitely many prime numbers. Well mention this result again later. A full, detailed, understanding of the proof requires some results well meet later, but you should be able to get the avour of it at this stage. So here it is, a very famous result: There are innitely many prime numbers. Proof (Informally written for the sake of exposition) Suppose not. That is, suppose there are only a nite number of primes. Then theres a largest one. Lets call it M . Now consider the number X = (2 3 5 7 11 M ) + 1, which is the product of all the prime numbers (2 up to M ), with 1 added. Notice that X > M , so X is not a prime (because M is the largest prime). If a number X is not prime, that means that it has a divisor p that is a prime number and which satises 1 < p < X . [This is the key observation: we havent seen this yet, but we will later.] But p must therefore be one of the numbers 2, 3, 5, . . . , M . However, X is not divisible by any of these numbers, because it has remainder 1 when divided by any of them. So we have

24

2.12. Some terminology

reached a contradiction: on the one hand, X must be divisible by one of these primes, and on the other, it is not. So the initial supposition that there were not innitely many primes simply must be wrong. We conclude there are innitely many primes. This proof has been written in a fairly informal and leisurely way to help explain whats happening. It could all be written more succinctly.

2.12

Some terminology

At this point, its probably worth introducing some important terminology. When, in Mathematics, we prove a true statement, we often say we are proving a Theorem, or a Proposition. (Usually the word Proposition is used if the statement does not seem quite so signicant as to merit the description Theorem.) A theorem that is a preliminary result leading up to a Theorem is often called a Lemma, and a minor theorem that is a fairly direct consequence of, or special case of, a theorem is called a Corollary, if it is not signicant enough itself to merit the title Theorem. For your purposes, it is important just to know that these words all mean true mathematical statements. You should realise that these terms are used subjectively: for instance, the person writing the mathematics has to make a decision about whether a particular result merits the title Theorem or is, instead, merely to be called a Proposition.

2.13
2.13.1

General advice
Introduction

Proving things is dicult. Inevitably, when you read a proof, in the textbooks or in these notes, you will ask How did the writer know to do that? and you will often nd you asking yourself How can I even begin to prove this?. This is perfectly normal. This is where the key dierence between abstract mathematics and more methods-based mathematics lies. If you are asked to dierentiate a function, you just go ahead and do it. It might be technically dicult in some cases, but there is no doubt about what approaches you should use. But proving something is more dicult. You might try to prove it, and fail. Thats ne: what you should do in that case is try another attack. Keep trying until you crack it. (I suppose this is a little bit like integration. Youll know that there are various methods, but you dont necessarily know which will work on a particular integral, so you should try one, and keep trying until you manage to nd the integral.) Abstract mathematics should always be done with a large pile of scrap paper at your disposal. You are unlikely to be able to write down a perfect solution to a problem straight away: some scratching around to get a feel for whats going on might well be needed, and some false starts might be pursued rst. If you expect to be able to envisage a perfect solution in your head and then write it down perfectly, you are placing too much pressure on yourself. Abstract mathematics is simply not done like that. In this chapter I have tried to indicate that there are methodical approaches to proof (such as proof by contradiction, for example). What you have to always be able to do is

25

2. Mathematical statements, proof, logic and sets

to understand precisely what it is that you have to prove. That sounds obvious, but it is something the importance of which is often underestimated. Once you understand what you need to show (and, here, working backwards a little from that end-point might be helpful, as weve seen), then you have to try to show it. And you must know when you have done so! So it is inevitable that you will have to take a little time to think about what is required: you cannot simply dive in like you might to a dierentiation question. All this becomes much easier as you practice it. You should attempt problems from the textbooks (and also the problems below). Problems are a valuable resource and you are squandering this resource if you simply turn to the answers (should these be available). It is one thing to agree with an answer, or to understand a proof, but it is quite a dierent thing to come up with a proof yourself. There is no point in looking at the answer before you have tried hard yourself to answer the problem. By trying (and possibly failing), you will learn more than simply by reading answers. Exam questions will be dierent from problems you have seen, so there is no point at all in learning answers. You need to understand how to approach problems and how to answer them for yourself.

2.13.2

How to write mathematics

You should write mathematics in English!! You shouldnt think that writing mathematics is just using formulae. A good way to see if your writing makes sense is by reading it aloud (where you should only read what you really have written, not adding extra words). If it sounds like nonsense, a sequence of loose statements with no obvious relations, then you probably need to write it again. Dont use more symbols than necessary. Since many people seem to think that mathematics involves writing formulae, they often use symbols to replace normal English words. An eternal favourite is the double arrow = to indicate that one thing follows from the other. As in : x2 = 1 = x = 1 or x = 1.

This is not only pure laziness, since its just as easy to write : x2 = 1, hence x = 1 or x = 1. But it is even probably not what was meant! The implication arrow = has a logical meaning if . . . , then . . . . So if you write x2 = 1 = x = 1 or x = 1, then that really means if x2 = 1, then x = 1 or x = 1. And hence this gives no real information about what x is. On the other hand, writing I know x2 = 1, hence x = 1 or x = 1, means that now we know x = 1 or x = 1 and can use that knowledge in what follows. Some other unnecessary symbols that are sometimes used are and . They mean something like therefore/hence and since/because. It is best not to use them, but to write the word instead. It makes things so much easier to read. Provide all information required.

26

2.13. General advice

A good habit is to start by writing what information is given and what question needs to be answered. For instance, suppose you are asked to prove the following : For any natural numbers a, b, c with c 2, there is a natural number n such that an2 + bn + c is not a prime. A good start to an answer would be : Given : natural numbers a, b, c, with c 2. To prove : there is a natural number n such that an2 + bn + c is not a prime. At this point you (and any future reader) has all the information required, and you can start thinking what really needs to be done.

2.13.3

How to do mathematics

In a few words : by trying and by doing it yourself !! Try hard The kind of questions you will be dealing with in this subject often have no obvious answers. There is no standard method to come to an answer. That means that you have to nd out what to do yourself. And the only way of doing that is by trial and error. So once you know what you are asked to do (plus all the information you were given), the next thing is to take a piece of paper and start writing down some possible next steps. Some of them may look promising, so have a better look at those and see if they will help you. Hopefully, after some (or a lot) of trying, you see how to answer the question. Then you can go back to writing down the answer. This rough working is a vital part of the process of answering a question (and, in an examination, you should make sure your working is shown). Once you have completed this part of the process, you will then be in a position to write the nal answer in a concise form indicating the ow of the reasoning and the arguments used. Keep trying You must get used to the situation that not every question can be answered immediately. Sometimes you immediately see what to do and how to do it. But other times you will realise that after a long time you havent got any further. Dont get frustrated when that happens. Put the problem aside, and try to do another question (or do something else). Look back at the question later or another day, and see if it makes more sense then. Often the answer will come to you as some kind of ah-ha ash. But you cant force these ashes. Spending more time improves the chances they happen, though. Finally, if you need a long time to answer certain questions, you can consider yourself in good company. For the problem known as Fermats Last Theorem, the time between when the problem was rst formulated and when the answer was found was about 250 years ! Do it yourself Here is a possible answer to the previous example: Given : natural numbers a, b, c, with c 2.

27

2. Mathematical statements, proof, logic and sets

To prove : there is a natural number n such that an2 + bn + c is not a prime. By denition ( see page 70 of Biggs book, or the footnote on page 4 of Eccles book ), a number p is prime if p 2 and the only divisors of p are 1 and p itself. Hence to prove : there is a natural number n for which an2 + bn + c is smaller than 2 or it has divisors other than 1 or itself. Lets take n = c. Then we have an2 + bn + c = ac2 + bc + c. But we can write ac2 + bc + c = c (ac + b + 1), which shows that ac2 + bc + c has c and ac + b + 1 as divisors. Moreover, its easy to see that neither c nor ac + b + 1 can be equal to 1 or to ac2 + bc + c. Weve found a value of n for which an2 + bn + c has divisors other than 1 or itself. The crucial step in the answer above is the one in which I choose to take n = c. Why did I choose that? Because it works. How did I get the idea to take n = c? Ah, thats far less obvious. Probably some rough paper and lots of trying was involved. In the nal answer, no information about how this clever idea was found needs to be given. You probably have no problems following the reasoning given above, and hence you may think that you understand this problem. But being able to understand the answer, and being able to nd the answer yourself are two completely dierent matters. And it is the second skill you are suppose to acquire in this course. (And hence the skill that will be tested in the examination.) Once you have learnt how to approach questions such as the above and come up with the clever trick yourself, you have some hope of being able to answer other questions of a similar type. But if you only study answers, you will probably never be able to nd new arguments for yourself. And hence when you are given a question youve never seen before, how can you trust yourself that you have the ability to see the trick that that particular question requires ? For many, abstract mathematics seems full of clever tricks. But these tricks have always been found by people working very hard to get such a clever idea, not by people just studying other problems and the tricks found by other people.

2.13.4

How to become better in mathematics

One thing you might consider is doing more questions. The books are a good source of exercises. Trying some of these will give you extra practice. But if you want to go beyond just being able to do what somebody else has written down, you must try to explore the material even further. Try to understand the reason for things that are maybe not explicitly asked. As an illustration of thinking that way, look again at the formulation of the example we looked at before : For any natural numbers a, b, c with c 2, there is a natural number n such that an2 + bn + c is not a prime. Why is it so important that c 2 ? If you look at the proof in the previous section, you see that that proof goes wrong if c = 1. (Since we want to use that c is a divisor dierent from 1.) Does that mean the statement is wrong if c = 1 ? (No, but a dierent proof is required.)

28

2.14. Learning outcomes

And what happens if we allow one or more of a, b, c to be zero or negative? And what about more complicated expression such as an3 + bn2 + cn + d for some numbers a, b, c, d with d 2 ? Could it be possible that there is an expression like this for which all n give prime numbers ? If you found the answer to the original question yourself, then you probably immediately see that the answer has to be no, since similar arguments as before work. But if you didnt try the original question yourself, and just studied the ready-made answer, youll be less well equipped to answer more general or slightly altered versions. Once you start thinking like this, you are developing the skills required to be good in mathematics. Trying to see beyond what is asked, asking yourself new questions and seeing which you can answer, is the best way to train yourself to become a mathematician.

2.14

Learning outcomes

At the end of this chapter and the relevant reading, you should be able to: demonstrate an understanding of what mathematical statements are prove whether mathematical statements are true or false negate statements, including universal statements and existential statements construct truth tables for logical statements use truth tables to determine whether logical statements are logically equivalent or not demonstrate knowledge of what is meant by conjunction and disjunction demonstrate understanding of the meaning of if-then statements and be able to prove or disprove such statements demonstrate understanding of the meaning of if and only if statements and be able to prove or disprove such statements nd the converse and contrapositive of statements prove statements by proving their contrapositive prove results by various methods, including directly, by the the method of proof by contradiction, and by working backwards demonstrate understanding of the key ideas and notations concerning sets prove results about sets use existential and universal quantiers be able to negate statements involving several dierent quantiers

29

2. Mathematical statements, proof, logic and sets

2.15

Sample exercises

Exercise 2.1 Is the following statement about natural numbers n true or false? Justify your answer by giving a proof or a counterexample: If n is divisible by 6 then n is divisible by 3. What are the converse and contrapositive of this statement? Is the converse true? Is the contrapositive true? Exercise 2.2 Is the following statement about natural numbers n true or false? Justify your answer by giving a proof or a counterexample: If n is divisible by 2 then n is divisible by 4. What are the converse and contrapositive of this statement? Is the converse true? Is the contrapositive true? Exercise 2.3 Prove that (P Q) and P Q are logically equivalent. Exercise 2.4 Prove that the negation of P Q is P Q. Exercise 2.5 Prove that for all real numbers a, b, c, ab + ac + bc a2 + b2 + c2 . Exercise 2.6 Prove by contradiction that there is no largest natural number. Exercise 2.7 Prove that there is no smallest positive real number. Exercise 2.8 Suppose A and B are subsets of a universal set E . Prove that (E E ) \ (A B ) = ((E \ A) E ) (E (E \ B )). Exercise 2.9 Suppose that P (x, y ) is a predicate involving two free variables x, y from a set E . (So, for given x and y , P (x, y ) is either true or false.) Find the negation of the statement x E, y E, P (x, y )

30

2.16. Comments on selected activities

2.16

Comments on selected activities

Learning activity 2.2 We can do this by constructing a truth table. Consider Table 2.8. This proves that (P Q) and P Q are equivalent. P T T F F Q T F T F P Q T F F F (P Q) F T T T P F F T T Q F T F T P Q F T T T

Table 2.8: The truth tables for (P Q) and P Q

Learning activity 2.3 The converse is if n divides 12 then n divides 4. This is false. For instance, n = 12 is a counterexample. This is because 12 divides 12, but it does not divide 4. The original statement is true, however. For, if n divides 4, then for some m Z, 4 = nm and hence 12 = 3 4 = 3nm = n(3m), which shows that n divides 12. Learning activity 2.4 We have x A \ B (x A) (x B ) (x A) (x E \ B ) x A (E \ B ). Learning activity 2.5 P (A) is the set consisting of the following sets: , {1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}, {1, 2, 3}, {2, 3, 4}, {1, 3, 4}, {1, 2, 4}, {1, 2, 3, 4}. Learning activity 2.6 The members of P (A) are all the subsets of A. A subset S is determined by which of the n members of A it contains. For each member x of A, either x S or x S . There are therefore two possibilities, for each x A. It follows that the number of subsets is 2 2 2 (where there are n factors, one for each element of A). Therefore P (A) has 2n members. Learning activity 2.7 The statement means that if we take any natural number n there will be some natural number m greater than n. Well, this is true. For example, m = n + 1 will do.

2.17

Solutions to exercises

Solution to exercise 2.1 The statement is true. For, suppose n is divisible by 6. Then for some m N, n = 6m, so n = 3(2m) and since 2m N, this proves that n is divisible by 3. The converse is If n is divisible by 3 then n is divisible by 6. This is false. For example, n = 3 is a counterexample: it is divisible by 3, but not by 6.

31

2. Mathematical statements, proof, logic and sets

The contrapositive is If n is not divisible by 3 then n is not divisible by 6. This is true, because it is logically equivalent to the initial statement, which we have proved to be true.

Solution to exercise 2.2 The statement is false. For example, n = 2 is a counterexample: it is divisible by 2, but not by 4. The converse is If n is divisible by 4 then n is divisible by 2. This is true. For, suppose n is divisible by 4. Then for some m N, n = 4m, so n = 2(2m) and since 2m N, this proves that n is divisible by 2. The contrapositive is If n is not divisible by 4 then n is not divisible by 2. This is false, because it is logically equivalent to the initial statement, which we have proved to be false. Alternatively, you can see that its false because 2 is a counterexample: it is not divisible by 4, but it is divisible by 2. Solution to exercise 2.3 This can be established by using the truth table constructed in Learning activity 2.2. See the solution above. Solution to exercise 2.4 This is established by Table 2.6. That table shows that (P Q) is logically equivalent to P Q. This is the same as saying that the negation of P Q is P Q. Solution to exercise 2.5 We work backwards, since it is not immediately obvious how to begin. We note that what were trying to prove is equivalent to a2 + b2 + c2 ab ac bc 0. This is equivalent to 2a2 + 2b2 + 2c2 2ab 2ac 2bc 0, which is the same as (a2 2ab + b2 ) + (b2 2bc + c2 ) + (a2 2ac + c2 ) 0. You can perhaps now see how this is going to work, for (a2 2ab + b2 ) = (a b)2 and so on. Therefore the given inequality is equivalent to (a b)2 + (b c)2 + (a c)2 0. We know this to be true because squares are always non-negative. If we wanted to write this proof forwards we might argue as follows. For any a, b, c, (a b)2 0, (b c)2 0 and (a c)2 0, so (a b)2 + (b c)2 + (a c)2 0 and hence 2a2 + 2b2 + 2c2 2ab 2ac 2bc 0, from which we obtain a2 + b2 + c2 ab + ac + bc,

32

2.17. Solutions to exercises

as required. Solution to exercise 2.6 Lets prove by contradiction that there is no largest natural number. So suppose there is a largest natural number. Let us call it N . (What we want to do now is somehow show that a conclusion, or something we know for sure must be false, follows.) Well, consider the number N + 1. This is a natural number. But since N is the largest natural number, we must have N + 1 N , which means that 1 0, and thats nonsense. So it follows that we must have been wrong in supposing there is a largest natural number. (Thats the only place in this argument where we could have gone wrong.) So there is no largest natural number. We could have argued the contradiction slightly dierently. Instead of using the fact that N + 1 N to obtain the absurd statement that 1 0, we could have argued as follows: N + 1 is a natural number. But N + 1 > N and this contradicts the fact that N is the largest natural number. Solution to exercise 2.7 We use a proof by contradiction. Suppose that there is a smallest positive real number and lets call this r. Then r/2 is also a real number and r/2 > 0 because r > 0. But r/2 < r, contradicting the fact that r is the smallest positive real number. (Or, we could argue: because r/2 is a positive real number and r is the smallest such number, then we must have r/2 r, from which it follows that 1 2, a contradiction.) Solution to exercise 2.8 We need to prove that (E E ) \ (A B ) = ((E \ A) E ) (E (E \ B )). Now, (x, y ) (E E ) \ (A B ) Solution to exercise 2.9 We deal rst with the existential quantier at the beginning of the statement. So, the negation of the statement is x E, (y E, P (x, y )) which is the same as x E, y E, P (x, y ). ((x, y ) A B ) ((x A) (y B )) (x A) (y B ) (x E \ A) (y E \ B ) ((x, y ) (E \ A) E ) ((x, y ) E (E \ B )) (x, y ) ((E \ A) E ) (E (E \ B )).

33

2. Mathematical statements, proof, logic and sets

34

Chapter 3 Natural numbers and proof by induction

R R
3.1

Biggs, N. L. Discrete Mathematics. Chapters 13. Eccles, P.J. An Introduction to Mathematical Reasoning. Chapters 14 and 6.

Introduction

This chapter explores some of the properties of the natural numbers. These will not be new to you, but they shall be explained a little more formally. The chapter also studies a very powerful proof method, known as proof by induction. This enables us to prove many universal statements about natural numbers that would be extremely dicult to prove by other means.

3.2

Natural numbers: an axiomatic approach

You know that the natural numbers are the positive integers, and you are certainly very comfortable with them. But suppose an alien visited you and you had to explain to him or her (or it, I suppose) what the natural numbers were. How would you do this? Well, you could describe them by the properties they have. (To paraphrase Biggs, we describe what they do rather than what they are.) We have the following axioms for the natural numbers. (An axiom is a statement that is assumed to be true.) 1. For all a, b N we have a + b N. [Closure under Addition] 2. For all a, b N we have a b N. [Closure under Multiplication] 3. For all a, b N we have a + b = b + a. [Commutative Law for addition] 4. For all a, b, c N we have (a + b) + c = a + (b + c). [Associative Law for addition] 5. For all a, b N we have a b = b a. [Commutative Law for Multiplication] 6. For all a, b, c N we have (a b) c = a (b c). [Associative Law for Multiplication] 7. There is a special element of N, denoted by 1, which has the property that for all n N we have n 1 = n. 8. For all a, b, c N, if a + c = b + c, then a = b. [Additive cancellation]

35

3. Natural numbers and proof by induction

9. For all a, b, c N, if a c = b c, then a = b. [Multiplicative Cancellation] 10. For all a, b, c N we have a (b + c) = (a b) + (a c). [Distributive Law] 11. For all a, b N, a < b if and only if there is some c N with a + c = b. 12. For all a, b N, exactly one of the following is true: a = b, a < b, b < a.

We also will write a b for a b. Other properties of the natural numbers follow from these axioms. (That is, they can be proved assuming these axioms.) For example, we can prove the following. P1. For all a, b, c N, (a + b) c = (a c) + (b c). P2. If a, b N satisfy a b = a, then b = 1. P3. For a, b, c N, if a < b and b < c, then a < c. [Transitivity] P4. For a, b, c N, if a < b then a + c < b + c and a c < b c. P5. 1 is the least element of N. P6. 1 is not equal to 1+1. We dont need to add these to the axioms because they follow from the axioms we already have. (We can prove them just from the axioms above.) Well come back to this later in the chapter. We have 1 + 1 = 1. We will use the symbol 2 to represent 1 + 1. It can also be shown that 1 + 1 + 1 is not equal to 1 or to 1 + 1. Well denote it by 3. And so on. . .. You might nd this all a bit weird. We already knew, after all, that 1 + 1 = 2 and have done for some time! But the point is that we can dene the natural numbers axiomatically by a set of rules or axioms and everything else about them follows from those axioms.

3.3

Least and greatest members and the well-ordering principle

If S is a subset of N, then l is a least member or least element of S if l S and, for all s S , l s. The natural number g is a greatest member of S if g S and, for all s S , g s. Its quite obvious that any non-empty set of natural numbers has a least member, but it does not follow from the axioms given above. We therefore take this as an additional axiom of the set of natural numbers, to be added to those above. It is known as the well-ordering principle or Least Element Axiom. Well-ordering principle (or Least Element Axiom): (Axiom 13. for the natural numbers): Every non-empty subset of N has a least element. This is such an important property of natural numbers (not shared by sets of real numbers, for instance).

36

3.4. The principle of induction

Activity 3.1 Think of a set of real numbers that has no least member.

3.4
3.4.1

The principle of induction


Proof by induction

One particularly useful principle that follows from the axioms of the natural numbers given above is the following one, known as the Induction principle. We can, in fact, take the Induction Principle as one of the axioms of the natural numbers, in place of the well-ordering principle: the two are equivalent. (See Eccles, Section 11.2.) This is, in fact, the approach taken by Biggs. But we shall view the Induction Principle as a consequence of the well-ordering principle along with the other axioms for the natural numbers. (See the end of this chapter for more on this.) The Induction Principle: Suppose P (n) is a statement involving natural numbers n. Then P (n) is true for all n N if the following two statements are true: (i) P (1) is true; (ii) For all k N, P (k ) P (k + 1). Suppose you want to prove n N, P (n). Suppose you can prove two things: P (1) is true, and k N, P (k ) P (k + 1). Then: because P (1) P (2) and P (1) is true, we must have that P (2) is true. Then, because P (2) P (3) and P (2) is true, we must have P (3) is true, and so on. So what you see is that this establishes the universal statement that for every n N, P (n) is true.

3.4.2

An example

Heres an example of how we might prove by induction a result we proved directly earlier, in the previous chapter, namely: n N, n2 + n is even. Let P (n) be the statement n2 + n is even. Then P (1) is true, because 12 + 1 = 2, and this is even. (Establishing P (1) is known as proving the base case or the induction basis.) Next we show that P (k ) P (k + 1) for any k N. So we show that if P (k ) is true, so will be P (k + 1). To do this we assume that P (k ) is true and show that P (k + 1) is then also true. (The assumption that P (k ) is true is known as the inductive hypothesis.) So suppose P (k ) is true, which means that k 2 + k is even. What we need to do now is show that this means that P (k + 1) is also true, namely that (k + 1)2 + (k + 1) is even. So we need somehow to relate the expression (k + 1)2 + (k + 1) to the one we are assuming we know something about, k 2 + k . Well, (k + 1)2 + (k + 1) = k 2 + 2k + 1 + k + 1 = (k 2 + k ) + (2k + 2).

37

3. Natural numbers and proof by induction

Now, by the inductive hypothesis (the assumption that P (k ) is true), k 2 + k is even. But 2k + 2 = 2(k + 1) is also even, so (k + 1)2 + (k + 1) is an even number, in other words P (k + 1) is true. So we have shown that k, P (k ) P (k + 1). It now follows, by the Principle of Induction, that for all n N, P (n) is true. Once we get used to this technique, we can make our proofs more succinct. The basic way of proving a result n N, P (n) by induction is as follows: [The Base Case] Prove P (1) is true. [The Induction Step] Prove that, for any k N, assuming P (k ) is true (the inductive hypothesis), then P (k + 1) is also true. And thats all you need to do! The principle of induction then establishes that P (n) is true for all n N.

3.4.3

Variants

Suppose N is some particular natural number and that P (n) is a statement involving natural numbers n. Then P (n) is true for all n N if the following two statements are true: (i) P (N ) is true; (ii) For all k N, k N , P (k ) P (k + 1). This is a version of the Induction Principle obtained from the standard one by changing the base case. It can be used to prove a result like the following: n 4, n2 2n . (The inequality n2 2n is false when n = 3, so it does not hold for all n N.) Activity 3.2 Prove that n 4, n2 2n . Another variant of the Induction Principle is the following, known as the Strong Induction Principle: The Strong Induction Principle: Suppose P (n) is a statement involving natural numbers n. Then P (n) is true for all n N if the following two statements are true: (i) P (1) is true; (ii) For all k N, (P (s) true s k ) P (k + 1). The name is misleading, because, in fact, the strong induction principle follows from the standard induction principle. Activity 3.3 Try to understand why the strong induction principle follows from the induction principle. Hint: consider Q(n), the statement s n, P (s) is true. [This is dicult, so you may want to omit this activity at rst.] The strong induction principle is, as we shall see, often useful when it comes to proving results about sequences that are dened recursively.

38

3.5. Summation formulae

3.5

Summation formulae

Suppose a1 , a2 , a3 , . . . is a sequence (an innite, ordered, list) of real numbers. Then the sum n r=1 ar is the sum of the rst n numbers in the sequence. It is useful to dene these sums recursively or by induction, as follows:
1 n+1 n

ar = a1
r=1

and

for n N,
r=1

ar =
r=1

ar

+ an+1 .

With this observation, we can use proof by induction to prove many results about the values and properties of such sums. Here is a simple, classical, example.
1 Example 3.1 For all n N, n r=1 r = 2 n(n + 1). This is simply the statement that the sum of the rst n natural numbers is n(n + 1)/2.

Proof. We prove the result by induction. Let P (n) be the statement that n 1 r=1 r = 2 n(n + 1). Then P (1) states that 1 = 1, which is true. So the base case P (1) is true. Now lets do the induction step. Suppose that k N and that (the k+1 1 inductive hypothesis) k r=1 r = 2 k (k + 1) holds. Consider r=1 r. We have
k+1 k

r =
r=1 r=1

r + (k + 1) 1 k (k + 1) + (k + 1) by the induction hypothesis 2 1 2 (k + k + 2k + 2) 2 1 2 (k + 3k + 2) 2 1 (k + 1)(k + 2) 2 1 (k + 1)((k + 1) + 1). 2

= = = = =

This establishes that P (k + 1) is true (for P (k + 1) is precisely the statement that k+1 r=1 r = (k + 1)((k + 1) + 1)/2.) Therefore, by induction, for all n N, n 1 r=1 r = 2 n(n + 1). Note how the the induction hypothesis was used. In the induction step, you always prove P (k + 1) to be true assuming P (k ) is. (Unless you do so, it isnt a proof by induction.) Activity 3.4 Prove by induction that the sum of the rst n terms of an arithmetic progression with rst term a and common dierence d is n(2a + (n 1)d)/2.

39

3. Natural numbers and proof by induction

3.6

Recursively dened sequences

Sequences of numbers are often dened recursively or by induction. For example, suppose that the sequence xn is given by x1 = 9, x2 = 13 and, for n 3, xn = 3xn1 2xn2 . We can prove by induction (using the strong induction principle) that, for all n N, xn = 5 + 2n+1 . Heres how: Since the inductive denition for xn only applies for n 3, the case step of our proof is to verify the result for the cases n = 1 and n = 2. Now, when n = 1, 5 + 2n+1 = 9, which is indeed x1 ; and when n = 2, 5 + 2n+1 = 13, which equals x2 , so these hold. Assume inductively that k N and that, for all s k , xs = 5 + 2s+1 . (Note that, here, we use strong induction. This is because xk+1 depends not only on xk but on xk1 too.) In particular, therefore, we have xk = 5 + 2k+1 and xk1 = 5 + 2k . So, xk+1 = = = = = = = = 3xk 2xk1 3(5 + 2k+1 ) 2(5 + 2k ) 15 10 + 3(2k+1 ) 10 2(2k ) 5 + 3(2k+1 ) 2(2k ) 5 + 6(2k ) 2(2k ) 5 + 4(2k ) 5 + 2k+2 5 + 2(k+1)+1 ,

which is exactly what we need. So the formula for xn holds for all n.

3.7

Using the axioms for the natural numbers

Earlier, we said that the following results follow from the axioms for N. P1. For all a, b, c N, (a + b) c = (a c) + (b c). P2. If a, b N satisfy a b = a, then b = 1. P3. For a, b, c N, if a < b and b < c, then a < c. [Transitivity] P4. For a, b, c N, if a < b then a + c < b + c and a c < b c. P5. 1 is the least element of N. P6. 1 is not equal to 1+1. Lets see why. Proof of P1. For all a, b, c N, (a + b) c = (a c) + (b c). (a + b) c = c (a + b) = (c a) + (c b) = (a c) + (b c) Proof of P2. If a, b N satisfy a b = a, then b = 1. Suppose a b = a. Then, since (by 7), a = a 1, so a b = a 1. by 5 [Commutative] by 10 [Distributive] by 5 [Commutative]

40

3.7. Using the axioms for the natural numbers

By 5 [Commutative], b a = 1 a. Then, by 9 [Cancellation], b = 1. Proof of P3. For a, b, c N, if a < b and b < c, then a < c. [Transitivity] If a < b and b < c then, by 11, there are x, y N such that a + x = b and b + y = c. Then, a + (x + y ) = (a + x) + y by 4 [Associativity] =b+y =c and so, by 11, together with the fact (by Closure, 1) that x + y N , a < c. Proof of P4. For a, b, c N, if a < b then a + c < b + c and a c < b c. If a < b then (by 11) this means d N with a + d = b. (i) We prove a + c < b + c. We have: (a + c) + d = d + (a + c) by 3 = (d + a) + c by 4 = (a + d) + c by 3 = b + c. This shows a + c < b + c. (ii) We prove a c < b c. We have: (a c) + (d c) = (a + d) c. This is P1 from above. So, since a + d = b, we have (a c) + (d c) = b c. Since d c N (by 2), we have a natural number z (z = d c) such that (a c) + z = (b c). So, by 11, a c < b c. Proof of P5. 1 is the least element of N. Certainly, by 13 [Well-ordering], N has a least member. Call it a. Suppose a = 1. Axiom 12 says a < 1 or a = 1 or 1 < a. We are assuming a = 1 and cant have 1 < a by minimality of a. So a < 1. By P4, a a < 1 a. But (Commutativity, 5), 1 a = a 1 = a (by 7). So: a a < a. But a a N (by Closure, 2) and this contradicts the minimality of a. Proof of P6. 1 is not equal to 1+1. 11 says a < b if and only if there is some c N with a + c = b. So 1 < 1 + 1. But 12 says that for all a, b N, exactly one of the following is true: a = b, a < b, b < a. So we do not have 1 = 1 + 1.

41

3. Natural numbers and proof by induction

3.8

Why the Principle works

We can now Prove the Principle of Induction from our axioms for the natural numbers (including the least element axiom). Theorem 3.1 (The Induction Principle) Suppose

(i) P (1) is true; (ii) For all k N, P (k ) P (k + 1). Then P (n) is true for all n N. Suppose its not the case that P (n) is true for all n N. Then the set S of n N for which it is not true is non-empty and, by the Least Element Axiom (13), has a least member a. Now, a = 1 because P (1) is true. And we cant have a < 1 because (P5) 1 is the least member of N. So, by 12, 1 < a. Consider a 1: this is a natural number less than a and is therefore not in S . So P (a 1) is true. But since P (k ) P (k + 1) for all k , it follows that P (a) is true, meaning a S , a contradiction. You might not be entirely satised with that proof. It used a 1 but we havent dened subtraction! Heres another way of explaining the last bit: Since 1 < a, there is some c N such that 1 + c = a (by Axiom 11). By Axiom 5 (Commutativity), c + 1 = a, which, by 11, means c < a. So, because a is the least element of S , c S and hence P (c) is true. But P (c) P (c + 1) and hence P (a) is true, a contradiction.

3.9

Learning outcomes

At the end of this chapter and the relevant reading, you should be able to: understand how the natural numbers can be dened by axioms and understand that other properties of natural numbers can be proved from the axioms state what is meant by a greatest and least member of a set of natural numbers and know what is meant by the well-ordering principle (or least element axiom) state the Induction Principle and its variants use Proof by Induction to prove a range of statements, including those involving summation and recursive sequences

42

3.10. Sample exercises

3.10

Sample exercises

Exercise 3.1 Prove by induction that, for all n N, 2n n + 1. Exercise 3.2 Prove by induction that the sum a + ar + ar2 + + arn1 of the rst n terms of a geometric progression with rst term a and common ratio r = 1 is a(1 rn )/(1 r). Exercise 3.3 Prove by induction that for all n N, 1 r2 = n(n + 1)(2n + 1). 6 r=1 Exercise 3.4
n n

Prove by induction that


i=1

1 n = . i(i + 1) n+1

Exercise 3.5 Suppose the sequence xn is given by x1 = 7, x2 = 23 and, for n 3, xn = 5xn1 6xn2 . Prove by induction that, for all n N, xn = 3n+1 2n . Exercise 3.6 Prove by induction that, for all n N, 2n+2 + 32n+1 is divisible by 7. Exercise 3.7 For a sequence of numbers x1 , x2 , x3 , . . ., and for n N, the number n r=1 xr is the product of the rst r numbers of the sequence. It can be dened inductively as follows:
1 k+1 k

xr = x1 , and for k 1,
r=1 r=1

xr =
r=1

xr

xk+1 .

Suppose that x = 1. Prove that


n

(1 + x
r=1

2r1

1 x2 )= . 1x

43

3. Natural numbers and proof by induction

3.11

Comments on selected activities

Learning activity 3.2 When n = 4, n2 = 16 and 2n = 24 = 16, so in this base case, the statement is true. Suppose we make the inductive hypothesis that for some k 4, k 2 2k . We want to show (k + 1)2 2k+1 .

We have (k + 1)2 = k 2 + 2k + 1 2k + 2k + 1 (by the inductive hypothesis). So well be done if we can show that 2k + 1 2k . This will follow from 2k + 1 k 2 and the assumed fact that k 2 2k . Now, 2k + 1 k 2 k 2 2k 1 0 (k 1)2 2, which is true for k 4. So, nally, (k + 1)2 2k + 2k + 1 2k + k 2 2k + 2k = 2k+1 . as required. So the result is true for all n 4. Learning activity 3.3 Let Q(n) be the statement s n, P (s) is true. Then Q(1) is true if and only if P (1) is true. The statement Q(k ) Q(k + 1) is the same as (P (s) true s k ) (P (s) true s k + 1). But if P (s) is true for all s k then its truth for all s k + 1 follows just from its truth when s = k + 1. That is, Q(k ) Q(k + 1) is the same as (P (s) true s k ) P (k + 1). The (standard) Induction Principle applied to the statement Q(n) tells us that: Q(n) is true for all n N if the following two statements are true: (i) Q(1) is true; (ii) For all k N, Q(k ) Q(k + 1). What weve established is that (i) and (ii) can be rewritten as: (i) P (1) is true; (ii) For all k N, (P (s) true s k ) P (k + 1). We deduce that: P (n) is true for all n N if the following two statements are true: (i) P (1) is true; (ii) For all k N, (P (s) true s k ) P (k + 1). This is exactly the Strong Induction Principle. So the Strong Induction Principle follows from the standard one and is, therefore, not really stronger. Learning activity 3.4 Let P (n) be the statement that the sum of the rst n terms is (n/2)(2a + (n 1)d). The base case is straightforward. The rst term is a, and the formula (n/2)(2a + (n 1)d) gives a when n = 1. Suppose that P (k ) holds, so the sum

44

3.12. Solutions to exercises

of the rst k terms is (k/2)(2a + (k 1)d). Now, the (k + 1)st term is a + kd, so the sum of the rst k + 1 terms is therefore k k (k 1) a + kd + (2a + (k 1)d) = a + kd + ak + d 2 2 k (k + 1) = (k + 1)a + d 2 (k + 1) (2a + kd) = 2 (k + 1) = (2a + ((k + 1) 1)d), 2 so P (k + 1) is true. The result follows for all n by induction.

3.12

Solutions to exercises

Solution to exercise 3.1 Let P (n) be the statement 2n n + 1. When n = 1, 2n = 2 and n + 1 = 2, so P (1) is true. Suppose P (k ) is true for some k N. Then 2k k + 1. It follows that 2k+1 = 2.2k 2(k + 1) = 2k + 2 k + 2 = (k + 1) + 1, so P (k + 1) is also true. Hence, by induction, for all n N, 2n n + 1. Solution to exercise 3.2 Let P (n) be the statement that the sum of the rst n terms is a(1 rn )/(1 r). P (1) states that the rst term is a(1 r1 )/(1 r) = a, which is true. Suppose P (k ) is true. Then the sum of the rst k + 1 terms is the sum of the rst k plus the (k + 1)st term, which is ark , so this sum is a(1 rk ) + (1 r)ark a(1 rk ) k + ar = 1r 1r a ark + ark ark+1 = 1r k+1 a(1 r ) , = 1r which shows that P (k + 1) is true. Hence, for all n N, P (n) is true, by induction. Solution to exercise 3.3 Let P (n) be the statement that 1 r2 = n(n + 1)(2n + 1). 6 r=1 Then P (1) states that 1 = 1(2)(3)/6, which is true. Suppose P (k ) is true for k N. Then 1 r2 = k (k + 1)(2k + 1) 6 r=1
k n

45

3. Natural numbers and proof by induction

and P (k + 1) is the statement that


k+1

1 1 r2 = (k + 1)(k + 2)(2(k + 1) + 1) = (k + 1)(k + 2)(2k + 3). 6 6 r=1

We have

k+1

r2 = (k + 1)2 +
r=1 r=1

r2

1 = (k + 1)2 + k (k + 1)(2k + 1) (by the induction hypothesis) 6 1 = (k + 1) [6(k + 1) + k (2k + 1)] 6 1 = (k + 1) 2k 2 + 7k + 6 6 1 = (k + 1)(k + 2)(2k + 3), 6 so P (k + 1) is true. By induction, P (n) is true for all n N. Solution to exercise 3.4
n

Let P (n) be the statement that


i=1

1 n = . Then P (1) states that i(i + 1) n+1

1 1 = , which is true. Suppose P (k ) is true for k N. Then 12 1+1


k

i=1

1 k = i(i + 1) k+1

and P (k + 1) is the statement that


k+1

i=1

1 k+1 = . i(i + 1) k+2

Now,
k+1

i=1

1 1 = + i(i + 1) (k + 1)(k + 2) = = = = =

i=1

1 i(i + 1)

1 k + (by the induction hypothesis) (k + 1)(k + 2) k + 1 1 + k (k + 2) (k + 1)(k + 2) k 2 + 2k + 1 (k + 1)(k + 2) (k + 1)2 (k + 1)(k + 2) k+1 , k+2

46

3.12. Solutions to exercises

so P (k + 1) is true. By induction, P (n) is true for all n N. Solution to exercise 3.5 Let P (n) be the statement that xn = 3n+1 2n . We use the Strong Induction Principle to prove P (n) is true for all n N. The base cases are n = 1 and n = 2. When n = 1, x1 = 7 and 3n+1 2n = 9 2 = 7. When n = 2, x2 = 23 and 3n+1 2n = 27 4 = 23, so these are true. Suppose that k 2 and that for all s k , P (s) is true. In particular, P (k ) and P (k 1) are true and so xk+1 = = = = = = = 5xk 6xk1 5(3k+1 2k ) 6(3k 2k1 ) 5(3k+1 ) 5(2k ) 6(3k ) + 6(2k1 ) 15(3k ) 6(3k ) 10(2k1 ) + 6(2k1 ) 9(3k ) 4(2k1 ) 3k+2 2k+1 3(k+1)+1 2k+1 ,

so P (k + 1) is true. Therefore, P (n) is true for all n N. Solution to exercise 3.6 Let P (n) be the statement that 2n+2 + 32n+1 is divisible by 7. When n = 1, 2n+2 + 32n+1 = 8 + 27 = 35 and this is a multiple of 7 because 35 = 5 7. Suppose P (k ) is true, which means that for some m N, 2k+2 + 32k+1 = 7m. Now, when we take n = k + 1, 2n+2 + 32n+1 = = = = = 2k+3 + 32k+3 2(2k+2 ) + 9(32k+1 ) 2(2k+2 + 32k+1 ) + 7(32k+1 ) 7m + 7(32k+1 ) 7 m + 32k+1 ,

which is a multiple of 7. So the statement is true for P (k + 1) and hence, by induction, for all n N. Solution to exercise 3.7 Let P (n) be the statement
n 2r1

(1 + x
r=1
0

1 x2 . )= 1x

When n = 1, the left hand side is 1 + x2 = 1 + x and the right hand side is (1 x2 )/(1 x) = 1 + x, so P (1) is true. Suppose P (k ) is true, so that
k

(1 + x
r=1

2r1

1 x2 )= . 1x

Then
k+1 k 2r1

(1 + x
r=1

) = (1 + x

2(k+1)1

)
r=1

(1 + x2

r 1

47

3. Natural numbers and proof by induction

1 x2 (by the induction hypothesis) 1x k 1 ( x2 ) 2 = (where weve used (1 + y )(1 y ) = 1 y 2 ) 1x k 1 x2 2 = 1x k+1 1 x2 , = 1x = (1 + x2 )


k

which shows that P (k + 1) is true. So P (n) is true for all n N, by induction.

48

Chapter 4 Functions and counting

R R

Biggs, N. L. Discrete Mathematics. Chapters 5 and 6. Eccles, P.J. An Introduction to Mathematical Reasoning. Chapter 10, Sections 10.1 and 10.2, and Chapter 11.

4.1

Introduction

In this chapter we look at the theory of functions, and we see how the idea of the size of a set can be formalised.

4.2
4.2.1

Functions
Basic denitions

You have worked extensively with functions in your previous mathematical study. Chiey, you will have worked with functions from the real numbers to the real numbers, these being the primary objects of interest in calculus. Well now take a more abstract approach to functions and their properties. Here is the denition of what we mean by a function. Denition 4.1 Suppose that X and Y are sets. Then a function (also known as a mapping) from X to Y is a rule that associates a unique member of Y to each member of X . We write f : X Y . The set X is called the domain of f and Y is called the codomain. The element of Y that is assigned to x X is denoted by f (x) and is called the image of x. We can write x f (x) to indicate that x maps to f (x). There are various ways of describing a function. Sometimes, if X has only nitely many members, we can simply list the images of the members of X . More usually, we can give a formula for the function. For instance, f : R R given by f (x) = 2x is the function that maps each real number a to the real number 2a. Sometimes a function can be dened recursively. For example, we might dene f : N N by f (1) = 1 f (n) = 2 + 3f (n 1), (n 2). (You can see that the sequence of numbers f (1), f (2), f (3), . . . is therefore given by a rst order dierence equation.)

49

4. Functions and counting

What does it mean to say that two function f, g are equal? Well, rst, they must have the same domain X and codomain Y . Then, for each x X , we must have f (x) = g (x). For example, if R+ is the set of positive real numbers, then the function f : R+ R given by f (x) = x2 and the function g : R R given by g (x) = x2 are not equal because their domains are dierent. For any set X , the identity function i : X X is given by i(x) = x.

4.2.2

Composition of functions

Suppose that X, Y, Z are sets and that f : X Y and g : Y Z . Then the composition gf , also denoted by g f , is the function from X to Z given by (gf )(x) = g (f (x)) (x X ). Note the notation, which can sometimes cause confusion. For example, suppose X = Y = Z = R. Then you might be tempted to think that gf denotes the product function (gf )(x) = g (x)f (x). But this would be wrong. It should always be clear from the context whether gf should be interpreted as a composition. Be aware of this. If I need to talk about the product of the functions f and g I will denote this by f (x)g (x). The notation g f leads to less confusion, but it is not used in all textbooks. Example 4.1 Suppose f : N N and g : N N are given by f (x) = x2 + 1 and g (x) = (x + 1)2 . Then, (f g )(x) = f (g (x)) = f ((x + 1)2 ) = ((x + 1)2 )2 + 1 = (x + 1)4 + 1. And, (gf )(x) = g (f (x)) = g (x2 + 1) = ((x2 + 1) + 1)2 = (x2 + 2)2 .

4.3

Bijections, surjections and injections

There are three very important properties that a function might possess: Denition 4.2 (Surjection) Suppose f is a function with domain X and codomain Y . Then f is said to be a surjection (or f is surjective) if every y Y is the image of some x X ; that is, f is a surjection if and only if y Y, x X, s.t. f (x) = y. Denition 4.3 (Injection) Suppose f is a function with domain X and codomain Y . Then f is said to be an injection (or f is injective) if every y Y is the image of at most one x X . In other words, the function is an injection if dierent elements of X have dierent images under f . Thus, f is an injection if and only if x, x X, x = x f (x) = f (x ) or (equivalently, taking the contrapositive), if and only if x, x X, f (x) = f (x ) x = x .

50

4.3. Bijections, surjections and injections

This latter characterisation often provides the easiest way to verify that a function is an injection. Denition 4.4 (Bijection) Suppose f is a function with domain X and codomain Y . Then f is said to be a bijection (or f is bijective) if it is both an injection and a surjection. So this means two things: each y Y is the image of some x X , and each y Y is the image of no more than one x X . Well, of course, this is equivalent to: each y Y is the image of precisely one x X . Example 4.2 f : N N given by f (x) = 2x is not a surjection, because there is no n N such that f (n) = 1. (For, 2n = 1 has no solution where n N.) However, it is an injection. To prove this, suppose that m, n N and f (m) = f (n). Then 2m = 2n, which implies m = n. Example 4.3 f : R R given by f (x) = 2x is a bijection. Activity 4.1 Prove that f : R R given by f (x) = 2x is a bijection.

4.3.1

An example

Let X = R, the set of real numbers, and let Y be the interval (1, 1), the set of real numbers x such that 1 < x < 1. Then the function f : X Y given by f (x) = is a bijection from X to Y . First, we prove f is injective. To do this, we prove that f (x) = f (y ) implies x = y . So, suppose f (x) = f (y ). Then x y = . 1 + |x| 1 + |y | So x + x|y | = y + y |x|. Because x/(1 + |x|) = y/(1 + |y |), x and y are both non-negative or both negative. For, otherwise, one of x/(1 + |x|) and y/(1 + |y |) will be negative and the other one will be non-negative, which cannot be the case since they are equal. So, x|y | = y |x|, both being xy if x, y 0 and xy if x, y < 0. So, we have x = y . Next, we show f is surjective. We need to prove that, for each y (1, 1), theres x R such that x/(1 + |x|) = y . Consider separately the case in which y 0 and the case in which y < 0. y 0. Then, to have x/(1 + |x|) = y , need x 0. So |x| = x and we need to solve x/(1 + x) = y . This has solution x = y/(1 y ). y < 0. Then well need to have x < 0 and the equation to solve is x/(1 x) = y , which has solution x = y/(1 + y ). x 1 + |x|

51

4. Functions and counting

4.4
4.4.1

Inverse functions
Denition, and existence

Suppose f : X Y . Then g : Y X is an inverse function of f if (gf )(x) = x for all x X and (f g )(y ) = y for all y Y . An equivalent characterisation is that y = f (x) x = g (y ). The following theorem tells us precisely when a function has an inverse. It also tells us that if an inverse exists, then there is only one inverse. For this reason we can speak of the inverse function, and give it a specic notation, namely f 1 . Theorem 4.1 f : X Y has an inverse function if and only if f is a bijection. When f is bijective, there is a unique inverse function. First, we prove: f : X Y has an inverse f is bijective. Proof. This is an theorem, so there are two things to prove: the and the . First, we show: f : X Y has an inverse f is bijective. Suppose f is a bijection. For each y Y there is exactly one x X with f (x) = y . Dene g : Y X by g (y ) = x. Then this is an inverse of f . Check this! Next, we show: f : X Y has an inverse f is bijective. Suppose f has an inverse function g . We know that for any y Y , f (g (y )) = (f g )(y ) = y , so there is some x X (namely x = g (y )) such that f (x) = y . So f is surjective. Now suppose f (x) = f (x ). Then g (f (x)) = g (f (x )). But g (f (x)) = (gf )(x) = x and, similarly, g (f (x )) = x . So: x = x and f is injective. Now we prove that when f is bijective, the inverse is unique. Suppose that g and h are inverses of f . Then hf is the identity function on X and f g is the identity function on Y . So, for any y Y , g (y ) = (hf )(g (y )) = ((hf )g )(y ) = (h(f g ))(y ) = h((f g )(y )) = h(y ), so g = h. Note that if f : X Y is a bijection, then its inverse function (which exists, by Theorem 4.1) is also a bijection.

4.4.2

Examples

Example 4.4 The function f : R R is given by f (x) = 3x + 1. Find the inverse function. To nd a formula for f 1 , we use: y = f (x) x = f 1 (y ). Now, y = f (x) y = 3x + 1 x = (y 1)/3,

52

4.5. Counting as a bijection

so

1 f 1 (y ) = (y 1). 3

Let Z denote the set of all integers (positive, zero, and negative). Example 4.5 The function f : Z N {0} is dened as follows: f (n) = 2n if n 0 2n 1 if n < 0.
1

4
.

Prove that f is a bijection and determine a formula for the inverse function f

First, we prove that f is injective: Suppose f (n) = f (m). Since 2n is even and 2n 1 is odd, either (i) n, m 0 or (ii) n, m < 0. (For otherwise, one of f (n), f (m) is odd and the other even, and so they cannot be equal.) In case (i), f (n) = f (m) means 2n = 2m, so n = m. In case (ii), f (n) = f (m) means 2n 1 = 2m 1, so n = m. Therefore f is injective. Next, we prove that f is surjective: We show that m N {0}, n Z such that f (n) = m. Consider separately the case m even and the case m odd. Suppose m is even. Then n = m/2 is a non-negative integer and f (n) is 2(m/2) = m). If m odd, then n = (m + 1)/2 is a negative integer and f (n) = f ((m + 1)/2) = 2 (m + 1) 2 1 = m.

The proof that f is surjective reveals to us what the inverse function is. We have f 1 (m) = m/2 if m even (m + 1)/2 if m odd.

4.5

Counting as a bijection

What does it mean to say that a set has three objects? Well, it means that I can take an object from the set, and call that Object 1, then I can take a dierent object from the set and call that Object 2, and then I can take a dierent object from the set and call that Object 3, and then there will be no objects left in the set without a name. Obvious, I know, but this is the fundamental way in which we can abstractly dene what we mean by saying that a set has m members. For m N, let Nm be the set {1, 2, . . . , m} consisting of the rst m natural numbers. Then we can make the following formal denition: Denition 4.5 A set S has m members if there is a bijection from Nm to S .

53

4. Functions and counting

So, the set has m members if to each number from 1 to m, we can assign a corresponding member of the set S , and all members of S are accounted for in this process. This is like the attachment of labels Object 1, etc, described above. Note that an entirely equivalent denition is to say that S has m members if there is a bijection from S to Nm . This is because if f : Nm S is a bijection, then the inverse function f 1 : S Nm is a bijection also. In fact, because of this, we can simply say that S has m members if there is a bijection between Nm and S . (Eccles uses the denition that involves a bijection from Nm to S and Biggs uses the denition that involves a bijection from S to Nm .)

For m N, if S has m members, we say that S has cardinality m (or size m). The cardinality of S is denoted by |S |.

4.6
4.6.1

The pigeonhole principle


The principle

The pigeonhole principle is something that you might nd obvious, but it is very useful. Informally, what it says is that says is that if you have n letters and you place them into m pigeonholes in such a way that no pigeonhole contains more than one letter, then n m. Equivalently, if n > m (so that you have more letters than pigeonholes), then some pigeonhole will end up containing more than one letter. This is very intuitive. Obvious as it may be, however, can you think about how you would actually prove it? We shall prove it below. But lets state the principle more formally, rst. Recall that, for r N, Nr = {1, 2, . . . , r}. Theorem 4.2 (Pigeonhole Principle (PP)) Let m be a natural number. Then the following statement is true for all n N: if there is an injection from Nn to Nm , then n m. Proof. We prove this by induction. The statement we want to prove is the statement P (n): if there is an injection from Nn to Nm , then n m. The base case, n = 1, is true because (since m N), 1 m. Suppose P (k ) is true. We now want to show that P (k + 1) is also true. So suppose there is an injection f : Nk+1 Nm . (What we want to show is that k + 1 m.) Since k 1, k + 1 2. So m must be at least 2. (If m was 1, then, for example, f (1) and f (2) would be equal, and f would not be an injection.) Since m 2 we can write m as m = s + 1 where s N. Now, either there is some x Nk = {1, 2, . . . , k } with f (x) = s + 1, or there is not. Lets examine each case separately. Suppose, then, rst, that for no x Nk do we have f (x) = s + 1. Then dene f : Nk Ns by f (x) = f (x) for x Nk . Then, because f is an injection, so too is f . So there is an injection (namely, f ) from Nk to Ns . By the induction hypothesis, therefore, k s and hence k + 1 s + 1 = m, as required. Now suppose that there is some j Nk such that f (j ) = s + 1. Then the value y = f (k + 1) must be dierent from s + 1 and therefore y Ns . Dene

54

4.6. The pigeonhole principle

f : Nk Ns by f (j ) = y and f (x) = f (x) if x Nk \ {j }. Then f maps from Nk to Nm and, furthermore, it is an injection. So, by the inductive hypothesis, k s and hence k + 1 s + 1 = m.

A consequence of this is: Theorem 4.3 Suppose n, m are two natural numbers. If there is a bijection from Nn to Nm , then n = m. Proof. Suppose f : Nn Nm is a bijection. Then f is an injection. So from Theorem PP, n m. But there is in inverse function f 1 : Nm Nn and this is also a bijection. In particular, f 1 is an injection from Nm to Nn , and hence m n. Now we have both n m and m n, hence n = m. A slightly more general form of the pigeonhole principle, easy to prove from that above is: Theorem 4.4 Suppose that A and B are sets with |A| = n and |B | = m, where m, n N. If there is an injection from A to B , then m n. Proof. From the denition of counting, there are bijections g : Nn A and h : Nm B . We also have an inverse bijection h1 : B Nm . Suppose there is an injection f : A B . Consider the composite function h1 f g : Nn Nm . If we can prove that this is an injection, then from Theorem 4.2 it follows that n m. So, let us prove injectivity. Suppose a, b Nn with a = b. Since g is a bijection g (a), g (b) A with g (a) = g (b). Since f is an injection f (g (a)), f (g (b)) B with f (g (a)) = f (g (b)). Since h1 is a bijection h1 (f (g (a))), h1 (f (g (b))) Nm with h1 (f (g (a))) = h1 (f (g (b))). This last inequality is what we need. The pigeonhole principle is remarkably useful (even in some very advanced areas of mathematics). It has many applications. For most applications, it is the contrapositive form of the principle that is used. This states: If m < n then there is no injection f : Nn Nm . So, if m < n, and f is any function f : Nn Nm , then there are x, y Nn with x = y such that f (x) = f (y ).

4.6.2

Some applications of the Pigeonhole Principle

We now prove some theorems using the pigeonhole principle. We start with an easy example. Theorem 4.5 In any group of 13 or more people, there are two persons whose birthday is in the same month.

55

4. Functions and counting

Proof. Consider the function that maps the people to their months of birth. Since 13 > 12, this cannot be a bijection, so two people are born in the same month. This next one is not hard, but perhaps not immediately obvious. Theorem 4.6 In a room full of people, there will always be at least two people who have the same number of friends in the room. Proof. Let X be the set of people in the room and suppose |X | = n 2. Consider the function f : X N {0} where f (x) is the number of friends x has in the room.

Lets assume that a person cant be a friend of themselves. (We could instead assume that a person is always friendly with themselves: we simply need a convention one way or the other.) Then f (X ) = {f (x) : x X } {0, 1, . . . , n 1}. But there cant be x, y with f (x) = n 1 and f (y ) = 0. Why? Well, such a y would be a friend of all the others, including x, which isnt possible since x has no friends in the room. So either f (X ) {0, 1, . . . , n 2} or f (X ) {1, . . . , n 1}. In each case, since f (x) can take at most n 1 values, there must, by PP, be at least two x, y X with f (x) = f (y ). And thats what we needed to prove. Heres an interesting geometrical example. For two points (x1 , y1 ), (x2 , y2 ) in the plane, the midpoint of (x1 , y1 ) and (x2 , y2 ) is the point 1 1 (x1 + x2 ), (y1 + y2 ) 2 2 (the point on the middle of the line connecting the two points ). Theorem 4.7 If we have a set A of ve or more points in the plane with integer coordinates, then there are two points in A whose midpoint has integer coordinates. Proof. For two integers a, b, 1 (a + b) is an integer if and only if a + b is even, so if and 2 only if a, b or both even or both odd. So the midpoint of (x1 , y1 ), (x2 , y2 ) has both coordinates integer if and only if x1 , x2 are both even or both odd, and also y1 , y2 are both even or both odd. Lets label each of the points (a, b) of A with one of (even,even), (even,odd), (odd,even) or (odd,odd). Since |A| 5, there will be at least two points which receive the same label. Hence these two points have the same parity (odd or even) for the rst coordinate, and the same parity for the second coordinate. This means the midpoint of these two points must be integer as well. By the way, this result would not necessarily hold if we only had four points in the set. Consider (0, 0), (1, 0), (1, 0) and (1, 1). Heres a very interesting number theory application (with a very sneaky proof). It uses the notion of remainders on division by n, which well cover properly soon: for now, all we need is that, for every natural number m, the remainder, r, upon division by n is one of the numbers 0, 1, . . . , n 1, and that m r is divisible by n.

56

4.7. A generalised form of PP

Theorem 4.8 Let a1 , a2 , . . . , an be n integers (where n 2). Then there exists a non-empty collection of these integers whose sum is divisible by n. Proof. Consider the numbers s0 , s1 , . . . , sn given by s0 = 0, s 1 = a1 , s 2 = a1 + a2 , s 3 = a1 + a2 + a3 , etc., until s n = a1 + a2 + + an . (It is not obvious, at all, why we should do this, but it will work!) For each of these si , consider the remainder upon division by n. Since there are n + 1 numbers si , but only n possible remainders (0, 1, . . . , n 1), two of the si will have the same remainder upon division by n. So suppose sk and s have the same remainder, where k < . Then s sk is divisible by n. But since s sk = ak+1 + ak+2 + + a , this means that the sum ak+1 + ak+2 + + a is divisible by n. Se we have proved the result. In fact we proved something even stronger than what we set out to prove : Let a1 , a2 , . . . , an be a list of n integers ( where n 2 ). Then there exists a non-empty collection of consecutive numbers from this list ak+1 , ak+2 , . . . , a whose sum is divisible by n. The theorem isnt true if we have fewer than n integers. For instance, if for any n 2 we take the numbers a1 , . . . , an1 all equal to 1, then its impossible to nd a sum that adds up to something divisible by n.

4.7

A generalised form of PP

We state without proof the following more general version of the PP. Again, its rather obvious. Isnt it? Theorem 4.9 Suppose f : A B and that |A| > k |B | where k N. Then there is some element of B that is the image of at least k + 1 elements of A. Last year, 232 students were registered for this course. I knew, before marking the exams, that at least three of them would get the same exam mark. Why? Well, apply the theorem, with A being the students, B being the set {0, 1, . . . , 100} of all possible marks (which is of size 101) and f (x) the mark of student x. Since 232 > 2(101), theres some mark y such that at least 2 + 1 = 3 students will have y = f (x), which means they get the same mark.

57

4. Functions and counting

4.8

Innite sets

We say that a set A is nite when there is some n N such that |A| = n. Otherwise, A is said to be innite. For example, the set of natural numbers is innite. You might think thats obvious, but how would you prove it? (Remember that the formal denition that a set A has cardinality n is that there is a bijection between Nn and A.) One way to show this is to use a proof by contradiction. Suppose (for a contradiction) that N is nite, of cardinality n N, and that f : Nn N is a bijection. Consider the number N = f (1) + f (2) + + f (n). Since each f (i) is a natural number, for all i Nn , N is also a natural number. But N > f (i) for all i Nn . So here is a natural number, N , that is not equal to f (i) for any i Nn . But that contradicts the fact that f is a bijection, because if its a bijection then its certainly a surjection and there should be some i Nn with f (i) = N .

4.9

Learning outcomes

At the end of this chapter and the relevant reading, you should be able to: describe precisely what is meant by a function describe precisely what it means to say a function is a surjection, an injection and a bijection, and be able to determine whether a given function has these properties state the denition of the composite function gf establish whether a function has an inverse or not demonstrate that you understand the formal denition of the cardinality of a nite set state and use the pigeonhole principle state what it means to say that a set is innite; and be able to prove that a set is innite.

58

4.10. Sample exercises

4.10

Sample exercises

Exercise 4.1 Suppose that X, Y, Z are sets and that f : X Y and g : Y Z . Prove that if f and g are injections, so is the composition gf . Prove also that if f and g are surjections, then so if the composition gf . Exercise 4.2 Let Z be the set of all integers and suppose that f : Z Z is given, for x Z, by f (x) = x+1 if x is even x + 3 if x is odd.

Determine whether f is injective. Determine also whether f is surjective. Exercise 4.3 Suppose that X, Y, Z are sets, that f : X Y , g : Y Z , and h : Y Z . Suppose that the compositions hf and gf are equal, and also that f is surjective. Prove that g = h. Exercise 4.4 Suppose that X, Y, Z are sets and that f : X Y and g : Y Z . Prove that if the composition gf in injective, then f is injective. Prove that if gf is surjective, then g is surjective. Exercise 4.5 Suppose that A and B are non-empty nite sets and that they are disjoint (meaning that A B = ). Prove, using the formal denition of cardinality, that |A B | = |A| + |B |. Exercise 4.6 Suppose that X, Y are any two nite sets. By using the fact that X Y = (X \ Y ) (Y \ X ) (X Y ), together with the result of Exercise 4.5, prove that |X Y | = |X | + |Y | |X Y |. Exercise 4.7 Suppose n N and that f : N2n+1 N2n+1 is a bijection. Prove that there is some odd integer k N2n+1 such that f (k ) is also odd. (State clearly any results you use.)

59

4. Functions and counting

4.11

Comments on selected activities

Learning activity 4.1 Given any y R, let x = y/2. Then f (x) = 2(y/2) = y . This shows that f is surjective. Also, for x, y R, f (x) = f (y ) 2x = 2y x = y, which shows that f is injective. Hence f is a bijection.

4.12

Solutions to exercises

Solution to exercise 4.1 Suppose f and g are injective. Then, for x, y X , (gf )(x) = (gf )(y ) g (f (x)) = g (f (y )) f (x) = f (y ) (because g is injective) x = y (because f is injective). This shows that gf is injective. Suppose that f and g are surjective. Let z Z . Then, because g is surjective, there is some y Y with g (y ) = z . Because f is surjective, there is some x X with f (x) = y . Then (gf )(x) = g (f (x)) = g (y ) = z, so z is the image of some x X under the mapping gf . Since z was any element of Z , this shows that gf is surjective. Solution to exercise 4.2 Suppose one of x, y is even and the other odd. Without any loss of generality, we may suppose x is even and y odd. (Without loss of generality signies that there is no need to consider also the case in which x is odd and y is even, because the argument wed use there would just be the same as the one were about to give, but with x and y interchanged.) So f (x) = x + 1 and f (y ) = y + 3. But we cannot then have f (x) = f (y ) because x + 1 must be an odd number and y + 3 an even number. So if f (x) = f (y ), then x, y are both odd or both even. If x, y are both even, this means x + 1 = y + 1 and hence x = y . If they are both odd, this means x + 3 = y + 3, which means x = y . So we see that f is injective. Is f surjective? Let z Z. If z is odd, then z 1 is even and so f (z 1) = (z 1) + 1 = z . If z is even, then 3 z is odd and so f (3 z ) = (3 z ) + 3 = z . So for z Z there is x Z with f (x) = z and hence f is surjective. Solution to exercise 4.3 Suppose f is surjective and that hf = gf . Let y Y . We show g (y ) = h(y ). Since y is any element of Y in this argument, this will establish that g = h. Because f is surjective, there is some x X with f (x) = y . Then, because hf = gf , we have h(f (x)) = g (f (x)), which means that h(y ) = g (y ). So weve achieved what we needed.

60

4.12. Solutions to exercises

Solution to exercise 4.4 Suppose gf is injective. To show that f is injective we need to show that f (x) = f (y ) x = y . Well, f (x) = f (y ) g (f (x)) = g (f (y )) (gf )(x) = (gf )(y ) x = y, where the last implication is because gf is injective. Now suppose gf is surjective. So for all z Z there is some x X with (gf )(x) = z . So g (f (x)) = z . Denoting f (x) by y , we therefore see that there is y Y with g (y ) = z . Since z was any element of Z , this shows that g is surjective. Solution to exercise 4.5 Suppose |A| = m and |B | = n. We need to show that |A B | = m + n which means, according to the denition of cardinality, that we need to show there is a bijection from Nm+n to A B . Because |A| = m, there is a bijection f : Nm A and because |B | = n, there is a bijection g : Nn B . Let us dene h : Nm+n A B as follows: for 1 i m, h(i) = f (i) and for m + 1 i m + n, h(i) = g (i m). Then h is injective. We can argue this as follows: if 1 i, j m then h(i) = h(j ) f (i) = f (j ) i = j, because f is injective. If m + 1 i, j m + n then h(i) = h(j ) g (i m) = g (j m) i m = j m i = j, because g is injective. The only other possibility is that one of i, j is between 1 and m and the other between m + 1 and m + n. In this case, the image under h of one of i, j belongs to A and the image of the other to B and these cannot be equal because A B = . So h is indeed an injection. It is also a surjection. For, given a A, because f is a surjection, there is 1 i m with f (i) = a. Then h(i) = a also. If b B then there is some 1 j n such that g (j ) = b. But then, this means that h(m + j ) = g ((m + j ) m) = b, so b is the image under h of some element of Nm+n . So h is a bijection from Nm+n to A B and hence |A B | = m + n. Solution to exercise 4.6 Note rst that the two sets (X \ Y ) (Y \ X ) and X Y are disjoint. Therefore, |X Y | = |(X \ Y ) (Y \ X )| + |X Y |. Now, (X \ Y ) and (Y \ X ) are disjoint, so |(X \ Y ) (Y \ X )| = |(X \ Y )| + |(Y \ X )| and therefore |X Y | = |(X \ Y )| + |(Y \ X )| + |X Y |. Now, the sets X \ Y and X Y are disjoint and their union is X , so |X | = |(X \ Y ) (X Y )| = |X \ Y | + |X Y |.

61

4. Functions and counting

A similar argument shows that |Y | = |(Y \ X ) (X Y )| = |Y \ X | + |X Y |. These mean that |X \ Y | = |X | |X Y | and |Y \ X | = |Y | |X Y |. So we have

|X Y | = |(X \ Y )| + |(Y \ X )| + |X Y | = (|X | |X Y |) + (|Y | |X Y |) + |X Y | = |X | + |Y | |X Y |. Solution to exercise 4.7 Let E be the set of even integers, and O the set of odd integers, in the range {1, 2, . . . , 2n + 1}. Then |E | = n and |O| = n + 1. If f was such that f (k ) was even for all k O, then f : O E given by f (x) = f (x) would be an injection. But, by the pigeonhole principle, since |O| > |E |, such an injection cannot exist. Hence there is some odd k such that f (k ) is odd.

62

Chapter 5 Equivalence relations and the integers

R R
5.1

Biggs, N. L. Discrete Mathematics. Chapter 7. Eccles, P.J. An Introduction to Mathematical Reasoning. Chapter 22.

Introduction

In this chapter of the notes we study the important idea of an equivalence relation, a concept that is central in abstract mathematics. As an important example, we look at how the integers can be dened from the natural numbers through the use of an equivalence relation. We also study some of the important properties of the integers.

5.2
5.2.1

Equivalence relations
Relations in general

The idea of a relation is quite a general one. For example, consider the set of natural numbers N and let us say that two natural numbers m, n are related, denoted by m R n, if m + n is even. So we have, for instance, 6 R 2 and 7 R 5, but that 6 and 3 are not related. This relation has some special properties. For one thing, since 2n is even for all n N, n R n for all n N. (We say such a relation is reexive.) Also, if m R n, then m + n is even. But m + n = n + m and hence, also, n R m. (We say such a relation is symmetric.) It is because m R n n R m that we can simply say that m and n are related rather than m is related to n or n is related to m. The relation R has other important properties that we will come back to later. Formally, a relation R on a set X is a subset of the Cartesian product X X (which, recall, is the set of all ordered pairs of the form (x, y ) where x, y X ). Example 5.1 Suppose R is the relation on R given by x R y x > y . Regarded as a subset of R R, this is the set {(x, y ) | x > y }. This relation does not possess the reexive and symmetric properties we met in the example above. For no x R do we have x R x because x is not greater than x. Furthermore, if x R y then x > y , and we cannot therefore also have y R x, for that would imply the contradictory statement that y > x. In many cases, we use special symbols for relations. For instance = is a relation, as is >. It is often convenient to use a symbol other than R: for instance, many textbooks use x y rather than x R y to denote the typical relation.

63

5. Equivalence relations and the integers

5.2.2

The special properties of equivalence relations

There are three special properties that a relation might have (two of which we saw in one of the earlier examples): Denition 5.1 Suppose that R is relation on a set X . Then [The reexive property] R is said to be reexive if, for all x X , x R x. [The symmetric property] R is said to be symmetric if, for all x, y X , x R y implies y R x (equivalently, for all x, y X , x R y y R x). [The transitive property] R is said to be transitive if, for all x, y, z X , whenever x R y and y R z , we also have x R z ; that is, (x R y ) (y R z ) xRz .

A relation that has all three of these properties is called an equivalence relation. Denition 5.2 A relation is an equivalence relation if is reexive, symmetric and transitive. Example 5.2 We saw earlier that the relation on N given by m R n m + n is even is reexive and symmetric. It is also transitive. To prove that, suppose x, y, z are three natural numbers and that x R y and y R z . Then x + y is even and y + z is even. To show that x R z we need to establish that x + z is even. Well, x + z = (x + y ) + (y + z ) 2y, and all three terms on the right (x + y , y + z , and 2y ) are even. Therefore, x + z is even and so x R z . Example 5.3 Let X be the set of n n real matrices. Dene a relation on X by: M N r, s N s.t. M r = N s . Then is an equivalence relation. Reexivity and symmetry are easy to see: M 1 = M 1 and, if M r = N s , then N s = M r . Proving transitivity requires more work. Suppose M N and N R. Then there are r, s, t, u N with M r = N s and N t = Ru . Then M rt = (M r )t = (N s )t = (N t )s = (Ru )s = Rus , so there are integers w = rt and x = us such that M w = Rx and hence M R.

5.3

Equivalence classes

Given an equivalence relation, it is natural to group together objects that are related to each other. The resulting groupings are known as equivalence classes. In this section, we

64

5.3. Equivalence classes

formally dene equivalence classes and discuss some of their properties. Denition 5.3 Suppose R is an equivalence relation on a set X and, for x X , let [x] be the set of all y X such that y R x. So, [ x] = { y X | y R x } . Notice that each [x] is a subset of X . Example 5.4 Consider again R on N given by m R n m + n is even. Any even number is related to any other even number; and any odd number to any odd number. So there are two equivalence classes: [1] = [3] = [5] = = set of odd positive integers, [2] = [4] = [6] = = set of even positive integers,

Example 5.5 Suppose that f : X Y is a surjection. Dene relation R on X by x R y f (x) = f (y ). Then R is an equivalence relation and the equivalence classes are given by Cy = {x X : f (x) = y }, for y Y . Activity 5.1 Check this! The equivalence classes have a number of important properties. These are given in the following result. Theorem 5.1 Suppose R is an equivalence relation on a set X . Then (i) For x, y X , [x] = [y ] x R y (ii) For x, y X , if x and y are not related by R, then [x] [y ] = . Proof. (i) This is an if and only if statement, so we have two things to prove: namely that [x] = [y ] x R y and that x R y [x] = [y ]. Suppose, then, that [x] = [y ]. The relation R is reexive, so we have x R x. This means that x [x]. But if [x] = [y ], then we must have x [y ]. But that means (by denition of [y ]) that x R y . Conversely, suppose that x R y . We now want to show that [x] = [y ]. So let z [x]. (We will show that z [y ].) Then z R x. But, because x R y and R is transitive, it follows that z R y and hence z [y ]. This shows [x] [y ]. We now need to show that [y ] [x]. Suppose w [y ]. Then w R y and, since x R y , we also have, since R is symmetric, y R x. So w R y and y R x. By transitivity of R, w R x and hence w [x]. This shows that [y ] [x]. Because [x] [y ] and [y ] [x], [x] = [y ], as required. (ii) Suppose x and y are not related. We prove by contradiction that [x] [y ] = . So suppose [x] [y ] = . Let z be any member of the intersection [x] [y ]. (The fact that

65

5. Equivalence relations and the integers

were assuming the intersection is non-empty means there is such a z .) Then z [x], so z R x and z [y ], so z R y . Because R is symmetric, x R z . So: x R z and z R y and, therefore, by transitivity, x R y . But this contradicts the fact that x, y are not related by R. So [x] [y ] = . Theorem 5.1 shows that either two equivalence classes are equal, or they are disjoint. Furthermore, because an equivalence relation is reexive, any x X is in some equivalence class (since it certainly belongs to [x] because x R x). So what we see is that the equivalence classes form a partition of X : their union is the whole of X , and no two equivalence classes overlap. Example 5.6 Consider again the equivalence relation R on N given by m R n m + n is even.

We have seen that there are precisely two equivalence classes: the set of odd positive integers and the set of even positive integers. Note that, as the theory predicted, these form a partition of all of N (since every natural number is even or odd, but not both).

5.4

Construction of the integers from the natural numbers

This section might seem at rst a little tricky. We know what the integers are, so why do we have to dene or construct them, you might well ask. Well, for one thing the procedure were about to look at is used very often in mathematics. We will meet it again when we study rational numbers and modular arithmetic. The big idea here is that we can often dene an interesting set of objects (and perform operations on them) by considering the set of equivalence classes of some relation. That is, we have a set X and an equivalence relation R on X , and we look at the set C of equivalence classes. In the abstract, this is perhaps confusing, but we will see some examples over the course of the next few chapters. We start with the integers. (The informal motivation behind what follows is this: imagine you have deposits of a and debts of b. Denote this by (a, b). Then you have a total of a b, which might be negative.) We can describe, or construct, the integers from the natural numbers, using an equivalence relation. In fact, we consider an equivalence relation on the set N N of all ordered pairs of natural numbers. Given (a, b) and (c, d) in X = N N, let us say that (a, b) R (c, d) a + d = b + c. (Informal motivation: were thinking of [(a, b)] as the (familiar) integer a b. Thats why we dened (a, b) R (c, d) a + d = b + c. This is the same as a b = c d. But we want to make this work, in the set of natural numbers and using addition, not subtraction, which we havent dened.)

66

5.4. Construction of the integers from the natural numbers

Ive said this is an equivalence relation, but lets check this. First, R is reexive because (a, b) R (a, b) if and only if a + b = b + a, which is clearly true. Next, R is symmetric, for (a, b) R (c, d) a + d = b + c c + b = d + a (c, d) R(a, b). Finally, R is transitive. For suppose that (a, b) R (c, d) and (c, d) R (e, f ). Then a + d = b + c and c + f = d + e. Therefore, (a + d) + (c + f ) = (b + c) + (d + e). That is (after cancelling c and d from each side), a + f = b + e, which means (a, b) R (e, f ). What are the equivalence classes of R? The typical equivalence class [(a, b)] contains all (c, d) for which a + d = b + c. For example, [(2, 1)] will be [(2, 1)] = {(3, 2), (4, 3), (5, 4), . . .}. Now, for n N, let us denote the equivalence class [(n + 1, 1)] by n and let us denote the equivalence class [(1, n + 1)] by n. Also, we denote by 0 the class [(1, 1)]. Then we dene the integers to be the set {. . . , 3, 2, 1, 0, 1, 2, 3, . . .}. We can do arithmetic (addition and multiplication) with the integers dened in this way. First, lets dene an addition operation (between equivalence classes) by [(a, b)] + [(c, d)] = [(a + c, b + d)]. So, for example, what does this say about the sum of integers +3 and 1. Well, +3 = [(4, 1)] and 1 = [(1, 2)] and therefore +3 + 1 = [(4, 1)] + [(1, 2)] = [(5, 3)]. Now, (5, 3) R (3, 1), so [(5, 3)] = [(3, 1)], which is what we called +2. No surprise there, then: 3 + (1) = 2 in the usual notation for integer arithmetic. (Henceforth, we can simply write m + (n) as the subtraction m n.) There is quite a subtle point about this denition of addition of equivalence classes. We know that there are many (innitely many) pairs (a , b ) such that [(a, b)] = [(a , b )]. Such an (a , b ) is called a representative of the equivalence class. (It is always the case, for any equivalence relation, as Theorem 5.1 shows, that [x] and [x ] are the same whenever x R x. So any equivalence class can be represented by potentially many dierent representatives: any member of the class will do.) So we need to be sure that the denition of addition will give us the same answer if we use dierent

67

5. Equivalence relations and the integers

representatives. In other words, suppose that [(a , b )] = [(a, b)] and [(c , d )] = [(c, d)]. The denition of addition, [(a, b)] + [(c, d)] = [(a + c, b + d)], will only make sense (or, it will only be consistent) if [(a , b )] + [(c , d )] = [(a, b)] + [(c, d)]. Thus, we need to prove that if [(a , b )] = [(a, b)] and [(c , d )] = [(c, d)], then [(a + c, b + d)] = [(a + c , b + d )]. We can see this easily enough in specic cases. For instance, [(4, 1)] = [(6, 3)] and [(1, 2)] = [(2, 3)]. We have [(4, 1)] + [(1, 2)] = [(5, 3)] and [(6, 3)] + [(2, 3)] = [(8, 6)]. Well, (5, 3) R (8, 6), because 5 + 6 = 3 + 8, so [(5, 3)] = [(8, 6)]. So, in this case, and with these choices of representatives for each equivalence class, we end up with the same class when we apply the addition operation. We can prove, more generally, that the denition works, that it does not depend on the choice of representatives of the classes. Remember, what we need to prove is that if [(a , b )] = [(a, b)] and [(c , d )] = [(c, d)], then [(a + c, b + d)] = [(a + c , b + d )]. Well, [(a , b )] = [(a, b)] and [(c , d )] = [(c, d)] mean that (a , b ) R (a, b) and (c , d ) R (c, d), so that a + b = b + a and c + d = d + c. We need to show that [(a + c, b + d)] = [(a + c , b + d )]. This means we need to show that (a + c, b + d) R (a + c , b + d ). But (a + c, b + d) R (a + c , b + d ) (a + c) + (b + d ) = (b + d) + (a + c ) (a + b ) + (d + c) = (a + b) + (c + d), which is true, because a + b = b + a and c + d = d + c. Multiplication, , is dened on these equivalence classes by [(a, b)] [(c, d)] = [(ac + bd, ad + bc)].

5.5

Properties of the integers

We now revert to the usual notation for the integers. In particular, we denote +n by n and consider N to be a subset of Z, the set of integers. Many of the usual properties of integers follow from the formal denition of integers given in the previous section: see Biggs, Section 7.5, for more details. We give one example:

68

5.6. Ordering the integers

Example 5.7 With the integers as dened formally in the previous section, we show that for any integer z , z + 0 = z . Recall that, for some (a, b), we will have z = [(a, b)] and that 0 is [(1, 1)]. Now, the denition of addition of integers (that is, of the equivalence classes) means that z + 0 = [(a, b)] + [(1, 1)] = [(a + 1, b + 1)]. But (a + 1, b + 1) R (a, b) because (a + 1) + b = (b + 1) + a, and hence [(a + 1, b + 1)] = [(a, b)] = z . So z + 0 = z . Activity 5.2 With integers dened in the formal way as these equivalence classes, prove that for any integer z , z 0 = 0.

5.6

Ordering the integers

For integers x = [(a, b)] and y = [(c, d)], we say x < y if and only if a + d < b + c. We noted in an earlier chapter that any non-empty subset of N has a least member. But this is not true for subsets of integers. For a subset S of Z, m is a lower bound for S if for all s S , m s; and M is an upper bound for S if for all s S , s M . We say that S is bounded below if it has a lower bound; and that it is bounded above if it has an upper bound. The natural number l is a least member of S if l S and, for all s S , l s. So a least member will be a lower bound that belongs to S . The natural number g is a greatest member of S if g S and, for all s S , g s. So a greatest member will be an upper bound that belongs to S . The following fact is a fundamental property of the integers, known as the well-ordering principle. (The well-ordering principle was discussed earlier, when it was presented as an axiom for the natural numbers. This is a generalisation of that principle.) The Well-ordering Principle: If S is a non-empty set of integers that has a lower bound, then S has a least member. (The same statement is true with lower replaced by upper and least replaces by greatest.) Furthermore, if S is bounded below, then there is precisely one least member. For, if l, l are least members then l, l S and so (since for all s S , l s and l s) we have both l l and l l, so that l = l .

5.7

Learning outcomes

At the end of this chapter and the relevant reading, you should be able to: demonstrate that you know what is meant by a relation demonstrate that you know what it means to say a relation is reexive, symmetric or transitive, or that it is an equivalence relation

69

5. Equivalence relations and the integers

verify whether given relations are reexive, symmetric or transitive demonstrate that you know the denition of equivalence classes and that you know some of their basic properties, in particular that they form a partition of the set on which the relation is dened determine the equivalence classes that correspond to an equivalence relation demonstrate knowledge of the way in which the integers can be formally constructed from the natural numbers through the use of an equivalence relation state the Well-Ordering Principle

5.8

Sample exercises

Exercise 5.1 Dene a relation R on Z by: for x, y Z, x R y x2 = y 2 . Prove that R is an equivalence relation, and describe the corresponding equivalence classes. Exercise 5.2 Dene the relation R on the set N by x R y if and only if there is some n Z such that x = 2n y . Prove that R is an equivalence relation. Exercise 5.3 Let X be the set of n n real matrices. Dene a relation on X by: M N an invertible P X s.t. N = P 1 M P. Prove that is an equivalence relation. Exercise 5.4 Suppose that f : X Y is a surjection. Dene the relation R on X by x R y f (x) = f (y ). Prove that R is an equivalence relation. What are the equivalence classes? Let C denote the set of equivalence classes [x] for x X . Prove that if [x] = [y ] then f (x) = f (y ). This means that we can dene a function g : C Y by: g ([x]) = f (x). Prove that g is a bijection. Exercise 5.5 Prove that the set {x Z | x is a multiple of 4} has no lower bound.

5.9

Comments on selected activities

Learning activity 5.2 Suppose z = [(a, b)]. Also, 0 = [(1, 1)]. The denition of multiplication is that [(a, b)] [(c, d)] = [(ac + bd, ad + bc)].

70

5.10. Solutions to exercises

So, z 0 = [(a, b)] [(1, 1)] = [(a + b, a + b)]. Now, (a + b, a + b) R (1, 1) because a + b + 1 = 1 + a + b and therefore [(a + b, a + b)] = [(1, 1)] = 0. So we see that z 0 = 0.

5.10

Solutions to exercises

Solution to exercise 5.1 R is reexive because for any x, x2 = x2 . R is symmetric because x2 = y 2 y 2 = x2 . To show R is transitive, suppose x, y, z Z and x R y and y R z . Then x2 = y 2 and y 2 = z 2 , so x2 = z 2 , which means x R z . Thus R is an equivalence relation. Given any x Z, the equivalence class [x] consists precisely of those integers y such that y 2 = x2 . So [x] = {x, x}. Solution to exercise 5.2 R is reexive because for any x, x = 20 x. R is symmetric because if x R y then n Z with x = 2n y . This means that y = 2n x and hence, taking m = n, m Z such that y = 2m x. So y R x. To show R is transitive, suppose x, y, z Z and x R y and y R z . Then there are m, n Z such that x = 2n y and y = 2m z , so x = 2n y = 2n (2m z ) = 2m+n z which, since m + n Z, shows that x R z . Thus R is an equivalence relation. Solution to exercise 5.3 For any M , M = I 1 M I where I is the identity matrix, so M M . For matrices M, N X , if M N then theres an invertible P with N = P 1 M P and so M = P N P 1 , which can be written as M = (P 1 )1 M P 1 . So there is an invertible matrix Q (equal to P 1 ) such that M = Q1 N Q and hence M N . This shows the relation is symmetric. Suppose M N and N R. Then there are invertible matrices P and Q such that N = P 1 M P and R = Q1 N Q. We therefore have R = Q1 (P 1 M P )Q = (Q1 P 1 )M (P Q) = (P Q)1 M (P Q), so there is an invertible matrix T = P Q so that R = T 1 M T and hence M R, establishing that is transitive. It follows that is an equivalence relation. (We used here the fact that (P Q)1 = Q1 P 1 . This follows from the fact that (Q1 P 1 )(P Q) = Q1 (P 1 P )Q = Q1 IQ = Q1 Q = I .) Solution to exercise 5.4 x R x because f (x) = f (x). If x R y then f (x) = f (y ) so f (y ) = f (x) and hence y R x. If x R y and y R z then f (x) = f (y ) and f (y ) = f (z ), so f (x) = f (z ) and x R z . Hence R is an equivalence relation. For x X , [x] is the set of all y X with f (y ) = f (x), so, since f is a surjection, the equivalence classes are exactly the sets Cz for each z Y , where Cz = {x X | f (x) = z } is the set of elements of X mapped onto z by f . The fact that [x] = [y ] implies f (x) = f (y ) follows directly either from this description of equivalence classes, or from the fact that [x] = [y ] implies x R y , which implies f (y ) = f (x).

71

5. Equivalence relations and the integers

Let g be as dened. It is surjective because for each z Y , there is some x X such that f (x) = z (since f is surjective) and hence g ([x]) = f (x) = z . Also, g is bijective because g ([x]) = g ([y ]) implies f (x) = f (y ), which means x R y and hence that [x] = [y ]. Solution to exercise 5.5 We can prove this by contradiction. Suppose that the set S = {x Z | x is a multiple of 4} has a lower bound, l. Then, for all x S , x l. Now, one of l 1, l 2, l 3, l 4 must be a multiple of 4. So one of these numbers is in S . However, each is less than l, contradicting the fact that l is a lower bound on S .

72

Chapter 6 Divisibility and prime numbers

R R

Biggs, N. L. Discrete Mathematics. Chapter 8. Eccles, P.J. An Introduction to Mathematical Reasoning. Chapters 15-17 and Chapter 23 (except section 23.5)

6.1

Introduction

In this chapter we begin to study elements of number theory. We start with a discussion of divisibility and this leads us to discuss common divisors. Prime numbers are the basic building blocks in the theory of numbers: in particular, each number can be written in essentially only one way as a product of primes.

6.2

Divisibility

For integers x, y we say that x is a multiple of y or that y divides x if, for some q Z, x = yq . We use the notation y | x to signify that y divides x. Note that, for every x Z, x | 0. But 0 | x only if x = 0. When y does not divide x, we write y | x. In this case, as you will know from elementary arithmetic, dividing x by y will leave a remainder.

6.3

Quotients and remainders

The following theorem is very useful. It formalises the fact that one integer may be divided by another, leaving a remainder. Theorem 6.1 For any positive integers a and b, there are unique non-negative integers q and r such that a = bq + r and 0 r < b. This can be proved using some standard properties of integers. Let N0 = N {0} and let Q = {m N0 | bm a}. Then Q is non-empty because 0 Q (since 0b = 0 a). Also, Q is nite, because if qb a, then, given that b N, we have q a. So Q must have a maximum member. Lets call this q . Let r = a bq . Because q Q, bq a and hence r 0. Now, q is the maximum member of A, so q + 1 A, which means that (q + 1)b > a, so qb + b > a and

73

6. Divisibility and prime numbers

hence r = a bq < b. So we have established that a = bq + r, and that 0 r < b. To show that q and r are unique, suppose we have a = bq + r = bq + r where 0 r, r < b. (We show q = q and r = r .) Either q q or q q . Lets suppose that q q (the argument is similar if q q ). Then 0 r = a bq a bq = r < b. So 0 (a bq ) (a bq ) < b, which simplies to 0 b(q q ) < b. This implies 0 q q < 1. But q q is an integer, and so we must have q q = 0. So q = q . Then, r = a bq = a bq = r . The same result holds more generally, without the restriction that a > 0, but the proof is simplest when we restrict to the positive case. The general Division Theorem is: Theorem 6.2 (Division Theorem) For any integers a and b with b > 0, there are unique integers q and r such that a = bq + r and 0 r < b.

6
6.4 Representation of integers with respect to a base
Let t be a positive integer. Then any positive integer x can represented uniquely in the form x = xn tn + xn1 tn1 + + r1 t + r0 for some integer n. The numbers xi are integers between 0 and t 1 and can be found by repeated division by t: see Biggs Section 8.3. We write x = (xn xn1 . . . x1 x0 )t . Example 6.1 The number 60 (written in base 10) can be written in base 3 as (2020)3 because: 60 = 2(33 ) + 0(32 ) + 2(3) + 0(1). The representation can be found by repeated division. 60 20 6 2 = = = = 3 20 + 0 36+2 32+0 3 0 + 2.

Example 6.2 Whats the representation in base 4 of the number (201)10 ?

201 = 4 50 + 1

74

6.5. Greatest common divisor

50 = 4 12 + 2 12 = 4 3 + 0 3 = 4 0 + 3. So the answer is (3021)4 . Check: 3(43 ) + 2(4) + 1 = 201.

6.5

Greatest common divisor

The greatest common divisor of two integers is dened as follows. Denition 6.1 (Greatest common divisor) Suppose a, b are two integers, at least one of which is not 0. Then the greatest common divisor (gcd) of a and b, denoted by gcd(a, b), is the unique positive integer d with the following properties: (i) d divides both a and b (that is, it is a common divisor of a and b) (ii) d is greater than every other common divisor of a and b: that is, if c | a and c | b then c d. Implicit here is the fact that the gcd is unique. This easily follows from properties (i) and (ii). For, suppose that d and d are two positive integers satisfying (i) and (ii). Because d divides a and b and because d satises (ii), we have d d. But also, because d divides a and b and because d satises (ii), we have d d . So we must have d = d . Its not too hard to see that the gcd exists. For any n Z, let D(n) = {m Z : m | n}. This is the set of positive divisors of n. Since 1 | n, D(n) = . Consider now the set D(a, b) = D(a) D(b), which is the set of positive common divisors of a and b. Then, D(a, b) = since 1 D(a, b). Suppose a = 0. (We know that at least one of a, b is nonzero. If a = 0, a very similar argument will work using b in place of a.) Then m D(a, b) m |a|. So D(a, b) is bounded above and hence has a (unique) maximal element d. Thats the gcd. Note that some textbooks use (a, b) to denote the gcd, rather than gcd(a, b). Example 6.3 gcd(12, 20) = 4 because 4 | 12 and 4 | 20, but there is no common divisor of 12 and 20 that is greater than 4. Activity 6.1 Convince yourself that gcd(35, 77) = 7. If two numbers a, b have gcd(a, b) = 1, then we say that a and b are coprime. In this case, a and b have no common factors other than 1 and 1. For example, 72 and 77 are coprime.

75

6. Divisibility and prime numbers

6.6

The Euclidean algorithm

There is a standard method for computing greatest common divisors, known as the Euclidean algorithm. Before presenting this, we state two important properties of greatest common divisors. If b N and a | b, then gcd(a, b) = a. For non-zero integers a and b, if a = bq + r where q, r are integers, then gcd(a, b) = gcd(b, r). The rst fact is clear: for a is, in this case, a common divisor of a and b. And theres no greater positive divisor of a than a itself. Activity 6.2 Prove this second fact by proving that the set of common divisors of a and b is the same as the set of common divisors of b and r (and hence both sets have the same greatest member.)

These observations provide a way to determine gcds. Lets think about a simple example. Suppose we want gcd(100, 15). (You can see immediately that the answer is 5, but lets try to explain a method that will be useful in rather less easy examples.) We have 100 = 15 6 + 10 so, by the second fact above, gcd(100, 15) = gcd(15, 10). Next, 15 = 10 1 + 5, so gcd(15, 10) = gcd(10, 5). But 10 = 2 5, so 5 divides 10 and so, by the rst of the two facts above, gcd(10, 5) = 5. It follows, then, that gcd(100, 15) = 5. The method, known as the Euclidean Algorithm, therefore employs successive use of the division theorem. Heres another, more substantial, example. Example 6.4 Let us calculate gcd(2247, 581). We have 2247 581 504 77 42 35 = = = = = = 581 3 + 504 504 1 + 77 77 6 + 42 42 1 + 35 35 1 + 7 7 5.

It follows that gcd(2247, 581) = 7. The reason is that these divisions establish the following equalities: gcd(2247, 581) = = = = = this last equality because 7 | 35. gcd(581, 504) gcd(504, 77) gcd(77, 42) gcd(42, 35) gcd(35, 7) = 7,

76

6.7. Some consequences of the Euclidean algorithm

6.7

Some consequences of the Euclidean algorithm

A useful consequence of the Euclidean algorithm is that we can use it to express d, the gcd of a and b, as an integer linear combination of a and b, by which we mean the following. Theorem 6.3 Suppose a and b are integers (at least one of which is not 0) and let d = gcd(a, b). Then there are m, n Z such that d = am + bn. For a formal, general, proof of this, see Biggs Section 8.4 or Eccles Section 17.1. Ill give an example here, which will demonstrate the way in which we can nd m, n once we have applied the Euclidean algorithm. Lets work with a = 2247 and b = 581. We want to nd integers m and n such that 2247m + 581n = 7. We can use the calculation we had above, by working backwards through the sequence of equations, as follows: 7 = = = = = = 42 35 42 (77 42) = 42 2 77 (504 77 6) 2 77 = 504 2 77 13 504 2 (581 504) 13 = 504 15 581 13 (2247 581 3) 15 581 13 = 2247 15 581 58 2247 15 + 581 (58).

So we see that m = 15 and n = 58 will work. Not an answer you could easily have guessed! Notice how, in each line of this calculation, we use one of the lines from the calculation that arises from the Euclidean algorithm (and we also simplify as we go along). You will get used to this with practice. There are many examples you could make up for yourself in order to help you practice. Activity 6.3 In the above procedure to nd m and n, gure out exactly which part of the Euclidean algorithm calculation is being used at each stage. Activity 6.4 Choose two particular positive integers a and b. Use the Euclidean algorithm to nd gcd(a, b) and then use your calculation to nd integers m and n such that d = ma + nb. Do this several times with dierent choices of numbers until you have mastered it. The fact that there are m, n Z such that gcd(a, b) = am + bn (that is, that the gcd of two integers is an integer linear combination of them) is very useful. Heres one nice consequence. We know that, by denition, if c | a and c | b, then c d = gcd(a, b). But we can say something stronger, namely that c | d. Theorem 6.4 Suppose that a, b N and let d = gcd(a, b). If c | a and c | b, then c | d. Proof. There are integers m, n such that d = ma + nb. Suppose that c | a and c | b. Then c | ma and c | nb, so c | (ma + nb). But this says c | d, as required.

77

6. Divisibility and prime numbers

Heres another consequence: Theorem 6.5 For a, b N, let d = gcd(a, b). Then, for c N, there are integers m and n such that c = am + bn if and only if d | c. Proof. Suppose c = am + bn. Now, d = gcd(a, b) satises d | a and d | b, so, also, d | (ma + nb) and hence d | c. Conversely, suppose d | c, so that for some integer k , c = kd. Now, there are m, n Z with d = ma + nb. Then, c = kd = k (ma + nb) = (km)a + (kn)b = M a + N b, where M, N Z. This shows that c can be written as an integer linear combination of a and b, as required. We also have: Theorem 6.6 Suppose that a, b N are coprime (meaning gcd(a, b) = 1). If a | r and b | r, then ab | r.

This is not generally true if the numbers a, b are not coprime. Think of a counterexample! Proof. Because gcd(a, b) = 1, there are integers m, n such that 1 = ma + nb. So r = r 1 = r(ma + nb) = mra + nrb. Because a | r and b | r, there are integers k1 , k2 such that r = k1 a and r = k2 b. So r = mra + nrb = m(k2 b)a + n(k1 a)b = (mk2 + nk1 )ab, which shows that ab | r.

6.8

Prime numbers

A prime number (or a prime) is a natural number p 2 with the property that the only divisors of p are 1 and p. In a precise sense, which well see shortly, primes are the building blocks of the natural numbers. One important property of primes is that if a prime divides a product of numbers, then it must divide at least one of the numbers in the product. This isnt true for non-primes: for example, 4 | 12 = 2 6, but 4 does not divide either 2 or 6. Theorem 6.7 Suppose that p is a prime number and that a, b N. If p | ab, then p | a or p | b. Proof. The proof makes use of the useful fact (seen above) that the gcd of any two numbers can be written as an integer linear combination of the numbers (Theorem 6.3). Suppose, then, that p is prime and that p | ab. If p | a, then the conclusion of the theorem holds, so suppose p | a. Then p and a have no common positive divisor other than 1.

78

6.9. Prime factorization: the Fundamental Theorem of Arithmetic

(The only positive divisors of p are 1 and p because it is prime, and p does not divide a, by assumption.) So gcd(p, a) = 1 and therefore there exist integers m and n with 1 = mp + na. So, b = b(mp + na) = (bm)p + n(ab). Now, p | ab and hence p | n(ab). Clearly, also, p | (bm)p. It follows that p | b, as required. This result can easily be extended: if a1 , a2 , . . . , an N and p | a1 a2 . . . an , then, for some i between 1 and n, p | ai . Activity 6.5 Prove this generalisation of Theorem 6.7.

6.9
6.9.1

Prime factorization: the Fundamental Theorem of Arithmetic


The Fundamental Theorem

The Fundamental Theorem of Arithmetic is the name given to the following Theorem. (As its name suggests, this is an important theorem!) Theorem 6.8 (Fundamental Theorem of Arithmetic) Every integer n 2 can be expressed as a product of one or more prime numbers. Furthermore, there is essentially only one such way of expressing n: the only way in which two such expressions for n can dier is in the ordering of the prime factors. The expression of an integer as a product of primes is known as its prime decomposition. For example, the prime decomposition of 504 is 504 = 2 2 2 3 3 7 = 23 .32 .7. (Note that, in this last expression, the dot, . denotes multiplication.) The proof of the Fundamental Theorem is not very dicult, given the results we already have about prime numbers. Establishing that each positive integer can be written as a product of primes is easy. Showing that such a decomposition is essentially unique (that is, unique up to the ordering of the factors) is a little trickier, but can be established using Theorem 6.7.

6.9.2

Proof of the Fundamental Theorem

There are two things to prove:


kr 1 k2 Any n 2 can be written as a product of primes: n = pk 1 p2 . . . pr , where p1 < p2 < < pr are primes and k1 , k2 , . . . , kr N. (Existence) l1 l2 kr ls 1 k2 This is essentially unique: if pk 1 p2 . . . pr = q1 q2 . . . qs , are two equal such expressions, then r = s, pi = qi and ki = li for all i. (Uniqueness).

79

6. Divisibility and prime numbers

* Fundamental Theorem: Existence We use (strong) induction. For n 2, let P (n) be the statement: n can be written as a product of primes Base case: n = 2 is a product of a single prime, so P (2) is true. Assume, inductively, that k N and that P (s) is true for all s k . (Were using strong induction.) Consider k + 1. This could be a prime number, in which case were done and P (k + 1) is true. Otherwise k + 1 = ab where 1 < a, b < k + 1. But then P (a) and P (b) are true (by assumption) so each of a, b is a product of primes. So, therefore, is k + 1. * Fundamental Theorem: Uniqueness The idea here is simple enough, but it is notationally dicult to write a detailed proof. Ill try to give you the basic idea.
l1 l2 k1 k2 ls r Suppose p1 p2 . . . pk r = q1 q2 . . . qs . Cancel as much as possible all (powers of) common primes. We want to show both resulting sides are 1 (so that the expressions were the same.)

Suppose not. Then the resulting LHS (left-hand side) is a product of some powers of some pi and the RHS is a product of some powers of some qi , and no pi equals any qj (because weve cancelled). Take any p appearing in the LHS. Then p | RHS so (by an earlier result, If p | a1 a2 . . . an , then, for some i, p | ai ) p divides one of the qj . This isnt possible since pi = qj . We can use the Fundamental Theorem of Arithmetic to prove that there are innitely many primes. You can nd an outline of this proof in Chapter 2. Activity 6.6 Look again at the proof, in Chapter 2, that there are innitely many primes, and understand where the Fundamental Theorem of Arithmetic is used in the proof.

6.10

Learning outcomes

At the end of this chapter and the relevant reading, you should be able to: state clearly what it means to say that one number divides another state the Division Theorem and, given two numbers, nd the remainder and quotient when one is divided by the other understand what is meant by the representation of an integer with respect to a particular basis and be able to work with this denition state the denition of the greatest common divisor of two numbers

80

6.11. Sample exercises

use the Euclidean algorithm to nd the gcd of two numbers demonstrate that you know that the gcd of two numbers can always be expressed as an integer linear combination of the two numbers; and be able to express the gcd in this way for any two numbers. use the Euclidean algorithm to express the gcd of two numbers as an integer linear combination of them state what is meant by a prime number state the Fundamental Theorem of Arithmetic.

6.11

Sample exercises

Exercise 6.1 Find d = gcd(2406, 654). Express d in the form d = 2406m + 654n for integers m, n. Exercise 6.2 Suppose that a, b N, both non-zero, and let d = gcd(a, b). We know that, by denition, if c | a and c | b, then c d. Prove, in fact, that c | d. Exercise 6.3 Suppose a, b N and that d = gcd(a, b). Prove that, for c N, there are integers m and n such that c = am + bn if and only if d | c. Exercise 6.4 Suppose a, b N. Prove that if there are integers m and n such that am + bn = 1 then a and b are coprime. Exercise 6.5 Prove that for all n N, the numbers 9n + 8 and 6n + 5 are coprime. Exercise 6.6 Suppose that a, b N and that gcd(a, b) = 1. Suppose that a | r and b | r. Prove that ab | r. Exercise 6.7 The Fibonacci numbers f1 , f2 , f3 , . . . are dened as follows: f1 = f2 = 1 and, for n 3, fn = fn1 + fn2 . Prove that for all n N, gcd(fn , fn+1 ) = 1.

81

6. Divisibility and prime numbers

Exercise 6.8 Suppose that p1 , p2 , . . . , pk are primes and that a, b N are given by
lk 1 l2 a = pl 1 p2 . . . pk , mk 1 m2 b = pm 1 p2 . . . pk .

Prove that
rk 1 r2 gcd(a, b) = pr 1 p2 . . . pk ,

where, for i = 1 to k , ri is the smaller of the two numbers li and mi . Exercise 6.9 Suppose a, b N satisfy gcd(a, b) = 1 and, for some k N, ab = k 2 . Prove that for some integers m, n, a = m2 and b = n2 .

6.12

Comments on selected activities

Learning activity 6.1 Certainly, 7 divides both 35 and 77, but there is no larger common divisor. (For, the only larger divisor of 35 is 35 itself, and this does not divide 77.) Learning activity 6.2 We prove that D(a, b) = D(b, r). The result on gcds will follow since gcd(x, y ) is the maximal element of D(x, y ). Suppose m D(a, b). Then m | a and m | b. It follows that m | (a bq ); that is, m | r. So m | b and m | r and hence m D(b, r). Therefore D(a, b) D(b, r). Suppose m D(b, r). Then m | b and m | r. It follows that m | (bq + r); that is, m | a. So m | b and m | a and hence m D(a, b). Therefore D(b, r) D(a, b). Learning activity 6.5 To prove this, we can (unsurprisingly) use induction on n. Let P (n) be the statement: If a1 , a2 , . . . , an N and p | a1 a2 . . . an , then, for some i between 1 and n, p | ai . Then P (1) is clearly true (and P (2) is the theorem just proved). Suppose P (n) is true and lets show P (n + 1) follows. So, suppose a1 , a2 , . . . , an+1 N and p | a1 a2 . . . an an+1 . Well, since p | Aan+1 , where A = a1 a2 . . . an , we can apply the n = 2 case to see that p | A or p | an+1 . But, by P (n), if p | A = a1 a2 . . . an then p | ai for some i between 1 and n. So were done: p divides at least one of the ai for i between 1 and n + 1. Learning activity 6.6 Heres the proof, with explicit reference to the Fundamental Theorem. Suppose there were not innitely many primes, so theres a largest prime, M , say. Let X = (2 3 5 7 11 M ) + 1. Since X > M , X is not a prime. By the Fundamental Theorem of Arithmetic, X has a prime divisor p which satises 1 < p < X . This p must be one of the numbers 2, 3, 5, . . . , M (since these are the only primes). However, X is not divisible by any of these numbers. So we have a contradiction. We conclude there are innitely many primes.

82

6.13. Solutions to exercises

6.13

Solutions to exercises

Solution to exercise 6.1 See Biggs, Section 8.4. The gcd is 6 and we have 6 = 28 2406 + (103) 654. Solution to exercise 6.2 We know that there are integers m, n such that d = ma + nb. Suppose that c | a and c | b. Then c | ma and c | nb, so c | (ma + nb). But this says c | d, as required. Solution to exercise 6.3 Suppose rst that c = am + bn for some some integers m and n. Now, d = gcd(a, b) satises d | a and d | b, so we also have d | (ma + nb) and hence d | c. Conversely, suppose d | c, so that for some integer k , c = kd. Now, the gcd d = gcd(a, b) can be written as an integer linear combination of a and b, so there are m, n Z with d = ma + nb. Then, c = kd = k (ma + nb) = (km)a + (kn)b = M a + N b, where M, N Z. This shows that c can be written as an integer linear combination of a and b, as required. Solution to exercise 6.4 This follows from the previous exercise, but we can prove it directly. Suppose that d N, that d | a and d | b. Then d | (am + bn), which means d | 1. Therefore, we must have d = 1. That is, the only positive common divisor of a and b is 1 and hence gcd(a, b) = 1 and the numbers are coprime. Solution to exercise 6.5 We have 2(9n + 8) 3(6n + 5) = 1. So, if d = gcd(9n + 8, 6n + 5), then d | (9n + 8) and d | (6n + 5), so d | 2(9n + 8) 3(6n + 5). But this says d | 1 and hence d = 1. Solution to exercise 6.6 Before we begin, lets just note that this property does not hold if a and b are not coprime. For example, 6 | 12 and 4 | 12 but 24 | 12. Suppose then that a | r and b | r. The fact that gcd(a, b) = 1 means that there are integers m, n such that 1 = ma + nb. So r = r 1 = r(ma + nb) = mra + nrb. Now, because a | r and b | r there are integers k1 , k2 such that r = k1 a and r = k2 b. So r = mra + nrb = m(k2 b)a + n(k1 a)b = (mk2 + nk1 )ab, which shows that r is an integer multiple of ab and hence ab | r. Solution to exercise 6.7 We prove this by induction on n. Let P (n) be the statement that gcd(fn , fn+1 ) = 1. When n = 1, this is true, because gcd(f1 , f2 ) = gcd(1, 1) = 1. It is true also when n = 2 because f3 = 2 and hence gcd(f2 , f3 ) = gcd(1, 2) = 1. Suppose, inductively, that k 2 and

83

6. Divisibility and prime numbers

gcd(fk , fk+1 ) = 1. We want to show that gcd(fk+1 , fk+2 ) = 1. Now, fk+2 = fk+1 + fk . Therefore, if d | fk+1 and d | fk+2 then d | fk+1 and d | (fk+2 fk+1 ) = fk . So any common divisor of fk+1 and fk+2 is also a common divisor or fk and fk+1 . Also, if d | fk and d | fk+1 then we also have d | fk+1 and d | (fk + fk+1 ) = fk+2 , so any common divisor of fk and fk+1 is also a common divisor or fk+1 and fk+2 . This all shows that the common divisors of the pair {fk+1 , fk+2 } are precisely the same as the common divisors of the pair {fk+1 , fk }. Therefore, the greatest common divisors of each pair are equal. That is, gcd(fk+1 , fk+2 ) = gcd(fk+1 , fk ) = gcd(fk , fk+1 ) = 1, where we have used the inductive hypothesis for the last equality. You can also establish this result by thinking about the way in which the Euclidean algorithm would work in nding the gcd of fk and fk+1 . Solution to exercise 6.8
rk 1 r2 Let d = pr 1 p2 . . . pk . Then because ri is the smaller of li and mi , we have ri li and ri li ri mi . So p | p and pri | pmi , for each i. Therefore d | a and d | b. Explicitly, for example,

lk 1 l2 a = pl 1 p2 . . . pk rk l1 r1 l2 r2 1 r2 k rk = pr p2 . . . pl 1 p2 . . . pk p 1 k 1 r1 l2 r2 k rk = d(pl p2 . . . pl ), 1 k

and because lk rk is a non-negative integer for each i, the number in parentheses is an integer. This shows d | a. The fact that d | b can be similarly shown. So d is a common divisor of a and b. Suppose D is any common divisor of a and b. Then, by the Fundamental Theorem of Arithmetic, D can be written as a product of primes. Let p be any one of these. Then p | a and p | b. Now, we know that if p | a1 a2 . . . an then p | ai for some i. (This follows from the results of Section 6.8.) The only primes appearing in the decomposition of a and b are p1 , p2 , . . . , pk , so we can deduce that for some i, p | pi which means p = pi (given that p and pi are primes). So the prime decomposition of D is of the form
sk 1 s2 D = ps 1 p 2 . . . pk

for some non-negative integers si . Now, suppose that, for some i, si > li . Then, for some integers M and N , li i D = ps i M, a = pi N, where, because they involve only products of the other primes, neither N or M is divisible by pi . Now, the fact that D | a means that theres an integer L with a = LD, so
si i pl i N = Lpi M

and hence
i li N = Lps M. i

But this shows, since si li 1 (because si , li Z and sI > li ), that pi | N , contradicting the observation that pi | N . So we must have si li for all i. A similar argument shows that si mi for all i. So si ri = min(li , mi ) and hence D d. The result follows.

84

6.13. Solutions to exercises

Solution to exercise 6.9 We use the Fundamental Theorem of Arithmetic. Let k have prime decomposition r 1 2 k = p 1 p2 . . . pr . Then 1 22 r . . . p2 ab = k 2 = p2 1 p2 r . It follows that a and b must have prime decompositions involving only the primes sr 1 s2 p1 , p2 , . . . , pr , and that each of a, b takes the form ps 1 p2 . . . pr where si is a non-negative integer. But we cannot have, for any i, pi | a and also pi | b, for this would mean that pi > 1 i is a common divisor of a, b, contradicting gcd(a, b) = 1. So, for each i, p2 divides precisely i one of a and b and pi does not divide the other of the two numbers. In other words, each of 1 22 2r where i = 0 or i = i . This can be written as a, b takes the form p2 1 p2 . . . pr 1 2 r 2 (p1 p2 . . . pr ) , and hence there are integers m, n such that a = m2 and b = n2 .

85

6. Divisibility and prime numbers

86

Chapter 7 Congruence and modular arithmetic

R R
7.1

Biggs, N. L. Discrete Mathematics. Chapter 13, Sections 13.1-13.3. Eccles, P.J. An Introduction to Mathematical Reasoning. Chapters 19-21.

Introduction

In this chapter, we study congruence and we describe modular arithmetic. This builds on the ideas and results on divisibility and equivalence relations that we met in earlier chapters. You go to sleep at 10 oclock and you sleep for 8 hours. At what time do you wake. Well, this is simple: you wake at 6 oclock. What youre doing in this calculation is youre doing whats called arithmetic modulo 12. The answer is not 10 + 8 = 18, because the clock re-starts once the hour of 12 is reached. This is a fairly simple idea, when expressed in these terms, and its the key concept behind modular arithmetic, a topic later in this chapter. We now take a more abstract approach.

7.2
7.2.1

Congruence modulo m
The congruence relation

Suppose that m is a xed natural number, and lets dene a relation R on the integers by a R b if and only if b a is a multiple of m. That is, a R b m | (b a). Then R is an equivalence relation. Activity 7.1 Prove that R is an equivalence relation on Z. This relation is so important that it has a special notation. If a R b, we say that a and b are congruent modulo m and we write a b (mod m). If a and b are not congruent modulo m, then we write a b (mod m). The division theorem tells us that for any integers a and for any m N, there are unique integers q and r such that a = qm + r and 0 r < b. What this implies for congruence is that, for any a, there is precisely one integer r in the range 0, 1, . . . , m 1 such that a r(mod m).

87

7. Congruence and modular arithmetic

Congruence relations can be manipulated in many ways like equations, as the following Theorem shows. Theorem 7.1 Suppose that m N and that a, b, c, d Z with a b (mod m) and c d (mod m). Then (i) a + c b + d (mod m) (ii) a c b d (mod m) (iii) ac bd (mod m) (iv) k Z, ka kb (mod m) (v) n N, an bn (mod m) Proof. I leave (i) and (ii) for you to prove. Heres how to prove (iii): because a b (mod m) and c d (mod m), we have m | (b a) and m | (d c). So, for some integers k, l, b a = km and d c = lm. That is, b = a + km and d = c + lm. So bd = (a + km)(c + lm) = ac + (kmc + alm + klm2 ) = ac + m(kc + al + klm). Now, kc + al + klm Z, so bd ac = (kc + al + klm)m is a multiple of m; that is, m | (bd ac) and ac bd (mod m). Part (iv) follows from (iii) by noting that k k (mod m), and part (v) follows by repeated application of (iii) (or, by (iii) and induction.). Activity 7.2 Prove parts (i) and (ii) of Theorem 7.1. Theorem 7.1 is useful, and it enables us to solve a number of problems. Here are two examples. Example 7.1 Suppose that the natural number x has digits xn xn1 . . . x0 (when written, normally, in base 10). So, for example, if x = 1246 then x0 = 6, x1 = 4, x2 = 2, x3 = 1. Then 9 divides x if and only if x0 + x1 + + xn is a multiple of 9. (So this provides a quick and easy way to check divisibility by 9. For example, 127224 is divisible by 9 because 1 + 2 + 7 + 2 + 2 + 4 = 18 is.) How do we prove that this test works? We can use congruence modulo 9. Note that x = x0 + (10)x1 + (10)2 x3 + + (10)n xn . Now, 10 1 (mod 9), so, for each k N, 10n 1 (mod 9). Hence x = x0 + (10)x1 + (10)2 x3 + + (10)n xn x0 + x1 + + xn (mod 9). A number is divisible by 9 if and only if it is congruent to 0 modulo 9, so 9 | x x 0 (mod 9) x0 + x1 + + xn 0 (mod 9) 9 | (x0 + x1 + + xn ). This is precisely what the test says.

88

7.2. Congruence modulo m

Example 7.2 We can use congruence to show that there are no integers x and y satisfying the equation 7x2 15y 2 = 1. We prove this by contradiction. So suppose such x and y did exist. Then, because 15y 2 is a multiple of 5, wed have 7x2 1 (mod 5). Now, x is congruent to one of the numbers 0, 1, 2, 3, 4 modulo 5. That is, we have: x 0 or x 1 or x 2 or x 3 or x 4 (mod 5). So, x2 0 or x2 1 or x2 4 or x2 9 or x2 16 (mod 5). But 9 4 (mod 5) and 16 1 (mod 5), so, in every case, either x2 0 or x2 1 or x2 4 (mod 5). It follows, then, that in all cases, we have 7x2 0 or 7x2 7 2 or 7x2 28 3 (mod 5). So there does not exist an integer x with 7x2 1 (mod 5), and hence there are no integer solutions to the original equation.

7.2.2

Congruence classes

What are the equivalence classes of the congruence relation, modulo a particular positive integer m? These are often called the congruence classes modulo m. Lets denote these by [x]m . For a particular x Z, [x]m will be all the integers y such that y x (mod m). We know that each x is congruent to precisely one of the integers in the range 0, 1, 2, . . . , m 1, and we know (from the general theory of equivalence relations) that if x y (mod m) then [x]m = [y ]m . So it follows that for each x Z, well have [x]m = [0]m , or [x]m = [1]m , . . . or [x]m = [m 1]m . So there are precisely m equivalence classes, [0]m , [1]m , . . . , [m 1]m . The theory of equivalence relations tells us that these form a partition of Z: they are disjoint and every integer belongs to one of them. But what are they? Well, [0]m is the set of all x such that x 0 (mod m), which means m | x. So [0]m is the set of all integers divisible by m. Generally, for 0 r m 1, [r]m will be the set of x such that x r (mod m). It follows that [r]m is the set of all integers x which have remainder r on division by m. Example 7.3 Suppose m = 4. Then the congruence classes are: [0]4 = {. . . , 8, 4, 0, 4, 8, . . .}, [1]4 = {. . . , 7, 3, 1, 5, 9, . . .}, [2]4 = {. . . , 6, 2, 2, 6, 10, . . .}, [3]4 = {. . . , 5, 1, 3, 7, 11, . . .}.

89

7. Congruence and modular arithmetic

7.3

Zm and its arithmetic

When, in an earlier chapter, we looked at how the integers may be constructed from the natural numbers through using an equivalence relation, we also saw that we could do arithmetic with the equivalence classes. We can also do this here, and the resulting addition and multiplication operations are known as modular arithmetic. First, lets introduce a new piece of notation. For m N, Zm is called the set of integers modulo m, and is the set of equivalence classes [0]m , [1]m , . . . , [m 1]m . So Zm has m members. We can dene operations and on Zm as follows: [x]m [y ]m = [x + y ]m , [x]m [y ]m = [xy ]m . For example, when m = 4, [2]4 [3]4 = [5]4 = [1]4 and [2]4 [3]4 = [6]4 = [2]4 . In practice, if we do not use the and symbols and we simply write x instead of [x]m , using values of x between 0 and m 1. We would say that we are in Zm if thats not clear from the context. So the above two calculations may be written: in Z4 , 2 + 3 = 1, and 2 3 = 2.

Note that we use only the symbols 0, 1, . . . , m 1, so we do not write 2 + 3 = 5. Instead we replace 5 by the number that it is congruent to modulo 5 and which lies between 0 and 4. The equations weve just written are entirely equivalent to the statements 2 + 3 1 (mod 5), 2 3 2 (mod 5). The addition and multiplication operations weve dened on Zm obey a number of rules that are familiar from normal addition and multiplication of integers. Theorem 7.2 Let m N. In Zm , for all a, b, c, (i) a + b = b + a (ii) a b = b a (iii) (a + b) + c = a + (b + c) (iv) (a b) c = a (b c) (v) a + 0 = a (vi) a 1 = a (vii) a (b + c) = (a b) + (a c) (viii) for each a Zm there is a unique element a Zm such that a + (a) = 0.

90

7.4. Invertible elements in Zm

Lets think a little about rule (viii) in this Theorem. Suppose were in Z4 and that a = 3. What is a? Well, what we want is an element of Zm which when added to 3 gives 0 when we are doing arithmetic in Z4 . Now, 3 + 1 = 0 in Z4 because 3 + 1 is congruent to 0 modulo 4, so 3 = 1. (Alternatively, we can note that 3 = 1(4) + 1, so 3 has remainder 1 on division by 4, so 3 1 (mod 4).) Activity 7.3 In Z9 , what is 4? It is important to realise that arithmetic in Zm does not obey all the nice properties that normal arithmetic of integers obeys. In particular, we cannot generally cancel. For example, in Z4 , 2 3 = 2 = 2 1, but we cannot cancel the 2 (that is, divide both sides by 2) to deduce that 3 = 1, because 3 = 1 in Z4 . (The reason we cannot cancel the 2 is that 2 has no inverse in Z4 . Existence of inverses is the topic of the next section.)

7.4

Invertible elements in Zm

A member x of Zm is invertible if there is some y Zm such that (in Zm ) xy = yx = 1. If such a y exists, it is called the inverse of x and is denoted by x1 . Example 7.4 In Z10 , 3 has inverse 7 because, in Z10 , 3 7 = 1 (because 3 7 = 21 1 (mod 10)). Example 7.5 In Z10 , 5 has no inverse. There is no x such that 5x = 1. For, modulo 10, for any x Z, 5x 0 or 5. (This is just the familiar fact that any multiple of 5 has last digit 0 or 5.) If x Zm is invertible, then it is possible to cancel x from both sides of an equation in Zm . That is, we have xa = xb a = b (in Zm ). This is not, as we have seen, generally true, but it works when x has an inverse because in this case xa = xb x1 (xa) = x1 (xb) (x1 x)a = (x1 x)b 1a = 1b a = b. Which x Zm are invertible? The answer is given by the following theorem. Theorem 7.3 Suppose m N. Then an element x of Zm is invertible if and only if x and m are coprime (that is, gcd(x, m) = 1). Proof. Suppose x is invertible, so that there is y with xy = 1 in Zm . This means that xy 1 (mod m), so, for some k Z, xy = 1 + km. Let d = gcd(x, m). Then d | x and d | m, so d | (xy km). That is, d | 1, from which it follows that d = 1 and x and m are coprime. Conversely, suppose gcd(x, m) = 1. Then (by the fact that the gcd can be written as an integer linear combination), there are integers y, z such that 1 = yx + zm. But this means yx 1 (mod m), so, in Zm , yx = 1 and x has inverse y .

91

7. Congruence and modular arithmetic

As a result of this theorem, we see that if p is a prime, then every non-zero element x of Zp is invertible. This is because gcd(x, p) = 1.

7.5
7.5.1

Solving equations in Zm
Single linear equations

Suppose we want to solve, in Zm , the equation ax = b. That is, we want to nd x between 0 and m 1 such that ax b (mod m). This may have no solutions. Indeed, suppose we take b = 1. Then the equation were confronted with is ax = 1, which has a solution if and only if a is invertible (by denition of inverse). So if a has no inverse in Zm , then such a linear equation will not always have a solution. If, however, a is invertible, then we can see that the equation ax = b in Zm has solution x = a1 b, because a(a1 b) = (aa1 )b = 1b = b. How do you nd a solution? Trial and error is not ecient if the numbers involved are large. But we can use the Euclidean algorithm. For suppose we want to solve ax = b in Zm , where gcd(a, m) = 1. Then, by using the Euclidean algorithm, we have seen how we can nd integers k, l such that 1 = ak + ml. So, b = abk + mlb, from which it follows that, modulo m, a(bk ) 1. So it looks like bk will be a solution. But remember that were looking for a solution in Zm , so we will want to nd x Zm such that x bk (mod m). Heres an example. Example 7.6 Suppose we want to solve the equation 83x = 2 in Z321 . We can check that 83 and 321 are coprime by the Euclidean algorithm, as follows: We have 321 83 72 11 6 5 = = = = = = 83 3 + 72 72 1 + 11 11 6 + 6 61+5 51+1 1 5.

It follows that gcd(321, 83) = 1. Now, working backwards, we can express 1 as an integer linear combination of 83 and 321: 1 = = = = = This tells us that 83 (58) 1 (mod 321). So, 83 (116) 2 (mod 321). 65 6 (11 6) = 6 2 11 (72 11 6) 2 11 = 72 2 11 13 72 2 (83 72) 13 = 72 15 83 13 (321 83) 3) 15 83 13 = 321 15 83 58.

92

7.5. Solving equations in Zm

Now, we want to nd x in the range 0 to 321 such that 116 x (mod 321 ). The answer is x = 205. So, nally, then, we see that, in Z321 , the equation 83x = 2 has solution x = 205. Activity 7.4 This calculation also reveals that 83 is invertible in Z321 . Why? And what is the inverse of 83 in Z321 ? More generally, we can ask: when does ax = b have a solution in Zm ? The answer is: when d = gcd(a, m) divides b. So a special case is when d = 1. That is, we have the following theorem. Theorem 7.4 In Zm , ax = b has a solution if and only if d | b, where d = gcd(a, m). Proof. First part, =: Suppose ax0 = b in Zm . Then ax0 b = km for some k Z. So, b = ax0 km. Since d = gcd(a, m), d | a and d | m, so d | (ax0 m). That is, d | b. Second part, =: Suppose d | b, so b = db1 for some b1 Z. There are x1 , y1 such that d = x1 a + y1 m. Then, b = db1 = (x1 b1 )a + (y1 b1 )m. So, in Zm , a(x1 b1 ) = b. That is, x1 b1 (reduced modulo m) is a solution. This theorem suggests a general method for solving ax = b in Zm : Find d = gcd(a, m). If d | b, theres no solution. If d | b, write b = db1 . Use Euclidean algorithm to nd x, y Z such that d = xa + ym. Then a solution is xb1 , reduced modulo m.

7.5.2

Systems of linear equations

We can also consider simultaneous linear equations in Zm . It should be realised that there might be no solutions, or more than one solution. Example 7.7 Lets solve the following two equations simultaneously in Z6 : 2x + 3y = 1, 4x + 3y = 5. Subtracting the rst equation from the second gives 2x = 4. You might be tempted to cancel the 2 and deduce that x must be 2. But wait! You cant cancel unless 2 and 6 are coprime, and they are not (since their gcd is 2). Instead, you can check for each of the elements of Z6 whether 2x = 4. Of course, x = 2 is a solution, but so also is x = 5 because, in Z6 , 2(5) = 10 = 4. You can also check by calculating the other values of 2x that x = 2, 5 are the only solutions. Now, from the rst equation, 3y = 1 2x. When x = 2 or 5, 2x = 4, so this is 3y = 1 4 = 3 = 3. So we now have 3y = 3. Again, we cannot cancel the 3. Instead we check, for each y Z6 ,

93

7. Congruence and modular arithmetic

whether it is a solution, and we nd that 1, 3 and 5 are all solutions. What this argument shows is that the possible solutions are (x, y ) = (2, 1), (2, 3), (2, 5), (5, 1), (5, 3), (5, 5). In fact, it can easily be checked (by substituting these pairs of values into the original equations) that these are indeed solutions. So this system has 6 dierent solutions. Activity 7.5 Check, by substituting into the original equations, that each of these six possible solution pairs (x, y ) is indeed a solution. Example 7.8 Consider the following system of simultaneous equations in Z7 : 3x + y = 1, 5x + 4y = 1. If we multiply the rst equation by 4, we obtain 12x + 4y = 4, which is the same (in Z7 ) as 5x + 4y = 4. But the second equation says 5x + 4y = 1. Since 1 and 2 are not equal in Z7 , these equations are inconsistent, so there are no solutions to this system.

7.6

Learning outcomes

At the end of this chapter and the relevant reading, you should be able to: state the denition of the equivalence relation congruence modulo m prove that congruence modulo m is an equivalence relation demonstrate an understanding of the links between congruence modulo m and remainder on division by m state and prove standard properties of congruence apply congruence to show, for example, that equations have no solutions demonstrate an understanding of what the congruence classes are demonstrate an understanding of what Zm means and how its addition and multiplication are dened nd the negatives of elements of Zm state the denition of an invertible element of Zm demonstrate that you know an element x in Zm is invertible if and only if x and m are coprime nd the inverse of an invertible element solve linear equations and systems of linear equations in Zm

94

7.7. Sample exercises

7.7

Sample exercises

Exercise 7.1 Show that n 7 (mod 12) n 3 (mod 4). Is the converse true? Exercise 7.2 Show that for all n Z, n2 0 or 1 (mod 3). Hence show that if 3 divides x2 + y 2 then 3 | x or 3 | y . Use this to prove that there are no integers x, y, z such that x2 + y 2 = 3z 2 , other than x = y = z = 0. Exercise 7.3 Show that, for all n N, 33n+1 3 5n (mod 11) and that 24n+3 8 5n (mod 11). Hence show that for all n N, 11 | (33n+1 + 24n+3 ). Exercise 7.4 By working modulo 7, prove that 2n+2 + 32n+1 is divisible by 7. (This result was proved in a dierent way, using induction, in the exercises at the end of Chapter 3) Exercise 7.5 Prove that 290 is an invertible element of Z357 and nd its inverse. Exercise 7.6 Solve the equation 10x = 3 in Z37 .

7.8

Comments on selected activities

Learning activity 7.1 We have m | 0 = a a, so the relation is reexive. Symmetry follows from m | (b a) m | (a b). Suppose that a R b and b R c. Then m | (b a) and m | (c b), so m | ((b a) + (c b)) = (c a) and hence a R c. Thus, R is transitive. Learning activity 7.2 We have m | (b a) and m | (d c). So m | ((b a) + (d c)), which is the same as m | ((b + d) (a + c)), so a + c b + d (mod m). We also have m | ((b a) (d c)), which is the same as m | ((b d) (a c)) so a c b d (mod m). Learning activity 7.3 Because 4 + 5 = 9 0 (mod 9), we have 4 = 5 in Z9 . Learning activity 7.4 The calculation shows that 83 (58) 1 (mod 321). We also know that 58 263 (mod 321) because 58 + 263 = 312 0 (mod 321). So well have 83 263 1 (mod 321). This shows that 83 is invertible in Z321 and that its inverse is 263.

95

7. Congruence and modular arithmetic

7.9

Solutions to exercises

Solution to exercise 7.1 If n 7 (mod 12) then, for some integer k , m = 7 + 12k and so m = 3 + 4 + 12k = 3 + 4(1 + 3k ). This means that n 3 (mod 4), because 1 + 3k is an integer. The converse is false, because, for example, 3 3 (mod 4), but 3 7 (mod 12) Solution to exercise 7.2 We have, modulo 3, n 0 or n 1 or n 2. So, respectively, n2 02 = 0 or n2 12 = 1 or n2 22 = 4 1. So in all cases n2 is congruent to 0 or 1. Suppose 3 | (x2 + y 2 ). Then, modulo 3, x2 + y 2 0. But each of x2 and y 2 is congruent to 0 or 1. If either or both are congruent to 1, then wed have x2 + y 2 1 or x2 + y 2 2. So we can see that we must have x2 0 and y 2 0. This means x 0 and y 0, which is the same as 3 | x and 3 | y . Now suppose that, for integers x, y, z , x2 + y 2 = 3z 2 , where not all of x, y, z are zero. If d is a common factor of x, y and z , then we can write x = dx1 , y = dy1 and z = dz1 , where 2 2 2 2 2 2 x1 , y1 , z1 Z. We can then see that d2 x2 1 + d2 y1 = 3d z1 , so that x1 + y1 = 3z1 . What this shows is that if there are any integer solutions, then there is one in which x, y, z have no common divisors (for any common divisors can be cancelled). So assume were dealing with such a solution. Now, x2 + y 2 = 3z 2 implies 3 | (x2 + y 2 ) (noting that neither side of the equation is 0 because not all of x, y, z are). What weve shown earlier in this exercise establishes that 3 | x and 3 | y . So x = 3x1 and y = 3y1 for some x1 , y1 Z. Then the 2 2 2 2 2 2 equation x2 + y 2 = 3z 2 becomes 9x2 1 + 9y1 = 3z and so z = 3x1 + 3y1 . This implies 3 | z . But this means 3 | z . (You can see this either by the Fundamental Theorem of Arithmetic, or by the fact that if z 0 modulo 3 then z 2 0, as we see from the calculations at the start of this solution.) So what we see, then, is that x, y, z are all divisible by 3. But we assumed that they constituted a solution with no common factor and weve reached a contradiction. So there are no solutions other than x = y = z = 0. Solution to exercise 7.3 Modulo 11, we have 33 = 27 5 and so 33n (33 )n 5n and hence 33n+1 = 3(3n ) 3 5n . Also, 24 = 16 5 and so 24n+3 = 8 (24 )n 8 5n . It follows that 33n+1 + 24n+3 3 5n + 8 5n = 11(5n ) 0 (mod 11), which means that 11 | (33n+1 + 24n+3 ). Solution to exercise 7.4 Modulo 7, 32 = 9 2, so 32n+1 = 3(32n ) 3(2n ) and 2n+2 = 4(2n ), so 2n+2 + 32n+1 4(2n ) + 3(2n ) = 7(2n ) 0, and hence 7 | (2n+2 + 32n+1 ). Solution to exercise 7.5 By the Euclidean algorithm, we have 357 = 290 + 67

96

7.9. Solutions to exercises

290 = 4 67 + 22 67 = 3 22 + 1, so 290 and 357 are coprime, from which it follows that 290 is invertible. Now, from the calculations just given, 1 = 67 3 22 = 67 3(290 4 67) = 13 67 3 290 = 13(357 290) 3 290 = 13 357 16 290. The fact that 13 357 16 290 = 1 means that, modulo 357, 16 290 1. So, in Z357 , (290)1 = 16 = 341. Solution to exercise 7.6 Because 37 is prime, we certainly know that 10 and 37 are coprime, so the equation has a solution. The quickest way to nd it is simply to note that the equation is equivalent to the congruence, modulo 37, that 10x 40, and the 10 can then be cancelled because 10 and 37 are coprime. But suppose we didnt spot that. The Euclidean algorithm tells us that: 37 10 7 3 and so 1 = = = = 723 7 2(10 7) = 3 7 2 10 3(37 3 10) 2 10 3 37 11 10. = = = = 3 10 + 7 17+3 23+1 3 1,

So we see that 11 10 1 (mod 37) and hence 33 10 3 (mod 37). Now, 33 4 (mod 37), so the solution is x = 4. This is easily checked: 10(4) = 40 = 3 in Z37 .

97

7. Congruence and modular arithmetic

98

Chapter 8 Rational, real and complex numbers

R R

Biggs, N. L. Discrete Mathematics. Chapter 9. Eccles, P.J. An Introduction to Mathematical Reasoning. Chapters 13 and 14.

The treatment in Biggs is probably better for the purposes of this course. Neither of these books covers complex numbers. You do not have to know very much about complex numbers for this course, but because this topic is not in these books, I have included quite a bit of material on complex numbers in this chapter. You can nd useful reading on complex numbers in a number of books, including the following (which you might already have, given that it is the MA100 text).

Anthony, M. and M. Harvey. Linear Algebra: Concepts and Methods. Cambridge University Press 2012. Chapter 13.

8.1

Introduction

In this chapter, we explore rational numbers, real numbers and complex numbers. In this course, we started with natural numbers and then we showed how to construct the set of all integers from these. This construction used an equivalence relation, together with a suitable way of adding and multiplying the equivalence classes. In a similar way, the rational numbers can be constructed from the integers by means of an equivalence relation. In this course, we do not take a very formal approach to the denition or construction of the real numbers (which can, in fact, be quite complicated). But we study properties of real numbers, and in particular we shall be interested in whether real numbers are rational or not. We also consider the cardinality of innite sets.

8.2
8.2.1

Rational numbers
An important equivalence relation

Rational numbers are, essentially, fractions. Youll certainly be aware that there are 2 many ways of representing a given rational number. For instance, represents the same 5 4 number as . We can capture these sorts of equivalences more formally by using an 10 equivalence relation on pairs of integers (m, n), where n = 0. So let X = Z (Z \ {0}) be the set of all pairs (m, n) where m, n Z and n = 0, and dene a relation R on X by: (m, n) R (m , n ) mn = m n.

99

8. Rational, real and complex numbers

(Yes, it looks like what were really saying here is m/n = m /n , but we want to work in the world of the integers for now, so we dont want to do division.) Then we can dene the set of rational numbers Q to be the set of equivalence classes of the relation R. Lets just pause for a moment to prove that R is indeed an equivalence relation. R is Reexive: (m, n)R(m, n) because mn = nm. R is Symmetric: (m, n)R(p, q ) mq = np pn = qm (p, q )R(m, n). R is Transitive: Suppose (m, n)R(p, q ) and (p, q )R(s, t). Then mq = np and pt = qs. So, (mq )(pt) = (np)(qs) and, after cancelling qp, this gives mt = ns, so (m, n)R(s, t). But, wait a minute: can we cancel pq ? Sure, if its nonzero. If it is zero then that means p = 0 (since we know that q = 0). But then mq = 0, so m = 0; and qs = 0, so s = 0. So, in this case mt = ns = 0.

8.2.2

Rational numbers as equivalence classes

m We represent the equivalence class [(m, n)] by . For example, we then have the n 4 2 which follows from the fact that [(2, 5)] = [(4, 10)], (familiar) fact that = 5 10 something that is true because (2, 5) R (4, 10) (2 10 = 4 5). What weve done here is construct the set of rational numbers without reference to division. In an abstract approach, this is the logically sound thing to do. Once we have constructed the rational numbers, we can then make sense of the division of integers: the division of m by n is the rational number m/n.

What, for instance, is the equivalence class [(1, 2)]? Well, (m, n)R(1, 2) means m 2 = n 1, or n = 2m. So it consists of (1, 2), (1, 2), (2, 4), (2, 4), (3, 6), (3, 6) . . . . Denoting the equivalence class [(m, n)] by m , we therefore have n

1 = {(1, 2), (1, 2), (2, 4), (2, 4), (3, 6), (3, 6), . . .}. 2 Recall that if x [x] then [x ] = [x]. So we can say 1 1 2 2 3 3 = = = = = = . 2 2 4 4 6 6 We can think of the integers as particular rational numbers by identifying the integer n n with the rational number (that is, with the equivalence class [(n, 1)]). So Z Q. 1

8.2.3

Doing arithmetic

How do we do arithmetic with rational numbers. Well, youve been doing this for years, but how would we dene addition and multiplication of rational numbers in an abstract setting? Just as we dened operations on equivalence classes in earlier chapters (in the construction of Z from N and in the construction of Zm ), we can dene addition

100

8.2. Rational numbers

and multiplication as an operation on the equivalence classes of R. Heres how: let and be dened on the set of rational numbers as follows: a c ad + bc a c ac = , = . b d bd b d bd In practice, we just use normal addition and multiplication symbols (and we often omit the multiplication symbol), so we have a c ad + bc a c ac + = , = . b d bd b d bd Well, no surprises there, but remember that what we are doing here is dening additional and multiplication of rational numbers (and remember also that these rational numbers are, formally, equivalence classes). Now, if you think hard about it, one issue that is raised is whether these denitions depend on the choice of representatives from each equivalence class. They should not, but we ought to check that. What I mean is that we really should have 4 1 2 2 + = + , 5 6 10 3 for example, because 2 4 2 1 = and = . 5 10 6 3 Well, lets see. Consider the addition denition. Suppose that a c c a = and = . b b d d What we need to check is that a c a c + = + . b d b d

a a Now, the fact that = means precisely that [(a, b)] = [(a , b )], which means that b b ab = a b. Similarly, we have cd = c d. Now, a c ad + bc a c ad +bc + = , and + = b d bd b d bd and we need to prove that ad + bc ad +bc = . bd bd This means we need to prove that (ad + bc, bd) R (a d + b c , b d ). Now, (ad + bc, bd) R (a d + b c , b d ) (ad + bc)b d = (a d + b c )bd adb d + bcb d = a d bd + b c bd (ab )dd + (cd )bb = (a b)dd + (c d)bb . Now, the rst terms on each side are equal to each other because ab = a b and the second terms are equal to each other because cd = c d, so we do indeed have consistency (that is, the denition of addition is independent of the choice of representatives chosen for the equivalence classes).

101

8. Rational, real and complex numbers

Activity 8.1 Show that the denition of multiplication of rational numbers is consistent: that is, that it does not depend on the choice of representatives chosen for the equivalence classes. Explicitly, show that if a c a c = and = , b b d d then a c a c = . b d b d

By the way, the rational numbers are described as such because they are (or, more formally, can be represented by) ratios of integers.

8.3
8.3.1

Rational numbers and real numbers


Real numbers: a sketchy introduction

For our purposes, we will assume that the set of real numbers R is given. That is, we shall not construct the real numbers formally. (This can be done, but is outside the scope of this course.) We will regard the rational numbers (or, as well often call them, the rationals) Q as a subset of R. There are various ways of thinking about real numbers. One way is to think about a real number as a point on the innite real line. Another is to think of real numbers as the limits of rational numbers. The formal idea of limit will be encountered in a later chapter, but we can encapsulate most of what we need by thinking about the decimal representation of real numbers. First, lets note that if ai N {0} and ai 9 for 1 i n, then the (nite) decimal expansion a0 .a1 a2 . . . an represents the rational number a0 + a2 an a1 + + + . 2 10 (10) (10)n

For example, what we mean by 1.2546 is the number 1+ 5 4 6 2 + + + . 10 100 1000 10000

Every positive real number can be represented by an innite decimal expansion a0 .a1 a2 a3 . . . ai . . . , where ai N {0} and ai 9 for i 1. We allow for ai to be 0, so, in particular, it is possible that ai = 0 for all i N where N is some xed number: such an expansion is known as a terminating expansion. Given such an innite decimal expansion, we say that it represents a real number a if, for all n N {0}, a0 .a1 a2 . . . an a a0 .a1 a2 . . . an + 1/(10)n .

102

8.3. Rational numbers and real numbers

This formalism allows us to see that the innite decimal expansion 0.99999 . . ., all of whose digits after the decimal point are 9, is in fact the same as the number 1.0000000 . . .. For example, two innite decimal expansions are 3.1415926535 . . . and 0.1833333333333 . . . . (Youll probably recognise the rst as being the number .) Suppose, in this second decimal expansion, that every digit is 3 after the rst three (that is, ai = 3 for i 3). We can extend this notation to Then we write this as 0.183 (or, in some texts, 0.183). cases in which there is a repeating pattern of digits. For example, suppose we have 0.1123123123123 . . . , where the 123 repeats innitely. Then we denote this by 0.1123.

8.3.2

Rationality and repeating patterns

You probably have heard stories of strange, obsessive mathematicians working out the expansion of to millions and millions of decimal places. (This has been the subject of a novel, a play, a lm, and a song!) This is relevant because the digits of have no repeating pattern, which you might think quite remarkable. In fact, it turns out that a real number will have an innitely repeating pattern in its decimal expansion (which includes the case in which the pattern is 0, so that it includes terminating expansions) if and only if the number is rational. Lets look at part of this statement: if a number is rational, then its decimal expansion will have a repeating pattern (which might be 0). Why is that? Well, lets look at an example. Example 8.1 We nd the decimal expansion of 4/7 by long-division. 0.5714285 7 4.0000000 3.5 .50 .49 10 7 30 28 20 14 60 56 40 35 50 So, 4/7 = 0.571428.

103

8. Rational, real and complex numbers

Notice: we must have the same remainder re-appear at some point, and then the calculation repeats. Heres the calculation again, with the repeating remainder highlighted in bold. 0 .5714285 7 4 .0000000 3 .5 .50 .49 10 7 30 28 20 14 60 56 40 35 50

Next, we think about the second part of the statement: that if the decimal expansion repeats, then the number is rational. Clearly, if the decimal expansion is terminating, then the number is rational. But what about the innite, repeating, case? Weve given two examples above. lets consider these in more detail. Example 8.2 Consider a = 0.183. Let x = 0.003. Then 10x = 0.03 and so 10x x = 0.03 0.003 = 0.03. So, 9x = 0.03 and hence x = (3/100)/9 = 1/300, so 0.183 = 0.18 + 0.003 = 18 1 55 11 + = = , 100 300 300 60

and this is the rational representation of a. Example 8.3 Consider the number 0.1123. If x = 0.0123, then 1000x = 12.3123 and 1000x x = 12.3. So 999x = 12.3 and hence x = 123/9990. So, 0.1123 = 1 1 123 1122 +x= + = . 10 10 9990 9990

In general, if the repeating block is of length k , then an argument just like the previous two, in which we multiply by 10k , will enable us to express the number as a rational number.

104

8.3. Rational numbers and real numbers

8.3.3

Irrational numbers

A real number is irrational if it is not a rational number. (So, given what we said above, an irrational number has no innitely repeating pattern in its decimal expansion.) Whats clear from above is that any real number can be approximated well by rational numbers: for the rational number a0 .a1 a2 . . . an is within 1/(10)n of the real number with innite decimal expansion a0 .a1 a2 . . .. We can, in some cases, prove that particular numbers are irrational. Here is a classic result of this type. Theorem 8.1 The real number 2 is irrational. That is, there are no positive integers m 2 = 2. m, n with n Proof. Suppose there were such m, n. If m, n are divisible by some d > 1, we may divide both m and n to obtain m , n such that the rational number m /n equals m/n. So we may assume that m, n have no common divisors other than 1; that is, gcd(m, n) = 1. Now, the equation (m/n)2 = 2 means m2 = 2n2 . So we see that m2 is even. We know (from Chapter 2) that this means m must be even. (For, the square of an odd integer is easily shown to be odd.) So there is some m1 such that m = 2m1 . 2 2 2 2 Then, m2 = 2n2 becomes 4m2 1 = 2n , and so n = 2m1 . Well, this means n is even and hence n must be even. So m, n are both divisible by 2. But we assumed that gcd(m, n) = 1, and this is contradicted by the fact that m and n have 2 as a common divisor. So our assumption that (m/n)2 = 2 must have been wrong and we can deduce no such integers m and n exist. Isnt this theorem a thing of beauty? Activity 8.2 Make sure you understand that this is a proof by contradiction, and that you understand what the contradiction is. Many other important numbers in mathematics turn out to be irrational. Ive already mentioned , and there is also e (the base of the natural logarithm).

8.3.4

Density of the rational numbers

As weve seen, some important numbers in mathematics are not rational. An intuitive question that arises is how many real numbers are rational and this is a dicult question to answer. There are innitely many real numbers and innitely many rationals, and innitely may real numbers are not rational. More on this in the next section! For the moment, lets make one important observation: not only are there innitely many rational numbers, but there are no gaps in the rational numbers. If you accept the view of real numbers as (possibly) innite decimal expansions, then this is quite clear: you can get a very good approximation to any real number by terminating its decimal expansion after a large number of digits. (And we know that a terminating decimal expansion is a rational number.) The following theorem makes sense of the statement that there are no rational-free zones in the real numbers. Precisely, between

105

8. Rational, real and complex numbers

any two rational numbers, no matter how close together they are, there is always another rational number. Theorem 8.2 Suppose q, q Q with q < q . Then there is r Q with q < r < q . Proof. Consider r = (1/2)(q + q ). Details are left to you! Activity 8.3 Complete this proof.

8.4

Countability of rationals and uncountability of real numbers

We know that N Z Q R, and that each inclusion is strict (there are integers that are not natural numbers, rational numbers that are not integers, and real numbers that are not rational). All of these sets are innite. But there is a sense in which the sets N, Z and Q have the same size and R is larger. Clearly we have to dene what this means in precise terms, because right now all we know is that there are more real numbers than rationals, for instance, but there are innitely many of each type of number. The following denition helps us. Denition 8.1 (Countable sets) A set is countable if there is a bijection between the set and N.

For instance, Z is countable: we can dene f : N Z by f (1) = 0, f (2) = 1, f (3) = 1, f (4) = 2, f (5) = 2, f (6) = 3, f (7) = 3, . . . . (In general, f (n) = (1)n n/2 , where n/2 means the largest integer that is no more than n/2.) It is straightforward to show that f is a bijection. Hence Z is countable. So, in this sense, the sets Z and N have the same cardinality (even though Z is strictly larger than N). Working with innite sets is not the same as working with nite sets: two nite sets, one of which was a strict subset of the other, could not have the same cardinality! What does countable mean? The formal denition is given above. But one way of thinking about it is that if S is countable, then the members of S can be listed: s1 , s2 , s3 , . . . , . For, suppose S is countable. Then there is a bijecion f : N S . Let si = f (i) for i N. Then, because f is a bijection, the list s1 , s2 , s3 , . . . will include every element of S , each precisely once. What is more surprising is that Q is also countable.

106

8.4. Countability of rationals and uncountability of real numbers

8.4.1

Countability of the rationals

Theorem 8.3 The set Q of rational numbers is countable. How can we prove Q is countable? By constructing a bijection N Q. We wont do so by means of a formula, but instead by thinking of a way in which all the rational numbers could be listed. Arrange all the ordered pairs of natural numbers as follows: (1, 1) (2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . . (1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . . (1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . . (1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . . (1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . . (1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . .

Traverse this array as indicated in the following diagrams, where traversed elements are emboldened and underlined as they are traversed. (1, 1) (2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . . (1, 1) (2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . . (1, 1) (2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . . (1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . . (1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . . (1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . . (1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . . (1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . . (1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . . (1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . . (1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . . (1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . . (1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . . (1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . . (1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . . (1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . . (1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . . (1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . .

107

8. Rational, real and complex numbers

(1, 1) (2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . . (1, 1) (2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . . (1, 1) (2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . .

(1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . . (1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . . (1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . . (1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . . (1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . .

(1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . . (1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . . (1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . . (1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . . (1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . .

(1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . . (1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . . (1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . . (1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . . (1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . .

(1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . . (1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . . (1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . . (1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . . (1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . .

(1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . . (1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . . (1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . . (1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . . (1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . .

(1, 1) (2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . . (1, 1) (2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . .

108

8.4. Countability of rationals and uncountability of real numbers

(1, 1) (2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . . (1, 1) ( 2, 1) (3, 1) (4, 1) (5, 1) (6, 1) . . .

(1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . . (1, 2) (2, 2) (3, 2) (4, 2) (5, 2) (6, 2) . . .

(1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . . (1, 3) (2, 3) (3, 3) (4, 3) (5, 3) (6, 3) . . .

(1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . . (1, 4) (2, 4) (3, 4) (4, 4) (5, 4) (6, 4) . . .

(1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . . (1, 5) (2, 5) (3, 5) (4, 5) (5, 5) (6, 5) . . .

(1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . . (1, 6) (2, 6) (3, 6) (4, 6) (5, 6) (6, 6) . . .

We get a listing of all the ordered pairs of natural numbers: (1, 1), (2, 1), (1, 2), (1, 3), (2, 2), (3, 1), (4, 1), (3, 2), (2, 3), . . . From this we can get a listing of all positive rational numbers m/n: simply write down the corresponding rationals and ignore any (m, n) such that the rational m/n has already earlier appeared in the list: (1, 1), (2, 1), (1, 2), (1, 3), (2, 2), (3, 1), (4, 1), (3, 2), (2, 3), . . . gives 1 2 1 1 2 3 4 3 2 1 1 2 3 4 5 6 , , , , , , , , , , , , , , , ,... 1 1 2 3 2 1 1 2 3 4 5 4 3 2 1 1 which becomes 1 2 1 1 , , , , 1 1 2 3 3 4 3 2 1 1 , , , , , , 1 1 2 3 4 5 5 6 , ,... 1 1

We can then include the negative rational numbers and 0 by starting with 0 and replacing m/n by m/n and m/n: 1 1 2 2 1 1 1 1 3 3 4 4 3 3 2 2 0, , , , , , , , , , , , , , , , , 1 1 1 1 2 2 3 3 1 1 1 1 2 2 3 3 1 1 1 1 5 5 6 6 , , , , , , , ,... 4 4 5 5 1 1 1 1 Its clear that this listing describes a bijection from N to Q. So this proves Q is countable. So, informally speaking, N, Z and Q all have the same size. What about R? Well, here it gets very interesting: the set of real numbers is not countable. (It is said to be uncountable.)

109

8. Rational, real and complex numbers

8.4.2

Uncountability of the real numbers

Theorem 8.4 The set R is not countable. (That is, R is uncountable.) This is probably not too surprising: a randomly written decimal expansion will not terminate or have a repeating pattern, so, intuitively, most real numbers are not rational. The proof uses the famous Cantor diagonal argument. Suppose that f : N R and that f (n) = xn0 .xn1 xn2 xn3 . . . . We show theres a number in R which isnt the image under f of any element of N (and hence f is not a surjection). Consider y = 0.y1 y2 y3 . . . where yi = 1 if xii = 1 2 if xii = 1.

For all n N, y = f (n) since yn is dierent from xnn . Since f was arbitrary, this shows that there can be no function f : N R that is surjective. Hence R is not countable.

8.5

Complex numbers
Introduction
p(x) = x2 3x + 2 q (x) = x2 + x + 1

8.5.1

Consider the two quadratic polynomials, and

If you sketch the graph of p(x) you will nd that the graph intersects the x-axis at the two real solutions (or roots) of the equation p(x) = 0, and that the polynomial factors into the two linear factors, p(x) = x2 3x + 2 = (x 1)(x 2) Sketching the graph of q (x), you will nd that it does not intersect the x-axis. The equation q (x) = 0 has no solution in the real numbers, and it cannot be factorised (or factored) over the reals. Such a polynomial is said to be irreducible. In order to solve this equation, we need to dene the complex numbers.

8.5.2

Complex numbers: a formal approach

In a formal approach to complex numbers, we dene the set C of complex numbers to be the set of all ordered pairs (x, y ) of real numbers, with addition and multiplication operations dened as follows: (a, b) + (c, d) = (a + c, b + d), (a, b) (c, d) = (ac bd, ad + bc).

110

8.5. Complex numbers

By identifying the complex number (x, 0) with the real number x, we regard R as a subset of C. We give the special symbol i to the complex number (0, 1). Note that we can then re-write the complex number (x, y ) as (x, y ) = x + yi. The complex number i satises i2 = i i = (0, 1) (0, 1) = (0 0 1 1, 0 1 + 1 0) = (1, 0), so i2 is the real number 1.

8.5.3

Complex numbers: a more usual approach

Rather than the ordered pairs approach outlined above, it is more common to dene the complex numbers as follows. We begin by dening the imaginary number i which has the property that i2 = 1. The term imaginary is historical, and not an indication that this is a gment of someones imagination. With this, we can then say what we mean by the complex numbers. Denition 8.2 A complex number is a number of the form z = a + ib, where a and b are real numbers, and i2 = 1. The set of all such numbers is C = {a + ib : a, b R} . If z = a + ib is a complex number, then the real number a is known as the real part of z , denoted Re(z ), and the real number b is the imaginary part of z , denoted Im(z ). Note that Im(z ) is a real number. If b = 0, then z is a real number, so R C. If a = 0, then z is said to be purely imaginary. The quadratic polynomial q (z ) = x2 + x + 1 can be factorised over the complex numbers, because the equation q (z ) = 0 has two complex solutions. Solving in the usual way, we have 1 3 . x= 2 We write, 3 = (1)3 = 1 3 = i 3, so that the solutions are 1 1 3 3 w = +i and w = i . 2 2 2 2 Notice the form of these two solutions. They are what is called a conjugate pair. We have the following denition. Denition 8.3 If z = a + ib is a complex number, then the complex conjugate of z is the complex number z = a ib. We can see by the application of the quadratic formula, that the roots of an irreducible quadratic polynomial with real coecients will always be a conjugate pair of complex numbers.

111

8. Rational, real and complex numbers

Addition, multiplication, division Addition and multiplication of complex numbers are dened as for polynomials in i using i2 = 1. Example 8.4 If z = (1 + i) and w = (4 2i) then z + w = (1 + i) + (4 2i) = (1 + 4) + i(1 2) = 5 i and zw = (1 + i)(4 2i) = 4 + 4i 2i 2i2 = 6 + 2i

If z C, then zz is a real number: zz = (a + ib)(a ib) = a2 + b2 . Activity 8.4 zz . Carry out the multiplication to verify this: let z = a + ib and calculate z zw = w ww

Division of complex numbers is then dened by Example 8.5

since ww is real.

1+i (1 + i)(4 + 2i) 2 + 6i 1 3 = = = + i 4 2i (4 2i)(4 + 2i) 16 + 4 10 10

Properties of the complex conjugate A complex number is real if and only if z = z . Indeed, if z = a + ib, then z = z if and only if b = 0. The complex conjugate of a complex number satises the following properties: z + z = 2 Re(z ) is real z z = 2i Im(z ) is purely imaginary z=z z+w =z+w zw = z w z w = z w

Activity 8.5 Let z = a + ib, w = c + id and verify all of the above properties.

112

8.5. Complex numbers

8.5.4

Roots of polynomials

The Fundamental Theorem of Algebra asserts that a polynomial of degree n with complex coecients has n complex roots (not necessarily distinct), and can therefore be factorised into n linear factors. Explicitly, any equation an z n + an1 z n1 + + a1 z + a0 = 0 where ai C has n solutions z C. Contrast this with the diculty of solving polynomial equations in R. So, the introduction of i enables us to solve all polynomial equations: theres no need to introduce anything else. A fancy way of saying this is: The eld of complex numbers is algebraically closed. If the coecients of the polynomial are restricted to real numbers, the polynomial can be factorised into a product of linear and irreducible quadratic factors over R and into a product of linear factors over C. The proof of the Fundamental Theorem of Algebra is beyond the scope of this course. However, we note the following useful result. Theorem 8.5 pairs. Complex roots of polynomials with real coecients appear in conjugate

Proof. Let P (x) = a0 + a1 x + + an xn , ai R, be a polynomial of degree n. We shall show that if z is a root of P (x), then so is z . Let z be a complex number such that P (z ) = 0, then a0 + a1 z + + a2 z 2 + an z n = 0 Conjugating both sides of this equation, a0 + a1 z + a2 z 2 + + an z n = 0 = 0 Since 0 is a real number, it is equal to its complex conjugate. We now use the properties of the complex conjugate: that the complex conjugate of the sum is the sum of the conjugates, and the same is true for the product of complex numbers. We have a0 + a1 z + a2 z 2 + + an z n = 0, and a0 + a1 z + a2 z 2 + + an z n = 0. Since the coecients ai are real numbers, this becomes a0 + a1 z + a2 z 2 + + an z n = 0. That is, P (z ) = 0, so the number z is also a root of P (x). Example 8.6 Let us consider the polynomial x3 2x2 2x 3 = (x 3)(x2 + x + 1). 1 3 If w = + i , then 2 2 x3 2x2 2x 3 = (x 3)(x w)(x w)

113

8. Rational, real and complex numbers

Activity 8.6 Multiply out the last two factors above to check that their product is the irreducible quadratic x2 + x + 1.

8.5.5

The complex plane

The following theorem shows that a complex number is uniquely determined by its real and imaginary parts. Theorem 8.6 Two complex numbers are equal if and only if their real and imaginary parts are equal. Proof. Two complex numbers with the same real parts and the same imaginary parts are clearly the same complex number, so we only need to prove this statement in one direction. Let z = a + ib and w = c + id. If z = w, we will show that their real and imaginary parts are equal. We have a + ib = c + id, therefore a c = i(d b). Squaring both sides, we obtain (a c)2 = i2 (d b)2 = (d b)2 . But a c and (d b) are real numbers, so their squares are non-negative. The only way this equality can hold is for a c = d b = 0. That is, a = c and b = d. As a result of this theorem, we can think of the complex numbers geometrically, as points in a plane. For, we can associate the vector (a, b)T uniquely to each complex number z = a + ib, and all the properties of a two-dimensional real vector space apply. A complex number z = a + ib is represented as a point (a, b) in the complex plane; we draw two axes, a horizontal axis to represent the real parts of complex numbers, and a vertical axis to represent the imaginary parts of complex numbers. Points on the horizontal axis represent real numbers, and points on the vertical axis represent purely imaginary numbers.

(a, b) z = a + ib i
      7 

(0, 0)

Complex plane or Argand diagram Activity 8.7 Plot z = 2 + 2i and w = 1 i 3 in the complex plane.

8.5.6

Polar form of z

If the complex number z = a + ib is plotted as a point (a, b) in the complex plane, then we can determine the polar coordinates of this point. We have a = r cos , b = r sin

114

8.5. Complex numbers

where r = a2 + b2 is the length of the line joining the origin to the point (a, b) and is the angle measured anticlockwise from the real (horizontal) axis to the line joining the origin to the point (a, b). Then we can write z = a + ib = r cos + i r sin . Denition 8.4 The polar form of the complex number z is z = r(cos + i sin ). The length r = a2 + b2 is called the modulus of z , denoted |z |, and the angle is called the argument of z . Note the following properties: z and z are reections in the real axis. If is the argument of z , then is the argument of z . |z |2 = zz . and + 2n give the same complex number. We dene the principal argument of z to be the argument in the range, < . Activity 8.8 Express z = 2 + 2i, w = 1 i 3 in polar form. Describe the following sets of z : (a) |z | = 3, (b) argument of z is . 4 Multiplication and division using polar coordinates gives zw = r(cos + i sin ) (cos + i sin ) = r(cos( + ) + i sin( + )) r z = ( cos( ) + i sin( )) w

Activity 8.9 Show these by performing the multiplication and the division as dened earlier, and by using the facts that cos( + ) = cos cos sin sin and sin( + ) = sin cos + cos sin . DeMoivres Theorem We can consider explictly a special case of the multiplication result above, in which w = z . If we apply the multiplication to z 2 = zz , we have z2 = = = = = zz (r(cos + i sin ))(r(cos + i sin )) r2 (cos2 + i2 sin2 + 2i sin cos ) r2 (cos2 sin2 + 2i sin cos ) r2 (cos 2 + i sin 2).

115

8. Rational, real and complex numbers

Here we have used the double angle formulae for cos 2 and sin 2. Applying the product rule n times, where n is a positive integer, we obtain DeMoivres Formula Theorem 8.7 (cos + i sin )n = cos n + i sin n Proof. z n = z z = (r(cos + i sin ))n
n times

= rn cos( + + ) + i sin( + + )
n times n times

8.5.7

Exponential form of z

Functions of complex numbers can be dened by the power series (Taylor expansions) of the functions: z2 z3 + + zC ez = 1 + z + 2! 3! sin z = z z3 z5 + 3! 5! cos z = 1 z2 z4 + 2! 4!

If we use the expansion for ez to expand ei , and then factor out the real and imaginary parts, we nd: ei = 1 + (i) + (i)2 (i)3 (i)4 (i)5 + + + + 2! 3! 4! 5! 2 3 4 5 = 1 + i i + + i 2! 3! 4! 5! 2 4 3 5 = 1 + + i + 2! 4! 3 5!

From which we conclude: Eulers Formula: ei = cos + i sin

Denition 8.5 The exponential form of a complex number z = a + ib is z = rei where r = |z | is the modulus of z and is the argument of z . In particular, the following equality is of note because it combines the numbers e, and i in a single expression: ei = 1.

116

8.5. Complex numbers

If z = rei , then its complex conjugate is given by z = rei . This is because, if z = rei = r(cos + i sin ), then z = r(cos i sin ) = r(cos() + i sin()) = rei . We can use either the exponential form, z = rei , or the standard form, z = a + ib, according to the application or computation we are doing. For example, addition is simplest in the form z = a + ib, but multiplication and division are simpler in exponential form. To change a complex number between rei and a + ib, use Eulers formula and the complex plane (polar form). Example 8.7
2

+ i sin 23 = 1 + i 23 . ei 3 = cos 23 2 e2+i 3 = e2 ei 3 = e2 cos 3 + ie2 sin 3.

Activity 8.10 Write each of the following complex numbers in the form a + ib: ei 2

ei 2

ei 4

ei

11 3

e1+i

e1

Example 8.8

Let z = 2 + 2i = 2 2 ei 4 and w = 1 i 3 = 2ei 3 , then w6 = (1 i 3)6 = (2ei 3 )6 = 26 ei2 = 64 zw = (2 2ei 4 )(2ei 3 ) = 4 2ei 12 7 z = 2ei 12 . w

and

Notice that in the above example we are using certain properties of the complex exponential function, that if z, w C, ez+w = ez ew and (ez )n = enz for n Z.

This last property is easily generalised to include the negative integers. Example 8.9 Solve the equation z 6 = 1 to nd the 6th roots of 1.

Write z 6 = (rei )6 = r6 ei6 ,

1 = ei = ei(+2n)

Equating these two expressions, and using the fact that r is a real positive number, we have 2n r=1 6 = + 2n, = + 6 6 This will give the six complex roots by taking n = 0, 1, 2, 3, 4, 5.

117

8. Rational, real and complex numbers

Activity 8.11 Show this. Write down the six roots of 1 and show that any one raised to the power 6 is equal to 1. Show that n = 6 gives the same root as n = 0. Use this to factor the polynomial x6 + 1 into linear factors over the complex numbers and into irreducible quadratics over the real numbers.

8.6

Learning outcomes

At the end of this chapter and the relevant reading, you should be able to: demonstrate that you understand how the rational numbers can be formally constructed by means of an equivalence relation and that addition and multiplication of rational numbers can be dened as operations on the equivalence classes indicate that you know that a real number is rational if and only if it has an innitely repeating pattern in its decimal expansion nd the decimal expansion of a rational number determine, in the form m/n, a rational number from its decimal expansion prove that certain numbers are rational or irrational demonstrate that you understand that there are rational numbers arbitrarily close to any real number state what it means to say that a set is countable or uncountable demonstrate that you know that the rationals are countable and the reals uncountable show that you know what is meant by complex numbers, and demonstrate that you can add, subtract, multiply and divide complex numbers state the denition of the complex conjugate of a complex number show that you know that every polynomial of degree n has n complex roots and that these occur in conjugate pairs indicate complex numbers on the complex plane determine the polar and exponential form of complex numbers state and use DeMoivres theorem and Eulers formula

118

8.7. Sample exercises

8.7

Sample exercises

Exercise 8.1 Prove that 5 is irrational. Exercise 8.2 Express the complex number Exercise 8.3 Solve the equation x2 2ix + 3 = 0. Exercise 8.4 Write each of the following complex numbers in the form a + ib: ei 2
3 3 11 3

1 + 2i in the form a + bi. 4 5i

ei 2

ei 4

ei

e1+i

e1 .

Exercise 8.5 Express 1 + 3i in exponential form. Hence nd (1 + 3i)30 .

8.8

Comments on selected activities

Learning activity 8.1 Suppose that a a c c = and = . b b d d What we need to check is that a c a c = . b d b d

Now, the fact that

a a = means precisely that [(a, b)] = [(a , b )], which means that b b ab = a b. Similarly, we have cd = c d. Now, a c ac a c ac = , and = b d bd b d bd

and so we need to prove that ac ac = . bd bd This means we need to prove that [(ac, bd)] R [(a c , b d )]. Now, [(ac, bd)] R [(a c , b d )] acb d = a c bd (ab )(cd ) = (a b)(c d),

119

8. Rational, real and complex numbers

which is true because ab = a b and cd = c d. Learning activity 8.6 We have (x w)(x w) = x2 (w + w)x + ww. Now, w + w = 2 Re(w) = 2( 1 ) and ww = 2 2 is x + x + 1. Learning activity 8.7
1 4

3 4

so the product of the last two factors

2i i

z = 2 + 2i

(0, 0) i 2i

w =1i 3

Learning activity 8.8 Draw the line from the point diagram the origin to z in the above. Do the same for w. For z , |z | = 2 2 and = 4 , so z = 2 2( cos( 4 ) + i sin( )). 4 , so that The modulus of w is |w| = 2 and the argument is 3

w = 2( cos( ) + i sin( )) = 2( cos( ) i sin( )). 3 3 3 3 The set (a) |z | = 3, is the circle of radius 3 centered at the origin. The set (b), argument , is the half line from the origin through the point (1,1). of z is 4 Learning activity 8.10 The roots are: z1 = 1 ei 6 , z4 = 1 ei 6 ,
7

z2 = 1 ei 6 , z5 = 1 ei 6 ,
i 13 6 9

z3 = 1 ei 6 , z6 = 1 ei
11 6

These roots are in conjugate pairs, and e z4 = z 3 = ei 6 , The polynomial factors as


5

=e :

i 6

z5 = z 2 = ei 2 ,

z6 = z 1 = ei 6 .

x6 + 1 = (x z1 )(x z 1 )(x z2 )(x z 2 )(x z3 )(x z 3 ), Using the a + ib form of each complex number, for example, z1 = 23 + i 1 , you can carry 2 out the multiplication of the linear terms pairwise (conjugate pairs) to obtain x6 + 1 as a product of irreducible quadratics with real coecients, x6 + 1 = (x2 3 x + 1)(x2 + 3 x + 1)(x2 + 1)

120

8.9. Solutions to exercises

8.9

Solutions to exercises

Solution to exercise 8.1 Suppose we have 5 = m/n where m, n Z. Since 5 > 0, we may assume that m, n > 0. (Otherwise, both are negative, and we can multiply each by 1.) We can also suppose that m, n have greatest common divisor 1. (For, we can cancel any common factors.) Then (m/n)2 = 5 means that m2 = 5n2 . So 5 | m2 . Now m can, by the Fundamental Theorem of Arithmetic, be written as a product of primes m = p1 p2 . . . pk . 2 2 2 Then m2 = p2 1 p2 . . . pk . If no pi is 5, then 5 does not appear as a factor in m and so 5 does not divide m2 . So some pi is equal to 5. So 5 | m. Now, this means that m = 5r for some r N and hence m2 = (5r)2 = 25r2 and so 25r2 = 5n2 . Then, n2 = 5r2 , so 5 | n2 . Arguing as before, 5 | n. So 5 is a common factor if m and n, which contradicts gcd(m, n) = 1. Hence 5 is not rational. Solution to exercise 8.2 We have 1 + 2i 1 + 2i 4 + 5i = 4 5i 4 5i 4 + 5i (1 + 2i)(4 + 5i) = (4 5i)(4 + 5i) 4 + 8i + 5i + 10i2 = 16 25i2 6 + 13i = 41 6 13 = + i. 41 41 You can check that this is the correct answer by calculating the product 6 13 + i (4 5i) 41 41

and observing that the answer is 1 + 2i. Solution to exercise 8.3 To solve the equation x2 2ix + 3 = 0, we could use the formula for the solutions of a quadratic equation. Or we could note that the equation is equivalent to (x i)2 = 4, so the solutions are given by x i = 2i and x i = 2i, so they are x = 3i and x = i. Solution to exercise 8.4 We have ei/2 = i, e
i(11/3) i(/3)

ei3/2 = i,

1 3 =e = i , e1+i = e1 ei = e cos(1) + i e sin(1), 2 2 1 1 e = e + 0i is real, so already in the form a + ib.

1 1 ei3/4 = + i , 2 2

121

8. Rational, real and complex numbers

Solution to exercise 8.5 To express z = 1 + 3i in exponential form, we rst note that 1+ 3i = 2 1 3 + i 2 2

and this is r(cos + i sin ) when r = 2, = /3. So z = 2ei/3 . Then, (1 + 3i)30 = z 30 = 2ei/3
30

= 230 e30i/3 = 230 e10i = 230 .

122

You might also like