Elements of Mathematical Logic
D.K. Johnston
Department of Philosophy,
University of Victoria
c
2006
by D.K. Johnston
Contents
1 First order languages
1.1 Syntax . . . . . . .
1.2 First order theories
1.3 Maximal consistent
1.4 Ω-completeness . .
.
.
.
.
1
1
2
4
5
2 Semantics of first order languages
2.1 First order models . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Soundness of first order theories . . . . . . . . . . . . . . . . . . .
2.3 Completeness of first order theories . . . . . . . . . . . . . . . . .
7
7
9
9
. . .
. . .
sets
. . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3 Model theory
12
3.1 Isomorphisms and submodels . . . . . . . . . . . . . . . . . . . . 12
3.2 The Löwenheim-Skolem Theorem . . . . . . . . . . . . . . . . . . 13
3.3 Elementary classes . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4 Decidability
4.1 Effective procedures . . . . . . .
4.2 The monadic predicate calculus .
4.3 Representation and decidability .
4.4 Recursive functions . . . . . . . .
4.5 The theory Q . . . . . . . . . . .
4.6 Undecidability of first order logic
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
16
16
16
18
18
20
22
5 Incompleteness
23
5.1 Gödel numbering . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2 Axiomatic first order theories . . . . . . . . . . . . . . . . . . . . 24
5.3 Incompleteness of arithmetic . . . . . . . . . . . . . . . . . . . . 24
First order languages
1.
1.1.
Syntax
The vocabulary of a first order language L includes a set of logical symbols,
{⊥, →, ∃, =}
together with the delimiters ‘(’ and ‘)’, and the non-logical symbols contained
in the following countable sets:1
a set of individual constants {c0 . . . ci . . .}
for each n ≥ 1, a set of n-ary predicate symbols {P0n . . . Pin . . .}
for each n ≥ 1, a set of n-ary function symbols {f0n . . . fin . . .}
Any of these sets may be empty or finite. We also assume that every first order
language is provided with a denumerable set of individual variables:
{xi | i ∈ N}
The terms of a first order language L are defined as follows:
1. Every individual variable is a term.
2. Every individual constant is a term.
3. If t1 . . . tn are terms, then fin (t1 . . . tn ) is a term.
A term is said to be closed iff it contains no variables. Thus, every individual
constant is a closed term.
We now define the formulas of L:
1. If t1 , t2 are terms, then (t1 = t2 ) is a formula.
2. If t1 . . . tn are terms, then Pin t1 . . . tn is a formula.
3. ⊥ is a formula.
4. If α and β are formulas, then (α → β) is a formula.
5. If α is a formula and x is a variable, then ∃x α is a formula, provided that
(i) x occurs in α, and (ii) ∃x does not occur in α.
When ∃x α is a formula, the scope of the quantifier ∃x is the formula α. An
occurrence of a variable x is said to be free in a formula α iff that occurrence is
not within the scope of a quantifier ∃x in α. Otherwise, x is said to be bound in
α. Thus, if ∃x α is a formula, then x is bound in ∃x α, but free in α. A formula
1 We call a set denumerable when it is in a one-to-one correspondence with N, the set of
natural numbers. We call a set countable when it is either finite or denumerable. The null set
is considered to be finite.
1
First order languages
2
that contains one or more free variables is called an open formula. Note that a
formula may contain both free and bound occurrences of the same variable.
An occurrence of a term t in a formula α is said to be free iff that occurrence
of t contains no bound variables. Thus, if t contains no variables at all, every
instance of t will be free. We use the notation α(t) to designate a formula α
that contains one or more free instances of the term t. Thus, α(x) designates
an open formula α that has one or more free instances of the variable x.
The notation α(t0 /t) designates the result of substituting the term t0 for
every free instance of t in α(t). We stipulate that α(t0 /t) exists only if t0 is
free in α(t0 /t) everywhere that t is free in α(t). Thus, α(x/t) will always be an
open formula, in which every free occurrence of t has been replaced by a free
occurrence of x.
If a formula α contains bound occurrences of a variable x, then αy/x represents the result of replacing every such occurrence of x with a variable y that
does not occur in α. Thus, wherever α has a bound occurrence of x, αy/x has a
bound occurrence of y. If α does not contain any bound occurrences of x, then
we stipulate that αy/x = α.
We allow the formulas of a first order language to be re-written according
to the following abbreviations:
¬α =def
α ∨ β =def
α ∧ β =def
α ↔ β =def
t1 6= t2 =def
∀x α =def
α→⊥
¬α → β
¬(¬α ∨ ¬β)
(α → β) ∧ (β → α)
¬(t1 = t2 )
¬∃x ¬α
Where ambiguity will not result, we often omit some of the parentheses that
would be required by strict application of the formation rules.
Definition 1.1. A sentence of a first order language L is a formula that contains
no free variables.
For convenience, we will often speak of a first order language L as though it
were identical with the set of its sentences (not its formulas). Thus, α ∈ L
simply means that α is a sentence of L. Similarly, Σ ⊆ L means that Σ is a set
of L-sentences.
1.2.
First order theories
Let L be a first order language. Where α, β, γ, represent arbitrary formulas of
L, the logical axioms of L are specified as follows:
1. Every truth functional tautology is an axiom.
2. Every instance of α ↔ αy/x is an axiom.
First order languages
3
3. Each of the following sentences is an axiom:
(I1) ∀x (x = x)
(I2) ∀x ∀y (x = y → y = x)
(I3) ∀x ∀y ∀z (x = y → (y = z → x = z))
4. Every instance of (t = t0 ) → (α(t/x) ↔ α(t0 /x)) is an axiom. (I4)
5. Every instance of α(t) → ∃x α(x/t) is an axiom. (EG)
6. Every instance of α → (∃x β(x) → ∃x (α ∧ β(x))) is an axiom, provided
that x is not in α. (∃1)
The axioms specified by clause 3 are called the identity axioms of L. The
inference rules of L are:
From α and α → β, infer β. (MP)
From α(x) → β, infer ∃x α(x) → β, provided that x is not in β. (∃2)
Suppose that α is an L-formula and Σ is a set of L-formulas.
Definition 1.2. α is derivable from Σ in L iff there is a sequence of L-formulas
β1 . . . βn where βn = α, and where each βi meets at least one of the following
conditions:
1. βi is a member of Σ.
2. βi is a logical axiom of L.
3. βi is derivable from previous members of the sequence by MP.
4. βi is derivable from previous members of the sequence by ∃2.
The sequence β1 . . . βn is called an L-derivation. When α is derivable from Σ in
L, we write Σ ` α. When α is derivable from the null set, we write ` α.
Definition 1.3. Σ is inconsistent iff Σ ` ⊥, and consistent otherwise.
Theorem 1.1. If α, β are L-formulas, and Σ, Σ0 are sets of L-formulas, then:
(a) α ∈ Σ ⇒ Σ ` α
(b) Σ ` α & Σ ⊆ Σ0 ⇒ Σ0 ` α
(c) ` α ⇒ Σ ` α
(d) Σ ` α & Σ ` α → β ⇒ Σ ` β
(e) Σ ` α → β ⇒ Σ ∪ {α} ` β
These results follow easily from the definition of derivability, along with some
simple propositional logic.
First order languages
4
Theorem 1.2 (Deduction Theorem). If α is a sentence of L, then:
Σ ∪ {α} ` β ⇒ Σ ` α → β
Proof. Assume that Σ ∪ {α} ` β, and let γ1 . . . γn be the required derivation.
The proof is by induction on the size of n.
Base step: If n = 1, then either β ∈ Σ ∪ {α} or ` β.
If ` β, then ` α → β, and so Σ ` α → β.
Suppose that β ∈ Σ ∪ {α}.
If β is α, then again ` α → β since α → α is a tautology.
If β ∈ Σ, then Σ ` β, and so Σ ` α → β by propositional logic.
Induction step: If either β ∈ Σ ∪ {α} or ` β, we argue as above.
(i) Suppose that β is derived by MP.
Then for some γ, both γ and γ → β occur earlier in the sequence.
∴ Σ ` α → γ & Σ ` α → (γ → β) by the induction hypothesis.
∴ Σ ` α → β by propositional logic.
(ii) Suppose that β is derived by ∃2.
Then β is ∃x γ(x) → δ, with x not in δ.
But γ(x) → δ occurs earlier in the sequence.
∴ Σ ` α → (γ(x) → δ) by the induction hypothesis.
∴ Σ ` αy/x ∧ γ(x) → δ, since α ↔ αy/x is an axiom.
∴ Σ ` ∃x (αy/x ∧ γ(x)) → δ by ∃2.
But since α is a sentence, x is not free in α. ∴ x does not occur in αy/x .
∴ αy/x → (∃x γ(x) → ∃x (αy/x ∧ γ(x))) is an axiom by ∃1.
∴ Σ ` αy/x → (∃x γ(x) → δ). ∴ Σ ` α → (∃x γ(x) → δ).
a
Corollary 1.3. If α ∈ L, Σ ` α iff Σ ∪ {¬α} ` ⊥.
Proof. First, assume that Σ ` α. ∴ Σ ∪ {¬α} ` α.
But Σ ∪ {¬α} ` α → ⊥. ∴ Σ ∪ {¬α} ` ⊥.
Next, assume that Σ ∪ {¬α} ` ⊥.
∴ Σ ` ¬α → ⊥ by the Deduction Theorem.
∴ Σ ` α by propositional logic.
a
Definition 1.4. T ⊆ L is a (first order) theory in L iff for all α ∈ L,
T `α⇒α∈T
The sentences of a theory are called theorems. When α is a theorem of T , we
write `T α. Note that, if α ∈ L, ` α ⇒ `T α for any theory T in L. Thus, any
sentence that is a logical axiom of L will be a theorem of any theory in L.
1.3.
Maximal consistent sets
Suppose L is a first order language, with Σ ⊆ L.
Definition 1.5. Σ is maximal iff for every α ∈ L, either α ∈ Σ or ¬α ∈ Σ.
First order languages
5
Definition 1.6. Σ is maximal consistent iff Σ is both maximal and consistent.
Theorem 1.4. If Σ is maximal consistent and α ∈ L, then
Σ`α⇒α∈Σ
Proof. Assume that Σ is maximal consistent, and that Σ ` α. Assume that
α 6∈ Σ. Then ¬α ∈ Σ because Σ is maximal. ∴ Σ ` α → ⊥. ∴ Σ ` ⊥. ∴ Σ is
inconsistent, contrary to hypothesis.
a
Corollary 1.5. If Σ is maximal consistent, then
α ∈ Σ & (α → β) ∈ Σ ⇒ β ∈ Σ
Theorem 1.6 (Lindenbaum’s Lemma). If Σ ⊆ L is consistent, then Σ is
included in a maximal consistent set.
Proof. Suppose that Σ is consistent. Let σ0 . . . σi . . . be an enumeration of the
sentences of L. We define an infinite series of sets Σ0 . . . Σi . . . as follows:
Σ0 = Σ
..
.
(
Σi ∪ {σi } if Σi 0 ¬σi
Σi+1 =
Σi otherwise
Let Σ̄ =
S
i≥0
Σi . We show that Σ̄ is both maximal and consistent.
(i) Assume that Σ̄ is inconsistent. ∴ Σ̄ ` ⊥. Let β1 . . . βn be the required
sequence, and let Σ0 be the set of members of this sequence that are in Σ̄.
Thus Σ0 ` ⊥. But Σ0 is finite, and so is included in some Σi . Therefore Σi is
inconsistent, contrary to the definition of Σ̄.
(ii) Assume that for some α ∈ L, neither α nor ¬α are in Σ̄. Suppose α = σi
and ¬α = σj in the ordering of L. ∴ Σi ` ¬α and Σj ` ¬¬α, by definition of
Σ̄. ∴ Σ̄ ` ⊥, contrary to (i) above. ∴ Either α ∈ Σ̄ or ¬α ∈ Σ̄.
a
1.4.
Ω-completeness
Let L be a first order language.
Definition 1.7. Σ ⊆ L is ω-complete iff for all α ∈ L,
∃x α(x) ∈ Σ ⇒ α(c/x) ∈ Σ
for some constant c.
First order languages
6
Where K is the set of constants of L, we define
K+ = K ∪ {c∗i | i ∈ N}
The important fact about K+ is that it will contain denumerably many constants
(i.e. every c∗i ) that are not in any formula of L. Let L+ be L with K+ replacing
K. Clearly L ⊆ L+ .
Suppose Σ ⊆ L, and let ξ0 . . . ξi . . . be an enumeration of all the existential
sentences of L+ . We form the infinite sequence of sets Σ0 . . . Σi . . . as follows:
Σ0 = Σ
..
.
Σi+1 = Σi ∪ {∃x α(x) → α(c∗ /x)}
where ∃x α(x) is ξi in the above enumeration, and c∗ occurs in neither α(x) nor
Σi . (There will always be a c∗ that is not in any member of Σi because no c∗ is
in any member of Σ, and Σi is formed from Σ by the addition of only finitely
many sentences.) Then the ω-extension of Σ is defined as:
[
Σω =
Σi
i≥0
Lemma 1.7. Σ is consistent in L ⇒ Σ is consistent in L+ .
Proof. Assume that Σ ` ⊥ in L+ , and let β1 . . . βn be the required derivation.
Replace each K+ constant in every βi with a unique variable not in any βi , and
let γ1 . . . γn be the resulting sequence. It is easily shown by induction that this
sequence is an L-derivation. But γn = ⊥, so Σ ` ⊥ in L.
a
Lemma 1.8. Σi is consistent ⇒ Σi+1 is consistent.
Proof. Assume that Σi+1 ` ⊥. ∴ Σi ∪ {∃x α(x) → α(c∗ /x)} ` ⊥.
∴ Σi ` ∃x α(x) and Σi ` α(c∗ /x) → ⊥.
∴ Σi ` α(x) → ⊥. But x is not in ⊥.
∴ Σi ` ∃x α(x) → ⊥ by ∃2. ∴ Σi ` ⊥ by MP.
a
Lemma 1.9. If Σ is consistent, then Σω is consistent.
Proof. If Σω is inconsistent, then some Σi will be inconsistent. But then by
Lemma 1.8, Σ0 = Σ will be inconsistent.
a
Theorem 1.10. Every L-consistent set of sentences is included in a set that is
both maximal consistent and ω-complete.
Proof. Assume that Σ is consistent in L. Then Σ is consistent in L+ by Lemma
1.7. ∴ Σω is consistent by Lemma 1.9. Thus by Lindenbaum’s Lemma, Σω is
included in some maximal consistent set Σ̄ ⊆ L+ . Now suppose that ∃x α(x) ∈
Σ̄. But (∃x α(x) → α(c∗ /x)) ∈ Σ̄, by construction of Σω . ∴ α(c∗ /x) ∈ Σ̄ by
Corollary 1.5. ∴ Σ̄ is ω-complete.
a
Semantics of first order languages
2.
2.1.
First order models
Let L be a first order language. Let A be a non-empty set, and I a function
that assigns values to the non-logical symbols of L as follows:
For each individual constant c, I(c) ∈ A.
For each n-ary predicate symbol P , I(P ) ⊆ An .
For each n-ary function symbol f , I(f ) is a function: An → A.
Then A is a domain, I is an interpretation of L in A, and M = hA, Ii is an
L-model.
An assignment on M is a function µ that assigns an element of A to every
term of L, in accordance with the following definition:
1. µ is arbitrary for individual variables.
2. For each individual constant c, µ(c) = I(c).
3. Where t1 . . . tn are terms, µ(f (t1 . . . tn )) = I(f )(µ(t1 ) . . . µ(tn )).
Definition 2.1. An assignment µ0 is an x-variant of µ iff µ0 (y) = µ(y) for every
variable y 6= x.
Note that, for any variable x, an assignment µ is an x-variant of itself.
Let α be an L-formula, M an L-model, and µ an assignment on M. We use
the notation M µ α to signify that α is satisfied by the assignment µ on M.
This concept of satisfiability is defined as follows:
1. M µ P t1 . . . tn iff hµ(t1 ) . . . µ(tn )i ∈ I(P ).
2. M µ (t1 = t2 ) iff µ(t1 ) = µ(t2 ).
3. M 2µ ⊥.
4. M µ (α → β) iff M 2µ α or M µ β.
5. M µ ∃x α(x) iff M µ0 α(x), for some x-variant µ0 of µ.
Definition 2.2. Σ is satisfiable on M iff there is an assignment µ on M such
that M µ α for every α ∈ Σ.
Suppose M = hA, Ii is an L-model. Let µ and ν be arbitrary assignments on
M. Then for all constants c of L, µ(c) = I(c) = ν(c).
Lemma 2.1. For all closed terms t of L, µ(t) = ν(t).
The proof, by a simple induction on the syntactic structure of t, is omitted.
7
Semantics of first order languages
8
Theorem 2.2. If µ(xi ) = ν(xi ) for all free variables xi in α, then:
M µ α iff M ν α
Proof. Assume the hypothesis of the Theorem. The proof is by induction on
the syntactic structure of α.
Base step: Suppose α is P t1 . . . tn .
By Lemma 2.1, µ(ti ) = ν(ti ) if ti is a closed term.
By hypothesis, µ(ti ) = ν(ti ) if ti is a variable.
Clearly µ(f (ti )) = ν(f (ti )) if µ(ti ) = ν(ti ).
Thus µ(ti ) = ν(ti ) for every ti in α.
Assume that M µ P t1 . . . tn . ∴ hµ(t1 ) . . . µ(tn )i ∈ I(P ).
∴ hν(t1 ) . . . ν(tn )i ∈ I(P ). ∴ M ν P t1 . . . tn .
(The case where α is (t1 = t2 ) is equally straightforward.)
Induction step: We consider only the case where α is ∃y β(y).
Assume M µ ∃y β(y). ∴ M µ0 β(y) for some y-variant µ0 of µ.
Choose ν 0 so that ν 0 (z) = ν(z) for z 6= y, and ν 0 (y) = µ0 (y).
∴ ν 0 (xi ) = ν(xi ), for all free xi in α, since y is not free in α.
But by hypothesis, ν(xi ) = µ(xi ), for all free xi in α.
∴ ν 0 (xi ) = µ(xi ) = µ0 (xi ) for all free xi in α, since µ0 is a y-variant of µ.
∴ ν 0 (xi ) = µ0 (xi ) for all free xi in β(y), since ν 0 (y) = µ0 (y).
∴ M ν 0 β(y) by the induction hypothesis.
∴ M ν ∃y β(y), since ν 0 is a y-variant of ν.
a
Corollary 2.3. If α is a sentence of L, then M µ α iff M ν α.
Since a sentence contains no free variables, this corollary follows immediately
from Theorem 2.2.
Lemma 2.4. If µ(t) = µ(t0 ), then M µ α(t/x) iff M µ α(t0 /x).
The proof, by a simple induction on the syntactic structure of α(x), is omitted.
Definition 2.3. A formula α is true on M iff M µ α for all µ.
When a formula α is true on M, we write M α. Corollary 2.3 shows that, if
a sentence is satisfied by one assignment on a model M, it is satisfied by them
all; and hence it will be true on M. When exactly the same sentences are true
on M and M0 , we say that the models are equivalent, and write M ≡ M0 .
Let C be a class of L-models.
Definition 2.4. Σ is satisfiable in C iff Σ is satisfiable on some M ∈ C.
Definition 2.5. α is valid on C iff for all M ∈ C, M α.
When α is valid on C, we write C α. When the identity of the class C is obvious
or irrelevant, we often write simply α.
Semantics of first order languages
9
Definition 2.6. A theory T is sound with respect to C iff for all α ∈ L,
`T α ⇒ C α
Definition 2.7. A theory T is complete with respect to C iff for all α ∈ L,
C α ⇒ ` T α
2.2.
Soundness of first order theories
Let L be a first order language and let C be the class of all L-models. It is
easily shown that the rule MP preserves validity on C: i.e. given both C γ and
C γ → δ, it follows that C δ. The next result shows that ∃2 also preserves
validity on C.
Lemma 2.5. C α(x) → β ⇒ C ∃x α(x) → β, if x is not in β.
Proof. Assume that M 2µ ∃x α(x) → β, with x not in β. ∴ M µ ∃x α(x)
and M 2µ β. ∴ M µ0 α(x) for some x-variant µ0 of µ. But x is not in β.
∴ M 2µ0 β by Theorem 2.2. ∴ M 2µ0 α(x) → β.
a
Theorem 2.6. ` α ⇒ C α.
Proof. Assume that ` α, and let β1 . . . βn be the required derivation. It is
easily demonstrated that all tautologies of L are valid on C. It is also easily
demonstrated that the identity axioms are valid on C, and similarly for every
instance of EG and ∃1. Lemma 2.4 implies that every instance of I4 is valid on
C. But the inference rules of L preserve validity on C. Thus, a simple induction
will show that C βi for each i. It follows that C α.
a
Corollary 2.7. If Σ ⊆ L is satisfiable then Σ is consistent.
Proof. Assume that Σ ` ⊥, and let β1 . . . βn be the required derivation. Let
Σ0 = {σ1 . . . σk } be the sentences of this derivation that are in Σ. Then Σ0 ` ⊥,
and so by k applications of the Deduction Theorem, ` σ1 ∧ . . . ∧ σk → ⊥.
Therefore by Theorem 2.6, Σ is satisfiable on M implies that M ⊥, which is
impossible. Thus Σ is not satisfiable.
a
Let T be the intersection of all first order theories in L. Clearly T is itself a
theory in L, and `T α ⇒ ` α. It follows from Theorem 2.6 that T is sound
with respect to C.
2.3.
Completeness of first order theories
Let L be a first order language that has constants, predicate symbols, and
function symbols.2 Let Σ be a set of L-sentences, and let C be the class of
L-models.
2 The results that follow are easily adapted for first order languages that lack any of these
items.
Semantics of first order languages
10
Theorem 2.8. Σ is consistent ⇒ Σ is satisfiable in C.
Assume that Σ is consistent. Then by Theorem 1.10, Σ is included in some set
Σ̄ that is both maximal consistent and ω-complete. We define a relation ∼ on
the set of closed terms of the augmented language L+ :
t ∼ t0 iff (t = t0 ) ∈ Σ̄
The identity axioms of L ensure that ∼ is an equivalence relation. For each
closed term t, we define an equivalence class:
[t] = {t0 | t ∼ t0 }
Let à be the set of all such equivalence classes. Next, we define an interpretation
˜ = [c] for each constant c, and:
I˜ of L+ in à where I(c)
˜ ) iff P t1 . . . tn ∈ Σ̄
h[t1 ] . . . [tn ]i ∈ I(P
˜ )([t1 ] . . . [tn ]) = [tn+1 ] iff (f (t1 . . . tn ) = tn+1 ) ∈ Σ̄
I(f
(The axiom I4 ensures that this definition is consistent. For example, if t0 ∈ [t],
then (t0 = t) ∈ Σ̄, and so by I4, α(t0 /x) will be in Σ̄ whenever α(t/x) is.)
˜ is the canonical model for the set Σ. Obviously, M̃ ∈ C. Let µ be
M̃ = hÃ, Ii
an arbitrary assignment on M̃.
Lemma 2.9. For all closed terms t, µ(t) = [t].
Proof. The proof is by induction on the syntactic structure of t.
˜ = [c].
Base step: Where t is a constant c, µ(c) = I(c)
˜ )(µ(t0 )) = I(f
˜ )([t0 ]) by
Induction step: Suppose t is f (t0 ).3 ∴ µ(f (t0 )) = I(f
0
0
0
˜ )([t ]) = [f (t0 )].
the induction hypothesis. But (f (t ) = f (t )) ∈ Σ̄. ∴ I(f
0
0
∴ µ(f (t )) = [f (t )].
a
Lemma 2.10. For all sentences α ∈ L+ and all assignments µ on M̃,
M̃ µ α iff α ∈ Σ̄
Proof. The proof is by induction on the syntactic structure of α.
Base step: When α is P t1 . . . tn , we argue as follows:
˜ )
M̃ µ P t1 . . . tn iff hµ(t1 ) . . . µ(tn )i ∈ I(P
˜ ) by Lemma 2.9
iff h[t1 ] . . . [tn ]i ∈ I(P
iff P t1 . . . tn ∈ Σ̄
The case where α is (t1 = t2 ) is equally straightforward.
Induction step: We consider only the case where α is ∃x β(x).
3 Lemma
2.9 can easily be generalised for n-ary function symbols.
Semantics of first order languages
Note that, since ∃x β(x) is a sentence, x is the only free variable in β(x).
First, assume that M̃ µ ∃x β(x).
∴ M̃ µ0 β(x), where µ0 is some x-variant of µ.
Suppose µ0 (x) = [t]. ∴ µ0 (x) = µ0 (t) by Lemma 2.9.
∴ M̃ µ0 β(t/x), by Lemma 2.4.
∴ β(t/x) ∈ Σ̄ by the induction hypothesis.
But (β(t/x) → ∃x β(x)) ∈ Σ̄ by EG. ∴ ∃x β(x) ∈ Σ̄.
Next, assume that ∃x β(x) ∈ Σ̄.
But Σ̄ is ω-complete. ∴ β(c/x) ∈ Σ̄ for some c.
∴ M̃ µ β(c/x) by the induction hypothesis. ∴ M̃ µ ∃x β(x).
11
a
M̃ satisfies Σ̄ by Lemma 2.10, and so M̃ also satisfies Σ. But M̃ ∈ C. This
proves Theorem 2.8.
Corollary 2.11. Any theory T ⊆ L is complete with respect to C.
Proof. Assume that 0T α for an arbitrary theory T . Then {¬α} is consistent,
and hence is satisfiable in C by Theorem 2.8. Thus there is some model in C
where α is not true. Therefore 2C α.
a
Theorem 2.12 (Compactness Theorem). Σ ⊆ L is satisfiable in C iff every
finite subset of Σ is satisfiable in C.
Proof. The ‘only if’ direction is trivial. For the ‘if’ direction, assume that Σ is
not satisfiable in C. Then Σ ` ⊥ by Theorem 2.8. Let β1 . . . βn be the required
derivation, and let Σ0 be the set of βi ’s that are in Σ. Then Σ0 ` ⊥. Thus Σ
has an inconsistent finite subset, which is not satisfiable in C.
a
Model theory
3.
3.1.
Isomorphisms and submodels
Suppose that L is a first order language, and that M = hA, Ii and M0 = hB, Ji
are L-models. Suppose that there is a function φ : A → B that has the following
properties:
1. φ(a1 ) = φ(a2 ) ⇒ a1 = a2 (i.e. φ is one-to-one)
2. ∀b ∈ B, ∃a ∈ A : φ(a) = b (i.e. φ is onto)
3. For all constants c, J(c) = φ(I(c))
4. For all n-ary predicate symbols P ,
ha1 . . . an i ∈ I(P ) iff hφ(a1 ) . . . φ(an )i ∈ J(P )
5. For all n-ary function symbols f ,
φ(I(f )(a1 . . . an )) = J(f )(φ(a1 ) . . . φ(an ))
Then φ is an isomorphism, and the models M and M0 are isomorphic. When
M and M0 are isomorphic, we write M ' M0 . It is easily seen that ' is an
equivalence relation.
Theorem 3.1. M ' M0 ⇒ M ≡ M0 .
Proof. Assume that M ' M0 , and let φ be the underlying isomorphism. For
any assignment µ on M, define µ0 (t) = φ(µ(t)), for all terms t. It is easily shown
(by induction) that µ0 is an assignment on M0 which is equivalent to µ on M.
The Theorem follows directly.
a
In the next section, we will see that the converse of Theorem 3.1 is not generally
true: i.e. there are equivalent models that are not isomorphic.
Corollary 3.2. Let M = hA, Ii, and suppose that |A| = |B|. Then there is a
model M0 = hB, Ji where M ' M0 .
Proof. If |A| = |B|, then there is a one-to-one correspondence between them.
Let φ be the underlying function. It is then simple to define an interpretation J
of L on B such that φ will be an isomorphism: for example, let J(c) = φ(I(c))
for all constants c; and so on.
a
As above, let L be a first order language, and let M = hA, Ii be an L-model.
Suppose that B ⊆ A has the following properties:
1. For all constants c, I(c) ∈ B.
2. For all n-ary function symbols f , b1 . . . bn ∈ B ⇒ I(f )(b1 . . . bn ) ∈ B.
12
Model theory
13
Lemma 3.3. For any assignment µ on M, µ(t) ∈ B for all closed terms t.
The Lemma follows easily from clauses 1 and 2 above, by a simple induction on
the syntactic structure of t.
Let IB be an interpretation of L in B where:
IB (c) = I(c) for all constants c.
IB (f )(b1 . . . bn ) = I(f )(b1 . . . bn ) for all n-ary function symbols f .
IB (P ) = I(P ) ∩ B n for all n-ary predicate symbols P .
The conditions on the structure of B ensure that the definition of IB is consistent. Then IB is the restriction of I to B, and M0 = hB, IB i is a submodel of
M.
3.2.
The Löwenheim-Skolem Theorem
Let L be a first order language. We say that a set of L-formulas Σ is satisfiable
in a set A if Σ is satisfiable on some L-model that has A as its domain. We say
that a model is countable when it has a countable domain; finite when it has a
finite domain; and so on.
Theorem 3.4. If Σ is satisfiable, then Σ is satisfiable in a countable set.
Proof. Suppose that Σ is satisfiable. Then by Corollary 2.7, Σ is consistent. Let
˜ be the canonical model for Σ. Since the set of closed terms of L+ is
M̃ = hÃ, Ii
denumerable, Ã is countable. Thus, since Σ is satisfiable on M̃, Σ is satisfiable
in a countable set.
a
Theorem 3.5 (Löwenheim-Skolem Theorem). If Σ is satisfiable on a model
M, then Σ is satisfiable on a countable submodel of M.
Since every model is a submodel of itself, the only non-trivial case of the
Löwenheim-Skolem Theorem is where M is uncountable.
Let M = hA, Ii be an L-model. Let Γ ⊆ A be the image of the constants of
L under the interpretation I. Let the series {ξi }i≥0 be an enumeration of the
existential formulas satisfiable on M.
Suppose y1 . . . yn are the free variables of ξi = ∃x α(x). But ξi is satisfiable
on M, so M µ α(x) for some µ. Arbitrarily select such a µ for each ξi , and
define:
Xi = {µ(x), µ(y1 ) . . . µ(yn )}
S
Let ∆ = i≥0 Xi , and form the series of sets {Bi } as follows:
B0 = Γ ∪ ∆
..
.
Bi+1 = Bi ∪ {a ∈ A | ∃b ∈ Bi : ∃f : I(f )(b) = a}
Model theory
14
S
Let B = i≥0 Bi .
Both Γ and ∆ are countable, so B0 is countable. But each Bi contains
at most denumerably many elements, so their union is countable. Obviously
B ⊆ A. The definition of Γ ensures that I(c) ∈ B for all constants c. From the
construction of the series {Bi }, it follows that I(f )(b) ∈ B whenever b ∈ B, for
any function symbol f . Let IB be the restriction of I to B. Then MB = hB, IB i
is a countable submodel of M.
Lemma 3.6. A formula α is satisfiable on MB iff α is satisfiable on M.
Proof.
Base step: Given Lemma 3.3, the result is trivial when α has no free variables.
Let α be P x1 . . . xn . First, assume that MB µ α. ∴ hµ(x1 ) . . . µ(xn )i ∈ IB (P ).
∴ hµ(x1 ) . . . µ(xn )i ∈ I(P ). ∴ M µ α.
Next, suppose that α is satisfiable on M. ∴ ∃x1 α is satisfiable on M, so
∃x1 P x1 . . . xn = ξi for some i. ∴ For some µ on M, µ(xk ) ∈ Xi for each xk ,
and M µ P x1 . . . xn . ∴ hµ(x1 ) . . . µ(xn )i ∈ I(P ). But Xi ⊆ B, so there is
a ν on MB where ν(xk ) = µ(xk ) for each xk . ∴ hν(x1 ) . . . ν(xn )i ∈ IB (P ).
∴ MB ν P x1 . . . xn . The case where α is (x = y) is similar.
Induction step: We consider only the case where α is ∃x β(x), and argue as
follows: ∃x β(x) is satisfiable on MB iff β(x) is satisfiable on MB iff β(x) is
satisfiable on M (by the induction hypothesis) iff ∃x β(x) is satisfiable on M. a
Thus we have established:
Theorem 3.7. A formula α is satisfiable on a model M iff α is satisfiable on
a countable submodel of M.
The Löwenheim-Skolem Theorem follows directly.
3.3.
Elementary classes
Let L be a first order language, and C a class of L-models.
Definition 3.1. C is elementary iff for some α ∈ L,
M ∈ C iff M α
Theorem 3.8. The class of all L-models is elementary.
Proof. Choose any α ∈ L such that ` α. Then M α for any L-model by
Theorem 2.6. Thus the class of L-models is elementary.
a
Consider the sentence schemas:
∃x1 . . . ∃xn
^
(xi 6= xj )
(3.1)
1≤i<j≤n
∀x1 . . . ∀xn+1
_
(xi = xj )
(3.2)
1≤i<j≤n+1
The cardinality of a model M is simply the cardinality of its domain, and is
designated by |M|.
Model theory
15
Theorem 3.9. For each n ≥ 1, the class of L-models of cardinality n is elementary.
Proof. For each n ≥ 2, the conjunction of sentences 3.1 and 3.2 is satisfiable on
a model M iff |M| = n. When n = 1, sentence 3.2 is ∀x ∀y (x = y), which is
satisfiable on a model M iff |M| = 1.
a
Corollary 3.10. For each n ≥ 1, the class of L-models of cardinality ≥ n is
elementary, and the class of L-models of cardinality ≤ n is elementary.
Theorem 3.11. The class of uncountable L-models is not elementary.
Proof. Suppose that some α ∈ L is true on an uncountable model M. But by
the Löwenheim-Skolem Theorem, α is true on some countable submodel of M.
Therefore α is true on some model not in the class of uncountable models. a
Lemma 3.12. If C is elementary, then Σ ⊆ L is satisfiable in C iff every finite
subset of Σ is satisfiable in C.
Proof. Assume that C is elementary, and let α be the required sentence. The
‘only if’ direction is trivial. For the ‘if’ direction, assume that Σ is not satisfiable
in C. If Σ ∪ {α} is consistent, then it is satisfiable by Theorem 2.8. But if α is
true on any M, then M ∈ C. Thus, if Σ ∪ {α} is consistent, Σ is satisfiable in C,
contrary to hypothesis. ∴ Σ∪{α} ` ⊥. ∴ ∃β1 . . . βn ∈ Σ : ` β1 ∧. . .∧βn → ¬α.
∴ C β1 ∧ . . . ∧ βn → ¬α by Theorem 2.6. But C α. ∴ {β1 . . . βn } ⊆ Σ is not
satisfiable in C.
a
Given Theorem 3.8, the Compactness Theorem (Theorem 2.12) follows from
Lemma 3.12.
Theorem 3.13. The class of finite L-models is not elementary.
Proof. For each n ≥ 2, let σn be the n-th instance of sentence 3.1 above. Clearly,
a particular σn is true on a model M iff |M| ≥ n. Let Σ be the set of all such
sentences, and let C be the class of finite L-models. But every finite subset of Σ
is satisfiable in C. For suppose that Σ0 ⊆ Σ is finite, and let σn be the member
of Σ0 that has the largest index. Then every sentence in Σ0 will be satisfiable
on any model that has at least n elements. But for every M ∈ C, there is a
σn ∈ Σ where |M| < n, and so M 2 σn . It follows that Σ itself is not satisfiable
in C. Therefore Lemma 3.12 implies that the class of finite L-models is not
elementary.
a
4.
4.1.
Decidability
Effective procedures
Let L be a first order language.
Definition 4.1. An effective procedure begins with any one of a specified set
of inputs, and terminates, after a finite number of steps, with exactly one of a
specified set of outputs.
Definition 4.2. Σ ⊆ L is decidable iff there is an effective procedure that will
prove, for any α ∈ L, either α ∈ Σ or α 6∈ Σ.
Thus, Σ will be decidable iff there is an effective procedure whose inputs are
the sentences of L, and whose outputs are ‘in Σ’ and ‘not in Σ’.4
Obviously, any finite set of first order sentences is decidable: it is possible
to examine all of the members of the set in a finite time, and so there is an
effective procedure for determining whether or not an arbitrary sentence is in
the set.
Theorem 4.1. L contains undecidable subsets.
Proof. L will have denumerably many sentences. But Cantor’s diagonal argument demonstrates that any denumerable set has uncountably many subsets.
Thus, the set of subsets of L will be uncountable. But any effective procedure
must be defined by a finite set of rules, each of which is finite in length. Hence
there are only denumerably many effective procedures, and so there will be more
subsets of L than there are effective procedures. Thus, some subsets of L will
be undecidable.
a
It follows from Definition 4.2 that a first order theory T ⊆ L is decidable iff
there is an effective procedure that will determine whether or not `T α, for any
α ∈ L. In what follows, we will see that some first order theories are decidable,
while others are not.
4.2.
The monadic predicate calculus
Let Lm be a first order language that has as its only non-logical symbols a denumerable set of individual constants, and a denumerable set of unary predicate
symbols. The monadic predicate calculus (mpc) is the intersection of all first
order theories in Lm .
Theorem 4.2. If an Lm -formula is satisfiable, then it is satisfiable on a finite
Lm -model.
4 This definition of decidability is easily extended to any kind of set; in particular, to any
set of natural numbers.
16
Decidability
17
Suppose that the formula α is satisfiable. Let M = hA, Ii be the required model,
and µ the required assignment on M. Let Π = {P1 . . . Pk } be the predicate
symbols that occur in α. For each πi ⊆ Π, define the set bi ⊆ A as follows:
(
a ∈ I(P ) for all P ∈ πi
a ∈ bi iff both
a 6∈ I(P ) for all P 6∈ πi
S
Thus {bi } = A. Let B be the set of all non-empty bi . Then |B| ≤ 2k . Let I 0
be a function on the non-logical symbols of Lm where:
For all constants c, I 0 (c) = bi iff I(c) ∈ bi
For all predicate symbols P , bi ∈ I 0 (P ) iff P ∈ πi
Since the bi ’s are disjoint, I 0 (c) is uniquely defined for each constant c. Thus I 0
is an interpretation of Lm in B, and consequently M0 = hB, I 0 i is an Lm -model.
Lemma 4.3. α is satisfiable on M0 .
Proof. The proof is by induction on the syntactic structure of α. Select an
assignment ν on M0 where ν(x) = bi iff µ(x) ∈ bi .
Base step: The case where α is (t = t0 ) is trivial.
Let α be P t. ∴ µ(t) ∈ I(P ). But µ(t) ∈ bi for some bi ∈ B.
∴ P ∈ πi . ∴ bi ∈ I 0 (P ). But ν(t) = bi , so M0 ν P t.
Induction step: We consider only the case where α is ∃y β(y).
Then M µ0 β(y) for some y-variant of µ.
But µ0 (y) ∈ bi for some bi ∈ B.
Select a ν 0 on M0 where ν 0 (x) = bj iff µ0 (x) ∈ bj .
∴ M0 ν 0 β(y) by the induction hypothesis.
But ν 0 is an y-variant of ν. ∴ M0 ν ∃y β(y).
a
This proves Theorem 4.2.
Consider an arbitrary α ∈ Lm and finite set A. Since α will contain only
finitely many individual constants and predicate symbols, there will be only
finitely many distinct interpretations of α in the set A. For example, if α is P c,
and |A| = n, then there will be n distinct ways of interpreting c, and 2n distinct
ways of interpreting P .
So by examining all possible interpretations of α in A, we can determine, in
a finite number of steps, whether α is satisfiable in A. Furthermore, if |B| = |A|,
then every interpretation of α in B will be isomorphic to some interpretation of
α in A. Thus, for any sentence α, and any n ≥ 1, there is an effective procedure
for determining whether or not there is a model of cardinality n that satisfies
α.
Assume that α contains k distinct predicate symbols. If 0mpc α, then ¬α
is consistent, and so by the completeness result, ¬α is satisfiable. Therefore
by Theorem 4.2, ¬α is satisfiable on some finite Lm -model. Furthermore, the
cardinality of the domain of this model will be ≤ 2k .
Decidability
18
This provides an effective procedure for determining whether or not α is a
theorem of mpc. For each n where 1 ≤ n ≤ 2k , determine whether there is a
model of cardinality n that satisfies ¬α. If no such model is found for any such
n, then `mpc α. If there is such a model, then 0mpc α. Thus we have established:
Theorem 4.4. mpc is decidable.
4.3.
Representation and decidability
Let L be any first order language with a denumerable set of closed terms. Let
{ti }i∈N be an enumeration of those terms, and let n̄ designate the term whose
index is n in this enumeration. Let T ⊆ L be a first order theory.
Definition 4.3. A set X ⊆ N is represented in T iff there is an L-formula α(x)
such that n ∈ X iff `T α(n̄/x).
We say that the formula α(x) ‘represents’ X in T .
Let g̈ be an enumeration of the formulas of L. Define the set ∆T as follows:
∆T = {n ∈ N | ∃α(x) : g̈(α(x)) = n & 0T α(n̄/x)}
Lemma 4.5. If T is decidable then ∆T is decidable.
Proof. Assume that T is decidable. Then there is an effective method for determining whether or not `T α for any α, and hence for α(n̄/x) when g̈(α(x)) = n.
But n ∈ ∆T when 0T α(n̄/x), and n 6∈ ∆T when `T α(n̄/x). Therefore ∆T is
decidable.
a
Lemma 4.6. ∆T is not represented in T .
Proof. Assume that ∆T is represented in T . Let δ(x) be the required formula,
with g̈(δ(x)) = n. Suppose n ∈ ∆T . ∴ 0T δ(n̄/x) by definition of ∆T . But
δ(x) represents ∆T in T . ∴ n 6∈ ∆T . The assumption that n 6∈ ∆T also leads
to a contradiction. ∴ ∆T is not represented in T .
a
Theorem 4.7. If every decidable subset of N is represented in T , then T is
undecidable.
Proof. Assume that every decidable subset of N is represented in T . But ∆T
is not represented in T by Lemma 4.6. ∴ ∆T is not decidable. ∴ T is not
decidable by Lemma 4.5.
a
4.4.
Recursive functions
To define the class of recursive functions, we first specify a set of initial functions:
the zero function ζ, the successor function σ, and a set of identity functions ιij ,
Decidability
19
for each i, j where 1 ≤ i ≤ j. These are all functions on N, which take values as
follows:
ζ(n) = 0
σ(n) = n + 1
ιij (n1 . . . nj ) = ni
Note that each of these functions is computable: i.e. given any arguments from
N, we can compute the value of the function for those arguments.
Next, we specify three operations that allow functions to be constructed
from other functions:
Composition: Given an i-place function f , and the j-place functions
g1 . . . gi , construct the j-place function h such that:
h(n1 . . . nj ) = f (g1 (n1 . . . nj ) . . . gi (n1 . . . nj ))
Primitive recursion: Given the i-place function f and the i + 2-place
function g, construct the i + 1-place function h such that:
h(n1 . . . ni , 0) = f (n1 . . . ni )
h(n1 . . . ni , σ(m)) = g(n1 . . . ni , m, h(n1 . . . ni , m))
Minimisation: Given an i + 1-place function f , construct the i-place function h such that h(n1 . . . ni ) is the smallest m ∈ N such that:
f (n1 . . . ni , m) = 0
(If no such m exists, then h is undefined.)
The class of recursive functions includes all and only those functions that can
be constructed from the initial functions by finitely many (including zero) applications of composition, primitive recursion, or minimisation.5
It can be proved that every recursive function is computable. For example,
suppose that f and g are unary functions. Then composition yields the function
h, where h(n) = f (g(n)) for all n ∈ N. Obviously h is computable provided
that f and g are computable.
Definition 4.4. A set X ⊆ N is recursive iff there is a recursive function f such
that, for all n ∈ N, n ∈ X iff f (n) = 0.
Church’s Thesis. Every decidable subset of N is recursive.
Church’s Thesis is not provable. By Definition 4.2, a set is decidable iff there is
an effective procedure for determining whether or not an arbitrary element is a
member of the set. But there is no precise specification of the characteristics a
5 Those functions constructible from the initial functions by composition and primitive
recursion alone are called primitive recursive functions.
Decidability
20
procedure must have if it is to be effective in the sense of Definition 4.1. The
Thesis would be refuted by a single example of an effective procedure that was
not recursive. No one has yet discovered such a procedure, and Church’s Thesis
has become widely accepted.
However, the converse of Church’s Thesis can be proved. As mentioned
above, all recursive functions are computable. So, if X ⊆ N is recursive, we
can determine whether or not n ∈ X simply by computing the value of the
associated recursive function. Therefore, any recursive subset of N is decidable.
Theorem 4.8. If every recursive subset of N is represented in a first order
theory T , then T is undecidable.
Theorem 4.8 follows from Theorem 4.7 together with Church’s Thesis.
4.5.
The theory Q
Let LQ be the first order language that has as its non-logical symbols the single
individual constant 0, the unary function symbol s, and the binary function
symbols + and ×. Then Q is the smallest first order theory in LQ that contains
the sentences:
[Q1] ∀x ∀y ((s(x) = s(y)) → (x = y))
[Q2] ∀x (s(x) 6= 0)
[Q3] ∀x ((x 6= 0) → ∃y (x = s(y)))
[Q4] ∀x ((x + 0) = x)
[Q5] ∀x ∀y ((x + s(y)) = s(x + y))
[Q6] ∀x ((x × 0) = 0)
[Q7] ∀x ∀y ((x × s(y)) = ((x × y) + x))
Let M = hN, Ii be a model for the language LQ where I(0) = 0, and where
I assigns the successor function to s, the addition function to +, and the multiplication function to ×. A standard model for LQ is one that is isomorphic to
M. Let S be the class of these standard models.
Lemma 4.9. Q is sound with respect to S.
The proof is straightforward.
Let θ be an enumeration of the closed terms of LQ where θ(0) = 0 and
θ(s(t)) = θ(t) + 1. As above, n̄ designates the term whose index is n in this
enumeration. Thus θ(n̄) = n.
Suppose that f is a unary function on N.6 We say that f is definable in
a first order theory T ⊆ LQ when there is a formula α(x, y), having two free
variables x and y, that meets the following conditions:
6 The
points that follow are easily generalised for n-place functions.
Decidability
21
(i) ∀n, m ∈ N, f (n) = m ⇒ `T α(n̄/x, m̄/y)
(ii) ∀n, m ∈ N, f (n) 6= m ⇒ `T ¬α(n̄/x, m̄/y)
(iii) `T ∀x ∀y ∀z (α(x, y) ∧ α(x, z/y) → (y = z))
Thus, if f is definable in T , and T ⊆ T 0 , then f is also definable in T 0 .
Lemma 4.10. Suppose that all recursive functions are definable in T . Then if
T is consistent, T is undecidable.
Proof. Assume that all recursive functions are definable in T , and that T is
consistent. Let X be an arbitrary recursive subset of N, and let f be the
corresponding recursive function. Then f is definable in T by some formula
α(x, y). First, assume that n ∈ X. ∴ f (n) = 0. ∴ `T α(n̄/x, 0̄/y). Next,
assume that n 6∈ X. ∴ f (n) 6= 0. ∴ `T ¬α(n̄/x, 0̄/y). ∴ 0T α(n̄/x, 0̄/y),
since T is consistent. Therefore X is represented in T by the formula α(x, 0̄/y).
But X is arbitrary, so every recursive subset of N is represented in T . Thus T
is undecidable by Theorem 4.8.
a
Lemma 4.11. All recursive functions are definable in Q.
To prove Lemma 4.11, it must first be shown that the initial recursive functions
are definable, and then that any function constructible by composition, primitive
recursion, or minimisation is also definable. This task is straightforward but
laborious, so here we will provide only some illustrative examples.
The successor function
We show that the function σ is defined by the formula s(x) = y.
(i) Let n ∈ N be arbitrary, and assume that σ(n) = m.
∴ m̄ is s(n̄). But `Q s(n̄) = s(n̄). ∴ `Q s(n̄) = m̄ as required.
(ii) We show that ∀n, m ∈ N, n 6= m ⇒ `Q n̄ 6= m̄. Assume that n < m.
Then m = k + 1 = σ(k) for some k ∈ N, and so m̄ is s(k̄).
First, assume that n = 0. Then n̄ is the constant 0.
But `Q 0 6= s(k̄) by Q2. ∴ `Q n̄ 6= m̄.
Next, assume that n = r + 1. Then n = σ(r), and so n̄ is s(r̄).
But n < m, so r 6= k. ∴ `Q r̄ 6= k̄ by the induction hypothesis.
∴ `Q s(r̄) 6= s(k̄) by Q1. ∴ `Q n̄ 6= m̄.
(iii) It is easily shown that the sentence,
∀x ∀y ∀z ((s(x) = y) ∧ (s(x) = z) → (y = z))
is a theorem of Q.
Decidability
22
Composition
Suppose that the unary functions f and g are defined by the formulas α(x, y)
and β(x, y) respectively. We show that the composition of f and g is defined by
the formula ∃z (α(z, y) ∧ β(x, z)).
(i) Assume that f (g(n)) = m, with g(n) = k. ∴ f (k) = m. ∴ `Q α(k̄, m̄) and
`Q β(n̄, k̄) by hypothesis. ∴ `Q ∃z (α(z, m̄) ∧ β(n̄, z)).
(ii) Assume that f (g(n)) 6= m, with g(n) = k. ∴ f (k) 6= m.
∴ `Q ¬α(k̄, m̄) and `Q β(n̄, k̄) by hypothesis.
But `Q ∀z (β(n̄, z) → (z = k̄)). ∴ `Q ∀z (β(n̄, z) → ¬α(z, m̄)).
∴ `Q ¬∃z (α(z, m̄) ∧ β(n̄, z)).
(iii) By hypothesis, we have both:
`Q ∀x ∀y ∀z (α(x, y) ∧ α(x, z/y) → (y = z))
`Q ∀x ∀y ∀z (β(x, y) ∧ β(x, z/y) → (y = z))
From which it follows:
`Q ∀x ∀y ∀z (∃w (α(w, x) ∧ β(y, w)) ∧ ∃w (α(w, z) ∧ β(y, w)) → (x = z))
These examples will suffice to illustrate the proof of Lemma 4.11.
Theorem 4.12. Q is undecidable.
Proof. Q is consistent by Lemma 4.9. Thus Q is undecidable by Lemmas 4.10
and 4.11
a
4.6.
Undecidability of first order logic
Definition 4.5. If Σ ⊆ L, then the Σ-extension of a first order theory T is the
intersection of all first order theories in L that contain both T and Σ.
A finite extension of T is simply a Σ-extension of T where Σ is finite.
Lemma 4.13. If a first order theory T is decidable, then any finite extension
of T is decidable.
Proof. Assume that Σ = {α1 . . . αn }, and let T 0 be the Σ-extension of T . Then
`T 0 β iff T ∪ Σ ` β iff `T α1 ∧ . . . ∧ αn → β by the Deduction Theorem. Thus
if T is decidable, T 0 is decidable.
a
Let L be a first order language that has denumerably many individual constants,
and for each n ≥ 1, denumerably many n-place function and predicate symbols.
Then first order logic (fol) is the intersection of all first order theories in L.
Theorem 4.14. fol is undecidable.
Proof. Let Q∗ be the smallest first order theory that includes both fol and the
sentences Q1. . . Q7. ∴ Q ⊆ Q∗ . ∴ All recursive functions are definable in Q∗ by
Lemma 4.11. It is easily shown that Q∗ is consistent. ∴ Q∗ is undecidable by
Lemma 4.10. But Q∗ is a finite extension of fol. ∴ fol is undecidable by Lemma
4.13.
a
Incompleteness
5.
5.1.
Gödel numbering
Every sequence of symbols of the language LQ can be assigned a unique member
of N, from which the sequence itself can be decoded.7 First, the individual
symbols of LQ are assigned unique numbers as follows:
(
1
) × + s
2 3 4 5
0
6
= ∃
7 8
→
9
⊥
10
Individual variables are assigned prime numbers greater than 10:
x1
11
x2
13
x3
17
x4
19
...
...
For each LQ symbol S, let g̈(S) be the number that is assigned to S by the
above scheme. We now extend g̈ so that it assigns a unique number to each
finite sequence of LQ symbols. Let p1 . . . pi . . . be the series of prime numbers.
When the symbol S is in the n-th place in the given sequence, assign S the
g̈(S)
number pn . The g̈-number assigned to the sequence as a whole is the product
of the numbers assigned to each of its symbols.8
As an example, consider the formula 0 = 0. By the above scheme, g̈(0) is 6
and g̈(=) is 7. Thus:
g̈(0 = 0) = 26 × 37 × 56 = 64 × 2187 × 15625 = 2187000000
Finite sequences of sequences are also assigned unique g̈-numbers in a similar
way. As an example, assume that α1 . . . αn is a sequence of LQ -sentences. Then
the g̈-number of this sequence of sequences is:
g̈(α1 )
p1
n)
× · · · × pg̈(α
n
The Fundamental Theorem of number theory says that every composite
number has a unique set of prime factors. Thus, given an arbitrary number, it
can be determined whether it is the g̈-number of some sequence of LQ symbols;
and if it is, those symbols, and their order in the sequence, can be deduced from
the number. Similarly, it can be determined whether an arbitrary number is
the g̈-number of some sequence of sequences of LQ symbols; and if it is, that
sequence can also be deduced from the number.
7 These
are called ‘gödel numbers’ after the logician Kurt Gödel who invented the technique.
In what follows, ‘number’ will always mean ‘natural number’.
8 Note that the g̈-number of a symbol is different from the g̈-number of the sequence containing just that symbol. Thus, the g̈-number of → is 9, but the g̈-number of the sequence
containing just the symbol → is 29 = 512.
23
Incompleteness
5.2.
24
Axiomatic first order theories
Definition 5.1. T ⊆ L is axiomatic iff there is a decidable Σ ⊆ L such that T
is the smallest first order theory that contains Σ.9
If T is axiomatic, it follows that `T α iff there is a finite sequence of sentences
σ1 . . . σn , where α is σn , and where each σi meets at least one of the following
conditions:
(i) σi is a member of Σ.
(ii) σi is a logical axiom of L.
(iii) σi follows from previous members of the sequence by MP or ∃2.
Any such sequence is called a T -derivation of α.
Lemma 5.1. If T is axiomatic, then the set of T -derivations is decidable.
Proof. Since Σ is decidable, it can be determined whether any finite sequence
of LQ sentences is a T -derivation.
a
Definition 5.2. A denumerable set A is said to be effectively enumerable iff it
can be determined, for any n ∈ N, which a ∈ A has that index.
Lemma 5.2. If T is axiomatic, then the theorems of T are effectively enumerable.
Proof. Assume that T is axiomatic. Given Lemma 5.1, we can determine
whether any n ∈ N is the g̈-number of a T -derivation. Thus, to find the kth theorem of T , we need only examine each n ∈ N until we have discovered k
derivations.
a
Lemma 5.3. If T is axiomatic and maximal consistent, then T is decidable.
Proof. Assume that T is axiomatic and maximal consistent. Then the theorems
of T are effectively enumerable by Lemma 5.2. Examine the theorems in order.
Since T is maximal, either α or ¬α will be discovered in a finite number of steps.
In the first case, it follows that `T α. In the second case, since T is consistent,
it follows that 0T α. Thus T is decidable.
a
5.3.
Incompleteness of arithmetic
Let R3 be the set of all LQ -sentences that are valid on the set of standard models
S. Thus R3 is a first order theory.
Lemma 5.4. R3 is maximal consistent.
9 The
null set is considered to be decidable.
Incompleteness
25
Proof. For any first order sentence α, and any first order model M, either M α
or M ¬α. But all M ∈ S are isomorphic. ∴ For all α ∈ LQ , S α or S ¬α,
so R3 is maximal. And since 2S ⊥, R3 is consistent.
a
Lemma 5.5. R3 is undecidable.
Proof. Q ⊆ R3 by Lemma 4.9. Thus every recursive function is definable in R3
by Lemma 4.11. But R3 is consistent by Lemma 5.4. Thus R3 is undecidable by
Lemma 4.10.
a
Theorem 5.6 (Gödel’s Theorem). R3 is not axiomatic.
Proof. By Lemma 5.5, R3 is undecidable. But R3 is maximal consistent by
Lemma 5.4. Thus R3 is not axiomatic by Lemma 5.3.
a
This is the celebrated incompleteness theorem for arithmetic, first proved by
Kurt Gödel in 1931.10
10 The proof of Gödel’s Theorem given here assumes Church’s Thesis. Gödel’s original proof
did not require this assumption, and is significantly more complex.
26
References
[1] Bell, J. and M. Machover. A Course in Mathematical Logic. North-Holland
1977.
[2] Boolos, G.S and R. Jeffrey. Computatability and Logic. Cambridge 1989.
[3] Chang, C.C. and H.J. Keisler. Model Theory. North-Holland 1973.
[4] Davis, M. Computabiltiy and Unsolvability. Dover 1982.
[5] Hunter, G. Metalogic. Macmillan 1971.
[6] Gödel, K. On Formally Undecidable Propositions of Principia Mathematica
and Related Systems. Dover 1992.
[7] Smullyan, R.M. Gödel’s Incompleteness Theorems. Oxford 1992.
© Copyright 2026 Paperzz