0% found this document useful (0 votes)
11 views88 pages

Proof Prop

Uploaded by

Karus Insania
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)
11 views88 pages

Proof Prop

Uploaded by

Karus Insania
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/ 88

Proofs in Propositional Logic:

Resolution

Proofs in Propositional Logic 79/448


What Is a “Proof”?

A proof is a formal demonstration that a statement is true.

• It must be mechanically checkable. A reader need not apply any


intuition or insight to verify that it is correct.
• In fact, a computer could verify its correctness.

A proof is generally syntactic, rather than semantic.

• Syntactic rules permit mechanical checking.


• The rules are chosen for semantic reasons, but their use remains
purely syntactic.

Proofs in Propositional Logic Notions of Proof 80/448


What Makes a Proof?

Generically, a proof consists of a list of formulas.

• The assumptions, if any, are listed first.


• Each subsequent formula must be a valid inference from preceding
formulas.
That is, there is an inference rule (defined by the proof system) that
justifies the formula, based on the previous ones.
• The final formula is the conclusion.

The key here is the set of inference rules. A set of inference rules defines
a proof system.

We notate “there is a proof with assumptions Σ and conclusion ϕ ” by

Σ`ϕ .

Proofs in Propositional Logic Notions of Proof 81/448


Inference Rules

In general, an inference rule is written as


α1 α2 ... αi
β .

This means,

Suppose that each of the formulas α1 , α2 , . . . , αi already


appears in the proof (either assumed or previously inferred).
Then one may infer the formula β .

Examples of possible rules:


α β A kind of definition of ∧. α∧β Rules need not be
α∧β α∨β equivalences.

Proofs in Propositional Logic Notions of Proof 82/448


Approaches to Proofs
Direct proofs:

To establish Σ |= ϕ , give a proof with α1 , α2 , . . . , αn as


assumptions, and obtain ϕ as the conclusion.

Refutations (a.k.a. indirect proofs, or proofs by contradiction):

To establish Σ |= ϕ , take ¬ϕ as an assumption, in addition to


α1 , α2 , . . . , αn . Obtain a definitive contradiction (denoted ⊥) as
a conclusion.
(In other words, give a direct proof of Σ ∪ {¬ϕ} |= ⊥.)

Why does the refutation approach work?


If Σ ∪ {¬ϕ} is a contradiction, then any valuation t that makes Σ true
must make ¬ϕ false and thus make ϕ true. Therefore, Σ |= ϕ .
Proofs in Propositional Logic Notions of Proof 83/448
Proofs and Entailment

We have outlined the following plan.

Goal: Show that Σ |= ϕ .


Method: Show that Σ ` ϕ (i.e., give a proof).

To justify this, we need that

Σ ` ϕ implies Σ |= ϕ .

Of course, this depends on what the proof system is!

Proofs in Propositional Logic Notions of Proof 84/448


The “Resolution” System and Rule
Resolution is a refutation system, with the following inference rule:
α ∨ p ¬p ∨ β
α∨β

for any variable p and formulas α and β .


We consider the following as special cases:

Unit resolution: Contradiction:


α ∨ p ¬p p ¬p
α ⊥

Resolution is a refutation system; a proof is complete when one derives a


contradiction ⊥.
In this case, the original assumptions are refuted.
Proofs in Propositional Logic Resolution 85/448
Example of Using Resolution

To prove: {p, q} `Res p ∧ q.


Our aim: derive a contradiction from the assumptions {p, q, ¬(p ∧ q)}.
As a preliminary step, re-write the third formula as ¬p ∨ ¬q.
We start the actual proof with the three assumptions.

1. p assumption
2. q assumption
3. ¬p ∨ ¬q assumption (from negated goal)

Now, we recall the inference rule: α ∨ p ¬p ∨ β .


α∨β
Consider lines 1 and 3. . . .

Proofs in Propositional Logic Resolution 86/448


Example of Using Resolution, cont’d

The proof so far:

1. p assumption
2. q assumption
3. ¬p ∨ ¬q assumption (from negated goal)

We have the formulas (1) p and (3) ¬p ∨ ¬q.


Apply unit resolution, yielding the formula ¬q.

Proofs in Propositional Logic Resolution 87/448


Example of Using Resolution, cont’d

1. p assumption
2. q assumption
3. ¬p ∨ ¬q assumption (from negated goal)
4. ¬q 1, 3

We have the formulas (1) p and (3) ¬p ∨ ¬q.


Apply unit resolution, yielding the formula ¬q.
We have the formulas (2) q and (4) ¬q.
Apply the contradiction rule, yielding ⊥.

Proofs in Propositional Logic Resolution 87/448


Example of Using Resolution, cont’d

1. p assumption
2. q assumption
3. ¬p ∨ ¬q assumption (from negated goal)
4. ¬q 1, 3
5. ⊥ 2, 4

We have the formulas (1) p and (3) ¬p ∨ ¬q.


Apply unit resolution, yielding the formula ¬q.
We have the formulas (2) q and (4) ¬q.
Apply the contradiction rule, yielding ⊥.
Done!
Proofs in Propositional Logic Resolution 87/448
Conjunctive Normal Form

