0% found this document useful (0 votes)
8 views40 pages

Lecture 4

The document is a lecture on Discrete Mathematics focusing on logic and proofs, prepared by Dr. Heba Askr for the University of Sadat City. It covers key topics such as propositional logic, methods of proving theorems, and common mistakes in proofs, providing examples and strategies for both direct and indirect proofs. The lecture emphasizes the importance of proofs in various applications, including computer science and artificial intelligence.

Uploaded by

yasmeensamir2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views40 pages

Lecture 4

The document is a lecture on Discrete Mathematics focusing on logic and proofs, prepared by Dr. Heba Askr for the University of Sadat City. It covers key topics such as propositional logic, methods of proving theorems, and common mistakes in proofs, providing examples and strategies for both direct and indirect proofs. The lecture emphasizes the importance of proofs in various applications, including computer science and artificial intelligence.

Uploaded by

yasmeensamir2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

University of Sadat City

Faculty of Computers and Artificial Intelligence (FCAI)

Discrete Mathematics
(MA102)
Lecture 4 (For AI and IS programs)
Prepared By:
Dr. Heba Askr
Information Systems Department
2020-2021
1
Chapter 1: Logic and Proofs

Topics
▪ Propositional logic
▪ Predicates and Quantifiers
▪ Rules of Inference and Proofs

2
Outline
• What is a Proof ?
• Methods of Proving
• Common Mistakes in Proofs
• Strategies : How to Find a Proof ?

3
Introduction to Proofs
A proof is a valid argument that establishes the truth of
a statement (as the conclusion).

Statements in a proof can include the axioms (something


assumed to be true), the premises, and previously proved
theorems.
Proofs have many practical applications:
• Verification that computer programs are correct
• Establishing that operating systems are secure
• Enabling programs to make inferences in AI
• More …

4
Introduction to Proofs
Related Terminology

Theorem

Lemma

corollary

conjecture

5
Introduction to Proofs
Related Terminology
• A theorem (major result) is a statement that can be shown to be
true using:
– definitions
– other theorems
– axioms (statements which are given as true)
– rules of inference

• A lemma
• is a ‘helping theorem’ or a result which is needed to prove a
theorem.
• is a theorem that is not very important. we sometimes prove a
theorem by a series of lemmas

6
Introduction to Proofs
Related Terminology cont.
• A corollary is a result which follows directly from a theorem.

• A conjecture is a statement that is being proposed to be true.


Once a proof of a conjecture is found, it becomes a theorem.
Many times conjectures are shown to be false, so they are not
theorems.

7
Introduction to Proofs
Proving Theorems
• Many theorems have the form:

• To prove them, we show that where c is an


arbitrary element of the domain,
• By universal generalization, the truth of the
original formula follows.
• So, we must prove something of the form:

8
Introduction to Proofs
Methods of Proofs

1. Direct Proofs

2. Indirect Proofs
• proof by contraposition.
• Proof by Contradiction.

9
Introduction to Proofs
Methods of Proof (Direct Proofs)
• A direct proof of a conditional statement p → q

First assumes that p is true, and uses axioms,


definitions, previously proved theorems, with rules
of inference, to show that q is also true.

10
Introduction to Proofs
Methods of Proof (Direct Proofs cont.)
Even and Odd Integers
Definition:
The integer n is even if there exists an integer k such that n = 2k, and
n is odd if there exists an integer k, such that n = 2k + 1.

• Note that every integer is either even or odd and no integer is both
even and odd.

• We will need this basic fact about integers in some of the example
proofs to follow.
11
Introduction to Proofs
Methods of Proof (Direct Proofs cont.)
Direct Proof (Example 1)
Give a direct proof of the theorem “If n is an odd
integer, then n2 is odd.”
Proof
Assume that n is an odd integer. This implies
that there is some integer k such that
n = 2k + 1. r
Then n2 = (2k+1)2 = 4k2 + 4k + 1 = 2(2k2 + 2k) + 1
= 2 r +1, (where r is an integer) Thus, n2 is odd.
12
Introduction to Proofs
Methods of Proof (Direct Proofs cont.)
Direct Proof (Example 2)
Give a direct proof of “if m and n are both square
numbers, then mn is also a square number.”
Proof
Assume that m and n are both squares. This implies
that there are integers u and v such that
m = u2 and n = v2.
Then mn = u2 v2 = (uv)2. Thus, mn is a square.

13
Introduction to Proofs
Methods of Proof (Direct Proofs cont.)

Definition: The real number r is rational if there


