Introduction to
Advanced Mathematics
Randall R. Holmes
Auburn University
c 2015 by Randall R. Holmes
Copyright Last revision: April 25, 2017
This work is licensed under the Creative Commons AttributionNonCommercial-NoDerivatives 4.0 International License. To view a copy
of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
1
Preliminaries
1.1
Set basics
A set is a collection of objects, called elements. A set can be described by
listing its elements. For example,
{a, b, c}
is the set with elements a, b, and c.
A set can be described by listing just some of its elements followed by dots
if the pattern is clear. For example, the set
{1, 2, 3, . . . }
has elements 1, 2, 3, 4, 5, and so forth. And the set
{5, 10, 15, . . . , 100}
has elements 5, 10, 15, 20, 25, and so forth, ending with 90, 95, 100.
Put A = {1, 2, 3}. (This sentence says that the letter A now serves as a
substitute (a nickname) for the set {1, 2, 3}.) The notation 3 ∈ A says that
3 is an element of A. The notation 4 ∈
/ A says that 4 is not an element of
A.
Put
N = {0, 1, 2, 3, . . . }
(set of natural numbers),
Z = {. . . , −3, −2, −1, 0, 1, 2, 3, . . . }
(set of integers),
+
Z = {1, 2, 3, . . . }
(set of positive integers),
R = set of real numbers.
The set R of real numbers is the set of all numbers having a decimal representation (with possibly infinitely many digits to the right of the decimal
point). This set comprises all of the familiar numbers. In particular, it√includes all fractions (and hence all integers) as√well as numbers such as 2,
π, and e (but not the imaginary number i = −1).
The set with no elements is called the empty set. It is denoted ∅.
1
For a natural number n, if a set X has precisely n elements we say that X
has cardinality n, and we write |X| = n. For instance, if X = {a, b, c},
then |X| = 3. Also, |∅| = 0.
The way one reads the notation n ∈ N depends on the context. Here are
some examples:
Since 5 ∈ Z . . . .
Let n ∈ N.
For every x ∈ R . . . .
1.2
Since 5 is an element of Z . . . .
Let n be an element of N.
For every x in R . . . .
String
Put x = 3 and y = 5. We have
x + y = 3 + 5 = 8.
This is an example of what we refer to as a “string.” The point of this string
is to say that the ends are equal, in other words, that x + y = 8. The string
helps the reader verify this equality: x + y equals 3 + 5 (by substitution),
which equals 8 (by simple arithmetic).
1.2.1 Example
x + y = 3/2.
Put x = 7/2 and y = −2. Use a string to say that
Solution We have
7
7
x + y = + (−2) = +
2
2
−4
2
=
7−4
3
= .
2
2
Discussion: Note that we do not summarize by writing [ Therefore, x + y =
3/2 ] . The string already says this, so it would be redundant to say it again.
Strings can be used to help the reader see not only equalities but other
relationships as well.
1.2.2 Example
2x + y > 7.
Put x = 6 and y = −4. Use a string to say that
2
Solution We have
2x + y = 2(6) + (−4) = 8 > 7.
Discussion: The string shows that 2x + y is greater than 7 by first showing
that 2x + y equals 8 and then pointing out that 8 is greater than 7 so that
2x + y must be greater than 7 as well.
1.2.3 Example
4x + 3y ∈ N.
Put x = 9/2 and y = 2/3. Use a string to say that
Solution We have
9
2
4x + 3y = 4
+3
= 18 + 2 = 20 ∈ N.
2
3
There are a few exceptions to the rule that a string is meant to express a
relationship between its ends. The context usually makes it clear what is
meant in these cases.
1.2.4 Example
strings:
The following are exceptions to the rule for reading
(a) Let x ∈ Z with −2 < x < 5. (Meaning: Let x be an integer such that
x > −2 and x < 5, that is, such that x is between −2 and 5.)
(b) Let m, n ∈ Z with m 6= 0 6= n. (Meaning: Let m and n be integers
with m 6= 0 and n 6= 0. The condition is better expressed by writing
m, n 6= 0.)
(c) Let 0 6= a ∈ Z. (Meaning: Let a ∈ Z with a 6= 0, that is, let a be a
nonzero integer.)
Discussion:
In part (b), there is no danger of interpreting the string as
expressing a relationship between m and n. In general, a string that has two
occurrences of 6= cannot say anything meaningful about how the ends relate.
For instance, we have 1 6= 2 6= 1 as well as 1 6= 2 6= 3. In the first case, the ends
are equal, while in the second case they are not equal.
3
1.3
Pattern matching
For n ∈ Z+ , put An = {1, 2, 3, . . . , n}. Then we have, for instance,
A10 = {1, 2, 3, . . . , 10}.
The notation A10 matches the pattern An with 10 playing the role of the n,
so we get this equation by replacing n by 10 in the definition of An .
We are writing 1, 2, 3, . . . , n to mean the list starting with 1 and ending with
n, so the numbers 2 and 3 need not actually appear. For instance, A1 = {1}.
1.3.1
Example
For n, m ∈ Z, put n ∗ m = 2nm .
(a) We have 1 ∗ 3 = 21·3 = 23 = 8.
(b) We have (1 ∗ 2) ∗ 0 = (21·2 ) ∗ 0 = 4 ∗ 0 = 24·0 = 1.
2 −m2
(c) For n, m ∈ Z, we have (n − m) ∗ (n + m) = 2(n−m)(n+m) = 2n
.
Discussion: In part (a), the expression 1 ∗ 3 matches the pattern n ∗ m with
1 playing the role of the n and 3 playing the role of the m.
In part (c), the letters n and m do not have the same meanings that they have
in the definition of n ∗ m. Rather, the expression (n − m) ∗ (n + m) matches
the pattern n ∗ m with n − m playing the role of the n and n + m playing the
role of the m.
1.3.2
Example
For n ∈ Z+ , let P (n) denote the statement
1 + 2 + 3 + ··· + n =
n(n + 1)
.
2
(a) P (4) is the statement 1 + 2 + 3 + 4 =
4(4 + 1)
.
2
(b) P (1) is the statement 1 =
1(1 + 1)
.
2
4
(c) For n ∈ Z+ with n > 1, P (n − 1) is the statement
1 + 2 + 3 + · · · + (n − 1) =
Discussion:
role of n.
(n − 1)((n − 1) + 1)
.
2
In part (a), P (4) matches the pattern P (n) with 4 playing the
In part (b), 1 plays the role of n and, since 1 + 2 + 3 + · · · + n means to start
with 1 and add successively higher integers up to n, this sum is just 1.
In part (c), n − 1 plays the role of n.
1.3.3 Example
For a, b, n ∈ Z we say that a is congruent to b modulo
n if a − b = kn for some k ∈ Z.
(a) Is it true that 10 is congruent to 4 modulo 3?
6 = (2)3.)
(b) Is it true that 3 is congruent to 9 modulo 5?
k5 for all k ∈ Z.)
(Yes, since 10 − 4 =
(No, since 3 − 9 = −6 6=
Discussion:
For a, b, n ∈ Z, the phrase [ a is congruent to b modulo n ] is
meant to be a substitute (a nickname) for the phrase [ a − b = kn for some
k ∈ Z ] . In part (a) the wording
10 is congruent to 4 modulo 3
matches the pattern
a is congruent to b modulo n
with 10 playing the role of a, 4 playing the role of b, and 3 playing the role of
n. So the question is the same as the question [ Is it true that 10 − 4 = k3 for
some k ∈ Z? ] . As observed, this is true since one can let k = 2.
5
1.4
Function basics
The reader is no doubt familiar with the notion of a function, such as the
function f given by f (x) = x2 . The understanding is that if you give this
function the input 3, it gives you the output 32 . If you give it the input −2,
it gives you the output (−2)2 . And so forth. So f can be regarded as a rule
for taking an input and producing an output.
In the formula f (x) = x2 , the letter x represents the input. It can be any
real number. The notation f (x) represents the output corresponding to the
input x. The formula says that, for a given input x, the corresponding
output f (x) is x2 :
f (x)
O
=O
x2O .
output corres. to x
is
this
Let X and Y be sets. A function f from X to Y (written f : X → Y )
is a rule that assigns to each element x of X a unique element f (x) of Y ,
depicted using a Venn diagram like this:
f
X
x
Y
f (x)
We regard a function as a device that takes an input and produces an output.
If the function f is given the input x, it produces the output f (x).
The set X is the domain of f and the set Y is the codomain of f .
The codomain of f is a set that contains all of the outputs, but it might also
contain elements that are not outputs. For instance, the function f : R → R
given by f (x) = x2 has codomain R, but this set contains the element −1,
which can never occur as an output. The set of all outputs of f is called the
image of f . So in this example, the image of f is the set of all nonnegative
real numbers.
6
(One sees the term “range” of f . Some authors use this to mean “codomain”
and others use it to mean “image.” Because of the potential confusion the
term has fallen out of favor and it is best not to use it at all.)
The notion of pattern matching discussed in the preceding section applies
to function notation.
1.4.1
Example
Define f : Z → Z by f (n) = 2n + 3.
(a) f (5) = 2(5) + 3 = 13.
(b) For a ∈ Z, f (a) = 2a + 3.
(c) For n ∈ Z, f (n − 4) = 2(n − 4) + 3 = 2n − 5.
(d) For x ∈ Z, f (f (x)) = f (2x + 3) = 2(2x + 3) + 3 = 4x + 9.
2
2
(e) For m ∈ Z, f (m4 ) = 2m4 + 3 = 4m8 + 12m4 + 9.
Discussion: In part (a), f (5) matches the pattern f (n) with 5 playing the
role of the n. In part (b), the letter a plays the role of the n.
In part (c) the n in the notation f (n − 4) does not have the same meaning that
it has in the definition f (n) = 2n + 3. Rather, f (n − 4) matches the pattern
f (n) with n − 4 playing the role of the n.
In part (d), the first step replaces f (x) with what it equals, namely, 2x + 3.
Then f (2x + 3) matches the pattern f (n) with 2x + 3 playing the role of the n.
In part (e), the first step replaces f (m4 ) with what it equals, namely, 2m4 + 3.
Then the expression is expanded and simplified.
1 – Exercises
1–1 Write a sentence using symbols to say that the letter E is to serve as
a substitute (a nickname) for the set of even integers from 2 to 1000.
1–2 Rewrite each of the following sentences replacing the symbols “∈” and
“∈”
/ by appropriate words.
7
(a) Let r ∈ R.
(b) Therefore, x/2 ∈
/ Z for some x ∈ Z.
(c) If n ∈ N, then n + m ∈ N for every m ∈ N.
1–3 Put x = 4 and y = 7. Use a string to say that 3(x − 2) = y − 1.
1–4 Put a = 1, b = −3, and c = 3. Use a string to say that b2 − 4ac < 0.
1–5 Put a = 1 and b = 2. Use a string to say that (a + b)2 6= a2 + b2 .
1–6 Put r = −2/3 and s = 8. Use a string to say that 12sr −
s
2
∈
/ N.
1–7 In each case, rewrite the statement to avoid the use of a string.
(a) We have 0 ≤ n ∈ Z.
(b) Let x, y ∈ R with 0 < x ≤ y ≤ 10.
(c) Therefore, z1 = z2 = · · · = zn = 0.
1–8 For m, n ∈ R with m, n > 0, put m n = nm . In each case below,
rewrite the expression so that no longer appears, and simplify if possible.
(Write a string beginning with the given expression and ending with the
simplified expression.)
(a) 3 2 = · · · .
(b) (2 (1/2)) 16 = · · · .
(c) For l, m, n ∈ R with l, m, n > 0, (m l)(n l) = · · · .
1–9 For x, y ∈ N with x ≤ 3y , put Ax,y = {x, x + 1, x + 2, . . . , 3y } and
Bx = Ax,x+2 . Write each of the following sets in list form.
8
(a) A5,2 = · · · .
(b) A0,0 = · · · .
(c) B2 = · · · .
1–10 For n ∈ Z+ , let P (n) be the statement
n2 ≥ 2n + 3.
(a) Write the statement P (5).
(b) Is the statement P (2) true? Explain.
(c) Let n ∈ Z+ with n > 1. Write the statement P (n − 1).
1–11 For n ∈ Z, put f (n) = n + 1. In each case below, rewrite the
expression so that f no longer appears, and simplify if possible. (Write a
string beginning with the given expression and ending with the simplified
expression.)
(a) f (4) = · · · .
(b) f (f (−1)) = · · · .
(c) For n, m ∈ Z, f (n + m) − n = · · · .
1–12 For n, m ∈ Z we say that n divides m (written n | m) if m = kn for
some k ∈ Z.
(a) Is it true that −3 divides 12? Explain.
(b) Is it true that 6 | 20? Explain.
(c) Is it true that 5 | 0? Explain.
1–13 Define f : R → R by f (x) = 2x x.
(a) Find f (3).
9
(b) Given a ∈ R, find f (a).
(c) Given x, h ∈ R, find f (x + h).
(d) Find (f (−1))2 + 1.
(e) Find f (f (1))f (−2).
(f) Given ♥ ∈ R, find f (♥).
10
2
2.1
Proofs - I
And and Or
Let n ∈ Z and assume that 1 ≤ n ≤ 3. The following is an example of an
and statement and its proof:
Statement:
2n ≥ 2
and n + 4 < 8.
Proof : First, by assumption we have n ≥ 1, so multiplying by 2 gives 2n ≥
2. Second, by assumption we have n ≤ 3, so adding 4 gives n + 4 ≤ 7 < 8.
There are two claims being made in the statement, so the method is to prove
each separately.
Letting P stand for the statement 2n ≥ 2 and letting Q stand for the
statement n + 4 < 8 we see that the statement above has the form [ P and
Q ] . We record here the method for proving a statement of this form, called
an and statement.
Statement: P and Q.
Proof :
(Prove P and then prove Q.)
2.1.1 Example
and 2n + m > 3m.
Let m, n ∈ Z with n > m. Prove that n − 1 − m ∈ N
Proof First, n is an integer, so n−1 is also an integer. Since n > m it follows
that n − 1 ≥ m. Subtracting m from both sides we get n − 1 − m ≥ 0 and
since the difference of two integers is an integer, we conclude that n − 1 − m
is a nonnegative integer, that is, n − 1 − m ∈ N.
Second, multiplying both sides of n > m by 2 and adding m gives 2n + m >
2m + m = 3m.
Let n ∈ Z and assume that n2 − 3n − 4 ≥ 0. The following is an example of
an or statement and its proof:
11
Statement:
Proof :
n≥4
or n ≤ −1.
Assume that n 4. We have
(n − 4)(n + 1) = n2 − 3n − 4 ≥ 0.
Now n < 4, so n − 4 is a negative number, and dividing by it gives n + 1 ≤ 0,
so n ≤ −1.
The idea of the proof is that, if n ≥ 4, then the statement holds and there
is nothing to show, so we need only consider the case where n 4.
The statement above has the form [ P or Q ] . We record the method for
proving a statement of this form, called an or statement.
Statement:
Proof :
P or Q.
Assume that P does not hold. (Prove Q holds.)
As in the example above, there are two cases to consider: Either P holds or
P does not hold. The statement is true when P holds, so we do not need to
consider that case. Therefore, it is enough to assume P does not hold and
then prove that Q must hold.
By symmetry, one could also prove the statement by assuming Q does not
hold and proving P must hold.
Our use here of the word “or” is different from that in everyday language.
If a menu says that dinner comes with soup or salad, it is understood that
the customer cannot have both (without paying extra). This meaning of the
word is called exclusive or. In mathematics, the word “or” always has the
inclusive or sense, meaning that both options are possible.
In the next example, we need the following elementary fact: If x, y, and r
are positive real numbers and x < y, then xr < y r .
2.1.2 Example
mn > m.
Let m, n ∈ Z+ with m ≥ 2. Prove that n = 1 or
Proof Assume that n 6= 1. Then n > 1 so n − 1 is positive, implying
mn−1 ≥ 2n−1 > 1n−1 = 1, where we have twice used the fact stated before
the example. Therefore, mn = mn−1 m > 1m = m.
12
2.2
For-every
The following is an example of a for-every statement and its proof:
Statement:
For every x ∈ Z+ we have 2x + 3 ≥ 5.
Proof : Let x ∈ Z+ . We have x ≥ 1. Multiplying by 2 gives 2x ≥ 2 and
then adding 3 gives 2x + 3 ≥ 5.
The first sentence in the proof is [ Let x ∈ Z+ ] . This says, in effect, [ Let x
represent an arbitrary positive integer ] . The word “arbitrary” just means
that we make no assumption about x (except that it is a positive integer).
The rest of the proof shows that this x satisfies the inequality 2x + 3 ≥ 5.
Since x is arbitrary, the reader is convinced that the inequality must hold
for every x ∈ Z+ .
The proof can be regarded as a template for showing any particular positive
integer satisfies the condition. For instance, if we wish to see why 4 satisfies
the condition we can replace x by 4 in the argument and follow along: We
have 4 ≥ 1. Multiplying by 2 gives 2(4) ≥ 2 and then adding 3 gives
2(4) + 3 ≥ 5.
For x ∈ Z+ , let P (x) stand for the statement 2x + 3 ≥ 5. For instance,
P (4) is the statement 2(4) + 3 ≥ 5. With this notation, we can write the
statement above as
For every x ∈ Z+ , we have P (x).
We record the method for proving a general statement of this form, called
a for-every statement. Here, X is a set, and P (x) is a statement involving
x ∈ X:
Statement:
Proof :
For every x ∈ X, we have P (x).
Let x ∈ X. (Show that P (x) holds.)
2.2.1 Example
Define f : N → Z by f (x) = x3 . Prove: For every
x ∈ N, we have f (x + 2) > 7.
13
Proof Let x ∈ N. We have x ≥ 0, so adding 2 and cubing gives (x + 2)3 ≥
23 = 8. Therefore,
f (x + 2) = (x + 2)3 ≥ 8 > 7.
Discussion: Here is how we might come up with the idea for such a proof:
After writing [ Let x ∈ N ] we turn to the thing we are trying to prove, that is,
f (x+2) > 7. On scratch paper, we write what this means, which is (x+2)3 > 7.
We observe that this inequality does not hold for every number x (it fails for
x = −2, for instance). But then we remember that x is in N so that x ≥ 0.
This gives us the idea for why the claim holds.
The proof, however, does not include an explanation of how we came up with
the idea. In general, proofs do not explain how insight was obtained. Instead,
they simply present a logical sequence of steps that help the reader get from
what is known (here, x ∈ N), to what is being claimed (here, f (x + 2) > 7).
The for-every clause can be moved to the end without changing the meaning.
For instance, the statement in the preceding example can be written
We have f (x + 2) > 7 for every x ∈ N.
2.2.2
Example
Prove: We have
√
n + 8 − 3 ≥ 0 for every n ∈ Z+ .
+ = {1, 2, 3, . . . }, we have n ≥ 1. Adding 8 and
Proof Let n ∈ Z+ . Since Z√
√
√
taking square roots we get n + 8 ≥ 9 = 3. Therefore, n + 8 − 3 ≥ 0.
In the next example, the for-every statement involves two elements of the
set instead of just one. Our method extends in the natural way to handle
this case.
2.2.3 Example
Define f : R → R by f (x) = 7x. Prove: We have
f (x + y) = f (x) + f (y) for every x, y ∈ R.
Proof Let x, y ∈ R. We have
f (x + y) = 7(x + y) = 7x + 7y = f (x) + f (y).
14
Vacuously true
The following statement is true:
For every x ∈ ∅, we have x = x + 1.
This might seem surprising since canceling the x’s in the condition x = x + 1
leaves 0 = 1, which is clearly not true. The reason why the statement is true
is that no one can prove it is false by producing an element x in the empty
set ∅ for which x 6= x + 1. We say that the statement is “vacuously” true.
More generally, if X is a set and P (x) is a statement involving x ∈ X, then
the following statement is vacuously true:
For every x ∈ ∅, we have P (x).
2.3
There-exists
The following is an example of a there-exists statement and its proof:
Statement:
Proof :
There exists x ∈ N such that (x − 5)2 = 4.
Put x = 7. Then x ∈ N and (x − 5)2 = (7 − 5)2 = 22 = 4.
In the proof we exhibit a single, explicit x in N that satisfies the condition,
and this convinces the reader that the statement is true. To come up with
an x that works, we might have reasoned on scratch paper that such an x
would have to satisfy x − 5 = ±2, so that x = 7, 3. Noting that x = 7
does indeed satisfy the condition, we go back and begin the proof with [ Put
x = 7 ] . Then we show the reader that this x works.
There are two things to note about the proof:
• We did not show the reader how we came up with an x that works. If
we had included in the proof what we did on scratch paper it would
have caused confusion because the logic of the proof requires only that
an x be exhibited.
• We did not mention that x = 3 also works. A single x that works is
all that is required.
15
We record the method for proving a general there-exists statement. Here,
X is a set and P (x) is a statement involving x ∈ X.
Statement:
There exists x ∈ X such that P (x).
Proof : Put x = (something worked out on scratch paper). (Show
that x ∈ X and that P (x) holds.)
The method for proving a there-exists statement can be put succinctly: Give
a single, explicit example.
2.3.1
Example
Prove: There exists x ∈ Z such that 2x − 9 > 1.
Proof Put x = 6. Then x ∈ Z and 2x − 9 = 2(6) − 9 = 3 > 1.
Discussion:
On scratch paper we solve the inequality 2x − 9 > 1 for x to
get x > 5 and this is what gives the idea to use x = 6.
Although it is true that for any integer x with x > 5 the stated inequality
holds, we did not say this. The logic requires only that we exhibit a single x
that works and it is easier for the reader to check if an explicit x is provided.
We could also have used x = 51,384 and the proof would have been perfectly
valid. However, it is preferable to choose something simple and/or optimal.
The there-exists statement in the preceding example can be expressed as
follows:
We have 2x − 9 > 1 for some x ∈ Z.
This is an example of a for-some statement. Every there-exists statement
can be recast as a for-some statement and vice versa.
2.3.2 Example
n ∈ N.
Prove: We have n3 + 2 < 32 and 5n2 > 10 for some
16
(Note: The statement can be recast as [ There exists n ∈ N such that
n3 + 2 < 32 and 5n2 > 10 ] .)
Proof Put n = 2. Then n ∈ N and
n3 + 2 = 23 + 2 = 10 < 32
and
5n2 = 5(2)2 = 20 > 10.
Discussion: We need to exhibit an n ∈ N that satisfies the two inequalities.
On scratch paper, we simplify the inequalities to get n3 < 30 and n2 > 2 and
then use inspection to see that n = 2 works. (One sees that n = 3 also works,
but the logic of the proof requires that we exhibit only one n that works.)
2.4
Scope
In the preceding section, we proved the following statement:
For every x ∈ Z+ , we have 2x + 3 ≥ 5.
Is it true that 2x+3 ≥ 5? Actually, the letter x in this question is undefined,
so this question does not even make sense. This is a matter of “scope,” which
is our focus here.
In the for-every statement above, the letter x has meaning just to the end
of the sentence. It has the role of a dummy variable, meaning that x can be
replaced by any other letter without changing the meaning of the statement.
So the statement [ For every y ∈ Z+ , we have 2y + 3 ≥ 5 ] says exactly the
same thing as the statement above. With this new formulation it is clear
that the question [ Is it true that 2x + 3 ≥ 5? ] does not make sense.
When we write a letter to represent a mathematical entity, such as a number
or a set, the scope of that letter refers to the portion of the text that
starts where the letter is introduced and ends where the letter no longer has
meaning.
In the example above, the scope of the letter x ends at the end of the
sentence. We say that the letter x is “in scope” within the sentence and
17
“out of scope” otherwise. It is incorrect to refer to a letter after it has gone
out of scope.
A letter has local scope if its meaning ends at the end of the sentence in
which it is introduced (or earlier).
2.4.1
Example
(a) For every n ∈ N, the number n + 1 is a positive integer. It follows
that 2(n + 1) is an even positive integer.
(Incorrect. The letter n has local scope. It has no meaning in the
second sentence.)
(b) If x is a negative integer, then −x is a positive integer. Therefore,
−x + 1 is also a positive integer.
(Incorrect. The letter x has local scope. It has no meaning in the
second sentence.)
The preceding example illustrates typical ways that letters having local scope
are introduced.
A letter x introduced in either of the following ways has local scope:
• For every x . . . .
• If x . . . .
On the other hand, a letter has global scope if its meaning continues
indefinitely (usually to the end of the proof).
2.4.2
Example
(a) Let n ∈ N. The number n + 1 is a positive integer. It follows that
2(n + 1) is an even positive integer.
(Correct. The letter n has global scope. It represents a fixed element
of N and it retains that meaning indefinitely.)
18
(b) Put y = −5. The number −y is a positive integer. Therefore −y + 1
is also a positive integer.
(Correct. The letter y has global scope. It refers to the number −5
indefinitely.
The preceding example illustrates typical ways of introducing letters so that
they have global scope.
A letter x introduced in either of the following ways has global scope:
• Let x . . . .
• Put x . . . .
Letters introduced using a for-some phrase (or, equivalently, a there-exists
phrase) can have local scope or global scope depending on the situation.
The following example illustrates some common situations.
2.4.3
Example
(a) If y is a positive integer with y ≤ 10, then y − 2x ≤ 0 for some integer
x with x ≤ 5. We have 3x ≤ 15.
(Incorrect. The letter y is local, and x depends on y so it is local as
well. Therefore x has no meaning in the last sentence.)
(b) Let y be an even integer. Since y is even, y = 2x for some integer x.
We have x = y/2.
(Correct. The letter y has global scope. The letter x introduced in the
next sentence is a particular integer satisfying y = 2x so it has global
scope as well.)
(c) Let y be an even integer. Since y is even, there exists an integer x
such that y = 2x. Therefore, x = y/2.
(Correct. This is identical to part (b).)
In part (b) of the example, the phrase [ We have y = 2x for some integer
x ] is understood to include the follow-up phrase [ Let x be a fixed such
19
integer ] . Actually writing the follow-up phrase is more proper, but it is
usually regarded as being too pedantic.
A letter x introduced in a proof in either of the following ways has
global scope (unless it depends on a letter having local scope):
• . . . for some x . . . ;
• There exists x . . . ;
We end this section with some practice combining the notions introduced
above.
2.4.4 Example
In each case, write “Correct” if there are no attempts
to use a letter that is out of scope. Otherwise, write “Incorrect,” provide an
explanation, and then revise the argument to fix the mistake.
(a) Let y ∈ Z and put z = 2y. If x ∈ Z and x < y, then 2x < 2y = z. It
follows that 2x + 1 < z + 1.
Incorrect. The letter x introduced in the second sentence has local
scope. It has no meaning in the final sentence.
Revision: Let y ∈ Z and put z = 2y. Let x ∈ Z and assume that
x < y. Then 2x < 2y = z. It follows that 2x + 1 < z + 1.
(b) If x ∈ N, then xy ∈ N for every y ∈ N. Let x ∈ N. For every z ∈ N,
we have xz ∈ N.
Correct.
(c) Let n be a positive integer. For every m ∈ N there exists a positive
integer x such that x > n + m. Therefore, if m ∈ N, we have y > n,
where y = x − m.
Incorrect. The letter m introduced in the second sentence has local
scope, and the letter x depends on m so it has local scope as well.
Therefore, x has no meaning in the final sentence.
Revision: Let n be a positive integer. Let m ∈ N. There exists
a positive integer x such that x > n + m. We have y > n, where
y = x − m.
20
Discussion:
In part (b), although the letter x has local scope in the first
sentence, it is redefined in the second sentence and is given global scope.
In the original statement of part (c), the renewal of the letter m in the final
sentence does not cause x to have meaning again.
2 – Exercises
2–1 Let x ∈ Z with 2 ≤ x < 6. Prove that 4 − x > −2 and 3−x ≤ 1/9.
2–2 Let n ∈ Z and assume that (n − 3)2 < 16. Prove that n ≥ 0 and
n ≤ 6.
2–3 Let m, n ∈ Z and assume that mn − m = n2 − 1. Prove that n = 1 or
m = n + 1.
2–4 Let x ∈ Z+ and let y ∈ R with y < 2. Prove: (y − 2)x+3 < 0 or x is
odd.
2–5 Define g : Z → Z by g(x) = 3 − x and let n ∈ Z. Prove: We have
n < 2 or g(n − 1) < 3.
2–6 Prove: For every n ∈ N, we have 4 − 3(n + 2) ≤ −2.
2–7 Define f : N → N by f (n) = n2 . Prove: For every n ∈ N, we have
f (2n+1 ) ≥ 4.
2–8 Define h : Z+ → R by h(n) =
n ≥ 9, we have 1 − h(n) < 1/9.
n
. Prove: For every n ∈ Z+ with
n+1
2–9 Prove: We have 5(2n ) − 2 ≥ 3 for every n ∈ N.
21
2–10 Define f : R → R by f (x) = 23x . Prove: We have f (x + y) =
f (x)f (y) for every x, y ∈ R.
2–11 Let X be the empty set. True or false: For every x ∈ X, we have
x2 < −5. Explain.
2–12 Prove: There exists n ∈ Z such that n2 + n = 6.
2–13 Prove: There exists n ∈ Z+ such that |n − 3| < 2.
2–14 Define f : R → R by f (x) = x2 − x. Prove: f (x) < 0 for some
x ∈ R.
2–15 Define f : Z → R by f (n) =
√
3
2 − n.
(a) Prove that 1 < |f (n)| < 2 for some n ∈ Z+ .
(b) Prove that for every n ∈ Z with n > 29, we have f (n) + 3 < 0.
2–16 Let x ∈ N and assume that x3 − 10x > 0. Prove: We have x = 0 or
x < a for some a ∈ A, where A = {3, 4, 5, 6}.
2–17 In each case, write “Correct” if there are no attempts to use a letter
that is out of scope. Otherwise, write “Incorrect,” provide an explanation,
and then revise the argument to fix the mistake.
(a) Let n ∈ Z and put m = 3n − 1. We have n = (m + 1)/3.
(b) We have 5x + 1 > 0 for every x ∈ N. Therefore, x > −1/5.
(c) If n is an odd integer, then n − 1 is even, so n − 1 = 2m for some
integer m. This implies m = (n − 1)/2.
22
2–18 In each case, write “Correct” if there are no attempts to use a letter
that is out of scope. Otherwise, write “Incorrect,” provide an explanation,
and then revise the argument to fix the mistake.
(a) For every m ∈ Z+ , we have m ≥ 1. Let n ∈ N. Then n ≥ 0, so
n + m ≥ 0 + 1 = 1.
(b) Let x ∈ Z and assume that x > 5. There exists y ∈ Z such that y ≥ 0
and y ≤ x. Therefore, x − y ≥ 0 and x − y ≤ x.
(c) Let x ∈ Z. If y ∈ Z and y < x, then x − y ∈ N. Put z = x − y. We
have 2z ∈ N.
23
3
Set
3.1
Set builder notation
The notation
{x | x ∈ N and x < 4}
is read
“The set of all x such that x is in N and x is less than 4.”
(The vertical line corresponds to the words “such that”.)
The number 0 is an element of the set above, because, if we replace x by
0 in the condition, a true statement results, namely, [ 0 ∈ N and 0 < 4 ] .
Reasoning this way, we see that the given set in list form is {0, 1, 2, 3}.
If we let P (x) stand for the statement [ x ∈ N and x < 4 ] , then the notation
becomes
{x | P (x)}.
This is the standard form of set-builder notation. It denotes the set of
all elements x that satisfy the property P (x).
The notation
{x ∈ N | x < 4}
is read
“The set of all x in N such that x is less than 4.”
This variation on the standard form describes the same set as the one given
earlier, but it is more convenient because it makes it clear from the start
that the set consists of certain elements of the set N. So we imagine starting
with the set N = {0, 1, 2, . . . } and removing elements, retaining only those
that are less than 4, to get {0, 1, 2, 3}.
3.1.1
Example
(a) Is 8 ∈ A?
(b) Is 9/2 ∈ A?
Put A = {x ∈ N | 2x + 1 ≥ 10}.
(Yes, because 8 ∈ N and 2(8) + 1 = 17 ≥ 10.)
(No, because 9/2 ∈
/ N.)
24
(c) Is 4 ∈ A?
(No, because 2(4) + 1 = 9 10.)
(d) Write the set A in list form.
Discussion:
(We have A = {5, 6, 7, . . . }.)
Writing the set A in standard set builder notation we get
{x | x ∈ N and 2x + 1 ≥ 10}.
To show something is in A we need to show that when it plays the role of the
x in the property a true statement results. In part (a), we substitute 8 for x
to get the statement [ 8 ∈ N and 2(8) + 1 ≥ 10 ] , which is true, so we conclude
that 8 ∈ A.
In the notation {x ∈ N | x < 4} the letter x goes out of scope at the closing
brace (see Section 2.4). It functions as a dummy variable, meaning that it
can be replaced by any letter without changing the set. For instance, this
set can also be written {n ∈ N | n < 4}.
3.1.2
Example
(a) Is 2 ∈ K?
Put K = {k ∈ Z | |k − 3| ≤ 2}.
(Yes, 2 ∈ K because 2 ∈ Z and |2 − 3| = | − 1| = 1 ≤ 2.)
(b) Is it true that |k − 3| ≤ 2? (This question does not make sense. The
letter k has no meaning outside of the braces {. . . }.)
(c) Let k ∈ K. Is it true that |k − 3| ≤ 2? (Yes. The first sentence says
to let k be an arbitrary element of K, so it must be the case that k
satisfies the condition |k − 3| ≤ 2.)
Here is another useful variation on the standard form of set-builder notation.
The notation
{2x | x ∈ N},
is read
“The set of all elements of the form 2x such that x is in N.”
This set is the same as {0, 2, 4, . . . } since, as the variable x ranges through
the set N = {0, 1, 2, . . . }, the expression 2x takes on the values 0, 2, 4, . . . .
As before, the letter x in the notation loses its meaning at the closing brace.
It acts as a dummy variable, so this set can also be written {2n | n ∈ N},
for instance.
25
3.1.3
Example
Put B = {3n | n ∈ Z}.
(a) Is 7 ∈ B? (No. This is asking whether 7 is of the form 3n such that
n ∈ Z, which is not the case since there is no integer n for which
7 = 3n.)
(b) Is −12 ∈ B? (Yes. The reason is that −12 = 3(−4) and −4 ∈ Z, so
−12 is of the right form to be in B with −4 playing the role of the n.)
(c) Is 3n a multiple of 3? (This question does not make sense. The letter
n has no meaning outside of the braces {. . . }.)
(d) Write the set B in list form. (We have B = {. . . , −6, −3, 0, 3, 6, . . . }.
To get this, one imagines letting n range through the set Z = {. . . , −2,
−1, 0, 1, 2, . . . } and writing the corresponding elements 3n.)
Now that we have the requisite notation, we can add the set Q of rational
numbers (fractions) to our list of standard notations:
N = {0, 1, 2, 3, . . . }
(set of natural numbers),
Z = {. . . , −3, −2, −1, 0, 1, 2, 3, . . . }
(set of integers),
Q = {m/n | m, n ∈ Z, n 6= 0}
(set of rational numbers),
R = set of real numbers.
If X is a set consisting of some real numbers (i.e., X is a “subset” of R), we
use the notation X + for the set of positive elements of X:
X + = {x ∈ X | x > 0}.
This defines the sets Z+ , Q+ , and R+ of positive integers, positive rational
numbers, and positive real numbers, respectively. In particular,
Z+ = {1, 2, 3, . . . }.
The empty set, denoted ∅, is the set having no elements. (Note that braces
are not used here. In fact, {∅} is a set having a single element, namely the
empty set.)
The set {1, 1, 1, 2, 2} is the same as the set {1, 2}. In other words, repetitions
of set elements are ignored.
3.1.4 Example
Put A = {1, 2, 3, 4, 5}, B = {−1, 0, 1}, and C = {x, y}.
Write each of the following sets using list notation:
26
(a) D = {a ∈ A | a/2 ∈
/ Z}. Answer: D = {1, 3, 5}. (This is the set of
those elements a of A having the property that a/2 is not an integer.)
(b) E = {b ∈ B | 1 − 2b > 0}. Answer: E = {−1, 0}. (This is the set of
those elements b of B having the property that 1 − 2b > 0.)
(c) F = {c∗ | c ∈ C}.
and write c∗ .)
Answer: F = {x∗ , y ∗ }. (We let c range through C
(d) G = {ab | a ∈ A and b ∈ B}.
Answer:
G = {1, 1/2, 1/3, 1/4, 1/5, 2, 3, 4, 5}.
(We let a range through A and b range through B and write ab , removing repetitions. The additional step of writing, for instance, 2−1
as 1/2 is not essential.)
3.1.5
Example
Write the set S = {(−1)n | n ∈ N} in list form.
Solution We have S = {1, −1}.
Discussion:
We initially let n range through N to get
S = {(−1)0 , (−1)1 , (−1)2 , (−1)3 , . . . } = {1, −1, 1, −1, . . . },
but then we remove the repetitions.
3.1.6 Example
Put 5Z = {5n | n ∈ Z}. Prove: For every x, y ∈ 5Z,
we have x + y ∈ 5Z.
Proof Let x, y ∈ 5Z. By the definition of 5Z, we have x = 5n and y = 5m
for some n, m ∈ Z. Therefore,
x + y = 5n + 5m = 5(n + m) ∈ 5Z,
the last step due to the fact that n + m ∈ Z.
27
Discussion: Writing instead [ x = 5n and y = 5n for some n ∈ Z ] would be
assuming that x = y, which might not be the case since x and y are arbitrary
elements of 5Z. Using two letters, n and m, allows for the possibility x 6= y
while still allowing for equality since n = m is possible.
In order to show x + y ∈ 5Z we need to show that x + y = 5k for some k ∈ Z,
so using the method of Section 2.3, we could have written the following:
Put k = n + m. Then k ∈ Z and x + y = 5n + 5m = 5(n + m) = 5k ∈ 5Z.
However, in a simple case like this, the introduction of the auxiliary letter k is
considered unnecessary since the reader sees 5(n + m) ∈ 5Z and understands
that n + m plays the role of n in the definition of 5Z.
3.1.7
Example
Prove: For every x, y ∈ Q, we have xy ∈ Q.
Proof Let x, y ∈ Q. Since Q = {m/n | m, n ∈ Z, n 6= 0}, we have x = m/n
and y = m0 /n0 for some m, n, m0 , n0 ∈ Z with n, n0 6= 0. Therefore,
xy =
m m0
mm0
· 0 =
∈ Q,
n n
nn0
the last step due to the fact that mm0 , nn0 ∈ Z and nn0 6= 0.
3.2
Subset
Put X = {2, 3, 5} and Y = {1, 2, 3, 4, 5, 6, 7}:
Y
1
X
7
2
5 3
4
6
Every element of X is also an element of Y . We express this by saying that
X is a “subset” of Y and by writing X ⊆ Y . Here is the precise definition:
28
The set X is a subset of the set Y , written X ⊆ Y , if the following
holds:
For every x ∈ X, we have x ∈ Y .
If X ⊆ Y and X 6= Y , then X is a proper subset of Y and we indicate this
by writing X $ Y (some authors write X ⊂ Y ).
Note that for any set Y we have both ∅ ⊆ Y (this is vacuously so), and also
Y ⊆Y.
3.2.1 Example
Prove that X ⊆ Y .
Put X = {x ∈ Z | x ≥ 7} and Y = {y ∈ Z | y > 3}.
Proof Let x ∈ X. By the definition of X, we have x ∈ Z and x ≥ 7.
Therefore, x ∈ Z and x ≥ 7 > 3, implying x ∈ Y . We conclude that X ⊆ Y .
Discussion: According to the definition of subset, we have to show that for
every x ∈ X we have x ∈ Y , so we begin with “Let x ∈ X” (see Section 2.2).
After observing what this says about x we argue that x ∈ Y . This requires
two observations. First, x ∈ Z, which we know, and second, x > 3, which we
show using a string. We conclude that x ∈ Y since, when x plays the role of
the dummy variable y, a true statement results.
The point of this example is to illustrate the formal procedure for proving
that one set is a subset of another. Here, writing the sets as lists we get
X = {7, 8, 9, . . . } and Y = {4, 5, 6, . . . }, so we see less formally that X ⊆ Y .
3.2.2 Example
that X ⊆ Y .
Put X = {6n | n ∈ Z} and Y = {2n | n ∈ Z}. Prove
Proof Let x ∈ X. We have x = 6n for some n ∈ Z. Therefore,
x = 6n = 2(3n) ∈ Y,
the last step due to the fact that 3n ∈ Z. We conclude that X ⊆ Y .
29
Discussion: As before, we let x be an arbitrary element of X and show that
it must also be an element of Y . The string x = 6n = 2(3n) ∈ Y says that
x ∈ Y (look at the ends).
3.2.3 Example
Prove that X ⊆ Y .
Put X = {3n + 1 | n ∈ Z+ } and Y = {y ∈ Z | y > 2}.
Proof Let x ∈ X. We have x = 3n + 1 for some n ∈ Z+ . In particular,
x ∈ Z. Also, n ≥ 1, so
x = 3n + 1 ≥ 3(1) + 1 = 4 > 2,
whence x ∈ Y . We conclude that X ⊆ Y .
3.3
Interval notation
We use the usual interval notation for subsets of the set R of real numbers.
For instance,
[−2, 7) = {x ∈ R | −2 ≤ x < 7},
(4, ∞) = {x ∈ R | x > 4},
(−∞, 1] = {x ∈ R | x ≤ 1}.
A bracket next to the number means it is included in the set, while a parenthesis means it is not included. By convention, only parentheses are used
next to ∞ and −∞.
3.3.1
Example
Put Y = {y ∈ R | y − 1 > 2}. Prove that [4, ∞) ⊆ Y .
Proof Let x ∈ [4, ∞). Then x ∈ R and x ≥ 4. We have x ∈ R and
x − 1 ≥ 4 − 1 = 3 > 2. Therefore, x ∈ Y . We conclude that [4, ∞) ⊆ Y .
Discussion: We let x be an arbitrary element of [4, ∞) and show that it is
an element of Y . The notation [4, ∞) is a substitute (a nickname) for the set
{x ∈ R | x ≥ 4} so we write what it means for x to be in this set. To show that
x ∈ Y we need to show two things: First, x ∈ R, which we already know, and
second, x − 1 > 2, which is shown using the string x − 1 ≥ 4 − 1 = 3 > 2 (look
at the ends). The first inequality of the string is due to the fact that x ≥ 4
(just subtract 1 from both sides).
30
In the next example, we make use of the fact that for a real number r the
statement |r| < 3 means the same as the two statements r < 3 and r > −3.
3.3.2
Example
Put X = {x ∈ R | |x − 2| < 1}. Prove that X ⊆ (0, 5).
Proof Let x ∈ X. Then x ∈ R, and also |x−2| < 1, which implies x−2 < 1
and x − 2 > −1. The first inequality gives x < 3 < 5 and the second gives
x > 1 > 0. This, together with the observation that x ∈ R, shows that
x ∈ {y ∈ R | 0 < y < 5} = (0, 5). We conclude that X ⊆ (0, 5).
Discussion:
The string x ∈ {y ∈ R | 0 < y < 5} = (0, 5) says x ∈ (0, 5)
(look at the ends).
3.3.3 Example
(−∞, 5) ⊆ Y .
Put Y = {3r − 1 | r ∈ R and r < 2}. Prove that
Proof Let x ∈ (−∞, 5). Then x ∈ R and x < 5. Put r = (x + 1)/3. Then
r ∈ R and r = (x + 1)/3 < (5 + 1)/3 = 2. Therefore, x = 3r − 1 ∈ Y . We
conclude that (−∞, 5) ⊆ Y .
Discussion: We let x be an arbitrary element of (−∞, 5) and show that it
is an element of Y . In order to show that x is in Y we need to show that it is
of the form x = 3r − 1 for some r ∈ R with r < 2. In other words we need to
show the existence of such an r. We find such an r by solving x = 3r − 1 to
get r = (x + 1)/3.
3.3.4
Example
Put X = {1 − r | r ∈ [1, 3]}. Prove that X ⊆ (−3, 1).
Proof Let x ∈ X. Then x = 1 − r for some r ∈ [1, 3]. First, r ∈ R, so
x = 1 − r ∈ R, which is one requirement for x to be in (−3, 1). Now, since
r ≥ 1, we have −r ≤ −1 so that x = 1 − r ≤ 0 < 1. And since r ≤ 3, we
have −r ≥ −3 so that x = 1 − r ≥ −2 > −3. Therefore, x ∈ (−3, 1) and we
conclude that X ⊆ (−3, 1).
31
3.3.5 Example
Define f : R → R by f (x) = 2 − 3x and put A = {x ∈
R | f (x) ∈ [−10, 5)}. Prove that A ⊆ (−2, 6).
Proof Let x ∈ A. Then x ∈ R and f (x) ∈ [−10, 5). This latter condition
says −10 ≤ f (x) < 5, that is, −10 ≤ 2 − 3x < 5. Subtracting 2 and dividing
by −3 (which changes the sense of the inequalities) yields 4 ≥ x > −1. So,
−2 < −1 < x ≤ 4 < 6, giving x ∈ (−2, 6). We conclude that A ⊆ (−2, 6).
3.4
Set equality
Let A and B be sets. If A and B have the same elements, we say they are
equal and write A = B.
Equivalently, A = B if and only if each set is a subset of the other.
Statement:
Proof :
A = B.
(⊆) (Prove A ⊆ B.)
(⊇) (Prove B ⊆ A).
Therefore, A = B.
It is common practice to introduce the proof of A ⊆ B by writing (⊆), and
to introduce the proof of B ⊆ A (which can be written A ⊇ B to keep the
sets in the same order) by writing (⊇).
3.4.1 Example
Prove that A = B.
Put A = {2n + 1 | n ∈ Z} and B = {3 − 2n | n ∈ Z}.
Proof (⊆) Let a ∈ A. Then a = 2n + 1 for some n ∈ Z, so
a = 2n + 1 = 3 − 2(1 − n) ∈ B,
the last step due to the fact that 1 − n ∈ Z. This shows that A ⊆ B.
(⊇) Let b ∈ B. Then b = 3 − 2n for some n ∈ Z, so
b = 3 − 2n = 2(1 − n) + 1 ∈ A,
32
the last step due to the fact that 1 − n ∈ Z. This shows that B ⊆ A.
Therefore, A = B.
The following example uses the fact that if a and b are two positive real
numbers with a ≤ b, then log2 a ≤ log2 b.
3.4.2
Put A = {x ∈ R | 2x ≤ 4}. Prove that A = (−∞, 2].
Example
Proof (⊆) Let x ∈ A. Then x ∈ R and 2x ≤ 4. We have
x = log2 2x ≤ log2 4 = log2 22 = 2,
so x ∈ (−∞, 2]. This shows that A ⊆ (−∞, 2].
(⊇) Let x ∈ (−∞, 2]. Then x ∈ R and x ≤ 2. We have
2x ≤ 22 = 4,
so x ∈ A. This shows that (−∞, 2] ⊆ A.
Therefore, A = (−∞, 2].
3.5
Set operations
In this section, we discuss three standard set operations: union, intersection,
and difference. Each is a way of combining two sets to form a new set.
Let A and B be sets.
The union of A and B, written A ∪ B and read “A union B,” is given by
A ∪ B = {x | x ∈ A or x ∈ B}.
A
B
33
The intersection of A and B, written A ∩ B and read “A intersect B,” is
given by
A ∩ B = {x | x ∈ A and x ∈ B}.
A
B
The difference of A and B, written A \ B and read “A minus B,” is given
by
A \ B = {x | x ∈ A and x ∈
/ B}.
A
B
For example, if A = {1, 2, 3, 4, 5} and B = {4, 5, 6, 7}, then
A ∪ B = {1, 2, 3, 4, 5, 6, 7},
A ∩ B = {4, 5},
A
A \ B = {1, 2, 3}.
B
1
2
4
5
3
6
7
The sets A and B are disjoint if A ∩ B = ∅, that is, if the sets have no
elements in common.
34
3.5.1 Example
Let A, B, and C be sets and assume that B ⊆ C.
Prove that A ∩ B ⊆ A ∩ C.
Proof Let x ∈ A ∩ B. Then x ∈ A and x ∈ B. Since B ⊆ C and x ∈ B we
have x ∈ C. Therefore, x ∈ A and x ∈ C, implying x ∈ A ∩ C. We conclude
that A ∩ B ⊆ A ∩ C.
3.5.2
Example
Let A and B be sets. Prove that A ∪ (B \ A) = A ∪ B.
Proof It suffices to show that each side is a subset of the other.
(⊆) Let x ∈ A ∪ (B \ A). Then x ∈ A or x ∈ (B \ A). In other words, either
(i) x ∈ A or (ii) x ∈ B and x ∈
/ A. Assume that x ∈
/ A. Then (ii) must hold,
implying x ∈ B. Hence, x ∈ A ∪ B. The inclusion (⊆) follows.
(⊇) Let x ∈ A ∪ B. Then x ∈ A or x ∈ B. Assume that x ∈
/ A. Then x ∈ B
and x ∈
/ A, so x ∈ B \ A. Hence, x ∈ A ∪ (B \ A). The containment (⊇)
follows.
Therefore, A ∪ (B \ A) = A ∪ B.
Discussion: In the proof of (⊆), after letting x be an arbitrary element of
the left-hand set and writing what this means, we turn to the task of showing
x is in the right-hand set. For this, we need to show x ∈ A or x ∈ B, and we
do this by assuming x ∈
/ A and showing that this must force x ∈ B (see Section
2.1).
3.5.3
Theorem. Let A, B, and C be sets. We have
(i) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C),
(ii) A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C).
Proof. (i) It suffices to show that each side is a subset of the other.
(⊆) Let x ∈ A ∩ (B ∪ C). Then x ∈ A and x ∈ B ∪ C. In other words, x ∈ A
and also x ∈ B or x ∈ C. Assume that x ∈
/ A ∩ B. Then x ∈
/ B, which
implies x ∈ C. Since x ∈ A as well, we get x ∈ A ∩ C, so x ∈ (A ∩ B) ∪
(A ∩ C). The inclusion (⊆) follows.
35
(⊇) Let x ∈ (A ∩ B) ∪ (A ∩ C). Then either x ∈ A ∩ B or x ∈ A ∩ C. In other
words, either (i) x ∈ A and x ∈ B or (ii) x ∈ A and x ∈ C. In either case,
x ∈ A. Assume that x ∈
/ B. Then case (ii) must hold, so x ∈ C. Therefore
x ∈ B ∪ C. Since x ∈ A as well, we conclude that x ∈ A ∩ (B ∪ C). The
containment (⊇) follows.
(ii)
Exercise 3–17.
3.5.4
have
Theorem (De Morgan’s Laws). Let A, B, and C be sets. We
(i) C \ (A ∪ B) = (C \ A) ∩ (C \ B),
(ii) C \ (A ∩ B) = (C \ A) ∪ (C \ B).
Proof. (i)
It suffices to show that each side is a subset of the other.
(⊆) Let x ∈ C \ (A ∪ B). Then x ∈ C and x ∈
/ A ∪ B. So x ∈ C and also
x∈
/ A and x ∈
/ B. Put another way, x ∈ C and x ∈
/ A and also x ∈ C and
x∈
/ B. This says x ∈ C \ A and x ∈ C \ B, so that x ∈ (C \ A) ∩ (C \ B).
The inclusion (⊆) follows.
(⊇) Let x ∈ (C \ A) ∩ (C \ B). Then x ∈ C \ A and x ∈ C \ B. So x ∈ C and
x∈
/ A and also x ∈ C and x ∈
/ B. Put another way, x ∈ C and also x ∈
/A
and x ∈
/ B. This says that x ∈ C and x ∈
/ A ∪ B, so that x ∈ C \ (A ∪ B).
The containment (⊇) follows.
(ii) Exercise 3–18.
3.6
Cartesian product
The Cartesian product of the sets A = {a, b, c} and B = {1, 2} is the set
A × B = {(a, 1), (b, 1), (c, 1), (a, 2), (b, 2), (c, 2)}.
So A × B is the set of all possible ordered pairs with first entry coming from
the set A and second entry coming from the set B.
Here is the general definition:
36
For sets A and B, the Cartesian product of A and B is the set
A × B = {(a, b) | a ∈ A and b ∈ B}.
3.6.1 Example
The Cartesian product R×R of R with itself is usually
denoted R2 . It is referred to as the Cartesian plane:
R2 = R × R = {(x, y) | x, y ∈ R}.
Put A = {1, 2}, B = {a, b}, and C = {b, c}. We have
A × (B ∪ C) = {1, 2} × {a, b, c}
= {(1, a), (2, a), (1, b), (2, b), (1, c), (2, c)}.
On the other hand, we have
(A × B) ∪ (A × C) = ({1, 2} × {a, b}) ∪ ({1, 2} × {b, c})
= ({(1, a), (2, a), (1, b), (2, b)}) ∪ ({(1, b), (2, b), (1, c), (2, c)})
= {(1, a), (2, a), (1, b), (2, b), (1, c), (2, c)}.
These sets have the same elements so they are equal:
A × (B ∪ C) = (A × B) ∪ (A × C).
Similarly, we have
A × (B ∩ C) = {(1, b), (2, b)} = (A × B) ∩ (A × C).
The next theorem states that these findings are not just coincidental.
3.6.2
Theorem. Let A, B, and C be sets.
(i) A × (B ∪ C) = (A × B) ∪ (A × C).
(ii) A × (B ∩ C) = (A × B) ∩ (A × C).
37
Proof. (i) It suffices to show each side is a subset of the other.
(⊆) Let x ∈ A × (B ∪ C). Then x = (a, u) for some a ∈ A and u ∈ B ∪ C.
Assume that x ∈
/ A × B. Since x = (a, u) and a ∈ A, it must be the case
that u ∈
/ B. But u ∈ B ∪ C, so u ∈ B or u ∈ C. It follows that u ∈ C,
so x = (a, u) ∈ A × C, and x is in the right-hand side. The inclusion (⊆)
follows.
(⊇) Exercise 3–19.
(ii) It suffices to show each side is a subset of the other.
(⊆) Exercise 3–19.
(⊇) Let x ∈ (A × B) ∩ (A × C). Then x ∈ A × B, and also x ∈ A × C. So
x = (a, b) for some a ∈ A and some b ∈ B, and also x = (a0 , c) for some
a0 ∈ A and some c ∈ C. But (a, b) = x = (a0 , c). In particular, b = c ∈ C,
so b ∈ B ∩ C. Therefore, x = (a, b) ∈ A × (B ∩ C). The containment (⊇)
follows.
3.7
Family of sets
A family of sets is a set, the elements of which are themselves sets. For
example,
A = {{1, 2, 3}, {2, 4}, {1, 2, 5, 6}}
is a family of sets. We can write instead
A = {A, B, C},
where
A = {1, 2, 3},
B = {2, 4},
C = {1, 2, 5, 6}.
This way of writing A makes it easier to see the big picture, namely, that A
is a set having three elements, namely, A, B, and C.
We have been using ordinary uppercase letters to denote ordinary sets (like
A = {1, 2, 3}), so it makes sense to use a fancier letter for a set having sets
as elements, which is why we have written A = {A, B, C}.
3.7.1
Example
Put A = {{1, 2, 3}, {2, 4}, {1, 2, 5, 6}}.
(a) {2, 4} ∈ A, but 2 ∈
/ A and 4 ∈
/ A.
38
(b) {{1, 2, 3}} ⊆ A, but {1, 2, 3} * A.
(c) {X ∈ A | 1 ∈ X} in list form is {{1, 2, 3}, {1, 2, 5, 6}}.
(d) {X ∪ Y | X, Y ∈ A} in list form is
{{1, 2, 3}, {1, 2, 3, 4}, {1, 2, 3, 5, 6}, {2, 4}, {1, 2, 4, 5, 6}, {1, 2, 5, 6}}.
Discussion: In part (d), we let X and Y range through all elements of A and
in each case write X ∪ Y . With A = {1, 2, 3}, B = {2, 4}, and C = {1, 2, 5, 6}
as before, the indicated set is
{A ∪ A, A ∪ B, A ∪ C, B ∪ B, B ∪ C, C ∪ C}.
This yields all of the possibilities since, for instance, B ∪ A = A ∪ B.
Put X = {1, 2, 3}. We can form the family of all subsets of X:
P(X) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.
This is called the “power set” of X.
Here is the general definition:
For a set X, the power set of X is the family P(X) of all subsets
of X:
P(X) = {S | S ⊆ X}.
3.7.2
Example
Put X = {a, b, c, d, e}.
(a) {b, d} ∈ P(X) (since {b, d} ⊆ X).
(b) a ∈ X, but a ∈
/ P(X) (since a * X).
(c) {a} ∈ P(X), but {a} ∈
/ X.
(d) ∅ ∈ P(X) and also ∅ ⊆ P(X) (since the empty set is a subset of every
set).
39
The notions of union and intersection extend naturally to families of sets.
Let A be a family of sets. The union of the family, written
is given by
[
A = {x | x ∈ A for some A ∈ A}.
S
A∈A A
A∈A
The intersection of the family, written
\
T
A∈A A
is given by
A = {x | x ∈ A for every A ∈ A}.
A∈A
S
One can regard the notation A∈A A as saying the union of all SA with
A ∈ A. In this notation, the letter A is a dummy variable, so B∈A B
means the same thing. Similar observations hold for the intersection.
If A = {{1, 2, 3}, {2, 4}, {1, 2, 5, 6}}, then
[
A = {1, 2, 3, 4, 5, 6}
and
A∈A
\
A = {2}.
A∈A
Here is a useful generalization of the notation given above:
Let A be a family of sets, and for each A ∈ A, let SA be a set. We
define
[
SA = {x | x ∈ SA for some A ∈ A}
A∈A
and
\
SA = {x | x ∈ SA for every A ∈ A}.
A∈A
40
S
For instance, if X is a set, then A∈A X ∩ A is the union of the sets X ∩ A
as A ranges through the family A. So here, X ∩ A plays the role of SA in
the notation above.
This new notation does indeed include the earlier notation as a special case
since we can put SA = A for each A ∈ A.
We have the following generalizations of Theorems 3.5.3 and 3.5.4, respectively.
3.7.3
Theorem. Let X be a set and let A be a family of sets. We have
(i) X ∩
S
(ii) X ∪
T
A∈A A
A∈A A
=
S
A∈A (X
∩ A),
=
T
A∈A (X
∪ A).
Proof. (i) Exercise 3–22.
(ii) It suffices to show that each side is a subset of the other.
T
T
(⊆) Let x ∈ X ∪
A∈A A . Then
T x ∈ X or x ∈ A∈A A. Let A0 ∈ A.
Assume that x ∈
/ X. Then x ∈ A∈A A, so that x ∈ A for every A ∈ A. In
particular, x ∈ A0 , T
so x ∈ X ∪ A0 . This shows that x ∈ X ∪ A for every
A ∈ A, that is, x ∈ A∈A (X ∪ A). The inclusion (⊆) follows.
T
(⊇) Let x ∈ A∈A (X ∪ A). Then x ∈ X ∪ A for every A ∈ A. Assume
that x ∈
/ X. Let A0 ∈ A. We have x ∈ X ∪ A0 andTx ∈
/ X, so x ∈ A0 .
This shows
T that x ∈ A for every A ∈ A, that is, x ∈ A∈A A. Therefore,
x∈X∪
A∈A A . The containment (⊇) follows.
Discussion: In the proof of the inclusion (⊆), after letting x be an arbitrary
element of the left-hand side and writing what this means we turn to the task
of showing that x must be an element of the right-hand side, that is, x ∈ X ∪ A
for every A ∈ A. Since this is a for-every statement, we write “Let A0 ∈ A”
(using the notation A0 so that we can continue to use A for a dummy variable).
Now the task is to show that x ∈ X ∪ A0 , which we do by assuming x ∈
/ X and
showing x must be in A0 .
In the proof of the containment (⊇), after letting x be an arbitrary element of
the right-hand side and writing what this means we turn to the task ofTshowing
that x must be an element of the left-hand side, that is, x ∈ X or x ∈ A∈A A.
For this, we assume that x is not in the first set and prove that it must be in
the second (see Section 2.1), that is, x ∈ A for every A ∈ A.
41
3.7.4 Theorem (De Morgan’s Laws). Let X be a set and let A be a
family of sets. We have
(i) X \
S
A∈A A
=
T
A∈A (X
\ A),
(ii) X \
T
A∈A A
=
S
A∈A (X
\ A).
Proof. (i) Exercise 3–23.
(ii) It suffices to show that each side is a subset of the other.
T
T
(⊆) Let x ∈ X \
A
. Then x ∈ X, and also x ∈
/ A∈A A, which
A∈A
means
/ A0 for some A0 ∈ A. Therefore, x ∈ X \ A0 , implying
S that x ∈
x ∈ A∈A (X \ A). The inclusion (⊆) follows.
S
(⊇) Let x ∈ A∈A (X \ A). Then x ∈ X \ A0 for some
T A0 ∈ A. Therefore,
x ∈ X, and
also
x
∈
/
A
,
this
latter
implying
x
∈
/
0
A∈A A. It follows that
T
A
.
The
containment
(⊇)
follows.
x∈X\
A∈A
Discussion: In the proof of the inclusion ⊆, we wrote the subscripted letter
A0 instead of just A for a particular element of A with x ∈ S
A0 . This allowed
us to continue using A as a dummy variable in the notation A∈A (X \ A).
For n ∈ N, put An = [n, n + 2). Then A0 = [0, 2), A1 = [1, 3), and so forth.
We can form the family A = {An | n ∈ N}. The elements A0 , A1 , A2 , . . .
of this family are “indexed” by the elements of the set N. In situations
like this it is customary to use slightly different notations for
S the union and
intersection of the family. For instance, instead of writing A∈A A we write
[
An
or
∞
[
An .
n=0
n∈N
We can use a variation on this latter notation to denote the union of just
some of the sets, like
5
[
An
n=3
for the union of the family {A3 , A4 , A5 }.
42
3.7.5
∞
[
For n ∈ N, put An = [n, n + 2). We have
Example
An = [0, ∞),
n=0
5
[
∞
\
An = [3, 7),
n=3
3
\
An = ∅,
n=0
An = [3, 4).
n=2
Discussion: These equations are arrived at by picturing the intervals An on
the number line as n ranges as indicated. For the first equation, for instance,
we are forming the union of the intervals A0 , A1 , A2 , and so forth, so we get
the interval [0, ∞):
A0
−1
0
1
A1
2
A2
3
Here is a formal proof of the equation
S∞
n=0
4
5
An = [0, ∞):
Proof. It suffices to prove that each side is a subset of the other.
S∞
(⊆) Let x ∈ n=0 An . We have x ∈ An = [n, n + 2) for some integer n with
n ≥ 0. In particular, x ∈ R and x ≥ n ≥ 0, implying x ∈ [0, ∞). The inclusion
(⊆) follows.
(⊇) Let x ∈ [0, ∞). We have x ∈ R and x ≥ 0. Denote by n0 the greatest
integer with n0 ≤ x and note that n0 ≥S0. We have x < n0 + 1 < n0 + 2, so
∞
x ∈ [n0 , n0 + 2) = An0 . Therefore, x ∈ n=0 An since An0 is one of the An in
this union. The containment (⊇) follows.
3.7.6
Example
For r ∈ R, put Ar = [r − 1, r + 1]. We have
[
[
\
Ar = (−1, ∞),
Ar = [0, 3],
Ar = [1, 2].
r∈R+
r∈[1,2]
r∈[1,2]
43
Discussion: As in the preceding example, these equalities are arrived at by
picturing the intervals Ar on the number line as r ranges through the indicated
sets.
T
Here is a formal proof of the equation r∈[1,2] Ar = [1, 2]:
T
(⊆) Let x ∈ r∈[1,2] Ar . Then x ∈ Ar = [r − 1, r + 1] for every r ∈ [1, 2]. In
particular, x ∈ A2 = [1, 3], so x ∈ R and x ≥ 1. Also, x ∈ A1 = [0, 2], so x ≤ 2.
Therefore, x ∈ [1, 2].
(⊇) Let x ∈ [1, 2]. It suffices to show that x ∈ Ar for every r ∈ [1, 2]. Let
r ∈ [1, 2]. First note that x ∈ R. We have x ≥ 1 = 2 − 1 ≥ r − 1 and
x ≤ 2 = 1 + 1 ≤ r + 1, so x ∈ [r − 1, r + 1] = Ar .
The equality follows.
3 – Exercises
3–1 Put A = {x ∈ Z+ | 7 − 2x > 0}.
(a) Is 4 ∈ A? Explain.
(b) Is 1 ∈ A? Explain.
(c) Is 0 ∈ A? Explain.
(d) Write the set A in list form.
3–2 Put B = {2n + 5 | n ∈ N}.
(a) Is 13 ∈ B? Explain.
(b) Is 10 ∈ B? Explain.
(c) Write the set B in list form.
3–3 Let A = {1, 2, 3, 4, 5}, B = {−1, 0, 1}, and C = {x, y}. Write each of
the following sets using list notation:
(a) D = {a ∈ A | a > 5/2 and a is odd},
44
(b) E = {b ∈ B | 1 − b ∈ Z+ },
(c) F = {(c, b) | b ∈ B and c ∈ C},
(d) G = {2a−3 | a ∈ A},
(e) H = {2b − 4 | b ∈ B and 3b ∈ A}.
3–4 Put A = {5n | n ∈ Z}. Prove: For every x, y ∈ A, we have xy ∈ A.
3–5 Prove: For every x, y ∈ Q, we have x + y ∈ Q.
Hint: Recall that Q = {m/n | m, n ∈ Z, n 6= 0}.
3–6 Put X = {x ∈ N | x < 3} and Y = {y ∈ Z | −2 < y ≤ 5}. Prove that
X ⊆Y.
3–7 Put X = {8n + 1 | n ∈ Z} and Y = {4n − 3 | n ∈ Z}. Prove that
X ⊆Y.
3–8 Put X = {3 − 5n | n ∈ N} and Y = {y ∈ Z | y < 7}. Prove that
X ⊆Y.
3–9 Put Y = {y ∈ R | 3y < 7}. Prove that (−∞, 2] ⊆ Y .
3–10 Put X = {x ∈ R | x2 − 5x + 4 < 0}. Prove that X ⊆ (0, 6).
3–11 Put Y = {2r | r ∈ R and r ≥ −3}. Prove that (1/4, ∞) ⊆ Y .
√
3–12 Put X = { r | r ∈ [4, 35]}. Prove that X ⊆ [2, 6).
45
3–13 Define g : R → R by g(x) = 2 − 5x and put A = {g(x) | x ∈
(−∞, 1]}. Prove that A ⊆ (−5, ∞).
3–14 Put A = {1 − 3n | n ∈ Z} and B = {3n − 8 | n ∈ Z}. Prove that
A = B.
3–15 Put A = {x ∈ R | |x − 1| < 3}. Prove that A = (−2, 4).
3–16 Let A, B, and C be sets and assume that A ⊆ C and B ⊆ C. Prove
that A ∪ B ⊆ C.
3–17 Prove Theorem 3.5.3 (ii): Let A, B, and C be sets. We have
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C).
3–18 Prove Theorem 3.5.4 (ii): Let A, B, and C be sets. We have
C \ (A ∩ B) = (C \ A) ∪ (C \ B).
3–19 Let A, B, and C be sets. Prove the following inclusions to finish the
proof of Theorem 3.6.2:
(a) A × (B ∪ C) ⊇ (A × B) ∪ (A × C).
(b) A × (B ∩ C) ⊆ (A × B) ∩ (A × C).
3–20 Let A and B be nonempty sets and assume that A × B = B × A.
Prove that A = B.
3–21 Answer the following and provide reasons:
(a) Is {−1, 0, 1} ∈ P(Z)?
46
(b) Is (2, 5] ⊆ P(R)?
(c) Is Q ∈ P(Q)?
(d) Is {{1, 2, 3}} ⊆ P(Z+ )?
3–22 Prove Theorem
S 3.7.3 (i):SLet X be a set and let A be a family of
sets. We have X ∩
A∈A A =
A∈A (X ∩ A).
3–23 Prove Theorem
S 3.7.4 (i):TLet X be a set and let A be a family of
sets. We have X \
A∈A A =
A∈A (X \ A).
3–24 For n ∈ Z+ , put An = [0, 1 − 1/n).
(a) Find
T8
(b) Find
T∞
(c) Find
S6
(d) Find
S∞
n=4 An .
n=1 An .
n=1 An .
n=1 An
and prove your claim.
3–25 For r ∈ R+ , put Ar = [r, 2r].
(a) Find
S
(b) Find
S
r∈[1,4] Ar .
(c) Find
T
r∈(3,8) Ar .
(d) Find
T
r∈[4,6] Ar
r∈R+
Ar .
and prove your claim.
47
4
4.1
Proofs - II
If-then
Let n ∈ N. The following statement is an example of an if-then statement
and its proof:
Statement:
If n ≤ 5, then 2n − 1 ≤ 9.
Proof : Assume that n ≤ 5. Multiplying both sides of this inequality by 2
gives 2n ≤ 10, and then subtracting 1 from both sides gives 2n − 1 ≤ 9.
The statement says [ If n ≤ 5, . . . ] , so it is making a claim only in the
situation where n ≤ 5. Therefore, the proof begins by explicitly making this
assumption: Assume that n ≤ 5.
If we let P stand for the statement n ≤ 5 and Q stand for the statement
2n − 1 ≤ 9, then the statement can be written [ If P , then Q ] . This is
the general form of an if-then statement. We record here the method for
proving such a statement.
Statement:
Proof :
If P , then Q.
Assume P holds. (Show Q holds.)
4.1.1 Example
y + 7 ≤ 0.
Let y ∈ R. Prove: If y ∈ {3 − 5x | x ∈ [2, ∞)}, then
Proof Assume that y ∈ {3 − 5x | x ∈ [2, ∞)}. Then y = 3 − 5x for some
x ∈ [2, ∞). We have x ≥ 2, so 10 − 5x ≤ 10 − 5(2) = 0. Therefore,
y + 7 = (3 − 5x) + 7 = 10 − 5x ≤ 0.
Another way to express the if-then statement [ If n ≤ 5, then 2n − 1 ≤ 9 ]
is to write
n≤5
=⇒
2n − 1 ≤ 9,
48
where the symbol “ =⇒ ” stands for the word “implies.” The meaning here
is that n ≤ 5 being true forces 2n − 1 ≤ 9 to be true, and this is the meaning
of the original if-then statement as well.
This new formulation allows a second method of proof, which uses a string
of implications:
Statement:
Proof :
If n ≤ 5, then 2n−1 ≤ 9. (Equivalently, n ≤ 5 ⇒ 2n−1 ≤ 9.)
We have
n≤5
=⇒
2n ≤ 10
(multiply by 2)
=⇒
2n − 1 ≤ 9
(subtract 1).
Discussion:
We have shown the usual method for justifying each step to
the right (but the justifications are not really necessary in this case).
Here is the method for proving a general if-then statement using a string of
implications.
Statement:
Proof :
P ⇒ Q.
(Equivalently, [ If P , then Q ] .)
We have P ⇒ · · · ⇒ Q.
4.1.2 Example
Let m ∈ Z. Prove, using a string of implications:
2m ∈ {n ∈ Z | n + 1 ≥ 6} =⇒ m > 2.
Proof We have
2m ∈ {n ∈ Z | n + 1 ≥ 6}
=⇒
=⇒
(2m) + 1 ≥ 6
5
m ≥ > 2.
2
Discussion:
For the first implication, we use what it means for 2m to be
in the indicated set, namely, when 2m plays the role of the n a true statement
results.
49
Prove: For every r ∈ R, if 2r − 4 ∈ [5, ∞), then r > n
4.1.3 Example
for some n ∈ Z+ .
Proof Let r ∈ R. Assume that 2r − 4 ∈ [5, ∞). Put n = 4 and note that
n ∈ Z+ . Since 2r − 4 ∈ [5, ∞), we have 2r − 4 ≥ 5, so r ≥ 9/2 > 4 = n.
Discussion: The statement is a for-every statement, so we begin with [ Let
r ∈ R ] . Then, the statement about this fixed element r is of the form [ If P ,
then Q ] , so we begin by assuming P . Next we take up the proof of Q, which
can be expressed [ There exists n ∈ Z+ such that r > n ] , so the method of
Section 2.3 applies. On scratch paper, we work out that r ≥ 9/2, which gives
us the idea to use n = 4.
4.2
If-and-only-if
Let n ∈ Z+ . The following is an example of an if-and-only-if statement:
n2 + n − 6 < 0 if and only if n = 1.
This statement is of the form [ P if and only if Q ] . Such a statement is
actually two statements:
(1) [ P if Q ] . This says P is true if Q is true. In other words, it says [ If
Q, then P ] , which can be written P ⇐ Q.
(2) [ P only if Q ] . This says that P being true forces Q to be true as
well. In other words, it says [ If P , then Q ] , which can be written
P ⇒ Q.
We write P ⇔ Q to mean P ⇒ Q and P ⇐ Q. So P ⇔ Q is another way
to write [ P if and only if Q ] .
Statement:
Proof :
P if and only if Q. (Equivalently, P ⇔ Q.)
(Prove both directions, P ⇒ Q and P ⇐ Q.)
50
4.2.1
Example
Let n ∈ Z+ . Prove: n2 + n − 6 < 0 if and only if n = 1.
Proof (⇒) Assume that n2 + n − 6 < 0. Then
(n − 2)(n + 3) = n2 + n − 6 < 0.
Now n ∈ Z+ so n ≥ 1. Therefore, n + 3 > 0 and we can divide by n + 3 to
get n − 2 < 0, that is, n < 2. Since n ≥ 1 we conclude that n = 1.
(⇐) Assume that n = 1. Then n2 + n − 6 = (1)2 + (1) − 6 = −4 < 0.
Discussion: We write the symbol (⇒) to indicate to the reader that we are
proving that the first statement implies the second statement. This implication
can be written as the if-then statement [ If n2 + n − 6 < 0, then n = 1 ] , so the
method of Section 4.1 applies and this is what we use.
Similarly, we write (⇐) to indicate that we are proving that the second statement implies the first statement.
The statement [ P if and only if Q ] is the statement that P and Q are
equivalent, meaning that they are both true or both false. For instance, in
the preceding example, both P and Q are true in the case n = 1, while in
the case n = 2 they are both false.
The statement [ P if and only if Q ] is often shortened by writing [ P iff Q ] .
4.2.2 Example
Let n ∈ Z. Prove: n = 3m − 9 for some m ∈ Z iff
2n ∈ 6Z, where 6Z = {6x | x ∈ Z}.
Proof (⇒) Assume that n = 3m − 9 for some m ∈ Z. We have 2n =
6m − 18 = 6(m − 3) ∈ 6Z.
(⇐) Assume that 2n ∈ 6Z. Then 2n = 6x for some x ∈ Z. Put m = x + 3.
Then m ∈ Z and n = 3x = 3(x + 3) − 9 = 3m − 9.
4.2.3 Example
P(X) ⊆ P(Y ).
Let X and Y be sets. Prove: X ⊆ Y if and only if
Proof (⇒) Assume that X ⊆ Y . Let S ∈ P(X). Then S ⊆ X ⊆ Y .
Therefore, S ∈ P(Y ). It follows that P(X) ⊆ P(Y ).
51
(⇐) Exercise 4–13.
Occasionally the most efficient way to prove an if-and-only-if statement is
to use a string of double implications (⇔).
Statement:
Proof :
P ⇔ Q.
(Equivalently, [ P if and only if Q ] .)
(Establish a string P ⇔ · · · ⇔ Q.)
4.2.4 Example
Let a, b ∈ Z. Prove, using a string of double implications: b = 2a + 3 ⇐⇒ a = (b − 3)/2.
Proof We have
b = 2a + 3
⇐⇒
b − 3 = 2a
⇐⇒
(b − 3)/2 = a
⇐⇒
a = (b − 3)/2.
Discussion: At each step it should be checked that both implications hold.
For instance, for the first ( ⇐⇒ ) we get the implication (⇒) by subtracting
3 from both sides, and we get the implication (⇐) by adding 3 to both sides.
This method does not easily lend itself to supplying reasons off to the right
since each step requires two reasons (one for each direction).
4.3
Equality of subsets
Let X be a set and let A and B be subsets of X. It follows immediately from
the definition of set equality (see Section 3.4) that the following statements
are equivalent (i.e., say the same thing):
(i) A = B,
(ii) For every x ∈ X we have x ∈ A if and only if x ∈ B.
52
This gives a method for proving that two subsets are equal by using a string
of double implications.
Statement:
Proof
(A, B ⊆ X).
A=B
Let x ∈ X. We have
x ∈ A ⇐⇒ · · · ⇐⇒ x ∈ B.
Therefore, A = B.
4.3.1 Example
Put A = {x ∈ R | |x − 1| < 3}. Prove, using a string
of double implications: A = (−2, 4).
Proof Let x ∈ R. We have
x∈A
⇐⇒
|x − 1| < 3
⇐⇒
x − 1 < 3 and x − 1 > −3
⇐⇒
x < 4 and x > −2
⇐⇒
x ∈ (−2, 4).
Therefore, A = (−2, 4).
Discussion:
We note that A and (−2, 4) are both subsets of R, so the
method applies with R playing the role of the set X.
4.3.2 Example
Put A = {4 − 2n | n ∈ Z} and B = {m ∈ Z | (4 −
m)/2 ∈ Z}. Prove, using a string of double implications: A = B.
Proof Let x ∈ Z. We have
x∈A
⇐⇒
x = 4 − 2n
for some n ∈ Z
⇐⇒
2n = 4 − x
for some n ∈ Z
⇐⇒
(4 − x)/2 = n
⇐⇒
(4 − x)/2 ∈ Z
⇐⇒
x ∈ B.
53
for some n ∈ Z
Therefore, A = B.
Discussion:
We first note that A, B ⊆ Z so the method applies with Z
playing the role of the set X.
As with all strings involving ( ⇐⇒ ) it should be checked that the argument
makes sense in both directions. It is for this reason that it is not enough to
write “for some n ∈ Z” in the first line only. If we had omitted this phrase in
the second line, for instance, the letter n would have been undefined at that
step working in the backwards direction (⇐).
The usual method for showing that two sets A and B are equal is to show
that each set is a subset of the other, that is, A ⊆ B and B ⊆ A. The method
just introduced is, in effect, a way of showing both of these simultaneously.
This method should be attempted only when the steps for showing the
inclusion A ⊆ B are precisely the reverse of those for showing B ⊆ A.
4.4
Induction
We claim that the statement
3n ≥ 1 + 2 n
holds for every integer n with n ≥ 1. For each such integer n, we use P (n) to
stand for the corresponding statement. For instance, P (1) is the statement
31 ≥ 1 + 2 1 ,
which we see is true. So P (1) holds. Next, P (2) is the statement
32 ≥ 1 + 2 2 ,
which is also true. So P (2) holds.
We might go on checking to see that P (3) holds, P (4) holds, and so forth,
but it is not possible to check in this fashion that P (n) holds for all of the
infinitely many possibilities for n. We need a better way.
Let n be a particular integer with n > 1 for which we wish to show P (n)
holds. Suppose we have managed to show that the preceding case P (n − 1)
holds, that is,
3n−1 ≥ 1 + 2n−1 .
54
Multiplying both sides of this inequality by 3 and then using simple algebra
we get
3n ≥ 3 + 3(2n−1 ) ≥ 1 + 2(2n−1 ) = 1 + 2n
which says that P (n) holds (look at the ends of the string).
Summarizing, we now know that P (n) holds whenever we know that the
preceding case P (n − 1) holds.
This convinces us that P (n) holds for every integer n with n ≥ 1 since we
can reason using a chaining argument as follows: First, P (1) holds (checked
earlier). Then P (2) holds, since the preceding case P (1) holds. Then P (3)
holds, since the preceding case P (2) holds. And so forth.
Now generalize by letting P (n) be any statement involving the integer n. We
can prove that P (n) holds for every integer n with n ≥ 1 by (i) showing the
“base case” P (1) holds (this starts the chain), and (ii) proving the following:
For every integer n with n > 1, if P (n − 1) holds, then P (n) holds.
(∗)
This is the statement that a particular case holds whenever the preceding
case holds. It allows the chaining.
The method just described is called proof by induction. Here is how to
structure this kind of proof.
Statement:
P (n) holds for every integer n with n ≥ 1.
Proof : We use induction.
(i) (Show the base case P (1) holds.)
(ii) Let n be an integer with n > 1, and assume that P (n − 1)
holds (Induction Hypothesis). (Prove that P (n) holds.)
By induction, P (n) holds for every integer n with n ≥ 1.
Step (ii) is the proof of statement (∗) above (see Sections 2.2 and 4.1). It is
called the “inductive step.” The assumption that P (n − 1) holds is called
the “Induction Hypothesis” (abbreviated I.H.).
55
4.4.1 Example
n ≥ 1 we have
Use induction to prove that for every integer n with
1 + 2 + 3 + ··· + n =
n(n + 1)
.
2
Proof We use induction. For an integer n, denote by P (n) the indicated
equality.
(i) The base case P (1) is the equality
1=
1(1 + 1)
,
2
which holds.
(ii) Let n be an integer with n > 1, and assume that P (n − 1) holds, that is,
1 + 2 + 3 + · · · + (n − 1) =
(n − 1)((n − 1) + 1)
2
(I.H.).
Adding n to both sides of this equation and then using simple algebra, we
get
(n − 1)((n − 1) + 1)
+n
2
(n − 1)n + 2n
=
2
n(n + 1)
,
=
2
1 + 2 + 3 + · · · + (n − 1) + n =
so P (n) holds.
By induction, P (n) holds for every integer n with n ≥ 1.
Here is a slight variation: Suppose that the statement to be shown is that
P (n) holds for every integer n with n ≥ 4, say. Then the same procedure is
valid with the number 4 in place of the number 1. In particular, the base
case is P (4). (The 1 in the induction hypothesis P (n − 1) does not change,
however.) The same holds for any other integer besides 4.
4.4.2 Example
Use induction to prove that for every integer n with
n
n ≥ 4 we have n! > 2 , where n! = n(n − 1)(n − 2) · · · 1 (read “n factorial”).
Proof We use induction. For an integer n, denote by P (n) the inequality
n! > 2n .
56
(i) We have
4! = 24 > 16 = 24 ,
so the base case P (4) holds.
(ii) Let n be an integer with n > 4, and assume that P (n − 1) holds, that is,
(n − 1)! > 2n−1 .
(I.H.)
Multiplying both sides of this inequality by n and using the fact that n(n −
1)! = n!, we get
n! > n(2n−1 ) > 2(2n−1 ) = 2n ,
where the second step uses the fact that n > 4. Therefore, P (n) holds.
By induction, P (n) holds for every integer n with n ≥ 1.
Recall that the power set P(X) of a set X is the set of all subsets of X. For
instance,
P(∅) = {∅},
P({1}) = {∅, {1}},
P({1, 2}) = {∅, {1}, {2}, {1, 2}},
P({1, 2, 3}) = {∅, {1}, {2}, {1, 2}, {3}, {1, 3}, {2, 3}, {1, 2, 3}}.
We notice that the numbers of elements in these power sets are 1, 2, 4, and
8, respectively, which can be written 20 , 21 , 22 , and 23 , respectively. After
noting that the exponents appearing here are the numbers of elements in
the sets that we are forming the power sets of, we are led to the conjecture
that if a set X has n elements, then P(X) has 2n elements.
Recall from Section 1.1 that for a finite set X, the number of elements in X
is denoted |X|.
4.4.3 Example
Use induction to prove the following for every integer
n with n ≥ 0: For every set X with |X| = n, we have |P(X)| = 2n .
Proof We use induction. For an integer n, denote by P (n) the statement
[ For every set X with |X| = n, we have |P(X)| = 2n ] .
(Note the difference between the letters P and P.)
57
(i) The base case is P (0), which is the statement that for every set X with
|X| = 0, we have |P(X)| = 20 = 1. The only set that has 0 elements is the
emptyset ∅ and we have already observed above that |P(∅)| = 1, so the base
case holds.
(ii) Let n be an integer with n > 0, and assume that P (n − 1) holds, which
is to say,
[ For every set X with |X| = n − 1, we have |P(X)| = 2n−1 ] (I.H.).
We prove that P (n) holds, namely, for every set X with |X| = n, we have
|P(X)| = 2n . Let X be a set with |X| = n. We can write the set X in list
form: X = {x1 , x2 , . . . , xn }.
Put S = {S ∈ P(X) | xn ∈
/ S} and T = {T ∈ P(X) | xn ∈ T }. (So S is the
collection of those subsets of X in which the element xn does not appear,
while T is the collection of those subsets of X in which the element xn does
appear.) Given S ∈ S we can form the set S ∪ {xn } (i.e., just adjoin xn to
S), and this latter set is in T . This pairs the elements of S with those of T
and shows that |S| = |T |. (See discussion below.)
Note that S = P(X 0 ), where X 0 = {x1 , x2 , . . . , xn−1 }. We have |S| =
|P(X 0 )| = 2n−1 , where the last equality uses the induction hypothesis, which
applies since |X 0 | = n − 1.
Observe that T = P(X)\S, so P(X) is the union of the disjoint sets S and
T . Therefore,
|P(X)| = |S| + |T | = 2|S| = 2(2n−1 ) = 2n .
This completes the inductive step.
By induction, P (n) holds for every integer n with n ≥ 0.
Discussion:
In the special case X = {1, 2, 3} we have
P(X) = {∅, {1}, {2}, {1, 2}, {3}, {1, 3}, {2, 3}, {1, 2, 3}}
and
S = {∅, {1}, {2}, {1, 2}},
T = {{3}, {1, 3}, {2, 3}, {1, 2, 3}}.
Here, xn = 3. Note how adjoining 3 to the elements of S produces the elements
of T , and |S| = 4 = |T |.
58
The preceding example illustrates a common way in which mathematics
progresses. A pattern involving positive integers is observed to hold in a
few special cases and it is conjectured to hold in general. Induction is then
used to prove the conjecture. It should be emphasized that induction is not
a means for coming up with a conjecture, but rather a means for proving a
conjecture that is formulated based on some evidence.
Continue to let P (n) be a statement about the integer n.
In carrying out the inductive step, it is sometimes convenient to replace the
assumption that the statement is true for the immediately preceding case
with the assumption that the statement is true for all of the preceding cases.
This still allows for the desired chaining: P (1) holds (vacuously, since there
are no preceding cases), then P (2) holds since the preceding case P (1) holds,
then P (3) holds since the preceding cases P (1) and P (2) hold, and so forth.
This variation is called proof by complete induction. Here is how to
structure such a proof.
Statement:
P (n) holds for every integer n with n ≥ 1.
Proof : We use complete induction.
Let n be an integer with n ≥ 1. Assume that P (k) holds for every
integer k with 1 ≤ k < n (Induction Hypothesis). (Prove that P (n)
holds.)
By complete induction, P (n) holds for every integer n with n ≥
1.
Once again, the number 1 can be replaced by any other integer.
The separate check of the base case does not appear here. (The inductive
step includes the case n = 1, so P (1) ends up being verified.) In practice,
however, in carrying out the proof one usually needs to establish a special
case (or sometimes a few special cases) in order to get to the point where
the induction hypothesis can be used. This is illustrated in the following
example.
59
4.4.4 Example
Use complete induction to prove the following for every
integer n with n ≥ 1: There exist integers i and j such that n = 2i + 3j.
Proof We use complete induction. For an integer n, denote by P (n) the
statement
[ There exist integers i and j such that n = 2i + 3j ] .
Let n be an integer with n ≥ 1 and assume that P (k) holds for every integer
k with 1 ≤ k < n (I.H.). We prove that P (n) holds. First, P (1) and P (2)
hold since
1 = 2(−1) + 3(1)
and
2 = 2(1) + 3(0).
Therefore, we may assume that n > 2. We have 1 ≤ n − 2 < n, so P (n − 2)
holds by the induction hypothesis. This means that there exist integers i
and j such that n − 2 = 2i + 3j. Therefore, n = 2(i + 1) + 3j, which shows
that P (n) holds.
By complete induction, P (n) holds for every integer n with n ≥ 1.
Discussion: The induction hypothesis requires k to be in the range 1 ≤ k <
n. We wanted to apply the induction hypothesis to k = n − 2, but under the
initial assumption that n ≥ 1 this k was not guaranteed to be in that range (for
instance, if n = 1 we have k = n − 2 = −1). This is why we first established
the special cases P (1) and P (2). With those out of the way, we could assume
n > 2 and get k = n − 2 in the required range.
4 – Exercises
4–1 Let n ∈ Z. Prove: If n ≥ 3, then 4n − 5 ≥ 7.
4–2 Let y ∈ R. Prove: If y ∈ {2x + 3 | x ∈ (−∞, 1)}, then y − 1 < 4.
4–3 Prove: For every n ∈ Z, if n ≤ 2, then n ∈ {x ∈ Z | 4 − 3x > −3}.
60
4–4 Let n ∈ N. Prove, using a string of implications: If n > 2, then
2n+1 > 8.
4–5 Put A = {x ∈ R | 2(x − 1)2 < 1}. Let r ∈ R. Prove, using a string of
implications: r + 1 ∈ A =⇒ r4 < 1/4.
4–6 Define h : R → R by h(x) = 5x − 2. Prove: For every r ∈ R, if
h(r) ∈ Q, then r ∈ Q.
4–7 Let r ∈ R. Prove: If r2 − 2r ≥ 3, then r ≥ 3 or r ≤ −1.
4–8 Let r ∈ R. Prove: If r < 3, then −x2 + (r − 2)x + 2r < 0 for every
x ∈ [3, ∞).
4–9 Let n ∈ Z+ . Prove: 3n − 2n2 ≥ 0 if and only if n = 1.
4–10 Let r ∈ R. Prove: r3 − r2 < 0 if and only if r 6= 0 and r < 1.
4–11 Let r ∈ R. Prove: r ∈ {x2 − 1 | x ∈ R+ } iff r ∈ (−1, ∞).
4–12 Let r, s ∈ R+ . Prove, using a string of double implications: (4r +
5)/(2s + 9) < 1 ⇐⇒ 2r − s < 2.
4–13 Finish Example 4.2.3: Let X and Y be sets. Prove that if P(X) ⊆
P(Y ), then X ⊆ Y .
4–14 Put A = {x ∈ R | (x − 1)2 > 4}. Prove, using a string of double
implications: A = (−∞, −1) ∪ (3, ∞).
61
4–15 Put A = {3 − 2r | r ∈ R+ } and B = {s ∈ R | 3 − s ∈ R+ }. Prove,
using a string of double implications: A = B.
4–16 Use induction to prove that 2n ≥ 1 + n for every integer n with
n ≥ 1.
4–17 Use induction to prove that for every integer n with n ≥ 1 we have
21 + 22 + 23 + · · · + 2n = 2n+1 − 2.
4–18 Use induction to prove that n2 − 4n + 2 > 0 for every integer n with
n ≥ 6.
4–19 Use induction to prove that 2n > n2 for every integer n with n ≥ 5.
Hint: At some point, use Exercise 4–18.
4–20 Use induction to prove that (n + 1)! > 2n+3 for every integer n with
n ≥ 5.
4–21 For a set X, put D(X) = {S ∈ P(X) | |S| = 2} (so D(X) is the
family of two-element subsets of X). Use induction to prove the following
for every integer n with n ≥ 2: For every set X with |X| = n, we have
|D(X)| = n! .
4–22 Use complete induction to prove the following for every integer n
with n ≥ 1: There exist integers i and j such that n = 8i + 3j.
4–23 Use complete induction to prove the following for every integer n
with n ≥ 1: There exist integers q and r with 0 ≤ r < 7 such that n =
7q + r.
62
5
Integers
5.1
Even integer, odd integer
In order to prove facts about even integers and odd integers we need precise
definitions:
• An integer m is even if m = 2k for some k ∈ Z.
• An integer m is odd if m = 2k + 1 for some k ∈ Z.
5.1.1
even.
Example
Let m and n be even integers. Prove that m + n is
Solution Since m is even, m = 2k for some k ∈ Z. Similarly, since n is
even, n = 2l for some l ∈ Z. We have m + n = 2k + 2l = 2(k + l). Now
k + l ∈ Z, so we conclude that m + n is even.
Let m be an integer. Prove: If m is odd, then m2 +
5.1.2 Example
m + 1 is odd.
Solution Assume that m is odd. Then m = 2k + 1 for some k ∈ Z. We
have
m2 + m + 1 = (2k + 1)2 + (2k + 1) + 1
= (4k 2 + 4k + 1) + 2k + 2
= (4k 2 + 6k + 2) + 1
= 2(2k 2 + 3k + 1) + 1.
Now 2k 2 + 3k + 1 ∈ Z, so we conclude that m2 + m + 1 is odd.
5.2
Divisibility
We are accustomed to saying informally that “3 goes evenly into 15” to
mean that there is no remainder when 15 is divided by 3. This is the same
63
as saying that “15 is a multiple of 3,” namely, 15 = (5)3. Here is the more
formal terminology:
Let m and n be integers. We say that n divides m (written n | m)
if m is a multiple of n. That is,
n|m
means
m = kn for some k ∈ Z.
We write n - m and say n does not divide m if it is not the case that
n divides m.
For example, 3 | 15 since 15 = (5)3 (so 5 plays the role of k in the definition).
However, 3 - 16 because there does not exist an integer k for which 16 = k3
(this equation would force k = 16/3 ∈
/ Z).
Note that n | m is the statement “n divides m,” which might be true or false
(3 | 15 is true, but 3 | 16 is false). It should not be confused with n / m (“n
divided by m”), which is a number (3 / 15 is a number, which equals 1/5).
5.2.1 Example
a | (b + c).
Let a, b, c ∈ Z. Prove that if a | b and a | c, then
Solution Assume that a | b and a | c. Then b = ka and c = la for some
k, l ∈ Z. Then k + l ∈ Z and b + c = ka + la = (k + l)a, so a | (b + c).
5.2.2
Example
Prove that 3 | (4n − 1) for every integer n with n ≥ 0.
Proof We use induction. For an integer n let P (n) be the statement 3 |
(4n − 1).
(i) The base case is P (0), which says 3 | (40 − 1), that is, 3 | 0. This holds
since 0 = (0)3.
(ii) Let n be an integer with n > 0 and assume that P (n − 1) holds, that is,
3 | (4n−1 − 1). By definition, 4n−1 − 1 = 3k for some k ∈ Z. We have,
4n − 1 = 4(4n−1 − 1) + 3 = 4(3k) + 3 = 3(4k + 1),
implying 3 | (4n − 1). This shows that P (n) holds.
By induction, P (n) holds for every integer n with n ≥ 0.
64
5.3
Division algorithm
Let m and n be positive integers. We have the method of long division for
dividing m by n, as shown on the left:
q
n)m
..
.
r
m
r
=q+
n
n
⇒
⇒ m = qn + r.
The process ends when we get a remainder r with 0 ≤ r < n. On the right,
we have shown that the results lead to the equation m = qn + r, which can
be interpreted as saying that n goes into m q times with r left over.
5.3.1 Theorem (Division algorithm). For every pair of integers m
and n with n > 0, there exist unique integers q and r with 0 ≤ r < n such
that
m = qn + r.
Proof. There are two claims in the statement: existence and uniqueness.
(Existence) Let n be an integer with n > 0. For an integer m let P (m)
be the statement “there exist integers q and r with 0 ≤ r < n such that
m = qn + r.” We first prove P (m) is true for every integer m with m ≥ 0
by using (complete) induction.
Fix an integer m with m ≥ 0 and assume that P (k) is true for every integer
k with 0 ≤ k < m (Induction Hypothesis). If m < n, then m = (0)n + m
and P (m) is true (with q = 0 and r = m). So we may assume that m ≥ n.
Put k = m − n. Then 0 ≤ k < m, so by the induction hypothesis P (k)
is true. Therefore, there exist integers q and r with 0 ≤ r < n such that
k = qn + r. Then m = k + n = (q + 1)n + r, which shows that P (m) is true.
By induction, P (m) is true for every integer m with m ≥ 0.
Now let m be an integer with m < 0. Since −m > 0 it follows from what
we have shown so far that there exist integers q and r with 0 ≤ r < n such
that −m = qn + r. If r = 0, then m = (−q)n + 0 and P (m) is true. On the
other hand, if r 6= 0, then
m = −(qn + r) = (−q − 1)n + (n − r),
65
and 0 ≤ n − r < n so P (m) is true (with −q − 1 playing the role of q and
n − r playing the role of r).
We have shown that P (m) is true for every integer m. Since n was an
arbitrary integer with n > 0, the proof of existence is complete.
(Uniqueness) Let m and n be integers with n > 0 and suppose that m =
qn + r and also m = q 0 n + r0 for some q, q 0 , r, r0 ∈ Z with 0 ≤ r, r0 < n.
Without loss of generality, we may assume that r ≥ r0 . We have
qn + r = m = q 0 n + r0 ,
(∗)
so
r − r0 = (q 0 − q)n,
that is, r − r0 is a multiple of n. But 0 ≤ r − r0 < n, so it follows that
r − r0 = 0, implying r = r0 . From Equation (∗) we then get qn = q 0 n, so
q = q 0 as well. This finishes the proof.
For integers m and n with n > 0, the remainder of m upon division by n is
the (unique) integer r with 0 ≤ r < n such that m = qn + r for some q ∈ Z.
5.3.2
Example
(a) Put m = 23 and n = 4. We have
m = 23 = (5)4 + 3 = 5n + 3
and 0 ≤ 3 < 4. Therefore, q = 5 and r = 3 in the theorem, and 3 is
the remainder of 23 upon division by 4.
(b) Put m = −16 and n = 7. We have
m = −16 = (−3)7 + 5 = (−3)n + 5
and 0 ≤ 5 < 7. Therefore, q = −3 and r = 5 in the theorem, and 5 is
the remainder of −16 upon division by 7.
5.4
Greatest common divisor, least common multiple
The reader probably knows that the greatest common divisor of 18 and 24 is
6. This is to say that 6 divides both 18 and 24 and it is the greatest integer
that does so.
66
For our definition of greatest common divisor we will use a formulation that
replaces the “greatest” property with a property involving only divisibility
(see part (ii) below). This formulation is equivalent to the usual one but is
easier to work with and generalizes to systems (technical term, “rings”) in
which an ordering is not defined.
Let a and b be positive integers. A greatest common divisor of a and
b is a positive integer g satisfying the following properties:
(i) g | a and g | b,
(ii) for every d ∈ Z+ such d | a and d | b, we have d | g.
If g is as in the definition, then part (i) says that g is a common divisor of
a and b, and part (ii) says that if d is any common divisor of a and b, then
d divides g (so that, in particular, d ≤ g, which justifies the use of the word
“greatest”).
We will show that a greatest common divisor always exists and is unique,
so that it will make sense to speak of the greatest common divisor of a and
b.
Put a = 18 and b = 24. Here is a table of ma + nb for a few choices of
integers m and n:
m
0
1
0
−1
1
2
3
n
0
0
1
1
−1
−1
−2
ma + mb
0
18
24
6
−6
12
6
We observe that the smallest positive entry in the column labeled ma + nb
is 6, which is the greatest common divisor of a and b, and that every entry
in this column is a multiple of 6. The next theorem says that this is no
coincidence.
67
5.4.1
Theorem. Let a and b be positive integers and put
H = {ma + nb | m, n ∈ Z}.
(i) H contains a positive integer.
(ii) H = Zg, where g is the least positive integer in H and where Zg =
{kg | k ∈ Z}.
(iii) g is a greatest common divisor of a and b and it is the unique such.
Proof. (i) We have a = 1a + 0b ∈ H and a is a positive integer.
(ii) We first note that g is in H so g = ia + jb for some i, j ∈ Z.
(⊆) Let x ∈ H. Then x = ma + nb for some m, n ∈ Z. By the division
algorithm there exist integers q and r with 0 ≤ r < g such that x = qg + r.
But then
r = x − qg = (ma + nb) − q(ia + jb) = (m − qi)a + (n − qj)b ∈ H.
Now g is the least positive integer in H and we have r ∈ H and 0 ≤ r < g
so r cannot be positive. Therefore, r = 0. Hence x = qg ∈ Zg.
(⊇) Let x ∈ Zg. Then x = kg for some k ∈ Z. Hence, x = k(ia + jb) =
(ki)a + (kj)b ∈ H.
(iii) We have a = 1a + 0b ∈ H = Zg, where we have used part (ii) for the
last equality. Therefore, a = kg for some k ∈ Z, that is, g | a. Similarly,
g | b. This checks part (i) in the definition of greatest common divisor.
Let d ∈ Z+ and assume that d | a and d | b. We have a = kd and b = ld for
some k, l ∈ Z. So g = ia + jb = i(kd) + j(ld) = (ik + jl)d, which says that
d | g. This checks part (ii) in the definition of greatest common divisor and
finishes the proof that g is a greatest common divisor of a and b.
Finally, let g 0 be an arbitrary greatest common divisor of a and b. In particular, g 0 | a and g 0 | b, so by part (ii) in the definition we get g 0 | g.
Interchanging the roles of g 0 and g in this argument, we get g | g 0 . By Exercise 5–6 we get g 0 = ±g. Since g 0 and g are both positive, it follows that
g 0 = g. Therefore, g is the unique greatest common divisor of a and b.
Let a and b be positive integers. In light of the preceding theorem it makes
sense to say the greatest common divisor a and b. We write this number
gcd(a, b).
68
The positive integers a and b are relatively prime if gcd(a, b) = 1.
5.4.2
Corollary. Let a and b be positive integers. We have
(i) gcd(a, b) = ma + nb for some m, n ∈ Z,
(ii) If a and b are relatively prime, then 1 = ma + nb for some m, n ∈ Z.
Proof. (i) In the notation of Theorem 5.4.1, we have gcd(a, b) = g ∈ H =
{ma + nb | m, n ∈ Z}, so the claim follows.
(ii) Assume a and b are relatively prime. Then using part (i), we get 1 =
gcd(a, b) = ma + nb for some m, n ∈ Z.
5.4.3 Example
Let a, b, c ∈ Z+ . Prove that if a | bc and a and b are
relatively prime, then a | c.
Solution Assume that a | bc and a and b are relatively prime. The first
assumption says that bc = ka for some k ∈ Z. According to Corollary 5.4.2
(ii) we have 1 = ma + nb for some m, n ∈ Z. Therefore,
c = 1c = (ma + nb)c = mac + nbc = mac + nka = (mc + nk)a,
so a | c.
The least common multiple of 6 and 8 is 24. So 24 is a multiple of 6 and
also a multiple of 8, and it is the least such. Put another way, 6 and 8
both divide 24, and 24 is the least positive integer that 6 and 8 both divide.
Expressing the notion of least common multiple in terms of divisibility like
this allows for a formulation analogous to that for greatest common divisor.
Let a and b be positive integers. A least common multiple of a and
b is a positive integer l satisfying the following properties:
(i) a | l and b | l,
(ii) for every m ∈ Z+ such a | m and b | m, we have l | m.
69
Note that this is the same as the definition of greatest common divisor except
that each divisibility expression x | y has been switched to y | x.
Let a and b be positive integers. Just as with greatest common divisor,
a least common multiple of a and b exists and it is unique (it is the least
positive integer in the set Za ∩ Zb), so it makes sense to say the least
common multiple of a and b. We write this number lcm(a, b).
5.4.4 Example
b ⇐⇒ a | b.
Let a and b be positive integers. Prove: lcm(a, b) =
Proof Put l = lcm(a, b).
(⇒) Assume that l = b. By part (i) in the definition of least common
multiple, we have a | l = b.
(⇐) Assume that a | b. We have b | b, so part (ii) in the definition of least
common multiple (with m = b) says l | b. On the other hand, by part (i) in
the definition of least common multiple, we have b | l. From Exercise 5–6, we
get l = ±b. Since l and b are both positive, it follows that lcm(a, b) = l = b.
Discussion:
ends).
5.5
In the proof of (⇒) the string a | l = b says a | b (look at the
Prime integer
In this section, we study the prime integers: 2, 3, 5, 7, 11, 13, 17, and so on.
Let p be an integer with p > 1. There are various ways to define what it
means for p to be prime, all of which amount to the same thing. One way
is to say p is prime if its only factorizations are p = 1p and p = p1. Another
way is to say that p is prime if it is divisible by only 1 and itself.
Yet another way is as follows:
An integer p with p > 1 is prime if the following holds:
if p | ab with a, b ∈ Z+ , then p | a or p | b.
70
The definition says that p is prime provided the only way it can divide a
product is if it divides one of the factors.
We use this as our definition in order to maintain consistency with the use
of the term prime in a more general setting (namely, ring theory).
The next theorem shows that our definition is indeed equivalent to both of
the more familiar definitions mentioned above. It lists three statements and
says that they are equivalent. This means that each is true if and only if
the others are true, that is (i ⇔ ii), (i ⇔ iii), and (ii ⇔ iii). There are six
implications here (three in each direction).
Instead of proving all six, we prove only these three: (i ⇒ ii), (ii ⇒ iii), and
(iii ⇒ i). This suffices, since these implications combine to give the missing
ones. For instance, we get (ii ⇒ i) from the string (ii ⇒ iii ⇒ i).
5.5.1
alent:
Theorem. Let p be an integer with p > 1. The following are equiv-
(i) p is prime,
(ii) if p = ab with a, b ∈ Z+ , then a = 1 or b = 1,
(iii) if k | p with k ∈ Z+ , then k = 1 or k = p.
Proof. (i ⇒ ii) Assume (i), that is, assume that p is prime. Assume that
p = ab with a, b ∈ Z+ . We have 1p = p = ab, so p | ab. Since p is prime,
either p | a or p | b. First assume that p | a. The equation p = ab implies
a | p as well, so Exercise 5–6 implies p = ±a. Since p and a are both positive,
it follows that p = a. Therefore, p = ab = pb, implying b = 1. Similarly, the
case p | b leads to a = 1, so (ii) holds.
(ii ⇒ iii) Assume that (ii) holds. Assume that k | p with k ∈ Z+ , and assume
that k 6= 1. Since k | p, we have p = kl for some l ∈ Z. Since p, k > 0 this
equation implies l > 0 as well, so l ∈ Z+ . By (ii), either k = 1 or l = 1. We
have assumed that k 6= 1, so l = 1, implying k = kl = p. Therefore, (iii)
holds.
(iii ⇒ i) Assume that (iii) holds. Assume that p | ab with a, b ∈ Z+ , and
assume that p - a. Let k be the greatest common divisor of p and a. Then
k | a, so k 6= p. But also k | p so we conclude from (iii) that k = 1, that is,
p and a are relatively prime. It now follows from Example 5.4.3 that p | b,
so p is prime, that is, (i) holds.
71
Discussion: In the proof of (i ⇒ ii), after making the assumptions, the goal
was to show a = 1 or b = 1. We could have assumed that a 6= 1 and shown
b = 1 as in Section 2.1, but in this case the particulars of the situation make
such an argument longer and less natural than the one given.
It follows from the theorem that instead of defining prime integer the way
we did we could just as well have used either property (ii) or property (iii).
5.6
Fundamental theorem of arithmetic
We have the well-known tree method for factoring a positive integer greater
than 1 into a product of primes. It is illustrated here for the integer 120:
120
12
3
10
4
2
2
120 = 2 · 2 · 2 · 3 · 5.
5
2
To begin the process, if the given number has a proper factorization, then
any such is chosen (120 = 12 · 10 in the example). The same is then done
for each of the factors, and so forth, until none of the factors has a proper
factorization, that is, until all of the factors are prime.
That the process must terminate at some point, resulting in a factorization
of the given number as a product of primes, is fairly obvious, but nevertheless
a formal argument is included in the proof below.
What might seem less obvious is that we should get the same prime factors
no matter how we choose the factorizations (starting instead with 120 =
20 · 6, for instance). This is indeed the case, though, according to the next
theorem.
5.6.1 Theorem (Fundamental Theorem of Arithmetic). Every integer greater than 1 can be written as a product of prime integers in only
one way (disregarding the order of the factors).
72
Proof. We first show the existence of a prime factorization for each integer
greater than 1, and then we show that such a factorization is unique.
(Existence) For an integer n greater than 1, let P (n) be the statement [ n
can be written as a product of prime integers ] . We prove this statement for
every integer n with n > 1 by (complete) induction.
Fix an integer n with n > 1 and assume that P (k) holds for every integer k
with 1 < k < n (Induction Hypothesis). If n is prime, then n is viewed as a
product of prime integers with a single factor, so P (n) holds. Now assume
that n is not prime. Then n does not satisfy the property (ii) of Theorem
5.5.1. So n can be factored n = kl with k, l ∈ Z+ , k, l 6= 1. Since l > 1,
the equation n = kl forces 1 < k < n so that P (k) holds by the induction
hypothesis. Therefore, k = p1 p2 · · · pr for some prime integers p1 , p2 , . . . , pr .
Similarly, 1 < l < n so P (l) holds, giving l = q1 q2 · · · qs for some prime
integers q1 , q2 , . . . , qs . Therefore,
n = kl = p1 p2 · · · pr q1 q2 · · · qs ,
which shows that P (n) holds.
By complete induction, P (n) holds for every integer n with n > 1.
(Uniqueness) For an integer n greater than 1, let P (n) be the statement [ n
can be written as a product of prime integers in at most one way (disregarding order of factors) ] . We prove this statement for every integer n with
n > 1 by (complete) induction.
Fix an integer n with n > 1 and assume that P (k) holds for every integer
k with 1 < k < n (Induction Hypothesis). Suppose we have n = p1 p2 · · · pr
and also n = q1 q2 · · · qs with pi and qi prime integers for every i. Then
p1 p2 · · · pr = n = q1 q2 · · · qs ,
(∗)
showing that p1 | q1 q2 · · · qs . Since p1 is prime, it follows that p1 | qi for some
i (see Exercise 5–15). We are not concerned with the order of the factors,
so by reordering and renumbering the qj ’s if necessary we may assume that
i = 1, that is, p1 | q1 . But q1 is prime, and by Theorem 5.5.1 (i ⇒ iii), the
only divisors of q1 are 1 and q1 . Since p1 6= 1, we get p1 = q1 . In particular,
if r, s = 1, then P (n) holds.
Therefore, we may assume that either r > 1 or s > 1. By interchanging the
labeling of the factors if necessary, we may assume that r > 1. If s = 1, then
equation (∗) gives p1 p2 · · · pr = q1 = p1 , implying p2 · · · pr = 1, which is not
possible since pj > 1 for every j forcing p2 · · · pr > 1. Therefore, s > 1.
73
Put k = p2 · · · pr , so that k = q2 · · · qs as well by Equation (∗). We have
n = p1 k and p1 > 1, forcing 1 < k < n, so that P (k) holds by the induction
hypothesis. We conclude that r = s and, after reordering and renumbering
the qj ’s if necessary, pj = qj for every j ≥ 2. We observed earlier that
p1 = q1 , so it follows that P (n) holds.
By complete induction, P (n) holds for every integer n with n > 1.
5.7
Congruence
Fix an integer n.
For integers a and b, we say that a is congruent to b modulo n,
written a ≡ b (mod n), if the difference a − b is a multiple of n. So
for a, b ∈ Z
a ≡ b (mod n)
a − b = kn for some k ∈ Z.
means
For example, 10 ≡ 4 (mod 3) since the difference 10 − 4 is a multiple of 3.
Note that 10 − 4 is just the distance between 4 and 10 on the number line.
Saying that an integer a is congruent to an integer b modulo n amounts to
saying that the distance between a and b on the number line is a multiple
of n.
Staying with the example 10 ≡ 4 (mod 3), note that both 10 and 4 have
remainder 1 upon division by 3. Saying that an integer a is congruent to
an integer b modulo n amounts to saying that both a and b have the same
remainder upon division by n. (See Exercise 5–19.)
We write a 6≡ b (mod n) to mean that it is not the case that a ≡ b (mod n)
for a, b ∈ Z.
5.7.1
Example
(a) 2 ≡ 12 (mod 5). (Reason: 2 − 12 = −10 = (−2)5.)
(b) −6 6≡ −22 (mod 3).
(Reason: −6 − (−22) = 16 6= k3 for all k ∈ Z.)
74
5.7.2 Example
(mod n).
Let a, b, n ∈ Z. Prove: If a ≡ b (mod n), then b ≡ a
Proof Assume that a ≡ b (mod n). Then a − b = kn for some k ∈ Z.
Hence,
b − a = −(a − b) = −kn = (−k)n
and −k ∈ Z, so b ≡ a (mod n).
5.7.3 Theorem. Let m, m0 , n ∈ Z with n > 0 and let r and r0 be the
remainders of m and m0 , respectively, upon division by n.
(i) We have m ≡ r (mod n).
(ii) We have m ≡ m0 (mod n) if and only if r = r0 .
Proof. (i) By the definition of remainder, we have m = qn + r for some
q ∈ Z. Therefore, m − r = qn, implying m ≡ r (mod n).
(ii) Exercise 5–19.
5.7.4 Theorem. Let a, a0 , b, b0 , n ∈ Z and assume that a ≡ a0 (mod n)
and b ≡ b0 (mod n).
(i) We have a + b ≡ a0 + b0 (mod n).
(ii) We have ab ≡ a0 b0 (mod n).
Proof. (i) By assumption, a − a0 = kn and b − b0 = ln for some k, l ∈ Z.
Therefore,
(a + b) − (a0 + b0 ) = (a − a0 ) + (b − b0 ) = kn + ln = (k + l)n
and k + l ∈ Z, so a + b ≡ a0 + b0 (mod n).
(ii) Exercise 5–18.
Suppose we wish to find the remainder of 86(96 + 70) upon division by 9.
One way is to first compute 86(96 + 70) = 86(166) = 14276 and then divide
by 9 using long division to find the remainder.
The next example shows an easier way. The example makes use of the
preceding theorems along with Exercise 5–17, which implies that if we have
a string of congruences we can conclude that the ends are congruent.
75
5.7.5 Example
Use congruences to find the remainder of 86(96 + 70)
upon division by 9.
Solution By Theorem 5.7.4, replacing any term or factor by a congruent
integer results in a congruent expression, so
86(96 + 70) ≡ 5(6 + 7) ≡ 5(13) ≡ 5(4) ≡ 20 ≡ 2
(mod 9),
which, according the Theorem 5.7.3, implies that the remainder of 86(96 +
70) upon division by 9 is 2. (In a string of congruences modulo n, we write
(mod n) only once, at the end.)
5.7.6 Example
Let a, n ∈ Z and put a + Zn = {a + kn | k ∈ Z}.
Prove: For every x ∈ Z we have x ≡ a (mod n) if and only if x ∈ a + Zn.
Proof Let x ∈ Z. We have
x ≡ a (mod n)
⇐⇒
x − a = kn for some k ∈ Z
⇐⇒
x = a + kn for some k ∈ Z
⇐⇒
x ∈ a + Zn.
5 – Exercises
5–1 Let m and n be odd integers. Prove that m + n is even.
5–2 Let a ∈ Z. Prove that a is even if and only if a − 1 is odd.
5–3 Let m be an odd integer. Use induction to prove that mn is odd for
every integer n with n ≥ 1.
5–4 Let a, b, c ∈ Z. Prove that if a | b and b | c, then a | c.
5–5 Let a, b, c ∈ Z with c 6= 0. Prove: a | b iff ca | cb.
76
5–6 Let m, n ∈ Z. Prove that if m | n and n | m, then m = ±n.
5–7
(a) Prove that a | 0 for every a ∈ Z.
(b) Let a ∈ Z. Prove that 0 | a if and only if a = 0.
5–8 Prove that 3 | (n3 + 5n + 6) for every integer n with n ≥ 0.
5–9 For the given integers m and n, find integers q and r with 0 ≤ r < n
as in the Division Algorithm and write a string of equalities to show that
the equation m = qn + r is satisfied.
(a) m = 27, n = 4;
(b) m = −18, n = 5.
5–10 Let m ∈ Z. Prove using the division algorithm: m is even or m is
odd.
5–11 Let a and b be positive integers. Prove: gcd(a, b) = a ⇐⇒ a | b.
5–12 Let a, b, c ∈ Z+ and put g = gcd(a, b). Prove: If a | bc, then (a/g) | c.
(This generalizes Example 5.4.3.)
5–13 Let a, b, c ∈ Z+ . Prove: lcm(ca, cb) = c lcm(a, b).
Hint: Put l0 = lcm(ca, cb) and l = lcm(a, b). The claim is that l0 = cl. Use
the definition of least common multiple and Exercise 5–5 to show that each
side divides the other, and then use Exercise 5–6.
77
5–14 Let p be a prime integer and put I = {kp | k ∈ Z}. Let a, b ∈ Z+ .
Prove: If ab ∈ I, then a ∈ I or b ∈ I.
5–15 Let p be a prime integer. Prove: For every positive integer n, if
p | a1 a2 · · · an with a1 , a2 , . . . , an ∈ Z, then p | ai for some i.
Hint: Use induction.
5–16 Decide whether each statement is true or false and provide an explanation.
(a) 5 ≡ −3 (mod 3).
(b) −4 ≡ −20 (mod 2).
(c) For every a, b ∈ Z, a ≡ b (mod 1).
5–17 Let a, b, c, n ∈ Z.
(a) Prove: a ≡ a (mod n).
(b) Prove: If a ≡ b (mod n) and b ≡ c (mod n), then a ≡ c (mod n).
5–18 Prove Theorem 5.7.4 (ii): Let a, a0 , b, b0 , n ∈ Z and assume that
a ≡ a0 (mod n) and b ≡ b0 (mod n). We have ab ≡ a0 b0 (mod n).
5–19 Prove Theorem 5.7.3 (ii): Let m, m0 , n ∈ Z with n > 0 and let r and
r0 be the remainders of m and m0 , respectively, upon division by n. We have
m ≡ m0 (mod n) if and only if r = r0 .
5–20 Let a, n ∈ Z. Prove that the following are equivalent:
(i) a ≡ 0 (mod n),
(ii) n | a,
78
(iii) a ∈ Zn, where Zn = {kn | k ∈ Z}.
Hint: See the comments preceding Theorem 5.5.1.
5–21 Let p be a prime integer. Let a ∈ Z+ with a 6≡ 0 (mod p). Prove:
There exists m ∈ Z such that ma ≡ 1 (mod p).
Hint: Corollary 5.4.2.
79
6
6.1
Proofs - III
Negation
Let n ∈ Z. The negative of the statement n > 3 is the statement [ It is not
the case that n > 3 ] , which can be written n ≯ 3. Since we know that either
n > 3 or n ≤ 3, we can express n ≯ 3 by writing n ≤ 3. So the negative of
the statement n > 3 is the statement n ≤ 3:
Statement: n > 3,
Negative: n ≤ 3.
Negation flips the truth value of a statement, meaning, if the statement is
true, then its negative is false, and vice versa. Here, if it is true that n > 3,
then it is false that n ≤ 3. On the other hand, if it is false that n > 3, then
it is true that n ≤ 3.
If P is a statement, then ¬ P denotes the negative of P . For instance,
¬ (n > 3) is n ≤ 3.
6.2
Negating And and Or
Let n ∈ Z. Here is an and statement followed by its negative:
Statement: n > 3 and n ≤ 7,
Negative: n ≤ 3 or n > 7.
The negative was obtained by imagining what would make the statement
false. Since the statement is true if both of the conditions n > 3 and n ≤ 7
hold, the statement is false if either of the conditions fails, that is, if n ≤ 3
or n > 7.
The example illustrates a general rule: To negate an and statement, negate
each part of the statement and replace “and” by “or.” Here and below, P
and Q denote statements.
80
Statement: P and Q,
Negative: ¬ P or ¬ Q.
Let n ∈ Z. Here is an or statement followed by its negative:
Statement: n ≤ 5 or n = 10,
Negative: n > 5 and n =
6 10.
The negative was obtained by imagining what would make the statement
false. Since the statement is true if either of the conditions n ≤ 5 or n = 10
holds, the statement is false if both of the conditions fail, that is, if n > 5
and n 6= 10.
In general, to negate an or statement, negate each part of the statement
and replace “or” by “and.”
Statement: P
or
Q,
Negative: ¬ P and ¬ Q.
This fits in nicely with the fact that if we negate a statement twice we should
get back to the original statement: The statement [ P and Q ] negates to
[ (¬ P ) or (¬ Q) ] , which in turn negates to [ (¬ (¬ P )) and (¬ (¬ Q)) ] , and
this is the same as the original statement [ P and Q ] .
6.2.1 Example
Here are some statements about an integer n together
with their negatives:
(a) Statement: n > 5 and n is even.
Negative: n ≤ 5 or n is odd.
81
(b) Statement: n = 4 or n ≡ 0 (mod 5).
Negative: n =
6 4 and n ≡
6 0 (mod 5).
(c) Statement: 3 | n and [ n < 0 or n ≥ 9 ] .
Negative: 3 - n or [ n ≥ 0 and n < 9 ] .
6.3
Negating For-every and There-exists
Let X be a subset of Z. Here is a for-every statement followed by its
negative:
Statement:
Negative:
For every x ∈ X, we have x + 1 ∈ X.
There exists x ∈ X such that x + 1 ∈
/ X.
The statement is true if it is the case that as x ranges through X we always
find that x + 1 ∈ X. So the statement is false if there happens to exist some
x in X for which x + 1 ∈
/ X. This is how the negative was obtained.
In general, to negate a for-every statement, change “For every” to “There
exists” and negate what follows. Here and below, X is a set, and for each
x ∈ X, P (x) is a statement involving x.
Statement:
Negative:
For every x ∈ X, we have P (x).
There exists x ∈ X such that ¬ P (x).
We can now formalize the argument given in Section 2.2 for why the statement [ For every x ∈ ∅, we have P (x) ] should be considered true (we introduced the terminology “vacuously true” for this situation). The negative of
this statement is [ There exists x ∈ ∅ such that ¬ P (x) ] , which is clearly
false (since there cannot exist x ∈ ∅), so the original statement should indeed
be considered true.
Let X be a subset of Z. Here is a there-exists statement followed by its
negative:
82
Statement:
Negative:
There exists x ∈ X such that x > 0.
For every x ∈ X, we have x ≤ 0.
The statement is true if there is at least one element x of X that is greater
than 0. So the statement is false if, for every x in X we have x ≤ 0. This is
how the negative was obtained.
In general, to negate a there-exists statement, change “There exists” to “For
every,” and negate what follows.
Statement:
Negative:
There exists x ∈ X such that P (x).
For every x ∈ X, we have ¬ P (x).
Note that negating a for-every statement produces a there-exists statement,
and negating that statement gets us back to the original for-every statement,
as expected.
6.3.1 Example
their negatives.
(a)
Statement:
Negative:
(b)
(c)
Let X ⊆ R. Here are some statements together with
For every x ∈ X, we have −2 ≤ x < 3.
There exists x ∈ X such that x < −2 or x ≥ 3.
Statement:
For every x ∈ X, there exists n ∈ N such that n > x.
Negative:
There exists x ∈ X such that for every n ∈ N we
have n ≤ x.
Statement:
There exists r ∈ R \ X with r > 1 such that r = x2
for some x ∈ X.
For every r ∈ R \ X with r > 1, we have r 6= x2 for
every x ∈ X.
Negative:
83
Discussion:
In part (c) the reason that r > 1 does not get changed to
r ≤ 1 in the negative statement is that the phrase “with r > 1” is part of
the definition of the set in question. We can make this explicit by putting
Y = (R \ X) ∩ (1, ∞) so that the statement becomes “There exists r ∈ Y such
that r = x2 for some x ∈ X.”
6.4
Counterexample
The following is an example of a false statement and its disproof:
False statement:
Disproof :
For every x ∈ Z, we have −x ≤ x.
Put x = −1. Then x ∈ Z and −x = −(−1) = 1 −1 = x.
The statement asserts that for every integer x the inequality −x ≤ x holds,
so to prove the statement is false, we exhibit a single x for which the inequality fails. Such an x is called a “counterexample” to the statement.
We can put the idea of a counterexample in terms of things we have already
studied: The false statement above has the form [ For every x ∈ X, we have
P (x) ] . Disproving the false statement is the same as proving its negative,
which is [ There exists x ∈ X such that ¬ P (x) ] , so we use the method of
Section 2.3 for proving a there-exists statement.
False statement:
For every x ∈ X, we have P (x).
Disproof : Put x = (something worked out on scratch paper).
(Show that x ∈ X and that ¬ P (x).)
The x in the disproof is a counterexample to the statement. The method
for disproving a false statement can be put succinctly: Give a single, explicit
counterexample.
6.4.1
Example
Disprove: For every x ∈ R, we have x2 ≥ x.
Disproof Put x = 1/2. Then x ∈ R and x2 = 1/4 1/2 = x.
The method extends naturally to the case where the for-every phrase involves more than one element of a set.
84
6.4.2 Example
(x − y) − z.
Disprove: For every x, y, z ∈ Z, we have x − (y − z) =
Disproof Put x, y = 0 and z = 1. Then x, y, z ∈ Z and
x − (y − z) = 0 − (0 − 1) = 1 6= −1 = (0 − 0) − 1 = (x − y) − z.
Discussion: The equation in the statement simplifies to z = −z. This gives
the idea for the counterexample, since it says we just need some x, y, and z
with z 6= −z, and we choose the simplest such.
6.4.3 Example
Disprove: For every function f : R → R, we have
f (r) < 0 for some r ∈ R.
Disproof Define f : R → R by f (x) = 1. For every r ∈ R, we have
f (r) = 1 ≮ 0.
Discussion: Informally: The statement can be regarded as saying that every
function from R to R has a graph that dips below the x-axis at some point.
This is clearly false since, for instance, the function that is constantly 1 has as
graph the horizontal line at height 1, which never goes below the x-axis.
More formally: Denoting the set of all functions from R to R by F, we can
replace the start of the statement with [ For every f ∈ F . . . ] , so the statement
has the right form for our method. The first sentence of the disproof defines
the counterexample f (using wording that is more appropriate for functions
than “Put f = · · ·”). By definition, f ∈ F, so all that remains is to observe
that this f satisfies the negative of the condition, which is [ For every r ∈ R,
we have f (r) ≮ 0 ] .
6.5
Contrapositive
Let n ∈ Z+ . The following is an if-then statement and its proof by the
method of “contraposition”:
Statement:
If n = 2, then 2n + 3 = 7.
85
Proof : We prove the contrapositive. Assume that 2n + 3 6= 7. Subtracting
3 and dividing by 2 yields n 6= 2.
The “contrapositive” of the given statement is [ If 2n + 3 6= 7, then n 6= 2 ] .
This says the same thing as the original statement, so we can choose to
prove the contrapositive instead, and this is what we did.
More generally, given the statement [ If P , then Q ] we can form its contrapositive [ If ¬Q, then ¬P ] . The contrapositive says the same thing as
the original statement. (The statements are logically equivalent, meaning
they are both true or both false.)
Statement:
Proof :
If P , then Q.
We prove the contrapositive. Assume ¬ Q. (Prove ¬ P .)
This method of proving an if-then statement by proving its contrapositive
is called proof by contraposition.
6.5.1 Example
0, then n ≥ 4.
Let n ∈ Z+ . Prove by contraposition: If n2 − 2n − 8 ≥
Proof We prove the contrapositive. Assume that n < 4. Then n − 4 < 0
and n + 2 > 0 (since n ≥ 1), so
n2 − 2n − 8 = (n − 4)(n + 2) < 0.
6.5.2 Example
x is even.
Let x ∈ Z. Prove by contraposition: If x2 is even, then
Proof We prove the contrapositive. Assume that x is not even. Then x is
odd, implying that x = 2n + 1 for some n ∈ Z. We have
x2 = (2n + 1)2 = 4n2 + 4n + 1 = 2(2n2 + 2n) + 1,
and 2n2 + 2n ∈ Z, so x2 is odd. In particular, x2 is not even.
86
6.5.3 Example
Define f : R → R by f (x) = 4x − 2 and let r ∈ R.
Prove by contraposition: If f (3r − 1) ∈ [6, 8), then r ∈ [1, ∞).
Proof We prove the contrapositive. Assume that r ∈
/ [1, ∞). Then r < 1,
implying
f (3r − 1) = 4(3r − 1) − 2 = 12r − 6 < 6.
Therefore, f (3r − 1) ∈
/ [6, 8).
6.6
Proof by contradiction
The following is a statement and its “proof by contradiction”:
Statement:
For every r ∈ R, we have r2 + 1 6= 0.
Proof : Assume, to the contrary, that the statement is false. Then there
exists r ∈ R such that r2 + 1 = 0. But this equation implies r2 = −1, which
contradicts the fact that the square of a real number is never negative. We
conclude that the original statement is true.
A proof by contradiction begins by assuming that the statement is false.
Then that assumption is used to derive a contradiction (here r2 = −1). The
contradiction signals that there must be a mistake somewhere in the proof.
Provided all of the other steps are valid, there is just one possible place
where the mistake can have occurred, namely, the initial assumption that
the statement is false. The conclusion is that the statement must be true
after all.
Here is the method for proof by contradiction:
Statement:
P.
Proof : Assume, to the contrary, that P is false. (Derive a contradiction.) We conclude that P is true.
In the proof, the assumption that P is false is the same as the assumption
that ¬ P is true, so the rules for negating statements apply.
87
6.6.1 Example
Prove by contradiction: The interval I = (0, ∞) does
not have a least element. More precisely, there does not exist r ∈ I such
that r ≤ x for all x ∈ I.
Proof Assume, to the contrary, that I has a least element r, so that r ∈ I
and r ≤ x for all x ∈ I. Put x = r/2. We have r > 0, so x = r/2 > 0,
implying x ∈ I. By assumption, r ≤ x = r/2. Dividing by r yields 1 ≤ 1/2,
a contradiction. We conclude that the statement is true.
6.6.2 Example
Put A = {(x − 1, 1 − y) | x, y ∈ R+ } and B = {(x, y) ∈
R2 | y − x = 2}. Prove by contradiction: A ∩ B = ∅.
Proof Assume, to the contrary, that A∩B 6= ∅. Then there exists v ∈ A∩B,
so that v ∈ A and v ∈ B. Since v ∈ A, we have v = (x − 1, 1 − y) for some
x, y ∈ R+ . Since (x − 1, 1 − y) = v ∈ B, we have (1 − y) − (x − 1) = 2,
which simplifies to y = −x. But x ∈ R+ , so y = −x < 0, contradicting that
y ∈ R+ . We conclude that A ∩ B = ∅.
We end this section with two famous theorems, both of which are proved
using contradiction.
√
6.6.3 Theorem. We have 2 ∈
/ Q.
√
Proof. √Assume, to the contrary, that 2 ∈ Q = {m/n | m, n ∈ Z, n 6= 0}.
Then 2 = m/n for some m, n ∈ Z with n 6= 0. By canceling between
numerator and denominator if necessary, we may assume that the fraction
m/n is in lowest terms, that is, m and n are relatively prime.
√
Squaring both sides of 2 = m/n and multiplying by n2 yields 2n2 = m2 .
This equation shows that 2 | m2 = mm. Since 2 is prime, we get 2 | m,
so m = 2k for some k ∈ Z. Substituting into the earlier equation we get
2n2 = (2k)2 = 4k 2 , implying n2 = 2k 2 . But this says 2 | n2 = nn, implying
2 | n.
So 2 divides both m and n, contradicting that we
√ chose m and n to be
relatively prime. We conclude that the statement 2 ∈
/ Q is true.
6.6.4
Theorem. There are infinitely many prime numbers.
Proof. Assume, to the contrary, that there are only finitely many primes
p1 , p2 , . . . , pn . Put s = p1 p2 · · · pn + 1 and note that s is an integer greater
88
than 1. By the Fundamental Theorem of Arithmetic (Theorem 5.6.1) we can
factor s as a product of primes. In this factorization, the prime pi appears
for some i, so that s = pi m, where m is the product of the remaining prime
factors (or m = 1 if there are no other factors). But then,
1 = s − p1 p2 · · · pn = pi (m − p1 p2 · · · pˆi · · · pn ),
where the symbol pˆi means “delete pi .” The expression in the parentheses
is just some integer and, since it is not possible to multiply the prime pi by
another integer and get 1, this is a contradiction. We conclude that there
are infinitely many prime numbers.
6 – Exercises
6–1 Let n ∈ Z. Write the negative of each of the following statements:
(a)
Statement:
n > 5 or n ≤ −5.
(b)
Statement:
n/2 ∈ Z and 4 - n.
(c)
Statement:
[ n is odd and gcd(n, 18) = 3 ] or n ∈ {4m | m ∈ Z}.
6–2 Let X be a subset of R. Write the negative of each of the following
statements.
(a)
Statement:
There exists x ∈ X such that x ∈
/ Z and x < 0.
(b)
Statement:
For every x ∈ X, we have x ∈ {r ∈ R | r =
0 or 1/r ∈ Z}.
(c)
Statement:
For every n ∈ N, there exists x ∈ X ∩ (n, n + 1).
6–3 Let X be a subset of R and let r ∈ R. Write the negative of each of
the following statements.
(a)
Statement:
X ⊆ R+ and for every n ∈ Z, we have x ∈ X for
some x > n.
(b)
Statement:
X ∩ [n, n + 1] 6= ∅ for every n ∈ Z, and x ∈ X for
some x ∈ Z with 1 ≤ x ≤ 5.
89
(c)
Statement:
For every ε ∈ R with ε > 0 there exists N ∈ N such
that 1/n < ε for every n ∈ N with n > N .
6–4 Put A = {n ∈ Z+ | 1/(n + 1) ∈ Z}. Prove or disprove: For every
n ∈ A we have n2 = 3.
6–5 Disprove: For every x ∈ Z, we have x2 6= 4.
6–6 Disprove: For every x, y, z ∈ R+ , we have x/(y/z) = (x/y)/z.
6–7 Disprove: For every function f : R → R, we have f (−x) = −f (x) for
every x ∈ R.
6–8 Prove or disprove: For every a, b, n ∈ Z+ with a 6≡ 0 (mod n) and
b 6≡ 0 (mod n), we have ab 6≡ 0 (mod n).
6–9 Let x ∈ Z. Prove by contraposition: If x2 is odd, then x is odd.
6–10 Let m, n ∈ Z. Prove by contraposition: If m + n ≥ 19, then m ≥ 10
or n ≥ 10.
6–11 Let m ∈ Z. Prove by contraposition: If 8 - (m2 − 1), then m is even.
6–12 Define f : R → R by f (x) = 4 − x and let r ∈ R. Prove by
contraposition: If 6r − 8 ∈ (−5, −2], then f (r + 1) ∈ [2, ∞).
6–13 Put A = {2x + 3 | x ∈ [1, ∞)} and B = {x ∈ R | 5 − x > 0}. Prove
by contradiction: A ∩ B = ∅.
90
6–14 Prove by contradiction: The parabola y = x2 and the line y = 2x − 2
do not intersect.
Hint: The claim is that there does not exist a point (r, s) satisfying both
equations.
6–15 Define f : R → R by f (x) = x + 1. Prove by contradiction: f does
not have a maximum value on the interval I = (−∞, 1). More precisely,
there does not exist a real number M such that M = f (r) for some r ∈ I
and M ≥ f (x) for every x ∈ I.
6–16 Prove by contradiction: For every prime integer p, we have
91
√
p∈
/ Q.
7
Function
7.1
Notation and terminology
We discussed some function basics in Section 1.4 so that we could include
functions in the examples and exercises in the preceding sections. Here, we
turn to a more in-depth study of functions.
Let X and Y be sets. A function f from X to Y (written f : X → Y )
is a rule that assigns to each element x of X a unique element f (x) of Y ,
depicted using a Venn diagram like this:
f
X
x
Y
f (x)
We regard a function as a device that takes an input and produces an output.
If the function f is handed the input x, it produces the output f (x). For
example, if the function f : R → R given by f (x) = x2 is handed the input
3, it produces the output f (3), which is 9.
The set X is the domain of f and the set Y is the codomain of f . The
domain of f is the set of all possible inputs, and the codomain of f is a set
containing all of the possible outputs of f (but the codomain might contain
elements that are not actual outputs).
Let f : X → Y be a function. This says to let f represent an arbitrary
function with domain X and codomain Y . If we are given a function like
this with no further information, it is possible to answer some questions
about f as the following example shows.
7.1.1
Example
Let f : Z+ → Z be a function.
(a) Is f (−1) defined?
(No. Anything playing the role of x in the expression f (x) must be an allowable input, that is, an element of the
domain Z+ of f . The number −1 is not in Z+ .)
(b) Does there exist n ∈ Z+ such that f (n) = 3/2?
(No. For any
+
n ∈ Z the notation f (n) stands for the corresponding output, which
92
must be an element of the codomain Z of f . The number 3/2 is not
in Z so it cannot equal an output of f .)
(c) Let m, n ∈ Z+ . Is f (m + n) defined?
(Yes. Since m and n are
positive integers, their sum m + n is as well. Therefore, m + n is in
the domain Z+ of f , so m + n is an allowable input.)
Define f : Z+ → Z by f (n) = 2n + 3. This sentence defines a particular
function by saying how the output is obtained from the input. It says,
if the input is n, then the corresponding output f (n) is what you get by
multiplying the input n by 2 and adding 3:
f (n)
O
=O
2n +
O 3.
output corres. to n
is
this
Here are some examples of functions having either domain or codomain not
just a set of numbers.
7.1.2 Example
Define f : Z → P(R) by f (n) = [n, n + 1). For example, f (3) = [3, 4) and f (−2) = [−2, −1).
7.1.3 Example
Define d : R × R → R by d(x, y) = |x − y|. For
example, d(1, 3) = |1 − 3| = 2 and also d(3, 1) = |3 − 1| = 2. In general, for
real numbers x and y, the number d(x, y) is the distance between x and y
on the number line.
Discussion:
The inputs here are pairs (x, y), so we really should write
d((x, y)) instead of d(x, y) since the function notation requires a pair of parentheses as well. However, it is customary to drop the outer parentheses in
situations like this.
7.1.4 Example
Define g : R → R × R by g(θ) = (θ, sin θ). For example, g(π/2) = (π/2, sin(π/2)) = (π/2, 1), and similarly g(π) = (π, 0). In
general, for an input θ, the corresponding output g(θ) is the point on the
graph of the sine function at the number θ.
93
Real function
A real function is a function having domain a subset of R and having
codomain R. In other words, a function f is a real function provided it is
of the form f : X → R, where X ⊆ R. (The more precise terminology for
such a function is “real-valued function of a real variable.”)
Let f be the real function given by f (x) = 1/(x + 1). The understanding in
definitions of real functions such as this is that the domain of the function
is the set of all real numbers x for which the expression is defined. In short,
the domain is the largest subset of R that makes sense. Here, the expression
1/(x + 1) is defined for every real number x except x = −1, so the domain
of f is R \ {−1}, which can also be written (−∞, −1) ∪ (−1, ∞).
7.1.5 Example
Let f be the real function given by f (x) =
Find the domain of f .
√
x2 − 9.
Solution For a real number
√ x, the
√ given expression is defined if and only if
x2 − 9 ≥ 0, that is, |x| = x2 ≥ 9 = 3. Therefore, the domain of f is the
set (−∞, −3] ∪ [3, ∞).
Let f : X → R be a real function. We describe the “graph” of f . The
domain of f is a subset of the set R, which is depicted by the horizontal
axis. For an element x in the domain of f , a point is drawn above x at height
f (x). (The point is drawn below x if f (x) is negative.) All such points form
the graph of f . So the graph of f is the set {(x, f (x)) | x ∈ X}.
f
(x, f (x))
f (x)
x
0
In order to measure heights, we keep a ruler (the vertical axis) at the origin,
which we can slide left or right as needed to make the measurement.
94
f
f (x) = 2
2
x
0
Alternatively, we can imagine the vertical axis as being a fixed representation
of the codomain R of f . In this case, for an input x, the corresponding
output f (x) is obtained by going up to the point on the graph above x (or
down to the point as the case may be) and then across to the vertical axis.
f
f (x)
0
x
A real number x (on the horizontal axis) is in the domain of f if and only
if there is a point on the graph of f directly above or below x. This implies
that the domain X of f is the “shadow” of the graph on the horizontal
axis. More precisely, the domain of f is the projection of the graph onto the
horizontal axis, where parts of the graph above the axis are projected down
and parts below the axis are projected up. The domain of f is shaded in
the diagram below.
95
f
1
1
domain of f = [−2, 0) ∪ (1, 3]
In Section 1.4 we defined the image of the function f , denoted im f , to be
the set of all outputs: im f = {f (x) | x ∈ X}. Since a real number on the
vertical axis is an output of f if and only if it has an arrow coming to it
as in the diagrams above, it follows that im f is the projection of the graph
onto the vertical axis. The image of f is shaded in the diagram below.
f
1
1
im f = (−∞, −1] ∪ (1, 2]
This discussion of graphs of real functions depends heavily on our visualization of real numbers as points on a number line. It does not apply to
functions that are not real. For those functions we have only the Venn
diagram visualization.
96
Equality
Two functions f : X → Y and g : X → Y are equal (written f = g) if
f (x) = g(x) for every x ∈ X. Note that, in the definition, the functions
f and g have the same domain X and the same codomain Y . So, if two
functions have different domains or they have different codomains, then
they cannot be equal.
7.1.6
Example
(a) Define f, g : R → R by f (x) = cos2 x + sin2 x and g(x) = 1. Then
f = g since, for every x ∈ R, we have
f (x) = cos2 x + sin2 x = 1 = g(x)
by a trigonometric identity.
(b) Define f, g : (−1, ∞) → R by f (x) = x and g(x) = |x|. Then f 6= g
since −1/2 ∈ (−1, ∞) and
f (−1/2) = −1/2 6= 1/2 = | − 1/2| = g(−1/2).
(c) Let f and g be the real functions given by f (x) = x and g(x) = x2 /x.
Since 0 is in the domain of f but it is not in the domain of g, the
functions have different domains. Therefore, f 6= g.
7.2
Well defined
If we write something like [ Define f : R → R+ by f (x) = x2 + 1 ] , we are
simply proposing a function. We need to check some things before we can
be certain that the proposed function is actually “well defined.”
For a proposed function to be well defined (and hence actually be a function) it must assign to each element of its domain a unique element of its
codomain. So a proposed function is not well defined if there is an element
of the stated domain for which any one of the following occurs:
97
f
Y
X
f
Y
X
f
Y
X
(i) an output is not defined,
?
(ii) more than one output is defined,
(iii) the output is not in the stated codomain.
7.2.1 Example
The following proposed functions are not well defined
(and are therefore not actually functions):
(a) f : R → R given by f (x) = 1/x. (The number 0 is in the domain R,
but f (0) = 1/0 is undefined, so f does not assign an element to each
element of its domain, that is, f is not well defined due to (i) above.)
(b) g : [0, ∞) → R given by g(x) = y where y 2 = x. (We have g(4) = 2
(since 22 = 4), but also g(4) = −2 (since (−2)2 = 4), so g does not
assign a unique element to each element of its domain, that is, g is not
well defined due to (ii) above.)
(c) h : [2, ∞) → (4, ∞) given by h(x) = x2 . (The number 2 is in the
domain [2, ∞), but h(2) is 4, which is not in the codomain, so h does
not assign to each element of its domain an element of its codomain,
that is, h is not well defined due to (iii) above.)
98
The function f : R → R given by
(
x2 + 1,
f (x) =
6 − x,
if x < 3,
if x ≥ 3
is an example of a function defined piecewise. Here, the output f (x) corresponding to a given input x depends on whether x < 3, in which case the
output is x2 + 1, or x ≥ 3, in which case the output is 6 − x. For instance,
f (2) = (2)2 + 1 = 5, since the input 2 satisfies 2 < 3. On the other hand,
f (4) = 6 − 4 = 2, since the input 4 satisfies 4 ≥ 3.
7.2.2 Example
Define a function f : R → R+ such that f (2) = 1/2,
f (3) = 1/3, and f (4) = 1/4.
Solution Define f : R → R+ by
1
f (x) = |x|
1
if x 6= 0,
if x = 0.
Discussion: The given constraints suggest that we should send an input to
its reciprocal, so our first thought is to define f (x) = 1/x. However, this would
give f (−1) = −1, which is not in the stated codomain R+ , and the same issue
arises for other negative inputs as well. So we adjust by writing f (x) = 1/|x|.
Finally, the domain is stated to be R so we need to provide an output for every
real number. As it stands there is no output associated with the input 0 since
f (0) = 1/|0| is undefined. Therefore, we use a piecewise definition to define
f (0) = 1.
This is not the only possible solution.
7.3
Image, Preimage
Image
Let f : X → Y be a function and let A be a subset of X. The set of all
outputs obtained by applying f to the elements of A is denoted f (A) and is
called the “image of A under f :”
99
f
X
Y
f (A)
A
Here is the formal definition:
Let f : X → Y be a function and let A ⊆ X. The image of A
under f is the set
f (A) = {f (a) | a ∈ A}.
7.3.1 Example
(−2, 1].
Define f : R → R by f (x) = x2 + 1, and put A =
(a) Prove that 3 ∈ f (A).
(b) Find f (A).
Solution
√
(a) Proof.
Put a = − 2. We have 2 < 4, so√taking square roots gives
√
2 < 2. Therefore, negating yields a = − 2 > −2. Also, a ≤ 0 < 1.
Since a ∈ R as well, we get a ∈ (−2, 1] = A. It follows that 3 =
a2 + 1 = f (a) ∈ f (A).
(b) The part of the graph above A = (−2, 1], which is shown in red in
the diagram below, is projected onto the vertical axis to find f (A).
Therefore, f (A) = [1, 5).
100
f
5
1
−2
1
Recall that R2 is defined to be the Cartesian product
R × R = {(x1 , x2 ) | x1 , x2 ∈ R}.
We use the notational convention that if x is an element of R2 , then x =
(x1 , x2 ), and if a is an element of R2 , then a = (a1 , a2 ), and so forth (i.e.,
the components of the element use the same letter).
7.3.2 Example
Define f : R2 → R2 by f (x) = (x1 + x2 , −3x1 ) and
2
put A = {x ∈ R | x2 = 4x1 }. Prove that (10, −6) ∈ f (A).
Proof Put a = (2, 8). We have a2 = 8 = 4(2) = 4a1 , so a ∈ A. Therefore,
(10, −6) = (2 + 8, −3(2)) = f ((2, 8)) = f (a) ∈ f (A).
Preimage
Let f : X → Y be a function and let B be a subset of Y . The set of all
inputs that have corresponding outputs in B is denoted f −1 (B) and is called
the “preimage of B under f :”
101
f
X
Y
f −1 (B)
B
Here is the formal definition:
Let f : X → Y be a function and let B ⊆ Y . The preimage of B
under f is the set
f −1 (B) = {x ∈ X | f (x) ∈ B}.
7.3.3 Example
[−1, 2].
Define f : R+ → R by f (x) =
√
x, and put B =
(a) Prove that 3 ∈ f −1 (B).
(b) Find f −1 (B).
Solution
(a) Proof. By definition, f −1 (B) √
= {x ∈ R | f (x)
√ ∈ [−1, 2]}. Now 3√< 4,
so taking square roots we get √ 3 < 2. Also, 3 ≥ 0 > −1. Since 3 is
in R as well, we have f (3) = 3 ∈ [−1, 2]. Therefore, 3 ∈ f −1 (B).
(b) The set B = [−1, 2] is shaded on the vertical axis in the diagram
below. The set f −1 (B) consists of those numbers on the horizontal
axis having the property that if you go above them to the graph and
then across you get a number in B. Put another way, the portion of
the graph colored red contains precisely those points that project into
the shaded region on the vertical axis and the numbers below that red
portion constitute the set f −1 (B). Therefore, f −1 (B) = [0, 4].
102
f
2
4
−1
A subset X of R is closed under addition if for every x, y ∈ X we have
x + y ∈ X.
7.3.4 Example
Let f : R → R be a function and let B ⊆ R. Assume
that f (x + y) = f (x) + f (y) for every x, y ∈ R. Prove: If B is closed under
addition, then f −1 (B) is closed under addition.
Proof Assume that B is closed under addition. Let x, y ∈ f −1 (B). By the
definition of f −1 (B), we have f (x), f (y) ∈ B, so
f (x + y) = f (x) + f (y) ∈ B,
the last step due to the fact that B is closed under addition. It follows that
x + y ∈ f −1 (B). Therefore, f −1 (B) is closed under addition.
7.4
Injective function
Let f : X → Y be a function. Informally, f is “injective” if it never sends
two inputs to the same output:
X
f
Y
X
f injective
f
f not injective
We can express this property as follows:
103
Y
For every x, x0 ∈ X, if x 6= x0 , then f (x) 6= f (x0 ).
In words, different inputs always produce different outputs.
For our formal definition of injective function we replace the if-then portion
of the statement above by its contrapositive (which does not change the
meaning). This has the advantage of replacing “6=” signs by “=” signs and
it puts the definition in a convenient form for writing proofs.
The function f : X → Y is injective if it satisfies the following:
For every x, x0 ∈ X, if f (x) = f (x0 ), then x = x0 .
An injective function is called an injection.
In words, f is injective if whenever two inputs x and x0 have the same output,
it must be the case that x and x0 are just two names for the same element.
7.4.1 Example
2x + 3 is injective.
Prove that the function f : R → R given by f (x) =
Proof Let x, x0 ∈ R and assume that f (x) = f (x0 ). Then 2x + 3 = 2x0 + 3
and we can subtract 3 from both sides and divide both sides by 2 to get
x = x0 . Therefore, f is injective.
7.4.2 Example
is not injective.
Prove that the function f : R → R given by f (x) = x2
Proof Put x = 1 and x0 = −1. We have x, x0 ∈ R and
f (x) = f (1) = 12 = 1 = (−1)2 = f (−1) = f (x0 ),
but x = 1 6= −1 = x0 . Therefore, f is not injective.
Discussion: It is not essential to use the letters x and x0 . One could write
the proof as follows: We have 1, −1 ∈ R and f (1) = 12 = 1 = (−1)2 = f (−1),
but 1 6= −1. Therefore, f is not injective.
104
If f is a real function, then we can tell from its graph whether or not the
function is injective: f is injective if and only if its graph passes the “horizontal line test,” that is, every horizontal line touches the graph in at most
one point.
f
f
x
f injective
x0
f not injective
The graph on the left passes the horizontal line test, implying that the
function never sends two inputs to the same output. Therefore, the function
is injective.
The graph on the right fails the horizontal line test since a horizontal line
intersects the graph at x and also at x0 . So we have f (x) = f (x0 ), but x 6= x0 ,
which implies that the function is not injective.
7.4.3 Theorem. Let X and Y be nonempty finite sets and let f : X → Y
be a function. If f is injective, then |X| ≤ |Y |.
Proof. We prove the contrapositive. Assume that |X| > |Y |. Then there are
more inputs to the function f than there are possible outputs. It follows that
two inputs must have the same output. More precisely, there exist x, x0 ∈ X
with x 6= x0 such that f (x) = f (x0 ). Therefore, f is not injective.
The argument used in the proof is called the pigeonhole principle. One
thinks of the elements of X as pigeons and the elements of Y as holes. The
pigeons fly to the holes and, if |X| > |Y |, then there are more pigeons than
holes, so two pigeons must end up occupying the same hole.
7.5
Surjective function
Let f : X → Y be a function. Informally, f is “surjective” if every element
of the codomain Y is an actual output:
105
X
f
Y
X
f surjective
f
Y
f not surjective
Here is the formal definition:
The function f : X → Y is surjective if it satisfies the following:
For every y ∈ Y there exists x ∈ X such that f (x) = y.
A surjective function is called a surjection.
7.5.1 Example
Prove that the function f : (−∞, 0] → [2, ∞) given by
f (x) = 2 − 3x is surjective.
Proof Let y ∈ [2, ∞). Put x = 31 (2 − y). Since y ≥ 2, we have x ≤ 0, so
that x ∈ (−∞, 0]. Also,
f (x) = 2 − 3x = 2 − 3 13 (2 − y) = y.
Therefore, f is surjective.
Discussion:
Since we are seeking an x in the domain for which f (x) = y,
that is, for which 2 − 3x = y, we get what we need by just solving this equation
for x.
7.5.2 Example
Prove that the function f : [1, ∞) → (2, ∞) given by
f (x) = x + 2 is not surjective.
Proof Assume, to the contrary, that f is surjective. Put y = 5/2. Then
y ∈ (2, ∞), so f (x) = y for some x ∈ [1, ∞). Then x + 2 = 5/2, implying
1/2 = x ∈ [1, ∞), a contradiction. We conclude that f is not surjective.
106
Discussion: Since an input x is ≥ 1 and the corresponding output is x + 2,
we see that the output is always ≥ 3 and this is what gives the idea to consider
5/2.)
7.5.3 Example
the following:
Let f : X → Y be a function and let B ⊆ Y . Prove
(a) We have f (f −1 (B)) ⊆ B.
(b) If f is surjective, then f (f −1 (B)) = B.
Proof
(a) Let y ∈ f (f −1 (B)). We have y = f (x) for some x ∈ f −1 (B). Therefore, y = f (x) ∈ B, where the last step uses the definition of f −1 (B).
(b) Assume that f is surjective. By part (a), it suffices to show that
f (f −1 (B)) ⊇ B. Let b ∈ B. Since f is surjective, there exists x ∈
X such that f (x) = b. This equation shows that x ∈ f −1 (B), so
b = f (x) ∈ f (f −1 (B)). Therefore, f (f −1 (B)) ⊇ B and the proof is
complete.
7.5.4 Theorem. Let X and Y be nonempty finite sets and let f : X → Y
be a function. If f is surjective, then |X| ≥ |Y |.
Proof. We prove the contrapositive. Assume that |X| < |Y |. Each input
of f corresponds to a single output, so the number of outputs is at most
|X|. Since |Y | > |X|, it follows that Y must have an element that is not
an output. More precisely, there exists y ∈ Y such that y 6= f (x) for every
x ∈ X. Therefore, f is not surjective.
7.6
Bijective function
Let f : X → Y be a function. Informally, f is “bijective” if it pairs the
elements of the domain with the elements of the codomain:
107
X
f
Y
f bijective
Here is the formal definition:
A function is bijective if it is both injective and surjective. A bijective function is called a bijection.
If f is bijective, then in its Venn diagram each element of the codomain
has precisely one arrow pointing to it (it has at least one such arrow since
the function is surjective and at most one since the function is injective),
so it does indeed pair the elements of the domain with the elements of the
codomain as shown above.
Because of the pairing property, a bijective function is said to set up a
“one-to-one correspondence” between the elements of the domain and the
elements of the codomain.
7.6.1 Theorem. Let X and Y be nonempty finite sets. We have |X| =
|Y | if and only if there exists a bijection f : X → Y .
Proof. (⇒) Assume that |X| = |Y |. Then |X|, |Y | = n for some n ∈ Z+ . We
can write X = {x1 , x2 , . . . , xn } and Y = {y1 , y2 , . . . , yn }. Define f : X → Y
by f (xi ) = yi . Then f is a bijection.
(⇐) Assume that there exists a bijection f : X → Y . Since f is injective,
Theorem 7.4.3 gives |X| ≤ |Y |. Since f is surjective, Theorem 7.5.4 gives
|X| ≥ |Y |. Therefore, |X| = |Y |.
108
7.7
Composition
Let f : X → Y and g : Y → Z be functions. The composition of f
and g is the function g ◦ f : X → Z given by
(g ◦ f )(x) = g f (x) .
X
x
f
Y
g
f (x)
Z
(g ◦ f )(x) = g(f (x))
g◦f
7.7.1
Theorem. Let f : X → Y and g : Y → Z be functions.
(i) If f and g are injective, then g ◦ f is injective.
(ii) If f and g are surjective, then g ◦ f is surjective.
(iii) If f and g are bijective, then g ◦ f is bijective.
Proof. (i) Assume that f and g are injective. Let x, x0 ∈ X and assume that
(g ◦ f )(x) = (g ◦ f )(x0 ). Then g(f (x)) = g(f (x0 )) and, since g is injective, we
get f (x) = f (x0 ). But since f is injective, this last equation implies x = x0 .
Therefore g ◦ f is injective.
(ii) Assume that f and g are surjective. Let z ∈ Z. Since g is surjective,
there exists y ∈ Y such that g(y) = z. Since f is surjective, there exists
x ∈ X such that f (x) = y. Then (g ◦f )(x) = g(f (x)) = g(y) = z. Therefore,
g ◦ f is surjective.
(iii) Assume that f and g are bijective. Then f and g are both injective and
also both surjective. By parts (i) and (ii), g ◦ f is injective and surjective,
so it is bijective.
109
7.8
Identity function
Let X be a set. The identity function on X is the function 1X :
X → X given by 1X (x) = x.
The next theorem shows that, if composition ◦ is regarded as a sort of
multiplication, then 1X and 1Y act as multiplicative identities (hence the
terminology and notation).
7.8.1 Theorem. Let f : X → Y be a function from the set X to the set
Y . We have f ◦ 1X = f and 1Y ◦ f = f .
Proof. For every x ∈ X, we have
(f ◦ 1X )(x) = f 1X (x) = f (x),
where the last equality uses the definition of 1X . Therefore f ◦ 1X = f .
For every x ∈ X, we have
(1Y ◦ f )(x) = 1Y f (x) = f (x),
where the last equality uses the definition of 1Y . Therefore 1Y ◦ f = f .
7.9
Inverse function
Let X and Y be sets and let f : X → Y be a function. An inverse
of f is a function f −1 : Y → X such that for all x ∈ X and y ∈ Y ,
f −1 f (x) = x and f f −1 (y) = y.
Assume that f : X → Y has an inverse f −1 . Exercise 7–17 shows that this
inverse function is unique.
The first equation in the definition says that if you apply f first and then
apply f −1 , you get back the original input x. So, in a sense, f −1 undoes
110
what f does. Similarly, the second equation says that f undoes what f −1
does.
In terms of the Venn diagram, f −1 is just like f except with the direction
of the arrows reversed:
f
X
1
2
3
4
Y
f −1
X
a
b
c
d
1
2
3
4
Y
a
b
c
d
Another way to say that f −1 : Y → X is an inverse of f is to say that
f −1 ◦ f = 1X
and f ◦ f −1 = 1Y .
The first equation
here says that for every x ∈ X, (f −1 ◦f )(x) = 1X (x), that
is, f −1 f (x) = x, which is the first equation in the definition. Similarly,
the second equation here says the same thing as the second equation in the
definition.
An inverse function need not exist. For instance, the function f : R → R
given by f (x) = x2 has no inverse. Indeed, if f −1 were an inverse of f , then
we would get
2
f −1 (−1) = f f −1 (−1) = −1,
contradicting that the square of a number is never negative.
However, the next theorem says that any bijection has an inverse (and also
that any function that has an inverse must necessarily be bijective).
7.9.1 Theorem. A function f : X → Y has an inverse if and only if it
is bijective.
Proof. Let f : X → Y be a function.
111
(⇒) Assume that f has an inverse f −1 . (f injective?) Let x, x0 ∈ X and
assume that f (x) = f (x0 ). Then
x = f −1 f (x) = f −1 f (x0 ) = x0 .
Therefore, f is injective. (f surjective?) Let y ∈ Y . Put x = f −1 (y). Then
x ∈ X and
f (x) = f f −1 (y) = y.
Therefore, f is surjective. Since f is both injective and surjective, it is
bijective.
(⇐) Assume that f is bijective. Define f −1 : Y → X by letting f −1 (y) be
the unique x in X for which f (x) = y. (Since f is surjective, there is at least
one such x and since
f is injective, there is at most one such x.) For x ∈ X,
we have f −1 f (x) = x (since f −1 f (x) is defined
to be the element that f
−1
sends to f (x)). Similarly, for y ∈ Y , f f (y) = y (since f −1 (y) is defined
to be the element that f sends to y). Therefore, f −1 is an inverse of f .
It was shown before the theorem that the function f : R → R given by
f (x) = x2 cannot have an inverse. This function is not bijective (in fact, it
is neither injective nor surjective), so the fact that it cannot have an inverse
is consistent with the theorem.
However, by changing the domain and codomain, while using the same formula, we can obtain a bijective (and hence invertible) function: The function f : [0, ∞) → [0, ∞) given by f (x) = x2 has inverse f −1 given by
√
f −1 (x) = x.
7 – Exercises
7–1 Let f : A → B be a function.
(a) Given the expression f (x), use context to decide what set x must be
an element of.
(b) Given the expression f (a), use context to decide what set f (a) must
be an element of.
7–2 Let X and Y be sets and let f : X → Z+ and g : Z → Y be functions.
112
(a) Is it possible that 2f (x) = 1 for some x ∈ X? Explain.
(b) Let x ∈ X. What set is g(f (x)) an element of? Explain.
7–3 In each case decide whether the proposed function is well defined. If
you say that the proposed function is not well defined, provide a reason.
(a) f : [−1, 1] → R by f (x) = θ, where cos θ = x.
(b) g : R → R+ by g(x) = 3x2 − 1.
(c) h : Z → Q by h(n) = n/(1 − 2n).
7–4 In each case decide whether the proposed function is well defined. If
you say that the proposed function is not well defined, provide a reason.
(a) f : R → R+ by
(
4 − x,
if x ≤ 1,
f (x) =
3x − 2, if x ≥ 1.
(b) g : R+ → R+ by g(x) = y, where y ∈ R and y 2 = x.
√
(c) h : Z → R by h(n) = n2 − 1.
7–5 Define a function f : Z → Z+ such that f (1) = 2, f (2) = 4, f (−1) =
5, and f (−100) = 5. Use a piece-wise definition with at most two conditions.
7–6 Let X be a set. For a subset A of X define χA : X → {0, 1} by
(
1, if x ∈ A,
χA (x) =
0, if x ∈
/ A.
This function χA is the characteristic (or indicator) function of the subset
A of X.
(a) In the case X = R, find χ[0,2] (1), χ(−∞,0) (0), χZ (3/2), and χQ (3/2).
113
(b) Prove that for every x, y ∈ X with x 6= y there exists a subset A of X
such that χA (x) = 1 and χA (y) = 0.
7–7 Define f : (−∞, 1) → R by f (x) = x2 − 2x. Prove that f is injective.
(Give an entirely algebraic proof. In other words, do not refer to the graph
of f and do not use calculus.)
7–8 Let f be the real function given by
(
x + 2, if x < 0,
f (x) =
x2 + 1, if x > 0.
Prove or disprove: f is injective.
7–9 Let f : R → R be a function and assume that f (x + y) = f (x) + f (y)
for every x, y ∈ R.
(a) Prove that f (0) = 0.
(b) Prove that f (−x) = −f (x) for every x ∈ R.
(c) Prove that f (x − y) = f (x) − f (y) for every x, y ∈ R.
Hint: For part (a), consider f (0 + 0). For part (b), use (a). For part (c),
use (b).
7–10 Let f : R → R be a function and assume that f (x+y) = f (x)+f (y)
for every x, y ∈ R. Prove: f is injective if and only if f −1 ({0}) = {0}.
Hint: Use Exercise 7–9.
7–11 Let f : X → Y be a function and let A ⊆ X. Prove the following:
(a) We have f −1 (f (A)) ⊇ A.
(b) If f is injective, then f −1 (f (A)) = A.
114
7–12 Define L : R2 → R2 by L(x) = (x1 +x2 , x1 −x2 ), where x = (x1 , x2 ).
Prove that L is surjective.
7–13 Denote by F the set of all functions from R to R. Define ϕ : F → R
by ϕ(f ) = f (1).
(a) Prove or disprove: ϕ is injective.
(b) Prove or disprove: ϕ is surjective.
7–14 Define f : (3, ∞) → R+ by f (x) = 2x − 6. Prove that f is bijective.
7–15 Let f : W → X, g : X → Y , and h : Y → Z be functions. Prove
that (h ◦ g) ◦ f = h ◦ (g ◦ f ).
Hint: See Section 7.1 for the definition of equality of functions.
7–16 Let f : X → Y and g : Y → Z be functions. Prove the following:
(a) If g ◦ f is injective, then f is injective.
(b) If g ◦ f is surjective, then g is surjective.
7–17 Let f : X → Y be a function. Let g1 , g2 : Y → X be functions and
assume that gi ◦ f = 1X and f ◦ gi = 1Y (i = 1, 2). Prove that g1 = g2 .
(Note: This shows that a function has at most one inverse.)
115
8
8.1
Relation
Introduction
Put X = {1, 2, 3}. We are so familiar with the notion of one integer being
less than another that we have no problem saying things like 1 < 2 and
2 ≮ 1. But how could we describe this idea that one element of the set
X is “less than” another to someone who had never before heard of such a
notion?
We could begin by just writing the set of all ordered pairs satisfying the
“less than” relationship:
{(1, 2), (1, 3), (2, 3)}.
Then we could say that for x, y ∈ X we will write x < y if the pair (x, y) is
in this set and write x ≮ y otherwise. For instance, 1 < 2 since (1, 2) is in
this set, but 2 ≮ 1 since (2, 1) is not in this set.
Since we wrote the set above to describe the notion “less than,” a natural
notation for this set would be “<.” In other words, we could put
< = {(1, 2), (1, 3), (2, 3)}.
Because of our experience using the symbol “<” it seems strange to us to see
it being used to denote a set, but a person who has never seen the symbol
before will have no such difficulties. With this notation, we can now say
that for x, y ∈ X we will write x < y if (x, y) ∈ < and we will write x ≮ y
if (x, y) ∈
/ <.
Note that the set < is a subset of the set X × X = {(x, y) | x, y ∈ X}.
8.2
Definition and examples
Motivated by the example in the preceding section, we define a relation on
a set as follows:
Let X be a set. A relation on X is a subset R of the set X × X.
Let R be a relation on the set X. For x, y ∈ X, we write xRy if (x, y) ∈ R
and we write xRy if (x, y) ∈
/ R.
116
8.2.1 Example
We have
Put X = {a, b, c, d, e} and R = {(c, a), (b, e), (d, d), (d, e)}.
cRa,
since (c, a) ∈ R,
dRd,
since (d, d) ∈ R,
aRb,
since (a, b) ∈
/ R,
eRb,
since (e, b) ∈
/ R,
and so on.
In this example, since cRa, we say that “c is related to a (with respect to
R).” Informally, a relation on a set is a rule for saying when two elements
are related.
To define a relation, instead of specifying a set of ordered pairs it is often
more straightforward just to declare what it means for one element to be
related to another.
8.2.2
Example
Denote by R the relation on Q given by
xRy
For instance,
5
2
R 21 since
5
2
−
1
2
if x − y ∈ Z.
= 2 ∈ Z, but
5
3
R 13 since
5
3
−
1
3
=
4
3
∈
/ Z.
Discussion: In the first sentence, the word “if” has the meaning of “if and
only if,” which is the standard interpretation for definitions.
The relation R is more formally given as a set:
R = {(x, y) ∈ Q × Q | x − y ∈ Z}.
Function as relation
Let X be a set and let f : X → X be a function. The set
{(x, f (x)) | x ∈ X}
is called the graph of f . (If X = R, then f is a real function and this set of
points in the plane R2 is the usual graph of f .) The graph of f is a subset
of X × X and is therefore a relation on X. In this way, every function from
X to X gives rise to a relation on X.
Let R be a relation on X. If R is the graph of some function f : X → X,
then R = {(x, f (x)) | x ∈ X}, so R satisfies the following property:
117
• Every element of X appears as the first entry of precisely one ordered
pair in R.
On the other hand, if R satisfies this property, then R is the graph of the
function f : X → X defined by f (x) = y, where (x, y) ∈ R. (The property
guarantees that f is well defined in that it assigns to each input x in X a
unique output in X.)
A function from X to X is often defined to be a relation R on X satisfying
the above property (so one does not distinguish between a function and its
graph). This is done to avoid the vague term “rule” in the usual definition of
function. Defining a function as a certain kind of relation like this provides
rigor, but in practice it is easier to think of a function as a rule for sending
inputs to outputs than to think of it as a set of ordered pairs.
This discussion easily generalizes to the case of a function from X to a
possibly different set Y .
8.3
Properties
Let X be a set and let R be a relation on X.
R is reflexive if it satisfies the following property:
For every x ∈ X, we have xRx.
8.3.1
Example
Prove that the relation ≤ on the set Z is reflexive.
Proof For every x ∈ Z, we have x ≤ x.
8.3.2
Example
Prove that the relation < on the set Z is not reflexive.
Proof We have 1 ∈ Z and 1 ≮ 1.
118
R is symmetric if it satisfies the following property:
For every x, y ∈ X, if xRy, then yRx.
8.3.3 Example
Denote by R the relation on Q given by xRy if x − y ∈
Z. Prove that R is symmetric.
Proof Let x, y ∈ Z and assume that xRy. We have x − y ∈ Z, so y − x =
−(x − y) ∈ Z, implying yRx.
8.3.4
Example
Prove or disprove: The relation ≤ on Z is symmetric.
Disproof :
We have 1, 2 ∈ Z and 1 ≤ 2, but 2 1. Therefore, ≤ is not
symmetric.
R is transitive if it satisfies the following property:
For every x, y, z ∈ X, if xRy and yRz, then xRz.
For the next example, we need to say precisely what it means to say that
one integer is less than another. Denote by < the relation on Z given by
x < y if y − x ∈ Z+ = {1, 2, . . . }.
8.3.5
Example
Prove that the relation < on Z is transitive.
Proof Let x, y, z ∈ Z and assume that x < y and y < z. We have y−x ∈ Z+
and z − y ∈ Z+ , so
z − x = (z − y) + (y − x) ∈ Z+ ,
implying x < z.
8.3.6 Example
Denote by R the relation on P(Z) (= power set of Z)
given by ARB if A ∩ B 6= ∅. Prove or disprove: R is transitive.
119
Disproof : Put A = {1, 2}, B = {2, 3}, and C = {3, 4}. We have A, B, C ∈
P(Z). Since A ∩ B = {2} =
6 ∅ and B ∩ C = {3} =
6 ∅, we have ARB and
BRC. However, A ∩ C = ∅, so ARC. Therefore, R is not transitive.
8.4
Equivalence relation
Let X be a set.
A relation ∼ on X is an equivalence relation if it is reflexive,
symmetric, and transitive, that is,
• (Reflexive) For every x ∈ X, we have x ∼ x,
• (Symmetric) For every x, y ∈ X, if x ∼ y, then y ∼ x,
• (Transitive) For every x, y, z ∈ X, if x ∼ y and y ∼ z, then
x ∼ z.
Let ∼ be an equivalence relation on X. If x, y ∈ X and x ∼ y, we say that
x is equivalent to y (or x and y are equivalent).
8.4.1 Example
Denote by ∼ the relation on R given by x ∼ y if |x| =
|y|. Prove that ∼ is an equivalence relation.
Proof (Reflexive) For every x ∈ R, we have |x| = |x|, so x ∼ x.
(Symmetric) Let x, y ∈ R and assume that x ∼ y. Then |x| = |y|. We have
|y| = |x|, so y ∼ x.
(Transitive) Let x, y, z ∈ R and assume that x ∼ y and y ∼ z. Then |x| = |y|
and |y| = |z|. We have |x| = |y| = |z|, so x ∼ z.
For integers a, b, and n we write a ≡n b to mean a ≡ b (mod n).
8.4.2 Example
For every n ∈ Z+ , the relation ≡n on Z is an equivalence relation. (Example 5.7.2 shows that this relation is symmetric and
Exercise 5–17 shows that it is reflexive and transitive.)
120
The next two examples give the extreme cases: (1) two elements are equivalent only if they are equal, and (2) every two elements are equivalent.
8.4.3 Example
lence relation.
The equality relation (=) on the set X is an equiva-
8.4.4 Example
Denote by ∼ the relation on the set X given by x ∼ y
for every x, y ∈ X. Then ∼ is an equivalence relation on X.
The next example shows that a function gives rise to an equivalence relation
in a natural way.
8.4.5 Example
Let f : X → Y be a function. Denote by ∼ the relation
on X given by x ∼ x0 if f (x) = f (x0 ). Then ∼ is an equivalence relation on
X.
The examples above can be viewed as special cases of this last example.
If we define f : R → [0, ∞) by f (x) = |x|, the associated equivalence
relation is that given in Example 8.4.1. For n ∈ Z+ , if we define f : Z →
{0, 1, 2, . . . , n − 1} by f (m) = [ remainder of m upon division by n ] , the
associated equivalence relation is that given in Example 8.4.2 (in view of
Theorem 5.7.3).
8.5
Equivalence class
Let X be a set, let ∼ be an equivalence relation on X, and let a ∈ X. Denote
by ā the set of all elements of X that are equivalent to a:
ā = {x ∈ X | x ∼ a}
The set ā is the equivalence class of a.
8.5.1 Example
Let ∼ be the equivalence relation on R given by x ∼ y
if |x| = |y|. For each a ∈ R, we have ā = {a, −a}.
121
8.5.2 Theorem. Let ∼ be an equivalence relation on the set X. For every
a, b ∈ X we have ā = b̄ if and only if a ∼ b.
Proof. Let a, b ∈ X.
(⇒) Assume that ā = b̄. By the reflexive property, we have a ∼ a, so
a ∈ ā = b̄. Therefore, a ∼ b.
(⇐) Assume that a ∼ b.
(⊆) Let x ∈ ā. We have x ∼ a and a ∼ b, so x ∼ b by the transitive property.
Therefore, x ∈ b̄. This shows that ā ⊆ b̄.
(⊇) We have assumed that a ∼ b, and this implies that b ∼ a by the
symmetric property. Using the preceding paragraph (with a and b reversed)
we get the containment ā ⊇ b̄.
Therefore, ā = b̄.
Let X be a set.
A partition of X is a family A of subsets of X satisfying the following properties:
S
(i) X = A∈A A,
(ii) for every A, B ∈ A, if A ∩ B 6= ∅, then A = B.
The if-then clause in the second condition can be expressed in the equivalent
contrapositive form: “if A 6= B, then A ∩ B = ∅.” So informally a partition
of X is a collection of subsets that cover X and that are pairwise disjoint.
For example, if X = {1, 2, . . . , 9}, then the family
A = {{1, 5, 8, 9}, {2, 3}, {4}, {6, 7}}
is a partition of X.
The elements of a partition are called the cells of the partition. A set
obtained by choosing precisely one element from each cell of a partition is
called a set of representatives of the partition.
122
The cells of the partition A shown above are the sets
{1, 5, 8, 9},
{2, 3},
{4},
{6, 7}.
The set {1, 2, 4, 6} is one set of representatives, and the set {8, 3, 4, 7} is
another (sixteen possible choices in all).
The next theorem shows how an equivalence relation on X gives rise to a
partition of X and, conversely, a partition of X gives rise to an equivalence
relation on X.
8.5.3
Theorem.
(i) Let ∼ be an equivalence relation on X. The family A = {ā | a ∈ X}
is a partition of X.
(ii) Let A be a partition of X. We get an equivalence relation on X by
putting x ∼ y if x, y ∈ A for some A ∈ A.
Proof. (i) For each a ∈ X we have a ∈ ā, so
[
[
[
X=
{a} ⊆
ā =
A.
a∈X
a∈X
A∈A
S
The other containment X ⊇ A∈A A is immediate, so we get equality and
the first property of a partition is satisfied.
Now let A, B ∈ A and assume that A∩B 6= ∅. We have A = ā and B = b̄ for
some a, b ∈ X. By our assumption, there exists some c ∈ A∩B = ā∩ b̄. This
implies c ∼ a and c ∼ b. By symmetry, we get a ∼ c, and then by transitivity,
we get a ∼ b. It now follows from Theorem 8.5.2 that A = ā = b̄ = B. This
shows that the second property of a partition is satisfied.
(ii) (Reflexive) For every x ∈ X we have x ∈ A for some A ∈ A by the first
property of a partition, so x, x ∈ A, implying x ∼ x.
(Symmetric) Let x, y ∈ X and assume that x ∼ y. We have x, y ∈ A for
some A ∈ A. Then y, x ∈ A, so y ∼ x.
(Transitive) Let x, y, z ∈ X and assume that x ∼ y and y ∼ z. We have
x, y ∈ A and y, z ∈ B for some A, B ∈ A. Now y ∈ A ∩ B, so A ∩ B 6= ∅.
By the second property of a partition, we get A = B. Therefore, x, z ∈ A,
implying x ∼ z.
We have shown that ∼ is an equivalence relation, so the proof is complete.
123
8.5.4 Example
The partition of Z corresponding to ≡3 (congruence
modulo 3) has cells
0̄ = {. . . , −6, −3, 0, 3, 6, . . . },
1̄ = {. . . , −5, −2, 1, 4, 7, . . . },
2̄ = {. . . , −4, −1, 2, 5, 8, . . . }.
The set {0, 1, 2} is a set of representatives of the partition.
8.6
Cardinality
According to Theorem 7.6.1, two (nonempty) finite sets have the same number of elements if and only if there exists a bijection from one set to the
other.
Two sets X and Y are equinumerous, written X ≈ Y , if there
exists a bijection from X to Y .
Denote by S the collection of all sets.
(Note: We use the terminology “collection of all sets” here rather than “set
of all sets” since this latter phrase leads to a paradox, known as Russell’s
Paradox. Instead of “collection” we really should use the technical term
“class,” but we opt for the more easily understood term.)
8.6.1
Theorem. The relation ≈ is an equivalence relation on S.
Proof. (Reflexive) For every X ∈ S, we have 1X : X → X is a bijection, so
X ≈ X.
(Symmetric) Let X, Y ∈ S and assume that X ≈ Y . Then there exists a
bijection f : X → Y . According to Theorem 7.9.1, the inverse function
f −1 : Y → X exists. Now f −1 has an inverse, namely f , so f −1 is bijective,
again by Theorem 7.9.1. Therefore, Y ≈ X.
(Transitive) Let X, Y, Z ∈ S and assume that X ≈ Y and Y ≈ Z. Then
there exist bijections f : X → Y and g : Y → Z. By Theorem 7.7.1,
g ◦ f : X → Z is a bijection. Therefore, X ≈ Z.
124
Let X be a set. The cardinality of X, denoted |X|, is the equivalence class of X relative to ≈:
|X| = {Y ∈ S | Y ≈ X}.
Let X be a set. By definition, we have
|X| = {Y ∈ S | there exists a bijection from Y to X}.
So |X| is the collection of all sets that are in one-to-one correspondence with
the set X.
For example, putting X = {a, b, c}, we get
|X| = {{a, b, c}, {A, B, C}, {x, y, z}, {♣, ♦, ♠}, {[, \, ]}, . . . }.
In other words, |X| is the collection of all sets having three elements.
In Section 1.1, we wrote |X| = 3 to mean that X has three elements. We
can now also regard the equation |X| = 3 as saying that we are using the
symbol “3” to stand for the collection of all sets having three elements.
8.6.2 Theorem. Let X and Y be sets. We have |X| = |Y | if and only if
there exists a bijection from X to Y .
Proof. By Theorem 8.5.2, |X| = |Y | if and only if X ≈ Y . By the definition
of the relation ≈, this latter holds if and only if there exists a bijection from
X to Y . The claim follows.
The following examples show that cardinalities of infinite sets relate to each
other in ways that might seem unexpected. For instance, the first example
shows that the sets N = {0, 1, 2, 3, . . . } and Z+ = {1, 2, 3, . . . } have the
same cardinality, even though it appears that the first has one more element
than the second.
8.6.3
Example
Prove that |N| = |Z+ |.
125
Proof Define f : N → Z+ by f (n) = n+1. Here is a diagram representation
of f :
N = { 0, 1, 2, 3, . . . }
Z+
{
=
1,
2,
3,
4,
}.
...
We see that f is a bijection, so |N| = |Z+ | by Theorem 8.6.2.
8.6.4
Prove that |N| = |Z|.
Example
Proof Define f : N → Z by
(
−n/2,
if n is even,
f (n) =
(n + 1)/2, if n is odd.
Here is a diagram representation of f :
N
=
{
0,
Z
=
{
0,
1,
1,
2,
−1,
3,
2,
4,
5,
−2,
3,
6,
−3,
...
}
...
}.
We see that f is a bijection, so |N| = |Z| by Theorem 8.6.2.
8.6.5
Example
Prove that |Z+ | = |Z+ × Z+ |.
Proof The elements of Z+ × Z+ are ordered pairs (m, n) with m, n ∈ Z+ ,
so they correspond to the points in the diagram below. Define f : Z+ →
Z+ ×Z+ by letting f (n) be the point labeled n in the diagram. For instance,
f (1) = (1, 1), f (2) = (2, 1), f (3) = (1, 2), and so on. Then f is a bijection,
so the claim follows. (This informal argument can be made precise.)
10
1
4
9
3
5
8
1
2
6
1
126
7
For sets X and Y we write |X| ≤ |Y | to mean that there exists an injection
from X to Y . Note that if X and Y are sets with X ⊆ Y , then |X| ≤ |Y |
since the function f : X → Y given by f (x) = x is an injection.
The following result, known as the Cantor-Bernstein-Schroeder theorem,
shows that this notion of inequality of cardinalities behaves much like inequality of numbers.
8.6.6 Theorem. Let X and Y be sets. If |X| ≤ |Y | and |Y | ≤ |X|, then
|X| = |Y |.
Proof. Omitted.
8.6.7
Example
Prove that |Z+ | = |Q+ |.
Proof First, |Z+ | ≤ |Q+ | since Z+ ⊆ Q+ .
Since each rational number can be written in lowest terms, we have
Q+ = {m/n | m, n ∈ Z+ , gcd(m, n) = 1}.
It follows that the function f : Q+ → Z+ × Z+ given by f (m/n) = (m, n),
where m, n ∈ Z+ and gcd(m, n) = 1, is well defined. The function f is
injective, which is routine to check. Therefore, |Q+ | ≤ |Z+ × Z+ | = |Z+ |,
where we have used Example 8.6.5.
By Theorem 8.6.6, we have |Z+ | = |Q+ |.
8.6.8
Example
Prove that |N| = |Q|.
Proof By the preceding example, the elements of Z+ can be paired with
those of Q+ (more formally, there is a bijection from the first set to the
second). Similarly, the elements of Z− can be paired with those of Q− .
Since Z is the disjoint union Z− ∪ {0} ∪ Z+ , the elements of Z can be paired
with those of Q− ∪ {0} ∪ Q+ , which is Q. It follows that |Z| = |Q|. By
Example 8.6.4, we have |N| = |Z|. Therefore, |N| = |Q|.
The cardinality of the set of natural numbers is denoted ℵ0 , which is read
“aleph naught” (the word “aleph” is for the letter ℵ and the word “naught”
is for the subscript 0). In symbols, ℵ0 = |N|.
127
The preceding examples show that the sets Z+ , Z, Z+ × Z+ , Q+ , and Q
all have the same cardinality ℵ0 . The next theorem shows that the set R of
real numbers does not have cardinality ℵ0 .
The proof of the theorem requires the following standard fact about real
numbers. Each real number x in the interval [0, 1) can be written in decimal
form 0.x1 x2 x3 · · ·. A decimal that ends in repeated 9’s can be rewritten (for
instance, 0.23999 · · · = 0.24000 · · ·). Disallowing repeated 9’s, though, there
is one and only one way to write each number in [0, 1) in decimal form,
which we refer to as the “unique decimal form” of the number.
For sets X and Y we write |X| < |Y | to mean that |X| ≤ |Y | and |X| =
6 |Y |.
8.6.9
Theorem. We have |N| < |R|.
Proof. The proof begins by establishing two claims:
Claim 1: |(0, 1)| = |R|. The function f : (0, 1) → R given by f (x) =
tan((2x − 1)π/2) has graph depicted below showing that the function is
bijective. (The graph passes the horizontal line test, so the function is
injective, and the projection of the graph onto the vertical axis is all of R,
so the function is surjective.) The claim now follows from Theorem 8.6.2.
R
f
0
1
Claim 2: |N| 6= |[0, 1)|. Assume, to the contrary, that |N| = |[0, 1)|. Using
Example 8.6.3 we get |Z+ | = |[0, 1)|. By Theorem 8.6.2, there exists a
bijection g : Z+ → [0, 1). For each n ∈ Z+ there exists xn ∈ {0, 1, 2, . . . , 8}
such that xn does not equal the nth digit in the unique decimal form of g(n).
Put x = 0.x1 x2 x3 · · · and note that this is the unique decimal form of x (no
digit equals 9 so the decimal cannot end with repeated 9’s). Then x ∈ [0, 1)
and, since g is surjective, it follows that x = g(n) for some n ∈ Z+ . But this
implies that the nth digit of x in unique decimal form, which is xn , must
128
equal the nth digit of g(n) in unique decimal form, contradicting how xn
was defined. The claim is established.
We are now prepared to finish the proof. First, we have |N| ≤ |R| since
N ⊆ R. Therefore, it suffices to show that |N| =
6 |R|. Since [0, 1) ⊆ R, we
get |[0, 1)| ≤ |R|. On the other hand, since (0, 1) ⊆ [0, 1), we get |(0, 1)| ≤
|[0, 1)|, so that |R| ≤ |[0, 1)| by Claim 1. Therefore, using Claim 2 and then
Theorem 8.6.6, we get |N| =
6 |[0, 1)| = |R|. This finishes the proof.
Discussion:
In the proof of Claim 2, suppose
g(1) = 0.3 · · ·
g(2) = 0.76 · · ·
g(3) = 0.895 · · · .
Then a possibility for x is x = 0.782 · · ·. Note that x 6= g(1) due to the first
digit, x =
6 g(2) due to the second digit, x 6= g(3) due to the third digit, and so
on.
8 – Exercises
8–1 Denote by R the relation on R given by xRy if |x − y| < 1. Prove or
disprove: R is an equivalence relation.
8–2 Denote by F the set of all functions from R to R. Denote by ∼ the
relation on F given by f ∼ g if there exists C ∈ R such that f (x)−g(x) = C
for every x ∈ R.
(a) Prove that ∼ is an equivalence relation.
(b) For f ∈ F describe the equivalence class f¯ in terms of graphs.
8–3 Denote by ∼ the relation on R2 given by x ∼ y if x1 = y1 (see
paragraph before Example 7.3.2 for notation).
(a) Prove that ∼ is an equivalence relation.
129
(b) For x ∈ R2 give a geometrical description of the equivalence class x̄.
Hint: For part (a), consider using Example 8.4.5.
130
© Copyright 2026 Paperzz