0% found this document useful (0 votes)
75 views

Prop Logic - Natural Deduction

This document discusses natural deduction proofs in propositional logic. It introduces propositional logic and defines atomic propositions. It describes the generic format for natural deduction rules and provides an example rule. The document outlines the different types of rules for introduction and elimination of logical operators. It defines sequents and describes how natural deduction proofs are constructed as a series of deduction steps, written out in a table format. The rules for conjunction are presented and an example proof is worked through step-by-step to demonstrate applying the rules.

Uploaded by

PARTH KHANDELWAL
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)
75 views

Prop Logic - Natural Deduction

This document discusses natural deduction proofs in propositional logic. It introduces propositional logic and defines atomic propositions. It describes the generic format for natural deduction rules and provides an example rule. The document outlines the different types of rules for introduction and elimination of logical operators. It defines sequents and describes how natural deduction proofs are constructed as a series of deduction steps, written out in a table format. The rules for conjunction are presented and an example proof is worked through step-by-step to demonstrate applying the rules.

Uploaded by

PARTH KHANDELWAL
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/ 33

CS F214

Logic in CS

Propositional Logic – Natural


Deduction
Slides by Prof. Shan B
BITS Pilani Jagat Sesh Challa
Pilani Campus
CS F214
Logic in CS
BITS Pilani
Pilani Campus

Proof System - Natural Deduction

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Propositional Logic

• Propositional Logic is essentially Boolean Logic: i.e.


• it is a logic of formulas (i.e. propositions)
• that evaluate to TRUE or FALSE
• made from atomic propositions and logical operations
(AND, OR, NOT ...)
e.g. raining AND sunny
e.g. raining AND sunny OR NOT humid AND NOT hot

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Propositional Logic - Propositions

• An atomic proposition is a statement that is atomic (i.e.


understood as is without structure):
• It may be true or false,
• but its truth or falsity is
• not based on any structure
• nor is it derived from something else
• e.g. (from the formulas in the last slide) :
• raining, sunny, humid, hot
• In Boolean Logic atomic propositions are referred to as
variables.

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proof Rules

• Proofs in (propositional) logic can be written down in various


formats:
• one of them is (Gentzen’s) natural deduction
• Proofs are based on rules (of inference):
• i.e. rules that state “one can infer S1 from S2”

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proof Rules – Generic Format

• In natural deduction, rules are written in the form:

Each premise is a (class of) propositional formula(s).


Similarly a conclusion is a (class of) propositional formula(s)

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proof Rules - Format - Example

• Consider this rule (labeled Ù e2 ):

𝜙# ∧ 𝜙$
Ù e2
𝜙$

This rule is read as:


given the premise
𝝓𝟏 Ù 𝝓𝟐
one can conclude
𝝓𝟐
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proof Rules – Different Kinds

• In natural deduction, typically, for each operation there are


two kinds of rules:
• one kind for elimination
• i.e. to prove a conclusion by eliminating the operation
• e.g. see previous slide (Ù elimination)
• one kind for introduction
• i.e. to prove a conclusion by introducing the operation
• e.g.
𝜙# 𝜙$
Ùi
𝜙# ∧ 𝜙$

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proof Technique: Natural Deduction:
Sequents

• In natural deduction, the statement (intended to be proved) is


referred to as a sequent:
• 𝜙!, 𝜙", … , 𝜙# ⊢ 𝜓
which is read as
• (the set of premises) “𝜙!, 𝜙", … , 𝜙#” entails (the conclusion) “𝜓”
• e.g. (sequent):
• 𝑝 ∧ 𝑞, 𝑟 ⊢ 𝑞 ∧ 𝑟
• To prove the sequent one has to apply (appropriate) proof rules.
• Q: Which rule(s) is/are required to prove the example sequent
given above?

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proofs in Natural Deduction

• Typically a (deduction) step in a proof involves:


• applying a rule on one or more premises to derive a
conclusion:
• for instance, from applying the rule ∧e2 on the
premise 𝒑 ∧ 𝒒 results in the conclusion, say, 𝒒
• Typically, then, a (natural deduction) proof is a sequence of
such (deduction) steps:
• e.g. proof for the sequent 𝒑 ∧ 𝒒, 𝒓 ⊢ 𝒒 ∧ 𝒓
• Step 1: apply ∧e2 on premise 𝒑 ∧ 𝒒 to result in q
• Step 2: apply ∧i on inference 𝒒 and premise 𝒓 to result
in 𝒒 ∧ 𝒓

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proofs in Natural Deduction

