You are on page 1of 98

Natural deduction for first order logic

COMP2600 / COMP6260

Dirk Pattinson
Australian National University

Semester 2, 2016
Recap: propositional natural deduction

[p] [p] [¬p]


.. .. ..
q p p→q q ∧ ¬q q ∧ ¬q
p→q q ¬p p

p q p ∧ q p ∧ q
p ∧ q p q

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

1 / 33
First-order logic

First-order logic is an extension of propositional logic.


First-order logic is useful when quantifying over the elements of some
domain.
More details in Lecture 1

Example:
Natural language First order logic
All COMP2600 students are happy. ∀x . student(x ) → happy(x )
Lisa is a COMP2600 student. student(Lisa)
Lisa is happy. happy(Lisa)

2 / 33
Finding proofs in first-order logic

Truth tables are virtually useless here


The exception is where domains are small
Natural deduction helps
There are introduction and elimination rules for quantifiers
There 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
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
An example of domain finiteness

“There is an integer between 4 and 7 that is divisible


by 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
Negating “there exists”

¬ (∃ x . P (x )) ↔ (∀ x . ¬ P (x ))
Examples:
I “No students dislike COMP2600”.
I ¬ ∃ s ∈ Student. s dislikes COMP2600

I ∀ s ∈ Student. ¬ s dislikes COMP2600

I “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
Negating “for all”

¬ (∀ x . P (x )) ↔ (∃ x . ¬ P (x ))
Examples:
I “Not all students passed the exam”.
I ¬ ∀ s ∈ Student. s passed the exam

I ∃ s ∈ Student. ¬ s passed the exam

I “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
Mixed negated quantifiers

Here are four different expressions of the fact that there is no upper bound to
the 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
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
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


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

10 / 33
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
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 rules
for propositional logic.

12 / 33
Instantiation

∀-E (universal instantiation)


∀x . P (x )
P (a)

13 / 33
Instantiation

∀-E (universal instantiation)


∀x . P (x )
P (a)

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

m Fish(a) → HasFins(a) ∀-E, n


If a predicate is true for all members of a domain, then it is also true for a
specific one (a must be a member of the domain).

13 / 33
Generalisation
P (a) (a arbitrary, a variable)
∀-I (universal generalisation)
∀x . P (x )

14 / 33
Generalisation
P (a) (a arbitrary, a variable)
∀-I (universal generalisation)
∀x . P (x )

n a ..

.. ..

m Cat(a) → EatsFish(a)

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

14 / 33
Generalisation
P (a) (a arbitrary, a variable)
∀-I (universal generalisation)
∀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, and
I 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
Breaching the arbitrariness requirement

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

15 / 33
Breaching the arbitrariness requirement

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

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

15 / 33
Breaching the arbitrariness requirement

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

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

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

15 / 33
Breaching the arbitrariness requirement

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

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

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

3 Cat(kitty) ∧-E, 1

15 / 33
Breaching the arbitrariness requirement

When we generalise for a variable a, the same proof steps must be possible for
all 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

15 / 33
Breaching the arbitrariness requirement

When we generalise for a variable a, the same proof steps must be possible for
all 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 in
the scope of that assumption)

15 / 33
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?

16 / 33
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
Example

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

17 / 33
Example

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

17 / 33
Example

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

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

17 / 33
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

17 / 33
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

17 / 33
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

17 / 33
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, 4
Exercise: also show the reverse to get equivalence, ↔

17 / 33
Generalisation

∃-I (existential generalisation)

P (a)
∃x . P (x )

18 / 33
Generalisation

∃-I (existential generalisation)

P (a)
∃x . P (x )

n Dog(fido)
.. ..

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

18 / 33
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, 2
Which step is invalid ??

19 / 33
Instantiation

[P (a)]
..
∃x . P (x ) 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 follows
as 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
Example

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


Prove
∃x . Huge(x )

21 / 33
Example

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


Prove
∃x . Huge(x )

21 / 33
Example

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


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

21 / 33
Example

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


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

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

21 / 33
Example

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


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

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

3 a Elephant(a)

21 / 33
Example

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


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

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

3 a Elephant(a)

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

21 / 33
Example

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


Prove
∃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

21 / 33
Example

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


Prove
∃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

21 / 33
Example

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


Prove
∃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 that
Elephant(x ), assume that individual is a

21 / 33
Swapping the order of existential quantifiers

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

22 / 33
Swapping the order of existential quantifiers

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

22 / 33
Swapping the order of existential quantifiers

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

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

22 / 33
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 )

22 / 33
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 )

22 / 33
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

22 / 33
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

22 / 33
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

22 / 33
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–6
Exercise: also show the converse to get equivalence, ↔

22 / 33
Swapping the order of existential and universal
quantifiers

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

