Вы находитесь на странице: 1из 40

UNIVERSIT DEGLI STUDI DI MILANO

Dipartimento di Matematica
First Steps in Model Theory
Silvio Ghilardi
2
The aim of these notes is to explain basic facts in model theory, for pure mathematicians addressing
their rst course in logic.
I am grateful to Francesco Alberti and Simone Rollini, who prepared the very rst version of these
notes.
La presente versione di questa dispensa porta la data del Settembre 2013.
The present version still requires revision!
Contents
1 Languages, Structures, and Theories 5
1.1 Syntax - Languages, Terms and Formulas . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Semantics - Truth and Logical Consequence . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Theories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3.1 Examples of Theories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3.2 Multi-Sorted Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2 Diagrams and Embeddings 17
2.1 Substructures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2 Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3 Ultraproducts and Compactness 25
3.1 Ultralters for P(X) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.2 Ultraproducts and Ultrapowers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.3 o theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.4 Compactness theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.5 Characterizing elementary classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4 Further Topics 31
4.1 Cardinality of Models and Completeness of Theories . . . . . . . . . . . . . . . . . 31
4.2 Back-and-Forth Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.3 An example of a Preservation Theorem . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.4 Satisability of Clauses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
A Complements on Boolean Algebras 37
A.1 Denition and Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
A.2 Atoms and Finite Duality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
A.3 Ultralters and Stone Representation . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3
4 Contents
Chapter 1
Languages, Structures, and Theories
We rst introduce the syntax of the languages we are studying in these notes.
1.1 Syntax - Languages, Terms and Formulas
Denition 1.1.1. [Language]
An elementary language / is a couple (T = T
n

n0
, T = T
n

n0
) where
for all n 0, T
n
is the set of function symbols of arity n; T
0
is the set of (individual)
constants;
for all n 0, T
n
is the set of predicate symbols of arity n; T
0
is the set of propositional
letters.
We assume that the identity predicate = is always included in T
2
, for every language we will talk
about. Moreover, in order to build formulas, we will need also symbols that are shared by any
elementary language:
a denumerable set 1 of (individual) variables x
0
, x
1
, . . . , y
0
, y
1
, . . .;
the set , , , , , of Boolean connectives;
the set of quantiers , .
Notice that we shall only quantify over individuals, not over subsets or functions, because we
are restricting to rst order logic.
Denition 1.1.2. [Term]
Given a language / = (T, T), a /-term is dened as follows:
1
individual variables x V ar and individual constants c T
0
are terms;
if f T
n
, n 0 and t
i
(i = 1, . . . , n) are terms, f(t
1
, . . . , t
n
) is a term.
Terms without variables are called closed or ground.
2
Terms are used to indicate objects.
Denition 1.1.3. [Formula]
Given a language / = (T, T), a /-formula is dened as follows:
3
every propositional variable p T
0
is an atomic formula;
1
We will write only term instead of L-term, if confusion does not arise.
2
The adjective closed comes from mathematical literature, while ground is more from Computer Science oriented
literature.
3
As for terms, we will write L-formula only when needed to avoid confusion.
5
6 Chapter 1. Languages, Structures, and Theories
if P T
n
, n 0 and t
i
(i = 1, . . . , n) are terms, P(t
1
, . . . , t
n
) is an atomic formula;
if A and B are two formulae, (A), (A B), (A B), (A B) are formulae;
if A is a formula and x is a variable, (xA) and (xA) are formulae.
When writing formulae we usually omit the external brackets and we may eliminate inner
brackets according to priorities (we stipulate that unary operators have strongest priority and
that , have stronger priority than ). Atomic formulae are also called atoms. A literal is an
atom or its negation. A clause is a disjunction of literals; an open (or quantier-free) formula is a
formula obtained from literals by applying them disjunctions and conjunctions. A ground formula
is a formula where variables do not occur (this is more restrictive than the notion of a sentence,
see below).
An occurrence of a variable x in A is said to be bounded if it is within the scope of a quantier
of A, i.e. if it is located in a sub-formula of A of the form x.B or x.B, otherwise the occurrence
of x is said to be free in A. A variable is free in a formula A if it has a free occurrence in A. With
A(x
1
, . . . , x
n
) we mean that the free variables of the formula A are among the variables included
in the list x
1
, . . . , x
n
. The notation x is used to represent tuples of distinct variables.
Denition 1.1.4. [Sentence]
A formula without free variables is called a sentence or a closed formula.
We shall use and to abbreviate AA and AA, respectively (here A is any sentence).
Denition 1.1.5. [Universal and Existential Closure]
Given a formula A(x
1
, . . . , x
n
), the universal closure of A(x
1
, . . . , x
n
) is the formula x
1
x
n
A;
the existential closure of A(x
1
, . . . , x
n
) is the formula x
1
x
n
A. They are denoted respectively
as A

and A