The Resolution rule can only be used successfully on formulas of a


restricted form.
Conjunctive normal form (CNF):

• A literal is a (propositional) variable or the negation of a variable.


• A clause is a disjunction of literals.
• A formula is in conjunctive normal form if it is a conjunction of
clauses.

In other words, a formula is in CNF if and only if

• its only connectives are ¬, ∨ and/or ∧,


• ¬ applies only to variables, and
• ∨ applies only to subformulas with no occurrence of ∧.

Proofs in Propositional Logic Resolution 88/448


Converting to CNF

1. Eliminate implication and equivalence.


Replace (α → β) by (¬α ∨ β)
Replace (α ↔ β) by (¬α ∨ β) ∧ (α ∨ ¬β).
(Now only ∧, ∨ and ¬ appear as connectives.)
2. Apply De Morgan’s and double-negation laws as often as possible.
Replace ¬(α ∨ β) by ¬α ∧ ¬β .
Replace ¬(α ∧ β) by ¬α ∨ ¬β .
Replace ¬¬α by α.
(Now negation only occurs in literals.)
3. Transform into a conjunction
 of clauses using distributivity.
Replace α ∨ (β ∧ γ) by (α ∨ β) ∧ (α ∨ γ) .
(One could stop here, but. . . .)
4. Simplify using idempotence, contradiction, excluded middle and
Simplification I & II.

Proofs in Propositional Logic Resolution 89/448


The Resolution Proof Procedure

To prove ϕ from Σ, via a Resolution refutation:

1. Convert each formula in Σ to CNF.


2. Convert ¬ϕ to CNF.
3. Split the CNF formulas at the ∧s, yielding a set of clauses.
4. From the resulting set of clauses, keep applying the resolution
inference rule until either:
• The empty clause ⊥ results.
In this case, ϕ is a theorem.
• The rule can no longer be applied to give a new formula.
In this case, ϕ is not a theorem.

Proofs in Propositional Logic Resolution 90/448


Example: Resolution

To show: {(p → q), (q → r)} |= (p → r).

Convert each assumption formula to CNF.

We get (¬p ∨ q) and (¬q ∨ r).


Convert the negation of the goal formula to CNF:

Replacing the → yields ¬(¬p ∨ r); then


De Morgan yields (p ∧ ¬r).
Splitting the ∧ yields four clauses: (¬p ∨ q), (¬q ∨ r), p and ¬r .

Proofs in Propositional Logic Resolution 91/448


Example, cont’d

Now we can make inferences, starting from our assumptions.

1. ¬p ∨ q assumption
2. ¬q ∨ r assumption
3. p assumption (from negated conclusion)
4. ¬r assumption (from negated conclusion)

Proofs in Propositional Logic Resolution 92/448


Example, cont’d

Now we can make inferences, starting from our assumptions.

1. ¬p ∨ q assumption
2. ¬q ∨ r assumption
3. p assumption (from negated conclusion)
4. ¬r assumption (from negated conclusion)
5. q 1, 3 (variable p)

Proofs in Propositional Logic Resolution 92/448


Example, cont’d

Now we can make inferences, starting from our assumptions.

1. ¬p ∨ q assumption
2. ¬q ∨ r assumption
3. p assumption (from negated conclusion)
4. ¬r assumption (from negated conclusion)
5. q 1, 3 (variable p)
6. r 2, 5 (variable q)

Proofs in Propositional Logic Resolution 92/448


Example, cont’d

Now we can make inferences, starting from our assumptions.

1. ¬p ∨ q assumption
2. ¬q ∨ r assumption
3. p assumption (from negated conclusion)
4. ¬r assumption (from negated conclusion)
5. q 1, 3 (variable p)
6. r 2, 5 (variable q)
7. ⊥ 4, 6 (variable r )

Refutation complete!

Proofs in Propositional Logic Resolution 92/448


Thinking About Consistency

Suppose I have a set of sentences Σ in propositional logic and an


additional sentence ϕ .
In each of the following cases, what can I conclude?

• If Σ ∧ ¬ϕ is consistent, then . . .
• If Σ ∧ ¬ϕ is inconsistent, then . . .
• If Σ ∧ ϕ is consistent, then. . .
• If Σ ∧ ϕ is inconsistent, then . . .

Proofs in Propositional Logic Resolution 93/448


Resolution Is Sound

For resolution to be meaningful, we need the following.

Theorem. Suppose that {α1 , . . . , αn } `Res ⊥; that is, there is a


resolution refutation with assumptions α1 , . . . , αn and conclusion ⊥.
Then the set {α1 , . . . , αn } is unsatisfiable (contradictory).

That is, if Σ ∪ {¬ϕ} `Res ⊥, then Σ ∪ {¬ϕ} is a contradiction.


Therefore, Σ |= ϕ .
In other words, the Resolution proof system is sound.
(If we prove something, it is true.)

We prove the theorem by induction on the length of the refutation.

Proofs in Propositional Logic Soundness and Completeness of Resolution 94/448


Soundness: The central argument

