natural deduction for first order logicfirst-order logic first-order logic is an extension of...

98
Natural deduction for first order logic COMP2600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2016

Upload: others

Post on 09-Jun-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Natural deduction for first order logicCOMP2600 / COMP6260

Dirk PattinsonAustralian National University

Semester 2, 2016

Page 2: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Recap: propositional natural deduction

[p]...q

p→q

p p→q

q

[p]...q ∧ ¬q

¬p

[¬p]...q ∧ ¬q

p

p q

p ∧ q

p ∧ q

p

p ∧ q

q

p

p ∨ q

p

q ∨ p

[p] [q]... ...p ∨ q r r

r

1 / 33

Page 3: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

First-order logic

First-order logic is an extension of propositional logic.First-order logic is useful when quantifying over the elements of somedomain.More details in Lecture 1

Example:

Natural language First order logicAll COMP2600 students are happy. ∀x . student(x)→happy(x)Lisa is a COMP2600 student. student(Lisa)Lisa is happy. happy(Lisa)

2 / 33

Page 4: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Finding proofs in first-order logic

Truth tables are virtually useless hereThe exception is where domains are smallNatural deduction helpsThere are introduction and elimination rules for quantifiersThere are some handy equational rules which help

Example proof of why COMP2600 student Lisa is happy:

1 ∀x . student(x)→happy(x)

2 student(Lisa)

3 student(Lisa)→happy(Lisa) ∀-E, 1

4 happy(Lisa) →-E, 2, 3

3 / 33

Page 5: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Quantifiers

Over finite domains

D = {x1,x2, . . . ,xn}(∀x ∈ D. P(x))≡ P(x1)∧P(x2)∧ . . .∧P(xn)

D = {x1,x2, . . . ,xn}(∃x ∈ D. P(x))≡ P(x1)∨P(x2)∨ . . .∨P(xn)

4 / 33

Page 6: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

An example of domain finiteness

“There is an integer between 4 and 7 that is divisibleby all integers between 1 and 3.”

∃n ∈ {4,5,6,7}. ∀m ∈ {1,2,3}. n mod m = 0

((4 mod 1 = 0)∧ (4 mod 2 = 0)∧ (4 mod 3 = 0)) ∨((5 mod 1 = 0)∧ (5 mod 2 = 0)∧ (5 mod 3 = 0)) ∨((6 mod 1 = 0)∧ (6 mod 2 = 0)∧ (6 mod 3 = 0)) ∨((7 mod 1 = 0)∧ (7 mod 2 = 0)∧ (7 mod 3 = 0))

5 / 33

Page 7: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Negating “there exists”

¬ (∃x . P(x)) ↔ (∀x . ¬P(x))

Examples:I “No students dislike COMP2600”.I ¬∃s ∈ Student. s dislikes COMP2600I ∀s ∈ Student. ¬s dislikes COMP2600I “All students like COMP2600”.

Think about finite domains and compare to De Morgan’s laws!¬(p∨q)↔ (¬p∧¬q) ; ¬(p1∨ . . .∨pn)↔ (¬p1∧ . . .∧¬pn)

6 / 33

Page 8: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Negating “for all”

¬ (∀x . P(x)) ↔ (∃x . ¬P(x))

Examples:I “Not all students passed the exam”.I ¬∀s ∈ Student. s passed the examI ∃s ∈ Student. ¬s passed the examI “There are some students who did not pass the exam”.

Compare to De Morgan’s laws!¬(p∧q)↔ (¬p∨¬q) ; ¬(p1∧ . . .∧pn)↔ (¬p1∨ . . .∨¬pn)

7 / 33

Page 9: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Mixed negated quantifiers

Here are four different expressions of the fact that there is no upper bound tothe natural numbers.We can shift from one to the other by negating the quantifiers.

¬∃m. ∀n. m ≥ n

∀m. ¬∀n. m ≥ n

∀m. ∃n. ¬m ≥ n

∀m. ∃n. m < n

8 / 33

Page 10: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Existential quantifiers with empty domains

Consider the existential formula:

∃x ∈ /0. P(x)

The definition of the existential quantifier says that this should be false,regardless of P, since there are no elements that could exist.

As a result, the following is true:

(∃x ∈ /0. P(x)) ≡ F

9 / 33

Page 11: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Universal quantifiers with empty domains

Consider the universally quantified formula:

∀x ∈ /0. P(x)

What does “for all x in the empty set” mean?

Use the negation rule

(∀x ∈ /0. P(x)) ≡ ¬ (∃x ∈ /0. ¬P(x))

We have(∀x ∈ /0. P(x)) ≡ T

10 / 33

Page 12: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Universal quantifiers with empty domains

“All unicorns climb trees”.Since the set of unicorns is empty, the statement is true.The statement can never be disproved by finding a counterexample.

11 / 33

Page 13: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Natural deduction in first-order logic

∀-E universal instantiation;∀-I universal generalisation;∃-E existential instantiation;∃-I existential generalisation;

Proof in first-order logic is usually based on these rules, together with the rulesfor propositional logic.

12 / 33

Page 14: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Instantiation

∀-E (universal instantiation)∀x . P(x)

P(a)

n ∀x . Fish(x)→HasFins(x)

... ...

m Fish(a)→HasFins(a) ∀-E, nIf a predicate is true for all members of a domain, then it is also true for aspecific one (a must be a member of the domain).

13 / 33

Page 15: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Instantiation

∀-E (universal instantiation)∀x . P(x)

P(a)

n ∀x . Fish(x)→HasFins(x)

... ...

