Prop Logic - Natural Deduction
Prop Logic - Natural Deduction
Logic in CS
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Propositional Logic
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Propositional Logic - Propositions
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proof Rules
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proof Rules – Generic Format
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proof Rules - Format - Example
𝜙# ∧ 𝜙$
Ù e2
𝜙$
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proof Technique: Natural Deduction:
Sequents
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proofs in Natural Deduction
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Proofs in Natural Deduction
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
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Rules for Conjunction
𝜙# ∧ 𝜙$ 𝜙# ∧ 𝜙$
Ù e1 Ù e2
𝜙# 𝜙$
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Rules for Conjunction – Example 1
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
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Natural Deduction: Proofs
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Conjunction - Exercises
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
CS F214
Logic in CS
BITS Pilani
Pilani Campus
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
Natural Deduction: Proof Rules:
Implication
𝜙→𝜓 𝜙
→𝑒
𝜓
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Implication – Example 1
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Implication – Example 1 (contd.)
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
→ 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
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
Jagat Sesh Challa CS F214 - Logic in Computer Science CSIS, BITS Pilani, Pilani Campus
ND: Proof Rules: Implication Introduction
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