You are on page 1of 14

Logic in Computer Science

Dr. Tathagata Ray


Associate Professor, BITS Pilani, Hyderabad Campus
rayt@hyderabad.bits-pilani.ac.in
BITS Pilani
Hyderabad Campus
Summary
Rule Name
𝜙 𝜓 And introduction
∧𝑖
𝜙∧𝜓

𝜙∧𝜓 And Elimination 1


∧ 𝑒1
𝜙
𝜙∧𝜓 And Elimination 2
∧ 𝑒2
𝜓
¬¬𝜙 Double –negation elimination
¬¬𝑒
𝜙
𝜙 Double-negation introduction
¬¬𝑖
¬¬𝜙
𝜙 𝜙 ⟶𝜓 Rule for eliminating implication
⟶𝑒
𝜓
𝜙 ⟶ 𝜓 ¬𝜓 Modus Tollens (MT)
𝑀𝑇
¬𝜙
𝜙 Rule implies introduction
..
.
𝜓
⟶𝑖
𝜙⟶𝜓

BITS Pilani, Hyderabad Campus


Summary
Rule Name

𝜙 Or Introduction 1
∨ 𝑖1
𝜙∨𝜓

𝜓 Or Introduction 2
∨ 𝑖2
𝜙∨𝜓
𝜙 𝜓 Or Elimination
. .
𝜙∨𝜓 . .
. .
𝜒 𝜒
∨𝑒
𝜒

Copy Rule

⊥ Bottom Elimination
⊥𝑒
𝜙
𝜙 ¬𝜙 Not Elimination
¬𝑒

𝜙 Not Introduction
..
.

¬I
¬𝜙

BITS Pilani, Hyderabad Campus


Derived Rules

• We have seen the Modus Tollens (MT) Rule.

• Can we derive this rule from other rules?

• So can we Prove ϕ → 𝜓, ¬𝜓 ⊢ ¬ϕ?

BITS Pilani, Hyderabad Campus


Proof of MT

1. ϕ→ 𝜓 Premise
2. ¬𝜓 Premise
3. 𝜙 Assumption
4. 𝜓 → 𝑒 1,3
5. ⊥ ¬𝑒 4,2
6. ¬𝜙 ¬𝑖 3 − 5

BITS Pilani, Hyderabad Campus


Rule of double negation

Prove the following 𝜙 ⊢ ¬¬𝜙.


Proof:
1.𝜙 Premise
2. ¬𝜙 Assumption
3. ⊥ ¬𝑒 1,2
4.¬¬𝜙

BITS Pilani, Hyderabad Campus


Rule Proof By Contradiction

• “Reductio ad absurdum” meaning reduction to absurdity.


• Commonly known as proof by contradiction
¬𝜙
..
.

• 𝑃𝐵𝐶
𝜙

BITS Pilani, Hyderabad Campus


Proof of PBC

• Prove ¬𝜙 →⊥⊢ 𝜙
• Proof
• 1. ¬𝜙 →⊥ Premise
• 2. ¬𝜙 Assumption
• 3. ⊥ →e 1,2
• 4.¬¬𝜙 ¬𝑖 2 − 3
• 5. 𝜙 ¬¬𝑒 4

BITS Pilani, Hyderabad Campus


Another Derived Rule

• This rule is called “tertium non datur” i.e The Law of


Excluded Middle (LEM).

• It simply says 𝜙 ∨ ¬𝜙 is true.

• There is no third possibility.

• Prove ⊢ 𝜙 ∨ ¬𝜙

BITS Pilani, Hyderabad Campus


Proof

1. ¬(𝜙 ∨ ¬𝜙) Assumption


2. 𝜙 Assumption
3. 𝜙 ∨ ¬𝜙 ∨ 𝑖1 2
4. ⊥ ¬e 3,1
5. ¬𝜙 ¬𝑖 2-4
6. 𝜙 ∨ ¬𝜙 ∨ 𝑖2 5
7. ⊥ ¬e 6,1
8. ¬¬(𝜙 ∨ ¬𝜙) ¬𝑖 1-7
9. (𝜙 ∨ ¬𝜙) ¬¬e 8

BITS Pilani, Hyderabad Campus


Rewriting the Proof

1. ¬(𝜙 ∨ ¬𝜙) Assumption


2. (𝜙 ∨ ¬𝜙) Assumption
3. ⊥ ¬e 2,1
4. ¬¬(𝜙 ∨ ¬𝜙) ¬𝑖 1-7
5. (𝜙 ∨ ¬𝜙) ¬¬e 8

Is this derivation correct????

BITS Pilani, Hyderabad Campus


Reason

• At any stage of a proof, it is permitted to introduce any


formula as assumption, by choosing a proof rule that
opens a box.

• We say natural deduction employs boxes to control the


scope of assumption.

• When an assumption is introduced a box is opened.

• Discharging assumption is achieved by closing a box


according to the pattern of its particular proof rule.

BITS Pilani, Hyderabad Campus


Another example of LEM

• Prove 𝑝 → 𝑞 ⊢ ¬𝑝 ∨ 𝑞
• Proof:
• 1. 𝑝 → 𝑞 Premise
• 2. ¬𝑝 ∨ 𝑝 LEM
• 3. ¬𝑝 Assumption
• 4. ¬𝑝 ∨ 𝑞 ∨ 𝑖1 3
• 5. 𝑝 Assumption
• 6. 𝑞 → 𝑒 1,5
• 7. ¬𝑝 ∨ 𝑞 ∨ 𝑖2 6
• 8. ¬𝑝 ∨ 𝑞 ∨ 𝑒 2,3 − 4, 5 − 7

BITS Pilani, Hyderabad Campus


Provable equivalence

Definition: Let 𝜙 and 𝜓 be formula of propositional logic.


We say that 𝜙 and 𝜓 are provably equivalent iff the
sequent 𝜙 ⊢ 𝜓 and 𝜓 ⊢ 𝜙 are valid.

BITS Pilani, Hyderabad Campus

You might also like