Top Banner
Propositional natural deduction COMP2600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2016
105

Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Jul 24, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Propositional natural deductionCOMP2600 / COMP6260

Dirk PattinsonAustralian National University

Semester 2, 2016

Page 2: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Major proof techniques

Three major styles of proof in logic and mathematicsModel based computation: truth tables for propositional logicAlgebraic proof: simplification rules e.g. De Morgan’sDeductive reasoning: rules of inferenceI Natural deduction is one exampleI Other examples: tableau calculi, resolution, Hilbert calculi

1 / 25

Page 3: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example proof using truth tables

Statement to be proved:

(p∧ (q∨ r))→ ((p∧q)∨ r))

For all 8 (= 23) possibilities of p,q, r , calculate truth value of the statement

p q r q∨ r p∧ (q∨ r) p∧q (p∧q)∨ r (p∧ (q∨ r))→ ((p∧q)∨ r))

T T T T T T T TT T F T T T T TT F T T T F T TT F F F F F F TF T T T F F T TF T F T F F F TF F T T F F T TF F F F F F F T

2 / 25

Page 4: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example proof using truth tables

Statement to be proved:

(p∧ (q∨ r))→ ((p∧q)∨ r))

For all 8 (= 23) possibilities of p,q, r , calculate truth value of the statement

p q r q∨ r p∧ (q∨ r) p∧q (p∧q)∨ r (p∧ (q∨ r))→ ((p∧q)∨ r))T T T T T T T T

T T F T T T T TT F T T T F T TT F F F F F F TF T T T F F T TF T F T F F F TF F T T F F T TF F F F F F F T

2 / 25

Page 5: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example proof using truth tables

Statement to be proved:

(p∧ (q∨ r))→ ((p∧q)∨ r))

For all 8 (= 23) possibilities of p,q, r , calculate truth value of the statement

p q r q∨ r p∧ (q∨ r) p∧q (p∧q)∨ r (p∧ (q∨ r))→ ((p∧q)∨ r))T T T T T T T TT T F T T T T T

T F T T T F T TT F F F F F F TF T T T F F T TF T F T F F F TF F T T F F T TF F F F F F F T

2 / 25

Page 6: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example proof using truth tables

Statement to be proved:

(p∧ (q∨ r))→ ((p∧q)∨ r))

For all 8 (= 23) possibilities of p,q, r , calculate truth value of the statement

p q r q∨ r p∧ (q∨ r) p∧q (p∧q)∨ r (p∧ (q∨ r))→ ((p∧q)∨ r))T T T T T T T TT T F T T T T TT F T T T F T T

T F F F F F F TF T T T F F T TF T F T F F F TF F T T F F T TF F F F F F F T

2 / 25

Page 7: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example proof using truth tables

Statement to be proved:

(p∧ (q∨ r))→ ((p∧q)∨ r))

For all 8 (= 23) possibilities of p,q, r , calculate truth value of the statement

p q r q∨ r p∧ (q∨ r) p∧q (p∧q)∨ r (p∧ (q∨ r))→ ((p∧q)∨ r))T T T T T T T TT T F T T T T TT F T T T F T TT F F F F F F T

F T T T F F T TF T F T F F F TF F T T F F T TF F F F F F F T

2 / 25

Page 8: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example proof using truth tables

Statement to be proved:

(p∧ (q∨ r))→ ((p∧q)∨ r))

For all 8 (= 23) possibilities of p,q, r , calculate truth value of the statement

p q r q∨ r p∧ (q∨ r) p∧q (p∧q)∨ r (p∧ (q∨ r))→ ((p∧q)∨ r))T T T T T T T TT T F T T T T TT F T T T F T TT F F F F F F TF T T T F F T T

F T F T F F F TF F T T F F T TF F F F F F F T

2 / 25

Page 9: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example proof using truth tables

Statement to be proved:

(p∧ (q∨ r))→ ((p∧q)∨ r))

For all 8 (= 23) possibilities of p,q, r , calculate truth value of the statement

p q r q∨ r p∧ (q∨ r) p∧q (p∧q)∨ r (p∧ (q∨ r))→ ((p∧q)∨ r))T T T T T T T TT T F T T T T TT F T T T F T TT F F F F F F TF T T T F F T TF T F T F F F T

