You are on page 1of 84

Discrete Mathematics

Chapter # 1 : The Foundations: Logic and Proofs

Spring, 2013/2014

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 1 / 85


Outline

1 Propositional Logic

2 Propositional Equivalences

3 Predicates and Quantifiers

4 Nested Quantifiers

5 Rules of Inference

6 Introduction to Proofs

7 Proof Methods and Strategy

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 2 / 85


Propositional Logic
Motivations

For every positive integer n, the sum of the positive integers not
exceeding n is n(n + 1)/2.
Mathematical Statement + Proof = Theorem
Proofs are important throughout mathematics, but how important
proofs are in computer science?.
Verify that computer programs produce the correct output for all
possible input values.
Show that algorithms always produce the correct result.
Establish the security of a system.
What we are going to learn in this chapter?
Introduce tools to construct a correct mathematical arguments.
Develop different proof methods that will enable us to prove many
different types of results.
Introduce several strategies for constructing proofs.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 3 / 85


Propositional Logic
Introduction
A proposition
a declarative sentence (that is, a sentence that declares a fact) that is
either true or false, but not both.

All the following declarative sentences are propositions.


”G” comes after ”F” in the English alphabetic.
Toronto is the capital of Canada.
1 + 1 = 2.
2 + 2 = 3.
Propositions 1 and 3 are true, whereas 2 and 4 are false.
Consider the following sentences:
What time is it?, Read this carefully.
I hope I can get above 90 in discrete mathematics.
x + 1 = 2.
Sentences 1 and 2 are not propositions because they are not
declarative sentences. Sentence 3 is not proposition because it is
neither true nor false.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 4 / 85
Propositional Logic
Introduction

Is it a proposition?
Hello, How are you?.
NO
We can eat rocks.
YES
Ahmad taller than Ali.
YES
He is a good student.
NO
Please wakeup.
NO
15 * Z >= 30.
NO

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 5 / 85


Propositional Logic
Introduction

We use letters to denote propositional variables (or statement


variables).
The conventional letters used for propositional variables are
p, q, r , s, . . . .
The truth value of a proposition is true, denoted by T, if it is a
true proposition, and the truth value of a proposition is false,
denoted by F, if it is a false proposition.

DEFINITION
Let p be a proposition. The negation of p, denoted by + p (also
denoted by p̄), is the statement
”It is not the case that p.”
The proposition + p is read ”not p.” The truth value of the negation of
p, + p, is the opposite of the truth value of p.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 6 / 85


Propositional Logic
Introduction

Ex. Find the negation of the proposition”Michaels PC runs Linux”


and express this in simple English.
Solution: The negation is ”It is not the case that Michaels PC runs
Linux.”
This negation can be more simply expressed as ”Michaels PC does
not run Linux.”
———————————————————————
Ex. Find the negation of the proposition ”Jessica’s smartphone has
at least 32GB of memory” and express this in simple English.
Solution: The negation is ”It is not the case that Jessica’s
smartphone has at least 32GB of memory.”
This negation can also be expressed as ”Jessica’s smartphone does
not have at least 32GB of memory”
or even more simply as ”Jessica’s smartphone has less than 32GB of
memory.”
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 7 / 85
Propositional Logic
Introduction

The truth table for the negation of a proposition p.

Connectives
The logical operators that are used to form new propositions from two or
more existing propositions.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 8 / 85
Propositional Logic
Compound Propositions

Conjunction
Let p and q be propositions. The conjunction of p and q, denoted by
p ∧ q, is the proposition of ”p and q”. The conjunction p ∧ q is true
when both p and q are true and is false otherwise.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 9 / 85


Propositional Logic
Compound Propositions

Example: Find the conjunction of the propositions p and q where p


is the proposition ”Rebeccas PC has more than 16 GB free hard disk
space” and q is the proposition ”The processor in Rebeccas PC runs
faster than 1 GHz.”
The conjunction of these propositions, p ∧ q, is the proposition
”Rebecca’s PC has more than 16 GB free hard disk space, and the
processor in Rebecca’s PC runs faster than 1 GHz.”
This conjunction can be expressed more simply as ”Rebecca’s PC
has more than 16 GB free hard disk space, and its processor runs
faster than 1 GHz”.
For this conjunction to be true, both conditions given must be true.
It is false, when one or both of these conditions are false.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 10 / 85


Propositional Logic
Compound Propositions

Disjunction
Let p and q be propositions. The disjunction of p and q, denoted by
p ∨ q, is the proposition of ”p or q”. The disjunction p ∨ q is false when
both p and q are false and is true otherwise.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 11 / 85


Propositional Logic
Compound Propositions

Exclusive or
Let p and q be propositions. The exclusive or of p and q, denoted by
p ⊕ q, is the proposition that is true when exactly one of p and q is true
and is false otherwise.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 12 / 85


Propositional Logic
Compound Propositions

Example: If the proportions p and q are: ”Students who have


