0% found this document useful (0 votes)
41 views

Lecture Notes in Discrete Mathematics - Part 5

This document discusses quantified propositions and arguments involving quantifiers: 1) It provides examples of valid argument forms using universal instantiation, universal modus ponens, and universal modus tollens. 2) It also discusses invalid argument forms like the converse error and inverse error. 3) The document aims to explain rules for reasoning with quantified statements using examples of filling in conclusions for arguments with quantified premises.

Uploaded by

Moch Dedy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Lecture Notes in Discrete Mathematics - Part 5

This document discusses quantified propositions and arguments involving quantifiers: 1) It provides examples of valid argument forms using universal instantiation, universal modus ponens, and universal modus tollens. 2) It also discusses invalid argument forms like the converse error and inverse error. 3) The document aims to explain rules for reasoning with quantified statements using examples of filling in conclusions for arguments with quantified premises.

Uploaded by

Moch Dedy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Lecture Notes in Discrete Mathematics

Marcel B. Finan
Arkansas Tech University
All
c Rights Reserved
4 PROPOSITIONS AND QUANTIFIERS 35

Example 4.6
Let P (x) denote the statement ”x > 3.” What is the truth value of the
proposition ∃x ∈ IR, P (x).

Solution.
Since 4 ∈ IR and 4 > 3, the given proposition is true

The proposition ∀x ∈ D, P (x) → Q(x) is called the universal conditional


proposition. For example, the proposition ∀x ∈ IR, if x > 2 then x2 > 4 is
a universal conditional proposition.

Example 4.7
Rewrite the proposition ”if a real number is an integer then it is a rational
number” as a universal conditional proposition.

Solution.
∀x ∈ IR, if x is an interger then x is a rational number

Example 4.8
a. What is the negation of the proposition ∀x ∈ D, P (x)?
b. What is the negation of the proposition ∃x ∈ D, P (x)?
c. What is the negation of the proposition ∀x ∈ D, P (x) → Q(x)?

Solution.
a. ∃x ∈ D, ∼ P (x).
b. ∀x ∈ D, ∼ P (x).
c. Since P (x) → Q(x) ≡ (∼ P (x)) ∨ Q(x) then ∼ (∀x ∈ D, P (x) → Q(x)) ≡
∃x ∈ D, P (x) and ∼ Q(x)

Example 4.9
Consider the universal conditional proposition

∀x ∈ D, if P (x) then Q(x).

a. Find the contrapositive.


b. Find the converse.
c. Find the inverse.
36 FUNDAMENTALS OF MATHEMATICAL LOGIC

Solution.
a. ∀x ∈ D, if ∼ Q(x) then ∼ P (x).
b. ∀x ∈ D, if Q(x) then P (x).
c. ∀x ∈ D, if ∼ P (x) then ∼ Q(x)

Example 4.10
Write the negation of each of the following propositions:

a. ∀x ∈ IR, x > 3 → x2 > 9.


b. Every polynomial function is continuous.
c. There exists a triangle with the property that the sum of angles is greater
than 180◦ .

Solution.
a. ∃x ∈ IR, x > 3 and x2 ≤ 9.
b. There exists a polynomial that is not continuous everywhere.
c. For any triangle, the sum of the angles is less than or equal to 180◦

Next, we discuss predicates that contain multiple quantifiers. A typical ex-


ample is the definition of a limit. We say that L = limx→a f (x) if and only if
∀ > 0, ∃ a positive number δ such that if |x − a| ≤ δ then |f (x) − L| < .

Example 4.11
a. Let P (x, y) denote the statement ”x + y = y + x.” What is the truth value
of the proposition (∀x ∈ IR)(∀y ∈ IR), P (x, y)?
b. Let Q(x, y) denote the statement ”x + y = 0.” What is the truth value of
the proposition (∃y ∈ IR)(∀x ∈ IR), Q(x, y)?

Solution.
a. The given proposition is always true.
b. The proposition is false. For otherwise, one can choose x 6= −y to obtain
0 6= x + y = 0 which is impossible

Example 4.12
Find the negation of the following propositions:
a. ∀x∃y, P (x, y).
b. ∃x∀y, P (x, y).
4 PROPOSITIONS AND QUANTIFIERS 37

Solution.
a. ∃x∀y, ∼ P (x, y).
b. ∀x∃y, ∼ P (x, y)

Example 4.13
The symbol ∃! stands for the phrase ”there exists a unique”. Which of the
following statements are true and which are false.

a. ∃!x ∈ IR, ∀y ∈ IR, xy = y.


b. ∃! integer x such that x1 is an integer.

Solution.
a. True. Let x = 1.
b. False since 1 and −1 are both integers with integer reciprocals
38 FUNDAMENTALS OF MATHEMATICAL LOGIC

Review Problems
Problem 4.1
By finding a counterexample, show that the proposition:” For all positive
integers n and m, m.n ≥ m + n” is false.

Problem 4.2
Consider the statement

∃x ∈ IR such that x2 = 2.

Which of the following are equivalent ways of expressing this statement?


a. The square of each real number is 2.
b. Some real numbers have square 2.
c. The number x has square 2, for some real number x.
d. If x is a real number, then x2 = 2.
e. Some real number has square 2.
f. There is at least one real number whose square is 2.

Problem 4.3
Rewrite the following propositions informally in at least two different ways
without using the symbols ∃ and ∀ :

a. ∀ squares x, x is a rectangle.
b. ∃ a set A such that A has 16 subsets.

Problem 4.4
Rewrite each of the following statements in the form ”∃ x such that ”:

a. Some exercises have answers.


b. Some real numbers are rational.

Problem 4.5
Rewrite each of the following statements in the form ”∀ , if then .”:

a. All COBOL programs have at least 20 lines.


b. Any valid argument with true premises has a true conclusion.
c. The sum of any two even integers is even.
d. The product of any two odd integers is odd.
4 PROPOSITIONS AND QUANTIFIERS 39

Problem 4.6
Which of the following is a negation for ”Every polynomial function is con-
tinuous”?

a. No polynomial function is continuous.


b. Some polynomial functions are continuous.
c. Every polynomial function fails to be continuous.
d. There is a noncontinuous polynomial function.
Problem 4.7
Determine whether the proposed negation is correct. If it is not, write a
correct negation.

Proposition : For all integers n, if n2 is even then n is even.


Proposed negation : For all integer n, if n2 is even then n is not even.
Problem 4.8
Let D = {−48, −14, −8, 0, 1, 3, 16, 23, 26, 32, 36}. Determine which of the fol-
lowing propositions are true and which are false. Provide counterexamples
for those propositions that are false.

a. ∀x ∈ D, if x is odd then x > 0.


b. ∀x ∈ D, if x is less than 0 then x is even.
c. ∀x ∈ D, if x is even then x ≤ 0.
d. ∀x ∈ D, if the ones digit of x is 2, then the tens digit is 3 or 4.
e. ∀x ∈ D, if the ones digit of x is 6, then the tens digit is 1 or 2
Problem 4.9
Write the negation of the proposition :∀x ∈ IR, if x(x + 1) > 0 then x > 0 or
x < −1.
Problem 4.10
Write the negation of the proposition : If an integer is divisible by 2, then it
is even.
Problem 4.11
Given the following true propostion:” ∀ real numbers x, ∃ an integer n such
that n > x.” For each x given below, find an n to make the predicate n > x
true.
10
a. x = 15.83 b. x = 108 c. x = 1010 .
40 FUNDAMENTALS OF MATHEMATICAL LOGIC

Problem 4.12
Given the proposition: ∀x ∈ IR, ∃ a real number y such that x + y = 0.
a. Rewrite this proposition in English without the use of the quantifiers.
b. Find the negation of the given proposition.
Problem 4.13
Given the proposition: ∃x ∈ IR, ∀y ∈ IR, x + y = 0.
a. Rewrite this proposition in English without the use of the quantifiers.
b. Find the negation of the given proposition.
Problem 4.14
Consider the proposition ”Somebody is older than everybody.” Rewrite this
proposition in the form ”∃ a person x such that ∀ .”
Problem 4.15
Given the proposition: There exists a program that gives the correct answer
to every question that is posed to it.”
a. Rewrite this proposition using quantifiers and variables.
b. Find a negation for the given proposition.
Problem 4.16
Given the proposition: ∀x ∈ IR, ∃y ∈ IR such that x < y.
a. Write a proposition by interchanging the symbols ∀ and ∃.
b. State which is true: the given proposition, the one in part (a), neither, or
both.
Problem 4.17
Find the contrapositive, converse, and inverse of the proposition ”∀x ∈ IR, if
x(x + 1) > 0 then x > 0 or x < −1.”
Problem 4.18
Rewrite the following proposition in if-then form :” Earning a grade of C −
in this course is a sufficient condition for it to count toward graduation.”
Problem 4.19
Rewrite the following proposition in if-then form :” Being on time each day
is a necessary condition for keeping this job.”
Problem 4.20
Rewrite the following proposition without using the words ”necessary” or ”
sufficient” : ”Divisibility by 4 is not a necessary condition for divisibility by
2.”
5 ARGUMENTS WITH QUANTIFIED PREMISES 41

