This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Reading, Discovering and Writing Proofs
Version 0.1.8
Steven Furino
February 26, 2012 Contents
1 In the beginning
1.1 What Makes a Mathematician a Mathematician?
1.2 How The Course Works . . . . . . . . . . . . . .
1.3 Why do we reason formally? . . . . . . . . . . . .
1.4 Reading and Lecture Schedule . . . . . . . . . . .
1.4.1 Lecture Schedule . . . . . . . . . . . . . .
1.4.2 Reading Schedule . . . . . . . . . . . . . . .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. 8
8
8
9
11
11
12 2 Our
2.1
2.2
2.3
2.4 .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. 13
13
13
16
18 3 Truth Tables
3.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Truth Tables as Deﬁnitions . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 Truth Tables to Evaluate Logical Expressions . . . . . . . . . . . . . . . . . 21
21
21
23 4 Introduction to Sets
4.1 Objectives . . . . . . . . . . .
4.2 Describing a Set . . . . . . .
4.3 Set Operations . . . . . . . .
4.3.1 Venn Diagrams . . . .
4.4 Comparing Sets . . . . . . . .
4.4.1 Sets of Solutions . . .
4.4.2 An Example . . . . .
4.5 Showing Two Sets Are Equal .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. 26
26
26
30
32
32
32
33
34 5 Discovering Proofs
5.1 Objectives . . . . . . . .
5.2 Discovering a Proof . . .
5.3 Reading A Proof . . . .
5.4 The Division Algorithm .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. 36
36
36
38
39 6 Quantiﬁers
6.1 Objectives . . . . . . .
6.2 Quantiﬁers . . . . . .
6.3 The Object Method .
6.4 The Construct Method
6.5 The Select Method . . .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. 41
41
41
44
45
46 First Proof
Objectives . . .
The Language .
Implications . .
Our First Proof .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. 2 .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. Section 0.0 CONTENTS
6.6
6.7 3
Sets and Quantiﬁers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A NonProof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Nested Quantiﬁers
7.1 Objectives . . . . . . . . . . . . .
7.2 Onto or Surjective . . . . . . . .
7.2.1 Deﬁnition . . . . . . . . .
7.2.2 Reading . . . . . . . . . .
7.2.3 Discovering . . . . . . . .
7.3 Onetoone or Injective . . . . . .
7.3.1 Deﬁnition . . . . . . . . .
7.3.2 Reading . . . . . . . . . .
7.3.3 Discovering . . . . . . . .
7.4 Limits . . . . . . . . . . . . . . .
7.4.1 Deﬁnition . . . . . . . . .
7.4.2 Reading A Limit Proof .
7.4.3 Discovering a Limit Proof 47
48 .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. 50
50
50
50
52
53
54
54
55
56
57
57
58
60 8 Induction
8.1 Objectives . . . . . . . . . . . . . . . . . .
8.2 Notation . . . . . . . . . . . . . . . . . . .
8.2.1 Summation Notation . . . . . . . .
8.2.2 Product Notation . . . . . . . . . .
8.2.3 Recurrence Relations . . . . . . . .
8.3 Introduction to Induction . . . . . . . . .
8.4 Principle of Mathematical Induction . . .
8.4.1 Why Does Induction Work? . . . .
8.4.2 Two Examples of Simple Induction
8.4.3 A Diﬀerent Starting Point . . . . .
8.5 Strong Induction . . . . . . . . . . . . . .
8.5.1 Interesting Example . . . . . . . .
8.6 Binomial Theorem . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. 62
62
62
62
64
64
65
66
67
67
69
70
72
73 .
.
.
. 76
76
76
80
82 10 Properties Of GCDs
10.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.2 Some Useful Propositions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
84
84 11 Linear Diophantine Equations
11.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2 The Select Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.3 Linear Diophantine Equations . . . . . . . . . . . . . . . . . . . . . . . . . . 90
90
90
92 9 The
9.1
9.2
9.3
9.4 .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
. Greatest Common Divisor
Objectives . . . . . . . . . . . . . . . . . . .
Greatest Common Divisor . . . . . . . . . .
Certiﬁcate of Correctess . . . . . . . . . . .
The Extended Euclidean Algorithm (EEA) .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. 12 Practice, Practice, Practice: Quantiﬁers and Sets
100
12.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
12.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4 Chapter 0
13 Congruence
13.1 Objectives . . . . . . . . . . . . .
13.2 Congruences . . . . . . . . . . . .
13.2.1 Deﬁnition of Congruences
13.3 Elementary Properties . . . . . . CONTENTS .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. 103
103
103
103
104 14 Modular Arithmetic
14.1 Objectives . . . . . . . . . . . . . . .
14.2 Modular Arithmetic . . . . . . . . .
14.2.1 [0] ∈ Zm . . . . . . . . . . . .
14.2.2 [1] ∈ Zm . . . . . . . . . . . .
14.2.3 Identities and Inverses in Zm
14.2.4 Subtraction in Zm . . . . . .
14.2.5 Division in Zm . . . . . . . .
14.3 Fermat’s Little Theorem . . . . . . . .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. .
.
.
.
.
.
.
. 112
112
112
114
114
114
116
116
116 .
.
.
. 120
120
120
122
123 15 Linear Congruences
15.1 Objectives . . . . . . . .
15.2 The Problem . . . . . .
15.3 Extending Equivalencies
15.4 Examples . . . . . . . . .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
.
.
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. 16 Chinese Remainder Theorem
125
16.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
16.2 An Old Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
16.3 Chinese Remainder Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . 126
17 Practice, Practice, Practice: Congruences
129
17.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
17.2 Linear and Polynomial Congruences . . . . . . . . . . . . . . . . . . . . . . 129
17.3 Preparing for RSA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
18 The
18.1
18.2
18.3 RSA Scheme
Objectives . . . . . . . . . . . . .
Why Public Key Cryptography?
Implementing RSA . . . . . . . .
18.3.1 Setting up RSA . . . . . .
18.3.2 Sending a Message . . . .
18.3.4 Example . . . . . . . . . .
18.3.3 Receiving a Message . . .
18.4 Does M = R? . . . . . . . . . . .
18.5 How Secure Is RSA? . . . . . . . .
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
. 19 Negation
19.1 Objectives . . . . . . . . . . . . . . . .
19.2 Negating Statements . . . . . . . . . .
19.3 Negating Statements with Quantiﬁers
19.3.1 Counterexamples . . . . . . . . .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. .
.
.
. .
.
.
.
.
.
.
.
. 135
135
135
136
136
136
136
137
139
140 .
.
.
. 141
141
141
143
144 20 Contradiction
146
20.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
20.2 How To Use Contradiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Section 0.0 CONTENTS 5
20.2.1 When To Use Contradiction . . . . . . . . . . . . . . . . . . . . . . .
20.2.2 Reading a Proof by Contradiction . . . . . . . . . . . . . . . . . . .
20.2.3 Discovering and Writing a Proof by Contradiction . . . . . . . . . . 21 Contrapositive
21.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21.2 The Contrapositive . . . . . . . . . . . . . . . . . . . . . . . . . . .
21.2.1 When To Use The Contrapositive . . . . . . . . . . . . . . .
21.3 Reading a Proof That Uses the Contrapositive . . . . . . . . . . .
21.3.1 Discovering and Writing a Proof Using The Contrapositive
22 Uniqueness
22.1 Objectives . . . . . . . .
22.2 Introduction . . . . . . .
22.3 Showing X = Y . . . . .
22.4 Finding a Contradiction
22.5 The Division Algorithm .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. 23 Introduction to Primes
23.1 Objectives . . . . . . . . . . . . . . .
23.2 Introduction to Primes . . . . . . . .
23.3 Induction . . . . . . . . . . . . . . .
23.4 Fundamental Theorem of Arithmetic
23.5 Finding a Prime Factor . . . . . . .
23.6 Working With Prime Factorizations .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
.
. 147
147
148 .
.
.
.
. 151
151
151
151
152
153 .
.
.
.
. 155
155
155
156
157
158 .
.
.
.
.
. 160
160
160
161
162
164
166 24 Introduction to Fermat’s Last Theorem
168
24.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
24.2 History of Fermat’s Last Theorem . . . . . . . . . . . . . . . . . . . . . . . 168
24.3 Pythagorean Triples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
25 Characterization of Pythagorean Triples
174
25.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
25.2 Pythagorean Triples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
26 Fermat’s Theorem for n = 4
26.1 Objectives . . . . . . . . .
26.2 n = 4 . . . . . . . . . . .
26.3 Reducing the Problem . .
26.4 History . . . . . . . . . . .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. 177
177
177
179
180 27 Problems Related to FLT
181
27.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
27.2 x4 − y 4 = z 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
28 Practice, Practice, Practice: Prime Numbers
184
28.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
28.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
29 Complex Numbers
185
29.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
29.2 Diﬀerent Equations Require Diﬀerent Number Systems . . . . . . . . . . . . 185 6 Chapter 0 CONTENTS 29.3 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30 Properties Of
30.1 Objectives
30.2 Conjugate
30.3 Modulus . 186 Complex Numbers
189
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 31 Graphical Representations of Complex Numbers
31.1 Objectives . . . . . . . . . . . . . . . . . . . . . . .
31.2 The Complex Plane . . . . . . . . . . . . . . . . .
31.2.1 (x, y ) . . . . . . . . . . . . . . . . . . . . . .
31.2.2 Modulus . . . . . . . . . . . . . . . . . . . .
31.3 Polar Representation . . . . . . . . . . . . . . . . .
31.4 Converting Between Representations . . . . . . . . .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. .
.
.
.
.
. 192
192
192
192
193
193
194 32 De Moivre’s Theorem
197
32.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
32.2 De Movre’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
32.3 Complex Exponentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
33 Roots of Complex Numbers
200
33.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
33.2 Complex nth Roots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
33.3 More Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
34 An Introduction to Polynomials
204
34.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
34.2 Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
34.3 Operations on Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
35 Factoring Polynomials
208
35.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
35.2 Polynomial Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
36 The
36.1
36.2
36.3
36.4
36.5 Shortest Path
Objectives . . .
The Problem .
Abstraction . .
Algorithm . . .
Extensions . . . Problem
......
......
......
......
...... .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. .
.
.
.
. 212
212
212
214
215
215 37 Paths, Walks, Cycles and Trees
216
37.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
37.2 The Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
37.3 Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
38 Trees
222
38.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
38.2 Properties of Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
39 Dijkstra’s Algorithm
226
39.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 Section 0.0 CONTENTS 7 39.2 Dijkstra’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
39.3 Certiﬁcate of Optimality . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
40 Certiﬁcate of Optimality  Path
40.1 Objectives . . . . . . . . . . . .
40.2 Certiﬁcate of Optimality . . . .
40.3 Weighted Graphs . . . . . . . .
40.4 Certiﬁcate of Optimality  Tree
41 Appendix .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. .
.
.
. 226
231
233
233
233
234
239
240 Chapter 1 In the beginning
1.1 What Makes a Mathematician a Mathematician? Welcome to MATH 135!
Let me begin with a question. What makes a mathematician a mathematician?
Many people would answer that someone who works with numbers is a mathematician.
But bookkeepers for small businesses work with numbers and we don’t normally consider a
bookkeeper as a mathematician. Others might think of geometry and answer that someone
who works with shapes is a mathematician. But architects work with shapes and we don’t
normally consider architects as mathematicians. Still others might answer that people who
use formulas are mathematicians. But engineers work with formulas and we don’t normally
consider engineers as mathematicians. A more insightful answer would be that people who
ﬁnd patterns and provide descriptions and evidence for those patterns are mathematicians.
But scientists search for and document patterns and we don’t normally consider scientists
as mathematicians.
The answer is proof  a rigorous, formal argument that establishes the truth of a statement.
This has been the deﬁning characteristic of mathematics since ancient Greece.
MATH 135 is about reading, writing and discovering proofs. If you have never done this
before, do not worry. This course will provide you with techniques that will help, and we
will practice those techniques in the context of some very interesting algebra. 1.2 How The Course Works
He who seeks for methods without having a deﬁnite problem in mind seeks for
the most part in vain.
David Hilbert Let me describe how the course works.
Throughout the course, we will work on three problems all of which illustrate the need
for proof. The ﬁrst problem resolves a very important practical commercial problem. The
second problem begins work on one of the most notorious problems in all of mathematics.
The last problem yields a surprising and beautiful result. Here are the three problems.
8 Section 1.3 Why do we reason formally? 9 How do we secure internet commerce? Have you ever bought a song or movie over
iTunes? Have you ever done your banking over the web? How do you make sure
that your credit card number and personal information are not intercepted by bad
guys? Number theory allows us to enable secure web transactions. And that theory
is backed by proof.
How many solutions are there to xn + y n = z n where x, y and z must be positive integers and n is an integer greater than or equal to three? This is one of the most
famous problems in the history of mathematics and it took over 350 years to solve. It
was ﬁrst conjectured by the French mathematician Pierre de Fermat in 1637 and was
only solved in 1995 by Andrew Wiles.
Why does eiπ + 1 = 0 ? e is a very unusual number. Of all the real numbers a, there is
ax
exactly one where ddx = ax . And that number is e. i is a very unusual number with
its deﬁning property of i2 = −1. π is a very unusual number even if it is common. It
is the unique ratio of the circumference of a circle to its diameter. Why should that
ratio be unique? One is the basis of the natural numbers, hence the integers, hence
the rationals. Zero is a diﬃcult number and was only accepted into the mathematics
of western Europe because of the inﬂuence of Hindu and Islamic scholars. Why should
all of these numbers be connected in so simple and elegant a form?
To work with these problems we will need to learn about congruences, modular arithmetic,
primes and complex numbers. And to work with these topics, we must learn about proof
techniques. The proof techniques will be introduced as we need them. 1.3 Why do we reason formally? Since many people dislike proofs, and think that humans already know enough mathematics,
let me deal with the question: “Why bother with proofs?” There are quite a few reasons.
To prevent silliness. In solving quadratic equations with nonreal roots, some of you will
have encountered the number i which has the special property that i2 = −1. But
then,
√
√√
√
−1 = i2 = i × i = −1 −1 = −1 × −1 = 1 = 1
Clearly, something is amiss.
To understand better. How would most of us answer the question “What’s a real number?” We would probably say that any number written as a decimal expansion is a
real number and any two diﬀerent expansions represent diﬀerent numbers. But then
what about this?
Let x = 0.9 = 0.999 . . . .
Multiplying by 10 and subtracting gives
10x = 9.9
−
x = 0.9
9x = 9
which implies x = 1, not x = 0.9. 10 Chapter 1 In the beginning Or suppose we wanted to evaluate the inﬁnite sum
1 − 1 + 1 − 1 + 1 − 1 + 1 − 1 + ...
If we pair up the ﬁrst two terms we get zero and every successive pair of terms also
gives us 0 so the sum is zero.
1 − 1+1 − 1+1 − 1+1 − 1+...
On the other hand, if we pair up the second and third term we get 0 and all successive
pairs of terms give 0 so the sum is 1.
1 −1 + 1 −1 + 1 −1 + 1 −1 + 1 + . . .
Or suppose we wanted to resolve Zeno’s paradox. Zeno was a famous ancient Greek
philosopher who posed the following problem. Suppose the Greek hero Achilles was
going to race against a tortoise and suppose, in recognition of the slowness of the
tortoise, that the tortoise gets a 100m head start. By the time Achilles has run half
the distance between he and the tortoise, the tortoise has moved ahead. And now
again, by the time Achilles has run half the remaining distance between he and the
tortoise, the tortoise has moved ahead. No matter how fast Achilles runs, the tortoise
will always be ahead! You might object that your eyes see Achilles pass the tortoise,
but what is logically wrong with Zeno’s argument?
To make better commercial decisions. Building pipelines is expensive. And lots of
pipelines will be built in the next few decades. Pipelines will ship oil, natural gas,
water and sewage. Finding the shortest route given physical constraints (mountains,
rivers, lakes, cities), environmental constraints (protection of the water table, no access
through national or state parks), and supply chain constraints (access to concrete and
steel) is very important. How do pipeline builders prove that the route they have
chosen for the pipeline is the shortest possible route given the constraints?
To discover solutions. Formal reasoning provides a set of tools that allow us to think
rationally and carefully about problems in mathematics, computing, engineering, science, economics and any discipline in which we create models.
Poor reasoning can be very expensive. Inaccurate application of ﬁnancial models led
to losses of hundreds of billions of dollars during the ﬁnancial crisis of 2008.
To experience joy. Mathematics can be beautiful, just as poetry can be beautiful. But
to hear the poetry of mathematics, one must ﬁrst understand the language. Section 1.4 Reading and Lecture Schedule 1.4
1.4.1 Reading and Lecture Schedule
Lecture Schedule Here is a proposed lecture schedule.
Lec.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 Ch.
1
2
5
6
7
8
8
9
9
10
11
11
12
13
13
14
14
15
16
17
19
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 Topic
In The Beginning
Our First Proof
Discovering Proofs
Quantiﬁers
Nested Quantiﬁers
Simple Induction and the Binomial Theorem
Strong Induction
Greatest Common Divisor
Extended Euclidean Algorithm
Properties of the GCD
Linear Diophantine Equations
Linear Diophantine Equations
Practice, Practice, Practice
Congruence
Congruence
Modular Arithmetic
Modular Arithmetic
Linear Congruences
Chinese Remainder Theorem
Practice, Practice, Practice
RSA
Introduction to Primes
Introduction to Fermat’s Last Theorem
Characterization of Pythagorean Triples
The Case n = 4
Related Problems
Practice, Practice, Practice
Introduction to Complex Numbers
Properties of Complex Numbers
Graphical Representations of Complex Numbers
DeMoivre’s Theorem
Roots of Complex Numbers
Practice, Practice, Practice
Introduction to Polynomials
Factoring Polynomials
Practice, Practice, Practice 11 12 Chapter 1 1.4.2 In the beginning Reading Schedule Since one of the goals of this course is to help you become comfortable reading mathematics,
there are ten short chapters for you to read. After you have completed the reading, an online
assignment will help you consolidate what you know.
Ch.
3
4
6
7
8
18
20
21
22
23 Topic
Truth Tables
Sets
Quantiﬁers
Nested Quantiﬁers
Induction
Introduction to Cryptography
Negation
Contradiction
Contrapositive
Uniqueness Before Lecture
3. Discovering Proofs
3. Discovering Proofs
4. Quantiﬁers
5. Nested Quantiﬁers
8. Simple Induction
21. RSA
22. Introduction to Primes
22. Introduction to Primes
22. Introduction to Primes
22. Introduction to Primes Chapter 2 Our First Proof
2.1 Objectives The technique objectives are:
1. Deﬁne statement, hypothesis, conclusion and implication.
2. Learn how to structure the analysis of a proof.
3. Carry out the analysis of a proof.
The content objectives are:
1. Deﬁne divisibility.
2. State and prove the Transitivity of Divisibility. 2.2 The Language
Mathematics is the language of mathematicians, and a proof is a method of communicating a mathematical truth to another person who speaks the “language”.
(Solow, How to Read and Do Proofs) Mathematics is an unusual language. It is extraordinarily precise. When a proof is fully
and correctly presented, there is no ambiguity and no doubt about its correctness.
However, understanding a proof requires understanding the language. This course will help
you with the basic grammar of the language of mathematics and is applicable to all proofs.
Just as in learning any new language, you will need lots of practice to become ﬂuent. 13 14 Chapter 2 Our First Proof With respect to learning proof techniques, the broad objectives of the course are simple.
1. Explain and categorize proof techniques that can be used in any proof. This course
will teach not only how a technique works, but when it is most likely to be used and
why it works.
2. Learn how to read a proof. This will require you to identify the techniques of the ﬁrst
objective.
3. Discover your own proofs. Knowledge of technique is essential but inadequate. Or,
as we would say in the language of mathematics, technique is “necessary but not
suﬃcient”. Discovering your own proof requires not only technique but also understanding, creativity, intuition and experience. This course will help with the technique
and experience. Understanding, creativity, and intuition come with time. Talent helps
of course.
4. Write your own proofs. Having discovered a proof, you must distill your discovery
into mathematical prose that is targeted at a speciﬁc audience.
Hopefully, in the previous lecture, I convinced you of why we need to prove things. Now
what is it that mathematicians prove? Mathematicians prove statements. Deﬁnition 2.2.1 A statement is a sentence which is either true or false. Statement Example 1 Here are some examples of statements.
1. 2 + 2 = 4. (A true statement.)
2. 2 + 2 = 5. (A false statement.)
3. x2 − 1 = 0 has two distinct real roots. (A true statement.)
4. There exists an angle θ such that sin(θ) > 1. (A false statement.) Example 2 Now consider the following sentences.
1. x > 0.
2. ABC is congruent to P QR. These are statements only if we have an appropriate value for x in the ﬁrst sentence and
appropriate instances of ABC and P QR in the second sentence. For example, if x is
the number 5, then the sentence “5 > 0” is a statement since the sentence is true. If x is
the number −5, then the sentence “−5 > 0” is also a statement since the sentence is false.
The key point is that a statement is a sentence which must be true or false. If x is the
English word algebra, then the sentence “algebra > 0” is not a statement since the sentence
is neither true nor false. Sentences like the two above are called open sentences. Section 2.2 The Language Deﬁnition 2.2.2 15 An open sentence is a sentence that Open Sentence • contains one or more variables, where
• each variable has values that come from a designated set called the domain of the
variable, and
• where the sentence is either true or false whenever values from the respective domains
of the variables are substituted for the variables. For example, if the domain of x is the set of real numbers, then for any real number chosen
and substituted for x, the sentence “x > 0” is a statement.
In this course, we will treat all open sentences as statements under the assumption that the
values of the variables always come from a suitable domain. Self Check 1 For each of the following, choose one of the following possible answers.
(a) This is not a statement.
(b) This is a true statement.
(c) This is a false statement.
(d) This is an open sentence.
1. {1, 3, 5, 7, 9}
2. sin2 θ + cos2 θ
3. For all real values θ, sin2 θ + cos2 θ = 1
4. Therefore, x = π/2.
5. If x is a positive real number, then log10 x > 0.
6. x2 + 1 = 0 has two real roots. 16 Chapter 2 2.3
Deﬁnition 2.3.1
Implication Our First Proof Implications The most common type of statement we will prove is an implication. Implications have
the form
If A is true , then B is true
where A and B are themselves statements. An implication is more commonly read as
If A, then B
or
A implies B
or
A⇒B Deﬁnition 2.3.2
Compound
Statement An implication is a compound statement, that is, it is made up of more than one statement.
In the statement “A implies B ”, A is a statement which may be true or false. B is a
statement which may be true or false. “A implies B ” is also a statement which may be true
or false. Deﬁnition 2.3.3 The statement A is called the hypothesis. The statement B is called the conclusion. Hypothesis,
Conclusion REMARK
To prove the implication “A implies B ”, you assume that A is true and you use this
assumption to show that B is true. A is what you start with. B is where you must end up.
To use the implication “A implies B ”, you must ﬁrst establish that A is true. After you
have established that A is true, then you can invoke B .
It is crucial that you are able to identify
1. the hypothesis
2. the conclusion
3. whether you are using or proving an implication Here are some examples of implications. Example 3 If x is a positive real number, then log10 x > 0.
Hypothesis: x is a positive real number.
Conclusion: log10 x > 0. Section 2.4 Implications Example 4 17 Let f (x) = x sin(x). Then f (x) = x for some real number x with 0 ≤ x ≤ 2π .
Hypothesis: f (x) = x sin(x).
Conclusion: f (x) = x for some real number x with 0 ≤ x ≤ 2π . Example 5 In plane geometry, ∠ABC = ∠XY Z whenever
Hypothesis: All ﬁgures are in the plane. ABC is similar to
ABC ∼ XY Z. XY Z. Conclusion: ∠ABC = ∠XY Z . Self Check 2 Identify the hypothesis and the conclusion in each of the following statements.
1. If a, b and c are real numbers, and b2 − 4ac > 0, then ax2 + bx + c = 0 has two distinct,
real roots.
(a) a, b and c are real numbers.
(b) b2 − 4ac > 0.
(c) a, b and c are real numbers and b2 − 4ac > 0.
(d) ax2 + bx + c = 0.
(e) ax2 + bx + c = 0 has two distinct, real roots.
2. If the line segment AB intersects the line segment P Q at O, then ∠AOQ = ∠P OB .
(a) The line segment AB
(b) The line segment AB intersects the line segment P Q.
(c) The line segment AB intersects the line segment P Q at O.
(d) ∠AOQ = ∠P OB .
(e) None of the above.
3. y = ax2 − 1 has no real root if a < 0.
(a) y = ax2 − 1.
(b) y = ax2 − 1 has no real roots.
(c) a < 0.
(d) None of the above.
4. When x is an integer, the maximum value of y = −x4 + 4x2 + 0.5 is 4.
(a) x is an integer.
(b) y = −x4 + 4x2 + 0.5
(c) x is a maximum value.
(d) The maximum value of y = −x4 + 4x2 + 0.5 is 4.
(e) None of the above. 18 Chapter 2 2.4 Our First Proof Our First Proof Let us read our ﬁrst proof. We begin with a deﬁnition. Deﬁnition 2.4.1
Divisibility An integer m divides an integer n, and we write m  n, if there exists an integer k so that
n = km. Example 6
• 3  6 since we can ﬁnd an integer k , 2 in this case, so that 6 = k × 3.
• 5 6 since no integer k exists so that 6 = k × 5.
• For all integers a, a  0 since 0 = 0 × a. This is true for a = 0 as well.
• For all nonzero integers a, 0 a since there is no integer k so that k × 0 = a. Some comments about deﬁnitions are in order. If mathematics is thought of as a language,
then deﬁnitions are the vocabulary and our prior mathematical knowledge indicates our
experience and versatility with the language.
Mathematics and the English language both share the use of deﬁnitions as extremely practical abbreviations. Instead of saying “a domesticated carnivorous mammal known scientiﬁcally as Canis familiaris” we would say “dog.” Instead of writing down “there exists an
integer k so that n = km”, we write “m  n.”
However, mathematics diﬀers greatly from English in precision and emotional content.
Mathematical deﬁnitions do not allow ambiguity or sentiment. Deﬁnition 2.4.2 A proposition is a true statement that has been proved by a valid argument. Proposition REMARK
You will encounter several variations on the word proposition. A theorem is a particularly
signiﬁcant proposition. A lemma is a subsidiary proposition, or more informally, a “helper”
proposition, that is used in the proof of a theorem. A corollary is a proposition that follows
almost immediately from a theorem.
There are particular statements that may look like propositions but are more foundational.
An axiom is a statement that is assumed to be true. No proof is given. From axioms we
derive propositions and theorems. Obviously, choosing axioms has to be done very carefully. Consider the following proposition and proof. Proposition 1 (Transitivity of Divisibility (TD))
Let a, b and c be integers. If a  b and b  c, then a  c. Section 2.4 Our First Proof 19 Proof: Since a  b, there exists an integer r so that ra = b. Since b  c, there exists an
integer s so that sb = c. Substituting ra for b in the previous equation, we get (sr)a = c.
Since sr is an integer, a  c.
Though this is a simple proof, other proofs can be diﬃcult to read because of the habits
of writing for professional audiences. Many proofs share the following properties which can
be frustrating for students.
1. Proofs are economical. That is, a proof includes what is needed to verify the truth of
a proposition but nothing more.
2. Proofs do not usually identify the hypothesis and the conclusion.
3. Proofs sometimes omit or combine steps.
4. Proofs do not always explicitly justify steps.
5. Proofs do not reﬂect the process by which the proof was discovered.
The reader of the proof must be conscious of the hypothesis and conclusion, ﬁll in the
omitted parts and justify each step. REMARK
When you are reading a proof of an implication, do the following.
1. Explicitly identify the hypothesis and the conclusion. If the hypothesis contains no
statements write “No explicit hypothesis”. At the end of the proof, you should be
able to identify where each part of the hypothesis has been used.
2. Explicitly identify the core proof technique. When reading a proof, the reader usually
works forward from the hypothesis until the conclusion is reached. Speciﬁc techniques
will be covered later in the course.
3. Record any preliminary material needed, usually deﬁnitions or propositions that have
already been proved. Judgement is needed here about how much to include.
4. Justify each step with reference to the deﬁnitions, previously proved propositions or
techniques used.
5. Add missing steps where necessary and justify these steps with reference to the deﬁnitions, previously proved propositions or techniques used. Let’s analyze the proof of the Transitivity of Divisibility in detail because it will give us
some sense of how to analyze proofs in general. First, observe that “If a  b and b  c, then
a  c.” is an open sentence, and that the domains for the variables a, b and c are speciﬁed
in the ﬁrst sentence, “Let a, b and c be integers.”
Professional mathematicians do all of these things implicitly but for the ﬁrst part of this
course, we will do these things explicitly.
We will do a line by line analysis, so to make our work easier, we will write each sentence
on a separate line. 20 Chapter 2 Our First Proof Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Since a  b, there exists an integer r so that ra = b.
2. Since b  c, there exists an integer s so that sb = c.
3. Substituting ra for b in the previous equation, we get (sr)a = c.
4. Since sr is an integer, a  c. Let’s analyze the proof. What we do now will seem like overkill but it serves two purposes.
It gives practice at justifying every line of a proof, and it gives us a structure that we
can use for other proofs. Lastly, recall that the author is proving an implication. The
author assumes that the hypothesis is true, and uses the hypothesis to demonstrate that
the conclusion is true. Here goes.
Analysis of Proof We begin by explicitly identifying the hypothesis and the conclusion.
Hypothesis: a, b and c are integers. a  b and b  c.
Conclusion: a  c.
Core Proof Technique: Work forwards from the hypothesis.
Preliminary Material: The deﬁnition of divides. An integer m divides an integer
n, and we write m  n, if there exists an integer k so that n = km.
Sentence 1 Since a  b, there exists an integer r so that ra = b.
In this sentence, the author of the proof uses the hypothesis a  b and the deﬁnition
of divides.
Sentence 2 Since b  c, there exists an integer s so that sb = c.
In this sentence, the author uses the hypothesis b  c and the deﬁnition of divides.
Sentence 3 Substituting ra for b in the previous equation, we get (sr)a = c.
Here, the author works forward using arithmetic. The actual work is:
sb = c and ra = b implies s(ra) = c which implies (sr)a = c.
Sentence 4 Since sr is an integer, a  c.
Lastly, the author uses the deﬁnition of divides. In this case, the m, k and n of the
deﬁnition apply to the a, sr and c of the proof. It is important to note that sr is an
integer, otherwise the deﬁnition of divides does not apply.
At the end of each proof, you should be able to identify where each part of the hypothesis
was used. It is obvious where a  b and b  c were used. The hypothesis “a, b and c are
integers” was needed to allow the author to use the deﬁnition of divides.
This completes the analysis of our ﬁrst proof. Between the readings, lectures, quizzes,
assignments and tests, you will work your way through roughly one hundred proofs. Chapter 3 Truth Tables
3.1 Objectives The technique objectives are:
1. Deﬁne not, and, or, implies and if and only if using truth tables.
2. Evaluate logical expressions using truth tables.
3. Use truth tables to establish the equivalence of logical expressions. 3.2 Truth Tables as Deﬁnitions Throughout this course we work with statements. Deﬁnition 3.2.1 A statement is a sentence which is either true or false. Statement Deﬁnition 3.2.2
Compound,
Component All of the statements we need to prove will be compound statements, that is, statements
composed of several individual statements called component statements. For example, the compound statement
If a  b and b  c, then a  c.
contains three component statements
a  b,
b  c, and
ac
Suppose we let X be the statement a  b and Y be the statement b  c and Z be the
statement a  c. Then our original statement
21 22 Chapter 3 Truth Tables If a  b and b  c, then a  c.
becomes
X and Y imply Z .
If we knew the truth values of X , Y and Z , then we would be able to determine the truth
value of the compound statement “X and Y imply Z ”. And that is where truth tables come
in. Truth tables contain all possible values of the component statements and determine the
truth value of the compound statement.
Truth tables can be used to deﬁne the truth value of a statement or evaluate the truth
value of a statement. For logical operations like not, and, or, implies and if and only if,
truth tables are used to deﬁne the truth value of the compound statement. Deﬁnition 3.2.3 The simplest deﬁnition is that of NOT A, written ¬A. NOT A ¬A
TF
FT
In prose, if the statement A is true, then the statement “NOT A” is false. If the statement
A is false, then the statement “NOT A” is true. Two very important and common logical connectives are AND and OR. Note that these do
not always coincide with our use of the words and and or in the English language! Deﬁnition 3.2.4
AND Deﬁnition 3.2.5
OR The deﬁnition of A AND B , written A ∧ B , is
A
T
T
F
F B A∧B
T
T
F
F
T
F
F
F The deﬁnition of A OR B , written A ∨ B , is
A
T
T
F
F B A∨B
T
T
F
T
T
T
F
F This is an opportune moment to highlight the diﬀerence between mathematical language
and the English language. If you are visiting a friend and your friend oﬀers you “coﬀee or Section 3.3 Truth Tables to Evaluate Logical Expressions 23 tea”, you interpret that to mean that you may have coﬀee or tea but not both. However,
the logical A ∨ B results in a true statement when A is true, B is true or both are true. In
mathematics, or is inclusive. Deﬁnition 3.2.6 The deﬁnition of A implies B , written A ⇒ B , often seems strange. Implies A
T
T
F
F B A⇒B
T
T
F
F
T
T
F
T The ﬁrst two rows in the table make sense. The last two make less sense. How can a false
hypothesis result in a true statement? The basic idea is that if one is allowed to assume an
hypothesis which is false, any conclusion can be derived.
We will shortly see that implies is closely related to if and only if. Deﬁnition 3.2.7 The deﬁnition of A if and only if B , written A ⇐⇒ B or A iﬀ B , is If and Only If A
T
T
F
F 3.3 B A ⇐⇒ B
T
T
F
F
T
F
F
T Truth Tables to Evaluate Logical Expressions We can construct truth tables for compound statements by evaluating parts of the compound
statement separately and then evaluating the larger statement. Consider the following truth
table which shows the truth values of ¬(A ∨ B ) for all possible combinations of truth values
of the component statements A and B . Example 1 Construct a truth table for ¬(A ∨ B ).
A
T
T
F
F B A ∨ B ¬(A ∨ B )
T
T
F
F
T
F
T
T
F
F
F
T In the ﬁrst row of the table A and B are true, so using the deﬁnition of or, the statement
A ∨ B is true. Since the negation of a true statement is false, ¬(A ∨ B ) is false, which 24 Chapter 3 Truth Tables appears in the last column of the ﬁrst row. Take a minute to convince yourself that each of
the remaining rows is correct.
Here is another example. Example 2 Construct a truth table for A ⇒ (B ∨ C ).
A
T
T
T
T
F
F
F
F Deﬁnition 3.3.1
Logically
equivalent B
T
T
F
F
T
T
F
F C B ∨ C A ⇒ (B ∨ C )
T
T
T
F
T
T
T
T
T
F
F
F
T
T
T
F
T
T
T
T
T
F
F
T Two compound statements are logically equivalent if they have the same truth values for
all combinations of their component statements. We write S1 ≡ S2 to mean S1 is logically
equivalent to S2 . REMARK
Equivalent statements are enormously useful in proofs. Suppose you wish to prove S1 but
are having diﬃculty. If there is a simpler statement S2 and S1 ≡ S2 , then you can prove S2
instead. In proving S2 , you will have proved S1 as well. Example 3 Construct a single truth table for ¬(A ∨ B ) and (¬A) ∧ (¬B ). Are these statements logically
equivalent?
A B A ∨ B ¬(A ∨ B ) ¬A ¬B (¬A) ∧ (¬B )
TT
T
F
F
F
F
TF
T
F
F
T
F
FT
T
F
T
F
F
FF
F
T
T
T
T
Since the columns representing ¬(A ∨ B ) and (¬A) ∧ (¬B ) are identical,
we can conclude that ¬(A ∨ B ) ≡ (¬A) ∧ (¬B ).
The preceding example and your assignments demonstrate DeMorgan’s Laws. Proposition 1 (De Morgan’s Law’s (DML))
If A and B are statements, then
1. ¬(A ∨ B ) ≡ (¬A) ∧ (¬B )
2. ¬(A ∧ B ) ≡ (¬A) ∨ (¬B ) Section 3.3 Truth Tables to Evaluate Logical Expressions 25 REMARK
The next example shows the equivalence of A ⇐⇒ B and (A ⇒ B ) ∧ (B ⇒ A). This is
particularly important for proofs. Because A ⇐⇒ B is equivalent to (A ⇒ B ) ∧ (B ⇒ A),
to prove a statement of the form A ⇐⇒ B , we could prove
1. A ⇒ B and
2. B ⇒ A. Example 4 Show that A ⇐⇒ B is logically equivalent to (A ⇒ B ) ∧ (B ⇒ A).
A
T
T
F
F Exercise 1 B A ⇐⇒ B
T
T
F
F
T
F
F
T A ⇒ B B ⇒ A (A ⇒ B ) ∧ (B ⇒ A)
T
T
T
F
T
F
T
F
F
T
T
T Use truth tables to show that for statements A, B and C , the Associativity Laws hold.
That is
1. A ∨ (B ∨ C ) ≡ (A ∨ B ) ∨ C
2. A ∧ (B ∧ C ) ≡ (A ∧ B ) ∧ C Exercise 2 Use truth tables to show that for statements A, B and C , the Distributivity Laws hold.
That is
1. A ∧ (B ∨ C ) ≡ (A ∧ B ) ∨ (A ∧ C )
2. A ∨ (B ∧ C ) ≡ (A ∨ B ) ∧ (A ∨ C ) Exercise 3 What logical statement is equivalent to ¬(A ⇒ B )? Provide evidence in the form of a truth
table. Chapter 4 Introduction to Sets
4.1 Objectives The technique objectives are:
1. Deﬁne and gain experience with set, element, setbuilder notation, deﬁning property,
subset, superset, equality of sets, empty set, universal set, complement, cardinality,
union, intersection and diﬀerence.
2. Be able to read and use Venn diagrams. 4.2 Describing a Set Sets are foundational in mathematics and literally appear everywhere. Deﬁnition 4.2.1
Set, Element A set is a collection of objects. The objects that make up a set are called its elements (or
members). Sets can contain any type of objects. Since this is a math course, we frequently use sets of
numbers. But sets could contain letters, the letters of the alphabet for example, or books,
such as those in a library collection.
It is customary to use uppercase letters (A, B, C . . .) to represent sets and lowercase letters
(a, b, c, . . .) to represent elements. If a is an element of the set A, we write a ∈ A. If a is
not an element of the set A, we write a ∈ A.
Small sets can be explicitly listed. For example, the set of primes less than 10 is
{2, 3, 5, 7}
When explicitly listing sets, we use curly braces, {}, and separate elements with a comma.
Many sets are either too large to be listed (the set of all primes less than 10,000) or are
deﬁned by a rule. In these cases, we employ setbuilder notation which makes use of a
deﬁning property of the set. For example, the set of all real numbers between 1 and 2
inclusive could be written as
{x ∈ R  1 ≤ x ≤ 2}
26 Section 4.2 Describing a Set 27 The part of the description following the bar () is the deﬁning property of the set. Some
authors use a colon (:) instead of a bar and write
{x ∈ R : 1 ≤ x ≤ 2}
As when explicitly listing sets, we use curly braces, {}. We will give a more formal description of deﬁning property after we talk about quantiﬁers.
Some letters have become associated with speciﬁc sets.
natural numbers, 1, 2, 3, . . .
integers
rational numbers, { p  p, q ∈ Z, q = 0}
q
irrational numbers
real numbers
complex numbers {x + yi  x, y ∈ R} N
Z
Q
Q
R
C Example 1 (SetBuilder Notation)
1. The set of all even integers can be described as
{n ∈ Z : 2  n}
There is frequently more than one way of describing a set. Another way of describing
the set of even integers is
{2k  k ∈ Z}
2. The set of all real solutions to x2 + 4x − 2 = 0 can be described as
{x ∈ R  x2 + 4 x − 2 = 0 }
and, in general, the set of all solutions to f (x) = 0 can be described as
{x ∈ R  f (x) = 0}
3. The set of all positive divisors of 30 can be written as
{n ∈ N : n  30}
4. In calculus, you often use intervals of real numbers. The closed interval [a, b] is
deﬁned as the set
{x ∈ R  a ≤ x ≤ b} Deﬁnition 4.2.2
Subset A set A is called a subset of a set B , and is written A ⊆ B , if every element of A belongs
to B . Symbolically, we write
A ⊆ B means x ∈ A ⇒ x ∈ B
or equivalently
A ⊆ B means “For all x ∈ A, x ∈ B
We sometimes say that A is contained in B . 28 Chapter 4 Introduction to Sets Example 2
{1, 2, 3} ⊆ {1, 2, 3, 4} Deﬁnition 4.2.3
Proper Subset A set A is called a proper subset of a set B , and written A ⊂ B , if every element of A
belongs to B and there exists an element in B which does not belong to A. In the previous example, it is also the case that Example 3
{1, 2, 3} ⊂ {1, 2, 3, 4} Deﬁnition 4.2.4
Superset A set A is called a superset of a set B , and written A ⊇ B , if every element of B belongs
to A. A ⊇ B is equivalent to B ⊆ A. Example 4
{1, 2, 3, 4} ⊇ {1, 2, 3} Deﬁnition 4.2.5
Proper Subset As before, a set A is called a proper superset of a set B , and written A ⊃ B , if every
element of B belongs to A and there exists an element in A which does not belong to B . Example 5
{1, 2, 3, 4} ⊃ {1, 2, 3} Deﬁnition 4.2.6
Set Equality Deﬁnition 4.2.7
Empty Set Deﬁnition 4.2.8
Universal Set Saying that two sets A and B are equal, and writing A = B , means that A and B have
exactly the same elements. Equivalently, and the more usual way of showing A = B , is
to show mutual inclusion, that is, show A is contained in B and B is contained in A.
Symbolically, we write
A = B means A ⊆ B AND B ⊆ A There is a special set, called the empty set and denoted by ∅, which contains no elements.
The empty set is a subset of every set. When we discuss sets, we are often concerned with subsets of some implicit or speciﬁed set
U , called the universal set. In our work on divisibility and greatest common divisors, we
will be concerned with integers as the universal set, even when we don’t explicitly say so. Section 4.2 Describing a Set Deﬁnition 4.2.9
Set Complement 29 Relative to a universal set U , the complement of a subset A of U , written A, is the set of
all elements in U but not in A. Symbolically, we write
A = {x  x ∈ U AND x ∈ A} Deﬁnition 4.2.10 Lastly, the cardinality of a set A, written A, is the number of elements in the set. Cardinality Example 6 For example, if A = {1, 2, 3, 4}, then A = 4. Here’s a pair of mindblowing questions.
What is the cardinality of N? How much larger is Q than N? Example 7 Let S = {x ∈ R  x2 = 2} and T = {x ∈ Q  x2 = 2}.
1. Describe the set S by listing its elements. What is the cardinality of S ?
2. Describe the set T by listing its elements. What is the cardinality of T ?
3. List all of the subsets of S .
Solution:
√
√
1. S = { 2, − 2}. S  = 2.
2. T = ∅. T  = 0.
√
√
3. ∅, { 2}, {− 2}, S Example 8 Let the universal set for this question be U , the set of natural numbers less than twenty.
Let T be the set of integers divisible by three and F be the set of integers divisible by ﬁve.
1. Describe T by explicitly listing the set and by using setbuilder notation in at least
two ways.
2. Find a subset of T of cardinality three.
3. Find an element which belongs to both T and F .
4. Find an element which belongs to neither T nor F .
5. Explicitly list the set T .
Solution:
1. Explicitly listing the set gives T = {3, 6, 9, 12, 15, 18}. Two setbuilder descriptions of
the set are T = {n ∈ N : 3  n, n ≤ 20} and T = {3k  k ∈ N, 3k ≤ 20} 30 Chapter 4 Introduction to Sets 2. {3, 6, 9}. There are several choices possible.
3. 15. Notice that this is an element, not a set.
4. 1. There are several choices possible.
5. {1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19} 4.3
Deﬁnition 4.3.1
Union Set Operations The union of two set A and B , written A ∪ B , is the set of all elements belonging to either
set A or set B . Symbolically we write
A ∪ B = {x  x ∈ A OR x ∈ B } = {x  (x ∈ A) ∨ (x ∈ B )} Note that when we say “set A or set B ” we mean the mathematical use of or. That is, the
element can belong to A, B or both A and B . Deﬁnition 4.3.2
Intersection The intersection of two set A and B , written A ∩ B , is the set of all elements belonging
to both set A and set B . Symbolically we write
A ∩ B = {x  x ∈ A AND x ∈ B } = {x  (x ∈ A) ∧ (x ∈ B )} Deﬁnition 4.3.3
Diﬀerence The diﬀerence of two set A and B , written A − B (or A \ B ), is the set of all elements
belonging to A but not B . Symbolically we write
A − B = {x  x ∈ A AND x ∈ B } = {x  (x ∈ A) ∧ (x ∈ B )}
If U is the universal set and A ⊂ U then A = U − A. Example 9 Let the universal set for this question be U , the set of natural numbers less than or equal
to twelve. Let T be the set of integers divisible by three, F be the set of integers divisible
by ﬁve and P the set of primes. Determine each of the following.
1. T ∪ F
2. T ∩ F
3. P
4. P ∩ (T ∪ F )
5. T ∪ F Section 4.3 Set Operations 6. (T ∪ F ) − P
Solution:
1. T ∪ F = {3, 5, 6, 9, 10, 12}
2. T ∩ F = ∅
3. P = {1, 4, 6, 8, 9, 10, 12}
4. P ∩ (T ∪ F ) = {3, 5}
5. T ∪ F = {1, 2, 4, 5, 7, 8, 10, 11}
6. (T ∪ F ) − P = {6, 9, 10, 12} 31 32 Chapter 4 4.3.1 Introduction to Sets Venn Diagrams Venn diagrams can serve as useful illustrations of set relationships. In Figure 4.3.1 below,
the universal set is U = {a, b, c, d, e, w}, the set A = {a, b, c, d} and the set B = {d, e}.
The element d lies in the intersection of sets A and B . Since d is the only such element,
A ∩ B = {d}. The element w does not lie in either set A or B . w
A B b
d
a e c Figure 4.3.1: Venn Diagram Add schematic Venn diagrams for intersection, union, disjoint, subset, superset,
complement 4.4 Comparing Sets 4.4.1 Sets of Solutions One common use of sets is to describe values which are solutions to an equation, but care
in expression is required here. The following two sentences mean diﬀerent things.
1. Let a, b, c ∈ R, a = 0 and b2 − 4ac ≥ 0. The solutions to the quadratic equation
ax2 + bx + c = 0
are
x= −b ± √ b2 − 4ac
2a 2. Let a, b, c ∈ R, a = 0 and b2 − 4ac ≥ 0. Then
√
−b ± b2 − 4ac
x=
2a
are solutions to the quadratic equation
ax2 + bx + c = 0
The ﬁrst sentence asserts that a complete description of all solutions is given. The second
√
sentence only asserts that x = (−b ± b2 − 4ac)/2a are solutions, not that they are the
complete solution. In the language of sets, if S is the complete solution to ax2 + bx + c = 0,
√
and T = {(−b ± b2 − 4ac)/2a}, Sentence 1 asserts that S = T (which implies S ⊆ T and
T ⊆ S ) but Sentence 2 only asserts that T ⊆ S . Section 4.5 Comparing Sets 33 This point can be confusing. Statements about solutions are often implicitly divided into
two sets: the set S of all solutions and a set T of proposed solutions. One must be careful
to determine whether the statement is equivalent to S = T or T ⊆ S . Phrases like the
solution or complete solution or all solutions indicate S = T . Phrases like a solution or are
solutions indicate T ⊆ S .
Similar confusion arises when showing that sets have more than one representation. For
example, a circle centred at the origin O is often deﬁned geometrically as the set of points
equidistant from O. Others deﬁne a circle algebraically in the Cartesian plane as the set of
points satisfying x2 + y 2 = r2 . To show that the two deﬁnitions describe the same object,
one must show that the two sets of points are equal. 4.4.2 An Example Given a set S and a set T , there are two very frequent tasks one must perform: one must
show S ⊆ T or S = T . In fact, the second task is just two instances of the ﬁrst task: to
show S = T one must show S ⊆ T and T ⊆ S .
So, the important message here is that mathematicians must become skilled at demonstrating that S ⊆ T . The plan in all cases is the same: choose a generic element of S and show
that it belongs to T . Symbolically
S ⊆ T means x ∈ S ⇒ x ∈ T
or equivalently
S ⊆ T means For all x ∈ S, x ∈ T
The element chosen must be completely generic and could, if forced, be instantiated as any
element of the set S . Showing that a speciﬁc element of S belongs to T is inadequate. Example 10 Consider the statement:
Integer multiples of π are roots of f (x) = (x2 − 1) sin x.
1. Explicitly identify two sets used in this statement.
2. Are the two sets equal?
3. Is the statement true?
Solution:
1. Let S be the set of all roots of f (x) = (x2 − 1) sin x. (We could write S more
symbolically as S = {x ∈ R  f (x) = 0}.) Let T be the set of integer multiples of π .
(We could also write T more symbolically as T = {nπ  n ∈ Z}).
2. To show that S = T we must show T ⊆ S and S ⊆ T . Since sin(nπ ) = 0 for all
integers n, we know that f (nπ ) = 0. Now, the deﬁning property of S is that a real
number x belongs to S if f (x) = 0. Since f (nπ ) = 0, nπ ∈ S . This is equivalent to: if
nπ ∈ T then nπ ∈ S , or equivalently, T ⊆ S . Now consider x = 1. The value x = 1 is
a solution to (x2 − 1) sin x = 0 and so belongs to S , but it is not an integer multiple
of π , so it does not belong to T . That is, S ⊆ T and so the two sets are not equal.
3. The statement is true. The statement only claims that T ⊆ S , not S = T . 34 Chapter 4 4.5 Introduction to Sets Showing Two Sets Are Equal Let’s take a look at two proofs of the same statement about sets. The ﬁrst uses a chain of
if and only if statements, the second uses mutual inclusion. Proposition 1 Let A, B and C be arbitrary sets.
A ∪ (B ∩ C ) = (A ∪ B ) ∩ (A ∪ C ) Proof: This proof uses a chain of if and only if statements to show that both A ∪ (B ∩ C )
and (A ∪ B ) ∩ (A ∪ C ) have exactly the same elements. Let x ∈ A ∪ (B ∩ C ). Then
x ∈ A ∪ (B ∩ C )
⇐⇒ (x ∈ A) ∨ (x ∈ (B ∩ C )) deﬁnition of union ⇐⇒ (x ∈ A) ∨ ((x ∈ B ) ∧ (x ∈ C )) deﬁnition of intersection ⇐⇒ ((x ∈ A) ∨ (x ∈ B )) ∧ ((x ∈ A) ∨ (x ∈ C )) Distributive Law of logic ⇐⇒ (x ∈ A ∪ B ) ∧ (x ∈ A ∪ C )
⇐⇒ x ∈ ((A ∪ B ) ∩ (A ∪ C )) deﬁnition of union
deﬁnition of intersection Proof: This proof uses mutual inclusion. That is, we will show
1. A ∪ (B ∩ C ) ⊆ (A ∪ B ) ∩ (A ∪ C )
2. A ∪ (B ∩ C ) ⊇ (A ∪ B ) ∩ (A ∪ C )
Equivalently, we must show
1. If x ∈ A ∪ (B ∩ C ), then x ∈ (A ∪ B ) ∩ (A ∪ C ).
2. If x ∈ (A ∪ B ) ∩ (A ∪ C ), then x ∈ A ∪ (B ∩ C ).
Let x ∈ A ∪ (B ∩ C ). By the deﬁnition of union, x ∈ A or x ∈ (B ∩ C ). If x ∈ A, then by the
deﬁnition of union, x ∈ A ∪ B and x ∈ A ∪ C , that is x ∈ (A ∪ B ) ∩ (A ∪ C ). If x ∈ B ∩ C ,
then by the deﬁnition of intersection, x ∈ B and x ∈ C . But then by the deﬁnition of union,
x ∈ A ∪ B and x ∈ A ∪ C . Hence, by the deﬁnition of intersection, x ∈ (A ∪ B ) ∩ (A ∪ C ).
In both cases, x ∈ (A ∪ B ) ∩ (A ∪ C ) as required.
Let x ∈ (A ∪ B ) ∩ (A ∪ C ). By the deﬁnition of intersection, x ∈ A ∪ B and x ∈ A ∪ C . If
x ∈ A, then by the deﬁnition of union, x ∈ A ∪ (B ∩ C ). If x ∈ A, then by the deﬁnition of
union and the fact that x ∈ A ∪ B , x ∈ B . Similarly, x ∈ C . But then, by the deﬁnition
of intersection, x ∈ B ∩ C . By the deﬁnition of union, x ∈ A ∪ (B ∩ C ). In both cases,
x ∈ A ∪ (B ∩ C ). The ﬁrst of these two proofs also uses mutual inclusion. Do you see how? Section 4.5 Showing Two Sets Are Equal 35 REMARK
Which technique is better for proving the equality of two sets: a chain of if and only if
statements or mutual inclusion? Though some of the choice is personal style, the choice is
primarily determined by the “reversibility” of each step in the proof. A chain of if and only
if statements only works if each step in the chain is reversible. That’s pretty unusual. Most
of the time when you are proving two sets are equal, you will need to use mutual inclusion. Chapter 5 Discovering Proofs
5.1 Objectives The technique objectives are:
1. Discover a proof using the Direct Proof technique.
2. Write a proof.
3. Read a proof.
The content objectives are:
1. Prove the Divisibility of Integer Combinations.
2. Prove the Bounds By Divisibility.
3. State the Division Algorithm. 5.2 Discovering a Proof Discovering a proof of a statement is generally hard. There is no recipe for this, but there
are some tips that may be useful, and as we go on through the course, you will learn speciﬁc
techniques. Consider the following proposition. Proposition 1 (Divisibility of Integer Combinations (DIC))
Let a, b and c be integers.
If a  b and a  c, then a  (bx + cy ) for any integers x and y . The very ﬁrst thing to do is explicitly identify the hypothesis and the conclusion.
Hypothesis: a, b, c ∈ Z, a  b and a  c. x, y ∈ Z
Conclusion: a  (bx + cy )
36 Section 5.2 Discovering a Proof 37 Since we are proving a statement, not using a statement, we assume that the hypothesis
is true, and then demonstrate that the conclusion is true. This straightforward approach
is called Direct Proof. However, in actually discovering a proof we do not need to work
only forwards from hypothesis. We can work backwards from the conclusion and meet
somewhere in the middle. When writing the proof we must ensure that we begin with the
hypothesis and end with the conclusion.
Whether working forwards or backwards, I ﬁnd it best to proceed by asking questions.
When working backwards, I ask
What mathematical fact would allow me to deduce the conclusion?
For example, in the proposition under consideration I would ask
What mathematical fact would allow me to deduce that a  (bx + cy )?
The answer tells me what to look for or gives me another statement I can work backwards
from. In this case the answer would be
1. If there exists an integer k so that bx + cy = ak , then a  (bx + cy ).
Note that the answer makes use of the deﬁnition of divides. Now I could ask the question
How can I ﬁnd such a k ?
The answer is not obvious so let’s turn to working forwards from the hypothesis. In this
case my standard two questions are
Have I seen something like this before?
What mathematical fact can I deduce from what I already know?
I have seen a  b in an hypothesis before, in the proof of the Transitivity of Divisibility. I
can use the deﬁnition of divisibility to assert that
2. There exists an integer r such that b = ra.
I also know that a  c so I can again use the deﬁnition of divisibility to assert that
3. There exists an integer s such that c = sa.
Hmmm, what now? Let’s look again at Sentence 1.
1. If there exists an integer k so that bx + cy = ak , then a  (bx + cy ). 38 Chapter 5 Discovering Proofs There is a bx + cy in Sentence 1 and an algebraic expression for b and c in Sentences 2 and
3. Substituting gives
bx + cy = (ra)x + (sa)y
and factoring out the a gives
bx + cy = (ra)x + (sa)y = a(rx + sy )
If we let k = rx + sy then k is an integer, since adding integers gives integers and multiplying
integers gives integers, and so there exists an integer k so that bx + cy = ak . Hence,
a  (bx + cy ).
We are done. Almost. We have discovered a proof but this is rough work. We must now
write a formal proof. Just like any other writing, the amount of detail needed in expressing
your thoughts depends upon the audience. A proof of a statement targeted at an audience
of professional specialists in algebra will not look the same as a proof targeted at a high
school audience. When you approach a proof, you should ﬁrst make a judgement about the
audience. I suggest that you write for your peers. That is, you write your proof so that you
could hand it to a classmate and expect that they would understand the proof.
Proof: Since a  b, there exists an integer r such that b = ra. Since a  c, there exists an
integer s such that c = sa. Let x and y be any integers. Now bx + cy = (ra)x + (sa)y =
a(rx + sy ). Since rx + sy is an integer, it follows from the deﬁnition of divisibility that
a  (bx + cy ).
Note that this proof does not reﬂect the discovery process, and it is a Direct Proof. It
begins with the hypothesis and ends with the conclusion. 5.3 Reading A Proof Here is another proposition and proof. Proposition 2 (Bounds By Divisibility (BBD))
Let a and b be integers. If a  b and b = 0 then a ≤ b. Proof: Since a  b, there exists an integer q so that b = qa. Since b = 0, q = 0. But if
q = 0, q  ≥ 1. Hence, b = qa = q a ≥ a.
Let’s analyze this proof. First, we will rewrite the proof line by line.
Proof: (For reference purposes, each sentence of the proof is written on a separate line.)
1. Since a  b, there exists an integer q so that b = qa.
2. Since b = 0, q = 0.
3. But if q = 0, q  ≥ 1.
4. Hence, b = qa = q a ≥ a. Section 5.4 The Division Algorithm 39 Now the analysis.
Analysis of Proof As usual, we begin by explicitly identifying the hypothesis and the
conclusion.
Hypothesis: a and b are integers. a  b and b = 0.
Conclusion: a ≤ b.
Core Proof Technique: Direct Proof.
Preliminary Material: The deﬁnition of divides.
Now we justify every sentence in the proof.
Sentence 1 Since a  b, there exists an integer q so that b = qa.
In this sentence, the author of the proof uses the hypothesis a  b and the deﬁnition
of divides.
Sentence 2 Since b = 0, q = 0.
If q were zero, then b = qa would imply that b is zero. Since b is not zero, q cannot
be zero.
Sentence 3 But if q = 0, q  ≥ 1.
Since q is an integer from Sentence 1, and q is not zero from Sentence 2, q ≥ 1 or
q ≤ −1. In either case, q  ≥ 1.
Sentence 4 Hence, b = qa = q a ≥ a.
Sentence 1 tells us that b = qa. Taking the absolute value of both sides gives b = qa
and using the properties of absolute values we get qa = q a. From Sentence 3,
q  ≥ 1 so q a ≥ a. Exercise 1 Prove the following statement. Let a, b, c and d be integers.
If a  c and b  d, then ab  cd. Exercise 2 Prove the following statement. Let x be an integer. If 2  (x2 − 1), then 4  (x2 − 1). 5.4 The Division Algorithm As you have known since grade school, not all integers are divided evenly by other integers.
There is usually a remainder. We record this as the Division Algorithm. Proposition 3 (Division Algorithm (DA))
If a and b are integers, and b > 0, then there exist unique integers q and r such that
a = qb + r where 0 ≤ r < b. 40 Chapter 5 Discovering Proofs We will not prove this statement now. You will see a proof of the uniqueness part later
on and a complete proof is available in the appendix. Add to appendix. Let’s see some
examples before a few remarks. Example 1
a=q×b+r
20 = 2 × 7 + 6
21 = 3 × 7 + 0
−20 = −3 × 7 + 1 REMARK
• The integer q is called the quotient.
• The integer r is called the remainder.
• The integer r is always strictly less than b.
• The integer r is always positive or zero.
• Observe that b  a if and only if the remainder is 0.
• Though the proposition is commonly known as the Division Algorithm, it is not really
an algorithm since it doesn’t provide a ﬁnite sequence of steps that will construct q
and r. It turns out that the Division Algorithm is remarkably useful. To see how, we must ﬁrst
deﬁne the greatest common divisor which we do soon. Chapter 6 Quantiﬁers
6.1 Objectives The technique objectives are:
1. Learn the basic structure of quantiﬁers.
2. Use the Object, Construct and Select Methods. 6.2 Quantiﬁers Not all mathematical statements are obviously in the form “If A, then B ”. You will encounter statements of the form there is, there are, there exists or for all, for each, for every,
for any. The ﬁrst three are all examples of the existential quantiﬁer there is and the
ﬁnal four are all examples of the universal quantiﬁer for all. The word existence is used
to make it clear that we are looking for or looking at a particular mathematical object. The
word universal is used to make it clear that we are looking for or looking at a set of objects
all of which share some desired behaviour. REMARK
All statements which use quantiﬁers look basically like one of the following two open sentences, though some elements of the sentence may be implicit or appear in a diﬀerent order.
There exists an x in the set S such that P (x) is true.
For every x in the set S , P (x) is true.
where P (x) is an open sentence that uses the variable x.
Some mathematicians prefer a more symbolic approach. The symbol ∃ stands for the
English expression “there exists”. The symbol ∀ stands for the English expression “for all”.
Symbolically, the two quantiﬁed sentences above are written as:
∃x ∈ S, P (x)
∀x ∈ S, P (x) 41 42 Chapter 6 Quantiﬁers REMARK
All statements which use quantiﬁers share a basic structure.
1. a quantiﬁer which will be either an existential or universal quantiﬁer,
2. a variable which can be any mathematical object,
3. a set which is the domain of the variable, often implicit, and
4. an open sentence which involves the variable,
It is crucial that you be able to identify the four parts in the structure of quantiﬁed statements. Here are some examples. Let’s begin with something we have already seen. Example 1
1. There exists an integer k so that n = km
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
k
Z
n = km Our next example could come from any of several branches of mathematics.
2. There exists a real number x such that f (x) = 0.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
x
R
f (x) = 0 This is a good point to illustrate the inﬂuence of the domain. Suppose in this example
we are interested in the speciﬁc function f (x) = x2 − 2. Then the statement
There exists a real number x such that x2 − 2 = 0.
is true since we can ﬁnd an x, √ 2, so that x2 − 2 = 0. But if we change the domain to integers, the statement
There exists an integer x such that x2 − 2 = 0.
√
√
is false because neither of the two real roots, 2 or − 2 are integers. So changing
the domain can change the truth value of the statement. In practice, the domain is
often not explicitly stated and is inferred from context. Section 6.2 Quantiﬁers 43 3. For every integer n > 5, 2n > n2 .
Quantiﬁer:
Variable:
Domain:
Open sentence: ∀
n
Z, n > 5
2n > n2 The sentence might appear as “2n > n2 for all integers n > 5”. The order is diﬀerent
but the meaning is the same.
4. There exists an angle θ such that sin(θ) = 1.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
an angle θ
R, inferred from the context
sin(θ) = 1 Note that in this example, the domain is implicit. Note also that there can be many
objects, many angles θ, which satisfy the statement.
5. For every angle θ, sin2 (θ) + cos2 (θ) = 1.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∀
θ
R, inferred from context
sin2 (θ) + cos2 (θ) = 1 6. If f is continuous on [a, b] and diﬀerentiable on (a, b) and f (a) = f (b), then there
exists a real number c ∈ (a, b) such that f (c) = 0.
This conclusion of this implication uses an existential quantiﬁer. The hypothesis and
the conclusion are:
Hypothesis: f is continuous on [a, b] and diﬀerentiable on (a, b) and f (a) = f (b).
Conclusion: There exists a real number c ∈ (a, b) such that f (c) = 0.
For the conclusion, the parts of the quantiﬁed statement are given below.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
c
(a, b) R
f (c) = 0 It takes practice to become ﬂuent in reading and writing statements that use quantiﬁers. 44 Chapter 6 6.3 Quantiﬁers The Object Method REMARK
We use the Object Method when an existential quantiﬁer occurs in the hypothesis. Suppose
that we must prove “A implies B ” and A uses an existential quantiﬁer. That is, A looks
like
There exists an x in the set S such that P (x) is true.
We proceed exactly as the English language interpretation would suggest  we assume that
the object x exists. We should:
1. Identify the four parts of the quantiﬁed statement.
2. Assume that a mathematical object x exists within the set S so that the statement
P (x) is true.
3. Make use of this information to generate another statement. For example, let’s look at the proof of the Transitivity of Divisibility again. Proposition 1 (Transitivity of Divisibility (TD))
Let a, b and c be integers. If a  b and b  c, then a  c. Proof: Since a  b, there exists an integer r so that ra = b. Since b  c, there exists an
integer s so that sb = c. Substituting ra for b in the previous equation, we get (sr)a = c.
Since sr is an integer, a  c.
You might ﬁrst ask “Where is the existential quantiﬁer?”. It isn’t obvious – yet. But recall
the deﬁnition of divisibility.
An integer m divides an integer n, and we write m  n, if there exists an integer
k so that n = km.
The sentence “there exists an integer k so that n = km” uses the existential quantiﬁer. It
is very common in mathematics that sentences contain implicit quantiﬁers and you should
be alert for them. Returning to divisibility, we have already identiﬁed the four parts of the
quantiﬁed sentence.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
k
Z
n = km Section 6.4 The Construct Method 45 How would the Object Method work? Consider the statement a  b. It uses an implicit
existential quantiﬁer. Since a  b occurs in the hypothesis, we assume the existence of an
integer, say r, so that ra = b. And if you return to examine our proof of Transitivity of
Divisibility, this is precisely what appears in the ﬁrst sentence of the proof. Similarly, the
Object Method can be used with b  c to assert that there exists an integer s so that sb = c.
Together, the ﬁrst two sentences allow us to derive the third sentence. 6.4 The Construct Method REMARK
We use the Construct Method when an existential quantiﬁer occurs in the conclusion.
Suppose that we must prove “A implies B ” and B uses an existential quantiﬁer. That is,
B looks like
There exists an x in the set S such that P (x) is true.
We proceed exactly as the English language interpretation would suggest  we show that
the object x exists, that x is in the set S , and that P (x) is true. We should:
1. Identify the four parts of the quantiﬁed statement.
2. Construct a mathematical object x.
3. Show that x ∈ S .
4. Show that P (x) is true. For example, let us discover a proof of the following proposition. Proposition 2 If n is of the form 4 + 1 for some positive integer , then 8  (n2 − 1). As usual, let us begin by explicitly identifying the hypothesis, the conclusion and the core
proof technique.
Hypothesis: n is of the form 4 + 1 for some integer .
Conclusion: 8  (n2 − 1).
Core Proof Technique: Since the deﬁnition of divisibility contains an existential quantiﬁer, and 8  (n2 − 1) occurs in the conclusion, we will use the Construct Method.
What, precisely should we construct? Again, thinking of the deﬁnition of divisibility and
the requirement of the Construct Method, we should construct a k and then show that k is
an integer and that 8k = n2 − 1. Where is this k going to come from? Let’s start with the 46 Chapter 6 Quantiﬁers hypothesis, n is of the form 4 + 1 for some integer . Substituting n = 4 + 1 into n2 − 1
gives
n2 − 1 = (4 + 1)2 − 1 = 16 2 + 8 + 1 − 1 = 16 2 + 8 = 8(2 2 + )
It seems that a suitable choice for k would be 2 2 + . Since is an integer and the product
of integers is an integer and the sum of integers is an integer, k is an integer. It is also clear
from the equation above that 8k = n2 − 1.
A proof might look like the following.
Proof: Substituting n = 4 + 1 into n2 − 1 gives
n2 − 1 = (4 + 1)2 − 1 = 16
Since 2 2 2 + 8 + 1 − 1 = 16 2 + 8 = 8(2 2 +) + is an integer, 8  (n2 − 1). Note that the proof does not explicitly name the Construct Method. Exercise 1 Where was the Construct Method used in the proof of the Transitivity of Divisibility? 6.5 The Select Method REMARK
We use the Select Method whenever a universal quantiﬁer occurs. Suppose a statement
looks like
For every x in the set S , P (x) is true.
Observe that this statement is equivalent to
If x is in the set S , then P (x) is true.
We proceed exactly as the English language interpretation would suggest  we show that
whenever an object x in the set S exists, P (x) is true. We should:
1. Identify the four parts of the quantiﬁed statement.
2. Select a representative mathematical object x ∈ S . This cannot be a speciﬁc object.
It has to be a placeholder so that our argument would work for any speciﬁc member
of S . Note that if the the set S is empty, we proceed no further. The statement is
vacuously true.
3. Show that P (x) is true. For example, let us discover a proof of the following proposition. Section 6.7 Sets and Quantiﬁers Proposition 3 47 For every odd integer n, 4  (n2 + 4n + 3).
Let’s begin by identifying the four parts of the quantiﬁed statement.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∀
n
odd integers
4  (n2 + 4n + 3) Now we select a representative mathematical object from the set. Let’s call the odd integer
that we selected n0 . We could certainly call it n. I am using n0 to emphasize that we have
selected a representative element. Now we must show that 4  (n2 + 4n0 + 3). Since n0 is
0
odd, we can write it as n0 = 2m + 1 for some integer m. Substituting into n2 + 4n0 + 3
0
gives
n2 + 4n0 + 3 = 4m2 + 4m + 1 + 8m + 4 + 3 = 4m2 + 12m + 8 = 4(m2 + 3m + 2)
0
which implies 4  (n2 + 4n0 + 3).
0
A proof might look like the following.
Proof: Let n0 be a positive, odd integer. We can write n0 as 2m + 1 for some integer m.
Substituting n0 = 2m + 1 into n2 + 4n0 + 3 gives
0
n2 + 4n0 + 3 = 4m2 + 4m + 1 + 8m + 4 + 3 = 4m2 + 12m + 8 = 4(m2 + 3m + 2)
0
Since m2 + 3m + 2 is an integer, 4  (n2 + 4n0 + 3).
0
The same proof would work if we converted the universal statement into an “If ... then ”
form. The equivalent statement would be Proposition 4 If n is a positive, odd integer, then 4  (n2 + 4n + 3). 6.6 Sets and Quantiﬁers It is important to emphasize the connection between sets and quantiﬁers. The basic structures of all quantiﬁed statements use sets.
There exists an x in the set S such that P (x) is true.
For every x in the set S , P (x) is true.
To correctly prove or use quantiﬁed statements, ﬁrst correctly identify the set being used.
Quantiﬁers frequently appear in the deﬁning property of a set. For example, the set of even
integers
{n ∈ Z : 2  n}
uses an implicit existential quantiﬁer in the deﬁnition of divides.
To show that S ⊆ T , we use the universally quantiﬁed statement
∀x ∈ S, x ∈ T
Sets and quantiﬁers are very closely linked. 48 Chapter 6 6.7 Quantiﬁers A NonProof Making mistakes is easy. Let’s take a look at a “proof” which is not a proof. Let’s ﬁnd out
why it fails. Proposition 5 1 If r is a positive real number with r = 1, then there is an integer n such that 2 n < r. Proof: (For reference purposes, each sentence of the proof is written on a separate line.)
1. Let n be any integer with n >
2. It then follows that 1
.
log2 (r) 1
< log2 (r).
n 1 3. Hence 2 n < 2log2 (r) = r. Analysis of Proof An interpretation of sentences 1 through 3 follows.
Sentence 1 Let n be any integer with n > 1/ log2 (r).
Since an existential quantiﬁer occurs in the conclusion, the author is using the Construct Method. The four parts of the quantiﬁer are:
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
n
Z
1
2n < r In the ﬁrst sentence of the proof, the author constructs an integer n. Later in the
proof, the author intends to show that n satisﬁes the open sentence of the quantiﬁer.
Since r is a real number (not equal to 1), 1/ log2 (r) evaluates to a real number and
we can certainly ﬁnd an integer greater than any given real number.
Sentence 2 It then follows that 1
n < log2 (r). Here the author takes the reciprocal of n > 1/ log2 (r).
1 Sentence 3 Hence 2 n < 2log2 (r) = r.
1
Use the left and right sides of n < log2 (r) as exponents of 2 and recall that the
x always increases as x increases.
function 2 Even the analysis looks good. What went wrong? Let’s look again at Sentence 2. Here we
used the statement Statement 6 If a, b ∈ R, neither equal to 0, and a < b, then 1/b < 1/a. Section 6.7 A NonProof 49 A proof seems pretty straightforward – divide both sides of a < b by ab. Except that
1
1
the statement is false. Consider the case a = −2 and b = 4. −2 < 4 but 4
−2 . Our
proposition really should be Statement 7 If a, b ∈ R, and 0 < a < b, then 1/b < 1/a. Now we can ﬁnd the problem in our proof. Choose r so that 0 < r < 1, say r = 1/2. That
will make log2 (r) negative and hence 1/ log2 (r) negative. Choose n = 1. Now Sentence 1 is
satisﬁed but Sentence 2 fails.
Can you think of any way to correct the proposition or the proof? Chapter 7 Nested Quantiﬁers
7.1 Objectives The technique objectives are:
1. Recognize nested quantiﬁers.
2. Learn how to parse nested quantiﬁers.
3. Learn which techniques to apply to a sentence containing nested quantiﬁers. 7.2
7.2.1 Onto or Surjective
Deﬁnition We begin with the deﬁnition of an onto function. Deﬁnition 7.2.1
Onto, Surjective Let S and T be two sets. A function f : S → T is onto (or surjective) if and only if for
every y ∈ T there exists an x ∈ S so that f (x) = y . Often S and T are equal to R or are subsets of R.
Though you may not understand the deﬁnition, the important observation is that the
deﬁnition contains two quantiﬁers. Let’s carefully parse the deﬁnition beginning with the
universal quantiﬁer “For every”. Recall that we must identify the quantiﬁer, variable,
domain and open sentence.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∀
y
T
there exists an x ∈ S so that f (x) = y The open sentence itself contains a quantiﬁer! So we must again identify the four parts of
this quantiﬁer.
50 Section 7.2 Onto or Surjective
Quantiﬁer:
Variable:
Domain:
Open sentence: 51
∃
x
S
f (x) = y REMARK
Because the existential quantiﬁer is “nested” within the universal quantiﬁer, this deﬁnition
is an example of nested quantiﬁers. There are really two basic principles for working
with nested quantiﬁers.
1. Process quantiﬁers from left to right. (This captures the “nested” structure.)
2. Use Object, Construct and Select methods as you proceed from left to right.
Moving from left to right is important. The order of quantiﬁers matters. For example, consider the following statement about the integers.
∀x ∃y, y > x
Translated into prose, this statement can be read as “Given any integer x, there exists a
larger integer y .” This is a true statement. Now let’s make a small modiﬁcation. We will
just change the order of the quantiﬁers. Our new statement is
∃y ∀x, y > x
A translation for this statement would be “There exists an integer y which is larger than
all integers.” A very diﬀerent, and false, statement.
We should be able to determine the structure of any proof that a function is onto. Let’s
keep the deﬁnition in mind.
Let S and T be two sets. A function f : S → T is onto (or surjective) if and
only if for every y ∈ T there exists an x ∈ S so that f (x) = y .
The order of quantiﬁers is
For all there exists so we would expect the proof to be structured
Select Method Construct Method The Construct Method identiﬁes a mathematical object, shows that the object is within
the domain, and that the object satisﬁes the open sentence. So an onto proof will look like
this. 52 Chapter 7 Nested Quantiﬁers Structure of an “Onto” Proof
• Let y ∈ T . (This comes from the Select Method.)
• Consider the object x. (This comes from the Construct Method.)
• First, we show that x ∈ S . (We show that the constructed object is within the
domain.)
• Now we show that f (x) = y . (We show that the open sentence is satisﬁed.) 7.2.2 Reading Let’s work through an example. Notice how closely the proof follows the structure of an
onto proof. Proposition 1 Let m = 0 and b be ﬁxed real numbers. The function f : R → R deﬁned by f (x) = mx + b
is onto. Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Let y ∈ R.
2. Consider x = (y − b)/m.
3. Since y ∈ R, x ∈ R.
4. But then f (x) = f ((y − b)/m) = m((y − b)/m) + b = y as needed. Let’s perform an analysis of this proof.
Analysis of Proof The deﬁnition of onto uses a nested quantiﬁer.
Hypothesis: m = 0 and b are ﬁxed real numbers. f (x) = mx + b.
Conclusion: f (x) is onto.
Core Proof Technique: Nested quantiﬁers.
Preliminary Material: Let us remind ourselves of the deﬁnition of the deﬁning
property of onto as it applies in this situation.
For every y ∈ R there exists x ∈ R so that f (x) = y .
Sentence 1 Let y ∈ R.
The ﬁrst quantiﬁer in the deﬁnition is a universal quantiﬁer so the author uses the
Select Method. That is, the author chooses an element (y ) in the domain (R). The
author must now show that the open sentence is satisﬁed (there exists an x ∈ R so
that f (x) = y ). The constructed object in this example is not surprising  we can
simply solve for x in y = mx + b. In general, though, it can be diﬃcult to construct a
suitable object. Note also that the choice of x depends on y so that it is not surprising
that x is a function of y . Section 7.2 Onto or Surjective 53 Sentence 2 Consider x = (y − b)/m.
The second quantiﬁer in the deﬁnition is a nested existential quantiﬁer so the author
uses the Construction Method. That is, the author constructs an element (x).
Sentence 3 Since y ∈ R, x ∈ R.
Because this step is usually straightforward, it is often omitted. It is included here to
emphasize that the constructed object lies in the appropriate domain.
Sentence 4 But then f (x) = f ((y − b)/m) = m((y − b)/m) + b = y as needed.
Here the author conﬁrms that the open sentence is satisﬁed. 7.2.3 Discovering Having read a proof, let’s discover one. Proposition 2 Let f : T → U and g : S → T be onto functions. Then f ◦ g is an onto function. Analysis of Proof The deﬁnition of onto uses nested quantiﬁers.
Hypothesis: f : T → U and g : S → T are both onto functions.
Conclusion: f ◦ g is onto.
Core Proof Technique: Nested quantiﬁers.
Preliminary Material: Let us recast the deﬁnition of onto for f ◦ g . To do this we
need to be cognizant of the fact that f : T → U and g : S → T and f ◦ g : S → U .
So the statement we need to prove is:
For every y ∈ U there exists x ∈ S so that f (g (x)) = y .
There are three instances of onto in the proposition. Two occur in the hypothesis and are
associated with the functions f and g . The third occurs in the conclusion and is associated
with the function f ◦ g . That is the one that interests us right now. The deﬁnition of onto
begins with a universal qualiﬁer. So we will use the Select Method applied to f ◦ g . Using
our proof template we have the following.
Proof in Progress
1. Let y ∈ U .
2. Consider the object x. We must construct the object x.
3. First, we show that x ∈ S . To be completed.
4. Now we show that f (g (x)) = y . To be completed.
Constructing x seems diﬃcult. We do not know what the sets S , T and U are and we have
no idea what the functions f and g look like. But we have not made use of our hypotheses
at all so let’s see if they can give us any ideas.
Since f : T → U is onto, we know that for any u ∈ U , there exists a t ∈ T so that f (t) = u. 54 Chapter 7 Nested Quantiﬁers Since g : S → T is onto, we know that for any t ∈ T , there exists an s ∈ S so that g (s) = t.
How does y ﬁt in? Observe that y ∈ U . But f : T → U and is onto, so there exists a
t ∈ T so that f (t ) = y . Since t ∈ T and g : S → T is onto, there exists an s ∈ S so that
g (s ) = t .
But what have we constructed? If we let x = s then we have an element that maps from
S to T and then from T to U for which f (g (s )) = y . Let’s record these.
Proof in Progress
1. Let y ∈ U .
2. Since f : T → U is onto, there exists a t ∈ T so that f (t ) = y .
3. Since t ∈ T and g : S → T is onto, there exists an s ∈ S so that g (s ) = t .
4. Hence, there exists s ∈ S so that f (g (s )) = f (t ) = y .
5. Hence, there exists x ∈ S so that f (g (x)) = y .
Notice that our last two lines are essentially duplicates. When doing rough work, this
is common. However, when writing up a proof, such duplications should be removed,
consistent notation should be enforced and omitted steps should be included. In this case,
the proof is almost done for us.
Proof: Let y in U . Since f : T → U is onto, there exists a t ∈ T so that f (t ) = y . Since
t ∈ T and g : S → T is onto, there exists an s ∈ S so that g (s ) = t . Hence, there exists
s ∈ S so that f (g (s )) = f (t ) = y . 7.3
7.3.1 Onetoone or Injective
Deﬁnition The deﬁnition of onto functions contained nested quantiﬁers which were diﬀerent. The next
deﬁnition uses nested quantiﬁers which are the same. Deﬁnition 7.3.1
Onetoone,
Injective Let S and T be two sets. A function f : S → T is onetoone (or injective) if and only if
for every x1 ∈ S and every x2 ∈ S , f (x1 ) = f (x2 ) implies that x1 = x2 . Just as with onto functions, let’s parse the deﬁnition beginning with the universal quantiﬁer “For every”. Recall that we must identify the quantiﬁer, variable, domain and open
sentence.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∀
x1
S
for every x2 ∈ S , f (x1 ) = f (x2 ) implies that x1 = x2 The open sentence itself contains a quantiﬁer! So we must again identify the four parts of
this quantiﬁer. Section 7.3 Onetoone or Injective
Quantiﬁer:
Variable:
Domain:
Open sentence: 55
∀
x2
S
f (x1 ) = f (x2 ) implies that x1 = x2 It is important to note that the open sentence is an implication!
We should be able to determine the structure of any proof that a function is onetoone.
The order of quantiﬁers is
For all For all so we would expect the proof to be structured
Select Method Select Method The Select Method selects a representative mathematical object within the appropriate
domain, and shows that the object satisﬁes the corresponding open sentence. So a onetoone proof will look like this.
Structure of a “Onetoone” Proof
• Let x1 ∈ S . (This comes from the Select Method.)
• Let x2 ∈ S . (This comes from the Select Method.)
• Suppose that f (x1 ) = f (x2 ). (This is the hypothesis of the open sentence. Since we
wish to show that the open sentence is true, we assume the hypothesis is true.)
• Now we show that x1 = x2 . (This is the conclusion of the open sentence. Since we
wish to show that the open sentence is true, we must show the conclusion is true.) 7.3.2 Reading Let’s work through an example. Notice how closely the proof follows the structure of a
onetoone proof. Proposition 3 Let m = 0 and b be ﬁxed real numbers. The function f : R → R deﬁned by f (x) = mx + b
is onetoone. Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Let x1 , x2 ∈ S .
2. Suppose that f (x1 ) = f (x2 ).
3. Now we show that x1 = x2 .
4. Since f (x1 ) = f (x2 ), mx1 + b = mx2 + b.
5. Subtracting b from both sides and dividing by m gives x1 = x2 as required. 56 Chapter 7 Nested Quantiﬁers Let’s perform an analysis of this proof.
Analysis of Proof The deﬁnition of onto uses a nested quantiﬁer.
Hypothesis: m = 0 and b are ﬁxed real numbers. f (x) = mx + b.
Conclusion: f (x) is onetoone.
Core Proof Technique: Nested quantiﬁers.
Preliminary Material: Let us remind ourselves of the deﬁnition of the deﬁning
property of onetoone as it applies in this situation.
For every x1 ∈ R and every x2 ∈ R, f (x1 ) = f (x2 ) implies that x1 = x2 .
Sentence 1 Let x1 , x2 ∈ R.
The author combines the ﬁrst two sentences of the structure of a onetoone proof into
a single sentence. This works because both of the ﬁrst two quantiﬁers in the deﬁnition
are universal quantiﬁers and so the author uses the Select Method twice. That is, the
author chooses elements (x1 andx2 ) in the domain (R). The author must now show
that the open sentence is satisﬁed (f (x1 ) = f (x2 ) implies that x1 = x2 ).
Sentences 2 and 3 Suppose that f (x1 ) = f (x2 ). Now we show that x1 = x2 .
The open sentence that must be veriﬁed is an implication, and f (x1 ) = f (x2 ) is the
hypothesis. To prove an implication, we assume the hypothesis and demonstrate that
the conclusion, x1 = x2 , is true.
Sentence 3 Since f (x1 ) = f (x2 ), mx1 + b = mx2 + b.
This is just substitution.
Sentence 4 Subtracting b from both sides and dividing by m gives x1 = x2 as required.
Here the author conﬁrms that the open sentence is satisﬁed. 7.3.3 Discovering Having read a proof, let’s discover one. Proposition 4 Let f : T → U and g : S → T be onetoone functions. Then f ◦ g is a onetoone function. Analysis of Proof The deﬁnition of onetoone uses nested quantiﬁers.
Hypothesis: f : T → U and g : S → T are both onetoone functions.
Conclusion: f ◦ g is onetoone.
Core Proof Technique: Nested quantiﬁers.
Preliminary Material: Let us recast the deﬁnition of onetoone for f ◦ g .
For every x1 ∈ S and every x2 ∈ S , (f ◦ g )(x1 ) = (f ◦ g )(x2 ) implies that
x1 = x2 . Section 7.4 Limits 57
There are three instances of onetoone in the proposition. Two occur in the hypothesis
and are associated with the functions f and g . The third occurs in the conclusion and is
associated with the function f ◦ g . Let’s use the structure of a onetoone proof as our
starting point.
Proof in Progress
1. Let x1 , x2 ∈ S .
2. Suppose that (f ◦ g )(x1 ) = (f ◦ g )(x2 ).
3. Now we show that x1 = x2 .
4. To be completed.
5. Hence, x1 = x2 as required.
Since f and g are not speciﬁed, this may seem impossible. But let’s “follow our nose” and
see what happens. Since (f ◦ g )(x1 ) = (f ◦ g )(x2 ), we know that f (g (x1 )) = f (g (x2 )).
But since f is onetoone, we know that g (x1 ) = g (x2 ). If this seems confusing, since f is
onetoone, f (y1 ) = f (y2 ) implies y1 = y2 . In this case, y1 = g (x1 ) and y1 = g (x1 ). Now
back to g (x1 ) = g (x2 ). Since g is onetoone, we know that x1 = x2 , which is exactly what
we needed to show.
A proof might look like the following.
Proof: Let x1 , x2 ∈ S . Suppose that (f ◦ g )(x1 ) = (f ◦ g )(x2 ). Since (f ◦ g )(x1 ) = (f ◦ g )(x2 ),
we know that f (g (x1 )) = f (g (x2 )). Since f is onetoone, we know that g (x1 ) = g (x2 ). And
since g is onetoone, x1 = x2 as required. 7.4
7.4.1 Limits
Deﬁnition Almost everyone who takes a calculus course encounters the notion of a limit. When we
write
lim f (x) = L
x→a we informally mean that we can make the values of f (x) arbitrarily close to L by taking
x suﬃciently close to, but not equal to a. But formally we need to be more explicit about
what “arbitrarily” and “suﬃciently” mean. That leads to the infamous ε − δ deﬁnition of
a limit. Deﬁnition 7.4.1
Limit The limit of f (x), as x approaches a, equals L means that for every real number ε > 0
there exists a real number δ > 0 such that
0 < x − a < δ ⇒ f (x) − L < ε Let’s carefully parse the deﬁnition beginning with the universal quantiﬁer “For every”.
Recall that we must identify the quantiﬁer, variable, domain and open sentence. 58 Chapter 7
Quantiﬁer:
Variable:
Domain:
Open sentence: Nested Quantiﬁers ∀
ε
real numbers > 0
there exists a real number δ > 0 such that
0 < x − a < δ ⇒ f (x) − L < ε The open sentence itself contains a quantiﬁer, so we must again identify the four parts of
the quantiﬁer.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
δ
real numbers > 0
0 < x − a < δ ⇒ f (x) − L < ε It is vitally important to observe that the open sentence is an implication.
Because the existential quantiﬁer is “nested” within the universal quantiﬁer, this deﬁnition
is another example of nested quantiﬁers. 7.4.2 Reading A Limit Proof Before we begin our example, we should be able to determine the structure of any limit
proof. The order of quantiﬁers is
For all ε there exists δ so we would expect the proof to be structured
Select Method Construct Method The choice of δ will depend on the choice of ε and so δ will be a function of ε. The Construct
Method identiﬁes a mathematical object, shows that the object is within the domain, and
that the object satisﬁes the open sentence. The open sentence is an implication with
hypothesis 0 < x − a < δ (ε) and conclusion f (x) − L < ε. We assume that the hypothesis
is true and show that the conclusion is true. So a limit proof will look like the following.
Structure of a “Limit” Proof
• Let ε > 0 be a real number. (This comes from the Select Method.)
• Consider the real number δ (ε). (This comes from the Construct Method.)
• First, we show that δ (ε) > 0. (This shows δ is within the domain.)
• Now let 0 < x − a < δ (ε). (This is the hypothesis of the open sentence in the
deﬁnition of limit.)
• We show that f (x) − L < ε. (This is the conclusion of the open sentence.)
The diﬃculty lies in ﬁnding a suitable choice of δ (ε). Let’s analyze a proof where someone
else has made the choice of δ (ε) for us. Section 7.4 Limits Proposition 5 59 Let m = 0 be a real number.
lim mx + b = ma + b x→a Proof: (For reference purposes, each sentence of the proof is written on a separate line.)
1. Let ε > 0 be a real number.
2. Consider the real number δ (ε) =
3. Since ε > 0 and m > 0, δ (ε) = ε
.
m ε
> 0.
m 4. Now
0 < x − a < δ (ε) ⇒ 0 < x − a < ε
m ⇒ mx − a < ε
⇒ m(x − a) < ε
⇒ m(x − a) + (b − b) < ε
⇒ (mx + b) − (ma + b) < ε
⇒ f (x) − L < ε
as required. Analysis of Proof As usual, we begin with the hypothesis and the conclusion.
Hypothesis: m = 0 is a real number.
Conclusion: limx→a mx + b = ma + b.
Core Proof Technique: Nested quantiﬁers.
Preliminary Material: Deﬁnition of a limit. Notice how closely this proof follows
the structure of a limit proof.
Sentence 1 Let ε > 0 be a real number.
The deﬁnition of limit begins with a universal quantiﬁer so the ﬁrst proof technique
is the Select Method, just as in the structure of a limit proof.
ε
.
m
The next quantiﬁer is an existential quantiﬁer in the conclusion and so we use the
Construct Method. This again follows the pattern of the proof structure. The conε
structed object is the real number δ (ε) =
. The author gives no indication why
m
that particular value was chosen or how it was derived. Sentence 2 Consider the real number δ (ε) = 60 Chapter 7 Nested Quantiﬁers ε
> 0.
m
After an object is constructed, the Construct Method requires that the object be in
the domain and that it satisfy the open sentence. Sentence 3 of the proof shows that
δ is in the domain, the set of real numbers greater than zero. Sentence 3 Since ε > 0 and m > 0, δ (ε) = Sentence 4 Now . . .
Sentence 4 demonstrates that δ satisﬁes the open sentence. The hypothesis of the
open sentence is 0 < x − a < δ (ε) and the conclusion is f (x) − L < ε. The chain
of reasoning begins with the hypothesis, and after arithmetic manipulation, arrives at
the conclusion. Exercise 1 Justify each line of arithmetic in Sentence 4. 7.4.3 Discovering a Limit Proof We will prove Proposition 6 2 If f (x) = e−1/x then
lim f (x) = 0. x→0 You might object that the function is not even deﬁned at 0, which is true. But the deﬁnition
of limx→a f (x) does not require f to be deﬁned at a. As usual, we begin by explicitly
identifying our hypothesis and conclusion.
2 Hypothesis: f (x) = e−1/x Conclusion: limx→0 f (x) = 0
This is a standard limit proof so we use our existing structure.
Proof in Progress
1. Let ε > 0 be a real number.
2. Consider the real number δ (ε).
3. First, we show that δ (ε) > 0.
4. Now let 0 < x < δ (ε). (This is just 0 < x − a < δ (ε) with a = 0.)
2 2 5. We show that e−1/x  < ε. (This is just f (x) − L < ε with f (x) = e−1/x and L = 0.) Section 7.4 Limits 61
The problem is: How do we construct a suitable δ ? Because ε is not numerically speciﬁed,
our construction for δ will be a function of ε. Now is the time to go to scrap paper. Since
we need
2
e−1/x  < ε
2 we begin there and look for a way to get to 0 < x < δ (ε). e−1/x > 0 for all x so we do
not need the absolute value signs.
1
<ε
e1/x2
2 Now divide by ε (we are using the hypothesis that ε = 0) and multiply by e1/x (we are
2
using the fact that e1/x > 0) to get the following.
1
2
< e1/x
ε
Taking the natural log gives
ln 1
ε < 1
x2 This is hopeful. We can invert the fractions to get
x2 < 1
ln(1/ε) and since x2 > 0 we now have
0 < x2 < 1
ln(1/ε) Taking square roots gives
0 < x < 1
ln(1/ε) And this is precisely the form we want. Our constructed delta is
δ= 1
ln(1/ε) This looks great. Unfortunately, we have made a dangerous assumption, that is ln(1/ε) > 0.
This is only true when ε < 1. However, it is mathematical practice to consider ε as small,
much smaller than one. We will adopt standard practice and ignore the case ε ≥ 1 though
details could be given for it as well.
We have already worked out the math so now we are in a position to write out the proof.
Take a minute to read the proof.
Proof: Let ε > 0. Since ε is small, we assume ε < 1. Consider δ = 1
ln(1/ε) . Since ε < 1, 1/ε > 1 which implies ln(1/ε) > 0 and so δ > 0. Now
0 < x <
as required. 1
1
⇒ 0 < x2 <
⇒ ln
ln(1/ε)
ln(1/ε) 1
ε < 1
1
2
2
⇒ < e1/x ⇒ e−1/x  < ε
2
x
ε Chapter 8 Induction
8.1 Objectives The technique objective is:
1. Learn how to use sum and product notation, and recognize recurrence relations.
2. Learn how to use the Principle of Mathematical Induction, sometimes called Simple
Induction.
3. Learn how to use the Principle of Strong Induction, usually called Strong Induction.
4. Deﬁne binomial coeﬃcient.
5. Read a proof of the Binomial Theorem. 8.2 Notation A number of examples we will discuss use sum, product and recursive notation that you
may not be familiar with. 8.2.1 Summation Notation The sum of the ﬁrst ten perfect squares could be written as
12 + 22 + 32 + · · · + 102
In mathematics, a more compact and more helpful notation is used.
10 i2
i=1 62 Section 8.2 Notation Deﬁnition 8.2.1 63 The notation n Summation
Notation xi
i=m is called summation notation and it represents the sum
xm + xm+1 + xm+2 + · · · + xn
The summation symbol, , is the upper case Greek letter sigma. The letter i is the index
of summation; the letter m is the lower bound of summation, and the letter n is the
upper bound of summation. The expression i = m under the summation symbol means
that the index i begins with an initial value of m and increments by i and stops when i = n.
The index of summation is a dummy variable and any letter could be used in its place. Example 1 7 i2 = 32 + 42 + 52 + 62 + 72
i=3
3 sin(kπ ) = sin(0) + sin(π ) + sin(2π ) + sin(3π )
k=0
n
i=1 11
1
1
= 1 + + + ··· + 2
i2
49
n This notation is often generalize to an arbitrary logical condition, and the sum runs over
all values satisfying the condition. Example 2 For example:
f (x)
x∈ S is the sum of f (x) over all elements x in the set S . The expression
d
dn,d>0 is the sum of all positive divisors of n. There are a number of rules that help us manipulate sums. Proposition 1 (Properties of Summation)
1. Multiplying by a constant
n n cxi = c
i=m xi where c is a constant
i=m 64 Chapter 8 2. Adding two sums n n xi +
i=m 3. Subtracting two sums n yi =
i=m n (xi + yi )
i= m n xi −
i=m Induction n (xi − yi ) yi =
i=m i= m 4. Changing the bounds of the index of summation
n n+k xi =
i= m x i− k
i=m+k The last property allows us to change the bounds of the index of summation, which is often
useful when combining summation expressions. Question Panel here 8.2.2 Product Notation Just as summation notation using
is an algebraic shorthand for a sum, product notation
using
is an algebraic shorthand for a product. Deﬁnition 8.2.2 The notation n Product Notation xi
i=m is called product notation and it represents the product
xm · xm+1 · xm+2 · · · · · xn
The product symbol, , is the upper case Greek letter pi. The index i and the upper and
lower bounds m and n behave just as they do for sums. Example 3 n 1−
i=2 8.2.3 1
i2 = 1− 1
4 1− 1
9 1− 1
16 ··· 1 − 1
n2 Recurrence Relations You are accustomed to seeing mathematical expressions in one of two ways: iterative and
closed form. For example, the sum of the ﬁrst n integers can be expressed iteratively as
1 + 2 + 3 + ··· + n Section 8.3 Introduction to Induction 65 or in closed form as n(n + 1)
2 There is a third way. Deﬁnition 8.2.3
Recurrence
Relation A recurrence relation is an equation that deﬁnes a sequence of number which is generated
by one or more initial terms, and expressions involving prior terms. You are probably familiar with the Fibonacci sequence which is a recurrence relation. Example 4 (Fibonacci Sequence)
The initial two terms are deﬁned as f1 = 1 and f2 = 1. All subsequent terms are deﬁned by
the recurrence relation fn = fn−1 + fn−2 . The ﬁrst eight terms of the Fibonacci sequence
are 1, 1, 2, 3, 5, 8, 11, 19. Example 5 (Sum of First n Integers)
We can deﬁne the sum of the ﬁrst n terms recursively as f (1) = 1 and
f (n) = f (n − 1) + n for n > 1 Question Panel here 8.3 Introduction to Induction Induction is a common and powerful technique and should be your ﬁrst choice whenever
you encounter a statement of the form
For every integer n ≥ 1, P (n) is true.
where P (n) is a statement that depends on n.
Here are two examples of propositions in this form. Proposition 2 For every integer n ≥ 1 n i2 =
i=1 n(n + 1)(2n + 1)
.
6 Often the clause “For every integer n ≥ 1” is implied and does not actually appear in the
proposition, as in the following version of the same theorem. 66 Chapter 8 Proposition 3 The sum of the ﬁrst n perfect squares is Induction n(n+1)(2n+1)
.
6 The second example uses sets, not equations. Proposition 4 Every set of size n has exactly 2n subsets. 8.4
Deﬁnition 8.4.1
Axiom Principle of Mathematical Induction An axiom of a mathematical system is a statement that is assumed to be true. No proof
is given. From axioms we derive propositions and theorems. Sometimes axioms are described as selfevident, though many are not. Axioms are deﬁning
properties of mathematical systems. The Principle of Mathematical Induction is one such
axiom. Axiom 1 Principle of Mathematical Induction (POMI)
Let P (n) be a statement that depends on n ∈ N.
If
1. P (1) is true, and
2. P (k ) is true implies P (k + 1) is true for all k ∈ N
then P (n) is true for all n ∈ N. We use the Principle of Mathematical Induction to prove statements of the form
For every integer n ≥ 1, P (n) is true.
The structure of a proof by induction models the deﬁnition of induction. The three parts
of the structure are as follows.
Base Case Verify that P (1) is true. This is usually easy. You will often see the statement
“It is easy to see that the statement is true for n = 1.” It is best to write this step
out completely.
Inductive Hypothesis Assume that P (k ) is true for some integer k ≥ 1. It is best to
write out the statement P (k ).
Inductive Conclusion Using the assumption that P (k ) is true, show that P (k + 1) is
true. Again, it is best to write out the statement P (k + 1) before trying to prove it. Section 8.4 Principle of Mathematical Induction 8.4.1 67 Why Does Induction Work? The basic idea is simple. We show that P (1) is true. We then use P (1) to show that P (2)
is true. And then we use P (2) to show that P (3) is true and continue indeﬁnitely. That is
P (1) ⇒ P (2) ⇒ P (3) ⇒ . . . ⇒ P (i) ⇒ P (i + 1) ⇒ . . . 8.4.2 Two Examples of Simple Induction Our ﬁrst example is very typical and uses an equation containing the integer n. Proposition 5 n i2 =
i=1 n(n + 1)(2n + 1)
.
6 Proof: We begin by formally writing out our inductive statement
n i2 = P (n) :
i=1 n(n + 1)(2n + 1)
.
6 Base Case We verify that P (1) is true where P (1) is the statement
1 i2 = P (1) :
i=1 1(1 + 1)(2 × 1 + 1)
.
6 As in most base cases involving equations, we can make our way from the left side of
the equation to the right side of the equation with just a little algebra.
1 i2 = 12 = 1 =
i=1 1(1 + 1)(2 × 1 + 1)
.
6 Inductive Hypothesis We assume that the statement P (k ) is true for some integer k ≥ 1.
k i2 = P (k ) :
i=1 k (k + 1)(2k + 1)
.
6 Inductive Conclusion Now show that the statement P (k + 1) is true.
k+1 i2 = P (k + 1) :
i=1 (k + 1)((k + 1) + 1)(2(k + 1) + 1)
.
6 This is the diﬃcult part. When working with equations, you can often start with the
more complicated expression and decompose it into an instance of P (k ) with some 68 Chapter 8 Induction leftovers. That’s what we will do here.
k+1 k i2 =
i=1 i2 + (k + 1)2 partition into P (k ) and other i=1 k (k + 1)(2k + 1)
+ (k + 1)2
use the inductive hypothesis
=
6
k (k + 1)(2k + 1) + 6(k + 1)2
=
algebraic manipulation
6
(k + 1) 2k 2 + 7k + 6
=
factor out k + 1, expand the rest
6
(k + 1)(k + 2)(2k + 3)
=
factor
6
(k + 1)((k + 1) + 1)(2(k + 1) + 1)
=
6
The result is true for n = k + 1, and so holds for all n by POMI. Our next example does not have any equations. Proposition 6 Let Sn = {1, 2, 3, . . . , n}. Then Sn has 2n subsets.
Let’s be very clear about what our statement P (n) is.
P (n): Sn has 2n subsets.
Now we can begin the proof.
Proof: Base Case We verify that P (1) is true where P (1) is the statement
P (1): S (1) has 2 subsets.
We can enumerate all of the sets of S1 easily. They are { } and {1}, exactly two as
required.
Inductive Hypothesis We assume that the statement P (k ) is true for some integer k ≥ 1.
P (k ): Sk has 2k subsets.
Inductive Conclusion Now show that the statement P (k + 1) is true.
P (k + 1): Sk+1 has 2k+1 subsets.
The subsets of Sk+1 can be partitioned into two sets. The set A in which no subset
contains the element k +1, and the complement of A, A, in which every subset contains
the element k + 1. Now A is just the subsets of Sk and so, by the inductive hypothesis,
has 2k subsets. A is composed of the subsets of Sk to which the element k +1 is added.
So, again by our inductive hypothesis, there are 2k subsets of A. Since A and A are
disjoint and together contain all of the subsets of Sk+1 , there must be 2k + 2k = 2k+1
subsets of Sk+1 .
The result is true for n = k + 1, and so holds for all n by POMI. Section 8.5 Principle of Mathematical Induction 8.4.3 69 A Diﬀerent Starting Point Some true statements cannot start with “for all integers n, n ≥ 1”. For example, “2n > n2 ”
is false for n = 2, 3, and 4 but true for n ≥ 5. But the basic idea holds. If we can show
that a statement is true for some base case n = b, and then show that
P (b) ⇒ P (b + 1) ⇒ P (b + 2) ⇒ . . . ⇒ P (i) ⇒ P (i + 1) ⇒ . . .
this is also induction. Perhaps this is not surprising because we can always recast a statement “For every integer n ≥ b, P (n)” as an equivalent statement “For every integer k ≥ 1,
P (k )”. For example,
For every integer n ≥ 5, 2n > n2 .
is equivalent to
For every integer k ≥ 1, 2k+4 > (k + 4)2 .
In this case, we have just replaced n by k + 4 in the statement.
The basic structure of induction is the same. To prove the statement
For every integer n ≥ b, P (n) is true.
the only changes we need to make are that our base case is P (b) rather than P (1), and that
in our inductive hypothesis we assume P (k ) is true for k ≥ b rather than k ≥ 1.
Here is an example. Proposition 7 For every integer n ≥ 5, 2n > n2 . As usual, let’s be very clear about what our statement P (n) is.
P (n): 2n > n2 .
Now we can begin the proof.
Proof: Base Case We verify that P (5) is true where P (5) is the statement
P (5): 25 > 52
This is just arithmetic.
25 = 32 > 25 = 52
Inductive Hypothesis We assume that the statement P (k ) is true for some integer k ≥ 5.
P (k ): 2k > k 2
Inductive Conclusion Now show that the statement P (k + 1) is true.
P (k + 1): 2k+1 > (k + 1)2
2k+1 = 2 × 2k > 2 × k 2 = k 2 + k 2 > k 2 + 2k + 1 = (k + 1)2
The result is true for n = k + 1, and so holds for all n by POMI. 70 Chapter 8 8.5 Induction Strong Induction Sometimes Simple Induction doesn’t work where it looks like it should. We then need to
change our approach a bit. The following example is similar to examples that we’ve done
earlier. Lets try to make Simple Induction work and see where things go wrong. Proposition 8 Let the sequence {xn } be deﬁned by x1 = 0, x2 = 30 and xm = xm−1 + 6xm−2 for m ≥ 3.
Then
xn = 2 · 3n + 3 · (−2)n for n ≥ 1. This seems like a classic case for induction since the conclusion clearly depends on the
integer n. Let’s begin with our statement P (n).
P (n): xn = 2 · 3n + 3 · (−2)n .
Now we can begin the proof.
Proof: Base Case We verify that P (1) is true where P (1) is the statement
P (1): x1 = 2 · 31 + 3 · (−2)1 .
From the deﬁnition of the sequence x1 = 0. The right side of the statement P (1)
evaluates to 0 so P (1) is true.
Inductive Hypothesis We assume that the statement P (k ) is true for k ≥ 1.
P (k ): xk = 2 · 3k + 3 · (−2)k .
Inductive Conclusion Now show that the statement P (k + 1) is true.
P (k + 1): xk+1 = 2 · 3k+1 + 3 · (−2)k+1 .
xk+1 = xk + 6xk−1
k by the deﬁnition of the sequence
k = 2 · 3 + 3 · (−2) + 6xk−1 by the Inductive Hypothesis Now two problems are exposed. The more obvious problem is what do we do with xk−1 ?
The more subtle problem is whether we can even validly write the ﬁrst line. When k + 1 = 2
we get
x2 = x1 + 6 x0
and x0 is not even deﬁned.
The basic principle that earlier instances imply later instances is sound. We need to
strengthen our notion of induction in two ways. First, we need to allow for more than
one base case so that we avoid the problem of undeﬁned terms. Second, we need to allow
access to any of the statements P (1), P (2), P (3), ... , P (k ) when showing that P (k + 1) is
true. This may seem like too strong an assumption but is, in fact, quite acceptable. This
practice is based on the Principle of Strong Induction. Section 8.5 Strong Induction Axiom 2 71 Principle of Strong Induction (POSI)
Let P (n) be a statement that depends on n ∈ N.
If
1. P (1), P (2), . . . , P (b), are true, and
2. P (1), P (2), . . . , P (k ) are all true implies P (k + 1) is true for all k ∈ N,
then P (n) is true for all n ∈ N. Just as before, there are three parts in a proof by strong induction.
Base Cases Verify that P (1), P (2), . . . , P (b) are all true. This is usually easy.
Inductive Hypothesis Assume that P (i) is true for i = 1, 2, 3, . . . , k , k ≥ b. This is
sometimes written as Assume that P (1), P (2), . . . , P (k ) are true.
Inductive Conclusion Using the assumption that P (1), P (2), . . . , P (k ) are true,
show that P (k + 1) is true.
As a rule of thumb, use Strong Induction when the general case depends on more than one
previous case. Though we could use Strong Induction all the time, Simple Induction is often
easier.
Let’s return to our previous proposition. Proposition 9 Let the sequence {xn } be deﬁned by x1 = 0, x2 = 30 and xm = xm−1 + 6xm−2 for m ≥ 3.
Then
xn = 2 · 3n + 3 · (−2)n for n ≥ 1. We will use Strong Induction. Recall our statement P (n).
P (n): xn = 2 · 3n + 3 · (−2)n .
Now we can begin the proof.
Proof: Base Case We verify that P (1) and P (2) are true.
P (1): x1 = 2 · 31 + 3 · (−2)1 .
From the deﬁnition of the sequence x1 = 0. The right side of the statement P (1)
evaluates to 0 so P (1) is true.
P (2): x2 = 2 · 32 + 3 · (−2)2 .
From the deﬁnition of the sequence x2 = 30. The right side of the statement P (2)
evaluates to 30 so P (2) is true. 72 Chapter 8 Induction Inductive Hypothesis We assume that the statement P (i) is true for 1 ≤ i ≤ k , k ≥ 2.
P (i): xi = 2 · 3i + 3 · (−2)i .
Inductive Conclusion Now show that the statement P (k + 1) is true.
P (k + 1): xk+1 = 2 · 3k+1 + 3 · (−2)k+1 .
xk+1 = xk + 6xk−1
k by the deﬁnition of the sequence
k = 2 · 3 + 3 · (−2) + 6(2 · 3 k −1 k−1 + 3 · (−2) ) by the Inductive Hypothesis = 3k−1 [2 · 3 + 6 · 2] + (−2)k−1 [3 · (−2) + 6 · 3] expand and factor = 18 · 3 k −1 k −1 + 12 · (−2) = 2 · 3k+1 + 3 · (−2)k+1 The result is true for n = k + 1, and so holds for all n by POSI. 8.5.1 Interesting Example A triomino is a tile of the form Proposition 10 A 2n × 2n grid of squares with one square removed can be covered by triominoes. As usual, we begin by explicitly stating P (n).
P (n): A 2n × 2n grid of squares with one square removed can be covered by
triominoes.
We will use Simple Induction.
Proof: Base Case We verify that P (1) is true.
P (1): A 2 × 2 grid of squares with one square removed can be covered by
triominoes.
A 2 × 2 grid with one square removed looks like or or or . Each of these can be covered by one triomino.
Inductive Hypothesis We assume that the statement P (i) is true for 1 ≤ i ≤ k .
P (k ): A 2i × 2i grid of squares with one square removed can be covered by
triominoes.
Note that our hypothesis covers every possible position for the empty square within
the grid. Section 8.6 Binomial Theorem 73 Inductive Conclusion We now show that the statement P (k + 1) is true.
P (k + 1): A 2k+1 × 2k+1 grid of squares with one square removed can be
covered by triominoes.
Consider a 2k+1 × 2k+1 grid with any square removed. Split the 2k+1 × 2k+1 grid in half vertically and horizontally. The missing square occurs in one of the four 2k × 2k subgrids formed. We’ll start by
placing one tile around the centre of the grid, not covering any of the 2k × 2k subgrids
where the square is missing: We can now view the grid as being made up of four 2k × 2k subgrids, each with one
square missing. The Inductive Hypothesis tells us that each of these can be covered
by triominoes. Therefore, the whole 2k+1 × 2k+1 grid can be covered. The result is
true for n = k + 1, and so holds for all n by POMI. 8.6
Deﬁnition 8.6.1
Binomial Binomial Theorem A binomial is the sum of two quantities, a + b for example. 74 Chapter 8 Induction You have probably encountered the following powers of a binomial.
(a + b)2 = a2 + 2ab + b2
(a + b)3 = a3 + 3a2 b + 3ab2 + b3
The obvious question is: what is the expansion of (a + b)n for a positive integer n?
The expansion of (a + b)n uses binomial coeﬃcients. Deﬁnition 8.6.2 a
b If 0 ≤ b ≤ a, then the binomial coeﬃcient Binomial
Coeﬃcient a
b
where 0! is deﬁned to be 1 so that a
a = is deﬁned by a!
b!(a − b)! = 1. This electronic assignment works through a proposed inductive proof of the following proposition. Proposition 11 (Binomial Theorem)
If x and y are any numbers, and n ∈ N, then
n (x + y )n =
r=0 n n−r r
xy
r Example 6
3 (x + y )3 =
r=0 3 3−r r
xy
r 3 3−0 0
3 3−1 1
3 3−2 2
3 3−3 3
x y+
x y+
x y+
xy
0
1
2
3 = = x3 + 3x2 y + 3xy 2 + y 3 Example 7 3
3 (2x − 3) =
r=0 3
(2x)3−r (−3)r = 8x3 − 36x2 + 54x − 27
r Proof: Let P (n) be the statement: If x and y are any numbers, and n ∈ N, then
n (x + y )n =
r=0 n n−r r
x y.
r Base Case We verify that P (1) is true where P (1) is the statement Section 8.6 Binomial Theorem 75
P (1): If x and y are any numbers, then (x + y )1 = Since 1
r=0 1 1−r r
x y=
r 1
1
r=0 r x1−r y r . 1 1−0 0
1 1−1 1
x y+
x y = x + y = (x + y )1
0
1 the base case holds.
Inductive Hypothesis We assume that the statement P (k ) is true for k ≥ 1.
P (k ): If x and y are any numbers, then (x + y )k = k
k
r=0 r xk −r y r . Inductive Conclusion We now show that the statement P (k + 1) is true.
P (k +1): If x and y are any numbers, then (x+y )k+1 = k+1 k+1
r=0
r xk+1−r y r . (x + y )k+1 = (x + y )(x + y )k (8.1) k k k k −r r
xy
r +y k k+1−r r
x
y
r + = x(x + y ) + y (x + y )
k =x
r=0
k =
r=0 = k k+1
x
+
0
k = xk+1 +
r=1
k+1 = xk+1 +
r=1
k+1 =
r=0 k
r=1 (8.2)
k
r=0
k
r=0 k k−r r
xy
r (8.3) k k−r r+1
xy
r (8.4) k k+1−r r
x
y+
r k
k
+
r
r−1 k −1
r=0 k k−r r+1
k k+1
xy
+
y
r
k xk+1−r y r + y k+1 k + 1 k+1−r r
x
y + y k+1
r k + 1 k+1−r r
x
y
r The result is true for n = k + 1, and so holds for all n by POMI. (8.5) (8.6) (8.7) (8.8) Chapter 9 The Greatest Common Divisor
9.1 Objectives The content objectives are:
1. To discover a proof of the proposition GCD With Remainders.
2. Do an example of the Euclidean Algorithm.
3. Prove the GCD Characterization Theorem.
4. Compute gcds and certiﬁcates using the Extended Euclidean Algorithm. 9.2
Deﬁnition 9.2.1
Greatest Common
Divisor Greatest Common Divisor Let a and b be integers, not both zero. An integer d > 0 is the greatest common divisor
of a and b, written gcd(a, b), if and only if
1. d  a and d  b (this captures the common part of the deﬁnition), and
2. if c  a and c  b then c ≤ d (this captures the greatest part of the deﬁnition). Example 1
• gcd(24, 30) = 6
• gcd(17, 25) = 1
• gcd(−12, 0) = 12
• gcd(−12, −12) = 12
• gcd(0, 0) =?? 76 Section 9.2 Greatest Common Divisor Deﬁnition 9.2.2
gcd(0, 0) 77 For a = 0, the deﬁnition implies that gcd(a, 0) = a and gcd(a, a) = a. We deﬁne gcd(0, 0)
as 0. This may sound counterintuitive, since all integers are divisors of 0, but it is consistent
with gcd(a, 0) = a and gcd(a, a) = a. Let’s prove a seemingly unusual proposition about gcds. Proposition 1 (GCD With Remainders (GCD WR))
If a and b are integers not both zero, and q and r are integers such that a = qb + r, then
gcd(a, b) = gcd(b, r). How would we discover a proof for this proposition? Let’s try the usual approach: identify
the hypothesis and conclusion, and begin asking questions.
Hypothesis: a, b, q and r are integers such that a = qb + r.
Conclusion: gcd(a, b) = gcd(b, r)
My ﬁrst question typically starts with the conclusion and works backward. What is a
suitable ﬁrst question? How about “How do we show that two integers are equal?” There
are lots of possible answers: show that their diﬀerence is zero, their ratio is one, each is
less than or equal the other. However, here we are working with gcds rather than generic
integers so perhaps a better question would be “How do we show that a number is a gcd?”
The broad answer is relatively easy. Use the deﬁnition of gcd. After all, right now it is
the only thing we have! A speciﬁc answer is less easy. Do we want to focus on gcd(a, b) or
gcd(b, r)? Here is an easy way to do both. Let d = gcd(a, b). Then show that d = gcd(b, r).
That gets us two statement in our proof.
Proof in Progress
1. Let d = gcd(a, b).
2. To be completed.
3. Hence d = gcd(b, r).
But how do we show that d = gcd(b, r)? Use the deﬁnition. Our proof can expand to
Proof in Progress
1. Let d = gcd(a, b).
2. We will show
(a) d  b and d  r, and
(b) if c  b and c  r then c ≤ d.
3. To be completed.
4. Hence d = gcd(b, r). 78 Chapter 9 The Greatest Common Divisor For the ﬁrst part of the deﬁnition, we ask “How do we show that one number divides another
number?” Interestingly enough, there are two diﬀerent answers  one for b and one for r,
though that is not obvious. For b there is already a connection between d and b in the ﬁrst
sentence. Since d = gcd(a, b), we know from the deﬁnition of gcd that d  b.
What about r? Using the deﬁnition of divisibility seems problematic. What propositions
could we use? Transitivity of Divisibility (Proposition 1) doesn’t seem to apply. How about
using the Divisibility of Integer Combinations (Proposition 1)? Proposition 2 (Divisibility of Integer Combinations)
Let a, b and c be integers. If a  b and a  c, then a  (bx + cy ) for any x, y ∈ Z. Observe that r = a − qb. Since d  a and d  b, d divides any integer combination of a and
b by the Divisibility of Integer Combinations. That is, d  (a(1) + b(−q )) so d  r. Let’s
extend our proof in progress.
Proof in Progress
1. Let d = gcd(a, b).
2. We will show
(a) d  b and d  r, and
(b) if c  b and c  r then c ≤ d.
3. Since d = gcd(a, b), we know from the deﬁnition of gcd that d  b.
4. Observe that r = a − qb. Since d  a and d  b, d  (a(1) + b(−q )) by the Divisibility of
Integer Combinations, so d  r.
5. To be completed.
6. Hence d = gcd(b, r).
That leaves us with the greatest part of greatest common divisor. This second part of the
deﬁnition is itself an implication, so we assume that c  b and c  r and we must show c ≤ d.
How do we show one number is less than or equal to another number? There doesn’t seem
to be anything obvious but ask “Have I seen this anywhere before?”. Yes, we have. In the
second part of the deﬁnition of gcd. But then you might ask “Isn’t that assuming what we
have to prove?” Let’s be precise about what we are saying. We can use d for one inequality.
Since d = gcd(a, b), for any c where c  a and c  b, c ≤ d.
What we need to show is: if c  b and c  r then c ≤ d.
These two statements are close, but not the same. If we assume that c  b and c  r, then
c  (b(q ) + r(1)) by the Divisibility of Integer Combinations (again). Since a = qb + r, c  a.
And now, since d = gcd(a, b) and c  a and c  b, c ≤ d as needed. Let’s add that to our
proof in progress.
Proof in Progress
1. Let d = gcd(a, b). Section 9.3 Greatest Common Divisor 79 2. We will show
(a) d  b and d  r, and
(b) if c  b and c  r then c ≤ d.
3. Since d = gcd(a, b), we know from the deﬁnition of gcd that d  b.
4. Observe that r = a − qb. Since d  a and d  b, d  (a(1) + b(−q )) by the Divisibility of
Integer Combinations, so d  r.
5. Let c  b and c  r. Then c  (b(q ) + r(1)) by the Divisibility of Integer Combinations.
Since a = qb + r, c  a. And now, since d = gcd(a, b) and c  a and c  b, c ≤ d by the
second part of the deﬁnition of gcd.
6. Hence d = gcd(b, r).
Having discovered a proof, we should now write the proof. Whenever you write, you should
have an audience in mind. You actually have two audiences to keep in mind: your peers with
whom you collaborate, and the markers. You do not need to specify each proof technique,
since your peers and markers know all of them. It does help to provide an overall plan if
you can. Also, proofs tend to work much more forwards than backwards because that helps
to emphasize the notion of starting with hypotheses and ending with the conclusion. Here
is one possible proof.
Proof: Let d = gcd(a, b). We will use the deﬁnition of gcd to show that d = gcd(b, r).
Since d = gcd(a, b), d  b. Observe that r = a − qb. Since d  a and d  b, d  (a − qb) by the
Divisibility of Integer Combinations. Hence d  r, and d is a common divisor of b and r.
Let c be a divisor of b and r. Since c  b and c  r, c  (qb + r) by the Divisibility of Integer
Combinations. Now a = qb + r, so c  a. Because d = gcd(a, b) and c  a and c  b, c ≤ d. REMARK
1. If a = b = 0 this proposition is also true since the only possible choices for b and r are
b = r = 0.
2. In general, there are many ways to work forwards and backwards.
3. The proof may records steps in a diﬀerent order than their appearance in the discovery
process.
4. Proofs are short and usually omit the discovery process.
5. Be sure that you can identify where each of your hypotheses was used in the proof. 80 Chapter 9 9.3 The Greatest Common Divisor Certiﬁcate of Correctess Suppose we wanted to compute gcd(1386, 322). We could factor both numbers, ﬁnd their
common factors and select the greatest. In general, this is very slow.
Repeated use of GCD With Remainders allows us to eﬃciently compute gcds. For example,
let’s compute gcd(1386, 322). Example 2
Since
Since
Since
Since 1386 = 4 × 322 + 98,
322 = 3 × 98 + 28,
98 = 3 × 28 + 14,
28 = 2 × 14 + 0, gcd(1386, 322) = gcd(322, 98).
gcd(322, 98) = gcd(98, 28).
gcd(98, 28) = gcd(28, 14).
gcd(28, 14) = gcd(14, 0). Since gcd(14, 0) = 14, the chain of equalities from the column on the right gives us
gcd(1386, 322) = gcd(322, 98) = gcd(98, 28) = gcd(28, 14) = gcd(14, 0) = 14. This process is known as the Euclidean Algorithm. Exercise 1 Randomly pick two positive integers and compute their gcd using the Euclidean Algorithm.
How do you know that you have the correct answer? Keep your work. You’ll need it soon. Because mistakes happen when performing arithmetic by hand, and mistakes happen when
programming computers, it would be very useful if there were a way to certify that an
answer is correct. Think of a certiﬁcate of correctness this way. You are a manager. You
ask one of your staﬀ to solve a problem. The staﬀ member comes back with the proposed
solution and a certiﬁcate of correctness that can be used to verify that the proposed solution
is, in fact, correct. The certiﬁcate has two parts: a theorem which you have already proved
and which relates to the problem in general, and data which relates to this speciﬁc problem.
For example, here’s a proposition that allows us to produce a certiﬁcate for gcd(a, b). Proposition 3 (GCD Characterization Theorem (GCD CT))
If d is a positive common divisor of the integers a and b, and there exist integers x and y
so that ax + by = d, then d = gcd(a, b). Our certiﬁcate would consist of this theorem along with integers x and y . If our proposed
solution was d and d  a, d  b and ax + by = d, then we could conclude without doubt that
d = gcd(a, b).
In the example 2 above, the proposed gcd of 1386 and 322 is 14. Our certiﬁcate of correctness
consists of the GCD Characterization Theorem and the integers d = 14, x = 10 and y = −43.
Note that 14  1386 and 14  322 and 1386 × 10 + 322 × (−43) = 14, so we can conclude
that 14 = gcd(1386, 322).
Here is a proof of the GCD Characterization Theorem. Section 9.4 Certiﬁcate of Correctess 81 Proof: (For reference, each sentence of the proof is written on a separate line.)
1. We will show that d satisﬁes the deﬁnition of gcd(a, b).
2. From the hypotheses, d  a and d  b.
3. Now let c  a and c  b.
4. By the Divisibility of Integer Combinations (Proposition 1), c  (ax + by ) so c  d.
5. By the Bounds by Divisibility (Proposition 2), c ≤ d, and so d = gcd(a, b). Let’s do an analysis of the proof.
Analysis of Proof As usual, we will begin by explicitly identifying the hypothesis and
the conclusion.
Hypothesis: d is a positive common divisor of the integers a and b. There exist
integers x and y so that ax + by = d.
Conclusion: d = gcd(a, b)
Core Proof Technique: Work forwards recognizing an existential quantiﬁer in the
hypothesis.
Preliminary Material: Deﬁnition of gcd. An integer d > 0 is the gcd(a, b) if and
only if
1. d  a and d  b, and
2. if c  a and c  b then c ≤ d.
Sentence 1 We will show that d satisﬁes the deﬁnition of gcd(a, b).
The author states the plan  always a good idea. The author is actually answering
the question “How do I show that one number is the gcd of two other numbers?”
Sentence 2 From the hypotheses, d  a and d  b.
The author is working forwards from the hypothesis. This handles the ﬁrst part of
the deﬁnition of gcd.
Sentence 3 Now let c  a and c  b.
The second part of the deﬁnition of gcd is an implication with hypothesis c  a and
c  b. The author must show c ≤ d.
Sentence 4 By the Divisibility of Integer Combinations, c  (ax + by ) so c  d.
This is where the author uses an existential quantiﬁer in the hypothesis. The author
assumes the existence of two integers x and y such that ax + by = d. The author does
not state this explicitly.
Having made this assumption, the author can use Sentence 3 to satisfy the hypotheses
of Divisibility of Integer Combinations and so invoke the conclusion, that is, c  (ax +
by ).
Sentence 5 By the Bounds By Divisibility, c ≤ d, and so d = gcd(a, b).
Having determined that c ≤ d, both parts of the deﬁnition of gcd are satisﬁed and so
the author can conclude that d = gcd(a, b).
Now the obvious questions is: “How do we ﬁnd x and y ?” 82 Chapter 9 9.4 The Greatest Common Divisor The Extended Euclidean Algorithm (EEA) Given two positive integers, a and b, the EEA is an eﬃcient way to compute not only
d = gcd(a, b) but the data x and y for the certiﬁcate. Here is the algorithm and an
example.
Algorithm 1 Extended Euclidean Algorithm
Require: a > b > 0 are integers.
Ensure: The following conditions hold at the end of the algorithm.
rn+1 = 0.
rn = gcd(a, b).
ri−2 = qi ri−1 + ri where 0 ≤ ri < ri−1 .
In every row, axi + byi = ri .
x = xn , y = yn is a solution to ax + by = gcd(a, b).
{Initialize}
Construct a table with four columns so that
The columns are labelled x, y , r and q .
The ﬁrst row in the table is (1, 0, a, 0).
The second row in the table is (0, 1, b, 0).
{To produce the remaining rows (i ≥ 3)}
repeat
ri−2
qi ← ri−1
Rowi ← Rowi−2 − qi Rowi−1
until ri = 0
This may be easier to understand with an example. Let’s compute gcd(1386, 322) using the
EEA. Since 1386 > 322 > 0 we can, in fact, legitimately use the EEA. Initially we get
xy
r
q
1 0 1386 0
0 1 322 0
To generate the third row we must ﬁrst compute q3 . Using the formula
ri−2
ri−1 qi ←
we get
q3 = r1
r2 = 1386
=4
322 Now we use the formula
Rowi ← Rowi−2 − qi Rowi−1
when i = 3 to get
Row3 ← Row1 − q3 Row2
With q3 = 4 we get
Row3 ← Row1 − 4 × Row2
Representing this in the table gives
Row1
−4 × Row2
= Row3 xy
r
q
1 0 1386 0
01
322 0
1 −4 98 4 Section 9.4 The Extended Euclidean Algorithm (EEA) 83 In a similar fashion we get the fourth row. Row2
−3 × Row3
= Row4 x
y
r
q
1
0 1386 0
0
1
322 0
1 −4 98 4
−3 13
28 3 The completely worked out example follows.
x
y
r
q
1
0
1386 0
0
1
322 0
1
−4
98 4
−3
13
28 3
10 −43 14 3
−23 99
0
2
We stop when the remainder is 0. The second last row provides the desired d, x and
y . The gcd d is the entry in the r column, x is the entry in the x column and y is the
entry in the y column. Hence, d = 14 (as before), and we can check the conditions of the
GCD Characterization Theorem to certify correctness. Since 14  1386 and 14  322 and
1386 × 10 + 322 × (−43) = 14, we can conclude that 14 = gcd(1386, 322).
If a or b is negative, apply the EEA to gcd(a, b) and then change the signs of x and y
after the EEA is complete. If a < b, simply swap their places in the algorithm. This works
because gcd(a, b) = gcd(b, a).
We treat the EEA as a proposition where the preconditions are the hypotheses and the
postconditions are the conclusions. Let’s record the algorithm in the form of a theorem. Proposition 4 (Extended Euclidean Algorithm (EEA))
If a and b are positive integers, then d = gcd(a, b) can be computed and there exist integers
x and y so that ax + by = d. A proof of the correctness of the EEA is available in the appendix. Add to appendix. Exercise 2 A few minutes ago you computed the gcd of two numbers. Repeat that exercise using the
EEA and verify that you can produce a certiﬁcate of correctness for your proposed gcd. Chapter 10 Properties Of GCDs
10.1 Objectives The technique objectives are:
1. To practice working with existential quantiﬁers.
The content objectives are:
1. Discover a proof of Coprimeness and Divisibility.
2. Discover a proof of GCD Of One
3. Exercise: Discover a proof of Division by the GCD.
4. Exercise: Discover a proof of Primes and Divisibility. 10.2 Some Useful Propositions We begin with a proposition on coprimeness and divisibility. Deﬁnition 10.2.1 Two integers a and b are coprime if gcd(a, b) = 1. Coprime Proposition 1 (Coprimeness and Divisibility (CAD))
If a, b and c are integers and c  ab and gcd(a, c) = 1, then c  b. This proposition has two implicit existential quantiﬁers, one in the hypothesis and one in
the conclusion. You might object and ask “Where?” It’s hidden  in the deﬁnition of divides.
Recall the deﬁnition. An integer m divides an integer n if there exists an integer k so that
n = km.
We treat an existential quantiﬁer in the hypothesis diﬀerently from an existential quantiﬁer
in the conclusion. Recall the following remarks from the chapter on quantiﬁers.
84 Section 10.2 Some Useful Propositions 85 REMARK
When proving that “A implies B ” and A uses an existential quantiﬁer, use the
Object Method.
1. Identify the four parts of the quantiﬁed statement “there exists an x in the set S such
that P (x) is true.”
2. Assume that a mathematical object x exists within the domain S so that the statement
P (x) is true.
3. Make use of this information to generate another statement.
When proving that “A implies B ” and B uses an existential quantiﬁer, use the
Construct Method.
1. Identify the four parts of the quantiﬁed statement. “there exists an x in the set S
such that P (x) is true.”
2. Construct a mathematical object x.
3. Show that x ∈ S .
4. Show that P (x) is true. Let’s be clear about what “there exists an integer k so that b = kc”, the existential statement
in the conclusion, means.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
k
Z
b = kc With all of this in mind, how do we go about discovering a proof for Coprimeness and
Divisibility? As usual, we will begin by explicitly identifying the hypothesis, the conclusion,
the core proof technique and any preliminary material we think we might need.
Hypothesis: a, b and c are integers and c  ab and gcd(a, c) = 1.
Conclusion: c  b.
Core Proof Technique: We use the Object Method because of the existential quantiﬁer
in the hypothesis, and the Construct Method because of the existential quantiﬁer in
the conclusion.
Preliminary Material: Deﬁnition of divides and gcd.
When discovering proofs I prefer to start by working backwards from the conclusion. In
this case, I would begin by asking “How do we show that one integer divides another?”
We can answer with the deﬁnition of divisibility. We must construct an integer k so that
b = ck . We will record this as follows. 86 Chapter 10 Properties Of GCDs Proof in Progress
1. To be completed.
2. Since b = kc, c  b.
The problem is that it is not at all clear what k should be. Let’s work forwards from the
hypothesis.
Somehow we need an equation with a b alone on one side of the equality sign. We can’t
start there but we can get an equation with a b. Since gcd(a, c) = 1, the EEA guarantees
that we can ﬁnd integers x and y so that ax + cy = 1. We could multiply this equation by
b. Let’s record these forward statements.
Proof in Progress
1. Since gcd(a, c) = 1, the EEA guarantees that we can ﬁnd integers x and y so that
ax + cy = 1 (1).
2. Multiplying (1) by b gives abx + cby = b (2).
3. To be completed.
4. Since b = kc, c  b.
If we could factor the left hand side of (2), we’d be able to get a c and other stuﬀ that we
could treat as our k . But the ﬁrst term has no c. Or maybe it does. Since c  ab there
exists an integer h so that ch = ab. Substituting ch for ab in (2) gives chx + cby = b (3).
We record this as
Proof in Progress
1. Since gcd(a, c) = 1, the EEA guarantees that we can ﬁnd integers x and y so that
ax + cy = 1 (1).
2. Multiplying (1) by b gives abx + cby = b (2).
3. Since c  ab there exists an integer h so that ch = ab. Substituting ch for ab in (2)
gives chx + cby = b (3).
4. To be completed.
5. Since b = kc, c  b.
Now factor.
Proof in Progress
1. Since gcd(a, c) = 1, the EEA guarantees that we can ﬁnd integers x and y so that
ax + cy = 1 (1).
2. Multiplying (1) by b gives abx + cby = b (2).
3. Since c  ab there exists an integer h so that ch = ab. Substituting ch for ab in (2)
gives chx + cby = b (3). Section 10.2 Some Useful Propositions 87 4. This gives c(hx + by ) = b.
5. But then if we let k = hx + by we have an integer k so that ck = b.
6. Since b = kc, c  b.
Here is a proof.
Proof: By the Extended Euclidean Algorithm and the hypothesis gcd(a, c) = 1, there exist
integers x and y so that ax + cy = 1. Multiplying by b gives abx + cby = b. Since c  ab
there exists an integer h so that ch = ab. Substituting ch for ab gives chx + cby = b. Lastly,
factoring produces (hx + by )c = b. Since hx + by is an integer, c  b.
Let us consider more properties of the greatest common divisor. Proposition 2 (GCD Of One (GCD OO))
Let a and b be integers. Then gcd(a, b) = 1 if and only if there are integers x and y with
ax + by = 1. This proposition has similar elements to the one we just proved, so it won’t be a surprise if
we use similar reasoning. REMARK
The important diﬀerence is that this statement is an “if and only if” statement. To prove
A if and only if B we must prove two statements:
1. If A, then B .
2. If B , then A. We can restate the proposition as Proposition 3 (GCD Of One (GCD OO))
Let a and b be integers.
1. If gcd(a, b) = 1, then there are integers x and y with ax + by = 1.
2. If there are integers x and y with ax + by = 1, then gcd(a, b) = 1. In statement (1), there is an existential quantiﬁer in the conclusion, so we would expect to
use the Construction Method. The problem is “Where do we get x and y ?” In the previous
proof, we used the EEA and it makes sense to use it here as well. By the EEA and the
hypothesis gcd(a, b) = 1, there exist integers x and y so that ax + by = 1. 88 Chapter 10 Properties Of GCDs In statement (2), an existential quantiﬁer occurs in the hypothesis so we can assume the
existence of integers x and y so that ax + by = 1. Also, 1  a and 1  b. These are exactly the
hypotheses of the GCD Characterization Theorem, so we can conclude that gcd(a, b) = 1.
Here is a proof of the GCD Of One proposition.
Proof: Since gcd(a, b) = 1, the EEA assures the existence of integers x and y so that
ax + by = 1. Statement 1 is proved.
Now, 1  a and 1  b. Also, by the hypothesis of Statement 2, there exist integers x and y so
that ax + by = 1. These are exactly the hypotheses of the GCD Characterization Theorem,
so we can conclude that gcd(a, b) = 1 and Statement 2 is proved. REMARK
This proof illustrates the connection between the GCD Characterization Theorem and the
Extended Euclidean Algorithm. Both assume integers a and b. The GCD Characterization
Theorem starts with an integer d where d  a, d  b and integers x and y so that ax + by = d
and concludes that d = gcd(a, b). The Extended Euclidean Algorithm computes a d so that
d = gcd(a, b), hence it produces a d so that d  a and d  b, and also computes integers x
and y so that ax + by = d.
So, if we encounter a gcd in the conclusion, we can try the GCD Characterization Theorem.
If we encounter a gcd in the hypothesis, we can try the Extended Euclidean Algorithm. Exercise 1 Proposition 4 Prove the following proposition. Compare your proof with the proof that follows. (Division by the GCD (DB GCD))
Let a and b be integers. If gcd(a, b) = d = 0, then gcd Proof: First, observe that gcd ab
,
dd ab
,
dd = 1. is meaningful. Since d  a and d  b, both b
a
and
d
d are integers.
We will use the GCD Characterization Theorem. Since gcd(a, b) = d, the EEA assures the
existence of integers x and y so that ax + by = d. Dividing by d gives
a
b
x+ y =1
d
d
Since 1 divides both
gcd ab
,
dd = 1. a
b
and , the GCD Characterization Theorem implies that
d
d Section 10.2 Some Useful Propositions Exercise 2 89 This exercise illustrates the use of Proof by Elimination and proves a very useful proposition
that follows from Coprimeness and Divisibility.
1. Prove that
A ⇒ B ∨ C ≡ (A ⇒ B ) ∨ (A ⇒ C ) ≡ ¬(A ⇒ B ) ∧ (A ⇒ C )
2. A true statement of the form A ⇒ B ∨ C has two cases: A ⇒ B OR A ⇒ C . One
way to prove a statement of the form A ⇒ B ∨ C is to show that one of the two cases
must hold. This is often done by proving the statement
¬(A ⇒ B ) ∧ (A ⇒ C ) which is equivalent to proving “If the ﬁrst case is not true, then
the second case must be true.” This technique is called Proof By Elimination since
one of the two cases is eliminated. With this in mind prove the proposition Primes
and Divisibility below. Begin your proof with “Suppose p a. We must show” Proposition 5 (Primes and Divisibility (PAD))
If p is a prime and p  ab, then p  a or p  b. Chapter 11 Linear Diophantine Equations
11.1 Objectives The technique objectives are:
1. To practice working with universal quantiﬁers.
2. To practice working with subsets.
The content objectives are:
1. Prove Coprimeness and Divisibility paying attention to the universal quantiﬁer.
2. Deﬁne Diophantine equations.
3. Prove the Linear Diophantine Equation Theorem (Part 1)
4. Discover a proof to the Linear Diophantine Equation Theorem (Part 2).
5. Examples of the Linear Diophantine Equation Theorem. 11.2 The Select Method We have already proved Proposition 1 (Coprimeness and Divisibility (CAD))
If a, b and c are integers and c  ab and gcd(a, c) = 1, then c  b. Let’s restate the proposition using a universal quantiﬁer. Proposition 2 (Coprimeness and Divisibility)
For all integers a, b and c where c  ab and gcd(a, c) = 1, c  b. 90 Section 11.2 The Select Method 91 REMARK
Whenever we encounter a universal quantiﬁer, we use the Select Method. To prove a
statement of the form
For every x in the set S , P (x) is true.
we should
1. Identify the four parts of the quantiﬁed statement.
2. Select a representative mathematical object x ∈ S . This cannot be a speciﬁc object.
It has to be a placeholder so that our argument would work for any speciﬁc member
of S . Note that if the the set S is empty, we proceed no further. The statement is
vacuously true.
3. Show that P (x) is true. Let’s see how the Select Method is used in the following proof, most of which you have seen
before.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Let a, b and c be integers where c  ab and gcd(a, c) = 1.
2. By the Extended Euclidean Algorithm and gcd(a, c) = 1, there exist integers x and y
so that ax + cy = 1.
3. Multiplying by b gives abx + cby = b.
4. Since c  ab there exists an integer h so that ch = ab.
5. Substituting ch for ab gives chx + cby = b.
6. Lastly, factoring produces c(hx + by ) = b.
7. Since hx + by is an integer, c  b. Here is an analysis.
Analysis of Proof The statement begins with a quantiﬁer so we should ﬁrst identify the
four parts of the quantiﬁed statement.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∀
a, b, c
Z
If c  ab and gcd(a, c) = 1, then c  b. 92 Chapter 11 Linear Diophantine Equations The open sentence is an implication so let’s identify the hypothesis and conclusion as
well as the core proof technique and preliminary material.
Hypothesis: c  ab and gcd(a, c) = 1.
Conclusion: c  b.
Core Proof Technique: We begin with the Select Method. We also use the Object
Method because of the implicit existential quantiﬁer in the hypothesis (c  ab)
and the Construct Method because of the implicit existential quantiﬁer in teh
conclusion (c  b).
Preliminary Material: Deﬁnitions of divide and gcd.
Sentence 1 Let a, b and c be integers where c  ab and gcd(a, c) = 1.
This follows exactly the plan of the Select Method. We begin by selecting representative objects in the domain. We end by showing that, for the chosen objects, the open
sentence is true. This part appears in Sentence 7.
Sentences 2 – 6 These appear just as they did in the original proof of Coprimeness and
Divisibility (Proposition 1)
Sentence 7 Since hx + by is an integer, c  b.
The important part of this sentence is the demonstration that the open sentence is
true.
There are some important remarks to make here.
• Just as in English, there is often more than one way to say the same thing.
• Quantiﬁers are often implicit or hidden.
• Condensed proofs typically do not illustrate the discovery process or explicitly identify
techniques. 11.3 Linear Diophantine Equations In high school, you looked at linear equations that involved real numbers. We will look at
linear equations involving only integers. Deﬁnition 11.3.1
Diophantine
Equations Equations with integer coeﬃcients for which integer solutions are sought, are called Diophantine equations after the Greek mathematician, Diophantus of Alexandria, who studied such equations. Diophantine equations are called linear if each term in the equation is
a constant or a constant times a single variable of degree 1. The simplest linear Diophantine equation is
ax = b
To emphasize, a, b ∈ Z and we want an x ∈ Z that solves ax = b. From the deﬁnition of
divisibility, we know that this equation has an integer solution x if and only if a  b. Section 11.3 Linear Diophantine Equations 93 What about linear Diophantine equations with two variables?
ax + by = c Theorem 3 (Linear Diophantine Equation Theorem, Part 1 (LDET 1))
Let gcd(a, b) = d. The linear Diophantine equation
ax + by = c
has a solution if and only if d  c. Before we study a proof of this theorem, let’s see how it works in practice. Example 1 Which of the following linear Diophantine equations has a solution?
1. 33x + 18y = 10
2. 33x + 18y = 15
Solution:
1. Since gcd(33, 18) = 3, and 3 does not divide 10, the ﬁrst equation has no integer
solutions.
2. Since gcd(33, 18) = 3, and 3 does divide 15, the second equation does have an integer
solution. But how do we ﬁnd a solution? Here are two simple steps that will allow us to ﬁnd a
solution.
1. Use the Extended Euclidean Algorithm to ﬁnd d = gcd(a, b) and x1 and y1 where
ax1 + by1 = d.
2. Multiply by k = c
to get akx1 + bky1 = kd = c. A solution is x = kx1 and y = ky1 .
d Returning to the exercise, the Extended Euclidean Algorithm gives
x
y
rq
1
0
33 0
0
1
18 0
1
−1 15 1
−1
2
31
6 −11 0 5
hence
33 × −1 + 18 × 2 = 3 94 Chapter 11 Linear Diophantine Equations Multiplying by k = c/d = 15/3 = 5 gives
33 × −5 + 18 × 10 = 15
so one particular solution is x = −5 and y = 10.
But are there more solutions? That’s where Part 2 of the Linear Diophantine Equation
Theorem comes in and we will cover it later.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. First, suppose that the linear Diophantine equation ax + by = c has an integer solution
x = x0 , y = y0 . That is, ax0 + by0 = c.
2. Since d = gcd(a, b), d  a and d  b.
3. But then, by the Divisibility of Integer Combinations, d  (ax0 + by0 ). That is d  c.
4. Conversely, suppose that d  c.
5. Then there exists an integer k such that c = kd.
6. Now, by the Extended Euclidean Algorithm, there exist integers x1 and y1 so that
ax1 + by1 = d.
7. Multiplying this equation by k gives
akx1 + bky1 = kd = c
which, in turn, implies that x = kx1 and y = ky1 is a solution to ax + by = c. Let’s perform an analysis of this proof.
Analysis of Proof This is an “if and only if” statement so we must prove two statements.
1. If the linear Diophantine equation ax + by = c has a solution, then d  c.
2. If d  c, then the linear Diophantine equation ax + by = c has a solution.
Core Proof Technique: Both statements contain an existential quantiﬁer in the
hypothesis, so each will start with the Object Method. Though both statements
also contain an existential quantiﬁer in the conclusion, only one uses the Construction Method. The other uses a proposition we have already proved.
Sentence 1 First, suppose that the linear Diophantine equation ax + by = c has an integer
solution x = x0 , y = y0 . That is, ax0 + by0 = c.
The author does not explicitly rephrase the “if and only if” as two statements. Rather,
Sentence 1 indicates which of the two implicit statements will be proved by stating the
hypothesis of Statement 1. Moreover, the ﬁrst statement uses an existential quantiﬁer
in the hypothesis. The hypothesis of the ﬁrst statement could be restated as Section 11.3 Linear Diophantine Equations 95 there exists an integer solution to the linear Diophantine equation
The four parts are
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
x0 , y0
Z
ax0 + by0 = c. Since the existential quantiﬁer occurs in the hypothesis, the author uses the Object
Method. The author assumes the existence of the corresponding objects (x0 , y0 ) in a
suitable domain (Z) and that these objects satisfy the related open sentence (ax0 +
by0 = c).
Sentence 2 Since d = gcd(a, b), d  a and d  b.
This follows from the deﬁnition of gcd.
Sentence 3 But then, by the Divisibility of Integer Combinations, d  (ax0 + by0 ). That is
d  c.
Since hypotheses of DIC (a, b and d are integers, and d  a and d  b) are satisﬁed,
the author can invoke the conclusion of DIC (d  (ax0 + by0 )). And from Sentence 1,
ax0 + by0 = c so d  c.
Sentence 4 Conversely, suppose that d  c.
The conversely indicates that the author is about to prove Statement 2. Recall that
an “if and only if” always consists of a statement and its converse. The hypothesis of
the converse is d  c. The deﬁnition of divides contains an existential quantiﬁer and
so, in Sentence 5, the authors uses the Object Method. The conclusion of Statement
2 contains an existential quantiﬁer (there exists an integer solution to the linear Diophantine equation), so the author uses the Construction Method and builds a suitable
solution. Here are the parts of the existential quantiﬁer in the conclusion.
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
x, y
Z
ax + by = c. Sentence 5 Then there exists an integer k such that c = kd.
This is the Object Method and follows from the deﬁnition of divisibility.
Sentence 6 Now, by the Extended Euclidean Algorithm, there exist integers x1 and y1 so
that
ax1 + by1 = d.
This is prior knowledge.
Sentence 7 Multiplying this equation by k gives
akx1 + bky1 = kd = c
which, in turn, implies that x = kx1 and y = ky1 is a solution to ax + by = c.
This is where the solution is constructed, x = kx1 and y = ky1 , and where the
open sentence is veriﬁed. The author does not explicitly check that kx1 and kx2 are
integers, though we must when we analyse the proof. 96 Chapter 11 Linear Diophantine Equations LDET 1 tells us when solutions exist and how to construct a solution. It does not ﬁnd all
of the solutions. That happens next. Theorem 4 (Linear Diophantine Equation Theorem, Part 2, (LDET 2))
Let gcd(a, b) = d = 0. If x = x0 and y = y0 is one particular integer solution to the linear
Diophantine equation ax + by = c, then the complete integer solution is
b
a
x = x0 + n, y = y0 − n, ∀n ∈ Z.
d
d Before we discover a proof, let’s make sure we understand the statement. Example 2 Find all solutions to 33x + 18y = 15.
Solution: Since gcd(33, 18) = 3, and 3 does divide 15, this equation does have integer
solutions by the Linear Diophantine Equation Theorem, Part 1. If we can ﬁnd one solution,
we can use the Linear Diophantine Equation Theorem, Part 2 to ﬁnd all solutions. Since
we earlier found the solution x = −5 and y = 10 the complete solution is
{(x, y )  x = −5 + 6n, y = 10 − 11n, n ∈ Z}
You we can check that these are solutions by substitution.
Check:
33x + 18y = 33(−5 + 6n) + 18(10 − 11n) = −165 + 198n + 180 − 198n = 15
This check does not verify that we have found all solutions. It veriﬁes that all of the pairs
f integers we have fund are solutions. The expression “complete integer solution” in the statement of LDET 2 hides the use of
sets. Let’s be explicit about those sets and what we need to do with them. There are, in
fact, two sets in the conclusion, the set of solutions and the set of x and y pairs. We deﬁne
them formally as follows.
Complete solution Let S = {(x, y )  x, y ∈ Z, ax + by = c}
b
Proposed solution Let T = {(x, y )  x = x0 + d n, y = y0 − a n, ∀n ∈ Z}
d The conclusion of LDET 2 is S = T .
How do we show that two sets are equal? Two sets S and T are equal if and only if S ⊆ T
and T ⊆ S . That is, at the risk of being repetitive, to establish that S = T we must show
two things.
1. S ⊆ T and
2. T ⊆ S Section 11.3 Linear Diophantine Equations 97 Normally one of the two is easy and the other is harder.
Suppose we want to show S ⊆ T . How do universal quantiﬁers ﬁgure in? Showing that
S ⊆ T is equivalent to the following statement. Proposition 5 S ⊆ T if and only if, for every member s ∈ S , s ∈ T . If you prefer symbolic notation you could write ∀s ∈ S, s ∈ T or s ∈ S ⇒ s ∈ T .
What are the components of the universal quantiﬁer in Proposition 5?
Quantiﬁer:
Variable:
Domain:
Open sentence: ∀
s
S
s∈T The Select Method works perfectly in these situations.
As frequently as sets are used, they are usually implicit and our ﬁrst task is to discern what
sets exist and how they are used. Let’s return to the proof of LDET 2 where our sets are:
Complete solution Let S = {(x, y )  x, y ∈ Z, ax + by = c}
b
Proposed solution Let T = {(x, y )  x = x0 + d n, y = y0 − a n, ∀n ∈ Z}
d Let us discover a proof. We must keep in mind that we have two things to prove
1. S ⊆ T and
2. T ⊆ S
In this case, item 2 is easier so we will do it ﬁrst. How do we show that T ⊆ S ? We must
show that x ∈ T ⇒ x ∈ S . We certainly don’t want to individually check every element of
T so we choose a representative element of T , one that could be replaced by any element of
T and the subsequent argument would hold. This is just the Select Method and it provides
our ﬁrst statement.
b
Let n0 ∈ Z. Then (x0 + d n0 , y0 − a n0 ) ∈ T .
d To show that this element is in S we must show that the element satisﬁes the deﬁning
property of S , that is, the element is a solution.
b
ax + by = a x0 + n0
d a
+ b y0 − n 0
d
ab
ab
= ax0 + by0 + n0 − n0
d
d
= ax0 + by0
=c And now we can conclude by hypothesis, x = x0 and y = y0 is an integer solution 98 Chapter 11 Linear Diophantine Equations b
(x0 + d n0 , y0 − a n0 ) ∈ S .
d To show that S ⊆ T we will need to recall the following proposition on Division by the
GCD (Proposition 4). Proposition 6 (Division by the GCD)
ab
d, d Let a and b be integers. If gcd(a, b) = d = 0, then gcd =1 Let’s begin our analysis of S ⊆ T . How do we show that S ⊆ T ? We choose a representative
element in S and show that it is in T , that is, that it satisﬁes the deﬁning property of T .
b
Speciﬁcally, we must show that an arbitrary solution (x, y ) has the form (x0 + d n, y0 − a n).
d
Let (x, y ) be an arbitrary solution. Then (x, y ) ∈ S and we must show (x, y ) ∈ T . Let
(x0 , y0 ) be a particular solution to the linear Diophantine equation ax + by = c. The
existence of (x0 , y0 ) is assured by the hypothesis. Let’s do the obvious thing and substitute
both solutions into the equation.
ax + by = c
ax0 + by0 = c
Eliminating c and factoring gives
a(x − x0 ) = −b(y − y0 )
b
a
We know that d = gcd(a, b) is a common factor of a and b so and are both integers.
d
d
Dividing the previous equation by d gives
a
b
(x − x0 ) = − (y − y0 )
d
d
Using Division by the GCD, gcd
Coprimeness and Divisibility that ab
d, d = 1. Since b
d divides (11.1)
a
d (x b
divides (x − x0 )
d
By the deﬁnition of divisibility, there exists an n ∈ Z so that
x − x0 = n b
b
⇒ x = x0 + n
d
d b
Also, substituting n d for x − x0 in Equation (11.1) yields a
y = y0 − n
d
b
So every solution is of the form (x, y ) = (x0 + d n0 , y0 − a n0 ) and so
d − x0 ) we know from Section 11.3 Linear Diophantine Equations 99 (x, y ) ∈ T
A very condensed proof of Linear Diophantine Equation Theorem, Part 2 might look like
the following. Notice the lack of mention of sets. Theorem 7 (Linear Diophantine Equation Theorem, Part 2, (LDET 2))
Let gcd(a, b) = d = 0. If x = x0 and y = y0 is one particular integer solution to the linear
Diophantine equation ax + by = c, then the complete integer solution is
b
a
x = x0 + n, y = y0 − n, ∀n ∈ Z.
d
d b
Proof: Substitution shows that integers of the form x = x0 + n d , y = y0 − a n, n ∈ Z are
d
solutions. Now, let (x, y ) be an arbitrary solution and let (x0 , y0 ) be a particular solution to the linear
Diophantine equation ax + by = c. Then
ax + by = c
ax0 + by0 = c
Eliminating c and factoring gives a(x − x0 ) = −b(y − y0 ) (1). Dividing by d and using
b
Division by the GCD and Coprimeness and Divisibility we have d  (x − x0 ). Hence, there
b
exists an n ∈ Z so that x = x0 + d n (2). Substituting (2) in (1) gives y = y0 − a n0 as
d
needed. Exercise 1 Find all solutions to
1. 35x + 21y = 28
2. 35x − 21y = 28 Chapter 12 Practice, Practice, Practice:
Quantiﬁers and Sets
12.1 Objectives This class provides an opportunity to practice working with quantiﬁers and sets. 12.2
Exercise 1 Exercises For each of the following statements, identify each quantiﬁer, its parts and your approach
to a proof of the statement.
1. For every integer a, 2  a(a + 1).
2. If n is an integer, then 8  (52n + 7).
3. If there exist integer solutions to the Diophantine equation ax2 + by 2 = c, then
gcd(a, b)  c. Exercise 2 For each of the following deﬁnitions, identify each quantiﬁer, its parts and the proof techniques that you would use to prove that a speciﬁc object satisﬁes the deﬁnition.
1. Saying that the function f of one real variable is bounded above means that there
is a real number y such that for every real number x, f (x) ≤ y .
2. Saying that a set of real numbers S is bounded means that there is a real number
M > 0 such that for every element s ∈ S , s < M .
3. Saying that the function f of one real variable is continuous at the point x means
that for every real number ε > 0 there is a real number δ > 0 such that, for all real
numbers y with x − y  < δ , f (x) − f (y ) < . 100 Section 12.2 Exercises Exercise 3 101 Prove each of the following propositions.
1. Suppose a and b are ﬁxed integers. Then
{ax + by  x, y ∈ Z} = {n · gcd(a, b)  n ∈ Z}.
2. An integer p > 1 is called a prime if its only positive divisors are 1 and p; otherwise
it is called composite.
Let a and b be ﬁxed integers. If p is a prime and p  ab, then p  a or p  b. Exercise 4 Solve the following problems.
1. Find the complete solution to 7x + 11y = 3.
2. Find the complete solution to 35x − 42y = 14.
3. Find the complete solution to 28x + 60y = 10.
4. For what value of c does 8x + 5y = c have exactly one solution where both x and y
are strictly positive? Exercise 5 The proof of the following statement is incomplete. Identify two sets used in the statement
and proof (they are used implicitly) and state why the proof is incomplete.
Let a, b, c ∈ R, a = 0 and b2 − 4ac ≥ 0. Then the quadratic equation
ax2 + bx + c = 0
has the solution
x= −b ± √ b2 − 4ac
2a Proof: To show that a particular value is a solution, it is enough to substitute that value
into the equation and show that the equation is satisﬁed. Consider
√
−b + b2 − 4ac
x=
2a
Substitution gives
√
√
2
−b + b2 − 4ac
−b + b2 − 4ac
a
+b
+c
2a
2a
√
√
a(b2 − 2b b2 − 4ac + b2 − 4ac) −b2 + b b2 − 4ac
=
+
+c
4a2
2
√
√a
b2 − 2b b2 − 4ac + b2 − 4ac −2b2 + 2b b2 − 4ac 4ac
=
+
+
4a
4a
4a
=0 102 Chapter 12 Practice, Practice, Practice: Quantiﬁers and Sets Since a similar result holds for
x=
the proposition holds. −b − √ b2 − 4ac
2a Chapter 13 Congruence
13.1 Objectives The content objectives are:
1. Deﬁne a is congruent to b modulo m.
2. Read a proof of Congruence is an Equivalence Relation.
3. Discover the proof of Properties of Congruence.
4. Read the proof of Congruences and Division.
5. Read the proof of Congruent Iﬀ Same Remainder.
6. Do examples. 13.2 Congruences 13.2.1 Deﬁnition of Congruences One of the diﬃculties in working out properties of divisibility is that we don’t have an
“arithmetic” of divisibility. Wouldn’t it be nice if we could resolve problems about divisibility in much the same way that we usually do arithmetic: add, subtract, multiply and
divide?
Carl Friedrich Gauss (1777  1855) was the greatest mathematician of the last two centuries. In a landmark work, Disquisitiones Arithmeticae, published when Gauss was 23, he
introduced congruences and provided a mechanism to treat divisibility with arithmetic. Deﬁnition 13.2.1
Congruent Let m be a ﬁxed positive integer. If a, b ∈ Z we say that a is congruent to b modulo m,
and write
a ≡ b (mod m)
if m  (a − b). If m (a − b), we write a ≡ b (mod m). 103 104 Chapter 13 Example 1 Congruence Verify each of the following
1. 20 ≡ 2 (mod 6)
2. 2 ≡ 20 (mod 6)
3. 20 ≡ 8 (mod 6)
4. −20 ≡ 4 (mod 6)
5. 24 ≡ 0 (mod 6)
6. 5 ≡ 3 (mod 7) Question Panel here REMARK
One already useful trait of this deﬁnition is the number of equivalent ways we have to work
with it.
a ≡ b (mod m)
⇐⇒ m  (a − b)
⇐⇒ ∃k ∈ Z
⇐⇒ ∃k ∈ Z 13.3 a − b = km
a = km + b Elementary Properties Another extraordinarily useful trait of this deﬁnition is that it behaves a lot like equality.
Equality is an equivalence relation. That is, it has the following three properties:
1. reﬂexivity, a = a.
2. symmetry, If a = b then b = a.
3. transitivity, If a = b and b = c, then a = c.
Most relationships that you can think of do not have these three properties. The relation
greater than fails reﬂexivity. The relation divides fails symmetry. The nonmathematical
relation is a parent of fails transitivity. Proposition 1 (Congruence Is An Equivalence Relation (CER))
Let a, b, c ∈ Z. Then
1. a ≡ a (mod m). Section 13.3 Elementary Properties 105 2. If a ≡ b (mod m), then b ≡ a (mod m).
3. If a ≡ b (mod m) and b ≡ c (mod m), then a ≡ c (mod m) These may seem obvious but as the earlier examples showed, many relations do not have
these properties. So, a proof is needed. We will give a condensed proof for all of them, and
then an analysis for part 3.
Proof: We show each part in turn.
1. Because a − a = 0 and m  0, the deﬁnition of congruence gives a ≡ a (mod m).
2. Since a ≡ b (mod m), m  (a − b) which in turn implies that there exists k ∈ Z so
that km = a − b. But if km = a − b, then (−k )m = b − a and so m  (b − a). By the
deﬁnition of congruence, b ≡ a (mod m).
3. Since a ≡ b (mod m), m  (a − b). Since b ≡ c (mod m), m  (b − c). Now, by the
Divisibility of Integer Combinations, m  ((1)(a − b) + (1)(b − c)) so m  (a − c). By
the deﬁnition of congruence, a ≡ c (mod m). Analysis of Proof We will prove part 3 of the proposition Congruence Is An Equivalence
Relation.
Hypothesis: a, b, c ∈ Z, a ≡ b (mod m) and b ≡ c (mod m).
Conclusion: a ≡ c (mod m).
Sentence 1 Since a ≡ b (mod m), m  (a − b).
The author is working forward from the hypothesis using the deﬁnition of congruence.
Sentence 2 Since b ≡ c (mod m), m  (b − c).
The author is working forward from the hypothesis using the deﬁnition of congruence.
Sentence 3 Now, by the Divisibility of Integer Combinations, m  ((1)(a − b) + (1)(b − c))
so m  (a − c).
Here it is useful to keep in mind where the author is going. The question “How do I
show that one number is congruent to another number?” has the answer, in this case,
of showing that m  (a − c) so the author needs to ﬁnd a way of generating a − c. And
a − c follows nicely from an application of the Divisibility of Integer Combinations.
Sentence 4 By the deﬁnition of congruence, a ≡ c (mod m).
The author is working forward from m  (a − c) using the deﬁnition of congruence. Proposition 2 (Properties of Congruence (PG))
If a ≡ a (mod m) and b ≡ b (mod m), then 106 Chapter 13 Congruence 1. a + b ≡ a + b (mod m)
2. a − b ≡ a − b (mod m)
3. ab ≡ a b (mod m) We will discover a proof of the third part and leave the ﬁrst two parts as exercises.
As usual we begin by identifying the hypothesis and the conclusion.
Hypothesis: a ≡ a (mod m) and b ≡ b (mod m)
Conclusion: ab ≡ a b (mod m)
Let’s consider the question “How do we show that two numbers are congruent to one
another?” The obvious abstract answer is “Use the deﬁnition of congruent.” We may want
to keep in mind, however, that there are several equivalent forms.
a ≡ b (mod m)
⇐⇒ m  (a − b)
⇐⇒ ∃k ∈ Z a − b = km ⇐⇒ ∃k ∈ Z a = km + b It is not at all clear which is best or whether, in fact, several could work. Since the
conclusion of part three involves the arithmetic operation of multiplication, and we don’t
have multiplication properties for equivalence or divisibility, it makes sense to consider
either the third or fourth of the equivalent forms. There isn’t much to separate them. I’ll
choose the last form and see how it works. So, the answer to “How do we show that two
numbers are congruent to one another?” in the notation of this proof is “We must ﬁnd an
integer k so that ab = km + a b . Let’s record that.
Proof in Progress
1. To be completed.
2. Since there exists k so that ab = km + a b , ab ≡ a b (mod m).
The problem is how to ﬁnd k . There is no obvious way backwards here so let’s start working
forward. The two hypotheses a ≡ a (mod m) and b ≡ b (mod m) can be restated in any
of their equivalent forms. Since we have already decided that we would work backwards
with the fourth form, it makes sense to use the same form working forwards. That gives
two statements.
Proof in Progress
1. Since a ≡ a (mod m), there exists an integer j such that a = mj + a (1).
2. Since b ≡ b (mod m), there exists an integer h such that b = mh + b (2).
3. To be completed. Section 13.3 Elementary Properties 107 4. Since there exists k so that ab = km + a b , ab ≡ a b (mod m).
But now there seems to be a rather direct way to produce an ab and an a b which we want
for the conclusion. Just multiply equations (1) and (2) together. Doing that produces
ab = m2 jh + mjb + a mh + a b = (mjh + jb + a h)m + a b
If we let k = mjh + jb + a h then k is an integer and satisﬁes the property we needed in
the last line of the proof, that is ab = km + a b . Let’s record this.
Proof in Progress
1. Since a ≡ a (mod m), there exists an integer j such that a = mj + a (1).
2. Since b ≡ b (mod m), there exists an integer h such that b = mh + b (2).
3. Multiplying (1) by (2) gives ab = m2 jh + mjb + a mh + a b = (mjh + jb + a h)m + a b .
4. Since there exists k so that ab = km + a b , ab ≡ a b (mod m).
Lastly, we write a condensed proof. Note that the reader of the proof is expected to be
familiar with the equivalent forms.
Proof: Since a ≡ a (mod m), there exists an integer j such that a = mj + a (1). Since
b ≡ b (mod m), there exists an integer h such that b = mh + b (2). Multiplying (1) by (2)
gives
ab = m2 jh + mjb + a mh + a b = (mjh + jb + a h)m + a b .
Since mjh + jb + a h is an integer, ab ≡ a b (mod m). Exercise 1 Prove the remainder of the Properties of Congruence proposition. There are four arithmetic operations with integers, but analogues to only three have been
given. It turns out that division is problematic. A statement of the form
ab ≡ ab (mod m) ⇒ b ≡ b (mod m) seems natural enough, simply divide by a. This works with the integer equation ab = ab .
But consider the case where m = 12, a = 6, b = 3 and b = 5. It is indeed true that
18 ≡ 30 (mod 12) and so
6×3≡6×5 (mod 12) but “dividing” by 6 gives the clearly false statement
3≡5 (mod 12). Division works only under the speciﬁc conditions of the next proposition. 108 Chapter 13 Proposition 3 Congruence (Congruences and Division (CD))
If ac ≡ bc (mod m) and gcd(c, m) = 1, then a ≡ b (mod m). Before we read the proof, let’s look at an example. Example 2 Examples of division in congruence relations.
1. 8 × 7 ≡ 17 × 7 (mod 3) ⇒ 8 ≡ 17 (mod 3)
2. For 6 × 3 ≡ 6 × 5 (mod 12), CD cannot be invoked. Why? Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Since ac ≡ bc (mod m), m  (ac − bc). That is, m  c(a − b).
2. By the proposition Coprimeness and Divisibility, m  (a − b).
3. Hence, by the deﬁnition of congruence a ≡ b (mod m). Exercise 2 Analyze the proof of the proposition on Congruences and Division. We now give one more statement that is equivalent to a ≡ b (mod m). Proposition 4 (Congruent Iﬀ Same Remainder (CISR))
a ≡ b (mod m) if and only if a and b have the same remainder when divided by m. Because this proposition is an “if and only if” proposition, there are two parts to the proof:
a statement and its converse. We can restate the proposition to make the two parts more
explicit. Proposition 5 (Congruent Iﬀ Same Remainder (CISR))
1. If a ≡ b (mod m), then a and b have the same remainder when divided by m.
2. If a and b have the same remainder when divided by m, then a ≡ b (mod m). Section 13.3 Elementary Properties 109 In practice, the two statements are not usually written out separately. The authors assume
that you do that whenever you read “if and only if”. Many “if and only if” proofs begin
with some prefatory material that will help both parts of the proof. For example, they often
introduce notation that will be used in both parts.
Let’s look at a proof of the Congruent Iﬀ Same Remainder proposition. Before we do an
analysis, make sure that you can identify
1. prefatory material (if any exists)
2. the proof of a statement
3. the proof of the converse of the statement
Proof: The Division Algorithm applied to a and m gives
a = q1 m + r1 , where 0 ≤ r1 < m
The Division Algorithm applied to b and m gives
b = q2 m + r2 , where 0 ≤ r2 < m
Subtracting the second equation from the ﬁrst gives
a − b = (q1 − q2 )m + (r1 − r2 ), where − m < r1 − r2 < m
If a ≡ b (mod m), then m  (a − b) and there exists an integer h so that hm = a − b. Hence
a − b = (q1 − q2 )m + (r1 − r2 ) ⇒ hm = (q1 − q2 )m + (r1 − r2 ) ⇒ r1 − r2 = m(h − q1 + q2 )
which implies m  (r1 − r2 ). But, −m < r1 − r2 < m so r1 − r2 = 0.
Conversely, if a and b have the same remainder when divided by m, then r1 = r2 and
a − b = (q1 − q2 )m so a ≡ b (mod m). The prefatory material is quoted below.
The Division Algorithm applied to a and m gives
a = q1 m + r1 , where 0 ≤ r1 < m
The Division Algorithm applied to b and m gives
b = q2 m + r2 , where 0 ≤ r2 < m
Subtracting the second equation from the ﬁrst gives
a − b = (q1 − q2 )m + (r1 − r2 ), where − m < r1 − r2 < m
The proof of Statement 1 is 110 Chapter 13 Congruence If a ≡ b (mod m), then m  (a − b) and there exists an integer h so that
hm = a − b. Hence
a−b = (q1 −q2 )m+(r1 −r2 ) ⇒ hm = (q1 −q2 )m+(r1 −r2 ) ⇒ r1 −r2 = m(h−q1 +q2 )
which implies m  (r1 − r2 ). But, −m < r1 − r2 < m so r1 − r2 = 0.
The proof of the converse of Statement 1, Statement 2, is
Conversely, if a and b have the same remainder when divided by m, then r1 = r2
and a − b = (q1 − q2 )m so a ≡ b (mod m).
We will do an analysis of the proof of Statement 1. An analysis of the proof Statement 2 is
left as an exercise.
Analysis of Proof In many “if and only if” statements one direction is much easier than
the other. In this particular case, we are starting with the harder of the two directions.
Hypothesis: a ≡ b (mod m).
Conclusion: a and b have the same remainder when divided by m.
Sentence 1 If a ≡ b (mod m), then m  (a − b) and there exists an integer h so that
hm = a − b.
Here the author is working forwards using two deﬁnitions. The deﬁnition of congruence allows the author to assert that “If a ≡ b (mod m), then m  (a − b)”. The
deﬁnition of divisibility allows the author to assert that “m  (a − b) [implies that]
there exists an integer h so that hm = a − b.”
Sentence 2 Hence
a − b = (q1 − q2 )m + (r1 − r2 ) ⇒ hm = (q1 − q2 )m + (r1 − r2 ) ⇒ r1 − r2 = m(h − q1 + q2 )
which implies m  (r1 − r2 ).
This is mostly arithmetic. The author begins with a − b = (q1 − q2 )m + (r1 − r2 ) from
the prefatory paragraph, substitutes hm for a − b, isolates r1 − r2 and factors out an
m from the remaining terms. Since h − q1 + q2 is an integer, the author deduces that
m  (r1 − r2 ).
Sentence 3 But, −m < r1 − r2 < m so r1 − r2 = 0.
This part is not so obvious. The author is working with two pieces of information.
The prefatory material provides −m < r1 − r2 < m. Sentence 2 provides m  (r1 − r2 ).
Now, what are the possible values of r1 − r2 ? Certainly r1 − r2 can be zero but are
there any other possible choices? If there were another choice it would be of the form
mx with x = 0. But that would make r1 − r2 = xm > m or r1 − r2 = xm < −m both
of which are impossible because −m < r1 − r2 < m. Hence, r1 − r2 = 0.
The conclusion does not say r1 − r2 = 0. It says that a and b have the same remainder
when divided by m. Since r1 and r2 are those remainders, and r1 − r2 = 0 ⇒ r1 = r2 ,
the author leaves it to the reader to deduce the conclusion. Section 13.3 Elementary Properties Exercise 3 111 Perform an analysis of the proof of Statement 2. REMARK
The proposition Congruent Iﬀ Same Remainder gives us another part to our chain of equivalent statements.
a ≡ b (mod m)
⇐⇒ m  (a − b)
⇐⇒ ∃k ∈ Z a − b = km ⇐⇒ ∃k ∈ Z a = km + b ⇐⇒ a and b have the same remainder when divided by m The propositions covered in this lecture are surprisingly powerful. Consider the following
example. Example 3 What is the remainder when 347 is divided by 7?
Solution: You could attempt to compute 347 with your calculator but it might explode.
Here is a simpler way. First, recognize that the remainder when 347 is divided by 7 is just
347 (mod 7). Now observe that 32 ≡ 2 (mod 7) and 33 ≡ 3 × 2 ≡ 6 ≡ −1 (mod 7). But
then
347 ≡ 345 32 ≡ (33 )15 32 ≡ (−1)15 32 ≡ (−1)(2) ≡ −2 ≡ 5 (mod 7)
Hence, the remainder when 347 is divided by 7 is 5. Chapter 14 Modular Arithmetic
14.1 Objectives The content objectives are:
1. Deﬁne the congruence class modulo m.
2. Construct Zm and perform modular arithmetic. Highlight the role of additive and
multiplicative identities, and additive and multiplicative inverses.
3. State Fermat’s Little Theorem.
4. Read a proof to a corollary of Fermat’s Little Theorem.
5. Discover a proof to the Existence of Inverses in Zp . 14.2 Modular Arithmetic In this section we will see the creation of a number system which will likely be new to you. Deﬁnition 14.2.1 The congruence class modulo m of the integer a is the set of integers Congruence Class Example 1 [a] = {x ∈ Z  x ≡ a (mod m)} For example, when m = 4
[0]
[1]
[2]
[3] =
=
=
= {x ∈ Z  x ≡ 0 (mod m)} =
{x ∈ Z  x ≡ 1 (mod m)} =
{x ∈ Z  x ≡ 2 (mod m)} =
{x ∈ Z  x ≡ 3 (mod m)} = {. . . , −8, −4, 0, 4, 8, . . .}
{. . . , −7, −3, 1, 5, 9, . . .}
{. . . , −6, −2, 2, 6, 10, . . .}
{. . . , −5, −1, 3, 8, 11, . . .} 112 =
=
=
= {4k  k ∈ Z}
{4k + 1  k ∈ Z}
{4k + 2  k ∈ Z}
{4k + 3  k ∈ Z} Section 14.2 Modular Arithmetic 113 REMARK
Note that congruence classes have more than one representation. In the example above
[0] = [4] = [8] and, in fact [0] has inﬁnitely many representations. If this seems strange to
you, remember that fractions are another example of where one number has inﬁnitely many
representations. For example 1/2 = 2/4 = 3/6 = · · · . Deﬁnition 14.2.2 We deﬁne Zm to be the set of m congruence classes Zm Zm = {[0], [1], [2], . . . , [m − 1]}
and we deﬁne two operations on Zm , addition and multiplication, as follows:
[a] + [b] = [a + b]
[a] · [b] = [a · b] Though the deﬁnition of these operations may seem obvious there is a fair amount going
on here.
1. Sets are being treated as individual “numbers”. Modular addition and multiplication
are being performed on congruence classes which are sets.
2. The addition and multiplication symbols on the left of the equals signs are in Zm and
those on the right are operations in the integers.
3. We are assuming that the operations are welldeﬁned. That is, we are assuming
that these operations make sense even when there are multiple representatives of a
congruence class. REMARK
Since
[a] = {x ∈ Z  x ≡ a (mod m)}
we can extend our list of equivalent statements to
[a] = [b] in Zm
⇐⇒ a ≡ b (mod m)
⇐⇒ m  (a − b)
⇐⇒ ∃k ∈ Z a − b = km ⇐⇒ ∃k ∈ Z a = km + b ⇐⇒ a and b have the same remainder when divided by m Just as there were addition and multiplication tables in grade school for the integers, we
have addition and multiplication tables in Zm . 114 Chapter 14 Example 2 Addition and multiplication tables in Z4 +
[0]
[1]
[2]
[3] Exercise 1 Modular Arithmetic [0]
[0]
[1]
[2]
[3] [1]
[1]
[2]
[3]
[0] [2]
[2]
[3]
[0]
[1] ·
[0]
[1]
[2]
[3] [3]
[3]
[0]
[1]
[2] [0]
[0]
[0]
[0]
[0] [1]
[0]
[1]
[2]
[3] [2]
[0]
[2]
[0]
[2] [3]
[0]
[3]
[2]
[1] Write out the addition and multiplication tables in Z5 14.2.1 [0] ∈ Zm By looking at the tables for Z4 and Z5 it seems that [0] ∈ Zm behaves just like 0 ∈ Z. In Z
∀a ∈ Z, a + 0 = a
∀a ∈ Z, a · 0 = 0
and in Zm
∀[a] ∈ Zm , [a] + [0] = [a]
∀[a] ∈ Zm , [a] · [0] = [0]
This actually follows from our deﬁnition of addition and multiplication in Zm .
∀[a] ∈ Zm , [a] + [0] = [a + 0] = [a]
∀[a] ∈ Zm , [a] · [0] = [a · 0] = [0] 14.2.2 [1] ∈ Zm In a similar fashion, by looking at the multiplication tables for Z4 and Z5 it seems that
[1] ∈ Zm behaves just like 1 ∈ Z. In Z
∀a ∈ Z, a · 1 = a
and in Zm
∀[a] ∈ Zm , [a] · [1] = [a]
This follows from our deﬁnition of multiplication in Zm .
∀[a] ∈ Zm , [a] · [1] = [a · 1] = [a] 14.2.3 Identities and Inverses in Zm Many of us think of subtraction and division as independent from the other arithmetic
operations of addition and multiplication. In fact, subtraction is just addition of the inverse.
Now, what’s an inverse? To answer that question we must ﬁrst deﬁne an identity. Section 14.2 Modular Arithmetic Deﬁnition 14.2.3
Identity 115 Given a set and an operation, an identity is, informally, “something that does nothing”.
More formally, given a set S and an operation designated by ◦, an identity is an element
e ∈ S so that
∀a ∈ S, a ◦ e = a The element e has no eﬀect. Having something that does nothing is extremely useful though parents might not say that of teenagers. Example 3 Here are examples of sets, operations and identities.
• The set of integers with the operation of addition has the identity 0.
• The set of rational numbers excluding 0 with the operation of multiplication has the
identity 1.
• The set of real valued functions with the operation of function composition has the
identity f (x) = x.
• The set of integers modulo m with the operation of modular addition has the identity
[0]. Deﬁnition 14.2.4 The element b ∈ S is an inverse of a ∈ S if a ◦ b = b ◦ a = e. Inverse Example 4 Here are examples of inverses.
• Under the operation of addition, the integer 3 has inverse −3 since 3 + (−3) = (−3) +
3 = 0.
• Under the operation of multiplication, the rational number
34
43
4 · 3 = 3 · 4 = 1. 3
4 has inverse 4
3 since • Under the operation of function composition ln x has the inverse ex since ln(ex ) =
eln x = x
• Under the operation of modular addition, [3] has the inverse [−3] in Z7 since [3] +
[−3] = [−3] + [3] = [0]. When the operation is addition, we usually denote the inverse by −a. Otherwise, we
typically denote the inverse of a by a−1 . This does cause confusion. Many students interpret
a−1 as the reciprocal. This works for real or rational multiplication but fails in other contexts
like function composition. We will use −a to mean the inverse of a under addition and a−1
to mean the inverse under all other operations. 116 Chapter 14 14.2.4 Modular Arithmetic Subtraction in Zm Let’s return to Zm . The identity under addition in Zm is [0] since
∀[a] ∈ Zm , [a] + [0] = [a]
Given any [a] ∈ Zm , [−a] exists and
[a] + [−a] = [a − a] = [0]
That is, every element [a] ∈ Zm has an additive inverse, [−a]. This allows us to deﬁne
subtraction in Zm . Deﬁnition 14.2.5 We will deﬁne subtraction as addition of the inverse. Thus Subtraction [a] − [b] = [a] + [−b] = [a − b] 14.2.5 Division in Zm Division is related to multiplication in the same way that subtraction is related to addition.
So ﬁrst, we must identify the multiplicative identity in Zm . Since
∀[a] ∈ Zm , [a][1] = [a]
we know that [1] is the identity under multiplication in Zm .
Inverses are more problematic with multiplication. Looking at the multiplication table for
Z5 we see that [2]−1 = [3] since [2][3] = [6] = [1]. But what is the inverse of [2] in Z4 ? It
doesn’t exist! Looking at the row containing [2] in the multiplication table for Z4 we cannot
ﬁnd [1]. Unlike addition in Zm where every element has an additive inverse, it is not always
the case that a nonzero element in Zm has a multiplicative inverse.
We deﬁne division analogously to subtraction. Deﬁnition 14.2.6
Division Division by a ∈ Zm is deﬁned as multiplication by the multiplicative inverse of a ∈ Zm ,
assuming that the multiplicative inverse exists. 14.3 Fermat’s Little Theorem Pierre de Fermat conjectured what we now call Fermat’s Last Theorem. He also proved a
much smaller but extremely useful result called Fermat’s Little Theorem. Theorem 1 (Fermat’s Little Theorem (F T))
If p is a prime number that does not divide the integer a, then
ap−1 ≡ 1 (mod p) Section 14.3 Fermat’s Little Theorem 117 A proof of Fermat’s Little Theorem is available in the Appendix. Add proof of F T for
the appendix. We will examine two corollaries. Corollary 2 For any integer a and any prime p
ap ≡ a (mod p) Proof: Let a ∈ Z and let p be a prime. If p a, then ap−1 ≡ 1 (mod p). Multiplying both
sides of the equivalence by a gives ap ≡ a (mod p). If p  a, then a ≡ 0 (mod p) and ap ≡ 0
(mod p). Thus ap ≡ a (mod p).
Let’s make sure we understand the proof.
Analysis of Proof There are two important items to note: the use of nested quantiﬁers
in the hypothesis and the use of cases in the proof.
Hypothesis: a ∈ Z, p is a prime
Conclusion: ap ≡ a (mod p)
Core Proof Technique: Select Method
Preliminary Material: Fermat’s Little Theorem
Sentence 1 Let a ∈ Z and let p be a prime.
The hypotheses contain two universal quantiﬁers, so we use the Select Method twice,
once for integers and once for primes.
Sentence 2 If p a, then ap−1 ≡ 1 (mod p).
The author breaks up the proof into two parts depending on whether or not p divides
a. The author will need two distinct cases because the approach diﬀers based on the
case. In the case where p does not divide a, the author uses F T.
Sentence 3 Multiplying both sides of the equivalence by a gives ap ≡ a (mod p).
This is just modular arithmetic.
Sentence 4 If p  a, then a ≡ 0 (mod p) and ap ≡ 0 (mod p). Thus ap ≡ a (mod p).
This is the second case where p does divide a. Both ap and a are congruent to zero
mod p so they are congruent to each other. Corollary 3 (Existence of Inverses in Zp (INV Zp ))
Let p be a prime number. If [a] is any nonzero element in Zp , then there exists an element
[b] ∈ Zp so that [a] · [b] = [1] This corollary is equivalent to stating that every nonzero element of Zp has an inverse.
Let’s discover a proof. As usual, we begin by identifying the hypothesis and the conclusion.
Hypothesis: p is a prime number. [a] is any nonzero element in Zp . 118 Chapter 14 Modular Arithmetic Conclusion: There exists an element [b] ∈ Zp so that [a] · [b] = [1].
Three points are salient. First, the corollary only states that an inverse exists. It doesn’t tell
us what the inverse is or how to compute the inverse. Second, there are three quantiﬁers.
1. Let p be a prime number is equivalent to For all primes p. Since this is an instance
of a universal quantiﬁer we would expect to use the Choose Method.
2. [a] is any nonzero element in Zp is another instance of a universal quantiﬁer so we
would expect to use the Choose Method again.
3. There is an existential quantiﬁer in the conclusion so we would expect to use the
Construct Method.
Together these give us the following.
Proof in Progress
1. Let p be a prime number.
2. Let [a] be a nonzero element in Zp .
3. Construct [b] as follows.
4. To be completed.
The third salient point is that this statement is a corollary of Fermat’s Little Theorem. Now
Fermat’s Little Theorem uses congruences, not congruence classes. But we could restate
F T with congruence classes as Theorem 4 (Fermat’s Little Theorem (F T))
If p is a prime number that does not divide the integer a, then
[ap−1 ] = [1] in Zp Now an analogy to real numbers provides the ﬁnal step. In the reals ap−1 = a · ap−2 so why
not let [b] = [ap−2 ]? This would give
Proof in Progress
1. Let p be a prime number.
2. Let [a] be a nonzero element in Zp .
3. Consider [b] = [ap−2 ].
4. To be completed.
Now we can invoke Fermat’s Little Theorem but ﬁrst we need to make sure the hypotheses
are satisﬁed.
Proof in Progress Section 14.3 Fermat’s Little Theorem 119 1. Let p be a prime number.
2. Let [a] be a nonzero element in Zp .
3. Consider [b] = [ap−2 ].
4. Since [a] = [0] in Zp , p a and so by F T
[a][b] = [a][ap−2 ] = [ap−1 ] = [1]
A proof might look as follows.
Proof: Let p be a prime number. Let [a] be a nonzero element in Zp . Consider [b] = [ap−2 ].
Since [a] = [0] in Zp , p a and so by F T
[a][b] = [a][ap−2 ] = [ap−1 ] = [1] REMARK
In summary, if p is a prime number and [a] is any nonzero element in Zp , then
[a]−1 = [ap−2 ] Exercise 2 What is [3]−1 in Z7 ? Chapter 15 Linear Congruences
15.1 Objectives The content objectives are:
1. Deﬁne a linear congruence in the variable x.
2. State and prove the Linear Congruence Theorem.
3. Do examples. 15.2 The Problem One of the advantages of congruence over divisibility is that we have an “arithmetic” of
congruence. This allows us to solve new kinds of “equations”. Deﬁnition 15.2.1
Linear Congruence A relation of the form
ax ≡ c (mod m)
is called a linear congruence in the variable x. A solution to such a linear congruence
is an integer x0 so that
ax0 ≡ c (mod m) The problem for this lecture is to determine when linear congruences have solutions and
how to ﬁnd them.
Recalling our table of statements equivalent to a ≡ b (mod m) we see that
ax0 ≡ c (mod m) if and only if there exists an integer y0 such that ax0 + my0 = c 120 Section 15.2 The Problem 121 REMARK
Thus
ax ≡ c (mod m) has a solution
⇐⇒ there exists an integer x0 such that ax0 ≡ c (mod m)
⇐⇒ there exists an integer y0 such that ax0 + my0 = c
⇐⇒ gcd(a, m)  c (by the Linear Diophantine Equation Theorem, Part 1) Moreover, the Linear Diophantine Equation Theorem, Part 2 tells us what the solutions to
ax + by = c look like. Theorem 1 (Linear Diophantine Equation Theorem, Part 2, (LDET 2))
Let gcd(a, m) = d = 0.
If x = x0 and y = y0 is one particular integer solution to the linear Diophantine equation
ax + my = c, then the complete integer solution is
x = x0 + m
a
n, y = y0 − n, ∀n ∈ Z.
d
d But then, if x0 ∈ Z is one solution to ax ≡ c (mod m) the complete solution will be
m
x ≡ x0 (mod ) where d = gcd(a, m)
d
Equivalently,
m
m
m
x ≡ x0 , x0 + , x0 + 2 , · · · , x0 + (d − 1)
(mod m)
d
d
d
Take note that there are d = gcd(a, m) distinct solutions modulo m.
We record this discussion as the following theorem. Theorem 2 (Linear Congruence Theorem, Version 1, (LCT 1))
Let gcd(a, m) = d = 0.
The linear congruence
ax ≡ c (mod m)
has a solution if and only if d  c.
Moreover, if x = x0 is one particular solution, then the complete solution is
x ≡ x0 (mod m
)
d or, equivalently,
x ≡ x0 , x0 + m
m
m
, x0 + 2 , · · · , x0 + (d − 1)
d
d
d (mod m) 122 Chapter 15 Linear Congruences Another way of considering the same problem is to reframe it in Zm . Since
[a] = {x ∈ Z  x ≡ a (mod m)}
solving
ax ≡ c (mod m)
is equivalent to ﬁnding a congruence class [x0 ] ∈ Zm that solves
[a][x] = [c] in Zm
Thus Theorem 3 (Linear Congruence Theorem, Version 2, (LCT 2))
Let gcd(a, m) = d = 0.
The equation
[a][x] = [c] in Zm
has a solution if and only if d  c.
Moreover, if x = x0 is one particular solution, then the complete solution is
[x0 ] , x0 + 15.3 m
m
m
, x0 + 2
, · · · , x0 + (d − 1)
d
d
d in Zm Extending Equivalencies Putting all of this together we have several views of the same problem. REMARK [a][x] = [c] has a solution in Zm
⇐⇒ ax ≡ c (mod m) has a solution
⇐⇒ there exists an integer x0 such that ax0 ≡ c (mod m)
⇐⇒ there exists an integer y0 such that ax0 + my0 = c
⇐⇒ gcd(a, m)  c
Moreover, if x0 , y0 is a particular integer solution to ax + my = c then a
m
n, y = y0 − n, ∀n ∈ Z
d
d
m
⇐⇒ the complete solution to ax ≡ c (mod m) is x ≡ x0 (mod )
d
m
m
m
⇐⇒ the complete solution to ax ≡ c (mod m) is x ≡ x0 , x0 + , x0 + 2 , · · · , x0 + (d − 1)
(mod m)
d
d
d
m
m
m
⇐⇒ the complete solution to [a][x] = [c] in Zm is [x0 ] , x0 +
, x0 + 2
, · · · , x0 + (d − 1)
in Z
d
d
d
the complete solution to ax + my = c is x = x0 + Section 15.4 Examples 15.4
Example 1 123 Examples If possible, solve the linear congruence
3x ≡ 5 (mod 6) Solution: Since gcd(3, 6) = 3 and 3 5, there is no solution to 3x ≡ 5 (mod 6) by the
Linear Congruence Theorem, Version 1. Example 2 If possible, solve the linear congruence
4x ≡ 6 (mod 10) Solution: Since gcd(4, 10) = 2 and 2  6, we would expect to ﬁnd two solutions to 4x ≡ 6
(mod 10). Since ten is a small modulus, we can simply test all possibilities modulo 10.
x (mod 10)
4x (mod 10) 0
0 1
4 2
8 3
2 4
6 5
0 6
4 7
8 8
2 9
6 Hence, x ≡ 4 or 9 (mod 10). Example 3 If possible, solve the linear congruence
3x ≡ 5 (mod 76) Solution: Since gcd(3, 76) = 1 and 1  5, we would expect to ﬁnd one solution to 3x ≡ 5
(mod 76). We could try all 76 possibilities but there is a more eﬃcient way. Thinking of
our list of equivalencies, solving 3x ≡ 5 (mod 76) is equivalent to solving 3x + 76y = 5 and
that we know how to do that using the Extended Euclidean Algorithm.
x
y
rq
1
0
76 0
0
1
30
1 −25 1 25
−3 −76 0 3
From the second last row, 76(1) + 3(−25) = 1, or to match up with the order of the original
equation, 3(−25) + 76(1) = 1. Multiplying the equation by 5 gives 3(−125) + 76(5) = 5.
Hence
x ≡ −125 ≡ 27 (mod 76)
We can check our work by substitution. 3 · 27 ≡ 81 ≡ 5 (mod 76). 124 Chapter 15 Example 4 Linear Congruences Find the inverse of [13] in Z29 .
Solution: By deﬁnition, the inverse of [13] in Z29 is the congruence class [x] so that
[13][x] = [1] in Z29 . Since gcd(13, 29) = 1, we know by the Linear Congruence Theorem,
Version 2 that there is exactly one solution. We could try all 29 possibilities or recall that
solving
[13][x] = [1] in Z29
is equivalent to solving
13x + 29y = 1
and that we know how to do using the Extended Euclidean Algorithm.
x
y
rq
1
0
29 0
0
1
13 0
1
−2 3 2
−4
9
14
13 −29 0 3
From the second last row, 29(−4) + 13(9) = 1, or to match up with the order of the original
equation, 13(9) + 29(−4) = 1. Hence
[13]−1 = [9] in Z29
We can check our work by substitution. [13][9] = [117] = [1] in Z29 . Chapter 16 Chinese Remainder Theorem
16.1 Objectives The content objectives are:
1. Do examples.
2. Discover a proof of the Chinese Remainder Theorem. 16.2 An Old Problem The following problem was posed, likely in the third century CE, by Sun Zi in his Mathematical Manual and republished in 1247 by Qin Jiushao in the Mathematical Treatise in
Nine Sections.
There are certain things whose number is unknown. Repeatedly divided by 3,
the remainder is 2; by 5 the remainder is 3; and by 7 the remainder is 2. What
will be the number?
The word problem asks us to ﬁnd an integer n that simultaneously satisﬁes the following
three linear congruences.
n≡2 (mod 3) n≡3 (mod 5) n≡2 (mod 7) Before we solve this problem, we will begin with two simultaneous congruences whose moduli
are coprime. 125 126 Chapter 16 16.3
Example 1 Chinese Remainder Theorem Chinese Remainder Theorem Solve
n≡2 (mod 5) n≡9 (mod 11) Solution: The ﬁrst congruence is equivalent to
n = 5x + 2 where x ∈ Z (16.1) Substituting this into the second congruence we get
5x + 2 ≡ 9 (mod 11) ⇒ 5x ≡ 7 (mod 11) Have we seen anything like this before? Of course, this is just a linear congruence! Its
solution is
x ≡ 8 (mod 11)
Now x ≡ 8 (mod 11) is equivalent to
x = 11y + 8 where y ∈ Z (16.2) Substituting Equation 16.2 into Equation 16.1 gives the solution
n = 5(11y + 8) + 2 = 55y + 42 for all y ∈ Z
which is equivalent to
n ≡ 42 (mod 55) We can check by substitution. If n = 55y + 42, then n ≡ 2 (mod 5) and n ≡ 9 (mod 11). Theorem 1 (Chinese Remainder Theorem (CRT))
If gcd(m1 , m2 ) = 1, then for any choice of integers a1 and a2 , there exists a solution to the
simultaneous congruences
n ≡ a1 (mod m1 ) n ≡ a2 (mod m2 ) Moreover, if n = n0 is one integer solution, then the complete solution is
n ≡ n0 (mod m1 m2 ) Before we begin our discovery of a solution, let’s be clear that there are two things to prove.
First, that a solution exists and second, what a complete solution looks like.
With regards to the ﬁrst part let’s identify, as usual, the hypothesis and the conclusion.
Hypothesis: gcd(m1 , m2 ) = 1. Section 16.3 Chinese Remainder Theorem 127 Conclusion: For any choice of integers a1 and a2 , there exists a solution to the simultaneous congruences
n ≡ a1 (mod m1 ) n ≡ a2 (mod m2 ) Since there is an existential quantiﬁer in the conclusion, we have to construct a solution.
There is nothing obvious from the statement of the theorem that will help us, but we have
already solved such a problem once in Example 1. Perhaps we could mimic what we did
there.
From the ﬁrst linear congruence
The integer n satisﬁes n ≡ a1 (mod m1 ) if and only if
n = a1 + m1 x for some x ∈ Z
The next thing we did was substitute this expression into the second congruence.
The number n satisﬁes the second congruence if and only if
a1 + m 1 x ≡ a2 (mod m2 ) m 1 x ≡ a2 − a1 (mod m2 ) Have we seen anything like this before? Of course, this is just a linear congruence!
Since gcd(m1 , m2 ) = 1, the Linear Congruence Theorem tells us that this congruence has a solution, say x = b and that the complete solution is
x = b + m2 y for all y ∈ Z
If we set y = 0 we get x = b and hence n = a1 + m1 b is one particular solution.
Now let’s consider the second part, a complete solution. Following on what we have done
above, an integer n satisﬁes the simultaneous congruences if and only if
n = a1 + m 1 x
= a1 + m1 (b + m2 y )
= (a1 + m1 b) + m1 m2 y for all y ∈ Z
But these are the elements of exactly one congruence class modulo m1 m2 . Hence, if n = n0
is one solution, then the complete solution is
n ≡ n0 Exercise 1 (mod m1 m2 ) Using the analysis above, write a proof for the Chinese Remainder Theorem. Question Panel 128 Chapter 16 Exercise 2 Solve
n≡2 (mod 3) n≡3 (mod 5) n≡2 (mod 3) n≡3 (mod 5) n≡4 Exercise 3 Chinese Remainder Theorem (mod 11) Solve The exercise above makes it clear that we can solve more than two simultaneous linear
congruences simply by solving pairs of linear congruences successively. We record this as Theorem 2 (Generalized Chinese Remainder Theorem (GCRT))
If m1 , m2 , . . . , mk ∈ Z and gcd(mi , mj ) = 1 whenever i = j , then for any choice of integers
a1 , a2 , . . . , ak , there exists a solution to the simultaneous congruences
n ≡ a1 (mod m1 ) n ≡ a2
.
.
. (mod m2 ) n ≡ ak (mod mk ) Moreover, if n = n0 is one integer solution, then the complete solution is
n ≡ n0 (mod m1 m2 . . . mk ) Chapter 17 Practice, Practice, Practice:
Congruences
17.1 Objectives The content objectives are:
1. Computational practice.
2. Preparing for RSA. 17.2 Linear and Polynomial Congruences Let’s recall how to solve linear congruences. Example 1 Solve 13x ≡ 1 (mod 60).
Solution: Since gcd(13, 60) = 1 and 1  1 we would expect to ﬁnd one congruence class
as a solution to 13x ≡ 1 (mod 60). Now 13x ≡ 1 (mod 60) is equivalent to the linear
Diophantine equation 13x+60y = 1 so we can use the EEA. (Note that we have interchanged
the labels for x and y . The statement of the algorithm ﬁnds a solution to ax + by = gcd(a, b)
where a > b. In this particular case, b = 60 > 13 = a. Because we have interchanged a and
b, we also interchange x and y .)
y
x
rq
1
0
60 0
0
1
13 0
1
−4 8 4
−1
5
51
2
−9 3 1
−3
14
21
5
−23 1 1
−13 60
02
Thus 13(−23)+60(5) = 1 and so x ≡ −23 ≡ 37 (mod 60) is a solution to 13x ≡ 1 (mod 60). 129 130 Chapter 17 Practice, Practice, Practice: Congruences Though we have eﬃcient means to solve linear congruences, we have no equivalent means
to solve polynomial congruences. Example 2 Solve x2 ≡ 1 (mod 8) by substitution.
Your ﬁrst reaction might be that there are zero, one or two solutions as there would be in
the reals.
Solution:
x (mod 8)
x2 (mod 8) 0
0 1
1 2
4 3
1 4
0 5
1 6
4 7
1 Hence, the solution is x ≡ 1, 3, 5 or 7 (mod 8). Example 3 Solve 36x47 + 5x9 + x3 + x2 + x + 1 ≡ 2 (mod 5). Reduce terms and use Fermat’s Little
Theorem or its corollaries before substitution.
Solution: Since 36 ≡ 1 (mod 5) the term 36x47 reduces to x47 (mod 5). Since 5 ≡ 0
(mod 5) the term 5x9 reduces to 0 (mod 5). Thus,
36x47 + 5x9 + x3 + x2 + x + 1 ≡ 2 (mod 5) reduces to
x47 + x3 + x2 + x + 1 ≡ 2 (mod 5) By Fermat’s Little Theorem, x4 ≡ 1 (mod 5) and so
x47 ≡ (x4 )11 x3 ≡ 111 x3 ≡ x3 (mod 5) and the polynomial congruence further reduces to
x3 + x3 + x2 + x + 1 ≡ 2 (mod 5) or, more simply,
2x3 + x2 + x + 1 ≡ 2
x (mod 5)
2x3 + x2 + x + 1 (mod 5) (mod 5)
0
1 1
0 2
3 3
2 4
4 Hence, the only solution to
36x47 + 5x9 + x3 + x2 + x + 1 ≡ 2
is
x≡3 Example 4 Solve n3 ≡ 127 (mod 165). (mod 5) (mod 5) Section 17.2 Linear and Polynomial Congruences 131 Solution: We could try all 165 possibilities but perhaps there is another way. Observing
that 165 = 3 × 5 × 11 and all three factors are relatively prime as pairs, maybe we could split
the problem into three linear congruences and then apply the Chinese Remainder Theorem.
Unfortunately, the polynomial is not linear. Let’s see what happens anyway.
Since n3 ≡ 127 (mod 165),
n3 ≡ 127 ≡ 1 (mod 3) 3 (mod 5) 3 (mod 11) n ≡ 127 ≡ 2
n ≡ 127 ≡ 6 Let’s consider each of the three congruences separately. In the case n3 ≡ 1 (mod 3) we can
use a corollary to Fermat’s Little Theorem. Since n3 ≡ n (mod 3) by FlT, n3 ≡ 1 (mod 3)
reduces to n ≡ 1 (mod 3) which is just the solution to the ﬁrst congruence.
For the case n3 ≡ 2 (mod 5) we will use a table.
n (mod 5)
n3 (mod 5) 0
0 1
1 2
3 3
2 4
4 6
7 7
2 The only solution to n3 ≡ 2 (mod 5) is n ≡ 3 (mod 5)
For the case n3 ≡ 6 (mod 11) we will use a table.
n (mod 11)
n3 (mod 11) 0
0 1
1 2
8 3
5 4
9 5
4 8
6 9
3 10
10 The only solution to n3 ≡ 6 (mod 11) is n ≡ 8 (mod 11)
Hence, a solution to n3 ≡ 127 (mod 165) can be found by solving the simultaneous linear
congruences
n≡1 (mod 3) n≡3 (mod 5) n≡8 (mod 11) Though these could be solved by eye (note that n ≡ 8 (mod 55) is a solution to the last
two) we will solve these, for practice, by writing out and substituting equations.
From n ≡ 1 (mod 3) we have
n = 3x + 1 where x ∈ Z (17.1) Substituting into the second equation we get
3x + 1 ≡ 3 (mod 5) ⇒ 3x ≡ 2 (mod 5) ⇒ x ≡ 4 (mod 5) Now x ≡ 4 (mod 5) is equivalent to
x = 5y + 4 where y ∈ Z (17.2) 132 Chapter 17 Practice, Practice, Practice: Congruences Substituting Equation 17.2 into Equation 17.1 gives the solution to the ﬁrst two linear
congruences.
n = 3(5y + 4) + 1 = 15y + 13 for all y ∈ Z
which is equivalent to
n ≡ 13 (mod 15) n ≡ 13 (mod 15) Now we need to solve n≡8 (mod 11) From n ≡ 13 (mod 15) we have
n = 15x + 13 where x ∈ Z (17.3) Substituting into the second equation we get
15x +13 ≡ 8 (mod 11) ⇒ 4x +2 ≡ 8 (mod 11) ⇒ 4x ≡ 6 (mod 11) ⇒ x ≡ 7 (mod 11) Now x ≡ 7 (mod 11) is equivalent to
x = 11y + 7 where y ∈ Z (17.4) Substituting Equation 17.4 into Equation 17.3 gives the solution.
n = 15(11y + 7) + 13 = 165y + 118 for all y ∈ Z
which is equivalent to
n ≡ 118 (mod 165) and which is the solution to the original problem n3 ≡ 127 (mod 165).
Checking we have n2 ≡ 1182 ≡ 64 (mod 165) and n3 ≡ 118 × 64 ≡ 127 (mod 165). Example 5 Determine, with justiﬁcation all solutions of the congruence equation
x61 + 26x41 + 11x25 + 5 ≡ 0 (mod 143) Solution: We could simply try all 143 distinct values modulo 143. However, computing
numbers like 7061 might be problematic. Have we seen anything like this before? Note
that 143 = 11 × 13. The previous question had a polynomial on the left and a composite
modulus on the right so perhaps we could do now what we did in the previous exercise,
break up the larger problem into several smaller problems.
If x0 is a solution to
x61 + 26x41 + 11x25 + 5 ≡ 0 (mod 143) then x0 is also a solution to
x61 + 26x41 + 11x25 + 5 ≡ 0
61 x + 26x 41 + 11x 25 +5≡0 (mod 11) (17.5) (mod 13) (17.6) Section 17.3 Linear and Polynomial Congruences 133 Let’s start with the polynomial congruence 17.5.
x61 + 26x41 + 11x25 + 5 ≡ 0 (mod 11) The most obvious thing to do is reduce each term modulo 11. This gives
x61 + 4x41 + 5 ≡ 0 (mod 11) Since 11 is prime, as long as 11 x0 , we can use F T which implies that
x10 ≡ 1 (mod 11) So then
x61 ≡ x60 x1 ≡ (x10 )6 x1 ≡ 16 x1 ≡ x (mod 11) Similarly, x41 ≡ x (mod 11) and so the congruence reduces to
x + 4x + 5 ≡ 0 (mod 11) or
5x ≡ −5 (mod 11) By Congruences and Division
x ≡ −1 ≡ 10 (mod 11) We still have to deal with the possibility that 11  x0 . If 11 did divide x0 , then 11 would be
a solution to
x61 + 26x41 + 11x25 + 5 ≡ 0 (mod 11)
Replacing x by 0 in the above equation, since 11 ≡ 0 (mod 11), gives 5 ≡ 0 (mod 11) which
is false. So 11 x0 . Similarly,
x61 + 26x41 + 11x25 + 5 ≡ 0 (mod 13) reduces to Insert Question Panel.
12x + 5 ≡ 0 (mod 13) or, since 12 ≡ −1 (mod 13)
−x ≡ −5 (mod 13) which has the solution
x≡5 (mod 13) Note again that 13 x0 .
But now we have two simultaneous linear congruences
x ≡ 10
x≡5 (mod 11)
(mod 13) Have you seen anything like this before? Insert Question Panel. 134 Chapter 17 17.3 Practice, Practice, Practice: Congruences Preparing for RSA This exercise will help us understand the implementation of the RSA scheme which we will
look at next. In commercial practice the numbers chosen are large but here, choose numbers
small enough to work with by hand.
I will give an example. You follow along but use your own numbers.
1. Choose two distinct primes p and q and let n = pq . I will choose p = 7 and q = 11 so
n = 77.
2. Select an integer e so that gcd(e, (p − 1)(q − 1)) = 1 and 1 < e < (p − 1)(q − 1). I will
choose e = 13 which satisﬁes gcd(13, 60) = 1 and 1 < 13 < 60.
3. Solve
ed ≡ 1 (mod (p − 1)(q − 1)) for an integer d where 1 < d < (p − 1)(q − 1). In my case d = 37. Chapter 18 The RSA Scheme
18.1 Objectives The content objectives are:
1. Illustrate the use of RSA.
2. Prove that the message sent will be the message received. 18.2 Why Public Key Cryptography? In a private key cryptographic scheme, like the substitution cipher or Vigen`re cipher that
e
you have already learned about, participants share a common key. This raises the problem
of how to distribute a large number of keys between users, especially if these keys need to
be changed frequently. For example, there are almost 200 countries in the world. If Canada
maintains an embassy in each country and allows Canadian embassies to communicate with
one another, the embassies must exchange a common key between each pair of embassies.
00
That means there are 22 = 19, 900 keys to exchange. Worse yet, for security reasons,
keys should be changed frequently and so 19, 900 keys might need to be exchanged daily.
In a public key cryptographic scheme, keys are divided into two parts: a public encryption
key which is shared in an open repository of some sort, and a private decryption key held
secretly by each participant. For user A to send a private message to user B , A would look
up B ’s public key, encrypt the message and send it to B . Since B is the only person who
possesses the secret key required for decryption, only B can read the message.
Such an arrangement solves the key distribution problem. The public keys do not need to
be kept secret and only one per participant needs to be available. Thus, in our embassy
example previously, only 200 keys need to be published.
The possibility of public key cryptography was ﬁrst published in 1976 in a paper by Diﬃe,
Hellman and Merkle. The RSA scheme, named after its discoverers Rivest, Shamir and
Adleman is an example of a commercially implemented public key scheme.
RSA is now widely deployed.
• Add list here.
135 136 Chapter 18 18.3 The RSA Scheme Implementing RSA In RSA, messages are integers. How does one get an integer from plaintext? In much the
same way we did with a Vigen`re cipher, assign a number to each letter of the alphabet
e
and then concatenate the digits together. 18.3.1 Setting up RSA 1. Choose two large, distinct primes p and q and let n = pq .
2. Select an integer e so that gcd(e, (p − 1)(q − 1)) = 1 and 1 < e < (p − 1)(q − 1).
3. Solve
ed ≡ 1 (mod (p − 1)(q − 1)) for an integer d where 1 < d < (p − 1)(q − 1).
4. Publish the public encryption key (e, n).
5. Keep secure the private decryption key (d, n). 18.3.2 Sending a Message To send a message:
1. Look up the recipient’s public key (e, n).
2. Generate the integer message M so that 0 ≤ M < n.
3. Compute the ciphertext C as follows:
Me ≡ C (mod n) where 0 ≤ C < n 4. Send C . 18.3.4 Example All of the computation in this part was done in Maple.
Setting up RSA
1. Choose two large, distinct primes p and q and let n = pq .
Let p be
9026694843 0929817462 4847943076 6619417461
5791443937,
and let q be
7138718791 1693596343 0802517103 2405888327
6844736583
so n is
6443903609 8539423089 8003779070 0502485677 Section 18.3 Implementing RSA 18.3.3 137 Receiving a Message To decrypt a message:
1. Use your private key (d, n).
2. Compute the messagetext R from the ciphertext C as follows:
Cd ≡ R (mod n) where 0 ≤ R < n 3. R is the original message. 1034536315 4526254586 6290164606 1990955188
1922989980 3977447271.
2. Select an integer e so that gcd(e, (p − 1)(q − 1)) = 1 and 1 < e < (p − 1)(q − 1).
Now (p − 1)(q − 1) is
6443903609 8539423089 8003779070 0502485677
1034536313 8360840952 3666750800 6340495008
2897684191 1341266752.
Choose e as
9573596212 0300597326 2950869579 7174556955
8757345310 2344121731.
It is indeed the case that gcd(e, (p − 1)(q − 1)) = 1 and 1 < e < (p − 1)(q − 1).
3. Solve
ed ≡ 1 (mod (p − 1)(q − 1)) for an integer d where 1 < d < (p − 1)(q − 1).
Solving this LDE gives d as
5587652122 6351022927 9795248536 5522717791
7285682675 6100082011 1849030646 3274981250
2583120946 4072548779.
4. Publish the public encryption key (e, n).
5. Keep secure the private decryption key (d, n).
Sending a Message
To send a message:
1. Look up the recipient’s public key (e, n).
2. Generate the integer message M so that 0 ≤ M < n.
We will let M = 3141592653.
3. Compute the ciphertext C as follows:
Me ≡ C (mod n) where 0 ≤ C < n 138 Chapter 18
Computing gives C
4006696554 3080815610 2814019838 8509626485
8151054441 5245547382 5506759308 1333888622
4491394825 3742205367.
4. Send C .
Receiving a Message
To decrypt a message:
1. Use your private key key (d, n).
2. Compute the messagetext R from the ciphertext C as follows:
Cd ≡ R
3. R is the original message.
R = 3141592653. (mod n) where 0 ≤ R < n The RSA Scheme Section 18.4 Does M = R? 18.4 139 Does M = R? Are we conﬁdent that the message sent is the message received? Theorem 1 (RSA)
If
1. p and q are distinct primes,
2. n = pq
3. e and d are positive integers such that ed ≡ 1 (mod (p − 1)(q − 1)),
4. 0 ≤ M < n
5. M e ≡ C (mod n)
6. C d ≡ R (mod n) where 0 ≤ R < n
then R = M . The proof is long and can appear intimidating but, in fact, it is structurally straightforward
if we break it into pieces. The proof is done in four parts.
1. Write R as a function of M , speciﬁcally
R ≡ M M k(p−1)(q−1) (mod n) 2. Show that R ≡ M (mod p). We will do this in two cases: (i) p M and (ii) p  M .
3. Show that R ≡ M (mod q ).
4. Use the Chinese Remainder Theorem to deduce that R = M .
Proof: First, we will show that
R ≡ M M k(p−1)(q−1) (mod n) Since ed ≡ 1 (mod (p − 1)(q − 1)), there exists an integer k so that
ed = 1 + k (p − 1)(q − 1)
Now
R ≡ Cd (mod n)
ed ≡ (M )
≡M ed (mod n)
(mod n) ≡ M 1+k(p−1)(q−1) (mod n) k(p−1)(q −1) (mod n) ≡ MM 140 Chapter 18
Second, we will show that R ≡ M (mod p). Suppose that p
Theorem,
M p−1 ≡ 1 (mod p) The RSA Scheme M . By Fermat’s Little Hence
M k(p−1)(q−1) ≡ (M p−1 )k(q−1)
≡ 1k(q−1)
≡1 (mod p) (mod p) (mod p) Multiplying both sides by M gives
M M k(p−1)(q−1) ≡ M (mod p) Since
R ≡ M M k(p−1)(q−1) (mod n) ⇒ R ≡ M M k(p−1)(q−1) (mod p) we have
R≡M (mod p) Now suppose that p  M . But then M ≡ 0 (mod p) and so M M k(p−1)(q−1) ≡ 0 (mod p).
That is,
M M k(p−1)(q−1) ≡ M (mod p)
Again, since
R ≡ M M k(p−1)(q−1) (mod n) ⇒ R ≡ M M k(p−1)(q−1) (mod p) we have
R≡M (mod p) In either case, we have R ≡ M (mod p).
Third, we will show that R ≡ M (mod q ). But this similar to R ≡ M (mod p).
Fourth and last, we will show that R = M . So far we have generated two linear congruences
that have to be satisﬁed simultaneously.
R≡M (mod p) R≡M (mod q ) Since gcd(p, q ) = 1 we can invoke the Chinese Remainder Theorem and conclude that
R≡M (mod pq ) R≡M (mod n) Since pq = n we have
Now, R and M are both integers congruent to each other modulo n, and both lie between
0 and n − 1, so R = M . 18.5 How Secure Is RSA? The basic idea behind RSA is that multiplying is easy and factoring is diﬃcult. Hence it is
easy to generate n, which is part of the key, and diﬃcult to factor a large n, say 200 digits,
into p and q which would make it easy to decrypt any message. Complete this. Chapter 19 Negation
19.1 Objectives The technique objectives are:
1. To learn how to negate systems.
2. To learn when to use counterexamples.
3. To practice ﬁnding counterexamples. 19.2 Negating Statements You will frequently encounter the negation of statement A. Deﬁnition 19.2.1
Negation The negation of the statement A is the statement NOT A. Because statements cannot be
both true and false, exactly only one of A and NOT A can be true. In some instances, ﬁnding the negation of a statement is easy. For example
A: f (x) has a real root.
NOT A: f (x) does not have a real root.
When A is already negated, a truth table tells us what to do.
A ¬A ¬(¬A)
TF
T
FT
F
Thus, ¬(¬A) = A. Two negatives are a positive, or equivalently, one NOT cancels another
NOT. For example,
A: 7 is not a divisor of 28.
NOT A: 7 is a divisor of 28.
141 142 Chapter 19 Negation You have already seen DeMorgan’s Laws when we worked with truth tables. Proposition 1 (De Morgan’s Law’s (DML))
If A and B are statements, then
1. ¬(A ∨ B ) ≡ (¬A) ∧ (¬B )
2. ¬(A ∧ B ) ≡ (¬A) ∨ (¬B ) REMARK
Thus, there is a speciﬁc rule applied when negating a statement containing the word AND.
A: B AND C
NOT A: (NOT B ) OR (NOT C ) Note that the connecting word has changed from AND to OR and that each term in the
expression has been negated. The brackets are not needed because NOT precedes OR in
logical evaluation, but the brackets are useful to emphasize the change. Here is a speciﬁc
example.
For example,
A: T is isosceles and it has perimeter 42.
NOT A: T is not isosceles or it does not have perimeter 42. REMARK
Similar to the conjunctive AND, a speciﬁc rule is applied when negating a statement containing the word OR.
A: B OR C
NOT A: (NOT B ) AND (NOT C ) Note that the connecting word has changed from OR to AND and, again, each term in the
expression has been negated. As before, the brackets are not needed because NOT precedes
AND in logical evaluation, but the brackets are useful to emphasize the change. Here is a
speciﬁc example.
For example,
A: T is isosceles or it has perimeter 42.
NOT A: T is not isosceles and it does not have perimeter 42.
A: T is isosceles or it has perimeter 42.
NOT A: T is not isosceles and it does not have perimeter 42. Section 19.3 Negating Statements with Quantiﬁers 19.3 143 Negating Statements with Quantiﬁers Negating statements that contains quantiﬁers is more complicated. We ﬁrst observe that:
• The negation of a universal statement results in an existential statement.
• The negation of an existential statement results in a universal statement. REMARK
A statement with an existential quantiﬁer looks like
There exists an x in the set S such that P (x) is true.
Its negation is
For every x in the set S , P (x) is false. REMARK
A statement with a universal quantiﬁer looks like
For every x in the set S , P (x) is true.
Its negation is
There exists an x in the set S such that P (x) is false. REMARK
To negate a statement using nested quantiﬁers, do the following.
Step 1 Put the word NOT in front of the entire statement.
Step 2 Move the NOT from left to right replacing quantiﬁers by their opposites and in
each case place the NOT just before the open sentence. Repeat until there are no
quantiﬁers to the right of NOT.
Step 3 When all of the quantiﬁers are to the left of NOT, incorporate the NOT into the
open sentence. Let’s do some examples. 144 Chapter 19 Negation Example 1
1. For every x ∈ S , f (x) = 0.
(a) NOT [For every x ∈ S , f (x) = 0.]
(b) There exists x ∈ S such that NOT [f (x) = 0].
(c) There exists x ∈ S such that f (x) = 0.
2. There exists x ∈ S such that f (x) = 0.
(a) NOT [There exists x ∈ S such that f (x) = 0.]
(b) For every x ∈ S , NOT [f (x) = 0].
(c) For every x ∈ S , f (x) = 0.
3. For every x ∈ S and for every f ∈ F , f (x) = 0.
(a) NOT [For every x ∈ S and for every f ∈ F , f (x) = 0.]
(b) There exists x ∈ S such that NOT [for every f ∈ F , f (x) = 0].
There exists x ∈ S and there exists f ∈ F such that NOT [f (x) = 0].
(c) There exists x ∈ S and there exists f ∈ F such that f (x) = 0.
4. There exists x ∈ S such that, for every f ∈ F , f (x) = 0.
(a) NOT [There exists x ∈ S such that for every f ∈ F , f (x) = 0.]
(b) For every x ∈ S , NOT [for every f ∈ F , f (x) = 0].
For every x ∈ S there exists a f ∈ F , NOT [f (x) = 0].
(c) For every x ∈ S there exists a f ∈ F , f (x) = 0. 19.3.1 Counterexamples So far in the course, we have worked on proving that statements are true. How do we prove
that a statement is false? In principle, this is relatively easy. To show that the statement
A is false, we only need to prove that the statement NOT A is true.
Suppose A is the statement:
A: For every x ∈ [−π, π ], sin(x) = 0.
This statement is very similar to our ﬁrst example. NOT A is the statement
NOT A: There exists x ∈ [−π, π ] such that sin(x) = 0.
In this case, NOT A is easy to prove using our construction method. If I consider x = 0, I
know that 0 ∈ [−π, π ] and sin(x) = 1 = 0. The number 0 is a counterexample. Deﬁnition 19.3.1
Counterexample In general, if we wish to prove that a universal statement A is false, we show that its
negation, which is an existential statement, is true. The particular object which we use to
show that the existential statement is true is called a counterexample of statement A. Section 19.3 Negating Statements with Quantiﬁers 145 The same idea arises when we want to show that a statement of the form “A implies B ”
is false. It is enough to show a particular instance where A is true and B is false, or
equivalently NOT B is true. For example, consider the following statement. Statement 2 S : If a, b and c are integers, and a  (bc), then a  b and a  c. The hypothesis is
A: a, b and c are integers, and a  (bc)
and the conclusion is
B : a  b and a  c.
To show that S is false, we must ﬁnd a speciﬁc instance where A is true and B is false. To
show that B is false we must show that NOT B is true.
NOT B : a b or a c.
Choosing a = 3, b = 6 and c = 7 we have an instance where the hypothesis A is true (since
3  42) and the conclusion B is false, equivalently, NOT B is true. The values a = 3, b = 6
and c = 7 are a counterexample for S . Chapter 20 Contradiction
20.1 Objectives The technique objectives are:
1. Learn how to read and discover proofs by contradiction.
The content objectives are:
1. Read a proof of Prime Factorization.
2. Discover a proof of Inﬁnitely Many Primes. 20.2 How To Use Contradiction We have mostly used the Direct Method to discover proofs, often in conjunction with one
of the methods associated with quantiﬁers. There are times when this is diﬃcult. A proof
by contradiction provides a new method. REMARK
Suppose that we wish to prove that the statement “A implies B ” is true. We assume that A
is true. We must show that B is true. What would happen if B were true, but we assumed
it was false and continued our reasoning based on the assumption that B was false? Since a
mathematical statement cannot be both true and false, it seems likely we would eventually
encounter a mathematically nonsensical statement. Then we would ask ourselves “How
did we arrive at this nonsense?” and the answer would have to be that our assumption that
B was false was wrong and B is, in fact, true. REMARK
A proof by contradiction of the statement “A implies B ” structures proofs in exactly this
way. Proceed as follows. 146 Section 20.2 How To Use Contradiction 147 1. Assume that A is true.
2. Assume that B is false, or equivalently, assume that NOT B is true.
3. Reason forward from A and NOT B to reach a contradiction. Unfortunately, it is not always clear what contradiction to ﬁnd, or how to ﬁnd it. What is
more clear is when to use contradiction. 20.2.1 When To Use Contradiction The general rule of thumb is to use contradiction when the statement NOT B gives you
useful information. There are typically two instances when this is useful. The ﬁrst instance
is when the statement B is one of only two alternatives. For example, if the conclusion B
is the statement f (x) = 0 then the only two possibilities are f (x) = 0 and f (x) = 0. NOT
B is the statement f (x) = 0 which could be useful to you. The second instance is when B
contains a negation. As we saw earlier, NOT B eliminates the negation. 20.2.2 Reading a Proof by Contradiction Suppose we want to prove the following proposition. Proposition 1 (Prime Factorization (PF))
If n is an integer greater than 1, then n can be expressed as a product of primes. Example 1 The integers 2, 3, 5 and 7 are primes and each is a product unto itself, that is, it is a product
consisting of one factor. The integers 4 = 2 × 2, 6 = 2 × 3 and 8 = 2 × 2 × 2 have been
factored as products of primes. Here is a proof.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Let N be the smallest integer, greater than 1, that cannot be written as a product of
primes.
2. N is not itself a prime, so we can write N = rs where 1 < r ≤ s < N .
3. Since r and s are less than N , they can be written as a product of primes.
4. But then it follows that N = rs can be written as a product of primes, a contradiction. Analysis of Proof An interpretation of sentences 1 through 4 follows. 148 Chapter 20 Contradiction Sentence 1 Let N be the smallest integer, greater than 1, that cannot be written as a
product of primes.
The ﬁrst sentence of a proof by contradiction usually gives the speciﬁc form of NOT
B that the author is going to work with. In this case, the author identiﬁes that this is
a proof by contradiction by assuming the existence of an object which contradicts the
conclusion, an integer N which cannot be written as a product of primes. Moreover,
of all such candidates for N the author chooses the smallest one. Though it may not
be obvious when ﬁrst encountering the proof why the author would stipulate such a
condition, it always has to do with something needed later in the argument.
Once you know that this is a proof by contradiction, look ahead to ﬁnd the contradiction. In this case, the contradiction appears in Sentence 4.
Sentence 2 N is not itself a prime, so we can write N = rs where 1 < r ≤ s < N .
If N were prime, then N by itself is a product of primes (with just one factor). But
the author has assumed that N is not a product of primes, hence N is composite and
can be written as the product of two nontrivial factors r and s.
Sentence 3 Since r and s are less than N , they can be written as a product of primes.
This sentence makes it clear why N needs to be the smallest integer that cannot be
written as a product of primes. In order to generate the contradiction, r and s must
be written as products of primes. If it were the case that N was not the smallest such
integer, it might be the case that neither r nor s could be written as a product of
primes.
Sentence 4 But then it follows that N = rs can be written as a product of primes, a
contradiction.
Since both r and s can be written as a product of primes, the product rs = N can
certainly be written as a product of primes. But this contradicts the assumption in
Sentence 1 that N cannot be written as a product of primes.
Since our reasoning is correct, it must be the case that our assumption that there is an
integer which cannot be written as a product of primes is incorrect. That is, every integer
can be written as a product of primes. 20.2.3 Discovering and Writing a Proof by Contradiction Discovering a proof by contradiction can be diﬃcult and often requires several attempts at
ﬁnding the path to a contradiction. Let’s see how we might discover a proof to a famous
theorem recorded by Euclid. Proposition 2 (Inﬁnitely Many Primes (INF P))
The number of primes is inﬁnite. We should always be clear about our hypothesis and conclusion. There is no explicit hypothesis in this case and the conclusion is the statement
Conclusion: The number of primes is inﬁnite. Section 20.2 How To Use Contradiction 149 This statement contains a negation, inﬁnite is an abbreviation of not ﬁnite, and so is a
candidate for a proof by contradiction. Our ﬁrst statement in a proof by contradiction is a
negation of the conclusion so we have
Proof in Progress
1. Assume that the number of primes is ﬁnite. (This is NOT B.)
2. To be completed.
Now comes the tough part. What do we do from here? How do we generate a contradiction?
Well, if the number of primes is ﬁnite, could we somehow use that assumption to ﬁnd a
“new” prime not in our ﬁnite list of primes? Our candidate should not have any of the
ﬁnite primes as a factor. At this point, it sounds like we need to list our primes.
Proof in Progress
1. Assume that the number of primes is ﬁnite. (This is NOT B.)
2. Label the ﬁnite number of primes p1 , p2 , p3 , . . . , pn .
3. To be completed.
Now we have a way to express a candidate for a “new” prime.
Proof in Progress
1. Assume that the number of primes is ﬁnite. (This is NOT B.)
2. Label the ﬁnite number of primes p1 , p2 , p3 , . . . , pn .
3. Consider the integer N = p1 p2 p3 · · · pn + 1.
4. To be completed.
Clearly N is larger than any of the pi so, by the ﬁrst sentence, N cannot be in the list of
primes. Thus
Proof in Progress
1. Assume that the number of primes is ﬁnite. (This is NOT B.)
2. Label the ﬁnite number of primes p1 , p2 , p3 , . . . , pn .
3. Consider the integer N = p1 p2 p3 · · · pn + 1.
4. Since N > pi ∀i, N is not a prime.
5. To be completed.
And this is where we can ﬁnd our contradiction. N has no nontrivial factors since dividing
N by any of the pi leaves a remainder of 1. But that means N cannot be written as a
product of primes, which contradicts the previous proposition. The contradiction in this
proof arises from a result which is inconsistent with something else we have proved.
Proof in Progress 150 Chapter 20 Contradiction 1. Assume that the number of primes is ﬁnite. (This is NOT B.)
2. Label the ﬁnite number of primes p1 , p2 , p3 , . . . , pn .
3. Consider the integer N = p1 p2 p3 · · · pn + 1.
4. Since N > pi ∀i, N is not a prime.
5. Since N = pi q + 1 for each of the primes pi , no pi is a factor of N . Hence N cannot
be written as a product of primes, which contradicts our previous proposition.
Putting all of the statements together gives the following proof.
Proof: Assume that there are only a ﬁnite number of primes, say p1 , p2 , p3 , . . . , pn . Consider
the integer N = p1 p2 p3 · · · pn + 1. Since N > pi ∀i, N is not a prime. But N = pi q + 1 for
each of the primes pi , so no pi is a factor of N . Hence N cannot be written as a product of
primes, which contradicts our previous proposition. Chapter 21 Contrapositive
21.1 Objectives The technique objectives are:
1. Deﬁne the contrapositive.
2. Read a proof using the contrapositive.
3. Discover and write a proof using the contrapositive. 21.2 The Contrapositive We begin with an exercise. Exercise 1 Deﬁnition 21.2.1 Use truth tables to show that A ⇒ B ≡ ¬B ⇒ ¬A. The statement ¬B ⇒ ¬A is called the contrapositive of A ⇒ B . Contrapositive The logical equivalence between a statement and its contrapositive gives us another proof
technique. Instead of proving “A implies B ” we prove “ NOT B implies NOT A” using
any of the existing techniques. 21.2.1 When To Use The Contrapositive 151 152 Chapter 21 Contrapositive REMARK
This is very similar to contradiction. Use the contrapositive when the statement NOT A
or the statement NOT B gives you useful information. This is most likely to occur when
A or B contains a negation or is one of two possible choices. When both A and B contain
negations, it is highly likely that using the contrapositive will be productive. 21.3 Reading a Proof That Uses the Contrapositive Consider the following proposition. Proposition 1 Suppose a is an integer. If 32 ((a2 + 3)(a2 + 7)) then a is even. Proof: (For reference, each sentence of the proof is written on a separate line.)
1. We will prove the contrapositive.
2. If a is odd we can write a as 2k + 1 for some integer k .
3. Substitution gives
(a2 + 3)(a2 + 7) = ((2k + 1)2 + 3)((2k + 1)2 + 7)
= (4k 2 + 4k + 1 + 3)(4k 2 + 4k + 1 + 7)
= (4k 2 + 4k + 4)(4k 2 + 4k + 8)
= 4(k 2 + k + 1) × 4(k 2 + k + 2)
= 16(k 2 + k + 1)(k 2 + k + 2)
4. Since one of k 2 + k + 1 or k 2 + k + 2 must be even, and the last line above shows that
a factor of 16 already exists disjoint from (k 2 + k + 1)(k 2 + k + 2), (a2 + 3)(a2 + 7)
must contain a factor of 32. That is 32  ((a2 + 3)(a2 + 7)). Analysis of Proof Since the hypothesis of the proposition contains a negation, and the
conclusion is one of two possible choices, it makes sense to consider the contrapositive.
Sentence 1 We will prove the contrapositive.
Not all authors will be so obliging as to state the proof technique up front. The
provided proof would also be correct if this sentence was omitted. Correct, but less
easy to understand.
As usual, we begin by identifying the hypothesis and the conclusion.
Hypothesis: A: 32 ((a2 + 3)(a2 + 7)).
Conclusion: B : a is even.
For the contrapositive Section 21.3 Reading a Proof That Uses the Contrapositive 153 Hypothesis: NOT B : a is even.
Conclusion: NOT A: 32  ((a2 + 3)(a2 + 7))
How would we know that the author was using the contrapositive if this sentence were
omitted? The clause “If a is odd” is NOT B so the author is using one of only two
proof techniques that begin this way, contradiction or contrapositive. Looking ahead
to the last line, we see that the author concludes with NOT A, so this is a proof of
the contrapositive. Had the author concluded with a contradiction, we would know
that this is a proof by contradiction.
Sentence 2 If a is odd we can write a as 2k + 1 for some integer k .
This is the statement NOT B . Knowing from Sentence 1 that the author is using the
contrapositive we would expect to see statements moving forward from the hypothesis
of the contrapositive (a is even) or backwards from the conclusion of the contrapositive
(32  ((a2 + 3)(a2 + 7))).
Sentence 3 Substitution gives (a2 + 3)(a2 + 7) = . . . = 16(k 2 + k + 1)(k 2 + k + 2).
This is just arithmetic.
Sentence 4 Since one of k 2 + k +1 or k 2 + k +2 must be even, and the last line above shows
that a factor of 16 already exists disjoint from (k 2 + k + 1)(k 2 + k + 2), (a2 + 3)(a2 + 7)
must contain a factor of 32. That is 32  ((a2 + 3)(a2 + 7)).
These sentences establish the conclusion of the contrapositive. Since the contrapositive
is true, the original statement is true. 21.3.1 Discovering and Writing a Proof Using The Contrapositive The important observation here is that once you decide to use the contrapositive, all of your
existing skills apply. The diﬃculty is in deciding whether or not to use the contrapositive.
For our example, we will begin with a deﬁnition. Deﬁnition 21.3.1
Bounded Proposition 2 A set S of real numbers is bounded if there is a real number M > 0 such that, for all
elements x ∈ S , x < M . Suppose that S and T are sets of real numbers with S ⊆ T . If S is not bounded, then T is
not bounded. We should always be clear about our hypothesis and conclusion.
Hypothesis: A: S is not bounded.
Conclusion: B: T is not bounded.
Since both the hypothesis and conclusion are negated, it makes sense to try to prove the
contrapositive “If T is bounded, then S is bounded.” This gives us two statements in our
proof.
Proof in Progress 154 Chapter 21 Contrapositive 1. Suppose that T is bounded. (This is just NOT B .)
2. To be completed.
3. Hence, S is bounded. (This is just NOT A.)
Working backwards from the conclusion we can ask “How do we show that S is bounded?”
Using the deﬁnition of bounded, we can write
Proof in Progress
1. Suppose that T is bounded. (This is just NOT B .)
2. To be completed.
3. For every x ∈ S , we have x < M .
4. Hence, S is bounded. (This is just NOT A.)
Now the question becomes “Where can we ﬁnd such an M ?” If we use the deﬁnition of
bounded and work forward from the hypothesis we can write
Proof in Progress
1. Suppose that T is bounded. (This is just NOT B .)
2. Since T is bounded, there exists a real number M > 0 such that, for all x ∈ T ,
x < M .
3. To be completed.
4. For every x ∈ S , we have x < M .
5. Hence, S is bounded. (This is just NOT A.)
Next, we need to connect the two sets and show that the M of the set T is the same as the
M of the set S . But we know
Since x ∈ S and S ⊆ T , x ∈ T .
Combining this with second sentence we have
Since x ∈ S , x ∈ T and so x < M .
Putting all of the statements together gives the following proof.
Proof: We will prove the contrapositive. Suppose that T is bounded. Hence, there exists
a real number M > 0 such that, for all x ∈ T , x < M . Let x ∈ S . Since S ⊆ T , x ∈ T
and so x < M . But then S is bounded as required. Chapter 22 Uniqueness
22.1 Objectives The technique objective is:
1. Learn how to prove a statement about uniqueness in the conclusion. 22.2 Introduction You have already encountered statements that contain the adjective unique. Instead of the
word “unique” you may see “one and only one” or “exactly one”.
Prior to this course you have probably seen statements like the following. Example 1
1. Two lines in the plane which are not parallel will intersect in one and only one point.
2. There is a unique function f (x) such that f (x) = f (x). And earlier in this course you saw the Division Algorithm. Proposition 1 (Division Algorithm (DA))
If a and b are integers, and b > 0, then there exist unique integers q and r such that
a = qb + r where 0 ≤ r < b. To prove a statement of the form
If . . ., then there is a unique object x in the set S such that P (x) is true. 155 156 Chapter 22 Uniqueness there are basically two approaches.
1. Assume that there are two objects X and Y in the set S such that P (X ) and P (Y )
are true. Show that X = Y .
2. Assume that there are two distinct objects X and Y in the set S such that P (X )
and P (Y ) are true. Derive a contradiction.
You can use whichever is easier in the circumstance. 22.3 Showing X = Y The method is as follows.
1. Assume that there are two objects X and Y in the set S such that P (X ) and P (Y )
are true.
2. Show that X = Y .
For example, let us prove the following statement. Proposition 2 If a and b are integers with a = 0 and a  b, then there is a unique integer k so that b = ka. As usual, we begin by explicitly identifying the hypothesis and conclusion.
Hypothesis: a and b are integers with a = 0 and a  b.
Conclusion: There is a unique integer k so that b = ka.
The appearance of “unique” in the conclusion tells us to use one of the two approaches
described in the previous section. In this case, we will assume the existence of two integers
k1 and k2 and show that k1 = k2 . But ﬁrst, we need to show that at least one integer k
exists, and this follows immediately from the deﬁnition of divisibility.
Proof in Progress
1. Since a  b, at least one integer k exists so that b = ka.
2. Let k1 and k2 be integers such that b = k1 a and b = k2 a. (Note how closely this
follows the standard pattern. k1 corresponds to X . k2 corresponds to Y . Both come
from the set of integers and if P (x) is the statement “b = xa”, then P (X ) and P (Y )
are assumed to be true.
3. To be completed.
4. Hence, k1 = k2 . Section 22.4 Finding a Contradiction 157 The obvious thing to do is equate the two equations to get
k1 a = k2 a
Since a is not zero we can divide both sides by a to get
k1 = k2
A proof might look like the following.
Proof: Since a  b, at least one integer k exists so that b = ka. Now let k1 and k2 be integers
such that b = k1 a and b = k2 a. But then k1 a = k2 a and dividing by a gives k1 = k2 . 22.4 Finding a Contradiction The method is as follows.
1. Assume that there are two distinct objects X and Y in the set S such that P (X )
and P (Y ) are true.
2. Derive a contradiction.
For example, let us prove the following statement. Proposition 3 Suppose a solution to the simultaneous linear equations y = m1 x + b1 and y = m2 x + b2
exists. If m1 = m2 , then there is a unique solution to the simultaneous linear equations
y = m1 x + b1 and y = m2 x + b2 . As usual, we begin by explicitly identifying the hypothesis and conclusion.
Hypothesis: A solution to the simultaneous linear equations y = m1 x+b1 and y = m2 x+b2
exists. m1 = m2 .
Conclusion: There is a unique solution to the simultaneous linear equations y = m1 x + b1
and y = m2 x + b2 .
The appearance of “unique” in the conclusion tells us to use one of the two approaches
described in the previous section. In this case, we will assume the existence of two distinct
points of intersection and derive a conclusion.
Proof in Progress
1. Suppose that y = m1 x + b1 and y = m2 x + b2 intersect in the distinct points (x1 , y1 )
and (x2 , y2 ). (Note again how closely this follows the standard pattern. (x1 , y1 )
corresponds to X . (x2 , y2 ) corresponds to Y . Both come from the set of ordered pairs
and both satisfy the statement “are a solution to the simultaneous linear equations
y = m1 x + b1 and y = m2 x + b2 .”.)
2. To be completed, hence a contradiction. 158 Chapter 22 Uniqueness But now if we substitute (x1 , y1 ) and (x2 , y2 ) into y = m1 x + b1
y1 = m1 x1 + b1 (22.1) y2 = m1 x2 + b1 (22.2) which implies that
y1 − y2 = m1 (x1 − x2 )
Similarly, substituting (x1 , y1 ) and (x2 , y2 ) into y = m2 x + b2 gives
y1 − y2 = m2 (x1 − x2 )
Equating the two expressions for y1 − y2 gives
(m1 − m2 )(x1 − x2 ) = 0
Since m1 = m2 , m1 − m2 = 0 so x1 − x2 = 0. That is, x1 = x2 . But also,
y1 − y2 = m1 (x1 − x2 ) and x1 − x2 = 0
imply
y1 − y2 = 0
That is, y1 = y2 . But then the points (x1 , y1 ) and (x2 , y2 ) are not distinct, a contradiction. Exercise 1 Write a proof for the preceding proposition. 22.5 The Division Algorithm Suppose that in a proof of the Division Algorithm it has already been established that
integers q and r exist and only uniqueness remains. A proposed proof of uniqueness follows. Proposition 4 (Division Algorithm)
If a and b are integers and b > 0, then there exist unique integers q and r such that
a = qb + r where 0 ≤ r < b Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Suppose that a = q1 b + r1 with 0 ≤ r1 < b. Also, suppose that a = q2 b + r2 with
0 ≤ r2 < b and r1 = r2 .
2. Without loss of generality, we can assume r1 < r2 .
3. Then 0 < r2 − r1 < b and
4. (q1 − q2 )b = r2 − r1 .
5. Hence b  (r2 − r1 ). Section 22.5 The Division Algorithm 159 6. By Bounds By Divisibility, b ≤ r2 − r1 which contradicts the fact that r2 − r1 < b.
7. Therefore, the assumption that r1 = r2 is false and in fact r1 = r2 .
8. But then (q1 − q2 )b = r2 − r1 implies q1 = q2 . Let’s make sure that we understand every line of the proof.
Sentence 1 Suppose that a = q1 b + r1 with 0 ≤ r1 < b. Also, suppose that a = q2 b + r2
with 0 ≤ r2 < b and r1 = r2 .
Since a statement about uniqueness appears in the conclusion, we would expect one
of the two uniqueness methods to be used. In fact, both are used. The assertion of
uniqueness applies to both q and r. Since the author writes r1 = r2 , that is, there are
distinct values of r1 and r2 , we should look for a contradiction regarding r. But the
author does not assume distinct values of q and so we would expect that the author
will show q1 = q2 .
Sentence 2 Without loss of generality, we can assume r1 < r2 .
“Without loss of generality” is an expression that means the upcoming argument
would hold identically if we made any other choice, so we will simply assume one of
the possibilities.
Sentence 3 Then 0 < r2 − r1 < b and
This is a particularly important line. It comes, in part, from r1 < r2 by subtracting r1
from both sides (this gives 0 < r2 − r1 ) and by remembering that the largest possible
value of r2 is b − 1 and the smallest possible value of r1 is 0, so the largest possible
diﬀerence is b − 1, thus r2 − r1 < b
Sentence 4 (q1 − q2 )b = r2 − r1 .
This follows from equating a = q1 b + r1 and a = q2 b + r2 .
Sentence 5 Hence b  (r2 − r1 ).
This follows from the deﬁnition of divisibility.
Sentence 6 By Bounds By Divisibility, b ≤ r2 − r1 which contradicts the fact that r2 − r1 <
b.
Note the importance of the strict inequality in the relation
b ≤ r2 − r1 < b
Sentence 7 Therefore, the assumption that r1 = r2 is false and in fact r1 = r2 .
The contradiction we were looking for. The Division Algorithm states that both q
and r are unique. So far, only the uniqueness of r has been established.
Sentence 7 But then (q1 − q2 )b = r2 − r1 implies q1 = q2 .
And this is where the uniqueness of q is established. Originally, the author assumed
the existence of q1 and q2 and now has shown that they are, in fact, the same. Chapter 23 Introduction to Primes
23.1 Objectives The technique objectives are:
1. Practice with induction.
2. Practice with arguments of uniqueness.
The content objectives are:
1. Recall the deﬁnition of prime and composite.
2. Discover a proof by induction of the Prime Factorization Theorem. 23.2 Introduction to Primes The second problem that the course focuses on is Fermat’s Last Theorem. Theorem 1 (Fermat’s Last Theorem (FLT))
If n ≥ 3, then there are no solutions to
xn + y n = z n
where x, y and z are positive integers. To make progress on this problem, we need to work with prime numbers. Recall our
deﬁnition of prime number. Deﬁnition 23.2.1 An integer p > 1 is called a prime if its only divisors are 1 and p, and composite otherwise. Prime, Composite 160 Section 23.3 Induction Example 1 161 The integers 2, 3, 5 and 7 are primes. The integers 4 = 2 × 2, 6 = 2 × 3 and 8 = 2 × 2 × 2
are composite. Note, that by deﬁnition, 1 is not a prime. We have already proved three propositions about primes, one of which is a consequence of
Coprimeness and Divisibility, and the other two were proved in the chapter on contradiction. Proposition 2 (Primes and Divisibility (PAD))
If p is a prime and p  ab, then p  a or p  b. Proposition 3 (Prime Factorization (PF))
If n is an integer greater than 1, then n can be written as a product of prime factors. Proposition 4 (Inﬁnitely Many Primes (INF P))
The number of primes is inﬁnite. We will prove Prime Factorization again, this time with induction. 23.3 Induction Recall how induction, Strong Induction in this case, works. Axiom 3 Principle of Strong Induction (POSI)
Let P (n) be a statement that depends on n ∈ P.
If
1. P (1), P (2), . . . , P (b), are true, and
2. P (1), P (2), . . . , P (k ) are all true implies P (k + 1) is true
then P (n) is true for all n ∈ P. Recall the three parts in a proof by strong induction.
Base Cases Verify that P (1), P (2), . . . , P (b) are all true.
Inductive Hypothesis Assume that P (i) is true for i = 1, 2, 3, . . . , k where k ≥ b.
Inductive Conclusion Using the assumption that P (1), P (2), . . . , P (k ) are true,
show that P (k + 1) is true. 162 Chapter 23 Introduction to Primes We will use Strong Induction to prove Proposition 5 (Prime Factorization (PF))
If n is an integer greater than 1, then n can be expressed as a product of prime factors. First, we formulate our statement P (n) that relies on the integer n.
P (n): n can be expressed as a product of prime factors.
Now we can begin the proof.
Proof: Base Case We verify P (2). Recall that the base case does not need to start at 1.
P (2): 2 can be expressed as a product of prime factors.
This is trivially true.
Inductive Hypothesis We assume that P (i) is true for i = 2, 3, . . . , k where k ≥ 2.
P (i): i can be expressed as a product of prime factors.
Inductive Conclusion Now show that the statement P (k + 1) is true.
P (k + 1): k + 1 can be expressed as a product of prime factors.
If k + 1 is prime, then k + 1 by itself is a product of prime factors. It is a product
with just one factor. In this case, P (k + 1) is true.
If k + 1 is composite, then we can write k + 1 = rs where 1 < r ≤ s < k + 1. Since
r and s are less than k + 1, they can be written as a product of prime factors by the
inductive hypothesis. Hence, k + 1 is a product of prime factors and P (k + 1) is true
in this case also.
The result is true for n = k + 1, and so holds for all n by POSI. 23.4 Fundamental Theorem of Arithmetic In grade school you used prime numbers to write the prime factorization of any positive
integer greater than one. You probably never worried about the possibility that there might
be more than one way to do this. However, in some sets “prime” factorization is not unique.
√
√
5
Consider the set S = {a + b 5  a, b ∈ Z}. In S , the number 4 = 4 + 0 √ can be factored
√
√
√
in two diﬀerent ways, 4 = 2 × 2 and 4 = ( 5 + 1)( 5 − 1). Moreover, 2, 5 + 1 and 5 − 1
are all prime numbers in S !
Since multiplication in the integers is commutative, the prime factorizations can be written
in any order. For example 12 = 2 × 2 × 3 = 2 × 3 × 2 = 3 × 2 × 2. However, up to the
order of the factors, the factorization of integers is unique. This property is so basic it is
referred to as the Fundamental Theorem of Arithmetic. It is also referred to as the Unique
Factorization Theorem. Section 23.4 Fundamental Theorem of Arithmetic Theorem 6 163 (Fundamental Theorem of Arithmetic or
Unique Factorization Theorem (UFT))
If n > 1 is an integer, then n can be written as a product of prime factors and, apart from
the order of factors, this factorization is unique. Observe that the conclusion contains two parts:
1. n can be written as a product of prime factors (which we proved earlier), and
2. apart from the order of factors, this factorization is unique.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. That n can be written as a product of prime factors follows from the proposition
Prime Factorization.
2. Now suppose that n is factored into primes in two ways,
n = p1 p2 . . . pk = q1 q2 . . . q (23.1) where all of the p’s and q ’s are primes.
3. Since p1  n, p1  q1 q2 . . . q .
4. By repeatedly applying the proposition Primes and Divisibility, p1 must divide one of
the q ’s. If necessary, rearrange the q ’s so that p1  q1 .
5. Since q1 is prime, and p1 > 1, it must be the case that p1 = q1 .
6. Dividing Equation 23.1 by p1 = q1 gives
p2 p3 . . . pk = q2 q3 . . . q (23.2) 7. By continuing in this way, we see that each p must be paired oﬀ with one of the q s
until there are no factors on either side.
8. Hence k =
the same. and, apart from the order of the factors, the two expressions for n are Let’s perform an analysis of the proof. As usual, we begin with the hypothesis and the
conclusion.
Hypothesis: n is an integer, n > 1
Conclusion: There are two parts.
1. n can be written as a product of prime factors, and
2. apart from the order of factors, this factorization is unique. 164 Chapter 23 Introduction to Primes Core Proof Technique: Uniqueness
Preliminary Material: Primes and Divisibility
Sentence 1 That n can be written as a product of prime factors follows from the proposition
Prime Factorization.
The ﬁrst of the two parts of the conclusion is just the conclusion of a previous proposition.
Sentence 2 Now suppose that n is factored into primes in two ways,
n = p1 p2 . . . pk = q1 q2 . . . q
where all of the p’s and q ’s are primes.
This is a classic use of the Uniqueness Method. We assume that there are two representations of the same object, and show that the two representations are, in fact,
identical. One representation of n is the product p1 p2 . . . pk and the second representation is the product q1 q2 . . . q .
Sentences 3 – 5 Since p1  n, p1  q1 q2 . . . q . By repeatedly applying the proposition
Primes and Divisibility, p1 must divide one of the q ’s. If necessary, rearrange the q ’s
so that p1  q1 . Since q1 is prime, and p1 > 1, it must be the case that p1 = q1 .
The author shows that the two representations of n are equal by showing that they
have identical factors. Here, the author demonstrates that p1 = q1 .
Sentences 6 – 7 Dividing Equation 23.1 by p1 = q1 gives
p2 p3 . . . pk = q2 q3 . . . q
By continuing in this way, we see that each p must be paired oﬀ with one of the q s
until there are no factors on either side.
This continues the author’s plan of showing that the two representations of n are
equal by showing that they have identical factors.
Sentence 8 Hence k =
n are the same. and, apart from the order of the factors, the two expressions for This is a typical conclusion to the Uniqueness Method. The two representations of
the same object are identical. 23.5 Finding a Prime Factor The previous proposition does not provide an algorithm for ﬁnding the prime factors of a
positive integer n. The next proposition shows that we do not have to check all of the prime
factors less than n, only those less than or equal to the square root of n. Proposition 7 (Finding a Prime Factor (FPF))
An integer n > 1 is either prime or contains a prime factor less than or equal to Let’s begin by identifying the hypothesis and the conclusion. √ n. Section 23.5 Finding a Prime Factor 165 Hypothesis: n is an integer and n > 1.
Conclusion: n is either prime or contains a prime factor less than or equal to √ n. Before we see a proof, let’s do an example. Example 2 Is 73 a prime number?
Solution: Using Finding a Prime Factor , we can check for divisibility by primes less than
√
√
or equal to 73. Now 73 ≈ 8.544 so any possible prime factor must be less than or equal
to 8. The only candidates to check are 2, 3, 5 and 7. Since none of these divide 73, 73 must
be prime. Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Suppose that n is not prime.
2. Let p be the smallest prime factor of n.
3. Since n is composite we can write n = ab where a and b are integers such that
1 < a, b < n.
4. Since p is the smallest prime factor, p ≤ a and p ≤ b and so n = ab ≥ p · p = p2 . That
√
is p ≤ n. Analysis of Proof Since or appears in the conclusion, we will use Proof By Elimination.
The equivalent statement that is proved is:
If n is an integer greater than 1 and n is not prime, then n contains a prime
√
factor less than or equal to n.
The word “a” should alert us to the presence of an existential quantiﬁer. We could
reword the statement as
If n is an integer greater than 1 and n is not prime, then there exists a
√
prime factor of n which is less than or equal to n.
This is the statement that will actually be proved.
Hypothesis: n is an integer greater than 1 and n is not prime.
Conclusion: There exists a prime factor of n which is less than or equal to √
n. Core Proof Technique: Construct Method
Sentence 1 Suppose that n is not prime.
This sentence tells that the author is going to use Proof by Elimination.
Sentence 2 Let p be the smallest prime factor of n.
The conclusion has an existential quantiﬁer and so the author uses the Construct
Method. The prime p will be the desired prime factor though it is not clear yet why
“smallest” is important. The proposition on Prime Factorization guarantees us that
a prime factor exists. 166 Chapter 23 Introduction to Primes Sentence 3 Since n is composite we can write n = ab where a and b are integers such that
1 < a, b < n.
By the hypotheses of the restated proposition, n > 1 and n is not prime, so n is
composite and can be factored.
Sentence 4 Since p is the smallest prime factor, p ≤ a and p ≤ b and so n = ab ≥ p·p = p2 .
√
That is p ≤ n.
This is where “smallest” is used. The conclusion follows from arithmetic and the fact
that p is the smallest prime factor. 23.6 Working With Prime Factorizations The next proposition, which we will state but not prove, gives us a means to list all of the
divisors of a positive integer. A proof is available in the Appendix. Add proof. Proposition 8 (Divisors From Prime Factorization (DFPF))
If a > 1 is an integer and
a = pα1 pα2 · · · pαk
12
k
is the prime factorization of a into powers of distinct primes p1 , p2 , . . . , pk , then the positive
divisors of a are integers of the form
d = pd1 pd2 · · · pdk where 0 ≤ di ≤ αi for i = 1, 2, . . . , k
12
k Exercise 1 Using Divisors From Prime Factorization, list all of the positive factors of 45. Exercise 2 How many positive divisors are there to the integer a whose prime factorization is
a = pα1 pα2 · · · pαk
12
k Proposition 9 (GCD From Prime Factorization (GCD PF))
If
a = pα1 pα2 · · · pαk
12
k
and
b = pβ1 pβ2 · · · pβ
12
are the prime factorizations of a and b, where some of the exponents may be zero, then
gcd(a, b) = pd1 pd2 · · · pdk where di = min{αi , βi } for i = 1, 2, . . . , k
12
k Though this method works well enough on small examples, it is much slower than the
Extended Euclidean Algorithm for computing gcds. Section 23.6 Working With Prime Factorizations Exercise 3 Use GCD PF to compute gcd(33 51 74 131 , 52 77 131 232 ). Exercise 4 Use the deﬁnition of gcd to prove GCD From Prime Factorization. 167 Chapter 24 Introduction to Fermat’s Last
Theorem
24.1 Objectives The content objectives are:
1. Provide an historical introduction.
2. Deﬁne gcd(x, y, z ), trivial solutions, Pythagorean triple and primitive Pythagorean
triple.
3. State Extending Coprimeness.
4. Read a proof of Multiples of Pythagorean Triples.
5. Discover a proof of Relative Primeness of Pythagorean Triples.
6. Read a proof of Parity of Primitive Pythagorean Triples.
7. State Decomposition of nth Powers. 24.2 History of Fermat’s Last Theorem Pierre de Fermat (1601 (?) – 1635) was a brilliant French mathematician. It was his habit
to make notes in the margins of his books and one such note is famous. Fermat possessed
a copy of Bachet’s translation of Diophantus’ Arithmetica. Problem II.8 of the Arithmetica
reads
Partition a given square into two squares.
Diophantus did not require the squares to be integers so we might write Problem II.8 as
For what positive rational numbers x, y and z is the equation
x2 + y 2 = z 2
satisﬁed?
168 Section 24.2 History of Fermat’s Last Theorem 169 Adjacent to Problem II.8, and in the margin of his copy of Arithmetica, Fermat wrote
(translated)
It is impossible to separate a cube into two cubes, or a fourth power into two
fourth powers, or in general, any power higher than the second, into two like
powers. I have discovered a truly marvellous proof of this, which this margin is
too narrow to contain.
Fermat was asserting Theorem 1 (Fermat’s Last Theorem)
If n ≥ 3, then
xn + y n = z n
has no solutions when x, y and z are positive integers. No proof was ever published by Fermat, or found among his notes after his death. It seems
very unlikely that he did have a proof and it was not until Andrew Wiles’ publications in
1994 that the Theorem, conjecture really, was proved. Fermat did prove the case n = 4, as
we shall do.
First though, we will clarify our language. Clearly there are solutions to xn + y n = z n . One
solution is x = y = z = 0, another solution is x = 0, y = z . Deﬁnition 24.2.1
Trivial We will say that any solution to xn + y n = z n for which at least one of x, y or z is zero, is
trivial. So we restate Fermat’s Last Theorem as Theorem 2 (Fermat’s Last Theorem)
If n ≥ 3, then
xn + y n = z n
has no nontrivial integer solutions. Our starting point will be a much more familiar problem.
x2 + y 2 = z 2 (24.1) You will recognize this as the equation of the Pythagorean Theorem. Our task is to identify
all positive integer solutions to 24.1. 170 Chapter 24 24.3 Introduction to Fermat’s Last Theorem Pythagorean Triples We begin with some deﬁnitions. Deﬁnition 24.3.1 A Pythagorean triple is a set of nonzero integers x, y and z such that x2 + y 2 = z 2 . Pythagorean Triple Equivalently, a Pythagorean triple is a nontrivial solution to x2 + y 2 = z 2 .
Now we expand our deﬁnition of gcd. Deﬁnition 24.3.2
Greatest Common
Divisor Let a, b and c be integers, not all zero. An integer d > 0 is the greatest common divisor
of a, b and c, written gcd(a, b, c), if and only if
1. d  a, d  b and d  c (this captures the common part of the deﬁnition), and
2. if e  a and e  b and e  c then e ≤ d (this captures the greatest part of the deﬁnition). Deﬁnition 24.3.3 A Pythagorean triple is said to be primitive if gcd(x, y, z ) = 1. Primitive Triple Example 1 Both (6, 8, 10) and (3, 4, 5) are Pythagorean triples. However
• (6, 8, 10) is not a primitive Pythagorean triple since gcd(6, 8, 10) = 2 = 1.
• (3, 4, 5) is a primitive Pythagorean triple since gcd(6, 8, 10) = 1. We leave the proof of the following very useful lemma as an exercise. Lemma 3 (Extending Coprimeness (EC))
If x, y and z are integers, not all zero, and gcd(x, y ) = 1, then gcd(x, y, z ) = 1. Proposition 4 (Multiples of Pythagorean Triples (MPT))
Let d = gcd(x, y, z ). The three integers x, y and z are a Pythagorean triple if and only if
x
y
z
the three integers x1 = , y1 = and z1 = are a Pythagorean triple.
d
d
d Example 2 (6, 8, 10) is a Pythagorean triple since 62 +82 = 102 . Since gcd(6, 8, 10) = 2, by the Multiples
of Pythagorean Triples, (3, 4, 5) is a Pythagorean triple.
Also, if (3, 4, 5) is a Pythagorean triple, then (3d, 4d, 5d) is a Pythagorean triple. This is a simple “if and only if” proof that can be proved using a chain of “if and only if”
statements. Section 24.3 Pythagorean Triples 171 Proof:
x, y and z are a Pythagorean triple
⇐⇒ x2 + y 2 = z 2
⇐⇒ x2 y2 (defn of Pythagorean triple) z2 (divide by d2 ) + 2= 2
d2
d
d
2
2
⇐⇒ x2 + y1 = z1
1
⇐⇒ x1 , y1 and z1 are a Pythagorean triple (substitution)
(defn of Pythagorean triple) Take ten minutes to prove the following proposition and then compare your proof with the
proof that follows. Proposition 5 (Relative Primeness of Pythagorean Triples (RPPT))
If x, y and z are a primitive Pythagorean triple, then gcd(x, y ) = gcd(x, z ) = gcd(y, z ) = 1. Proof: We will show that gcd(x, y ) = 1. The other pairs are similar. Suppose to the
contrary that gcd(x, y ) = d > 1. Then there exists a prime p so that p  d. Since p  x and
p  y , p  (x2 + y 2 ) by the Divisibility of Integer Combinations. Since x2 + y 2 = z 2 , p  z 2
and so p  z by Primes and Divisibility. But then gcd(x, y, z ) ≥ p > 1 which contradicts the
hypothesis that x, y and z are a primitive Pythagorean triple.
Let us walk through a proof of the following proposition. Proposition 6 (Parity of Primitive Pythagorean Triples (PPPT))
If x, y and z are a primitive Pythagorean triple, then one of the integers x or y is even and
the other is odd. First, let’s check this against our experience. Example 3 (Parity of Primitive Pythagorean Triples)
1. In the primitive Pythagorean triple (3, 4, 5), 3 is odd and 4 is even.
2. The Pythagorean triple (6, 8, 10) has no odd elements, but the proposition does not
apply to the Pythagorean triple (6, 8, 10) since it is not primitive.
3. In the primitive Pythagorean triple (8, 15, 17), 8 is even and 15 is odd. 172 Chapter 24 Introduction to Fermat’s Last Theorem Proof: (For reference, each sentence of the proof is written on a separate line.)
1. We will proceed by contradiction using two cases: x and y are both even, and x and
y are both odd.
2. Consider the ﬁrst case. Suppose that x and y are both even.
3. But then gcd(x, y ) = 2 = 1 which contradicts the Relative Primeness of Pythagorean
Triples.
4. Consider the second case. Suppose that x and y are both odd.
5. This implies that x2 ≡ 1 (mod 4) and y 2 ≡ 1 (mod 4) which in turn implies
z 2 = x2 + y 2 ≡ 2 (mod 4) 6. But this is impossible since the square of any integer can only be congruent to 0 or 1
modulo 4.
7. Since the two integers cannot both be even or odd, exactly one must be even and one
must be odd. As usual, we will begin our analysis by identifying the hypothesis, conclusion, core proof
techniques and preliminary material.
Hypothesis: x, y and z are a primitive Pythagorean triple.
Conclusion: One of the integers x or y is even and the other is odd.
Core Proof Technique: There are only three possible cases: x and y are both even, x and
y are both odd or x and y have opposite parity. The ﬁrst two cases will be eliminated
leaving the third as the only possible outcome. Each of the ﬁrst two cases is dealt with
using contradiction. The use of contradiction several times within a proof is common.
Preliminary Material: primitive Pythagorean triple, congruences
Let’s examine each collection of sentences.
Sentence 1. We will proceed by contradiction eliminating two cases: x and y are both even,
and x and y are both odd.
The author indicates the plan of the proof, always a good idea. There are only three
possible cases: x and y are both even, x and y are both odd or x and y have opposite
parity. The author will disprove the ﬁrst two cases using contradiction, hence by
elimination leaving only opposite parity.
Sentence 2. Consider the ﬁrst case. Suppose that x and y are both even.
This sentence begins the ﬁrst of the two embedded proofs by contradiction. Section 24.3 Pythagorean Triples 173 Sentence 3. But then gcd(x, y ) = 2 = 1 which contradicts the Relative Primeness of
Pythagorean Triples.
To invoke the Relative Primeness of Pythagorean Triples we should make sure that
the hypothesis of RPPT is satisﬁed. All that is required is that “x, y and z are a
primitive Pythagorean triple”, which is assured from the hypothesis of the proposition
we are proving.
Sentence 4. Consider the second case. Suppose that x and y are both odd.
This sentence begins the second of the two embedded proofs by contradiction.
Sentence 5. This implies that x2 ≡ 1 (mod 4) and y 2 ≡ 1 (mod 4) which in turn implies
z 2 = x2 + y 2 ≡ 2 (mod 4) Sentence 6. But this is impossible since the square of any integer can only be congruent
to 0 or 1 modulo 4.
This part of proof is quite diﬀerent from the earlier part. Since any odd integer a can
be written in the form 2t + 1, a2 has the form 4t2 + 4t + 1 which is congruent to
1 (mod 4). Thus z 2 = x2 + y 2 ≡ 1 + 1 ≡ 2 (mod 4). But how could this be? If z were
odd, z 2 ≡ 1 (mod 4), and if z were even, z 2 ≡ 0 (mod 4).
Sentence 7. Since the two integers cannot both be even or odd, exactly one must be even
and one must be odd.
Since the cases of x and y both even or x and y both odd have been eliminated, all
that remains is that x and y have opposite parity. REMARK
If x, y , z is a Pythagorean triple, we will assume as a convention that x is even and y is
odd. Notice that this implies that z is odd. (Why?) We conclude with a small proposition that is very useful. The proof appears in the Appendix. Proposition 7 (Decomposition of nth Powers (DNP))
If ab = cn and gcd(a, b) = 1, then there exist integers a1 and b1 so that a = an and b = bn .
1
1 Example 4 Consider 592, 704 which is just 843 . With n = 3, c = 84, a = 64 and b = 9261, the
hypotheses of the proposition are satisﬁed. Hence, there exist integers a1 and b1 so that
a = 64 = an and b = 9261 = bn . So a1 = 4 and b1 = 21, and 43 213 = 843 .
1
1
Notice that our choice of a and b satisﬁed gcd(a, b) = 1. With a = 8 = 23 and b = 74088 =
423 , even though ab = cn is still true, the proposition does not apply since gcd(a, b) = 1 Chapter 25 Characterization of Pythagorean
Triples
25.1 Objectives The content objectives are:
1. State and prove the Characterization of Pythagorean Triples theorem.
2. Illustrate the theorem. 25.2 Pythagorean Triples We are now able to characterize all nontrivial, primitive Pythagorean triples. The proof
in this section follows that done by David Burton in Elementary Number Theory, Seventh
Edition. Theorem 1 (Characterization of Pythagorean Triples (CPT))
The complete set of nontrivial, primitive solutions to
x2 + y 2 = z 2
is given by
x = 2st
y = s2 − t2
z = s2 + t2
for integers s > t > 0 such that gcd(s, t) = 1 and s ≡ t (mod 2). Let’s understand what the theorem is saying. Every choice of s and t satisfying integers
s > t > 0 such that gcd(s, t) = 1 and s ≡ t (mod 2) should produce a Pythagorean triple
and these are the only nontrivial, primitive Pythagorean triples.
174 Section 25.2 Pythagorean Triples 175 The table below lists some primitive Pythagorean triples arising from small values of s and
t.
s t 2
3
4
4
5
5 1
2
1
3
2
4 x
2st
4
12
8
24
20
40 y
s2 − t2
3
5
15
7
21
9 z
s2 + t2
5
13
17
25
29
41 Before we read the proof, let’s do some analysis. The expression “complete solution” should
indicate to us that we are working with sets. So, the ﬁrst step is to identify which sets are
used and what their relationship is.
One set is the collection of nontrivial, primitive Pythagorean triples and can be deﬁned by
S = {x, y, z ∈ N  x2 + y 2 = z 2 , gcd(x, y, z ) = 1, 2  x}
Note that the use of N is equivalent to nontrivial, that gcd(x, y, z ) = 1 is equivalent to
primitive and 2  x follows our convention that in a primitive Pythagorean triple, x is even
and y and z are odd. The other set is the collection of triples determined by formula and
can be deﬁned by
T = {x, y, z ∈ N 
s, t ∈ N, x = 2st, y = s2 − t2 , z = s2 + t2 , s > t, gcd(s, t) = 1, s ≡ t (mod 2)}
The Characterization of Pythagorean Triples theorem asserts that S = T . We would expect
the proof to show that S = T by showing that S ⊆ T and T ⊆ S , though this is done
implicitly.
Here is the proof. Be sure to identify
1. where S and T appear in the proof,
2. where each of the elements that deﬁne set membership are satisﬁed,
3. where each of the elements that deﬁne set membership are used.
Question Panel walk through of proof here.
Proof: Let x, y and z be a nontrivial, primitive Pythagorean triple. Since x is even and
y and z are odd, z − y and z + y are even. Suppose z − y = 2u and z + y = 2v . Then
u= z−y
z+y
and v =
2
2 and
v − u = y and u + v = z
and the equation x2 + y 2 = z 2 may be rewritten as
x2 = z 2 − y 2 = (z − y )(z + y ) 176 Chapter 25 Characterization of Pythagorean Triples Dividing the preceding equation by 4 gives
x
2 2 = z−y
2 z+y
2 = uv We claim that u and v are relatively prime. Suppose they were not and gcd(u, v ) = d > 1.
Then d  (v − u) and d  (u + v ). But v − u = y and u + v = z so d  y and d  z which
contradicts the fact that y and z are relatively prime. Now we can use our proposition on
Decomposing nth Powers to conclude that u and v are perfect squares. Hence, for some
positive integers s and t
u = t2
v = s2
Using these values of u and v produces
z = v + u = s2 + t2
y = v − u = s2 − t2
x2 = 4vu = 4s2 t2 ⇒ x = 2st
We claim that gcd(s, t) = 1. If d > 1 were a common factor of s and t, d would be a
common factor of y and z contradicting the fact that gcd(y, z ) = 1. Finally, if s and t are
both even or both odd, then y and z are even, a contradiction. Hence, exactly one of s and
t is odd, the other is even. Symbolically, s ≡ t (mod 2).
Conversely, let the natural numbers s and t satisfy s > t, gcd(s, t) = 1, s ≡ t (mod 2).
Using the provided formulas for x, y and z we have
x2 + y 2 = (2st)2 + (s2 − t2 )2 = (s2 + t2 )2 = z 2
so x, y and z are a Pythagorean triple. To see that the triple is nontrivial, we must show
that x, y and z are all positive. Since s, t > 0, x = 2st > 0 and z = s2 + t2 > 0. Since s > t,
y = s2 − t2 > 0. To see that the triple is primitive, assume that gcd(x, y, z ) = d > 1 and
let p be any prime divisor of d. Since one of s and t is odd and the other is even, z is odd.
Since p  z , p = 2. From p  y and p  z , we know that p  (z + y ) and since z + y = 2s2 ,
p  2s2 . Hence, p  s. Similarly, p  t. But then p is a common factor of s and t contradicting
gcd(s, t) = 1. Since no such p can exist, gcd(x, y, z ) = 1 and x, y and z are a primitive
triple. Chapter 26 Fermat’s Theorem for n = 4
26.1 Objectives The content objectives are
1. State and prove: The Diophantine equation x4 + y 4 = z 2 has no nontrivial solution.
2. State and prove: The Diophantine equation x4 + y 4 = z 4 has no nontrivial solution.
3. Show a reduction of FLT to If p is an odd prime, then the Diophantine equation
xp + y p = z p has no nontrivial solution. 26.2 n=4 Having completely resolved the case of Pythagorean triples, we can now turn our attention
to the one instance of FLT proved by Fermat. Actually, we will prove a slightly stronger
result and the case n = 4 will follow as a corollary. The approach in this section mostly
follows Elementary Number Theory, Seventh Edition by David Burton. Theorem 1 (FLT, Strong Version of n = 4)
The Diophantine equation x4 + y 4 = z 2 has no nontrivial solution. The proof is demanding but it has a straightforward structure.
1. This is a proof by contradiction. It assumes the existence of a “minimal” solution x0 ,
y0 , z0 to x4 + y 4 = z 2 .
2. Using x0 , y0 , z0 the author constructs a nontrivial primitive Pythagorean triple.
3. Using the Characterization of Pythagorean Triples the author ﬁnds various algebraic
expressions involving s and t.
4. The author uses these algebraic expressions to construct another nontrivial primitive
Pythagorean triple.
177 178 Chapter 26 Fermat’s Theorem for n = 4 5. Lastly, the author uses this triple to construct a solution x1 , y1 , z1 to x4 + y 4 = z 2
which is “smaller” than x0 , y0 , z0 , hence a contradiction.
Extensive Question Panel here.
Proof: By way of contradiction, suppose there exists a positive integer solution to x4 + y 4 =
z 2 . Of all such solutions, choose any one in which z is smallest. Call this solution x0 , y0 ,
z0 . Without loss of generality, we may also assume that gcd(x0 , y0 ) = 1. (Why?) This in
turn implies that gcd(x0 , y0 , z0 ) = 1. (Why?)
Since x0 , y0 , z0 is a solution we know
4
2
x4 + y0 = z0
0 which we can rewrite as
x2
0 2 2
+ y0 2 2
= z0 2
But that means that x2 , y0 and z0 are nontrivial primitive solutions of a2 + b2 = c2 so we
0
can make use of the Characterization of Pythagorean Triples. In particular, we know that
2
one of x2 and y0 is even. We can assume that x2 is even, hence x0 is even, and that there
0
0
exist integers s and t so that s > t > 0 and gcd(s, t) = 1 and s ≡ t (mod 2) satisfying x2 = 2st
0
2
y0 = s2 − t2 z0 = s2 + t2
Since s ≡ t (mod 2), exactly one of s and t are even. Suppose s is even and t is odd. Now
2
2
consider the equation y0 = s2 − t2 modulo 4. Because y0 is odd,
2
y0 = s2 − t2 ⇒ 1 ≡ 0 − 1 (mod 4) ⇒ 1 ≡ 3 (mod 4) which is impossible. Therefore s is odd and t is even so we write t = 2r. Then
x2 = 2st ⇒ x2 = 4sr ⇒
0
0 x0
2 2 = sr Now gcd(s, t) = 1 implies that gcd(s, r) = 1 (why?) and so we can use the proposition
on Decomposing nth Powers. Since (x0 /2)2 is a perfect square, s and r must be perfect
2
2
squares and we can write s = z1 and r = w1 for positive integers z1 and w1 .
2
Rewrite y0 = s2 − t2 as 2
t2 + y0 = s2 Because gcd(s, t) = 1 implies gcd(s, t, y0 ) = 1, the triple t, y0 , s is a primitive Pythagorean
triple and we can use the Characterization of Pythagorean Triples again. With t even, the
Characterization of Pythagorean Triples assures us of the existence of integers u and v so
that u > v > 0 and gcd(u, v ) = 1 and u ≡ v (mod 2) satisfying
t = 2uv
y0 = y 2 − v 2
s = u2 + v 2
Now, observe that
uv = t
2
= r = w1
2 Section 26.4 Reducing the Problem 179 and so by the proposition on Decomposing nth Powers, u and v are perfect squares. Suppose
2
u = x2 and v = y1 where x1 and y1 are positive integers. But then
1
2
s = u2 + v 2 ⇒ z1 = x2
1 2 2
+ y1 2 and so
2
4
z 1 = x 4 + y1
1 That is, x1 , y1 , z1 is a solution to x4 + y 4 = z 2 . Since z1 and t are positive
2
0 < z1 ≤ z1 = s ≤ s2 < s2 + t2 = z0 That is,
z1 < z0
But recall that x0 , y0 , z0 is a solution to x4 + y 4 = z 2 with the smallest possible value of z .
But x1 , y1 , z1 is a solution to x4 + y 4 = z 2 with a smaller value of z !
The case n = 4 of Fermat’s Last Theorem follows immediately. Corollary 2 The Diophantine equation x4 + y 4 = z 4 has no positive integer solution. 2
Proof: If x0 , y0 , z0 were a positive integer solution of x4 + y 4 = z 4 , then x0 , y0 , z0 would
4 + y 4 = z 2 , contradicting the previous theorem.
be a positive integer solution to x 26.3 Reducing the Problem It is not necessary to consider every exponent of xn + y n = z n to prove Fermat’s Last
Theorem.
If n > 2, then n is either a power of 2 or divisible by an odd prime p. In the ﬁrst case,
n = 4k for some k ≥ 1 and the equation xn + y n = z n can be rewritten as
xk 4 + yk 4 = zk 4 We have just seen that this equation has no positive integer solution.
In the second case, n = pk for some k ≥ 1 and the equation xn + y n = z n can be rewritten
as
p
p
p
xk + y k = z k
If it could be shown that up + v p = wp has no solution, then there would be no solution
of the form u = xk , v = y k , w = z k and so there would be no solution to xn + y n = z n .
Therefore, Fermat’s Last Theorem reduces to Theorem 3 (Fermat’s Last Theorem – Reduced)
If p is an odd prime, then the Diophantine equation
xp + y p = z p
has no nontrivial solutions. 180 Chapter 26 26.4 History Awaiting copyright permission. Fermat’s Theorem for n = 4 Chapter 27 Problems Related to FLT
27.1 Objectives 1. Read a proof of Squares From the Diﬀerence of Quartics
2. Read a proof of a proposition on the area of Pythagorean triangles. 27.2 x4 − y 4 = z 2 From x4 + y 4 = z 2 , we turn to a closely related Diophantine equation, x4 − y 4 = z 2 . Our
proof is very similar to that of the Strong Version of FLT for n = 4. The approach in this
section mostly follows Elementary Number Theory, Seventh Edition by David Burton. Proposition 1 (Squares From the Diﬀerence of Quartics (SFDQ))
The Diophantine equation x4 − y 4 = z 2 has no nontrivial solution. Proof: Suppose that there exists a nontrivial solution to x4 − y 4 = z 2 . Of all such solutions
x0 , y0 , z0 , choose any one in which x0 is smallest. Choosing x0 as small as possible forces
x0 to be odd. (Why?)
We now show that we can also assume that gcd(x0 , y0 ) = 1. Suppose gcd(x0 , y0 ) = d > 1.
4
Then writing dx1 = x0 and dy1 = y0 and substituting into x4 − y 4 = z 2 we get d4 (x4 − y1 ) =
1
2
2
z0 . So d4  z0 , hence d2  z0 . Thus z0 = d2 z1 for some integer z1 . But then
4
2
d4 x4 − d4 y1 = d4 z1
1 so x1 , y1 , z1 is a nontrivial solution to x4 − y 4 = z 2 with 0 < x1 < x0 contradicting our
choice of a minimal x0 .
4
2
If the equation x4 − y0 = z0 is written in the form
0 x2
0 2 2
− y0 then
2
2
z0 + y0 2 2 2
= z0 = x2
0 181 2 182 Chapter 27 Problems Related to FLT 2
and we see that z0 , y0 , x2 constitute a primitive Pythagorean triple.
0 From here there are two cases: y0 odd and y0 even. Consider the case where y0 is odd. The
Characterization of Pythagorean Triples asserts that there exist integers s and t so that
s > t > 0 and gcd(s, t) = 1 and s ≡ t (mod 2) satisfying
z0 = 2st (this is forced from y0 odd) 2
y0 = s2 − t2 x2 = s2 + t2
0
Observe that
2
s4 − t4 = (s2 + t2 )(s2 − t2 ) = x2 y0 = (x0 y0 )2
0 so s, t, x0 y0 is a positive solution to x4 − y 4 = z 2 . But
0<s< s2 + t2 = x0 which contradicts the minimality of x0 so y0 cannot be odd.
Now consider the case where y0 is even. The Characterization of Pythagorean Triples asserts
that there exist integers s and t so that s > t > 0 and gcd(s, t) = 1 and s ≡ t (mod 2)
satisfying
2
y0 = 2st
2 (this is forced from y0 even)
2 z0 = s − t x2 = s2 + t2
0
Because of the symmetry of expressions for s and t, we may assume that s is even and t is
odd. Consider the relation
2
y0 = 2st
Since gcd(s, t) = 1 and s is even, we know that gcd(2s, t) = 1. This allows us to invoke the
proposition on Decomposing nth Powers. That is, 2s and t are each squares of positive
integers, say 2s = w2 and t = v 2 . Because w must be even, set w = 2u to get s = 2u2 .
Therefore
x2 = s2 + t2 = 4u4 + v 4
0
and so 2u2 , v 2 , x0 form a Pythagorean triple. Since gcd(2u2 , v 2 ) = gcd(s, t) = 1, gcd(2u2 , v 2 , x0 ) =
1 and so the Pythagorean triple is primitive. The Characterization of Pythagorean Triples
asserts that there exist integers a and b so that a > b > 0 and gcd(a, b) = 1 and a ≡ b
(mod 2) satisfying
2u2 = 2ab
v 2 = a2 − b2
x0 = a2 + b2
Now 2u2 = 2ab implies u2 = ab which implies, by the proposition on Decomposing nth
Powers, that a and b are perfect squares. Say a = c2 and b = d2 . And here we use a pattern
we have seen before. Since
v 2 = a2 − b2 = c4 − d4
c, d, v is a positive integer solution to x4 − y 4 = z 2 . But
√
0 < c = a < a2 + b2 = x0 Section 27.2 x4 − y 4 = z 2 183 contradicting the minimality of x0 so y0 cannot be even.
Since the integer y0 cannot be either odd r even, it must be the case that our assumption
that there is a nontrivial solution is incorrect.
This proposition has an unexpected use in a statement about the areas of Pythagorean
triangles. Deﬁnition 27.2.1 A Pythagorean triangle is a right triangle whose sides are of integral length. Pythagorean
Triangle In the margin of his copy of Diophantus’ Arithmetica, Fermat stated and proved a proposition equivalent to the following. Proposition 2 The area of a Pythagorean triangle can never be equal to a perfect square. Here, perfect square means the square of an integer.
Proof: We will proceed by contradiction. Consider a Pythagorean triangle ABC where
the hypotenuse has length z and the other two sides have lengths x and y , so that
x2 + y 2 = z 2
The area of
gives (27.1) ABC is (1/2)xy and if this were a square we could write (1/2)xy = u2 . This
2xy = 4u2 (27.2) Now Equation (27.1) plus Equation (27.2) gives
x2 + y 2 + 2xy = z 2 + 4u2 ⇒ (x + y )2 = z 2 + 4u2
and Equation (27.1) minus Equation (27.2) gives
x2 + y 2 − 2xy = z 2 − 4u2 ⇒ (x − y )2 = z 2 − 4u2
Now multiply these last two equations together to get
(x + y )2 (x − y )2 = (z 2 + 4u2 )(z 2 − 4u2 ) ⇒ x2 − y 2
or
x2 − y 2 2 2 = z 4 − 16u4 = z 4 − (2u)4 But we know by our proposition on the Squares From the Diﬀerence of Quartics that no
nontrivial solution to this equation is possible, hence a contradiction. Chapter 28 Practice, Practice, Practice: Prime
Numbers
28.1 Objectives This class provides an opportunity to practice working with primes. 28.2 Exercises 184 Chapter 29 Complex Numbers
29.1 Objectives The content objectives are :
1. N ⊂ Z ⊂ Q ⊂ R ⊂ C
2. Deﬁne: complex number, C, real part, imaginary part
3. Operations: complex addition, complex multiplication, equality of complex numbers
4. State and prove properties of complex numbers. 29.2 Diﬀerent Equations Require Diﬀerent Number Systems When humans ﬁrst counted, we tallied. We literally made notches on sticks, stones and
bones. Thus the natural numbers, N, were born. But it wouldn’t be long before the
necessity of fractions became obvious. One animal to be shared by four people (we will
assume uniformly) meant that we had to develop the notion of 1/4. Though it would not
have been expressed this way, the equation
4x = 1
does not have a solution in N and so we would have had to extend our notion of numbers
to include fractions, the rationals.
Q= a
 a, b ∈ Z, b = 0
b This is an overstatement historically, because recognition of zero and negative numbers
which are permitted in Q were very slow to come. But even these new numbers would not
help solve equations of the form
x2 = 2
which would arise naturally from isosceles right angled triangles. For this, the notion
of number had to be extended to include irrational numbers, which combined with the
rationals, give us the real numbers. 185 186 Chapter 29 Complex Numbers Eventually, via Hindu and Islamic scholars, western mathematics began to recognize and
accept both zero and negative numbers. Otherwise, equations like
3x = 5x
or
2x + 4 = 0
have no solution. Thus, mathematicians recognized that
N⊂Z⊂Q⊂R
but even R was inadequate because equations of the form
x2 + 1 = 0
had no real solutions.
And so, our number system was extended again. 29.3
Deﬁnition 29.3.1
Complex Number Complex Numbers A complex number z in standard form is an expression of the form x + yi where x, y ∈ R.
The set of all complex numbers is denoted by
C = {x + yi  x, y ∈ R} Example 1 Some examples are 3 + 4i, 0 + 5i (usually written 5i), 7 − 0i (usually written 7) and 0 + 0i
(usually written 0). Deﬁnition 29.3.2 For a complex number z = x + yi, the real number x is called the real part and is written
(z ) and the real number y is called the imaginary part and is written (z ). Real Part,
Imaginary Part So (3 + 4i) = 3 and (3 + 4i) = 4. If z is a complex number where (z ) = 0, we will treat
z as a real number and we will not write the term containing i. For example, z = 3 + 0i
will be treated as a real number and will be written z = 3. Thus
R⊂C
and so
N⊂Z⊂Q⊂R⊂C
One has to wonder how much further the number system needs to be extended! Deﬁnition 29.3.3
Equality The complex numbers z = x + yi and w = u + vi are equal if and only if x = u and y = v . Section 29.3 Complex Numbers Deﬁnition 29.3.4 187 Addition is deﬁned as Addition (a + bi) + (c + di) = (a + c) + (b + d)i Example 2
(1 + 7i) + (2 − 3i) = (1 + 2) + (7 − 3)i = 3 + 4i Deﬁnition 29.3.5 Multiplication is deﬁned as Multiplication (a + bi) · (c + di) = (ac − bd) + (ad + cb)i Example 3
(1 + 7i) · (2 − 3i) = (1 · 2 − 7 · (−3)) + (1 · (−3) + 7 · 2)i = 23 + 11i
The multiplication symbol is usually omitted and we write zw or (a + bi)(c + di). Exercise 1 Let u = 3 + i and v = 2 − 7i. Compute
1. u + v
2. u − v
3. uv
4. u2 v
5. u3
6. Exercise 2 v
u (write the solution in the form x + yi where x, y ∈ R) Compute
1. i4k for any nonnegative integer k
2. i4k+1 for any nonnegative integer k
3. i4k+2 for any nonnegative integer k
4. i4k+3 for any nonnegative integer k The usual properties of associativity, commutativity, identities, inverses and distributivity
that we associate with rational and real numbers also apply to complex numbers. 188 Proposition 1 Chapter 29 Complex Numbers Let u, v, z ∈ C. Then
1. Associativity of addition: (u + v ) + z = u + (v + z )
2. Commutativity of addition: u + v = v + u
3. Additive identity: 0 = 0 + 0i has the property that z + 0 = z
4. Additive inverses: If z = x + yi then there exists an additive inverse of z , written −z
with the property that z +(−z ) = 0. The additive inverse of z = x + yi is −z = −x − yi.
5. Associativity of multiplication: (u · v ) · z = u · (v · z )
6. Commutativity of multiplication: u · v = v · u
7. Multiplicative identity: 1 = 1 + 0i has the property that z · 1 = z whenever z = 0.
8. Multiplicative inverses: If z = x + yi = 0 then there exists a multiplicative inverse
of z , written z −1 , with the property that z · z −1 = 1. The multiplicative inverse of
z = x + yi is z −1 = xx−yi2 .
2 +y
9. Distributivity: z · (u + v ) = z · u + z · v We will only prove the eighth property.
Proof: We only need to demonstrate that z −1 = xx−yi2 is welldeﬁned and that z · z −1 = 1.
2 +y
2 + y 2 = 0 and so z −1 is welldeﬁned. Now we simply use complex arithmetic.
Since z = 0, x
x + yi · x − yi
x2 + xy − xy − y 2 i2
x2 + y 2
=
=2
=1
x2 + y 2
x2 + y 2
x + y2 Chapter 30 Properties Of Complex Numbers
30.1 Objectives The content objectives are:
1. Deﬁne conjugate and modulus
2. State and prove several properties of complex numbers. 30.2
Deﬁnition 30.2.1 Conjugate The complex conjugate of z = x + yi is the complex number Conjugate z = x − yi
The conjugate of z = 2 + 3i is z = 2 − 3i. Proposition 1 (Properties of Conjugates (PCJ))
If z and w are complex numbers, then
1. z + w = z + w
2. zw = z w
3. z = z
4. z + z = 2 (z )
5. z − z = 2i (z ) Exercise 1 Prove each part of the Properties of Conjugates proposition.
(Hint: begin with “Let z = x + yi and w = u + vi.”) 189 190 Chapter 30 Properties Of Complex Numbers Exercise 2 Prove: Let z ∈ C. The complex number z is a real number if and only if z = z . Exercise 3 Prove: Let z ∈ C and z = 0. The complex number z is purely imaginary ( (z ) = 0) if and
only if z = −z . Example 1 For z = i deﬁne
z+i
z−i
Prove that w is a real number if and only if z is zero or purely imaginary.
w= Solution:
W is real ⇐⇒ w = w
z+i
z−i
⇐⇒
=
z−i
z+i
⇐⇒ z z − 1 + (z + z )i = z z − 1 − (z + z )i
⇐⇒ z + z = 0
⇐⇒ (z ) = 0 ⇐⇒ z is zero or purely imaginary 30.3
Deﬁnition 30.3.1 Modulus The modulus of the complex number z = x + yi is the nonnegative real number Modulus Example 2 z  = x + yi = The modulus of z = 2 − 5i is z  = x2 + y 2 (22 ) + (−5)2 = √ 29. Given two real numbers, say x1 and x2 , we can write either x1 ≤ x2 or x2 ≤ x1 . However,
given two complex numbers, z1 and z2 , we cannot meaningfully write z1 ≤ z2 or z2 ≤ z1 .
But since the modulus of a complex number is a real number, we can meaningfully write
z1  ≤ z2 . The modulus gives us a means to compare the magnitude of two complex
numbers, but not compare the numbers themselves.
If Proposition 2 (z ) = 0, then the modulus corresponds to the absolute values of real numbers. (Properties of Modulus (PM))
If z and w are complex numbers, then
1. z  = 0 if and only if z = 0 Section 30.3 Modulus 191 2. z  = z 
3. zz = z 2
4. zw = z w
5. z + w ≤ z  + w. This is the triangle inequality. Exercise 4 Prove each of the parts of the Properties of Modulus proposition. Chapter 31 Graphical Representations of
Complex Numbers
31.1 Objectives The content objectives are:
1. Deﬁne complex plane, polar coordinates, polar form.
2. Convert between Cartesian and polar form.
3. Multiplication in polar form. 31.2
31.2.1
Deﬁnition 31.2.1
Complex Plane The Complex Plane
(x, y ) The notation z = x + yi suggests a nonalgebraic representation. Each complex number
z = x + yi can be thought of as a point (x, y ) in a plane with orthogonal axes. Label one
axis the real axis and the other axis the imaginary axis. The complex number z = x + yi
then corresponds to the point (x, y ) in the plane. This interpretation of the plane is called
the complex plane or the Argand plane. 192 Section 31.4 Polar Representation 193 Figure 31.2.1: The Complex Plane Exercise 1 Plot the following points in the complex plane.
1. 4 + i
2. −2 + 3i
3. −2 − i 31.2.2 Modulus Recall that the modulus of the complex number z = x + yi is the nonnegative real number
z  = x + yi = x2 + y 2 There are a couple of geometric points to note about the modulus of z = x + yi. The
Pythagorean Theorem is enough to prove that z  is the distance from the origin to z in
the complex plane, and that the distance between z and w = u + vi is just z − w =
(x − u)2 + (y − v )2 . Exercise 2 Sketch all of the points in the complex plane with modulus 1. 31.3 Polar Representation There is another way to represent points in a plane which is very useful when working with
complex numbers. Instead of beginning with the origin and two orthogonal axes, we begin
with the origin O and a polar axis which is a ray leaving from the origin. The point P (r, θ)
is plotted so that the distance OP is r, and the counter clockwise angle of rotation from
the polar axis, measured in radians, is θ.
Note that this allows for multiple representations since (r, θ) identiﬁes the same point as
(r, θ + 2πk ) for any integer k .
The obvious question is how to go from one to the other. 194 Chapter 31 Graphical Representations of Complex Numbers Figure 31.3.1: Polar Representation 31.4 Converting Between Representations Simple trigonometry allows us to convert between polar and Cartesian coordinates. Figure 31.4.1: Connecting Polar and Cartesian Representations Given the polar coordinates (r, θ), the corresponding Cartesian coordinates (x, y ) are
x = r cos θ
y = r sin θ
Given the Cartesian coordinates (x, y ), the corresponding polar coordinates are determined
by
r= x2 + y 2 x
r
y
sin θ =
r cos θ = Exercise 3 For each of the following polar coordinates, plot the point and convert to Cartesian coordinates.
1. (1, 0) Section 31.4 Converting Between Representations 195 2. (2, π/2)
3. (3, π )
4. (2, 7π/2)
5. (4, π/4)
6. (4, 4π/3) Exercise 4 For each of the following Cartesian coordinates, plot the point and convert to polar coordinates.
1. (1, 0)
2. (0, 1)
3. (−1, 0)
4. (0, −1)
5. (1, 1)
6. (−1, 1)
√
7. (2, −2 3) From our earlier description of conversions, we can write the complex number
z = x + yi
as
z = r cos θ + ri sin θ = r(cos θ + i sin θ) Deﬁnition 31.4.1 The polar form of a complex number z is Polar Form z = r(cos θ + i sin θ)
where r is the modulus of z and the angle θ is called an argument of z . The expression
cos θ + i sin θ is frequently abbreviated to cis θ and so we write z = rcis θ. Example 1 The following are representations of complex numbers in both Cartesian and polar form.
1. 1 = cis 0
√
2. −1 + i = 2cis 3π/4
√
3. −1 − 3i = 2cis 4π/3 196 Chapter 31 Graphical Representations of Complex Numbers One of the advantages of polar representation is that multiplication becomes very straightforward. Proposition 1 (Polar Multiplication of Complex Numbers (PMCN))
If z1 = r1 (cos θ1 + i sin θ1 ) and z2 = r2 (cos θ2 + i sin θ2 ) are two complex numbers in polar
form, then
z1 z2 = r1 r2 (cos(θ1 + θ2 ) + i sin(θ1 + θ2 )) Example 2
√
√
( 2cis 3π/4) · (2cis 4π/3) = 2 2cis 3π 4π
+
4
3 √
= 2 2cis 25π
12 √
= 2 2cis Proof:
z1 z2 = r1 (cos θ1 + i sin θ1 ) · r2 (cos θ2 + i sin θ2 )
= r1 r2 ((cos θ1 cos θ2 − sin θ1 sin θ2 ) + i(cos θ1 sin θ2 + sin θ1 cos θ2 ))
= r1 r2 (cos(θ1 + θ2 ) + i sin(θ1 + θ2 )) π
12 Chapter 32 De Moivre’s Theorem
32.1 Objectives The content objectives are:
1. State and prove De Moivre’s Theorem and do examples.
2. Derive Euler’s Formula. 32.2
Theorem 1 De Movre’s Theorem (De Movre’s Theorem (DMT))
If θ ∈ R and n ∈ Z, then
(cos θ + i sin θ)n = (cos nθ + i sin nθ) Example 1 √
√
Consider the complex number z = 1/ 2 + i/ 2 which, in polar form is z = cos π/4 +
i sin π/4. By De Moivre’s Theorem,
z 10 = (cos π/4 + i sin π/4)10 = cos 10π/4 + i sin 10π/4 = cos π/2 + i sin π/2 = i. Proof: We will prove DeMoivre’s Theorem using three cases.
1. n = 0
2. n > 0
3. n < 0 197 198 Chapter 32 De Moivre’s Theorem For the case n = 0, DeMoivre’s Theorem reduces to (cos θ + i sin θ)0 = (cos 0 + i sin 0). By
convention z 0 = 1 so the left hand side of the equation is 1. Since cos 0 = 1 and sin 0 = 0,
the right hand side also evaluates to 1.
For the case n > 0 we will use induction.
P (n): (cos θ + i sin θ)n = (cos nθ + i sin nθ).
Base Case We verify that P (1) is true where P (1) is the statement
P (1): (cos θ + i sin θ)n = (cos 1θ + i sin 1θ).
This is trivially true.
Inductive Hypothesis We assume that the statement P (k ) is true for some k ≥ 1.
P (k ): (cos θ + i sin θ)k = (cos kθ + i sin kθ).
Inductive Conclusion Now show that the statement P (k + 1) is true.
P (k + 1): (cos θ + i sin θ)k+1 = (cos(k + 1)θ + i sin(k + 1)θ)
(cos θ + i sin θ)k+1 = (cos θ + i sin θ)k (cos θ + i sin θ) by separating out one factor
= (cos kθ + i sin kθ)(cos θ + i sin θ) by the Inductive Hypothesis
= (cos(k + 1)θ + i sin(k + 1)θ) Polar Multiplication of Complex Numbers
Lastly, for the case n < 0 we will use complex arithmetic. Since n < 0, n = −m for some
m ∈ P.
(cos θ + i sin θ)n = (cos θ + i sin θ)−m
1
=
(cos θ + i sin θ)m
1
=
(cos mθ + i sin mθ)
= cos mθ − i sin mθ
= cos(−mθ) + i(sin(−mθ))
= cos nθ + i sin nθ Corollary 2 If z = r(cos θ + i sin θ) and n is an integer,
z n = rn (cos nθ + i sin nθ) Section 32.3 Complex Exponentials 32.3 199 Complex Exponentials If you were asked to ﬁnd a realvalued function y with the property that
dy
= ky and y = 1 when x = 0
dx
for some constant k , you would choose
y = ekx
And if you were asked to ﬁnd the derivative of f (θ) = cos θ + i sin θ where i was treated as
any other constant you would almost certainly write
df (θ)
= − sin θ + i cos θ
dθ
but then and so Deﬁnition 32.3.1 df (θ)
= − sin θ + i cos θ = i(cos θ + i sin θ) = if (θ)
dθ
df (θ)
= if (θ) and f (θ) = 1 when θ = 0
dθ By analogy, we deﬁne the complex exponential function by Complex
Exponential eiθ = cos θ + i sin θ As an exercise, prove the following. Proposition 3 (Properties of Complex Exponentials (PCE)) eiθ · eiφ = ei(θ+φ)
eiθ n = einθ The polar form of a complex number z can now be written as
z = reiθ
where r = z  and θ is an argument of z .
Out of this arises one of the most stunning formulas in mathematics. Setting r = 1 and
θ = π we get
eiπ = cos π + i sin π = −1 + 0i = −1
That is
eiπ + 1 = 0
Who would have believed that e, i, π, 1 and 0 would have such a wonderful connection! Chapter 33 Roots of Complex Numbers
33.1 Objectives The content objectives are:
1. State and prove the Complex nthe Roots Theorem and do examples. 33.2
Deﬁnition 33.2.1 Complex nth Roots If a is a complex number, then the complex numbers that solve Complex Roots zn = a
are called the complex nth roots. De Moivre’s Theorem gives us a straightforward way
to ﬁnd complex nth roots of a. Theorem 1 (Complex nth Roots Theorem (CNRT))
If r(cos θ + i sin θ) is the polar form of a complex number a, then the solutions to z n = a
are
√
θ + 2kπ
θ + 2kπ
n
r cos
+ i sin
for k = 0, 1, 2, . . . , n − 1
n
n √
The modulus n r is the unique nonnegative nth root of r. This theorem shows that any
complex number, including the reals, has exactly n diﬀerent complex nth roots. Example 1 Find all the complex fourth roots of −16. Solution: We will use the Complex nth Roots Theorem. First, we write −16 in polar
form as
−16 = 16(cos π + i sin π )
200 Section 33.2 Complex nth Roots 201 Using the Complex nth Roots Theorem the solutions are
√
4 16 cos = 2 cos π + 2kπ
π + 2kπ
+ i sin
4
4
π kπ
π kπ
+ i sin
+
+
4
2
4
2 for k = 0, 1, 2, 3
for k = 0, 1, 2, 3 The four distinct roots are given below
π
π
+ i sin
4
4
3π
+ i sin
When k = 1, z1 = 2 cos
4
5π
+ i sin
When k = 2, z2 = 2 cos
4
7π
+ i sin
When k = 3, z3 = 2 cos
4 When k = 0, z0 = 2 cos =2
3π
4
5π
4
7π
4 i
1
√ +√
2
2
−1
=2 √ +
2
−1
=2 √ +
2
1
=2 √ +
2 =
i
√
2
−i
√
2
−i
√
2 √ √
2+i 2 √
√
=− 2+i 2
√
√
=− 2−i 2
= √ √
2−i 2 Graphing these solutions is illuminating. Figure 33.2.1: The Fourth Roots of 16 Note that the solutions are uniformly distributed around a circle whose radius is √
n r. Proof: As usual, when showing that a complete solution exists we work with two sets: the
set S of solutions and the set T of speciﬁc representation of the solution. We then show
that S = T by mutual inclusion. Our two sets are
S = {z ∈ C  z n = a} 202 Chapter 33
and
T= √
n r θ + 2kπ
n cos θ + 2kπ
n + i sin Roots of Complex Numbers k = 0, 1, 2, . . . , n − 1 where a = r(cos θ + i sin θ).
We begin by showing that T ⊆ S . Let t = √
n r cos θ + 2kπ
n θ + 2kπ n
n
= r(cos(θ + 2kπ ) + i sin(θ + 2kπ ))
√
n
r tn = n be an element of T . Now cos = r(cos θ + i sin θ) De Moivre’s Theorem trigonometry =a
Hence, t is a solution of z n = a, that is, t ∈ S .
Now we show that S ⊆ T . Let w = s(cos φ + i sin φ) be an nth root of a. Since a =
r(cos θ + i sin θ) we have
wn = a
⇐⇒ (s(cos φ + i sin φ))n = r(cos θ + i sin θ)
⇐⇒ sn (cos nφ + i sin nφ) = r(cos θ + i sin θ) De Moivre’s Theorem Now two complex numbers in polar form are equal if and only if their moduli are equal and
their arguments diﬀer by an integer multiple of 2π . So
√
sn = r ⇒ s = n r
and θ + 2πk
n
where k ∈ Z. Hence, the nth roots of a are of the form
nφ − θ = 2πk ⇒ φ = √
n r cos θ + 2kπ
n + i sin θ + 2kπ
n for k ∈ Z But this is k ∈ Z, not k = 0, 1, 2, . . . , n − 1. Since w is an nth root of a, there exists an
integer k0 so that
w= √
n r cos θ + 2 k0 π
n + i sin θ + 2k0 π
n w= √
n r cos θ + 2 k1 π
n + i sin θ + 2k1 π
n If we can show that if and only if k0 ≡ k1 (mod n) whenever r = 0, then w ∈ T . Now
k0 ≡ k1
⇐⇒ k0 − k1 = n
⇐⇒ 2πk0 − 2πk1 = 2πn
2πk0 2πk1
⇐⇒
−
= 2π
n
n
θ + 2πk0 θ + 2πk1
⇐⇒
−
= 2π
n
n (mod n)
for some ∈Z for some ∈Z for some ∈Z for some ∈Z Section 33.3 More Examples 33.3 203 More Examples Exercise 1 An nth root of unity is a complex number that solves z n = 1. Find all of the sixth roots
of unity. Express them in standard form and graph them in the complex plane. Exercise 2 Find the square roots of −2i. Express them in standard form and graph them in the complex
plane. Chapter 34 An Introduction to Polynomials
34.1 Objectives The content objectives are:
1. Deﬁne polynomial, coeﬃcient, F[x], degree, zero polynomial, linear polynomial, quadratic
polynomial, cubic polynomial, equal, sum, diﬀerence, product, quotient, remainder, divides and factor.
2. Deﬁne operations on polynomials.
3. State the Division Algorithm for Polynmials.
4. Do examples. 34.2 Polynomials Our number systems were developed in response to the need to ﬁnd solutions to real polynomials. We are now able to solve all equations of the form
a2 x2 + a1 x + a0 = 0
or
xn − a0 = 0
whether the coeﬃcients are real or complex. In fact, a great deal more is known.
Let F be a ﬁeld. Roughly speaking, a ﬁeld is a set of numbers that allows addition, subtraction, multiplication and division. The rational numbers Q, the real numbers R, the complex
numbers C and the integers modulo a prime p, Zp are all ﬁelds. The integers are not a ﬁeld
because we cannot divide 2 by 4 and get an integer. Since division is just multiplication by
an inverse, Z6 is not a ﬁeld since [3] has no inverse. 204 Section 34.3 Operations on Polynomials Deﬁnition 34.2.1 205 A polynomial in x over F is an expression of the form Polynomial an xn an−1 xn−1 + · · · + a1 x + a0
where all of the ai belong to F.
The ai are called coeﬃcients. We use F[x] to denote the set of polynomials in x with
coeﬃcients from F. Example 1
1. x2 + 7x − 1 ∈ R[x]
2. x3 − 7ix + (5 − 2i) ∈ C[x]
3. [3]x5 + [2]x3 + [6] ∈ Z7 [x]
It is important to be clear about what ﬁeld the coeﬃcients come from. The polynomial
x2 + 1 belongs to both R[x] and C[x] but the equation x2 + 1 = 0 has complex solutions
but no real solutions. Deﬁnition 34.2.2 If an = 0 in the polynomial Degree et al an xn an−1 xn−1 + · · · + a1 x + a0
then the polynomial is said to have degree n. The zero polynomial has all of its coeﬃcients
zero and its degree is not deﬁned. Polynomials of degree 1 are called linear polynomials,
of degree 2, quadratic polynomials, and of degree 3 cubic polynomials. 34.3 Operations on Polynomials We very frequently use f (x) to denote an element of F[x] and write
n f (x) = an xn an−1 xn−1 + · · · + a1 x + a0 = ai xi
i=0 Let f (x), g (x) ∈ F[x] where
n
n n−1 f (x) = an x an−1 x ai xi + · · · + a1 x + a0 =
i=0
n g (x) = bn xn bn−1 xn−1 + · · · + b1 x + b0 = bi xi
i=0 Deﬁnition 34.3.1
Equal The polynomials f (x) and g (x) are equal if and only if ai = bi for all i. 206 Chapter 34 An Introduction to Polynomials Polynomials can be added, subtracted and multiplied as algebraic expressions exactly as
you have done in high school. Deﬁnition 34.3.2 The sum of the polynomials f (x) and g (x) is deﬁned as Sum max(n,m) (ai + bi )xi f (x) + g (x) =
i=0 where any “missing” terms have coeﬃcient zero. Example 2
1. In R[x], if f (x) = x2 + 7x − 1 and g (x) = 3x4 − x3 + 4x2 − x + 5 then
f (x) + g (x) = 3x4 − x3 + 5x2 + 6x + 4.
2. In C[x], if f (x) = x3 − 7ix + (5 − 2i) and g (x) = (4 + 3i)x + (7 + 7i)x then
f (x) + g (x) = x3 + (4 − 4i)x + (12 + 5i)x.
3. In Z7 [x], if f (x) = [3]x5 + [2]x3 + [6] and g (x) = [2]x4 + [5]x3 + [2]x2 + [4] then
f (x) + g (x) = [3]x5 + [2]x4 + [2]x2 + [3]. Deﬁnition 34.3.3 The diﬀerence of the polynomials f (x) and g (x) is deﬁned as Diﬀerence max(n,m) (ai − bi )xi f (x) − g (x) =
i=0 where any “missing” terms have coeﬃcient zero. Exercise 1 Find the diﬀerence of each of the pairs of polynomials given in Example 2. The deﬁnition of the product of two polynomials looks more complicated than it is. Deﬁnition 34.3.4 The product of the polynomials f (x) and g (x) is deﬁned as Product m+n ci xi f (x) · g (x) =
i=0 where i ci = a0 bi + a1 bi−1 + · · · + ai−1 b1 + ai b0 = aj bi−j
j =0 Section 34.3 Operations on Polynomials Example 3 207 In R[x], if f (x) = x2 + 7x − 1 and g (x) = 3x + 2 then
f (x) · g (x) = Add long multiplication example here.
Now we run into the same issue we had with the integers, division. Though it makes sense
to say that x − 3 divides x2 − 9 since x2 − 9 = (x − 3)(x + 3) what do we do when there is a
remainder? Just as we had a division algorithm for integers, we have a division algorithm
for polynomials. Proposition 1 (Division Algorithm for Polynomials (DAP))
If f (x) and g (x) are polynomials in F[x] and g (x) is not the zero polynomial, then there
exist unique polynomials q (x) and r(x) in F[x] such that
f (x) = q (x)g (x) + r(x) Deﬁnition 34.3.5
Quotient,
Remainder where deg r(x) < deg g (x) or r(x) = 0 The polynomial q (x) is called the quotient polynomial. The polynomial r(x) is called the
remainder polynomial. If r(x) = 0, we say that g (x) divides f (x) or f (x) is a factor
of f (x) and we write g (x)  f (x). Add long division examples over several ﬁelds here. Exercise 2 For each f (x) and g (x), ﬁnd the quotient and remainder polynomials.
1. Let f (x) and g (x) be the real polynomials f (x) = 2x4 + 6x3 − x + 4 and g (x) = x2 + 3.
2. Let f (z ) and g (z ) be the complex polynomials
f (z ) = iz 3 + (2 + 4i)z 2 + (3 − i)z + (4 − 8i) and g (z ) = iz + (2 − 2i). Chapter 35 Factoring Polynomials
35.1 Objectives The content objectives are:
1. Deﬁne polynomial equation, solution and root.
2. State the Fundamental Theorem of Algebra 35.2
Deﬁnition 35.2.1
Polynomial Equation Polynomial Equations A polynomial equation is an equation of the form
an xn an−1 xn−1 + · · · + a1 x + a0 = 0
which will often be written as f (x) = 0. An element c ∈ F is called a root or zero of the
polynomial f (x) if f (c) = 0. That is, c is a solution of the polynomial equation f (x) = 0. The history of mathematics is replete with exciting and sometimes bizarre stories of mathematicians as they looked, in vain, for an algorithm that would ﬁnd a root of an arbitrary
polynomial. We can now prove that no such algorithm exists. It is known though, that a
root exists for every complex polynomial. This was proved in 1799 by the brilliant mathematician Karl Friedrich Gauss. Theorem 1 (Fundamental Theorem of Algebra (FTA))
For all complex polynomials f (z ) with deg(f (z )) ≥ 1, there exists a z0 ∈ C so that f (z0 ) = 0. Ironically, we can prove a root exists, we just can’t construct one in general. The proof of
this theorem is demanding and is left for later courses.
We can use the Division Algorithm for Polynomials to help though. Recall 208 Section 35.2 Polynomial Equations Proposition 2 209 (Division Algorithm for Polynomials (DAP))
If f (x) and g (x) are polynomials in F[x] and g (x) is not the zero polynomial, then there
exist unique polynomials q (x) and r(x) in F[x] such that
f (x) = q (x)g (x) + r(x) Proposition 3 where deg r(x) < deg g (x) or r(x) = 0 (Remainder Theorem (RT))
The remainder when the polynomial f (x) is divided by (x − c) is f (c). Example 1 Find the remainder when f (z ) = 3z 12 − 8iz 5 + (4 + i)z 2 + z + 2 − 3i is divided by z + i.
Solution: One could do the painful thing and carry out long division. Another possibility
is to use the Remainder Theorem and compute f (−i).
f (−i) = 3(−i)12 − 8i(−i)5 + (4 + i)(−i)2 + (−i) + 2 − 3i
= 3 − 8i(−i) + (4 + i)(−1) − i + 2 − 3i
= 3 − 8 − 4 − i − i + 2 − 3i
= −7 − 5i
The remainder is −7 − 5i. Proof: By the Division Algorithm for Polynomials, there exist unique polynomials q (x)
and r(x) such that
f (x) = q (x)(x − c) + r(x) where deg r(x) < 1 or r(x) = 0 Therefore, the remainder r(x) is a constant (which could be zero) which we will write as
r0 . Hence
f (x) = q (x)(x − c) + r0
Substituting x = c into this equation gives f (c) = r0 . Corollary 4 (Factor Theorem 1 (FT1))
The linear polynomial (x − c) is a factor of the polynomial f (x) if and only if f (c) = 0. Equivalently, Corollary 5 (Factor Theorem 2 (FT2))
The linear polynomial (x − c) is a factor of the polynomial f (x) if and only if c is a root of
the polynomial f (x). 210 Chapter 35 Factoring Polynomials How do we go about actually factoring polynomials? In general, this is hard to do. There
are no formulas for roots if the polynomial has degree ﬁve or more. But if the polynomial
has integer coeﬃcients, we have a good starting point. Theorem 6 (Rational Roots Theorem (RRT))
Let f (x) = an xn + an−1 xn−1 + · · · + a2 x2 + a1 x + a0 be a polynomial with integer coeﬃcients.
If p is a rational root with gcd(p, q ) = 1, then p  a0 and q  an .
q In order to ﬁnd a rational root of f (x), we only need to examine a ﬁnite set of rational
numbers, those whose numerator divides the constant term and those whose denominators
divide the leading coeﬃcient. Note that the theorem only suggests those rational numbers
that might be roots. It does not guarantee that any of these numbers are roots. Example 2 If possible, ﬁnd a rational root of f (x) = 2x4 + x3 + 6x + 3. Solution: We will use the Rational Roots Theorem. The divisors of 2 are ±1 and ±2. The
divisors of 3 are ±1 and ±3. Hence, the candidates for rational roots are
1
3
±1, ± , ±3, ±
2
2
Now test each of these candidates.
x
1 −1
f (x) 12 −2
Thus, the only root is
Proof: If 1
2
25
4 −1
2 0 3
−3
210 120 3
2
51
2 −3
2
3
4 −1
2. p
is a root of f (x) then
q
an p
q n + an−1 p
q n−1 + · · · + a2 p
q 2 + a1 p
q + a0 = 0 Multiplying by q n gives
an pn + an−1 pn−1 q + · · · + a2 p2 q n−2 + a1 pq n−1 + a0 q n = 0
and
an pn = −q an−1 pn−1 + · · · + a2 p2 q n−3 + a1 pq n−2 a0 q n−1
Since all of the symbols in this equation are integers, both the right hand side and left hand
side are integers. Since q divides the the right hand side, q divides the left hand side, that
is
q  an p n
Since gcd(p, q ) = 1 we can repeatedly use the proposition on Coprimeness and Divisibility
to show that q  an . In a similar way, we can show that p  a0 . Section 35.2 Polynomial Equations 211 Exercise 1 Is x + 1 a factor of x10 + 1, or x9 + 1. Can you make a statement about when x + 1 divides
or does not divide x2n + 1, or x2n+1 + 1 for n a positive integer? Exercise 2 If x + (2 + i) is a root of f (x) = x4 + 4x3 + 2x2 − 12x − 15, factor f (x) into products of real
polynomials and complex polynomials of lowest degree. Exercise 3 Prove that x = √
n p is irrational for any integer n > 1. Complex roots of real polynomials come in conjugate pairs. Chapter 36 The Shortest Path Problem
36.1 Objectives The technique objectives are:
1. Abstract from a map to a graph.
2. Formulate an algorithm.
3. Extend plausible uses. 36.2 The Problem Suppose you are living in downtown Toronto (the pink dot on the map) on a coop work
term and you want to escape the intense July heat by going to Sibbald Point Provincial
Park (the blue dot on the map) to swim in Lake Simcoe. See Figure 36.2.1.
You could take Highway 404 past the 401, past the 407 up to the end of Highway 404, and
then take a minor road to Highway 48 and go north from there. But perhaps it would be
better to take Lakeshore Drive to Highway 48 and go straight north.
Your task is to ﬁnd an algorithm, a strategy, to ﬁnd the shortest route between downtown
Toronto and Sibbald Point Provincial Park. 212 Section 36.2 The Problem 213 Figure 36.2.1: Sibbald Point Provincial Park 214 Chapter 36 36.3 The Shortest Path Problem Abstraction Let’s focus on what’s important in the problem. Looking at the map there is, for our
purpose, lots of information that is not important: colours, parking locations, where the
Green Belt is, towns not along the way. What is really important are locations where we
might change directions, routes between those locations, and distances. We’ll highlight
locations on the map as grey dots and connections between locations as solid teal lines. See
Figure 36.3.1. Figure 36.3.1: Locations and Connections Section 36.5 Algorithm 215 But since we don’t need the rest of the detail, let’s omit it and include only locations,
connections and distances. See Figure 36.3.2. 20
45 15 120
60
60 10
10
10 10 30
5 20
25 Figure 36.3.2: The Essentials 36.4 Algorithm With a partner, draw a random map and attempt to discover an algorithm that will ﬁnd
the shortest route from one location to another. [Note to instructor: solicit some algorithms
and have the class assess whether the algorithm might work.] 36.5 Extensions This problem is set as minimal distances between two points. But perhaps instead of
distance we could use time or cost. And instead of a person travelling we could have
couriers delivering packages, or electrical signals carrying phone calls. In fact, there are
surprising uses as well including managing cutting stock in steel mills and ﬁnding optimal
schedules for construction projects. Chapter 37 Paths, Walks, Cycles and Trees
37.1 Objectives The technique objectives are:
1. Practice with by contradiction.
2. Practice with unqueness.
The content objectives are:
1. Deﬁne graph, walk, path, cycle, and tree.
2. Construct diagrams corresponding to graphs.
3. Observe: Any walk can be decomposed into at most one path and a collection of cycles.
4. Prove: There is a unique path between every pair of vertices in a tree. 37.2
Deﬁnition 37.2.1
Graph The Basics A graph G is a pair (V, E ) where V is a ﬁnite, nonempty set, and E is a set of unordered
pairs of elements of V . The elements of V are called vertices and the elements of E called
edges. It is often very useful to represent a graph as a drawing where vertices correspond to points
and edges correspond to lines between vertices. Graphs may be represented by more than
one diagram as illustrated in Example 1. 216 Section 37.2 The Basics Example 1 217 Let G = (V, E ) where
V = {1, 2, 3, 4, 5, 6, 7}
and
E = {{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 1}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}} . 7
2 1 6 7 3
1 5 2 3 4 5 6 4 Figure 37.2.1: Two representations of the same graph Deﬁnition 37.2.2
Adjacent, Incident If edge e = {u, v }, then we say that u and v are adjacent vertices, and that edge e is
incident with vertices u and v . We can also say that the edge e joins u and v . Vertices
adjacent to a vertex u are called neighbours of u. A graph is completely speciﬁed by the pairs of vertices that are adjacent, and the only
function of a line in the diagram is to indicate that two vertices are adjacent. Deﬁnition 37.2.3
Walk A walk W is a nonempty sequence of edges
W = {{v0 , v1 }, {v1 , v2 }, {v2 , v3 }, . . . , {vn−1 , vn }} .
Since vi−1 and vi uniquely determine an edge e of a walk, we will usually just list the
vertices. Thus
W = v0 , v1 , v2 , v3 , . . . , vn−1 , vn . Deﬁnition 37.2.4
Path Deﬁnition 37.2.5
Cycle If v0 = s and vn = t in the walk W , we call W an stwalk. If no vertex in the walk is
repeated, that is, if v0 , v1 , v2 , . . . , vn are all distinct, then W is called a path. If v0 = vn and v0 , v1 , v2 , . . . , vn−1 are all distinct, then W is called a cycle. 218 Chapter 37 2 1 6 Paths, Walks, Cycles and Trees 7 5 3 4 Figure 37.2.2: The bold lines indicate the walk W = 1, 6, 7, 3, 4, 7, 3, 2. 2 1 6 7 5 3 4 Figure 37.2.3: The bold lines indicate the path P = 1, 6, 7, 3, 2 2 1 6 7 5 3 4 Figure 37.2.4: The bold lines indicate the cycle C = 7, 3, 4, 7 Note that the walk W = 1, 6, 7, 3, 4, 7, 3, 2 can be decomposed into the path P = 1, 6, 7, 3, 2
and the cycle C = 7, 3, 4, 7. In fact, we can always perform this kind of decomposition for
walks but before we state the appropriate theorem, we need to deﬁne a few more terms. Deﬁnition 37.2.6
Collection,
Decomposed By a collection we mean a family of objects where repetition is allowed. Let W be an
stwalk. If s = t, we say that W can be decomposed into a collection C of cycles if, for
every edge e the number of times e occurs in W is the same as the number of times e occurs
in cycles of C . If s = t, we say that W can be decomposed into an stpath P and a
collection C of cycles if, for every edge e the number of times e occurs in W is the same as Section 37.3 Trees 219 the number of times e occurs in P and the cycles of C . We will state, but not prove, the following proposition. Proposition 1 (Walk Decomposition (WD))
Let W be an stwalk.
1. If s = t, then W can be decomposed into a nonempty collection of cycles.
2. If s = t and a vertex is not repeated in W , then W is a path.
3. If s = t and a vertex is repeated in W , then W can be decomposed into a path and a
nonempty collection of cycles. You may wonder what the diﬀerence is between the deﬁnition of decomposition and the
proposition Walk Decomposition. The deﬁnition allows for the possibility that some walks
cannot be decomposed. The proposition states that all walks can be decomposed. Deﬁnition 37.2.7
Connected To say that a graph G is connected means that there is a path between any two vertices of
G. We will assume for this course that all of our graphs are connected, though in general,
that is not a safe assumption. 37.3 Trees A tree is a very special and incredibly useful kind of graph. Deﬁnition 37.3.1 A tree is a connected graph with no cycles. Tree 2 1 6 7 5 3 4 Figure 37.3.1: A tree We will prove several propositions about trees starting with this one. 220 Proposition 2 Chapter 37 Paths, Walks, Cycles and Trees (Unique Paths in Trees (UPT))
There is a unique path between every pair of vertices in a tree. We normally begin our proofs by explicitly identifying the hypothesis and the conclusion.
Unique Paths in Trees is not in “If A, then B .” form, so let’s ﬁrst restate it. Recall that
the hypothesis is what we get to start with, and the conclusion is what we must show. We
start with a tree. Call it T . We must show that there is a unique path between every pair
of vertices in T . Hence, we could restate Unique Paths in Trees as Proposition 3 (Unique Paths in Trees (UPT))
If T is a tree, then there is a unique path between every pair of vertices in T . Working forwards and backwards to prove this proposition will be problematic. So, it’s time
for a diﬀerent technique, proof by contradiction. Normally, when we wish to prove that the
statement “A implies B ” is true, we assume that A is true and show that B is true. What
would happen if B were true, but we assumed it was false and continued our reasoning
based on the assumption that B was false? Since a mathematical statement cannot be both
true and false, it seems likely we would eventually encounter a mathematically nonsensical
statement. Then we would ask ourselves “How did we arrive at this nonsense?” and the
answer would have to be that our assumption that B was false was wrong and B is, in fact,
true.
Proofs by contradiction have the following structure.
1. Assume that A is true.
2. Assume that B is false, or equivalently, assume that NOT B is true.
3. Reason forward from A and NOT B to reach a contradiction.
We will prove Unique Paths in Trees by contradiction.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Suppose that u and v are any two distinct vertices of T .
2. Since T is connected, there is at least one path connecting u to v .
3. Now suppose that there are two distinct uv paths, P1 = x0 , x1 , x2 , . . . , xn and P2 =
y0 , y1 , y2 , . . . , ym . Thus u = x0 = y0 and v = xn = ym .
4. We can construct a walk W beginning with u and ending at u that consists of “walking” from u to v in P1 , then from v to u “backwards” in P2 . More speciﬁcally,
W = x0 , x1 , x2 , . . . , xn , ym−1 , ym−2 , ym−3 , . . . , y0 .
5. By Part (1) of Proposition 1, W can be decomposed into a nonempty collection of
cycles. Section 37.3 Trees 221
6. But then the tree T contains cycles, contradicting the deﬁnition of a tree. Analysis of Proof We will begin by explicitly identifying the hypothesis and the conclusion.
Hypothesis: T is a tree.
Conclusion: There is a unique path between every pair of vertices in T .
Core Proof Technique: Contradiction.
Preliminary Material: Deﬁnition of tree.
Sentence 1 Suppose that u and v are any two distinct vertices of T .
The conclusion contains a universal quantiﬁer, every. Let’s ﬁrst identify the components of the universal quantiﬁer.
Objects:
Universe of discourse:
Certain property:
Something happens: Vertices u and v
Vertices of the tree T
None speciﬁed.
There is a unique path between u and v . Since we are using a universal quantiﬁer in the conclusion of the proposition, the
author uses Choose method.
Sentence 2 Since T is connected, there is at least one path connecting u to v .
Before the author can show that there is a unique path, the author must ﬁrst show
that a path exists.
Sentence 3 Now suppose that there are two distinct uv paths, P1 = x0 , x1 , x2 , . . . , xn and
P2 = y0 , y1 , y2 , . . . , ym . Thus u = x0 = y0 and v = xn = ym .
The author is negating the conclusion and so is going to use on of two techniques,
Contradiction or Contrapositive. Since the author hasn’t indicated which, it is useful
to look ahead in the proof to ﬁnd out. The last sentence of the proof makes it clear
that the author is using Contradiction.
Sentence 4 We can construct a walk W beginning with u and ending at u that consists of
“walking” from u to v in P1 , then from v to u “backwards” in P2 . More speciﬁcally,
W = x0 , x1 , x2 , . . . , xn , ym−1 , ym−2 , ym−3 , . . . , y0 .
Sentence 5 By Part (1) of Proposition 1, W can be decomposed into a nonempty collection of cycles.
The diﬃcult part in proofs by contradiction is ﬁnding a contradiction. In Sentence
4 the author constructs a walk and in Sentence 5 the author shows that the walk
contains cycles. But cycles don’t exist in trees and so
Sentence 6 But then the tree T contains cycles, contradicting the deﬁnition of a tree.
This is also an example of working with uniqueness. Chapter 38 Trees
38.1 Objectives The technique objectives are:
1. Induction.
The content objectives are:
1. Deﬁne degree.
2. Prove Two Vertices of Degree One.
3. Prove: Number of Vertices in a Tree. 38.2
Deﬁnition 38.2.1
Degree Proposition 1 Properties of Trees Let G be a graph. The number of edges incident with a vertex v is called the degree of v
and is denoted by deg(v ). In Figure 38.2.1, vertex a has degree 3 and vertex b has degree 2. (Two Vertices of Degree One (TVDO))
If T is a tree with at least two vertices, then T has at least two vertices of degree one. Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Find a longest path P = w0 w1 w2 . . . wn in T , say between nodes u = w0 and v = wn .
2. Since any edge in the tree constitutes a path, P must contain at least one edge so
u = v.
3. Thus, the vertex wn−1 in the path is adjacent to v but distinct from v .
222 Section 38.2 Properties of Trees 223 i s h
g f b e d
c
a s Figure 38.2.1: Graph corresponding to Toronto  Sibbald Point map 4. If deg(v ) > 1, there must be another vertex, w, distinct from wn−1 and adjacent to v .
5. If w is in P , then a cycle would exist but trees do not have cycles. Hence, w is not in
P.
6. If w is not in P , then we could add edge {v, w} to P to get a path longer than P ,
contradicting the assumption that P is a longest path in T .
7. Hence, deg(v ) = 1.
8. Similarly, deg(u) = 1 and so two vertices of degree one exist in T . Analysis of Proof We will begin by explicitly identifying the hypothesis and the conclusion.
Hypothesis: T is a tree with at least two vertices.
Conclusion: T has at least two vertices of degree one.
Core Proof Technique: Construction and Contradiction (three times!).
Preliminary Material: Deﬁnition of tree and of degree. 224 Chapter 38 Trees Sentence 1 Find a longest path P = w0 w1 w2 . . . wn in T , say between nodes u = w0 and
v = wn .
The conclusion contains an existential quantiﬁer, has. Let’s ﬁrst identify the components of the existential quantiﬁer.
Objects:
Universe of discourse:
Certain property:
Something happens: Two vertices (unnamed)
Vertices of the tree T
None speciﬁed.
Both vertices have degree 1. Since the proposition contains an existential quantiﬁer in the conclusion, the author
is using the Construct method. This sentence serves two purposes. First, it implicitly
identiﬁes the two objects that will be constructed, u and v . And second, it sets up
the contradictions that will be needed later.
Sentence 2 Since any edge in the tree constitutes a path, P must contain at least one edge
so u = v .
Given that the author intends to show that u and v are distinct vertices of degree one,
the author must ﬁrst establish that u = v . Also, the following argument will require
that the path contain an edge.
Sentence 3 Thus, the vertex wn−1 in the path is adjacent to v but distinct from v .
The author is setting up the contradiction, though it is not at all clear from here how
that contradiction will be displayed.
Sentence 4 If deg(v ) > 1, there must be another vertex, w, distinct from wn−1 and adjacent to to v .
From the analysis of the ﬁrst sentence, the author intends to show that v has degree
one. That means this sentence indicates the author is going to proceed by contradiction.
Sentence 5 If w is in P , then a cycle would exist but trees do not have cycles. Hence, w
is not in P .
This is a miniature proof by contradiction of the statement “If deg(v ) > 1 and w
is adjacent to v , then w is not in P .” Sentence 5 begins with the negation of the
conclusion and ﬁnds a contradiction quickly. If w is in P , then the walk constructed
by taking the subpath from w to v in P and adding the edge {v, w} yields a cycle,
but trees do not contain cycles by deﬁnition.
Sentence 6 If w is not in P , then we could add edge {v, w} to P to get a path longer than
P , contradicting the assumption that P is a longest path in T .
This is another miniature proof by contradiction, this time of the statement “If
deg(v ) > 1 and w is adjacent to v , then w is in P .”
Sentence 7 Hence, deg(v ) = 1.
Assuming that deg(v ) > 1 leads to an adjacent vertex w being both in P and not in
P , a contradiction. Since the author’s reasoning is correct, it must be the case that
the assumption deg(v ) > 1 is false. Since T is connected, deg(v ) > 0 so deg(v ) = 1. Section 38.2 Properties of Trees 225 Sentence 8 Similarly, deg(u) = 1 and so two vertices of degree one exist in T .
Similarly is a useful but dangerous word in proofs. If the conditions really are similar,
then using “similarly” spares tedious eﬀort in checking the details. However, if the
conditions are not similar, the use of “similarly” could be masking a fatal error.
In this case, the argument is identical when w1 replaces wn−1 . Proposition 2 (Number of Vertices in a Tree (NVT))
Let T = (V, E ) be a tree. Then V  = E  + 1. Since V is an integer, we could consider all trees with one vertex, two vertices, three vertices
and so on, this seems like a perfect case for induction. Let’s be very clear about what our
statement P (n) is.
P (n): Let T = (V, E ) be a tree with n vertices. Then n = E  + 1.
Now we can begin the proof.
Proof: Base Case We verify that P (1) is true where P (1) is the statement
P (1): Let T = (V, E ) be a tree with one vertex. Then 1 = E  + 1.
This is equivalent to stating that E  = 0. Since a tree with one vertex has no edges,
the base case is true.
Inductive Hypothesis We assume that the statement P (k ) is true for k ≥ 2.
P (k ): Let T = (V, E ) be a tree with k vertices. Then k = E  + 1.
Inductive Conclusion Now show that the statement P (k + 1) is true.
P (k + 1): Let T = (V, E ) be a tree with k + 1 vertices. Then k + 1 = E  + 1.
By Proposition 1, we know that there is at least one vertex of degree one in T . Let’s
call such a vertex v . Since deg(v ) = 1, v is adjacent to only one vertex, say u. Deleting
the vertex v and the edge {u, v } creates a new tree T where T has k vertices and
E  − 1 edges. By our Inductive Hypothesis therefore,
k = (E  − 1) + 1 ⇒ k = E .
But T has one more vertex and more edge than T so
k + 1 = E  + 1
as required.
The result is true for n = k +1, and so holds for all n by the Principle of Mathematical
Induction. Chapter 39 Dijkstra’s Algorithm
39.1 Objectives The content objectives are:
1. Be able to execute Dijkstra’s Algorithm. 39.2 Dijkstra’s Algorithm [Note to instructors: How you start this depends on how you ended the class that introduced
the Shortest Path Problem.]
Let’s look at a formal expression for solving the shortest path problem.
We can think of the “Require” statement as the preconditions to the algorithm, or the
hypothesis to a proposition. In this case, we require a graph with nonnegative weights on
the edges, and a starting vertex s. We can think of the “Ensure” statement as the postconditions to the algorithm or the conclusion to a proposition. In this case, the algorithm
should terminate with a tree of shortest paths rooted at s, and the distances of a shortest
path from s to each node.
Though our original problem talked about distances, the values we assign to the edges of
the graph could also be time or capacity or costs. The convention is to call these values
weights, which is why the function from the edges to the real numbers is named w.
Let’s watch the algorithm in operation. Our example appears in Figure 39.2.1.
The initialization steps of the algorithm set the distance to s at 0, and the provisional
distances to all other vertices at inﬁnity. By abuse of notation, we will treat inﬁnity as a
real number. We will record distances as numeric labels in blue near the vertices. The set
V initially contains only s and E is empty. We will show the nodes in V as bold circles
and the edges in E as bold lines. Note that at every stage of the algorithm, T = (V , E )
is a tree of shortest paths to the vertices in V . See Figure 39.2.2
Now the algorithm examines each edge with one vertex in V and one vertex not in V . If
using the edge creates a shorter path to a vertex not in V , then the provisional distance to
that vertex is updated. Figure 39.2.3 shows the results of the update. Edges and distances
226 Section 39.2 Dijkstra’s Algorithm 227 Algorithm 2 Dikstra’s Algorithm
Require: G = (V, E ); w : E → R; w({u, v }) ≥ 0, ∀{u, v } ∈ E ; and a designated node s.
Ensure: T = (V , E ) is a tree rooted at s of shortest paths from s to every other node;
d : V → R gives the distance of a shortest path to v , ∀v ∈ V .
{Initialize}
d(s) ← 0
d(v ) ← ∞, ∀v ∈ V, v = s
V ← {s}
E ←∅
T ← (V , E )
repeat
for every edge {u, v } ∈ E where u ∈ V and v ∈ V do
if d(v ) < d(u) + w({u, v }) then
d(v ) ← d(u) + w({u, v })
end if
end for
Choose a y ∈ V so that d(y ) = min{d(w)  w ∈ V }
For the y just chosen, choose {x, y } ∈ E where x ∈ V and d(y ) = d(x) + w({x, y })
V ← V ∪ {y }
E ← E ∪ {{x, y }}
T ← (V , E )
until V = V
3 s 1 b 9 2 c 3 4 a 1 d Figure 39.2.1: Graph G with weights involved in the updates are shown in green. The inﬁnite values previously assigned to
vertices a, b and c have been crossed out.
Continuing with the update, choose the vertex not in V with the smallest provisional
distance. In this iteration, the choice is b. Add b to V and {s, b} to E . This update is
shown in Figure 39.2.4. The nodes in V are shown as bold circles and the edges in E as
bold lines. Note that T = (V , E ) is a tree of shortest paths to the vertices in V .
We repeat this until V = V . Since V = {s, a, b, c, d} and V = {s, b}, V = V and so we
continue. Again, the algorithm examines each edge with one vertex in V and one vertex
not in V . If using the edge creates a shorter path to a vertex in V , then the provisional
distance to that vertex is updated. Figure 39.2.5 shows the results of the update. Edges
and distances involved in the updates are shown in green.
Now choose the vertex not in V with the smallest provisional distance. In this iteration, 228 Chapter 39
∞ 0
3 s 1 ∞ a 9 b Dijkstra’s Algorithm 2 c 3 4 ∞ 1 d ∞
Figure 39.2.2: After initialization 0
3 s 1 ∞1 9 b ∞3 a 2 ∞9 c 3 4 1 d ∞
Figure 39.2.3: First update of d 0 3
3 s 1 1 b a 9 2 c 3 4 9 1 d ∞
Figure 39.2.4: End of ﬁrst iteration the choice is a. Add a to V and {s, a} to E . This update is shown in Figure 39.2.6. The
nodes in V are shown as bold circles and the edges in E as bold lines. Again, note that
T = (V , E ) is a tree of shortest paths to the vertices in V .
We repeat this until V = V . Since V = {s, a, b, c, d} and V = {s, a, b}, V = V and so we Section 39.2 Dijkstra’s Algorithm 229 0 3
3 s 1 1 b a 9 2 c 3 4 94 1 d ∞5
Figure 39.2.5: Second update of d 0 3
3 s 1 1 b a 9 2 c 3 4 4 1 d 5 Figure 39.2.6: End of second iteration continue. Again, the algorithm examines each edge with one vertex in V and one vertex
not in V . If using the edge creates a shorter path to a vertex in V , then the provisional
distance to that vertex is updated. In this iteration, no updates to provisional distances
took place. Figure 39.2.7 shows the results of the update. Edges and distances involved in
the updates are shown in green.
0 3
3 s 1 1 b a 9 2 c 3 4 4 1 d 5 Figure 39.2.7: Third update of d 230 Chapter 39 Dijkstra’s Algorithm Now choose the vertex not in V with the smallest provisional distance. In this iteration,
the choice is c. Add c to V and {b, c} to E . This update is shown in Figure 39.2.8. Again,
note that T = (V , E ) is a tree of shortest paths to the vertices in V .
0 3
3 s 1 1 b a 9 2 c 3 4 4 1 d 5 Figure 39.2.8: End of third iteration We repeat this until V = V . Since V = {s, a, b, c, d} and V = {s, a, b, c}, V = V and so
we continue. Again, the algorithm examines each edge with one vertex in V and one vertex
not in V . If using the edge creates a shorter path to a vertex in V , then the provisional
distance to that vertex is updated. Figure 39.2.9 shows the results of the update.
0 3
3 s 1 1 b a 9 2 c 3 4 4 1 d 5 Figure 39.2.9: Fourth update of d Now choose the vertex not in V with the smallest provisional distance. In this iteration,
the choice is d. Add d to V . But now both and {b, d} and {c, d} match the condition to be
added to E . Which one should be added or should both be added? It is only necessary to
choose one, say {b, d}. This update is shown in Figure 40.3.1. Again, note that T = (V , E )
is a tree of shortest paths to the vertices in V .
Now, ﬁnally V = V and the algorithm terminates. Exercise 1 (Note to instructors: you may wish to do another example before assigning Section 39.3 Certiﬁcate of Optimality 231 0 3
3 s 1 1 b a 9 2 c 3 4 4 1 d 5 Figure 39.2.10: End of fourth iteration and termination of the algorithm this exercise.)
Turn to a neighbour and create a random small graph, say of 6 vertices, and run Dijkstra’s
algorithm on your graph. 39.3 Certiﬁcate of Optimality Based on our experiments when we began this section, the example we did together, and
your own examples, it seems that we have lots of empirical evidence that Dijkstra’s algorithm
works. But evidence is not a proof. Moreover, if a colleague were to provide us with a graph,
edge weights and a proposed tree of shortest paths, it would be nice to have a certiﬁcate
of optimality. Simply running the algorithm again might reproduce an existing error in the
computer program that runs the algorithm.
Let’s consider the two objects the algorithm is supposed to produce.
1. A tree of shortest paths rooted at s.
2. A function d : V → R which gives the distance of a shortest path to v , ∀v ∈ V .
We won’t prove that Dijkstra’s algorithm produces these two objects, though we will certainly think about it. In the next couple of classes we will prove a theorem that allows us
to certify that the output of Dijkstra’s algorithm is, in fact, correct.
Let’s look at the algorithm more closely. Would we expect the algorithm to always produce
a tree? That is, is T = (V , E ) a tree in every iteration? If there is some iteration where
it is not a tree, then the end product will not be a tree because the algorithm only adds
edges. The algorithm never deletes edges.
The algorithm will have V  − 1 iterations because we add a vertex to V at each iteration
and V begins with s. We also add an edge at each iteration so we end up with V  =
E  + 1. Proposition 2 is suggestive but not conclusive. It says that for a tree T = (V, E ),
V  = E  + 1. It does not say that V  = E  + 1 implies that the graph (V, E ) is a tree. 232 Chapter 39 Dijkstra’s Algorithm Let’s consider the construction of T . A tree is deﬁned as a connected graph with no cycles
so let’s ask ourselves “Can the algorithm create a cycle in T ?” Suppose that it did and the
cycle occurred when the edge {u, v } was added. That means both u and v already had to
exist in V , but the edge that is added always contains a vertex not in V . Hence, no cycles
exist in T . As for connectedness, this makes sense since, at each iteration an edge is added
to an already connected graph constructed in the previous iteration.
More problematic is guaranteeing that T is a tree of shortest paths.
Let’s look at d more closely. Suppose {u, v } ∈ E and the path in E from s encounters u
before it encounters v . Then d(u) = d(v ) + w({u, v }). That is not a surprise. That is how
the algorithm adds edges to E . Now look at the exercise that you just completed. Examine
any edge at all in E , say {x, y }. My guess is that you will see d(y ) ≤ d(x) + w({x, y }).
This is what will help us generate a certiﬁcate of optimality. Chapter 40 Certiﬁcate of Optimality  Path
40.1 Objectives The content objectives are:
1. Deﬁne weight, distance potentials, feasible distance potentials, equality edges and tree
of shortest paths.
2. Use a certiﬁcate of optimality to test that a proposed solution is optimal.
3. Prove A Path Shorter Than A Walk.
4. Prove Feasible Potentials.
5. Prove Certiﬁcate of Optimality for a Path.
6. Prove Shortest Paths Give Feasible Potentials.
7. Prove Shortest Path Optimality.
8. Prove Trees of Shortest Paths. 40.2 Certiﬁcate of Optimality Recall that a certiﬁcate consists of a theorem and data. If the data satisfy the hypothesis
of the theorem, the theorem guarantees that the desired property holds.
The data will be a tree T and a function d : V → R, exactly what is produced by Dijkstra’s
algorithm. Our task is to ﬁnd a theorem that will say “If the data satisfy a certain property,
then
1. T is a tree of shortest paths rooted at s.
2. d : V → R gives the distance of a shortest path to v , ∀v ∈ V .” 233 234 Chapter 40 40.3 Certiﬁcate of Optimality  Path Weighted Graphs Suppose that G = (V, E ) is a connected graph with weights w : E → R. Let us also suppose
that w({u, v }) ≥ 0, for every edge of E .
Let W = v0 v1 v2 . . . vn be a walk in G. We deﬁne the weight of W to be the sum of the
weights of all arcs in W . If the edge {u, v } occurs more than once in W , its weight is
counted for each occurrence in W . More formally,
n−1 w({vi , vi+1 }) w(W ) =
i=0 We have been using this deﬁnition implicitly. The distance of a trip from downtown Toronto
to Sibbald Point Provincial Park is the sum of distances of each part of the trip. Dijkstra’s
algorithm also uses this deﬁnition implicitly. Proposition 1 (A Path Shorter Than A Walk (PSTW))
Let G = (V, E ) be a connected graph with nonnegative real weights. Let W be an stwalk
with s = t. Then there exists an stpath with w(P ) ≤ w(W ). Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Part 3 of Proposition 1 states that W can be decomposed into an stpath P and a
collection of cycles C1 , C2 , . . . , Cr .
2. Now r w (W ) = w (P ) + w(Ci ).
i=1 3. Since w(Ci ) ≥ 0 for all i = 1, 2, 3, . . . , r, w(P ) ≤ w(W ). Analysis of Proof We will begin by explicitly identifying the hypothesis and the conclusion.
Hypothesis: G = (V, E ) is a connected graph with nonnegative real weights. W is
an stwalk with s = t.
Conclusion: There exists an stpath with w(P ) ≤ w(W ).
Core Proof Technique: Construct method.
Preliminary Material: Deﬁnitions related to weighted graphs.
Sentence 1 Part 3 of Proposition 1 states that W can be decomposed into an stpath P
and a collection of cycles C1 , C2 , . . . , Cr .
The conclusion contains an existential quantiﬁer so the author uses the Construct
method. Let’s ﬁrst identify the components of the existential quantiﬁer. Section 40.3 Weighted Graphs 235
Quantiﬁer:
Variable:
Domain:
Open sentence: ∃
A path P
All paths in G = (V, E )
w(P ) ≤ w(W ) The author must construct an stpath P and does so using Part 3 of Proposition 1.
The author will now show that w(P ) ≤ w(W ).
Sentence 2 Now r w (W ) = w (P ) + w(Ci ).
i=1 This is the numeric implication of Proposition 1.
Sentence 3 Since w(Ci ) ≥ 0 for all i = 1, 2, 3, . . . , r, w(P ) ≤ w(W ).
This is arithmetic.
The proof is very simple and relies very heavily on the fact that w(Ci ) ≥ 0 for all i =
1, 2, 3, . . . , r. What if the hypothesis “nonnegative real weights” were simply “nonnegative
real weights”? Exercise 1 Show the necessity of “nonnegative” in the hypothesis of Proposition 1. That is, ﬁnd a
counterexample to the statement:
Let G = (V, E ) be a connected graph with nonnegative real weights. Let W be an stwalk
with s = t. Then there exists an stpath with w(P ) ≤ w(W ). You might argue that this is irrelevant because you never encounter negative distances.
This may be true of distances, but this is not true of costs. Subsidies and rebates do, in
fact, create negative cost edges in models.
Let G = (V, E ) be a connected graph with nonnegative weights w : E → R and d : V → R.
The components of d are called distance potentials. We say that distance potentials are
feasible when
d(u) + w({u, v }) ≥ d(v ) for all uv ∈ E.
Edges for which d(u) + w({u, v }) = d(v ) are called equality edges. Proposition 2 (Feasible Potentials (FP))
Let G = (V, E ) be a connected graph with nonnegative weights w : E → R, d : V → R
be feasible distance potentials and W an stwalk. Then w(W ) ≥ d(t) − d(s). Moreover,
w(W ) = d(t) − d(s) if and only if every arc of W is an equality edge. Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Suppose W = v0 v1 v2 . . . vk where s = v0 and t = vk . 236 Chapter 40 Certiﬁcate of Optimality  Path 2. The feasible distance potentials satisfy
d(v0 ) + w({v0 , v1 }) ≥ d(v1 )
d(v1 ) + w({v1 , v2 }) ≥ d(v2 )
d(v2 ) + w({v2 , v3 }) ≥ d(v3 )
.
.
.
d(vk−1 ) + w({vk−1 , vk }) ≥ d(vK )
3. Adding these inequalities together gives
d(v0 ) + d(v1 ) + d(v2 ) + . . . + d(vk−1 ) + w({v0 , v1 }) + w({v1 , v2 }) + . . . + w({vk−1 , vk })
≥d(v1 ) + d(v2 ) + d(v3 ) + . . . + d(vk ).
4. This simpliﬁes to
d(v0 ) + w(W ) ≥ d(vk )
or
w(W ) ≥ d(t) − d(s).
5. Moreover, w(W ) ≥ d(t) − d(s) if and only if every inequality above holds with equality,
that is, every edge in W is an equality edge. This is a straightforward proof so no analysis is provided. Theorem 3 (Certiﬁcate of Optimality for a Path (OPT P))
Let G = (V, E ) be a connected graph with nonnegative weights w : E → R and let s
be a designated vertex and let P be an stpath. If there exist feasible distance potentials
d : V → R such that every edge of P is an equality edge, then P is a shortest stpath. Before we examine the proof, let’s see how the theorem works as part of the certiﬁcate. Recall the tree and function d that resulted from our example of running Dijkstra’s algorithm.
The dark edges indicate the tree and the blue labels adjacent to the vertices give d. Observe
the sdpath P = sbd. All of the hypotheses of Theorem 3 are satisﬁed. G is a connected
graph with nonnegative weights. A vertex s has been designated. P = sbd is an sdpath.
By examining each edge of G we can conﬁrm that d are feasible distance potentials. By
examining each edge of P we can conﬁrm that every edge of P is an equality edge. Hence,
by Theorem 3, P is a shortest sdpath.
Now to the proof.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. By the ﬁrst part of the conclusion of Proposition 2, every stwalk has weight at least
w(t) − w(s).
2. By the second part of the conclusion of Proposition 2, w(P ) = w(t) − w(s). Section 40.3 Weighted Graphs 237 0 3
3 s 1 1 b a 9 2 c 3 4 4 1 d 5 Figure 40.3.1: Tree and d 3. Since the weight of every walk W is bounded below by w(t) − w(s), and P is a path
that achieves that bound, P must be a shortest stpath. Analysis of Proof We will begin by explicitly identifying the hypothesis and the conclusion.
Hypothesis: G = (V, E ) is a connected graph with nonnegative weights w : E →
R. s is a designated vertex and P is an stpath. There exist feasible distance
potentials d : V → R such that every edge of P is an equality edge.
Conclusion: P is a shortest stpath.
Core Proof Technique: ForwardBackwards. Existential quantiﬁers occur in the
hypothesis.
Preliminary Material: Accumulated knowledge about weighted graphs.
Sentence 1 By the ﬁrst part of the conclusion of Proposition 2, every stwalk has weight
at least w(t) − w(s).
Since is is a form of the existential quantiﬁer, the hypothesis “P is an stpath” allows
the author to assume the existence of P . What the author must show is not that
P exists, or that P is an stpath, but rather that P is a shortest stpath. The ﬁrst
sentence of the proof places an upper bound on w(P ).
Sentence 2 By the second part of the conclusion of Proposition 2, w(P ) = w(t) − w(s).
The hypotheses of the current theorem include “There exist feasible distance potentials
d : V → R such that every edge of P is an equality edge.” The existential quantiﬁer in
this hypothesis allows the author to assume the existence of feasible distance potentials
and equality edges. These are needed to invoke 2.
Sentence 3 Since the weight of every walk W is bounded below by w(t) − w(s), and P is
a path that achieves that bound, P must be a shortest stpath.
Since no walk, and hence no path, can be shorter than w(t) − w(s), and w(P ) =
w(t) − w(s), P must be a shortest stpath. 238 Chapter 40 Proposition 4 Certiﬁcate of Optimality  Path (Shortest Paths Give Feasible Potentials (SPGFP))
Let G = (V, E ) be a connected graph with nonnegative weights w : E → R and a designated
node s. If d : V → R is deﬁned as the length of a shortest path from s to v for all vertices
in V , then d are feasible distance potentials. Proof: (For reference purposes, each sentence of the proof is written on a separate line.)
1. By contradiction, suppose that d are not feasible distance potentials. Then there
exists {u, v } ∈ E such that d(u) + w({u, v }) < d(v ).
2. Let P be a shortest supath. By the deﬁnition of d, w(P ) = d(u).
3. Consider the walk W constructed by appending the edge {u, v } to the path P .
4. By Proposition 1, there exists an sv path P with w(P ) ≤ w(W ).
5. But w(W ) = w(P ) + w({u, v }) = d(u) + w({u, v }) < d(v ).
6. But then w(P ) < d(v ) so d(v ) cannot be the length of a shortest sv path, a contradiction. Now we show that the converse of the certiﬁcate of optimality for paths also holds. Theorem 5 (Feasible Distance Potentials and Equality Edges)
Let G = (V, E ) be a connected graph with nonnegative weights w : E → R and let s be
a designated vertex. If P is a shortest stpath, then there exist feasible distance potentials
d : V → R such that every edge of P is an equality edge. Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Let d : V → R be deﬁned as the length of a shortest path from s to v for all vertices
in V . By 4, these are feasible distance potentials.
2. Hence, w(P ) = d(t) = d(t) − 0 = d(t) − d(s).
3. But then 2 implies that every edge of P is an equality edge. Together, the theorem on the optimality of paths (Theorem 3) and the existence of feasible
distance potentials (Theorem 5) gives Theorem 6 (Shortest Path Optimality (SPO))
Let G = (V, E ) be a connected graph with nonnegative weights w : E → R and let s
be a designated vertex. P is a shortest stpath if and only if there exist feasible distance
potentials such that every edge of P is an equality edge. Section 40.4 Certiﬁcate of Optimality  Tree 40.4 239 Certiﬁcate of Optimality  Tree We have dealt so far with paths, but Dijkstra’s algorithm produces a tree, not a path.
Fortunately, similar theorems hold. Theorem 7 (Trees of Shortest Paths (TSP))
Let G = (V, E ) be a connected graph with nonnegative weights w : E → R. Let s be a
designated vertex and let T be a spanning tree rooted at s. If there exist feasible distance
potentials such that every edge of T is an equality edge, then T is a tree of shortest paths
rooted at s.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Let us assume that there exist feasible distance potentials such that every edge of T
is an equality edge.
2. For every node v in V , there is an stpath in T that satisﬁes the hypotheses of Theorem
3.
3. Hence, T is a tree of shortest paths rooted at s. Theorem 7 requires a spanning tree, feasible potentials and equality arcs. How do we know
that these exist? Theorem 8 (Existence of Trees of Shortest Paths (ETSP))
Let G = (V, E ) be a connected graph with nonnegative weights w : E → R and let s be a
designated vertex. Then there exists a tree of shortest paths rooted at s. Proof: (For reference, each sentence of the proof is written on a separate line.)
1. For every node v ∈ V , let P (v ) be a shortest stpath in G and let d(v ) = w(P (v )).
2. Since d(v ) is the length of a shortest path to v , Proposition 4, tells us that d is a set
of feasible distance potentials.
3. We know from Proposition 2 that every edge in a shortest sv path is an equality arc.
So, every edge of P (v ) is an equality edge for every v ∈ V .
4. Let
E= P (v ).
v ∈V 5. The edges of E contain a path consisting of equality arcs from s to every v ∈ V .
Delete from E enough edges to produce a tree T .
6. But then 7 applies and T is a tree of shortest paths rooted at s. Chapter 41 Appendix
Proposition 1 (Decomposing nth Power (DNP))
If ab = cn and gcd(a, b) = 1, then there exist integers a1 and b1 so that a = an and b = bn .
1
1 Proof: Without loss of generality, we may assume that a > 1 and b > 1. If
a = pk1 pk2 · · · pkr
r
12
jj
j
b = q11 q22 · · · qss are the prime factorizations of a and b, then no px can occur among the qy otherwise the
gcd(a, b) > 1. As a result, the prime factorization of ab is
jj
j
ab = pk1 pk2 · · · pkr q11 q22 · · · qss
r
12 Let us suppose that c can be factored into primes as
c = ul1 ul2 · · · ult
t
12
Then ab = cn can be written as
jj
j
pk1 pk2 · · · pkr q11 q22 · · · qss = unl1 unl2 · · · unlt
r
t
12
1
2 This implies that each px and qy equals some uh and that the corresponding exponents are
equal. That is kx = nlh (or jy = nlh ). This implies that all of the exponents of the px and
qy are divisible by n. Thus, we can choose
k /n k /n a = p1 1 p2 2 j /n j /n b = q11 q22
and a = an and b = bn as needed.
1
1 240 · · · pkr /n
r j
· · · qss /n ...
View
Full
Document
This note was uploaded on 04/02/2012 for the course MATH 135 taught by Professor Andrewchilds during the Winter '08 term at Waterloo.
 Winter '08
 ANDREWCHILDS
 Math

Click to edit the document details