taken calculus can take this course” and ”Students who have taken
computer science can take this course”, what is the difference
between the connection using inclusive and exclusive or?
Inclusive or: ”Students who have taken calculus or computer
science can take this class.”
Here we mean that students who have taken both calculus and
computer science can take the class, as well as the students who
have taken only one of the two subjects.
Exclusive or: ”Students who have taken calculus or computer
science, but not both, can enroll in this class.”
Here, we mean that students who have taken both calculus and a
computer science course cannot take the class. Only those who have
taken exactly one of the two courses can take the class.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 13 / 85
Propositional Logic
Conditional Statements

A variety of terminology is used to express p → q. You will


encounter most if not all of the following ways to express this
conditional statement:

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 15 / 85


Propositional Logic
Conditional Statements

Example: If the proportions p and q are: ”Ali studies discrete


mathematics” and ”Ali will get a good grade.” Express the
statement p → q as a statement in English using ”if p, then q”,
”q when p” and ”q unless + p”.
”If Ali studies discrete mathematics, then he will get a good grade.”.
”Ali will get a good grade when he studies discrete mathematics.”
”Ali will get a good grade unless he does not study discrete
mathematics”

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 16 / 85


Propositional Logic
Conditional Statements

There are three related conditional statements that occur so often that
they have special names:
The converse of p → q is the preposition q → p.
The contrapositive of p → q is the preposition + q →+ p.
The inverse of p → q is the preposition + p →+ q.

Only the contrapositive always has the same truth value as p → q.


The converse and the inverse of a conditional statement are also
equivalent [check that], but neither is equivalent to the original
conditional statement.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 17 / 85


Propositional Logic
Conditional Statements

Example: What are the contrapositive, the converse, and the


inverse of the conditional statement ”The home team wins whenever
it is raining?”
.
Because ”q whenever p” is one of the ways to express the
conditional statement ”p → q, the original statement can be
rewritten as ”If it is raining, then the home team wins”.
Consequently,
The contrapositive is: ”If the home team does not win, then it is
not raining.”
The converse is: ”If the home team wins, then it is raining.”
The inverse is: ”If it is not raining, then the home team does not
win.”
Only the contrapositive is equivalent to the original statement.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 18 / 85
Propositional Logic
Biconditional Statements

Biconditional Statement
Let p and q be propositions. The biconditional statement p ↔ q is the
proposition ”p if and only if q.” The biconditional statement p ↔ q is
true when p and q have the same truth values, and is false otherwise.
Biconditional statements are also called bi-implications.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 19 / 85


Propositional Logic
Biconditional Statements

The statement p ↔ q is true when both the conditional statements


p → q and q → p are true and is false otherwise.
There are some other common ways to express p ↔ q: ”p is
necessary and sufficient for q”, ”if p then q, and conversely” and ”p
iff q”.
As we will take later, you will find that p ↔ q has exactly the same
truth table as (p → q) ∧ (q → p).

Example: Let p be the statement ”You can take the flight” and let
q be the statement ”You buy a ticket.” Then p ↔ q is the
statement ”You can take the flight if and only if you buy a ticket.”
This statement is true if p and q are either both true or both false, that
is, if you buy a ticket and can take the flight or if you do not buy a ticket
and you cannot take the flight. It is false when p and q have opposite
truth values.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 20 / 85
Propositional Logic
Precedence of Logical Operators

The operators have the following order of precedence:

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 21 / 85


Propositional Logic
Truth Tables of Compound Propositions

Construct the truth table of the compound proposition:

(p∨ + q) → (p ∧ q)

Exercise: repeat for


p →+ (p ∨ q) Ans:[F F T T]
(+ p ∧ q) ↔ (p ∨ q) Ans:[F F T T]

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 22 / 85


Propositional Equivalences
Introduction

The compound propositions are classified according to their possible


truth values to:
Tautology: A compound proposition that is always true, no matter
what the truth values of the propositional variables that occur in it.
Example: p ∨ (+ p)
Contradiction: A compound proposition that is always false
Example: p ∧ (+ p)
Contingency: A compound proposition that is neither a tautology
nor a contradiction
.
Exercise:
What about + (p ∧ q) ↔ (+ p) ∨ (+ q)?.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 23 / 85


Propositional Equivalences
Logical Equivalences

Compound propositions that have the same truth values in all possible
cases are called logically equivalent.
Another Definition
The compound propositions p and q are called logically equivalent if
p ↔ q is a tautology. The notation p ≡ q denotes that p and q are
logically equivalent.
General Remarks:
The symbol ≡ is not a logical connective, and p ≡ q is not a
compound proposition but rather is the statement that p ↔ q is a
tautology.
The symbol ⇔ is sometimes used instead of ≡ to denote logical
equivalence.
The compound propositions p and q are equivalent if and only if the
columns giving their truth values agree.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 24 / 85


Propositional Equivalences
Logical Equivalences