5 Arguments with Quantified Premises


In this section we discuss three types of valid arguments that involve the
universal quantifier.

• The rule of universal instantiation:


∀x ∈ D, P (x)
a∈D
..˙ P (a)

Example 5.1
Use universal instantiation to fill in valid conclusion for the following argu-
ment.

All positive integers are greater than or equal to 1


3 is a positive integer
..˙

Solution.
All positive integers are greater than or equal to 1
3 is a positive integer
..˙ 3 ≥ 1

• Universal Modus Ponen:


∀x ∈ D, if P (x) then Q(x)
P (a) f or some a ∈ D
..˙ Q(a)

Example 5.2
Use the rule of the universal modus ponens to fill in valid conclusion for the
following argument.

∀n ∈ IN, if n = 2k for some k ∈ IN then n is even.


0 = 2.0
..˙

Solution.
∀n ∈ IN, if n = 2k for some k ∈ IN then n is even.
42 FUNDAMENTALS OF MATHEMATICAL LOGIC

0 = 2.0
..0
˙ is even

• Universal Modus Tollens:


∀x ∈ D, if P (x) then Q(x)
∼ Q(a) f or some a ∈ D
..˙ ∼ P (a)

Example 5.3
Use the rule of the universal modus tonens to fill in valid conclusion for the
following argument.

All healthy people eat an apple a day.


Harry does not eat an apple a day.
..˙

Solution.
All healthy people eat an apple a day.
Harry does not eat an apple a day.
..˙ Harry is not healthy

Next, we discuss a couple of invalid arguments whose premises involve quan-


tifiers.

• The rule of converse error:


∀x ∈ D, if P (x) then Q(x)
Q(a) f or some a ∈ D
..˙ P (a)

Example 5.4
What kind of error does the following invalid argument exhibit?

All healthy people eat an apple a day.


Helen eats an apple a day.
..˙ Helen is healthy

Solution.
This invalid argument exhibits the converse error
5 ARGUMENTS WITH QUANTIFIED PREMISES 43

• The rule of inverse error:


∀x ∈ D, if P (x) then Q(x)
∼ P (a) f or some a ∈ D
..˙ ∼ Q(a)

Example 5.5
What kind of error does the following invalid argument exhibit?

All healthy people eat an apple a day.


Hubert is not a healthy person.
..˙ Hubert does not eat an apple a day.

Solution.
This invalid argument exhibits the inverse error
44 FUNDAMENTALS OF MATHEMATICAL LOGIC

Review Problems
Problem 5.1
Use the rule of universal modus ponens to fill in valid conclusion for the ar-
gument.

For all real numbers a, b, c, and d, if b 6= 0 and d 6= 0 then ab + dc = ad+bc


bd
.
a = 2, b = 3, c = 4, and d = 5 are particular real numbers such that b 6= 0
and d 6= 0.
..˙
Problem 5.2
Use the rule of universal modus tonens to fill in valid conclusion for the ar-
gument.

If a computer is correct, then compilation of the program does not produce


error messages.
Compilation of this program produces error messages.
..˙
Problem 5.3
Use the rule of universal modus ponens to fill in valid conclusion for the ar-
gument.

All freshmen must take writing.


Caroline is a freshman.
..˙ .
Problem 5.4
What kind of error does the following invalid argument exhibit?
All cheaters sit in the back row.
George sits in the back row.
..˙ George is a cheater.
Problem 5.5
What kind of error does the following invalid argument exhibit?
All honest people pay their taxes.
Darth is not honest.
..˙ Darth does not pay his taxes.
6 PROJECT I: DIGITAL LOGIC DESIGN 45

6 Project I: Digital Logic Design


In this section we discuss the logic of digital circuits which are considered to
be the basic components of most digital systems, such as electronic comput-
ers, electronic phones, traffic light controls, etc.
The purpose of digital systems is to manipulate discrete information which
are represented by physical quantities such as voltages and current. The
smallest representation unit is one bit, short for binary digit. Since electronic
switches have two physical states, namely high voltage and low voltage we
attribute the bit 1 to high voltage and the bit 0 for low voltage.
A logic gate is the smallest processing unit in a digital system. It takes one
or few bits as input and generates one bit as an output.
A circuit is composed of a number of logic gates connected by wires. It
takes a group of bits as input and generates one or more bits as output.
The six basic logic gates are the following:

(1) NOT gate (also called inverter): Takes an input of 0 to an output


of 1 and an input of 1 to an output of 0. The corresponding logical symbol
is ∼ P.
(2) AND gate: Takes two bits, P and Q, and outputs 1 if P and Q are 1 and
0 otherwise. The logical symbol is P ∧ Q.
(3) OR gate: outputs 1 if either P or Q is 1 and 0 otherwise. The logical
symbol is P ∨ Q.
(4) NAND gate: outputs a 0 if both P and Q are 1 and 1 otherwise. The
symbol is ∼ (P ∧ Q). Also, denoted by P |Q, where | is called a Scheffer
stroke.
(5) NOR gate: output a 0 if at least one of P or Q is 1 and 1 otherwise. The
symbol is ∼ (P ∨ Q) or P ↓ Q, where ↓ is a Pierce arrow

The logic gates have the following graphical representations:


46 FUNDAMENTALS OF MATHEMATICAL LOGIC

Problem 6.1
Construct the truth tables of the gates discussed in this section.

If you are given a set of input signals for a circuit, you can find its output
by tracing through the circuit gate by gate.

Problem 6.2
Give the output signal S for the following circuit, given that P = 0, Q = 1,
and R = 0 :

Problem 6.3
Write the input/output table for the circuit of the previous problem.

A variable with exactly two possible values is called a Boolean variable.


A Boolean expression is an expression composed of Boolean variables and
connectives (which are the gates in this section).
6 PROJECT I: DIGITAL LOGIC DESIGN 47

Problem 6.4
Find the Boolean expression that corresponds to the circuit of Problem 6.1.

Problem 6.5
Construct the circuit corresponding to the Boolean expression: (P ∧ Q)∨ ∼
R.

Problem 6.6
For the following input/output table, construct (a) the corresponding Boolean
expression and (b) the corresponding circuit:

P Q R S
1 1 1 0
1 1 0 1
1 0 1 0
1 0 0 0
0 1 1 1
0 1 0 0
0 0 1 0
0 0 0 0

Two digital logic circuits are equivalent if, and only if, their corresponding
Boolean expressions are logically equivalent.

Problem 6.7
Show that the following two circuits are equivalent:

Problem 6.8
Consider the following circuit
48 FUNDAMENTALS OF MATHEMATICAL LOGIC

Let P and Q be single binary digits and P + Q = RS. Complete the fol-
lowing table
P Q R S
1 1
1 0
0 1
0 0
The given circuit is called a half-adder. It computes the sum of two single
binary digits.

Several methods have been used for expressing negative numbers in the com-
puter. The most obvious way is to convert the number to binary and stick
on another bit to indicate sign, 0 for positive and 1 for negative. Suppose
that integers are stored using this signed-magnitude technique in 8 bits so
that the leftmost bit holds the sign while the remaining bits represent the
magnitude. Thus, +4110 = 00101001 and −4110 = 10101001.
The above procedure has a gap. How one would represent the bit 0? Well,
there are two ways for storing 0. One way is 00000000 which represents
+0 and a second way 10000000 represents −0. A method for representing
numbers that avoid this problem is called the two’s complement. Con-
sidering −4110 again, first, convert the absolute value to binary obtaining
4110 = 00101001. Then take the complement of each bit obtaining 11010110.
This is called the one complement of 41. To complete the procedure, in-
crement by 1 the one’s complement to obtain −4110 = 11010111.
Conversion of +4110 to two’s complement consists merely of expressing the
number in binary, i.e. +4110 = 00101001.
6 PROJECT I: DIGITAL LOGIC DESIGN 49

Problem 6.9
Express the numbers 104 and −104 in two’s complement representation with
8 bits.

Now, an algorithm to find the decimal representation of the integer with a


given 8-bit two’s complement is the following:
1. Find the two’s complement of the given two’s complement,
2. write the decimal equivalent of the result.

Problem 6.10
What is the decimal representation for the integer with two’s complement
10101001?
50 FUNDAMENTALS OF MATHEMATICAL LOGIC

7 Project II: Number Systems


In this section we consider three number systems that are of importance
in applications, namely, the decimal system, the binary system, and the
hexadecimal system. Decimal numbers are used in communication among
human beings whereas binary numbers are used by computers to represent
numbers.

Consider first the decimal system. If n is a positive integer then n can


be written as
n = dk dk−1 · · · d1 d0 ,
where the digits d0 , d1 , · · · , dk are elements of the set {0, 1, 2, · · · , 9}.