F F T T F F T TF F F F F F F T

2 / 25

Page 10: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example proof using truth tables

Statement to be proved:

(p∧ (q∨ r))→ ((p∧q)∨ r))

For all 8 (= 23) possibilities of p,q, r , calculate truth value of the statement

p q r q∨ r p∧ (q∨ r) p∧q (p∧q)∨ r (p∧ (q∨ r))→ ((p∧q)∨ r))T T T T T T T TT T F T T T T TT F T T T F T TT F F F F F F TF T T T F F T TF T F T F F F TF F T T F F T T

F F F F F F F T

2 / 25

Page 11: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example proof using truth tables

Statement to be proved:

(p∧ (q∨ r))→ ((p∧q)∨ r))

For all 8 (= 23) possibilities of p,q, r , calculate truth value of the statement

p q r q∨ r p∧ (q∨ r) p∧q (p∧q)∨ r (p∧ (q∨ r))→ ((p∧q)∨ r))T T T T T T T TT T F T T T T TT F T T T F T TT F F F F F F TF T T T F F T TF T F T F F F TF F T T F F T TF F F F F F F T

2 / 25

Page 12: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

The notion of a deductive proof

A proof is a sequence of steps.Each step is either:I an axiom or an assumption; orI a statement which follows from previous steps via a valid rule of inference.

Natural deduction:I for each connective, there is an introduction and an elimination ruleI rules are formal, but resemble natural, i.e., human reasoning

3 / 25

Page 13: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example of a natural deduction proof

Statement to be proved: (p∧ (q∨ r))→ ((q→ s)∨p)

1 p∧ (q∨ r) Assumption

2 p ∧-E, 1

3 (q→ s)∨p ∨-I, 2

4 (p∧ (q∨ r))→ ((q→ s)∨p) →-I, 1–3

4 / 25

Page 14: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Conjunction rules

∧-I (and introduction)

p q

p ∧ q

∧-E (and elimination)

p ∧ q

p

p ∧ q

q

5 / 25

Page 15: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Conjunction rules

∧-I (and introduction)

p q

p ∧ q

∧-E (and elimination)

p ∧ q

p

p ∧ q

q

5 / 25

Page 16: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example

Commutativity of conjunction (derived rule)

p ∧ q

q ∧ p

1 p∧q

2 p ∧-E, 1

3 q ∧-E, 1

4 q∧p ∧-I, 2, 3

6 / 25

Page 17: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Implication rules

→-I (implication introduction)[ p ]

...q

p→ q

This notation means that by assuming p, you can prove q.p is then discharged - no longer an assumption.

→-E (implication elimination)p p→ q

q

7 / 25

Page 18: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Implication rules

→-I (implication introduction)[ p ]

...q

p→ q

This notation means that by assuming p, you can prove q.p is then discharged - no longer an assumption.

→-E (implication elimination)p p→ q

q

7 / 25

Page 19: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example - transitivity of implication (derived rule)

We provep→ q q→ r

p→ r

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 p→ r →-I, 3–5

Lines 1 and 2 are the assumptions given, you may use these throughout theproofLine 3 is an assumption made within the proof, you may use it only within itsscope (lines 3 to 5)

8 / 25

Page 20: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example - transitivity of implication (derived rule)

We provep→ q q→ r

p→ r

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 p→ r →-I, 3–5

Lines 1 and 2 are the assumptions given, you may use these throughout theproofLine 3 is an assumption made within the proof, you may use it only within itsscope (lines 3 to 5)

8 / 25

Page 21: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example - transitivity of implication (derived rule)

We provep→ q q→ r

p→ r

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 p→ r →-I, 3–5

Lines 1 and 2 are the assumptions given, you may use these throughout theproofLine 3 is an assumption made within the proof, you may use it only within itsscope (lines 3 to 5)

8 / 25

Page 22: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example - transitivity of implication (derived rule)

We provep→ q q→ r

p→ r

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 p→ r →-I, 3–5

Lines 1 and 2 are the assumptions given, you may use these throughout theproofLine 3 is an assumption made within the proof, you may use it only within itsscope (lines 3 to 5)

8 / 25