Example: Show that + (p ∨ q) and + p∧ + q are logically


equivalent

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 25 / 85


Propositional Equivalences
Logical Equivalences

Example: Show that p → q and + p ∨ q are logically equivalent

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 26 / 85


Propositional Equivalences
Logical Equivalences

Example: Show that p ∨ (q ∧ r ) and (p ∨ q) ∧ (p ∨ r ) are logically


equivalent. This is the distributive law of disjunction over
conjunction.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 27 / 85


Propositional Equivalences
Logical Equivalences

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 28 / 85


Propositional Equivalences
Logical Equivalences

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 29 / 85


Propositional Equivalences
Logical Equivalences

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 30 / 85


Propositional Equivalences
Logical Equivalences

Example: Show that + (p → q) and p∧ + q are logically


equivalent

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 31 / 85


Propositional Equivalences
Logical Equivalences

Example: Show that + (p ∨ (+ p ∧ q)) and + p∧ + q are


logically equivalent by developing a series of logical equivalences.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 32 / 85


Propositional Equivalences
Logical Equivalences

Example: Show that (p ∧ q) → (p ∨ q) is a tautology.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 33 / 85


Homework due to 24th of Sept.
From the text book, Section 1.1, page 12
Questions: Q1,Q3,Q9 [parts a,c,h], Q16, Q27[part a], Q31[parts a,c,e]
and Q33[part e].

Homework due to 29th of Sept.


From the text book, Section 1.3, page 34
Questions: Q3 [part a],Q5,Q9 [part c], Q10 [only repeat for Q9(c)] and
Q23.
Predicates and Quantifiers
Introduction

”Every computer connected to the university network is functioning


properly.” Is it a proposition?
In this section we will introduce a more powerful type of logic called
predicate logic.
Statements involving variables, such as ”x > 3,” is neither true nor
false when the values of the variables are not specified.
The statement x > 3 has two parts:
The subject: the variable x.
The predicate: ”is greater than 3” refers to a property that the
subject of the statement can have.
We can denote the statement ”x is greater than 3” by P(x), where
P denotes the predicate ”is greater than 3” and x is the variable.
The statement P(x) is also said to be the value of the propositional
function P at x.
Once a value has been assigned to the variable x, the statement
P(x) becomes a proposition and has a truth value.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 35 / 85
Predicates and Quantifiers
Predicates

Example: Let P(x) denote the statement ”x > 3.” What are the
truth values of P(4) and P(2)?
P(4), ”4 > 3”, True.
P(2), ”2 > 3”, False.

Example: Let Q(x, y ) denote the statement ”x = y + 3.” What are


the truth values of the propositions Q(1, 2) and Q(3, 0)?
Q(1, 2), ”1 = 2 + 3”, False.
Q(3, 0), ”3 = 0 + 3”, True.
Exercise:
Let R(x, y , z) denote the statement ”x + y = z”. What are the truth
values of the propositions R(1, 2, 3) and R(0, 0, 1)?

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 36 / 85


Predicates and Quantifiers
Quantifiers

The universal quantification


The universal quantification of P(x) is the statement
”P(x) for all values of x in the domain.”
The notation ∀xP(x) denotes the universal quantification of P(x).
∀ is called the universal quantifier.
We read ∀xP(x) as ”for all xP(x)” or ”for every xP(x)”.
An element for which P(x) is false is called a counterexample of
∀xP(x).

The existential quantification


The existential quantification of P(x) is the proposition
”There exists an element x in the domain such that P(x).”
We use the notation ∃xP(x) for the existential quantification of P(x).
Here ∃ is called the existential quantifier.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 37 / 85
Predicates and Quantifiers
Quantifiers

What are the truth values of the quantification ∀xP(x) for the following
statements:
P(x) is ”x + 1 > x”, D : Real No.’s.
True for all real numbers ⇒ True.
P(x) is ”x < 2”, D : Real No.’s.
P(3) is false. That is, x = 3 is a counterexample for the statement
”∀xP(x)” ⇒ False.
P(x) is ”x 2 > 0”, D : All integers.
We see that x = 0 is a counterexample because x 2 = 0 when x = 0,
so that x 2 is not greater than 0 when x = 0. ⇒ False.
P(x) is ”x 2 < 10”, D : +ve integers not exceeding 4.
∀xP(x) = P(1) ∧ P(2) ∧ P(3) ∧ P(4). Because P(4), which is the
statement ”42 < 10,” is false ⇒ ∀xP(x) is False.
P(x) is ”x 2 ≥ x”, D : Real No.’s
∀x(x 2 ≥ x) is false if the domain consists of all real numbers.
However, its True if the domain consists of the integers No’s only.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 38 / 85
Predicates and Quantifiers
Quantifiers