• Proofs are written in a particular format:


• as a table with one column of premises and results along with
corresponding explanations in the next column
• For instance, the 2-step proof from the previous slide i.e.
• Step 1: apply ∧e2 on premise 𝒑 ∧ 𝒒 to result in q
• Step 2: apply ∧i on inference 𝒒 and premise 𝒓 to result in 𝒒 ∧ 𝒓
is written out as:
refers to premise in
Deduction Explanation
row 1
1 𝒑∧𝒒 Premise
2 𝒒 ∧e2 1 refers to result in row 2 and
premise in row 3
3 𝒓 Premise
4 𝒒∧𝒓 ∧i 2,3

Note that the explanations may refer to the entries in the deduction column
by using the row number.
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
CS F214
Logic in CS
BITS Pilani
Pilani Campus

Natural Deduction: Rules for Conjunction

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Rules for Conjunction

• Conjunction refers to the operation “AND”:


The introduction rule for AND
𝜙# 𝜙$
Ùi
𝜙# ∧ 𝜙$
The elimination rules for AND

𝜙# ∧ 𝜙$ 𝜙# ∧ 𝜙$
Ù e1 Ù e2
𝜙# 𝜙$

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Rules for Conjunction – Example 1

• Prove the following sequent:


• hot ∧ humid, sleepy ∧ dull |-- hot ∧ sleepy
• The proof evolves via the following steps:
Deduction Explanation
The first ∧-elimination
1 hot ∧ humid Premise rule is applied on the
2 hot ∧e1 1 premise in line 1
i.e. on hot ∧ humid to
obtain the result hot

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Rules for Conjunction – Example 1
(contd.)

Deduction Explanation
The second ∧-elimination
1 hot ∧ humid Premise rule is applied on premise
2 hot ∧e1 1 in line 3
3 dull ∧ sleepy Premise i.e. on dull ∧ sleepy to
obtain the result sleepy
4 sleepy ∧e2 3

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Rules for Conjunction – Example 1
(contd.)

Deduction Explanation
1 hot ∧ humid Premise The ∧ -introduction rule
2 hot ∧e1 1 is applied on results in
line 2 and 4 to obtain
3 dull ∧ sleepy Premise
the result hot ∧ sleepy
4 sleepy ∧e2 3
5 hot ∧ sleepy ∧i 2,4

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Natural Deduction: Proofs

Observations (about proofs):


• Typically the first step of a proof is a premise from the given
sequent
and the last step is the conclusion from the given sequent.
i.e. if the sequent (to be proved) is of the form
f1 , f2 , ... fn ⊢ y
then the proof will (typically) be of the form
fk Premise
...
y Conclusion

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Natural Deduction: Proofs

Observations (about proofs):


• Typically the rule (to be) applied is
(i) an elimination rule for an operation if
the (desired) result should be devoid of the operation
and one of the premises contains the operation.

(ii) an introduction rule for an operation if


the (desired) result should involve the operation
and the premises may not

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Conjunction - Exercises

• Prove the following sequent:


• english_summer ∧ green_top ∧ fast_bowling,
indian_batsmen_fail

english_summer ∧ fast_bowling ∧ indian_batsmen_fail

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
CS F214
Logic in CS
BITS Pilani
Pilani Campus

Proof System - Natural Deduction – Implication Rules

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Natural Deduction: Proof Rules:
Implication

• Modus Ponens (Implication Elimination)

𝜙→𝜓 𝜙
→𝑒
𝜓

This rule is read as:


if we know 𝜙 implies 𝜓 and we know 𝜙 is true
then we can conclude 𝜓

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Implication – Example 1

Prove using “modus ponens”:


rains, rains → wet, wet → slippery ⊢ slippery
The proof proceeds as follows:

Deduction Explanation → elimination


on premises in
1 rains Premise
row 1 and 2
2 rains → wet Premise
3 wet →e 1,2
...
1st step

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Implication – Example 1 (contd.)

Prove using “modus ponens”:


rains, rains → wet, wet → slippery ⊢ slippery

Deduction Explanation
1 rains Premise
2nd step
2 rains → wet Premise
→ elimination
3 wet →e 1,2
on premises in
4 wet → slippery Premise row 3 and 4
5 slippery →e 3,4

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Implication – Example 2

