Rules of Inference & Proofs: Definitions
Rules of Inference & Proofs: Definitions
Rules of Inference & Proofs: Definitions
Unit 3
RULES OF INFERENCE
& PROOFS
Definitions
An Argument in propositional logic is a sequence of
propositions.
All but (except) the final proposition are called premises.
The final proposition is called conclusion.
An argument is valid if the truth of all premises implies that
the conclusion is true.
i.e. (p1 p2 … pn) q is a tautology,
p
Replacing the propositions by
pq propositional variables,
q changes the argument to
ARGUMENT FORM
( p (p → q) ) → q
q
pq
p
Modus Tollens example
Assume you are given the following two statements:
“you will not get a grade”
“if you are in this class, you will get a grade”
Rules of Inference:
Addition & Simplification
Addition: If you know that p is true, then p q will
ALWAYS be true
p
pq
SOLUTION
Let:
p = “It is sunny this afternoon”
q = “it is colder than yesterday”
r = “We will go fishing”
s = “we will take a canoe trip”
t = “we will be home by sunset”
1. ¬p q 1st hypothesis
2. ¬p Simplification using step 1
3. r→p 2nd hypothesis
4. ¬r Modus tollens using steps 2 & 3
5. ¬r → s 3rd hypothesis
6. s Modus ponens using steps 4 & 5
7. s→t 4th hypothesis
8. t Modus ponens using steps 6 & 7
More Rules of Inference
pq pq
Hypothetical Disjunctive
qr p
syllogism syllogism
pr q
p pq
Addition Simplification
pq p
p pq
Conjunction q Resolution pr
pq qr
Summary: Rules of Inference
Example
1. “If it does not rain or if it is not foggy, then I will drive to
Riyadh and I will attend the conference”
( r f) (d c)
2. “If I will drive to Riyadh, then the test will be canceled ”
dt
3. “The test was not canceled”
t
Can you conclude: “It rained (r)?
Example of Proof (ii)
( r f) (d c)
dt
t
r?
1. ¬t 3rd hypothesis
2. d→t 2nd hypothesis
3. ¬d Modus tollens using steps 1 & 2
4. (¬r¬f)→(dc) 1st hypothesis
5. ¬(dc)→¬(¬r¬f) Contrapositive of step 4
6. (¬d¬c)→(rf) DeMorgan’s law and double negation law
7. ¬d¬c Addition from step 3
8. rf Modus ponens using steps 6 & 7
9. r Simplification using step 8
specific constant ?
YES
YES
YES
YES
“Everybody who owns a red car has gotten at least one speeding
ticket”
Can you conclude: “Somebody in this class has gotten a speeding ticket”?
Let C(x) = “x is a student in this class”
Let R(x) = “x owns a red car”
Let T(x) = “x has gotten a speeding ticket”
SOLUTION
C(Mostafa)
R(Mostafa)
x (R(x)→T(x))
???? x (C(x)T(x))
x (C(x)M(x))
x (M(x)→H(x))
x (C(x)H(x))
x (C(x)M(x))
Example of Proof (iv) x (M(x)→H(x))
x (C(x)H(x))
x (C(x)M(x)) x (M(x)→H(x)) → x (C(x)H(x))
Direct Proofs
A direct proof shows 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.
To perform a direct proof of a conditional statement p → q,
assume p is true, and show that q must therefore be true
Example:
Show that the square of an even number is an even number
Rephrased: if n is even, then n2 is even
The integer n is even if there exists an integer k such that n = 2k
The integer n is odd if there exists an integer k such that n = 2k + 1
Solution (Proof)
Assume n is even
Thus, n = 2k, for some k (definition of even numbers)
n2 = (2k)2 = 4k2 = 2(2k2)
As n2 is 2 times an integer, n2 is thus even
Indirect Proofs:
1. Proof by contraposition
Consider an implication: p→q
Its contrapositive (¬q → ¬p ) is logically equivalent to the original
implication; i.e. p → q ¬q → ¬p
Example
If n2 is an odd integer then n is an odd integer
n = 2k-4
3
Umm… ???
n 2k 4
3
n +5 = (2k+1) +5;
3 3
Indirect Proofs:
2. Proof by Contradiction
Vacuous Proof
Consider an implication: p→q
If it can be shown that p is false, then the implication is always
true
By definition of an implication
Trivial Proof
Consider an implication: p→q
If it can be shown that q is true, then the implication is always
true
By definition of an implication
Vacuous Proof Example
Shown that p is false, then the implication
is always true
Example
Use the proof of equivalence to show that
“If n is a positive integer, then n is odd
if and only if n2 is odd”
Solution
Examples
x ¬R(x), where R(x) means x has red hair
Find one person (in the domain) who has red hair
Every positive integer is the square of another
Square root of 5 is 2.236, which is not an integer
Example
Show (prove) that the statement “every positive
integer is the sum of the squares of two integers”
is false
Solution
1. To show that this statement is false, we look for a
counterexample, which is a particular integer that is
not the sum of the squares of two integers
2. The integer 3 cannot be written as the sum of the
squares of two integers
3. Consequently, we have shown that Every positive
integer is the sum of the squares of two integers is
false