Claim: Suppose that a set Γ = {β1 , . . . , βk } is satisfiable. Let βk+1 be a


formula obtained from Γ by one use of the resolution inference rule.
Then the set Γ ∪ {βk+1 } is satisfiable.
Proof: Let valuation v satisfy Γ ; that is, βiv = T for each i .
Let βk+1 be γ1 ∨ γ2 , obtained by resolving βi = p ∨ γ1 and β j = ¬p ∨ γ2 .

Case I: v(p) = F. Since βiv = T, we must have γ1v = T. Thus βk+1


v
= T.
Case II: v(p) = T. Since β j = T, we must have γ2 = T. Thus βk+1 = T.
v v v

In either of the two possible cases, we have βk+1


v
= T, as claimed.

Proofs in Propositional Logic Soundness and Completeness of Resolution 95/448


The Claim Implies the Theorem

Using induction on n, the previous claim implies

Claim II: Suppose that the set Γ = {β1 , . . . , βk } is satisfiable.


Let α be a formula obtained from Γ by n uses of the resolution
inference rule. Then the set Γ ∪ {α} is satisfiable.
(The previous claim is the inductive step of this one.)

Therefore, if a set of assumptions leads to ⊥ after any number n of


resolution steps, the set must be unsatisfiable—since any set containing
⊥ is unsatisfiable.

Thus Resolution is a sound refutation system, as required.

Proofs in Propositional Logic Soundness and Completeness of Resolution 96/448


Can Resolution Fail?

In some cases, there may be no way to obtain ⊥, using any number of


resolution steps. What then?

Definition. A proof system S is complete if every entailment has a proof;


that is, if
Σ |= α implies Σ `S α .

Theorem. Resolution is a complete refutation system for CNF formulas.


That is, if there is no proof of ⊥ from a set Σ of assumptions in CNF,
then Σ is satisfiable.

Proofs in Propositional Logic Soundness and Completeness of Resolution 97/448


Resolution Is Complete (Outline)

Claim. Suppose that a resolution proof “reaches a dead end”—that is, no


new clause can be obtained, and yet ⊥ has not been derived. Then the
entire set of formulas (including the assumptions!) is satisfiable.

Proof (outline): We use induction again. However, it is not an induction


on the length of the proof, nor on the number of formulas. Instead, we
use induction on the number of variables present in the formulas.

Basis: only one variable occurs, say p.


After conversion to CNF and simplification, the only possible clauses are
p and ¬p. If both occured, ⊥ would be derivable. Thus at most one
does; we can satisfy it.

Proofs in Propositional Logic Soundness and Completeness of Resolution 98/448


Completeness Proof, part II

Inductive hypothesis: The claim holds for sets having at most k variables.

Consider a set of clauses using k + 1 variables, from which no additional


clause can be derived via the resolution rule. Suppose that it does not
contain ⊥. Select any one variable, say p, and separate the clauses into
three sets:

S p : the clauses that contain the literal p.


S¬p : the clauses that contain the literal ¬p.
R: the remaining clauses, which do not contain variable p at all.

The “remainder” set R has at most k variables.


Thus the hypothesis applies: it has a satisfying valuation v .

Proofs in Propositional Logic Soundness and Completeness of Resolution 99/448


Completeness Proof, part III
We have a valuation v , on the variables other than p, that satisfies
set R. We now must satisfy the sets S p and S¬p .

Case I: Every clause in S p , of the form p ∨ α, has α v = T.


In this case, the set S p is already satisfied. Define v(p) = F,
which additionally makes every clause in S¬p true.

Case II: S p has some clause p ∨ α with α v = F.


In this case, set v(p) = T; this satisfies every formula in S p .
What about a clause ¬p ∨ β in S¬p ?
Consider the formula α ∨ β , obtained by resolution from p ∨ α
and ¬p ∨ β . It must lie in R; thus β v = T. Thus also
(¬p ∨ β) v = T, as required.

Done!
Proofs in Propositional Logic Soundness and Completeness of Resolution 100/448
Resolution Provides an Algorithm

The resolution method yields an algorithm to determine whether a given


formula, or set of formulas, is satisfiable or contradictory.

• Convert to CNF. (A well-specified series of steps.)


• Form resolvents, until either ⊥ is derived, or no more derivations are
possible.
• If ⊥ is derived, the original formula/set is contradictory. Otherwise,
the preceding proof describes how to find a satisfying valuation.

Proofs in Propositional Logic Soundness and Completeness of Resolution 101/448


The Algorithm Can Be Very Slow

The algorithm can be “souped up” in many ways.

• Choosing a good order of doing resolution steps. (It matters!)


• Sophisticated data structures, to handle large numbers of clauses.
• Additional techniques: setting variables, “learning”, etc.

However, it still has limitations.


Theorem (Haken, 1985): There is a number c > 1 such that
For every n, there is an unsatisfiable formula on n variables
(and about n1.5 total literals) whose smallest resolution
refutation contains more than c n steps.

Resolution is an exponential-time algorithm!


(And you thought quadratic was bad. . . .)

Proofs in Propositional Logic Soundness and Completeness of Resolution 102/448


Resolution in Practice: Satisfiability (SAT) solvers

Determining the satisfiability of a set of propositional formulas is a


fundamental problem in computer science.
Examples:

• software and hardware verification


• automatic test pattern generation
• planning
• scheduling

. . . many problems of practical importance can be formulated as


determining the satisfiability of a set of formulas.

Proofs in Propositional Logic Soundness and Completeness of Resolution 103/448


Resolution in practice: “SAT Solvers”

Modern SAT solvers can often solve hard real-world instances with over
a million propositional variables and several million clauses.

Annual SAT competitions:

http://www.satcompetition.org/

Many are open source systems.

Best SAT solvers are based on backtracking search.

Proofs in Propositional Logic Soundness and Completeness of Resolution 104/448


Satisfiability in Theory

If a formula is satisfiable, then there is a short demonstration of that:


simply give the valuation. Anyone can easily check that it is correct.
The class of problems with this property is known as NP.
The class of problems for which one can find a solution efficiently is
known as P .
(For a precise definition, we need to define “efficiently.” We won’t, here.)

A Fundamental Question: Is P = NP?

A partial answer: If SAT is in P (by any algorithm), then P = NP.

Proofs in Propositional Logic Soundness and Completeness of Resolution 105/448


Proofs in Propositional Logic:
Natural Deduction

Natural Deduction 106/448


Why Another Proof System?

The Resolution system is both sound and complete. Why do we need


another proof system?

• Resolution proofs are fine for computers, but people normally reason
quite differently. To model what people do, we must take another
approach.
• Resolution is closely tied to propositional logic. Extending it to
other forms of logic requires significant additional techniques.

Thus we will consider a system called Natural Deduction.

• It closely follows how people (mathematicians, at least) normally


make formal arguments.
• It extends easily to more-powerful forms of logic.

Natural Deduction Introduction 107/448


Overview of Natural Deduction

As in Resolution, a proof in Natural Deduction consists of a collection of


formulas, in some order, each with a justification.
It has some contrasts, however.

• It does a direct proof, rather than a refutation.


• Assumptions (formulas without a justification) play a crucial role.
• Using an assumption creates a “sub-proof”.
Formulas inside a sub-proof may not be used outside it.
An inference rule may refer to a completed sub-proof.

We use the same notation as before for existence of a proof. If there is a


proof of a formula ϕ from a set Σ of assumptions, we write

Σ `ND ϕ or simply Σ ` ϕ .

Natural Deduction Introduction 108/448


The Basic Rules of Natural Deduction

The simplest rule is, if you have a formula in the proof already, you may
write it down again. This is called reflexivity.
We will write rules like this:

Name ` -notation inference notation