What are the truth values of the quantification ∃xP(x) for the following
statements:
P(x) is ”x > 3”, D : Real No.’s.
Because ”x > 3” is sometimes true, for instance, when x = 4 ⇒ the
existential quantification of P(x) is True.
P(x) is ”x = x + 1”, D : Real No.’s.
Because P(x) is false for every real number x ⇒ the existential
quantification of P(x) is False.
P(x) is ”x 2 > 10”, D : +ve integers not exceeding 4.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 39 / 85


Predicates and Quantifiers
Quantifiers

What are the truth values of the quantification ∃xP(x) for the following
statements:
P(x) is ”x > 3”, D : Real No.’s.
Because ”x > 3” is sometimes true, for instance, when x = 4 ⇒ the
existential quantification of P(x) is True.
P(x) is ”x = x + 1”, D : Real No.’s.
Because P(x) is false for every real number x ⇒ the existential
quantification of P(x) is False.
P(x) is ”x 2 > 10”, D : +ve integers not exceeding 4.
∃xP(x) = P(1) ∨ P(2) ∨ P(3) ∨ P(4). Because P(4), which is the
statement ”42 > 10,” is True ⇒ ∃xP(x) is True.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 39 / 85


Predicates and Quantifiers
Quantifiers

The uniqueness quantification


The uniqueness quantifier of P(x) is the statement
”There exists a unique x such that P(x) is true.”
The notation ∃!xP(x) or ∃1 xP(x) denotes the uniqueness quantification
of P(x).
Example: ∃1 x(x − 1 = 0) with D : is the set of real numbers is a True
statement.

Quantifiers with Restricted Domains


The domain of a quantifier can be restricted in an abbreviated form by
using a condition on the variable that is included after the quantifier.
Example: ∀x < 0(x 2 > 0) states that ”The square of a negative real
number is positive.”
This statement is the same as ∀x(x < 0 → x 2 > 0).

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 40 / 85


Predicates and Quantifiers
Precedence of Quantifiers

The quantifiers ∀ and ∃ have higher precedence than all logical


operators from propositional calculus.
Example: ∀xP(x) ∨ Q(x) is the disjunction of ∀xP(x) and Q(x).
In other words, it means (∀xP(x)) ∨ Q(x) rather than
∀x(P(x) ∨ Q(x)).

Logical Equivalences Involving Quantifiers


Statements involving predicates and quantifiers are logically equivalent if
and only if they have the same truth value no matter which predicates
are substituted into these statements and which domain of discourse is
used for the variables in these propositional functions. We use the
notation S ≡ T to indicate that two statements S and T involving
predicates and quantifiers are logically equivalent.
Example: ∀x(P(x) ∧ Q(x)) ≡ ∀xP(x) ∧ ∀xQ(x)

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 41 / 85


Predicates and Quantifiers
Negating Quantified Expressions

+ ∀xP(x) ≡ ∃x + P(x)

Let P(x) denotes the statement ”x knows Java programming”, and


let the universe of discourse be all the students in your class.
∀xP(x) means all the students in your class know Java
programming.
The negation: ”not all the students in your class know Java
programming”.
Or: ”there exists at least one student in your class who does not
know Java programming”.
This is equivalent to ∃x + P(x)

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 42 / 85


Predicates and Quantifiers
Negating Quantified Expressions

+ ∃xP(x) ≡ ∀x + P(x)

Let P(x) denotes the statement ”x knows Java programming”, and


let the universe of discourse be all the students in your class.
∃xP(x) means there exists at least one student in your class who
knows Java programming.
The negation: ”all the students in your class do not know Java
programming”.
This is equivalent to ∀x + P(x)

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 43 / 85


Predicates and Quantifiers
Negating Quantified Expressions

+ ∃xP(x) ≡ ∀x + P(x)

Let P(x) denotes the statement ”x knows Java programming”, and


let the universe of discourse be all the students in your class.
∃xP(x) means there exists at least one student in your class who
knows Java programming.
The negation: ”all the students in your class do not know Java
programming”.
This is equivalent to ∀x + P(x)

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 43 / 85


Predicates and Quantifiers
Negating Quantified Expressions

Example: What are the negations of the statements ∀x(x 2 > x)


and ∃x(x 2 = 2)?
The negation of ∀x(x 2 > x) is + ∀x(x 2 > x).
This is equivalent to ∃x + (x 2 > x).
This can be written as ∃x(x 2 ≤ x).
The negation of ∃x(x 2 = 2) is + ∃x(x 2 = 2).
This is equivalent to ∀x + (x 2 = 2).
This can be written as ∀x(x 2 6= 2).
Exercise:
Show that + ∀x(P(x) → Q(x)) and ∃x(P(x)∧ + Q(x)) are logically
equivalent.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 44 / 85


Nested Quantifiers
Introduction

Nested Quantifiers
Its the statements that have one Quantifier within the scope of another.
Examples:
∀x∃y P(x, y )
”For all x, there exists a y such that P(x, y ).”
Example: ∀x∃y (x + y = 0).
∃x∀y P(x, y )
”There exists an x, such that for all y P(x, y ) is true.”
Example: ∃x∀y (x ∗ y = 0).

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 45 / 85