The number n can be expressed as a sum of powers of 10 as follows:

n = dk 10k + dk−1 10k−1 + · · · + d1 101 + d0 100 .

For example,

5049 = 5(103 ) + 0(102 ) + 4(101 ) + 9(100 ).

A number in binary system is a number n that can be written in the form

n = bk bk−1 · · · b1 b0 ,

where bi is either 0 or 1.

We will use subscript to tell the base of which a number is represented.


Thus, we write n2 = bk bk−1 · · · b1 b0 to indicate that the number n is in base
2.
If n is a number in base 2 then its decimal value (i.e. base 10) is found by
the formula:

n2 = bk (2k ) + bk−1 (2k−1 ) + · · · + b1 (21 ) + b0 (20 ) = m10 .

Problem 7.1
Find the decimal value of the following binary numbers:
a. 11001012
b. 1101102
7 PROJECT II: NUMBER SYSTEMS 51

To convert a positive integer n from base 10 to base 2 we use the division


algorithm as follows:
(1) n = q0 (2) + r0 , where q0 is the quotient of the division of n by 2 and r0
is the remainder.
(2) If q0 = 0 then n is already in base 2. If not then divide q0 by 2 to obtain
q0 = q1 (2) + r1 .
(3) If q1 = 0 then n10 = r1 r0 . If not repeat the process. Note that the
remainders are all less than 2.
Suppose that qk = 0 then

n10 = rk rk−1 · · · r1 r0 .

Problem 7.2
Represent the following decimal integers in binary notation:
a. 129710
b. 45810

Problem 7.3
Evaluate the following sums:
a. 110111012 + 10010110102
b. 1011012 + 111012

Another useful number system is the hexadecimal system. The possible


digits in an hexadecimal system are :

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

where A, B, C, D, E, F stand for 10, 11, 12, 13, 14, and 15 respectively.
The conversion of a number from base 16 to base 10 is similar to the conver-
sion of numbers from base 2 to base 10. The conversion of a number from
base 10 to base 16 is similar to the conversion of a decimal number to base
2.

Problem 7.4
Convert the number A2BC16 to base 10.

To convert an integer from base 16 to base 2 one performs the following:


(1) Write each hexadecimal digit of the integer in fixed 4-bit binary notation.
(2) Juxtapose the results.
52 FUNDAMENTALS OF MATHEMATICAL LOGIC

Problem 7.5
Convert the number B53DF 816 to base 2.

To convert an integer from base 2 to base 16:


(1) Group the digits of the binary number into sets of four bits, starting from
the right and adding leading zeros as needed.
(2) Convert the binary numbers in (1) to base 16.
(3) Juxtapose the results of (2)

Problem 7.6
Convert the number 1011011110001012 to base 16.
Fundamentals of Mathematical
Proofs

In this chapter we discuss some common methods of proof and the standard
terminology that accompanies them.

8 Methods of Direct Proof I


A mathematical system consists of axioms, definitions, and undefined
terms. An axiom is a statement that is assumed to be true. A definition
is used to create new concepts in terms of existing ones. A theorem is a
proposition that has been proved to be true. A lemma is a theorem that
is usually not interesting in its own right but is useful in proving another
theorem. A corollary is a theorem that follows quickly from a theorem.

Example 8.1
The Euclidean geometry furnishes an example of mathematical system:
• points and lines are examples of undefined terms.
• An example of a definition: Two angles are supplementary if the sum of
their measures is 180◦ .
• An example of an axiom: Given two distinct points, there is exactly one
line that contains them.
• An example of a theorem: If two sides of a triangle are equal, then the
angles opposite them are equal.
• An example of a corollary: If a triangle is equilateral, then it is equiangular.

An argument that establishes the truth of a theorem is called a proof. Logic


is a tool for the analysis of proofs.

53
54 FUNDAMENTALS OF MATHEMATICAL PROOFS

First we discuss methods for proving a theorem of the form ”∃x such that
P (x).” This theorem guarantees the existence of at least one x for which the
predicate P (x) is true. The proof of such a theorem is constructive: that
is, the proof is either by finding a particular x that makes P (x) true or by
exhibiting an algorithm for finding x.

Example 8.2
Show that there exists a positive integer which can be written as the sum of
the squares of two numbers.

Solution.
Indeed, one example is 52 = 32 + 42

Example 8.3
Show that there exists an integer x such that x2 = 15, 129.

Solution.
Applying the well-known algorithm of extracting the square root we find that
x = 123

By a nonconstructive existence proof we mean a method that involves


either showing the existence of x using a proved theorem (or axioms) or the
assumption that there is no such x leads to a contradiction. The disadvan-
tage of nonconstructive method is that it may give virtually no clue about
where or how to find x.

Theorems are often of the form ”∀x ∈ D if P (x) then Q(x).” We call P (x)
the hypothesis and Q(x) the conclusion.

Let us first consider a proposition of the form ∀x ∈ D, P (x). Then this


can be written in the form ”∀x, if x ∈ D then P (x).” If D is a finite set, then
one check the truth value of P (x) for each x ∈ D. This method is called the
method of exhaustion.

Example 8.4
Show that for each integer 1 ≤ n ≤ 10, n2 − n + 11 is a prime number.

Solution.
The given proposition can be written in the form ”∀n ∈ IN, if 1 ≤ n ≤ 10
8 METHODS OF DIRECT PROOF I 55

then P (n)” where P (n) = n2 − n + 11. Using the method of exhaustion we


see that

P (1) = 11 ; P (2) = 13 ; P (3) = 17 ; P (4) = 23


P (5) = 31 ; P (6) = 41 ; P (7) = 53 ; P (8) = 67
P (9) = 83 ; P (10) = 101.

The most powerful technique for proving a universal proposition is one that
works regardless of the size of the domain over which the proposition is
quantified. It is called the method of generalizing from the generic
particular.
The method consists of picking an arbitrary element x of the domain (known
as a generic element) for which the hypothesis P (x) is satisfied, and then
using definitions, previously established results, and the rules of inference to
conclude that Q(x) is also true.
By a direct method of proof we mean a method that consists of showing
that if P (x) is true for x ∈ D then Q(x) is also true.

The following shows the format of the proof of a theorem.

Theorem 8.1
For all n, m ∈ Z , if m and n are even then so is m + n.

Proof.
Let m and n be two even integers. Then there exist integers k1 and k2 such
that n = 2k1 and m = 2k2 . We must show that m + n is even, that is, an
integer multiple of 2. Indeed,

m + n = 2k1 + 2k2
= 2(k1 + k2 )
= 2k

where k = k1 + k2 ∈ Z . Thus, by the definition of even, m + n is even

Example 8.5
Prove the following theorem.

Theorem Every integer is a rational number.


56 FUNDAMENTALS OF MATHEMATICAL PROOFS

Solution.
n
Proof. Let n be an arbitrary integer. Then n = 1
. By the definition of
rational numbers, n is rational

Theorem 8.2
If a, b ∈ Q
I then a + b ∈ Q.
I

Proof.
Let a and b be two rational numbers. Then there exist integers a1 , a2 , b1 6= 0,
and b2 6= 0 such that a = ab11 and b = ab22 . By the property of addition of two
fractions we have
a + b = ab11 + ab22
= a1 bb21+a
b2
2 b1

By letting p = a1 b2 + a2 b1 ∈ Z and q = b1 b2 ∈ Z ∗ we get a + b = pq . That is,


a + b ∈QI

Corollary 8.1 The double of a rational number is rational.

Proof.
Let a = b in the previous theorem we see that 2a = a + a = a + b ∈ Q
I

Next, we point out of some common mistakes that must be avoided in prov-
ing theorems.

• Arguing from examples. The validity of a general statement can not be


proved by just using a particular example.

• Using the same letters to mean two different things. For example, sup-
pose that m and n are any two given even integers. Then by writing m = 2k
and n = 2k this would imply that m = n which is inconsistent with the
statement that m and n are arbitrary.

• Jumping to a conclusion. Let us illustrate by an example. Suppose that


we want to show that if the sum of two integers is even so is their difference.
Consider the following proof: Suppose that m + n is even. Then there is an
integer k such that m + n = 2k. Then, m = 2k − n and so m − n is even.
The problem with this proof is that the crucial step m − n = 2k − n − n =
2(k − n) is missing. The author of the proof has jumped prematurely to a
8 METHODS OF DIRECT PROOF I 57

conclusion.

• Begging the question. By that we mean that the author of a proof uses in
his argument a fact that he is supposed to prove.

Finally, to show that a proposition of the form ∀x ∈ D, if P (x) then Q(x)


is false it suffices to find an element x ∈ D where P (x) is true but Q(x) is
false. Such an x is called a counterexample.

Example 8.6
Disprove the proposition ∀a, b ∈ IR, if a < b then a2 < b2 .