m Fish(a)→HasFins(a) ∀-E, nIf a predicate is true for all members of a domain, then it is also true for aspecific one (a must be a member of the domain).

13 / 33

Page 16: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Generalisation

∀-I (universal generalisation)P(a) (a arbitrary, a variable)

∀x . P(x)

n a ...

... ...

m Cat(a)→EatsFish(a)

m+1 ∀x . Cat(x)→EatsFish(x)

The a on the left of the bar is a guard which reminds us that:I this variable is local to the inner derivation, andI it cannot be free in an assumption

It is like an “assumption” that a is an arbitrary member of the domain.That is, the proof from lines n to m must work for anything in place of a.

14 / 33

Page 17: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Generalisation

∀-I (universal generalisation)P(a) (a arbitrary, a variable)

∀x . P(x)

n a ...

... ...

m Cat(a)→EatsFish(a)

m+1 ∀x . Cat(x)→EatsFish(x)

The a on the left of the bar is a guard which reminds us that:I this variable is local to the inner derivation, andI it cannot be free in an assumption

It is like an “assumption” that a is an arbitrary member of the domain.That is, the proof from lines n to m must work for anything in place of a.

14 / 33

Page 18: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Generalisation

∀-I (universal generalisation)P(a) (a arbitrary, a variable)

∀x . P(x)

n a ...

... ...

m Cat(a)→EatsFish(a)

m+1 ∀x . Cat(x)→EatsFish(x)

The a on the left of the bar is a guard which reminds us that:I this variable is local to the inner derivation, andI it cannot be free in an assumption

It is like an “assumption” that a is an arbitrary member of the domain.That is, the proof from lines n to m must work for anything in place of a.

14 / 33

Page 19: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Breaching the arbitrariness requirement

When we generalise for a variable a, the same proof steps must be possible forall members of the domain.

1 (Cat(kitty)→HasFur(kitty)) ∧ Cat(kitty)

2 Cat(kitty)→HasFur(kitty) ∧-E, 1

3 Cat(kitty) ∧-E, 1

4 HasFur(kitty) →-E, 2, 3

5 ∀x . HasFur(x) WRONG ∀-I, 4

WRONG because kitty appears in an assumption (step 1) (and step 4 is still inthe scope of that assumption)

15 / 33

Page 20: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Breaching the arbitrariness requirement

When we generalise for a variable a, the same proof steps must be possible forall members of the domain.

1 (Cat(kitty)→HasFur(kitty)) ∧ Cat(kitty)

2 Cat(kitty)→HasFur(kitty) ∧-E, 1

3 Cat(kitty) ∧-E, 1

4 HasFur(kitty) →-E, 2, 3

5 ∀x . HasFur(x) WRONG ∀-I, 4

WRONG because kitty appears in an assumption (step 1) (and step 4 is still inthe scope of that assumption)

15 / 33

Page 21: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Breaching the arbitrariness requirement

When we generalise for a variable a, the same proof steps must be possible forall members of the domain.

1 (Cat(kitty)→HasFur(kitty)) ∧ Cat(kitty)

2 Cat(kitty)→HasFur(kitty) ∧-E, 1

3 Cat(kitty) ∧-E, 1

4 HasFur(kitty) →-E, 2, 3

5 ∀x . HasFur(x) WRONG ∀-I, 4

WRONG because kitty appears in an assumption (step 1) (and step 4 is still inthe scope of that assumption)

15 / 33

Page 22: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Breaching the arbitrariness requirement

When we generalise for a variable a, the same proof steps must be possible forall members of the domain.

1 (Cat(kitty)→HasFur(kitty)) ∧ Cat(kitty)

2 Cat(kitty)→HasFur(kitty) ∧-E, 1

3 Cat(kitty) ∧-E, 1

4 HasFur(kitty) →-E, 2, 3

5 ∀x . HasFur(x) WRONG ∀-I, 4

WRONG because kitty appears in an assumption (step 1) (and step 4 is still inthe scope of that assumption)

15 / 33

Page 23: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Breaching the arbitrariness requirement

When we generalise for a variable a, the same proof steps must be possible forall members of the domain.

1 (Cat(kitty)→HasFur(kitty)) ∧ Cat(kitty)

2 Cat(kitty)→HasFur(kitty) ∧-E, 1

3 Cat(kitty) ∧-E, 1

4 HasFur(kitty) →-E, 2, 3

5 ∀x . HasFur(x) WRONG ∀-I, 4

WRONG because kitty appears in an assumption (step 1) (and step 4 is still inthe scope of that assumption)

15 / 33

Page 24: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Breaching the arbitrariness requirement

When we generalise for a variable a, the same proof steps must be possible forall members of the domain.

1 (Cat(kitty)→HasFur(kitty)) ∧ Cat(kitty)

2 Cat(kitty)→HasFur(kitty) ∧-E, 1

3 Cat(kitty) ∧-E, 1

4 HasFur(kitty) →-E, 2, 3

5 ∀x . HasFur(x) WRONG ∀-I, 4

WRONG because kitty appears in an assumption (step 1) (and step 4 is still inthe scope of that assumption)

15 / 33

Page 25: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Free and bound variables

Bound: Every occurrence of variable x in ∀x . p(x) and in ∃x . p(x) is bound.Free: Every occurrence of a variable that is not bound is free.Example:

(∀x . x + y = y + x) ∧ (∀x . ∃y . y > x + z)

Q: Which occurrences of variables are free and which are bound?

A: All occurrences of x are bound; none of z are; and just the last 2occurrences of y are bound.Hence the instance of z is free, as are the first two occurrences of y .