Reflexivity, ϕ
Σ, ϕ ` ϕ
or Premise ϕ

The notation on the right is as we had before: if we have the formula


above the line available, we may write the formula below the line in the
proof.
The version in the center reminds us of the role of assumptions in
Natural Deduction. Other rules will make more use of it.

Natural Deduction Basic Rules 109/448


A First Example

Here is a proof of p, q ` p.

1. p Premise
2. q Premise
3. p Reflexivity: 1

Alternatively, we could simply write

1. p Premise

and be done.

(Note: “extra” formulas never hurt anything.)

Natural Deduction Basic Rules 110/448


Rules for Conjunction: ∧i
Each connective symbol has an “introduction rule” to conclude formulas
that contain it, and an “elimination rule” to conclude a formula that
removes it from an earlier formula.
We start with the introduction rule for ∧.

Name ` -notation inference notation


∧-introduction If Σ ` ϕ and Σ ` α, ϕ α
(∧i) then Σ ` ϕ ∧ α ϕ∧α

Rule ∧i means

If each of the formulas ϕ and α already appears in the proof,


then we may write the formula ϕ ∧ α as the next formula of
the proof.

Natural Deduction Conjunction Rules 111/448


Rules for Conjunction: ∧e

The elimination rule for ∧ basically “undoes” the introduction.

Name ` -notation inference notation


∧-elimination If Σ ` ϕ ∧ α, ϕ∧α ϕ∧α
(∧e) then Σ ` ϕ and Σ ` α ϕ α

Rule ∧e means

If the formula ϕ ∧ α already appears in the proof, then we may


write either ϕ or α as the next formula of the proof.

Natural Deduction Conjunction Rules 112/448


Example: Conjunction Rules

Example. Show that p ∧ q ` q ∧ p.

1. p∧q Premise
2. q ∧e: 1
3. p ∧e: 1
4. q ∧ p ∧i: 2, 3

Natural Deduction Conjunction Rules 113/448


Example: Conjunction Rules (2)

Example. Show that p ∧ q, r ` q ∧ r .

1. p∧q Premise
2. r Premise
3. q ∧e: 1
4. q ∧ r ∧i: 3, 2

Natural Deduction Conjunction Rules 114/448


Rules for Implication: →e
The rule →-elimination requires two formulas earlier in the proof.

Name ` -notation inference notation


→-elimination If Σ ` ϕ → α and Σ ` ϕ , ϕ→α ϕ
(→e) then Σ ` α α

