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

Logical Structures Lecture 1. Declarative Sentences and Natural Deduction

This document provides an introduction to logical structures through declarative sentences and natural deduction. It begins with examples of declarative sentences and their symbolic representation. Next, it describes the core rules of natural deduction, including conjunction introduction and elimination. The document aims to establish a system for valid deductive reasoning through a calculus of natural deduction rules.

Uploaded by

Nam Phương
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)
45 views

Logical Structures Lecture 1. Declarative Sentences and Natural Deduction

This document provides an introduction to logical structures through declarative sentences and natural deduction. It begins with examples of declarative sentences and their symbolic representation. Next, it describes the core rules of natural deduction, including conjunction introduction and elimination. The document aims to establish a system for valid deductive reasoning through a calculus of natural deduction rules.

Uploaded by

Nam Phương
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/ 78

LOGICAL STRUCTURES

Lecture 1. Declarative sentences and Natural deduction

Bui Anh Tuan


Advanced Program in Computer Science

Spring, 2021

Bui Anh Tuan Page 1/59


Contents

1 Declarative sentences
2 Natural deduction
Rules for natural deduction
Derived rules
Provable equivalence
Proof by contradiction

Bui Anh Tuan Page 2/59


Declarative Sentences

Examples

Example 1.1
If the train arrives late and there are no taxis at the station, then John is
late for his meeting. John is not late for his meeting. The train did arrive
late. Therefore, there were taxis at the station.

Bui Anh Tuan Page 3/59


Declarative Sentences

Examples

Example 1.1
If the train arrives late and there are no taxis at the station, then John is
late for his meeting. John is not late for his meeting. The train did arrive
late. Therefore, there were taxis at the station.

Example 1.2
If it is raining and Jane does not have her umbrella with her, then she will
get wet. Jane is not wet. It is raining. Therefore, Jane has her umbrella
with her.

Bui Anh Tuan Page 3/59


Declarative Sentences

Examples

Example 1.3
If Superman were able and willing to prevent evil, he would do so. If
Superman were unable to prevent evil, he would be impotent; if he were
unwilling to prevent evil, he would be malevolent. Superman does not
prevent evil. If Superman exists, he is neither impotent nor malevolent.
Therefore, Superman does not exist.

Bui Anh Tuan Page 4/59


Declarative Sentences

Declarative Sentences

Definition 1.4
Declarative sentence is a sentence that declares a fact.

Bui Anh Tuan Page 5/59


Declarative Sentences

Declarative Sentences

Definition 1.4
Declarative sentence is a sentence that declares a fact.

Example 1.5
Declarative sentences
1 The sum of the numbers 3 and 5 equals 8.
2 Jane reacted violently to Jacks accusations.
3 Every even natural number > 2 is the sum of two prime numbers
(Goldbach’s conjecture).
4 All Martians like pepperoni on their pizza.
5 Albert Camus était un écrivain français.
6 Die Wur̈de des Menschen ist unantastbar.

Bui Anh Tuan Page 5/59


Declarative Sentences

Declarative Sentences

Example 1.6
Not declarative sentences
1 What time is it?
2 No smoking!
3 What a beautiful day!
4 Could you please pass me the salt?
5 Ready, steady, go!
6 May fortune come your way.

Bui Anh Tuan Page 6/59


Declarative Sentences

Declarative Sentences

We need to develop a calculus of reasoning which allows us to draw


conclusions from given assumptions which are reliable in the sense
that they preserve truth: if all our assumptions are true, then our
conclusion ought to be true as well.
Given any true property of a computer program, we can find an
argument in our calculus that has this property as its conclusion.
Example 1.5(3): Every even natural number > 2 is the sum of two
prime numbers (Goldbach’s conjecture).

Bui Anh Tuan Page 7/59


Declarative Sentences

Symbolic design

1 Consider certain declarative sentences as being atomic, or


indecomposable, like the sentence
‘The number 5 is even.’
2 Assign certain distinct symbols p, q, r, . . . to each of these atomic
sentences and we can then code up more complex sentences in a
compositional way.