exist integers p and q where q≠0 such that r = p/q

14
Introduction to Proofs
Methods of Proof (Direct Proofs cont.)
Direct Proof (Example 3)
Prove that the sum of two rational numbers
is rational.
Proof

Where =
= ≠0

Thus the sum is rational.

15
Introduction to Proofs
Methods of Proof (Indirect Proofs)
• Indirect Proofs : Proofs that are not direct proofs,
that do not start with the premises and end with
the conclusion.
• Examples of Indirect Proofs :
1. Proof by Contraposition
2. Proof by Contradiction

16
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proving Conditional Statements: p → q using
indirect proofs
• The proof by contraposition method makes
use of the equivalence
p→q   q→ p

• To show that the conditional statement p → q


is true, we first assume  q is true, and use
axioms, definitions, proved theorems, with
rules of inference, to show  p is also true
17
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proof by Contraposition
Prove that if n is an integer and 3n + 2 is odd, then n is odd.

Can this statement be proved by direct proof ?????

Assume that 3n + 2 is an odd integer.


3n + 2 = 2k + 1 for some integer k.
Can we use this fact to show that n is odd?
We see that 3n + 1 = 2k, n = (2k-1)/3but there does not
seem to be any direct way to conclude that n is odd.
Because direct proof failed, we next try a proof by contraposition

18
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proof by Contraposition (Example 1)
Prove that if n is an integer and 3n + 2 is odd, then n is odd.
Remember p → q   q → p
Proof Assume  q is true to prove that  p is true
q
Assume that n is even. This implies that n = 2k for some integer k.
Then, 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1),
Therefore 3n + 2 is even. p
Since we have shown ¬q → ¬p , p → q must hold as well. If n is
an integer and 3n + 2 is odd (not even) , then n is odd (not even).

19
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proof by Contraposition (Example 2)
Prove by contraposition that for an integer n,
if n2 is odd, then n is odd.
Proof
Assume n is even (i.e., not odd). Therefore, there exists an integer
k such that n = 2k. Hence,
n2 = 4k2 = 2 (2k2)
and n2 is even(i.e., not odd).
We have shown that if n is an even integer, then n2 is even.
Therefore by contraposition, for an integer n, if n2 is odd, then n is
odd.
20
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
• The proof by contradiction method makes use
of the equivalence
p   p→q
where q is any contradiction.

21
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Explanation of the previous slide
p   p→q
where q is any contradiction.
• Because a contradiction q is false, but ¬p → q is
true, we can conclude that ¬p is false, which
means that p is true. p q p→q
T T T
T F F
F T T
F F T

22
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
p   p→q
One way to show that as follows:
• To construct a proof by contradiction, we assume
that both p and ¬q are true.
• If both p and ¬p or q and ¬q are true, then we
have a contradiction and the proof by
contradiction is complete.

23
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proof by contradiction (Example)
Give a proof by contradiction of the theorem
“If 3n +2 is odd, then n is odd.”
Proof Remember
Let p be “3n + 2 is odd” and q be “n is odd.” P   p →q
Assume that p and ¬q is true. This implies that n is even and n = 2k
for some integer k, so that 3n + 2 = 3(2k) + 2 = 2(3k + 1).
Thus, 3n + 2 is even.
A contradiction occurs (where ?)
Because both p and ¬p are true and q and ¬q are also true , we
have a contradiction.
so the original statement is true by proving by contradiction
24
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proofs of Equivalence (Theorems that are
Biconditional Statements)
• When proving bi-conditional statement, we may make use of the
equivalence pq(p→q)(q→p)

• In general, when proving several propositions are equivalent, we


can use the equivalence
p1  p2  …  pk  ( p1 → p2 )  ( p2 → p3 )  …  ( pk → p1 )

25
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proofs of Equivalence (Theorems that are
Biconditional Statements)
Proofs of Equivalence (Example)
• Show that the following statements about the integer n are
equivalent :
p := “n is even”
q := “n –1 is odd”
r := “n2 is even”

• To do so, we can show the three propositions p → q, q → r, r → p


are all true.
26
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proofs of Equivalence (Theorems that are
Biconditional Statements)
Proofs of Equivalence (Example) p := “n is even”
q := “n – 1 is odd”
r := “n 2 is even”
We have to prove:
1) If “n is even” then “n – 1 is odd”.
2) If “n – 1 is odd” then “n 2 is even”.
3) If “n 2 is even” then “n is even”.