In words:

if you have that ϕ implies α, and also that ϕ , than you may
conclude α.

This rule is sometimes referred to by its Latin name, modus ponens.

(Rumours that “modus ponens” is the Latin equivalent of “D’uh!” are untrue, however well justified.)

Natural Deduction Implication Rules 115/448


Rules for Implication: →i
The →-introduction rule is our first to employ a sub-proof.

Name ` -notation inference notation


ϕ.
→-introduction If Σ, ϕ ` α, ..
(→i) then Σ ` ϕ → α .
α
ϕ→α

The rule uses the formula ϕ as a hypothesis, or assumption. The


assumption functions as a premise in the sub-proof, but it is not a
premise of the main proof.
The “box” around the sub-proof of Σ, ϕ ` α reminds us that nothing
inside the sub-proof may come out. Outside of the sub-proof, we may
use only the whole sub-proof, in a rule (like →-introduction) that
specifies a sub-proof.
Natural Deduction Implication Rules 116/448
Sub-Proof Rules
To use rule →i, we must have a completed sub-proof.

Assumption Rule:

A sub-proof may be opened at any point.


Its first line, labelled “assumption”, may be any formula.

Sub-proof closure rules:

The most-recently opened sub-proof may be closed at any time.


No formula inside a closed sub-proof may be referenced.
Only the entire sub-proof may be used, once it is closed.

Finally: every sub-proof must be closed before the last line of the proof.

Natural Deduction Implication Rules 117/448


Example: Rule →i and sub-proofs

Example. Give a proof of p → q, q → r ` p → r .

To start, we write down the premises at the beginning, and the


conclusion at the end.
What next?
1. p → q Premise
2. q→r Premise

p→r ???

Natural Deduction Implication Rules 118/448


Example: Rule →i and sub-proofs

Example. Give a proof of p → q, q → r ` p → r .

To start, we write down the premises at the beginning, and the


conclusion at the end.
What next?
1. p → q Premise
2. q→r Premise The goal “ p → r ” contains →.
3. p Assumption Let’s try rule →i. . . .
4.
5.
6. p→r →i: ??

Natural Deduction Implication Rules 118/448


Example: Rule →i and sub-proofs

Example. Give a proof of p → q, q → r ` p → r .

To start, we write down the premises at the beginning, and the


conclusion at the end.
What next?
1. p → q Premise
2. q→r Premise The goal “ p → r ” contains →.
3. p Assumption Let’s try rule →i. . . .
4. q
Inside the sub-proof, we can use
5. r →e: 2, 4 rule →e.
6. p→r →i: ??

Natural Deduction Implication Rules 118/448


Example: Rule →i and sub-proofs

Example. Give a proof of p → q, q → r ` p → r .

To start, we write down the premises at the beginning, and the


conclusion at the end.
What next?
1. p → q Premise
2. q→r Premise The goal “ p → r ” contains →.
3. p Assumption Let’s try rule →i. . . .
4. q →e: 1, 3
Inside the sub-proof, we can use
5. r →e: 2, 4 rule →e.
6. p→r →i: 3–5
Done!

Natural Deduction Implication Rules 118/448


Rules of Disjunction: ∨i and ∨e

Rule ∨i is much like rule ∧i. Rule ∨e, however, is more complicated.

Name ` -notation inference notation


If Σ ` ϕ , ϕ ϕ
∨-introduction
then Σ ` ϕ ∨ α ϕ∨α α∨ϕ
(∨i)
and Σ ` α ∨ ϕ
If Σ, ϕ1 ` α
ϕ1 ϕ2
∨-elimination and Σ, ϕ2 ` α, .. ..
.. ..
(∨e) then ϕ1 ∨ ϕ 2 α α
Σ , ϕ 1 ∨ ϕ2 ` α α

Rule ∨e is also known as “proof by cases”.

Natural Deduction Disjunction Rules 119/448


Example: Or-Introduction and -Elimination
Example: Show that p ∨ q ` (p → q) ∨ (q → p).

1. p∨q Premise
2. p Assumption
3. q Assumption
4. p Reflexivity: 2
5. q→p →i: 3–4
6. (p → q) ∨ (q → p) ∨i: 5
7. q Assumption
8. p Assumption
9. q Reflexivity: 7
10. p→q →i: 8–9
11. (p → q) ∨ (q → p) ∨i: 10
12. (p → q) ∨ (q → p) ∨e: 1, 2–6, 7–11

Natural Deduction Disjunction Rules 120/448


Negation

We shall treat negation by considering contradictions.


We shall use the notation ⊥ to represent any contradiction.
It may appear in proofs as if it were a formula.

The elimination rule for negation:

Name ` -notation inference notation


⊥-introduction, or ϕ ¬ϕ
Σ, ϕ , ¬ϕ ` ⊥
¬-elimination (¬e) ⊥

Formulas ϕ and ¬ϕ cannot both be true—to have both is a


contradiction.

Natural Deduction Negation 121/448


Negation Introduction (¬i)