.
1.2 Semantics - Truth and Logical Consequence
Semantics is the heart of model theory. Problems we want to address are usually specied through
semantic concepts.
A structure is the rst brick to build the notion of truth. In order to establish whether a
formula is true we need to interpret the symbols in the formula, otherwise they are just symbols,
and there is no way to assign to a formula a truth value, unless we know how to map symbols
in the abstract word of formulas to objects of some real world. So a structure needs a set
of objects A and a function J that associates function symbols of the formal language / with
functions between objects of the universe A, and predicate symbols with relations between real
objects.
Denition 1.2.1. [Structure]
Given a language / = (T, T), a /-structure is a pair / = (A, J), where:
A is a set called the support or the universe of the structure;
J is a function called interpretation such that
for every function symbol f T
n
, n 1,
J(f) : A
n
A
for every predicate symbol P T
n
, n 1,
J(P) A
n
The cardinality of a structure is the cardinality of its support. The interpretation of the identity
symbol is assumed to be real identity, i.e. it is assumed that J(=) := (a, a) [ a A.
1.2. Semantics - Truth and Logical Consequence 7
For n = 0, we let A
n
be a singleton, so that we can (equivalently) say that the interpretation
of a constant is an element of A and that the interpretation of a propositional letter belongs to a
two-element set, i.e. it is a truth value.
Notice that the support of a structure can be really huge and (in any case) there is no reason
why a language should have an individual constant naming every element of the universe of a
structure. This might lead to technical problems when dening truth of quantied formulae.
There are many solutions to these problems, the solution we adopt here is to build fake names:
given a language / and a /-structure /, we will consider an extended language which has a
name (i.e. an individual constant) for every element of the universe of the structure /. The
interpretation of / is expanded in such a way that every new symbol is interpreted as the object
it represents in the language. This operation allows us to give a complete denition of truth.
Denition 1.2.2. [Extended language]
Given a language / = (T, T), a /-structure / = (A, J) and X A, /
X
is the language obtained
adding to T
0
an individual constant a for every a X (we call a the name of a). The interpretation
J is extended to cope with the new symbols by letting J( a) := a.
For the denition of truth, we need to expand the language with the name of every element of
a structure / = (A, J), i.e. we need to consider /
A
.
We rst dene interpretation of ground terms:
Denition 1.2.3. [Interpretation of ground terms] For every ground term t of /
A
, we dene
t
I
A by induction as follows:
f(t
1
, . . . , t
n
)
I
= J(f)(t
I
1
, . . . , t
I
n
) .
We are now ready to give the denition of truth for a sentence: given a language /, a /-
structure / = (A, J), the fact that a /
A
-sentence B is true in / is denoted as / [= B. This
notion is dened as follows:
Denition 1.2.4. [Truth]
Given a language / = (T, T), a /-structure / = (A, J), P T
n
and ground /
A
-terms t
1
, . . . , t
n
,
we put
/ [= P(t
1
, . . . , t
n
) (t
I
1
, . . . , t
I
n
) J(P)
Moreover, given two /
A
-sentences A and B, we put
/ [= A / ,[= A
/ [= A B / [= A and / [= B
/ [= A B / [= A or / [= B
/ [= A B / ,[= A or / [= B
/ [= x.A / [= A( a/x) for at least one a A
/ [= x.A / [= A( a/x) for all a A
where A( a/x) represents the sentence obtained from A substituting all the free occurrences of x
with (the name of the element) a. Finally, if B(x
1
, . . . , x
n
) is a formula,
/ [= B(x
1
, . . . , x
n
) for all a
1
, . . . , a
n
A, / [= B( a
1
/x
1
, . . . , a
n
/x
n
) (1.1)
and if is a set of formulae, / [= for all B , / [= B.
From now on, we shall write simply a for a; in addition, B( a
1
/x
1
, . . . , a
n
/x
n
) will be written
as B(a
1
, . . . , a
n
). Notice that, since J(=) is the set of identical pairs, for two terms t
1
, t
2
it always
holds that
/ [= (t
1
= t
2
) i J(t
1
) = J(t
2
) (1.2)
8 Chapter 1. Languages, Structures, and Theories
Denition 1.2.5. [Logical consequence]
Given a language /, a set of /-formulas and a /-formula B,
[= B for all /-structure /, / [= / [= B
If [= B, B is said to be a logical consequence of . B is a logical truth if [= B (denoted with
[= B).
Quite often, we shall speak about structures, formulae, etc. leaving the language / as under-
stood, in case confusion does not arise (but as soon as important facts depend on the reference
language, we shall stress this dependence).
According to a classical result (Church Theorem), the set of logical truths is not decidable, it
is only semi-decidable. Semi-decidability means that it is possible to program a computer in such
a way to output an innite list A
0
, A
1
, . . . containing precisely logical truths. So, if we want to
know whether a formula B is a logical truth, we will eventually know this only if B is a logical
truth, otherwise we will wait forever. Local improvement of this situation are possible, but not
general solutions!
1.3 Theories
Denition 1.3.1. [Theory, Models]
A theory T is a set of sentences. A structure / is a model of the theory T if / [= T.
In Computer Science applications like SMT, a quite dierent and rather unorthodox denition
of theory is adopted: there, a theory is dened to be just a pair formed by a language / and a
class of /-structures.
To better understand the situation, let us recall the classical Galois connection machinery used
in these situations. Fix a language /; with a set of formulae T one can associate the class of
/-structures Mod(T) = / [ / [= and conversely with a class of /-structures ( one can
associate a set of formulae Th(() = B [ for all / (, / [= B. It is quite immediate to show
that we have:
T Th(() ( Mod(T)
for all T, (. A theory T is said to be deductively closed i T = Th(Mod(T)) (equivalently,
i it is of the kind Th(() for some () and a class of structures ( is said to be elementary i
( = Mod(Th(()) (equivalently, i it is of the kind Mod(T) for some T). In model theory, one
may not want to distinguish between T and its deductive closure Th(Mod(T)) (more generally,
we often consider equal two theories having the same models), however the distinction between
elementary and not elementary classes is crucial. The distinction between T and Th(Mod(T)) is
an axiomatization issue: the real theory is Th(Mod(T)), whereas T has to be seen as a set of
axioms for Th(Mod(T)). The existence of nice set of axioms is important to explain the intuitive
meaning of the theory, but might also have consequences on the properties of the theory itself (in
fact, some model-theoretic properties of the theory depends on the fact that the theory has an
axiomatization of a special shape).
In Computer Science applications, the emphasis is however on decision procedures, thats
why one often does not stress denability isssues, like the property of a class of models of being
elementary. In any case, one should pay attention to the fact that the standard denition of a
theory we adopt the the unorthodox SMT denition are not equivalent and should not be confused!
Denition 1.3.2. [Completeness, Consistency]
A theory T is complete if for every sentence B, it holds that
T [= B or T [= B;
a theory T is consistent when it has at least one model (i.e., when T ,[= ).
1.3. Theories 9
Example 1.3.1. Examples of complete theories can be found easily: for all structure /,
Th(/) = B [ B is a formula such that / [= B
is a complete theory. It can be seen that every deductively closed, consistent and complete theory
arises in this way.
Thus consistent and complete theories are essentially the theories of the kind Th((), where ( is
formed by a single structure. The following notation will be useful: given a structure / = (A, J)
and a set X A, Th
X
(/) will denote the sets of /
X
-formulae true in /.
The brief discussion below concerning decidability issues supplies further motivations to the
investigation of completeness of theories.
Denition 1.3.3. [Decidability]
A theory T is decidable i the relation T [= B is decidable.
If membership to T is decidable, the relation T [= B is semi-decidable (this follows from
instance from completeness theorems for logical calculi). According to a general fact in recursion
theory, a set is decidable i it is semi-decidable and its complement is also semi-decidable. Thus, if
T is complete and membership to T is decidable, then T is decidable: this is why completeness of a
theory is an important topic also for computational purposes (although it must be said that model-
theoretical methods establishing decidability via completeness give quite impractical algorithms,
so that the whole matter has to be redesigned case by case for concrete applications).
1.3.1 Examples of Theories
Lets see some examples of theories. In this Section, we will mention properties of these theories
that can be proved by using more advanced theoretical tools (some of these tools will be introduced
later on in these notes). The reader, at this stage, should simply concentrate on the task of writing
appropriate formulae to specify theories in a formal context. Sometimes we specify a theory by
using formulae which are not sentences: in these cases, these formulae should be replaced by their
universal closures.
Theory of identity
Let /
=
be a language whitout function symbols, i.e., T
n
is empty for all n; in this language there
are also no predicate symbols except for a binary one, i.e., T
n
is empty if n ,= 2 and T
2
contains
only one element, =. If T
=
is empty we have the pure theory of identity. A /
=
-structure is a
set, every /
=
-structure is a model for this theory.
If / is a nite /
=
-structure of cardinality n,
T
=
n
=
_
_
_
x
1
, . . . , x
n
_
_

i=j
x
i
,= x
j
_
_
, x
0
, x
1
, . . . , x
n
_
_

i=j
x
j
= x
i
_
_
_
_
_
has the same models of Th(/) (we will consider identical two theories with the same models).
Notice that the two axioms of T
=
n
represent the existence of exactly n distinct elements in the
support of /.
Otherwise, if / is not nite, Th(/) is the theory
T
=

=
_
_
_
x
1
, . . . , x
n
_
_

i=j
x
i
,= x
j
_
_
_
_
_
n
Notice these two facts:
T
=

is not nitely axiomatized (in general, one can show that it is not possible to nd a nite
set of axioms for T
=

);
10 Chapter 1. Languages, Structures, and Theories
T
=

has as models all the non-nite /


=
-structures, even if they are not isomorphic between
themselves. So our language does not distinguish between innite cardinalities.
The extensions discussed above are all and the only ones consistent and complete extensions of
T
=
(recall that, if T

is consistent and complete, T

can be identied with Th(/), where / is any


model of T

).
Theory of equality with uninterpreted functions
Let /
EUF
be the language /
=
enriched with function symbols (but T
n
is still empty if n ,= 2 and
T
2
is the singleton =). As for T
=
, again we have that T
EUF
= . The formula

i
x
i
= y
i
f(x
1
, . . . , x
n
) = f(y
1
, . . . , y
n
)
is an example of a logical consequence of this theory. Other examples ecompass formulae expressing
reexivity, symmetry and transitivity conditions of the identity predicate.
Theory of total orders
Let /
O
be a language where T
n
= for all n, T
n
= if n ,= 2 and T
2
= , =. The total order
theory T
T O
has these axioms:
x x reexivity
x y y z x z transitivity
x y y x x = y antisymmetry
x y y x totality
A consistent and complete extension of T
T O
is the theory T
T O
which also has these axioms (let
x < y be the formula x y x ,= y):
x < y z.(x < z z < y) density
xy.x < y no right endpoint
xy.y < x no left endpoint
Notice that T
T O
is equal to Th(Q, ) and also to Th(R, ). This immediatly follows from the
fact that T
T O
is consistent and complete, and from the fact that the axioms of T
T O
are true in
such structures.
Theory of Abelian groups
As well-known, an Abelian group is a set A endowed with a binary associative and commutative
operation + : AA A. Moreover, there exists the identity element 0 A, and for every element
a A there is an element b A such that a +b = 0 (b is called the inverse of A).
Thus, the language of Abelian groups is (+, , 0), i.e., it has a binary function symbol +, a
unary function symbol (x is the opposite of x) and an individual constant 0 which is the
identity element. Axioms are
x + (y +z) = (x +y) +z associativity
x +y = y +x commutativity
x + 0 = x identity
x + (x) = 0 inverse
1.3. Theories 11
A consistent and complete extension of this theory is obtained considering the theory of nonde-
generate Abelian groups that are divisible and torsion-free. Non-degeneracy means x(x ,= 0),
whereas the remaining two conditions are expressed with innitely many axioms:
xy (ny = x) (for all n 1) divisibility
nx = 0 x = 0 (for all n 1) torsion-freeness
where nx stands for x +x +. . . +x (n times).
Another consistent and complete extension of the Abelian groups theory is obtained requiring
the group to be innite (i.e. a model of T
=

) and the order of every element to be p (p is prime).


This fact is expressed by the axiom px = 0.
To obtain the theory of totally ordered groups, one has to enrich the language with a binary
relation < and add irreexivity, transitivity, linearity and compatibility axioms:
x < x irreexivity
x < y y < z x < z transitivity
x < y x = y y < x linearity
x < y x +z < y +z compatibility
Together with the divisibility axiom y (ny = x), the theory becomes complete, hence the same as
Th(R, +, , 0, <). This is the theory of totally ordered divisible Abelian groups, also called linear
real arithmetic in Computer Science applications.
Theory of vector spaces on a given eld K
To model vector spaces over a xed eld K we need, in addition to the language and axioms for
Abelian groups, one unary function symbol f

for all K, denoting the scalar multiplication


by . As additional axioms, we have (x stands for f

(x)):
(i) (x +y) = x +y
(ii) ( +)x = x +x
(iii) (x) = ()x
(iv) 1x = x
If K is innite, the theory is consistent and complete if we add the axiom xx ,= 0. If K is
nite, to get a complete theory we need for instance to add the axioms of T
=
n
or T
=

(not for all


n, of course, we get a consistent theory!).
If we want vector spaces on a variable eld, we need a multi-sorted language, see below.
Theory of elds
To introduce commutative rings with unity we need the language (+, 0, , , 1); the axioms are
the standard ones (Abelian group axioms for +, , 0, commutative monoid axioms for , 1, plus
distributive laws). Notice that the extra axiom needed for the theory of elds
x = 0 y xy = 1
is not an equation, but it is a formula requiring an existential quantier.
We want to investigate terms in the theory C of elds (the same considerations apply, more
generally, to the theory of commutative rings). For such terms, there is a canonical form, modul
C in the following sense: for every term t(x) there exists a polynomial p(x) with coecients in Z
such that C [= t(x) = p(x). Thus we can identify terms with the corresponding polynomial, and
atoms with formulas of the form p(x) = 0. Notice that coecient are in Z, because we must refer
to the denition of a term: for instance, the monomial 3xy mus be considered just an abbreviation
12 Chapter 1. Languages, Structures, and Theories
for ((x y)+(x y))+(x y) (where inx notation has been used for the operation +, . We may also
get polynomials with coecients in a structure (eld) K, but then we must consider expanded
languages /
K
.
We obtain the theory C
p
of elds of characteristic p by adding to C the axiom
p = 0
where p stands for 1 + . . . + 1 (p times). For the characteristic zero C
0
we need innitely many
axioms
p ,= 0
with p prime (it can be shown that nitely many axioms are not sucient).
We now want to specify algebraically closed elds: the related theory will be called T
ACF
.
Here we need again innitely many axioms of the form
y
_
y
n
+
n1

i=0
x
i
y
i
= 0
_
(1.3)
saying that monic polynomials of degree n 1 always have a root. One can prove that T
ACF
p
and T
ACF
0
(the theories of algebraically closed elds of characteristic p and 0) are consistent and
complete, thus for instance T
ACF
0
= Th(C, +, , 0, , 1).
How can we axiomatize real arithmetic Th(R, +, , 0, , 1)? This is the theory of real closed
elds: it is obtained by adding to the theory of elds the axioms (1.3) for all odd n, plus the
following axioms:
y (y
2
= x y
2
= x)
n

i=1
x
2
i
= 0
n

i=1
(x
i
= 0)
It can be shown (exercise) that a real closed eld can be ordered by putting x < y i y x is not
0 and it is a square. Thus, in order to axiomatize Th(R, +, , 0, , 1, <) we only need the extra
axiom
x < y (x y ,= 0 z (z
2
= x y)).
This is essentially a linguistic variation of T
RCF
.
The ordered elds provide us a with starting point to observe that there are well known proper-
ties that are not elementary. A property of this kind is completeness, that requires quantication
over subsets of the model. Another one is the Archimedean property
x > 0

nN
nx > y
that involves an innite disjunction. One can prove that both properties are not elementary, in
the sense that it is not possible to express them by using (nitely or innitely many) rst-order
formulae.
Dierence logic over the integers
Axiomatizing (fragments of) arithmetic over natural or integers numbers is a much more dicult
task. We begin by analyzing a very weak fragment, which is nevertheless useful in the applications.
Let /
IDL
be a language with two unary function symbols P and S (predecessor and successor),
the binary predicate < and the constant 0. The theory are T
IDL
= Th(Z, <, 0, S, P) is called
integer dierence logic in Computer Science applications.
1.3. Theories 13
It can be proved that T
IDL
can be axiomatized with these sentences:
x.x ,< x
x, y.(x < y y < x x = y)
x, y, z.(x < y y < z x < z)
x.(P(S(x)) = x S(P(x)) = x)
x, y.(S(x) = S(y) x = y)
x, y.(P(x) = P(y) x = y)
x, y.(S(x) < S(y) x < y)
x, y.(P(x) < P(y) x < y)
x, y.(x < S(y) x < y x = y)
x, y.(P(x) < y x < y x = y)
Notice that every atoms of this theory are of the form
t S
n
(u) (1.4)
where <, =, t is a variable and u can be a variable, the constant 0 or n Z. The standard
notation for atoms (1.4) is t u n, called dierence logic notation.
Presburger arithmetic
Linear integer arithmetic is decidable; to get Th(Z, <, 0, S, P, +, ), one can add to the axioms for
a totally ordered Abelian group, the above axioms for T
IDL
and the following extra axioms (one
for each n) expressing existence of integer quotients and remainders:
y.

0r<n
x = ny +r
(we used the abbreviations nt for the sum of n-copies of t and n for n1). However, to get better
properties (like quantier elimination) it is better to add to the language extra binary relations

n
(one for every n > 0) together with axioms
x
n
y z (nz = x y)
constraining
n
to be interpreted as equivalence modulo n. The resulting theory is called Pres-
burger Arithmetic and is very useful in applications to formal verication.
Peano arithmetic
The situation becomes much worse if we add multiplication to the language. Let /
PA
be a
language with two binary function symbols +, , one unary function symbol S representing the
successor and the constant 0. Elementary Peano Arithmetic T
PA
contains the following axioms:
0 ,= S(x)
S(x) = S(y) x = y
x + 0 = x
x +S(y) = S(x +y)
x 0 = 0
x S(y) = (x y) +x
14 Chapter 1. Languages, Structures, and Theories
A(0, y) x.(A(x, y) A(S(x), y)) xA(x, y)
The last axiom (this is an innite set of axioms, one for every A(x, y)) is a restricted form of induc-
tion.
4
There is a quite big distance between T
PA
and Th(N, 0, S, +, ):
5
according to Gdels rst
theorem, there are no consistent and complete extensions of T
PA
, unless we adopt an undecidable
set of axioms (which is not quite desirable, though).
1.3.2 Multi-Sorted Languages
In many applications, both to Mathematics and Computer Science, we need to consider dierent
sorts of variables. Lets turn to the example of the theory of vector spaces. Suppose we do not x
the scalar eld; in this case it is not possible to write an axiom like (x+y) = x+y in the form
f

(x +y) = f

(x) +f

(y), where f

is a unary function symbol denoting scalar multiplication by


(this is because the set of such f

is not xed). We must adopt instead a more natural approach


in which scalar multiplication is a binary operation, taking a scalar and a vector as arguments.
To make this formal, we need to introduce in the syntax of rst order languages sorts: these are
just placeholders, in our case we have two sorts S, V for scalars and vectors, respectively. In the
general case, sorts are just a set and the specication of such a set must be added to the denition
of a rst-order language. This modication has ubiquitous (but straightforward) consequences
on all the denitions from sections 1.1,1.2. We shall explain them informally, taking inspiration
from the vector spaces case. First, scalar multiplication and vector additions are not just binary
function symbols, but function symbols having as a domain a list of sorts and as a codomain a
sort: we write this as
: S, V V + : V, V V
Similar observations apply to the remaining operations (scalar eld operations, opposite vector,
etc.), constants (0,1 scalar, 0 vector, etc.) and relations (we now have two identity predicates, one
for each sort). The denitions of a term is also modied (we need variables and terms of a given
sort, not just variables and terms) as well as the denition of a formula. Strctures will consist of a
set for each sort and of sorted interpretations for function and predicate symbols; the denition of
truth must take into accounts sorts of variables when recursively evaluating quantiers, etc. Once
all these obvious modications are carried out, we can formally speak about multi-sorted theories
and their models. In the case of vector spaces, we get the ordinary notion of a vector space (a
eld acting via scalar multiplication into an Abelian group) as a model of the two-sorted theory
of vector spaces.
Many-sorted theories are frequently used in Computer Science aplications oriented for instance
to formal verication. Here we need sorts to model container datatypes, with function symbols
for accessing and modifying data: examples of such theories are the theory of arrays, of lists, of
stacks, etc. We discuss in more details the theory of arrays.
Theory of arrays
The language of this theory has three sorts: INDEX, ELEM and ARRAY. We have also two function
symbols:
rd : ARRAY, INDEX ELEM
wr : ARRAY, INDEX, ELEM ARRAY
for accessing the content of the i-th cell of the array a and for modifying it. The axioms of this
theory (due to C. Mc Carthy) are
rd(wr(a, i, e), i) = e
4
Full induction requires quantication over all subsets, hence second order logic. From the point of view of
metamathematical properties, second order Peano Arithmetic does not behave better and is also subject to intrinsic
limitations of second order logic (the set of logical consequences is not even semi-decidable anymore).
5
Taking Z or even Q instead of N does not improve the situation.
1.3. Theories 15
i ,= j rd(wr(a, i, e), j) = rd(a, j)
a ,= b i.rd(a, i) ,= rd(b, i)
The last axiom is called the extensionality axiom: it says that two arrays are the same in case
their cells have the same content. The standard models of this theory (called functional models)
interpret the sort ARRAY as the set of all functions from the interpretation of the sort INDEX into
the interpretation of the sort ELEM; the symbol rd is interpreted as functional application and
the symbol wr as the operation of modifying the function a by changing its value on i from a(i)
into e.
The theory of arrays is undecidable in general, but its quantier-free fragment is decidable (as
some remarkable extensions).
16 Chapter 1. Languages, Structures, and Theories
Chapter 2
Diagrams and Embeddings
There exist dierent notions of morphisms between structures, but here will focus only on the
most useful ones.
2.1 Substructures
The notion of an isomorphism between structures in the obvious one:
Denition 2.1.1. [Isomorphism]
An isomorphism between two /-structures / = (A, J) and /

= (A

, J

) is a bijection
: A A

such that for all f T


n
, P T
n
and a
1
, . . . , a
n
A the following two conditions
[J(f)(a
1
, . . . , a
n
)] = J

(f) ((a
1
), . . . , (a
n
))
(a
1
, . . . , a
n
) J(P) ((a
1
), . . . , (a
n
)) J

(P)
are satised.
By induction we can easily verify that if is an isomorphism as above, then for all a
1
, . . . , a
n

A, for all formulas A(x
1
, . . . , x
n
), we have
/ [= A(a
1
, . . . , a
n
) /

[= A((a
1
), . . . , (a
n
))
Recall that when we use notation / [= A(a
1
, . . . , a
n
) (for a formula A(x
1
, . . . , x
n
) and a
1
, . . . , a
n

A), we mean the following: (i) in A at most the variables x
1
, . . . , x
n
occur free; (ii) we have ex-
panded the language / with names for a
1
, . . . , a
n
(these names are indicated again with a
1
, . . . , a
n
for simplicity); (iii) the interpretation J is also expanded to the enlarged language by putting
J(a
1
) = a
1
, . . . , J(a
n
) = a
n
; (iv) the formula A(a
1
, . . . , a
n
) (obtained by replacing the names of
a
1
, . . . , a
n
for the free occurrences of the variables x
1
, . . . , x
n
, respectively) is true in / (with J
extended as in (iii)).
Denition 2.1.2. [Substructure]
A /-structure /

= (A

, J

) is said to be a substructure of / = (A, J) if A

A and if for all


f T
n
and P T
n
holds that J

(f) and J

(P) are the restrictions of J(f) and J(P) to A

.
Example 2.1.1. If / does not contain predicate symbols, the notion of a substructure coincides
with the notion of sub-algebra, i.e. subset closed with respect to the operations (thus, the notion of
substructure generalizes the notion of a subgroup, subring, etc.). If / contains predicate symbols
we need to pay attention to the meaning of the denition: e.g. if / contains a binary relation
R, the structure (N, ) will have as a substructure all the (S, ) with S N such that for all
a
1
, a
2
S, a
1
a
2
(in S) if and only if a
1
a
2
(in N). In other words, we require that the
inclusion preserves and reects relations.
17
18 Chapter 2. Diagrams and Embeddings
Lemma 2.1.1. If /

is a substructure of /, for every atomic /


A
-sentence A(a
1
, . . . , a
n
) we have
/ [= A(a
1
, . . . , a
n
) /

[= A(a
1
, . . . , a
n
) (2.1)
Proof. To prove this fact, we rst establish a related property concerning ground terms of /
A
.
The property is proved by induction on complexity of these terms and it is the following:
J(t(a)) = J

(t(a)) (2.2)
If t is a constant of /, such relation holds because J

is the restriction of J; if t is the name of an


element of A

, this relation holds since the names of the elements are always interpreted as the
elements they represent. By induction, if t = f(t
1
, . . . , t
n
), with f T
n
, we have
J(f(t
1
, . . . , t
n
)) = J(f)(J(t
1
), . . . , J(t
n
)) by denition of J
= J

(f)(J

(t
1
), . . . , J

(t
n
)) by inductive hypothesis
= J

(f(t
1
, . . . , t
n
)) by denition of J

In order to prove the (2.1), we know that if A(a


1
, . . . , a
n
) is an atomic formula, then it must be
of the form P(t
1
, . . . , t
n
) where P T
n
and t
1
, . . . , t
n
are closed /
A
-terms. So we can say that
/ [= P(t
1
, . . . , t
n
) (J(t
1
), . . . , J(t
n
)) J(P)
(J

(t
1
), . . . , J

(t
n
)) J

(P) by (2.2)
/

[= P(t
1
, . . . , t
n
)
Lemma 2.1.1 can be used also for an alternative equivalent denition of a substructure. We
say that /

is a substructure of / if A

A and if (2.1) holds for all the atomic /


A
-sentences.
In this case, J

will be automatically the restriction of J; to prove this it is sucient to consider


the /
A
-sentences
f(a
1
, . . . , a
n
) = b P(a
1
, . . . , a
n
)
and reason in this way:
J

(f)(a
1
, . . . , a
n
) = b /

[= f(a
1
, . . . , a
n
) = b
/ [= f(a
1
, . . . , a
n
) = b by (2.1)
J(f)(a
1
, . . . , a
n
) = b
(a
1
, . . . , a
n
) J

(P) /

[= P(a
1
, . . . , a
n
)
/ [= P(a
1
, . . . , a
n
) by (2.1)
(a
1
, . . . , a
n
) J(P)
This shows that the two denitions of a substructure are indeed equivalent.
We have seen that, if /

is a substructure of /, (2.1) holds for all the atomic /


A
-sentences.
Moreover, (2.1) holds also for the open /
A
-sentences, i.e. for the quantier-free /
A
-sentences:
this fact can be proved with a simple induction, going through the clauses of Denition 1.2.4
concerning disjunction, conjunctions, implications and negations.
But we cannot go further, because even if A is quantier-free, a quantied /
A
-sentence x.A(x)
can be true in / but not in /

(while the converse always holds), and a universal /


A
-sentence
xA(x) can be true in /

but not in / (while the converse always holds).


Exercise 2.1.1. Prove the above statement.
To transfer truth of arbitrary sentences in the expanded language, we need to strengthen the
notion of a substructure:
2.2. Diagrams 19
Denition 2.1.3. [Elementary substructure]
If the equation (2.1) holds for every /
A
-sentence, we say thta /

is an elementary substructure
of / (we denote this fact with /

/).
Example 2.1.2. Lets consider the language of the theory of elds, it is clear that Q is a substruc-
ture of R, and R is a substructure of C. But in neither case we have an elementary substructure
because:
R [= x(x
2
= 2) Q ,[= x(x
2
= 2)
C [= x(x
2
= 1) R ,[= x(x
2
= 1)
Example 2.1.3. We can prove that if K
1
and K
2
are two elds algebraically closed such that
K
1
K
2
, then K
1
K
2
. This fact is not obvious (it is a version of the Hilberts Nullstellensatz
theorem).
We complete the section with further basic denitions.
Denition 2.1.4. [Embeddability]
Given two structures / and B, we say that / can be embedded into B if / is isomorphic to a
substructure of B. If / is isomorphic to an elementary substructure of B, we say that / can be
elementarily embedded into B.
Next Proposition immediately follows from Lemma 2.1.1:
Proposition 2.1.1. / can be embedded (resp. elementarily embedded) into B if it exists : A
B such that for every atomic /
A
-sentence A (resp. for every sentence A) it holds that
/ [= A(a
1
, . . . , a
n
) B [= A((a
1
), . . . , (a
n
)) (2.3)
Notice that in the previous Proposition, automatically turns out to be injective, by taking
a
1
= a
2
as A.
Denition 2.1.5. [Elementary equivalence]
Given two /-structures / and B, they are elementarily equivalent written / B if Th(/) =
Th(B), or, in other words, if for every /-sentence A, it happens that / [= A B [= A.
Notice that / B (or B /) implies / B, while the converse might not be true. Ele-
mentary equivalence is weaker than the notion of isomorphism. Moreover, it can happen that two
elementarily equivalent structures cannot be elementarily embedded into each other. Notice that
in a complete theory all models are elementarily equivalent.
2.2 Diagrams
Embeddability can be investigated syntactically by the help of diagrams (this is a powerful idea
is due to A. Robinson).
Denition 2.2.1. [Diagram]
Given a /-structure / = (A, J), the diagram
A
of / is the set of all ground /
A
-literals true in
/. The elementary diagram
e
A
of / is the set of all /
A
-sentences true in /.
Notice that the presence of the parameters for the support A of / distinguishes
e
A
from
Th(/). Next Lemma is a powerful (although quite simple) tool in model theory:
Lemma 2.2.1. [Robinson Diagram Lemma]
Let / and B be two /-structures. / is embeddable in (resp. elementarily embeddable) in B if and
only if it is possible to expand B to a /
A
-structure that is a model of
A
(resp.
e
A
).
20 Chapter 2. Diagrams and Embeddings
Proof. We give the proof only for the case of (plain) embeddability (for elementary embeddability
the argument is similar). Now / is embeddable into B i there exists a function
: A B
such that for every atomic /
A
-sentence it holds that
/ [= A(a
1
, . . . , a
n
) B [= A((a
1
), . . . , (a
n
))
But this is equivalent to stating that for every element of
A
it holds that
/ [= A(a
1
, . . . , a
n
) = B [= A((a
1
), . . . , (a
n
)) (2.4)
Stating that B can be expanded to a model of
A
means that it is possible to enlarge the inter-
pretation of the symbols belonging to / to an interpretation of symbols belonging to /
A
, i.e. it is
possible to associate to every a A a (a) B in such a way that the /
A
-literals true in / will
be true also in the enlarged /
A
-structure B. In other words, there must exist : A B such
that (2.4) holds.
We state here a fundamental theorem usually combined with Lemma 2.2.1 in the applications
(the proof is delayed to the next chapter):
Theorem 2.2.1. [Compactness]
A set of sentences has a model if and only if every nite subset
0
admits a model.
Given an /-structure / and a X A, there exists the smallest substructure /
X
/ that
contains X in its support. It suces to this end to close X with respect to all the operations of /
and then to dene J
X
by restriction from J. We can easily see that the support of /
X
is given by
_
a A [ there exist b X, an /-term t(x) such that t(b)
I
= a
_
(recall Denition 1.2.3 for the meaning of t(b)
I
). If / = /
X
for a nite X, we say that / is
nitely generated. Notice that a nitely generated structure can be innite.
Example 2.2.1. The Abelian group Z is nitely generated by 1.
Example 2.2.2. If / does not contains function symbols, the support of /
X
is X.
Example 2.2.3. Finitely generated Boolean algebras are nite, because every element of B = B
X
,
for any nite X, can be written as
_
i

j
a
ij
(2.5)
where a
ij
is equal to c or c

for a given c X. Indeed, if we apply De Morgans and distribution


laws, from elements of the form (2.5) we get elements of the same form.
Applications of the diagram lemma
We show some examples on the power of the combined use of Diagram Lemma and Compactness
Theorem.
Proposition 2.2.1. Every Abelian group is embeddable into a divisible Abelian group.
Proof. Let / an Abelian group. By using Lemma 2.2.1 it suces to prove that, given the theory
T of Abelian groups,

A
xy (ny = x)
n1
T
is consistent.
2.2. Diagrams 21
By compactness it suces to prove that every set
xy (ny = x)
n1
T
is consistent, where is a nite subset of
A
. So, it suces to prove that every nitely generated
Abelian group can be embedded into a divisible Abelian group.
By a result from Algebra, every nitely generated Abelian group is a product of nitely many
cyclic groups G
1
. . . G
n
.
1
The multiplicative group of complex numbers C

is divisible, and
so are the products (C

)
n
of C

with itself. Every cyclic group G


i
can be embedded in C

, so we
obtain the result by putting together the embeddings
i
: G
i
C

1

n
: G
1
G
n
(C

)
n
(a
1
, . . . , a
n
) (
1
(a
1
), . . . ,
n
(a
n
))
Next, we give a compactness-based proof of Stone theorem:
2
Proposition 2.2.2. [Stones theorem]
Every Boolean algebra can be embedded in a Boolean algebra of the kind P(X).
Proof. The proof is easy for all the atomic Boolean algebras B: is this case it suces to take as
X the set of atoms belonging to B and state
B

P(X)
x a [ a x
trivially preserves , 1 and preserves , 0 by the denition of an atom; it is injective because
B is atomic.
3
So we only need to show that every Boolean algebra B can be embedded into an
atomic Boolean algebra, i.e. that for every B

B
x (x ,= 0 y (y x y ,= 0 z (z y z = 0 z = y))) T
is consistent, where T is the theory of Boolean algebras. By compactness, it suces to consider the
case in which B is nitely generated. But nitely generated Boolean algebras are nite and nite
Boolean algebras are trivially atomic (for every x ,= 0 exists a minimal y such that 0 < y x).
Proposition 2.2.3. Every Boolean algebra with 0 ,= 1 can be embedded into an atomless Boolean
algebra.
Proof. Given a Boolean algebra B
0
we build B
0
B
1
showing the consistency of

B
0
0 < c
a
< a [ a B
0
, a ,= 0 T (2.6)
where T is theory of Boolean algebras and the constants c
a
(one for every a B
0
, a ,= 0) are new
constants. Suppose that we have proved that the (2.6) is consistent. Repeating this procedure we
build a chain
B
0
B
1
B
1
B
i

Let B =

i
B
i
. Obviously B
0
can be embedded in B. Now B is atomless, because if b ,= 0 is an
element of B, it is also an element of B
i
for some i; but if this holds we get 0 < c
b
< b as an
element of B
i+1
, and thus as an element of B, showing that b is not minimal, hence not an atom.
The only thing we need to prove is the consistency of (2.6). By compactness it suces to
consider a nite subset of
B
0
of the kind

B
0 < c
a
< a [ a B

and a ,= 0 T (2.7)
1
Consult any textbook, for instance McLane-Birkho Algebra.
2
Useful information on Boolean alebras can be foound in the Appendix A below.
3
Remember that a morphism between Boolean algebras is injective when (x) = 0 for all x = 0.
22 Chapter 2. Diagrams and Embeddings
where B

B
0
is nite. We can now apply nite duality and consider a nite set X ,= , such that
B

P(X). Let f : X 0, 1 X be the rst projection. We have


B

P(X)
f
1
P(X 0, 1)
If S ,= 0, S X we have
f
1
(S) = (s, 0) [ s S (s, 1) [ s S
To show that (2.7) is consistent it then suces to interpret c
S
as (s, 0) [ s S.
Proposition 2.2.4. Every ordered eld can be elementarily embedded in a non-Archimedean eld.
Proof. Let C be an ordered eld, and lets prove the consistency of

e
C
n < c
n
where c is a new constant and n stands for the term 1 + + 1 (n-times). To prove consistency,
by compactness it is sucient to prove the consistency (for every n
1
, . . . , n
k
) of

e
C
n
1
< c, . . . , n
k
< c
but the latter consistency is obvious (just expand the structure C to interpret c as m
I
, where m
is any element such that m > n
1
, . . . , n
k
).
Notice that if C = R, then R can be embedded in a eld that contains elements which are
innitely big, and so (passing to inverses) also innitely small. The fact that the embedding is
elementary means that if we show an elementary property A (not involving innitesimals) using
the existence of innitesimals, we can in principle prove the property without using innitesimals,
and hence the property is true also in the standard structure. The extension of this result to
Henkin models of higher-order logics is more tricky, but viable, and it constitutes the foundations
of non-standard analysis.
2.3 Exercises
Exercise 2.3.1. Prove that every model of TO can be embedded into a model of TO

.
Exercise 2.3.2. Prove that if (P, ) is a partial order, it is possible to nd

such that
(i)

;
(ii) (P,

) is a total order.
Hint: Prove the result by induction for a nite P. Then, for the general case, apply the compact-
ness theorem to the set
TO a b [ a, b P are s.t. a is less or equal to b in (P, )
a ,= b [ a, b P are s.t. a is dierent from b
Exercise 2.3.3. Prove that a graph is k-colorable if and only if every nite subgraph of its is
k-colorable. Hint: here a graph is a structure (X, R) where R is a binary, irreexive and symmetric
relation. Express the k-colorability by elementary axioms in a language that contains, in addition
to R, k unary predicates C
1
, . . . , C
k
. Then use compactness theorem.
2.3. Exercises 23
Exercise 2.3.4. Prove that does not exist any sentence A belonging to the theory of elds C
such that
C A
has as models exactly the elds of charactestic zero (this means that the zero characteristic can
be expressed only with innitely many axioms). Hint: the existence of such A would mean that
C A p ,= 0 [ p is a prime number
is inconsistent, so...
Exercise 2.3.5. Prove that every model of the theory of arrays with extensionality can be em-
bedded into a functional model, i.e. a model / such that ARRAY
M
is the set of the functions
INDEX
M
ELEM
M
and rd
M
and wr
M
are the functional application and the update function.
Exercise 2.3.6. Prove that the theory of array with extensionality is not closed under substruc-
tures.
Exercise 2.3.7. Lets consider a two-sorted language (let the two sorts be ELEM and SETS) with
a predicate of type ELEMSETS. Find the axioms on such that every model of these axioms
can be embedded into a model / such that
SETS
M
= P
_
ELEM
M
_
and such that
M
is the membership relation.
24 Chapter 2. Diagrams and Embeddings
Chapter 3
Ultraproducts and Compactness
In this section we prove the Compactness Theorem. In order to do that, we introduce a funda-
mental construction in model theory, namely ultraproducts.
3.1 Ultralters for P(X)
We recall few facts concerning ultralters for sets of indices; these facts can be more generally
obtained in the context of Boolean algebras (see Appendix A for more and for the proofs).
Let I be a set; an ultralter over P(I) is a family | of subsets of I such that
(i) I |
(ii) / |
(iii) If S T and S | then T |
(iv) If S | and T | then S T |
(v) If S T | then S | or T |
Exercise 3.1.1. Prove the following immediate properties concerning an ultralter |:
for any S I, exactly one between S and I S belongs to |;
if S |, then for any T, we have T | if and only if T S |
if a I, |
a
= S [ a S is an ultralter (called the principal ultralter of a)
if I is nite, all the ultralters over P(I) are principal.
Unfortunately principal ultralters are not particularly useful for our purposes. In fact, our
main application of ultralters is the construction of ultraproducts of models; but with principal
ultralters, the ultraproducts result isomorphic to the models themselves. The following denition
introduces a property sucient to generate more interesting ultralters.
Denition 3.1.1. A family T of subsets of I has the nite intersection property if for each
S
1
, . . . , S
n
T it holds that S
1
. . . S
n
,= .
Exercise 3.1.2. Prove that the family of conite subsets of I (remember that S is conite if I S
is nite) has the nite intersection property.
Next result is proved with the help of Zorn lemma (see Appendix A):
Theorem 3.1.1. [Ultralter Theorem]
If a family T has the nite intersection property, then there is an ultralter | T.
Thus there are non principal ultralters and we are goimg to use precisely them.
25
26 Chapter 3. Ultraproducts and Compactness
3.2 Ultraproducts and Ultrapowers
Let /
i

iI
an innite set of /-structures, and let | be an ultralter of P(I). We are going to
introduce the /-structure

U
/
i
(3.1)
called the ultraproduct (with respect to |) of the /
i
.
The ultraproduct (3.1) is dened in this way: we rst introduce an equivalence relation over

i
A
i
a b i I [ a
i
= b
i
|
(here a and b are elements belonging to

i
A
i
and a
i
, b
i
are their i
th
coordinates). Notice that
a b and b c implies that a c because | is an ultralter. The structure

U
/
i
has

i
A
i
/
as support set.
For every symbol f T
n
, P T
n
we dene
J(f) ([a
1
], . . . , [a
n
]) =
_
(J
i
(f)(a
i
1
, . . . , a
i
n
))
i

([a
1
], . . . , [a
n
]) J(P)
_
i I [ (a
i
1
, . . . , a
i
n
) J
i
(P)
_
|
(3.2)
Here ([a
1
], . . . , [a
n
]) is a tuple whose elements are equivalence classes of innite tuples; for each
class, a representative is arbitrarily chosen, f is interpreted in the structures /
i
and applied on
the coordinates of the representatives to get a new innite tuple, of which we take the equivalence
class. To interpret an n-ary predicate P, we again take the representatives a
1
, . . . , a
n
of a tuple
of equivalence classes and wonder whether there are many indices i where the tuple of the i-th
coordinates belongs to the interpretation of P in /
i
.
Of course we must check that denitions (3.2) do not depend on the representatives chosen.
Indeed if a
1
b
1
, . . . , a
n
b
n
we have that there is a S | such that for all i S, a
i
1
=
b
i
1
, . . . , a
i
n
= b
i
n
(we can take the same S for all j = 1, . . . , n thanks to the nite intersection
property). For these i S we have
J
i
(f)(a
i
1
, . . . , a
i
n
) = J
i
(f)(b
i
1
, . . . , b
i
n
)
and thus
_
J
i
(f)(a
i
1
, . . . , a
i
n
)
_
i

_
J
i
(f)(b
i
1
, . . . , b
i
n
)
_
i
Moreover, for these i S will hold that
_
a
i
1
, . . . , a
i
n
_
J
i
(P)
_
b
i
1
, . . . , b
i
n
_
J
i
(P) (3.3)
Therefore, the set
T = i [
_
a
i
1
, . . . , a
i
n
_
J
i
(P)
is an element of | if and only if T S | and the set
T

= i [
_
b
i
1
, . . . , b
i
n
_
J
i
(P)
is an element of | if and only if T

S |. Applying (3.3) we get that T S = T

S and this
shows that denition (3.2) does not depend on representatives of equivalence classes.
If /
i
= / for all i I, the ultraproduct

U
/
is called ultrapower of / modulo |.
The fundamental theorem below states that every rst-order formula is true in an ultraproduct
if it is true in a big subset of the index structures; that is, if and only if the set of indexes for which
the formula is true is in the ultralter. In particular, an ultrapower is elementarily equivalent to
the original structure and it is indistinguishable from it from a rst-order logic perspective.
3.3. o theorem 27
3.3 o theorem
Theorem 3.3.1. [o fundamental theorem]
Let /
i
(i I) be /-structures. For every /-sentence A,

U
/
i
[= A i [ /
i
[= A |
In particular, if /
i
= / for all i, we get
/

U
/
for ultrapowers.
Proof. Let J be dened as in (3.2); we rst show by induction on terms t(x
1
, . . . , x
n
) that for
every n-tuple [a] := [a
1
], . . . , [a
n
] from the support of

U
/
i
we have
t([a
1
], . . . , [a
n
])
I
=
__
t(a
i
1
, . . . , a
i
n
)
I
i
_
i

.
This is certainly true if t is a constant of / or if it is the variable x
i
. If t = f(t
1
[a], . . . , t
n
[a]), we
have
t
I
= J(f)(t
1
[a]
I
, . . . , t
n
[a]
I
) = J(f)
___
t
1
(a
i
)
I
i
_
i

, . . . ,
__
t
n
(a
i
)
I
i
_
i
_
=
__
J(f)
_
t
1
(a
i
)
I
i
, . . . , t
n
(a
i
)
I
i
__
i

=
__
f(t
1
(a
i
), . . . , t
n
(a
i
))
I
i
_
i

=
__
t(a
i
)
I
i
_
i

Now we shall prove that for all formula A(x


1
, . . . , x
n
) and for every n-tuple [a] := [a
1
], . . . , [a
n
]
from the support of

U
/
i
, we have (the theorem thesis follows as special case for n = 0)

U
/
i
[= A([a]) i I [ /
i
[= A(a
i
) | (3.4)
If A is an atom, it is of the form P(t
1
[a], . . . , t
n
[a]) so

U
/
i
[= P(t
1
[a], . . . , t
n
[a]) if and only if
_
t
1
[a]
I
, . . . , t
n
[a]
I
_
J(P)
if and only if
___
t
1
(a
i
)
I
i
_
i

, . . . ,
__
t
n
(a
i
)
I
i
_
i
_
J(P)
if and only if
_
i J [
_
t
1
(a
i
)
I
i
, . . . , t
n
(a
i
)
I
i
_
J
i
(P)
_
|
if and only if
_
i J [ /
i
[= P(t
1
(a
i
), . . . , t
n
(a
i
))
_
|
Thus (3.4) holds for any atom A. Now we shall deal with the inductive cases: If A = A
1
A
2
then

U
/
i
[= A
1
([a]) A
2
([a]) i
_

U
/
i
[= A
1
([a]) and

U
/
i
[= A
2
([a])
_
i (i [ /
i
[= A
1
(a) | and i [ /
i
[= A
2
(a) |)
i i [ /
i
[= A
1
(a) A
2
(a) |
Here we have exploited the fact that given S, T J, (S | and T |) (S T |) holds
because | is a lter. If A is a negation or a disjunction, it can be proved in the same way exploiting
respectively the facts that S | (I S) / | and that (S | or T |) (S T |),
following from| being an ultralter. The only remaining case is when A has the formxB([a], x).
1
By induction,

U
/
i
[= xB([a], x)
1
The case with the universal quantier can be proved in the same way.
28 Chapter 3. Ultraproducts and Compactness
is equivalent to
there exists [b] such that

U
/
i
[= B([a], [b]) (3.5)
and to
there exists [b] such that i [ /
i
[= B(a
i
, b
i
) | (3.6)
We would like to conclude that this is equivalent to
_
i [ there exists b
i
A
i
such that /
i
[= B(a
i
, b
i
)
_
| (3.7)
that is to
_
i [ /
i
[= xB(a
i
, x)
_
| (3.8)
(3.6) (3.7) is obvious. (3.7) (3.6) can be proved in this way: from (3.7) we get that given
a certain S |, we are given also b
i
A
i
for i S. To obtain [b] we complete this list arbitrarily
(the structures are not empty)
2
on the indexes of I S.
The fundamental theorem, in the case of ultrapowers, yields an immediate example of an
elementary embedding: in fact, the above proof shows that the map from the support of / into
the support of

U
/
i
assiciating with a the constant function with value a is elementary. We
remark that the ultrapower is usually much larger than /. This does not happen if / is nite
or | is principal; in particular, if A is nite of cardinality n, the statement there are exactly n
elements will be true in / and thus in

U
/
i
. As for the non-elementary properties of /, their
preservation mainly depend on the choice of |.
o theorem is a result of great importance in model theory. In the next section we will see
how it can be exploited in order to prove the compactness theorem. Moreover, the last section of
this chapter will show that it can be used also to characterize elementary classes, i.e. to give a
necessary and sucient criterion to see whether a class of models can or cannot be specied by
using rst-order logic.
3.4 Compactness theorem
Theorem 3.4.1. [Compactness theorem]
Let be a set of sentences; if every nite
0
has a model, then has a model.
Proof. We take as the set of indexes I the set of all nite subsets of . By hypothesis, for all i I
there exists /
i
that is a model of all A i. For all A let

A = i [ A i, and lets consider
the lter over P(I) generated by

A [ A . This is a proper lter, in fact



A
1
. . .

A
n
is
never empty, since it contains at least A
1
, . . . , A
n
. Let | be an ultralter that extends it (the
ultralter theorem guarantees its existence): | will contain all

A. We can prove that

U
/
i
[=
exploiting Theorem 3.3.1. In order to establish if

U
/
i
[= A for an A , by the fundamental
theorem it is sucient to show that i [ /
i
[= A |. But

A | and

A i [ /
i
[= A: in fact,
if j

A then A j and thus /
j
[= A (because /
j
is a model for any formula belonging to j) and
j i [ /
i
[= A follows.
2
In standard textbooks, the denition of a structure requires the support to be not empty. In fact, this
assumption is never really needed; in our case too, a more elaborate denition of an ultraproduct would avoid the
restriction to nonempty supports.
3.5. Characterizing elementary classes 29
3.5 Characterizing elementary classes
A class K of /-structures is said to be elementary if it is the class of the models of an elementary
theory T (intended as a set of sentences).
Theorem 3.5.1. [Characterization of elementary classes]
A class K of models is elementary if and only if it is closed under ultraproducts and elementary
equivalence.
Proof. If K = / [ / [= for a given , then it is obvious that
(i) / K and / B = B K.
(ii) for all i, /
i
K =

U
/
i
K.
To show the converse, let K satisfy (i) and (ii), and let be the set of all sentences true in every
element of K. If / [= , we want to prove that / K. Let = Th(/); for all nite
0

there exists B

0
K such that B

0
[=
0
(otherwise we would have that (
_

0
) , in contrast
to / [= ). Following the same strategy used to prove the compactness theorem, taking I to be
the set of the nite subsets of , we build

U
B
i
[= , with B
i
K for all i. Since = Th(/),

U
B
i
/, and thus (using (i) and (ii)) / K.
The characterization theorem enables us to show that a certain property cannot be expressed by
a rst order formula: it is sucient to exhibit a class of structures that has the property, and an
ultraproduct or ultrapower for which the property instead does not hold.
The following theorem is a deep result by Keisler and Shelah:
Theorem 3.5.2. / and B are elementarily equivalent if and only if they have isomorphic ultra-
powers.
So we can improve Theorem 3.5.1 by saying that a class of models K is elementary if and
only if K is closed under isomorphisms, ultraproducts and the complementary class of K is closed
under ultrapowers.
Example 3.5.1. We build a non-standard model of real numbers via ultrapowers.
In the theory of real arithmetic T (this is the theory of closed real elds, namely Th(R, +, , 0, , 1))
there exist terms
1, 1 + 1, 1 + 1 + 1, . . .
to denote natural numbers. Since T [= !x(x n = 1), in every model of T there are unique
elements representing
1,
1
2
,
1
3
, . . .
Let us add their names to the language, for simplicity. An innitesimal in a / [= T is an
element of the support of / such that for every n
/ [= <
1
n
/ [= 0 <
In R there are not innitesimals, due to the Archimedean property (which is not elementary, as
a consequence of our argument below). Nevertheless, there are / R that admit innitesimals.
To build such a model, let I be the set of natural numbers greater than 0, let | be a non-principal
ultralter of I and let / :=

U
R. Consider (a
j
)
j
such that R [= 0 < a
j
< 1/i whenever
j > i. Since j [ j > i | (this is a conite set), we have / [= [(a
j
)] < 1/n for every n and
/ [= 0 < [(a
j
)]. Thus [(a
j
)] is innitesimal in

U
R.
Ultrapowers can be used to detect non-elementary properties.
30 Chapter 3. Ultraproducts and Compactness
Exercise 3.5.1. Let / be a language with two relations R and R

. Prove that the class of the


/ for which R

M
is the reexive and transitive closure of R
M
is not elementary. Hint: let /
i
,
i N be given by 0, . . . , i, while R
M
i
is the successor relation and R

M
i
is . Take

/
i
for
a non-principal ultralter | ...
Chapter 4
Further Topics
In this Chapter we investigate further selected classical results (Lwhenheim-Skolem theorems,
os-Vaught test, preservation theorems, etc.) giving interesting information about the power and
the limitations of rst order logic.
4.1 Cardinality of Models and Completeness of Theories
To establish that a theory is complete has a twofold goal. For example, the fact that the theory
of algebraically closed elds of 0 characteristic is complete yields an axiomatization of Th(C). In
general, if T is complete and / [= T then T = Th(/), that is T axiomatizes /. Moreover, if
T , besides being complete, has also decidable axioms, then T results itself decidable. In fact an
actual enumeration A
0
, . . . , A
i
, . . . of the logic consequences of T becomes a decision procedure
since we are sure that for each sentence A sooner or later we will nd A or A in the enumeration
(and the algorithm will terminate).
We will show a useful criterion (the os-Vaught test) to determine whether a theory is com-
plete). First we must investigate the topic of cardinality of models; the cardinality of a language /
(written [[/[[)
1
is, by denition, the cardinality of the set of /-formulae, that is the maximum be-
tween
0
and the cardinality of the sets T
n
and T
n
. If the signature is nite or countable, the
cardinality of the language will be countable; if the signature is uncountable, then the cardinality
of the signature will be the same as the cardinality of the language.
Lemma 4.1.1. Let / be a substructure of B; we have / B whenever it happens that for each
/
A
-sentence of kind xB(x, a
1
, . . . , a
n
)
B [= xB(x, a
1
, . . . , a
n
) there exists a A s.t. B [= B(a, a
1
, . . . , a
n
) (4.1)
Proof. It must be proved that for each /
A
-sentence A(a
1
, . . . , a
n
)
/ [= A(a
1
, . . . , a
n
) B [= A(a
1
, . . . , a
n
)
We already know that this property holds if A is atomic by the denition of a substructure. If A
is of kind A
1
A
2
, A
1
A
2
, A
1
it is sucient to apply the induction hypothesis; if A is of type
xB, one direction of the implication is obtained by induction hypothesis, the other one by (4.1)
and by the induction hypothesis. The universal quantier case is reducible to the existential one
(because x can be rewritten as x modulo logical equivalence).
The idea behind the Lwenheim-Skolem theorems is that if a theory has an innite model, then
the cardinality of the model can be increased (upward) or decreased (downward), also depending
on the cardinality of the language. For example, if the language has countable cardinality and there
1
We use the notation ||X|| to indicate also the cardinality of a set X (thus the notation |||| might be ambiguous,
but the context should clarify the right use).
31
32 Chapter 4. Further Topics
is an innite model, then we can obtain an elementarily equivalent model of any cardinality. This
means that rst order logic is not expressive enough to talk about cardinalities, and to distinguish
between innite cardinalities.
Theorem 4.1.1. [Downward Lwenheim-Skolem]
Let / be a /-structure and X A s.t. [[X[[ [[/[[. Then there exists a B / s.t. X B and
[[B[[ = [[X[[. Thus, every consistent /-theory T has a model of cardinality at most [[/[[.
Proof. Lets dene a chain of subsets X
0
, . . . , X
i
, . . . of A in the following way. X
0
is X. In order
to dene X
i+1
, we choose for each /
X
i
-sentence true in / of type xB(x, a
1
, . . . , a
n
) an a A
s.t. / [= B(a, a
1
, . . . , a
n
). X
i+1
will be the set of the chosen a (we have X X
i+1
considering
sentences of kind xx = c).
Let B =

X
i
; B is closed under the operations of /, since if f T
n
and a
1
, . . . , a
n
B, then
there exists an i s.t. a
1
, . . . , a
n
X
i
. Considering the sentence xf(a
1
, . . . , a
n
) = x we obtain
J(f)(a
1
, . . . , a
n
) X
i+1
B. By construction, the hypothesis of the previous lemma is satised,
thus B is the support of an elementary substructure B of /. Each X
i
has cardinality equal to that
of the set of /
X
i1
-formulae, hence it has cardinality equal to that of [[X[[. Thus [[B[[ = [[X[[
follows.
Notice that the choice axiom is used in the above proof.
Theorem 4.1.2. [Upward Lwenheim-Skolem]
Every innite /-structure / is an elementary substructure of a structure B of cardinality m, for
each m [[A[[, [[/[[. Thus, every /-theory T that has an innite model has innite models of
arbitrarily large cardinality.
2
Proof. Assume m [[A[[, [[/[[ as given. Lets introduce m new constants c
i
. The set of
sentences

e
A
c
i
,= c
j

i=j
has a model by compactness (in fact, since / is innite, every nite subset has a model, because
a nite subset involves only nitely many new constants). Let ( be that model; ( has cardinality
at least m by construction and by Robinson theorem / ( holds. It is then sucient to apply
the previous theorem to get an intermediate structure / B ( with [[B[[ = m.
The two theorems guarantee that, if T has an innite model, it has a model of cardinality
m for each m [[/[[, where / is the language of T . In particular, if / is countable, T has
a countable model. For instance, Zermelo set theory has a countable model. This only looks
paradoxical; quoting Shoeneld: Undoubtedly we can formalize in a countable theory a fraction
of mathematics that is large enough to prove that the set of real numbers is uncountable. How can
such a theory admit a countable model? The explanation is the following. The set of real numbers
in the model is countable, thus a one-to-one mapping between it and the set of natural numbers
exists. But this mapping does not belong to the model; so it cannot invalidate the theorem of the
theory which establishes that no one-to-one mapping exists between the sets of real and natural
numbers..
Denition 4.1.1. If m is a cardinal number, a theory is m-categorical if it has only one model
(up to isomorphism) of cardinality m.
Theorem 4.1.3. [os-Vaught test]
Let T be a consistent /-theory with only innite models. If T is m-categorical for some m [[/[[,
then T is complete.
2
Notice that this does not hold for nite models: a model with n elements cannot be elementarily equivalent
to a model with m > n elements, because having n elements is an elementary property.
4.2. Back-and-Forth Techniques 33
Proof. It is sucient to prove that every / [= T is elementarily equivalent to a substructure of
cardinality m, so that by transitivity / B follows for each pair /, B of models of T . If [[A[[ m,
we apply the upward Lwenheim-Skolem theorem. If m [[A[[, we consider X A of cardinality
m [[/[[ and apply the downward Lwenheim-Skolem theorem.
Notice that a theory can be decidable without being complete and viceversa; it can also being
complete without satisfying the os-Vaught test.
We will now illustrate some examples and applications of the os-Vaugth test.
Example 4.1.1. T
=

is complete since two countable sets are isomorphic in the language that
contains only the = symbol.
Example 4.1.2. The theory of vector spaces over an innite eld / with x x ,= 0 is complete.
Lets consider an arbitrary model / of the theory. It is determined by the cardinality of any basis
B, up to isomorphisms. The elements of / are all represented as /
B
-terms (each vector is as a
linear combination of the members of the basis), thus their cardinality is [[/
B
[[ = max([[/[[, [[B[[).
If [[A[[ > [[/[[, it must be [[A[[ = [[B[[. It follows that the theory is m-categorical for each
m > [[/[[: for such m, every model of cardinality m will have a basis of cardinality m and will be
unique up to isomorphism. Notice that for m < [[/[[ there are no models of cardinality m and for
m = [[/[[ there are as many models as the cardinal numbers less or equal to m. For example, if
/ = Q which is countable, there is a countable number of models, that is the vector spaces with
bases of cardinality 1, . . . ,
0
.
If / is nite, the theory of innite vector spaces over / is complete since m-categorical in all the
innite m (by the same reasoning as in the previous case).
Example 4.1.3. The theory of algebraically closed elds of xed characteristic is complete. Here
a model / in uniquely determined by the cardinality of its transcendence basis B on the prime eld
(this is either Q or Z
p
, depending on the characteristics). Since every element of / is algebraic
on B, the polynomials of /
B
are max(
0
, [[B[[), and each of them has only a nite number of
roots, it is clear that the cardinality of / is max(
0
, [[B[[). Then, the theory has a countable
number of countable models (those with a transcendence basis of cardinality 0, . . . ,
0
) and in
every uncountable power m it has a single model, with a transcendence basis of cardinality m.
4.2 Back-and-Forth Techniques
Lets continue with two examples where the application of the os-Vaugth test requires a slightly
more complex technique. We will show that TO

and the theory of atomless boolean algebras


are
0
-categorical, thus complete, since they do not have nite models; the technique we will
employ is known as back and forth. Given two countable models, we want to prove that they are
isomorphic. The idea is to build a chain of partial isomorphisms between nite substructures;
at each step one element from the rst structure and one from the second are added, increasing
the isomorphism until it is complete.
Lets start with TO

, the theory of dense total orders without endpoints. Notice that for such
theory the following holds:
Observation 4.2.1. Let /, B, ( be three models of TO, such that B, ( are nite and / is a
countable model of TO

. Suppose we have inclusions i, j of substructures; then there exists a


further embedding k : ( / s.t. k j = i
A
B
C
i j
k
34 Chapter 4. Further Topics
The reason is clear: B is a nite linear order and ( contains some new elements interleaved with
those of B, and TO

axioms allow to insert the correspondent elements in /.


c
1 b
1
c
2
c
3 b
2
c
4
Using 4.2.1, we can easily prove that TO

is
0
-categorical as follows. Let /, B be two
countable models of TO

, with A = a
1
, a
2
, . . . and B = b
1
, b
2
, . . .. For each i = 0, 1, . . . we
dene a nite substructure /
i
of /, a nite substructure B
i
of B and an isomorphism
i
: /
i

B
i
such that /
i
/
i+1
, B
i
B
i+1
,
i

i+1
. Let /
0
= a
1
, B
0
= b
1
,
0
: a
1
b
1
be the
trivial mapping. For the inductive step i we proceed as follows (if i is even, otherwise we swap
/ and B). Let a be the rst element of the enumeration of the elements belonging to A such
that a , A
i
. Let /
i+1
be the substructure generated by A
i
a. Using 4.2.1 there exists an
embedding k:
A
i+1 B
A
i
B
i
k

Hence we can take as B


i+1
the image of k and as
i+1
the restriction of k to its image. By
construction / =

i
/
i
, B =

i
B
i
and =

i
is an isomorphism.
As we can see, the proof depends on 4.2.1 and on the fact that nitely generated structures
are nite (in such a way that /
i
cannot consume all the elements of / which is countable
and in such a way that 4.2.1 can be always applicable). We now prove 4.2.1 for atomless Boolean
algebras, so to get the
0
-categoricity of the theory with the same argument.
Proposition 4.2.1. Observation 4.2.1 still holds in case we replace TO by the theory of Boolean
algebras and TO

by the theory of atomless Boolean algebras. As a consequence, the latter is


countably categorical and complete.
Proof. We use the nite duality (see Appendix A for details on nite duality).
To prove the Observation 4.2.1, x a contable atomless Boolean algebra /, two nite Boolean
algebras B, ( and two injective morphisms i, j
A
B
C
i
j
By nite duality we can suppose that B = P(X), ( = P(Y ), j = f
1
with f : Y X surjective.
Let m be big enough in such a way that every element belonging to X has less than m f-preimages.
Since / is countable, we can suppose that / =

i
/
i
with nite /
i
. We can also assume that /
0
is B and /
1
has an m-partition of every a /
0
, a ,= 0 (see exercice 4.2.1 below). It is enough to
prove that there exists an injective k such that
A
1
A
0
= B
C
i
j
k
4.3. An example of a Preservation Theorem 35
commutes. By nite duality, we have that /
1
P(Z) and i h
1
: /
0
/
1
with h : Z
X surjective. Thus, it is sucient to nd a surjective g such that
Z
X
Y
g
h f
commutes. Since in /
1
there is a m-partition of every a /
0
, a ,= 0, every element of X has
at least m-preimages in Z, more than it has in Y . But this means that it is easy to dene g as
required.
Notice that many times the completeness of theories cannot be established with simple instru-
ments linked to the s-Vaught test. An emblematic case is the theory of real closed elds, that
is complete but is not categorical in any power.
The following exercise states a property used in the above proof:
Exercise 4.2.1. Let y be an element of a Boolean algebra B. We say that x
1
, . . . , x
m
is a
partition of y if y =

i
x
i
and x
i
x
j
= 0 (for every i ,= j) and x
i
,= 0 (for all i). Show that in an
atomless Boolean algebra every y ,= 0 has a partition of m elements for all m 1.
4.3 An example of a Preservation Theorem
Preservation theorems relates the semantic behaviour of sentences to their syntactic shape. This
is an important chapter in model theory; we investigate below just a very simple result in the area
to give some avour of the techniques. More substantial results are summarized in Table 4.1 and
can be easily found in any model theory textbook.
A sentence is universal (resp. existential) i it is the universal (resp. the existential) closure
of a quantier-free formula (in the sense of Denition 1.1.5). A sentence is preserved under
substructures if, given two structures / and A such that A is a substructure of /,
/ [= implies A [=
Proposition 4.3.1. is preserved under substructures if and only if it is logically equivalent to
a universal sentence.
Proof. One implication is trivial. To prove the other one, suppose that is preserved under
substructures. Let
= universal [ [=
If we can prove that [= , then by compactness we obtain that
0
[= (for a nite
0
,
0
)
and thus
[=

0
yieldying the claim.
Let / [= and lets prove that / [= . Consider
A
: if this is consistent, by the diagram
lemma, there is / such that we have / / [= , and thus / [= . If it is not consistent, by
compactness, it exists a quantier-free S(a) such that / [= S(a) and [= S(a). From this fact,
since the a are names for elements from the support of / and hence do not occur in , it follows
that [= xS(x) and thus xS(x) , against the fact that / [= .
Exercise 4.3.1. Prove that a theory T is preserved by substructures (i.e. / [= T and A [= /
implies A [= T) if and only if it can be axiomatized with universal sentences.
Exercise 4.3.2. Formulate and prove the analogous of Proposition 4.3.1 for existential sentences.
36 Chapter 4. Further Topics
Axioms Preservation under...
Universal Substructures
Existential Super-structures

0
2
(i.e.

) Union of chains
Positive (, , , ) Surjective homomorphisms
Equations (in functional languages) products + substructures + quotients
Table 4.1: Some preservation results.
4.4 Satisability of Clauses
We report here the proof of the Herbrand Theorem, that was mentioned in another part of the
course.
Let (x
1
, . . . , x
n
) be a clause;
3
a ground instance of is a ground clause of the kind (t
1
, . . . , t
n
),
where t
1
, . . . , t
n
are ground terms.
Theorem 4.4.1. Let be a set of clauses; then is inconsistent (i.e. the set of universal closures
of formulae from does not have a model) i there is a nite set
0
of ground instances of clauses
from that does not have a model.
Proof. By compactness, it is sucient to show that the consistency of the set

formed by all
ground instances of clauses from implies the consistency of itself. Let / be a model of

;
since truth of ground formulae is preserved by passing to substructures, we may assume that
the support of / contains precisely the set of all t
M
, varying t among the ground terms of the
language (in fact, the set of the t
M
- for ground t - is always a substructure of any /). Pick
any clause (x) ; we show that / [= , i.e. that for every a in the support of /, we have
/ [= (a) (recall 1.1). But the tuples of elements from the support of / are precisely the tuples
of the interpretations of the ground terms, hence we have a = t
M
for some ground t and / [= (t)
follows from the fact that / is a model of

.
We mention that the above statement of Herbrand theorem can be (non trivially) modied
so that it applies to formulae which are not clauses and not even universal sentences. There are
also constructive, proof-theoretic proofs of the theorem. For computational logic applications,
a reduction to propositional satisability must accompany the statement of the theorem. This
reduction is explicitly stated in the exercise below.
Exercise 4.4.1. A propositional abstraction is an injective map associating a propositional letter
p
A
to ground atomic formulae A. The propositional abstraction of a ground clause A
1
A
n

B
1
B
m
is p
A
1
p
A
n
p
B
1
p
B
m
; the propositional abstraction of a set of ground
clauses is the set of propositional abstractions of its members. Prove that if is a set of clauses in
which the identity symbol does not occur, then is inconsistent i there is a nite set
0
of ground
instances of clauses from whose propositional abstraction is not satisable (here satisability is
intended in the sense of truth tables). Hint: to build a structure / = (A, J) out of a propositional
assignment V to the p
A
s, use the set of ground terms (the Herbrand universe) as A. Then dene
J so that t
I
= t holds for all ground t and so that / [= A i V (p
A
) = 1 holds for all ground atoms
A.
3
We restrict to clauses in this section, because we have in mind computational logic applications. However, one
may easily adapt the arguments to quantier-free formulae.
Appendix A
Complements on Boolean Algebras
Since many exercises and examples refer to Boolean algebras, we supply basic information here.
A.1 Denition and Examples
Denition A.1.1. [Boolean algebra]
A Boolean algebra B = (X, ., , _

, 1, 0) is a complemented distributive lattice.


Thus the language of the theory of Boolean algebras has two constants 0, 1, one unary function
symbol (_)

and two binary function symbols , ..


1
A (quite redundant, indeed) axiomatization
is the following (where we put x y i x y = x):
x x
x y y z x z
x y y x x = y
z x y (z x z y)
x . y z (x z y z)
x 1
0 x
x . (y z) = (x . y) (x . z)
x (y . z) = (x y) . (x z)
x . x

= 1
x x

= 0
We mention that there are alternative, purely equational, axiomatizations.
Example A.1.1. The most typical example of Boolean algebra is the powerset P(X), where X is
a set, and . are the set-theoretic intersection and union operations and the function (_)

yields
the complement of a set w.r.t. X; X itself represents 1, while 0 is . The relation is interpreted
as .
1
We did not keep a uniform notation in these notes, so that sometimes the join () and meet () operations
are indicated with and , respectively.
37
38 Appendix A. Complements on Boolean Algebras
Example A.1.2. Another example is the sub-algebra of P(X) given by
P
fc
(X) = C X [ C is nite or X C is nite
This is called the Boolean algebra of nite and conite subsets of X.
Boolean algebras are important also for studying theories. If T is a theory, we dene /
n
(T) in
the following way: we take the formulas of the kind A(x
1
, . . . , x
n
) and put
A B i T [= A B
(recall that A B is dened as (A B) (B A)). We obtain a Boolean algebra dening all
operations on the representatives, i.e.
[A] [B] = [A B]
[A] . [B] = [A B]
1 = []
0 = []
[A]

= [A]
It turns out that [A] [B] T [= A B. There exist important connections between the
Boolean structure of /
n
(T) and the properties of models of T (e.g., under weak hypotheses, the
niteness of /
n
(T) corresponds to the fact that T has only one countable model).
A.2 Atoms and Finite Duality
Proposition A.2.1. The following conditions are equivalent for a nonzero element a in a Boolean
algebra B:
(i) for all x B, a x or a x

;
(ii) for all x, y B, a x . y a x or a y;
(iii) a is <-minimal among nonzero elements of B.
Proof. Exercise.
Nonzero elements a satisfying the equivalent conditions (i)-(iii) above are called atoms. A
Boolean algebra B is said to be atomic whenever for every x B, x ,= 0, there is an atom a x.
At the opposite extreme, it is said to be atomless i it does not have atoms.
The theory of innite atomic Boolean algebras and of atomless Boolean algebras are both
complete.
Exercise A.2.1. The Boolean algebras P(X) and P
fc
(X) are atomic, their atoms are the sin-
gleton subsets.
Exercise A.2.2. Show that an example of Boolean algebra without atoms can be obtained by
considering /
1
(T) where T = is the theory without axioms build over a language with innitely
many unary predicates.
The content of the following exercises is used in the present notes.
Exercise A.2.3. Prove that given a nite Boolean algebra B, we have B P(X), where X is
the set of the atoms of B.
Exercise A.2.4. If X
f
Y is a function, the inverse image f
1
: P(Y ) P(X) is a morphism
between Boolean algebras. Prove that:
A.3. Ultralters and Stone Representation 39
(i) f is injective f
1
is surjective;
(ii) f is surjective f
1
is injective.
Exercise A.2.5. If X and Y are nite sets, every Boolean morphism
: P(Y ) P(X)
is of the kind f
1
for only one f : X Y .
Readers knowing a little about category theory may take inspiration from the previous exercises
in order to prove the full nite duality theorem, stating that the category of nite Boolean algebras
is equivalent to the opposite of the category of nite sets.
A.3 Ultralters and Stone Representation
We have seen that all nite Boolean algebras are of the kind P(X) for a set X. This is not true
anymore for innite Boolean algebras: in fact, all algebras of the kind P(X) are atomic, whereas
we have seen in Proposition 2.2.3 that there exist atomless Boolean algebras.
A representation theorem holds in general case, though. This is Stone Representation Theorem,
a fundamental result in the theory of Boolean algebras. This theorem forms the subject of the
present section.
Denition A.3.1. [Filters]
A lter of a Boolean algebra B is a subset T B s.t.:
(i) 1 T
(ii) a T and a b b T
(iii) a T and b T a b T
The lter is said to be proper whenever 0 / T. A maximal proper lter is called ultralter.
Example A.3.1. In P(X) and P
fc
(X), given a X, we have that S [ a S is an ultralter,
called the principal ultralter generated by a.
Example A.3.2. More in general, if a is an atom of a Boolean algebra B, |
a
= b [ a b is an
ultralter of B. Ultralters like |
a
are called isolated; if | is isolated and a | is an atom, then
we say that a isolates |.
Example A.3.3. ( = S [ X S is nite is an ultralter of P
fc
(X) for any innite X (actually
it is the only non principal ultralter of P
fc
(X)); however in P(X) this is only a proper lter, not
being maximal. ( is called the lter of conite subsets. Every ultralter of P(X) either extends
( or is principal.
Exercise A.3.1. Verify that the following three conditions on a proper lter T are equivalent:
1. T is maximal among proper lters, i.e. it is an ultralter;
2. T contains exactly one between a and a

, for each a B;
3. for each a, b B we have a b T (a T or b T).
The ultralter theorem below is of great importance; we will prove it by using the choice axiom,
in the equivalent form of the following:
Lemma A.3.1. [Zorns Lemma] Suppose a non empty partially ordered set S has the property
that every chain (i.e. every totally ordered subset) has an upper bound in S. Then the set S
contains a maximal element.
40 Appendix A. Complements on Boolean Algebras
Denition A.3.2. A subset o of B has the nite intersection property if for each a
1
, . . . , a
n
o
it holds that a
1
. . . a
n
,= 0.
Theorem A.3.1. [Ultralter Theorem] Every subset o of B having the nite intersection
property can be extended to an ultralter.
Proof. Consider rst
F := b B [ there are a
1
, . . . , a
n
o s.t. a
1
a
n
b .
It is easily seen that F is a lter (actually it is the smallest lter containing o) and because of the
nite intersection property, F is proper. We now apply Zorns lemma to the set S of the proper
lters extending F. It is sucient to show that if F
i

iI
is a chain in S, then

iF
F
i
S. But
the conditions (i), (ii) and (iii) can be easily veried for

i
F
i
. For example, if a, b

i
F
i
, then
there is a j such that a, b F
j
(because F
i

i
is a chain), thus a b F
j
and so a b

i
F
i
.
Thus

i
F
i
is a lter, and it is a proper lter because all F
i
are proper lters.
Exercise A.3.2. Prove Stones theorem (Proposition 2.2.2) using the ultralter theorem. Hint:
let X be the set of ultralters of B. Dene B

P(X) with (x) = | [ x |.
Exercise A.3.3. A Stone space is a compact Haussdor space having a base formed by sets which
are clopen (i.e. both closed and open). Show that the set of ultralters of B can be turned into
a Stone space by taking as a base the sets which are in the image of the morphism of Exercise
A.3.2.
The last two exercises are the ingredients needed to prove an extension of the nite duality
theorem to arbitrary Boolean algebras. This is Stone duality theorem, saying that the category of
Boolean algebras is equivalent to the opposite of the category of Stone spaces and continuous maps.

Вам также может понравиться