Page 23: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example - transitivity of implication (derived rule)

We provep→ q q→ r

p→ r

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 p→ r →-I, 3–5

Lines 1 and 2 are the assumptions given, you may use these throughout theproofLine 3 is an assumption made within the proof, you may use it only within itsscope (lines 3 to 5)

8 / 25

Page 24: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example - transitivity of implication (derived rule)

We provep→ q q→ r

p→ r

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 p→ r →-I, 3–5

Lines 1 and 2 are the assumptions given, you may use these throughout theproofLine 3 is an assumption made within the proof, you may use it only within itsscope (lines 3 to 5)

8 / 25

Page 25: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example - transitivity of implication (derived rule)

We provep→ q q→ r

p→ r

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 p→ r →-I, 3–5

Lines 1 and 2 are the assumptions given, you may use these throughout theproofLine 3 is an assumption made within the proof, you may use it only within itsscope (lines 3 to 5)

8 / 25

Page 26: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example - transitivity of implication (derived rule)

We provep→ q q→ r

p→ r

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 p→ r →-I, 3–5

Lines 1 and 2 are the assumptions given, you may use these throughout theproofLine 3 is an assumption made within the proof, you may use it only within itsscope (lines 3 to 5)

8 / 25

Page 27: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Notation: justification of a step

1 p→ q

2 p

3 q →-E, 1, 2

4 p→ q →-I, 2–3This is a rather silly proof, we succeed in proving what we started with.But it illustrates the meaning of the line number notation:→-E,1,2 means that rule→-E proves line 3 from lines 1 and 2→-I,2-3 means rule→-I proves line 4 from the fact that we could assume line2 and (using that assumption) prove line 3

9 / 25

Page 28: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Notation: justification of a step

1 p→ q

2 p

3 q →-E, 1, 2

4 p→ q →-I, 2–3This is a rather silly proof, we succeed in proving what we started with.But it illustrates the meaning of the line number notation:→-E,1,2 means that rule→-E proves line 3 from lines 1 and 2→-I,2-3 means rule→-I proves line 4 from the fact that we could assume line2 and (using that assumption) prove line 3

9 / 25

Page 29: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Notation: justification of a step

1 p→ q

2 p

3 q →-E, 1, 2

4 p→ q →-I, 2–3This is a rather silly proof, we succeed in proving what we started with.But it illustrates the meaning of the line number notation:→-E,1,2 means that rule→-E proves line 3 from lines 1 and 2→-I,2-3 means rule→-I proves line 4 from the fact that we could assume line2 and (using that assumption) prove line 3

9 / 25

Page 30: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Notation: justification of a step

1 p→ q

2 p

3 q →-E, 1, 2

4 p→ q →-I, 2–3This is a rather silly proof, we succeed in proving what we started with.But it illustrates the meaning of the line number notation:→-E,1,2 means that rule→-E proves line 3 from lines 1 and 2→-I,2-3 means rule→-I proves line 4 from the fact that we could assume line2 and (using that assumption) prove line 3

9 / 25

Page 31: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Notation: justification of a step

1 p→ q

2 p

3 q →-E, 1, 2

4 p→ q →-I, 2–3

This is a rather silly proof, we succeed in proving what we started with.But it illustrates the meaning of the line number notation:→-E,1,2 means that rule→-E proves line 3 from lines 1 and 2→-I,2-3 means rule→-I proves line 4 from the fact that we could assume line2 and (using that assumption) prove line 3

9 / 25

Page 32: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Notation: justification of a step

1 p→ q

2 p

3 q →-E, 1, 2

4 p→ q →-I, 2–3This is a rather silly proof, we succeed in proving what we started with.But it illustrates the meaning of the line number notation:→-E,1,2 means that rule→-E proves line 3 from lines 1 and 2→-I,2-3 means rule→-I proves line 4 from the fact that we could assume line2 and (using that assumption) prove line 3

9 / 25

Page 33: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Rules involving assumptions

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 q∧ r WRONG ∧-I, 4, 5

If a statement is inside the scope of an assumption, then it depends on thatassumption.Given p→ q and q→ r , we then assumed p and ”proved” q∧ r , but q∧ rdepends on p.Indentation and vertical lines indicate scopingSimilar to scoping in program code: eg lines 3 to 5 are a a method, and p is alocal variable to that method.