16 / 33

Page 26: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Free and bound variables

Bound: Every occurrence of variable x in ∀x . p(x) and in ∃x . p(x) is bound.Free: Every occurrence of a variable that is not bound is free.Example:

(∀x . x + y = y + x) ∧ (∀x . ∃y . y > x + z)

Q: Which occurrences of variables are free and which are bound?A: All occurrences of x are bound; none of z are; and just the last 2

occurrences of y are bound.Hence the instance of z is free, as are the first two occurrences of y .

16 / 33

Page 27: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

(∀x . ∀y . P(x ,y)) ↔ (∀y . ∀x . P(x ,y))

1 ∀x . ∀y . P(x ,y)

2 b a ∀y . P(a,y) ∀-E, 1

3 P(a,b) ∀-E, 2

4 ∀x . P(x ,b) ∀-I, 3

5 ∀y . ∀x . P(x ,y) ∀-I, 4Exercise: also show the reverse to get equivalence,↔

17 / 33

Page 28: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

(∀x . ∀y . P(x ,y)) ↔ (∀y . ∀x . P(x ,y))

1 ∀x . ∀y . P(x ,y)

2 b a ∀y . P(a,y) ∀-E, 1

3 P(a,b) ∀-E, 2

4 ∀x . P(x ,b) ∀-I, 3

5 ∀y . ∀x . P(x ,y) ∀-I, 4Exercise: also show the reverse to get equivalence,↔

17 / 33

Page 29: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

(∀x . ∀y . P(x ,y)) ↔ (∀y . ∀x . P(x ,y))

1 ∀x . ∀y . P(x ,y)

2 b a ∀y . P(a,y) ∀-E, 1

3 P(a,b) ∀-E, 2

4 ∀x . P(x ,b) ∀-I, 3

5 ∀y . ∀x . P(x ,y) ∀-I, 4Exercise: also show the reverse to get equivalence,↔

17 / 33

Page 30: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

(∀x . ∀y . P(x ,y)) ↔ (∀y . ∀x . P(x ,y))

1 ∀x . ∀y . P(x ,y)

2 b a ∀y . P(a,y) ∀-E, 1

3 P(a,b) ∀-E, 2

4 ∀x . P(x ,b) ∀-I, 3

5 ∀y . ∀x . P(x ,y) ∀-I, 4Exercise: also show the reverse to get equivalence,↔

17 / 33

Page 31: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

(∀x . ∀y . P(x ,y)) ↔ (∀y . ∀x . P(x ,y))

1 ∀x . ∀y . P(x ,y)

2 b a ∀y . P(a,y) ∀-E, 1

3 P(a,b) ∀-E, 2

4 ∀x . P(x ,b) ∀-I, 3

5 ∀y . ∀x . P(x ,y) ∀-I, 4Exercise: also show the reverse to get equivalence,↔

17 / 33

Page 32: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

(∀x . ∀y . P(x ,y)) ↔ (∀y . ∀x . P(x ,y))

1 ∀x . ∀y . P(x ,y)

2 b a ∀y . P(a,y) ∀-E, 1

3 P(a,b) ∀-E, 2

4 ∀x . P(x ,b) ∀-I, 3

5 ∀y . ∀x . P(x ,y) ∀-I, 4Exercise: also show the reverse to get equivalence,↔

17 / 33

Page 33: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

(∀x . ∀y . P(x ,y)) ↔ (∀y . ∀x . P(x ,y))

1 ∀x . ∀y . P(x ,y)

2 b a ∀y . P(a,y) ∀-E, 1

3 P(a,b) ∀-E, 2

4 ∀x . P(x ,b) ∀-I, 3

5 ∀y . ∀x . P(x ,y) ∀-I, 4Exercise: also show the reverse to get equivalence,↔

17 / 33

Page 34: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Generalisation

∃-I (existential generalisation)

P(a)

∃x . P(x)

n Dog(fido)

... ...

m ∃x . Dog(x) ∃-I, n

18 / 33

Page 35: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Generalisation

∃-I (existential generalisation)

P(a)

∃x . P(x)

n Dog(fido)

... ...

m ∃x . Dog(x) ∃-I, n

18 / 33

Page 36: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

An invalid argument

This argument is invalid if the domain is empty.

1 ∀x . P(x)

2 P(a) ∀-E, 1

3 ∃x . P(x) ∃-I, 2Which step is invalid ??

19 / 33

Page 37: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Instantiation

∃x . P(x)

[P(a)]...q (a arbitrary, a variable)

q (a not free in q)

Rationale: if P(x) holds for some individual x ,let that individual be called a (so P(a) holds)prove that q followsas q doesn’t involve our choice of a,q holds regardless of which individual has P true

The proof of q from P(a) must work for any individual in place of a

20 / 33

Page 38: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

Prove∃x . Elephant(x) ∀x . Elephant(x)→Huge(x)

∃x . Huge(x)

1 ∃x . Elephant(x)

2 ∀x . Elephant(x)→Huge(x)

3 a Elephant(a)

4 Elephant(a)→Huge(a) ∀-E, 2

5 Huge(a) →-E, 3, 4

6 ∃x . Huge(x) ∃-I, 5

7 ∃x . Huge(x) ∃-E, 1, 3–6

The notation reflects an assumption: since there is some individual x such thatElephant(x), assume that individual is a

21 / 33

Page 39: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

Prove∃x . Elephant(x) ∀x . Elephant(x)→Huge(x)

∃x . Huge(x)

1 ∃x . Elephant(x)

2 ∀x . Elephant(x)→Huge(x)