If an assumption ϕ leads to a contradiction, then derive ¬ϕ .

Name ` -notation inference notation


ϕ.
¬-introduction If Σ, ϕ ` ⊥, ..
(¬i) then Σ ` ¬ϕ .

¬ϕ

Natural Deduction Negation 122/448


Example: Negation

Example. Show that ϕ → ¬ϕ ` ¬ϕ .

Natural Deduction Negation 123/448


Example: Negation

Example. Show that ϕ → ¬ϕ ` ¬ϕ .

1. ϕ → ¬ϕ Premise

¬ϕ ??

Natural Deduction Negation 123/448


Example: Negation

Example. Show that ϕ → ¬ϕ ` ¬ϕ .

1. ϕ → ¬ϕ Premise
2. ϕ Assumption
3.
4. ⊥ ??
5. ¬ϕ ¬i: 2–?

Natural Deduction Negation 123/448


Example: Negation

Example. Show that ϕ → ¬ϕ ` ¬ϕ .

1. ϕ → ¬ϕ Premise
2. ϕ Assumption
3. ¬ϕ →e: 1, 2
4. ⊥ ??
5. ¬ϕ ¬i: 2–?

Natural Deduction Negation 123/448


Example: Negation

Example. Show that ϕ → ¬ϕ ` ¬ϕ .

1. ϕ → ¬ϕ Premise
2. ϕ Assumption
3. ¬ϕ →e: 1, 2
4. ⊥ ¬e: 2, 3
5. ¬ϕ ¬i: 2–4

Natural Deduction Negation 123/448


The Last Two Basic Rules

Double-Negation Elimination:

Name ` -notation inference notation


¬¬-elimination If Σ ` ¬¬ϕ , ¬¬ϕ
(¬¬e) then Σ ` ϕ ϕ

Contradiction Elimination:

Name ` -notation inference notation


⊥-elimination If Σ ` ⊥, ⊥
ϕ
(⊥e) then Σ ` ϕ

Natural Deduction Negation 124/448


A Redundant Rule

The rule of ⊥-elimination is not actually needed.


Suppose a proof has 27. ⊥ 〈some rule〉
28. ϕ ⊥e: 27.

We can replace these by 27. ⊥ 〈some rule〉


28. ¬ϕ Assumption
29. ⊥ Reflexivity:
27
30. ¬¬ϕ ¬i: 28–29
31. ϕ ¬¬e: 30.

Thus any proof that uses ⊥e can be modified into a proof that does not.

Natural Deduction Negation 125/448


Example: “Modus tollens”
The principle of modus tollens: p → q, ¬q ` ¬p.

Natural Deduction Negation 126/448


Example: “Modus tollens”
The principle of modus tollens: p → q, ¬q ` ¬p.

1. p→q Premise
2. ¬q Premise

¬p ??

Natural Deduction Negation 126/448


Example: “Modus tollens”
The principle of modus tollens: p → q, ¬q ` ¬p.

1. p→q Premise
2. ¬q Premise
3. p Assumption
4.
5. ⊥ ??
6. ¬p ¬i: ??

Natural Deduction Negation 126/448


Example: “Modus tollens”
The principle of modus tollens: p → q, ¬q ` ¬p.

1. p→q Premise
2. ¬q Premise
3. p Assumption
4. q →e: 3, 1
5. ⊥ ??
6. ¬p ¬i: ??

Natural Deduction Negation 126/448


Example: “Modus tollens”
The principle of modus tollens: p → q, ¬q ` ¬p.

1. p→q Premise
2. ¬q Premise
3. p Assumption
4. q →e: 3, 1
5. ⊥ ¬e: 2, 4
6. ¬p ¬i: 3–5

Modus tollens is sometimes taken as a “derived rule”:


ϕ → α ¬α
¬ϕ MT

Natural Deduction Negation 126/448


Derived Rules

Whenever we have a proof of the form Γ ` ϕ , we can consider it as a


derived rule:
Γ
ϕ

If we use this in a proof, it can be replaced by the original proof of


Γ ` ϕ . The result is a proof using only the basic rules.

Using derived rules does not expand the things that can be proved. But
they can make it easier to find a proof.

Natural Deduction Negation 127/448


Some Useful Heuristics
Ideas to construct a proof:

1. Start with the premises at the top and the conclusion at the bottom.
2. If you can apply an elimination rule to premises, do so.
(In the case of ∨-elimination, open two sub-proofs.)
3. Next, work backwards from the end. If your target formula has a
connective, try its introduction rule.
This will yield a new target. Repeat steps 2 and 3 with the new
target, until you reach premises and/or available assumptions.
4. Treat a subproof as if it were a full proof (with a new premise).

Sometimes these ideas will lead you to a proof; sometimes they will not.
If not, try something else instead of an introduction rule (idea 3).

Sometime nothing works. Take a break, and perhaps try again later.
Natural Deduction Additional Examples and Techniques 128/448
Further Examples of Natural Deduction
Example. Show that p → q ` (r ∨ p) → (r ∨ q).

Write down premises and conclusion (step 1).


No elimination applies (step 2). Thus try →i (step 3).