10 / 25

Page 34: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Rules involving assumptions

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 q∧ r WRONG ∧-I, 4, 5

If a statement is inside the scope of an assumption, then it depends on thatassumption.Given p→ q and q→ r , we then assumed p and ”proved” q∧ r , but q∧ rdepends on p.Indentation and vertical lines indicate scopingSimilar to scoping in program code: eg lines 3 to 5 are a a method, and p is alocal variable to that method.

10 / 25

Page 35: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Rules involving assumptions

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 q∧ r WRONG ∧-I, 4, 5

If a statement is inside the scope of an assumption, then it depends on thatassumption.Given p→ q and q→ r , we then assumed p and ”proved” q∧ r , but q∧ rdepends on p.Indentation and vertical lines indicate scopingSimilar to scoping in program code: eg lines 3 to 5 are a a method, and p is alocal variable to that method.

10 / 25

Page 36: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Rules involving assumptions

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 q∧ r WRONG ∧-I, 4, 5

If a statement is inside the scope of an assumption, then it depends on thatassumption.Given p→ q and q→ r , we then assumed p and ”proved” q∧ r , but q∧ rdepends on p.Indentation and vertical lines indicate scopingSimilar to scoping in program code: eg lines 3 to 5 are a a method, and p is alocal variable to that method.

10 / 25

Page 37: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Rules involving assumptions

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 q∧ r WRONG ∧-I, 4, 5

If a statement is inside the scope of an assumption, then it depends on thatassumption.Given p→ q and q→ r , we then assumed p and ”proved” q∧ r , but q∧ rdepends on p.Indentation and vertical lines indicate scopingSimilar to scoping in program code: eg lines 3 to 5 are a a method, and p is alocal variable to that method.

10 / 25

Page 38: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Rules involving assumptions

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 q∧ r WRONG ∧-I, 4, 5

If a statement is inside the scope of an assumption, then it depends on thatassumption.Given p→ q and q→ r , we then assumed p and ”proved” q∧ r , but q∧ rdepends on p.Indentation and vertical lines indicate scopingSimilar to scoping in program code: eg lines 3 to 5 are a a method, and p is alocal variable to that method.

10 / 25

Page 39: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Rules involving assumptions

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 q∧ r WRONG ∧-I, 4, 5

If a statement is inside the scope of an assumption, then it depends on thatassumption.Given p→ q and q→ r , we then assumed p and ”proved” q∧ r , but q∧ rdepends on p.Indentation and vertical lines indicate scopingSimilar to scoping in program code: eg lines 3 to 5 are a a method, and p is alocal variable to that method.

10 / 25

Page 40: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Rules involving assumptions

1 p→ q

2 q→ r

3 p

4 q →-E, 1, 3

5 r →-E, 2, 4

6 q∧ r WRONG ∧-I, 4, 5

If a statement is inside the scope of an assumption, then it depends on thatassumption.Given p→ q and q→ r , we then assumed p and ”proved” q∧ r , but q∧ rdepends on p.Indentation and vertical lines indicate scopingSimilar to scoping in program code: eg lines 3 to 5 are a a method, and p is alocal variable to that method.

10 / 25

Page 41: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Useless assumptions

You can assume anything, but it might not be useful.

1 p∧q

2 q ∧-E, 1

3 (p∧q)→ q →-I, 1–2

1 p ∧ You are a giraffe

2 You are a giraffe ∧-E, 1

3 p ∧ You are a giraffe → You are a giraffe →-I, 1–2

11 / 25

Page 42: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Useless assumptions

You can assume anything, but it might not be useful.

1 p∧q

2 q ∧-E, 1

3 (p∧q)→ q →-I, 1–2

1 p ∧ You are a giraffe

2 You are a giraffe ∧-E, 1

3 p ∧ You are a giraffe → You are a giraffe →-I, 1–2

11 / 25

Page 43: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Useless assumptions

You can assume anything, but it might not be useful.

1 p∧q

2 q ∧-E, 1

3 (p∧q)→ q →-I, 1–2

1 p ∧ You are a giraffe

2 You are a giraffe ∧-E, 1