Bui Anh Tuan Page 8/59


Declarative Sentences

Symbolic design

Consider some atomic sentences:

p : ‘I won the lottery last week.’


q : ‘I purchased a lottery ticket.’
r : ‘I won last week’s sweepstakes.’

Form more complex sentences:

¬ : The negation of p is denoted by ¬p and expresses


‘I did not win the lottery last week’
∨ : disjunction of p and r, p ∨ r, at least one of them is true.
‘I won the lottery last week, or I won last week’s sweepstakes’

Bui Anh Tuan Page 9/59


Declarative Sentences

Symbolic design

Consider some atomic sentences:

p : ‘I won the lottery last week.’


q : ‘I purchased a lottery ticket.’
r : ‘I won last week’s sweepstakes.’

Form more complex sentences:

∧ : conjunction of p and r, p ∧ r, both are true.


‘Last week I won the lottery and the sweepstakes.’
→ : implication between p and q, p → q (p is the assumption, q is
the conclusion)
‘If I won the lottery last week, then I purchased a lottery ticket’

Bui Anh Tuan Page 10/59


Declarative Sentences

Binding priorities

Complex sentence:
p ∧ q → ¬r ∨ q
means ‘if p and q then not r or q’
A computer would require the insertion of brackets

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

Convention
¬ binds more tightly than ∨ and ∧, and the latter two bind more tightly
than →. Implication → is right-associative: expressions of the form
p → q → r denote p → (q → r).

Bui Anh Tuan Page 11/59


Declarative Sentences

Binding priorities

Exercise: The formulas of propositional logic below implicitly assume the


binding priorities of the logical connectives put forward in Convention.
Make sure that you fully understand those conventions by reinserting as
many brackets as possible.

1 ¬p ∧ q → r
2 (p → q) → (r → s ∨ t)
3 p ∨ q → ¬p ∧ r

Bui Anh Tuan Page 12/59


Natural Deduction

Introduction

Establish the validity of Examples 1.1 and 1.2?


Need a set of rules each of which allows us to draw a conclusion given
a certain arrangement of premises: proof rules.
Suppose we have a set of formulas φ1 , φ2 , . . . , φn , premises, and
another formula ψ, conclusion.

This expression is called a sequent; it is valid if a proof for it can be


found

Bui Anh Tuan Page 13/59


Natural Deduction

Introduction

By an sequent, we mean a sequence of statements that ends with a


conclusion.
The conclusion is the last statement of the sequent.
The premises are the statements of the sequent preceding the
conclusion.
By a valid sequent, we mean that the conclusion must follow from the
truth of the premises.
Fallacy is form of incorrect reasoning which leads to invalid sequent.

Bui Anh Tuan Page 14/59


Natural Deduction

Introduction

Example 2.1
If the train arrives late and there are no taxis at the station, then John is
late for his meeting. John is not late for his meeting. The train did arrive
late. Therefore, there were taxis at the station.

Example 2.2
If it is raining and Jane does not have her umbrella with her, then she will
get wet. Jane is not wet. It is raining. Therefore, Jane has her umbrella
with her.

Sequent : p ∧ ¬q → r, ¬r, p ` q.

Bui Anh Tuan Page 15/59


Natural Deduction

Greek letters

Bui Anh Tuan Page 16/59


Natural Deduction

Rules for natural deduction

The rules for conjunction


The rules of double negation
The rule implies introduction
The rules for disjunction
The rules for negation

Bui Anh Tuan Page 17/59


Natural Deduction

The rules for conjunction

and-introduction: to prove φ ∧ ψ we need to prove φ and ψ


separately.

and-elimination:

1 ∧e1 : if we have a proof for φ ∧ ψ then by apply this rule we get a


proof for φ;
2 ∧e2 : if we have a proof for φ ∧ ψ then by apply this rule we get a
proof for ψ.

Bui Anh Tuan Page 18/59


Natural Deduction

The rules for conjunction


Example 2.3
Use rules for conjunction to prove that p ∧ q, r ` q ∧ r is valid.

