RDW 1
RDW 1
RDW 1
Version 1.0
c Faculty of Mathematics, University of Waterloo
Contents
1 In the beginning 10
1.1 What Makes a Mathematician a Mathematician? . . . . . . . . . . . . . . 10
1.2 Why Do We Reason Formally? . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3 Structure of the Course . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5 Analysis of a Proof 33
5.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.2 Divisibility of Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.2.1 Understanding the Definition of Divisibility . . . . . . . . . . . . . 34
5.2.2 Transitivity of Divisibility . . . . . . . . . . . . . . . . . . . . . . . 34
5.3 Analyzing the Proof of Transitivity of Divisibility . . . . . . . . . . . . . . 35
6 Discovering Proofs 37
6.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.2 Divisibility of Integer Combinations . . . . . . . . . . . . . . . . . . . . . . 37
6.3 Discovering a Proof of Divisibility of Integer Combinations . . . . . . . . . 38
6.4 Proof of Bounds by Divisibility . . . . . . . . . . . . . . . . . . . . . . . . 40
2
Section 0.0 CONTENTS 3
7 Introduction to Sets 44
7.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.2 Describing a Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.2.1 Set-builder Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.3 Set Operations - Unions, Intersections and Set-Differences . . . . . . . . . 48
7.4 Cartesian Products of Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.4.1 Cartesian Products of the Form S S . . . . . . . . . . . . . . . . 50
9 Quantifiers 62
9.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
9.2 Quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
9.3 The Universal Quantifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
9.3.1 The Select Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
9.4 The Existential Quantifier . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
9.4.1 The Construct Method . . . . . . . . . . . . . . . . . . . . . . . . . 67
9.5 Negating Quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.6 Assuming a Quantified Statement is True . . . . . . . . . . . . . . . . . . 70
9.6.1 The Substitution Method . . . . . . . . . . . . . . . . . . . . . . . 70
9.6.2 The Object Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
10 Nested Quantifiers 73
10.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
10.2 Nested Quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
10.2.1 Negating Nested Quantifiers . . . . . . . . . . . . . . . . . . . . . . 75
10.3 More Examples with Nested Quantifiers . . . . . . . . . . . . . . . . . . . 76
10.4 Functions and Surjections . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
10.4.1 Graphically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
10.4.2 Reading a Proof About Surjection . . . . . . . . . . . . . . . . . . 79
10.4.3 Discovering a Proof About Surjection . . . . . . . . . . . . . . . . . 80
12 Proofs by Contradiction 90
12.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
12.2 Proof by Contradiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
12.2.1 When to Use Contradiction . . . . . . . . . . . . . . . . . . . . . . 91
12.2.2 A More Substantial Proof by Contradiction . . . . . . . . . . . . . 92
12.2.3 Discovering and Writing a Proof by Contradiction . . . . . . . . . . 93
23 Congruence 167
23.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
23.2 Congruences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
23.2.1 Definition of Congruences . . . . . . . . . . . . . . . . . . . . . . . 167
23.3 Elementary Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
38 Counting 271
38.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
38.2 African Shepherds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
38.3 What Does It Mean to Count? . . . . . . . . . . . . . . . . . . . . . . . . 272
38.4 Showing That a Bijection Exists . . . . . . . . . . . . . . . . . . . . . . . 272
38.5 Finite Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
These course notes are meant to accompany the lectures of MATH 135 at the University of
Waterloo.
The script, examples and exercises were initially authored by Steve Furino and subsequently
modified by Mukto Akash and J.P. Pretti with help from Carmen Bruni. Please send any
corrections or suggestions to jpretti@uwaterloo.ca.
This version is an update to version 0.5 used in Winter 2016. It corrects mistakes discovered
at that time but several chapters have also been substantially rewritten.
8
Part I
9
Chapter 1
In the beginning
But why do we reason so formally at all? Many people believe that humans already know
enough mathematics so Why bother with proofs? There are quite a few reasons.
To prevent silliness. In solving quadratic equations with non-real 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.
10
Section 1.3 Why Do We Reason Formally? 11
To understand better. How would most of us answer the question Whats a real num-
ber? We would probably say that any number written as a decimal expansion is a
real number and any two different expansions represent different 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
He who seeks for methods without having a definite problem in mind seeks for
the most part in vain.
David Hilbert
How do we secure internet commerce? Have you ever bought a song or movie digi-
tally? 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.
Why does ei + 1 = 0 ? This is often heralded as the most beautiful equation in math-
ematics. We know that the natural exponent, e, is a very unusual number that arises
in calculus as a limit of a specific sequence of numbers.
On a similar note, i is a very unusual number because it has the property that i2 = 1.
This is strange because we know that the square of a real number is always non-
negative, and clearly the number i violates this rule.
As mathematicians, we appreciate that is also 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?
In addition to all of these, one (1) is the basis of the natural numbers, hence the
integers, hence the rationals. Zero (0) is a difficult number and was only accepted
into the mathematics of western Europe because of the influence of Hindu and Islamic
scholars. Why should all of these numbers be connected in so simple and elegant a
form?
How do we factor polynomials? You may have factored positive integers into a product
of prime numbers before. We will see in this course that polynomials, which are
expressions like ax4 + bx3 + cx2 + dx + e, behave a lot like the integers. Hence, there
is also a need in mathematics to factor polynomials into the polynomial equivalent of
prime numbers.
What does it mean to count? You probably learned to count before you went to school.
In fact, counting with our fingers is often the first way we get introduced to the
numbers we use in mathematics. We soon realize there are more numbers than we
can count with our fingers. But how do you count to infinity? Is there only one
infinity?
Section 1.3 Structure of the Course 13
To understand and solve these problems we will need to learn about various mathematical
concepts, such as modular congruences, modular arithmetic, complex numbers,
polynomials, etc. To work with these topics, we must learn some foundational mathe-
matics such as logical expressions and sets, and, most importantly, we must learn how to
recognize and use proof techniques.
There will be a substantial amount of new definitions and propositions introduced through-
out the course. Familiarize yourself with these. We will use a system of acronyms (e.g.
(DML)) to keep track of the proven propositions (e.g. (De Morgans Laws)) and to refer
to them from time-to-time. Disclaimer: These acronyms are somewhat artificial and may
not be meaningful outside the setting of this course. A similar comment applies to the labels
(e.g., Select Method, Construct Method, etc.) that we use for our various proof methods.
Chapter 2
2.1 Objectives
Definition 2.2.1 A statement is a sentence that has a definite state of being either true or false.
Statement
14
Section 2.3 Propositions, Proofs and Axioms 15
1. 2 + 2 = 4. (A true statement.)
4. There exists a real number such that sin() > 1. (A false statement.)
First of all, a statement must have a corresponding truth value. That is, when reading
a statement, we should realize that what is being said has to be either true or false (but
cannot be both), even if we do not know the truth value of the statement.
Example 2 On the other hand, the following are examples of sentences that are not mathematical
statements.
1. Is 7 = 5?
3. Let x > 0.
Let us discuss why the above sentences are not statements. Questions, such as is 7 = 5?,
are never statements. We simply cannot assign a true or a false state to questions.
Similarly, instructions to find the smallest positive integer or to assume that x > 0
cannot be given truth values, and are therefore not statements. The last example is different
and paradoxical. Can you see why it cannot be true but also cannot be false?
A mathematical statement has a definite true or false value. Given a statement, however,
it is not always obvious whether the statement is true or not. Throughout this course we
will encounter statements like this. We will be interested in figuring out whether they are
true or false. Such statements are known as propositions.
REMARK
A proposition is a mathematical claim posed in the form of a statement that either needs
to be proven true or demonstrated false by a valid argument. You will encounter several
variations on the word proposition. A theorem is a particularly significant 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.
16 Chapter 2 A First Look At Proofs
This is clearly a statement, but is it true? Well, if we consider the number 5 in place of
x, we note that (5)2 + 1 = 26, whereas 2 5 = 10, and since 26 > 10, the number 5 does
satisfy the claim made in the proposition. However, just as one swallow does not make a
summer, knowing that the sentence is true when x = 5 does not guarantee us that it will
be true for other instances of x. We need to establish this using a proof.
A proof is simply a series of convincing arguments that leaves absolutely no doubt that a
given proposition is true. Proofs work by connecting our assumed knowledge from previously
proven statements, definitions, axioms, etc. in a mathematically accurate way to deduce a
result that establishes the proposed truth.
Let us read our first proof.
Note that in the given proof, we did not specify any particular number, rather we worked
with the algebraic symbol x. The significance of using x is that it establishes the rule in
general. The arguments that are used in the proof are just applications of our common
knowledge about real numbers and inequalities. Since we followed a valid line of reasoning,
the last expression must hold true for the x we started with, thus proving the statement.
REMARK
Here is a common mistake made by students when they try to prove Proposition 1 given
above.
Exercise 1 Try to prove Proposition 1 another way. Start with the left-hand side x2 +1 and manipulate
it to deduce that x2 + 1 2x.
Section 2.3 Propositions, Proofs and Axioms 17
Finally, there are particular statements, known as axioms, that are more foundational. An
axiom is a statement that is assumed to be true. No proof is given, nor needed. Axioms are
essentially our fundamental beliefs on how mathematics should work. Obviously, choosing
axioms has to be done very carefully.
There are some very famous axioms in mathematics, such as Peanos Axioms on Natural
Numbers, Euclids Axioms on Plane Geometry, the Zermelo-Fraenkel Axioms of Set Theory,
the Principle of Mathematical Induction, etc. However, these formal axioms are often
stated for a professional audience, and their importance is sometimes difficult to grasp at a
beginners level.
In this course, we will not use a formal set of axioms. Instead, we will write for an audience
consisting of other students in the course. Assume other MATH 135 students are reading
your proofs. Facts they all should know can be used without proof. This audience should
be able to follow your arguments without having to question any facts (axioms) that you
use.
3. x + y = y + x and xy = yx.
4. x2 0 and y 2 0.
Definition 2.3.1 We say that an integer even if it can be written in the form 2k where k is an integer.
Even and Odd Otherwise, an integer can be written in the form 2k + 1 where k is an integer and we say
that the integer is odd.
3.1 Objectives
Throughout this course we work with statements and their proofs. To understand methods
for proving statements, we must first understand how complicated statements may often be
dissected into a combination of simpler parts. We may then develop ways to string together
proofs of such parts to prove the complicated statement in its entirety.
Our objective in this chapter is to develop some rules for combining several statements to
produce a new statement. The truth value of the new statement depends on the truth value
of the initial statements that are being combined.
Definition 3.2.1 A compound statement is a statement composed of several individual statements called
Compound, component statements.
Component
18
Section 3.3 Truth Tables as Definitions 19
For example, the statement ( is a real number) and (3 6= 4). contains two components:
1. is a real number.
2. 3 6= 4.
For the time being, we shall focus on compound statements that are composed of two
components. We often label statements with letters such as A, B, C, etc. Suppose A and B
are two arbitrary, unrelated statements. Then A would have its own truth value, as would
B. We may indicate, for example, that A is true (T ) but B is false (F ) by assigning the
state (T, F ) to the pair of statements (A, B). Thus, the pair (A, B) can achieve any of the
following states: (T, T ), (T, F ), (F, T ) and (F, F ).
To form a compound statement S, whose components are A and B, we need to declare the
truth value of S based on the possible states of its components. The simplest way to do so
is to use a truth table. A truth table summarizes the information about the states of each
component and the corresponding truth value of the compound statements. We have a few
examples of how truth tables are used to define compound statements in section 3.3 below.
In this section, we will use truth tables to introduce three logical operators: AND, OR
and NOT. Note that these do not always coincide with our use of the words and, or, not
in the English language.
Given some statement A, perhaps the simplest compound statement that we may come up
with is the negation of A. The negation of A, simply known as NOT A, is the statement
whose truth value is the exact opposite of that of A. For example, (3 = 4) and (3 6= 4) are
negations of each other.
Definition 3.3.1 We define NOT A, written A, using the following truth table.
NOT
A A
T F
F T
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.
Given a statement A, we often try to negate A by writing A in a manner that does not
involve the symbol. For example, (3 = 4) is written as (3 6= 4), ( < 4) is written as
( 4), etc. We will see in later chapters that such practice becomes useful when we are
trying to prove complicated statements that have many individual components.
20 Chapter 3 Truth Tables and Logical Operators
Suppose A and B are arbitrary statements. Let us now use truth tables to define two
compound statements: A B (conjunction) and A B (disjunction).
The truth table summarizes the fact that A B is true only when both the components A
and B are true.
Truth tables can be used to define the truth value of a statement or to evaluate the truth
value of a statement. For example, if we now specify that
P : is a real number,
and Q : (3 6= 4),
then, according to the truth table above, the compound statement
must be true as both of its components are true. On the other hand, the statement
( is a real number) (3 = 4)
Proof Method We may also devise methods for proving compound statements by using truth tables. To
AB prove that a statement of the form A B is true, we must establish, separately, that both
A is true and B is true.
On the other hand, showing either A is false or B is false is enough to conclude that A B
must be false.
This truth table establishes that A B is false only when A and B are both false.
Section 3.4 More Complicated Statements 21
Example 1 Each of the following statements are true since at least one of the components is true.
3. ( is an integer) (3 6= 4).
( is an integer) (3 = 4)
Proof Method To prove that a statement of the form A B is true, it is enough to establish any one of the
AB statements A or B to be true. On the other hand, to show A B is false, we must show
that both A is false and B is false.
We may now combine more than one logical operator to form more complicated compound
statements. We can construct truth tables for compound statements by evaluating parts of
the compound statement separately and then combine their corresponding truth value to
evaluate the truth value of the overall 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. (Brackets serve the same purpose in logical expressions as
they do in arithmetic: they specify the order of operations.)
22 Chapter 3 Truth Tables and Logical Operators
A B A B (A B)
T T T F
T F T F
F T T F
F F F T
In the first row of the table A and B are true, so using the definition of OR, the statement
A B is true. Since the negation of a true statement is false, (A B) is false, which
appears in the last column of the first row. Take a minute to convince yourself that each of
the remaining rows is correct.
A B A B (A) (B)
T T F F F
T F F T F
F T T F F
F F T T T
2. Suppose A and B are true, and C is false. What is the truth value of A (B C)?
Notice that the effect of taking double negation, that is (A), is exactly what we expect:
the truth value of (A) is the same as that of A. Thus, logically, there is no difference
between considering the original statement A or the compound statement (A). We say
that A and (A) are logically equivalent, and express this idea by writing
(A) A.
Definition 3.5.1 Two compound statements, say S1 and S2 , are logically equivalent if they have the same
Logically truth values for all possible states of their component statements. We write S1 S2 to
equivalent mean S1 is logically equivalent to S2 .
Section 3.5 Equivalent Logical Expressions 23
Essentially, S1 S2 tells us that their truth values are perfectly correlated - one cannot be
true while the other is false, and vice versa. Thus, logically, there is no reason to distinguish
between S1 and S2 .
Proof Method Equivalent statements are enormously useful in proofs. Suppose you wish to prove S1 but
Logically are having difficulty. If there is a simpler statement S2 and S1 S2 , then you can prove S2
Equivalent instead. In proving S2 , you will have proved S1 as well.
Statements
Example 4 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)
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T
Since the columns representing (AB) and (A)(B) are identical for the corresponding
truth values of the components, we can conclude that
(A B) (A) (B).
Exercise 2 Use truth tables to show that for statements A, and B, the Commutativity Laws hold.
That is
1. A B B A
2. A B B A
Using a truth table is not the only way to determine whether two statements are logically
equivalent; we may also use established equivalences to obtain new ones. In general, if we
can establish that S1 S2 and S2 S3 , then we may immediately conclude that S1 S3 .
We say that logical equivalence is transitive and use this fact many times in this course.
Example 5 Suppose A and B are arbitrary statements. Use the fact that we have established
to prove that
(A) (B) (A B)
without using a truth table.
24 Chapter 3 Truth Tables and Logical Operators
Solution. To establish the logical equivalence between two statements, we must start with
one statement and convince the reader that it is logically equivalent to the other. Let us
start with the statement to the left of the sign.
Note that the final statement is (A B), exactly what appears on the right of the sign.
Since we managed to arrive at (A B) from (A) (B) with the help of established
logical equivalences, we may conclude that (A) (B) (A B).
Exercise 3 Construct a single truth table for (AB) and (A)(B) and verify that these statements
are indeed logically equivalent. Then verify that these statements are not logically equivalent
to (A) (B) and are also not logically equivalent to (A B).
1. (A B) (A) (B)
2. (A B) (A) (B)
Provide a statement that is logically equivalent to NOT A, but does not contain the word
not or the negation () symbol (negative symbols such as 6=, ,
/ etc. are allowed).
Solution. Here, we are asked to negate statement A.
There are two obvious components to statement A, namely (5 = 2) and (3 < 6 < 7), that
are connected by the logical operator OR (). According to De Morgans Laws (DML), we
would have
However, we are not allowed to use the symbol, so we shall use (5 6= 2) instead of (5 = 2).
At this point, we must realize that (3 < 6 < 7) is actually an abbreviated form of compound
statement (3 < 6) (6 < 7). Thus, using DML again, we have
(3 < 6 < 7) (3 < 6) (6 < 7).
Finally, we may replace (3 < 6) by (3 6) and (6 < 7) by (6 7). Collecting all this
analysis in one place, we finally get that
Section 3.5 Equivalent Logical Expressions 25
Several other logical equivalences provide the foundation of the various proof techniques we
will study throughout the course.
A B C BC A (B C) A B A C (A B) (A C)
T T T T T T T T
T T F F T T T T
T F T F T T T T
T F F F T T T T
F T T T T T T T
F T F F F T F F
F F T F F F T F
F F F F F F F F
REMARK
The previous example verifies the first of the following Associativity Laws.
1. A (B C) (A B) C
2. A (B C) (A B) C
The term associative (and commutative seen earlier) is also used in other contexts. For
example, we say that the addition of integers is associative because a + (b + c) = (a + b) + c
for integers a, b and c. Ask yourself what other standard arithmetic operations are also
associative.
Finally, we state the Distributivity Laws:
1. A (B C) (A B) (A C)
2. A (B C) (A B) (A C)
Self Check 1 As in the previous example, use truth tables to verify the remaining laws.
Chapter 4
4.1 Objectives
We have just started our journey towards understanding mathematical statements and
developing their proofs. So far, we have discovered that a complicated statement may often
be broken down into simpler components, and the connection between these components
may then be leveraged to produce a proof of the complicated statement. We would now
like to start developing the theory of how to prove statements.
The most common type of statement we will prove is an implication. An implication is
a compound statement that has two components, lets call these components A and B for
the time being.
The component A located to the left of the = arrow is known as the hypothesis, while
the component B on the right is known as the conclusion.
26
Section 4.2 Implications: Hypothesis = Conclusion 27
Conditional statements such as implications have been around since the ages of classical
Greek philosophy, and it may be worth mentioning that the terms hypothesis and conclusion
are inherited from their usage in logic and philosophy. In English language, the structure
of implications is quite easy to understand. The hypothesis (also known as supposition,
premise, protasis, etc.) appears between the if and the then. The conclusion (also
often called proposition, inference, apodosis, etc.) shows up after the then and states the
consequence of the hypothesis condition being met.
Here, the hypothesis is I read this chapter thoroughly and the conclusion is I will be
able to prove implications.
Example 2 Let x be a positive real number. Identify the hypothesis and the conclusion of the following
implication:
Hypothesis: x > 1
Conclusion: x2 > x
REMARK
1. We usually only use true implications in our day-to-day usage of conditional sentences.
False implications (e.g., if the earth is a planet, then all people are mushrooms) are
rare. We must always keep in mind that the condition imposed on an implication
being false is that the hypothesis must be true while the conclusion is false.
2. Another point of confusion often arises from the last two rows in the definition of
A = B:
A B A = B
F T T
F F T
Inexperienced mathematicians often look at these rows and ask questions such as
28 Chapter 4 Implications and the Direct Proof
These questions arise from our difficulty in appreciating the fact that the truth table
is simply defining A = B. The purpose of the truth table is to establish the truth
value of A = B depending on the state of the pair (A, B). The states (F, T ) and
(F, F ) are just possible truth values for the pair (A, B), and we assign A = B to
be true for these states.
If (1 + 1 = 4) then ( = 3)
and
If (1 + 1 = 4) then ( 6= 3)
We may try to use to truth value of A = B to obtain information about the truth
values of the components A and B respectively. This is a nice exercise in logic, and helps
us understand how to use previously proven propositions towards proving new ones.
It will be useful for us to remember the truth table for A = B in this section.
A B A = B
T T T
T F F
F T T
F F T
For example, from the second row of the truth table, whenever A = B is false, we
immediately determine that A must be true and B must be false.
On the other hand, suppose A = B is true. Perhaps we also know that A is true. What
can we deduce from these pieces of information? From the definition of A = B, we see
that the only row where both A = B is true and A is true is the first row. Thus, we
may deduce that B must also be true.
Section 4.4 Rules of Inference 29
Example 4 Consider the following examples that illustrate these rules of inference.
1. In each of the given cases, assume that it has been established that the given impli-
cation is true. For the given statements P and Q, when P is true, discuss whether
we can determine if Q must be true or not.
(a) Implication : If I do every problem in the text book, then I will learn discrete
mathematics.
P : I learnt discrete mathematics.
Q : I must have done every problem in the text book.
Solution: We are told that the implication is true, and that P is true. However,
P only tells us that the conclusion of the implication is satisfied, thus it is still
possible for the hypothesis, Q, to be either true or false.
For example, I could have learnt discrete mathematics by other means such as
attending relevant lectures, reading different books, etc, rather than solving every
problem in the text book.
(b) Implication : If the Earth were flat, then Columbus would not set sail.
P : Columbus set sail.
Q : The earth is not flat.
Solution: Given that P is true, this means that the conclusion of the im-
plication is false, but the implication itself is true. From the definition of an
implication, the only way this is possible is when the hypothesis of the implica-
tion is also false. This means Q must be false, so this time we may actually
deduce that Q is true.
2. Let a and b be real numbers. Is it possible for the following implications to be false?
There are a few different methods for proving that an implication is true. In this section,
we will focus on the most obvious method: the direct proof.
Proof Method To prove the implication A implies B is true, you assume that A is true and you use this
Direct Proof assumption to show that B is true. Statement A is what you start with. Statement B is
where you must end up.
Suppose a, b and c are real numbers. You may have seen the following proposition in high
school.
b
Proposition 1 If a 6= 0 and b2 = 4ac and, then x = 2a is a solution to ax2 + bx + c = 0.
We shall prove this proposition through a direct proof, but before that, let us start by
identifying the hypothesis and the conclusion of the implication above.
Our approach will be to assume a 6= 0 and b2 = 4ac is true, and try to use this assumption
b
to verify that x = 2a is a solution to ax2 + bx + c = 0 is also a true statement. To
check whether a particular value of x solves some equation in the variable x, we need to
substitute the proposed value of x in the equation and check that the left side and the right
side of the equation evaluates to the same number.
Proof of Proposition 1: Assume that (a 6= 0) (b2 = 4ac) is true. This means that the
components a 6= 0 and b2 = 4ac are both true.
b
Since a 6= 0, therefore we are allowed to divide by a, and thus the fraction 2a is a real
b 2
number. Substitute x = 2a into the left side of ax + bx + c = 0 and simplify to get
b 2
b
ax2 + bx + c = a +b +c
2a 2a
2
b b2
=a +c
4a2 2a
b2 b2
= +c
4a 2a
b2 2b2 + 4ac
=
4a
b2 + 4ac
= .
4a
Using the assumption that b2 = 4ac, we get that b2 + 4ac must equal zero. Hence the
left side of the equation evaluates to zero. The right side is already zero, so the two sides
match.
b
Therefore, x = 2a is a solution to ax2 + bx + c = 0.
Section 4.5 Negating an Implication 31
REMARK
Here, it is crucial to note that this proof does not begin with the statement ax2 + bx + c = 0.
Instead, it begins by manipulating the expression ax2 + bx + c which is not a statement on
its own.
Related to this, it is best to start a direct proof of the statement A = B with the
sentence
Assume A is true
Although professional mathematicians will take shortcuts, when first learning proofs, all
your assumptions should be stated explicitly. At no point during the proof should we give
the impression that the conclusion, i.e., statement B, has been assumed to be true.
We will see lots of direct proofs in this course, presented in different contexts.
What is wrong with the following attempted proof of the given implication?
Attempted Proof: (For reference, each sentence of the proof is written on a separate
line.)
1. Assume n2 is even.
Solution: In the attempted proof, we cannot yet justify how we obtain step 3 from any
of the previous steps. In fact, in step 3, we are actually assuming that n can be written as
2`, but this is true only when n is even. Therefore, we have inherently assumed that the
conclusion is true instead of deducing it from the hypothesis.
Example 6 Construct the truth table for (A) B and demonstrate that this statement is logically
equivalent to A = B.
Solution: Using the following truth table
A B A = B A (A) B
T T T F T
T F F F F
F T T T T
F F T T T
[(A) B] A (B).
Example 8
Consider the following implication.
2. Identify the logical flaw in the following attempted disproof of the implication.
Attempted Disproof: Assume x2 < 0. Then adding 1 to both sides of the inequality
gives x2 + 1 < 1. Thus x2 + 1 2. We have that the hypothesis being true gives us
that the conclusion is false, hence the given implication must be false.
Solution: The argument correctly demonstrates that the implication If x2 < 0 then
x2 + 1 2 is true. However this statement is unrelated to the original statement. It
is not the negation of the implication, which would be x2 < 0 and x2 + 1 2 which
indeed is false for all real numbers.
Chapter 5
Analysis of a Proof
5.1 Objectives
We have have just learned how to prove an implication using a direct proof. In this chapter,
we shall analyze the proof of the proposition known as Transitivity of Divisibility, and will
recognize it as a direct proof. First, let us introduce the concept of divisibility.
For the time being, we will focus exclusively on integers. Division turns out to be a fairly
complicated operation on integers. If we try to divide 6 by 2, we get the integer 3 as a
result; but if we divide say 6 by 4, then the result 46 = 1.5 is no longer an integer. Since we
want to deal solely with integers, we are interested in learning more about the cases where
the result of a division is an integer.
Definition 5.2.1 An integer m divides an integer n, and we write m | n, when there exists an integer k so
Divisibility that n = km.
If m | n, then we say that m is a divisor or a factor of n, and that n is a multiple of m
or that n is divisible by m.
33
34 Chapter 5 Analysis of a Proof
Suppose m and n are two integers. Let us also make the assumption that m is non-zero.
We would like to understand what it means:
When one first encounters a proposition, it often helps to work through some examples to
understand the proof.
The proposition Transitivity of Divisibility involves an implication that has some instances
of divisibility of integers (i.e., m | n) both in the hypothesis and in the conclusion. The
proof highlights the difference between assuming m | n versus showing m | n.
Let us analyze the proof of the Transitivity of Divisibility in detail because it will give us
some sense of how to analyze proofs in general.
We will do a line by line analysis, so to make our work easier, we will write each sentence
on a separate line. What we do now will seem like overkill but it serves two purposes. It
gives us practice at justifying every line of a proof, and a structure that we can use for other
proofs.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Assume a | b and b | c.
5. Since sr is an integer, a | c.
Analysis of Proof: We begin by explicitly identifying our assumptions and our desired
conclusion.
Core Proof Technique: Work forwards from the hypothesis (Direct Proof).
Preliminary Material: The definition of divides. An integer m divides an integer
n, and we write m | n, if there exists an integer k so that n = km.
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 definition of divides.
This completes our first careful analysis of a proof.
Chapter 6
Discovering Proofs
6.1 Objectives
In the previous chapter we used the proof techniques that we have learned so far to analyze
a proof of the Transitivity of Divisibility.
When we define a new mathematical concept, such as divisibility, we are usually eager to
find out what kind of properties it satisfies. For example, we know that 5 divides both
10 and 15. Then, according to the Transitivity of Divisibility (TD), 5 would divide all
multiples of 10, and similarly, 5 would also divide all multiples of 15. What if we add a
multiple of 10 to a multiple of 15, would 5 divide the result? For instance, does 5 divide
The answer is a resounding yes ! In fact, it is not very difficult to believe that 5 would
divide all possible linear integer combinations of 10 and 15 (i.e., any expression of the form
10x + 15y, where x and y are integers). This can be generalized to a new result:
However, we still need to prove this result. In this chapter, we will discover a proof of the
above proposition.
37
38 Chapter 6 Discovering Proofs
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 specific
techniques.
Let us begin with a numeric example.
Example 1 Suppose a = 3, b = 6 and c = 27. Then, the proposition claims that for any integers x and
y, 3 | (6x + 27y). That is, 3 divides any linear integer combination of 6 and 27. You might
say, Thats obvious. Just take a common factor of 3 from 6x + 27y. That is
That observation is very suggestive of the proof of the Divisibility of Integer Combinations.
The very first thing to do when proving a statement is to explicitly identify the assumptions
and the desired conclusion. Lets do that for Divisibility of Integer Combinations (DIC).
Assumptions: a, b, c Z, a | b and a | c.
Since we are proving an implication, not using it, we assume that the hypothesis is true,
and then demonstrate that the conclusion is true. You may recognize this straightforward
approach to be a 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, it is best to proceed by asking questions. When
working backwards, we may ask
The answer tells us what to look for or gives us another statement we can work backwards
from. In this case the answer would be
Note that the answer makes use of the definition of divides. Lets record this statement as
part of a proof in progress.
Section 6.3 Discovering a Proof of Divisibility of Integer Combinations 39
Proof in Progress
1. To be completed.
The answer is not obvious so lets turn to working forwards from the hypothesis. In this
case our standard two questions are
We have seen a | b in a hypothesis before. Twice actually, once in the proof of the Tran-
sitivity of Divisibility and once in the prior example. Just as was done in the proof of the
Transitivity of Divisibility, we can use a | b and the definition of divisibility to assert that
2. To be completed.
We also know that a | c so we can use the definition of divisibility again to assert that
3. To be completed.
Hmm, what now? Lets look again at the last sentence. There is a bx + cy in the last
sentence and an algebraic expression for b and c in the first two sentences. Substituting
gives
bx + cy = (ra)x + (sa)y
and factoring out the a gives
Does this look familiar? We factored in our numeric example and we are factoring here.
If we let k = rx + sy then, because multiplying integers gives integers and adding integers
gives integers, k is an integer. Hence, there exists an integer k so that bx + cy = ak. That
is, 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 first make a judgement about the
audience. As with our use of axioms, write for your peers. That is, write your proof so that
you could hand it to a classmate and expect that they would understand the proof.
Proof: Assume that a | b and a | c. 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
definition of divisibility that a | (bx + cy).
Note that this proof does not reflect the discovery process, and it is a direct proof. It begins
with the hypothesis and ends with the conclusion.
Before we leave this proposition, lets consider the significance of the requirement that x
and y are integers. Suppose, as in our numeric example, a = 3, b = 6 and c = 27. If
we choose x = 3/2 and y = 1/4, then bx + cy = 99/2 which is not even an integer! This
simple example emphasizes the importance of the variables x and y being integers in the
conclusion.
Lets 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.)
2. Since b 6= 0, q 6= 0.
3. However, if q 6= 0, |q| 1.
Analysis of Proof As usual, we begin by explicitly identifying the assumptions and the
desired conclusion.
Sentence 2 Since b 6= 0, q 6= 0.
If q were zero, then b = qa would imply that b is zero. So by our rules of inference,
since b is not zero, q cannot be zero.
REMARK
When reading a proof of a proposition, you should attempt to do the following.
1. Identify all the assumptions that have been made. Sometimes the assumptions may
not be explicitly stated in the proof, but you should try to locate them anyway. Quite
often there are mistakes in incorrect proofs because of unjustified assumptions, so
it is a good practice to keep track of all the assumptions and highlight where each
assumption is being used.
2. Record any preliminary material used in the proof, usually definitions or propositions
that have already been proved. As a rule of thumb for MATH 135, in our proofs, we
are allowed to use any definition that has been stated and any result that has been
proven in the duration of the course, unless instructed otherwise.
3. Justify each step with reference to the definitions, previously proved propositions or
techniques used. Add missing steps where necessary and justify these steps as well.
If a particular step cannot be justified, then the proof is most definitely incorrect.
4. Identify the core proof technique. Although we have not seen this yet, throughout this
course we will learn several proof techniques and then apply them in different mathe-
matical scenarios. You should try to identify the technique that is being employed in
the proof.
Part II
43
Chapter 7
Introduction to Sets
7.1 Objectives
2. Practice working with sets and set operations: union, intersection and set-difference.
We are now going to improve our understanding of some fundamental concepts. In the next
two chapters, we will discover sets. Sets are foundational in mathematics and appear in
many places.
Definition 7.2.1 A set is a collection of objects. The objects that make up a set are called its elements (or
Set, Element members).
Sets can contain any type of object. 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. The simplest way to describe a set is to explicitly list
all of its elements inside curly braces, {}, and separate individual elements with a comma.
1. {2, 4, 6, 8} lists all the positive even numbers less that 10.
2. {1, 2, {1, 2, 3}} is a set that contains three elements: 1, 2 and the set {1, 2, 3}. Note
that the set {1, 2, 3} is considered a single element of {1, 2, {1, 2, 3}}, even though
{1, 2, 3} contains three elements itself.
44
Section 7.2 Describing a Set 45
4. The set of natural numbers, denoted N, lists all the positive integers starting from 1.
That is,
N = {1, 2, 3, 4, . . .}.
Computer scientists begin counting at 0 so the notation N used in a computer science
context usually means the set of integers 0, 1, 2, 3, . . .. Be sure to note that in MATH
135, we start counting our natural numbers from 1.
It is customary to use uppercase letters (S, T, U , etc.) to represent sets and lowercase letters
(x, y, z, etc.) to represent elements. If x is an element of the set S, we write x S. If x is
not an element of the set S, we write x 6 S.
Definition 7.2.2 The set { } contains no elements and is known as the empty set. We usually use as a
Empty Set symbol for the empty set, that is,
= { }.
REMARK
It is quite common for students to mistake the set {} as the empty set . However, {} is
actually non-empty, it contains as an element! Thus
{} =
6 .
The number of elements in a finite set is called the cardinality of the set. For a set S, we
use |S| to denote its cardinality. For instance, |{, , , }| = 4, |{1, 2, {1, 2, 3}}| = 3 and
|{, {}}| = 2.
The cardinality of the empty set is defined to be zero, i.e., || = 0.
Although small sets can be explicitly listed, many sets are too large to comfortably list all
their elements. You may have noticed this when we introduced N. Fortunately, a lot of sets
can be defined with the help of some common rules that each of their elements must satisfy.
In these cases, we employ set-builder notation which makes use of a defining property of the
set.
46 Chapter 7 Introduction to Sets
When we work with sets, we assume the existence of a very large set, known as the universe
of discourse, usually denoted U, that contains all the objects that we would need in the
context of our work. The universe of discourse is often not explicitly stated, we simply
assume that it exists. For example, in our work on divisibility, we will primarily be concerned
with integers, so it may be safe to assume that the set of integers Z is the universe of
discourse, even when we dont always explicitly say so.
Quite often we will come across sets whose elements satisfy some membership criteria.
The membership criteria of a set S is simply established by a property P (x) that can be
evaluated for all the elements of the universe of discourse, and P (x) is true if and only if x is
an element of S. Thus P (x) is the defining property of the set we are trying to describe.
Definition 7.2.3 Suppose S is a set that has a defining property P (x) for its elements, then the set-builder
Set-builder notation
Notation {x U : P (x)}
is used to describe S. The part of the description following the colon (:) is the defining
property of the set.
Sometimes we use a vertical bar instead of a colon and write {x U | P (x)} to describe S.
However, this can be confusing because we also use a bar to mean divides.
The statement
S = {x U : P (x)}
is read as The elements of S are exactly all the values of x such that P (x) is true.
Sometimes we only write S = {x : P (x)}, assuming that the universe of discourse is implied
by the context. However, we will try to avoid this sloppiness in this course.
REMARK
The membership criteria P (x) mentioned here is an example of an open sentence.
An open sentence is a sentence that contains one or more variables, where
each variable has values that come from a designated set called the domain of the
variable, and
the sentence is either true or false whenever values from the respective domains of the
variables are substituted for the variables.
Of course, by substituting a particular element of the domain in place of the variable in the
open sentence, we get a statement.
For example, x > 0 is an open sentence. If the domain of x is the set of real numbers,
then for a real number, such as , chosen and substituted for x, the sentence > 0 is a
statement.
Section 7.2 Describing a Set 47
{n Z : 2 | n}.
{x R : x2 + 4x 2 = 0}.
{n N : n | 30}.
In calculus, we often use intervals of real numbers. The closed interval [a, b] is
defined as the set
{x R : a x b}.
Thus [1, 2] = {x R : 1 x 2}.
2. When the universe of discourse is not known or named, or sometimes just because it
is more convenient, elements of the set S can be expressed in terms of other variables.
This alternative form of the set builder notation is
{f (x) : P (x)},
where f (x) is a typical element of S that has been expressed in terms of the variable
x, and the defining property P (x) is true if and only if f (x) is an element of S.
{2k : k Z}.
In this example, f (k) = 2k and P (k) is k Z. Here, as we go over all the integer
values of k, the values of 2k give us all the even numbers.
The set of rational numbers, denoted Q, is described by
p
: p, q Z, q 6= 0 .
q
Once again, the elements of Q are fractions of the form pq , where p and q are
integers, and q 6= 0. Observe that when there are multiple defining properties
listed for the variables, we implicitly consider these properties to be connected
by an AND. Also, notice here that some elements have multiple representations
(e.g. 21 = 24 ). This is okay but we dont double count them.
The set described by {x2 : x Z, 0 x 4} can be explicitly listed as
{0, 1, 4, 9, 16}.
48 Chapter 7 Introduction to Sets
Self Check 1 It usually takes some time to get used to the set-builder notation. Check to see whether
you can answer the following question.
In this section we shall review some of the basic set operations that you need to be familiar
with.
Definition 7.3.1 The union of two sets S and T , written S T , is the set of all elements belonging to either
Union set S or set T . Symbolically we write
S T = {x : x S OR x T } = {x : (x S) (x T )}
Note that when we say set S or set T we mean the mathematical use of OR. That is, the
element can belong to S, T or both S and T .
Definition 7.3.2 The intersection of two sets S and T , written S T , is the set of all elements belonging
Intersection to both set S and set T . Symbolically we write
S T = {x : x S AND x T } = {x : (x S) (x T )}
Definition 7.3.3 The set-difference of two sets S and T , written S T (or S \ T ), is the set of all elements
Set-Difference belonging to S but not T . Symbolically we write
S T = {x : x S AND x 6 T } = {x : (x S) (x 6 T )}
Section 7.4 Set Operations - Unions, Intersections and Set-Differences 49
Definition 7.3.4 Relative to a universal set U, the complement of a subset S of U, written S, is the set of
Set Complement all elements in U but not in S. Symbolically, we write
S = {x : x U AND x 6 S} = {x : (x U) (x 6 S)}
Example 5 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 and F be the set of integers divisible
by five.
1. Describe T by explicitly listing the set and by using set-builder notation in at least
two ways.
Solution:
1. Explicitly listing the set gives T = {3, 6, 9, 12}. Two set-builder descriptions of the
set are T = {n N : 3 | n, n 12} and T = {3k : k N, 3k 12}.
2. There are several choices possible. For example, 1 is not in T and also not in F .
2. A = {x R | sin x = 0, 2 x 2} and
B = {x R : cos x = 0, 2 x 2}
Suppose S and T are two sets. We have already seen several ways to combine S and T to
form a new set. Here is another way of doing so:
Each element of S T is an ordered pair of the form (x, y), where the first element of
the pair belongs to S and the second element belongs to T . For two ordered pairs (x, y)
and (a, b) to be equal, we must have x = a and y = b. So, if x 6= y, then the pair (x, y) is
different from the pair (y, x).
Example 6 Let S = {4, 5} and T = {n N : n | 6}. By explicitly listing all the elements of each set,
we have
T = {1, 2, 3, 6},
and so
S T = {(4, 1), (4, 2), (4, 3), (4, 6), (5, 1), (5, 2), (5, 3), (5, 6)}
whereas
T S = {(1, 4), (1, 5), (2, 4), (2, 5), (3, 4), (3, 5), (6, 4), (6, 5)}.
As this example shows, typically
S T 6= T S.
REMARK
We note the following
1. If S = or T = , then S T = .
2. Suppose S and T are finite sets such that |S| = n and |T | = m, where n and m are
natural numbers. Then |S T | = n m.
Given a set S, we can consider collecting all the possible ordered pairs of the elements in
S. The resulting set is the Cartesian product S S.
In an ordered pair, the order in which the elements are listed does matter, so the pair (4, 5)
is distinct from the pair (5, 4). So, for example, when S = {4, 5}, there are four distinct
ordered pairs in S S as demonstrated below:
Example 7 Let T = {n N : n | 6}. The Cartesian product T T is described using the set-builder
notation as
T T = {(n, m) N N : n | 6, m | 6}.
Since there are four elements in T , therefore there are sixteen elements in T T , exhaustively
listed below:
T T ={(1, 1), (1, 2), (1, 3), (1, 6), (2, 1), (2, 2), (2, 3), (2, 6),
(3, 1), (3, 2), (3, 3), (3, 6), (6, 1), (6, 2), (6, 3), (6, 6)}
REMARK
In the previous example, a common error is to try to describe T T as
{(n, n) N N : n | 6}.
However, in the set {(n, n) N N : n | 6}, each pair (n, n) has the same number in
the first and the second coordinates. Thus {(n, n) N N : n | 6} only has these four
elements: (1, 1), (2, 2), (3, 3) and (6, 6) and so it does not consider all possible pairs that can
be formed using the elements of T .
R R = {(x, y) : x R, y R}.
The elements of this set are represented by the points on a two dimensional Cartesian plane,
and the diagonal set contains all the points on the line y = x (see Figure 7.4.1).
8.1 Objectives
2. To learn how to prove that two sets are disjoint, or one is contained as a subset of the
other, or they are equal.
In the previous chapter, we developed some basic understanding of sets and set operations.
In this chapter, we will discuss how to compare two sets. Our main criteria for compar-
ison between two sets might be the amount of overlap between the two sets, that is, the
proportion of elements the sets have in common.
Suppose S and T are two sets that we want to compare. Let us start with a few definitions.
In other words, we say S and T are disjoint when they have nothing in common. For
example, the sets {1, 2, 3} and {5, 6, 7} are disjoint. Similarly {1, 2, 3} is disjoint from the
set {{1}, {1, 2}, {1, 2, 3}}. Finally, note that the empty set is disjoint from every other
set.
If we consider two sets S and T from the same universe U, then they may or may not be
disjoint. When two sets are not disjoint, they share some common elements (i.e., S T 6= ).
In an extreme scenario, it is possible that all the elements of one set, say S, are also shared
by T .
52
Section 8.2 Comparing Sets 53
Definition 8.2.2 A set S is called a subset of a set T , and is written S T , when every element of S belongs
Subset to T .
Proof Method To prove S T , prove the implication: x S = x T . Usually, this is done through a
ST direct proof .
Example 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}.
1. Show that T S.
Solution: We start by assuming that x is an element of T . Therefore, by the defining
property of T , x = n, for some integer n. Since sin(n) = 0 for all integers n, we
know that
f (x) = f (n) = (n)2 1 sin(n) = 0.
Now, the defining property of S is that a real number x belongs to S if and only if
f (x) = 0. Since f (n) = 0, n S. Thus, we have proven that if x T , then x S.
This is equivalent to showing T S.
There are a few more concepts related to subsets that we need to define.
Definition 8.2.3 A set S is called a proper subset of a set T , and written S ( T , if every element of S
Proper Subset belongs to T and there exists at least one element in T which does not belong to S.
54 Chapter 8 Subsets, Set Equality, Converse and If and Only If
REMARK
You may have seen the notation S T being used to denote S is a proper subset of T .
However, this is not universal. Some authors use S T to mean S T as well. To avoid
any potential confusion, we will not be using the notation S T , and will explicitly use
S T or S ( T as needed.
Definition 8.2.4 A set S is called a superset of a set T , and written S T , if every element of T belongs
Superset to S. S T is equivalent to T S.
Example 3
{1, 2, 3, 4} {1, 2, 3}
Definition 8.2.5 As before, a set S is called a proper superset of a set T , and written S ) T , if every
Proper Superset element of T belongs to S and there exists an element in S which does not belong to T .
Example 4
{1, 2, 3, 4} ) {1, 2, 3}
Self Check 1 Let S, T and V be three sets. Check that you can prove: If S T and T V then S V .
Section 8.3 Showing Two Sets Are Equal 55
Definition 8.3.1 We say that two sets S and T are equal, and write S = T , when S T and T S.
Set Equality
According to the definition of set equality, two sets S and T are equal when every element
of S is in T and every element of T is in S. That is, S = T means that for every element
x from the universe of discourse,
is a true statement. More informally, S = T means S and T have exactly the same elements.
1. A (B C) and
2. (B C) A.
To obtain the converse of an implication, we simply switch the places of the hypothesis and
the conclusion.
REMARK
It is a common mistake for beginning mathematicians to assume that A = B and
B = A are the same. They are not!
We can use truth tables to show that A = B 6 B = A. Essentially, this means that
the truth values of A = B and B = A are unrelated; when A = B is true, it is
not possible to deduce whether B = A is true or false without knowing the truth values
of the components A and B.
1. For all real numbers x, if x = n, for some integer n, then (x2 1) sin(x) = 0 is
true, but its converse if (x2 1) sin(x) = 0 then x = n for some integer n is not
true.
2. For any integer k, the implication if k is even and 5 | k then 10 | k is true, and the
converse if 10 | k then k is even and 5 | k is true as well.
2. B = A.
To prove this, we must consider both directions. That is, we must prove that if n is even,
then n + 1 is odd and if n + 1 is odd, then n is even. Note that we wont always see such
short simple proofs!
Proof:
=
Assume that n is even. Then n = 2k for some integer k. Hence n + 1 = 2k + 1. That is,
n + 1 is odd.
=
Assume that n + 1 is odd. Then n + 1 = 2` + 1 for some integer `. Hence n = 2`. That is,
n is even.
REMARK
Mathematicians often write definitions like this:
Definition 8.3.4 An integer is a perfect square if and only if it equals k 2 for some integer k.
Perfect Square
The convention is that when if is used in this way in a definition, it really means if and
only if. Since this is so common, we will sometimes begrudgingly adopt this norm in this
course.
58 Chapter 8 Subsets, Set Equality, Converse and If and Only If
Sometimes, we can also use a chain of true if and only if statements to prove a statement
is true. Recall the following proposition from an earlier chapter.
Our attempted direct proof of this result failed because it began by implicitly assuming the
statement to be proved was true. Instead, we can continually write equivalent statements:
x2 + 1 2x x2 2x + 1 0
(x 1)2 0.
Since the square of any real number is never negative, the last statement is true. Hence all
the equivalent statements including x2 + 1 2x are true for all real numbers x.
This proof technique is succinct and correct. However, it requires the reader to check that
each step is correct in both directions. For example, above, the reader must verify that
x2 2x + 1 0 = (x 1)2 0 and that (x 1)2 0 = x2 2x + 1 0. As it is
in this case, the reversibility of each step should be easy to verify. Sometimes, a step is
only true in one direction! Other times it is true in both directions but this is unclear and
further justification is required. There may also be a large number of steps involved. So,
we often advise novice proof writers to write out both directions separately.
1
|x + 3| < 2 if and only if |4x + 13| < 3.
An erroneous proof is provided below. Clearly state the fundamental error in the argument
and explain why it is an error.
Proof Method Given sets S and T , there are two logically equivalent ways to prove that S = T :
S=T
Mutual Inclusion: Show that each of the set relations S T and T S is true.
Chain of If and Only If Statements: Show, through a chain of true if and only if state-
ments, that (x S) (x T ) is a true statement for every x from the universe
of discourse.
We present two proofs of the same statement about sets. The first uses mutual inclusion
and the second uses a chain of if and only if statements.
A (B C) = (A B) (A C)
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).
REMARK
Notice that we used cases to help with our proof. An arbitrary element x is either in a set
or not in a set. This can often be used to help with a condition like x A B.
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)) definition of union
(x A) ((x B) (x C)) definition of intersection
((x A) (x B)) ((x A) (x C)) Distributive Law of logic
(x A B) (x A C) definition of union
x ((A B) (A C)) definition of intersection
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 different things.
Self Check 2 Let a, b, c R, a 6= 0 and b2 4ac 0. Check that you can prove the statement:
b b2 4ac
Proposition 3 The solutions to the quadratic equation ax2 + bx + c = 0 are x = 2a .
Consider the approach outlined in this section. Define two sets S and T to be
( )
2
b b2 4ac
S = x R | ax + bx + c = 0 and T = x R | x = .
2a
Demonstrate that S = T .
Chapter 9
Quantifiers
9.1 Objectives
9.2 Quantifiers
This chapter is devoted towards the final piece of the puzzle required to construct well-
formed mathematical statements involving variables. Let us recall some of the statements
that we have seen so far:
The above sentences are examples of quantified statements. Each of the statements above
contain a variable, and each variable has been introduced through a phrase such as for
every, for any, there exists, there is, etc. Such phrases are called quantifiers, and
they give us some information about how to assess whether the statements are true or false.
The role of a quantifier is to develop a sense of how many elements of a given domain
satisfy a given property. In English, words such as all, some, many, none, few,
etc., are used in quantification. In this course, we will only be interested in two types of
quantifiers: universal and existential. A universal quantifier (e.g., for all) generalizes
a property for all elements of a given domain, while an existential quantifier (e.g., there
exists) demands that the property be satisfied by at least one element from the domain.
62
Section 9.3 Quantifiers 63
REMARK
All statements which use quantified variables share a basic structure:
It is crucial that you be able to identify the four parts in the structure of quantified state-
ments.
Example 1 Here are some examples of statements with quantified variables. We have identified the four
key parts of each statement.
The universal quantifier, denoted by the symbol , is used to indicate that all elements
of a set satisfy a common property. Thus the statement
x S, P (x),
indicates that all members of the set S satisfy the given property P . We read the above
statement as For all x in S, P (x) is true or simply as For all x in S, P (x).
Example 2 Suppose T is a subset of the letters of the English alphabet, given by T = {i, o, u}. Consider
P (x) to be the open sentence x is a vowel. Then x T, P (x) is a true statement as each
of the statements P (i), P (o) and P (u) is true. Notice that this means that P (i)P (o)P (u)
is a true statement as well.
REMARK
In general, given a finite set S = {x1 , x2 , x3 , . . . , xn }, the statement x S, P (x) is
logically equivalent to P (x1 ) P (x2 ) P (x3 ) P (xn )
When the domain is empty, i.e., S = , then regardless of what the open sentence P (x)
says, the statement x , P (x) is said to be vacuously true.
Example 3 Consider the open sentence P (x) given by x2 0. The statement x R, P (x), or
equivalently, x R, x2 0, is a true statement.
In addition to the standard sentence: For all x in R, x2 0, we also often use the
following sentences in English to convey the same meaning as x R, x2 0.
1. For every x R, x2 0.
2. Any x R satisfies x2 0.
3. Let x be a real number. Then x2 0.
4. The square of every real number is non-negative.
Here is another example of how we may use the universal quantifier. You may be familiar
with the following definition of a prime number.
Definition 9.3.1 An integer p > 1 is called a prime if and only if its only positive divisors are 1 and p itself.
Primes Otherwise, p is called composite.
Note how the universal quantifier is being used to convey the condition about the only
positive divisors of p are 1 and p by looking at all the positive integers k that divide p
and inferring that k must be 1 or p.
Section 9.4 The Universal Quantifier 65
Let us now discuss how to prove that a statement of the form x S, P (x) is true.
We want to justify that each element of S satisfies the property P (x). One way to do so
would be to go through each and every element of S, and check that the open sentence P
is evaluates to true for each member of S.
However, it is easy to see that this process could get tiresome when S has a lot of elements,
perhaps infinitely many, and we have to carefully check that the open sentence is true for
each element of S. Instead, we use the select method.
N = {1, 2, 3, 4, 5, . . .}.
The existential quantifier, denoted by the symbol , is used to express the idea that at
least one element of a given set satisfies a given property. We read the statement
x S, P (x)
as There exists at least one value of x in S for which P (x) is true or simply as There
exists x in S such that P (x).
Here are some other ways in which the statement x S, P (x) is expressed in written
English:
x [0, 2], x2 1 = 0
could be read as The value of x2 1 is 0 for some x between 0 and 2 (inclusive). However,
the standard way to read the above statement is to say There exists an x in the interval
[0, 2] such that x2 1 = 0.
k Z, m = kn.
REMARK
In general, given a finite set S = {x1 , x2 , x3 , . . . , xn } with n-elements, we have
The statement x S, P (x) is true if and only if we can find at least one element from the
set S that satisfies the property P , which happens if and only if P (x1 ) P (x2 ) P (xn )
is a true statement.
Note that x S, P (x) would be a false statement when there are no elements of x
that satisfy the property P . This implies that when the domain is empty, the statement
x , P (x) is vacuously false.
Section 9.4 The Existential Quantifier 67
Note that 4 is also an even number from the domain, so we could have chosen x = 4 as
well. However, all we need to do is find one element from the domain that satisfies the
given property. So once we find one value that works, such as x = 2, we dont need
to concern ourselves with whether other elements of the domain satisfy the property
or not.
2. There is a real number [0, 2] such that sin = cos .
Proof: Consider = . Clearly, [0, 2]. Since
4
1 1
sin = sin = and cos = cos =
4 2 4 2
sin = cos as required.
Let us provide some more insights into how to use the construct method. In particular, if
we look back at the previous example, how did we manage to obtain the values from the
corresponding domain that seem to magically satisfy the required property? There are two
ways to find such values as discussed below.
1. By Trial and Error : We could attempt to substitute each element of the domain for
x in the open sentence until we find one that works. This approach works well when
the domain is small, and it is easy to verify whether the property is true or false for
each domain element.
For instance, when S = {1, 2, 3, 4} and P (x) is the statement x is even, we can
simply exhaustively examine each of the numbers 1, 2, 3 and 4 until we find an even
number. So, we try x = 1 and find that P (1) is false. We then move onto x = 2, find
P (2) is true, and may immediately conclude that x S, P (x) is a true statement.
When we write down the final proof, we do not need to demonstrate all the values
that we tried, but just use the one that we found to work.
2. By using preliminary knowledge about what we wish to prove. The method of trial
and error is not such a great idea when we are dealing with infinite domains such as
[0, 2] or [1, 1]. In these cases, we try to use any prior knowledge that we may have
about the open sentence to try to come up with a value that works.
For example, heres a table of special angles for trigonometric ratios that you may
remember from high school:
0 6 4 3 2
0 1 1 2 1 3 4
sin 2 =0 2 = 2 2 = 2 2 2 = 1
3 1 1
cos 1 2 2 2 0
From this table, we notice that sin and cos take the same value when = 4 .
Alternatively, we might note that sin = cos if and only if tan = 1 and come up
with = 4 . Armed with this knowledge, we may now write a formal proof of the
statement there is a real number [0, 2] such that sin = cos . In our proof, we
do not need to mention how we came across the value of = 4 , but just demonstrate
that it works.
Similarly, while proving x2 2 = 3x for some x [1, 1], we may use our knowledge
of quadratic equations. The equation x2 2 = 3x may be written as x2 3x 2 = 0,
and using the quadratic formula to solve for the values of x gives us
p
(3) (3)2 (4)(1)(2) 3 17
x= = .
2 2
Then we can work with inequalities, or possibly use a calculator to compute approxi-
mations, and test if these values are within our our intended interval [1, 1].
REMARK
When we apply our preliminary knowledge in a constructive proof, we usually do it on a
rough piece of paper. The final written proof does not usually contain any reference of
how we obtained the value that works. We simply propose this value for x, make sure the
proposed value is in the domain, and then demonstrate that the property holds for this
value.
Section 9.6 Negating Quantifiers 69
The above suggests that the following rules of negation should apply for quantified state-
ments.
The negation of For all x S, P (x) is true is
That is, using the symbols for the quantifiers, we are saying
[ x S, P (x)] [ x S, (P (x))].
Similarly, the negation of There exists some x S such that P (x) is true is
In other words,
[ x S, P (x)] [ x S, (P (x))].
These rules of negation help us understand the methods for disproving quantified statements.
Self Check 1 Check that you can negate the following statement without using the word not or the
symbol:
If x N, n | x then n = 1.
Proof Method Suppose we assume x S, P (x) is true, and we want to use this assumption in a proof.
Substitution
Method Substitute one or more appropriate values of x from S into the open sentence P (x), and
use the fact that P (x) must be true to arrive at the desired conclusion.
If x [0, ), r2 x then r = 0.
Let p be a real number and k be an integer. Consider the following statement about p and
k:
p
If there exists a non-zero integer q such that q = k, then p must be an integer.
To prove this statement, we assume that non-zero integer q, such that pq = k is true.
Here p and k are integers, but we do not know their numerical values. We will now use the
symbol q as an (hypothetical) object that
p
2. satisfies the equation q = k.
Our goal is to use these properties of q to convince the reader that p must be an integer.
The proof is below.
Proof: We are given that p is a real number and k is an integer. Let us assume that q is
a non-zero integer for which pq = k.
We may now multiply both sides of pq = k by q to get p = qk. Since q and k are both
integers, then qk is also an integer. Hence p must be an integer.
` Z, such that n = 4` + 1.
Our goal is to prove 8 | (n2 1), which is equivalent to proving that k Z, 8k = (n2 1).
Note that when using the object method, we should not use a variable that already exists
in the problem as that can lead to potential confusion and error.
Can you see that we also used the construct method in the above proof?
The next example shows such a mistake in an attempted proof.
72 Chapter 9 Quantifiers
Self Check 3 Discuss what is wrong with the previous attempt at proving the above statement. Either
prove the given statement, or provide a value for each of the variables m, a, b and c such
that the statement is false.
Nested Quantifiers
10.1 Objectives
Most of the statements that we will see in mathematics contain more than one variable.
Each variable must come with its own domain and quantifier. When a statement has more
than one quantified variable, it is important to note the order in which they appear.
For example, consider the following statement containing three variables x, y and z:
x R, y Z, z R, x + y + z = 0.
We read mathematical statements from left to right. If a statement contains more than one
quantified variable, then we first read the leftmost quantified variable, and regard the rest
of the statement as a property of this variable. Thus, the other quantified variables become
nested within the property of the leftmost variable. We then proceed through the rest of
the statement in a similar manner. Therefore, we may parse the above statement in layers,
like an onion. For instance, we can consider this statement to be of the form
x R, P (x),
73
74 Chapter 10 Nested Quantifiers
It takes a bit of practice to become good at parsing and using nested quantifiers in state-
ments. To start, we will focus on statements that have only two variables. There are four
possible combinations of nested quantifiers to consider. The following examples illustrate
how to prove statements with nested quantifiers.
x+y
Example 1 For all x N, for all y N, 2 xy.
Proof. Let x N and y N. We know that the following algebraic equation is true for all
natural numbers x and y:
(x y)2 = (x + y)2 4xy.
Since N R, (x y)2 0. Thus, we have (x + y)2 4xy 0, which simplifies to
(x + y)2
xy.
4
x+y
Taking the positive square-root on both sides, we get 2 xy.
2. or use the select method on both the variables x and y, show Q(x, y) is true.
Example 2 There exists a positive even integer m such that for every positive integer n,
1 1
1.
m n 2
Proof. The first quantifier is existential, so we must use the construct method. Let m = 2.
Let n be any arbitrary positive integer. We consider three cases.
1
n1 = 12 11 = 12 = 12 .
Case 1. When n = 1, we have m
1
n1 = 21 12 = 0 < 12 .
Case 2. When n = 2, then m
Case 3. When n 3, then 0 < n1 13 < 12 . Thus
1
= = < 1.
1 1 1 1 1
m n 2 n 2 n 2
We note that in each case, the required inequality is satisfied. Thus 12 n1 12 is true
Example 3 For every integer n 2, there exists an integer m such that n < m < 2n.
Proof. Let n be an integer greater than or equal to 2. We need to provide a value of m that
satisfies the property n < m < 2n. As the value of m may depend on n, we will try to
express m in terms of n.
Let m = n + 1. Since n is an integer, n + 1 must also be an integer, therefore m is indeed
an integer.
Notice that m = n + 1 > n. On the other hand, 2n = n + n. We are given that n 2,
therefore n + n n + 2 > n + 1. In other words, 2n > m. Thus, our proposed value of m
satisfies
n < m < 2n.
Example 4 There exists a positive even integer s for which there exists a positive odd integer t such
that 2s + 3t is prime.
Proof. Let s = 2 and t = 1. Then
22 + 31 = 4 + 3 = 7,
REMARK
To disprove a statement involving quantifiers, we usually just prove that the negation of
the statement is true.
1. There exists a non-negative integer k such that for every integer n, k < n.
Solution: The given statement is false. Let k be any non-negative integer. Consider
n = k 1. Then k > n. So we cannot find a non-negative integer k that would satisfy
k < n for all values of n.
2. For every two integers a and c, there exists an integer b such that a + b = c.
Solution: The given statement is true.
1. Suppose S = {1, 3, 5} and T = {6, 14}. For every x S there exists some y T such
that x + y is a prime.
2. There exists a non-negative integer k such that for every non-negative integer n, k < n.
3. There exists a non-negative integer k such that for every positive integer n, k < n.
4. For every non-negative integer n, there exists a non-negative integer k such that k < n.
Section 10.4 Functions and Surjections 77
P : x R y R y 2 2xy + x2 2x + 2y 0,
Q : y R x R y 2 2xy + x2 2x + 2y 0 .
One of the most fundamental notions of modern mathematics is that of a function. You
may be familiar with the concept of functions from studying high school mathematics. We
may formally define functions with the help of nested quantifiers.
Definition 10.4.1 Let S and T be two sets. A function f from S to T , denoted by f : S T , is a rule that
Function, Domain, assigns to each element s S a unique element f (s) T . The set S is called the domain
Codomain, Value of the function and the set T is called the codomain. The element f (s) is called the value
of the function f at s.
Sometimes a picture helps. In this case, Figure 10.4.1 illustrates when a rule is not a
function.
If there exists an element in the domain which maps to more than one element in the
codomain, then the given rule is not a function.
78 Chapter 10 Nested Quantifiers
S T
Suppose f : S T is a function with domain S and codomain T . The set of values that
can be obtained by the function f is a subset of T , known as the image of f . For example,
the familiar function sin x is often defined with domain R, codomain R and image [1, 1].
In special cases, the image of f and the codomain of f may be the same set.
Definition 10.4.2 Let S and T be two sets. A function f : S T is onto (or surjective) if and only if for
Onto, Surjective every y T there exists an x S so that f (x) = y.
10.4.1 Graphically
As with the illustration of a rule that is not function, sometimes a picture helps to illustrate
when a function is not surjective. See Figure 10.4.2.
If there exists an element in the codomain which is not the value of any element in the
domain, then the given function is not surjective.
Section 10.4 Functions and Surjections 79
S T
Proposition 1 Let m 6= 0 and b be fixed real numbers. The function f : R R defined 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.
Sentence 1 Let y R.
The first quantifier in the definition of onto is a universal quantifier 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 satisfied (there exists an x R so
that f (x) = y).
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.
We can begin with the basic proof structure that we discussed earlier.
Proof in Progress
y = x2 + 3
2. Consider x = y 3.
3. Show that x [1, 2]. To be completed.
4. Now we show that f (x) = y. To be completed.
It is not immediately obvious that x [1, 2]. Some arithmetic manipulation with inequalities
helps us here. Since y [4, 7], we know that
4y7
Subtracting three gives
1y34
Now taking the positive square root gives
p
1 y32
and since x = y 3 we have
1x2
which is exactly what we need. We can update our proof in progress.
Proof in Progress
Substitution will give us the last step. Here is a complete proof. Note that techniques are
not named and the steps in the arithmetic are not explicitly justified. These are left to the
reader.
Proof: Let y [4, 7]. Consider x = y 3. Now
p
4 y 7 = 1 y 3 4 = 1 y 3 2 = 1 x 2.
Since
f (x) = x2 + 3 = ( y 3)2 + 3 = y
p
f is onto.
The choice of the domain and codomain for the function is important. Consider the state-
ment
This is very similar to the proposition we just proved, and you might think that the same
proof would work. But it doesnt. Consider the choice y = 0 R. What value of x maps to
0? Since f (x) = x2 + 3 3 for all real numbers x, there is no choice of x so that f (x) = 0,
and Statement 3 is false.
Part III
82
Chapter 11
11.1 Objectives
1. Learn how to prove statements using the contrapositive.
2. Develop proof methods for more complicated implications.
We now have some basic idea about implications and the direct proof method for proving
implications. The recipe for a direct proof is simple: assume that the hypothesis is true
and use it to prove the conclusion. Unfortunately, there are several implications that are
very difficult to prove using a direct proof.
Let us try to prove this implication using a direct proof. If we assume that the hypothesis
x5 3x4 + 2x3 x2 + 4x 1 0 is true, then we have a monstrous polynomial inequality
to deal with. It will be very difficult to try to get information about x from this hypothesis
alone. We must find a better method to solve this problem.
A B A = B B A B = A
T T T F F T
T F F T F F
F T T F T T
F F T T T T
83
84 Chapter 11 Contrapositives and Other Proof Techniques
Example 2 From the previous example, replace the given implication - if x5 3x4 +2x3 x2 +4x1 0,
then x 0 - by its contrapositive
We will now prove this contrapositive using a direct proof. Let us assume that x < 0. Then
x5 < 0, 2x3 < 0 and 4x < 0. In addition, 3x4 < 0, x2 < 0 and 1 < 0. As all the terms
are negative, we add them to get
Since the contrapositive is true, the original implication must be true as well.
Suppose you need to prove the statement A = B. 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. Especially when both A and B contain
negations, it is highly likely that using the contrapositive will be productive.
Another possible motivation for using contrapositive may come from the statements A or
B themselves. If A or B contains a condition that is one of only two possibilities, then the
negation, which indicates the second possibility, may be useful. For example, an integer
can be either odd or even (not both). So if we have a statement about an even integer, the
contrapositive will give us a statement about an odd integer.
In addition to that, we often use the method of contrapositve when the hypothesis of an
implication looks more complicated than the conclusion.
Finally, these are just rules of thumb. There are no rules that tell you exactly when the
contrapositive should be used. However, with practice, you should develop a feel for when
it is a good technique to attempt.
Section 11.2 Proof by Contrapositive 85
Proof: (For reference, each sentence of the proof is written on a separate line.)
3. Substitution gives
4. Since one of the consecutive integers 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 As usual, we begin by identifying the hypothesis and the conclusion.
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.
For the contrapositive
We have seen that the hypothesis and conclusion of an implication can be compound state-
ments. Let us look as some examples that outline the process for proving implications where
the hypothesis or conclusion is of the form (P Q) or (P Q). The logical equivalences
mentioned here can be proved using truth tables.
We have already seen examples where the hypothesis and conclusion include the AND
logical operator. These situations are not actually all that complicated.
Example 3 Look back at our propositions involving divisibility. Our results Transitivity of Divisibility
(TD), Divisibility of Integer Combinations (DIC) and Bounds By Divisibility (BBD) all
involve a hypotheses of the form (A B).
if p2 | qr then p = q and p = r.
1. if p2 | qr then p = q, and
2. if p2 | qr then p = r
are true.
Section 11.3 More Complicated Implications 87
REMARK
Both subproofs in the previous example use the exact same logic, and in fact the second
is a word-for-word rewrite of the first if we simply switch the variables q and r.
In proofs like these, it is redundant to go through both cases. Often, we use the phrase
without loss of generality or the word and only show one case. It is implied that the
other case will be proved in exactly the same way apart from some obvious interchange of
variables. Some authors will write that the second case follows similarly.
We will see this again in the next example.
If a | b or a | c then a | (bc).
2. if a | c then a | (bc)
are true. Notice that the two cases are nearly identical.
Warning: It takes some experience and expertise in mathematics to know when we can
write a proof without loss of generality. It is best to avoid using this if you are not confident
in your approach. In general, it is not correct to prove A = C and immediately conclude
that (A B) = C. A simple example of this is when A is false, B is true, and C is false.
88 Chapter 11 Contrapositives and Other Proof Techniques
If x2 7x + 12 0, then x 3 or x 4.
Proof: (For reference, each sentence of the proof is written on a separate line.)
5. Therefore x 4 as desired.
4. State the negation of Statement 2 without using the word not or the symbol.
Solution: x2 3x + 2 0 [(x < 1) (x > 2)].
Assume that (x < 1) or (x > 2). For a real number x, since x < 1 and x > 2 cannot
be true simultaneously, this gives us two cases to work with.
Case I: Assume x < 1. Note that x2 3x + 2 can be factored as (x 1)(x 2). Since
x < 1, therefore both (x 1) < 0 and (x 2) < 0. Thus, their product (x 1)(x 2)
must be positve. Hence x2 3x + 2 > 0.
Case II: Assume x > 2. Then (x 1) > 0 and (x 2) > 0. Once again, the product
(x 1)(x 2) must be positive, so x2 3x + 2 > 0.
Self Check 1 Analyze the proof above. Make sure to justify each sentence.
Self Check 2 Let U be a universal set containing sets S and T . Consider the following statement.
Statement 3
ST ST
This may be mystifying. How is this connected to the other examples in this chapter? But
lets rephrase the statement as
If x S T , then x S T
or
If x S T , then x S or x T
Now the implication and use of the word or is apparent. Prove this rephrased statement.
Chapter 12
Proofs by Contradiction
12.1 Objectives
Let us begin with a riddle. Suppose a group of three mathematicians and four engineers
are seated at a round table. Assuming there are no empty chairs, is it possible to make sure
that no two engineers sit next to each other?
We may answer the riddle in the following way. Suppose each engineer sits between two
mathematicians. Then there must be a mathematician to the right of each engineer, so
we get that there must be at least four mathematicians at the table. However, the riddle
stipulates that there are three mathematicians in the group, so saying that there are four
or more mathematicians at the table does not make any sense.
We reached a conclusion that must be false. The only way this can happen is if our initial
assumptions was also false, that is, it is not possible for each engineer to sit between two
mathematicians. In other words, we have proven that there must be at least two engineers
who sit next to each other. We have just seen an example of a proof by contradiction.
Definition 12.2.1 Let A be a statement. Note that either A or A must be false, so the compound statement
Contradiction A (A) is always false. The statement A (A) is true is called a contradiction.
In other words, any time we come across an argument that claims both A and A to be
true, we say that there must be a contradiction in the argument.
90
Section 12.2 Proof by Contradiction 91
Suppose that we wish to prove that the statement A implies B is true. To use a contra-
diction, we must assume that (A = B) is true. Hence, our assumption becomes A
is true and B is false. We must now proceed to find a contradiction. Let us demonstrate
this with an example.
We have mostly used the direct method to discover proofs, often in conjunction with one
of the methods associated with quantifiers. There are times when this is difficult. A proof
by contradiction provides a new method. Unfortunately, it is not always clear what
contradiction to find, or how to find it. What is more clear is when to use contradiction.
The general rule of thumb is to use contradiction when the statement NOT B gives you
more useful information that B, the statement you wish to prove. There are typically two
instances when this is useful. The first 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) 6= 0. NOT B is the statement f (x) 6= 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.
92 Chapter 12 Proofs by Contradiction
REMARK
There is a subtle connection between a proof by contrapositive and a proof by contradiction
for an implication A = B. In a proof by contradiction, we would start by assuming
A (B) is true and one possible contradiction to deduce is that A must be false. However,
this is similar to proving the contrapositive B = A.
So a proof by contrapositive may be viewed as a very special instance of a proof by contra-
diction.
Example 2 The integers 2, 3, 5 and 7 are primes and mathematicians use the convention that a number
by itself is a product. The integers 4 = 2 2, 6 = 2 3 and 8 = 2 2 2 have been factored
as products of primes.
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.
3. Since r and s are less than N , they can be written as a product of primes.
Sentence 1 Let N be the smallest integer, greater than 1, that cannot be written as a
product of primes.
The first sentence of a proof by contradiction usually gives the specific form of NOT
B that the author is going to work with. In this case, the author identifies 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 first 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 find the contra-
diction. In this case, the contradiction appears in Sentence 4.
Section 12.2 Proof by Contradiction 93
Sentence 2 Now, 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 non-trivial 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.
REMARK
A subtle point needs to be addressed. In Sentence 1, we choose the smallest integer N from
a set of positive integers. How do we know such an integer exists? When assuming this,
we are actually relying on the well-ordering principle which famously states that every
non-empty set of positive integers contains at least one element.
Discovering a proof by contradiction can be difficult and often requires several attempts at
finding the path to a contradiction. Lets see how we might discover a proof to a famous
theorem recorded by Euclid.
We should always be clear about our hypothesis and conclusion. There is no explicit hy-
pothesis in this case and the conclusion is the statement
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 finite, could we somehow use that assumption to find a
new prime not in our finite list of primes? Our candidate should not have any of the
finite primes as a factor. At this point, it sounds like we need to list our primes.
Proof in Progress
3. To be completed.
4. To be completed.
Clearly N is larger than any of the pi so, by the first sentence, N cannot be in the list of
primes. Thus
Proof in Progress
5. To be completed.
This is where we can find our contradiction. The value N has no non-trivial 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
Proof: Assume that there are only a finite number of primes, say p1 , p2 , p3 , . . . , pn . Consider
the integer N = p1 p2 p3 pn + 1. Since N > pi for all 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 13
13.1 Objectives
2. Prove the uniqueness of the quotient and the remainder from the Division Algorithm.
13.2 Introduction
1. Demonstrate that there is at least one object in the set S that satisfies P (X).
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. Demonstrate that there is at least one object in the set S that satisfies P (X).
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.
96
Section 13.4 Showing X = Y 97
13.3 Showing X = Y
1. Demonstrate that there is at least one object in the set S that satisfies P .
2. Assume that there are two objects X and Y in the set S such that P (X) and P (Y )
are true.
3. Show that X = Y .
Proposition 1 If a and b are integers with a 6= 0 and a | b, then 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 first, we need to show that at least one integer k
exists, and this follows immediately from the definition of divisibility.
Proof in Progress
2. Let k1 and k2 be integers such that b = k1 a and b = k2 a. (Note how closely this
follows the standard pattern where k1 corresponds to X, and 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 .
k1 a = k2 a
k1 = k2
Proof: Since a | b, by the definition of divisibility there exists an integer k 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 the non-zero value a gives k1 = k2 .
98 Chapter 13 Uniqueness, Injections and the Division Algorithm
1. Demonstrate that there is at least one object in the set S that satisfies P .
2. Assume that there are two distinct objects X and Y in the set S such that P (X)
and P (Y ) are true.
3. Derive a contradiction.
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
y1 = m1 x1 + b1 (13.1)
y2 = m1 x2 + b1 (13.2)
y1 y2 = m2 (x1 x2 )
Section 13.5 One-to-one (Injective) 99
(m1 m2 )(x1 x2 ) = 0
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.
You may already be familiar with the concept of one-to-one functions, also known as injec-
tions. Let us now write a formal definition of one-to-one functions.
Definition 13.5.1 Let S and T be two sets. A function f : S T is one-to-one (or injective) if and only if
One-to-one, for every x1 S and every x2 S, f (x1 ) = f (x2 ) implies that x1 = x2 .
Injective
We should be able to recognize that the definition above contains the concept of uniqueness,
although it is not spelled out explicitly. In particular, according to the above definition, a
function f is one-to-one if and only for a given element y from the image of f , there is a
unique x S such that y = f (x).
Lets work through an example. Notice how closely the proof follows the structure of a
uniqueness proof.
Proposition 3 Let m 6= 0 and b be fixed real numbers. The function f : R R defined by f (x) = mx + b
is one-to-one.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Let x1 , x2 S.
Sentence 1 Let x1 , x2 R.
The author combines the first two sentences of the structure of a one-to-one proof into
a single sentence. This works because both of the first two quantifiers in the definition
are universal quantifiers and so the author uses the select method twice. That is, the
author chooses elements x1 and x2 in the domain R. The author must now show that
the open sentence is satisfied. That is, f (x1 ) = f (x2 ) implies that x1 = x2 .
Sentence 4 Subtracting b from both sides and dividing by the non-zero m gives x1 = x2 as
required.
Here the author confirms that the open sentence is satisfied. Observe that the hy-
pothesis m 6= 0 is used here.
We can begin with the basic proof structure that we discussed earlier.
Proof in Progress
The obvious starting point is to write down f (x1 ) = f (x2 ) and see if algebraic manipulation
can take us to x1 = x2 . And that is indeed the case.
We need to be careful here since x21 = x22 does not generally imply x1 = x2 . For example,
x1 = 5 and x2 = 5 satisfy x21 = x22 but not x1 = x2 . However, in this case because
the domain is [1, 2] we are justified in taking the positive square root and concluding that
x1 = x2 . Here is a complete proof.
Proof: Let x1 , x2 [1, 2]. Suppose that f (x1 ) = f (x2 ). But then x21 + 3 = x22 + 3 and
so x21 = x22 . Since x1 , x2 [1, 2] we can take the positive square root of both sides to get
x1 = x2 .
Just as with onto functions, the choice of the domain and codomain for the function is
important. Consider the statement
This is very similar to the proposition we just proved, but this statement is false. It is easier
to see why by working with the contrapositive of f (x1 ) = f (x2 ) x1 = x2 . Recall that the
contrapositive is logically equivalent to the original statement. For one-to-one functions, we
can make the following statement which is equivalent to the definition.
Statement 6 Let S and T be two sets. A function f : S T is one-to-one (or injective) if and only if
for every x1 S and every x2 S, if x1 6= x2 , then f (x1 ) 6= f (x2 ).
13.5.2 Graphically
As with the illustration of a function that is not surjective, sometimes a picture helps to
illustrate when a function is not injective. See Figure 13.5.1.
If there exists an element in the codomain which is the value of more than one element in
the domain, then the given function is not injective.
102 Chapter 13 Uniqueness, Injections and the Division Algorithm
S T
In this section, we will see the partial proof of an important proposition about divisibility
of integers.
a = qb + r where 0 r < b
If the statement of Division Algorithm, the integer a is called the dividend and b is called
the divisor. The corresponding q is called the quotient and r is called the remainder.
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.
Proof: (For reference, each sentence of the proof is written on a separate line.)
4. (q1 q2 )b = r2 r1 .
5. Hence b | (r2 r1 ).
Sentence 4 (q1 q2 )b = r2 r1 .
This follows from equating a = q1 b + r1 and a = q2 b + r2 .
b r2 r1 < b.
Simple Induction
14.1 Objectives
1. Learn how to use sum and product notation, and recognize recurrence relations.
14.2 Notation
Suppose we had 10 spheres of radii from 1 to 10 and wanted the total volume? How would
we express this? What if there were 100 spheres? It helps to have notation for this. This
section introduces sum, product and recursive notation that you may not be familiar with.
12 + 22 + 32 + + 102
10
X
In mathematics, a more compact notation is used often: i2 .
i=1
xm + xm+1 + xm+2 + + xn
P
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 notation means that the index i begins with an initial
value of m and increments by 1 stopping when i = n. The index of summation is a dummy
variable and any letter could be used in its place.
104
Section 14.2 Notation 105
Example 1
7
X
i2 = 32 + 42 + 52 + 62 + 72
i=3
3
X
sin(k) = sin(0) + sin() + sin(2) + sin(3)
k=0
n
X 1 1 1 1
2
= 1 + + + + 2
i 4 9 n
i=1
1. Multiplying by a constant
n
X n
X
cxi = c xi where c is a constant
i=m i=m
n
X n
X n
X
xi yi = (xi yi )
i=m i=m i=m
The first two properties tell us that summation is linear. They require indices with the
same upper and lower bounds. The last property allows us to change the bounds of the
index of summation, which is often useful when combining summation expressions.
xm xm+1 xm+2 xn
Q
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 2 n
Y 1 1 1 1 1
1 2 = 1 1 1 1 2
i 4 9 16 n
i=2
You are accustomed to seeing mathematical expressions in one of two ways: iterative and
closed form. For example, the sum of the first n integers can be expressed iteratively as
1 + 2 + 3 + + n
or in closed form as
n(n + 1)
2
There is a third way.
Definition 14.2.3 A recurrence relation is an equation that defines a sequence of numbers and which is
Recurrence Relation generated by one or more initial terms, and expressions involving prior terms.
f (1) = 1 and
f (n) = f (n 1) + n for n > 1
You are probably familiar with the Fibonacci sequence which is a recurrence relation.
Definition 14.3.1 An axiom of a mathematical system is a statement that is assumed to be true. No proof
Axiom is given. From axioms we derive propositions and theorems.
Sometimes axioms are described as self-evident, though many are not. Axioms are defining
properties of mathematical systems. The Principle of Mathematical Induction is one such
axiom.
Induction is a common and powerful technique and should be a consideration whenever you
encounter a statement of the form
Base Case Verify that PP (1) is true. Usually, we prove that a relation (for example, an
equality such as ni=0 2i = 2n+1 1, or an inequality such as 3n > n2 , or divisibility
such as 4 | (5n 1), etc.) holds true for n = 1. The typical approach in such a case is
to substitute n = 1 on the left side and also on the right side of the relation separately,
and show that you can obtain the same number or expression from both sides. This
is usually easy, but 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).
Note that we are using the select method on k, so it is important to mention that
P (k) is assumed true for some k N. If the assumption stated P (k) is true for all
k N, then the whole proof would fall apart.
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.
108 Chapter 14 Simple Induction
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 indefinitely. That is
Our first example is very typical and uses an equation containing the integer n.
Proof: We begin by formally writing out our inductive statement. Let P (n) be the state-
ment:
n
X n(n + 1)(2n + 1)
i2 = .
6
i=1
Base Case We verify that P (1) is true where P (1) is the statement
1
X 1(1 + 1)(2 1 + 1)
i2 = .
6
i=1
As in most base cases involving equations, we can evaluate the expressions on the
left hand side and right hand side of the equals sign. The left hand side expression
evaluates to
X1
i2 = 12 = 1.
i=1
1(1 + 1)(2 1 + 1)
= 1.
6
Since both sides equal each other, P (1) is true.
Inductive Hypothesis We assume that the statement P (k) is true for some integer k 1.
That is, assume
k
X k(k + 1)(2k + 1)
i2 = .
6
i=1
Inductive Conclusion Now we show that the statement P (k + 1) is true. That is, we
show
k+1
X (k + 1)((k + 1) + 1)(2(k + 1) + 1)
i2 = .
6
i=1
Section 14.3 Principle of Mathematical Induction 109
This is the difficult 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
leftovers. Thats what we will do here.
k+1 k
!
X X
2
i + (k + 1)2
2
i = (partition into P (k) and other)
i=1 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
2
(k + 1) 2k + 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 the Principle of Mathematical
Induction.
Lets be very clear about what our statement P (n) is. Let P (n) be the statement
Sn has 2n subsets.
Proof: Base Case We verify that P (1) is true where P (1) is the statement
S1 has 2 subsets.
Note that S1 = {1}. 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.
That is, we assume
Sk has 2k subsets.
Inductive Conclusion Now show that the statement P (k + 1) is true. That is, we show
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 of Sk . Further, 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 the Principle of Mathematical
Induction.
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 (k) P (k + 1) . . .
this is also induction. Perhaps this is not surprising because we can always recast a state-
ment For every integer n b, P (n) as an equivalent statement For every integer m 1,
P (m). For example,
is equivalent to
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.
As usual, lets be very clear about what our statement P (n) is. Let P (n) be the statement
n2 > 2n + 1.
Proof: Base Case We verify that P (3) is true where P (3) is the statement
32 > 2(3) + 1.
This is just arithmetic as
32 = 9 > 7 = 2(3) + 1.
Inductive Hypothesis We assume that the statement P (k) is true for some integer k 3.
That is, we assume
k 2 > 2k + 1 .
Inductive Conclusion Now show that the statement P (k + 1) is true. That is, we show
(k + 1)2 > 2(k + 1) + 1.
We take the left-hand side and note that
(k + 1)2 = k 2 + 2k + 1 > (2k + 1) + (2k + 1) = 4k + 2 > 2k + 3 = 2(k + 1) + 1.
The first inequality follows from the inductive hypothesis and the second inequality
uses the fact that k > 0.
The result is true for n = k +1, and so holds for all n by the Principle of Mathematical
Induction.
2n > n2 .
Proof: Base Case We verify that P (5) is true where P (5) is the statement
25 > 52 .
This is just arithmetic as
25 = 32 > 25 = 52 .
Inductive Hypothesis We assume that the statement P (k) is true for some integer k 5.
That is, we assume
2k > k 2 .
Inductive Conclusion Now show that the statement P (k + 1) is true. That is, we assume
2k+1 > (k + 1)2 .
We will use the fact that for k 5, k 2 > 2k + 1 which follows from the previous
proposition:
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 the Principle of Mathematical
Induction.
112 Chapter 14 Simple Induction
Proposition 6 A 2n 2n grid of squares with one square removed can be covered by triominoes.
Proof: Base Case We verify that P (1) is true. That is, we verify:
Inductive Hypothesis We assume that the statement P (k) is true for some integer k 1.
That is, we assume:
Note that our inductive hypothesis covers every possible position for the empty square
within the grid.
Inductive Conclusion We now show that the statement P (k + 1) is true. That is, we
show:
A 2k+1 2k+1 grid of squares with one square removed can be covered by
triominoes.
The missing square occurs in one of the four 2k 2k subgrids formed. Well 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. Together with one more triomino in the centre, 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 the
Principle of Mathematical Induction.
REMARK
Outside of this course, proofs can often be difficult to read because of the habits of writing
for professional audiences. In general, 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 assumptions and the goals explicitly.
5. Proofs do not reflect the process by which the proof was discovered.
All of this is often especially true for proofs that use induction. The reader of a proof must
be conscious of the assumptions being made and the desired goal of the proof, fill in the
omitted parts and justify each step.
In this course, we will train towards writing proofs that do not share the points from the
list above. The point is not frustrate the readers of our proofs!
Chapter 15
Strong Induction
15.1 Objectives
Sometimes Simple Induction doesnt work where it looks like it should. We then need to
change our approach a bit. The following example is similar to examples that weve done
earlier. Lets try to make The Principle of Mathematical Induction (POMI) work and see
where things go wrong.
Proposition 1 Let the sequence {xn } be defined by x1 = 0, x2 = 30 and xm = xm1 + 6xm2 for m 3.
Then
xn = 2 3n + 3 (2)n for all n 1.
The proposition is saying that the closed form of xn agrees with the recursive definition.
This seems like a classic case for induction since the conclusion clearly depends on the
integer n. Lets begin with our statement P (n):
xn = 2 3n + 3 (2)n .
Base Case We verify that P (1) is true where P (1) is the statement
x1 = 2 31 + 3 (2)1 .
From the definition of the sequence x1 = 0. The right side of the statement P (1)
evaluates to 0 so P (1) is true.
114
Section 15.2 Strong Induction 115
Inductive Hypothesis We assume that the statement P (k) is true for some integer k 1.
That is, we assume
xk = 2 3k + 3 (2)k .
Inductive Conclusion Now we show that the statement P (k + 1) is true. That is, we
show
Now two problems are exposed. The more obvious problem is what do we do with xk1 ?
The more subtle problem is whether we can even validly write the first line. When k + 1 = 2
we get
x2 = x1 + 6x0
and x0 is not even defined.
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 invalidly using the recursive definition. 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.
1. P (1), P (2), . . . , P (b) are true for some positive integer b, and
2. P (1), P (2), . . . , P (k) are all true implies P (k + 1) is true for all k N,
Base Cases Verify that P (1), P (2), . . . , P (b) are all true. This is usually easy.
Inductive Hypothesis Assume that P (1), P (2), . . . , P (k) are true for some k b. This
is sometimes written as Assume that P (i) is true for integers i = 1, 2, 3, . . . , k, for
some integer k b or Assume that P (i) is true for all integers 1 i k, for some
k b.
116 Chapter 15 Strong Induction
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 multiple previous
cases. Though we could use strong induction all the time, it is often confusing to do so.
Lets return to our previous proposition.
Proposition 2 Let the sequence {xn } be defined by x1 = 0, x2 = 30 and xm = xm1 + 6xm2 for m 3.
Then
xn = 2 3n + 3 (2)n for n 1.
xn = 2 3n + 3 (2)n .
Proof: Base Case We verify that P (1) and P (2) are true. Now, P (1) is
x1 = 2 31 + 3 (2)1 .
From the definition of the sequence x1 = 0. The right side of the statement P (1)
evaluates to 0 so P (1) is true. Now, P (2) is
x2 = 2 32 + 3 (2)2 .
From the definition of the sequence x2 = 30. The right side of the statement P (2)
evaluates to 30 so P (2) is true.
Inductive Hypothesis We assume that the statement P (i) is true for all integers 1 i
k, for some k 2. That is, we assume
xi = 2 3i + 3 (2)i .
Inductive Conclusion Now we show that the statement P (k + 1) is true. That is, we
show
xk+1 = 2 3k+1 + 3 (2)k+1 .
Starting with the left-hand side which is valid because k 2 = k + 1 3,
xk+1 = xk + 6xk1 (by the definition of the sequence)
k k k1 k1
= 2 3 + 3 (2) + 6(2 3 + 3 (2) ) (by the Inductive Hypothesis)
= 3k1 [2 3 + 6 2] + (2)k1 [3 (2) + 6 3] (expand and factor)
k1 k1
= 18 3 + 12 (2)
= 2 32 3k1 + 3 (2)2 (2)k1
= 2 3k+1 + 3 (2)k+1
The result is true for n = k + 1, and so holds for all n by the Principle of Strong
Induction.
Section 15.3 Strong Induction 117
As with simple induction, strong induction can have a starting point other than n = 1.
Proposition 3 Every integer n 9 can be written in the form 3x + 4y for non-negative integers x and y.
x y 3x + 4y
3 0 9
2 1 10
1 2 11
4 0 12
3 1 13
2 2 14
There seems to be a pattern. After every group of three integers n, we can generate the
next group of three integers by adding one to the preceding values of x. Since this is a case
where previous values allow us to generate later values, induction may work.
Our first task is to come up with a suitable statement P (n). Let P (n) be the statement
Proof: Base Case We verify that P (9), P (10) and P (11) are true. We repeat the table
above for the required values of 9, 10 and 11. Note that x and y are non-negative
integers.
x y 3x + 4y
3 0 9
2 1 10
1 2 11
Inductive Hypothesis We assume that the statement P (i) is true for all integers 9 i
k, for some k 11. That is, we assume
Inductive Conclusion Now we show that the statement P (k + 1) is true. That is, we
show
The result is true for n = k + 1, and so holds for all n by the Principle of Strong
Induction.
118 Chapter 15 Strong Induction
The result is true for n = k + 1, and so holds for all n by the Principle of Strong
Induction.
REMARK
When using strong induction, we prove the base cases P (1), P (2), . . . , P (b) are true
for some positive integer b. Depending on the nature of the problem, sometimes we
may have b = 1, and proving P (1) is sufficient for the base case. The proof carried
out in the induction conclusion will tell us whether we need more than one base case.
As a rule of thumb, when the induction conclusion is completed, check whether you
can use P (1) to logically deduce that P (2) must be true using solely the procedure
from the induction conclusion step. Then check whether P (1) and P (2) implies P (3),
whether P (1) P (2) P (3) implies P (4), and so on. If this can be consistently done,
then we need only one base case.
REMARK
An interesting, but technical point is that the Well-Ordering Principle (mentioned briefly
in Chapter 12), The Principle of Mathematical Induction and The Principle of Strong
Induction are logically equivalent. That is, nothing can be proven by one of these that
cannot be proven by any of the others.
Chapter 16
Whats Wrong?
16.1 Objectives
Proving statements is hard. Both for beginners and for professionals, it is usually the case
that one needs to make several attempts to prove a given statement. Even when it seems
like a proof has been discovered, errors are common.
This chapter identifies some of the most common errors and gives you practice in detecting
those errors. Being aware of these common errors will hopefully allow you to identify them
and so avoid them in your own work.
Lets assume you are reading a proposed proof of the statement S. How do you go about
assessing whether or not the proof is correct? Here are some questions to ask yourself.
Are there any explicit quantifiers in the statement S? If so, identify the four parts of
the quantifier and the proof technique associated with the quantifier.
How can I justify each sentence in the proof? What definition, previously proved
proposition or proof technique justifies the sentence?
Have any steps been omitted? If so, what should those steps be and what definition,
previously proved proposition or proof technique justifies the omitted step?
120
Section 16.5 Assuming What You Need To Prove 121
To prove an implication, you assume that the hypothesis is true and deduce, by careful
reasoning, that the conclusion is true. It is an extremely common error among beginning
mathematicians to assume that the conclusion is true. Typically the flawed proof begins
by assuming the conclusion and reasons to some true statement. The problem in this case
does not lie with the reasoning, but with the assumption.
Consider the following statement and proposed proof.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Suppose a is even.
The reasoning from Sentence 1 to Sentence 2 is correct. The reasoning from Sentence 2 to
Sentence 3 is correct., and 32 - ((a2 + 3)(a2 + 7)) does appear in the statement we are trying
to prove. But it appears as the hypothesis, not as the conclusion. The problem lies in Step
1 where the author assumed the conclusion, what needed to be proved.
REMARK
When proving an implication, assume that the hypothesis is true and deduce, by careful
reasoning, that the conclusion is true. Do not assume that the conclusion is true.
This common error is related to the previous one in that inadequate attention is paid to
an hypothesis and conclusion. Typically, this error occurs when a proposition is invoked
but the hypotheses for the proposition are not satisfied. Hence, invoking the proposition is
wrong.
Consider the following statement and proposed proof.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Let d | a and d | b.
122 Chapter 16 Whats Wrong?
The statement is false but the proof looks convincing. To see that the statement is false,
consider the case where a = b = d = 3. Since a, b and d are integers, and 3 | 3 the
hypotheses are true. But d = 3 6 0 = |a b| so the conclusion is false.
Sentence 1 simply restates the hypothesis so it is correct. The reasoning from Sentence 1
to Sentence 2 is correct. So, the error lies somewhere in Sentence 3. Recall the statement
of Bounds By Divisibility. We have changed the variable names to make a comparison with
the above statement clearer.
REMARK
Before invoking a proposition, make sure that all of the hypotheses of the proposition are
satisfied.
When you try to prove a statement of the form For every x in the set S, P (x) is true,
you must cover every element in the set S. It is not enough to give a particular example.
Consider the following statement and proposed proof.
Proof: (For reference, each sentence of the proof is written on a separate line.)
The proof shows that in the particular case a = 3 the statement is true. It does not
address the infinitely many other odd cases all of which are included under For every odd
integer a.
Section 16.8 Counter-Examples With An Existential Quantifier 123
REMARK
You cannot use an example to show that a universal statement is true. Use the select
method when you want to prove that a universal statement is true.
When you try to prove a statement of the form There exists an x in the set S such that
P (x) is true, showing that there are elements in S which do not satisfy the statement P (x)
is not useful. There may be many, even infinitely many, elements in S which do not satisfy
P (x). The point is to show that at least one element does satisfy P (x).
Consider the following statement and proposed proof that the statement is false.
Statement 5 There exists an integer in the set S = {10, 11, 12, . . . , 20} such that 2n 1 is prime.
Proof: (For reference, each sentence of the proof is written on a separate line.)
3. But since 1023 = 3 341, 210 1 is not prime and the statement is false.
The proof shows that in the particular case n = 10 the statement is false. However, the
statement does not claim that all of the elements of S have the property that 2n 1 is
prime. The statement only claims that one element in the set S has such a property. In
fact, there is an element with that property, n = 13.
REMARK
You cannot use a counter-example to show that an existential statement is false. To show
that an existential statement is false, negate the statement to get a universal statement and
then use the select method to prove that this universal statement is true. To show that an
existential statement is true, use the construct method.
We see in the example below that using the same variable for different objects can lead to
an incorrect conclusion.
124 Chapter 16 Whats Wrong?
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Assume a | b and a | c.
4. Therefore b c = ka ka = 0.
There is no reason to believe that dividing b by a gives the same quotient as when dividing
c by a. Assuming this leads to a false statement.
REMARK
When using the object method on multiple existential quantifiers, use a new variable for
each quantifier.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Suppose a is even.
REMARK
To prove A B, you can prove the contrapositive B A which is logically equivalent
to A B. Proving or disproving the converse, B A, is not helpful.
If P (1) is false, the chain of reasoning fails. Thus, it is always important to establish the
base case in induction.
Consider the following statement and proposed proof.
Proof: (For reference, each sentence of the proof is written on a separate line.)
2. Assume that P (k) is true for some integer k 1. That is, k > k + 1 for some integer
k 1.
5. Since the result is true for n = k +1, it holds for all n by the Principle of Mathematical
Induction.
This induction fails because we did not verify that P (1) is true. In fact, P (1) is not true in
this case. One is not greater than two.
REMARK
When doing induction, always verify the base cases.
It may be that the structure of a proof is correct, but the proof stumbles while doing compli-
cated arithmetic or not properly treating unusual cases. Consider the following statement
and proposed proof.
126 Chapter 16 Whats Wrong?
1
Statement 9 If r is a positive real number with r 6= 1, then there is an integer n such that 2 n < r.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1
1. Let n be any integer with n > .
log2 (r)
1
2. It then follows that < log2 (r).
n
1
3. Hence 2 n < 2log2 (r) = r.
Because the error in this proof is more subtle than others we have looked at, lets do a
formal analysis of the proof.
Analysis of Proof As usual, we begin by identifying the hypothesis and the conclusion.
An interpretation of Sentences 1 through 3 will follow.
Even the analysis looks good. What went wrong? Lets look again at Sentence 2. Here we
used the statement
Section 16.12 Not Understanding a Definition 127
A proof seems pretty straightforward divide both sides of a < b by ab. Except that
the statement is false. Consider the case a = 2 and b = 4. 2 < 4 but 41 2
1
. Our
proposition really should be
Now we see the problem in the 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
satisfied but Sentence 2 fails.
This is the most common error in our experience, and that is not surprising. Even great
mathematicians have had difficulty with definitions. In the historical development of math-
ematics, correct definitions often come well after the associated mathematics has been used.
Cauchys definition of a limit came two hundred years after Newtons description of
calculus.
Consider the following statement and proposed proof.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Assume n = k 3 + 1, where k N.
The problem is in step 3, which misses important parts of the definition of a prime.
Definition 16.12.1 An integer p > 1 is called a prime if and only if its only positive divisors are 1 and p itself.
Primes
To convince the reader that n is not a prime, it is insufficient to factor n as (k+1)(k 2 k+1).
We also need to show that these factors of n are positive and are different from 1 and n.
REMARK
Know your definitions.
Part IV
128
Chapter 17
17.1 Objectives
Definition 17.2.1 Let a and b be integers, not both zero. An integer d > 0 is the greatest common divisor
Greatest Common of a and b, written gcd(a, b), if and only if
Divisor
gcd(24, 30) = 6
gcd(17, 25) = 1
gcd(12, 0) = 12
gcd(12, 12) = 12
Definition 17.2.2 For a 6= 0, the definition implies that gcd(a, 0) = |a| and gcd(a, a) = |a|. We define gcd(0, 0)
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|.
129
130 Chapter 17 The Greatest Common Divisor
Proposition 1 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? Lets try the usual approach: identify the hypothesis and
conclusion, and begin asking questions.
It is often a good idea to start with the conclusion and works backward. What is a suitable
first question? How about How do we show that two integers are equal? There are lots
of possible answers: show that their difference is zero, their ratio is one, each is less than or
equal the other. However, here we are working with greatest common divisors rather than
generic integers so perhaps a better question would be How do we show that a number
is a greatest common divisor? The broad answer is relatively easy. Use the definition of
greatest common divisor. After all, right now it is the only thing we have! A specific 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 statements in our proof.
Proof in Progress
2. To be completed.
But how do we show that d = gcd(b, r)? Use the definition. Our proof can expand to
Proof in Progress
2. We will show
3. To be completed.
For the first part of the definition, we ask How do we show that one number divides another
number? Interestingly enough, there are two different 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 first
sentence. Since d = gcd(a, b), we know from the definition of gcd that d | b.
What about r? Using the definition of divisibility seems problematic. What propositions
could we use? Transitivity of Divisibility doesnt seem to apply. How about using the
Divisibility of Integer Combinations? Recall
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. Lets
extend our proof in progress.
Proof in Progress
2. We will show
5. To be completed.
That leaves us with the greatest part of greatest common divisor. This second part of the
definition 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 doesnt seem
to be anything obvious but ask Have I seen this anywhere before?. Yes, we have. In the
second part of the definition of gcd. But then you might ask Isnt that assuming what we
have to prove? Lets 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. Make sure that you see the difference.
In one, we are using the fact that d = gcd(a, b). In the other, we are showing that any
common factor of b and r is less than or equal to d.
If we assume that c | b and c | r, then c | (b(q)+r(1)) by Divisibility of Integer Combinations
(again). Since a = qb + r, c | a. Combining, d = gcd(a, b) and c | a and c | b, gives c d as
needed. Lets add that to our proof in progress.
132 Chapter 17 The Greatest Common Divisor
Proof in Progress
Having discovered a proof, we should now write the proof. Notice that in our written proof
below, we begin by clearly making our audience aware of our plan.
Proof: Let d = gcd(a, b). We will use the definition 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. Since d = gcd(a, b) and c | a and c | b, we have
c d. Hence d = gcd(b, r).
REMARK
1. Notice that q and r are not restricted as in the statement of the Division Algorithm.
2. If a = b = 0 this proposition is also true since the only possible choices for b and r are
b = r = 0. As a result we name and use the following more general proposition.
Suppose we wanted to compute gcd(1386, 322). We could factor both numbers, find their
common factors and select the greatest. In general, this is very slow.
Repeated use of GCD With Remainders allows us to efficiently compute gcds. For example,
lets compute gcd(1386, 322).
Example 5
Since 1386 = 4 322 + 98, gcd(1386, 322) = gcd(322, 98).
Since 322 = 3 98 + 28, gcd(322, 98) = gcd(98, 28).
Since 98 = 3 28 + 14, gcd(98, 28) = gcd(28, 14).
Since 28 = 2 14 + 0, 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.
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. Youll 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 certificate of correctness this way. You are a manager. You
ask one of your staff to solve a problem. The staff member comes back with the proposed
solution and a certificate of correctness that can be used to verify that the proposed solution
is, in fact, correct. The certificate has two parts: a theorem which you have already proved
and which relates to the problem in general, and data which relates to this specific problem.
For example, heres a proposition that allows us to produce a certificate for gcd(a, b).
Our certificate 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 Example 5 above, the proposed greatest common divisor of 1386 and 322 is 14. Our
certificate 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 138610+322(43) =
14, so we can conclude that 14 = gcd(1386, 322).
Here is a proof of the GCD Characterization Theorem.
Proof: (For reference, each sentence of the proof is written on a separate line.)
Analysis of Proof As usual, we will begin by explicitly identifying the hypothesis and
the conclusion.
18.1 Objectives
1. Compute the greatest common divisor of two integers and certificates using the Ex-
tended Euclidean Algorithm.
Given two positive integers, a and b, the EEA is an efficient way to compute not only
d = gcd(a, b) but the data x and y for the certificate. Well begin with an example and
then formally state the algorithm.
First though, we need to know what the floor of a number is.
Definition 18.2.1 The floor of x, written bxc, is the largest integer less than or equal to x.
floor
Example 1
1. b9.713c = 9.
2. b9.025c = 9.
3. b9c = 9.
4. b9.713c = 10. Since the floor of x is the largest integer less than or equal to x, 9
cannot be the floor of 9.713 since 9 > 9.713.
7
5. = 3.
2
136
Section 18.2 The Extended Euclidean Algorithm (EEA) 137
Lets compute gcd(1386, 322) using the EEA. We begin by creating four columns labelled
x, y, r (for remainder) and q (for quotient). We will construct a sequence of rows that will
tell us the gcd and provide a certificate. For the i-th row we will label the column entries
xi , yi , ri and qi . There is something very important to observe about the table. If we are
computing gcd(a, b), in each row of the table
axi + byi = ri
x y r q
1 0 a 0
0 1 b 0
x y r q
1 0 1386 0
0 1 322 0
We construct each of the remaining rows by using the two preceding rows. To generate the
third row we must first compute a quotient q3 using the formula
ri2
qi
ri1
Here we get
r1 1386
q3 = = =4
r2 322
To construct the next row we use the formula
When i = 3 we get
Row3 = Row1 q3 Row2
With q3 = 4 we get
Row3 = Row1 4 Row2
Writing this in the table gives
x y r q
Row1 1 0 1386 0
4 Row2 0 1 322 0
= Row3 1 4 98 4
In a similar fashion we get the fourth row. To generate the fourth row we must first compute
a quotient q4 using the formula
ri2
qi
ri1
Here we get
r2 322
q4 = = =3
r3 98
138 Chapter 18 The Extended Euclidean Algorithm
When i = 4 we get
Row4 Row2 q4 Row3
With q4 = 3 we get
Row4 Row2 3 Row3
and so
x y r q
1 0 1386 0
Row2 0 1 322 0
3 Row3 1 4 98 4
= Row4 3 13 28 3
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
greatest common divisor 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).
Section 18.2 The Extended Euclidean Algorithm (EEA) 139
We treat the EEA as a proposition where the preconditions of the algorithm are the hy-
potheses and the postconditions of the algorithm are the conclusions. However, if a or b is
negative, we can apply the EEA with |a| and |b| and convert signs afterwards. Therefore,
the algorithm gives rise to a well known theorem for any integers a and b.
1. Use the Extended Euclidean Algorithm to compute d and provide a certificate that d
is correct.
2. Using part (a) , find d1 = gcd(231, 660) and provide a certificate that d1 is correct.
3. Using part (a) of this question, find d2 = gcd(231, 660) and provide a certificate
that d2 is correct.
140 Chapter 18 The Extended Euclidean Algorithm
Solution:
1.
x y r q
1 0 660 0
0 1 231 0
1 2 198 2
1 3 33 1
7 20 0 6
By the EEA, d = 33. Our certificate consists of the GCD Characterization Theorem
together with d = 33 (d is positive and divides both 660 and 231), and the integers
1 and 3 (since 660(1) + 231(3) = 33).
2. Since gcd(231, 660) = gcd(231, 660), d1 = 33. Our certificate consists of the GCD
Characterization Theorem together with d1 = 33 (d1 is positive and divides both 660
and 231), and the integers 1 and 3 (since 660(1) + 231(3) = 33).
3. Since gcd(231, 660) = gcd(231, 660), d2 = 33. Our certificate consists of the GCD
Characterization Theorem together with d2 = 33 (d2 is positive and divides both 660
and 231), and the integers 1 and 3 (since 660(1) 231(3) = 33).
Proof: Let d = gcd(a, b). We will use the GCD Characterization Theorem and Bezouts
Lemma.
First, we show that cd is a common divisor of ac and bc. Since d = gcd(a, b), d | a. By the
definition of divisibility, there exists an integer k so that dk = a. Multiplying this equation
by c gives cdk = ca. Since k is an integer, cd | ac. Similarly, cd | bc.
Next, we show that there exist integers x0 and y0 so that
acx0 + bcy0 = cd
Since d = gcd(a, b), by Bezouts Lemma, there exist integers x1 and y1 so that
ax1 + by1 = d
acx1 + bcy1 = cd
Letting x0 = x1 and y0 = y1 gives the required values for the GCD Characterization
Theorem.
Chapter 19
Properties Of GCDs
19.1 Objectives
1. Define coprime.
This proposition has two implicit existential quantifiers, one in the hypothesis and one in
the conclusion. You might object and ask Where? They are hidden - in the definition of
divides. Recall the definition. An integer m divides an integer n if there exists an integer k
so that n = km.
We treat an existential quantifier in the hypothesis differently from an existential quantifier
in the conclusion. Recall the following remarks from the chapter on quantifiers.
141
142 Chapter 19 Properties Of GCDs
REMARK
When proving that A implies B and A uses an existential quantifier, use the
object method.
1. Identify the four parts of the quantified 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.
When proving that A implies B and B uses an existential quantifier, use the
construct method.
1. Identify the four parts of the quantified statement. there exists an x in the set S
such that P (x) is true.
3. Show that x S.
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.
Conclusion: c | b.
Core Proof Technique: We use the object method because of the existential quantifier
in the hypothesis, and the construct method because of the existential quantifier in
the conclusion.
Lets work backwards from the conclusion by asking the question How do we show that
one integer divides another? We can answer with the definition of divisibility. We must
construct an integer k so that b = ck. We will record this as follows.
Proof in Progress
1. To be completed.
2. Since b = kc, c | b.
Section 19.2 Some Useful Propositions 143
The problem is that it is not at all clear what k should be. Lets work forwards from the
hypothesis.
Somehow we need an equation with a b alone on one side of the equality sign. We cant
start there but we can get an equation with a b. Since gcd(a, c) = 1, Bezouts Lemma tells
us we can find integers x and y so that ax + cy = 1. We could multiply this equation by b.
Lets record these forward statements.
Proof in Progress
1. Since gcd(a, c) = 1, Bezouts Lemma guarantees that we can find integers x and y so
that ax + cy = 1. Call this equation (1).
3. To be completed.
4. Since b = kc, c | b.
If we could factor the left hand side of (2), wed be able to get a c and other stuff that we
could treat as our k. But the first 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. We record
this as
Proof in Progress
1. Since gcd(a, c) = 1, Bezouts Lemma guarantees that we can find integers x and y so
that ax + cy = 1. Call this equation (1).
4. To be completed.
5. Since b = kc, c | b.
Now factor.
Proof in Progress
1. Since gcd(a, c) = 1, Bezouts Lemma guarantees that we can find integers x and y so
that ax + cy = 1. Call this equation (1).
6. Since b = kc, c | b.
144 Chapter 19 Properties Of GCDs
Here is a proof.
Proof: By Bezouts Lemma 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.
Exercise 1 Prove Primes and Divisibility. Because of the or in the conclusion, you may want to use
the elimination method.
This proposition has similar elements to the one we just proved, so it wont be a surprise if
we use similar reasoning.
REMARK
The important difference 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.
Proof: Since gcd(a, b) = 1, Bezouts Lemma 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
Bezouts Lemma. 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). Bezouts Lemma gives a d so that d | a and d | b, namely
d = gcd(a, b), and also hands us integers x and y so that ax + by = d.
So, if we encounter a greatest common divisor in the conclusion, we can try the GCD
Characterization Theorem. If we encounter a greatest common divisor in the hypothesis,
we can try using Bezouts Lemma.
As we often do, lets get a sense of the proposition by using numeric examples.
a b a b
Example 1 First, observe that gcd , is meaningful. Since d | a and d | b, both and are
d d d d
integers.
Now gcd(18, 24) = 6. By the proposition Division by the GCD,
18 24
gcd , =1
6 6
Proof: We will use the GCD Characterization Theorem. Since gcd(a, b) = d, Bezouts
Lemma assures the existence of integers x and y so that ax + by = d. Dividing by d gives
a b
x+ y =1
d d
a b
Since 1 divides both and and 1 is positive, the GCD Characterization Theorem implies
d d
that
a b
gcd , = 1.
d d
We have now built up a collection of useful results that we can build upon to increase our
understanding of the greatest common divisor.
Example 2 Prove the following proposition. Let a, b Z. For every integer n N, if gcd(a, b) = 1,
then gcd(a, bn ) = 1.
is trivially true.
Inductive Hypothesis We assume that the statement P (k) is true for some integer k 1.
That is, we assume
If gcd(a, b) = 1, then gcd(a, bk ) = 1.
Since gcd(a, b) = 1, Bezouts Lemma tells us that there exist integers x and y so that
ax + by = 1
Since gcd(a, bk ) = 1 by the Inductive Hypothesis, Bezouts Lemma tells us that there
exist integers x0 and y 0 so that
ax0 + bk y 0 = 1
Multiplying the two equations together gives
Let x00 = axx0 + bk xy 0 + bx0 y and y 00 = yy 0 . Since there exist integers x00 and y 00 so
that
ax00 + bk+1 y 00 = 1
we can invoke GCD of One to assert that gcd(a, bk+1 ) = 1.
Example 3 Prove the following proposition. Given any rational number r, prove that there exist coprime
p
integers p and q, with q 6= 0, so that r = .
q
a
Proof: Since r is rational, we can write r as r = where a, b Z and b 6= 0. Let
b
a b
d = gcd(a, b). Since b 6= 0, d 6= 0. Let p = and q = . Since d is a divisor of a and
d d
b, both p and q are integers. Moreover, the proposition Division by GCD assures us that
p
gcd(p, q) = 1. Thus, there exist coprime integers p and q, with q 6= 0, so that r = .
q
Chapter 20
20.1 Objectives
Many of us are familiar with a method for calculating the GCD of positive integers with
the help of prime factorization. For example, given
you may know that you can take the minimum exponent for each prime factor to determine
that gcd(252, 630) = 2 32 7 = 126. In this chapter, we investigate prime numbers
towards formalizing this result.
Definition 20.2.1 An integer p > 1 is called a prime if and only if its only positive divisors are 1 and p itself.
Prime, Composite Otherwise, p is called composite.
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.
148
Section 20.3 Unique Factorization Theorem (UFT) 149
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.
Consider the set S = {a + b 5 | a, b Z}. In S, the
number 4 = 4 + 0 5 can be factored
in two different 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.
That n can be written as a product of prime factors follows is precisely the proposition
Prime Factorization. The key new part of the statement is that apart from the order of
factors, this factorization is unique. What follows is an outline of the proof of uniqueness.
150 Chapter 20 GCD from Prime Factorization
Sketch of Proof:
n = p1 p2 . . . pk = q1 q2 . . . q` (20.1)
2. Since p1 | n, p1 | q1 q2 . . . q` .
3. By repeatedly applying Euclids Lemma, p1 must divide one of the qs. If necessary,
rearrange the qs so that p1 | q1 .
p2 p3 . . . pk = q2 q3 . . . q` (20.2)
6. By continuing in this way, we see that each p must be paired off with one of the qs
until there are no factors on either side.
7. Hence k = ` and, apart from the order of the factors, the two expressions for n are
the same.
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. Why,
however, is the argument labelled as a sketch of a proof? What is not as rock solid as we
would like it to be?
The author is waving his or her hands when writing repeatedly applying and continuing
in this way. How do we know that Euclids Lemma can be applied indefinitely? Are we
sure that we can always continue pairing factors? It may seem obvious to you and some
mathematicians might be lazy and leave the argument as stated above. However, induction
can be used to be fully convincing and meet our standards of rigour.
Self Check 1 Use induction to prove the following generalization of Euclids Lemma for all natural num-
bers n.
Self Check 2 Write a formal rigorous proof of the Unique Factorization Theorem (UFT).
The previous proposition does not provide an algorithm for finding 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.
Section 20.4 Finding a Prime Factor 151
Proof: (For reference, each sentence of the proof is written on a separate line.)
3. Since n is composite we can write n = ab where a and b are integers such that
1 < a, b < n.
Analysis of Proof Since or appears in the conclusion, we will use proof by elimination.
The equivalent statement that is proved is:
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.
The Unique Factorization Theorem tells us that for any integer n 2, if p1 , p2 , . . . , pk are
all the distinct primes that divide n, then we may express
n = p1 1 p2 2 pk k ,
where 1 , 2 , . . . , k N. For example, the prime divisors of 80262 are 2, 3, 7 and 13, and,
in particular, 80262 = 21 32 73 131 .
Note that in the unique prime factorization of 80262, we cannot use primes such as 5, 11
or 17 as they do not divide 80262. However, if we are willing to give up on the uniqueness
of the factorization, then we may write 80262 = 21 32 50 73 110 131 170 . The
key here is that 50 , 110 and 170 are all equal to 1, so their inclusion in the product has not
changed the overall answer. Nevertheless, this has now allowed us to use a larger list of
primes in the factorization of 80262, at the cost of losing the guarantee that these primes
will divide 80262.
In general, given any integer n 2, if we have a large enough list of distinct primes
p1 , p2 , . . . , pm that includes all the prime divisors of n, but may also include primes that
dont divide n, then we are allowed to represent n using all the primes in this list by saying
n = p1 1 p2 2 pmm ,
where 1 , 2 , . . . , m are non-negative integers. The next proposition uses this idea to list
all of the positive divisors of a positive integer.
Section 20.5 Working With Prime Factorizations 153
n = p1 1 p2 2 pk k
is the unique prime factorization of n into powers of distinct primes p1 , p2 , . . . , pk , where the
integers 1 , 2 , . . . , k 1, then d is a positive divisor of n if and only if d can be written
as
d = pd11 pd22 pdkk where 0 di i for i = 1, 2, . . . , k.
After multiplying by p1 , we complete the proof in this direction by the Principal of Strong
Induction.
(1 d1 ) (2 d2 ) ( d )
q = p1 p2 pk k k .
(1 d1 ) (2 d2 ) ( d )
qd = (p1 p2 pk k k )(pd11 pd22 pdkk ) = p1 1 p2 2 pk k = n.
Therefore d | n as required.
154 Chapter 20 GCD from Prime Factorization
72 = 23 32
20 30 = 1 21 30 = 2 22 30 = 4 23 30 = 8
20 31 = 3 21 31 = 6 22 31 = 12 23 31 = 24
20 32 = 9 21 32 = 18 22 32 = 36 23 32 = 72
Exercise 1 Using Divisors From Prime Factorization, list all of the positive factors of 45.
Exercise 2 Show that the number of positive divisors of an integer n, whose unique prime factorization
is
n = p1 1 p2 2 pk k ,
is given by (1 + 1)(2 + 1) (k + 1).
Now that we have a method to obtain all the positive divisors of any positive integer using
its prime factorization, we may expect to use this method to calculate the GCD of two
positive integers say a and b. First, note that given a, b N, since there are infinitely many
primes but only a finite number of prime factors of a and b, we may produce a large enough
list of distinct primes, say p1 , p2 , . . . , pk , that contain all the prime divisors of both a and
b. This provides us with ways to write both a and b, respectively, in terms of the primes
p1 , p2 , . . . , pk as
a = p1 1 p2 2 pk k , and
b = p1 1 p2 2 pk k ,
are ways to express a and b as a product of primes, where the primes are distinct and some
of the exponents may be zero, then
Though this method of finding the GCD works well enough on small examples, but for
larger numbers, this method is very slow and inefficient. Nevertheless, it is an important
theoretical tool that can be used to prove other propositions.
21.1 Objectives
1. Define Diophantine equations.
2. Prove the Linear Diophantine Equation Theorem (Part 1)
In high school, you studied how to find all the real solutions to systems of linear equations.
However, there are many applications where we only want to find the integer solutions. For
example, a variable might represent the number of trucks to use when shipping a product
over large distances.
Definition 21.2.1 Equations with integer coefficients for which integer solutions are sought, are called
Diophantine Diophantine equations after the Greek mathematician, Diophantus of Alexandria, who
Equations 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.
156
Section 21.2 Linear Diophantine Equations 157
Before we study a proof of this theorem, lets see how it works in practice.
1. 33x + 18y = 10
2. 33x + 18y = 15
Solution:
1. Since gcd(33, 18) = 3, and 3 does not divide 10, the first 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 find a solution? Here are two simple steps that will allow us to find a
solution.
1. Use the Extended Euclidean Algorithm to find d = gcd(a, b) and x1 and y1 where
c
2. Multiply Equation 21.1 by k = to get akx1 + bky1 = kd = c. A solution is x = kx1
d
and y = ky1 .
Applying these two steps to Part 2 of the example, the Extended Euclidean Algorithm gives
x y r q
1 0 33 0
0 1 18 0
1 1 15 1
1 2 3 1
6 11 0 5
hence
33 1 + 18 2 = 3
c 15
Multiplying by k = = = 5 gives
d 3
33 5 + 18 10 = 15
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.
ax1 + by1 = d.
c
7. Multiplying this equation by k = gives
d
akx1 + bky1 = kd = c
Analysis of Proof This is an if and only if statement so we must prove two statements.
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 the first statement. Moreover, the first statement uses an existential
quantifier in the hypothesis. The hypothesis of the first statement could be restated
as
Since the existential quantifier 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 assumes that these objects satisfy the related open sentence
(ax + by = c).
Sentence 3 But then, by the Divisibility of Integer Combinations, d | (ax0 + by0 ). That is
d | c.
Since the hypotheses of DIC (a, b and d are integers, and d | a and d | b) are satisfied,
the author can invoke the conclusion of DIC (d | (ax0 + by0 )). From Sentence 1,
ax0 + by0 = c so d | c.
Quantifier:
Variable: x, y
Domain: Z
Open sentence: ax + by = c.
ax1 + by1 = d.
22.1 Objectives
LDET 1 tells us when solutions exist and how to construct a solution. It does not find all
of the solutions. That happens next.
160
Section 22.2 Finding All Solutions to ax + by = c 161
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 verifies that all of the pairs
of integers we have found are solutions.
REMARK
The use of for all in the statement of LDET 2 is common but it means something different
than the universal quantifier. It is arguably better to say as n ranges over all the integers.
In fact, complete integer solution is really hiding the use of sets. A formal solution to
the previous example can be written as {(x, y) : x = 5 + 6n, y = 10 11n, n Z}. This
makes it particularly clear that one solution consists of a value for x and also a value for y.
Moreover, the same n must be used for any one solution.
For the general equation, lets be explicit about what sets are lurking beneath the surface
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 define them formally as follows.
1. S T and
2. T S.
Quantifier:
Variable: s
Domain: S
Open sentence: sT
162 Chapter 22 Linear Diophantine Equations: All Solutions
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, the second statement is easier so we will do it first. How do we show that
T S? We must show that for all x T, x S. We certainly dont 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 first statement.
b a
Let n0 Z. Then x0 + n0 , y0 n0 T.
d d
To show that this element is in S we must show that the element satisfies the defining
property of S, that is, the element is a solution.
b a
ax + by = a x0 + n0 + b y0 n0
d d
ab ab
= ax0 + by0 + n0 n0
d d
= ax0 + by0
=c (by hypothesis, x = x0 and y = y0 is an integer solution)
Now we consider the first statement. How do we show that S T ? We choose a represen-
tative element in S and show that it is in T , that is, that it satisfies the defining property
of T . Specifically, we must show that an arbitrary solution (x, y) has the form
b a
x0 + n, y0 n .
d 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. Lets do the obvious thing and substitute
both solutions into the equation:
ax + by = c
ax0 + by0 = c.
Section 22.2 Finding All Solutions to ax + by = c 163
a(x x0 ) = b(y y0 ).
Now what? We are looking to show that (x, y) T and we see d = gcd(a, b) 6= 0 in the
denominator. This might remind you of Division by the GCD:
a b
(x x0 ) = (y y0 ). (22.1)
d d
a b b a
Using Division by the GCD, gcd , = 1. Since divides (x x0 ) we know from
d d d d
Coprimeness and Divisibility that
b
(x x0 ).
d
b b
x x0 = n x = x0 + n.
d d
b
Substituting n for x x0 in Equation (22.1) yields
d
a
y = y0 n.
d
b a
(x, y) = x0 + n, y0 n
d d
and so
(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.
164 Chapter 22 Linear Diophantine Equations: All Solutions
b a
Proof: Substitution shows that integers of the form x = x0 + n , y = y0 n, n Z are
d 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.
1. 35x + 21y = 28
2. 35x 21y = 28
1. (a) Find all integer solutions to the linear Diophantine equation 36x + 48y = 18.
Solution: Since gcd(36, 48) = 12 and 12 - 18, no solutions exists by LDET 1.
(b) Find all integer solutions to the linear Diophantine equation 36x + 438y = 18.
Solution: First, we apply the EEA to 36 and 438.
y x r q
1 0 438 0
0 1 36 0
1 12 6 12
6 73 0 6
36 (12) + 438 1 = 6.
Section 22.3 More Examples 165
Multiplying by 3 gives
36 (36) + 438 3 = 18
and so x0 = 36 and y0 = 3 is one particular solution to 36x + 438y = 18.
By LDET 2, the complete solution is x = 36 + 73n, y = 3 6n, for all n Z.
(c) Find all positive integer solutions to the linear Diophantine equation 36x+438y =
18.
Solution: Following on from part (b), we are looking for values of n so that
x > 0 and y > 0. That is,
Now
36
36 + 73n > 0 = n > .
73
Since n is an integer, this gives n 1. Also,
3
3 6n > 0 = n < .
6
Since n is an integer, this gives n 0.
There are no integers that simultaneously satisfy n 1 and n 0, so no positive
integer solutions to 36x + 438y = 18 exist.
2. What is the complete solution to the linear Diophantine equation 1950x 770y = 30?
We begin with the EEA applied to 1950 and 770. We will adjust the signs later.
x y r q
1 0 1950 0
0 1 770 0
1 2 410 2
1 3 360 1
2 5 50 1
15 38 10 7
77 195 0 5
3. (From a collection attributed to Alcuin of York in 775 who is known to have sent a
collection of similar problems to Charlemagne.)
One hundred bushels of grain are distributed among one hundred people in such a way
that every man receives three bushels, every woman receives two bushels and every
child receives half a bushel. How many men, women and children are there? (Give all
possible solutions if more than one exists.)
Solution: Let m represent the number of men, w the number of women and c the
number of children. The statement of the problem implies that
m + w + c = 100
3m + 2w + 0.5c = 100.
5m + 3w = 100. (22.2)
One obvious solution to Equation 22.2 is m = 20 and w = 0 and the complete solution
to Equation 22.2 is
m = 20 + 3n
nZ
y = 0 5n
The complete set of solutions for the problem where m, w and c are each non-negative
is enumerated in the table below.
n m w c
0 20 0 80
1 17 5 78
2 14 10 76
3 11 15 74
4 8 20 72
5 5 25 70
6 2 30 68
Chapter 23
Congruence
23.1 Objectives
1. Define 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. Give a proof of Congruence Division.
23.2 Congruences
One of the difficulties in working out properties of divisibility is that we dont have an
arithmetic of divisibility. Wouldnt it be nice if we could solve 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 cen-
turies. In a landmark work, Disquisitiones Arithmeticae, published when Gauss was 23,
he introduced congruence notation and provided a mechanism to treat divisibility with
arithmetic.
Definition 23.2.1 Let m be a fixed positive integer. If a, b Z we say that a is congruent to b modulo m,
Congruent and write
a b (mod m)
if and only if m | (a b). If m - (a b), we write a 6 b (mod m).
REMARK
The three bars used for congruence is the same notation that is used for logical equivalence
even though there is no connection. Unfortunately, mathematicians often use the same
symbol to mean very different things.
167
168 Chapter 23 Congruence
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 6 3 (mod 7)
REMARK
One already useful trait of this definition is the number of equivalent ways we have to work
with it.
a b (mod m)
m | (a b)
k Z such that a b = km
k Z such that a = km + b
Example 2 In each of the following cases, find all values of a, 0 a < m where m is the modulus, that
satisfy the congruence relation.
1. a 52 (mod 12)
2. 14 a (mod 15)
3. 2a 5 (mod 7)
4. 2a 5 (mod 8)
5. 2a 4 (mod 8)
6. a2 1 (mod 7)
Solution:
1. a = 4
2. a = 1
3. a = 6
4. No solution exists
5. a {2, 6}
6. a {1, 6}
Section 23.3 Elementary Properties 169
Another extraordinarily useful trait of this definition is that it behaves a lot like equality.
Equality is an equivalence relation. That is, it has the following three properties:
1. reflexivity, a = a.
2. symmetry, If a = b then b = a.
Most relationships that you can think of do not have these three properties. The relation
greater than fails reflexivity. The relation divides fails symmetry. The non-mathematical
relation is a parent of fails transitivity. However, logical equivalence and similarity of
triangles do satisfy this.
1. a a (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 proof for all of them, and then an
analysis for part 3.
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 definition of congruence, a c (mod m).
1. a + b a0 + b0 (mod m)
2. a b a0 b0 (mod m)
3. ab a0 b0 (mod m).
Lets consider the question How do we show that two numbers are congruent to one
another? The obvious abstract answer is Use the definition of congruence. We may
want to keep in mind, however, that there are several equivalent forms.
a b (mod m)
m | (a b)
k Z such that a b = km
k Z such that 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 dont
have multiplication properties for equivalence or divisibility, it makes sense to consider
Section 23.3 Elementary Properties 171
either the third or fourth of the equivalent forms. There isnt much to separate them. Lets
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 find an
integer k so that ab = km + a0 b0 . Lets record that.
Proof in Progress
1. To be completed.
The problem is how to find k. There is no obvious way backwards here so lets start working
forward. The two hypotheses a a0 (mod m) and b b0 (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
3. To be completed.
But now there seems to be a rather direct way to produce an ab and an a0 b0 which we want
for the conclusion. Just multiply equations (1) and (2) together. Doing that produces
If we let k = mjh + jb0 + a0 h then k is an integer and satisfies the property we needed in
the last line of the proof, that is ab = km + a0 b0 . Lets record this.
Proof in Progress
3. Multiplying (1) by (2) gives ab = m2 jh+mjb0 +a0 mh+a0 b0 = (mjh+jb0 +a0 h)m+a0 b0 .
Lastly, we write a proof. Note that the reader of the proof is expected to be familiar with
the equivalent forms.
Proof: Since a a0 (mod m), there exists an integer j such that a = mj + a0 (1). Since
b b0 (mod m), there exists an integer h such that b = mh + b0 (2). Multiplying (1) by (2)
gives
ab = m2 jh + mjb0 + a0 mh + a0 b0 = (mjh + jb0 + a0 h)m + a0 b0 .
Since mjh + jb0 + a0 h is an integer, ab a0 b0 (mod m).
172 Chapter 23 Congruence
REMARK
The preceding proof goes back to first principles by relying on the definition of divisibility.
This is okay and something that should definitely be attempted before admitting defeat.
However, we have built some useful results on divisibility and it makes sense to see if we
can use these powerful tools to discover an alternative proof. Below we describe how you
might come up with a more elegant argument.
(a a0 )x + (b b0 )y
it seems like we could pick x = b to get ab, but then we also get an a0 b term which we need
to cancel. Setting y = a0 will do this and also gives us the a0 b0 term we need. This leads
us to the following proof.
m | [(a a0 )b + (b b0 )a0 ].
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
seems natural enough, simply divide by a. This works with the integer equation ab = ab0 .
But consider the case where m = 12, a = 6, b = 3 and b0 = 5. It is indeed true that
18 30 (mod 12)
and so
6365 (mod 12)
But dividing by 6 gives the false statement
35 (mod 12).
Division works only under the specific conditions of the next proposition.
1. 8 7 17 7 (mod 3) 8 17 (mod 3)
Proof: (For reference, each sentence of the proof is written on a separate line.)
24.1 Objectives
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.
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).
In practice, the two statements are not usually written out separately. The author assumes
that you do that whenever you read if and only if. Many if and only if proofs begin
with some preliminary material that will help both parts of the proof. For example, they
often introduce notation that will be used in both parts.
Lets look at a proof of Congruent Iff Same Remainder. Before we do an analysis, make
sure that you can identify
174
Section 24.2 Congruence and Remainders 175
a = q1 m + r1 , where 0 r1 < m.
b = q2 m + r2 , where 0 r2 < m.
a = q1 m + r1 , where 0 r1 < m.
b = q2 m + r2 , where 0 r2 < m.
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.
Sentence 2 Hence
REMARK
The proposition Congruent Iff Same Remainder gives us another part to our chain of equiv-
alent statements:
a b (mod m)
m | (a b)
k Z 3 a b = km
k Z 3 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.
347 7q + r (mod 7)
r (mod 7).
Thus, the remainder when 347 is divided by 7 is just 347 (mod 7). Now observe that
32 2 (mod 7) and 33 27 6 1 (mod 7). But then
521 7q + r (mod 7)
r (mod 7).
Thus,
347 6 521 (mod 7).
Example 3
What is the remainder when 2271 3314 is divided by 7? Provide justification for your work.
Solution: First, observe that 23 1 (mod 7) and 33 1 (mod 7) and so by the propo-
sition and corollary to Properties of Congruence,
2271 3314 (23 )90 21 (33 )104 32 (1)90 21 (1)104 32 2 9 18 4 (mod 7).
Thus, by the proposition Congruent Iff Same Remainder, 2271 3314 has remainder 4 when
divided by 7.
Chapter 25
Linear Congruences
25.1 Objectives
The problem for this lecture is to determine when linear congruences have solutions and
how to find them.
Recalling our table of statements equivalent to a b (mod m) we see that
179
180 Chapter 25 Linear Congruences
REMARK
Moreover, the Linear Diophantine Equation Theorem, Part 2 tells us what the solutions to
ax + by = c look like.
m
Note that there are d = gcd(a, m) distinct solutions modulo m and one solution modulo .
d
We record this discussion as the following theorem.
Section 25.3 Examples 181
25.3 Examples
3x 5 (mod 6).
4x 6 (mod 10).
Solution: Since gcd(4, 10) = 2 and 2 | 6, we would expect to find two solutions to 4x 6
(mod 10). Since ten is a small modulus, we can simply test all possibilities modulo 10.
x (mod 10) 0 1 2 3 4 5 6 7 8 9
4x (mod 10) 0 4 8 2 6 0 4 8 2 6
REMARK
Why are there only 10 possibilities? Make sure you understand why this follows from
Congruent Iff Same Remainder. Going forward, we wont be explicit about this.
182 Chapter 25 Linear Congruences
3x 5 (mod 76).
Solution: Since gcd(3, 76) = 1 and 1 | 5, we would expect to find one solution to 3x 5
(mod 76). We could try all 76 possibilities but there is a more efficient 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 r q
1 0 76 0
0 1 3 0
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).
Though we have efficient means to solve linear congruences, we have no equivalent means
to solve polynomial congruences.
x (mod 8) 0 1 2 3 4 5 6 7
x2 (mod 8) 0 1 4 1 0 1 4 1
Modular Arithmetic
26.1 Objectives
2. Construct Zm and perform modular arithmetic. Highlight the role of additive and
multiplicative identities, and additive and multiplicative inverses.
In this section we will see the creation of a number system which will likely be new to you.
Definition 26.2.1 The congruence class modulo m of the integer a is the set of integers
Congruence Class
[a] = {x Z | x a (mod m)}
REMARK
Note that congruence classes have more than one representation. In the example above
[0] = [4] = [8] and, in fact [0] has infinitely many representations. If this seems strange to
you, remember that fractions are another example of where one number has infinitely many
representations. For example 1/2 = 2/4 = 3/6 = .
183
184 Chapter 26 Modular Arithmetic
[a] + [b] = [a + b]
[a] [b] = [a b].
Though the definition 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 well-defined. That is, we are assuming
that these operations make sense even when there are multiple representatives of a
congruence class. For example, in Z6 , [2] = [8] and [3] = [9]. Further, we can verify
that [2] + [3] = [8] + [9].
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 3 a b = km
k Z 3 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 .
Note that all of the entries have representatives between 0 and 3. Even though there are
many representatives for each congruence class, we usually choose a representative between
0 and m 1.
Section 26.2 Modular Arithmetic 185
26.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
26.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
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, whats an inverse? To answer that question we must first define an identity.
186 Chapter 26 Modular Arithmetic
Definition 26.2.3 Given a set and an operation, an identity is, informally, something that does nothing.
Identity 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 effect. Having something that does nothing is extremely useful
though parents might not say that of teenagers.
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].
Under the operation of addition, the integer 3 has inverse 3 since 3 + (3) = (3) +
3 = 0.
3 4
Under the operation of multiplication, the rational number 4 has inverse 3 since
3 4 4 3
4 3 = 3 4 = 1.
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].
26.2.4 Subtraction in Zm
That is, every element [a] Zm has an additive inverse, [a]. This allows us to define
subtraction in Zm .
26.2.5 Division in Zm
Division is related to multiplication in the same way that subtraction is related to addition.
So first, we must identify the multiplicative identity in Zm . Since
REMARK
In a later chapter we will determine when multiplicative inverses do and do not exist in Zm .
With this deeper understanding, we can compare Zm to other algebraic systems like the
integers, rationals and real numbers. By the end of this course we will be able to include
complex numbers and polynomials on this list. Mathematicians classify these systems by
studying the commonalities and differences between them. Common examples that you
might encounter in future courses are groups, rings, and vector spaces. We will touch on
the importance of fields at the end of MATH 135.
188 Chapter 26 Modular Arithmetic
+ [0] [1] [2] [3] [4] [5] [0] [1] [2] [3] [4] [5]
[0] [0] [1] [2] [3] [4] [5] [0] [0] [0] [0] [0] [0] [0]
[1] [1] [2] [3] [4] [5] [0] [1] [0] [1] [2] [3] [4] [5]
[2] [2] [3] [4] [5] [0] [1] [2] [0] [2] [4] [0] [2] [4]
[3] [3] [4] [5] [0] [1] [2] [3] [0] [3] [0] [3] [0] [3]
[4] [4] [5] [0] [1] [2] [3] [4] [0] [4] [2] [0] [4] [2]
[5] [5] [0] [1] [2] [3] [4] [5] [0] [5] [4] [3] [2] [1]
The elements [1] and [5] are the only elements with an inverse in Z6 .
2. In each of the following cases, find all values of [x] Zm , 0 x < m, that satisfy the
equation.
(a) [4][3] + [5] = [x] Z10
(b) [7]1 [2] = [x] Z10
(c) [2][x] = [4] Z8
(d) [3][x] = [9] Z11
Solution:
(a) x = [7]
(b) x = [1]
(c) x {[2], [6]}
(d) x = [3]
3. Solve the following system of equations in Z11 ,
[2][x] + [7][y] = [4] (26.1)
[3][x] + [2][y] = [9]. (26.2)
There are several ways to solve this. We will use elimination just as you would have
used in high school. In Z11 , [3] times equation (1) minus [2] times equation (2) gives
[17][y] = [6] = [6][y] = [6] = [y] = [1] = [y] = [10].
Substituting [y] = [10] into Equation (1) gives
[2][x] + [7][10] = [4] = [2][x] = [0] = [x] = [0].
Thus, the solution is [x] = [0], [y] = [10].
(Notice that we used CD when dividing by 6 and then again when dividing by 2.)
Check
[2][x] + [7][y] = [2][0] + [7][10] = [70] = [4]
[3][x] + [2][y] = [3][0] + [2][10] = [20] = [9]
Section 26.5 Linear Congruences and Modular Classes 189
ax c (mod m).
solving
ax c (mod m)
is equivalent to finding a congruence class [x0 ] Zm that solves
[a][x] = [c] in Zm .
Thus
Putting all of this together we have several views of the same problem.
REMARK
Example 5
1. For each of the given elements, determine its inverse, if an inverse exists. Express the
inverse as [b] where 1 b < m.
Solution:
(a) Finding [5]1 Z10 is equivalent to solving [5][b] = [1] in Z10 . Since gcd(5, 10) =
5 and 5 - 1, this equation has no solution by LCT 2.
(b) Finding [5]1 Z47 is equivalent to solving [5][b] = [1] in Z47 . Since gcd(5, 47) =
1 and 1 | 1, this equation has a solution by LCT 2. Now, solving [5][b] = [1] in
Z47 is equivalent to solving 5b + 47y = 1. We can use the EEA to find a solution.
y b r q
1 0 47 0
0 1 5 0
1 9 2 9
2 19 1 2
5 47 0 2
(Note that the x of the EEA has been written as b to be consistent with the linear
Diophantine equation.) The table gives 5(19) + 47(2) = 1 and so [5]1 = [19]
in Z47 .
y x r q
1 0 29 0
0 1 13 0
1 2 3 2
4 9 1 4
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
Congruence Division
Chapter 27
27.1 Objectives
Pierre de Fermat proved a useful result called Fermats Little Theorem. This should not
be confused with one of the great conjectures, now theorem, of the last 400 years, Fermats
Last Theorem.
Lets begin by understanding what the theorem is saying by using a numeric example.
Example 1 Suppose p = 29 and a = 18. Computing 1828 and reducing it modulo 29 is difficult without
the aid of a computer. However, by Fermats Little Theorem we know that
193
194 Chapter 27 Fermats Little Theorem
Proof: (For reference, each sentence of the proof is written on a separate line.)
3. Since gcd(a, p) = 1, Congruence Division tells us that r s (mod p), but this is not
possible when 1 r < s p 1.
4. Because a, 2a, 3a, . . . , (p 1)a are all distinct and non-zero modulo p, it must be the
case that these integers are equivalent to the integers 1, 2, 3, . . . , p 1 in some order.
a 2a 3a (p 1)a 1 2 3 (p 1) (mod p)
(p 1)!ap1 (p 1)! (mod p).
Lets analyze the proof. As usual, we begin by identifying the hypothesis and the conclusion.
Analysis of Proof This is the most complicated proof in the course so far, so we will be
very thorough. In fact, this proof contains a proof within a proof.
Sentence 1 If p - a, we first show that the integers a, 2a, 3a, . . . , (p 1)a are all distinct
modulo p.
The reason for this sentence is not at all obvious. The sentence is needed, but not
until Sentence 4. The word distinct should alert us to a need to prove uniqueness.
Sentence 3 Since gcd(a, p) = 1, Congruence Division tells us that r s (mod p), but this
is not possible when 1 r < s p 1.
The statement gcd(a, p) = 1 is not one of the hypotheses. Where did it come from?
Since p is a prime and p - a, it must be the case that gcd(a, p) = 1. It is always useful
to identify where the hypotheses of a proposition are used in a proof. The hypotheses
of Fermats Little Theorem are used right here.
To invoke Congruence Division, we must show that its hypotheses are satisfied. One
of those hypotheses is ra sa (mod p). The other is gcd(a, p) = 1. Invoking CD gives
r s (mod p). But r and s are distinct, positive integers less than p, so this is not
possible. This concludes the proof of distinctness of the integers a, 2a, 3a, . . . , (p 1)a.
Sentence 4 Because a, 2a, 3a, . . . , (p 1)a are all distinct and non-zero modulo p, it must
be the case that these integers are equivalent to the integers 1, 2, 3, . . . , p 1 in some
order.
The set {a, 2a, 3a, . . . , (p 1)a} is a set of p 1 integers all distinct and non-zero
modulo p and also coprime to p. (Can you see why?) This is also true for the set of
p 1 integers {1, 2, 3, . . . , p 1}. Thus, the two sets must be the same modulo p.
Sentence 5 Multiplying these integers together gives
a 2a 3a (p 1)a 1 2 3 (p 1) (mod p)
p1
(p 1)!a (p 1)! (mod p)
Example 2
What is the remainder when 31412001 is divided by 17?
We are looking for an r that satisfies the Division Algorithm. That is
Reducing the above equation modulo 17 indicates that we must find r satisfying
Observe that
3141 13 (mod 17)
and that by Fermats Little Theorem
when 17 - 13. Putting all of this together with Properties of Congruence gives
Example 3 Solve 36x47 + 5x9 + x3 + x2 + x + 1 2 (mod 5) where x Z5 . Reduce terms and use
Fermats 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,
reduces to
x47 + x3 + x2 + x + 1 2 (mod 5)
Now observe that x 0 (mod 5) cannot be a solution, otherwise we have 1 2 (mod 5)
by substitution in the preceding equation. Since 5 is a prime and 5 - x, we can use Fermats
Little Theorem which implies that x4 1 (mod 5) and so
x3 + x3 + x2 + x + 1 2 (mod 5)
x (mod 5) 0 1 2 3 4
2x3 x2
+ + x + 1 (mod 5) 1 0 3 2 4
is
x3 (mod 5)
ap a (mod p).
Proof: Let a Z and let p be a prime. If p - a, then ap1 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).
Analysis of Proof There are two important items to note: the use of nested quantifiers
and the use of cases.
This corollary is equivalent to stating that every non-zero element of Zp has an inverse.
Lets discover a proof. As usual, we begin by identifying the hypothesis and the conclusion.
Two points are salient. First, the corollary only states that an inverse exists. It doesnt tell
us what the inverse is or how to compute the inverse. Second, there are three quantifiers.
1. Let p be a prime number is equivalent to for all primes p. Since this is an instance of
a universal quantifier we would expect to use the select method.
4. To be completed.
Now Fermats Little Theorem uses congruences, not congruence classes. But we could
restate Fermats Little Theorem with congruence classes as
[ap1 ] = [1] in Zp .
Now an analogy to real numbers provides the final step. In the reals ap1 = a ap2 so why
not let [b] = [ap2 ]? This would give
Proof in Progress
4. To be completed.
Now we can invoke Fermats Little Theorem but first we need to make sure the hypotheses
are satisfied.
Proof in Progress
Proof: Let p be a prime number. Let [a] be a non-zero element in Zp . Consider [b] = [ap2 ].
Since [a] 6= [0] in Zp , p - a and so by Fermats Little Theorem
REMARK
In summary, if p is a prime number and [a] is any non-zero element in Zp , then
[a]1 = [ap2 ].
28.1 Objectives
The following problem was posed, likely in the third century CE, by Sun Zi in his Math-
ematical Manual and republished in 1247 by Qin Jiushao in the Mathematical Treatise in
Nine Sections.
The word problem asks us to find an integer n that simultaneously satisfies the following
three linear congruences.
n2 (mod 3)
n3 (mod 5)
n2 (mod 7)
As when faced with linear Diophantine equations, we first want to determine if there is a
solution. When a solution exists, we want to know how to find a solution and, in fact, all the
solutions. We cannot simply plug one congruence into the other. Instead, we will use our
theory on single linear congruences and their connection to linear Diophantine equations to
try and express the complete solution in terms of a single modulus.
Before we solve the word problem above with three simultaneous linear congruences, we
will begin with two simultaneous congruences whose moduli are coprime.
200
Section 28.3 Chinese Remainder Theorem 201
Example 1 Solve
n2 (mod 5)
n9 (mod 11).
Solution: Suppose n is an integer such that n 2 (mod 5) and n 9 (mod 11). From
the first congruence, we know
As in a previous chapter, we can use inspection and Linear Congruence Theorem 1 to solve
this and get
x 8 (mod 11)
which can be written as
x = 11y + 8 for some y Z. (28.2)
Substituting Equation 28.2 into Equation 28.1 gives
Thus
n 42 (mod 55).
REMARK
Suppose we try and solve
log2 (x + 3) + log2 (x 3) = 4.
We can use logarithm rules to get log2 (x2 9) = 4 = 24 = x2 9 = x = 5.
However, we cant stop there. We need to check our final answers and reject x = 5
because log2 (x 3) requires x > 3.
How is this related to solving simultaneous linear congruences?
In the solution to Example 1, we carefully included a last checking step. The ultimate goal
was to describe {n Z : n 2 (mod 5) and n 9 (mod 11)} in another more helpful
way. This means our solution is essentially a proof that two sets are equal requiring an
argument in two directions. Now, in practice, we typically cite the following formalization
of this process instead of including the last checking step.
202 Chapter 28 Chinese Remainder Theorem
n a1 (mod m1 )
n a2 (mod m2 )
have a unique solution modulo m1 m2 . Thus, if n = n0 is one integer solution, then the
complete solution is
n n0 (mod m1 m2 )
Hypothesis: a1 , a2 Z. gcd(m1 , m2 ) = 1.
n a1 (mod m1 )
n a2 (mod m2 )
Since there is an existential quantifier in the conclusion, we use the construct method and
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 first linear congruence
n = a1 + m1 x for some x Z
The next thing we did was substitute this expression into the second congruence.
a1 + m1 x a2 (mod m2 )
m1 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 con-
gruence has a solution, say x = b and that the complete solution can be written:
x = b + m2 y for some y Z.
Section 28.3 Chinese Remainder Theorem 203
n = a1 + m1 x = a1 + m1 (b + m2 y) = (a1 + m1 b) + m1 m2 y.
This implies
n a1 + m1 b (mod m1 m2 ).
Conversely, we can write this as
n = a1 + m1 b + m1 m2 k for some k Z
and we need to check that all integers of this form satisfy both congruences.
Exercise 1 Using the analysis above, write a proof for the Chinese Remainder Theorem.
Example 2 Solve
n2 (mod 3)
n3 (mod 5).
x2 (mod 5).
n = 3(5y + 2) + 2 = 15y + 8.
Thus
n8 (mod 15)
and since gcd(3, 5) = 1, by the Chinese Remainder Theorem, this is the complete solution.
Example 3 Solve
3x 2 (mod 8)
4x 9 (mod 11).
204 Chapter 28 Chinese Remainder Theorem
Weve seen how to determine by Linear Congruence Theorem 1 that this system of congru-
ences is equivalent to
x6 (mod 8)
x5 (mod 11).
Since gcd(8, 11) = 1, we know by the Chinese Remainder Theorem that a solution to this
pair of linear congruences exists. Rewriting x 6 (mod 8) as x = 8y + 6 (1) for some
y Z and substituting into the second linear congruence gives 8y + 6 5 (mod 11). This
reduces to 8y 10 (mod 11) and the solution is y 4 (mod 11) by inspection and Linear
Congruence Theorem 1. Rewriting y 4 (mod 11) as y = 11z+4 for z Z and substituting
in Equation 1 gives x = 8(11z + 4) + 6 = 38 + 88z for some z Z, or, equivalently,
x 38 (mod 88).
Example 4 Solve
n2 (mod 3)
n3 (mod 5)
n4 (mod 11).
Solution: The first two of the three linear congruences were solved above so we can replace
n2 (mod 3)
n3 (mod 5)
by
n8 (mod 15).
This reduces a problem of three linear congruences to a problem in two linear congruences.
n8 (mod 15)
n4 (mod 11).
The previous exercise 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
Section 28.4 Splitting a Modulus 205
n a1 (mod m1 )
n a2 (mod m2 )
..
.
n ak (mod mk )
n n0 (mod m1 m2 . . . mk )
You should ask yourself What happens if the moduli are not coprime? That investigation
is left as an exercise.
Exercise 2 Solve the problem posed by Sun Zi that began this lecture.
Example 5 Find all integers n such that n37 + 10n8 + 14n7 + 1 5 (mod 35).
Solution: We could try all 35 possibilities but even then, computing something like 2037
is a problem. Perhaps there is another way. Observing that 35 = 5 7 and both factors
are relatively prime, we will use the Splitting Modulus (SM) theorem and split the problem
206 Chapter 28 Chinese Remainder Theorem
into two linear congruences and then apply the Chinese Remainder Theorem. Can you see
why this is okay even though the polynomial is not linear?
We split
n37 + 10n8 + 14n7 + 1 5 (mod 35)
into
Well, have we seen anything like these before? Indeed, we have. The previous example
solved congruences just like these. Well solve each of the polynomial congruences individ-
ually. As in the previous example, we can reduce terms and use Fermats Little Theorem
or its corollaries to simplify the congruence before substitution. Lets start with Equation
(28.5).
Since 10 0 (mod 5) the term 10n8 reduces to 0 (mod 5).
Since 14 4 (mod 5) the term 14n7 reduces to 4n7 (mod 5).
Finally, since 5 0 (mod 5), the right hand side constant reduces to 0 (mod 5).
Thus,
n37 + 10n8 + 14n7 + 1 5 (mod 5)
reduces to
n37 + 4n7 + 1 0 (mod 5).
This looks like progress! Now observe that n0 0 (mod 5) cannot be a solution, otherwise
we have 1 0 (mod 5) by substitution in the preceding equation. Since 5 is a prime and
5 - n0 , we use Fermats Little Theorem to get n4 1 (mod 5). Hence
and
n7 n4 n3 n3 (mod 5)
and so the polynomial congruence further reduces to
n (mod 5) 0 1 2 3 4
n + 4n3 + 1 (mod 5) 1 1 0 2 1
is
n2 (mod 5).
This is a linear congruence so that supports the idea of using the Chinese Remainder
Theorem. Now lets examine Equation (28.6) (repeated below).
n (mod 7) 0 1 2 3 4 5 6
n + 3n2 + 1 (mod 7) 1 5 1 3 4 4 3
REMARK
Lets summarize what we have learned from all of our examples.
Simultaneous linear congruences can be solved using the Chinese Remainder Theorem
if the moduli are coprime.
A single congruence can be split into simultaneous congruences by splitting the mod-
ulus into coprime factors and using the Chinese Remainder Theorem to combine
solutions to the individual congruences.
Chapter 29
29.1 Objectives
The need for secret communications has been known for millenia. In the modern world, the
need for secret communication is much larger than it was even in the recent past. Certainly
the traditional requirements of military and diplomatic secrecy continue, but the credit card,
debit card and web transactions of modern commerce, as well as privacy concerns for health,
citizenship and other electronic records, have raised the need for secure communications and
storage dramatically.
In its most elemental form, the objective of any secret communication scheme is to allow
two parties, usually referred to as Alice (for person A) and Bob (for person B), to commu-
nicate over an insecure channel so that an opponent, often called Oscar, cannot understand
what is being communicated. The information Alice wishes to communicate is called the
message or the plaintext. The act of transforming the plaintext into a ciphertext is
called enciphering or encryption. The rules for enciphering make use of a key, which
is an input to the algorithm. The act of transforming the ciphertext to plaintext using the
key is called deciphering or decryption.
In a private key cryptographic scheme, Alice and Bob both must share some secret key
to be able communicate using cryptography. 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. That means there
are 200
2 = 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 private
decryption key held secretly by each participant, and a public encryption key, derived from
the private key, which is shared in an open repository of some sort. For user A to send a
209
210 Chapter 29 The RSA Scheme
private message to user B, A would look up Bs 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 first published in 1976 in a paper by Diffie,
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. The following protocols and products, which embed RSA, are
used by many of us daily. SSL (Secure Sockets Layer) is the most commonly used protocol
for secure communication over the web. It is frequently used to encrypt payment data
before sending that data to a server. PGP (Pretty Good Privacy) is used by individuals
and businesses to encrypt and authenticate messages. It was originally intended for email
messages and attachments but is now also used for encrypting files, folders or entire hard
drives. EMV (Europay, MasterCard and VISA) is a global standard for authenticating
credit and debit card transactions at point of sale (POS) or automated teller machines
(ATM).
In the next section, we will introduce the RSA scheme and then prove that it works. The
security of the RSA scheme is a widely studied subject, but we will not address that here.
In RSA, messages are integers. How does one get an integer from plaintext? We assign
a number to each letter of the alphabet and then concatenate the digits together. If the
message is too long, it may need to be broken into parts so that M < n (see Sending a
Message below).
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).
To send a message:
4. Send C.
To decrypt a message:
29.3.4 Example
Setting up RSA
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:
Computing gives C
4006696554 3080815610 2814019838 8509626485
8151054441 5245547382 5506759308 1333888622
4491394825 3742205367.
4. Send C.
Receiving a Message
To decrypt a message:
When the value of n is small and can be easily factored into n = pq for distinct primes p and
q, we can carry out the calculations without using computers. For this, we need to recall
the theorem about splitting a congruence modulo n into multiple simultaneous congruences
using the factors of n.
Even though the end results of an RSA calculation is presented modulo n, the Splitting
Modulus (SM) theorem allows us to carry out the intermediate modulo p and modulo q
separately, and combine the results using the Chinese Remainder Theorem(CRT) to get the
final answer in (mod n).
The advantage of using p and q is that these numbers are prime, so we can use Fermats
Little Theorem (F`T) and its corollaries.
1. Given p = 5, and q = 11, and e = 3, find the private key (d, n) for an RSA scheme.
Solution: In this case, n = 5 11 = 55 and (p 1)(q 1) = 4 10 = 40. To find d,
we solve
3d 1 (mod 40).
40x + 3d = 1
x y r q Division Algorithm
1 0 40 0 40 = 0(3) + 40
0 1 3 0 23 = 0(40) + 3
1 -13 1 13 40 = 13(3) + 1
2. Suppose you receive the cipher-text C = 47. Decrypt the message using your private
key (27, 55).
Solution: So we will compute
The Splitting Modulus (SM) theorem allows us to instead solve the simultaneous
congruences
R (47)27 (mod 5)
27
and R (47) (mod 11).
R 227 (mod 5)
27
and R 3 (mod 11).
Since 5 and 11 are both prime numbers, we may now use Fermats litte Theorem
(F`T), which tells us 24 1 (mod 5) and 310 1 (mod 11).
Using 27 = (6)(4) + 3, we get R (24 )6 23 23 8 3 (mod 5). Similarly, from
27 = 2(10) + 7 , we get that R (310 )2 (3)7 (37 ) 9 (mod 11). Finally, we have to
solve the simultaneous system of equations given by
R3 (mod 5)
and R 9 (mod 11).
REMARK
Notice that the Splitting Modulus theorem simplified our work in the example above. How-
ever, this is not something that an adversary can do because p and q are not part of the
public key!
29.4 Does M = R?
Theorem 2 (RSA)
If
2. n = pq
4. 0 M < n
5. M e C (mod 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.
2. Show that R M (mod p). We will do this in two cases: (i) p - M and (ii) p | M .
Now
R Cd (mod n)
e d
(M ) (mod n)
ed
M (mod n)
1+k(p1)(q1)
M (mod n)
M M k(p1)(q1) (mod n).
Second, we will show that R M (mod p). Suppose that p - M . By Fermats Little
Theorem,
M p1 1 (mod p).
216 Chapter 29 The RSA Scheme
Hence
Since
R M M k(p1)(q1) (mod n) = R M M k(p1)(q1) (mod p).
we have
RM (mod p).
Now suppose that p | M . But then M 0 (mod p) and so M M k(p1)(q1) 0 (mod p).
That is,
M M k(p1)(q1) M (mod p).
Again, since
we have
RM (mod p).
RM (mod p)
RM (mod q).
Since gcd(p, q) = 1 we can invoke the Chinese Remainder Theorem and conclude that
RM (mod pq).
Since pq = n we have
RM (mod n).
Now, R and M are both integers congruent to each other modulo n, and both lie between
0 and n 1, so R = M .
Part V
217
Chapter 30
Complex Numbers
30.1 Objectives
When humans first counted, we tallied. We literally made notches on sticks, stones and
bones. Thus the natural numbers, N, were born. But it wouldnt 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.
na o
Q= : a, b Z, b 6= 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.
Eventually, via Hindu and Islamic scholars, western mathematics began to recognize and
accept both zero and negative numbers. Otherwise, equations like
3x = 5x
218
Section 30.3 Complex Numbers 219
or
2x + 4 = 0
have no solution. Thus, mathematicians recognized that
N(Z(Q(R
x2 + 1 = 0
Definition 30.3.1 A complex number z in standard form is an expression of the form x+yi where x, y R.
Complex Number 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).
Definition 30.3.2 For a complex number z = x + yi, the real number x is called the real part and is written
Real Part, Re(z) or <(z) and the real number y is called the imaginary part and is written Im(z) or
Imaginary Part =(z).
R(C
and so
N(Z(Q(R(C
One has to wonder how much further the number system needs to be extended!
Definition 30.3.3 The complex numbers z = x + yi and w = u + vi are equal if and only if x = u and y = v.
Equality
Example 2
(1 + 7i) + (2 3i) = (1 + 2) + (7 3)i = 3 + 4i
Example 3
(1 + 7i) (2 3i) = (1 2 7 (3)) + (1 (3) + 7 2)i = 23 + 11i
REMARK
Lets square i.
The fact that i2 = 1 is what gives complex numbers their strangeness and their strength.
Together with properties of real numbers, it allows us to avoid use of the cumbersome
formal definition of complex multiplication when doing numerical computations. Instead,
we can expand the binomial and replace i2 by 1. So for the above example, we can more
familiarly write
(1 + 7i) (2 3i) = 2 3i + 14i 21i2 = 23 + 11i.
The multiplication symbol is usually omitted and we write zw or (a + bi)(c + di).
1. u + v
2. u v
3. uv
4. u3
Section 30.3 Complex Numbers 221
Solution:
1. u + v = (3 + i) + (2 7i) = 5 6i
2. u v = (3 + i) (2 7i) = 1 + 8i
You probably didnt even question the use of exponents in the previous example. Techni-
cally, we havent defined u2 and u3 for a complex number yet. However, we do this in the
usual way. That is, if z is a complex number and n > 1 is an integer, we write z n to mean
the multiplication of n copies of z. We stick to the convention that z 0 = 1 and z 1 = z.
However, we wont take sides in the debate over what 00 is or means.
Exercise 2 Compute
3 + 4i
What about division? Consider . What does this mean?
1 + 2i
Let z = 1 + 2i. As with real numbers and integers modulo a prime, we want to write
3 + 4i
= (3 + 4i)z 1
z
where if z 1 = (x + yi) for real numbers x and y, then (1 + 2i)(x + yi) = 1. If this is true,
v
Example 5 Let u = 3 + i and v = 2 7i. Compute and write the answer standard form.
u
Solution: Using the definition, we get
v 6 7 2 + 21 1 23
= + i= + i.
u 9+1 9+1 10 10
Alternatively,
v 2 7i 2 7i 3 i 1 23i 1 23
= = = = + i.
u 3+i 3+i 3i 10 10 10
We will now also allow negative integer exponents. That is, if z is a complex number and
n is a positive integer, then z n simply means z1n . Things get interesting and especially
strange when we explore rational, real and even complex exponents!
The usual properties of associativity, commutativity, identities, inverses and distributivity
that we associate with rational and real numbers also apply to complex numbers.
1. Associativity of addition: (u + v) + z = u + (v + z)
2. Commutativity of addition: u + v = v + u
5. Associativity of multiplication: (u v) z = u (v z)
6. Commutativity of multiplication: u v = v u
9. Distributivity: z (u + v) = z u + z v
and
u(uv) = (3 + i)((3 + i)(2 7i)) = (3 + i)(13 19i) = 58 44i.
Section 30.3 Complex Numbers 223
Self Check 1 Prove that the properties of associativity, commutativity, identities, inverses and distribu-
tivity are true for complex numbers.
REMARK
You may wonder if the quadratic formula still works for complex numbers. If you were
introduced to complex numbers in high school, this may have been the motivation. It turns
out that complex numbers allow us to find two (not necessarily distinct) solutions to any
real quadratic equation. It also works if the coefficients are complex numbers. However,
we need a reinterpretation of some of the terms in the formula. We will get to this in later
chapters.
Chapter 31
31.1 Objectives
1. Define conjugate and modulus.
31.2 Conjugate
or
(x2 y 2 + 2x + 1) + (2xy 2y)i = 0
Equating real and imaginary parts we have
x2 y 2 + 2x + 1 = 0.
2xy 2y = 0.
2xy 2y = 0 2y(x 1) = 0 y = 0 or x = 1
x2 + 2x + 1 = 0 x = 1
224
Section 31.2 Conjugate 225
1 y 2 + 2 + 1 = 0 y 2 = 4 y = 2
1. z + w = z + w
2. zw = z w
3. z = z
4. z + z = 2Re(z)
5. z z = 2Im(z)i
We will prove the first of these properties and leave the remainder as exercises.
Exercise 1 Prove each of the remaining parts of the Properties of Conjugates proposition.
Example 2 Prove: Let z C. The complex number z is a real number if and only if z = z.
Solution: Let z = x + yi.
Exercise 2 Prove: Let z C and z 6= 0. The complex number z is purely imaginary (Re(z) = 0) if and
only if z = z.
REMARK
Note that zero is both real and purely imaginary.
w is real w = w
z+i z+i
=
zi zi
z+i zi
= by Properties of Conjugates
zi z+i
zz 1 + (z + z)i = zz 1 (z + z)i
2i(z + z) = 0
z + z = 0
2Re(z) = 0 by Properties of Conjugates
Re(z) = 0
z is purely imaginary.
31.3 Modulus
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 .
This is one reason why we associate each complex number with a non-negative real number.
Section 31.3 Modulus 227
Definition 31.3.1 The modulus of the complex number z = x + yi is the non-negative real number
Modulus p
|z| = |x + yi| = x2 + y 2 .
p
Example 4 The modulus of z = 2 5i is |z| = (22 ) + (5)2 = 29.
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 Im(z) = 0, the modulus corresponds to the absolute values of real numbers. If we think
of |x| for a real number x as the distance from x to zero, then this matches a geometric
intepretation of |z| we will introduce for complex numbers in the next chapter.
2. |z| = |z|
3. zz = |z|2
4. |zw| = |z||w|
REMARK
Squaring both sides of an equation or inequality and the using zz = |z|2 from Properties
of Modulus often allows us to avoid introducing the real an imaginary parts of a complex
number z. This often leads to a shorter and more elegant proof. How did you prove the
fourth part of Properties of Modulus?
z+i
Example 5 For z C, z 6= i define w = . Prove that |w| < 1 if and only if Im(z) < 0.
zi
228 Chapter 31 Properties Of Complex Numbers
Example 6 One of the dangers in working in a new mathematical system is the temptation to invent
new but incorrect rules.
For each step of the following argument that purports to show that |z| = 1 for all complex
numbers z, provide justification (by citing an appropriate proposition, for example) or state
that the logic is incorrect and give a reason why.
Let z be any complex number.
0 = |1| 1 (31.1)
1
= |zz |1 (31.2)
1
= |z||z |1 (31.3)
1
= |(z + 1) 1||z |1 (31.4)
1
= (|z + 1| + | 1|)|z |1 (31.5)
1
= (|z + 1| + 1)|z |1 (31.6)
1 1
= |z + 1||z | + |z |1 (31.7)
= |z + 1||z| + |z| 1 (31.8)
= (|z| + |1|)|z| + |z| 1 (31.9)
= (|z| + 1)|z| + |z| 1 (31.10)
2
= |z| + 2|z| 1 (31.11)
2
= (|z| 1) (31.12)
Graphical Representations of
Complex Numbers
32.1 Objectives
1. Define complex plane, polar coordinates, polar form.
Definition 32.2.1 The notation z = x + yi suggests a non-algebraic representation. Each complex number
Complex Plane 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.
229
230 Chapter 32 Graphical Representations of Complex Numbers
1. 4 i
2. 2 + 3i
32.2.2 Modulus
Recall that the modulus of the complex number z = x + yi is the non-negative real number
p
|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| =
p
(x u)2 + (y v)2 .
Exercise 2 Sketch all of the points in the complex plane with modulus 1.
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, ) identifies the same point as
(r, + 2k) for any integer k.
The obvious problem is how to go from one to the other.
Section 32.4 Converting Between Representations 231
Given the Cartesian coordinates (x, y), the corresponding polar coordinates are determined
by
p
r = x2 + y 2
x
cos =
r
y
sin = .
r
Example 1 Here are points in standard form, Cartesian coordinates and polar coordinates.
Exercise 3 Below are polar coordinates of points. Plot the points and convert to Cartesian coordinates.
1. (1, 0)
2. (2, 7/2)
3. (4, 4/3)
Next are Cartesian coordinates of points. Plot the points and convert to polar coordinates.
1. (1, 0)
2. (1, 1)
3. (2, 2 3)
232 Chapter 32 Graphical Representations of Complex Numbers
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 ).
REMARK
Some people shorten cos + i sin using the notation cis .
Example 2 The following are representations of complex numbers in both standard and polar form.
1. 1 = cos 0 + i sin 0
3 3
2. 1 + i = 2 cos + i sin
4 4
4 4
3. 1 3i = 2 cos + i sin
3 3
9+i
Example 3 Write z = in the form r(cos + i sin ) with r 0 and 0 < 2.
5 4i
Solution:
9+i (9 + i)(5 + 4i) 41 + 41i
z= = = 2 2
= 1 + i = 2(cos /4 + i sin /4).
5 4i (5 4i)(5 + 4i) 5 +4
One of the advantages of polar representation is that multiplication becomes very straight-
forward.
Proof:
Example 4
3 3 4 4
2 cos + i sin 2 cos + i sin
4 4 3 3
3 4 3 4
= 2 2 cos + + i sin +
4 3 4 3
25 25
= 2 2 cos + i sin
12 12
= 2 2 cos + i sin
12 12
Chapter 33
De Moivres Theorem
33.1 Objectives
234
Section 33.2 De Moivres Theorem 235
1. n = 0
2. n > 0
3. n < 0.
For the case n = 0, DeMoivres 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. Let P (n) be the statement
Base Case We verify that P (1) is true where P (1) is the statement
(cos + i sin )1 = cos 1 + i sin 1.
This is trivially true.
Inductive Hypothesis We assume that the statement P (k) is true for some k 1. That
is, we assume
(cos + i sin )k = cos k + i sin k.
Inductive Conclusion Now show that the statement P (k + 1) is true. That is, we show
(cos + i sin )k+1 = cos(k + 1) + i sin(k + 1).
Beginning with the left-hand side,
(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)
Since P (k+1) is true, P (n) is true for all natural numbers n by the Principle of Mathematical
Induction.
Lastly, for the case n < 0 we will use complex arithmetic. Since n < 0, n = m for some
m N.
(cos + i sin )n = (cos + i sin )m
1
=
(cos + i sin )m
1
=
(cos m + i sin m)
cos m i sin m
=
(cos2 m + i sin2 m)
= cos m i sin m
= cos(m) + i(sin(m))
= cos n + i sin n
236 Chapter 33 De Moivres Theorem
z n = rn (cos n + i sin n)
Example 2 Calculate (1 + 3i)17 .
Solution: We use De Moivres Theorem. The polar form of 1 + 3i is
By De Moivres Theorem,
(1 + 3i)17 = 217 (cos 2/3 + i sin 2/3)17
= 217 (cos 34/3 + i sin 34/3)
= 217 (cos 4/3 + i sin 4/3)
17 1 3
= 2 ( i)
2 2
= 216 (1 3i)
By expanding
as required.
Section 33.3 Complex Exponentials 237
Example 4 Using the fact that = 52 satisfies cos 2 = cos 3, calculate cos 25 .
Solution: From the previous example and substituting 1 cos2 for sin2 we have
by the double angle formula for the cosine. Rearranging this and letting X = cos , we get
4X 3 2X 2 3X + 1 = 0
Note that X = 1 is a solution (extraneous) to this polynomial: that would mean that
= 2k for some integer k, contrary to assumption. So, divide the polynomial by X 1 to
get
(X 1)(4X 2 + 2X 1) = 0
The real value of cos is one of the roots of this polynomial, and it is not 1. Now apply the
quadratic formula taking the positive root since 0 < and = 25 < 21 to get
2 20 1 + 5
X= and X > 0 = X =
8 4
1+ 5
Therefore, cos 25 = 4 .
If you were asked to find a real-valued function y with the property that
dy
= ky and y = 1 when x = 0
dx
for some constant k, you would choose
y = ekx .
If you were asked to find 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
df
= sin + i cos = i(cos + i sin ) = if ()
d
and so
df
= if () and f () = 1 when = 0.
d
238 Chapter 33 De Moivres Theorem
ei ei = ei(+)
n
ei = ein n Z.
z = rei
!6
ei5/12
Example 5 How do we write z = in the form x + iy with x, y R?
3
!6
ei5/12
z= = ( 3)6 (ei5/12 )6 = 33 ei5/2 = 27(ei/2 ) = 27i.
3
Chapter 34
34.1 Objectives
Definition 34.2.1 If a is a complex number, then the complex numbers that solve
Complex Roots
zn = a
The modulus n r is the unique non-negative n-th root of r. This theorem asserts that any
non-zero complex number, including the reals, has exactly n different complex n-th roots.
239
240 Chapter 34 Roots of Complex Numbers
4
Note that the solutions are uniformly distributed around a circle whose radius is 16.
Section 34.2 Complex n-th Roots 241
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 specific representations of the solution. We then show
that S = T by mutual inclusion. Our two sets are
S = {z C : z n = a}
and
n
+ 2k + 2k
T = r cos + i sin : k = 0, 1, 2, . . . , n 1
n n
where a = r(cos + i sin ).
We begin by showing that T S. Let t = n r cos +2k + i sin +2k
n n be an element
of T . Now
n
n n
n + 2k + 2k
t = r cos + i sin
n n
= r(cos( + 2k) + i sin( + 2k)) using De Moivres Theorem
= r(cos + i sin )
=a
wn = a
(s(cos + i sin ))n = r(cos + i sin )
sn (cos n + i sin n) = r(cos + i sin ) by De Moivres Theorem.
Now two complex numbers in polar form are equal if and only if their moduli are equal and
their arguments differ by an integer multiple of 2. So
sn = r = s = n r
and
+ 2k
n = 2k = =
n
where k Z. Hence, the n-th roots of a are of the form
n
+ 2k + 2k
r cos + i sin for k Z.
n n
Example 3 Find all of the cube roots of 2. Express your answers in standard form and plot these
solutions in the complex plane.
Solution: We will use the Complex n-th Roots Theorem to solve z 3 = 2. First, we write
2 in polar form as
2 = 2(cos 0 + i sin 0).
Using the Complex n-th Roots Theorem the solutions are
3 2k 2k
2 cos + i sin for k = 0, 1, 2.
3 3
Section 34.3 Square Roots 243
Example 4 Solve z 6 z 3 2 = 0.
Solution: Since z 6 z 3 2 = (z 3 2)(z 3 + 1) it is enough to solve z 3 2 = 0 and z 3 + 1 = 0.
The roots of z 3 2 = 0 are given
by the previous
example. The roots of z 3 + 1 = 0 can also
1 3 1 3
be calculated to yield 2 + i 2 , 1 and 2 i 2 .
Exercise 1 An n-th 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.
The Complex n-th Roots Theorem (CNRT) tells us that for a complex number a 6= 0, there
are exactly two complex numbers z such that z 2 = a. It is common to call these the square
roots of a and CNRT gives them to us in polar form. However, the quadratic formula can
also be used.
b w
2a
where w is a solution to z 2 = b2 4ac.
Notice that this is not written using the notation b2 4ac. What does b2 4ac even
mean when b2 4ac is not a non-negative real number? Remember that we dont have the
notions of positive and negative for arbitrary complex numbers. Square root is not a
well-defined function over the complex numbers.
Nevertheless, if w2 = a for complex numbers w and a, then (w)2 = a as well. So in some
sense the plus/minus sign inthe quadratic formula means it does not matter which square
root we select as a value for b2 4ac. This is why some people still safely use the notation
r even if they do not know whether or not r is a non-negative real number.
244 Chapter 34 Roots of Complex Numbers
Exercise 2 Prove that the quadratic formula holds for any complex quadratic equation.
Exercise 3 Find the square roots of 2i and graph them in the complex plane.
3 w
x= where w2 = 9 4(4) = 7.
4
By inspection, we see that ( 7i)2 = 7i2 = 7 so the two solutions are
3 7
i.
4 4
3 w
x= where w2 = 9 4i(2i) = 9 8 = 1.
2i
Example 7 The equation x3 x2 + x 1 = 0 has one real solution but it also has two non-real complex
solutions. What are the three solutions?
Solution: Observe that
(x2 + 1) = 0 or (x 1) = 0.
The second factor yields the real root x = 1 and the first factor yields the two non-real
complex roots i.
You may know that if the sum of the coefficients is zero as in this example, then x 1 is a
factor. Can you explain why? This relates to the material in the next chapter.
Part VI
Factoring Polynomials
245
Chapter 35
An Introduction to Polynomials
35.1 Objectives
1. Define polynomial and key polynomial terminology.
2. Define operations on polynomials.
3. State the Division Algorithm for Polynomials.
35.2 Polynomials
Our number systems were developed in response to the need to find solutions to equations.
We are now able to solve all equations of the form
a2 x2 + a1 x + a0 = 0
or
xn a0 = 0
whether a0 , a1 and a2 are real or complex numbers and n is a natural number. In fact, a
great deal more is known.
Consider the left hand side of the equations above. They are expressions built using a
symbol x and coefficients taken from some set. The choice of set is important.
In MATH 135, when we use the term field, we mean
You may see a more general definition in a future course and it is important to know there
are many more examples of fields! Roughly speaking, a field is a set of numbers equipped
with operations addition, subtraction, multiplication and division.
The integers are not a field because, for example, we do not get an integer when dividing
11 by 3. Similarly, Z6 is not a field since [3] does not have a multiplicative inverse in Z6 .
Recall that division is just multiplication by an inverse so we cannot divide by [3] in Z6 .
246
Section 35.2 Polynomials 247
REMARK
One of the most critical properties of a field is the following.
Most often we will work with polynomials over the rational numbers, real numbers or com-
plex numbers. These are called real polynomials, rational polynomials and complex
polynomials respectively.
4. 5x4 +0x3 1x2 +0x2 is in Q[x] (also in R[x] and C[x]). We would usually express the
term 1x2 simply as x2 , and omit the terms 0x3 and 0x from the polynomial expression,
and simplify the polynomial as 5x4 x2 2.
Finally, note that 2x3 + x2 7
2 ix + 5
/ R[x] as at least one of the coefficients is not a
real number. In fact, as we have
Q ( R ( C,
we also get a similar relationship for polynomials:
Q[x] ( R[x] ( C[x].
248 Chapter 35 An Introduction to Polynomials
This means we should always clearly specify the field when working with polynomials.
Example 2 The polynomial [2]x3 +[4]x2 +[1] can be viewed as a polynomial over Z5 but it is cumbersome
to write all these square brackets and hence people often write this element of Z5 [x] as
2x3 + 4x + 1 making sure to do all of our coefficient arithmetic modulo 5.
then the polynomial is said to have degree n. In other words, the degree of a polynomial
is the largest power of x that has a non-zero coefficient.
The zero polynomial has all of its coefficients equal to zero and its degree is not defined.
The reason for this might be explained in future courses where you may alternatively see the
degree of the zero polynomial defined to be . A constant polynomial is a polynomial
that is either the zero polynomial or a polynomial of degree 1. Polynomials of degree 1
are called linear polynomials, of degree 2, quadratic polynomials, and of degree 3, cubic
polynomials.
Note that the polynomial 0x3 + 0x2 + 1x + 0 is actually linear as the largest exponent of x
with a non-zero coefficient is 1.
In the following discussion, we will sometimes use both function notation and summation
notation. That is, we will frequently use f (x) to denote an element of F[x] and write
n
X
f (x) = an xn + an1 xn1 + + a1 x + a0 = ak xk .
k=0
Definition 35.2.3 Let f (x) = an xn + an1 xn1 + + a1 x + a0 , and g(x) = bn xn + bn1 xn1 + + b1 x + b0
Equal both be polynomials in F[x].
The polynomials f (x) and g(x) are equal if and only if ak = bk for all k.
Thus, x3 x + 21 and ln(1)x4 + tan 4 x3 sin () x2 e0 x + 44 are indeed the same
REMARK
Do not mistake polynomial equality with function equality. For example, consider
When viewed as polynomials, f (x) and g(x) are not equal. However they are equal when
viewed as functions mapping elements of Z3 to Z3 . That is, both functions map [0] to [0],
[1] to [1], and [2] to [1].
Definition 35.3.1 The sum of the polynomials f (x) and g(x) is defined as
Sum
max(n,m)
X
f (x) + g(x) = (ak + bk )xk
k=0
where deg(f (x)) = n, deg(g(x)) = m, and any missing terms have coefficient zero.
Definition 35.3.2 The difference of the polynomials f (x) and g(x) is defined as
Difference
max(n,m)
X
f (x) g(x) = (ak bk )xk
k=0
where deg(f (x)) = n, deg(g(x)) = m, and any missing terms have coefficient zero.
Example 5 In Z7 [x], if f (x) = [3]x5 + [2]x3 + [5] and g(x) = [2]x4 + [2]x3 + [3]x2 + [6] then
f (x) g(x) = [3]x5 + [5]x4 + [4]x2 + [6].
250 Chapter 35 An Introduction to Polynomials
Exercise 1 Find the difference of each of the pairs of polynomials given in Example 4.
x2 + 7x 1
3x + 2
2x2 + 14x 2
3x3 + 21x2 3x
3x3 + 23x2 + 11x 2
The x2 column simply displays the combinations of terms from f (x) and g(x) whose product
gives x2 , that is x2 2 and 7x 3x.
The formal definition of the product of two polynomials looks more complicated than it is.
Definition 35.3.3 The product of the polynomials f (x) and g(x) is defined as
Product
m+n
X
f (x)g(x) = ck xk
k=0
where
k
X
ck = a0 bk + a1 bk1 + + ak1 b1 + ak b0 = aj bkj .
j=0
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 2 + (3 i)z + 2i and
g(z) = iz + (2 2i).
f (x) = q(x)g(x) + r(x) where r(x) is the zero polynomial or deg r(x) < deg g(x).
Definition 35.3.4 The polynomial q(x) is called the quotient polynomial. The polynomial r(x) is called the
Quotient, remainder polynomial. We say that g(x) divides f (x) or g(x) is a factor of f (x) and
Remainder, Divides we write g(x) | f (x) if and only if there exists a polynomial q(x) such that f (x) = q(x)g(x).
That is, f (x) divides g(x) when f (x) and g(x) are both the zero polynomial or when the
remainder r(x) from the Division Algorithm for Polynomials is the zero polynomial.
We use the same notation as before with the division of integers. This is because of the
strong parallels between division of integers and division of polynomials.
We wont prove the Division Algorithm for Polynomials.
REMARK
This is a place where it is very important that the coefficients are taken from a field.
Consider
x2 = (2x + 1)( 12 x 12 ) + 21 .
Here we are dividing the quadratic rational polynomial x2 by the linear rational polynomial
2x + 1. While these polynomials have integer quotients, we get the quotient 12 x 12 and
remainder 21 which do not have integer coefficients. The statement of the Division Algorithm
for Polynomials would not be true if we tried to say f (x), g(x), q(x) and r(x) all have integer
coefficients. The integers are not a field! Similarly, think about what goes wrong if we try
to work over Z4 which is also not a field.
Thus, the quotient polynomial is q(x) = 3x2 + x 7 and the remainder polynomial is
r(x) = 2x + 12 and f (x) = q(x)g(x) + r(x).
z2 + 6z + (11 + 9i)
iz + (2 2i) iz 3 + (2 + 4i)z 2 + (3 i)z + (40 4i)
iz 3 + (2 2i)z 2
6iz 2 + (3 i)z
6iz 2 + (12 12i)z
(9 + 11i)z + (40 4i)
(9 + 11i)z + (40 4i)
0
Thus, the quotient polynomial is q(z) = z 2 + 6z + (11 + 9i) and the remainder is the zero
polynomial. Therefore, g(z) divides f (z).
Dont forget that when dividing f (x) by g(x), you can always check your work by multiplying
g(x) by the quotient and adding the remainder. You should get f (x)!
Exercise 3 For each f (x) and g(x), find the quotient and remainder polynomials.
2. Complex polynomials:
f (z) = iz 3 + z 2 (1 + i)z + 10 and g(z) = z + 2i.
Chapter 36
Factoring Polynomials
36.1 Objectives
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, if c is a solution of the polynomial equation f (x) = 0.
The history of mathematics is replete with exciting and sometimes bizarre stories of math-
ematicians as they looked, in vain, for an algorithm that would find a root of any arbitrary
polynomial. It is known, though, that every complex polynomial has at least one root. This
was proved in 1799 by the brilliant mathematician Karl Friedrich Gauss.
253
254 Chapter 36 Factoring Polynomials
Interestingly, we can prove a root exists, we just cant construct one in general. The proof
of this fact and the Fundamental Theorem of Algebra are both demanding and are left for
later courses.
Instead, we will study some consequences of the Fundamental Theorem of Algebra and
investigate some special cases. First, in this section we consider an arbitrary field and recall
the Division Algorithm for Polynomials.
f (x) = q(x)g(x) + r(x) where r(x) is the zero polynomial or deg r(x) < deg g(x).
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) < deg(x c) = 1 or r(x) is the zero polynomial.
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 .
Equivalently,
Lemma 6 Let F be a field and let f (x), g(x) and h(x) be polynomials in F[x].
Exercise 1 Prove Lemma 6. Show that it is false if we extend the definition of polynomial to allow
coefficients to be taken from Z6 .
This lemma, induction, and the Factor Theorem, allow us to prove the following.
Proposition 7 If f (z) is a polynomial of degree n 1 over a field F, then f (z) has at most n roots in F.
REMARK
We learned that when considering multiplication and division, the prime numbers are the
basic building blocks of the positive integers. What happens with polynomials? Can we
always factor a polynomial? Is there an analogy of prime numbers for polynomials? We
will move towards answering this question as the course winds down.
The Remainder Theorem and Factor Theorem give us a connection between roots and linear
factors. What about factors of higher degree? It turns out that sometimes we can factor
polynomials (into non-linear factors) even if the polynomial does not have any roots. All of
this only makes sense with respect to a specific field.
Definition 36.2.2 Let F be a field. We say a polynomial of positive degree in F[x] is reducible in F[x] when
Reducible, it can be written as the product of two polynomials in F[x] of positive degree. Otherwise,
Irreducible we say that the polynomial is irreducible in F[x].
256 Chapter 36 Factoring Polynomials
Lemma 6 tells us that all linear polynomials are irreducible over any field. However, the
next example shows that not all irreducible polynomials are linear.
Example 2 Consider the polynomial f (x) = x2 + 1. It is reducible in C[x] because f (x) = (x i)(x + i).
However, it is irreducible in R[x]. Why? Using Lemma 6, the only possible way to write
f (x) as a product of irreducible polynomials in R[x] is as a product of two real linear factors.
However, we know that x2 + 1 does not have a real root so the Factor Theorem tells us this
is impossible.
REMARK
In future courses, you might also encounter polynomial analogies of greatest common divisor
and the Euclidean Algorithm.
The Division Algorithm for Polynomials, Remainder Theorem, Factor Theorem are true for
any field. We also saw that the degree of a polynomial is an upper bound on the number
of roots of the polynomial.
For complex polynomials, we have the Fundamental Theorem of Algebra and can use it to
prove a particularly close connection between roots and factorization of complex polynomi-
als.
Since f (z) = (z c1 )q(z), then a complex number w is a root of f (z) if and only if
(w c1 )q(w) = 0 if and only if w = c1 or q(w) = 0. That is, the roots of f (z) are precisely
c1 and c2 , c3 , . . . , ck , the roots of q(z).
Therefore the statement is true when n = k and the result is true by the Principal of
Mathematical Induction.
Of course, the n roots of a complex polynomial of degree n may not be distinct. Put
another way, a number c can be a root of a polynomial more than once in which case the
corresponding linear polynomial (x c) will appear more than once in a full factorization
of the polynomial.
Definition 36.3.1 The multiplicity of a root c of a polynomial f (x) is the largest positive integer k such that
Multiplicity of a (x c)k is a factor of f (x).
Root
How do we go about actually factoring polynomials? In general, this is hard to do. If the
polynomial has degree five or more, there are no formulas for the exact values its roots using
addition, subtraction, multiplication and division. However, if the polynomial has integer
coefficients, we have a good starting point.
258 Chapter 36 Factoring Polynomials
In order to find a rational root of f (x), we only need to examine a finite set of rational
numbers, those whose numerator divides the constant term and whose denominator divides
the leading coefficient. Note that the theorem only suggests the rational numbers that might
be roots. It does not guarantee that any of these numbers are roots.
1, 21 , 3, 32 .
1
Thus, the only rational root is 2 .
p
Proof: If q is a root of f (x) then
n n1 2
p p p p
an q + an1 q + + a2 q + a1 q + a0 = 0.
Multiplying by q n gives
an pn + an1 pn1 q + + a2 p2 q n2 + a1 pq n1 + a0 q n = 0
and
an pn = q an1 pn1 + + a2 p2 q n3 + a1 pq n2 + a0 q n1 .
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 pn .
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 36.3 Factoring in Special Cases 259
REMARK
The phrase we can repeatedly use is a sign that the author is cheating a bit here. It
would be better to use a generalized form of Coprimeness and Divisibility and prove this
generalization by induction.
Exercise 4 Is x + 1 a factor of x10 + 1, or of x9 + 1? When does x + 1 divide (or not divide) x2n + 1
for n a positive integer? When does x + 1 divide (or not divide) x2n+1 + 1 for n a positive
integer?
Exercise 5 Prove that if p is a prime, then n p is irrational for any integer n > 1.
The next, very useful theorem is like a two for one special. If you find one non-real
complex root of a real polynomial, you get another one for free.
Example 5 Let f (x) = x4 x3 5x2 x 6. Given that i is a root of f (x), factor f (x).
Solution: Since f (x) is a polynomial with real coefficients, we can use the Conjugate Roots
Theorem. Thus, i and i are both roots and, by the Factor Theorem, (x i) and (x + i)
are factors of f (x). The product of these two factors is x2 + 1. Dividing f (x) by x2 + 1
yields a quotient of x2 x 6 which factors as (x 3)(x + 2). Thus
Exercise 6 Given that x + (2 + i) is a factor of f (x) = x4 + 4x3 + 2x2 12x 15, write f (x) as a product
of irreducible real polynomials and also as a product of irreducible complex polynomials.
Proof: Let c C be a root of f (x) where Im(c) 6= 0. Then by the Factor Theorem,
f (x) = (x c)q1 (x) for some q1 (x) C[x].
Now, by the Conjugate Roots Theorem, c is also a root of f (x). Hence
f (c) = (c c)q1 (c) = 0.
Since Im(c) 6= 0, then c 6= c, or c c 6= 0 which in turn means q1 (c) = 0. That is, c is a root
of q1 (x) and so by using the Factor Theorem again, we get that
q1 (x) = (x c)q2 (x) where q2 (x) C[x].
We substitute to get
f (x) = (x c)(x c)q2 (x) = g(x)q2 (x)
where g(x) = (x c)(x c). By Properties of Conjugates and Properties of Modulus,
g(x) = x2 (c + c)x + cc = x2 2Re(c)x + |c|2 .
Since 2Re(c) R and |c|2 R, g(x) is a real quadratic polynomial. All that remains is to
show that q2 (x) is in R[x]. From above, in C[x], we have that
f (x) = g(x)q2 (x) + r2 (x)
where r2 (x) is the zero polynomial. Using the Division Algorithm for Polynomials (DAP)
in R[x], we get
f (x) = g(x)q(x) + r(x)
where q(x) is in R[x] and the remainder r(x) is the zero polynomial or deg r(x) < deg g(x).
Now, every real polynomial is a complex polynomial, so we can also view this as a statement
in C[x]. As for any field, DAP over C tells us that the quotient and remainder are unique.
Therefore r(x) = r2 (x) is the zero polynomial and q(x) = q2 (x) has real coefficients.
REMARK
Notice how we used complex polynomials to prove a result about real polynomials. This is
one of many ways in which moving up to C from R gives us a more complete picture and
deeper understanding of the real world.
We leave proving this using induction and Real Quadratic Factors as an exercise. The main
idea is that complex polynomials of degree n have n roots, perhaps with repetitions. Those
roots which are real correspond to real linear factors. Those roots which are not real come
in conjugate pairs, and correspond to real quadratic factors (as a pair).
36.4 Examples
Example 6 For each of the following, you are given several roots of a polynomial f (x). Find a polynomial
in the given F[x] of lowest possible degree that has the given roots.
1. R[x]: 3 + 2i, 5.
Solution: Since we are looking for a polynomial in R[x], we can use the Conjugate
Roots
Theorem for complex roots. Hence, 3+ 2i
6 R will be paired with its conjugate
3 2i. The product of the corresponding factors will produce a real quadratic. Hence
one choice for the polynomial is,
f (x) = (x (3 + 2i))(x (3 2i))(x 5)
= (x2 6x + 11)(x 5)
= x3 11x2 + 41x 55.
2. C[x]: 3 + 2i, 5.
Solution: Since both 3 + 2i and 5 are complex numbers, the corresponding linear
factors are in C[x] so
f (x) = (x (3 + 2i))(x 5) = x2 (8 + 2i)x + (15 + 5 2i).
3. R[x]: 1 5, 2i, 0.
Solution: Since we are looking for a polynomial in R[x], we can use the Conjugate
Roots Theorem for complex roots. The only root not in R is 2i so we need to pair this
root with its conjugate 2i. The product of the corresponding factors will produce a
real quadratic. Hence one choice for the polynomial is,
f (x) = (x (1 5))(x 2i)(x + 2i)(x 0)
= (x (1 5))(x2 + 4)x
= (x (1 5))(x3 + 4x)
= x4 + (1 + 5)x3 + 4x2 + 4(1 + 5)x.
Example 7 Write each of the following polynomials f (x), as a product of irreducible polynomials in
F[x]. Cite appropriate propositions to justify the reasoning.
1. f (x) = x2 x 6 in Q[x].
Solution: The quadratic formula gives the roots 3 and 2. These are values in Q so
f (x) has linear factors x 3 and x + 2 by the Factor Theorem. Hence,
f (x) = (x 3)(x + 2)
2. f (x) = x2 x + 6 in Q[x].
Solution: The quadratic formula gives only complex roots in this instance. Since
complex numbers do not belong to Q there are no linear factors in Q[x]. Therefore
by Lemma 6, f (x) = x2 x + 6 is irreducible Q[x]. (Can you see why?)
1, 2, 21 .
Example 8 Factor f (x) = 3x4 5x3 + x2 5x 2 over R[x] and C[x] into a product of irreducible
polynomials.
Solution: Since all of the coefficients are integers, we can use the Rational Roots Theorem.
The divisors of a0 are {1, 2} and the divisors of an are {1, 3} so the only candidates
for rational roots are
1, 2, 13 , 23 .
Now test each of these candidates.
1
x 1 1 2 2 3 13 2
3 23
f (x) 8 12 0 100 100
27 0 52
9
104
27
Since 2 and 13 are roots, x 2 and x + 13 (or 3x + 1) are factors. We can perform long
division with f (x) and the divisor (x 2)(3x + 1) = 3x2 5x 2 to get
and
f (x) = (x 2)(3x + 1)(x i)(x + i) C[x].
264 Chapter 36 Factoring Polynomials
Example 9 Let f (z) = z 6 + 4z 4 + z 2 + 4. Given that f (2i) = 0, factor f (z) into a product of irreducible
polynomials over C[z].
Solution: Over C, a polynomial of degree six will have six linear factors. Since all of the
coefficients of f (z) are real, the Conjugate Roots Theorem applies. Since 2i is a root, 2i
is also a root. Thus
(z 2i)(z + 2i) = z 2 + 4
is a factor of f (z). Long division produces
f (z) = z 6 + 4z 4 + z 2 + 4 = (z 2 + 4)(z 4 + 1)
We now factor z 4 + 1 using the Complex n-th Roots Theorem applied to z 4 = 1. First,
we write 1 in polar form as
1 = 1(cos + i sin ).
So the four distinct roots are
4 + 2k + 2k
1 cos + i sin =
4 4
k k
cos + + i sin + for k = 0, 1, 2, 3.
4 2 4 2
When k = 1, z1 = cos 3 3 1 i
4 + i sin 4 = 2 + 2 .
When k = 2, z2 = cos 5 5 1 i
4 + i sin 4 = 2 + 2 .
When k = 3, z3 = cos 7 7 1 i
4 + i sin 4 = 2 + 2 .
Example 10 Let f (x) = [1]x2 + [1] Z3 [x]. Factor f (x) into a product of irreducible polynomials.
After substituting all three elements of Z3 , we see that f (x) does not have any roots.
Therefore it does not have any linear factors and by Lemma 6, there is no work to do.
Notice that the Fundamental Theorem of Algebra does not apply to polynomials over Zp .
Example 11 Let f (x) = [1]x4 + [2]x2 + [1] Z3 [x]. Factor f (x) into a product of irreducible polynomials.
As in the previous example, we can deduce that f (x) does not have any roots. This tells us
that f (x) does not have any linear factors. So by Lemma 6 we only need to check if f (x)
can be written as a product of quadratic polynomials. In fact, f (x) = ([1]x2 + [1])2 . Can
you see how we might have found this factorization in this case? In general, mathematicians
do not have efficient methods for factoring in Zp .
Part VII
265
Chapter 37
37.1 Objectives
2. Define bijection.
Earlier, we learned about nested quantifiers and used them to define the concept of functions,
surjections and injections. Here is a quick summary of the definitions.
REMARK
A rule f : S T is a function if and only if
s S !t T, f (s) = t
where the exclamation mark after the existential quantifier means unique.
266
Section 37.3 Composition of Functions 267
t T s S, f (s) = t
x1 S x2 S, f (x1 ) = f (x2 ) = x1 = x2
x1 S x2 S, x1 6= x2 = f (x1 ) 6= f (x2 )
REMARK
Suppose f is a rule that defines a mapping from set S to set T .
f is surjective if, for each element t T , there is at least one element s S so that
f (s) = t.
f is injective if, for each element t T , there is at most one element s S so that
f (s) = t.
We may combine two functions to create a third function using the concept of composition
of functions defined below:
Definition 37.3.1 Suppose S, T and V are three sets, and f : T V and g : S T are two functions. Then
Composition of we may define the composite function f g : S V , given by
Functions
f g(x) = f (g(x)) for all x S.
Note that for the composition f g to be defined, the codomain of g must be equal of
the domain of f . As a consequence, the composition g f may not be defined unless the
codomain of f is equal to the domain of g. Therefore f g and g f are quite different.
Mathematics makes great use of the composition of functions. The next proposition states
that the composition of onto functions is also onto.
268 Chapter 37 Compositions and Bijections
The next proposition asserts that the composition of one-to-one functions is also one-to-one.
Try discovering a proof before analyzing the one given below.
37.4 Bijections
Definition 37.4.1 A function f : S T is bijective if and only if f is both surjective and injective.
Bijective
REMARK
Put another way, saying a function f : S T is bijective means that for each element
t T , there is exactly one element s S such that f (s) = t.
Example 1 For each of the following functions, determine if the function is a surjection, injection, or
bijection.
1. f : R R defined by f (x) = ex .
Solution: This function is not surjective. Consider the real number 1. Since
f (x) > 0 for all x R, there is no real number x0 so that f (x0 ) = 1. To show
that this function is injective, let x1 , x2 R and suppose that ex1 = ex2 . Taking the
natural log of both sides gives ln(ex1 ) = ln(ex2 ) which implies that x1 = x2 . Since f
is not surjective, it is not bijective.
Section 37.4 Bijections 269
37.4.1 Inverses
There are many instances in mathematics when undoing an operation is very useful. Sub-
traction undoes addition. Division undoes multiplication. Taking a square root undoes the
operation of squaring. Here is a way to generalize all such undoings.
A common mistake is to assume that the inverse is the reciprocal. The inverse of the
function f (x) = x2 is f 1 = x, not 1/x2 .
It is not surprising that the function f in our example is bijective. The following theorem,
which we will not prove, establishes the fact that inverses only exist for bijective functions.
Bijections are commonly used in calculus to identify invertible functions. Bijections are
used in linear algebra and group theory to show that two algebraic structures, which may
look very different, are essentially the same. We will use bijections to count.
Chapter 38
Counting
38.1 Objectives
1. Define what it means for two sets to have the same cardinality.
Many, many years ago, Dr. Furino lived high up in the mountains of southern Africa. Herd
boys would be sent with their flocks of sheep and goats to the high pastures to allow the
animals to graze. The herd boys were uneducated, and very few knew how to count. So,
how did they know if they had the right number of animals at any given time? An animal
might get lost at night, be out of sight among the ridges during the day, or be taken by
jackals.
Before the herd boys were sent out from their family compounds they would be given a
very small bag that contained pebbles, one pebble for each animal. So, to count the
animals, they would simply match up a pebble against each animal they could see. If there
were more pebbles than animals, an animal was missing. If there were more animals than
pebbles, another animal had joined their flock, presumably from a nearby herd. If there
was exactly one pebble for each animal, the herd boy had the correct number of animals.
The herd boys counted by forming a bijection between the set of pebbles in their bag
and the set of animals in their flock. When we count by saying 1, 2, 3, . . . we are creating
a bijection between a subset of the integers and the set of objects we are counting. Now,
how do we formalize this idea?
271
272 Chapter 38 Counting
Recall that we used the notation |S| to mean the cardinality, or number of elements, in the
set S. Now it is time to be clear about what that really means.
Definition 38.3.1 If there exists a bijection between the sets S and T , we say that the sets have the same
Cardinality cardinality and we write |S| = |T |.
Let Nn denote the set of all natural numbers less than or equal to n.
N0 =
N1 = {1}
N2 = {1, 2}
N3 = {1, 2, 3}
Nn = {1, 2, 3, . . . , n}
Definition 38.3.2 If there exists a bijection between a set S and Nn , we say that the number of elements
Number of in S is n, and we write |S| = n. Moreover, we also say that S is a finite set. If no bijection
Elements, Finite, exists between a set S and Nn for any n, we say that S is an infinite set.
Infinite
This formal definition corresponds exactly to what herd boys do with pebbles, what children
do when counting on fingers, and what we do when counting with the words one, two,
three. This definition extends the bijection notion to infinite sets as well, but that extension
brings some weirdness which we will see next lecture.
The presence of an existential quantifier in the conclusion suggests we use the construct
method. Lets begin by identifying the parts of the quantified sentence.
Quantifier:
Variable: f
Domain: all functions from S to T
Open sentence: f : S T is a bijection.
Section 38.5 Showing That a Bijection Exists 273
To show that the open sentence is true, we must show that f is a bijection, that is, we must
show that f is surjective and injective. So any proof that |S| = |T | which uses bijections
will have the following structure.
Proof in Progress
In practice, the first two steps are usually combined and authors typically write Consider
the function f mapping from S to T defined by .... The task of verifying that the rule is
really a function is left to the reader. A more formal proof would require that the details be
presented, but this is where understanding your audience is important. In many instances,
verifying that a rule is a function is straightforward and including such a verification would
actually distract from the proof. With the preceding remark in mind, and already knowing
how to handle Steps 3 and 4, we can produce a more typical proof structure.
Proof in Progress
The structure contains two parts which are, in themselves, proofs: a proof that f is surjec-
tive, and a proof that f is injective.
We should emphasize that bijections are not the only way to show that two sets have the
same cardinality. We can use bijections to establish propositions which are simpler to work
with, and then use the propositions.
REMARK
Even though it is often obvious that a rule is a function, we want to emphasize that many
common rules are not functions. For example, the (x, y) pairs that satisfy x2 + y 2 = 1 do
not constitute a function using the rule f (x) = y since (0, 1) and (0, 1) are among the
pairs. That is, x = 0 does not map to a unique value of y. The parabola x = y 2 is not a
function. Though y = sin x is a function, its reflection in the line y = x, x = sin y, is not a
function which is why the domain must be restricted when you are looking for an inverse
sine relation.
Many real life rules are not functions. Think of a university timetable which implicitly
embeds a rule that maps rooms to students. Since one room contains many students, the
rule that maps rooms to students is not a function.
274 Chapter 38 Counting
We begin by proving two fundamental theorems about counting and sets for which you
probably already have an intuitive understanding but may never have proved.
|S T | = |S| + |T |.
A simple example can be taken from any room in any building. If S is a set of m chairs in
the room, and T is a set of n tables in the room, then the number of tables and chairs is
m + n.
Before we read a proof of the Cardinality of Disjoint Sets, it is important to keep two things
in mind. First, we are proving a statement about set cardinality, not a statement about
set equality. Second, to establish basic properties of set cardinality we must work with
bijections.
The intuitive idea underlying the proof is very simple. Count the first m elements in S, and
then continue counting the next n elements in T . As you will see, a formal proof is more
complicated. Note how closely the proof follows the structure described in the previous
section.
Proof: (For reference, each sentence of the proof is written on a separate line.)
6. Thus
|S T | = |Nm+n | = m + n = |Nm | + |Nn | = |S| + |T |
Analysis of Proof As usual, we begin with the hypothesis and the conclusion.
Sentence 1 Since S is a finite set, there exists a bijection f : S Nm for some non-
negative integer m, and |S| = m.
This makes use of the hypothesis and the definition of Nm . The second sentence is
similar.
Sentence 2 Since T is a finite set, there exists a bijection g : T Nn for some non-
negative integer n, and |T | = n.
Sentence 3 Before looking at Sentence 3, we are going to skip ahead to the last sentence.
Fortunately, when reading a proof we are free to do that. This last sentence drives
what we need to do. Sentence 3 constructs a function h : S T Nm+n . How are
we going to use h?
The first equality sign relies on the bijection h. All of the remaining equality signs
can be justified from the definition of N` or Sentences 1 and 2. The difficult part is
constructing h and then establishing that h is a bijection. Sentence 3 constructs a
function h : S T Nm+n as follows.
f (x) if x S
h(x) =
g(x) + m if x T.
Notice that h is defined in terms of f and g. Note also that elements in the set S will
be mapped to the integers 1, 2, . . . , m and the elements in the set T will be mapped
to the integers m + 1, m + 2, . . . , m + n.
Having defined a function h, the author must still establish
276 Chapter 38 Counting
h is surjective
h is injective
This occurs in the next two paragraphs, each of which is a proof in its own right.
Self Check 1 The rule h : S T Nm+n defined below appears in the proof of the Cardinality of Disjoint
Sets.
f (x) if x S
h(x) =
g(x) + m if x T
Prove that the rule is a function.
|S T | = |S| + |T | |S T |.
After having just endured an arduous proof, you might be disinclined to go looking for a
complicated mapping and then proving that it is a bijection. Thats sensible. What we can
do in this case is to use the Cardinality of Disjoint Sets by writing S T and T as the union
of disjoint sets.
Proof in Progress
3. To be completed.
But now that we have the unions of finite disjoint sets we can invoke the Cardinality of
Disjoint Sets.
Proof in Progress
Subtracting the two cardinality equations and rearranging will give us what we need. Take
a minute to read a complete proof.
S T = S (T S),
|S T | = |S| + |T S|.
T = (S T ) (T S)
|T | = |S T | + |T S|.
|S T | |T | = |S| |S T |
hence
|S T | = |S| + |T | |S T |
as required.
The proof uses the same partitioning idea that was used in the proof of the Cardinality of
Intersecting Sets.
S (T S) = T.
|S| + |T S| = |S (T S)| = |T |.
Example 2 Suppose S is a non-empty finite set with k elements and a 6 S. Find a bijection f from
S {a} to Nk+1 . You do not need to prove that f is a bijection, simply state it. Use this
bijection to prove that |S {a}| = |S| + 1.
Proof: Since S is a non-empty finite subset, there exists a bijection g between S and Nk
for some integer k. Define f as follows.
g(x) if x S
f (x) =
k + 1 if x = a.
Now
|S {a}| = |Nk+1 | = k + 1 = |S| + 1
as needed.
39.1 Objectives
With respect to counting, finite sets behave pretty much as we expect. For example, if S is
a proper subset of T , then |S| < |T |.
This is not the case for infinite sets. Consider the following proposition.
Proposition 1 Let 2N be the set of even natural numbers. Then |N| = |2N|.
Lets be clear about what this proposition is saying. Even though the set of positive even
numbers is a proper subset of the set of natural numbers, and even though there are infinitely
many odd numbers excluded from the set of even numbers, the cardinality of the sets of
even numbers and all natural numbers is the same!
How would we prove this? Two sets have the same cardinality if and only if there exists a
bijection between the two sets. So we can use the same proof structure that was used in
the previous chapter to build a bijection between two sets.
Proof in Progress
3. We show that f is injective. Let s1 , s2 N and suppose that f (s1 ) = f (s2 ). Now we
show that s1 = s2 to be completed.
279
280 Chapter 39 Cardinality of Infinite Sets
f (s) = 2s
N 1 2 3 4 ...
2N 2 4 6 8 . . .
3. We show that f is injective. Let s1 , s2 N and suppose that f (s1 ) = f (s2 ). Now we
show that s1 = s2 (to be completed ).
There are infinitely many rational numbers between the natural numbers 1 and 2 so it is
a real shock to most people that the cardinality of the positive rational numbers and the
natural numbers is the same. For technical reasons, we wont prove that but we will prove
something very close. Consider the sets
N N = {(a, b) | a, b N}
and n a o
Q>0 = a, b N, gcd(a, b) = 1 .
b
The obvious mapping f : Q>0 N N defined by
a
f = (a, b)
b
is injective but not surjective since, for example, (2, 2) N N but 22 6 Q>0 . Since N N
is at least as large as Q>0 , it is even more surprising that N N and N have the same
cardinality.
Section 39.4 Infinite Sets Are Even Weirder Than You Thought 281
Proposition 2
|N N| = |N|
To prove this we will make use of the following proposition, whose proof will be left as an
exercise.
Example 1 Here are some examples of the Even-Odd Factorization of Natural Numbers.
60 = 22 15
64 = 26 1
65 = 20 65
Here is a proof that |N N| = |N|. Notice how closely it follows the proof structure that we
have been using.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Consider the function f : N N N defined by f (a, b) = 2a1 (2b 1). Observe that
mathematicians usually write f (a, b) instead of f ((a, b)).
2. We show that f is surjective. Let t N. By the Even-Odd Factorization of Natural
Numbers, t = 2i q where i is a non-negative integer and q is an odd natural number.
Since q is odd, there exists a natural number b such that q = 2b 1. If t is odd then
t = 20 (2b 1) and f (1, b) = t. If t is even then there exists a natural number a so
that t = 2a1 (2b 1) and f (a, b) = t.
3. We show that f is injective. Let (a, b), (c, d) NN and suppose that f (a, b) = f (c, d).
But then
f (a, b) = f (c, d) 2a1 (2b 1) = 2c1 (2d 1)
(2a1 = 2c1 ) and (2b 1 = 2d 1)
(a = c) and (b = d)
(a, b) = (c, d)
as required.
4. Hence, f : N N N is a bijection and |N N| = |N|.
You might well ask, do all infinite sets have the same size? The surprising answer is no.
282 Chapter 39 Cardinality of Infinite Sets
Recall that (0, 1) denotes the open interval of real numbers between 0 and 1. That is
Proposition 4 The set of natural numbers and the open interval (0, 1) of real numbers do not have the
same cardinality. That is, |N| =
6 |(0, 1)|
Proof: By way of contradiction, assume that |N| = |(0, 1)|. But then some bijection
f : N (0, 1) must exist. Write each element of (0, 1) as an infinite decimal and list all of
the real numbers in (0, 1) as follows.
Construct the real number c = 0.c1 c2 c3 c4 . . . as follows. For ci , choose any digit from
1, 2, 3, . . . , 8 with the property that ci 6= aii . The number c does not end in an infinite
sequence of 0s or 9s so has only one decimal representation (a subtlety that requires its
own explanation in another course). The real number c appears nowhere in the list since it
differs from f (i) in position i for every i.
But then f is not surjective, hence not bijective which contradicts our assumption.
Can we say that the cardinality of one infinite set is less than or greater than another
infinite set?
Can there be infinite sets whose cardinality lies between that of other infinite sets of
distinct cardinalities?
These are very interesting questions with even more interesting answers. Unfortunately, the
questions and answers will have to be left to another course.
Index
283
284 Chapter 39 INDEX
remainder, 102
remainder polynomial, 251
root, 253
term, 247
theorem, 15
Transitivity of Divisibility, 34, 37
Truth Table, 19
union, 48
universe of discourse, 46, 47, 53, 55, 59
upper bound of summation, 104