Solution.
A counterexample is the following. Let a = −2 and b = −1. Then a < b but
a2 > b 2
58 FUNDAMENTALS OF MATHEMATICAL PROOFS

Review Problems
A real number r is called rational if there exist two integers a and b 6= 0
such that r = ab . A real number that is not rational is called irrational.

Problem 8.1
Show that the number r = 6.321521521... is a rational number.

Problem 8.2
Prove the following theorem.

Theorem. The product of two rational numbers is a rational number.

Problem 8.3
Use the previous exercise to prove the following.

Corollary. The square of any rational number is rational.

Problem 8.4
Use the method of constructive proof to show that if r and s are two real
numbers then there exists a real number x such that r < x < s.

Problem 8.5
The following Pascal program segment does not find the minimum value in
a data set of N integers. Find a counterexample.

MINN := 0;
FOR I := 1 TO N DO
BEGIN
READLN (A);
If A < MINN THEN MINN := A
END
9 MORE METHODS OF PROOF 59

9 More Methods of Proof


A vacuous proof is a proof of an implication p → q in which it is shown
that p is false.

Example 9.1
Use the method of vacuous proof to show that if x ∈ ∅ then David is playing
pool.

Solution.
Since the proposition x ∈ ∅ is always false, the given proposition is vacuously
true

A trivial proof of an implication p → q is one in which q is shown to


be true without any reference to p.

Example 9.2
Use the method of trivial proof to show that if n is an even integer then n is
divisible by 1.

Solution.
Since the proposition n is divisible by 1 is always true, the given implication
is trivially true

The method of proof by cases is a direct method of proving the condi-


tional proposition p1 ∨ p2 ∨ · · · ∨ pn → q. The method consists of proving the
conditional propositions p1 → q, p2 → q, · · · , pn → q.

Example 9.3
Show that if n is a positive integer then n3 + n is even.

Solution.
We use the method of proof by cases.

Case 1. Suppose that n is even. Then there is k ∈ IN such that n = 2k. In


this case, n3 + n = 8k 3 + 2k = 2(4k 3 + k) which is even.

Case 2. Suppose that n is odd. Then there is a k ∈ IN such that n = 2k + 1.


So, n3 + n = 2(4k 3 + 6k 2 + 4k + 1) which is even
60 FUNDAMENTALS OF MATHEMATICAL PROOFS

Example 9.4
Use the proof by cases to prove the triangle inequality: |x + y| ≤ |x| + |y|.
Solution.
Case 1. x ≥ 0 and y ≥ 0. Then x + y ≥ 0 and so |x + y| = x + y = |x| + |y|.
Case 2. x ≥ 0 and y < 0. Then x + y < x + 0 < |x| ≤ |x| + |y|. On the
other hand, −(x + y) = −x + (−y) ≤ 0 + (−y) = |y| ≤ |x| + |y|. Thus,
if |x + y| = x + y then |x + y| < |x| + |y| and if |x + y| = −(x + y) then
|x + y| ≤ |x| + |y|.
Case 3. The case x < 0 and y ≥ 0 is similar to case 2.
Case 4. Suppose x < 0 and y < 0. Then x + y < 0 and therefore |x + y| =
−(x + y) = (−x) + (−y) = |x| + |y|.
So in all four cases |x + y| ≤ |x| + |y|.

Now, given a real number x. The largest integer n such that n ≤ x < n + 1
is called the floor of x and is denoted by bxc. The smallest integer n such
that n − 1 < x ≤ n is called the ceiling of x and is denoted by dxe.
Example 9.5
Compute bxc and dxe of the following values of x :
a. 37.999 b. − 57
2
c. −14.001
Solution.
a. b37.999c = 37, d37.999e = 38.
b. b− 57
2
c = −29, d− 57
2
e = −28.
c. b−14.001c = −15, d−14.001e = −14.
Example 9.6
Use the proof by a counterexample to show that the proposition ”∀x, y ∈
IR, bx + yc = bxc + byc” is false.
Solution.
Let x = y = 0.5. Then bx + yc = 1 and bxc + byc = 0

The following gives another example of the method of proof by cases.


Theorem 9.1
For any integer n,
n

n , if n is even
b c= 2
n−1
2 2
, if n is odd
9 MORE METHODS OF PROOF 61

Proof.
Let n be any integer. Then we consider the following two cases.

Case 1. n is odd. In this case, there is an integer k such that n = 2k + 1.


Hence,
n 2k + 1 1
b c=b c = bk + c = k
2 2 2
1
since k ≤ k + 2 < k + 1. Since n = 2k + 1 then solving this equation for k
we find k = n−1
2
. It follows that

n n−1
b c=k= .
2 2
Case 2. Suppose n is even. Then there is an integer k such that n = 2k.
Hence, b n2 c = bkc = k = n2 .
62 FUNDAMENTALS OF MATHEMATICAL PROOFS

Review Problems
Problem 9.1
Prove that for any integer n the product n(n + 1) is even.
Problem 9.2
Prove that the square of any integer has the form 4k or 4k + 1 for some
integer k
Problem 9.3
Prove that for any integer n, n(n2 − 1)(n + 2) is divisible by 4.
Theorem 9.2
Given any nonnegative integer n and a positive integer d there exist integers
q and r such that n = dq + r and 0 ≤ r < d. The number q is called the
quotient of the division of n by d and we write q = n div d. The number r
is called the remainder and we write r = n mod d or n ≡ r(mod d).
Proof.
The proof uses the fact that any nonempty subset of IN has a smallest ele-
ment. So let S = {n − d · k ∈ IN : k ∈ Z }. This set is nonempty. Indeed, if
n ∈ IN then n = n−0·d ≥ 0 and if n < 0 then n−d·n = n·(1−d) ≥ 0. Thus,
S is a nonempty subset of IN so it has a smallest elements, called r. That is,
there is an integer q such that n − d · q = r or n = d · q + r. It remains to show
that r < d. Suppose the contrary, i.e. r ≥ d. Then n − d · (q + 1) = r − d ≥ 0
so that n − d · (q + 1) ∈ S. Hence, r ≤ n − d · (q + 1) = r − d, a contradiction.
Hence, r < d

The following theorem shows a way for finding q and r.


Theorem 9.3
If n is a nonnegative integer and d is a positive integer by letting q = b nd c
and r = n − db nd c, we have
n = dq + r, and 0 ≤ r < d.
Proof.
Suppose n is a nonnegative integer, d is a positive integer,q = b nd c and
r = n − db nd c. By substitution we have
n n
dq + r = db c + n − db c = n.
d d
9 MORE METHODS OF PROOF 63

It remains to show that 0 ≤ r < d. By the definition of the floor function we


have
n
q ≤ < q + 1.
d
Multiplying through by d we find

dq ≤ n < dq + d.

This implies that


0 ≤ n − dq < d.
But
n
r = n − db c = n − dq.
d
Hence, 0 ≤ r < d. This completes a proof of the theorem

Problem 9.4
State a necessary and sufficient condition for the floor function of a real
number to equal that number

Problem 9.5
Prove that if n is an even integer then b n2 c = n2 .

Problem 9.6
Show that the equality bx − yc = bxc − byc is not valid for all real numbers
x and y.

Problem 9.7
Show that the equality dx + ye = dxe + dye is not valid for all real numbers
x and y.

Problem 9.8
Prove that for all real numbers x and all integers m, dx + me = dxe + m.

Problem 9.9
Show that if n is an odd integer then d n2 e = n+1
2
.
64 FUNDAMENTALS OF MATHEMATICAL PROOFS

10 Methods of Indirect Proofs: Contradiction


and Contraposition
Recall that in a direct proof one starts with the hypothesis of an implication
p → q and then prove that the conclusion is true. Any other method of
proof will be referred to as an indirect proof. In this section we study two
methods of indirect proofs, namely, the proof by contradiction and the proof
by contrapositive.

• Proof by contradiction: We want to show that p is true. we assume it


is not and therefore ∼ p is true and then derive a contradiction. By the rule
of contradiction discussed in Chapter 1, p must be true.

Theorem 10.1
If n2 is an even integer so is n.

Proof.
Suppose the contrary. That is suppose that n is odd. Then there is an integer
k such that n = 2k + 1. In this case, n2 = 2(2k 2 + 2k) + 1 is odd and this
contradicts the assumption that n2 is even. Hence, n must be even

Theorem 10.2

The number 2 is irrational.

Proof. √
Suppose not. That is, suppose that 2 is rational. Then √ there exist two
integers m and n with no common divisors such that 2 = m n
. Squaring
2 2 2
both sides of this equality we find that 2n = m . Thus, m is even. By
Theorem 10.1, m is even. That is, 2 divides m. But then m = 2k for some
integer k. Taking the square we find that 2n2 = m2 = 4k 2 , that is n2 = 2k 2 .
This says that n2 is even and by Theorem 10.1, n is even. We conclude that
2 divides both m and n and this contradcits
√ our assumption that m and n
have no common divisors. Hence, 2 must be irrational

