0% found this document useful (0 votes)
8 views12 pages

Mathematical Logic For Computer Science-Chp.08

Chapter 8 discusses the extension of deductive systems G and H from propositional logic to first-order logic, incorporating axioms and rules for the universal quantifier. It details the Gentzen system G and the Hilbert system H, including their axioms, rules of inference, and examples of proofs. The chapter concludes with theorems regarding the soundness and completeness of both systems.

Uploaded by

yuripakpahan2205
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)
8 views12 pages

Mathematical Logic For Computer Science-Chp.08

Chapter 8 discusses the extension of deductive systems G and H from propositional logic to first-order logic, incorporating axioms and rules for the universal quantifier. It details the Gentzen system G and the Hilbert system H, including their axioms, rules of inference, and examples of proofs. The chapter concludes with theorems regarding the soundness and completeness of both systems.

Uploaded by

yuripakpahan2205
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/ 12

Chapter 8

First-Order Logic: Deductive Systems

We extend the deductive systems G and H from propositional logic to first-order


logic by adding axioms and rules of inference for the universal quantifier. (The exis-
tential quantifier is defined as the dual of the universal quantifier.) The construction
of semantic tableaux for first-order logic included restrictions on the use of constants
and similar restrictions will be needed here.

8.1 Gentzen System G

Figure 8.1 is a closed semantic tableau for the negation of the valid formula

∀xp(x) ∨ ∀xq(x) → ∀x(p(x) ∨ q(x)).

The formulas to which rules are applied are underlined, while the sets of constants
C(n) in the labels of each node are implicit.
Let us turn the tree upside down and in every node n replace U (n), the set of
formulas labeling the node n, by Ū (n), the set of complements of the formulas in
U (n). The result (Fig. 8.2) is a Gentzen proof for the formula.
Here is the classification of quantified formulas into γ - and δ-formulas:

γ γ (a) δ δ(a)

∃xA(x) A(a) ∀xA(x) A(a)


¬ ∀xA(x) ¬ A(a) ¬ ∃xA(x) ¬ A(a)

Definition 8.1 The Gentzen system G is a deductive system. Its axioms are sets of
formulas U containing a complementary pair of literals. The rules of inference are
the rules given for α- and β-formulas in Sect. 3.2, together with the following rules
for γ - and δ-formulas:

M. Ben-Ari, Mathematical Logic for Computer Science, 155


DOI 10.1007/978-1-4471-4129-7_8, © Springer-Verlag London 2012
156 8 First-Order Logic: Deductive Systems

¬ (∀xp(x) ∨ ∀xq(x) → ∀x(p(x) ∨ q(x)))



∀xp(x) ∨ ∀xq(x), ¬ ∀x(p(x) ∨ q(x))
 
∀xp(x), ¬ ∀x(p(x) ∨ q(x)) ∀xq(x), ¬ ∀x(p(x) ∨ q(x))
↓ ↓
∀xp(x), ¬ (p(a) ∨ q(a)) ∀xq(x), ¬ (p(a) ∨ q(a))
↓ ↓
∀xp(x), ¬ p(a), ¬ q(a) ∀xq(x), ¬ p(a), ¬ q(a)
↓ ↓
∀xp(x), p(a), ¬ p(a), ¬ q(a) ∀xq(x), q(a), ¬ p(a), ¬ q(a)
× ×
Fig. 8.1 Semantic tableau in first-order logic

U ∪ {γ , γ (a)} U ∪ {δ(a)}
, .
U ∪ {γ } U ∪ {δ}

The rule for δ-formulas can be applied only if the constant a does not occur in any
formula of U .

The γ -rule can be read: if an existential formula and some instantiation of it are
true, then the instantiation is redundant.
The δ-rules formalizes the following frequently used method of mathematical
reasoning: Let a be an arbitrary constant. Suppose that A(a) can be proved. Since
a was arbitrary, the proof holds for ∀xA(x). In order to generalize from a specific
constant to for all, it is essential that a be an arbitrary constant and not one of the
constants that is constrained by another subformula.

¬ ∀xp(x), ¬ p(a), p(a), q(a) ¬ ∀xq(x), ¬ q(a), p(a), q(a)