3 p ∧ You are a giraffe → You are a giraffe →-I, 1–2

11 / 25

Page 44: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Useless assumptions

You can assume anything, but it might not be useful.

1 p∧q

2 q ∧-E, 1

3 (p∧q)→ q →-I, 1–2

1 p ∧ You are a giraffe

2 You are a giraffe ∧-E, 1

3 p ∧ You are a giraffe → You are a giraffe →-I, 1–2

11 / 25

Page 45: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Useless assumptions

You can assume anything, but it might not be useful.

1 p∧q

2 q ∧-E, 1

3 (p∧q)→ q →-I, 1–2

1 p ∧ You are a giraffe

2 You are a giraffe ∧-E, 1

3 p ∧ You are a giraffe → You are a giraffe →-I, 1–2

11 / 25

Page 46: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Disjunction rules

∨-I (or introduction)

p

p ∨ q

p

q ∨ p

∨-E (or elimination)

[p] [q]... ...

p ∨ q r r

r

12 / 25

Page 47: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Disjunction rules

∨-I (or introduction)

p

p ∨ q

p

q ∨ p

∨-E (or elimination)

[p] [q]... ...

p ∨ q r r

r

12 / 25

Page 48: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

∨-E template

1 p∨q

2 p

... ...

a r

b q

... ...

c r

d r ∨-E, 1, 2–a, b–c

13 / 25

Page 49: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

∨-E template

1 p∨q

2 p

... ...

a r

b q

... ...

c r

d r ∨-E, 1, 2–a, b–c

13 / 25

Page 50: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

∨-E template

1 p∨q

2 p

... ...

a r

b q

... ...

c r

d r ∨-E, 1, 2–a, b–c

13 / 25

Page 51: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

∨-E template

1 p∨q

2 p

... ...

a r

b q

... ...

c r

d r ∨-E, 1, 2–a, b–c

13 / 25

Page 52: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

∨-E template

1 p∨q

2 p

... ...

a r

b q

... ...

c r

d r ∨-E, 1, 2–a, b–c

13 / 25

Page 53: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

∨-E template

1 p∨q

2 p

... ...

a r

b q

... ...

c r

d r ∨-E, 1, 2–a, b–c

13 / 25

Page 54: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

∨-E template

1 p∨q

2 p

... ...

a r

b q

... ...

c r

d r ∨-E, 1, 2–a, b–c

13 / 25

Page 55: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

∨-E template

1 p∨q

2 p

... ...

a r

b q

... ...

c r

d r ∨-E, 1, 2–a, b–c

13 / 25

Page 56: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

∨-E template

1 p∨q

2 p

... ...

a r

b q

... ...

c r

d r ∨-E, 1, 2–a, b–c

13 / 25

Page 57: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: commutativity of disjunction (derived rule)

p∨q

q∨p

1 p∨q

2 p

3 q∨p ∨-I, 2

4 q

5 q∨p ∨-I, 4

6 q∨p ∨-E, 1, 2–3, 4–5

14 / 25

Page 58: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: commutativity of disjunction (derived rule)

p∨q

q∨p

1 p∨q

2 p

3 q∨p ∨-I, 2

4 q

5 q∨p ∨-I, 4

6 q∨p ∨-E, 1, 2–3, 4–5

14 / 25

Page 59: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: commutativity of disjunction (derived rule)

p∨q

q∨p

1 p∨q

2 p

3 q∨p ∨-I, 2

4 q

5 q∨p ∨-I, 4

6 q∨p ∨-E, 1, 2–3, 4–5

14 / 25

Page 60: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: commutativity of disjunction (derived rule)

p∨q

q∨p

1 p∨q

2 p

3 q∨p ∨-I, 2

4 q

5 q∨p ∨-I, 4

6 q∨p ∨-E, 1, 2–3, 4–5

14 / 25

Page 61: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: commutativity of disjunction (derived rule)

p∨q

q∨p

1 p∨q

2 p

3 q∨p ∨-I, 2

4 q

5 q∨p ∨-I, 4

6 q∨p ∨-E, 1, 2–3, 4–5

14 / 25

Page 62: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: commutativity of disjunction (derived rule)

p∨q

q∨p

1 p∨q

2 p

3 q∨p ∨-I, 2