3 a Elephant(a)

4 Elephant(a)→Huge(a) ∀-E, 2

5 Huge(a) →-E, 3, 4

6 ∃x . Huge(x) ∃-I, 5

7 ∃x . Huge(x) ∃-E, 1, 3–6

The notation reflects an assumption: since there is some individual x such thatElephant(x), assume that individual is a

21 / 33

Page 40: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

Prove∃x . Elephant(x) ∀x . Elephant(x)→Huge(x)

∃x . Huge(x)1 ∃x . Elephant(x)

2 ∀x . Elephant(x)→Huge(x)

3 a Elephant(a)

4 Elephant(a)→Huge(a) ∀-E, 2

5 Huge(a) →-E, 3, 4

6 ∃x . Huge(x) ∃-I, 5

7 ∃x . Huge(x) ∃-E, 1, 3–6

The notation reflects an assumption: since there is some individual x such thatElephant(x), assume that individual is a

21 / 33

Page 41: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

Prove∃x . Elephant(x) ∀x . Elephant(x)→Huge(x)

∃x . Huge(x)1 ∃x . Elephant(x)

2 ∀x . Elephant(x)→Huge(x)

3 a Elephant(a)

4 Elephant(a)→Huge(a) ∀-E, 2

5 Huge(a) →-E, 3, 4

6 ∃x . Huge(x) ∃-I, 5

7 ∃x . Huge(x) ∃-E, 1, 3–6

The notation reflects an assumption: since there is some individual x such thatElephant(x), assume that individual is a

21 / 33

Page 42: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

Prove∃x . Elephant(x) ∀x . Elephant(x)→Huge(x)

∃x . Huge(x)1 ∃x . Elephant(x)

2 ∀x . Elephant(x)→Huge(x)

3 a Elephant(a)

4 Elephant(a)→Huge(a) ∀-E, 2

5 Huge(a) →-E, 3, 4

6 ∃x . Huge(x) ∃-I, 5

7 ∃x . Huge(x) ∃-E, 1, 3–6

The notation reflects an assumption: since there is some individual x such thatElephant(x), assume that individual is a

21 / 33

Page 43: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

Prove∃x . Elephant(x) ∀x . Elephant(x)→Huge(x)

∃x . Huge(x)1 ∃x . Elephant(x)

2 ∀x . Elephant(x)→Huge(x)

3 a Elephant(a)

4 Elephant(a)→Huge(a) ∀-E, 2

5 Huge(a) →-E, 3, 4

6 ∃x . Huge(x) ∃-I, 5

7 ∃x . Huge(x) ∃-E, 1, 3–6

The notation reflects an assumption: since there is some individual x such thatElephant(x), assume that individual is a

21 / 33

Page 44: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

Prove∃x . Elephant(x) ∀x . Elephant(x)→Huge(x)

∃x . Huge(x)1 ∃x . Elephant(x)

2 ∀x . Elephant(x)→Huge(x)

3 a Elephant(a)

4 Elephant(a)→Huge(a) ∀-E, 2

5 Huge(a) →-E, 3, 4

6 ∃x . Huge(x) ∃-I, 5

7 ∃x . Huge(x) ∃-E, 1, 3–6

The notation reflects an assumption: since there is some individual x such thatElephant(x), assume that individual is a

21 / 33

Page 45: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

Prove∃x . Elephant(x) ∀x . Elephant(x)→Huge(x)

∃x . Huge(x)1 ∃x . Elephant(x)

2 ∀x . Elephant(x)→Huge(x)

3 a Elephant(a)

4 Elephant(a)→Huge(a) ∀-E, 2

5 Huge(a) →-E, 3, 4

6 ∃x . Huge(x) ∃-I, 5

7 ∃x . Huge(x) ∃-E, 1, 3–6

The notation reflects an assumption: since there is some individual x such thatElephant(x), assume that individual is a

21 / 33

Page 46: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Example

Prove∃x . Elephant(x) ∀x . Elephant(x)→Huge(x)

∃x . Huge(x)1 ∃x . Elephant(x)

2 ∀x . Elephant(x)→Huge(x)

3 a Elephant(a)

4 Elephant(a)→Huge(a) ∀-E, 2

5 Huge(a) →-E, 3, 4

6 ∃x . Huge(x) ∃-I, 5

7 ∃x . Huge(x) ∃-E, 1, 3–6

The notation reflects an assumption: since there is some individual x such thatElephant(x), assume that individual is a

21 / 33

Page 47: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential quantifiers

(∃x . ∃y . P(x ,y)) ↔ (∃y . ∃x . P(x ,y))

1 ∃x . ∃y . P(x ,y)

2 a ∃y . P(a,y)

3 b P(a,b)

4 ∃x . P(x ,b) ∃-I, 3

5 ∃y . ∃x . P(x ,y) ∃-I, 4

6 ∃y . ∃x . P(x ,y) ∃-E, 2, 3–5

7 ∃y . ∃x . P(x ,y) ∃-E, 1, 2–6Exercise: also show the converse to get equivalence,↔

22 / 33

Page 48: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential quantifiers

(∃x . ∃y . P(x ,y)) ↔ (∃y . ∃x . P(x ,y))

1 ∃x . ∃y . P(x ,y)

2 a ∃y . P(a,y)

3 b P(a,b)

4 ∃x . P(x ,b) ∃-I, 3

5 ∃y . ∃x . P(x ,y) ∃-I, 4

6 ∃y . ∃x . P(x ,y) ∃-E, 2, 3–5

