Hilber Proof Systems
Hilber Proof Systems
Hilber Proof Systems
ese are lecture notes for an introductory course on logic aimed at graduate students
in Computer Science. e notes cover techniques and results from propositional logic,
modal logic, propositional dynamic logic and first-order logic. e notes are based on
a course taught to first year PhD students at SPIC Mathematical Institute, Madras,
during August–December, .
Contents
Propositional Logic
. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Axiomatisations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Maximal Consistent Sets and Completeness . . . . . . . . . . . . . . . . .
. Compactness and Strong Completeness . . . . . . . . . . . . . . . . . . .
Modal Logic
. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Correspondence eory . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Axiomatising valid formulas . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Bisimulations and expressiveness . . . . . . . . . . . . . . . . . . . . . . . .
. Decidability: Filtrations and the finite model property . . . . . . . . . .
. Labelled transition systems and multi-modal logic . . . . . . . . . . . . .
Dynamic Logic
. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Axiomatising valid formulas . . . . . . . . . . . . . . . . . . . . . . . . . . .
First-Order Logic
. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Formalisations in first-order logic . . . . . . . . . . . . . . . . . . . . . . .
. Satisfiability: Henkin’s reduction to propositional logic . . . . . . . . . .
. Compactness and the Löwenheim-Skolem eorem . . . . . . . . . . . .
. A Complete Axiomatisation . . . . . . . . . . . . . . . . . . . . . . . . . . .
CONTENTS
Propositional Logic
. Syntax
We begin with a countably infinite set of atomic propositions P = { p0 , p1 , . . .} and
two logical connectives ¬ (read as not) and ∨ (read as or).
e set Φ of formulas of propositional logic is the smallest set satisfying the fol-
lowing conditions:
• If α is a member of Φ, so is (¬α).
We shall normally omit parentheses unless we need to explicitly clarify the structure of
a formula. We follow the convention that ¬ binds more tightly than ∨. For instance,
¬α ∨ β stands for ((¬α) ∨ β).
e fact that Φ is the smallest set satisfying this inductive definition provides us
with the principle of structural induction.
• If α is a member of S, so is (¬α).
. Semantics
en, Φ ⊆ S.
. Semantics
To assign meaning to formulas, we begin by assigning meaning to the atomic proposi-
tions. Let ⊤ denote the truth value true and ⊥ the truth value false.
b p) = v( p).
• For p ∈ P , v(
¨
b
⊤ if v(β) =⊥
b =
• For α of the form ¬β, v(α)
⊥ otherwise
¨
b
⊥ if v(β) b )=⊥
= v(γ
b =
• For α of the form β ∨ γ , v(α)
⊤ otherwise
Exercise .. We saw that every subset of P defines a valuation v. Does every subset
of Φ define an extended valuation Vb ? ⊣
def
α ∧ β = ¬(¬α ∨ ¬β)
def
α ⊃ β = ¬α ∨ β
def
α ≡ β = (α ⊃ β) ∧ (β ⊃ α)
Exercise .. Express v(α∧β), v(α ⊃ β) and v(α ≡ β) in terms of v(α) and v(β).
⊣
Exercise .. According to the Pigeonhole Principle, if we try to place n+1 pigeons
in n pigeonholes, then at least one pigeonhole must have two or more pigeons. For
i ∈ {1, 2, . . . , n+1} and j ∈ {1, 2, . . . , n}, let the atomic proposition pi j denote that
the i th pigeon is placed in the the j th pigeonhole. Write down a formula expressing
the Pigeonhole Principle. What is the length of your formula as a function of n? ⊣
In principle, testing the validity of a formula α involves checking its truth value
across an uncountable number of valuations. However, it is sufficient to look at the
effect of valuations on the atomic propositions mentioned in α.
Let us define Voc(α), the vocabulary of α, as follows:
is justifies the familiar algorithm for testing validity: build a truth-table for the
propositions mentioned in α and check if all rows yield the value ⊤.
. Axiomatisations
ough we have a straightforward algorithm for testing validity of formulas in propo-
sitional logic, such algorithms do not exist for more complicated logical systems. In
particular, there is no such algorithm for first-order logic.
However, it is still possible to effectively enumerate all the valid formulas of first-
order logic. One way of presenting such an enumeration is through an axiomatisation
of the logic. To prepare the ground for studying axiomatisations of more complex
logics, we begin with an axiomatisation for propositional logic.
Axiom System AX e axiom system AX consists of three axioms and one inference
rule.
(A) α ⊃ (β ⊃ α)
(A) (α ⊃ (β ⊃ γ )) ⊃ ((α ⊃ β) ⊃ (α ⊃ γ ))
(A) (¬β ⊃ ¬α) ⊃ ((¬β ⊃ α) ⊃ β)
α, α ⊃ β
(Modus Ponens, or MP)
β
• βn = α
• For each i ∈ {1, 2, . . . , n}, βi is either an instance of one of the axioms (A)–(A),
or is obtained by applying the rule (MP) to formulas β j , βk , where j , k <
i —that is, βk is of the form β j ⊃ βi .
We write ⊢AX α to denote that α is derivable using the axiom system AX and say that
α is a thesis of the system. We will normally omit the subscript AX.
e main technical result we would like to establish is that the set of formulas
derivable using AX is precisely the set of valid formulas of propositional logic.
eorem .. For all formulas α, ⊢ α iff ⊨ α.
We break up the proof of this theorem into two parts. e first half is to show that
every thesis of AX is valid. is establishes the soundness of the axiom system,
Lemma .. (Soundness) For all formulas α, if ⊢ α then ⊨ α.
e other half of eorem .. is more difficult to establish. We have to argue that
every valid formula is derivable. Formally, this would show that our axiomatisation is
complete.
We follow the approach of the logician Leon Henkin and attack the problem in-
directly. Consider the contrapositive of the statement we want to prove—that is, if a
formula α is not a thesis, then it is not valid.
Exercise ..
(i) Show that α ∨ β is consistent iff either α is consistent or β is consistent.
(ii) Show that if α∧β is consistent then both α and β are consistent. Is the converse
true?
• X0 = X
¨
Xi ∪ {αi } if Xi ∪ {αi } is consistent
• For i ≥ 0, Xi +1 =
Xi otherwise
Maximal consistent sets have a rich structure which we shall exploit to prove com-
pleteness.
We postpone the proof of these properties and first show how they lead to com-
pleteness.
Maximal consistent sets and valuations Let X be an MCS. Define the valuation vX to
be the set { p ∈ P | p ∈ X }—in other words, vX ( p) = ⊤ iff p ∈ X .
us, every MCS X defines a canonical valuation vX which satisfies precisely those
formulas that belong to X . (Conversely, every valuation also defines an MCS in a
canonical way: given a valuation v, Xv = {α | v ⊨ α}. It is not difficult to establish
that the valuation vXv generated by Xv is exactly the same as v.)
. Compactness and Strong Completeness
(ii) e proof of the second part follows in a similar manner, assuming the deriv-
ability of appropriate formulas. We omit the details. ⊣
which satisfy certain properties. One way of restricting the class of valuations under
consideration is to specify a set of formulas X and only look at those valuations where
X is true. If α is true wherever the formulas from X are true, then α is a logical
consequence of X .
It is possible to prove this directly using a technique similar to the one used to
prove the soundness and completeness of AX (see Exercise ..). However, we will
prove it indirectly using two auxiliary results which are of independent interest—the
Deduction eorem and the Compactness eorem.
We begin with the Deduction eorem, which is a statement about derivability.
eorem .. (Deduction) Let X ⊆ Φ and α, β ∈ Φ. en, X ∪ {α} ⊢ β iff X ⊢
α ⊃ β.
Lemma .. (König) Let T be a finitely branching tree—that is, every node has a finite
number of children (though this number may be unbounded). If T has infinitely many
nodes, then T has an infinite path.
P Let T be a finitely branching tree with infinitely many nodes. Call a node x
in T bad if the subtree rooted at x has infinitely many nodes. Clearly, if a node x is
bad, at least one of its children must be bad: x has only finitely many children and if
all of them were good, the subtree rooted at x would be finite.
We now construct an infinite path x0 x1 x2 . . . in T . Since T has an infinite number
of nodes, the root of T is a bad node. Let x0 be the root of T . It has at least one bad
successor. Pick one of the bad successors of x0 and designate it x1 . Pick one of the bad
successors of x1 and designate it x2 , and so on. ⊣
;.
p1 7→ ⊤ p1 7→ ⊥
p1 7→ ⊤ p1 7→ ⊤ p1 7→ ⊥ p1 7→ ⊥
p2 7→ ⊤ p2 7→ ⊥ p2 7→ ⊤ p2 7→ ⊥
··· ··· ··· ···
We shall first prove the following related result. Let X be a set of formulas. We
say that X is satisfiable if there exists a valuation v such that v ⊨ X .
(iii) Every maximal FSS X generates a valuation vX such that for every formula α,
vX ⊨ α iff α ∈ X .
(iv) Any FSS X is simultaneously satisfiable (that is, for any FSS X , there exists vX
such that vX ⊨ X ).
. Compactness and Strong Completeness
(v) For all X and all α, X ⊨ α iff there exists Y ⊆fin X such that Y ⊨ α. ⊣
(ii) Every consistent set X can be extended to a maximal consistent set (MCS).
(iii) Every MCS X generates a valuation vX such that for all formulas α, vX ⊨ α iff
α ∈ X.
(iv) Every consistent set X is satisfiable: that is, there exists a valuation vX such that
vX ⊨ X .
Modal Logic
. Syntax
As in propositional logic, we begin with a countably infinite set of atomic propositions
P = { p0 , p1 , . . .} and two logical connectives ¬ (read as not) and ∨ (read as or). We
add a unary modality □ (read as box).
e set Φ of formulas of modal logic is the smallest set satisfying the following:
• If α is a member of Φ, so is (¬α).
• If α is a member of Φ, so is (□α).
. Semantics
Frames A frame is a structure F = (W , R), where W is a set of possible worlds and
R ⊆ W × W is the accessibility relation. If w R w ′ , we say that w ′ is an R-neighbour
of w.
In more familiar terms, a frame is just a directed graph over the set of nodes W . We
do not make any assumptions about the set W —not even the fact that it is countable.
Satisfiability and validity As usual, we say that α is satisfiable if there exists a frame F =
(W , R) and a model M = (F ,V ) such that M , w ⊨ α for some w ∈ W . e formula
α is valid, written ⊨ α, if for every frame F = (W , R), for every model M = (F ,V )
and for every w ∈ W , M , w ⊨ α.
(iii) Suppose that α is valid. en, □α must also be valid. Consider any model
M = ((W , R),V ) and any w ∈ W . To check that M , w ⊨ □α we have to
verify that every R-neighbour of w satisfies α. Since α is valid, M , w ′ ⊨ α for
all w ′ ∈ W . So, every R-neighbour of w does satisfy α and M , w ⊨ □α.
Exercise .. e argument given in part (i) of Exercise applies only to non-modal
instances of propositional tautologies—for instance, the explanation does not justify
the validity of the formula □α ∨ ¬□α. Show that all substitution instances of propo-
sitional tautologies are valid formulas in modal logic. ⊣
Later in this section we will describe a sound and complete axiomatisation for
modal logic. is will give us an effective way of enumerating all valid formulas. After
that, we will encounter a technique by which we can bound the size of the underlying
frame required to satisfy a formula α. But, we first examine an aspect of modal logic
which does not have any counterpart in propositional logic.
P We first show that every reflexive frame belongs to C□α⊃α . Let M = ((W , R),V )
be a model where R is reflexive. Consider any world w ∈ W . Suppose that M , w ⊨
□α. We have to show that M , w ⊨ α as well. Since M , w ⊨ □α, every R-neighbour
of w satisfies α. But R is reflexive, so w is an R-neighbour of itself. Hence, M , w ⊨ α.
Conversely, we show that every non-reflexive frame does not belong to C□α⊃α . Let
F = (W , R) be a frame where for some w ∈ W , it is not the case that w R w. Choose
a proposition p and define a valuation V as follows: V (w) = ; and V (w ′ ) = { p} for
all w ′ ̸= w. Clearly, (F ,V ), w ⊨ □ p but (F ,V ), w ⊭ p. Hence w fails to satisfy the
substitution instance □ p ⊃ p of the formula □α ⊃ α. ⊣
. Correspondence Theory
P We first show that every transitive frame belongs to C□α⊃□□α . Let M =
((W , R),V ) be a model where R is transitive. Consider any world w ∈ W . Sup-
pose that M , w ⊨ □α. We have to show that M , w ⊨ □□α as well.
For this, we have to show that every R-neighbour w ′ of w satisfies □α. Consider
any R-neighbour w ′ of w. If w ′ has no R-neighbours, then it is trivially the case that
M , w ′ ⊨ □α. On the other hand, if w ′ has R-neighbours, then we must show that
each R-neighbour of w ′ satisfies α. Let w ′′ be an R-neighbour of w ′ . Since w R w ′
and w ′ R w ′′ , by transitivity w ′′ is also an R-neighbour of w. Since we assumed that
M , w ⊨ □α, it must be the case that M , w ′′ ⊨ α, as required.
Conversely, we show that every non-transitive frame does not belong to C□α⊃□□α .
Let F = (W , R) be a frame where for some w, w ′ , w ′′ ∈ W , w R w ′ and w ′ R w ′′
but it is not the case that that w R w ′′ . Choose a proposition p and define a valuation
V as follows: ¨
{ p} if w R wb
b =
V (w)
; otherwise
Since w ′′ is not an R-neighbour of w, V (w ′′ ) = ;. is means that M , w ′ ⊭ □ p, for
w ′′ is an R-neighbour of w ′ and M , w ′′ ⊭ p. erefore, M , w ⊭ □□ p, since w ′ is an
R-neighbour of w. On the other hand, M , w ⊨ □ p by the definition of V . Hence,
M , w ⊭ □ p ⊃ □□ p, which is an instance of □α ⊃ □□α. ⊣
e characteristic formula for transitivity can dually be written ◊◊α ⊃ ◊α. is form
represents transitivity more intuitively—the formula says that if w R w ′ R w ′′ and w ′′
satisfies α, there exists an R-neighbour wb of w satisfying α. If R is transitive, w ′′ is a
natural candidate for w. b Similarly, α ⊃ ◊α is the dual (and more appealing) form of
the characteristic formula for reflexivity. We have used the □ forms of these formulas
because they are more standard in the literature.
P We first show that every symmetric frame belongs to Cα⊃□◊α . Let M =
((W , R),V ) be a model where R is symmetric. Consider any world w ∈ W . Sup-
pose that M , w ⊨ α. We have to show that M , w ⊨ □◊α as well.
For this, we have to show that every R-neighbour w ′ of w satisfies ◊α. Consider
any R-neighbour w ′ of w. Since R is symmetric, w is an R-neighbour of w ′ . We
assumed that M , w ⊨ α so M , w ′ ⊨ ◊α, as required.
. Correspondence Theory
. w′ w ′′
Conversely, we show that every non-symmetric frame does not belong to Cα⊃□◊α .
Let F = (W , R) be a frame where for some w, w ′ ∈ W , w R w ′ but it is not the case
that that w ′ R w. Choose a proposition p and define a valuation V as follows:
¨
; if w ′ R wb
b =
V (w)
{ p} otherwise
P We first show that every Euclidean frame belongs to C◊α⊃□◊α . Let M =
((W , R),V ) be a model where R is Euclidean. Consider any world w ∈ W . Suppose
that M , w ⊨ ◊α. We have to show that M , w ⊨ □◊α as well.
Let w ′ be an R-neighbour of w. We must show that M , w ′ ⊨ ◊α. Since M , w ⊨
◊α, there must exist wα such that w R wα and M , wα ⊨ α. Since R is Euclidean,
w ′ R wα as well, so M , w ′ ⊨ ◊α as required.
Conversely, we show that every non-Euclidean frame does not belong to C◊α⊃□◊α .
Let F = (W , R) be a frame where for some w, w ′ , w ′′ ∈ W , w R w ′ and w R w ′′ but
one of w ′ R w ′′ and w ′′ R w ′ fails to hold. Without loss of generality, assume that it
is not the case that w ′′ R w ′ .
. Correspondence Theory
Notice that if R is Euclidean, for all w ′ , if there exists w such that w R w ′ , then
w ′ R w ′ . It is not difficult to verify that if R is reflexive and Euclidean then R is in
fact an equivalence relation. On the other hand, if R is symmetric and transitive then
it is also Euclidean.
A frame (W , R) is said to be converse well-founded if for all nonempty subsets X
of W , there exists a maximal element x of X , i.e. x is in X and for all y in X , it is not
the case that x R y.
P We first show that every transitive and converse well-founded frame is a model
of □(□α ⊃ α) ⊃ □α, i.e., it belongs to C□(□α⊃α)⊃□α . Let M = ((W , R),V ) be a
model where R is transitive and converse well-founded. Consider any world w ∈ W .
Suppose that M , w ⊨ □(□α ⊃ α). We have to show that M , w ⊨ □α as well.
For this, we have to show that every R-neighbour w ′ of w satisfies α. Consider
any R-neighbour w ′ of w. Since w satisfies □(□α ⊃ α), w ′ satisfies □α ⊃ α. us,
to show that every R-neighbour w ′ of w satisfies α it suffices to show that w ′ satisfies
□α.
Consider the set X of worlds x such that w R x. Since R is transitive, whenever
x is an element of X and x R y, we also have w R y and hence y is in X . A path
in W is any finite sequence ρ = w0 , w1 , . . . , wn of worlds (n ≥ 0) such that for all
i : 0 < i ≤ n, wi R wi+1 . e length of such a path, denoted len(ρ), is defined to be
n. A path ρ = w0 , w1 , . . . , wn is said to be an x-path (for x ∈ W ) if x = w0 . For any
node x ∈ W , define the height of x, denoted ht(x) to be sup{len(ρ) | ρ is an x-path}.
e height of a given world is in general an ordinal. But the following useful property
holds: whenever x R y then ht(y) < ht(x).
For all x ∈ X , we prove by transfinite induction on ht(x) that x satisfies □α (and
hence α). e base case is when ht(x) is 0, which means that there is no y ∈ W such
that x R y. But then x vacuously satisfies □α. For the induction step, consider an
arbitrary world x in X . For all y ∈ W such that x R y, y ∈ X and ht(y) is strictly less
than ht(x). erefore by the induction hypothesis every R-neighbour y of x satisfies
□α (and hence α), and hence x satisfies □α (and hence α).
us every R-neighbour w ′ of w satisfies α, and hence w satisfies □α.
. Correspondence Theory
Exercise .. What classes of frames are characterised by the following formulas?
(i) ◊α ⊃ □α.
(ii) ◊α ⊃ ◊◊α.
(iii) α ⊃ □α. ⊣
Are there natural classes of frames which cannot be characterised in modal logic?
We will see later that irreflexive frames form one such class. But first, we return to the
notions of satisfiability and validity and look for a completeness result.
. Axiomatising valid formulas
Axiom System K
Axioms
(A) All tautologies of propositional logic.
(K) □(α ⊃ β) ⊃ (□α ⊃ □β).
Inference Rules
α, α ⊃ β α
(MP) (G) □α
β
e axiom (A) is an abbreviation for any set of axioms which are sound and com-
plete for Propositional Logic—in particular, we could instantiate (A) with the axioms
(A)–(A) of the system AX discussed in the previous section.
As usual, we say that α is a thesis of System K ³, denoted ⊢K α, if we can derive
α using the axioms (A) and (K) and the inference rules (MP) and (G). Once again,
we will omit the subscript and write ⊢ α if there is no confusion about which axiom
system we are referring to.
³e name K is derived from Saul Kripke.
. Axiomatising valid formulas
e canonical model
When we studied propositional logic, we saw that each maximal consistent set defines a
“propositional world”. In modal logic, we have to construct frames with many propo-
sitional worlds. In fact, we generate a frame with all possible worlds, with a suitable
accessibility relation.
Canonical model e canonical frame for System K is the pair FK = (WK , RK ) where:
• WK = {X | X is an MCS}.
e canonical model for System K is given by MK = (FK ,VK ) where for each
X ∈ WK , VK (X ) = X ∩ P .
Exercise .. We can dually define RK using the modality ◊ rather than □. Verify
that X RK Y iff {◊α | α ∈ Y } ⊆ X . ⊣
Reflexive frames
System T is the set of axioms obtained by adding the following axiom scheme to Sys-
tem K.
(T) □α ⊃ α
Lemma .. System T is sound and complete with respect to the class of reflexive frames.
P To show that System T is sound with respect to reflexive frames, we only need
to verify that the new axiom (T) is sound for this class of frames—the other axioms
and rules from System K continue to be sound. e soundness of axiom (T) follows
from Proposition ...
To show completeness, we must argue that every formula which is consistent with
respect to System T can be satisfied in a model based on a reflexive frame. To es-
tablish this, we follow the proof of completeness for System K and build a canonical
model MT = ((WT , RT ),VT ) for System T which satisfies the property described in
Lemma ... We just need to verify that the resulting frame (WT , RT ) is reflexive.
For any MCS X , we need to verify that X RT X or, in other words, that {α | □α ∈
X } ⊆ X . Consider any formula □α ∈ X . Since □α ⊃ α is an axiom of System T,
. Axiomatising valid formulas
□α ⊃ α ∈ X , by Lemma .. (i). From Lemma .. (ii), it then follows that α ∈ X ,
as required. ⊣
Transitive frames
System is the set of axioms obtained by adding the following axiom scheme to Sys-
tem K.
() □α ⊃ □□α
Lemma .. System is sound and complete with respect to the class of transitive frames.
P We know that the axiom () is sound for the class of transitive frames from
Proposition ... is establishes the soundness of System .
To show completeness, we must argue that every formula which is consistent with
respect to System can be satisfied in a model based on a transitive frame. Once again,
we can build a canonical model M4 = ((W4 , R4 ),V4 ) for System which satisfies the
property described in Lemma ... We just need to verify that the resulting frame
(W4 , R4 ) is transitive.
In other words, if X , Y, Z are MCSs such that X R4 Y and Y R4 Z, we need
to verify that X R4 Z—that is, we must show that {α | □α ∈ X } ⊆ Z. Consider
any formula □α ∈ X . Since □α ⊃ □□α is an axiom of System , it follows from
Lemma .. that □□α ∈ X . Since X R4 Y , it must be the case that □α ∈ Y .
Further, since Y R4 Z it must be the case that α ∈ Z, as required. ⊣
(B) α ⊃ □◊α.
Verify that System B is sound and complete with respect to symmetric frames. ⊣
Lemma .. System S is sound and complete with respect to the class of reflexive and
transitive frames.
P Since System T is sound for the class of reflexive frames and System is sound
for the class of transitive frames, it follows that System S is sound for the class of
reflexive and transitive frames.
To show completeness, as usual we build a canonical model M S4 = ((WS4 , RS4 ),VS4 )
satisfying the property in Lemma ... Using the argument in the proof of Lemma ..,
it follows that RS4 is reflexive. Similarly, from the proof of Lemma .. it follows that
RS4 is transitive. ⊣
Equivalence relations
e System S is obtained by adding the following axioms to System K.
(T) □α ⊃ α
() ◊α ⊃ □◊α.
We have already seen that (T) is the axiom for reflexivity, while () characterises Eu-
clidean frames.
Exercise ..
(i) Show that System S is sound and complete for the class of frames whose acces-
sibility relation is an equivalence relation.
(ii) Show that the axioms () and (B) can be derived in System S. ⊣
w w1 w2 w3 w4 ···
(i) If w1 ∼ w2 and w1 R1 w1′ then there exists w2′ such that w2 R2 w2′ and w1′ ∼ w2′ .
(ii) If w1 ∼ w2 and w2 R2 w2′ then there exists w1′ such that w1 R1 w1′ and w1′ ∼ w2′ .
Notice that the empty relation is a trivial example of a bisimulation. Two worlds which
are related by a bisimulation satisfy exactly the same formulas.
Lemma .. Let ∼ be a bisimulation between M1 = ((W1 , R1 ),V1 ) and M2 = ((W2 , R2 ),V2 ).
For all w1 ∈ W1 and w2 ∈ W2 , if w1 ∼ w2 , then for all formulas α, M1 , w1 ⊨ α iff
M2 , w2 ⊨ α.
We can use bisimulations to show that certain classes of frames cannot be charac-
terised in modal logic.
P Let α be a formula that characterises the class of irreflexive frames. Consider
the pair of frames in Figure .. Since the first frame is not irreflexive, there should be
a valuation V and an instance β of α such that β is not satisfied at w under V .
Let us define a valuation V ′ on the second model such that for each wi , V ′ (wi ) =
V (w). We can clearly set up a bisimulation between the two models by relating w to
each of the worlds wi . is means that w satisfies exactly the same formulas as each
of the worlds wi . In particular, β is not satisfied at each wi . is is a contradiction
because the second model is irreflexive and β is an instance of the formula α which
we claimed was a characteristic formula for irreflexive frames. ⊣
Antisymmetry
We have seen that irreflexivity cannot be characterised in modal logic. Another natural
frame condition which is beyond the expressive power of modal logic is antisymmetry.
Recall that a relation R on W is antisymmetric if w R w ′ and w ′ R w imply that
w = w ′.
Lemma .. Let α be a formula which is satisfiable over the class of reflexive and transi-
tive frames. en, α is satisfiable in a model based on an reflexive, transitive and antisym-
metric frame.
Consider the frame (W , R). If R is not antisymmetric, there are two worlds w and
w in W such that w R w ′ and w ′ R w. e idea is to break each loop of this kind
′
by making infinitely many copies of w and w ′ and arranging these copies alternately
in a chain. We then verify that the new model which we construct is bisimilar to the
original model.
Formally, we say that X ⊆ W is a cluster if X × X ⊆ R—in a cluster, every world
can “see” every other world.
Let Cl be the class of maximal clusters of W —that is, X ∈ Cl if X is cluster and
for each w ∈/ X , (X ∪ {w}) × (X ∪ {w}) ̸⊆ R. Since R is reflexive, every singleton
{w} is a cluster. It follows that the set Cl of maximal clusters is not empty and that
every world w ∈ W belongs to some maximal cluster in Cl. In fact, W is partitioned
into maximal clusters.
For each X ∈ Cl, define WX = X × N, where N is the set {0, 1, 2, . . .} of natural
numbers. us WX contains infinitely many copies of each world from X . For each
set WX , we define an accessibility relation within WX . For this, we first fix an arbitrary
total order ≤X on X . For X ∈ Cl, RX ⊆ WX × WX is then defined as follows:
We then define a relation across maximal clusters based on the original accessibility
relation R:
∪
R′ = {(WX × WY ) | X ̸= Y and for some w ∈ X and w ′ ∈ Y, w R w ′ }
c, R)
Finally, we can define the new frame (W b corresponding to (W , R).
∪
c=
• W WX .
X ∈Cl
∪
b = R′ ∪
• R RX .
X ∈Cl
∼ = {((w, i ), w) | w ∈ W , i ∈ N}
. Bisimulations and expressiveness
Exercise .. Show that the relation R b constructed in the proof of Lemma .. is
reflexive, transitive and antisymmetric. ⊣
We have already seen that the system S is sound and complete for the class of
reflexive, transitive frames. is class is very close to the class of partial orders, which are
ubiquitous in computer science. e fact that antisymmetry cannot be characterised in
. Decidability: Filtrations and the finite model property
modal logic means that modal logic cannot distinguish between reflexive and transitive
frames (often called preorders) and reflexive, transitive and antisymmetric frames (or
partial orders).
Corollary .. e system S is sound and complete for the class of partial orders.
P Since partial orders are reflexive and transitive, S is certainly sound for this
class of frames. We already know that every formula which is consistent with respect
to S is satisfiable in a preorder. e bulldozing construction described in the proof
of Lemma .. shows that every formula satisfiable over a preorder is also satisfiable
over a partial order. ⊣
Finite model property Let A be an axiom system which is sound and complete with
respect to a class of frames C . e system A has the finite model property if for all
formulas α, ⊬A α implies there is a model M = (F ,V ) based on a finite frame F =
(W , R) ∈ C such that for some w ∈ W , M , w ⊨ ¬α.
Since A is sound and complete for the class C , this is equivalent to demanding that
any formula which is satisfiable in the class C is in fact satisfiable in a model based on
a finite frame from the class C .
Assume that we can effectively decide whether or not a given finite frame belongs
to the class C , we can then systematically enumerate all finite models built from the
class C . As a consequence, the finite model property allows us to enumerate the set
of formulas satisfiable within the class C . On the other hand, the completeness of the
axiom system A allows us to enumerate the set of formulas which are valid in this class
of frames.
To check whether a formula α is valid, we interleave these enumerations. If α is
valid, it will be enumerated as a thesis of the system A. On the other hand, if α is
not valid, its negation ¬α must be satisfiable, so ¬α will appear in the enumeration of
formulas satisfiable over C . us, the finite model property yields a decision procedure
for validity (and, dually, satisfiability).
. Decidability: Filtrations and the finite model property
• α ∈ sf(α).
Exercise .. Show that the size of the set sf(α) is bounded by the length of α. More
formally, for a formula α, define |α|, the length of α, to be the number of symbols in
α. Show that if |α| = n then |sf(α)| ≤ n. Give an example where |sf(α)| < |α|. ⊣
∪
For a set X of formulas, we write sf(X ) to denote the set α∈X sf(α). A set of
formulas X is said to be subformula-closed (or just sf-closed ) if X = sf(X ).
Let M = ((W , R),V ) and M ′ = ((W ′ , R′ ),V ′ ) be a pair of models. We have
already seen that if we can set up a bisimulation ∼ between M and M ′ , then for each
pair of worlds (w, w ′ ) ∈∼, the worlds w and w ′ satisfy the same formulas. Often, we
are willing to settle for a weaker relationship between w and w ′ —we do not require
them to agree on all formulas, but only on formulas from a fixed set X . For sf-closed
subsets X , this can be achieved using filtrations.
Filtrations Let M = ((W , R),V ) and M ′ = ((W ′ , R′ ),V ′ ) be a pair of models and X
an sf-closed set of formulas. An X -filtration from M to M ′ is a function f : W → W ′
such that:
Recall that our goal is to establish the finite model property for a class of frames
C —whenever a formula α is satisfiable over C , then there is a model for α based on
a finite frame from the class C .
Our strategy will be as follows: given a formula α and an arbitrary model M for
α, define an sf-closed set of formulas Xα and a finite model Mα such that α ∈ Xα and
there is an Xα -filtration from M to Mα . Lemma .. then tells us that α is satisfied in
Mα . Since this procedure applies uniformly to all satisfiable formulas α over the given
class of frames, it follows that this class of frames has the finite model property.
Defining Xα is easy—we set Xα = sf(α). To construct Mα , we have to define a
frame (Wα , Rα ) and a valuation Vα : Wα → 2P .
We define Wα and Vα in a uniform manner for all classes of frames. To define
Wα , we begin with the following equivalence relation ≃α on W : w ≃α w ′ if for
each β ∈ Xα , M , w ⊨ β iff M , w ′ ⊨ β. In other words, w ≃α w ′ iff the worlds w
and w ′ satisfy exactly the same formulas from the set Xα . We use [w] represent the
equivalence class of w with respect to the relation ≃—that is, [w] = {w ′ | w ′ ≃α w}.
. Decidability: Filtrations and the finite model property
P Recall that system K is sound and complete for the class F of all frames.
From our discussion of the finite model property, it suffices to show that any formula
satisfiable over F is in fact satisfiable over a finite frame in F .
Let α be a satisfiable formula and let M = ((W , R),V ) be a model for α—-that
is, for some wα ∈ W , M , wα ⊨ α. Let Xα = sf(α) and define Wα and Vα as described
earlier. Define Rα as follows:
P Recall that system T is sound and complete for the class of reflexive frames.
Let α be a formula satisfiable at a world wα in a model M = ((W , R),V ) where (W , R)
is a reflexive frame. We have to exhibit a finite model for α based on a reflexive frame.
Define Xα and Mα = ((Wα , Rα ),Vα ) as in the proof of Lemma ... We have
already seen that f : w 7→ [w] then defines an Xα -filtration from M to Mα . To
complete the proof of the present lemma, it suffices to show that the frame (Wα , Rα )
is reflexive.
Since R is reflexive, we have (w, w) ∈ R for each w ∈ W . By property (i) of
filtrations, (w, w) ∈ R implies ([w], [w]) ∈ Rα . Since f is surjective, it then follows
that Rα is reflexive as well. (Notice that this argument actually establishes that any
filtration from a reflexive model M to a model M ′ preserves reflexivity.) ⊣
P Recall that S is sound and complete for the class of reflexive and transitive
frames. Let α be a formula satisfiable at a world wα in a model M = ((W , R),V )
where (W , R) is reflexive and transitive. We have to exhibit a finite model for α based
on a reflexive and transitive frame.
Let Xα = sf(α) and define Wα and Vα in terms of ≃α as usual. Let Rα be defined
as follows:
lemma that any filtration from a reflexive model preserves reflexivity, so it is immediate
that (Wα , Rα ) is a reflexive frame.
To show transitivity, suppose that ([w1 ], [w2 ]) and ([w2 ], [w3 ]) belong to Rα .
We have to show that ([w1 ], [w3 ]) ∈ Rα as well. is means that for each formula
□β in Xα , we have to show that if M , w1 ⊨ □β then M , w3 ⊨ □β. Suppose that
M , w1 ⊨ □β. Since ([w1 ], [w2 ]) ∈ Rα , we know that M , w2 ⊨ □β. Now, since
([w2 ], [w3 ]) ∈ Rα , it follows that M , w3 ⊨ □β as well. ⊣
Exercise ..
(i) Recall that the axiom system B is sound and complete for the class of symmetric
frames. Show that B has the finite model property. Define Rα as follows:
(ii) Recall that the axiom system S is sound and complete for the class of frames
based on equivalence relations. Show that S has the finite model property.
Define Rα as follows:
Small model property In all the finite models we have constructed, we have defined Wα
to be the set of equivalence classes generated by the relation ≃α . Since the size of sf(α)
is bounded by |α|, it follows that |Wα | is bounded by 2|α| . us, when we establish
the finite model property using the equivalence relation ≃α , we in fact derive a bound
on the size of a finite model for α. As a result, we establish a stronger property, which
we call the small model property.
More formally, we say that a class of frames C has the small model property if
there is a function fC : N → N such that for each formula α satisfiable over the class
C , there is a model for α over C whose size is bounded by fC (|α|). For instance, in
the examples we have seen, fC (|α|) = 2|α| .
. Labelled transition systems and multi-modal logic
Exercise .. In the examples we have seen (axiom systems K, T etc.) verify that the
satisfiability of a formula α can be checked in time which is doubly exponential in |α|.
⊣
us, the modalities {□i }i ∈{1,2,...,n} are used to “independently” reason about the re-
lations {Ri }i ∈{1,2,...,n} . We can then use the theory we have developed to describe
properties of each of these relations. For instance, the multi-relational frames where
the axioms □3 α ⊃ α and □7 α ⊃ □7 □7 α are valid correspond to the class where R3
is reflexive and R7 is transitive. We can express interdependencies between different
relations using formulas which combine these modalities. For instance, the formula
α ⊃ ◊5 ◊2 β indicates that a world which satisfies α has an R5 -neighbour which in
turn has an R2 -neighbour where β holds.
We have seen how to characterise classes of frames using formulas from modal
logic. We can extend this idea in a natural way to characterise classes of multi-relational
frames.
→a = {(s , s ′ ) | (s , a, s ′ ) ∈ →}
It is then clear that the multi-relational frame (S, {→a }a∈Σ ) describes the same struc-
ture as the original labelled transition system (S, Σ, →).
To reason about the structure (S, {→a }a∈Σ ), we have modalities □a (read as Box a)
and ◊a (read as Diamond a) for each a ∈ Σ. Traditionally, the modality □a is written
[a] and the modality ◊a is written 〈a〉.
When reasoning about labelled transition systems, the set of atomic propositions
P corresponds to properties which distinguish one configuration of the system from
each other. For instance, we could have an atomic proposition to denote that “memory
location is unused” or that “the printer is busy”. In these notes, we will not go into
the details of how to model a computing system in terms of such a logic.
Assuming we have an abstract encoding of system properties in terms of atomic
propositions, we can now reason about the dynamic behavior of the system. For in-
stance, we can assert M , s ⊨ [c]〈b 〉α to denote that in the state s , any c-transition will
lead to a state from where we can use a b -transition to realise the property described
by α. In particular, if α is just the constant ⊤, this formula asserts that a b -transition
is enabled after any c-transition.
Unfortunately, we still do not have the expressive power we need to make non-
trivial statements about programs. For instance, we cannot say that after a c-transition,
we can eventually reach a state where a b -transition is enabled. Or that we have reached
a portion of the state space where henceforth only a and d transitions are possible.
For this, we need to move from modal logic to dynamic logic, which is the topic
of discussion in the next section.
Chapter
Dynamic Logic
Dynamic logic is a multi-modal logic where the modalities are indexed not by un-
interpreted letters, but by programs, which have structure. e relationship between
different programs also forms an integral part of the logic.
. Syntax
As in propositional logic, we begin with a countably infinite set of atomic propositions
P = { p0 , p1 , . . .} and two logical connectives ¬ (read as not) and ∨ (read as or). We
also begin with a countably infinite set of atomic actions A = {a0 , a1 , . . .}.
e set Φ of formulas of dynamic logic and the set Π of programs are simultane-
ously defined by induction as the smallest sets satisfying the following:
• If α is a member of Φ, so is (¬α).
• If π is a member of Π, so is (π∗ ).
. Semantics
Frames A frame is just a labelled transition system F = (W , A , →). For each a in
a
A , define −→ ⊆ W × W to be the set of pairs (w, w ′ ) such that (w, a, w ′ ) belongs
a
to →. If w −→w ′ we say that w ′ is an a-neighbour of w.
Satisfiability and validity As usual, we say that α is satisfiable if there exists a frame
F = (W , A , →) and a model M = (F ,V ) such that M , w ⊨ α for some w ∈ W . e
formula α is valid, written ⊨ α, if for every frame F = (W , A , →), for every model
M = (F ,V ) and for every w ∈ W , M , w ⊨ α.
(viii) Suppose that α is valid. en, [π]α must also be valid. Consider any model
M = ((W , A , →),V ) and any w ∈ W . To check that M , w ⊨ [π]α we have
to verify that every π-neighbour of w satisfies α. Since α is valid, M , w ′ ⊨ α
for all w ′ ∈ W . So, every π-neighbour of w does satisfy α and M , w ⊨ [π]α.
Axioms
(A) All tautologies of propositional logic.
(A) [π](α ⊃ β) ⊃ ([π]α ⊃ [π]β).
(A) [π1 + π2 ]α ≡ ([π1 ]α ∧ [π2 ]α).
(A) [π1 · π2 ]α ≡ [π1 ][π2 ]α.
(A) [π∗ ]α ≡ (α ∧ [π][π∗ ]α).
(A) (α ∧ [π∗ ](α ⊃ [π]α)) ⊃ [π∗ ]α.
(A) [α?]β ≡ (α ⊃ β).
. Axiomatising valid formulas
Inference Rules
α, α ⊃ β α
(MP) (G)
β [π]α
As usual, we say that α is a thesis, denoted ⊢ α, if we can derive α using the axioms
(A) to (A) and the inference rules (MP) and (G). It is easily seen that ⊢ [π](α∧β) ≡
([π]α ∧ [π]β).
e result we want to establish is the following.
P As we observed earlier, it suffices to show that each axiom is valid and that the
inference rules preserve validity. is is precisely what we exhibited in Example . ⊣
As we saw in the case of Propositional Logic, this will yield as an immediate corol-
lary the result we seek:
Corollary .. (Completeness for dynamic logic) Let α be a valid formula. en
⊢ α.
. Axiomatising valid formulas
Atoms
Instead of working with maximal consistent sets as we did in modal logic, we work
with certain subsets of subformulas of the formula of interest. We first make precise
the notion of subformula of a formula. e definition is not completely obvious – it
has some aspects which are motivated by the proof of completeness. For convenience,
in the rest of the section, we will fix a consistent formula α0 and try to construct a model in
which it is satisfied.
• α ∈ sf(α).
Exercise .. Show that the size of the set sf(α) is bounded by the square of the length
of α. More formally, for a formula α, define |α|, the length of α, to be the number
of symbols in α. Show that if |α| = n then |sf(α)| ≤ n 2 . Give an example where
|sf(α)| < |α|2 . ⊣
(vi) For all formulas [π1 + π2 ]α ∈ cl, [π1 + π2 ]α ∈ A iff [π1 ]α ∈ A and [π2 ]α ∈
A.
b to be α ∧ · · · ∧ α , and
For any finite set of formulas A = {α1 , . . . , αn }, define A 1 n
for any finite collection V = {A1 , . . . , Am } of finite sets of formulas, define Vb to be
c ∨ ··· ∨ A
A Ó . We first present the following useful properties related to AT. c
1 m
c
Lemma .. ⊢ AT.
c en ¬AT
P Let AT = {A1 , . . . , Ar }. Suppose it is not the case that ⊢ AT. c is
consistent. In other words, ¬A c ∧ · · · ∧ ¬A
c is consistent. By Lindenbaum’s lemma,
1 r
there is a maximal consistent set X such that ¬A c ∧ · · · ∧ ¬A
c ∈ X . is means that
1 r
b
for all i : 1 ≤ i ≤ r , ¬Ai ∈ X . Let B = X ∩ cl. Since X is a maximal consistent
. Axiomatising valid formulas
b ≡ ¬Vb .
Lemma .. Let U ⊆ AT and let V = AT \ U . en ⊢ U
···
···
Ó ⊃ α ) ∧ (B
ℓ mn . (A c ⊃ ¬α ) α mn ∈ Am \ Bn .
m mn n mn
Ó ⊃ ¬B
ℓ′mn . A c ℓ mn , PL.
m n
ℓ′mn + 1. (Ac ∨ ··· ∨ A
Ó ) ⊃ (¬Bb ∧ · · · ∧ ¬B)
bℓ′11 , . . . , ℓ′mn , PL.
1 m 1
ℓ′mn + 2. U b ⊃ ¬Vb ℓ′mn + 1, def. of U b , Vb , PL.
ℓ′ + 3. U b ≡ ¬Vb , ℓ′mn + 2, PL.
mn
Now it follows from definitions of U and V and by Lemma .. that ⊢ U b ∨ Vb .
b ≡ ¬Vb .
From the above derivation ⊢ U ⊣
b.
Lemma .. Let α ∈ cl, and let U denote the set {A ∈ AT | α ∈ A}. en ⊢ α ≡ U
c ⊃ α) ∧ · · · ∧ (A
1. (A Ó ⊃ α) α ∈ Ai for 1 ≤ i ≤ m.
1 m
b
2. U ⊃ α , def. of U b , PL.
3. (Bb1 ⊃ ¬α) ∧ · · · ∧ (B
c ⊃ ¬α)
n α∈ / B j , and hence ¬α ∈ B j for 1 ≤ j ≤ n.
b c)
4. (α ⊃ ¬B1 ) ∧ · · · ∧ (α ⊃ ¬B , PL
n
5. α ⊃ ¬V b , def. of Vb , PL.
6. Ub ≡ ¬Vb Lemma ...
7. α ⊃ U b , , PL.
8. α ≡ U b , , PL.
is completes the proof of the lemma. ⊣
Lemma .. Suppose α and β are formulas and π is a program such that for all A ∈
b or ⊢ A
AT, either ⊢ α ⊃ [π]¬A b ⊃ β. en ⊢ α ⊃ [π]β.
Lemma .. For each atom A ∈ AT and for each formula α ∈ cl, M , A ⊨ α iff α ∈ A.
In particular, M , A0 ⊨ α0 .
(ii) For any two atoms A and B, and any program π which “occurs” in α0 —more
π
formally, any π such that [π]α ∈ cl for some α—if A−→B and [π]α ∈ A, then
α ∈ B.
b
(iii) For any two atoms A and B, and any program π which occurs in α0 , if A∧〈π〉Bb
π
is consistent then A−→B.
Proof of (i)
Basis: If α = p ∈ P ∩ cl, then M , A ⊨ p iff p ∈ V (A) iff p ∈ A, by the definition of
V.
Induction step:
α = ¬β ∈ cl: en M , A ⊨ ¬β iff M , A ⊭ β iff (by the induction hypothesis) β ∈
/A
iff (by the fact that A is an atom) ¬β ∈ A.
α = β ∨ γ ∈ cl: en M , A ⊨ β ∨ γ iff M , A ⊨ β or M , A ⊨ γ iff (by the induction
hypothesis) β ∈ A or γ ∈ A iff (by the fact that A is an atom) β ∨ γ ∈ X .
α = [π]β ∈ cl: We analyse this case in two parts:
(⇐) Suppose that [π]β ∈ A. We have to show that M , A ⊨ [π]β. Consider any
π
atom B such that A−→B. By (ii), we know that β ∈ B. By induction hypothesis,
M , B ⊨ β. Since B is an arbitrary π-neighbour of A, M , A ⊨ [π]β, as desired.
. Axiomatising valid formulas
π
(⇒) Suppose M , A ⊨ [π]β. is means that for all atoms B such that A−→B,
M , B ⊨ β. In other words, for all atoms B such that M , B ⊭ β, it is not the case
π b ⊃ [π]¬B.
that A−→B. By (iii), this implies that for all such B, ⊢ A b By induction
hypothesis on β, M , B ⊭ β iff β ∈ / B. us our earlier statement is equivalent to
saying that for all atoms B such that β ∈ / B, ⊢ A b ⊃ [π]¬B. b By the properties of
atoms, this is the same as saying that for all atoms B such that ¬β ∈ B, ⊢ Ab ⊃ [π]¬B.
b
b
By propositional logic, axiom (A) and rule (G), we can see that ⊢ A ⊃ [π]¬U , b
where U is the set of all atoms which contain ¬β. But by Lemma .., we see that
⊢Ub ≡ ¬β. erefore ⊢ A b ⊃ [π]β. But A b is a conjunction of formulas belonging to
A and [π]β ∈ cl, and A is an atom, so it follows that [π]β ∈ B, as desired.
Proof of (ii)
Basis: Suppose π = a ∈ A and A and B are atoms. Let [a]α ∈ A and α ∈ / B. en
b b
¬α ∈ B. Now it is easy to see that ⊢ A ⊃ [a]α and ⊢ B ⊃ ¬α. us ⊢ α ⊃ ¬B, b and
hence by rule (G), ⊢ [a]α ⊃ [a]¬B. b ⊃ [a]¬B.
b erefore it follows that ⊢ A b But this
a a
means that it is not the case that A−→B. us we see that if A−→B and [a]α ∈ A
then α ∈ B.
Induction step:
π = π1 + π2 : For any atom A, [π1 + π2 ]α ∈ A iff [π1 ]α ∈ A and [π2 ]α ∈ A. Now
π1 +π2 π1 π2
A −→ B iff A−→B or A−→B. In either case it follows from induction hypothesis
that α ∈ B.
π1 ·π2
π = π1 · π2 : For any atom A, [π1 · π2 ]α ∈ A iff [π1 ][π2 ]α ∈ A. Now A −→B
π1 π2
iff there exists another atom C such that A−→C and C −→B. Now by induction
hypothesis it follows that [π2 ]α ∈ C and again by induction hypothesis it follows that
α ∈ B.
π = π1∗ : For any atom A, [π1∗ ]α ∈ A iff α ∈ A and [π1 ][π1∗ ]α ∈ A. Consider any
π1∗
atom such that A−→B. is means that there exists a sequence of atoms A0 , . . . , Ak
π1
(k ≥ 0) such that A = A0 , B = Ak and for all i : 0 ≤ i < k, Ai −→Ai +1 . We prove by
induction that [π1∗ ]α ∈ Ai for all i : 0 ≤ i ≤ k. In particular, [π1∗ ]α ∈ Ak = B and
hence α ∈ B, as desired.
Now for the induction. Clearly [π1∗ ]α ∈ A0 . Suppose [π1∗ ]α ∈ Ai . en
π1
[π1 ][π1∗ ]α ∈ Ai . But since Ai −→Ai +1 , we can apply the induction hypothesis on
π1
−→ to conclude that [π1∗ ]α ∈ Ai+1 , as desired.
π = β?: For any atom A, [β?]α ∈ A iff β ∈
/ A or α ∈ A. By applying (i) on β, β ∈
/A
. Axiomatising valid formulas
β?
iff M , A ⊭ β. Now A−→B iff M , A ⊨ β and A = B. is tells us that β ∈ A and
hence it has to be the case that α ∈ A = B.
Proof of (iii)
a
Basis: For a ∈ A , it immediately follows from the definition of −→ that whenever
b ∧ 〈a〉B,
A b A−→B.a
Induction step:
π = π1 + π2 : Suppose π1 + π2 occurs in α0 . We prove the desired claim in the
π1 +π2 π1
contrapositive form. It is not the case that A −→ B iff it is not the case that A−→B
π2
and it is not the case that A−→B. But by induction hypothesis, this implies that
⊢Ab ⊃ [π ]¬Bb and ⊢ A b ⊃ [π ]¬B.
b It immediately follows from Axiom (A) that
1 2
⊢Ab ⊃ [π + π ]¬B. b
1 2
b ⊃ [π ]U
Claim ⊢ U b.
1
is completes the proof of Lemma .., and hence of Lemma ... ⊣
First-Order Logic
Consider typical structures which we come across in mathematics and computer sci-
ence—graphs, groups, monoids, rings, fields, …. A graph, for instance, is a set of
vertices with a binary relation on this set which defines the edges. A group is a set
equipped with a special constant (identity) and a binary function on the set which
is associative. In general, all these structures consist of an underlying set of elements
together with relations and functions defined over this set which satisfy certain prop-
erties.
First-order logic provides a natural framework for talking about such structures.
In first-order logic, we begin by fixing abstract symbols to denote relations, functions
and constants. ese can then be combined using the usual propositional connectives
built up from ¬ (not) and ∨ (or). In addition, first-order logic provides the means to
quantify over elements¹ in the structure—we have the existential quantifier ∃ (read as
“there exists”) and its dual, the universal quantifier ∀ (read as “for all”). e logic also
has the symbol ≡, denoting equality, as a primitive construct.²
Defining the precise syntax and semantics of first-order logic is a little more in-
volved than for propositional or modal logics. Before getting into the details, let us
look at an informal example.
• e operation + is associative.
To formalise this in first-order logic, we have to first fix the symbols in the language.
We choose a function symbol op which takes two arguments and a constant symbol ϵ.
We can then write the following formulas.
(G) ∀x op(x, ϵ) ≡ x
. Syntax
First-order languages To define the formulas of first-order logic, we have to first fix
the underlying language. A first-order language is a triple L = (R, F , C ) where R =
{r1 , r2 , . . .} is a countable set of relation symbols, F = { f1 , f2 , . . .} is a countable set
of function symbols and C = {c1 , c2 , . . .} is a countable set of constant symbols. Each
symbol r ∈ R and f ∈ F is associated with an arity, denoted #(r ) or #( f ), indicating
how many arguments the symbol takes. We also fix a countable set Var = {v1 , v2 , . . .}
of variables. We shall use x, y, z, . . . to denote typical elements of Var.
A term which does not contain any variables is called a closed term. Notice that if L
contains no function symbols, then the only terms over L are constants from C and
variables from Var.
As we described before in an informal way, to define the semantics of first-order
logic we have to fix a structure with respect to which the formulas of the language
are interpreted. is interpretation will map each term to a unique element of the set
underlying the structure. It is helpful to think of terms as the “names” which we can
generate within L to talk about elements in the structure we are interested in.
Formulas Having defined the atomic formulas, we can then define ΦL , the set of first-
order formulas over L. e set ΦL is the smallest set satisfying the following conditions:
• If φ ∈ ΦL then ¬φ ∈ ΦL .
• If φ, ψ ∈ ΦL then φ ∨ ψ ∈ ΦL .
. Semantics
As we saw informally earlier, to give meaning to a first-order formula over a language
L = (R, F , C ), we have to fix a set S and assign a relation over S to each relation
symbol in R, a function over S to each function symbol in F and an element of S to
each constant symbol in C .
• For each relation symbol r ∈ R with #(r ) = n, ι(r ) is an n-ary relation over
S—that is, ι(r ) ⊆ S n .
We mentioned earlier that terms are names for elements in the structure. We can
now make this statement precise. Once we fix an interpretation I , each term t over
L maps to a unique element t I of S. Let I = (M , σ) where M = (S, ι). en:
• If t is a constant c ∈ C , t I = c M .
• I ⊨ t1 ≡ t2 if t1I = t2I .
• I ⊨ ¬φ if I ⊭ φ.
• I ⊨ φ ∨ ψ if I ⊨ φ or I ⊨ ψ.
Bound and free variables Before looking at examples of how to describe properties of
structures in first-order logic, let us look closer at the role that variables play in defining
the meaning of a formula.
As we saw above, we need to augment an L-structure M with an assignment σ in
order fully specify the meaning of formulas. In principle, σ fixes a value for all variables
in Var. However, for a fixed formula φ, we only need to know the values fixed by σ
for those variables mentioned in φ.
More precisely, we only need σ to fix values of variables which are not “quantified”
within φ. In a formula of the form ∃x ψ or ∀x ψ, the value assigned by σ to x is
irrelevant in fixing the meaning of the overall formula—the semantics of the quantifiers
forces us to look at all possible assignments for x in order to give meaning to the
formula.
Formally, in a formula of the form ∃x ψ the scope of the quantifier ∃x is the
formula ψ. We say that a variable x is free in φ if it does not occur within the scope
of a quantifier ∃x. Otherwise, x is said to be bound. For a formula φ, the set of free
variables of φ, denoted FV(φ), is defined inductively as follows:
• FV(¬φ) = FV(φ).
In the rest of the notes, we often write φ(x1 , x2 , . . . , xk ) to denote that FV(φ) ⊆
{x1 , x2 , . . . , xk }.
e following proposition, analogous to Proposition .. of Propositional Logic,
formalises the fact that the meaning of a formula does not depend on that portion of
the assignment which lies outside its set of free variables.
In other words, for a sentence φ and an L-structure M it makes sense to directly write
M ⊨ φ. As usual, if X is a set of sentences, we write M ⊨ X to denote that M ⊨ φ
for each sentence φ ∈ X ..
us, for instance, the first-order formulas which are valid over all groups are just
those formulas which are logical consequences of the sentences (G)–(G) which we
used to characterise groups.
We end this section with some notation about variables and some assumptions
about substitution. Given a formula φ(x1 , x2 , . . . , xn ), where {x1 , x2 , . . . , xn } ⊆ FV(φ),
. Formalisations in first-order logic
Groups revisited
As we saw earlier, the three sentences (G)–(G) characterize groups, in the sense that
any structure M = (S, f , s ) which is a model for (G)–(G) defines a group over the
set S with group operation f and identity s .
In groups, the cancellation law holds. is says that for any three elements x, y, z
in the group, if x ◦ z = y ◦ z, then x = y. Recall that the language we chose for
groups consisted of a binary function symbol op and a constant ϵ. In this language,
the cancellation law can be stated as follows:
def
φc = ∀x ∀y ∀z (op(x, z) ≡ op(y, z) ⊃ x ≡ z)
Since the cancellation law φc holds in all groups, we would expect that (G1), (G2), (G3) ⊨
φc .
An element g in a group (G, +, 0) such that g ̸= 0 and |g + g + {z
· · · + g = 0 is
}
n times
said to be of order n. We can formulate the fact that a group has no elements of order
two as follows:
def
ψ = ¬∃x (¬(x ≡ ϵ) ∧ op(x, x) ≡ ϵ)
. Formalisations in first-order logic
us, the set of sentences {(G1), (G2), (G3), (Ab)} characterize abelian groups.
Lest we get the impression that all interesting properties of groups can be captured
easily in first-order logic, let us consider torsion groups. A group (G, +, 0) is said to be
a torsion group if every element of G has finite order—that is, for each g ∈ G, there is
a natural number n ≥ 1 such that |g + g + {z
· · · + g = 0. To formalize this in a “natural
}
n times
Equivalence relations
Let r be a binary relation symbol in the language. We can force r to be interpreted as
an equivalence relation through the following three sentences.
• ∀x r (x, x)
It should be clear that in any structure M , these three sentences would force r M
to be reflexive, symmetric and transitive.
Order
Ordered structures occur frequently in mathematics. A strict linear order < over a
set S is a non-empty binary relation which is irreflexive and transitive and which has
the property that any two distinct elements in S are related by <. For instance, the
less-than ordering over the set of natural numbers is a strict linear order.
Using the same symbol < to denote the ordering relation within our language, we
can axiomatise linear order using the following sentences.
. Formalisations in first-order logic
• ∀x ¬(x < x)
• ∀x ∀y (x < y ∨ x = y ∨ y < x)
Fields
Recall that a field is a structure (F , +, ·, 0, 1) where:
• (F , +, 0) is an abelian group.
Exercise .. Using a first-order language with two binary function symbols and two
constants, axiomatise fields. ⊣
Questions of cardinality
We can make assertions about the size of structures in first-order logic. Consider the
sentence
def
φ≥2 = ∃x ∃y ¬(x ≡ y)
Clearly, any structure which models φ≥2 must have at least two distinct elements in the
underlying set. We can easily generalize this formula to φ≥n for any natural number
n as follows: ∨
def
φ≥n = ∃x1 ∃x2 · · · ∃xn ¬(xi ≡ x j )
i ̸= j
def
• For pi ∈ P , p̂i (x) = Pi (x), where x is a variable.
def
• If α = ¬β, then α̂(x) = ¬β̂(x).
def
• If α = β ∨ γ , then α̂(x) = β̂(x) ∨ γ̂ (x).
def
• If α = □β, then α̂(x) = ∀y (r (x, y) ⊃ β̂(y)).
Proposition .. Let α be a modal logic formula over P . en, α is satisfiable iff α̂(x)
is first-order satisfiable.
(⇐) Conversely, suppose that there is a structure M based on a set S such that
for some s ∈ S, (M , [x 7→ s ]) ⊨ α̂(x). We must show that α is satisfiable. We fix
our frame to be (S, r M ) and for each pi ∈ P , we fix V ( pi ) = PiM . Once again, by
induction on the structure of α, we can establish that M , s ⊨ α. We omit the details.
⊣
Our translation from modal logic to first-order logic allows us to reduce some
questions about modal logic to the framework of modal logic. For instance, by the
preceding proposition, questions about the satisfiability or validity of a formula α in
modal logic can be phrased in terms of the first-order satisfiability or first-order validity
of the corresponding formula α̂(x).
We can even reduce more sophisticated questions to first-order logic. For instance,
if we want to check whether a formula α is satisfiable over a frame whose accessibil-
ity relation is an equivalence relation, we can check the simultaneous satisfiability of
α̂(x) along with the three first-order sentences we saw earlier which capture the fact
that the relation r is an equivalence relation. In general, questions about “relativised
satisfiability” can be reduced to first-order logic whenever the properties demanded of
the accessibility relation can be captured using first-order sentences.
We can even talk about satisfiability with respect to classes of frames which cannot
be axiomatised in modal logic—for instance, the sentence ∀y (¬r (y, y)) describes the
class of irreflexive frames, which cannot be described in modal logic. In other words,
the formula ∀y (¬r (y, y)) ∧ α̂(x) is satisfiable iff α is satisfiable over an irreflexive
frame.
e disadvantage with reducing questions about modal logic to first-order logic is
that first-order logic is too powerful from a computational point of view—for instance,
we shall observe later that satisfiability is undecidable for first-order logic. On the other
hand, we showed that for many systems of modal logic, satisfiability is in fact decidable.
Exercise .. Let L be a finite first-order language and let M be a finite L-structure.
Show that there is an L-sentence φM the models of which are precisely the L-structures
isomorphic to M . ⊣
Exercise ..
(i) Let L = {+, ×, 0} where + and × are binary function symbols and 0 is a con-
stant symbol. Consider the L-structure (R, +, ×, 0), where R is the set of real
numbers with the conventional interpretation of +, × and 0 as addition, mul-
tiplication and zero.
. Formalisations in first-order logic
Show that the relation < (”less than”) is elementary definable in (R, +, ×, 0)—that
is, there is a formula φ(x, y) over L such that for all a, b in R, ((R, +, ×, 0), [x 7→
a, y 7→ b ]) ⊨ φ(x, y) iff a < b .
(ii) Let L = {+, 0}. Show that the relation < is not elementary definable in (R, +, 0).
(Hint: Work with a suitable automorphism of (R, +, 0)—that is, a suitable iso-
morphism of (R, +, 0) onto itself ). ⊣
(ii) r is an equivalence relation with an equivalence class containing more than one
element. ⊣
Show that:
(ii) For every m ≥ 1, the set of numbers greater than which are divisible by m is
a spectrum.
Prime formulas A prime formula over L is an atomic formula or a formula which begins
with the quantifier ∃. Let PL be the set of prime formulas over L.
Example In the formula ∃x r (x) ∨ t1 ≡ t2 , the prime formulas are ∃x r (x) and
t1 ≡ t2 . In the formula ∀x s (x) ⊃ ∃x s (x), after rewriting ∀ in terms of ∃, we have
two prime formulas—∃x ¬s (x) and ∃x s (x).
Observe that every formula in ΦL can be constructed from prime formulas using
the propositional connectives ¬ and ∨. e idea is to treat each distinct prime formula
as an independent atomic proposition and deduce the satisfiability of a set X ⊆ ΦL
from the propositional structure of its prime formulas.
P For each prime formula ψ, define v(ψ) = ⊤ if I ⊨ ψ and v(ψ) = ⊥ oth-
erwise. Since each first-order formula can be built up from prime formulas using the
connectives ¬ and ∨, the result follows. ⊣
e preceding examples show that the prime formula structure of ΦL does not
accurately capture the effect of the equality relation and the role played by quantifiers
in the semantics of first-order logic. Henkin’s solution is to add extra formulas which
“tie together” formulas connected by the equality relation and quantifiers so that the
truth of one formula is linked to the truth of the other.
For instance, if we augment the set {c ≡ d , d ≡ e, ¬(c ≡ e)} with the formula
{(c ≡ d ) ∧ (d ≡ e) ⊃ (c ≡ e)}, the set is no longer propositionally satisfiable. e
new formula links the truth value of the prime formulas c ≡ d and d ≡ e to that of
c ≡ e. Clearly the formula we have added is true in any structure, so it has not altered
the first-order satisfiability of the original set.
. Satisfiability: Henkin’s reduction to propositional logic
Similarly, consider the second example {∀x (r (x) ⊃ s (x)), ∀x r (x), ∃x ¬s (x)},
which may be rewritten as {¬∃x (r (x) ∧ ¬s (x)), ¬∃x ¬r (x), ∃x ¬s (x)}.
If a sentence of the form ∃y φ(y) is satisfied in a structure, we can use a term t to
denote the “witnessing” element where φ holds. With this intended interpretation of
t , we can append the sentence ∃y φ(y) ⊃ φ(t ) to the set containing ∃y φ(y) without
affecting its satisfiability.
Similarly, a sentence of the form ¬∃y φ(y) is satisfiable just in case ¬φ(t ) holds for
every term t . us, we can expand a set of formulas containing ¬∃y φ(y) by a sentence
¬∃y φ(y) ⊃ ¬φ(t ), where t is an arbitrary term, without affecting satisfiability.
If we apply this reasoning to the set {¬∃x (r (x)∧¬s (x)), ¬∃x ¬r (x), ∃x ¬s (x)},
we first identify a term t to witness the formula ∃x ¬s (x) and add the formula ∃x ¬s (x) ⊃
¬s (t ) to the set. Applying the rule for ¬∃y φ(y) to the other two formulas, we can then
add ¬∃x (r (x)∧¬s (x)) ⊃ ¬(r (t )∧¬s (t )) and ¬∃x ¬r (x) ⊃ ¬¬r (t ) to the set. A val-
uation which satisfies the three original formulas in the set must now also make the set
{¬(r (t ) ∧ ¬s (t )), ¬¬r (t ), ¬s (t )} true. is simplifies to {¬r (t ) ∨ s(t ), r (t ), ¬s (t )},
which is not propositionally satisfiable. In other words, the expanded set is not propo-
sitionally satisfiable, which reflects the fact that the original set of three formulas was
not first-order satisfiable.
Adding equality formulas, as we did in the first example, is not a problem. How-
ever, in the second case, we need to have a term to denote the witnessing element for
each sentence ∃y φ(y) in our set. It may be the case that the original language L does
not have enough terms to cover all existential sentences of this form! In general, we
have to expand the language in order to ensure that we do not run out of terms.
e Witnessing Expansion of L
Let L = (R, F , C ) be the original language, with X ⊆ ΦL the set of sentences whose
satisfiability we want to establish. We shall systematically add new constants to L in
order to ensure that we have enough terms in the language to “name” all witnessing
elements for existential sentences. Formally, we inductively define new sets of constants
C0 , C1 , . . . as follows:
• Let C0 = ; and let L0 = L.
• Assume we have defined Cn . Let Ln = (R, F , C ∪ C1 ∪ C2 ∪ · · · ∪ Cn ). For each
formula φ(x) of ΦLn \ ΦLn−1 , with exactly one free variable x, let cφ(x) be a new
constant, called the witnessing constant of the sentence ∃x φ(x).
Let Cn+1 be the set of such constants generated by ΦLn \ ΦLn−1 .
∪
Let CH = i ≥0 Ci and let LH = (R, F , C ∪ CH ).
. Satisfiability: Henkin’s reduction to propositional logic
• e quantifier axioms are sentences over LH of the form φ(t ) ⊃ ∃x φ(x), where
t is a closed term over LH .
It is clear that the quantifier axioms are true in any structure and are hence first-
order valid. On the other hand, the Henkin axioms are not automatically true—we
need to ensure that the witnessing constants are interpreted properly in the structure
in order for the axioms to be true.
Let ΦH denote the set of all instances of the Henkin axiom and ΦQ denote the set
of all instances of the quantifier axiom over the language LH .
e equality axioms
Adding the equality axioms is easier. Let LH be the witnessing expansion of L. To
ensure that our propositional valuations respect the notion of equality, we define the
following set of axioms capturing properties of equality. e equality axioms are all
instances of the following, where t , u, v with or without subscripts are uniformly sub-
stituted by arbitrary terms over LH , f is an arbitrary n-ary function symbol in L and
r is an arbitrary n-ary relation symbol in L.
t≡t
t≡u ⊃ u≡t
(t ≡ u ∧ u ≡ v) ⊃ t ≡ v
(t1 ≡ u1 ∧ t2 ≡ u2 ∧ · · · ∧ tn ≡ un ) ⊃ ( f (t1 , t2 , . . . , tn ) ≡ f (u1 , u2 , . . . , un ))
(t1 ≡ u1 ∧ t2 ≡ u2 ∧ · · · ∧ tn ≡ un ) ⊃ (r (t1 , t2 , . . . , tn ) ⊃ r (u1 , u2 , . . . , un ))
Let ΦE q denote all instances of the equality axioms over LH . Notice that though
these axioms are not, in general, sentences, each formula in ΦE q is satisfied in every
interpretation of LH ,
We now have the following lemma, which shows that satisifiability in first-order
logic can be reduced to a similar question in propositional logic.
Lemma .. (First-order satisfiability) Let L be a first-order language and let LH be
the witnessing expansion of L. For any set X of formulas over L, the following are equiva-
lent:
. Satisfiability: Henkin’s reduction to propositional logic
e construction of M is as follows.
t1 ≡ u1 ∧ t2 ≡ u2 ∧ · · · ∧ tn ≡ un ⊃ (r (t1 , t2 . . . , tn ) ⊃ r (u1 , u2 . . . , un ))
is completes the construction of M and, at the same time, establishes that for
atomic sentences φ, M ⊨ φ iff v ⊨ φ. Indeed, I ⊨ r (t1 , . . . , tn ) iff (by semantics)
〈[t1 ], . . . , [tn ]〉 ∈ r M iff (by definition) v ⊨ r (t1 , . . . , tn ). On the other hand, I ⊨
t1 ≡ t2 iff (by semantics) t1I = t2I iff (by definition) t1 ≃ t2 iff (by definition, again)
v ⊨ t1 ≡ t2 .
To extend this argument to all sentences φ, we proceed by induction on the struc-
ture of φ. e cases where φ = ¬ψ and φ = ψ1 ∨ ψ2 are straightforward, so suppose
that φ = ∃x ψ(x).
If (M , σ) ⊨ φ then there is an element s in the underlying set S such that
(M , σ[x 7→ s ]) ⊨ ψ(x). Since every element in S corresponds to an equivalence
class [t ] for some term t over LH , we can find a constant t s ∈ LH such that t sM = s .
. Compactness and the Löwenheim-Skolem Theorem
Exercise .. Let L be a first-order language and let LH be the witnessing expansion
of L. Prove that for any set X of formulas over L, if there is an LH -interpretation
which is a model for X , there is also an L-interpretation which is a model for X . ⊣
eorem .. (Compactness) Let X be any set of First-Order formulas and let φ be a
formula. en, X ⊨ φ iff there is a finite subset Y ⊆fin X such that Y ⊨ φ.
As we saw in the case of Propositional Logic (Page ), this follows directly once
we establish the following finite satisfiability result.
Lemma .. (Finite Satisfiability) Let L be a First-Order language and let X be a set
of formulas over L. en, X is satisfiable iff every Y ⊆fin X is satisfiable.
P e non-trivial half of the statement is to show that if every Y ⊆fin X is satis-
fiable then X is satisfiable. From the First-Order Satisfiability Lemma, it is sufficient
to establish that (X ∪ ΦH ∪ ΦQ ∪ ΦE q ) is propositionally satisfiable. From the Finite
Satisfiability Lemma for propositional logic (Lemma ..), it suffices to show that
every finite subset (X ∪ ΦH ∪ ΦQ ∪ ΦE q ) is propositionally satisfiable. By assumption,
each finite subset Y ⊆fin X is satisfiable. From the First-Order Satisfiability Lemma,
we can then conclude that for each Y ⊆fin X , (Y ∪ ΦH ∪ ΦQ ∪ ΦE q ) is proposi-
tionally satisfiable. Since each finite subset of (X ∪ ΦH ∪ ΦQ ∪ ΦE q ) is contained in
(Y ∪ ΦH ∪ ΦQ ∪ ΦE q ) for some Y ⊆fin X , it then follows that each finite subset of
(X ∪ ΦH ∪ ΦQ ∪ ΦE q ) is propositionally satisfiable. us, (X ∪ ΦH ∪ ΦQ ∪ ΦE q ) is
propositionally satisfiable, or, in other words, X is First-Order satisfiable. ⊣
. A Complete Axiomatisation
P Let us look at the first case in detail. If L is finite or countable, then ΦL is
countable. If X is satisifiable, then it is satisfiable in the structure constructed in the
proof of Lemma ... e underlying set in that structure is bounded by the number
of constants in L together with the number of constants in the witnessing expansion of
L. Recall the construction of CH , the set of set of witnessing constants for L. Initially,
C1 contains a constant cφ(x) for each formula φ(x) ∈ ΦL . Since ΦL is countable, so
is C1 and, thus, L1 is countable. Inductively, assuming that Ln is countable, the same
argument establishes that the next set of witnessing constants Cn+1 is countable. us,
CH is the countable union of countable sets and is thus countable.
A similar argument applies in the second case. We omit the details. ⊣
Axiom System FOL-AX e axiom system FOL-AX consists of three categories ax-
ioms and two inference rules.
. A Complete Axiomatisation
Lemma .. All the equality axioms over L can be derived using the above axioms and
rules.
P Consider the equality axiom t ≡ t for some term t . Here is a derivation of it:
1. x≡x Aa.
2. y≡y Aa.
3. ¬(x ≡ x) ⊃ ¬(y ≡ y) , PL.
4. ∃ x¬(x ≡ x) ⊃ ¬(y ≡ y) , rule (G).
5. ¬(t ≡ t ) ⊃ ∃ x¬(x ≡ x) A.
6. ¬(t ≡ t ) ⊃ ¬(y ≡ y) ,,PL.
7. t≡t ,,PL.
Now consider the equality axiom t ≡ u ⊃ u ≡ t . is is easily derivable as follows,
where we let α(x) be x ≡ t (note that α(t ) is t ≡ t and α(u) is u ≡ t ):
1. t ≡ t by the earlier derivation.
2. t ≡ u ⊃ (α(t ) ≡ α(u)) Ab.
3. t ≡ u ⊃ u ≡ t ,,PL.
Consider (t ≡ u ∧ u ≡ v) ⊃ t ≡ v. Again the following is an easy derivation,
letting α(x) be t ≡ x (note that α(u) is t ≡ u and α(v) is t ≡ v):
1. u ≡ v ⊃ (α(u) ≡ α(v)) Ab.
2. (t ≡ u ∧ u ≡ v) ⊃ t ≡ v , PL.
. A Complete Axiomatisation
eorem .. Let X be a set of formulas over L and φ a sentence over L. en X ⊢ L
iff X ⊨ L.
As usual, the proof of this theorem is in two parts, soundness and completeness.
Suppose that the formula φ(x) ⊃ ψ is valid, where x ∈ / FV(ψ). In other words,
for any interpretation (M , σ), (M , σ) ⊨ φ(x) ⊃ ψ.
Consider an arbitrary interpretation (M ′ , σ ′ ), where M ′ = (S ′ , ι′ ). We must
show that if (M ′ , σ ′ ) ⊨ ∃x φ(x) then (M ′ , σ ′ ) ⊨ ψ as well.
Suppose that (M ′ , σ ′ ) ⊨ ∃x φ(x). From the semantics of the quantifier ∃, (M ′ , σ ′ ) ⊨
∃x φ(x) iff for some s ∈ S ′ , (M ′ , σ ′ [x 7→ s ]) ⊨ φ(x). From the validity of φ(x) ⊃ ψ,
we can conclude that (M ′ , σ ′ [x 7→ s ]) ⊨ ψ. But, x ∈ / FV(ψ), so σ ′ [x 7→ s ] and σ ′
agree on FV(ψ). From Proposition .., it follows that (M ′ , σ ′ ) ⊨ ψ as well, as re-
quired. ⊣
(iii) If x ∈
/ FV(ψ) and X ⊢ [(∃y φ(y) ⊃ φ(x)) ⊃ ψ], then X ⊢ ψ.
(ii) is follows from the fact that [((φ ⊃ θ) ⊃ ψ) ⊃ (¬φ ⊃ ψ)] and [((φ ⊃ θ) ⊃
ψ) ⊃ (θ ⊃ ψ)] are tautologies.
P Suppose that X ⊨ φ. en, X ∪{¬φ} is not first-order satisfiable. By Lemma ..,
X ∪ ¬φ ∪ ΦH ∪ ΦQ ∪ ΦE q is not propositionally satisfiable. From the Compact-
ness eorem for propositional logic, it follows that there is a finite subset Y ⊆fin
X ∪ ΦH ∪ ΦQ ∪ ΦE q such that Y ∪ {¬φ} is not propositionally satisfiable.
Let the formulas in Y be listed in the order α1 , α2 , . . . , αn , β1 , β2 , . . . , β m , such
that:
. A Complete Axiomatisation
Recall that each formula β′i is of the form ∃x ψ(x) ⊃ ψ(y), where the variable
y does not appear in β′i +1 , β′i +2 , . . . , β′m , φ. We can thus apply Lemma .. (iii) n
times to obtain X ⊢ φ. ⊣
. Variants of the Löwenheim-Skolem Theorem
eorem .. Let X be a set of formulas which has arbitrarily large finite models (i.e.
for every n ∈ N there is a model for X whose cardinality is at least n). en X also has a
countable model.
def
P Let Y = X ∪ {φ≥n | 2 ≤ n} (φ≥n was presented in Section . under the
head Questions of cardinality). Every model of Y is also a model of X and is infinite
in size. erefore we only need to prove that Y is satisfiable. By the Compactness
eorem it suffices to show that every finite subset Y0 of Y is satisfiable. Each such
def
Y0 is a subset of Xn0 = X ∪ {φ≥n | 2 ≤ n ≤ n0 } for an appropriate n0 ∈ N. But
according to hypothesis there is a model for X whose size is at least n0 . is is also a
model for Xn0 and hence Y0 . us we are done. ⊣
We next prove that if a set of formulas has a model of a certain cardinality, it has
models of every larger cardinality.
P Let L be the language of X and let C be the set of constants in L. For each
/ C ) such that ca ̸= c b for distinct a, b ∈ A. Let L′
a ∈ A let ca be a new constant (ca ∈
be the language L augmented with the set of constants {ca | a ∈ A}. Suppose we show
def
that the set Y = X ∪ {¬(ca ≡ c b ) | a, b ∈ A, a ̸= b } of L′ -formulas is satisfiable.
Consider any model I of Y . Since I ⊨ ¬(ca ≡ c b ) for all distinct a, b ∈ A, it is clear
that I (ca ) ̸= I (c b ) for distinct a, b ∈ A. us {(a, I (ca )) | a ∈ A} is an injective
map from A into the underlying set of I , and the theorem would be proved.
We now turn our attention to proving that Y is indeed satisfiable. By Compactness
it suffices to show that all finite subsets Y0 of Y are satisfiable. But that is very easy
to see. Every such Y0 is a subset of Z = X ∪ {¬(cai ≡ ca j ) | 1 ≤ i , j ≤ n, i ̸= j }
for some appropriate subset {a1 , . . . an } of A. Now let I be some infinite model for
. Elementary Classes
e above theorem can be put to good use in the study of algebraic theories. For
instance, let X be the set of group axioms. Since there exist infinite groups, the above
theorem says that there exist arbitrarily large groups. Similarly, there are arbitrarily
large orderings and arbitrarily large fields. While each of these facts can be derived
using algebraic methods specific to the theory, first-order logic provides us with the
framework and with methods to state and prove such results in a general form.
the class of models of X . We drop the superscript when there is no scope for confusion.
We also write Mod φ instead of Mod {φ}.
Fields of prime characteristic and of characteristic 0 Let p be a prime. A field F has char-
acteristic p if 1| + 1 +
{z· · · + 1} = 0. If there is no prime p for which F has characteristic
p times
p, F is said to have characteristic 0. For every prime p the field Z/( p) of the integers
modulo p has characteristic p. e field R of real numbers has characteristic 0. Let
φF be the conjunction of all the field axioms, and let χ p be the formula 1| + 1 +
{z· · · + 1}
p times
≡ 0 (we use the 0 and 1 both as constant symbols of the language of fields as well as
names of the additive and multiplicative identities of fields). en the class of fields
of characteristic p is exactly the same as Mod (φF ∧ χ p ). Hence this class is elemen-
tary. e class of fields of characteristic 0 is ∆-elementary — it is easily seen to be the
same as Mod ({φF } ∪ {¬χ p | p is prime}). In what follows, we show that it is not
elementary.
Let φ be a sentence in the lenaguage of fields which is valid in all fields of charac-
teristic 0, that is
{φF } ∪ {¬χ p | p is prime} ⊨ φ.
By the Compactness eorem there is an n0 such that
Hence φ is valid in all fields of characteristic ≥ n0 . us we have proved the following
theorem.
eorem .. A sentence (in the language of fields) which is valid in all fields of char-
acteristic 0 is also valid in all fields whose characteristic is sufficiently large.
From this we conclude that the class of fields of characteristic 0 is not elementary,
for otherwise, there would have to be a sentence φ (characterising the class) which is
valid precisely in all the fields of characteristic 0.
e class of finite structures and the class of infinite structures It is easily seen that the class
of finite L-structures (for a fixed L), the class of finite groups, the class of finite fields
are not ∆-elementary. e proof is simple: If, for example, the class of finite groups
were of the form Mod X , then X would be a set of formulas having arbitrarily large
finite models (groups of the form Z/( p)) but no infinite model. at would contradict
eorem ...
On the other hand the corresponding classes of infinite structures is ∆-elementary.
In fact, let C be any ∆-elementary class of structures, characterised by the set of for-
mulas X . en the class C ∞ of infinite structures in C is characterised by X ∪
{φ≥n | n ≥ 2}.
. Elementary Classes
Torsion groups A group G is called a torsion group if every element is of finite order,
i.e. if for every a ∈ G there is an n ≥ 1 such that |a + a +
{z· · · + a} = 0. An ad-hoc
n times
∀x(x ≡ 0 ∨ x + x ≡ 0 ∨ x + x + x ≡ 0 ∨ · · · ).
However, we may not form infinitely long disjunctions in first-order logic. Indeed, the
class of torsion groups is not even ∆-elementary.
Suppose, for a contradiction, that X is a set of formulas that characterises the class
of torsion groups. Let
def
Y = X ∪ {¬( |x + x +
{z· · · + x} ≡ 0) | n ≥ 1}.
n times
a1 = a, an = b , ai E ai +1 for i = 1, . . . , n − 1
(i.e., if for any two distinct elements in V there is a path connecting them). For
n ∈ N, the regular (n + 1)-gon Gn with the vertices 0, . . . , n is a connected graph.
def
More precisely, Gn is the structure (Vn , En ) with Vn = {0, . . . , n} and
def
En = {(i , i + 1) | i < n} ∪ {(i , i − 1) | 1 ≤ i ≤ n} ∪ {(0, n), (n, 0)}.
We now prove that the class of connected graphs is not ∆-elementary. Assume,
towards a contradiction, that a set X of formulas characterises the class of connected
graphs. For n ≥ 2 we set
def
ψn = ¬(x ≡ y) ∧ ¬∃x1 . . . ∃xn (x1 ≡ x ∧ xn ≡ y ∧ x1 E x2 ∧ · · · ∧ xn−1 E xn )
and
def
Y = X ∪ {ψn | n ≥ 2}.
. Elementarily Equivalent Structures
Definition ..
(i) Two structures (for the same language) M and M ′ are called elementarily equiv-
alent (written: M ≡ M ′ ) if for every formula φ (in the appropriate language) we
have M ⊨ φ iff M ′ ⊨ φ.
def
(ii) For an interpretation M let Th(M ) = {φ | M ⊨ φ}. Th(M ) is called the
(first-order) theory of M .
M ≡ M ′ iff M ′ ⊨ Th(M ).
It can be easily seen by a simple (but probably tedious) induction that any two
isomorphic structures satisfy the same first-order formulas. In other words, they are
elementarily equivalent. e converse is not immediately clear though: Are any two
elementarily equivalent structures isomorphic to each other?
. Elementarily Equivalent Structures
eorem .. If M is infinite then the class of all structures isomorphic to M is not
∆-elementary; in other words, no infinite structure can be characterised up to isomorphism
by a set of first-order formulas.
ordered field of reals R< are archimedean. We show that there is an non-archimedean
ordered field elementarily equivalent to the ordered field of real numbers. is will
prove the following.
P Let
def
X = Th(R< ) ∪ {0 < x, 1 < x, 2 < x, . . .},
. Elementarily Equivalent Structures
P Let
def
X = Th(N) ∪ {¬(x ≡ 0), ¬(x ≡ 1), ¬(x ≡ 2), . . .},
where 0, 1, 2, . . . stands for the terms 0, s (0), s (s (0)), . . .. Every finite subset of X has
a model of the form (N, σ), where σ(x) is a sufficiently large natural number. By the
Compactness eorem there is a model (M ′ , σ ′ ) of X , which by the countability of
the language of arithmetic and the Löwenheim-Skolem theorem we may assume to be
at most countable. M is a structure elementarily equivalent to N. Since for m ̸= n
the sentence ¬(m ≡ n) belongs to Th(N), M is infinite and hence is countable. M
. Elementarily Equivalent Structures
and N are not isomorphic, since an isomorphism from N onto M would have to map
the interpretation of n in the structure N (this turns out to be the number n) to the
interpretation of n in the structure M , and thus σ(x) would not belong to the range
of the isomorphism at all. ⊣
Considering the set Th(N< ) ∪ {¬(x ≡ 0), ¬(x ≡ 1), ¬(x ≡ 2), . . .}, we obtain the
following theorem.
hold. ey say that 0 is the smallest element, 1 is the next smallest element after 0, 2
is the next smallest element after 1, and so on. Since these sentences also hold in M ,
the “initial segment” of M looks as follows:
.
M
0 1M 2M 3M
.
0M
1M 2M 3M a
.
0M
1M 2M 3M a a +M a
It is clear that a + a lies in a different copy of Z than a. If they belonged to the same
copy, then a + a = a + n for some natural number n. By the cancellation law for
addition, a = n, which is a contradiction. We can also show that between every two
copies of Z< in M there lies another. is is because N< satisfies a sentence φ which
says that for any two elements m and n, if m < n there exists a “midpoint” p (i.e.
m + n = 2 · p or m + n = 2 · p + 1). e same statement is satisfied by M as well.
If we now consider two elements a and b which lie in different copies of Z< in M ,
they have a midpoint c which has to lie in between a and b but cannot lie in either
of their copies Z< (since that would imply that a and b lie in the same copy). us
any nonstandard model of arithmetic looks like the rational line (to the right of and
including the point 0) with the point 0 replaced by a copy of N< and every other point
replaced by a copy of Z< .
Fraisse’s theorem
In the following, we provide a simple proof of Fraisse’s theorem. We assume that we are
working with the signature of graphs, consisting of a single binary relation symbol R. It
is easy to see that what we prove here can be generalised to all signatures containing only
relational symbols. Later we will show how to extend the result to arbitrary signatures.
We introduce the following notation to simplify the presentation. We use a to
denote a tuples of elements. |a| denotes the number of elements in the tuple. We also
write φ(x) (where x = x1 , . . . , x r ) to indicate the fact that FV(φ) ⊆ {x1 , . . . , x r }. For
. An Algebraic Characterisation of Elementary Equivalence
a structure M , a tuple a of elements from M , and a formula φ(x) with |x| = |a|, we
write (M , a) ⊨ φ(x) to mean that (M , σ) ⊨ φ, with σ(xi ) = ai for all i ≤ |x|.
Note that for the above definition to make sense, |x| should be equal to |a|. But
we will not crib about such minor details here and in what follows.
We now motivate the notion of m-isomorphism. e least we require is that any
two m-isomorphic graphs are m-equivalent. Consider two graphs G = (V , E) and
H = (W , F ), a from V and b from W . Suppose that (G, a) ̸≡ m (H , b ). Let us
say that there is a formula φ(x, y) with quantifier rank ≤ m − 1 such that (G, a) ⊨
∃yφ(x, y) and (H , b ) ⊭ ∃yφ(x, y). is means that for some c ∈ V and for all
d ∈ W , (G, ac) ⊨ φ(x, y) and (H , b d ) ⊭ φ(x, y). us there is c ∈ V such that
for all d ∈ W , (G, ac) ̸≡ m−1 (H , b d ). In the symmetric case involving the universal
quantifier, we infer that there is d ∈ W such that for all c ∈ V , (G, ac) ̸≡ m−1 (H , b d ).
We have proved the following
Lemma .. Suppose that for every c ∈ V there is a d ∈ W such that (G, ac) ≡ m−1
(H , b d ) and that for every d ∈ W there is a c ∈ V such that (G, ac) ≡ m−1 (H , b d ).
en (G, a) ≡ m (H , b ).
Lemma .. ere are only finitely many inequivalent formulas of quantifier depth
≤ m having at most k free variables.
P Let C (m, k) denote the number of formulas of quantifier depth ≤ m having
at most k free variables. (To be precise, C (m, k) is the size of a maximal set of pairwise
inequivalent formulas each of which is of quantifier depth ≤ m and has at most k free
variables.) We prove by induction on m that for all k, C (m, k) is finite.
For any k, there are exactly p = 2 · k 2 atomic formulas, xi ≡ x j and Rxi x j
p
where i, j ≤ k. us there are at most 22 inequivalent quantifier-free formulas. us
C (0, k) is finite.
For the case where m > 0, we know by the induction hypothesis that C (m −1, k)
is finite for all k. A formula of quantifier depth ≤ m is a boolean combination of
formulas of quantifier depth ≤ m − 1 and formulas of the form ∀yφ(x, y) where φ is
2·C (m−1,k+1)
of quantifier depth ≤ m − 1. us C (m, k) ≤ 22 and is hence finite. ⊣
(H , b d ) ⊭ φc (x, y). Since there are only finitely many φc ’s which are inequiva-
lent their disjunction is equivalent to a graph formula ψ(x, y) of quantifier depth
≤ m − 1. Now for all c ∈ V , (G, ac) ⊨ ψ(x, y) but (H , b d ) ⊭ ψ(x, y). ere-
fore (G, a) ⊨ ∀yψ(x, y) but (H , b ) ⊭ ∀yψ(x, y). is shows that (G, a) ̸≡ m
(H , b ). ⊣
(G, a) ∼
= f (H , b ) iff (G, a) ≡ (H , b ).
• p is injective.
From the above definition it is clear that a given p is a partial isomorphism from
M to M ′ iff it is a partial isomorphism from M r to (M ′ ) r . us it follows that
M∼ = m M ′ iff M r ∼ = m (M ′ ) r , for any given m. We can now easily prove Fraisse’s
theorem for arbitrary finite signatures. M ∼ = f M ′ iff M r ∼ = f (M ′ ) r iff M r ≡
(M ′ ) r iff M ≡ M ′ .
Examples
We give two examples in this section, which illustrate the use of the easier half of
Fraisse’s theorem.
In earlier sections, we showed that some classes of structures are not ∆-elementary.
e arguments involved the Compactness eorem and used infinite structures. With
the techniques at our disposal now, we can show that certain properties cannot be
expressed by a first-order sentence, even if we restrict ourselves to finite structures. We
illustrate this approach by the following example.
eorem .. Let L be the language of graphs. ere is no L-sentence whose finite
models are the finite connected graphs. (Hence, in particular, the class of connected graphs
is not elementary.)
P For k ≥ 0 let Gk = (Vk , Ek ) be the graph corresponding to the regular (k +1)-
gon, where
Vk = {0, . . . , k}
and
Ek = {(i , i + 1) | i < k} ∪ {(i , i − 1) | 1 ≤ i ≤ k} ∪ {(0, k), (k, 0)},
and let Hk = (Wk , Fk ) consist of two disjoint copies of Gk , say,
Wk = {0, . . . , k} × {0, 1}
and
Fk = {((i , 0), ( j , 0)) | (i , j ) ∈ Ek } ∪ {((i , 1), ( j , 1)) | (i , j ) ∈ Ek }.
We claim that:
For all k ≥ 2 m : Gk ∼
= m Hk .
en we are done. In fact, let φ be an L-sentence and m be the quantifier rank of
φ. en we have that G2m ∼ = m H2m , i.e. G2m ≡ m H2m and therefore G2m ⊨ φ iff
H2m ⊨ φ. Since G2m is connected, but H2m is not, the class of finite models of φ
cannot be identical with the class of all finite connected graphs.
For proving that for all k ≥ 2 m : Gk ∼ = m Hk , we proceed as follows. For fixed
k ≥ 2 and n ≥ 0, we define “distance functions” d on Vk ×Vk and d ′ on Wk ×Wk ,
m
as follows:
(
def length of the shortest path connecting a and b in Gk , if this length is ≤ 2 ;
m
d (a, b ) =
∞, otherwise;
. An Algebraic Characterisation of Elementary Equivalence
(
def d (a, b ) if i = j ;
d ′ ((a, i ), (b , j )) =
∞ otherwise.
We say that (Gk , a) and (Hk , b ) are (d , d ′ )-equivalent iff for all i, j ≤ |a|, d (ai , a j ) =
d ′ (bi , b j ). Just like in the previous example, we can prove that whenever (Gk , a) and
(H , b ) are (d , d ′ )-equivalent, (G , a) ∼
k k = (H , b ).
m k ⊣
Ehrenfeucht Games
e algebraic description of elementary equivalence is well-suited for many purposes.
However, it lacks the intuitive appeal of a game-theoretical characterisation due to
Ehrenfeucht, which we look at in the present section.
Let L be an arbitrary signature and let M = (S, ι) and M ′ = (S ′ , ι′ ) be L-
structures. To simplify the formulation we assume S ∩ S ′ = ;. e Ehrenfeucht
game G (M , M ′ ) corresponding to M and M ′ is played by two players, Spoiler and
Duplicator, according to the following rules:
Each play of the game begins with Spoiler choosing a natural number r ≥ 1; r
is the number of subsequent moves each player has to make in the course of the play.
ese subsequent moves are begun by the Spoiler, and both players move alternately.
Each move consists of choosing an element from S ∪ S ′ . If Spoiler chooses an element
ai ∈ S in his i -th move, then Duplicator must choose an element bi ∈ S ′ in his i -
th move. If Spoiler chooses an element bi ∈ S ′ in his i -th move, then Duplicator
must choose an element ai ∈ S in his i -th move. After the r -th move of Duplicator
the play is completed. Altogether some number r ≥ 1, elements a1 , . . . , a r ∈ S and
b1 , . . . , b r ∈ S ′ have been chosen. Duplicator has won the play iff (M , a) ∼
=0 (M ′ , b ).
We say that Duplicator has a winning strategy in G (M , M ′ ) and write “Duplicator
wins G (M , M ′ )” if it is possible for him to win each play. (Following Ebbinghaus,
Flum, and omas, we omit an exact definition of the notion of “winning strategy”.)
Lemma .. M ∼
= f M ′ iff Duplicator wins G (M , M ′ ).
M ≡ M ′ iff Duplicator wins G (M , M ′ ).
. Decidability
We consider in this section the satisfiability problem for first-order logic. is is the
problem of determining whether a given first-order formula is satisfiable. We saw
earlier that the corresponding problem for propositional logic, many modal logics,
and dynamic logic is decidable. In contrast, the problem is undecidable for first-order
logic. We present a particularly simple proof of this result here. Our undecidability
proof proceeds by reducing the reachability problem for two-counter machines to the
satisfiability problem.
A two-counter machine is a finite-state automaton equipped with two counters
which can contain arbitrary natural numbers. Formally it is a tuple M = (Q, q0 , ∆, F )
where:
• Q is a finite set of states,
• ∆ ⊆ Q × {0, 1}2 × Q × {−1, 0, 1}2 is the transition relation satisfying the fol-
lowing condition:
e reduction
Let M = (Q, q0 , ∆, F ) be a given two-counter machine. en LM is defined to be
(CM , FM , RM ) where:
• CM = {q | q ∈ Q} ∪ {},
def
∨
• φ∆ = φt .
t ∈∆
def
• φM = (φ∆ ∧ init) ⊃ final.
e following two lemmas prove that the reduction is correct. (We use m as an
abbreviation for s m () in the formulas, in what follows.)
e above two lemmas, in conjunction with the fact that the reachability problem
for two-counter machines is undecidable, immediately yields the following theorem.
eorem .. e satisfiability problem (as also the validity problem) for first-order
logic is undecidable.
e above reduction uses a language with a unary function symbol, a ternary relation
symbol, and some constants. Using some coding tricks, we can get by with using just
the ternary relation symbol and constants. Working out the minimal expressive power
which leads to undecidability is an interesting problem, which has generated a lot of
research over the years. In fact, there are books solely devoted to the study of the status
of decidability of various fragments of first-order logic.