Rules of Inference
CS 111
Nature & Importance of Proofs
• In mathematics, a proof is:
– A sequence of statements that form an argument.
– Must be correct (well-reasoned, logically valid) and complete (clear, detailed) that rigorously & undeniably establishes the truth of a mathematical statement.
• Why must the argument be correct & complete? – Correctness prevents us from fooling ourselves.
Rules of Inference
•
Rules of inference are patterns of logically
valid deductions from hypotheses to
conclusions
.
• “If you have a current password, then you can log onto the network”
• “You have a current password”
therefore
• “You can log onto the network”
Inference Rules - General Form
•
Inference Rule
–
– Pattern establishing that if we know that a set of
hypotheses are all true, then a certain related
conclusion statement is true.
Hypothesis 1
Hypothesis 2 …
Inference Rules & Implications
•
Each logical inference rule corresponds to an
implication that is a tautology.
•
Hypothesis 1
Inference rule
Hypothesis 2 …
conclusion
•
Corresponding tautology:
((Hypoth. 1) (Hypoth. 2) …) conclusion
Modus Ponens
p
p
q (p
(p
q))
q
q
You have a current password
If you have a current password, then you can log onto the network
_________________________________
Modus Tollens
q
p
q (
q
(p
q))
q
p
• “You cannot log onto the network”
• “If you have a current password, then you can log onto the network”
therefore
• “You have not a current password”
Some Inference Rules
p
Rule of Addition
p
q
“It is cloudy now. Therefore, it is either cloudy or raining now.”
p
q
Rule of Simplification
Some Inference Rules
p q
pq
Rule of Conjunction
01/06/2021 L.Niepel 2016 9
• “It is cloudy.
• It is raining now.
Syllogism Inference Rules
p
q
Rule of hypothetical
q
r
syllogism
p
r
p
q
Rule of disjunctive
p
syllogism
Resolution Inference Rule
p
∨
q
¬
p
∨
r
∴
q
∨
r
The rule is based on the tautology:
((p
∨
q)
∧
(
¬
p
∨
r))
→
(q
∨
r)
This rule is frequently used in automatic proving
of theorems
Formal Proofs
• A formal proof of a conclusion C, given premises
p1, p2,…,pn consists of a sequence of steps, each of which applies some inference rule to premises or to previously-proven statements (as hypotheses) to yield a new true statement (the conclusion).
• A proof demonstrates that if the premises are true,
Formal Proof – Example 1
• Suppose we have the following premises:
“It is not sunny and it is cold.”
“if it is not sunny, we will not swim”
“If we do not swim, then we will canoe.” “If we canoe, then we will be home early.”
• Given these premises, prove the theorem
“We will be home early” using inference rules.
Proof Example 1
cont.
•
Let us adopt the following abbreviations:
sunny = “It is sunny”; cold = “It is cold”;
swim = “We will swim”; canoe = “We will canoe”; early = “We will be home early”.
•
Then, the premises can be written as:
(1)
sunny
cold
(2)
sunny
swim
(3)
swim
canoe
(4) canoe
early
Proof Example 1
cont.
•
We construct an argument as follows:
step reason
(1) sunny cold Premise
(2) sunny Simplification using (1)
(3) sunny swim Premise
(4) swim Modus ponens for (2), (3)
(5) swim canoe Premise
(5) canoe Modus ponens for (4), (5) (6) canoe early Premise
(7) Early Modus ponens for (5), (6)
Proof Example
2.
•
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.”
Proof Example 2
cont.
•
Let us adopt the following abbreviations:
mail= “you send me an e-mail message”; finish = “I will finish writing the program”;
sleep = “I will go to sleep early”;
refreshed = “I will wake up feeling refreshed
Then, the premises can be written as:
(1) mail finish
(2)
sleep
(3) sleep
refreshed
Proof Example 2
cont
.
Step Proved by
1. mail finish Premise #1.
2 finish mail contrapositive of 1. 3. mail sleep Premise #2.
4. finish sleep Hypothetical syllogism (2)(3). 5. sleep refreshed Premise #3.
Proof by resolution – Example 3.
Show that the premises (pq) r and rs imply the conclusion p s.
Solution:
(pq) r (p r) (q r) premise 1 rs (r s) premise 2
(p r) simplification from premise1
From (p r) (r s) using resolution follows p s.
Inference Rules for Quantifiers
• x P(x)
P(o) (substitute any object o)
• P(g) (for g a general element of
discourse)
x P(x)
• x P(x)
P(c) (substitute a new constant c)
• P(o) (substitute any extant object o) x P(x)
Universal instantiation
Universal generalization
Existential instantiation
Existential generalization
Example
“Everyone in this discrete math class has taken a course in computer science” and “Fatmah is a student in this class” imply “Fatmah has taken a course in computer science”
D(x): “x is in discrete math class”
C(x): “x has taken a course in computer science” x (D(x) C(x)) Premise 1
D(Fatmah) Premise 2
C(Fatmah)
Example – cont.
Step Proved by
1. x (D(x) C(x)) Premise #1.
2. D(Fatmah) C(Fatmah) Univ. instantiation. 3. D(Fatmah) Premise #2.
Universal modus ponens.
We can use together universal instantiation and rule Modus ponens:
x (P(x) Q(x)) Premise 1
P(a), where a is a particular element in domain
__________________________________________
Q(a)
Example.
Assume that for all positive numbers n, if n is greater than 4, then n2 is less the 2n. Use universal modus
ponens to show that 1002 < 2 100.
n>4 (n2 <2n)
n= 100
___________