7 ∃y . ∃x . P(x ,y) ∃-E, 1, 2–6Exercise: also show the converse to get equivalence,↔

22 / 33

Page 49: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential quantifiers

(∃x . ∃y . P(x ,y)) ↔ (∃y . ∃x . P(x ,y))

1 ∃x . ∃y . P(x ,y)

2 a ∃y . P(a,y)

3 b P(a,b)

4 ∃x . P(x ,b) ∃-I, 3

5 ∃y . ∃x . P(x ,y) ∃-I, 4

6 ∃y . ∃x . P(x ,y) ∃-E, 2, 3–5

7 ∃y . ∃x . P(x ,y) ∃-E, 1, 2–6Exercise: also show the converse to get equivalence,↔

22 / 33

Page 50: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential quantifiers

(∃x . ∃y . P(x ,y)) ↔ (∃y . ∃x . P(x ,y))

1 ∃x . ∃y . P(x ,y)

2 a ∃y . P(a,y)

3 b P(a,b)

4 ∃x . P(x ,b) ∃-I, 3

5 ∃y . ∃x . P(x ,y) ∃-I, 4

6 ∃y . ∃x . P(x ,y) ∃-E, 2, 3–5

7 ∃y . ∃x . P(x ,y) ∃-E, 1, 2–6Exercise: also show the converse to get equivalence,↔

22 / 33

Page 51: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential quantifiers

(∃x . ∃y . P(x ,y)) ↔ (∃y . ∃x . P(x ,y))

1 ∃x . ∃y . P(x ,y)

2 a ∃y . P(a,y)

3 b P(a,b)

4 ∃x . P(x ,b) ∃-I, 3

5 ∃y . ∃x . P(x ,y) ∃-I, 4

6 ∃y . ∃x . P(x ,y) ∃-E, 2, 3–5

7 ∃y . ∃x . P(x ,y) ∃-E, 1, 2–6Exercise: also show the converse to get equivalence,↔

22 / 33

Page 52: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential quantifiers

(∃x . ∃y . P(x ,y)) ↔ (∃y . ∃x . P(x ,y))

1 ∃x . ∃y . P(x ,y)

2 a ∃y . P(a,y)

3 b P(a,b)

4 ∃x . P(x ,b) ∃-I, 3

5 ∃y . ∃x . P(x ,y) ∃-I, 4

6 ∃y . ∃x . P(x ,y) ∃-E, 2, 3–5

7 ∃y . ∃x . P(x ,y) ∃-E, 1, 2–6Exercise: also show the converse to get equivalence,↔

22 / 33

Page 53: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential quantifiers

(∃x . ∃y . P(x ,y)) ↔ (∃y . ∃x . P(x ,y))

1 ∃x . ∃y . P(x ,y)

2 a ∃y . P(a,y)

3 b P(a,b)

4 ∃x . P(x ,b) ∃-I, 3

5 ∃y . ∃x . P(x ,y) ∃-I, 4

6 ∃y . ∃x . P(x ,y) ∃-E, 2, 3–5

7 ∃y . ∃x . P(x ,y) ∃-E, 1, 2–6Exercise: also show the converse to get equivalence,↔

22 / 33

Page 54: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential quantifiers

(∃x . ∃y . P(x ,y)) ↔ (∃y . ∃x . P(x ,y))

1 ∃x . ∃y . P(x ,y)

2 a ∃y . P(a,y)

3 b P(a,b)

4 ∃x . P(x ,b) ∃-I, 3

5 ∃y . ∃x . P(x ,y) ∃-I, 4

6 ∃y . ∃x . P(x ,y) ∃-E, 2, 3–5

7 ∃y . ∃x . P(x ,y) ∃-E, 1, 2–6Exercise: also show the converse to get equivalence,↔

22 / 33

Page 55: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential quantifiers

(∃x . ∃y . P(x ,y)) ↔ (∃y . ∃x . P(x ,y))

1 ∃x . ∃y . P(x ,y)

2 a ∃y . P(a,y)

3 b P(a,b)

4 ∃x . P(x ,b) ∃-I, 3

5 ∃y . ∃x . P(x ,y) ∃-I, 4

6 ∃y . ∃x . P(x ,y) ∃-E, 2, 3–5

7 ∃y . ∃x . P(x ,y) ∃-E, 1, 2–6Exercise: also show the converse to get equivalence,↔

22 / 33

Page 56: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

1 ∃x . ∀y . P(x ,y)

2 b a ∀y . P(a,y)

3 P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∃x . P(x ,b) ∃-E, 1, 2–4

6 ∀y . ∃x . P(x ,y) ∀-I, 5

23 / 33

Page 57: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

1 ∃x . ∀y . P(x ,y)

2 b a ∀y . P(a,y)

3 P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∃x . P(x ,b) ∃-E, 1, 2–4

6 ∀y . ∃x . P(x ,y) ∀-I, 5

23 / 33

Page 58: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

1 ∃x . ∀y . P(x ,y)

2 b a ∀y . P(a,y)

3 P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∃x . P(x ,b) ∃-E, 1, 2–4

6 ∀y . ∃x . P(x ,y) ∀-I, 5

23 / 33

Page 59: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

1 ∃x . ∀y . P(x ,y)

2 b a ∀y . P(a,y)

3 P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∃x . P(x ,b) ∃-E, 1, 2–4

6 ∀y . ∃x . P(x ,y) ∀-I, 5

23 / 33

Page 60: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

1 ∃x . ∀y . P(x ,y)

2 b a ∀y . P(a,y)

3 P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∃x . P(x ,b) ∃-E, 1, 2–4