1. p→q Premise

(r ∨ p) → (r ∨ q) ??

Natural Deduction Additional Examples and Techniques 129/448


Further Examples of Natural Deduction
Example. Show that p → q ` (r ∨ p) → (r ∨ q).

In the sub-proof, try ∨-elimination on the assumption


(step 2).

1. p→q Premise
2. r∨p Assumption

r ∨q ??
9. (r ∨ p) → (r ∨ q) ??

Natural Deduction Additional Examples and Techniques 129/448


Further Examples of Natural Deduction
Example. Show that p → q ` (r ∨ p) → (r ∨ q).

No elimination applies from the assumptions (step 2).


What about ∨-introduction for the conclusion (step 3)?

1. p→q Premise
2. r∨p Assumption
3. r Assumption
4. r ∨q ??
5. p Assumption
6.
7. r ∨q ??
8. r ∨q ∨e: ??
9. (r ∨ p) → (r ∨ q) →i: 2–8

Natural Deduction Additional Examples and Techniques 129/448


Further Examples of Natural Deduction
Example. Show that p → q ` (r ∨ p) → (r ∨ q).

It works!

1. p→q Premise
2. r∨p Assumption
3. r Assumption
4. r ∨q ∨i: 3
5. p Assumption
6. q →e: 5, 1
7. r ∨q ∨i: 6
8. r ∨q ∨e: 2, 3–4, 5–7
9. (r ∨ p) → (r ∨ q) →i: 2–8

Natural Deduction Additional Examples and Techniques 129/448


Life’s Not Always So Easy. . .


Example. Show that ` (p → q) → p → p.

1.


(p → q) → p → p Try →i. . .

Natural Deduction Additional Examples and Techniques 130/448


Life’s Not Always So Easy. . .


Example. Show that ` (p → q) → p → p.

1. (p → q) → p Assumption

5. p

6. (p → q) → p → p Try →i. . .

Natural Deduction Additional Examples and Techniques 130/448


Life’s Not Always So Easy. . .


Example. Show that ` (p → q) → p → p.

1. (p → q) → p Assumption
2. No elimination applies.
3.
4. ?????
5. p No connective.

6. (p → q) → p → p Try →i. . .

Natural Deduction Additional Examples and Techniques 130/448


Life’s Not Always So Easy. . .


Example. Show that ` (p → q) → p → p.

1. (p → q) → p Assumption
2. No elimination applies.
3.
4. ?????
5. p No connective.

6. (p → q) → p → p Try →i. . .

Time to try something ingenious. . . .

Natural Deduction Additional Examples and Techniques 130/448


Some Common Derived Rules

Proof by contradiction (reductio ad absurdum):

if Σ, ¬ϕ `⊥, then Σ ` ϕ .

The “Law of Excluded Middle” (tertiam non datur): ` ϕ ∨ ¬ϕ .

Double-Negation Introduction: if Σ ` ϕ then Σ ` ¬¬ϕ .

You can try to prove these yourself, as exercises.


