Download Mathematical Logic Fall 2004 Professor R. Moosa Contents

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Gödel's incompleteness theorems wikipedia , lookup

Intuitionistic logic wikipedia , lookup

Computability theory wikipedia , lookup

Truth-bearer wikipedia , lookup

Set theory wikipedia , lookup

Turing's proof wikipedia , lookup

History of the function concept wikipedia , lookup

Foundations of mathematics wikipedia , lookup

Law of thought wikipedia , lookup

Non-standard analysis wikipedia , lookup

Propositional calculus wikipedia , lookup

Structure (mathematical logic) wikipedia , lookup

Axiom wikipedia , lookup

Peano axioms wikipedia , lookup

Naive set theory wikipedia , lookup

Curry–Howard correspondence wikipedia , lookup

Axiom of reducibility wikipedia , lookup

Model theory wikipedia , lookup

Mathematical logic wikipedia , lookup

Non-standard calculus wikipedia , lookup

Interpretation (logic) wikipedia , lookup

History of the Church–Turing thesis wikipedia , lookup

List of first-order theories wikipedia , lookup

Laws of Form wikipedia , lookup

Theorem wikipedia , lookup

Mathematical proof wikipedia , lookup

Principia Mathematica wikipedia , lookup

Transcript
Mathematical Logic
Fall 2004
Professor R. Moosa
Chris Almost
Contents
1 Introduction
2 First-order logic
2.1 Languages . . . . . . . .
2.2 Structures . . . . . . . .
2.3 Terms . . . . . . . . . .
2.4 Substructures . . . . . .
2.5 Interpreting L-formulas
2.6 Truth . . . . . . . . . .
2
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3 Model Theory
4 “Proofs”
4.1 Logical Axioms . . . . . .
4.2 Propositional Logic . . . .
4.3 Completeness . . . . . . .
4.4 Proof of the Completeness
2
2
3
3
4
5
6
7
. . . . . .
. . . . . .
. . . . . .
Theorem
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
8
8
10
11
12
5 Model Theory
15
6 Definability Theory
19
7 Real Closed Fields
24
8 Computability, Undecidability,
8.1 Computablility . . . . . . . .
8.2 Gödel Numbering . . . . . . .
8.3 Löb’s Theorem . . . . . . . .
8.4 More definability . . . . . . .
Incompleteness
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
26
27
30
32
32
2
Mathematical Logic
1
Introduction
Mathematical Logic is the study of the type of reasoning done by mathematicians. (i.e. proofs, as opposed
to observation) Axioms are the first unprovable laws. They are statements about certain “basic concepts”
(undefined first concepts). There is usually some sort of “soft” justification for believing these first principles.
After this, we define derived concepts and prove theorems about the concepts. All of this together is called
an axiom system. Mathematical logic is really the study of axiom systems.
We must formalize mathematically the notions of statements, proofs, structure, and truth in a given
structure, with respect to a given language. Once we have formalized these notions, we may prove theorems
about them. Logic is really metamathematics. Often the study of the study of a field contributes back to
the field itself, and this is the case with logic. We often discover connections to core areas of math itself
(number theory, geometry, analysis, and algebra).
There is a dichotomy in logic. Given a statement (theorem/axiom/whatever), there is the syntax of the
statement (what is written down on the board) and the semantics (what the statement really means). In
some sense, we want to study the abstract semantics, but it is usually much easier to study the concrete
syntax. Surprisingly, sometimes this works.
Now for some examples. Here we understand that the variables range over the natural numbers and the
operations are as usual.
(i) ∃ y(x = y + y) says that x is even.
(ii) (1 < p) ∧ ∀ r ∀ s(p = rs ⇒ (r = 1) ∨ (s = 1)) says that p is prime
(iii) ∀ x((1 + 1 < x) ∧ even(x) ⇒ ∃ p ∃ q(prime(p) ∧ prime(q) ∧ (x = p + q))) is the Goldbach conjecture
We don’t know if the GC is true in N. As a sentence, it has an interpretation in R, but it is obviously false!
In a given axiom system Σ , there are two possible criteria for judging whether or not we accept a statement
σ. Syntactically, we accept σ if it is a theorem of the system, that is, it can be proved. Sematically, we
accept σ if the meaing of σ is true under every interpretation which is compatible with the axioms of σ (this
is called logical or semantic consequence). The completeness theorem says that these agree.
2
First-order logic
2.1
Languages
Definition 2.1. A language L is a disjoint union of sets Lrel and Lf un where
(i) Lrel is the set of relation symbols, each R of which has an associated arity a(R) ∈ N
(ii) Lf un is the set of function symbols, each F of which has an associated arity a(F ) ∈ N
A constant symbol is a function symbol of arity zero.
Example 2.2. (i) Language of group: Lgroup = {1,−1 , ·}. There is a constant function 1, a unary function
−1
, and a binary function ·
(ii) Additive language of Abelian groups: Lab = {0, −, +}
(iii) Language of order: Lorder = {<} where < is a binary relation
(iv) Language of ordered Abelian groups: Labo = {<, 0, −, +}
(v) Language of rings: Lring = {0, 1, −, +, ·}
First-order logic
3
(vi) Language of semirings: Lsemiring = {0, 1, +, ·}
(vii) Language of ordered rings: Lo−ring = {<, 0, 1, −, +, ·}
(viii) Language of real vector spaces: Lvs(R) = {0, (µr : r ∈ R), −, +} where µr is a unary function symbol
for each r ∈ R
Languages are not invested with meaning, they are just symbols! Languages form the basis for the syntax
of logic.
2.2
Structures
Definition 2.3. Let L denote some language. A structure A for L (also called an L-structure) is a triple
(A, (RA )R∈Lrel , (F A )F ∈Lf un ) consisting of the following: A nonempty set A, called the underlying set of A (or
the universe of A), for each R ∈ Lrel a set RA ⊆ Aa(R) , and for each F ∈ Lf un a function F A : Aa(F ) → A.
These are called the interpretations of the relations and the functions, respectively. The interpretations of
the functions and the relations are called the primatives of A.
Remark. If c is a constant symbol then cA : A0 → A. Since A0 is a single point, cA is completely determined
by it’s range. Through abuse of notation, we say cA ∈ A.
Notation. When the structure is clear from the context, we will abuse the notation and use the same notation
for a relation/function symbol and it’s interpretation.
Example 2.4. (i) Every groups is an Lgroup -structure by interpreting 1,−1 , · as the identity, inverse,
and multiplication of the group, respectively. e.g. R = (R× , 1,−1 , ·) We can also make N an Lgroup structure by interpreting 1 as the number 1, · as multiplication and −1 as the zero map (n−1 = 0),
χ
χ = (N, 1χ ,−1 , ·χ ). Note that this is not actually a group.
(ii) If A = (A, 0, −, +) is an Abelian group then A is an Lab -structure in the natural way. For example,
(R+ , 0, −, +)
A
A
(iii) An Lvs(R) -structure: A = (R[x], 0A , µA
r : P 7→ rP, − , + )
2.3
Terms
Definition 2.5. Var = {v0 , v1 , v2 , . . .} is a countably infinite set of symbols whose elements are called
variables. We assume that vm 6= vn for m 6= n and we assume that no variable appears as a function or
relation symbol in any language that we will ever consider.
Remark. We often use x, y, z, etc. as variables. It doesn’t really matter. For most of what we do, it isn’t
necessary that Var be countably infinite. We will point out in proofs where one needs to make changes in
the proofs if Var is not countably infinite.
Definition 2.6. Suppose that L is a language. An L-term is a word on the alphabet Lf un ∪ Var (where
“word” has the obvious (finite) meaning) such that:
(i) every variable is a term (as a word of length 1)
(ii) if F ∈ Lf un is n-ary and t1 , . . . , tn are terms, then F t1 · · · tn is a term
Example 2.7. L = Lring , then · + 11 + x − y is a valid Lring -term. We would normally write this as
(1 + 1) · (x − y). We will be writing our terms in the “natural” way (using parentheses and infix notation)
even though it is not strictly correct.
4
Mathematical Logic
Lemma 2.8. Suppose that t1 , . . . , tm and v1 , . . . , vn are L-terms and that t1 · · · tm = v1 · · · vn . Then n = m
and ti = vi ∀ i.
Proof. By induction on the length of v1 · · · vn =: l. If l = 0 then both words are empty and we are done. If
m = 0 then we are also done, so we may assume that m > 0. Suppose that l > 0 and the lemma is true for
all words with smaller length. So the first letter of t1 and v1 is the same. There are two possibilities, either
t1 is a variable, or t1 = F a1 , . . . , ak for some F , ai ’s, and k. If t1 = F a1 , . . . , ak , then the first symbol of v1
is F , and so v1 = F b1 , . . . , bk for some terms bi . Thus we get F a1 · · · ak t1 · · · tm = F b1 · · · bk v1 · · · vn We may
strip of the F and get that a1 · · · ak t1 · · · tm = b1 · · · bk v1 · · · vn . By the induction hypothesis k + n = k + m,
so n = m and ai = bi for i = 1, . . . k and tj = vj for j = 2, . . . n. It follows that t1 = v1 and we are done, as
the other case is analogous.
Proposition 2.9. (Unique readability of terms) Suppose that L is a language and t is an L-term. Then
either t is a vabiable or t can be written uniquely as F t1 · · · tn for some n-ary function symbol F and L-terms
ti , i = 1, 2, . . . , n.
Proof. Suppose that t is not a variable. Then t = F t1 · · · , tn for some n-ary function symbol F and terms
ti . If there is another way of writing t as G v1 · · · vm , then F t1 · · · tn = G v1 · · · vm (as words) and so F = G
(as function symbols). Thus n = m, and by the lemma ti = vi ∀ i.
Notation. We will often write t = t(x1 , . . . , xn ) to indicate that the variables in t come from the list x1 , . . . , xn .
Note that it is not necessary that each of x1 , . . . , xn appear in t.
Definition 2.10. (Interpreting terms) Suppose that A is an L-structure and t = t(x) is an L-term, where
x = (x1 , . . . , xm ) (m ∈ N is fixed). We associate to t(x) a function tA : Am → A given by
(i) if t is the variable xi then define tA (a) = ai ∀ a ∈ Am
m
A
(ii) if t = F t1 · · · tn for some n-ary function F then define tA (a) = F A (tA
1 (a), . . . , tn (a)) ∀ a ∈ A
We call tA the interpretation of t(x).
Remark. The definition is well-founded (works) because of Unique readability. Notice that tA depends not
only on t but also on x = (x1 , . . . , xm ).
Example 2.11. R = (R, 0, 1, −, +, ·) is an Lring -structure. The term · + 11 + x − y is interpreted in R as
the function tR : R2 → R : (a, b) 7→ 2(a − b).
2.4
Substructures
Definition 2.12. Suppose that A, B are L-structures. Then A is a substructure of B, denoted by A ⊆ B, if
(i) the underlying set A of A is a subset of the underlying set B of B
(ii) for all relations R ∈ Lrel of arity m, RA = RB ∩ Am
(iii) for all functions F ∈ Lf un of arity n, F A = F B |An . In particular, F B (An ) ⊆ A.
Remark. Suppose B is an L-structure and A ⊆ B is some subset of the universe of B. If F B (An ) ⊆ A ∀ F ∈
Lf un then A is the underlying set of a structure A ⊆ B. In particular,
A = (A, (RB ∩ Aa(R) )R∈Lrel , (F B |Aa(F ) )F ∈Lf un )
Example 2.13.
(i) (Z, 0, 1, −, +, ·) ⊆ (Q, 0, 1, −, +, ·) ⊆ (R, 0, 1, −, +, ·)
(ii) (N, <, 0, 1, +, ·) ⊆ (Z, <, 0, 1, +, ·)
(iii) But N is not the underlying set of any substructure of (Z, 0, 1, −, +, ·).
5
First-order logic
2.5
Interpreting L-formulas
Definition 2.14. The logical symbols are the variables (Var) together with
>, ⊥, ¬, ∧, ∨, ∃, ∀, =
Definition 2.15. (i) An atomic L-formula is a word on the alphabet L ∪ Var ∪ {>, ⊥, =} of one of the
following forms
(a) >
(b) ⊥
(c) R t1 · · · tm , where R ∈ Lrel and the ti are L-terms
(d) = t1 t2 , where t1 , t2 are L-terms
(ii) An L-formula is a word on the alphabet of L union the logical symbols, defined inductively by
(a) every atomic formula is a formula
(b) if ϕ, ψ are formulae then so are ∧ϕψ, ∨ϕψ, and ¬ϕ
(c) if ϕ is a formula and x is a variable then ∃ xϕ and ∀ xϕ are formulae
Remark.
(i) We will write the formulas using infix notation for readability
(ii) We will use ϕ → ψ to abbreviate the formula ∨¬ϕψ (i.e. ¬ϕ ∨ ψ)
Definition 2.16. Suppose that ϕ is an L-formula. Write ϕ as a string s1 · · · sm , where each si is in L or
is a logical symbol. A subformula of ϕ is a subword of the form si · · · sk , where 1 ≤ i ≤ k ≤ m that is
itself a formula. An occurrence of a variable x in the j th place (so x = sj ) is said to be bound if there is a
subformula of ϕ, si · · · sk , such that 1 ≤ i ≤ j ≤ k ≤ m of the form ∀ xψ or ∃ xψ for some formula ψ. An
occurrence that is not bound is said to be free.
Example 2.17. Consider the formula ∃ x(x · y = z) ∧ x−1 = 1. Then the first two occurrences of x are
bound, and the last occurrence of x, y and z are free.
Definition 2.18. An L-sentence is an L-formula with no free occurrence of variables.
Proposition 2.19. (Unique readability of formulae) Suppose L is a language and ϕ is an L-formula. Then
ϕ can be written uniquely as exactly one of the following
(i) >
(ii) ⊥
(iii) R t1 · · · tm , where R ∈ Lrel and the ti are L-terms
(iv) = t1 t2 , where t1 , t2 are L-terms
(v) ¬ϕ, where ϕ is a formula
(vi) ∧ϕψ, where ϕ and ψ are formulas
(vii) ∨ϕψ, where ϕ and ψ are formulas
(viii) ∃ xϕ, where ϕ is a formula and x is a variable
6
Mathematical Logic
(ix) ∀ xϕ, where ϕ is a formula and x is a variable
Notation. Suppose that ϕ is an L-formula. We often write ϕ = ϕ(x1 , . . . , xn ) to indicate that all of the free
variables of ϕ are amoung the variables x1 , . . . , xn . It is not necessary that each of these variables actually
appears as a free variable. It is assumed that they are distinct variables, however.
Definition 2.20. Suppose that t1 , . . . , tn are L-terms and x1 , . . . , xn are variables.
(i) If t is a term, then by t(t1 /x1 , . . . tn /xn ) we mean the word obtained from t by replacing xi with ti
simultaneously.
(ii) If ϕ is a formula, then by ϕ(t1 /x1 , . . . , tn /xn ) we mean the word obtained from ϕ by replacing each
free occurrence of xi with ti simultaneously.
Lemma 2.21.
(i) t(t1 /x1 , . . . tn /xn ) is a term
(ii) ϕ(t1 /x1 , . . . , tn /xn ) is a formula
Also note that ϕ atomic implies that ϕ(t1 /x1 , . . . , tn /xn ) is atomic.
Proof. (Sketch) First prove (i) by induction on length. This implies (ii) for ϕ atomic. Next, prove (ii) for
general ϕ by induction on length. For example, say ϕ is ∃ xψ. There are two cases
(i) x 6∈ {x1 , . . . , xn }. Then ϕ(t1 /x1 , . . . , tn /xn ) is ∃ xψ(t1 /x1 , . . . , tn /xn ) and by induction, the right hand
side is a formula
(ii) Without loss of generality, x = x1 . Then ϕ is ∃ x1 ψ. All occurrences of x1 in ϕ are bounded, so by
definition ϕ(t1 /x1 , . . . , tn /xn ) is ϕ(t2 /x2 , . . . , tn /xn ) and by induction we are done
We will write ϕ(t1 , . . . , tn ) as shorthand for ϕ(t1 /x1 , . . . , tn /xn ). Suppose we have a formula ϕ(x1 , . . . , xn )
and a stucture A = (A, . . .). For elements of the structure a1 , . . . an ∈ A, what do we mean by ϕ(a1 , . . . , an )?
Definition 2.22. Suppose that A = (A, . . .) is an L-structure. For each a ∈ A, we choose a new constant
symbol a called the name of a. The language obtained from L by adding the names a for each a ∈ A is
denoted by LA := L ∪ {a | a ∈ A}. The L-structure A can be made into an LA -structure, AA , by keeping
the same interpretation of symbols in L as A had, and interpreting each name a as a, (i.e. aAA = a).
It is understood that different names are used for different elements. It is also understood that the
name of a is not a function, relation, or logical symbol. Note that LA depends on A. If t(x1 , . . . , xn ) is
an L-term and a1 , . . . , an ∈ A, then t(a1 , . . . , an ) is a variable-free LA -term. Similarily, if ϕ(x1 , . . . , xn )
is an L-formula, then ϕ(a1 , . . . , an ) is an LA -sentence. Note that every L-formula (resp. sentence) is an
LA -formula (resp. sentence). Every LA -term t(x1 , . . . , xn ) is of the form s(x1 , . . . , xn , a1 , . . . , am ) for some
L-term s and elements a1 , . . . , am ∈ A. Then tAA : An → A, whereas sA : An+m → A.
2.6
Truth
Definition 2.23. Let L be a language and A be an L-structure. We define inductively what it means for
an LA -sentence to be true in A. If σ is an LA -sentence, we write A |= σ to mean that σ is true in A.
(i) A |= >, and A 6|= ⊥
A
A
(ii) A |= R t1 · · · tm if and only if (tA
1 , . . . , tm ) ∈ R where t1 , . . . , tm are variable free LA -terms
A
(iii) A |= t1 = t2 if and only if tA
1 = t2 where t1 , t2 are variable free LA -terms.
7
Model Theory
(iv) σ = ¬σ1 , A |= σ if and only if A 6|= σ1
(v) σ = σ1 ∧ σ2 , A |= σ if and only if A |= σ1 and A |= σ2
(vi) σ = σ1 ∨ σ2 , A |= σ if and only if A |= σ1 or A |= σ2
(vii) σ = ∃ xϕ(x), A |= σ if and only if there exists a ∈ A such that A |= ϕ(a)
(viii) σ = ∀ xϕ(x), A |= σ if and only if for all a ∈ A we have A |= ϕ(a)
In particular, we have defined what it means for an L-sentence to be true in A. We also say that A satisfies
σ or that σ holds in A for A |= σ. If A |= σ = ϕ(a1 , . . . , an ) for ϕ an L-formula and (a1 , . . . , an ) ∈ An , then
we say (a1 , . . . , an ) realizes ϕ in A, or (a1 , . . . , an ) is true of ϕ in A.
Definition 2.24. Given an LA -formula ϕ(x1 . . . , xn ), we let ϕAA be the set of n-tuples that realize ϕ
(i.e. {(a1 , . . . , an ) ∈ An | A |= ϕ(a1 , . . . , an )}). We say that ϕA is defined by ϕ. A set S ⊆ AN is
definable in A if S = ϕA for some LA -formula ϕ(x1 . . . , xn ). Moreover, if ϕ can be chosen to be of the form
ϕ(x1 . . . , xn ) = ψ(x1 . . . , xn , b1 , . . . bm ) where ψ is an L-formula and b1 , . . . bm ∈ B ⊆ A then we say that ϕ
is B-definable. In this case we may also say that S is definable with parameters from B. When B = ∅ we
say that S is 0-definable.
√
Example 2.25.√In (R, <, 0, 1, +, −, ·), S = {x ∈ R√| x < 2} ⊆ R is definable. For example, it is defined
by ϕ(x) := x < 2, an LR -formula. It is actually { 2}-definable. We can do better, by taking
ψ(x) := (x · x < 1 + 1) ∨ (x < 0)
ψ is an L-formula and S = ψ A , so S is 0-definable.
√
√
Example 2.26. In (R, <, 0, +, −), S = {x ∈ R | x < 2} ⊆ R is { 2}-definable, but not 0-definable (at
least by ψ). We will be able to prove this for certain later.
3
Model Theory
Definition 3.1. Suppose Σ is a collection of L-sentences. A model of Σ is an L-structure A such that each
sentence in Σ is true in A.
Example 3.2.
(i) Groups are exactly the Lgroup -structures that are models of
GR := {∀ x(x · 1 = x ∧ 1 · x = x), ∀ x(x · x−1 = 1 ∧ x−1 · x = 1), ∀ xyz(x · (y · z) = (x · y) · z)}
(ii) Abelian groups are exactly the Lgroup -structures that are models of GR ∪ {∀ xy(x · y = y · x)}. Alternatively, Abelian groups are the Lab -structures that are models of
AB := {∀ x(x + 0 = x), ∀ x(x + (−x) = 0), ∀ xyz(x + (y + z) = (x + y) + z), ∀ xy(x + y = y + x)}
(iii) Rings are exactly the Lring -structures that are models of the ring axioms,
RI = AB ∪ {∀ x(x · 1 = x ∧ 1 · x = x), ∀ xyz(x · (y · z) = (x · y) · z)}
(iv) Fields are the models of the field axioms,
F = RI ∪ {∀ x∃ y(x · y = 1 ∧ y · x = 1), ∀ xy(x · y = y · x), 1 6= 0}
8
Mathematical Logic
(v) Algebraically closed fields are the models of
ACF = F ∪ {∀ u1 , . . . un ∃ x(xn + u1 xn−1 + · · · + un = 0) | n = 2, 3, . . .}
Definition 3.3. We say that an L-sentence σ is a logical consequence of a collection of L-sentences Σ,
written Σ |= σ, if σ is true in every model of Σ.
Example 3.4. GR |= ∀ xyz(x · y = x · z → y = z)
The completeness theorem will say that Σ |= σ if and only if σ is “proveable” from Σ, once we know
what proveable means.
Definition 3.5. Suppose that A = (A, . . .) is an L-structure. An A-instance of an L-formula ϕ(x1 , . . . , xn )
is an LA -sentence of the form ϕ(a1 , . . . , an ), where a1 , . . . , an ∈ A. This is independent of the choice of
(x1 , . . . , xn ), but this requires proof. We say that an L-formula is valid in A if every A-instance is true,
denoted A |= ϕ. ϕ is satisfiable in A if some A-instance is true. An L-formula ϕ is a logical consequence of
a collection of L-sentences Σ, written Σ |= ϕ, if ϕ is valid for all A |= Σ. (A |= Σ means that A is a model
of Σ.)
Exercise. ϕ(x1 , . . . , xn ) is valid if an only if A |= ∀ x1 , . . . , xn ϕ, if and only if ϕA = An
Lemma 3.6. A = (A, . . .) an L-structure. Let t be a variable free LA -term. with tA = a ∈ A. Then
(i) If s(x) is an LA -term then s(t) is a variable free LA -term, and s(t)A = s(a)A = sA (a)
(ii) If ϕ(x) is an LA -formula then ϕ(t) is an LA -sentence, and A |= ϕ(t) if and only if A |= ϕ(a)
4
“Proofs”
4.1
Logical Axioms
Definition 4.1. L is a language. The logicals axioms of L are the propositional axioms, the equality axioms,
and the quantifier axioms. A propositional axiom of L is a formula of one of the following forms, where
ϕ, ψ, θ are L-formulas
(i) >
(ii) ϕ → (ψ ∨ ϕ); ϕ → (ϕ ∨ ψ)
(iii) ¬ϕ → (¬ψ → ¬(ϕ ∨ ψ))
(iv) (ϕ ∧ ψ) → ϕ; (ϕ ∧ ψ) → ψ
(v) ϕ → (ψ → (ϕ ∧ ψ))
(vi) ϕ → (¬ϕ → ⊥)
(vii) (ϕ → (ψ → θ)) → ((ϕ → ψ) → (ϕ → θ))
(viii) (¬ϕ → ⊥) → ϕ
Equality axioms of L are the following L-formulas, where x’s, y’s, and z’s are variables
(i) x = x
“Proofs”
9
(ii) x = y → y = x
(iii) (x = y) ∧ (y = z) → x = z
(iv) (x1 = y1 ) ∧ · · · ∧ (xn = yn ) ∧ R x1 . . . xn → R y1 . . . yn where R ∈ Lrel is n-ary
(v) (x1 = y1 ) ∧ · · · ∧ (xn = yn ) → F x1 . . . xn = F y1 . . . yn where F ∈ Lf un is n-ary
If ϕ is an L-formula, t an L-term, and y a variable, we say that t is free for y in ϕ if no variable in t becomes
bound upon replacing free occurrences of y by t in ϕ. That is, for all variables x in t, there is no subformula
of ϕ of the form ∀ xψ or ∃ xψ where ψ has an occurrence of y that is free in ϕ. The quantifier axoims are
L-formulas of the form
(i) ϕ(t/y) → ∃ yϕ
(ii) ∀ yϕ → ϕ(t/y)
where ϕ is any L-formula, t is an L-term which is free for any y in ϕ.
You must check that every logical axiom of L is valid in every L-structure!
Definition 4.2. The logical rules of L are:
(MP) From ϕ and ϕ → ψ infer ψ
(G) If x does not occur freely in ϕ then
(a) from ϕ → ψ infer ϕ → ∀ xψ
(b) from ψ → ϕ infer ∃ xψ → ϕ
Check that if the hypotheses of a logical rule are valid in a given L-structure then so are the conclusions.
Definition 4.3. A (formal) proof of an L-formula ϕ from a set of L-sentences Σ is a sequence ϕ1 , . . . , ϕk
of L-formulae such that
(i) ϕ = ϕk
(ii) For all 1 ≤ j ≤ k, ϕj is either
(a) a logical axiom
(b) a sentence in Σ
(c) there are 1 ≤ r, s < j such that ϕj can be infered from ϕr and ϕs by (MP) or from ϕr by (G).
We say that Σ proves ϕ and write Σ ` ϕ if there exists a proof of ϕ from Σ.
Note that these are not the only possible logical axioms and logical rules.
Lemma 4.4. For any L-formulas ϕ, ψ, θ,
(i) Law of the Excluded Middle: ` ϕ ∨ ¬ϕ
(ii) Contraction rule: ` ϕ ∨ ϕ → ϕ
(iii) Associativity: ` (ϕ ∨ ψ) ∨ θ → ϕ ∨ (ψ ∨ θ)
(iv) Cut rule: ` (ϕ ∨ ψ) ∧ (¬ϕ ∨ θ) → (ψ ∨ θ)
Proof. Exercise.
(i) Propostion axiom scheme 2 says that γ → β ∨ γ. In particular, ϕ → (¬(¬ϕ ∨ ϕ) ∨ ϕ) and ϕ → (¬ϕ ∨ ϕ).
But the first is equivalent to ϕ → ((¬ϕ ∨ ϕ) → ϕ) and the second ϕ → (ϕ → ϕ). Now from another
axiom, (γ → (β → π)) → ((γ → β) → (γ → π)), and so (sub it just ϕ, apply (MP)).
10
4.2
Mathematical Logic
Propositional Logic
Definition 4.5. Given L-formulas ϕ1 , . . . , ϕn , let Prop(ϕ1 , . . . , ϕn ) be the set of L-formulas obtained inductively as follows
(i) >, ⊥, ϕ1 , . . . , ϕn ∈ Prop(ϕ1 , . . . , ϕn )
(ii) If θ, ψ ∈ Prop(ϕ1 , . . . , ϕn ), so are ¬θ, θ ∧ ψ, θ ∨ ψ
A truth assignment on {ϕ1 , . . . , ϕn } is a map t : {ϕ1 , . . . , ϕn } → {0, 1}. We extend t to Prop(ϕ1 , . . . , ϕn )
inductively as follows t̂ : Prop(ϕ1 , . . . , ϕn ) → {0, 1}
(i) t̂(>) = 1, t̂(⊥) = 0
(ii) t̂(¬θ) = 1 − t̂(θ)
(iii) t̂(θ ∧ ψ) = min{t̂(θ), t̂(ψ)}
(iv) t̂(θ ∨ ψ) = max{t̂(θ), t̂(ψ)}
An L-formula ϕ is an L-tautology if there exist L-formulae ϕ1 , . . . , ϕn such that ϕ ∈ Prop(ϕ1 , . . . , ϕn ) and
for every truth assignment t : {ϕ1 , . . . , ϕn } → {0, 1}, t̂(ϕ) = 1.
Note that all of the L-formulas in Lemma 4.4 above are L-tautologies, and also all of our propositional
axioms are L-tautologies.
Theorem. (Tautology Theorem) ` ϕ for any L-tautology ϕ.
Proof. See text. This proof requires some tricks.
Lemma 4.6. Let Σ be a set of L-sentences. Then
(i) If Σ ` ϕ then Σ ` ∀ xϕ
(ii) If Σ ` ϕ and t is an L-term which is free for x in ϕ then
Σ ` ϕ(t/x)
(iii) If Σ ` ϕ and t1 , . . . , tn are L-terms whose variables do not occur bound in ϕ then
Σ ` ϕ(t1 /x1 , . . . tn /xn )
Proof. (i) ϕ → (¬∀ xϕ → ϕ) is an L-tautology on {ϕ, ∀ xϕ}. So Σ proves it. Since Σ ` ϕ, by (MP)
Σ ` ¬∀ xϕ → ϕ. So by (G), Σ ` ¬∀ xϕ → ∀ xϕ. But (¬∀ xϕ → ∀ xϕ) → ∀ xϕ is a tautology, and by
(MP), Σ ` ∀ xϕ
(ii) Σ ` ϕ gives Σ ` ∀ xϕ. ∀ xϕ → ϕ(t/x) is a quantifier axiom since t is free for x in ϕ. Therefore by
(MP) Σ ` ϕ(t/x).
(iii) Let y1 , . . . yn be fresh variables. By using (ii) repeatedly, Σ ` ϕ(y1 /x1 , . . . yn /xn ). Setting
ψ = ϕ(y1 /x1 , . . . yn /xn )
by (ii) repeatedly, Σ ` ψ(t1 /y1 , . . . tn /yn ). Now observe
ψ(t1 /y1 , . . . tn /yn ) = ϕ(t1 /x1 , . . . tn /xn )
11
“Proofs”
Lemma. (Deduction Lemma) If Σ ∪ {σ} ` ϕ then Σ ` σ → ϕ, where Σ is a set of L-sentences, σ is an
L-sentence, and ϕ is any L-formula.
Proof. By induction on the length of the proof of ϕ from Σ ∪ {σ}. Suppose the proof is of length one. If ϕ
is a logical axiom then Σ ` ϕ and ϕ → (σ → ϕ) and we are done by (MP). If ϕ ∈ Σ ∪ {σ} then either ϕ ∈ Σ
and we are done as before, or ϕ = σ and we are done since ϕ → ϕ is a tautology.
If ϕ is obtained from (MP) applied to θ and θ → ϕ then by the induction hypothesis Σ ` σ → θ and
Σ ` σ → (θ → ϕ).
(σ → (θ → ϕ)) → ((σ → θ) → (σ → ϕ))
is a propositional axiom. Using (MP) we have
Σ ` (σ → θ) → (σ → ϕ)
and applying it again gives us Σ ` σ → ϕ.
Suppose that ϕ is obtained by (G). There are two cases
(i) ϕ = ϕ0 → ∀ xψ where x does not occur freely in ϕ0 , and ϕ0 → ψ appears earlier in the proof of ϕ from
Σ ∪ {σ}. By the induction hypothesis, Σ ` σ → (ϕ0 → ψ).
(σ → (ϕ0 → ψ)) → ((σ ∧ ϕ0 ) → ψ)
is a tautology. By (MP) Σ ` (σ ∧ ϕ0 ) → ψ and x does not occur freely in σ ∧ ϕ0 . By (G) Σ ` σ ∧ ϕ0 →
∀ xψ.
((σ ∧ ϕ0 ) → ∀ xψ) → (σ → (ϕ0 → ∀ xψ))
is a tautology. By (MP) Σ ` σ → ϕ.
(ii) ϕ = ∃ xψ → ϕ0 where x does not occur freely in ϕ0 , and ψ → ϕ0 appears earlier in the proof of ϕ from
Σ ∪ {σ}. Exercise.
Definition 4.7. A set of L-sentences Σ is said to be consistent if Σ 6` ⊥. Otherwise, Σ is said to be
inconsistent.
Corollary 4.8. Σ ` σ if and only if Σ ∪ {¬σ} is inconsistent.
Proof. Assume that Σ ` σ. σ → (¬σ → ⊥) is a propositional axiom. By (MP) Σ ` ¬σ → ⊥, and thus
Σ ∪ {¬σ} ` ¬σ → ⊥. It is clear that Σ ∪ {¬σ} ` ¬σ, and so by (MP) Σ ∪ {¬σ} ` ⊥. Therefore Σ ∪ {¬σ} is
inconsistent.
Now suppose that Σ ∪ {¬σ} ` ⊥. Then by the deduction lemma Σ ` ¬σ → ⊥. But (¬σ → ⊥) → σ is a
propositional axiom. Therefore by (MP) Σ ` σ.
4.3
Completeness
Proposition 4.9. If Σ ` ϕ then Σ |= ϕ, where Σ is a set of L-sentences and ϕ is an L-formula.
Proof. Suppose Σ ` ϕ. Let A |= Σ. Let ϕ1 , . . . , ϕk be a proof of ϕ from Σ. We show that A |= ϕj for each
j. (In particular, A |= ϕk gives that A |= ϕ.) Every logical axiom is valid in A. If the hypotheses of any
logical rule are valid in A then so are it’s conclusions. Every sentence in Σ is true in A, so by induction,
A |= ϕj for all j.
More interestingly,
12
Mathematical Logic
Theorem. (Completeness Theorem, Gödel (1930)) Σ ` ϕ if and only if Σ |= ϕ, where Σ is a set of Lsentences and ϕ is an L-formula.
Corollary. (Compactness Theorem) If Σ |= ϕ then there exists Σ0 ⊆ Σ with Σ0 finite such that Σ0 |= ϕ.
Proof. Σ |= ϕ implies that Σ ` ϕ so there is a proof. Proofs are finite, so there is a finite subset Σ0 ⊆ Σ
such that Σ0 ` ϕ, which implies that Σ0 |= ϕ. (Let Σ0 be the set of the L-sentences that actually appear in
the proof of ϕ from Σ.)
Recall that Abelian groups are exactly the Lab -structures which are models the Abelian group axioms
AB. We say that the class of Abelian groups is “elementary”.
Example 4.10. There is no collection of Lgroup -sentences, Σ, such that the models of Σ are exactly the
finite groups. That is, the class of finite groups is not elementary. Suppose Σ exists. Let
Σ0 := Σ ∪ {∃ x1 , . . . , xn ∧i6=j (xi 6= xj ) | n = 1, 2, 3, . . . }
Then Σ0 has no models. It follows that Σ0 |= ⊥, vacuously. By compactness, there is some N > 0 such that
Σ0N := Σ ∪ {∃ x1 , . . . , xn ∧i6=j (xi 6= xj ) | n = 1, 2, . . . , N }
and Σ0N |= ⊥. But any group of size at least N is a model of Σ0N , but not a model of ⊥. This is a
contradiction.
Theorem. (Completeness Theorem, second form) Σ is consistent if and only if Σ has a model.
Proposition 4.11. The two forms of completeness are equivalent. That is, the following are equivalent
(i) Σ ` ϕ if an only if Σ |= ϕ
(ii) Σ is consistent if and only if Σ has a model
Proof. (i) ⇒ (ii) Suppose that Σ is consistent. Σ 6` ⊥, so Σ |6 = ⊥ by (i). Thus Σ has model, for otherwise
Σ |= ⊥ vacuously. Conversely, suppose Σ has a model. Then Σ |6 = ⊥, so Σ 6` ⊥, again by (i).
(ii) ⇒ (i) Exercise.
Theorem. (Compactness Theorem, second form) If every finite subset of Σ has model then Σ has a model.
4.4
Proof of the Completeness Theorem
We will prove that Σ is consistent if an only if Σ has a model. We’ve already proved that if Σ has a model
then Σ 6|= ⊥, so Σ 6` ⊥ and Σ is consistent.
Suppose now that Σ is consistent. We need to find a model. Let TL be the set of all variable free L-terms.
Define ∼Σ by t1 ∼Σ t2 if and only if Σ ` t1 = t2 . The idea we are going use is that TL / ∼Σ should be the
universe of a model of Σ.
Lemma 4.12.
(i) For each L-term, ` t = t
(ii) t, t0 L-terms, if Σ ` t = t0 then Σ ` t0 = t
(iii) t1 , t2 , t3 L-terms, if Σ ` t1 = t2 and Σ ` t2 = t3 then Σ ` t1 = t3
(iv) R ∈ Lrel m-ary and t1 , t01 , . . . , tm , t0m L-terms such that Σ ` ti = t0i for each i, then Σ ` R t1 . . . tm
implies that Σ ` R t01 . . . t0m
“Proofs”
13
(v) F ∈ Lf un m-ary and t1 , t01 , . . . , tm , t0m L-terms such that Σ ` ti = t0i for each i, then Σ ` F t1 . . . tm =
F t01 . . . t0m
Proof. These are just restatements of some of the logical axioms. Fill in the details.
Parts (i) to (iii) enusure that ∼Σ is an equivalence relation on TL . Suppose L has at least one constant
symbol, so that TL is non-empty.
Definition 4.13. Define an L-structure AΣ as follows
• universe of AΣ is AΣ = TL / ∼Σ
• for R ∈ Lrel m-ary, define RAΣ ⊆ (AΣ )m by ([t1 ], . . . [tm ]) ∈ RAΣ if and only if Σ ` R t1 . . . tm
• for F ∈ Lrel m-ary, define F AΣ ([t1 ], . . . [tm ]) = [t] if and only if Σ ` F t1 . . . tm = t
Notice that the interpretations of the relation and function symbols is well founded because of parts (vi) and
(v) of the lemma.
Lemma 4.14. Suppose L has a constant symbol and Σ is consistent. Then
(i) for all t ∈ TL , tAΣ = [t]
(ii) for each atomic sentence σ, Σ ` σ if and only if AΣ |= σ
Proof.
(i) Trivial induction.
(ii) Follows from (i) by induction. For example, σ = R t1 . . . tm for terms in TL . Then Σ ` σ if and only if
AΣ
AΣ
Σ
([t1 ], . . . , [tm ]) ∈ RAΣ , which is equvalent to having (tA
. This happens if and only if
1 , . . . , tm ) ∈ R
AΣ |= R t1 . . . tm , by definition of |=. The other cases are analogous.
We wish to extend the above claim to all sentences. There are two obstacles. The first is that for any
sentence σ, either AΣ |= σ or AΣ |= ¬σ, by definition of |=. This is not necessarily the case for provability
in Σ. That is, maybe Σ 6` σ and Σ 6` ¬σ.
Definition 4.15. A set Σ of sentences is said to be complete if for every sentence σ either Σ ` σ or Σ ` ¬σ.
For example, ACF is incomplete, as ACF 6` ∀ x(x + x = 0) and ACF 6` ∃ x(x + x 6= 0). Thus it is
impossible for part (ii) to be true for all σ.
If σ = ∃ xϕ(x), where ϕ is atomic, suppose that Σ ` ∃ xϕ(x). For AΣ |= σ, one needs an element
a ∈ AΣ such that AΣ |= ϕ(a), where ϕ(a) is an LAΣ -atomic sentence. But a = [t] for some t ∈ TL . Now
aAΣ = a = [t] = tAΣ . By a previous lemma, AΣ |= ϕ(a) if and only if AΣ |= ϕ(t). ϕ(t) is an atomic sentence,
so AΣ |= ϕ(t) if and only if Σ ` ϕ(t). So in summary, in order to extend the above claim to σ = ∃ xϕ(x) we
need that whenever Σ ` ∃ xϕ(x) there is a variable free term t ∈ TL such that Σ ` ϕ(t). This is a property
of Σ that is not necessarily going to be the case.
Definition 4.16. A Σ-witness for the sentence ∃ xϕ(x), where ϕ(x) is any L-formula, is t ∈ TL such that
Σ ` ϕ(t). We say that Σ has witnesses if whenever Σ ` ∃ xϕ(x) then there exists a Σ-witness for ∃ xϕ(x).
For example, ACF does not have witnesses, as the variable-free terms of ACF are exactly the integers,
and so ∃ x(x · x = 1 + 1) has no witness.
Theorem 4.17. Suppose L has a constant symbol and Σ is consistent. Then the following are equivalent
(i) for each L-sentence σ, Σ ` σ if and only if AΣ |= σ
14
Mathematical Logic
(ii) Σ is complete and has witnesses.
In particular, if Σ is consistent, complete, and has witnesses, then AΣ |= Σ.
Proof. We have already seen that (i) implies (ii). We need to show that (ii) is sufficient for (i). Assume (ii)
and use induction on the number of logical symbols. If σ is atomic, then this is the above lemma. If σ is
one of ¬σ1 or σ1 ∨ σ2 or σ1 ∧ σ2 then this is easy by induction. (Try it.) If σ = ∃ xϕ(x), then suppose that
Σ ` σ. Σ has witnesses, so there is t ∈ TL such that Σ ` ϕ(t). By the induction hypothesis, AΣ |= ϕ(tAΣ ),
so AΣ |= σ. And so on. . .
If σ = ∀ xϕ(x) then . . .
Lemma 4.18. If Σ is consistent then Σ ⊆ Σc , where Σc is a complete set of L-sentences.
Proof. Let P be the set of all consistent sets of L-sentences containing Σ. Partially order it by inclusion.
Given a chain, the union is also consistent (as proofs are finite) and hence an upper bound for the chain.
Thus by Zorn’s Lemma, P has a maximal element Σc . Σc is complete because given any σ, either σ ∈ Σc or
¬σ ∈ Σ. (If Σc 6` σ then, by a corollary above, Σc ∪ {¬σ} is not inconsistent, so Σc ∪ {¬σ} ∈ P and hence
by maximality ¬σ ∈ Σc .)
Lemma 4.19. Let Σ be a consistent set of L-sentences and c a fresh constant symbol not in L. Let Lc =
L ∪ {c}. Let ϕ(y) be any L-formula.
(i) If Σ `Lc ϕ(c) then Σ `L ϕ(y)
(ii) If Σ `L ∃ yϕ(y) then Σ ∪ {ϕ(c)} is a consistent set of Lc -sentences
Proof. (Sketch) Go through the proof of ϕ(c) from Σ and replace every occurrence of c by a new variable z
(6= y and does not occur in the proof). Check that we have a proof of ϕ(z/y) from Σ in L. Notice that the
only occurrences of c in this proof are in ϕ(c) and in the logical axioms. Thus Σ `L ϕ(z). For the second
part, assume not. Then Σ ∪ {ϕ(c)} `Lc ⊥, which implies Σ `Lc ϕ(c) → ⊥ by the deduction lemma, which
implies Σ `L ϕ(y) → ⊥. By (G) Σ `L ∃ yϕ(y) → ⊥, but Σ `L ∃ yϕ(y), which implies that Σ `L ⊥, a
contradiction.
Corollary 4.20. Let Σ be consistent and let
Λ = {σ = ∃ xϕ(x) | ϕ(x) is an L-formula ϕ(x) and Σ ` σ}
Let {cσ | σ ∈ Λ} be a set of new constant symbols such that cσ 6= cσ0 for any σ 6= σ 0 ∈ Λ. Let
Lw := L ∪ {cσ | σ ∈ Λ} and Σw := Σ ∪ {ϕ(cσ ) | ∃ xϕ(x) ∈ Λ}
Then Σw is a consistent set of Lw -sentences.
Proof. Repeated use of Lemma 4.18 (finitely many times, by contradiction).
Note that we have not yet shown that Σw has witnesses!
We now complete the proof of completeness. Let Σ be a set of L-sentences. Set L0 = L and Σ0 = Σ.
Define
(
(
Ln if n is even
Σcn if n is even
Ln+1 =
and
Σ
=
n+1
Lw
if n is odd
Σw
if n is odd
n
n
Then Ln ⊆ Ln+1 and Σn ⊆ Σn+1 for all n, and Σn is a consistent set of Ln -sentences. Let
[
[
Σ∞ :=
Σn and L∞ :=
Ln
n≥0
n≥0
Model Theory
15
Claim. Σ∞ is a consistent set of L∞ -sentences
Proof. Any proof of ⊥ from Σ∞ in L∞ is finite and so is a proof of ⊥ from ΣN from LN for some N .
Claim. Σ∞ is complete.
Proof. Let σ be an L∞ -sentence. Then σ is an LN -sentence for some N even. LN +1 = LN and ΣN +1 = ΣcN
is a complete set of LN -sentences, so either ΣcN `LN σ or ΣcN `LN ¬σ. Therefore either Σ∞ `L∞ σ or
Σ∞ `L∞ ¬σ.
Claim. Σ∞ has witnesses.
Proof. Σ∞ `L∞ ∃ xϕ(x), where ϕ is an L∞ -formula implies that ΣN `LN ∃ xϕ(x) for some large N odd.
w
w
w
LN +1 = Lw
N and ΣN +1 = ΣN is a consistent set of LN -sentences. By construction of LN from LN , there is
w
w
w
w
a constant symbol c ∈ LN such that ϕ(c) ∈ ΣN and ΣN `LN ϕ(c). This implies that Σ∞ `L∞ ϕ(c), so ϕ(x)
has a witness in L∞ .
From these claims and the theorem above, AΣ∞ |= Σ∞ .
Definition 4.21. Suppose that L∗ is a language extending L and A = (A, . . .) is an L∗ -structure. The
reduct of A to L, denoted by A|L is the L-structure with universe A and each symbol in L is interpreted
exactly as it was in A. Essentially, we are forgetting the interpretation of the symbols in L∗ \ L.
We must check 2 things
(i) tA|L = tA for any L-term
(ii) For any LA -sentence σ, A|L |=L σ if and only if A |=L∗ σ
Then AΣ∞ |= Σ∞ implies that AΣ∞ |L |= Σ, so AΣ∞ |L is a model of Σ.
5
Model Theory
Corollary. (Compactness Theorem) Let Σ be a set of L-sentences such that every finite subset has a model.
Then Σ has a model.
Corollary. (Countable Löwenheim-Skolem Theorem) Suppose that L is a countable language and Σ a set
of L-sentences has a model. Then Σ has a countable model. (By the cardinality of a structure we mean the
cardinality of its universe.)
Proof. Σ is consistent. Var is countable and L is countable, hence the set of L-sentences is countable. In
particular, L ∪ {cσ | Σ ` σ where σ = ∃ xϕ(x)} is countable. This implies that Σw is countable and so is Lw .
Therefore L∞ and TL∞ are countable, and so TL∞ / ∼Σ∞ is countable, and it is the underlying universe of
AΣ∞ |L |= Σ.
Theorem. (Generalized Löwenheim-Skolem Theorem) Suppose L has size at most κ, and suppose that Σ,
a set of L-sentences, has an infinite model. Then Σ has a model of size κ.
This theorem is important because it implies that model theory cannot distinguish between cardinals.
Model theory is not set theory.
16
Mathematical Logic
Proof. Let {cλ | λ < κ} be a family of new constant symbols, pairwise distinct and not in L. Let L0 =
L ∪ {cλ | λ < κ} and let Σ0 = Σ ∪ {cλ 6= cλ0 | λ < λ0 < κ}. We claim that Σ0 is consistent. If not, then
some finite subcollection Λ ⊆ Σ0 is inconsistent. Let cλ1 , . . . , cλn be the new constants that actually appear
in Λ. Then Λ ⊆ Σ ∪ {cλi 6= cλj | i 6= j, 1 ≤ i < j ≤ n}. Σ has an infinite model A. Make A into an
L ∪ {cλ1 , . . . , cλn }-structure by interpreting cλ1 , . . . , cλn as distinct elements (fix any such choice). Call this
structure An . Then An |= Σ ∪ {cλi 6= cλj | i 6= j, 1 ≤ i < j ≤ n}, so An |= Λ, which is a contradiction.
Now L0 has size at most κ, so there are at most κ many L0 -sentences, which implies that L0w has
cardinality at most κ, and so L0∞ has cardinality at most κ. As before, TL0∞ / ∼Σ0∞ = AΣ0∞ |L |= Σ0 . Therefore
Σ0 has a model of size at most κ. But any model of Σ0 has κ-many elements, so Σ0 has a model of size
exactly κ, call it A. Then A |= Σ.
Definition 5.1. Let A = (A, . . .), B = (B, . . .) be L-structures. A homomorphism h : A → B is a map
h : A → B such that
(i) for each m-ary relation symbol R ∈ Lrel and any (a1 , . . . , am ) ∈ Am
(a1 , . . . , am ) ∈ RA implies (h(a1 ), . . . , h(an )) ∈ RB
(ii) for each m-ary function symbol F ∈ Lf un and any (a1 , . . . , am ) ∈ Am
h(F A (a1 , . . . , am )) = F B (h(a1 ), . . . , h(an ))
If you replace the implication above with “if and only if” in (i) then we say that h is a strong homomorphism. An embedding is an injective strong homomorphism. An isomorphism is a surjective embedding. An
automorphism of A is an isomorphism from A to itself. If there exists an isomorphism h : A → B then we
say A and B are isomorphic and we write A ∼
= B.
For example, if A ⊆ B then the inclusion map A ,→ B is an embedding. The ring homomorphisms from
algebra are exactly the (strong) homomorphisms of Lring -structures, and similarily for groups, fields, vector
spaces, etc. We think of automorphisms as acting in the natural way on An for all n and on subsets of the
universe, for example h(a1 , . . . , an ) = (h(a1 ), . . . , h(an )).
Proposition 5.2. Suppose that h : A → B is an isomorphism, ϕ = ϕ(x1 , . . . , xn ) is an L-formula and
a = (a1 , . . . , a1 ) ∈ An . Then
A |= ϕ(a) if and only if B |= ϕ(h(a))
In particular, a sentence is true in A if and only if it is true in B.
Proof. We claim that if t = t(x1 , . . . , xn ) is an L-term and a = (a1 , . . . , a1 ) ∈ An then h(tA (a)) = tB (h(a)),
for any homomorphism h : A → B. This is a straightforward induction on the length of t. t = xi implies that
h(tA (a)) = h(ai ) = tB (h(a)). If t = F t1 · · · tm then we use the fact that h commutes with F and induction
to get our conclusion.
For the proof of the proposition, use proof by induction on the number of logical symbols in ϕ. If
ϕ is > or ⊥, then we are clearly done. If t = R t1 · · · tm then by definition, A |= ϕ(a) if and only if
A
B
A
A
A
(tA
1 (a), . . . , tm (a)) ∈ R , which happens if and only if (h(t1 (a)), . . . , h(tm (a))) ∈ R . By the above claim,
B
B
B
A |= ϕ(a) if and only if (t1 (h(a)), . . . , tm (h(a))) ∈ R , that is, B |= ϕ(h(a)). If ϕ is t1 = t2 then the conclusion
follows because h is injective. Now if ϕ is not atomic there then are five cases. Negation, disjunction, and
conjunction are easy. If ϕ is ∃ yψ(x1 , . . . , xn , y) then A |= ϕ(a) if and only if there exists c ∈ A such that
A |= ψ(a1 , . . . , a1 , c). This happens if and only if there is b ∈ B such that B |= ψ(ha1 , . . . , ha1 , b) by induction
and the fact that h is surjective. For the last case, use the contrapositive and the case above.
17
Model Theory
Notation. Define Aut(A) to be the group of automorphisms of A (under composition). If C ⊆ A then
AutC (A) denotes the automorphisms of A which fix C pointwise.
Corollary 5.3. If C ⊆ A and S is a C-definable set in A = (A, . . .) then h(S) = S for all h ∈ AutC (A).
Proof. Write S = ϕA ⊆ An where ϕ = ϕ(c1 , . . . , cm , x1 , . . . , xn ), where c1 , . . . , cm ∈ C. For any h ∈ Aut(A)
then h(S) is defined by ϕ(h(c1 ), . . . , h(cm ), x1 , . . . , xn ). (Check this.) So an automorphism applied to a
definable set is again a definable set, defined by the formula obtained by applying the automorphism to the
parameters. In particular, if h fixes C then h(S) is defined by ϕ(c1 , . . . , cm , x1 , . . . , xn ), and so h(S) = S.
√
Example
(R, <, 0, 1) since there are automorphisms of (R, <, 0, 1) that move
√
√5.4. { 2} is not 0-definable in−1
2. But 2 is 0-definable in (R, +, ×, −, , 0, 1).
Definition 5.5. By an L-theory (or theory) we mean a set of L-sentences. A theory Σ is complete if Σ ` σ
or Σ ` ¬σ for all L-sentences σ. Equivalently, given any two models A, B, of Σ then
{σ | A |= σ} = {σ | B |= σ} (= {σ | Σ ` σ})
Theorem. (Vaught test) Suppose a L-theory Σ has a model and all models of Σ are infinite. If there exists
κ ≥ card(L) such that any two models of size κ are isomorphic, then Σ is complete.
Definition 5.6. We say that a theory is κ-categorical (or categorical in power κ) if any two models of size
κ are isomorphic.
Proof. Suppose that Σ is not complete, say Σ 6` σ and Σ 6` ¬σ. Then σ1 = Σ ∪ {σ} and Σ2 = Σ ∪ {¬σ} are
both consistent and they both have infinite models. By the generalized L-S, they have models of size κ. Say
A1 |= Σ1 and A2 |= Σ2 . But A1 |= Σ and A2 |= Σ, so A1 ∼
= A2 . In particular, A1 |= σ implies A2 |= σ and
A2 |= ¬σ, which is a contradiction.
Example 5.7. L = Lorder = {<}. Let DLO be the theory
{ ∀ x(x 6< x),
∀ xyz(x < y ∧ y < z → x < z),
∀ xy(x < y ∨ x = y ∨ y < x),
∀ xy(x < y → ∃ z(x < z < y)),
∀ x∃ y∃ z(x < y ∧ z < x )}
This is the theory of dense linear orderings without endpoints.
Theorem 5.8. (Cantor) Any two countable dense linear orderings without endpoints are isomorphic. That
is, DLO is ℵ0 -categorical.
Proof. Typical “back-and-forth” argument. Let (A, <) and (B, <) be countable models of DLO. Say
A = {an | n ∈ N} and B = {bn | n ∈ N}. We inductively define partial maps {hn | n ∈ N} from A to B such
that
(i) hn is a bijection between a finite subset of A and a finite subset of B which preserves <
(ii) hn+1 extends hn (denoted hn ⊆ hn+1 )
S
S
(iii) n∈N dom(hn ) = A and n∈N range(hn ) = B
18
Mathematical Logic
S
Once we have these we set h = n∈N hn : A → B, which is a <-preserving bijection. By <-preserving we
mean a < b ⇐⇒ h(a) < h(b), and so h is an isomorphism.
Take h0 : {a0 } → {b0 } : a0 7→ b0 . Suppose that we have defined h0 , . . . , hn satisfying (i) and (ii).
“forth” If n is even, let k be the least such that ak 6∈ dom(hn ). Let l be the least such that bl is situated with
respect to range(hn ) exactly as ak is situated with respect to dom(hn ). That is, a < ak if and only if
h(a) < bl for all a ∈ dom(hn ). Such an element bl ∈ B exists because of denseness and no endpoints.
Set
hn+1 : dom(hn ) ∪ {ak } → range(hn ) ∪ {bl }
by extending hn and taking ak to bl . So hn+1 satisfies (i) and (ii).
“back” If n is odd, choose l least such that bl 6∈ range(hn ). Let k be least such that b < bl if and only if
h−1
n (b) < ak for all b ∈ range(hn ). Set hn+1 exactly as above. Note that (iii) holds for {hn | n ∈ N} as
the domain and range strictly increase at each stage and we didn’t “skip” anything. (Prove this, use
induction.) In fact, we have shown that given any r1 < · · · < rk ∈ A and s1 < · · · < sk ∈ B there is an
isomorphism h : (A, <) → (B, <) such that h(ri ) = si for i = 1, . . . , k, by taking h0 (ri ) = si for each i
and continuing as above.
Corollary 5.9. DLO is complete.
For example, there are no L-sentences distinguishing (Q, <) from (R, <).
Proof. By Vaught’s test. (DLO has only infinite models, and it has at least one model (e.g. (Q, <)) and
ℵ0 ≥ card(L) = 1 and all models of size ℵ0 isomorphic.)
Example 5.10. Fix a field F and let V SF∞ be the theory of infinite vector spaces over F in the language
Lvs(F ) . First, a few facts. If V and W are F -vector spaces then
P
(i) V has a basis B ⊆ V such that every v ∈ V can be written uniquely as v = b∈B fb b where {fb | b ∈ B}
are scalars and only finitely many of them are non-zero.
(ii) Any two bases have the same cardinality
(iii) If B is a basis for V and C is a basis for W then any bijection B → C extends to an isomorphism
V → W . (Notice that isomorphism in the linear algebra sense is the same as isomorphism in the sense
of Lvs(F ) -structures.)
(iv) If B is a basis for V then card(V ) = card(B) × card(F ) provided one of F or B is infinite. If
both F and B are finite, then card(V ) = card(B)card(F ) In particular, if card(B) > card(F ) then
card(V ) = card(B) provided B is infinite.
Theorem 5.11. V SF∞ is complete.
Proof. Let κ > card(F ) be an infinite cardinal. Then any two models of V SF∞ of cardinality κ have the same
dimension, κ, by part (iv) above. By part (iii), they are isomorphic. By Vaught’s test V SF∞ is complete.
A similar idea shows that ACPp is complete (see assignment 2 question 3).
Theorem 5.12. (Morely’s Theorem) Let L be a countable language. If Σ is an L-theory which is κ-categorical
for some uncountable cardinal κ then Σ is λ-categorical for all λ > ℵ0 .
Definability Theory
6
19
Definability Theory
Notation. If A is an L-structure then we write |A| to denote it’s universe.
Definition 6.1. Let A = (A, . . . ) be an L-structure. A (partial) map f : An → Am is definable if its graph
Γ(f ) := {(a, b) ∈ An+m | f (a) = b} is definable. Similarily, for any C ⊆ A we say that f is C-definable or
definable over C if its graph is C-definable.
Example 6.2.
(i) Addition is not definable in (Q, <).
Proof. Suppose that Γ(+) is defined by the LQ -formula φ(r1 , . . . , rk , x1 , x2 , x3 ) and take R := {r1 , . . . , rk },
so that Γ(+) is R-definable. Without loss of generality we may assume r1 < · · · < rk . Let a >
b > |rk | + 1. The back-and-forth construction in the proof of Cantor’s theorem shows that since
r1 < · · · < rk < b < a < a + b and r1 < · · · < rk < b < a < a + b + 1 there is an automorphism
h of (Q, <) which fixes R ∪ {a, b} and takes a + b to a + b + 1. It follows that h ∈ AutR (Q) with
h(a, b, a + b) = (a, b, a + b + 1). Therefore h(Γ(+)) 6= Γ(+), so Γ(+) is not R-definable.
(ii) Multiplication on R is not 0-definable in R = (R, +, −, 0)
Proof. Suppose that Γ(×) is defined by some L-formula φ(x1 , x2 , x3 ). Let h : R → R : x 7→ 2x. This
is an automorphism of R. But h(1, 2, 2) = (2, 4, 4) so h(Γ(×)) 6= Γ(×).
Definition 6.3. Let Σ be an L-theory. We say that two formulas ϕ and ψ are Σ-equivalent if Σ |= ϕ ↔ ψ.
Equivalently, if in every model A |= Σ, ϕ and ψ define the same set, ϕA = ψ A .
Definition 6.4. An L-theory Σ is said to have quantifier elimination (or admit QE) if every L-formula
ϕ(x1 , . . . , xn ) is Σ-equivalent to a quantifier-free L-formula ψ(x1 , . . . , xn ). In particular, every L-sentence is
Σ-equivalent to a quantifier-free L-sentence.
Lemma 6.5. Suppose that Σ is consistent and there exists an L-structure which embeds in every model of
Σ. Then if Σ admits QE, it is complete.
Proof. Suppose that C is an L-structure embedding in every model of Σ. Let A, B be models of Σ. We will
show that A, B satisfy the same L sentences. Let σ be an L-sentence. By QE there is an L-sentence γ
such that Σ |= σ ↔ γ. Therefore A |= σ if and only if A |= γ, if and only if C |= γ (since C ⊆ A and γ is
quantifier-free, see assignment 1), if and only if B |= γ, if and only if B |= σ.
Example 6.6. ACF0 is consistent and (Q, 0, 1, +, ×, −) embeds in every field of characteristic 0. If ACF0
admits QE then it is complete.
Example 6.7. In (R, <, 0, 1, +, ×, −) the L-formula ∃ y(ay 2 + by + c = 0) is equivalent to
(a 6= 0 ∧ b2 − 4ac ≥ 0) ∨ (a = 0 ∧ b 6= 0) ∨ (a = 0 ∧ b = 0 ∧ c = 0)
Definition 6.8. A primative existential formula is a formula of the form ∃ yφ(x1 , . . . , xn , y), where y is a
single variable and φ(x1 , . . . , xn , y) is a conjunction of atomic or negated atomic formulae. (Atomic and
negated atomic formulae are often called literals.)
Lemma 6.9. Σ admits QE if and only if every primative existential formula ψ(x1 , . . . , xn ) is Σ-equivalent
to a quantifier-free formula θ(x1 , . . . , xn ).
20
Mathematical Logic
Proof. The forward implication is obvious. Let ϕ(x1 , . . . , xn ). Proof of the reverse implication by induction
on the number of symbols in ϕ. If ϕ is atomic we are done. If ϕ is one of ¬ϕ1 , ϕ1 ∧ ϕ2 , or ϕ1 ∨ ϕ2 then it
follows by induction. If ϕ is ∃ yγ(x1 , . . . , xn , y) where γ is an L-formula, then by in the induction hypothesis
γ is Σ-equivalent to some quantifier-free formula γ qf (x1 , . . . , xn , y). So γ qf is Σ-equivalent to a disjunction
of conjunctions of literals
m
_
γ qf =
γiqf (x1 , . . . , xn , y)
i=1
Wm
So ϕ = i=1 ∃ y(γiqf (x1 , . . . , xn , y)) since ∃ commutes with
Now Σ |= ϕ ↔
∨. By assumption for each i there is a quantifier-free formula θ(x1 , . . . , xn , y) that is Σ-equivalent to
∃ yγiqf (x1 , . . . , xn , y). Finish this.
Wm
qf
i=1 ∃ y(γi (x1 , . . . , xn , y)).
Definition 6.10. Suppose that A = (A, . . . ) and C ⊆ A. The substructure generated by C, denoted hCi, is
the L-structure given by
• universe of hCi is {tA (c1 , . . . , cn ) | t(x1 , . . . , xn ) is an L-term, c1 , . . . , cn ∈ C}
• R ∈ Lrel m-ary, take RhCi := RA ∩ |hCi|m
• F ∈ Lf un m-ary, take F hCi := F A ||hCi|m
Check that |hCi| ⊆ A is the smallest subset of A containing C and closed under functions. Also check that
hCi ⊆ A. We say that a substructure C ⊆ A is finitely generated if C = hCi for some C ⊆ A finite.
Example 6.11. R = (R, 0, 1, +, −, ×) commutative ring, A ⊆ R, then hRi = (Z[A], 0, 1, +, −, ×) where
Z[A] = {P (a1 , . . . , an ) | a1 , . . . , an ∈ A, P (X1 , . . . , Xn ) ∈ Z[X1 , . . . , Xn ]}.
Lemma 6.12. Suppose that A = (A, . . . ) and B = (B, . . . ) are L-structures and a1 , . . . , an ∈ A and
b1 , . . . , bn ∈ B. The following are equivalent:
(i) For any quantifier-free formula φ(x1 , . . . , xn ), A |= φ(a1 , . . . , an ) if and only if B |= φ(b1 , . . . , bn )
(ii) There exists an isomorphism h : h{a1 , . . . , an }i → h{b1 , . . . , bn }i : ai 7→ bi
Proof. Define h as follows. h(tA (ai1 , . . . , aim )) := tB (bi1 , . . . , bim ). In particular, h(ai ) = bi . Use (i) to
show that h is an isomorphism from h{a1 , . . . , an }i to h{b1 , . . . , bn }i. h is well-defined and a bijection since
if e, f ∈ h{a1 , . . . , an }i then e = tA (ai1 , . . . , aim ), f = sA (ai1 , . . . , aim0 ). Then e = f if and only if A |=
tA (ai1 , . . . , aim ) = sA (ai1 , . . . , aim0 ), which happens if and only if B |= tA (bi1 , . . . , bim ) = sA (bi1 , . . . , bim0 ) by
(i). This says that h(e) = h(f ), so h is well-defined. Check that h is a strong homomorphism.
Let A0 = h{a1 , . . . , an }i and B0 = h{b1 , . . . , bn }i. If φ(x1 , . . . , xn ) is any quantifier-free formula, then
A |= φ(a1 , . . . , an ) if and only if A0 |= φ(a1 , . . . , an ) since φ(a1 , . . . , an ) is a quantifier-free LA0 -sentence and
A0 ⊆ A. This happens if and only if B0 |= φ(b1 , . . . , bn ) as there is an isomorphism between A0 and B0
taking ai to bi , and this is equivalent to B0 |= φ(b1 , . . . , bn ).
Theorem 6.13. Let Σ be an L-theory and φ(x1 , . . . , xn ) an L-formula. The following are equivalent:
(i) φ is Σ-equivalent to a quantifier-free formula θ(x1 , . . . , xn )
(ii) Given any A, B |= Σ and finitely generated substructures A0 ⊆ A and B0 ⊆ B with an isomorphism h
between them, A |= φ(a1 , . . . , an ) implies that B |= φ(ha1 , . . . , han ) for any a1 , . . . , an ∈ |A0 |
Proof. See text.
Putting the last two propositions together yields
Definability Theory
21
Corollary 6.14. (Criterion for QE) Given
(i) A conjunction of atomic or negated atomic L-formulae φ(x1 , . . . , xm , y)
(ii) Models A, B of Σ
(iii) Substructures A0 = h{a1 , . . . , an }i ⊆ A, B0 = h{b1 , . . . , bn }i ⊆ B
(iv) An isomorphism h : A0 → B0 taking ai to bi for i = 1, . . . , n
Then Σ has QE if A |= ∃yφ(ai1 , . . . , aim , y) implies B |= ∃yφ(bi1 , . . . , bim , y).
Proof. We need only eliminate primative existential formulas. The last theorem gives us a sufficient condition
for doing so.
Proposition 6.15. DLO has QE
Proof. Let A = (A, . . . ), B = (B, . . . ) be models of DLO, a1 < · · · < an ∈ A, and b1 < · · · < bn ∈ B.
Let A0 and B0 be generated by the ai ’s and bi ’s respectively, and let h be an isomorphism between them
taking ai to bi for each i − 1, . . . , n. Let φ(x1 , . . . , xm , y) be a conjuction of atomic and negated atomic
formulas. We need to show that if A |= ∃ yφ(ai1 , . . . , aim , y) then B |= ∃ yφ(bi1 , . . . , bim , y). Let a ∈ A
be such that A |= φ(ai1 , . . . , aim , a). As we have seen in the proof that DLO is ℵ0 -categorical, there is
some b ∈ B such that h extends to A00 := h{a1 , . . . , an , a}i ∼
= B00 := h{b1 , . . . , bn , b}i that takes a to b.
0
Then A0 |= φ(ai1 , . . . , aim , a) since it is a quantifier-free L|A0 | -sentence. Therefore B00 |= φ(bi1 , . . . , bim , b),
so B |= φ(bi1 , . . . , bim , b). Therefore A |= ∃ yφ(ai1 , . . . , aim , y) implies B |= ∃ yφ(bi1 , . . . , bim , y). Thus DLO
admits QE.
Corollary 6.16. The definable subsets of A in (A, <) |= DLO are exactly the finite unions of points and
intervals. Here an interval is open and possibly infinite.
Proof. It’s clear that the finite unions of points and intervals are definable. For the other direction, by QE,
it suffices to show that the sets defined by atomic formulas are finite unions of points or intervals (Check
this).
Definition 6.17. A theory Σ in a language containing < extending the theory of total orderings is called
o-minimal if every definable subset of A is a finite union of points and intervals for any A |= Σ.
Example 6.18. The theory of (R, 0, 1, <, +, −, ·) is o-minimal
Example 6.19. The theory of DLO is o-minimal
Proposition 6.20. Let p = 0 or a prime. ACFp has QE.
Proof. Set R = Z if p = 0 and R = Fp otherwise. Let K = (K, 0, 1, +, −, ·) |= ACFp and a1 , . . . , an ∈
K. Then h{a1 , . . . , an }i = R[a1 , . . . , an ]. Let L = (L, 0, 1, +, −, ·) |= ACFp and b1 , . . . , bn ∈ L Then
h{b1 , . . . , bn }i = R[b1 , . . . , bn ]. Let h be an isomorphism of rings R[a1 , . . . , an ] → R[b1 , . . . , bn ].
We know h extends to an isomorphism h0 of fraction fields F(a1 , . . . , an ) → F(b1 , . . . , bn ). Here F = Q if
p = 0 and F = Fp otherwise. Moreover, h0 extends to an isomorphism h00 of algebraic closures F(a1 , . . . , an ) →
F(b1 , . . . , bn ) Consult Hungerford for details.
Let φ(x1 , . . . , xn , y) be a conjunction of atomic and negated atomic L-formulas. Suppose K |= ∃yφ(a1 , . . . , an , y);
we need to show L |= ∃yφ(b1 , . . . , bn , y).
Let c ∈ K such that K |= φ(a1 , . . . , an , c).
Case 1: If c ∈ F(a1 , . . . , an ) then h00 (c) will satisfy φ(b1 , . . . , bn , y) in F(b1 , . . . , bn ). Since F(b1 , . . . , bn ) ⊆ L we
are done.
22
Mathematical Logic
Case 2: If c ∈
/ F(a1 , . . . , an ) we may in trouble, since h00 may not extend to c. Consider L = F(b1 , . . . , bn ). Since
K |= φ(a1 , . . . , an , c), φ must be a conjunction of formulas coming from the following possibilities.
(a) ψ(x1 , . . . , xn ) where ψ is an atomic or negated atomic L-formula
(b) {Qi (x1 , . . . , xn , y) = 0}i=1...` where the Qi are polynomials in Z[X1 , . . . , Xn , Y ] so Qi (a1 , . . . , an , Y ) ∈
F(a1 , . . . , an )[Y ].
(c) {Pi (x1 , . . . , xn , y) 6= 0}i=1...m where the Pi are non-zero polynomials
Let d ∈ L such that Pi (b1 , . . . , bn , d) 6= 0 for i = 1, . . . , r. This is easy since we have r finite, the Pi
expressible as polynomials in one variable, and our language L infinite. And so we are done. Remember,
we wanted to show L |= ∃yφ(b1 , . . . , bn , y). From (a), this follows immediately - we have no y to worry
about. From (b), we note h00 maps the roots of the Qi (a1 , . . . , an , Y ) to roots of Qi (b1 , . . . , bn , Y ), so
we can choose our c to be in the algebraic closure. From (c), everything follows from our choice of d.
Corollary 6.21. ACFp is complete.
Proposition 6.22. Suppose Σ has QE. Given models of Σ, A ⊆ B, and any LA -sentence θ, A |= θ if and
only if B |= θ.
Proof. Write θ = φ(a1 , . . . , an ) where φ(x1 , . . . , xn ) is an L-formula. By QE there is a quantifier-free Lformula ψ such that Σ |= φ if and only if Σ |= ψ. From a previous assignment relating structures to
substructures, the result follows.
Definition 6.23. We say Σ is model-complete if whenever A ⊆ B are models of Σ and θ is an L|A| -sentence
A |= θ if and only if B |= θ
We note that QE implies model-completeness.
Example 6.24. The theory of fields of characteristic 0 does not have QE. Consider ∃x(x2 = 1) in R ⊆ C.
Corollary 6.25. Every definable subset of K in (K, 0, 1, +, −, ×) |= ACFp is either finite or cofinite.
Proof. The sets defined by atomic fomulas in one variable are of the form P (X) = 0 or ⊥ or > where
P ∈ K[X]. But a non-zero polynomial has only finitely many roots. The class of sets obtained from the
atomically defined sets using ∩, ∪, and complement are exactly the finite and co-finite sets, by QE.
Definition 6.26. If a theory Σ is such that in every model A |= Σ, every definable subset of |A| is finite or
cofinite then we say that Σ is strongly minimal.
Definition 6.27. A ⊆ B we say that A is an elementary substructure of B, denoted A B, if for every
L|A| -sentence θ
A |= θ if and only if B |= θ
A theory Σ is model-complete if for any models A ⊆ B of Σ then A B.
We showed QE implies model-complete. For example, (R, +, −, 0, 1, ×) ⊆ (C, +, −, 0, 1, ×) and not
elementary. This implies that the theory of fields of characteristic zero does not have QE.
Corollary. (Hilbert’s Nullstellensatz) Suppose that K is an algebraically closed field. If I ⊆ K[X1 , . . . , Xn ]
is a prime ideal then there exists a = (a1 , . . . , an ) ∈ K n such that P (a) = 0 for all P ∈ I.
23
Definability Theory
Proof. Let X = (X1 , . . . , Xn ). K[X]/I is an integral domain, as I is a prime ideal. Let L be the fraction
field of K[X]/I. Then K ⊆ K[X]/I ⊆ L ⊆ Lalg . By model-completeness K Lalg . Now I is finitely
generated since K[X] is Noetherian, say I = hP1 , . . . , Pm i.
!
m
^
alg
L |= ∃x1 , . . . , xn
Pi (x1 , . . . , xn ) = 0
i=1
witnessed by (X1 + I, . . . , Xn + I) =: (b1 , . . . , bn ) ∈ Lalg . Thus
K |= ∃x1 , . . . , xn
m
^
!
Pi (x1 , . . . , xn ) = 0
i=1
because K is an elementary substructure.
Corollary. (Lefschetz Principle) Let σ be an Lring -sentence. The following are equivalent
(i) σ is true in C
(ii) σ is true in some algebraically closed field of characteristic zero
(iii) σ is true in all algebraically closed fields of characteristic zero
(iv) For infinitely many primes p, σ is true in some algebraically closed field of characteristic p
(v) For infinitely many primes p, σ is true in all algebraically closed fields of characteristic p
(vi) For all but finitely many primes p, σ is true in some algebraically closed field of characteristic p
(vii) For all but finitely many primes p, σ is true in all algebraically closed fields of characteristic p
Proof. Exercise.
Lemma 6.28. Σ has QE if and only if every completion of Σ has QE.
Proof. ⇒ is clear. Let ϕ(x1 , . . . , xn ) be an L-formula. Let c1 , . . . , cn be new constant symbols and L∗ =
L ∪ {c1 , . . . , cn }. Define
Λ := {θ | Σ ∪ {ϕ(c1 , . . . , cn )} |= θ and θ is quantifier-free}
Claim. Σ ∪ Λ |= ϕ(c1 , . . . , cn )
Let A∗ |= Σ ∪ Λ and A = A∗ |L |= Σ. Then the theory of A, Th(A), is complete and it contains Σ.
So Th(A) admits QE. Let θ(x1 , . . . , xn ) be a quantifier-free L-formula such that Th(A) |= ϕ ↔ θ. Then
¬θ(c1 , . . . , cn ) 6∈ Λ, so θ(c1 , . . . , cn ) ∈ Λ and so A∗ |= θ(c1 , . . . , cn ). Thus A∗ |= θ(c1 , . . . , cn ) → ϕ(c1 , . . . , cn ),
so A∗ |= ϕ(c1 , . . . , cn ).
By compactness, there is some θ(c1 , . . . , cn ) such that Σ ∪ {θ} |= ϕ(c1 , . . . , cn ), which implies that
Σ |= θ(c1 , . . . , cn ) → ϕ(c1 , . . . , cn ). But also Σ∪{ϕ} |= θ(c1 , . . . , cn ) by definition of Λ, so Σ |= θ(c1 , . . . , cn ) ↔
ϕ(c1 , . . . , cn ).
It follows that ACF has QE. Suppose that Λ ⊇ ACF and Λ is complete. Let A |= Λ, with p as the
characteristic of A. Then for all B |= Λ, the characteristic of B is p, so Λ is a model of ACFp . Since ACFp
has QE, Λ has QE.
24
7
Mathematical Logic
Real Closed Fields
In studying the theory of R it turns out that the “right” language is Lo−ring = {<, 0, 1, −, +, ×}. Recall that
< is 0-definable in (R, 0, 1, −, +, ×) by defining x ≤ y to be the set defined by the formula ∃ z(y − x = z 2 ).
Definition 7.1. RCOF is the Lo−ring -theory consisting of
(i) Axioms of fields
(ii) Axioms of total ordering
(iii) ∀ xyz(x < y → x + z < y + z) and ∀ xy(0 < x ∧ 0 < y → 0 < xy)
(iv) For each n ∈ N odd ∀ x1 . . . xn ∃ y(y n + x1 y n−1 + · · · + xn−1 y + xn = 0)
(v) ∀ x(0 < x → ∃ y(x = y 2 ))
Definition 7.2. A real ordered closure of an ordered field (F, <) is a real closed ordered field (R, <) such
that (F, <) ⊆ (R, <) and F ⊆ R ⊆ F alg .
For example, (Q, <) is the real order closure of (Q, <).
Theorem 7.3. (Artin-Schreir) Up to Lo−ring -isomorphism every ordered field has a unique real ordered
closure.
Theorem 7.4. (Intermediate Value Property) Suppose R |= RCOF and P ∈ R[x] is any polynomial. If
a, b ∈ R, a < b, are such that P (a) < 0 and P (b) > 0 then there is c ∈ R, a < c < b, such that P (c) = 0.
Theorem 7.5. RCOF has QE.
Proof. Let A = (K, 0, 1, <, +, −, ×) and B = (K 0 , 0, 1, <, +, −, ×) both be models of RCOF . Let A0 =
(Q[a1 , . . . , an ], 0, 1, <, +, −, ×) ⊆ A and B0 = (Q[b1 , . . . , bn ], 0, 1, <, +, −, ×) ⊆ B be finitely generated substructures and h : A0 → B0 an Lo−ring -isomorphism taking ai to bi for i = 1, . . . , n.
Claim. h extends to an ordered field isomorphism h0 : Q(a1 , . . . , an ) → Q(b1 , . . . , bn ) that takes
x
y
7→
h(x)
h(y) .
It is clear that h0 is a field isomorphism, and it is not hard to see using axiom (iii) that it is an Lo−ring isomorphism. For example, suppose that x, y ∈ Q[a1 , . . . , bn ] and y > 0.
x
h(x)
x
0
> 0 ⇐⇒ x > 0 ⇐⇒
> 0 (since h(y) > 0) ⇐⇒ h
>0
y
h(y)
y
Claim. h0 extends to an Lo−ring -isomorphism h00 : (F, <) → (F 0 , <), where F = Q(a1 , . . . , an )alg ∩ K and
F 0 = Q(b1 , . . . , bn )alg ∩ K 0 , the real ordered closures of these fields.
The proof follows by the uniqueness of real ordered closure.
Let φ(x1 , . . . , xn , y) be a conjunction of atomic and negated atomic formulae. Suppose that A |=
∃ yφ(a1 , . . . , an , y). We want B |= ∃ yφ(b1 , . . . , bn , y). Let c ∈ K be such that A |= φ(a1 , . . . , an , c). If
c ∈ F then clearly h00 (c) ∈ F 0 ⊆ K 0 and is such that B |= φ(b1 , . . . , bn , h00 (c)).
We may assume that c ∈ K \ F . Let P1 (y), . . . , Pl (y) ∈ F [y] be the polynomials that appear in
φ(a1 , . . . , an , y).
00
Claim. There is a d ∈ F 0 such that Pj (c) = 0 if and only if Pjh (d) = 0 and Pj (c) < 0 if and only if
00
Pjh (d) < 0 for all j = 1, . . . , l.
We may assume that none of the Pi are the zero polynomial, as that case is obvious. Since c ∈ K \ F , c
is not in the algebraic closure of Q(a1 , . . . , an ) and hence for all j = 1, . . . , l we have Pj (c) 6= 0.
25
Real Closed Fields
Case 1: Suppose that for some i, j there is a root r of Pi and s of Pj with r < c < s. Furthermore, choose r and
s so that none of the roots of P1 , . . . , Pl fall in the interval (r, s). By the intermediate value property,
none of P1 , . . . , Pl change sign in the interval (r, s). Thus
00
r+s
h (r) + h00 (s)
h00
sign(Pj (c)) = sign Pj
= sign Pj
2
2
for all j = 1, . . . , l. Let d =
h00 (r)+h00 (s)
.
2
Then it satisfies the conclusions of the claim.
Case 2: ?? This proof is broken. Ask Cameron why.
By the third claim, B |= φ(b1 , . . . , bn , d). (why?) An atomic formula with parameters from F is of the form
(or equivalent to the form) P (y) = 0 or P (y) < 0, where P (y) ∈ F [y]. If P1 , . . . , Pl appear in φ(a1 , . . . , an , y)
00
00
then P1h , . . . , Plh are the polynomials that appear in φ(b1 , . . . , bn , y).
Corollary 7.6. RCOF is o-minimal.
Corollary 7.7. RCOF is complete.
Proof. It suffices to show that there exists an Lo−ring -structure which embeds in every model of RCOF .
Let Z = (Z, <, 0, 1, +, −, ×) (with the usual ordered ring structure on Z). If A = (R, . . .) |= RCOF then
the characteristic of R must be zero. We must show that <A restricts to < on the integers. To do this we
will show that the positive elements of Z are positive elements in R. Well, 0 < 1 by the axioms, so 0 < 2,
0 < 3,. . . in A. Therefore Z ⊆ A.
It follows that RCOF axiomatises Th(R, <, 0, 1, +, −, ×). What about Th(R, 0, 1, +, −, ×)? Note that it
does not have QE, as the definable sets are the finite or cofinite sets, but if it had QE then intervals would
be definable, a contradiction.
Lemma 7.8. In a model of RCOF the positive elements are exactly the non-zero squares.
Proof. Positive elements are squares by the axioms. Suppose that x < 0 and x = b2 in some R |= RCOF .
Then b < 0, so 0 < −b, but then 0 < (−b)2 = b2 = x, a contradiction.
Definition 7.9. A field F is called formally real if −1 is not a sum of squares.
It turns out that F is formally real if and only if there exists an order < such that (F, <) is an ordered
field. Moreover, if F is formally real and a ∈ F is not a sum of squares then there exists an ordering on F
such that a < 0.
Theorem. (Hilbert’s 17th Problem, Artin) Let f (X1 , . . . , Xn ) ∈ R(X1 , . . . , Xn ) where X1 , . . . , Xn are indeterminates. If f (a1 , . . . , an ) ≥ 0 for all a1 , . . . , an ∈ R (i.e. f is positive semi-definite) then f is a sum of
squares in R(X1 , . . . , Xn ).
Proof. Assignment 4.
Lemma 7.10. Suppose that (F, <) is an ordered field. The following are equivalent
(i) (F, <) |= RCOF
(ii) For any a ∈ F either a or −a is a square, and every odd degree polynomial has a root.
Proof. Suppose that (F, <) |= RCOF . If a < 0 then 0 < −a, so by RCOF axioms −a is a square. The
axioms of RCOF say that every odd degree polynomial has a root. Suppose that for any a ∈ F either a or
−a is a square, and every odd degree polynomial has a root. In any ordered field negative elements are not
squares, so every positive element is a square.
26
Mathematical Logic
Definition 7.11. RCF is the Lring -theory consisting of
(i) Axioms of a field
(ii) −1 is not a sum of squares, ¬∃ x1 . . . xm (−1 = x21 + · · · + x2m )
(iii) For all odd n, ∀ x1 . . . xm ∃ y(y n + x1 y n−1 + · · · + xn−1 y + xn = 0)
(iv) ∀ x(∃ y(x = y 2 ) ∨ ∃ (−x = y 2 ))
This is the theory of real closed fields.
Examples are (R, 0, 1, +, −, ×) and (Q, 0, 1, +, −, ×) (real algebraic numbers).
Proposition 7.12.
(i) If R |= RCOF then R|Lring |= RCF
(ii) Conversely, if R |= RCF then the Lo−ring -structure obtained by interpreting x < y by ∃ y(y − x = z 2 )
is a model of RCOF .
Proof. Exercise.
Corollary 7.13. RCF is model-complete and complete.
Proof. Suppose that A ⊆ B where A |= RCF and B |= RCF . We want to show that A B. By
Proposition 7.12, (A, <) |= RCOF and (B, <) |= RCOF . Note that (A, <) ⊆ (B, <) as Lo−ring -structures.
We just need to check that <B restricts to <A . But in both A and B the positives are the non-zero squares,
and A and B agree on what the non-zero squares are as A ⊆ B. By QE for RCOF , RCOF is model-complete.
So (A, <) (B, <), and hence A B. So RCF is model-complete.
For completeness, if A |= RCF and B |= RCF and σ is any Lring -sentence
A |= ⇐⇒ (A, <) |= σ ⇐⇒ (B, <) |= σ ⇐⇒ B |= σ
It follows that RCF axiomatises Th(R, 0, 1, +, −, ×).
8
Computability, Undecidability, Incompleteness
Definition 8.1. For any L-theory Σ, the theory of Σ, Th(Σ) = {σ L-sentence | Σ ` σ}. If A is an
L-structure, Th(A) = {σ L-sentence | A |= σ}
Remark. The following are equivalent
(i) Σ is complete
(ii) For any, equivalently for some, A |= Σ and Th(Σ) = Th(A)
(iii) For any A, B |= Σ, Th(A) = Th(B)
The language we will be working with from now on is L = {<, 0, S, +, ·}, the language of arithmetic. Let
the L-structure N = (N, <, 0, S, +, ·) be the natural numbers with the usual interpretation. S : N → N : x 7→
x + 1 is the successor function.
Informally, a set is calculable if there is a method for determining whether an element is in the set or not in
finitely many steps. Similarily, a function f : A → B is calculable if there is a method such that given a ∈ A
we can obtain f (a) in finitely many steps. This is not a mathematical definition. Gödel’s Incompleteness
theorem says (essentially) that there is no calculable set of L-sentences Σ such that Th(Σ) = Th(N).
It suffices and is convienent to formalise the notion of calculability of functions f : Nn → N. If we have
such a notion then R ⊆ Nn is calculable if its characteristic function χR : Nn → N is calculable.
Computability, Undecidability, Incompleteness
Example 8.2.
school
27
(i) + : N2 → N and · : N2 → N are calculable. We learned how to calculate these in grade
(ii) χ≤ : N2 → N is calculable.
(iii) For any 1 ≤ i ≤ n, let IiN : Nn → N : a → ai , the ith coordinate function. Then IIN is calculable.
(iv) Suppose that H1 , . . . , Hk : Nn → N and G : Nk → N are calculable. Then F = G(H1 , . . . Hk ) : Nn → N
is calculable.
(v) Suppose that we all agree that G : Nn+1 → N is calculable, and we kow that for each a ∈ Nn there is
x ∈ N such that G(a, x) = 0. Then consider the function F : Nn → N such that F (a) is the least x
such that G(a, x) = 0, denoted µx(G(a, x) = 0). Then F is calculable.
8.1
Computablility
Definition 8.3. The computable (formal notion of calculable) functions (or recursive functions) are the
functions Nn → N (n = 0, 1, 2, . . . ) obtained inductively by applying the following rules
(R1) + : N2 → N,· : N2 → N,χ≤ : N2 → N, IiN : Nn → N for all n, 1 ≤ i ≤ n are all computable
(R2) If H1 , . . . , Hk : Nn → N and G : Nk → N are computable then F = G(H1 , . . . Hk ) : Nn → N is
computable.
(R3) If G : Nn+1 → N is calculable and we know that for each a ∈ Nn there is x ∈ N such that G(a, x) = 0,
then F : Nn → N given by F (a) := µx(G(a, x) = 0) is computable.
A relation R ⊆ Nn is computable if its characteristic function χR : Nn → N is computable.
Clearly every computable function is calculable. The Church-Turing Thesis says that every calculable
function F : N → N is computable. (It follows for F : Nn → N, as we will see later.) This is not a precise
mathematical statement. There is evidence for this claim
(i) We can, and will, show that many, many calculable functions are computable.
(ii) It has never failed. No one has produced a function which we agree is calculable that has proven to
not be computable. In fact, any candidate F has been proven to be computable.
(iii) Many alternative formalizations of calculable have been proposed (e.g. “calculable by a formal machine”), but they all produce the same set of functions; namely the computable ones.
Lemma 8.4. The functions χ≥ : N2 → N, cnk : Nn → N : a 7→ k, and χ= : N2 → N are computable.
Proof. χ≥ (m, n) = χ≤ (n, m) = χ≤ (I22 (m, n), I12 (m, n)), so χ≥ = χ≤ (I22 , I12 ) by R1, R2, χ≥ is computable.
n+1
n+1
(a, x) = 0). In+1
: Nn+1 → R is computable by R1. For all
For cn0 : Nn → N : a 7→ 0, cn0 (a) = µx(In+1
n+1
n
a ∈ N there is an x such that In+1 (a, x) = 0 (namely x = 0). By R3 cn0 is computable. Now note that
n+1
n+1
cnk+1 = µx(cnk (a) < x) = µx(χ≥ (cn+1
(a, x), In+1
(a, x)) = 0). Letting G : Nn+1 → N, G = χ≥ (cn+1
, In+1
) we
k
k
see by induction, R1, R2, R3, and the first part of the lemma that the constant functions are computable.
χ= = χ≤ · χ≥ , so by R1 χ= is computable.
Lemma 8.5.
(i) If P, Q ⊆ Nn are computable relations then so are
(a) ¬P = Nn \ P
(b) P ∨ Q = P ∪ Q
28
Mathematical Logic
(c) P ∧ Q = P ∩ Q
(d) P → Q = (Nn \ P ) ∪ Q
(e) P ↔ Q = [(Nn \ P ) ∪ Q] ∩ [(Nn \ Q) ∪ P ]
(ii) <, ≤, =, ≥, >, 6= are all computable.
Proof. Exercise. It suffices to show for ¬P and P ∧ Q.
Lemma 8.6. Suppose that H1 , . . . , Hk : Nn → N are computable. Suppose that R ⊆ Nk is computable. then
R(H1 , . . . , Hn ) ⊆ Nn is computable where a ∈ R(H1 , . . . , Hk ) ⇐⇒ (H1 (a), . . . , Hk (a)) ∈ R.
Proof. χR(H1 ,...,Hn ) = χR (H1 , . . . , Hk ).
Lemma 8.7. (i) (Definition of functions by cases) Let R1 , . . . , Rk ⊆ Nn be computable and suppose that
for every a ∈ Nn exactly one of R1 (a), . . . , Rk (a) is true. If G1 , . . . , Gk : Nn → N are computable then
F : Nn → N defined by

G1 (a) if R1 (a)


.
F (a) = ..


G (a) if R (a)
k
k
is computable.
(ii) (Definition of relations by cases) R1 , . . . , Rk as before. Suppose that P1 , . . . , Pk ⊆ Nn are computable.
Then P ⊆ Nn defined by


P (a) if R1 (a)

 1
.
P (a) ⇐⇒ ..


P (a) if R (a)
k
k
is computable
Proof.
(i) F = χR1 · G1 + · · · + χRk · Gk . Check this.
(ii) P = P1 ∧ R1 ∨ · · · ∨ Rk ∧ Pk . Check this too.
Lemma 8.8. Let R ⊆ Nn+1 be computable. Suppose that for all a ∈ Nn there is x ∈ N such that R(a, x).
Then F : Nn → N : a 7→ µx(R(a, x)) is computable.
Proof. F (a) = µx(χR (a, x) 6= 0) = µx(χ= (χr (a, x), cn+1
(a, x)) = 0), which is computable by R3.
0
Lemma 8.9. F : Nn → N is computable if and only if its graph Γ(F ) ⊆ Nn+1 is computable.
n+1
Proof. χΓ(F ) = χ= (F (I1n+1 , Inn+1 ), In+1
).
F (a) = µx(Γ(F )(a, x)).
Lemma 8.10. Let R ⊆ Nn+1 be computable. Suppose P, Q ⊆ Nn+1 are defined by: for all a ∈ Nn , y ∈ N
(i) P (a, y) if and only if there is an x < y such that R(a, x)
(ii) Q(a, y) if and only if for all x < y, R(a, x)
Then P and Q are computable.
29
Computability, Undecidability, Incompleteness
Proof.
n+1
n+1
(i) P (a, y) ⇐⇒ µx(R(a, x) ∨ x = In+1
(a, y)) < In+1
(a, y)
(ii) P (a, y) ⇐⇒ ¬(there exists x < y such that ¬R(a, x)), so by (1) we are done.
We use ∃ x < y as short for “there exists x < y”. This is not to be confused with ∃ from a language.
Lemma 8.11. The function −̇ : N2 → N is computable, where
(
x − y if x ≥ y
−̇(x, y) =
0
if x < y
Lemma 8.12. Pair : N2 → N is defined by Pair(x, y) =
(x+y)2 +(x+y)
2
+ x. Pair is computable and bijective.
Proof. Exercise. Do it.
Corollary 8.13. Left, Right : N → N defined by Left(a) = I12 (Pair−1 (a)) and Right(a) = I22 (Pair−1 (a)) are
both computable.
Definition 8.14. (Gödel’s β function) β : N2 → N defined by
β(a, i) = µx(x ≡ Left(a)
(mod 1 + (i + 1)Right(a)))
Note that the teriary relation a ≡ b (mod c) is computable because
a ≡ b (mod c) ⇐⇒ ∃ x < a + 1 a = x · c + b ∨ ∃ x < b + 1 b = x · c + a
Proposition 8.15.
(i) β is computable
(ii) β(a, i) ≤ a−̇1
(iii) For any sequence (a0 , . . . , an−1 ) ∈ Nn there is an a ∈ N such that β(a, i) = ai
Proof.
(i) See note above.
(ii) β(a, i) ≤ Left(a) ≤ a. If a > 0 then Left(a) < a, so β(a, i) ≤ a−̇1.
(iii) Suppose that (a0 , . . . , an−1 ) ∈ Nn . Let N ∈ N be such that N > ai for i = 0, 1, . . . , n − 1 and N is a
multiple of all the primes less than n. Then 1 + N, 1 + 2N, . . . , 1 + nN are relatively prime. By the
Chinese Remainder Theorem there is an M such that
M ≡ a0
(mod 1 + N )
M ≡ a1
..
.
(mod 1 + 2N )
M ≡ an−1
(mod 1 + nN )
Let a = Pair(M, N ). So Left(a) = M and when it is divided by 1 + (1 + i)Right(a) = 1 + (1 + i)N we
get ai . Thus a satisfies the conclusion of the proposition.
30
Mathematical Logic
Definition 8.16. Given (a1 , . . . , an ) ∈ Nn we define
ha1 , . . . , an i = µx(β(x, 0) = n, β(x, 1) = a1 , . . . , β(x, n) = an )
So ha1 , . . . , an i is the least natural number which encodes (n, a1 , . . . , an ) in β. Note that hi = 0.
Lemma 8.17.
(i) Define Seq := {a ∈ N | a = ha1 , . . . , an i for some a1 , . . . , an ∈ N} ⊆ N is computable.
(ii) (a1 , . . . , an ) 7→ ha1 , . . . , an i : Nn → N is computable
(iii) ` : N → N given by `(a) = β(a, 0) is computable. This is known as the length function.
(iv) (a, i) 7→ β(a, i + 1) : N2 → N is computable. This is the ith coordinate function, and we denote it
(a)i = β(a, i + 1).
(v) In : N2 → N : (a, i) 7→ µx(`(x) = i ∧ ∀ j < i (x)j = (a)j ) is computable. This gets the initial segment
of a seqence a.
(vi) ∗ : N2 → N : (a, b) 7→ µx(`(x) = `(a) + `(b) ∧ ∀ i < `(a) (x)i = (a)i and ∀ j < `(b) (x)`(a)+j = (a)j ) is
computable. This is sequence concatenation.
Notice that β(a, i) ≤ a−̇1 for all a and i.
Proof. See text. Most of these functions have already been given explicitly and are hence seen to be computable.
Lemma 8.18. Given F : Nn+1 → N, define F : Nn+1 → N for a ∈ Nn and b ∈ N by F (a, b) =
hF (a, 0), F (a, 1), . . . , F (a, b − 1)i. Then F is computable if and only if F is computable.
Proposition 8.19. Suppose G : Nn+2 → N is computable. Let F : Nn+1 → N be such that for a ∈ Nn ,
F (a, 0) = G(a, 0, 0) and F (a, b + 1) = G(a, b + 1, hF (a, 0), . . . , F (a, b)i). That is, F (a, b) = G(a, b, F (a, b)) is
computable.
If F is defined recursively using computable data then it is computable. For example, the function
m 7→ 2m is computable.
Let A : Nn+1 → N and B : Nn+2 → N. Suppose F : Nn+1 → N is defined by forall a ∈ Nn , F (a, 0) = A(a)
and F (a, b + 1) = B(a, b, F (a, b)). We say that F is defined by primitive recursion from A and B.
Corollary 8.20. If A and B are computable then so is F .
So also sets R ⊆ Nn defined recursively from computable data are computable.
8.2
Gödel Numbering
We want to talk about computable L-theories, formulae, et cetera. For the purposes of this we will assume
that L is a finite language, but this assumption is not always necessary. Assign to each symbol s from the
language, logical symbols, or variables a natural number, called the symbol number as follows:
(i) s = vi ∈ Var = {v1 , v2 , . . . } set SN (s) = 2i
(ii) Otherwise assign SN (s) to be an odd number. Notice that there are only finitely many symbols in the
language and logical symbols.
31
Computability, Undecidability, Incompleteness
Definition 8.21. The Gödel number p tq of an L-term t is defined recursively as follows
(
hSN (t)i
if t = vi
p q
t :=
p q
p q
hSN (F ), t1 , . . . , tn i if t = F t1 . . . tn
For a formula ϕ,

hSN (>)i





hSN (⊥)i





hSN (=), p tq1 , p tq2 i



p q
p q


hSN (R), t1 , . . . , tn i
p q
ϕ := hSN (¬), p ψ q i



hSN (∧), p ψ q , p θq i




hSN (∨), p ψ q , p θq i





hSN (∃), SN (x), p ψ q i



hSN (∀), SN (x), p ψ q i
if
if
if
if
if
if
if
if
if
ϕ=>
ϕ=⊥
ϕ is t1 = t2
ϕ = R t1 . . . tn
ϕ = ¬ψ
ϕ=ψ∧θ
ϕ=ψ∨θ
ϕ = ∃ xψ
ϕ = ∀ xψ
Lemma 8.22. The following subsets of N are computable:
(i) Vble := {p xq | x is a variable} ⊆ N
(ii) Term := {p tq | t is an L-term} ⊆ N
(iii) AFor := {p ϕq | ϕ is an atomic L-formula} ⊆ N
(iv) For := {p ϕq | ϕ is an L-formula} ⊆ N
Proof. (i) Vble(a) if and only if a ∈ Seq and `(a) = 1 and ∃ y < a (a)0 = 2y. (Note that y < (a)0 =
β(a, 1) ≤ a−̇1 ≤ a.)
The rest are exercises. Do them.
Lemma 8.23. There exists a computable function Sub : N3 → N which satisfies for any terms t and s,
variable x, and formula ϕ.
Sub(p tq , p xq , p sq ) = p t(s/x)q
Sub(p ϕq , p xq , p sq ) = p ϕ(s/x)q
Proof. See text.
Lemma 8.24. The following are computable.
(i) Fr := {(p ϕq , p xq ) | x is free in ϕ} ⊆ N2
(ii) FrSub := {(p ϕq , p xq , p tq ) | t is free for x in ϕ} ⊆ N3
(iii) PrAx := {p ϕq | ϕ is a propositional axiom} ⊆ N
(iv) EqAx := {p ϕq | ϕ is an equality axiom} ⊆ N
(v) Quant := {p ϕq | ϕ is a quantifier axiom} ⊆ N
(vi) MP := {(p ϕq , p ϕ → ψ q , p ψ q ) | ϕ, ψ are L-formulae} ⊆ N3
(vii) Gen := {(p ϕq , p ψ q ) | ψ follows from ϕ by generalization} ⊆ N2
32
Mathematical Logic
(viii) Sent := {p σ q | σ is an L-sentence} ⊆ N
We can encode the syntax of L in N in an effective manner. Suppose that Σ is an L-theory. We say that
Σ is computable if p Σq := {p σ q | σ ∈ Σ} ⊆ N is computable. Define PrfΣ to be the set of all proofs from Σ.
More precisely, it is the set {hp ϕq1 , . . . , p ϕqn i | (ϕ1 , . . . , ϕn ) is a proof of ϕn from Σ}.
Lemma 8.25. If Σ is computable then PrfΣ is computable.
If Σ is computable, is Th(Σ) computable?
a ∈ Th(σ) ⇐⇒ a is a sentence and there is b ∈ PrfΣ such that (b)`(b) = a
This is not necessarily computable because there is no bound on the length of the proof of a.
Definition 8.26. A relation S ⊆ N is computably generated if there exists a computable relation R ⊆ N2
such that
S(a) ⇐⇒ ∃ b R(a, b)
8.3
Löb’s Theorem
Σ ⊇ N , N |= Σ, L = {0, ·, +, S, <}
p q
Found σ L-sentence such that Σ ` σ ↔ ∀ x¬PrΣ (x, S σ 0). Such a σ exists by the “fixed-point” theorem.
p q
In N, S σ 0 = p σ q . In N, σ says “I am unprovable from Σ”. N |= σ and Σ 6` σ (check this), so σ witnesses
Gödel Incompleteness theorem. σ is called a Gödel sentence. By the fixed-point theorem, there is also τ
p q
L-sentence such that Σ ` τ ↔ ∃ xPrΣ (x, S τ 0). In N, τ says “I am provable from Σ”. Heuristically, there
is no problem with N |= τ , N |= ¬τ , Σ ` τ , Σ 6` τ . Löb proved that Σ ` τ (and hence Σ |= τ ).
Theorem 8.27. (Löb) Let θ be any sentence such that Σ ` ∃ xPrΣ (x, S
provable implies true) then Σ ` θ.
8.4
p q
τ
0) → θ (this is called soundness,
More definability
Definition 8.28. L,L0 two languages, A and L-structure and B an L0 -structure. We say that A is definable
in B if there exists an injective map δ : |A| → |B|k for some k ≥ 0, such that
• δ(|A|) ⊆ |B|k is definable in B say defined by the L|B| -formula δU
• For every R ∈ Lrel , n-ary, δ(RA ) ⊆ |B|nk is definable in B say defined by the L|B| -formula δR
• For every F ∈ Lf un , n-ary, δ(Γ(F A )) ⊆ |B|(n+1)k is definable in B say defined by the L|B| -formula δF
Example 8.29. N = (N, 0, +, ·, S, <) is definable in (Z, +, 0, 1, ×, −). Take δ = id, k = 1. By Lagrange’s
Theorem x ∈ N ⇐⇒ ∃ abcd(x = a2 + b2 + c2 + d2 ). + is same, · is ×, S(x) = x + 1, x < y ⇐⇒ (y − x) ∈ N.
If δU and all the δR’s and δF ’s are L0 -formulae then we say that δ is a 0-definition of A in B (or A is
0-definable in B).
Theorem 8.30. (Tarski) If A is strongly undecidable and A is definable in B, then B is strongly undecidable.
Corollary 8.31. L = Lring and RI = theory of rings is undecidable by the example above (since N is
strongly undecidable and definable in Z, a ring)
Theorem 8.32. (Julia Robinson) Z is definable in Q (as a field).
Hence Q is strongly undecidable, so the the theory of fields is undecidable.