6 ∀y . ∃x . P(x ,y) ∀-I, 5

23 / 33

Page 61: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

1 ∃x . ∀y . P(x ,y)

2 b a ∀y . P(a,y)

3 P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∃x . P(x ,b) ∃-E, 1, 2–4

6 ∀y . ∃x . P(x ,y) ∀-I, 5

23 / 33

Page 62: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

1 ∃x . ∀y . P(x ,y)

2 b a ∀y . P(a,y)

3 P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∃x . P(x ,b) ∃-E, 1, 2–4

6 ∀y . ∃x . P(x ,y) ∀-I, 5

23 / 33

Page 63: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

1 ∃x . ∀y . P(x ,y)

2 b a ∀y . P(a,y)

3 P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∃x . P(x ,b) ∃-E, 1, 2–4

6 ∀y . ∃x . P(x ,y) ∀-I, 5

23 / 33

Page 64: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Another proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

We got the previous proof by first looking at the goal, (∀y . . . .), so using ∀-I.Here we first look at what we have, (∃x . . . .), and so use ∃-E.

1 ∃x . ∀y . P(x ,y)

2 a ∀y . P(a,y)

3 b P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∀y . ∃x . P(x ,y) ∀-I, 4

6 ∀y . ∃x . P(x ,y) ∃-E, 1, 2–5

24 / 33

Page 65: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Another proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

We got the previous proof by first looking at the goal, (∀y . . . .), so using ∀-I.Here we first look at what we have, (∃x . . . .), and so use ∃-E.

1 ∃x . ∀y . P(x ,y)

2 a ∀y . P(a,y)

3 b P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∀y . ∃x . P(x ,y) ∀-I, 4

6 ∀y . ∃x . P(x ,y) ∃-E, 1, 2–5

24 / 33

Page 66: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Another proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

We got the previous proof by first looking at the goal, (∀y . . . .), so using ∀-I.Here we first look at what we have, (∃x . . . .), and so use ∃-E.

1 ∃x . ∀y . P(x ,y)

2 a ∀y . P(a,y)

3 b P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∀y . ∃x . P(x ,y) ∀-I, 4

6 ∀y . ∃x . P(x ,y) ∃-E, 1, 2–5

24 / 33

Page 67: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Another proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

We got the previous proof by first looking at the goal, (∀y . . . .), so using ∀-I.Here we first look at what we have, (∃x . . . .), and so use ∃-E.

1 ∃x . ∀y . P(x ,y)

2 a ∀y . P(a,y)

3 b P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∀y . ∃x . P(x ,y) ∀-I, 4

6 ∀y . ∃x . P(x ,y) ∃-E, 1, 2–5

24 / 33

Page 68: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Another proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

We got the previous proof by first looking at the goal, (∀y . . . .), so using ∀-I.Here we first look at what we have, (∃x . . . .), and so use ∃-E.

1 ∃x . ∀y . P(x ,y)

2 a ∀y . P(a,y)

3 b P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∀y . ∃x . P(x ,y) ∀-I, 4

6 ∀y . ∃x . P(x ,y) ∃-E, 1, 2–5

24 / 33

Page 69: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Another proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

We got the previous proof by first looking at the goal, (∀y . . . .), so using ∀-I.Here we first look at what we have, (∃x . . . .), and so use ∃-E.

1 ∃x . ∀y . P(x ,y)

2 a ∀y . P(a,y)

3 b P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∀y . ∃x . P(x ,y) ∀-I, 4

6 ∀y . ∃x . P(x ,y) ∃-E, 1, 2–5

24 / 33

Page 70: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Another proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

We got the previous proof by first looking at the goal, (∀y . . . .), so using ∀-I.Here we first look at what we have, (∃x . . . .), and so use ∃-E.

1 ∃x . ∀y . P(x ,y)

2 a ∀y . P(a,y)

3 b P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∀y . ∃x . P(x ,y) ∀-I, 4

6 ∀y . ∃x . P(x ,y) ∃-E, 1, 2–5

24 / 33

Page 71: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Another proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

We got the previous proof by first looking at the goal, (∀y . . . .), so using ∀-I.Here we first look at what we have, (∃x . . . .), and so use ∃-E.

1 ∃x . ∀y . P(x ,y)

2 a ∀y . P(a,y)

3 b P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∀y . ∃x . P(x ,y) ∀-I, 4

6 ∀y . ∃x . P(x ,y) ∃-E, 1, 2–5

24 / 33

Page 72: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Swapping the order of existential and universalquantifiers

Another proof of∃x . ∀y . P(x ,y)∀y . ∃x . P(x ,y)

We got the previous proof by first looking at the goal, (∀y . . . .), so using ∀-I.Here we first look at what we have, (∃x . . . .), and so use ∃-E.

1 ∃x . ∀y . P(x ,y)

2 a ∀y . P(a,y)

3 b P(a,b) ∀-E, 2

4 ∃x . P(x ,b) ∃-I, 3

5 ∀y . ∃x . P(x ,y) ∀-I, 4

6 ∀y . ∃x . P(x ,y) ∃-E, 1, 2–5

24 / 33

Page 73: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Can quantifiers always be swapped?

∃x . ∀y . Eats(x ,y) → ∀y . ∃x . Eats(x ,y)There is an animal All foods can be eaten

that can eat all foods. by some animal.

∀y . ∃x . Eats(x ,y) → ∃x . ∀y . Eats(x ,y)All foods can be eaten There is an animal

by some animal. that can eat all foods.

Is this second version true? Try to prove it. What happens?

25 / 33