27
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proofs of Equivalence (Theorems that are
Biconditional Statements)
Proofs of Equivalence (Example) p := “n is even”
q := “n – 1 is odd”
r := “n 2 is even”

We use a direct proof to show that p1→ p2 (p → q).


Suppose that n is even. Then n = 2k for some integer k. Consequently,
n − 1 = 2k − 1 = 2(k − 1) + 1. This means that n − 1 is odd because it is
of the form 2m + 1, where m = k − 1.

28
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proofs of Equivalence (Theorems that are
Biconditional Statements)
Proofs of Equivalence (Example) p := “n is even”
q := “n – 1 is odd”
r := “n 2 is even”

29
Introduction to Proofs
Methods of Proof (Indirect Proofs cont.)
Proofs of Equivalence (Theorems that are
Biconditional Statements)
Proofs of Equivalence (Example) p := “n is even”
q := “n – 1 is odd”
r := “n 2 is even”

To prove p3→ p1 (r → p), we use a proof by contraposition (if n is odd then


n 2 is odd). This is proved in slide 11.

This completes the proof.

30
Introduction to Proofs
Mistakes in Proofs
Example:
What is wrong with this famous supposed “proof” that 1 = 2?
“Proof”: We use these steps, where a and b are two equal positive integers.

Solution: Step 5. a - b = 0 by the premise and division by 0 is


undefined.
31
Introduction to Proofs
Looking Ahead

• If direct methods of proof do not work:


– We may need a clever use of a proof by
contraposition.
– Or a proof by contradiction.

32
Proof Methods and Strategy
Proof by Cases:
A proof by cases must cover all possible cases that arise in a theorem.

• To prove a conditional statement of the form:

• Use the tautology

• Each of the implications is a case.

33
Proof Methods and Strategy
Proof by Cases: Example:
Use a proof by cases to show that n 2 + 1 ≥ 2 n when n is a positive
integer with 1 ≤ n ≤ 4.
Solution:
Case (1): When n = 1, we have 1 2 + 1 >= 21 . It follows that n 2 +1≥ 2n is
true in this case.
Case (2): When n = 2, we have 2 2 + 1 >= 22 . It follows that n 2 +1≥ 2n is
true in this case..
Case (3): When n = 3, we have 3 2 + 1 >= 23 . It follows that n 2 +1≥ 2n is
true in this case.
Case (4): When n = 4, we have 4 2 + 1 >= 24 . It follows that n 2 +1≥ 2n is
true in this case.
So the inequality n 2 + 1 ≥ 2 n holds for all the above cases and the
proof is complete.
34
Proof Methods and Strategy
Existence Proofs :
• Proof of theorems of the form is called an existence proof.

Constructive existence proof:


– Find an explicit value of c, for which P(c) is true.
– Then is true by Existential Generalization (EG).

Example: Show that there is a positive integer that can be written as the sum of cubes of
positive integers in two different ways:

Proof: 1729 is such a number since


1729 = 103 + 93 = 123 + 13

35
Proof Methods and Strategy
Nonconstructive Existence Proofs :
In a nonconstructive existence proof, we assume no c
exists which makes P(c) true.

One common method of giving a nonconstructive


existence proof is to use proof by contradiction.

36
Proof Methods and Strategy
Nonconstructive Existence Proofs cont.:
Example: Show that there exist irrational numbers x and y
such that x y is rational.

Proof: We know that √2 is irrational. Consider the number


√2 √2 . If it is rational, we have two irrational numbers x
and y with x y rational, namely x = √2 and y = √2 .

But if √2 √2 is irrational, then we can let x = √2 √2 and


y = √2 so that x y = (√2 √2 )√2 = √2 (√2 √2) = √2 2 =
2(rational number).

37
Proof Methods and Strategy
Proof Strategies for proving p → q
• Choose a method.
1. First try a direct method of proof.
2. If this does not work, try an indirect method (e.g., try to
prove by contraposition or by contradiction).
• For whichever method you are trying, choose a strategy.
1. First try forward reasoning. Start with the axioms and known
theorems and construct a sequence of steps that end in the
conclusion. Start with p and prove q, or start with ¬q and
prove ¬p.
2. If this doesn’t work, try backward reasoning. When trying to
prove q, find a statement p that we can prove with the
property p → q.

38
Proof Methods and Strategy
Backward Reasoning:
Example:

39
Proof Methods and Strategy
Backward Reasoning:
Solution:

we conclude that x ≠ y and therefor (x + y) ∕ 2 > √xy when x and y are


distinct positive real numbers

40

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy