Notes 3
Notes 3
1.1 Signatures
1.3 Well-formed terms
Definition. A first-order signature consists of two disjoint sets F and P of func-
tion symbols, respectively, predicate symbols, together with an arity function Definition 3. The set T ⊆ A∗ of well-formed terms (or simply terms) over a
ar : F ∪ P → N. If f ∈ F and ar(f ) = n, then we call f an n-ary function given first-order signature is the smallest subset of A∗ such that
symbol. If P ∈ P and ar(P ) = n, then we call P an n-ary predicate symbol.
We also use the words “nullary”, “unary”, “binary”, etc., for 0-ary, 1-ary, 2-ary 1. If x is a variable, then x ∈ T .
and so on. A nullary function symbol is also called a constant symbol. A nullary
2. If c is a constant symbol, then c ∈ T .
predicate symbol is sometimes called a sentence symbol.
Example 1. The signature of elementary arithmetic has a constant symbol “0”, 3. If f is an n-ary function symbol, where n > 1, and if t1 , . . . , tn ∈ T , then
a unary function symbol “S”, binary function symbols “+”, “·”, and “E”, and a f (t1 , . . . , tn ) ∈ T .
binary predicate symbol “<”. The intended interpretations of these symbols are
Example 4. Relative to the signature of elementary arithmetic, the following are
respectively zero, the successor function, addition, multiplication, exponentiation,
well-formed terms:
and the less than relation.
Example 2. The signature of set theory has at least a binary predicate symbol +(x, y) S(S(S(0))) ·(S(S(0)), +(E(x, 0), S(0)))
“∈”. Sometimes one also adds a constant symbol “∅”, binary function symbols
“∪” and “∩”, and so forth. We will soon start using a more readable, informal syntax for terms, writing, for
instance x + y, 3, and 2 · (x0 + 1) for the above three terms. However, the formal
syntax, while cumbersome, has technical advantages because it guarantees us a
1.2 Alphabet unique readability result similar to that proved for well-formed formulas of sen-
tential logic. When we use the informal syntax, it will always be understood that
First-order terms and formulas will be defined relative to a given signature. Given we actually mean the corresponding well-formed terms of the formal language.
a signature, the alphabet of first-order logic consists of the elements of F and P,
plus the following symbols (which we assume are not in F and P):
¬ ∧ ∨ → ⊤ ⊥ ∀ ∃ (connectives) 1.4 Well-formed formulas
≈ (equality)
Definition 5. The set W ⊆ A∗ of well-formed formulas (wff’s) over a given
( ) , (auxiliary symbols)
first-order signature is the smallest subset of A∗ such that
x1 x2 x3 . . . (variables)
Notice that there is a countable supply of variables. We denote the set of variables 1. If Q is a nullary predicate symbol, then Q ∈ W.
by V, and we often use lower-case roman letters such as x, y, z to denote variables.
1 2
2. If P is an n-ary predicate symbol, where n > 1, and if t1 , . . . , tn are well- Relative to the signature of set theory, the following are well-formed formulas:
formed terms, then P (t1 , . . . , tn ) ∈ W.
4. ∈(x, y).
3. If t1 and t2 are well-formed terms, then ≈(t1 , t2 ) ∈ W.
5. (∃x (∀y ( ¬ ∈(y, x)))).
4. ⊤, ⊥ ∈ W.
6. (∀x (∀y
5. If α ∈ W then ( ¬ α) ∈ W. ((∀z ((∈(z, x)→∈(z, y))∧(∈(z, y)→∈(z, x))))→≈(x, y)))).
6. If α, β ∈ W then (α ∧ β) ∈ W, (α ∨ β) ∈ W, and (α → β) ∈ W,
7. If α ∈ W and x is a variable, then (∀x α) ∈ W and (∃x α) ∈ W. 1.6 Backus-Naur Form
The formulas build by rules 1–4 are called atomic formulas. All other well- In computer science, where one needs to define languages all the time, a useful
formed formulas are called composite formulas. notation has emerged for defining sets of strings. The notation is called BNF (for
Backus-Naur Form). The BNF notation is nothing but a succinct way of stating the
The sets of terms and formulas that arise from a given signature are also called the content of Definitions 3 and 5, and other such similar definitions. The following
language of that signature. For instance, we speak of the language of elementary is the BNF for well-formed terms and formulas of first-order logic:
arithmetic, or the language of set theory, etc.
Remark. In Definitions 3 and 5, we speak of the “smallest” set of strings satisfying
Terms: t ::= x c f (t1 , . . . , tn )
certain conditions. In order for this to be well-defined, we must prove in each case
that such a smallest set actually exists. The proof is very similar to the case of Formulas: α ::= Q P (t1 , . . . , tn ) ≈(t1 , t2 ) ⊤ ⊥
sentential logic, and we omit it here. ( ¬ α) (α1 ∧ α2 ) (α1 ∨ α2 ) (α1 → α2 )
Notice that equality symbol ≈ is automatically included in every first-order lan- (∀x α) (∃x α)
guage. We regard ≈ as a logical symbol with a fixed interpretation, namely equal-
ity. In this, it differs from the other predicate symbols, which are non-logical Here, the symbols t, and α are meta-variables that range over terms and formulas,
symbols whose meaning depends on the context. The symbol ≈ is not part of the respectively. Moreover, x ranges over variables, c ranges over constant symbols,
signature of a language, since the signature only fixes the non-logical symbols. f ranges over n-ary function symbols with n > 1, Q ranges over nullary predicate
However, we do occasionally refer to ≈ as a binary predicate symbol. symbols, and P ranges over n-ary predicate symbols with n > 1.
Each clause of the BNF defines a syntactic class, such as terms, formulas, etc. The
vertical lines in each clause separate the different alternative forms that a string in
1.5 Examples that syntactic class can have. The meaning of a BNF is that it defines the smallest
set(s) of strings closed under certain operations. Thus, it is really just a short-hand
Relative to the signature of elementary arithmetic, the following are well-formed notation for the inductive clauses spelled out in Definitions 3 and 5.
formulas:
3 4
Since the proofs are very similar to those of sentential logic, we omit them here, 1.9 Free variables
and we will henceforth use induction and recursion without further ado.
Definition. The set FV(t) of free variables of a term t, and the set FV(α) of free
variables of a formula α, are recursively defined as follows:
1.8 Informal syntax
Terms: FV(x) = {x}
We will also adopt a more liberal syntax for writing terms and formulas informally. FV(f (t1 , . . . , tn )) = FV(t1 ) ∪ . . . ∪ FV(tn ) (n > 0)
For the sentential connectives, we adopt the same precedence rules as before. We
Formulas: FV(P (t1 , . . . , tn )) = FV(t1 ) ∪ . . . ∪ FV(tn ) (n > 0)
also write ∀x α or ∀x.α instead of (∀x α), and similar for ∃. The convention is
FV(t1 ≈ t2 ) = FV(t1 ) ∪ FV(t2 )
that when we use a dot, as in ∀x.α, then the scope of the quantifier extends as far
FV(⊤) = ∅
as possible, so that ∀x.α ∧ β means ∀x(α ∧ β) and not (∀x α) ∧ β.
FV(⊥) = ∅
For terms, we use the usual infix notation where appropriate. For instance, we FV(( ¬ α)) = FV(α)
write x + y · z instead of +(x, ·(y, z)). We do the same for certain binary FV((α1 α2 )) = FV(α) ∪ FV(β)
predicates, for instance we write x < y, x ∈ y, and x ≈ y instead of <(x, y), FV((∀x α)) = FV(α) − {x}
∈(x, y), and ≈(x, y), respectively. FV((∃x α)) = FV(α) − {x}
If P is a predicate symbol of arity n = 0, then we will sometimes also write
We say a variable x is free in α if x ∈ FV(α). This is the case if x occurs
P (t1 , . . . , tn ) to denote P itself. This convention allows us to handle the cases
somewhere in α, but not in the scope of a quantifier. A formula α is called a
n = 0 and n > 1 uniformly in case distinctions. With this convention, the atomic
sentence if FV(α) = ∅. We sometimes denote sentences by the letters σ and τ .
formulas are precisely the formulas of the form P (t1 , . . . , tn ), t1 ≈ t2 , ⊤, or ⊥.
We also adopt certain other conventions, such as writing x 6< y instead of ¬ x < y,
and α ↔ β instead of (α → β) ∧ (β → α). The following are the well-formed 2 Truth and Models
formulas from Section 1.5 written in the informal syntax.
1. x ≈ S(0).
2.1 Structures
2. ∀x∃y x 6∈ y. To interpret the formulas of first-order logic, we need to know three things: first,
we need to know in which set to interpret the variables. Second, we need to know
3. ∀x∀y∀z. x < y ∧ y < z → x < z. how to interpret the basic constant and function symbols. Third, we need to know
how to interpret the basic predicate symbols.
4. x ∈ y.
Definition. Fix a first-order signature hF , P, ari. A structure A for the signature
5. ∃x∀y y 6∈ x. consists of the following data:
6. ∀x∀y ((∀z. z ∈ x ↔ z ∈ y) → x ≈ y).
1. A non-empty set |A|, called the carrier of A. The elements of |A| are also
called objects or individuals.
2. For each n-ary function symbol f in F , a function
f A : |A|n → |A|,
called the interpretation of f .
5 6
3. For each n-ary predicate symbol P in P, a relation S(S(S(S(S(0))))) ≈ 0.
Note that we require the carrier to be non-empty. Also note that the interpretation ∀x∀y(x + y ≈ 0 → x ≈ 0 ∧ y ≈ 0).
of each function symbol is a total function, i.e., it is everywhere defined. We do
In particular, not every structure of elementary arithmetic makes all the sentences
not allow function symbols to denote partial functions. So for instance, if we were
true that would be true of the natural numbers. If a structure satisfies, say, the
to interpret the language of fields, we would be forced to interpret the inversion
axioms of number theory, then we call it a model of number theory. Notice the
operation (−)−1 by a total function. We handle this situation by interpreting 0−1
difference in the usage of the words “structure” and “model”: we speak of a struc-
by some dummy value, for instance, we could let 0−1 = 0.
ture for a language, but of a model of the axioms. But we are getting ahead of
ourselves: axioms and models are discussed in Section 2.5 below.
2.2 Examples
The standard model for the language of elementary arithmetic is the following 2.3 The interpretation of terms and formulas
structure:
In the previous section, we have given some examples of structures, and we have
|A| = N = {0, 1, 2, . . .} informally spoken of a structure “satisfying” certain sentences but not others. We
<A = {hx, yi ∈ N | x < y} now need to define formally what we mean by a structure satisfying a sentence.
0A = 0 To this end, we need to be able to interpret terms and formulas in a given structure.
S A (x) = x + 1, for all x ∈ N We first need to define the concept of a valuation of variables. Throughout the rest
+A (x, y) = x + y, for all x, y ∈ N of this section, fix a language. Recall that we wrote V for the set of variables and
·A (x, y) = x · y, for all x, y ∈ N T for the set of terms of a language.
E A (x, y) = xy , for all x, y ∈ N
Definition. A valuation in a structure A is a map s : V → |A| which assigns an
The following defines another structure for the language of elementary arithmetic: element of the carrier to each variable of the language. If s is a valuation, x ∈ V
a variable, and a ∈ |A| is an individual, then we denote by s(x|a) the valuation s′
|B| = {0, 1, 2, 3, 4} that behaves like s, except that it assigns a to x:
<B = {hx, yi ∈ N | y = x + 1 (mod 5)}
0B = 0 a if z = x,
s′ (z) =
S B (x) = x + 1 (mod 5), for all x ∈ N s(z) if z 6= x.
+B (x, y) = x + y (mod 5), for all x, y ∈ N
·B (x, y) = x · y (mod 5), for all x, y ∈ N Any valuation s : V → |A| can be recursively extended to an interpretation s̄ :
E B (x, y) = xy (mod 5), for all x, y ∈ N T → |A| of arbitrary terms as follows:
The structure A satisfies different sentences than the structure B. For example, s̄(x) = s(x)
the following sentences hold in B, but not in A: s̄(f (t1 , . . . , tn )) = f A (s̄(t1 ), . . . , s̄(tn )) (n > 0)
∀x∃y(x ≈ S(y)).
7 8
If A is a structure, s : V → |A| a valuation, and ϕ a formula, then we define quantifier, for all a ∈ A, we have |=A Qx [s(x|a)], and thus, for all a ∈ A, a ∈
whether |A| satisfies ϕ under the valuation s, in symbols |=A ϕ [s], by the fol- QA . In particular, s(y) ∈ QA , and thus |=A Qy [s]. Since A and s were arbitrary,
lowing recursive clauses: this shows ∀x. Qx |= Qy.
|=A P (t1 , . . . , tn ) [s] iff hs̄(t1 ), . . . , s̄(tn )i ∈ P A Example. Prove that Qy 6|= ∀x. Qx. It suffices to give a particular structure and
|=A t1 ≈ t2 [s] iff s̄(t1 ) = s̄(t2 ) a valuation such that the left-hand side is satisfied and the right-hand side is not.
|=A ⊤ [s] always So let |A| = {0, 1}, and let QA = {0}. Let s be a valuation such that s(y) = 0.
|=A ⊥ [s] never Then |=A Qy [s], but not |=A ∀x. Qx [s].
|=A ( ¬ ϕ) [s] iff not |=A ϕ [s]
Notice that the situation is similar to doing proofs with truth tables: To prove
|=A (ϕ1 ∧ ϕ2 ) [s] iff |=A ϕ [s] and |=A ψ [s] that a logical entailment holds, we need to consider all structures and valuations,
|=A (ϕ1 ∨ ϕ2 ) [s] iff |=A ϕ [s] or |=A ψ [s]
whereas to prove that a logical entailment doesn’t hold, it suffices to give a single
|=A (ϕ1 → ϕ2 ) [s] iff |=A ϕ [s] implies |=A ψ [s] counterexample. The difference is that structures, unlike truth tables, need not
|=A (∀x ϕ) [s] iff for all a ∈ |A|, |=A ϕ [s(x|a)]
be finite, and thus there is no obvious mechanical method for deciding whether
|=A (∃x ϕ) [s] iff there exists a ∈ |A| such that |=A ϕ [s(x|a)]
a given logical entailment holds or not. (In fact, one can prove that there isn’t a
Remark. Strictly speaking, the above definition does not fit into the schema of non-obvious method either).
our recusion principle, because we are definition a predicate by recursion, and
not a function. More formally, one would first define, by recursion, a function
modelsA which assigns a truth value modelsA (ϕ, s) ∈ {T, F } to each pair of a
2.5 Theories and models
well-formed formula ϕ and a valuation s. One would then define |=A ϕ [s] if and
We first observe that the interpretation of a sentence does not depend on the valu-
only if modelsA (ϕ, s) = T .
ation s.
Lemma 6. 1. If s, s′ are valuations which agree on the free variables of a
2.4 Logical entailment term t, then s̄(t) = s̄′ (t).
Definition. Let Γ be a set of well-formed formulas, and ϕ a well-formed formula. 2. If s, s′ are valuations which agree on the free variables of a formula ϕ, then
We say that Γ logically implies (or entails) ϕ, in symbols Γ |= ϕ, if for every |=A ϕ [s] if and only if |=A ϕ [s′ ].
structure A and every valuation s in A: if |=A ψ [s] holds for every ψ ∈ Γ, then
|=A ϕ [s]. Proof. Exercise.
As before in the case of sentential logic, we use certain shorthand notations. Thus Corollary 7. If σ is a sentence and A is a structure, then |=A σ [s] is independent
we write ψ1 , . . . , ψn |= ϕ instead of {ψ1 , . . . , ψn } |= ϕ, and |= ϕ instead of of the valuation s (i.e., either it holds for all valuations, or for no valuation).
∅ |= ϕ. Thus, |= ϕ means that every structure and every valuation satisfies ϕ. In
this case, we say that the formula ϕ is valid. We say that two formulas ϕ and ψ We say that A is a model of σ if |=A σ [s] for some s. Since this notion does
logically equivalent if ϕ |= ψ and ψ |= ϕ. In this case, we also write ϕ |= =| ψ. not depend on s (by the previous corollary), we simply write |=A σ in this case.
Notice that, as compared to our terminology in sentential logic, we have dropped Similarly, if Σ is a set of sentences, then we say that A is a model of Σ, in symbols
the “tauto” from “tautological entailment” and “tautological equivalence”. One |=A Σ, if |=A σ for all σ ∈ Σ.
usually speaks of tautologies only in the case of sentential logic. Let A be a structure. The set of all sentences that are satisfied in A is called the
Example. Prove that ∀x. Qx |= Qy. Take an arbitrary structure A and an arbitrary theory of A. It is also denoted Th(A). More generally, if C is a class of structures,
valuation s such that |=A ∀x. Qx [s]. Then, by the interpretation of the universal
9 10
the set of those sentences that are satisfied in every structure A ∈ C is called the
theory of C , and written Th(C ).
We can also take the opposite point of view: starting from a set Σ of sentences,
we can ask for the class of structures which satisfy Σ. This class is denoted by
Mod(Σ). In this context, the sentences in Σ are often called axioms, and we say
that the class Mod(Σ) is axiomatized by Σ.
Definition. We say that C is axiomatizable if C = Mod(Σ) for some set Σ of
sentences. We say that a class C of structures is finitely axiomatizable if C =
Mod(σ) for some sentence σ.
Notice that for any structure A and any sentence σ, the following holds:
σ ∈ Th(A) ⇐
⇒ |=A σ ⇐
⇒ A ∈ Mod(σ).
Proposition 8. The following hold, for any class C of structures and any set Σ of
sentences:
Proof. Exercise.
11