↓ ↓
¬ ∀xp(x), p(a), q(a) ¬ ∀xq(x), p(a), q(a)
↓ ↓
¬ ∀xp(x), p(a) ∨ q(a) ¬ ∀xq(x), p(a) ∨ q(a)
↓ ↓
¬ ∀xp(x), ∀x(p(x) ∨ q(x)) ¬ ∀xq(x), ∀x(p(x) ∨ q(x))
 
¬ (∀xp(x) ∨ ∀xq(x)), ∀x(p(x) ∨ q(x))

∀xp(x) ∨ ∀xq(x) → ∀x(p(x) ∨ q(x))
Fig. 8.2 Gentzen proof tree in first-order logic
8.1 Gentzen System G 157

¬ ∀yp(a, y), ¬ p(a, b), ∃xp(x, b), p(a, b)



¬ ∀yp(a, y), ∃xp(x, b), p(a, b)

¬ ∀yp(a, y), ∃xp(x, b)

¬ ∀yp(a, y), ∀y∃xp(x, y)

¬ ∃x∀yp(x, y), ∀y∃xp(x, y)

∃x∀yp(x, y) → ∀y∃xp(x, y)

Fig. 8.3 Gentzen proof: use rules for γ -formulas followed by rules for δ-formulas

Example 8.2 The proof of ∃x∀yp(x, y) → ∀y∃xp(x, y) in Fig. 8.3 begins with the
axiom obtained from the complementary literals ¬ p(a, b) and p(a, b). Then the
rule for the γ -formulas is used twice:
U, ¬ ∀yp(a, y), ¬ p(a, b) U, ∃xp(x, b), p(a, b)
, .
U, ¬ ∀yp(a, y) U, ∃xp(x, b)
Once this is done, it is easy to apply rules for the δ-formulas because the constants
a and b appear only once so that the condition in the rule is satisfied:

U, ∃xp(x, b) U, ¬ ∀yp(a, y)
, .
U, ∀y∃xp(x, y) U, ¬ ∃x∀y∃xp(x, y)
A final application of the rule for the α-formula completes the proof.

We leave the proof of the soundness and completeness of G as an exercise.

Theorem 8.3 (Soundness and completeness) Let U be a set of formulas in first-


order logic. There is a Gentzen proof for U if and only if there is a closed semantic
tableau for Ū .
158 8 First-Order Logic: Deductive Systems

8.2 Hilbert System H

The Hilbert system H for propositional logic is extended to first-order logic by


adding two axioms and a rule of inference.

Definition 8.4 The axioms of the Hilbert system H for first-order logic are:

Axiom 1 (A → (B → A)),
Axiom 2 (A → (B → C)) → ((A → B) → (A → C)),
Axiom 3 (¬ B → ¬ A) → (A → B),
Axiom 4 ∀xA(x) → A(a),
Axiom 5 ∀x(A → B(x)) → (A → ∀xB(x)).

• In Axioms 1, 2 and 3, A, B and C are any formulas of first-order logic.


• In Axiom 4, A(x) is a formula with a free variable x.
• In Axiom 5, B(x) is a formula with a free variable x, while x is not a free variable
of the formula A.
The rules of inference are modus ponens and generalization:
A→B A A(a)
, .
B ∀xA(x)

Propositional Reasoning in First-Order Logic

Axioms 1, 2, 3 and the rule of inference MP are generalized to any formulas in first-
order logic so all of the theorems and derived rules of inference that we proved in
Chap. 3 can be used in first-order logic.

Example 8.5
∀xp(x) → (∃y∀xq(x, y) → ∀xp(x))
is an instance of Axiom 1 in first-order logic and:

∀xp(x) → (∃y∀xq(x, y) → ∀xp(x)) ∀xp(x)


∃y∀xq(x, y) → ∀xp(x)
uses the rule of inference modus ponens.

In the proofs in this chapter, we will not bother to give the details of deductions
that use propositional reasoning because these are easy to understand. The notation
PC will be used for propositional deductions.
8.2 Hilbert System H 159

Specialization and Generalization

Axiom 4 can also be used as a rule of inference:

Rule 8.6 (Axiom 4)


U ∀xA(x)
.
U A(a)

Any occurrence of ∀xA(x) can be replaced by A(a) for any a. If A(x) is true
whatever the assignment of a domain element of an interpretation I to x, then
A(a) is true for the domain element that I assigns to a.
The generalization rule of inference states that if a occurs in a formula, we may
bind all occurrences of a with the quantifier. Since a is arbitrary, that is the same as
saying that A(x) is true for all assignments to x.
There is a reason that the generalization rule was given only for formulas that
can be proved without a set of assumptions U :