Prove using “modus ponens”:


rains, rains → wet, wet → slippery ⊢ wet ∧ slippery

→ elimination
Deduction Explanation
on premises in
1 rains Premise row 1 and 2
2 rains → wet Premise
→ elimination
3 wet →e 1,2 on premises in
4 wet → slippery Premise row 1 and 4
5 slippery →e 1,4
6 wet Ù slippery Ù i 3,5
Ù -introduction
on premises in
row 3 and 5

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Natural Deduction - Proofs

• Questions:
• How do you identify the next step in a proof?
• How do you identify which rule is to be applied?
• Observations:
• An ND proof is usually driven bottom up i.e.
• one identifies the steps (deductions) of the proof by
starting with the conclusion
• The structure of the conclusion (i.e. the top level
operation(s) used) leads to the identification of the
appropriate rule
• for instance the choice of ∧i rule vs. the choice of →e
rule in the two proofs in the last two slides.

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND – Structure of Proofs - Example

Prove:
rains, rains → wet, wet → slippery ⊢ wet ∧ slippery

Deduction Explanation

wet Ù slippery Ùi
Ù -introduction

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Implication – Example 2

Prove:
rains, rains → wet, wet → slippery ⊢ wet ∧ slippery

Deduction Explanation

→ elimination

2 slippery →e
1 wet Ù slippery Ùi ?,2
Ù introduction
on premise in
row 2 and ?

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Implication – Example 2

Prove:
rains, rains → wet, wet → slippery ⊢ wet ∧ slippery

Deduction Explanation

→ -elimination
4 wet ? on Premise in
3 wet → slippery Premise row 3 and result
2 in row 4
slippery →e 3,4
1 wet Ù slippery Ùi ?,2
Ù -introduction
on premise in
row 2 and ?

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Implication – Example 2

Prove:
rains, rains → wet, wet → slippery ⊢ wet ∧ slippery

Deduction Explanation → -elimination on


6 rains Premise Premises in rows 5
5 rains → wet Premise and 6
4 wet →e 5,6
3 wet → slippery Premise
2 slippery →e 3,4
1 wet Ù slippery Ùi ?,2

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Implication – Example 2

Prove:
rains, rains → wet, wet → slippery ⊢ wet ∧ slippery

Deduction Explanation → -elimination on


6 rains Premise Premise in row 4 and
5 rains → wet Premise result in row 3
4 wet →e 5,6
3 wet → slippery Premise
2 slippery →e 3,4
1 wet Ù slippery Ùi 4,2
Ù -introduction on
premise in row 2 and
result in row 4

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Proof Rules: Implication Introduction

• A “Proof” introduces implication

i.e. if we can assume 𝜙# and prove 𝜙$ ,


Assume 𝜙! then 𝜙# ⊢ 𝜙$ can be inferred
.
.
. Question:
How is this rule different from the ones
𝜙$ seen before?
[Hint: Note that there is a sub-proof.
-->i
End of Hint.]
𝜙# → 𝜙$

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Proofs using Implication Introduction

• Example:
• Prove the sequent ⊢ 𝑝 ∧ 𝑞 → 𝑞
• Proof:
Deduction Explanation
1 These two rows
𝒑∧𝒒 Assumption
constitute a proof
2 𝒒 Ù e2 1 of the sequent
3 𝒑∧𝒒→𝐪 →i 1-2 𝒑∧𝒒⊢𝐪

Observation:
Proof of a sequent of the form 𝝓 ⊢ 𝝍 can be treated as
the proof of a sequent of the form ⊢ 𝝓 → 𝝍

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Proofs using Implication Introduction

Observation:
– Proof of a sequent of the form 𝝓 ⊢ 𝝍 can be
treated as the proof of a sequent of the form 𝝓 → 𝝍
– lnductively, proof of 𝝓𝟏 , 𝝓𝟐 , … 𝝓𝒏 ⊢ 𝝍 is proof of
⊢ 𝝓𝟏 → (𝝓𝟐 → … → (𝝓𝒏 → 𝝍 … ))

Exercise:
Prove the following sequent :
𝒑 → 𝒒, 𝒒 → 𝒓 ⊢ 𝒑 → 𝒓
and thereby prove the following sequent, using the
observation mentioned above:
⊢ 𝒑 → 𝒒 → ( 𝒒 → 𝒓 → (𝒑 → 𝒓))

Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus

You might also like