Page 74: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Can quantifiers always be swapped?

∃x . ∀y . Eats(x ,y) → ∀y . ∃x . Eats(x ,y)There is an animal All foods can be eaten

that can eat all foods. by some animal.

∀y . ∃x . Eats(x ,y) → ∃x . ∀y . Eats(x ,y)All foods can be eaten There is an animal

by some animal. that can eat all foods.

Is this second version true? Try to prove it. What happens?

25 / 33

Page 75: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Can quantifiers always be swapped?

∃x . ∀y . Eats(x ,y) → ∀y . ∃x . Eats(x ,y)There is an animal All foods can be eaten

that can eat all foods. by some animal.

∀y . ∃x . Eats(x ,y) → ∃x . ∀y . Eats(x ,y)All foods can be eaten There is an animal

by some animal. that can eat all foods.

Is this second version true? Try to prove it. What happens?

25 / 33

Page 76: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

(∀x . ¬P(x)) ↔ ¬(∃x . P(x))

Prove¬(∃x . P(x))

∀x . ¬P(x)

1 ¬(∃x . P(x))

2 a P(a)

3 ∃x . P(x) ∃-I, 2

4 (∃x . P(x))∧¬(∃x . P(x)) ∧-I, 1, 3

5 ¬P(a) ¬I, 2–4

6 ∀x . ¬P(x) ∀-I, 5

26 / 33

Page 77: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

(∀x . ¬P(x)) ↔ ¬(∃x . P(x))

Prove¬(∃x . P(x))

∀x . ¬P(x)

1 ¬(∃x . P(x))

2 a P(a)

3 ∃x . P(x) ∃-I, 2

4 (∃x . P(x))∧¬(∃x . P(x)) ∧-I, 1, 3

5 ¬P(a) ¬I, 2–4

6 ∀x . ¬P(x) ∀-I, 5

26 / 33

Page 78: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

(∀x . ¬P(x)) ↔ ¬(∃x . P(x))

Prove¬(∃x . P(x))

∀x . ¬P(x)

1 ¬(∃x . P(x))

2 a P(a)

3 ∃x . P(x) ∃-I, 2

4 (∃x . P(x))∧¬(∃x . P(x)) ∧-I, 1, 3

5 ¬P(a) ¬I, 2–4

6 ∀x . ¬P(x) ∀-I, 5

26 / 33

Page 79: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

(∀x . ¬P(x)) ↔ ¬(∃x . P(x))

Prove¬(∃x . P(x))

∀x . ¬P(x)

1 ¬(∃x . P(x))

2 a P(a)

3 ∃x . P(x) ∃-I, 2

4 (∃x . P(x))∧¬(∃x . P(x)) ∧-I, 1, 3

5 ¬P(a) ¬I, 2–4

6 ∀x . ¬P(x) ∀-I, 5

26 / 33

Page 80: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

(∀x . ¬P(x)) ↔ ¬(∃x . P(x))

Prove¬(∃x . P(x))

∀x . ¬P(x)

1 ¬(∃x . P(x))

2 a P(a)

3 ∃x . P(x) ∃-I, 2

4 (∃x . P(x))∧¬(∃x . P(x)) ∧-I, 1, 3

5 ¬P(a) ¬I, 2–4

6 ∀x . ¬P(x) ∀-I, 5

26 / 33

Page 81: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

(∀x . ¬P(x)) ↔ ¬(∃x . P(x))

Prove¬(∃x . P(x))

∀x . ¬P(x)

1 ¬(∃x . P(x))

2 a P(a)

3 ∃x . P(x) ∃-I, 2

4 (∃x . P(x))∧¬(∃x . P(x)) ∧-I, 1, 3

5 ¬P(a) ¬I, 2–4

6 ∀x . ¬P(x) ∀-I, 5

26 / 33

Page 82: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

(∀x . ¬P(x)) ↔ ¬(∃x . P(x))

Prove¬(∃x . P(x))

∀x . ¬P(x)

1 ¬(∃x . P(x))

2 a P(a)

3 ∃x . P(x) ∃-I, 2

4 (∃x . P(x))∧¬(∃x . P(x)) ∧-I, 1, 3

5 ¬P(a) ¬I, 2–4

6 ∀x . ¬P(x) ∀-I, 5

26 / 33

Page 83: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

(∀x . ¬P(x)) ↔ ¬(∃x . P(x))

Prove¬(∃x . P(x))

∀x . ¬P(x)

1 ¬(∃x . P(x))

2 a P(a)

3 ∃x . P(x) ∃-I, 2

4 (∃x . P(x))∧¬(∃x . P(x)) ∧-I, 1, 3

5 ¬P(a) ¬I, 2–4

6 ∀x . ¬P(x) ∀-I, 5

26 / 33

Page 84: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬P(x)

2 ∃x . P(x)

3 a P(a)

4 ¬P(a) ∀-E, 1

5 P(a)∧¬P(a) ∧-I, 3, 4

6 ⊥ see below

7 ⊥ ∃-E, 2, 3–6

8 ¬(∃x . P(x)) ¬I, 2–7

Think of ⊥ as an abbreviation for any contradiction, say, q∧¬q.From step 5 to 6 uses the proof of the derived rule “contradiction elimination”.

27 / 33

Page 85: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬P(x)

2 ∃x . P(x)

3 a P(a)

4 ¬P(a) ∀-E, 1

5 P(a)∧¬P(a) ∧-I, 3, 4

6 ⊥ see below

7 ⊥ ∃-E, 2, 3–6

8 ¬(∃x . P(x)) ¬I, 2–7