Nested Quantifiers
Understanding Statements Involving Nested Quantifiers

Example: Translate the following statements into English where the


domain is all the real numbers:
∀x∃y (x + y = 0)
Every real number has an additive inverse.
∀x∀y ((x > 0) ∧ (y < 0) → (xy < 0))
The product of a positive real number and a negative real number is
always a negative real number.
∀x∀y (x + y = y + x)
This is the commutative law for addition of real numbers.
∀x∀y ∀z(x + (y + z) = (x + y ) + z)
This is the associative law for addition of real numbers.
∀x∃y (((x ≥ 0) ∧ (y < 0)) → (x − y > 0))
A non-negative number minus a -ve number is greater than zero.
∃x∃y (((x ≤ 0) ∧ (y ≤ 0)) ∧ (x − y > 0))
The difference between two non-positive numbers is not necessarily
non-positive (i.e. can be +ve)
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 46 / 85
Nested Quantifiers
Understanding Statements Involving Nested Quantifiers

Exercise:
∀x∀y (((x 6= 0) ∧ (y 6= 0)) ↔ (xy 6= 0))
Example: Translate the following English statement into logical
expression:
”The sum of two positive integers is always positive”.
We first rewrite the sentence ”For every two integers, if these integers
are both positive, then the sum of these integers is positive.”
Next, we introduce the variables x and y to obtain ”For all positive
integers x and y , x + y is positive.”
Consequently, we can express this statement as:
∀x∀y ((x > 0) ∧ (y > 0) → (x + y > 0)), where the domain consists
of all integers.
If the domain is all positive integers, then the statement can be
written as ”For every two positive integers, the sum of these integers
is positive”, and can be expressed mathematically as:
∀x∀y (x + y > 0).

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 47 / 85


Nested Quantifiers
Understanding Statements Involving Nested Quantifiers

Example: Translate the following English statement into logical


expression:
”Every real number except zero has a multiplicative inverse”.
We first rewrite the sentence ”For every real number x except zero, x
has a multiplicative inverse.”
Next, we introduce the variables x and y to obtain ”For every real
number x, if x 6= 0, then there exists a real number y such that
xy = 1.”
Consequently, we can express this statement as:
∀x((x 6= 0) → ∃y (xy = 1)).

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 48 / 85


Nested Quantifiers
Translating English Sentences into Logical Expressions

Example: Translate the following English statement into into logical


expression:
”Any student either has a computer or has a friend that has a
computer. ”.
”For any student x, x has a computer or there is some student y
where y has a computer and x and y are friends.”
Consequently, we can express this statement as:
∀x(C (x) ∨ ∃y [C (y ) ∧ F (x, y )]).
where:
C (x) is ”x has a computer”.
F (x, y ) is ”x and y are friends”.
Universe of discourse for x and y is all students.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 49 / 85


Nested Quantifiers
The Order of Quantifiers

The order of the quantifiers is important unless all the quantifiers


are universal quantifiers or all are existential quantifiers.
The order of nested universal quantifiers (or existential quantifiers)
in a statement without other quantifiers can be changed without
changing the meaning of the quantified statement.
Example: ∀x∀y (x + y = y + x) ≡ ∀y ∀x(x + y = y + x).
The order in which quantifiers appear when there is different types
makes a difference.
Example: the statements ∃x∀y (x + y = 0) and ∀x∃y (x + y = 0)
are not logically equivalent. (WHY??)
Exercise:
Let Q(x, y , z) be the statement ”x + y = z”. What are the truth
values of the statements ∀x∀y ∃zQ(x, y , z) and ∃z∀x∀yQ(x, y , z),
where the domain of all variables consists of all real numbers?

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 50 / 85


Nested Quantifiers
The Order of Quantifiers

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 51 / 85


Nested Quantifiers
Negating Nested Quantifiers

Statements involving nested quantifiers can be negated by


successively applying the rules for negating statements involving a
single quantifier.
Example #1:
+ ∀x∃y (xy = 1)
≡ ∃x + ∃y (xy = 1)
≡ ∃x∀y + (xy = 1)
≡ ∃x∀y (xy 6= 1)
Example #2:
+ ∀x∃y ∀zP(x, y , z)
≡ ∃x + ∃y ∀zP(x, y , z)
≡ ∃x∀y + ∀zP(x, y , z)
≡ ∃x∀y ∃z + P(x, y , z)

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 52 / 85


Rules of Inference
Valid Arguments in Propositional Logic

A correct (deductive) proof is to establish that


If the conditions are true then the conclusion is true.
i.e., Conditions → conclusion is a tautology

Argument
An argument in propositional logic is a sequence of propositions. All but
the final proposition in the argument are called premises and the final
proposition is called the conclusion. An argument is valid if the truth of
all its premises implies that the conclusion is true.