write the premises, leave a gap and write the conclusion

fill the gap between the premises and the conclusion by applying a
suitable sequence of proof rules

Bui Anh Tuan Page 19/59


Natural Deduction

The rules for conjunction

fill the gap between the premises and the conclusion by applying a
suitable sequence of proof rules

proof in tree structure

Bui Anh Tuan Page 20/59


Natural Deduction

The rules for double negation

there is no difference between a formula φ and its double negation


¬¬φ.
‘It is not true that it does not rain.’
means
‘It rains.’
rules of elimination and introduction for double negation:

Bui Anh Tuan Page 21/59


Natural Deduction

The rules for double negation

Example 2.4
The proof for the sequent p, ¬¬(q ∧ r) ` ¬¬p ∧ r.

Bui Anh Tuan Page 22/59


Natural Deduction

The rules for double negation

Example 2.5
The proof for the sequent (p ∧ q) ∧ r, s ∧ t ` q ∧ r.

Bui Anh Tuan Page 23/59


Natural Deduction

The rule for eliminating implication

implies-elimination: (modus ponens, arrow-elimination)

Conclusion: q = ‘The street is wet.’


parameters φ and ψ for → e can be instantiated to any sentence

Bui Anh Tuan Page 24/59


Natural Deduction

The rule for eliminating implication

Example 2.6
The proof for the sequent p, p → q, p → (q → r) ` r

Bui Anh Tuan Page 25/59


Natural Deduction

Modus Tollens

Example 2.7
‘If Abraham Lincoln was Ethiopian, then he was African.
Abraham Lincoln was not African.
Therefore, he was not Ethiopian.

Bui Anh Tuan Page 26/59


Natural Deduction

Modus Tollens

Example 2.8
Proof for the sequent p → (q → r), p, ¬r ` ¬q

Bui Anh Tuan Page 27/59


Natural Deduction

Modus Tollens
Example 2.9
Combination of MT with ¬¬e or ¬¬i

proves that the sequent ¬p → q, ¬q ` p is valid.

shows the validity of the sequent p → ¬q, q ` ¬p.


Bui Anh Tuan Page 28/59
Natural Deduction

Exercises

Exercise: Prove the validity of the following sequents:

1 p → (p → q), p ` q.
2 q → (p → r), ¬r, q ` ¬p

Bui Anh Tuan Page 29/59


Natural Deduction

Rule implies introduction

MT shows that p → q, ¬q ` ¬p is valid.


Is p → q ` ¬q → ¬p valid? How to proof?
Mechanics: Suppose that p → q is true. If we temporarily assume
that ¬q holds, we can use MT to infer ¬p. Thus assuming p → q we
can show that ¬q implies ¬p, p → q.

Bui Anh Tuan Page 30/59


Natural Deduction

Rule implies introduction

Example 2.10
Proof using → i

Bui Anh Tuan Page 31/59


Natural Deduction

Definition 2.11
Logical formulas φ with valid sequent ` ψ are theorems.

Example 2.12
Theorem whose proof utilises most of the rules introduced so far

Bui Anh Tuan Page 32/59


Natural Deduction

Bui Anh Tuan Page 33/59


Natural Deduction

Example 2.13
Prove the validity of the sequent p ∧ q → r ` p → (q → r)

Bui Anh Tuan Page 34/59


Natural Deduction

Example 2.13
Prove the validity of the sequent p ∧ q → r ` p → (q → r)

Bui Anh Tuan Page 34/59


Natural Deduction

Example 2.14
Prove the validity of the ‘converse’ of the previous sequent

p → (q → r) ` p ∧ q → r

Bui Anh Tuan Page 35/59


Natural Deduction

Example 2.14
Prove the validity of the ‘converse’ of the previous sequent

p → (q → r) ` p ∧ q → r

We say that those two formulas are equivalent

Bui Anh Tuan Page 35/59


Natural Deduction

Example 2.15
Proof that uses introduction and-elimination rules for conjunction; it
shows the validity of the sequent

p→q `p∧r →q∧r