4 q

5 q∨p ∨-I, 4

6 q∨p ∨-E, 1, 2–3, 4–5

14 / 25

Page 63: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: commutativity of disjunction (derived rule)

p∨q

q∨p

1 p∨q

2 p

3 q∨p ∨-I, 2

4 q

5 q∨p ∨-I, 4

6 q∨p ∨-E, 1, 2–3, 4–5

14 / 25

Page 64: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Negation rules

Idea: assume the opposite of what you want to prove and find a contradiction —so your assumption must have been wrong

¬-I (not introduction)[p]...

q ∧ ¬q

¬p

¬-E (not elimination)(eliminates ¬ froman assumption)

[¬p]...

q ∧ ¬q

p

15 / 25

Page 65: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Negation rules

Idea: assume the opposite of what you want to prove and find a contradiction —so your assumption must have been wrong

¬-I (not introduction)[p]...

q ∧ ¬q

¬p

¬-E (not elimination)(eliminates ¬ froman assumption)

[¬p]...

q ∧ ¬q

p

15 / 25

Page 66: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: double negation introduction (derived rule)

p

¬¬pIt is raining

It is not the case that is is not raining

1 p

2 ¬p

3 p∧¬p ∧-I, 1, 2

4 ¬¬p ¬I, 2–3

16 / 25

Page 67: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: double negation introduction (derived rule)

p

¬¬pIt is raining

It is not the case that is is not raining

1 p

2 ¬p

3 p∧¬p ∧-I, 1, 2

4 ¬¬p ¬I, 2–3

16 / 25

Page 68: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: double negation introduction (derived rule)

p

¬¬pIt is raining

It is not the case that is is not raining

1 p

2 ¬p

3 p∧¬p ∧-I, 1, 2

4 ¬¬p ¬I, 2–3

16 / 25

Page 69: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: double negation introduction (derived rule)

p

¬¬pIt is raining

It is not the case that is is not raining

1 p

2 ¬p

3 p∧¬p ∧-I, 1, 2

4 ¬¬p ¬I, 2–3

16 / 25

Page 70: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: double negation introduction (derived rule)

p

¬¬pIt is raining

It is not the case that is is not raining

1 p

2 ¬p

3 p∧¬p ∧-I, 1, 2

4 ¬¬p ¬I, 2–3

16 / 25

Page 71: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: contradiction elimination (derived rule)

p∧¬p

q

1 p∧¬p

2 ¬q

3 p∧¬p R, 1

4 q ¬E, 2–3

17 / 25

Page 72: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: contradiction elimination (derived rule)

p∧¬p

q

1 p∧¬p

2 ¬q

3 p∧¬p R, 1

4 q ¬E, 2–3

17 / 25

Page 73: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: contradiction elimination (derived rule)

p∧¬p

q

1 p∧¬p

2 ¬q

3 p∧¬p R, 1

4 q ¬E, 2–3

17 / 25

Page 74: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: contradiction elimination (derived rule)

p∧¬p

q

1 p∧¬p

2 ¬q

3 p∧¬p R, 1

4 q ¬E, 2–3

17 / 25

Page 75: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: contradiction elimination (derived rule)

p∧¬p

q

1 p∧¬p

2 ¬q

3 p∧¬p R, 1

4 q ¬E, 2–3

17 / 25

Page 76: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: contradiction elimination (derived rule)

p∧¬p

q

1 p∧¬p

2 ¬q

3 p∧¬p R, 1

4 q ¬E, 2–3

17 / 25

Page 77: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: double negation elimination (derived rule)

¬¬p

p

1 ¬¬p

2 ¬p

3 ¬p∧¬¬p ∧-I, 1, 2

4 p ¬E, 2–3

18 / 25

Page 78: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: double negation elimination (derived rule)

¬¬p

p

1 ¬¬p

2 ¬p

3 ¬p∧¬¬p ∧-I, 1, 2

4 p ¬E, 2–3

18 / 25

Page 79: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: double negation elimination (derived rule)

¬¬p

p

1 ¬¬p

2 ¬p

3 ¬p∧¬¬p ∧-I, 1, 2

4 p ¬E, 2–3

18 / 25

Page 80: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: double negation elimination (derived rule)