A(a)
.
∀xA(x)

Example 8.7 Suppose that we were allowed to apply generalization to A(a) A(a)
to obtain A(a) ∀xA(x) and consider the interpretation:

(Z , {even(x)}, {2}).

The assumption A(a) is true but ∀xA(x) is not, which means that generalization is
not sound as it transforms A(a) |= A(a) into A(a) |= ∀xA(x).

Since proofs invariably have assumptions, a constraint must be placed on the


generalization rule to make it useful:

Rule 8.8 (Generalization)


U A(a)
,
U ∀xA(x)
provided that a does not appear in U .

The Deduction Rule

The Deduction rule is essential for proving theorems from assumptions.

Rule 8.9 (Deduction rule)


U ∪ {A} B
.
U A→B
160 8 First-Order Logic: Deductive Systems

Theorem 8.10 (Deduction Theorem) The deduction rule is sound.

Proof The proof is by induction on the length of the proof of U ∪ {A} B. We must
show how to obtain a proof of U A → B that does not use the deduction rule. The
proof for propositional logic (Theorem 3.14) is modified to take into account the
new axioms and generalization.
The modification for the additional axioms is trivial.
Consider now an application of the generalization rule, where, without loss of
generality, we assume that the generalization rule is applied to the immediately pre-
ceding formula in the proof:
i U ∪ {A} B(a)
i+1 U ∪ {A} ∀xB(x) Generalization
By the condition on the generalization rule in the presence of assumptions, a does
not appear in either U or A.
The proof that the deduction rule is sound is as follows:
i U ∪ {A} B(a)
i U A → B(a) Inductive hypothesis, i
i +1 U ∀x(A → B) Generalization, i
i +2 U ∀x(A → B) → (A → ∀xB) Axiom 5
i +3 U A → ∀xB MP, i + 1, i + 2
The fact that a does not appear in U is used in line i + 1 and the fact that a does
not appear in A is used in line i + 2.

8.3 Equivalence of H and G


We prove that any theorem that can be proved in G can also be proved in H .
We already know how to transform propositional proofs in G to proofs in H ; what
remains is to show that any application of the γ - and δ-rules in G can be transformed
into a proof in H .

Theorem 8.11 The rule for a γ -formula can be simulated in H .

Proof Suppose that the rule:


U ∨ ¬ ∀xA(x) ∨ ¬ A(a)
U ∨ ¬ ∀xA(x)
was used. This can be simulated in H as follows:
1. ∀xA(x) → A(a) Axiom 4
2. ¬ ∀xA(x) ∨ A(a) PC 1
3. U ∨ ¬ ∀xA(x) ∨ A(a) PC 2
4. U ∨ ¬ ∀xA(x) ∨ ¬ A(a) Assumption
5. U ∨ ¬ ∀xA(x) PC 3, 4
8.4 Proofs of Theorems in H 161

Theorem 8.12 The rule for a δ-formula can be simulated in H .

Proof Suppose that the rule:


U ∨ A(a)
U ∨ ∀xA(x)
was used. This can be simulated in H as follows:
1. U ∨ A(a) Assumption
2. ¬ U → A(a) PC 1
3. ∀x(¬ U → A(x)) Gen. 2
4. ∀x(¬ U → A(x)) → (¬ U → ∀xA(x)) Axiom 5
5. ¬ U → ∀xA(x) MP 3, 4
6. U ∨ ∀xA(x) PC 5
The use of Axiom 5 requires that a not occur in U , but we know that this holds by
the corresponding condition on the rule for the δ-formula.

Simulations in G of proofs in H are left as an exercise. From this follows:

Theorem 8.13 (Soundness and completeness) The Hilbert system H is sound and
complete.

8.4 Proofs of Theorems in H


We now give a series of theorems and proofs in H .
The first two are elementary theorems using existential quantifiers.

Theorem 8.14 A(a) → ∃xA(x).

Proof
1. ∀x¬ A(x) → ¬ A(a) Axiom 4
2. A(a) → ¬ ∀x¬ A(x) PC 1
3. A(a) → ∃xA(x) Definition ∃

Theorem 8.15 ∀xA(x) → ∃xA(x).