Argument form
An argument form in propositional logic is a sequence of compound
propositions involving propositional variables. The conclusion is true if
the premises are all true.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 53 / 85


Rules of Inference
Valid Arguments in Propositional Logic

Ex. Determine whether the following argument is valid


”If you have a current password, then you can log onto the network.”
”You have a current password.”
Therfore
”You can log onto the network.”
Task: determine whether the conclusion must be true when the
premises are both true.
Use p to represent ”You have a current password” and q to
represent ”You can log onto the network.”
Then, the argument has the form

where ∴ is the symbol that denotes ”therefore”.


The statement ((p → q) ∧ p) → q is a tautology [modus ponens].
In particular, When both p → q and p are true, we know that q
must also be true and hence the argument is valid.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 54 / 85
Rules of Inference
Rules of Inference for Propositional Logic

Valid argument form


The argument form with premises p1 , p2 , · · · , pn and conclusion q is
valid, when (p1 ∧ p2 ∧ · · · ∧ pn ) → q is a tautology.

We can always use a truth table to show that an argument form is


valid. However, this can be a tedious approach.
Instead, we can first establish the validity of some relatively simple
argument forms, called rules of inference.
These rules of inference can be used as building blocks to construct
more complicated valid argument forms.
Exercise: Check the validity of the following arguments
((p → q) ∧ (q → r )) → (p → r ).
”If I like DM, I will study it. Either I study DM or I fail the course.
Therefore, If I fail the course, then I do not like DM”.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 55 / 85
Rules of Inference
Rules of Inference for Propositional Logic

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 56 / 85


Rules of Inference
Rules of Inference for Propositional Logic

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 57 / 85


Rules of Inference
Rules of Inference for Propositional Logic

State which rule of inference is the basis of the following arguments:


”It is below freezing now. Therefore, it is either below freezing or
raining now.”
Let p be the proposition ”It is below freezing now” and q the
proposition ”It is raining now.” Then this argument is of the form

[the addition rule].


”It is below freezing and raining now. Therefore, it is below freezing
now.”
Let p be the proposition ”It is below freezing now” and q the
proposition ”It is raining now.” Then this argument is of the form

[the simplification rule].

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 58 / 85


Rules of Inference
Rules of Inference for Propositional Logic

State which rule of inference is the basis of the following argument:


”If it rains today, then we will not have a barbecue today. If we do
not have a barbecue today, then we will have a barbecue tomorrow.
Therefore, if it rains today, then we will have a barbecue tomorrow.”
Let p be the proposition ”It is raining today,” let q be the
proposition ”We will not have a barbecue today,” and let r be the
proposition ”We will have a barbecue tomorrow.” Then this
argument is of the form

[hypothetical syllogism].

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 59 / 85


Rules of Inference
Using Rules of Inference to Build Arguments

Example: Show that the premises ”It is not sunny this afternoon and it
is colder than yesterday,” ”We will go swimming only if it is sunny,” ”If
we do not go swimming, then we will take a canoe trip,” and ”If we take
a canoe trip, then we will be home by sunset” lead to the conclusion
”We will be home by sunset.”

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 60 / 85


Rules of Inference
Using Rules of Inference to Build Arguments

Example: Show that the premises ”If you send me an e-mail message,
then I will finish writing the program,” ”If you do not send me an e-mail
message, then I will go to sleep early,” and ”If I go to sleep early, then I
will wake up feeling refreshed,” lead to the conclusion ”If I do not finish
writing the program, then I will wake up feeling refreshed.”

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 61 / 85


Rules of Inference
Using Rules of Inference to Build Arguments

Example: Show that the premises ”Gary is either intelligent or a good


actor,” ”If Gary is intelligent, then he can count from 1 to 10,” and
”Gary can only count from 1 to 3,” lead to the conclusion ”Gary is a
good actor.”

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 62 / 85


Rules of Inference
Rules of Inference for Quantified Statements

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 63 / 85


Rules of Inference
Rules of Inference for Quantified Statements

Example: Show that the premises ”A student in this class has not read
the book,” and ”Everyone in this class passed the first exam,” lead to the
conclusion ”Someone who passed the first exam has not read the book.”

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 65 / 85


Rules of Inference
Combining Rules of Inference for Propositions and Quantified Statements

Universal modus ponens

Universal modus tollens

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 66 / 85


Rules of Inference
Combining Rules of Inference for Propositions and Quantified Statements
Example: Assume that ”For all positive integers n, if n is greater than 4,
then n2 is less than 2n ” is true. Use universal modus ponens to show
that 1002 < 2100 .

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 67 / 85


Rules of Inference

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 68 / 85


Homework due to 6th of Oct.
From the text book, Section 1.4, page 53
Questions: Q2,Q4, Q12[parts e,f], Q14[parts c,d], and Q18.
From the text book, Section 1.5, page 64
Questions: Q2,Q4 [parts a,d,f], Q24 [part a], Q26[parts e,g,h],
Q28[parts f,h,j] and Q30[part a,c,e].
From the text book, Section 1.6, page 78
Questions: Q10[parts a,c,e], Q14[parts a,c] , Q16[parts a,c], Q24, and
Q28.
Introduction to Proofs
Introduction