Think of ⊥ as an abbreviation for any contradiction, say, q∧¬q.From step 5 to 6 uses the proof of the derived rule “contradiction elimination”.

27 / 33

Page 86: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬P(x)

2 ∃x . P(x)

3 a P(a)

4 ¬P(a) ∀-E, 1

5 P(a)∧¬P(a) ∧-I, 3, 4

6 ⊥ see below

7 ⊥ ∃-E, 2, 3–6

8 ¬(∃x . P(x)) ¬I, 2–7

Think of ⊥ as an abbreviation for any contradiction, say, q∧¬q.From step 5 to 6 uses the proof of the derived rule “contradiction elimination”.

27 / 33

Page 87: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬P(x)

2 ∃x . P(x)

3 a P(a)

4 ¬P(a) ∀-E, 1

5 P(a)∧¬P(a) ∧-I, 3, 4

6 ⊥ see below

7 ⊥ ∃-E, 2, 3–6

8 ¬(∃x . P(x)) ¬I, 2–7

Think of ⊥ as an abbreviation for any contradiction, say, q∧¬q.From step 5 to 6 uses the proof of the derived rule “contradiction elimination”.

27 / 33

Page 88: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬P(x)

2 ∃x . P(x)

3 a P(a)

4 ¬P(a) ∀-E, 1

5 P(a)∧¬P(a) ∧-I, 3, 4

6 ⊥ see below

7 ⊥ ∃-E, 2, 3–6

8 ¬(∃x . P(x)) ¬I, 2–7

Think of ⊥ as an abbreviation for any contradiction, say, q∧¬q.From step 5 to 6 uses the proof of the derived rule “contradiction elimination”.

27 / 33

Page 89: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬P(x)

2 ∃x . P(x)

3 a P(a)

4 ¬P(a) ∀-E, 1

5 P(a)∧¬P(a) ∧-I, 3, 4

6 ⊥ see below

7 ⊥ ∃-E, 2, 3–6

8 ¬(∃x . P(x)) ¬I, 2–7

Think of ⊥ as an abbreviation for any contradiction, say, q∧¬q.From step 5 to 6 uses the proof of the derived rule “contradiction elimination”.

27 / 33

Page 90: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬P(x)

2 ∃x . P(x)

3 a P(a)

4 ¬P(a) ∀-E, 1

5 P(a)∧¬P(a) ∧-I, 3, 4

6 ⊥ see below

7 ⊥ ∃-E, 2, 3–6

8 ¬(∃x . P(x)) ¬I, 2–7

Think of ⊥ as an abbreviation for any contradiction, say, q∧¬q.From step 5 to 6 uses the proof of the derived rule “contradiction elimination”.

27 / 33

Page 91: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬P(x)

2 ∃x . P(x)

3 a P(a)

4 ¬P(a) ∀-E, 1

5 P(a)∧¬P(a) ∧-I, 3, 4

6 ⊥ see below

7 ⊥ ∃-E, 2, 3–6

8 ¬(∃x . P(x)) ¬I, 2–7

Think of ⊥ as an abbreviation for any contradiction, say, q∧¬q.From step 5 to 6 uses the proof of the derived rule “contradiction elimination”.

27 / 33

Page 92: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬P(x)

2 ∃x . P(x)

3 a P(a)

4 ¬P(a) ∀-E, 1

5 P(a)∧¬P(a) ∧-I, 3, 4

6 ⊥ see below

7 ⊥ ∃-E, 2, 3–6

8 ¬(∃x . P(x)) ¬I, 2–7

Think of ⊥ as an abbreviation for any contradiction, say, q∧¬q.From step 5 to 6 uses the proof of the derived rule “contradiction elimination”.

27 / 33

Page 93: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Introduction to metalogic

Various proof methods to prove a statement in propositional calculusI Truth tablesI Natural deduction

We hope these all are correct, whatever that meansAt least we would hope these all give the same answers!

28 / 33

Page 94: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Soundness and completeness

A propositional statement is valid iff it can be proved using truth tablesIn this case, we use truth tables as our definition of the semantics ofpropositional logic

When using another proof method such as natural deduction, must ensure it:only proves valid statements, andproves every valid statement

Formally, we say that a proof system (such as the rules of natural deduction) is

Sound, if every derivable (ie, provable) statement or rule is validComplete, if every valid statement or rule is derivable

29 / 33

Page 95: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Showing soundness

For each rule, need to show that whenever both the premises are true, thenso is the conclusioni.e. show that rules preserve validityUses induction similar to that we saw last week

30 / 33

Page 96: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Showing completeness

Note: completeness is a property of the whole set of rules, rather than ofindividual rulesShowing completeness:

Idea is to reproduce the truth-table in a natural deduction proofSteps of each sub-proof similar to the calculations in the truth-tableUse derived rules to mimic the truth-table definition of each connective

31 / 33

Page 97: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

The importance of soundness and completeness

Soundness assures us that:every correct natural deduction proof proves a valid statementCompleteness assures us that:there exists a natural deduction proof for every valid statement

32 / 33

Page 98: Natural deduction for first order logicFirst-order logic First-order logic is an extension of propositional logic. First-order logic is useful when quantifying over the elements of

Metalogic of first order logic

First order natural deduction is sound and completeSo you can find a proof of any valid statementBut the truth-tables aren’t finite — you can’t actually prove or disprove astatement by truth-tablesIf there is a proof you can find it by mindlessly trying all sequences of rules oflength 1, length 2, . . .But if you don’t find a proof, you haven’t established anythingFirst order logic is semi-decidable

33 / 33