Bui Anh Tuan Page 36/59


Natural Deduction

Example 2.15
Proof that uses introduction and-elimination rules for conjunction; it
shows the validity of the sequent

p→q `p∧r →q∧r

Bui Anh Tuan Page 36/59


Natural Deduction

Exercises

Exercise 1: Prove the validity of the following sequents:

1 p ` (p → q) → q
2 (p → r) ∧ (q → r) ` p ∧ q → r

Exercise 2: Check the validity of the following sequents:

1 ¬p → ¬q ` q → p
2 p ∨ q, ¬q ∨ r ` p ∨ r

Bui Anh Tuan Page 37/59


Natural Deduction

Rules for Disjunction

or-introduction: introduction of disjunction

Bui Anh Tuan Page 38/59


Natural Deduction

Rules for Disjunction

or-elimination: Suppose that we want to show some proposition χ


by assuming φ ∨ ψ, we have to give two separate proofs which need
to combine into one argument:
First, we assume φ is true and have to come up with a proof of χ.
Next, we assume ψ is true and need to give a proof of χ as well.
Given these two proofs, we can infer χ from the truth of φ ∨ ψ, since
our case analysis above is exhaustive.

Bui Anh Tuan Page 39/59


Natural Deduction

Rules for Disjunction

Remark 2.1
p ∨ q ` q ∨ p is valid.

Bui Anh Tuan Page 40/59


Natural Deduction

Examples
Example 2.16
Prove that the sequent q → r ` p ∨ q → p ∨ r is valid

Bui Anh Tuan Page 41/59


Natural Deduction

Examples
Example 2.16
Prove that the sequent q → r ` p ∨ q → p ∨ r is valid

Bui Anh Tuan Page 41/59


Natural Deduction

Examples
Example 2.17
Prove that the sequent (p ∨ q) ∨ r ` p ∨ (q ∨ r) is valid

Bui Anh Tuan Page 42/59


Natural Deduction

Examples
Example 2.17
Prove that the sequent (p ∨ q) ∨ r ` p ∨ (q ∨ r) is valid

Bui Anh Tuan Page 42/59


Natural Deduction

Examples
Example 2.18
Prove that the sequent p ∧ (q ∨ r) → (p ∧ q) ∨ (p∧) is valid.

Bui Anh Tuan Page 43/59


Natural Deduction

Examples
Example 2.18
Prove that the sequent p ∧ (q ∨ r) → (p ∧ q) ∨ (p∧) is valid.

Bui Anh Tuan Page 43/59


Natural Deduction

Examples

Example 2.19
Prove that the sequent ` p → (q → p) is valid.

Bui Anh Tuan Page 44/59


Natural Deduction

Examples

Example 2.19
Prove that the sequent ` p → (q → p) is valid.

Bui Anh Tuan Page 44/59


Natural Deduction

Rules for Negation


Definition 2.20
Contradictions are expressions of the form φ ∧ ¬φ or ¬phi ∧ phi, where φ
is any formula.

Note: Any formula can be derived from a contradiction

p ∧ ¬p ` q

Rule of bottom-elimination (contradiction):

Negation-elimination:

Bui Anh Tuan Page 45/59


Natural Deduction

Examples

Example 2.21
Show that ¬p ∨ q ` p → q is valid.

Bui Anh Tuan Page 46/59


Natural Deduction

Examples

Example 2.21
Show that ¬p ∨ q ` p → q is valid.

Bui Anh Tuan Page 46/59


Natural Deduction

Negation-introduction

Negation-introduction:

Bui Anh Tuan Page 47/59


Natural Deduction

Examples
Example 2.22
Show that p → q, p → ¬q ` ¬p is valid.

Bui Anh Tuan Page 48/59


Natural Deduction

Examples
Example 2.22
Show that p → q, p → ¬q ` ¬p is valid.

Bui Anh Tuan Page 48/59


Natural Deduction

Examples
Example 2.23
Show that p → (q → r), p, ¬r ` ¬q is valid.