Proof
is a valid argument that establishes the truth of a mathematical
statement.
A proof can use the hypotheses of the theorem, if any, axioms assumed
to be true, and previously proven theorems.

Types of Proofs:
Formal proofs [Used by computer programs]: show that
statements involving propositions and quantified statements are true
by supplying all the steps and giving the rules for each step in the
argument.
Informal proofs [Used by humans]: more than one rule of inference
may be used in each step, where steps may be skipped, where the
axioms being assumed and the rules of inference used are not
explicitly stated.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 70 / 85


Introduction to Proofs
Methods of Proving Theorems / Direct proof

Direct proof
showing that a conditional statement p → q is true by showing that if p
is true, then q must also be true, so that the combination p true and q
false never occurs.
Give a direct proof of the following theorems:
”If n is an odd integer, then n2 is odd”.
Assume n is odd ⇔ n = 2k + 1, where k is an integer.
n2 = (2k + 1)2
= (4k 2 + 4k + 1) = 2(2k 2 + 2k) + 1 = 2k̀ + 1
Since n2 can be written in this form, it is odd.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 71 / 85


Introduction to Proofs
Methods of Proving Theorems / Direct proof

Give a direct proof of the following theorems:


”If m and n are both perfect squares, then nm is also a perfect
square. (An integer a is a perfect square if there is an integer b such
that a = b 2 .)”.
Assume that n and m are perfect squares ⇔ n = t 2 and m = s 2 ,
where s and t are integers.
mn = s 2 t 2
= (ss)(tt) = (st)(st) = (st)2 [using commutativity and
associativity of multiplication]
Since mn can be written in this form, it is a perfect square.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 72 / 85


Introduction to Proofs
Methods of Proving Theorems / Indirect proof

Proof by Contraposition
make use of the fact that the conditional statement p → q is equivalent
to its contrapositive, + q →+ p.
Give an indirect proof of the following:
”if n is an integer and 3n + 2 is odd, then n is odd.”.
Assume that the conclusion q of this implication is false (n is even).
Then use rules of inference and known theorems to show that the
hypothesis p must also be false (3n + 2 is even).
n is even ⇔ n = 2k where k is an integer.
⇒ 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1) = 2k̀
Therefore 3n + 2 is even.
We have shown that the contrapositive of the implication is true, so
the implication itself is also true (If 3n + 2 is odd, then n is odd).
Exercise show that ”if m + n > 50 then m > 25 or n > 25” where m
and n are integers.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 73 / 85
Introduction to Proofs
Methods of Proving Theorems / Indirect proof

Proof by Contradiction
reveal that p is true if we can show that + p → (r ∧ + r ) is true for
some proposition r .
Way: assume + q and p and then deduce any contradiction.
Give an indirect proof of the following:
”if the square of an integer number is odd, then the integer is odd.”
Assume that the hypothesis p of this implication is true and the
conclusion q is false (n is even). Then use rules of inference and
known theorems to deduce contradiction.
Assume n2 is odd and n is not odd (even).
⇒ n = 2k
⇒ n2 = 4k 2 = 2(2k 2 )
Therefore n2 is even and is also odd by the assumption.
We have a contradiction.
Exercise show that ”if 3n + 2 is odd, then n is odd”.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 74 / 85
Introduction to Proofs
Proofs of Equivalence

Prove the theorem:


”If n is an integer, then n is odd if and only if n2 is odd.”
This theorem has the form ”p if and only if q”, where p is ”n is
odd” and q is ”n2 is odd.”
To prove this theorem, we need to show that p → q and q → p are
true.
Because we have shown that both p → q and q → p [refer to the
last examples], we have shown that the theorem is true.

To prove that a group of statements are equivalent, we can establish any


chain of conditional statements we choose as long as it is possible to
work through the chain to go from any one of these statements to any
other statement. For example, we can show that p1 , p2 , and p3 are
equivalent by showing that p1 → p3 , p3 → p2 , and p2 → p1 .

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 75 / 85


Introduction to Proofs
Proofs of Equivalence

Show that these statements about the integer n are equivalent:


p1 : n is even. p2 : n − 1 is odd. p3 : n2 is even.
We can show that these three statements are equivalent by showing
that the conditional statements p1 → p2 , p2 → p3 , and p3 → p1 are
true.
p1 → p2 [Direct proof]: n is even ⇒ n = 2k for some integer k
⇒ n − 1 = 2k − 1 = 2(k − 1) + 1
⇒ n − 1 is odd.
p2 → p3 [Direct Proof]: n − 1 is odd ⇒ n − 1 = 2k + 1 for some
integer k
⇒ n = 2k + 2 and n2 = (2k + 2)2 = 4k 2 + 8k + 4 = 2(2k 2 + 4k + 2)
⇒ n2 is even.
p3 → p1 [Proof by Contraposition]: is equivalent to show that n is
odd → n2 is odd (We proved this before).
This completes the proof.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 76 / 85
Introduction to Proofs
Mistakes in Proofs