23 / 33
Swapping the order of existential and universal
quantifiers

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

23 / 33
Swapping the order of existential and universal
quantifiers

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

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

23 / 33
Swapping the order of existential and universal
quantifiers

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

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

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

23 / 33
Swapping the order of existential and universal
quantifiers

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

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

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

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

23 / 33
Swapping the order of existential and universal
quantifiers

∃x . ∀y . P (x , y )
Proof of
∀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

23 / 33
Swapping the order of existential and universal
quantifiers

∃x . ∀y . P (x , y )
Proof of
∀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

23 / 33
Swapping the order of existential and universal
quantifiers

∃x . ∀y . P (x , y )
Proof of
∀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
Swapping the order of existential and universal
quantifiers
∃x . ∀y . P (x , y )
Another proof of
∀y . ∃x . P (x , y )

24 / 33
Swapping the order of existential and universal
quantifiers
∃x . ∀y . P (x , y )
Another proof of
∀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.

24 / 33
Swapping the order of existential and universal
quantifiers
∃x . ∀y . P (x , y )
Another proof of
∀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.

24 / 33
Swapping the order of existential and universal
quantifiers
∃x . ∀y . P (x , y )
Another proof of
∀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 )

24 / 33
Swapping the order of existential and universal
quantifiers
∃x . ∀y . P (x , y )
Another proof of
∀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 )

24 / 33
Swapping the order of existential and universal
quantifiers
∃x . ∀y . P (x , y )
Another proof of
∀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

24 / 33
Swapping the order of existential and universal
quantifiers
∃x . ∀y . P (x , y )
Another proof of
∀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

24 / 33
Swapping the order of existential and universal
quantifiers
∃x . ∀y . P (x , y )
Another proof of
∀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

24 / 33
Swapping the order of existential and universal
quantifiers
∃x . ∀y . P (x , y )
Another proof of
∀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
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.

25 / 33
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.

25 / 33
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
The “quantifier negation” equivalence

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

26 / 33
The “quantifier negation” equivalence

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

26 / 33
The “quantifier negation” equivalence

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

1 ¬(∃x . P (x ))

26 / 33
The “quantifier negation” equivalence

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

1 ¬(∃x . P (x ))

2 a P (a)

26 / 33
The “quantifier negation” equivalence

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

1 ¬(∃x . P (x ))

2 a P (a)

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

26 / 33
The “quantifier negation” equivalence

(∀x . ¬ P (x )) ↔ ¬(∃x . P (x ))
¬(∃x . P (x ))
Prove
∀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

26 / 33
The “quantifier negation” equivalence

(∀x . ¬ P (x )) ↔ ¬(∃x . P (x ))
¬(∃x . P (x ))
Prove
∀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

26 / 33
The “quantifier negation” equivalence

(∀x . ¬ P (x )) ↔ ¬(∃x . P (x ))
¬(∃x . P (x ))
Prove
∀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
The “quantifier negation” equivalence

Proof of the converse:

27 / 33
The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬ P (x )

27 / 33
The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬ P (x )

2 ∃x . P (x )

27 / 33
The “quantifier negation” equivalence

Proof of the converse:

1 ∀x . ¬ P (x )

2 ∃x . P (x )

3 a P (a)

27 / 33
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

27 / 33
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

27 / 33
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

27 / 33
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

27 / 33
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
Introduction to metalogic

Various proof methods to prove a statement in propositional calculus


I Truth tables
I Natural deduction

We hope these all are correct, whatever that means


At least we would hope these all give the same answers!

28 / 33
Soundness and completeness

A propositional statement is valid iff it can be proved using truth tables


In this case, we use truth tables as our definition of the semantics of
propositional logic

When using another proof method such as natural deduction, must ensure it:
only proves valid statements, and
proves 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 valid
Complete, if every valid statement or rule is derivable

29 / 33
Showing soundness

For each rule, need to show that whenever both the premises are true, then
so is the conclusion
i.e. show that rules preserve validity
Uses induction similar to that we saw last week

30 / 33
Showing completeness

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


individual rules
Showing completeness:
Idea is to reproduce the truth-table in a natural deduction proof
Steps of each sub-proof similar to the calculations in the truth-table
Use derived rules to mimic the truth-table definition of each connective

31 / 33
The importance of soundness and completeness

Soundness assures us that:


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

32 / 33
Metalogic of first order logic

First order natural deduction is sound and complete


So you can find a proof of any valid statement
But the truth-tables aren’t finite — you can’t actually prove or disprove a
statement by truth-tables
If there is a proof you can find it by mindlessly trying all sequences of rules of
length 1, length 2, . . .
But if you don’t find a proof, you haven’t established anything
First order logic is semi-decidable

33 / 33

You might also like