Theorem 10.3
The set of prime numbers is infinite.
10 METHODS OF INDIRECT PROOFS: CONTRADICTION AND CONTRAPOSITION65

Proof.
Suppose not. That is, suppose that the set of prime numbers is finite. Then
these prime numbers can be listed, say, p1 , p2 , · · · , pn . Now, consider the inte-
ger N = p1 p2 · · · pn +1. By the Unique Factorization Theorem, ( See Exercise
??) N can be factored into primes. Thus, there is a prime number pi such
that pi |N. But since pi |p1 p2 · · · pn then pi |(N − p1 p2 · · · pn ) = 1, a contradic-
tion since pi > 1.

• Proof by contrapositive: We already know that p → q ≡∼ q →∼ p. So


to prove p → q we sometimes instead prove ∼ q →∼ p.

Theorem 10.4
If n is an integer such that n2 is odd then n is also odd.

Proof.
Suppose that n is an integer that is even. Then there exists an integer k such
that n = 2k. But then n2 = 2(2k 2 ) which is even.
66 FUNDAMENTALS OF MATHEMATICAL PROOFS

Review Problems
Problem 10.1
Use the proof by contradiction to prove the proposition ”There is no greatest
even integer.”

Problem 10.2
Prove by contradiction that the difference of any rational number and any
irrational number is irrational.

Problem 10.3
Use the proof by contraposition to show that if a product of two positive real
numbers is greater than 100, then at least one of the numbers is greater than
10.

Problem 10.4
Use the proof by contradiction to show that the product of any nonzero
rational number and any irrational number is irrational.
11 METHOD OF PROOF BY INDUCTION 67

11 Method of Proof by Induction


With the emphasis on structured programming has come the development of
an area called program verification, which means your program is correct
as you are writing it.
One technique essential to program verification is mathematical induc-
tion, a method of proof that has been useful in every area of mathematics
as well.
Consider an arbitrary loop in Pascal starting with the statement

F OR I := 1 T O N DO

If you want to verify that the loop does something regardless of the particular
integral value of N, you need mathematical induction.
Also, sums of the form
n
X n(n + 1)
k=
k=1
2

are very useful in analysis of algorithms and a proof of this formula is math-
ematical induction.
Next we examine this method. We want to prove that some predicate P (n)
is true for any nonnegative integer n ≥ n0 . The steps of mathematical induc-
tion are as follows:

(i) (Basis of induction) Show that P (n0 ) is true.


(ii) (Induction hypothesis) Assume P (n) is true.
(iii) (Induction step) Show that P (n + 1) is true.

Example 11.1
Use the technique of mathematical induction to show that

n(n + 1)
1 + 2 + 3 + ··· + n = , n ≥ 1.
2

Solution.
Let S(n) = 1 + 2 + · · · + n. Then
(i) (Basis of induction) S(1) = 1 = 1(1+1)
2
. That is, S(1)is true.
n(n+1)
(ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) = 2
.
68 FUNDAMENTALS OF MATHEMATICAL PROOFS

(n+1)(n+2)
(iii) (Induction step) We must show that S(n + 1) = 2
. Indeed,

S(n + 1) = 1 + 2 + · · · + n + (n + 1)
= S(n) + (n + 1)
n(n+1)
= 2
+ (n + 1)
(n+1)(n+2)
= 2

Example 11.2 P (Geometric progression)