Bui Anh Tuan Page 49/59


Natural Deduction

Examples
Example 2.23
Show that p → (q → r), p, ¬r ` ¬q is valid.

Bui Anh Tuan Page 49/59


Natural Deduction

Examples
Example 2.24
Show that p ∧ ¬q → r, ¬r, p ` q is valid.

Bui Anh Tuan Page 50/59


Natural Deduction

Examples
Example 2.24
Show that p ∧ ¬q → r, ¬r, p ` q is valid.

Bui Anh Tuan Page 50/59


Natural Deduction

Derived Rules

Modus Tollens is not a primitive rule of natural


deduction, but it can be derived from some of the other rules.

Bui Anh Tuan Page 51/59


Natural Deduction

Derived Rules

Modus Tollens is not a primitive rule of natural


deduction, but it can be derived from some of the other rules. For
example, using → e, ¬e and ¬i as below

Bui Anh Tuan Page 51/59


Natural Deduction

Derived Rules

Two important derived rules are:

1 Proof by contradiction: (PBC for short, Latin name reductio ad


absurdum) if from ¬φ we obtain a contradiction, then we are entitled
to deduce φ:

Bui Anh Tuan Page 52/59


Natural Deduction

Derived Rules

Two important derived rules are:

1 Proof by contradiction: (PBC for short, Latin name reductio ad


absurdum) if from ¬φ we obtain a contradiction, then we are entitled
to deduce φ:

Bui Anh Tuan Page 52/59


Natural Deduction

Derived Rules

PBC can be derived from → i, ¬i, → e and ¬¬e as follows

Bui Anh Tuan Page 53/59


Natural Deduction

2 Law of Excluded Middle: (LEM for short, Latin name tertium non
datur or simply no third) φ ∨ ¬φ is true.

Bui Anh Tuan Page 54/59


Natural Deduction

2 Law of Excluded Middle: (LEM for short, Latin name tertium non
datur or simply no third) φ ∨ ¬φ is true.
Example: if-statements in programming language
‘if B {C1 } else {C2 }’

Bui Anh Tuan Page 54/59


Natural Deduction

2 Law of Excluded Middle: (LEM for short, Latin name tertium non
datur or simply no third) φ ∨ ¬φ is true.
Example: if-statements in programming language
‘if B {C1 } else {C2 }’

Bui Anh Tuan Page 54/59


Natural Deduction

Example 2.25
Using LEM, we show that p → q `6= p ∨ q is valid.

Bui Anh Tuan Page 55/59


Natural Deduction

Example 2.25
Using LEM, we show that p → q `6= p ∨ q is valid.

Bui Anh Tuan Page 55/59


Natural Deduction

Natural Deduction: Summary

Page 27 in the textbook.

Bui Anh Tuan Page 56/59


Natural Deduction

Provable Equivalence

Definition 2.26
Let φ and ψ are formulas of propositional logic. We say that φ and ψ are
provably equivalent iff the sequents φ ` ψ and ψ ` φ are valid and we
denote by φ a` ψ.

Bui Anh Tuan Page 57/59


Natural Deduction

Provable Equivalence

Definition 2.26
Let φ and ψ are formulas of propositional logic. We say that φ and ψ are
provably equivalent iff the sequents φ ` ψ and ψ ` φ are valid and we
denote by φ a` ψ.

Example 2.27
Examples of provably equivalent formulas are

Bui Anh Tuan Page 57/59


Natural Deduction

Extra Reading

Section 1.2.5. Proof by contradiction in the textbook.

Bui Anh Tuan Page 58/59


Natural Deduction

Exercises

Prove the validity of the following sequents

1 p → (q ∨ r), q → s, r → s ` p → s
2 (p ∧ q) ∨ (p ∧ r) ` p ∧ (q ∨ r)
3 p → q, r → s ` p ∧ r → q ∧ s

Bui Anh Tuan Page 59/59

You might also like