¬¬p

p

1 ¬¬p

2 ¬p

3 ¬p∧¬¬p ∧-I, 1, 2

4 p ¬E, 2–3

18 / 25

Page 81: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Example: double negation elimination (derived rule)

¬¬p

p

1 ¬¬p

2 ¬p

3 ¬p∧¬¬p ∧-I, 1, 2

4 p ¬E, 2–3

18 / 25

Page 82: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Equivalence

p↔ q means p is true if and only if q is trueWe can make the definition

p↔ q ≡ (p→ q)∧ (q→ p)

which would naturally give us these rulesintroduction rule:

p→ q q→ p

p↔ qelimination rules:

p↔ q

p→ q

p↔ q

q→ p

19 / 25

Page 83: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Equivalence — Rules

Alternatively we can get rules which don’t involve the→ symbol↔-I (↔ introduction) [p] [q]

... ...q p

p↔ q↔-E (↔ elimination)

p↔ q p

q

p↔ q q

pNote the similarities to the→-I and→-E rules

20 / 25

Page 84: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Which rule to use next?

Guided by the “form” of your goal, and what you already have proved“form” — ie, look at the connective: ∧,∨,→,¬always can consider using ¬-E (not elimination) ruleto prove p∨q, ∨-I (or introduction) may not work

p

p ∨ q

q

p ∨ q

p may not be necessarily true, q may not be necessarily true

21 / 25

Page 85: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

To prove p∨q, sometimes you need to do this:

1 Using ¬-E, assume ¬(p∨q) (hoping to prove some contradiction)2 When is ¬(p∨q) true ? When both p and q false!3 From ¬(p∨q) how to prove ¬p ? (next slide)4 Having proved both ¬p and ¬q, prove some further contradiction

Exercise: prove¬p→ q

p∨q

22 / 25

Page 86: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Not-or elimination (derived rule)

¬(p∨q)

¬p

1 ¬(p∨q)

2 p

3 p∨q ∨-I, 2

4 (p∨q)∧¬(p∨q) ∧-I, 1, 3

5 ¬p ¬I, 2–4

23 / 25

Page 87: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Not-or elimination (derived rule)

¬(p∨q)

¬p

1 ¬(p∨q)

2 p

3 p∨q ∨-I, 2

4 (p∨q)∧¬(p∨q) ∧-I, 1, 3

5 ¬p ¬I, 2–4

23 / 25

Page 88: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Not-or elimination (derived rule)

¬(p∨q)

¬p

1 ¬(p∨q)

2 p

3 p∨q ∨-I, 2

4 (p∨q)∧¬(p∨q) ∧-I, 1, 3

5 ¬p ¬I, 2–4

23 / 25

Page 89: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Not-or elimination (derived rule)

¬(p∨q)

¬p

1 ¬(p∨q)

2 p

3 p∨q ∨-I, 2

4 (p∨q)∧¬(p∨q) ∧-I, 1, 3

5 ¬p ¬I, 2–4

23 / 25

Page 90: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Not-or elimination (derived rule)

¬(p∨q)

¬p

1 ¬(p∨q)

2 p

3 p∨q ∨-I, 2

4 (p∨q)∧¬(p∨q) ∧-I, 1, 3

5 ¬p ¬I, 2–4

23 / 25

Page 91: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Not-or elimination (derived rule)

¬(p∨q)

¬p

1 ¬(p∨q)

2 p

3 p∨q ∨-I, 2

4 (p∨q)∧¬(p∨q) ∧-I, 1, 3

5 ¬p ¬I, 2–4

23 / 25

Page 92: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Not-or elimination (derived rule)

¬(p∨q)

¬p

1 ¬(p∨q)

2 p

3 p∨q ∨-I, 2

4 (p∨q)∧¬(p∨q) ∧-I, 1, 3

5 ¬p ¬I, 2–4

23 / 25

Page 93: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Proving a contrapositive rule

In the same way, whenever you can prove anyp

q

then you can prove¬q¬p

1 ¬q

2 p

3 q your proof of q from p

4 q∧¬q ∧-I, 1, 3

5 ¬p ¬I, 2–4

24 / 25

Page 94: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Proving a contrapositive rule