Proof
1. ∀xA(x) ∀xA(x) Assumption
2. ∀xA(x) A(a) Axiom 4
3. ∀xA(x) A(a) → ∃xA(x) Theorem 8.14
4. ∀xA(x) ∃xA(x) MP 2, 3
5. ∀xA(x) → ∃xA(x) Deduction
162 8 First-Order Logic: Deductive Systems

Theorem 8.16 ∀x(A(x) → B(x)) → (∀xA(x) → ∀xB(x)).

Proof
1. ∀x(A(x) → B(x)), ∀xA(x) ∀xA(x) Assumption
2. ∀x(A(x) → B(x)), ∀xA(x) A(a) Axiom 4
3. ∀x(A(x) → B(x)), ∀xA(x) ∀x(A(x) → B(x)) Assumption
4. ∀x(A(x) → B(x)), ∀xA(x) A(a) → B(a) Axiom 4
5. ∀x(A(x) → B(x)), ∀xA(x) B(a) PC 2, 4
6. ∀x(A(x) → B(x)), ∀xA(x) ∀xB(x) Gen. 5
7. ∀x(A(x) → B(x)) ∀xA(x) → ∀xB(x) Deduction
8. ∀x(A(x) → B(x)) → (∀xA(x) → ∀xB(x)) Deduction

Rule 8.17 (Generalization)

A(a) → B(a)
.
∀xA(x) → ∀xB(x)

The next theorem was previously proved in the Gentzen system. Make sure that
you understand why Axiom 5 can be used.

Theorem 8.18 ∃x∀yA(x, y) → ∀y∃xA(x, y).

Proof
1. A(a, b) → ∃xA(x, b) Theorem 8.14
2. ∀yA(a, y) → ∀y∃xA(x, y) Gen 1
3. ¬ ∀y∃xA(x, y) → ¬ ∀yA(a, y) PC 2
4. ∀x(¬ ∀y∃xA(x, y) → ¬ ∀yA(x, y)) Gen. 3
5. (∀x(¬ ∀y∃xA(x, y) → ¬ ∀yA(x, y)))→
(¬ ∀y∃xA(x, y) → ∀x¬ ∀yA(x, y)) Axiom 5
6. ¬ ∀y∃xA(x, y) → ∀x¬ ∀yA(x, y) MP 4, 5
7. ¬ ∀x¬ ∀yA(x, y) → ∀y∃xA(x, y) PC 6
8. ∃x∀yA(x, y) → ∀y∃xA(x, y) Definition of ∃

The proof of the following theorem is left as an exercise:

Theorem 8.19 Let A be a formula that does not have x as a free variable.

∀x(A → B(x)) ↔ (A → ∀xB(x)),


∃x(A → B(x)) ↔ (A → ∃xB(x)).
8.5 The C-Rule * 163

The name of a bound variable can be changed if necessary:

Theorem 8.20 ∀xA(x) ↔ ∀yA(y).

Proof
1. ∀xA(x) → A(a) Axiom 4
2. ∀y(∀xA(x) → A(y)) Gen. 1
3. ∀xA(x) → ∀yA(y) Axiom 5
4. ∀yA(y) → ∀xA(x) Similarly
5. ∀xA(x) ↔ ∀yA(y) PC 3, 4

The next theorem shows a non-obvious relation between the quantifiers.

Theorem 8.21 Let B be a formula that does not have x as a free variable.

∀x(A(x) → B) ↔ (∃xA(x) → B).

Proof
1. ∀x(A(x) → B) ∀x(A(x) → B) Assumption
2. ∀x(A(x) → B) ∀x(¬ B → ¬ A(x)) Exercise
3. ∀x(A(x) → B) ¬ B → ∀x¬ A(x) Axiom 5
4. ∀x(A(x) → B) ¬ ∀x¬ A(x) → B PC 3
5. ∀x(A(x) → B) ∃xA(x) → B Definition of ∃
6. ∀x(A(x) → B) → (∃xA(x) → B) Deduction

7. ∃xA(x) → B ∃xA(x) → B Assumption


8. ∃xA(x) → B ¬ ∀x¬ A(x) → B Definition of ∃
9. ∃xA(x) → B ¬ B → ∀x¬ A(x) PC 8
10. ∃xA(x) → B ∀x(¬ B → ¬ A(x)) Theorem 8.19
11. ∃xA(x) → B ∀x(A(x) → B) Exercise