(Hint: in the first two, the last step uses rule ¬¬e: ¬¬ϕ ` ϕ .)
Or see pages 24–26 of Huth and Ryan.

Natural Deduction Additional Examples and Techniques 131/448


Soundness and Completeness
of Natural Deduction

Natural Deduction Soundness and Completeness 132/448


Soundness and Completeness of Natural Deduction

As with Resolution, we want Natural Deduction to be both sound and


complete.

Soundness of Natural Deduction means that the conclusion of a


proof is always a logical consequence of the premises. That is,

If Σ `ND ϕ , then Σ |= ϕ .

Completeness of Natural Deduction means that all logical


consequences in propositional logic are provable in Natural
Deduction. That is,

If Σ |= ϕ , then Σ `ND ϕ .

Natural Deduction Soundness and Completeness 133/448


Proof of Soundness

To prove soundness, we use induction on the length of the proof:

For all deductions Σ ` α which have a proof of length n or less,


it is the case that Σ |= α.

That property, however, is not quite good enough to carry out the
induction. We actually use the following property of a natural number n.

Suppose that a formula ϕ appears at line n of a partial


deduction, which may have one or more open sub-proofs. Let
Σ be the set of premises used and Γ be the set of assumptions
of open sub-proofs. Then Σ ∪ Γ |= ϕ .

Natural Deduction Soundness and Completeness 134/448


Basis of the Induction

Base case. The shortest deductions have length 1, and thus are either

1. ϕ Premise.

or

1. ϕ Assumption.

We have either ϕ ∈ Σ (in the first case), or ϕ ∈ Γ (in the second case).
Thus Σ ∪ Γ |= ϕ , as required.

Natural Deduction Soundness and Completeness 135/448


Proof of Soundness: Inductive Step

Inductive step. Hypothesis: the property holds for each n < k; that is,

If some formula ϕ appears at line k or earlier of some partial


deduction, with premises Σ and un-closed assumptions Γ , then
Σ ∪ Γ |= ϕ .

To prove: if ϕ 0 appears at line k + 1, then Σ ∪ Γ 0 |= ϕ 0


(where Γ 0 = Γ ∪ ϕ 0 when ϕ 0 is an assumption, and Γ 0 = Γ otherwise).

Formula ϕ 0 must have a justification by some rule. We shall consider


each possible rule.

Natural Deduction Soundness and Completeness 136/448


Inductive Step, Case I

Case I: ϕ 0 was justified by ∧i.

We must have ϕ 0 = α1 ∧ α2 , where each of α1 and α2 appear


earlier in the proof, at steps m1 and m2 , respectively. Also, any
sub-proof open at step m1 or m2 is still open at step k + 1.
Thus the induction hypothesis applies to both; that is, Σ |= α1
and Σ |= α2 .
By the definition of |= , this yields Σ |= ϕ 0 , as required.

Natural Deduction Soundness and Completeness 137/448


Inductive Step, Case II

Case II: ϕ 0 was justified by →i.

Rule →i requires that ϕ 0 = α1 → α2 and there is a closed


sub-proof with assumption α1 and conclusion α2 , ending by
step k. Also, any sub-proof open before the assumption of α1
is still open at step k + 1.
The induction hypothesis thus implies Σ ∪ (Γ ∪ α1 ) |= α2 .
Hence Σ ∪ Γ |= α1 → α2 , as required.

Natural Deduction Soundness and Completeness 138/448


Inductive Step, Cases III ff.

Case III: ϕ 0 was justified by ¬e.

This requires that ϕ 0 be the pseudo-formula ⊥, and that the


proof contain formulas α and ¬α for some α, each using at
most k steps.
By the induction hypothesis, both Σ |= α and Σ |= ¬α.
Thus Σ is contradictory, and Σ |= ϕ 0 for any ϕ 0 .

Cases IV–XIII:

The other cases follow by similar reasoning.

This completes the inductive step, and the proof of soundness.

Natural Deduction Soundness and Completeness 139/448


Completeness of Natural Deduction

We now turn to completeness.

Formally, completeness means the following.

Let Σ be a set of formulas and ϕ be a formula.

If Σ |= ϕ , then Σ ` ϕ .

That is, every consequence has a proof.

How can we prove this?

Natural Deduction Proof of Completeness 140/448


Proof of Completeness: Getting started

Suppose that Σ |= ϕ , where Σ = {σ1 , σ2 , . . . , σm }.


Thus the formula (σ1 ∧ σ2 ∧ . . . ∧ σm ) → ϕ is a tautology.
Lemma. Every tautology is provable in Natural Deduction.
Once we prove the Lemma, the result follows. Given a proof of
(σ1 ∧ σ2 ∧ . . . ∧ σm ) → ϕ , one can use ∧i and →e to complete a proof
of Σ ` ϕ .

Natural Deduction Proof of Completeness 141/448


Tautologies Have Proofs
For a tautology, every line of its truth table ends with T.
We can mimic the construction of a truth table using inferences in
Natural Deduction.

Claim. Let ϕ have k variables p1 , . . . , pk . Let v be a valuation,


and define `1 , `2 , . . . , `k as
¨
pi if v(pi ) = T
`i =
¬pi if v(pi ) = F.

If ϕ v = T, then {`1 , . . . `k } ` ϕ , and


if ϕ v = F, then {`1 , . . . `k } ` ¬ϕ .

To prove the claim, use structural induction on formulas


(which is induction on the column number of the truth table).
Once the claim is proven, we can prove a tautology as follows. . . .
Natural Deduction Proof of Completeness 142/448
Outline of the Proof of a Tautology
1. p1 ∨ ¬p1 L.E.M.
2. p2 ∨ ¬p2 L.E.M.
..
.
k. pk ∨ ¬pk L.E.M. m + 1. ¬p1 assumption
k + 1. p1 assumption ..
.
.. p2 assumption ϕ
.
.. n. ϕ ∨e: 1, (k + 1)–m,
.
(m + 1)–n
ϕ
¬p2 assumption
..
. Once each variable is
ϕ assumed true or false, the
m. ϕ ∨e: 2, . . .
previous claim provides a
proof.

Natural Deduction Proof of Completeness 143/448


Proving the Claim
Hypothesis: the following hold for formulas α and β :

If {`1 , . . . , `k } |= α, then {`1 , . . . , `k } ` α;


If {`1 , . . . , `k } 6|= α, then {`1 , . . . , `k } ` ¬α;
If {`1 , . . . , `k } |= β , then {`1 , . . . , `k } ` β ; and
If {`1 , . . . , `k } 6|= β , then {`1 , . . . , `k } ` ¬β .

If {`1 , . . . , `k } |= α ∧ β , put the two proofs of α and β together, and then


infer α ∧ β , by ∧i.
If {`1 , . . . , `k } 6|= α → β (and thus {`1 , . . . , `k } |= α and {`1 , . . . , `k } 6|= β ),

• Prove α and ¬β .
• Assume α → β ; from it, conclude β (→e) and then ⊥ (¬e).
• From the sub-proof, conclude ¬(α → β), by ¬i.

The other cases are similar.


Natural Deduction Proof of Completeness 144/448

You might also like