In the same way, whenever you can prove anyp

q

then you can prove¬q¬p

1 ¬q

2 p

3 q your proof of q from p

4 q∧¬q ∧-I, 1, 3

5 ¬p ¬I, 2–4

24 / 25

Page 95: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Proving a contrapositive rule

In the same way, whenever you can prove anyp

q

then you can prove¬q¬p

1 ¬q

2 p

3 q your proof of q from p

4 q∧¬q ∧-I, 1, 3

5 ¬p ¬I, 2–4

24 / 25

Page 96: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Proving a contrapositive rule

In the same way, whenever you can prove anyp

q

then you can prove¬q¬p

1 ¬q

2 p

3 q your proof of q from p

4 q∧¬q ∧-I, 1, 3

5 ¬p ¬I, 2–4

24 / 25

Page 97: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Proving a contrapositive rule

In the same way, whenever you can prove anyp

q

then you can prove¬q¬p

1 ¬q

2 p

3 q your proof of q from p

4 q∧¬q ∧-I, 1, 3

5 ¬p ¬I, 2–4

24 / 25

Page 98: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Proving a contrapositive rule

In the same way, whenever you can prove anyp

q

then you can prove¬q¬p

1 ¬q

2 p

3 q your proof of q from p

4 q∧¬q ∧-I, 1, 3

5 ¬p ¬I, 2–4

24 / 25

Page 99: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Proving a contrapositive rule

In the same way, whenever you can prove anyp

q

then you can prove¬q¬p

1 ¬q

2 p

3 q your proof of q from p

4 q∧¬q ∧-I, 1, 3

5 ¬p ¬I, 2–4

24 / 25

Page 100: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Law of the excluded middle (derived)

p ∨¬p“Everything must either be or not be.” – Russell

1 ¬(p∨¬p)

2 ¬p ¬∨-E (previous slide), 1

3 ¬¬p ¬∨-E (previous slide), 1

4 ¬p∧¬¬p ∧-I, 2, 3

5 p∨¬p ¬E, 1–4

25 / 25

Page 101: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Law of the excluded middle (derived)

p ∨¬p“Everything must either be or not be.” – Russell

1 ¬(p∨¬p)

2 ¬p ¬∨-E (previous slide), 1

3 ¬¬p ¬∨-E (previous slide), 1

4 ¬p∧¬¬p ∧-I, 2, 3

5 p∨¬p ¬E, 1–4

25 / 25

Page 102: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Law of the excluded middle (derived)

p ∨¬p“Everything must either be or not be.” – Russell

1 ¬(p∨¬p)

2 ¬p ¬∨-E (previous slide), 1

3 ¬¬p ¬∨-E (previous slide), 1

4 ¬p∧¬¬p ∧-I, 2, 3

5 p∨¬p ¬E, 1–4

25 / 25

Page 103: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Law of the excluded middle (derived)

p ∨¬p“Everything must either be or not be.” – Russell

1 ¬(p∨¬p)

2 ¬p ¬∨-E (previous slide), 1

3 ¬¬p ¬∨-E (previous slide), 1

4 ¬p∧¬¬p ∧-I, 2, 3

5 p∨¬p ¬E, 1–4

25 / 25

Page 104: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Law of the excluded middle (derived)

p ∨¬p“Everything must either be or not be.” – Russell

1 ¬(p∨¬p)

2 ¬p ¬∨-E (previous slide), 1

3 ¬¬p ¬∨-E (previous slide), 1

4 ¬p∧¬¬p ∧-I, 2, 3

5 p∨¬p ¬E, 1–4

25 / 25

Page 105: Propositional natural deduction · Example - transitivity of implication (derived rule) We prove p!q q!r p!r 1 p!q 2 q!r 3 p 4 q!-E, 1, 3 5 r!-E, 2, 4 6 p!r!-I, 3–5 Lines 1 and

Law of the excluded middle (derived)

p ∨¬p“Everything must either be or not be.” – Russell

1 ¬(p∨¬p)

2 ¬p ¬∨-E (previous slide), 1

3 ¬¬p ¬∨-E (previous slide), 1

4 ¬p∧¬¬p ∧-I, 2, 3

5 p∨¬p ¬E, 1–4

25 / 25