12. ∀x(A(x) → B) ↔ (∃xA(x) → B) PC 6, 11

8.5 The C-Rule *


The C-rule is a rule of inference that is useful in proofs of existentially quantified
formulas. The rule is the formalization of the argument: if there exists an object
satisfying a certain property, let a be that object.
164 8 First-Order Logic: Deductive Systems

Definition 8.22 (C-Rule) The following rule may be used in a proof:


i U ∃xA(x) (an existentially quantified formula)
i +1 U A(a) C-rule
provided that
• The constant a is new and does not appear in steps 1, . . . , i of the proof.
• Generalization is never applied to a free variable or constant in the formula to
which the C-rule is applied:
i U ∃xA(x, y) (an existentially quantified formula)
i+1 U A(a, y) C-rule
···
j U ∀yA(a, y) Illegal!

For a proof that the rule is sound, see Mendelson (2009, Proposition 2.10).
We use the C-Rule to give a more intuitive proof of Theorem 8.18.

Theorem 8.23 ∃x∀yA(x, y) → ∀y∃xA(x, y)

Proof
1. ∃x∀yA(x, y) ∃x∀yA(x, y) Assumption
2. ∃x∀yA(x, y) ∀yA(a, y) C-Rule
3. ∃x∀yA(x, y) A(a, b) Axiom 4
4. ∃x∀yA(x, y) ∃xA(x, b) Theorem 8.14
5. ∃x∀yA(x, y) ∀y∃xA(x, y) Gen. 4
6. ∃x∀yA(x, y) → ∀y∃xA(x, y) Deduction

The conditions in the C-rule are necessary. The first condition is similar to the
condition on the deduction rule. The second condition is needed so that a formula
that is true for one specific constant is not generalized for all values of a variable.
Without the condition, we could prove the converse of Theorem 8.18, which is not
a valid formula:
1. ∀x∃yA(x, y) ∀x∃yA(x, y) Assumption
2. ∀x∃yA(x, y) ∃yA(a, y) Axiom 4
3. ∀x∃yA(x, y) A(a, b) C-rule
4. ∀x∃yA(x, y) ∀xA(x, b) Generalization (illegal!)
5. ∀x∃yA(x, y) ∃y∀xA(x, y) Theorem 8.14
6. ∀x∃yA(x, y) → ∃y∀xA(x, y) Deduction
8.6 Summary 165

8.6 Summary

Gentzen and Hilbert deductive systems were defined for first-order logic. They are
sound and complete. Be careful to distinguish between completeness and decid-
ability. Completeness means that every valid formula has a proof. We can discover
the proof by constructing a semantic tableau for its negation. However, we cannot
decide if an arbitrary formula is valid and provable.

8.7 Further Reading


Our presentation is adapted from Smullyan (1968) and Mendelson (2009). Chap-
ter X of (Smullyan, 1968) compares various proofs of completeness.

8.8 Exercises
8.1 Prove in G :
∀x(p(x) → q(x)) → (∃xp(x) → ∃xq(x)),
∃x(p(x) → q(x)) ↔ (∀xp(x) → ∃xq(x)).

8.2 Prove the soundness and completeness of G (Theorem 8.3).

8.3 Prove that Axioms 4 and 5 are valid.

8.4 Show that a proof in H can be simulated in G .

8.5 Prove in H : ∀x(p(x) → q) ↔ ∀x(¬ q → ¬ p(x)).

8.6 Prove in H : ∀x(p(x) ↔ q(x)) → (∀xp(x) ↔ ∀xq(x)).

8.7 Prove the theorems of Exercise 8.1 in H .

8.8 Prove Theorem 8.19 in H . Let A be a formula that does not have x as a free
variable.
∀x(A → B(x)) ↔ (A → ∀xB(x)),
∃x(A → B(x)) ↔ (A → ∃xB(x)).

8.9 Let A be a formula built from the quantifiers and the Boolean operators ¬ , ∨, ∧
only. A , the dual of A is obtained by exchanging ∀ and ∃ and exchanging ∨ and ∧.
Prove that A iff ¬ A .
166 8 First-Order Logic: Deductive Systems

References
E. Mendelson. Introduction to Mathematical Logic (Fifth Edition). Chapman & Hall/CRC, 2009.
R.M. Smullyan. First-Order Logic. Springer-Verlag, 1968. Reprinted by Dover, 1995.

You might also like