a. Let S(n) = nk=0 ark , n ≥ 0 where r 6= 1. Use induction to show that
n+1 )
S(n) = a(1−r
1−r
.
b. Show that 1 + 12 + · · · + 2n−1
1
≤ 2, for all n ≥ 1.

Solution.
a. We use the method of proof by mathematical induction.

(i) (Basis of induction) S(0) = a = 0k=0 ark . That is, S(1)is true.P
P
(ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) = nk=0 ark .
n+2 )
(iii) (Induction step) We must show that S(n + 1) = a(1−r1−r
. Indeed,
Pn+1 k
S(n + 1) = k=0 ar
= S(n) + arn+1
n+1
= a 1−r
1−r
1−r
+ arn+1 1−r
n+1 n+1 −r n+2
= a 1−r +r 1−r
n+2
= a 1−r
1−r
.

b. By a. we have
1−( 12 )n
1 + 12 + 1
22
+ ··· + 1
2n−1
= 1− 12
= 2(1 − ( 12 )n )
1
= 2 − 2n−1
≤ 2.

Example 11.3Pn (Arithmetic progression)


Let S(n) = k=1 (a + (k − 1)r), n ≥ 1. Use induction to show that S(n) =
n
2
[2a + (n − 1)r].

Solution.
We use the method of proof by mathematical induction.
11 METHOD OF PROOF BY INDUCTION 69

(i) (Basis of induction) S(1) = a = 12 [2a + (1 − 1)r]. That is, S(1)is true.
(ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) = n2 [2a + (n −
1)r].
(iii) (Induction step) We must show that S(n + 1) = (n+1) 2
[2a + nr]. Indeed,
Pn+1
S(n + 1) = k=1 (a + (k − 1)r)
= S(n) + a + (n + 1 − 1)r
n
= 2
[2a + (n − 1)r] + a + nr
2an+n2 r−nr+2a+2nr
= 2
2a(n+1)+n(n+1)r
= 2
n+1
= 2
[2a + nr].

We next exhibit a theorem whose proof uses mathematical induction.

Theorem 11.1
For all integers n ≥ 1, 22n − 1 is divisible by 3.

Proof.
Let P (n) : 22n − 1 is divisible by 3. Then
(i) (Basis of induction) P (1) is true since 3 is divisible by 3.
(ii) (Induction hypothesis) Assume P (n) is true. That is, 22n − 1 is divisible
by 3.
(iii) (Induction step) We must show that 22n+2 − 1 is divisible by 3. Indeed,

22n+2 − 1 = 22n (4) − 1


2n
= 2 (3 + 1) − 1
= 2 · 3 + (22n − 1)
2n

= 22n · 3 + P (n)

Since 3|(22n − 1) and 3|(22n · 3) we have 3|(22n · 3 + 22n − 1). This ends a proof
of the theorem

Example 11.4
a. Use induction to prove that n < 2n for all non-negative integers n.
b. Use induction to prove that 2n < n! for all non-negative integers n ≥ 4.

Solution.
a. Let S(n) = 2n − n, n ≥ 0. We want to show that S(n) > 0 is valid for all
70 FUNDAMENTALS OF MATHEMATICAL PROOFS

n ≥ 0. By the method of mathematical induction we have


(i) (Basis of induction) S(0) = 20 − 0 = 1 > 0. That is, S(0)is true.
(ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) > 0.
(iii) (Induction step) We must show that S(n + 1) > 0. Indeed,

S(n + 1) = 2n+1 − (n + 1)
= 2n .2 − n − 1
n
= 2 (1 + 1) − n − 1
= 2n − n + 2n − 1
= (2n − 1) + S(n)
> 2n − 1
≥ 0

since the smallest value of n is 0 and in this case 20 − 1 = 0.


b. Let S(n) = n! − 2n , n ≥ 4. We want to show that S(n) > 0 for all n ≥ 4.
By the method of mathematical induction we have
(i) (Basis of induction) S(4) = 4! − 24 = 8 > 0. That is, S(4)is true.
(ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) > 0, n ≥ 4.
(iii) (Induction step) We must show that S(n + 1) > 0. Indeed,

S(n + 1) = (n + 1)! − 2n+1


= (n + 1)n! − 2n (1 + 1)
= n! − 2n + nn! − 2n
> 2(n! − 2n ) = 2S(n)
> 0

where we have used the fact that if n ≥ 1 then nn! ≥ n!

Example 11.5 (Bernoulli’s inequality)


Let h > −1. Use induction to show that

(1 + nh) ≤ (1 + h)n , n ≥ 0.

Solution.
Let S(n) = (1 + h)n − (1 + nh). We want to show that S(n) ≥ 0 for all n ≥ 0.
We use mathematical induction as follows.
(i) (Basis of induction) S(0) = (1 + h)0 − (1 + 0h) = 0. That is, S(0)is true.
(ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) ≥ 0, n ≥ 0.
11 METHOD OF PROOF BY INDUCTION 71

(iii) (Induction step) We must show that S(n + 1) ≥ 0. Indeed,

S(n + 1) = (1 + h)n+1 − (1 + (n + 1)h)


= (1 + h)(1 + h)n − nh − 1 − h
≥ (1 + h)(1 + nh) − nh − 1 − h
= nh2
≥ 0.

Example 11.6
Define the following sequence of numbers: a1 = 2 and for n ≥ 2, an = 5an−1 .
Find a formula for an and then prove its validity by mathematical induction.

Solution.
Listing the first few terms we find, a1 = 2, a2 = 10, a3 = 50, a4 = 250. Thus,
an = 2.5n−1 . We will show that this formula is valid for all n ≥ 1 by the
method of mathematical induction.
(i) (Basis of induction) a1 = 2 = 2.51−1 . That is, a1 is true.
(ii) (Induction hypothesis) Assume an is true. That is, an = 2.5n−1
(iii) (Induction step) We must show that an+1 = 2.5n . Indeed,

an+1 = 5an
= 5(2.5n−1 )
= 2.5n .
72 FUNDAMENTALS OF MATHEMATICAL PROOFS

Review Problems
Problem 11.1
Use the method of induction to show that

2 + 4 + 6 + · · · + 2n = n2 + n

for all integers n ≥ 1.

Problem 11.2
Use mathematical induction to prove that

1 + 2 + 22 + · · · + 2n = 2n+1 − 1

for all integers n ≥ 0.

Problem 11.3
Use mathematical induction to show that
n(n + 1)(2n + 1)
12 + 22 + · · · + n2 =
6
for all integers n ≥ 1.

Problem 11.4
Use mathematical induction to show that
 2
3 3 3 n(n + 1)
1 + 2 + ··· + n =
2

for all integers n ≥ 1.

Problem 11.5
Use mathematical induction to show that
1 1 1 n
+ + ··· + =
1·2 2·3 n(n + 1) n+1

for all integers n ≥ 1.


11 METHOD OF PROOF BY INDUCTION 73

Problem 11.6
Use the formula
n(n + 1)
1 + 2 + ··· + n =
2
to find the value of the sum
3 + 4 + · · · + 1, 000.
Problem 11.7
Find the value of the geometric sum
1 1 1
1 + + 2 + ··· + n.
2 2 2
Problem 11.8
Let S(n) = nk=1 (k+1)!
k
P
. Evaluate S(1), S(2), S(3), S(4), and S(5). Make a
conjecture about a formula for this sum for general n, and prove your con-
jecture by mathematical induction.
Problem 11.9
For each positive integer n let P (n) be the proposition 4n −1 is divisible by 3.

a. Write P (1). Is P (1) true?


b. Write P (k).
c. Write P (k + 1).
d. In a proof by mathematical induction that this divisibility property holds
for all integers n ≥ 1, what must be shown in the induction step?
Problem 11.10
For each positive integer n let P (n) be the proposition 23n − 1 is divisible by
7. Prove this property by mathematical induction.
Problem 11.11
Show that 2n < (n + 2)! for all integers n ≥ 0.
Problem 11.12
a. Use mathematical induction to show that n3 > 2n + 1 for all integers
n ≥ 2.
b. Use mathematical induction to show that n! > n2 for all integers n ≥ 4.
Problem 11.13
A sequence a1 , a2 , · · · is defined by a1 = 3 and an = 7an−1 for n ≥ 2. Show
that an = 3 · 7n−1 for all integers n ≥ 1.
74 FUNDAMENTALS OF MATHEMATICAL PROOFS

12 Project III: Elementary Number Theory


and Mathematical Proofs
Recall that the set of positive integers together with zero is denoted by IN.
The set of all integers is denoted by Z and the set of rational numbers is
denoted by Q.
I

We say that an integer n is even if and only if there exists an integer k


such that n = 2k. An integer n is said to be odd if and only if there exists
an integer k such that n = 2k + 1.

Problem 12.1
Let m and n be two integers.
a. Is 6m + 8n an even integer?
b. Is 6m + 4n2 + 3 odd?

Let a and b be two integers with a 6= 0. We say that b is divisible by a,


written a|b, if there exists an integer k such that b = ka. In this case we say
that a divides b, a is a factor of b, and b is a multiple of a. For example,
3 6 |7 whereas 3|12.

Problem 12.2
Prove the following theorem.

Theorem 12.1
Let a 6= 0, b 6= 0, and c be integers.
(i) If a|b and a|c then a|(b ± c).
(ii) If a|b then a|bc.
(iii) If a|b and b|c then a|c.

A positive integer p > 1 is called prime if 1 and p are the only divisors of p.
A number which is not prime is called a composite number. For example,
3 is prime whereas 10 is composite.

Problem 12.3
Let m and n be positive integers with m > n. Is m2 − n2 composite?

Problem 12.4
Write the first 7 prime numbers.
12 PROJECT III: ELEMENTARY NUMBER THEORY AND MATHEMATICAL PROOFS75

Problem 12.5
If a positive number p is composite then one can always write p as the product
of primes, where the prime factors are written in increasing order. This result
is known as the Fundamental Theorem of Arithmetic or the Unique
Factorization Theorem. Write the prime factorization of 180.

The following important theorem shows that if a number is not divisible by


any prime less than to its square root then the number must be prime.

Theorem 12.2
If
√ n is a composite integer, then n has a prime divisor less than or equal to
n.

Proof.
Since n is composite,
√ there√is a divisor a of n√such
√ that 1 < a < n. Write
n = ab. If a > n √ and b > n√ then n = ab > n n = n, a false conclusion.
Thus, either a ≤ n√or b ≤ n. Hence, n has a positive divisor which is
less than or equal to n. This divisor is either prime or, by the Fundamental
Theorem of Arithmetic has √ a prime divisor. In either case, n has a prime
divisor less than or equal to n

Problem 12.6
Use the previous theorem to show that the number 101 is prime.
76 FUNDAMENTALS OF MATHEMATICAL PROOFS

13 Project IV: The Euclidean Algorithm


Problem 13.1
Let a and b be two integers not both equal to zero. We say that d is the
greatest common divisor of a and b, written d = gcd(a, b), if d is the
largest integer such that d|a and d|b. If d = 1 then we say that a and b are
relatively prime. To find d one writes the prime factorization of both a
and b, say a = pa11 pa22 · · · pann , b = pb11 pb22 · · · pbnn , then
min(a1 ,b1 ) min(a2 ,b2 )
d = p1 p2 · · · pmin(a
n
n ,bn )
.
(i) Find gcd(120, 500).
(ii) Show that 17 and 22 are relatively prime.
Problem 13.2
We say that m is the least common multiple of two positive integers a
and b, written m = lcm(a, b), if m is the smallest positive integer that is
divisible by both a and b. Using the notation of the previous exercise m is
max(a1 ,b1 ) max(a2 ,b2 ) max(an ,bn )
given by m = p1 p2 · · · pn . Find lcm(120, 500).
Problem 13.3
Recall that a ≡ b mod n if and only if a − b = kn for some integer k.
(i) Show that if a ≡ b mod n and c ≡ d mod n then a + c ≡ b + d mod n.
(ii) Show that if a ≡ b mod n and c ≡ d mod n then ac ≡ bd mod n.
(iii) What are the solutions of the linear congruences 3x ≡ 4(mod7)?

Lemma 13.1 (Euclidean Algorithm)


Let a, b, q, and r be integers such that a = bq + r. Then gcd(a, b) = gcd(b, r).
Proof.
Let d1 = gcd(a, b) and d2 = gcd(b, r). We will show that d1 = d2 . Since d2 |b,
d2 |bq. Also d2 |r. Consequently d2 |(bq + r) that is d2 |a. Hence, d2 ≤ d1 . A
similar argument shows that d1 ≤ d2 . We conclude that d1 = d2

Using Lemma 13.1 we derive an algorithm, called the Euclidean Algo-


rithm, for finding the greatest common divisor of two non-negative integers
a and b with b 6= 0.
Dividing a by b we obtain
a = bq + r1 , where 0 ≤ r1 < b.
13 PROJECT IV: THE EUCLIDEAN ALGORITHM 77

By Lemma 13.1 we have gcd(a, b) = gcd(b, r1 ). If r1 6= 0 then we divide b by


r1 to obtain
b = r1 q1 + r2 , where 0 ≤ r2 < r1 .
Again by Lemma 13.1 we have gcd(b, r1 ) = gcd(r1 , r2 ). If r2 6= 0 then we
divide r1 by r2 to obtain

r1 = r2 q2 + r3 , where 0 ≤ r3 < r2 .

By Lemma 13.1 we have gcd(r1 , r2 ) = gcd(r2 , r3 ). Repeating the above process,


ultimately, we will end up with rn = rn+1 qn+1 . In this case rn+1 = gcd(a, b).

Problem 13.4
a. Use the Euclidean algorithm to find gcd(414, 662).
b. Use the Euclidean algorithm to find gcd(287, 91).
78 FUNDAMENTALS OF MATHEMATICAL PROOFS

14 Project V: Induction and the Algebra of


Matrices
In this section, we introduce the concept of a matrix. We also examine four
operations on matrices- equality, addition, scalar multiplication, and multi-
plication.

A matrix A of size m × n is a rectangular array of the form


 
a11 a12 ... a1n
 a21 a22 ... a2n 
A=  ...

... ... ... 
am1 am2 ... amn
where the aij ’s are the entries of the matrix, m is the number of rows, n
is the number of columns. The zero matrix 0 is the matrix whose entries
are all 0. The n × n identity matrix In is a square matrix whose main
diagonal consists of 10 s and the off diagonal entries are all 0. A matrix A can
be represented with the following compact notation A = (aij ). The ith row
of the matrix A is
[ai1 , ai2 , ..., ain ]
and the jth column is  
a1j

 a2j 

 .. 
 . 
amj

In what follows we discuss the basic arithmetic of matrices.

Two matrices are said to be equal if they have the same size and their cor-
responding entries are all equal. If the matrix A is not equal to the matrix
B we write A 6= B.
Problem 14.1
Find x1 , x2 and x3 such that
   
x1 + x2 + 2x3 0 1 9 0 1
 2 3 2x1 + 4x2 − 3x3  =  2 3 1 
4 3x1 + 6x2 − 5x3 5 4 0 5
14 PROJECT V: INDUCTION AND THE ALGEBRA OF MATRICES 79

Problem 14.2
Solve the following matrix equation for a, b, c, and d
   
a−b b+c 8 1
=
3d + c 2a − 4d 7 6

Next, we introduce the operation of addition of two matrices. If A and B are


two matrices of the same size, then the sum A + B is the matrix obtained
by adding together the corresponding entries in the two matrices. Matrices
of different sizes cannot be added.

Problem 14.3
Consider the matrices
     
2 1 2 1 2 1 0
A= ,B = ,C =
3 4 3 5 3 4 0

Compute, if possible, A + B, A + C and B + C.

If A is a matrix and c is a scalar, then the product cA is the matrix obtained


by multiplying each entry of A by c. Hence, −A = (−1)A. We define, A−B =
A + (−B). The matrix cIn is called a scalar matrix.

Problem 14.4
Consider the matrices
   
2 3 4 0 2 7
A= ,B =
1 2 1 1 −3 5

Compute A − 3B.

Problem 14.5
Let A be an m × n matrix. The transpose of A, denote by AT , is the n × m
whose columns are the rows of A. Find the transpose of the matrix
 
2 3 4
A= ,
1 2 1
80 FUNDAMENTALS OF MATHEMATICAL PROOFS

Now, let A be a matrix of size m × n and entries aij ; B is a matrix of size


n × p and entries bij . Then the product matrix is a matrix of size m × p and
entries
cij = ai1 b1j + ai2 b2j + · · · + ain bnj
that is cij is obtained by multiplying componentwise the entries of the ith
row of A by the entries of the jth column of B. It is very important to keep
in mind that the number of columns of the first matrix must be equal to the
number of rows of the second matrix; otherwise the product is undefined.

Problem 14.6
Consider the matrices
 
  4 1 4 3
1 2 4
A= , B =  0 −1 3 1 
2 6 0
2 7 5 2

Compute, if possible, AB and BA.

Problem 14.7
Prove by induction on n ≥ 1 that
 n  n 
2 1 2 n2n−1
= .
0 2 0 2n
Fundamentals of Set Theory

Set is the most basic term in mathematics and computer science. Hardly
any discussion in either subject can proceed without set or some synonym
such as class or collection. In this chapter we introduce the concept of sets
and its various operations and then study the properties of these operations.

15 Basic Definitions
We first consider the following known as the barber puzzle:” The army
captain orders his company barber to shave all members of the company
provided they do not shave themselves. The barber is so busy at first that
his own beard begins to be unsightly. Just as he lathers up, the impossibility
of his position strikes him: If he shaves himself, he disobeys the captain’s or-
der. If he does not shave himself, then by the captain’s order he is supposed
to shave himself.”
A situation like this is known as a paradox. To resolve the problem one has
to take the barber out of the company. Another well known paradox is

Russell’s Paradox. Define the set A = {X : X is a set, X 6∈ X}.


Since A is a set then saying that A ∈ A will imply that A 6∈ A by the defini-
tion of A. Saying that A 6∈ A means that A ∈ A by the definition of A. Thus
in either case the assumption that A is a set leads to an untenable paradox:
A ∈ A and A 6∈ A. Hence, A is not a set.
Such a paradox indicated the necessity of a formal axiomatization of set the-
ory.
We define a set A as a collection of well-defined objects (called elements or
members of A) such that for any given object x either one (but not both)
of the following holds:

81
82 FUNDAMENTALS OF SET THEORY

• x belongs to A and we write x ∈ A.

• x does not belong to A, and in this case we write x 6∈ A.

We denote sets by capital letters A, B, C, · · · and elements by lowercase let-


ters a, b, c, · · · Sets consisting of sets will be denoted by script letters.
There are two different ways to represent a set. The first one is to list,
without repetition, the elements of the set. The other way is to describe a
property that characterizes the elements of the set.
We define the empty set, denoted by ∅, to be the set with no elements.

Example 15.1
List the elements of the following sets.
a. {x|x is a real number such that x2 = 1}.
b. {x|x is an integer such that x2 − 3 = 0}.

Solution.
a. {−1, 1}.
b. ∅

Example 15.2
Use a property to give a description of each of the following sets.
a. {a, e, i, o, u}.
b. {1, 3, 5, 7, 9}.

Solution.
a. {x|x is a vowel}.
b. {n ∈ IN∗ |n is odd and less than 10}

Let A and B be two sets. We say that A is a subset of B, denoted by


A ⊆ B, if and only if every element of A is also an element of B. Symboli-
cally:
A ⊆ B ⇔ ∀x, x ∈ A implies x ∈ B
If there exists an element of A which is not in B then we write A 6⊆ B.
Since the proposition x ∈ ∅ is always false then for any set A we have

∅ ⊆ A ⇔ ∀x, x ∈ ∅ implies x ∈ A
15 BASIC DEFINITIONS 83

Example 15.3
Suppose that A = {2, 4, 6}, B = {2, 6}, and C = {4, 6}. Determine which of
these sets are subsets of which other of these sets.

Solution.
B ⊆ A and C ⊆ A

If sets A and B are represented as regions in the plane, relationships be-


tween A and B can be represented by pictures, called Venn diagram.

Example 15.4
Represent A ⊆ B using Venn diagram.

Solution.

Two sets A and B are said to be equal if and only if A ⊆ B and B ⊆ A.


We write A = B. Thus, to show that A = B it suffices to show the double
inclusions mentioned in the definition. For non-equal sets we write A 6= B.

Example 15.5
Determine whether each of the following pairs of sets are equal.
(a) {1, 3, 5} and {5, 3, 1}.
(b) {{1}} and {1, {1}}.

Solution.
(a) {1, 3, 5} = {5, 3, 1}.
(b) {{1}} = 6 {1, {1}} since 1 6∈ {{1}}
84 FUNDAMENTALS OF SET THEORY

Let A and B be two sets. We say that A is a proper subset of B, de-


noted by A ⊂ B, if A ⊆ B and A 6= B. Thus, to show that A is a proper
subset of B we must show that every element of A is an element of B and
there is an element of B which is not in A.

Example 15.6
I IN using ⊂
Order the sets of numbers: Z , IR, Q,

Solution.
IN ⊂ Z ⊂ Q
I ⊂ IR

Example 15.7
Determine whether each of the following statements is true or false.
(a) x ∈ {x} (b) {x} ⊆ {x} (c) {x} ∈ {x}
(d) {x} ∈ {{x}} (e) ∅ ⊆ {x} (f) ∅ ∈ {x}

Solution.
(a) True (b) True (c) False (d) True (e) True (f) False

If U is a given set whose subsets are under consideration, then we call U


a universal set.
Let U be a universal set and A, B be two subsets of U. The absolute com-
plement of A is the set

Ac = {x ∈ U |x 6∈ A}.

The relative complement of A with respect to B is the set

B − A = {x ∈ U |x ∈ B and x 6∈ A}.

Example 15.8
Let U = IR. Consider the sets A = {x ∈ IR|x < −1 or x > 1} and
B = {x ∈ IR|x ≤ 0}. Find

a. Ac .
b. B − A.

Solution.
a. Ac = [−1, 1].
15 BASIC DEFINITIONS 85

b. B − A = [−1, 0]

Let A and B be two sets. The union of A and B is the set

A ∪ B = {x|x ∈ A or x ∈ B}.

where the ’or’ is inclusive. This defenition can be extended to more than two
sets. More precisely, if A1 , A2 , · · · , are sets then

∪∞
n=1 An = {x|x ∈ Ai f or some i}.

Let A and B be two sets. The intersection of A and B is the set

A ∩ B = {x|x ∈ A and x ∈ B}.

If A∩B = ∅ we say that A and B are disjoint sets. Given the sets A1 , A2 , · · · ,
we define
∩∞n=1 An = {x|x ∈ Ai f or all i}.

Example 15.9
Let A = {a, b, c}, B = {b, c, d}, and C = {b, c, e}.

a. Find A ∪ (B ∩ C), (A ∪ B) ∩ C, and (A ∪ B) ∩ (A ∪ C). Which of


these sets are equal?
b. Find A ∩ (B ∪ C), (A ∩ B) ∪ C, and (A ∩ B) ∪ (A ∩ C). Which of these
sets are equal?
c. Find A − (B − C) and (A − B) − C. Are these sets equal?

Solution.
a. A ∪ (B ∩ C) = A, (A ∪ B) ∩ C = {b, c}, (A ∪ B) ∩ (A ∪ C) = {b, c} =
(A ∪ B) ∩ C.
b. A ∩ (B ∪ C) = {b, c}, (A ∩ B) ∪ C = C, (A ∩ B) ∪ (A ∩ C) = {b, c} =
(A ∩ B) ∪ C.
c. A − (B − C) = A and (A − B) − C = {a} = 6 A − (B − C).

Example 15.10
For each n ≥ 1, let An = {x ∈ IR : x < 1 + n1 }. Show that

∩∞
n=1 An = {x ∈ IR : x ≤ 1}.
86 FUNDAMENTALS OF SET THEORY

Solution.
The proof is by double inclusions method. Let y ∈ {x ∈ IR : x ≤ 1}. Then
for all positive integer n we have y ≤ 1 < 1 + n1 . That is, y ∈ ∩∞ n=1 An . This
shows that {x ∈ IR : x ≤ 1} ⊆ ∩∞ A
n=1 n .
Conversely, let y ∈ ∩∞ n=1 A n . Then y < 1 + n1 for all n ≥ 1. Now take the limit
of both sides as n → ∞ to obtain y ≤ 1. That is, y ∈ {x ∈ IR : x ≤ 1}. This
shows that ∩∞ n=1 An ⊆ {x ∈ IR : x ≤ 1}.

Example 15.11
The symmetric difference of A and B, denoted by A∆B, is the set contain-
ing those elements in either A or B but not both. Find A∆B if A = {1, 3, 5}
and B = {1, 2, 3}.

Solution.
A∆B = {2, 5}

The notation (a1 , a2 , · · · , an ) is called an ordered n-tuples. We say that


two n-tuples (a1 , a2 , · · · , an ) and (b1 , b2 , · · · , bn ) are equal if and only if a1 =
b1 , a2 = b2 , · · · , an = bn .
Given n sets A1 , A2 , · · · , An the Cartesian product of these sets is the set

A1 × A2 × · · · × An = {(a1 , a2 , · · · , an ) : a1 ∈ A1 , a2 ∈ A2 , · · · , an ∈ An }

Example 15.12
Let A = {x, y}, B = {1, 2, 3}, and C = {a, b}. Find
a. A × B × C.
b. (A × B) × C.

Solution.
a.
A × B × C = {(x, 1, a), (x, 2, a), (x, 3, a), (y, 1, a), (y, 2, a),
(y, 3, a), (x, 1, b), (x, 2, b), (x, 3, b), (y, 1, b)
(y, 2, b), (y, 3, b)}
b.

(A × B) × C = {((x, 1), a), ((x, 2), a), ((x, 3), a), ((y, 1), a), ((y, 2), a),
((y, 3), a), ((x, 1), b), ((x, 2), b), ((x, 3), b), ((y, 1), b)
((y, 2), b), ((y, 3), b)}
15 BASIC DEFINITIONS 87

Next, we introduce one more special kind of sets, denoted by Σ∗ . An al-


phabet is a finite nonempty set Σ whose members are called letters and
with the restrictions that Σ does not contain letters which are themselves
strings beginning with other letters of Σ. Thus, Σ = {a, b, c, ca} is not an
alphabet. A word is any finite string of letters from Σ. We denote the set of
all words using letters from Σ by Σ∗ . Any subset of Σ∗ is called a language.
For example, if Σ consists of the twenty six letters of the english alphabet,
then the American language can be defined as the subset of Σ∗ consisting of
words in the latest edition of the Webster’s World dictionary of the American
Language.
The empty word or the null word is the string with no letters. It is de-
noted by .
We define the length of a word w to be the number of letters from Σ in
w and we write |w|. Note that in order to define the length of a word the
restriction given in the definition is needed. To be more precise, suppose that
Σ = {a, b, ab}. Then what is the length of the word aab? Is this a word with
two letters a and ab or three letters a, a, and b? So obviously there is no way
to tell. This ambiguity is resolved by making the restriction stated in the
definition above.
Finally, by Σn we mean the set of all words over Σ of length n. That is, Σn
is the cartesian product of n copies of Σ.

Example 15.13
Let Σ = {a, b}. List all the elements of the set

A = {w ∈ Σ∗ : |w| = 2}.

Solution.

A = {aa, ab, ba, bb}


88 FUNDAMENTALS OF SET THEORY

Review Problems
Problem 15.1
Which of the following sets are equal?
a. {a, b, c, d}
b. {d, e, a, c}
c. {d, b, a, c}
d. {a, a, d, e, c, e}

Problem 15.2
Let A = {c, d, f, g}, B = {f, j}, and C = {d, g}. Answer each of the following
questions. Give reasons for your answers.
a. Is B ⊆ A?
b. Is C ⊆ A?
c. Is C ⊆ C?
d. Is C is a proper subset of A?

Problem 15.3
a. Is 3 ∈ {1, 2, 3}?
b. Is 1 ⊆ {1}?
c. Is {2} ∈ {1, 2}?
d. Is {3} ∈ {1, {2}, {3}}?
e. Is 1 ∈ {1}?
f. Is {2} ⊆ {1, {2}, {3}}?
g. Is {1} ⊆ {1, 2}?
h. Is 1 ∈ {{1}, 2}?
i. Is {1} ⊆ {1, {2}}?
j. Is {1} ⊆ {1}?

Problem 15.4
Let A = {b, c, d, f, g} and B = {a, b, c}. Find each of the following:
a. A ∪ B.
b. A ∩ B.
c. A − B.
d. B − A.

Problem 15.5
Indicate which of the following relationships are true and which are false:
a. Z + ⊆ Q.
I
15 BASIC DEFINITIONS 89

b. IR− ⊂ Q.
I
I ⊂ Z.
c. Q
d. Z + ∪ Z − = Z .
I ∩ IR = Q.
e. Q I
I ∪ Z = Z.
f. Q
g. Z + ∩ IR = Z +
h. Z ∪ QI = Q.
I

Problem 15.6
Let A = {x, y, z, w} and B = {a, b}. List the elements of each of the following
sets:
a. A × B
b. B × A
c. A × A
d. B × B.

Problem 15.7
Let Σ = {x, y} be an alphabet.
a. Let L1 be the language consisting of all strings over Σ that are palindromes
and have length ≤ 4. List the elements L1 .
b. Let L2 be the language consisting of all strings over Σ that begins with x
and have length ≤ 3. List the elements L2 .
c. Let L3 be the language consisting of all strings over Σ with length ≤ 3
and for which all the x0 s appear to the left of all the y 0 s. List the elements
L3 .
d. List the elements of Σ4 , the set of all strings of length 4 over Σ.
e. Let A = Σ3 ∪ Σ4 . Describe A, B, and A ∪ B in words.
90 FUNDAMENTALS OF SET THEORY

16 Properties of Sets
The following exercise shows that the operation ⊆ is reflexive and transitive,
concepts that will be discussed in the next chapter.

Example 16.1
a. Suppose that A, B, C are sets such that A ⊆ B and B ⊆ C. Show that
A ⊆ C.
b. Find two sets A and B such that A ∈ B and A ⊆ B.
c. Show that A ⊆ A.

Solution.
a. We need to show that every element of A is an element of C. Let x ∈ A.
Since A ⊆ B then x ∈ B. But B ⊆ C so that x ∈ C.
b. A = {x} and B = {x, {x}}.
c. The proposition if x ∈ A then x ∈ A is always true. Thus, A ⊆ A

Theorem 16.1
Let A and B be two sets. Then
a. A ∩ B ⊆ A and A ∩ B ⊆ B.
b. A ⊆ A ∪ B and B ⊆ A ∪ B.

Proof.
a. If x ∈ A ∩ B then x ∈ A and x ∈ B. This still imply that x ∈ A. Hence,
A ∩ B ⊆ A. A similar argument holds for A ∩ B ⊆ B.
b. The proposition ”if x ∈ A then x ∈ A ∪ B” is always true. Hence,
A ⊆ A ∪ B. A similar argument holds for B ⊆ A ∪ B

Theorem 16.2
Let A be a subset of a universal set U. Then
a. ∅c = U.
b. U c = ∅.
c. (Ac )c = A.
d. A ∪ Ac = U.
e. A ∩ Ac = ∅.

Proof.
a. If x ∈ U then x ∈ U and x 6∈ ∅. Thus, U ⊆ ∅c . Conversely, suppose that
x ∈ ∅c . Then x ∈ U and x 6∈ ∅. This implies that x ∈ U. Hence, ∅c ⊆ U.

You might also like