Every step is valid except for one, step 5 where we divided both sides by
a − b. The error is that a − b equals zero; division of both sides of an
equation by the same quantity is valid as long as this quantity is not zero.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 77 / 85


Proof Methods and Strategy
Exhaustive Proof and Proof by Cases

Proof by cases
The original conditional statement with a hypothesis made up of a
disjunction of the propositions p1 , p2 , · · · , pn can be proved by proving
each of the n conditional statements pi → q, i = 1, 2, · · · , n, individually.

To prove a conditional statement of the form


p1 ∨ p2 ∨ · · · pn → q,
the tautology
[(p1 ∨ p2 ∨ · · · pn ) → q] ↔ [(p1 → q) ∧ (p2 → q) ∧ · · · (pn → q)]
can be used as a rule of inference.

Exhaustive proof
Proving by exhausting all possibilities [normally applicable when there is
small number of possibilities].

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 78 / 85


Proof Methods and Strategy
Exhaustive Proof and Proof by Cases

EX. Prove that (n + 1)3 ≥ 3n if n is positive integer with n ≤ 4.


Using the method of exhaustion, we can verify that for the possible
values of n = 1, 2, 3, 4 that (n + 1)3 ≥ 3n .
Exercise: Prove that the only consecutive positive integers not exceeding
50 that are perfect powers are 8 and 9. (An integer is a perfect power if
it equals na , where a is an integer greater than 1.)
EX. Prove that if n is an integer, then n2 ≥ n using proof by cases.
We can prove that n2 ≥ n for every integer by considering three cases,
when n = 0, when n ≥ 1, and when n ≤ −1.
Case(i): n = 0 ⇒ 02 = 0 ⇒ n2 ≥ n for this case.
Case(ii): n ≥ 1 ⇒ n.n ≥ 1.n ⇒ n2 ≥ n for this case.
Case(iii): n ≤ −1 ⇒ n2 ≥ 0 ⇒ n2 ≥ n for this case.
Because the inequality holds in all three cases, we can conclude that if n
is an integer, then n2 ≥ n.
Exercise: Use a proof by cases to show that |xy | = |x||y |, where x and y
are real numbers.[WLOG]
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 79 / 85
Proof Methods and Strategy
Exhaustive Proof and Proof by Cases

EX. Show that if x and y are integers and both xy and x + y are even,
then both x and y are even.
We can proof using the proof by contraposition and the notion of
(without loss of generality (WLOG)) and by proof by cases.
First, suppose that x and y are not both even, that is x is odd or y is
odd or both are odd.
WLOG, assume that x is odd, ⇒ x = 2m + 1 for some integer m.
To complete the proof we need to show that xy or x + y is odd. We have
two cases:
Case(i): y is even ⇒ y = 2n ⇒ x + y = (2m + 1) + 2n = 2(m + n) + 1
is odd.
Case(ii): y is odd
⇒ y = 2n + 1 ⇒ xy = (2m + 1) ∗ (2n + 1) = 2(2mn + m + n) + 1 is odd.
which completes the proof.
Note: WLOG means the inclusion of the case when y is assumed to be
odd and then consider the two cases of x.
Discrete Mathematics - Ch.1 Dr. Musbah Shaat 81 / 85
Proof Methods and Strategy
Existence Proofs

Existence Proofs
A proof of a proposition of the form ∃xP(x).

A Constructive Existence Proof


finding an element a, called a witness, such that P(a) is true.

A Nonconstructive Existence Proof


we do not find an element a such that P(a) is true, but rather prove that
∃xP(x) is true in some other way.
EX. Show that there is a positive integer that can be written as the sum
of cubes of positive integers in two different ways.
After considerable computation (such as a computer search) we find that
1729 = 103 + 93 = 123 + 13 .

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 82 / 85


Proof Methods and Strategy
Uniqueness Proofs

Uniqueness Proofs
Show that an element with a given property exists and that no other
element has this property.
Existence: We show that an element x with the desired property exists.
Uniqueness: We show that if y 6= x, then y does not have the desired
property.
Equivalently, we can show that if x and y both have the desired
property, then x = y .
EX. Show that if a and b are real numbers and a 6= 0, then there is a
unique real number r such that ar + b = 0.

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 83 / 85


Proof Methods and Strategy
FORWARD AND BACKWARD REASONING

EX. Show that for any two distinct real numbers x and y , the arithmetic

mean (x + y )/2 is always greater than the geometric mean xy .

Discrete Mathematics - Ch.1 Dr. Musbah Shaat 84 / 85


End of Chapter # 1

You might also like