Notes (1) Ai
Notes (1) Ai
Lecture Notes
Johannes Korbmacher
Utrecht University
Version 0.10
September 7, 2022
License
Adapt — remix, transform, and build upon the material for any pur-
pose, even commercially.
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org
https://freedomdefined.org/Definition
Contents
I Preliminaries 1
1 Introduction 2
1.1 Valid Inferences . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Propositional and First-Order Logic . . . . . . . . . . . . . . 6
1.3 Classical Logic . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Decidability . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5 Core Ideas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.6 Self-Study Questions . . . . . . . . . . . . . . . . . . . . . . . 12
1.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.8 Further Readings . . . . . . . . . . . . . . . . . . . . . . . . . 13
ii
CONTENTS iii
II Propositional Logic 72
IV Conclusion 292
Preliminaries
1
Chapter 1
Introduction
(1) The letter is either in the left drawer or in the right drawer, and
it’s not in the left drawer. So, the letter is in the right drawer.
(2) If the ball is scarlet, then it’s red, and the ball is red. So, the ball
is scarlet.
In an inference, the statements that come before the “so” are called the
premises, and the statement that comes after is called the conclusion.
Inference (1) is clearly a pretty solid piece of reasoning. If you know
for sure that the letter is either in the left or in the right drawer, but
you can exclude that it’s in the left drawer, then the letter must be
in the right drawer. Inference (2), in contrast, is pretty bad. Sure, if
the ball is scarlet, then it’s red. That’s a conceptual truth. And let’s
grant for the sake of argument that the ball is red. But that doesn’t
mean that the ball has to be scarlet. There are many other shades of
red: crimson, burgundy, maroon, . . . . In logician’s terminology, (1) is
a valid inference, while (2) is invalid. The aim of logic is to develop a
theory of valid inference.1
1
The notion of validity at play here, the one that mathematical logic courses typically
focus on, is a very strong notion of validity: it requires that the truth of the premises
necessitates the truth of the conclusion. The notion is also known as deductive validity in
the literature. In this course, we’ll be exclusively concerned with deductive validity and
2
CHAPTER 1. INTRODUCTION 3
Clearly not, for this would lead to a contradiction: we’d have that the
letter is either in the left or the right drawer and, at the same time, it’s
also neither in the left nor in the the right drawer. And surely, we can’t
have a contradiction in a possible situation, so the letter must be in the
right drawer, i.e. the conclusion must be true. Since we were reasoning
about an arbitrary possible situation, we can conclude that in every
possible situation in which the premises are true, the conclusion is true
as well. So, the argument is valid.
1.1.7 Note that an inference can be valid even if the conclusion is actually
false! This can happen (only) if at least one of its premises is false,
too. Take the following inference as an example: if Bremen is part
of the Netherlands, then Johannes is Dutch, and Bremen is part of
the Netherlands; so, Johannes is Dutch. It’s easy to convince yourself
that the inference is valid but the conclusion is false (I’m German,
from around Bremen). But that’s OK, since all we need that in every
possible situation in which the premises are true, the conclusion is
true—and that’s the case. It’s just that in the real world, which is a
very possible situation, one of the premises is false: Bremen is not part
of the Netherlands. The account of validity as truth-preservation only
talks about the truth of the conclusion in situations where the premises
are true, it remains silent about what happens if the premises are false.
Validity is, in a sense, a hypothetical concept. There is a stronger
concept of correct reasoning which demands that the premises be true
as well: an inference is said to be sound iff it is valid and the premises
are actually true. With a sound inference it’s certainly impossible that
the conclusion is false. The reason why we primarily study validity
and not soundness is that it allows us to focus on the logical aspects
of reasoning, leaving facts out of the picture—those are for scientists
to figure out.
1.1.9 There is a third and final step, which consists in determining a proof
system for the logic. The aim is to formulate inference rules that al-
low us to derive the conclusion from the premises in all (and only)
the valid inferences. These inference rules, however, are supposed to
be purely syntactic in the sense that they only make reference to the
formal symbols and not to the concepts of semantics, like truth in a
model. As you will see, showing that an inference is valid using the
official definition of validity as truth preservation across all models
can be difficult, it typically requires creative thinking and it’s not at
all obvious how to proceed. The point of a proof system is to make
establishing validity more tractable, especially for an artificial intelli-
gence. From a more philosophical vantage point, the idea of a proof
system is to formally model the kind of step-by-step reasoning that we
typically do in logical situations. The subfield of logic that deals with
proof systems is called proof theory. In this course, we’ll work with the
proof system of semantic tableaux, which was invented by the Dutch
logician Evert Willem Beth.
1.1.10 Once we’ve laid down a set of inference rules, it’s an important math-
ematical fact to establish that using these rules, we can derive the
conclusion from the premises in all and only the valid inferences. So,
we have to show two things: first that we can derive the conclusion
from the premises only if the inference is valid, and second that we
can derive the conclusion from the premises whenever the inference is
valid. The first part, is called the soundness theorem. For most log-
ics it’s quite easy to establish soundness. What’s more difficult but
possible to show is the second part, that every valid inference can be
shown to be valid by our purely formal means. This is (Gödel’s) com-
pleteness theorem, named after Austrian logician Kurt Gödel. In this
course, we’ll prove both soundness and completeness for the tableaux
method. This will be our most important mathematical result.
CHAPTER 1. INTRODUCTION 6
1.2.2 Propositional logic deals with inferences that are valid because of the
meaning of the so-called sentential connectives: “not,” “and,” “or,” “if
. . . , then . . . ,” and so on. The two inferences we discussed in 1.1.1 are
valid/invalid in precisely this sense: (1) is valid because of the meaning
of “not” and ”or” and (2) is invalid because of the meaning of “if . . . ,
then . . . .” In the second part of this course, after having dealt with
some mathematical prolegomena, we’ll develop standard propositional
logic “from scratch:” we’ll cover its syntax, semantics, and proof the-
ory. In a sense, we could save us some work and move immediately
to first-order logic, since the syntax, semantics, and proof theory for
first-order logic are extensions of those for propositional logic. But
for propaedeutic reasons, we’ll cover propositional logic separately. In
propositional logic, the definitions of a formal language, a model, truth
in a model, and derivability are all straight-forward enough so that we
can focus on how they exemplify the underlying ideas sketched in §1.1.
1.2.3 First-order logic deals with all of the inferences of propositional logic
plus inferences involving generality. There are inferences that are easily
seen to be valid but we can’t account for their validity purely in terms
of the behavior of the sentential connectives. Consider, e.g.:
(3) This ball is scarlet and everything that’s scarlet is red. So, this
ball is red.
(4) The letter is in the left drawer. So there is something in the left
drawer.
It’s easily checked that, intuitively, in every situation where the premises
of these arguments are true, the conclusion is too. But the (formal)
language of propositional logic lacks the expressive resources to cap-
ture the meaning of the crucial premise in (3) or the conclusion in
(4). Claims like “everything that’s scarlet is red” or “there is some-
thing in the left drawer” cannot be analyzed purely in terms of “not,”
“and,” “or,” . . . . To deal with such claims, we need quantifiers, which
are linguistic devices, like “for all” and “there exists,” that allow us
to express general claims, i.e. claims that are, in a sense, about all
objects.
1.3.2 Note that when we argued that inference (1) from 1.1.1 is valid in 1.1.5,
we assumed that we can’t have contradictions in possible situations.
This is a kind of consistency assumption and it’s characteristic of
classical logic. Note that without the consistency assumption, inference
(1) wouldn’t be valid, since we could find a situation in which the
premises are true but the conclusion not. This would be a situation
in which the letter is not in the right drawer but it’s both in the left
drawer and not in the left drawer. Since the letter is in the left drawer,
it’s in the left or the right drawer, meaning the first premise is true.
And since the letter is also not in the left drawer, the second premise
is true. But the letter is not in the right drawer, so the conclusion
is false. Hence, if we were to allow for such an impossible situation
(which we’re not!), the inference would be invalid.
the premises are true. Hence, trivially, in every situation where the
premises are true, so is the conclusion.3 To drive the point home, think
of it in another way. Ask yourself: Can the inference be invalid? Well,
there would have to be a possible situation where the premises are true
and the conclusion is not. But that would need to be a situation in
which the ball is red and not red, which is excluded by the consistency
assumption. This means that the argument cannot be invalid, which
is just another way to say that it’s valid. Clearly, the point generalizes
to arbitrary inferences with inconsistent premises. Bottom-line: every
inference with inconsistent premises is valid. This is known as the
principle of ex falso quodlibet and it’s an example of a law of classical
logic.
1.3.4 There are logics which don’t share the consistency assumptions, so-
called paraconsistent logics. We won’t deal with them in the course,
but as AI students, you should know that they exist. There are a
variety of reasons for why one might be interested in paraconsistent
logics, but a simple example, which is close to home for AI purposes,
involves reasoning with information provided by (possibly) inconsis-
tent databases. We often have to reason with information provided by
databases where we don’t have control over how information is fed
into them, and which therefore might turn out to be inconsistent. Just
think of the internet! This means that if we use classical logic to reason
with the information provided by such an inconsistent database, every
inference which uses all the information in the database as premises
would turn out to be valid, which is clearly undesirable. To obtain
useful information from inconsistent databases using logic, we need
a paraconsistent logic. Classical logic, instead, is more suited to rea-
soning about the real world (rather than about information), where
inconsistencies arguably can’t occur.
that every inference whose conclusion says that something is the case
or not is valid. Take, for example, an inference with the conclusion “the
ball is red or not.” For that inference, no matter what the premises
are, to be invalid, we’d need a situation in which the premises are true
but the conclusion is not. But that would require it to be the case that
in that situation the ball is neither red nor not red, the question of its
redness would need to be unsettled. Given the completeness assump-
tion, that’s impossible. Hence, the argument can’t be invalid. So it’s
valid. This is known as the classical law of verum ex quodlibet.
1.3.6 Statements like “the ball is red or not,” which in classical logic are true
in all situations, are also called logical truths. Conversely, contradic-
tions, like “the ball is both red and not,” are called logical falsehoods.
Logical truths and falsehoods are not very informative considered as
statements about the real world, but they play a central role in clas-
sical logic. We’ll see later that the logical truth of certain statements
coincides with the validity of certain inferences. So, in a sense, we can
focus on the logical truth of statements rather than the validity of
inferences.
1.3.7 Logics without the completeness assumption also exist. They are called
paracomplete logics, and again, we won’t cover them in this course.
They are equally useful in the case of reasoning with databases, albeit
for slightly different reasons. Just like databases can turn out to be in-
consistent, they might be incomplete by failing to provide information
about a certain subject matter, e.g. the redness of the ball. In such
cases, we arguably don’t want to be able to conclude from the database
that the ball is either red or not, since that’s not what the database
says—it remains quiet about this. This is what a paracomplete logic
allows us to do.
1.3.9 There are many other characteristics of what’s called classical logic.
Here are just a few:
1.3.10 In this course, you’ll get familiar with classical logic and you’ll get an
“I know it when I see it” kind of acquaintance with the subject.
1.4 Decidability
1.4.1 As a computer science-minded person, you might ask: Is it perhaps
possible to write a computer program, such that if I give it an arbitrary
inference, the program will determine (in a finite amount of time)
whether the argument is valid? Meaning, the program will spit out
“yes” if the inference is valid, and it will spit out “no” if the argument is
invalid. This is (roughly) what logicians call the question of decidability
of validity. And indeed, in propositional logic, it’s possible to write
such a computer program: classical propositional logic is decidable. We
will, indeed, prove this result by describing two decision procedures for
propositional logic, one using models and one using proof systems.
1.4.4 Even though first-order logic is undecidable, we can still write a com-
puter program that attempts to find a derivation of a given conclusion
CHAPTER 1. INTRODUCTION 11
from some premises. We just have to keep in mind that even if the in-
ference in question is valid, it’s possible that the program doesn’t find
a proof in a reasonable amount of time. A program like this is called a
theorem prover. The method of semantic tableaux we use in this course
is often used in theorem provers (in fact, for propositional logic, it es-
sentially is a theorem prover). We’ll look a bit at the problems we face
when trying to write efficient theorem provers.
A proof system is sound and complete iff the valid inferences are pre-
cisely the ones whose conclusion can be derived from the premises.
(a) There is a situation in which premises and conclusion are all false.
(b) In every situation where the conclusion is false, the premises are
true.
(c) There is a situation in which the premises are true and there is no
situation in which the conclusion is true.
(d) There is a situation in which the premises are true and the con-
clusion is false.
(e) In every situation where the premises are true, the conclusion is
false.
(f) There is no situation in which the premises are true and the con-
clusion as well.
1.7 Exercises
Each chapter contains a set of exercises. Solutions to selected exercises can
be found in the appendix. The exercises marked [h] are homework assign-
ments, which are always due in the workgroup meeting preceding the one in
which they are going to be discussed.
1.7.1 [h] Are the following inferences valid or invalid? Provide an explana-
tion!
(a) Every blue fish is a whale. This is a whale. So, this is a blue fish.
CHAPTER 1. INTRODUCTION 13
(b) Well, I didn’t not miss the train. So, I missed the train.
(c) If you had checked your email, then you’d have seen my message,
and you didn’t see my message. So you didn’t check your email.
(d) Every rose is red. So there’s at least one red rose.
(e) If you did that, then pigs can fly. So, you didn’t do it.
1.7.2 [h] Give an argument that if an inference is valid, then adding addi-
tional premises doesn’t cancel the validity of the inference.
1.7.3 [h] For every invalid inference, it’s possible to add one or more premises
to make it valid. Why? (There’s actually more than one way of achiev-
ing this, find at least two.)
A (very) short, informal introduction to the core ideas of logic that I can
warmly recommend is:
The first four chapters of that book give you a slightly more detailed, infor-
mal overview of the material that we’re going to cover. The author, Graham
Priest, is a famous non-classical logician, he believes that there are true
contradictions. Because of this, his booklet is particularly good at taking
non-classical views into account. The later chapters of that book can also
be recommended, by way of outlook on the broader field of modern logic.
In block 2 of this year, you will take “Wiskunde voor KI,” which is a proper
mathematics course. That course covers the material of the following two
chapters (and much more) in way more detail. The purpose of the present
chapters (and corresponding section of the course) is to bring you up to speed
so that we can study logic.
14
CHAPTER 2. A MATHEMATICS PRIMER FOR ASPIRING LOGICIANS15
2.2 Mathemateze
2.2.1 As you know from from high-school, mathematical language is full of
special symbols, which you will have to be able to read in order to
understand what’s being said in the first place. For this reason, we’ll
first cover some notation.
2.2.2 Mathematicians frequently use Greek letters, and you should be fa-
miliar with their names/pronunciations. Here are the most commonly
used letters and their names, capitals are included some cases but not
in others:
Letter Name
α alpha
β beta
Γ, γ gamma
∆, δ delta
epsilon
ζ zeta
η eta
Θ, θ theta
ι iota
κ kappa
Λ, λ lambda
µ mu
ν nu
Ξ, ξ xi
Π, π pi
ρ rho
Σ, σ sigma
τ tau
Φ, φ, ϕ phi
χ chi
Ψ, ψ psi
Ω, ω omega
variables are said to range over the objects of the category. In our
example, a and b range over numbers. A variable can assume any
value from among the objects it ranges over. For example, we can
have that a = 0, a = 1, a = π, and so on. Absent further information,
we don’t know what the value of a given variable is. So, all we know,
for example, if n ranges over the natural numbers is what follows from
n being a natural number: that 0 ≤ n, that n ≤ n + 1, and so on.1
But we don’t know, for example, whether n is even, odd, prime, or
the like. That n has such properties would need to be inferred from
extra information. For example, if it’s given that n is a prime number
bigger than two, then we can infer that n is odd.
2.2.4 Strictly speaking, you always need to declare your variables: you need
to say which kind of object they range over. This is typically done
using the word “let.” You would, for example, say: let n be a natural
number, let f be a function, or the like. But there are many different
phrases that can be used to the same effect, for example:
2.2.5 Always having to declare one’s variables quickly gets tedious. This is
why we have conventions concerning standard variables for important
categories of objects. Some standard variables used in mathematics
and their associated categories are:
Object Variable
unspecified x, y, z, . . .
sometimes: a, b, c, . . .
natural numbers n, m, l, . . .
indices i, j, . . .
sets of indices I, J, . . .
functions f, g, h, . . .
also: λ, σ, τ, . . .
sets X, Y, Z, . . .
conditions Φ, Ψ, . . .
formulas φ, ψ, θ, . . .
also: A, B, C, . . .
1
There is quite some dispute about whether zero counts as a natural number or not.
In the context of this course, unless stated otherwise, we will always assume that it is.
CHAPTER 2. A MATHEMATICS PRIMER FOR ASPIRING LOGICIANS17
propositions p, q, r, . . .
also: P, Q, R, . . .
Note the pattern here. The first variable for a category is typically
chosen mnemonically—number, f unction, index, φormula, . . . —and
the following continue in alphabetical (or inverse alphabetical) order.
Also, “higher-order” objects, like sets or conditions, typically get cap-
ital variables.
0+0=0+0
0+1=1+0
1+0=0+1
...
2.2.7 Variables also allow us to talk about numbers where we don’t know
precisely what they are. Take the first prime number bigger than 436 ·
1099 . By Euclid’s theorem, we know that this number exists: there
are infinitely many prime numbers and there are only finitely many
numbers smaller than 436 · 1099 , so there needs to be a first prime
number after 436 · 1099 . We can refer to this number using a variable
by saying: let n be the first prime number bigger than 436 · 1099 . It’s
difficult to refer to this number explicitly, or to even determine which
number it is: the number is very, very large. All we know is that the
number exists. Another way of saying this is: there exists a natural
number n such that n is the first prime number after 436 · 1099 .
indices: a1 is the first apple, a2 the second apple, and a3 the third
apple. What a mathematician would typically say in such a situation
is something like this: suppose we have three apples, a1 , a2 , and a3 .
2.2.9 Sometimes, we only know that we have finitely many objects, but not
how many precisely. The standard way of expressing this mathemati-
cally is to say something of the sort: consider n-apples, a1 , . . . , an . Here
n is used as a variable for a some arbitrary but fixed natural number,
just like we discussed above. When we use numbers as indexes for
objects in this way, we typically use i, j, . . . as variables ranging over
these numbers. For example, we would say something like: consider
n-apples, a1 , . . . , an and let ai be one of these apples, for 1 ≤ i ≤ n.
Here i ranges over the numbers from 1 to n used as indices, it is an
index variable. Note that for each i between 1 and n, ai is a variable
that ranges over apples.
2.2.10 As we said, a variable always stands for an arbitrary but fixed object
of some category. But note that the information which kind of object
a variable stands for is only valid in a given context with a preceding
variable declaration. For example, if we let n stand for the first prime
after 436 · 1099 , then n refers to this number until the context of our
assumption (current proof, sub-argument, etc.) is closed and we move
to the next context. Only when we move to a different context— a new
proof, for example— we can re-use n as a variable. If we use n again in
the same context, it still refers to the first prime after 436·1099 . So, for
example, if you were to talk about finitely many apples a1 , . . . , an in
the same context where you’ve earlier assumed that n is the first prime
after 436 · 1099 , then you would in fact be talking about that many
apples (rather than some arbitrary finite number as per 2.2.9). So:
watch out that you’re always clear on your variable declarations and
what you can and cannot assume about the values of your variables.
nience. Suppose that we’ve just established that there exists a natural
number n such that n is the first prime number after 436 · 1099 . This
number is not important enough to justify introducing a new constant
for it, but it might be useful to free up the variable n again for later
use—n is such a convenient variable for natural numbers. So we might
call the number n, whose existence we’ve just established, a and con-
tinue to use n as we please. Conceptually, what’s happening here is
nothing but a new variable declaration, but it’s fruitful to think about
it as introducing a “temporary name” for an object.
2.2.14 If two things are equivalent—the one is the case iff the other is—
then the two things can be exchanged for each other in practically
all mathematical contexts. For example, according to our account of
validity given above, we can freely go back and forth between saying
that an inference is valid and saying that in every possible situation
where the premises are true, the conclusion is true as well. The two
phrases (practically) mean the same thing. This is why “iff” is often
used in definitions (see below).
2.2.15 Here are some other abbreviations often found in mathematical writing
together with their associated meaning:
Abbreviation Meaning
i.e. id est, that is
e.g. exempli gratia, for example
viz. videlicet, namely
s.t. such that
w.r.t. with respect to
w.t.s want to show
q.e.d. quod erat demonstrandum
fr for (especially hand-written)
df. or dfn. definition (especially hand-written)
thm. theorem (especially hand-written)
2.2.16 We now turn from notation to meaning. You might have noticed that
CHAPTER 2. A MATHEMATICS PRIMER FOR ASPIRING LOGICIANS20
2.2.22 But note that not any list of necessary and sufficient conditions consti-
tute a proper definition. For a definition to be successful, we demand
that the defined concept doesn’t occur among the conditions being
used to define it. Why? Well, a definition that violates this constraint
wouldn’t be very useful. Suppose we would define an even number as
one that is the product of an even number with some other number.
It’s true that a number is even iff the number is the product of an even
number with some other number. So the conditions are necessary and
sufficient for a number to be even. But this is not a particularly useful
3
You might wonder: why didn’t he say positive natural number? The reason is that,
in mathematics, it’s standard to reserve positive for numbers (strictly) bigger than zero.
So, zero isn’t positive. But then being positive can’t be a necessary condition for being a
natural number: zero is not positive but a natural number. Zero is, however, not negative,
for a negative number is one that is smaller than zero and zero isn’t smaller than itself.
CHAPTER 2. A MATHEMATICS PRIMER FOR ASPIRING LOGICIANS22
2.2.24 The way of defining a property generalizes to relations, like the relation
≤ on the natural numbers. For two natural numbers n, m, we say that
n ≤ m iff there exists a natural number k such that n + k = m. The
relation ≤ is called binary because it relates two objects. There are
also ternary, quaternary, quinary relations, and so on. More generally,
we call a relation n-ary iff it relates n objects, where n is a natural
number. So a binary relation is a 2-ary relation, a ternary relation is a
3-ary relation, and so on. Here’s an example of a definition of a ternary
relation: a point (on the plane) x lies in between two points y and z
if and only if there is a straight line that connects y and z which goes
through x.
2.2.25 Just like with definitions of objects, there is sometimes more than
one definition of a given property or relation. For example, n ≤ m for
natural numbers n and m can equivalently be defined by the condition
n
that m ≤ 1. It’s good to know alternative definitions of important
properties and relations.
2.2.27 There’s also a way in which learning mathemateze is not like learn-
ing a language, at least not like learning a language in (high)school.
When you learn definitions in mathematics, you should not just mem-
orize them, like your vocabs in school-English. It is much, much more
important that you understand a mathematical definition rather than
that you memorize it. This is what the previous steps are supposed to
help you with. And once you’ve properly understood a definition, it
will actually be easy to remember it, or at least to be able to recon-
struct it from memory.
2.2.28 As you will see once we get more advanced, certain kinds of mathe-
matical objects have a special way of being defined: a set, for example,
is defined by specifying its members, a function is defined by saying
which output it gives for which input, and so on. These special kinds of
definitions can always be traced back to the general kind of definition
we characterized above in 2.2.2, but they tell us something about the
(mathematical) nature of the objects under consideration. For exam-
ple, the fact that a set can be defined by specifying its members tells
us that there is nothing more to being a set than being a collection
of objects (more on sets in the next chapter). Keep an eye out for the
way in which an individual object of a certain kind—a set, a function,
a language, a model, . . . —is defined, you will better understand what
these objects are (mathematically speaking).
CHAPTER 2. A MATHEMATICS PRIMER FOR ASPIRING LOGICIANS24
2.2.29 Having covered all of this notation, it’s important to get clear on its
benefits and drawbacks. The primary purpose of most of the features
of mathemateze that we’ve just discussed is precision, they allow us to
phrase our claims in such a precise way that we can establish them be-
yond a reasonable doubt—that we can prove them. We’ll cover proving
things in the next section, the section on mathodology. But the pre-
cision I just mentioned comes at a price: as you can probably agree,
a properly formulated mathematical claim can be (very) difficult to
properly understand. And so there is also a role for natural language
in mathematics: it can make the very precise claims of mathemateze
intuitively perspicuous. Just compare the two claims:
The two claims say exactly the same thing. While the first is very
precise and, once understood, easily seen to be true, the second is far
more intelligible.
2.3 Mathodology
2.3.1 One of the most important mathematical activities is proving things.
A mathematical proof is a rigorous, step-by-step argument which es-
tablishes the truth of a mathematical statement. Importantly, in a
mathematical proof, every step needs to be justified, nothing should
remain vague or unclear.
0 is a natural number
for no natural number n, n + 1 = 0
for all natural numbers n, m, if n + 1 = m + 1, then n = m
for all natural numbers n, n + 0 = n
for all natural numbers n, n + (m + 1) = (n + m) + 1
....
2.3.4 Axiomatic proofs are an epistemic ideal, you almost never find a full
axiomatic proof in the literature. The point of most mathematical
writing is to convince the reader that a purely axiomatic proof exists.
It’s left to the interested reader to figure out the details. Of course,
whether a given piece of writing convinces you, depends on your back-
ground. Mathematical writing for beginners is much more detailed
than writing on an advanced level. In this course, you’ll get more and
more advanced and we’ll get, correspondingly, less and less detailed.
CHAPTER 2. A MATHEMATICS PRIMER FOR ASPIRING LOGICIANS26
2.3.7 Having to rigorously prove a mathematical fact may seem like a daunt-
ing task at first. To make things easier for you, I recommend following
these steps: figure out what you want to prove, state your claim as
clearly as possible, unfold the relevant definitions, remind yourself of
relevant facts, devise a proof strategy, write up your proof, proof-read.
Let’s go through these steps in turn:
literature. However, you can make use of results that are clearly
established in the lecture, the notes, or the like. Please make
sure that you reference where to find the proof clearly, using
the slide number or chapter.section.number.
2.3.7.5 Devise a proof strategy.
Now things get serious, you actually need to start reasoning.
What we will do at this point is to try to see why the result
holds and to derive a proof strategy from that. In our exam-
ple conjecture, finding a proof strategy is relatively easy. We
simply note that if n > 2 is a prime number, then n can’t be
even. Because if n were even, by definition, there would be a k
such that 2k = n, which contradicts the assumption that n is
prime. And if n isn’t even, then, by definition, n is odd. This
isn’t our final proof yet, we still have some cleaning up to do.
But we have a pretty good idea how to proceed.
Note that often it will not be so easy to find a proof strategy.
What you will typically do, then, is to look through all the
proof strategies/argument forms you know and see if they are
useful. Below, we list some standard proof strategies/argument
forms together with the kind of situations in which they are
typically useful. While doing more and more mathematics,
you will slowly build a mental library of proof strategies that
worked in certain situations. This will be an invaluable re-
source in trying to prove things: most often, what you’ll do
is to adapt a proof strategy you already know to the case at
hand. Bottom-line: even if this looks hard now, you will get
better at this with experience.
2.3.7.6 Write up your proof.
Now it’s time to record the results of your work, now you write
up the finished proof. If you indeed succeeded in proving your
result, it is now a result (a lemma, proposition, theorem), so
you can write:
Proposition. Let n be natural number such that n is prime.
If n > 2, then n is odd.
When you claim a result, you will have to follow up with a
proof. The proof typically comes afterwards in a separate proof
environment. You begin the proof by declaring your variables
and listing your assumptions (possible naming them for ease
of reference). Then you reason carefully, step-by-step to the
desired result:
definition, this means that (i) 1 < n and (ii) there are no
natural numbers k, l < n such that n = k · l. We want to
show that if n > 2, then n is odd. So, suppose that n > 2.
By definition, for n to be odd would mean that n is not even.
We claim that given our assumptions, n cannot be even and
hence must be odd. For suppose that n is even. By definition,
this would mean that there exists an m such that n = 2m. But
this would contradict condition (ii) for n being prime: just let
k = 2 and l = m. Note that 1 < n and n = 2m, it follows that
m < n and we have 2 < n by assumption . So, n cannot be
even, which means that n must be odd.
Note the at the end of the proof. It marks the end of the
proof and is read Q.E.D., i.e. quod erat demonstrandum (what
was to be shown).
We’ve completed our proof.
2.3.7.7 Proof-read.
As with any piece of writing, it’s important to double check
what you’ve written. At this stage of proving things, go through
what you’ve written once more. Ask yourself: Are my defini-
tions correct(ly phrased)? Is every reasoning step explained?
Are all my variables declared? Is my wording understandable?
—Keep in mind that your proof will be read by somebody
else, you’re not writing it for yourself but to convince some-
body else. Write for a reader, not for yourself. We grade your
mathematical writing not only in terms of correctness but also
in terms of intelligibility.
Now you’re (finally) done. Typically, at this part, we’ll discard
our notes and rest content with our finished, polished proof.
Especially when handing in homework, what you will report is
your proof and not your notes (unless asked specifically).
that the if-then claim is false for we’d get a contradiction: the
if-part would need to be both true and false. So, given that
we can derive the negation of the if-part from the negation
of the then-part, the if-then claim cannot be false, so it must
be true.
Use. Contraposition is very useful if the then-part contains
a disjunctive claim (as in the example below).
Examples.
Proposition. Let n, m be natural numbers. If n · m is even,
then either n is even or m is even.
Proof. Suppose that n and m are natural numbers. We want
to show that n · m is even, then either n is even or m is
even. We prove the contrapositive, i.e. if neither n nor m is
even, then n · m is odd. Note that if neither n nor m is even,
then both n and m are odd. This means that n = 2k + 1
and m = 2l + 1 for natural numbers k, l. Now consider the
number n · m. Since n = 2k + 1 and m = 2l + 1, we have that
n · m = (2k + 1)(2l + 1) = 4kl + 2k + 2l + 1 = 2(2kl + k + l) + 1.
But now note that 2(2kl + k + l) + 1 is of the form 2x + 1
for x a natural number, just let x = 2kl + k + l. But this just
means that 2(2kl + k + l) + 1 = n · m is odd, which is what
we needed to show.
Biconditional Proof.
Form. We prove that two statements are equivalent (the one
is true iff the other is) by showing that (i) if the one is true,
so is the other (the left-to-right or ⇒ direction) and that
(ii) if the other is true, so is the one (the right-to-left or
⇐ direction). Note that we can prove (i) and (ii) using any
kind of proof principle we like, but often conditional proof is
useful.
Justification. Essentially, an equivalence claim (iff-statement)
is just a combination of two if-then statements. To say that
n is odd iff n is not even is to say that (i) if n is odd, then
n is not even, and (ii) if n is not even, then n is odd. So,
essentially, we need to prove two if-then claims, which is what
biconditional proof amounts to.
Use. I cannot stress this enough: you always need to prove
both the left-to-right and the right-to-left direction if you try
to establish an equivalence claim.
Example.
Proposition. Let n be a natural number. Then n2 is even
iff n is even.
CHAPTER 2. A MATHEMATICS PRIMER FOR ASPIRING LOGICIANS35
n2 = (2k + 1)2 = 4k 2 + 4k + 1
Example.
Note that basically every proof we’ve discussed so far is just
one application of universal generalization away from prov-
ing a universal, for-all claim. Take the following proposition
we’ve proven above:
Proposition. For n a natural number, n2 + n is even.
We could easily transform the proof of this proposition in a
proof of the following proposition:
Proposition. For all natural numbers n, n2 + n is even.
Or, informally put, the result of squaring a natural number
and then adding the number itself to this will always result
in an even number. The proof of this will be almost like the
proof of the previous proposition:
Proof. For universal generalization, let n be an arbitrary nat-
ural number. [insert proof of previous proposition here]. Since
n was arbitrary, we can conclude that all numbers have the
desired property.
It’s a simple exercise to do the same with the other claims
made in the chapter.
So, you can see that there is not much of a difference be-
tween using universal statements and using declared vari-
ables. Strictly speaking, however, to prove a universal claim
you need to reason by universal generalization (or something
to the effect).
going to repeat here since all of this applies to this course (this is a direct
quote from p. x of that book):
Observe — The power of Sherlock Holmes came not from his deduc-
tions but his observations.
Prepare to be wrong — You will often be told you are wrong when doing
mathematics. Don’t despair; mathematics is hard, but the rewards are
great. Use it to spur yourself on.
Reflect — Look back and see what you have learned. Ask yourself how
you could have done better.
Follow these steps to construct a proof: figure out what you want to
prove, state your claim as clearly as possible, unfold the relevant defi-
nitions, remind yourself of relevant facts, devise a proof strategy, write
up your proof, proof-read.
Over time, you will slowly build a mental library of proof strategies
that worked in certain situations. Study existing proofs and try to
understand them, why they work, how they approach the problem.
This is the best way to build that mental library.
What do you think is a good proof strategy to tackle this? (This is, of
course, somewhat subjective, but think about it!)
2.7 Exercises
2.7.1 For each of the arguments you gave in exercise 1.7.1, determine which
argument forms you’ve used.
2.7.2 Prove the following simple, number-theoretic facts. Make use of the
step-by-step procedure laid out in 2.3.7.
(a) Formulate a necessary but not sufficient condition for n being even.
(b) Formulate a sufficient but not necessary condition for n being even.
(c) Formulate a necessary and sufficient condition for n being even.
2.7.4 [h, 6 x] For each of the following mathematical statements, express the
statement in ordinary language, without the use of mathematical sym-
bols.
CHAPTER 2. A MATHEMATICS PRIMER FOR ASPIRING LOGICIANS40
2.7.5 [6 x] Consider our running example from 2.3.7 and its final proof:
Proposition. Let n be a natural number such that n is prime. If
n > 2, then n is odd.
Describe the theorem and its proof in natural language without the
use of mathematical symbols.
I can warmly recommend both of these books, they will make your life much
easier when it comes to studying any field that uses modern mathematics,
such as logic, (parts of) philosophy, linguistics, (theoretical) computer sci-
ence, . . . .
Most of the things we covered above are covered in those books at greater
length and in more detail. It might be that, here and there, the books contra-
dict what I said above by way of advice—but those are primarily questions
of style and not of substance.
3.1.3 A set may contain any number of elements. The set {0}, for example,
has just one member—the number 0. A set with exactly one member
is also called a singleton set.1 The set {2, 14} has two members. And so
on. Sets can also have infinitely many members. An important infinite
set we’ll encounter frequently is N, the set of all natural numbers. You
might be tempted to write N = {0, 1, 2, . . .} but it’s important to resist
this temptation. In order to define a set, for each object it needs to
be clear whether it’s an element of the set or not. And who’s to say
that the list 0, 1, 2, . . . continues 0, 1, 2, 3, 4, . . . and not 0, 1, 2, 4, 6 . . ..
This means that if we write N = {0, 1, 2, . . .} this leaves open whether
3 ∈ N or 3 ∈ / N.
3.1.4 Other infinite sets we’ll encounter are: Z, the set of the integers (pos-
1
It’s important to distinguish the set {0} from the number 0.
42
CHAPTER 3. ELEMENTARY SET THEORY 43
3.1.5 There also exists a set with no elements at all, the so-called empty set.
This set is of fundamental importance in logic and mathematics. We
denote this set by {} or ∅. Note especially that for each object x, we
have that x ∈/ ∅.
3.1.6 If the elements of a set are precisely the objects satisfying condition
Φ, then we can denote the set by {x : Φ(x)}. This is called a definition
by set abstraction. For example, {x : x is a prime number} is the set
that contains all and only the prime numbers. So we have that 3 ∈ {x :
x is a prime number} but 4 ∈ / {x : x is a prime number}. Note that
by Euclid’s theorem, the set {x : x is a prime number} has infinitely
many elements. So, using set abstraction, we can denote infinite sets
by a finitary expression.
To be perfectly clear : an object a is a member of the set {x : Φ(x)} iff
a satisfies the condition Φ, i.e. Φ(a)!
3.1.7 Set abstraction is typically carried out over the elements of an already
known set X, i.e. we consider the set of all members of X that sat-
isfy condition Φ. This set is denoted {x ∈ X : Φ(x)}, which is just
shorthand for {x : x ∈ X and Φ(x)}. The background set of a set
abstraction can make a sigificant difference to the sets
√ denoted.
√ E.g.
{x ∈ N : x × x = 2} = ∅ but {x ∈ R : x × x = 2} = { 2, − 2}.
3.1.8 When we’re doing set abstraction, we also often implicitly assume that
the members of the new set have a specific form. E.g. we would write
n
Q = {m : n, m ∈ Z, m 6= 0} to say that Q is the set of fractions of
n
integers. In this case, { m : n, m ∈ Z} is shorthand for:
n
{x : there exist n, m ∈ Z such that x = , where m 6= 0}.
m
We extend this notation later to the more general case.
b∈/ {1, a, 0, {b, 1}}. The moral here is that it’s important to distinguish
between subsets and elements: even though {b, 1} * {1, a, 0, {b, 1}}, we
have that {b, 1} ∈ {1, a, 0, {b, 1}}.
3.2.2 It’s easily checked that every set is a subset of itself. This will be the
first proposition that we prove:
Proof. This might seem “obvious,” but it’s important to prove even
obviously seeming facts. After all, you might think that something’s
obvious but it turns out to be false! So, consider any arbitrary set X
and arbitrary object x. Suppose that x ∈ X. It follows, trivially, that
x ∈ X. Since x was arbitrary, this means that for each x, if x ∈ X,
then x ∈ X, which is another way of saying that X ⊆ X. Since X was
also arbitrary, it follows that for each set X, we have that X ⊆ X.
Proof. We prove this fact “indirectly,” that is we show that the as-
sumption that some set is a proper subset of itself leads to a contra-
diction. Hence it cannot be that any set is a proper subset of itself.
Suppose that some set X is such that X ⊂ X. Call this set A. By the
definition of ⊂ we have that A ⊆ A and A 6⊆ A, which is a contradic-
tion. So there exists no set X such that X ⊂ X.
3.2.4 It’s also instructive to show that the empty set, ∅, is a subset of every
set whatsoever:
Proof. We show this fact again indirectly. Suppose that there exists
a set X such that ∅ * X. Call this set A. We get that ∅ * A, which
means that there exists at least one object x such that x ∈ ∅ but
x∈/ A. Call this object a. We get that a ∈ ∅. But we know that for
each x, x ∈/ ∅, and hence a ∈ / ∅. We’ve arrived at a contradiction,
a ∈ ∅ and a ∈
/ ∅. Hence the assumption that there exists a set X such
that ∅ * X is false, which means that for each set X, we have that
∅ ⊆ X.
CHAPTER 3. ELEMENTARY SET THEORY 45
℘(X) = {Y : Y ⊆ X}.
That is, the power set of X is the set of all the subsets of X. So, for
example, we have that ℘({1, 2}) = {∅, {1}, {2}, {1, 2}}. Note that by
the propositions proved in 3.2.2 and 3.2.4, for every set X, we have
that ∅, X ∈ ℘(X).
For example, it follows from the axiom of extensionality that the sets
{1, 2}, {2, 1}, {1, 1, 2}, {2, 1, 1, 2}, . . . are all one and the same sets—for
they have precisely the same members. In other words, in set-theory
the order and multiplicity of the elements of a set doesn’t matter.
3.3.2 Note that in order to show that two sets X and Y are identical, we
have to show two things: (i) we have to show that X ⊆ Y and (ii)
we have to show that Y ⊆ X. No proof of a purported set-identity is
complete without having established both of these facts. To show that
two sets X and Y are distinct, in contrast, it’s enough to establish one
of X * Y or Y * X. In other words, it suffices to show either that
there exists an x with x ∈ X and x ∈/ Y or that there exists an x with
x ∈ Y and x ∈ / X.
Proposition. Let’s say that a set X is empty iff for all objects x, we
have that x ∈
/ X. Then we have that for all sets X, if X is empty, then
X = ∅.
Proof. We prove this indirectly. So, suppose that there exists a set X
such that X is empty but X 6= ∅. Call this set A. It follows that A 6= ∅,
which means that either A * ∅ or ∅ * A. We’ve already established
that ∅ ⊆ X for every set X (cf. 2.2.4), so we can focus on the case that
A * ∅. If A * ∅, this means that there exists an object x such that
x ∈ A but x ∈ / ∅. Call this object a. We get that a ∈ A. But we’ve
assumed that A is an empty set, meaning that for all x, x ∈ / A. So,
CHAPTER 3. ELEMENTARY SET THEORY 46
certainly, a ∈
/ A. We’ve arrived at a contradiction, a ∈ A and a ∈ / A,
meaning that the assumption that there exists an empty set X with
X 6= ∅ is false. Hence, for all sets X, if X is empty, then X = ∅.
X ∪ Y = {x : x ∈ X or x ∈ Y }.
3.4.2 The intersection of two sets contains all things that are in both sets.
We denote the intersection of X and Y by X ∩ Y . More formally,
X ∩ Y = {x : x ∈ X and x ∈ Y }.
Proof. Let A and B be two arbitrary sets and suppose that A∩B = A.
We need to show that for each x, if x ∈ A, then x ∈ B. So take an
arbitrary object a and suppose that a ∈ A. Suppose for indirect proof
that a ∈
/ B. Since A ∩ B = A, it follows that a ∈ A ∩ B. But A ∩ B is
defined as {x : x ∈ A and x ∈ B}, so it follows that a ∈ B. We have
arrived at a contradiction, a ∈ B and a ∈ / B, which means that our
assumption a ∈ / B is false. Hence a ∈ B. So, if a ∈ A, then a ∈ B.
Since a was arbitrary, this means that for each x, if x ∈ A, then x ∈ B.
This just means that A ⊆ B. So, if A ∩ B = A, then A ⊆ B. And
since A and B were both arbitrary, we have that for all X and Y , if
X ∩ Y = X, then X ⊆ Y .
CHAPTER 3. ELEMENTARY SET THEORY 47
3.4.4 The operations of union and intersection can also be applied to more
than two sets. A technically convenient way of doing is is to define
union (intersection) for sets of sets. Suppose that X is a set of sets.
Then we define:
[
X = {x : there exists a X ∈ X such that x ∈ X}
\
X = {x : for all X ∈ X , we have that x ∈ X}
For example, the sets {1, a, b}, {1, a, c}, {1, b, d}. We get:
[
{{1, a, b}, {1, a, c}, {1, b, d}} = {1, a, b, c, d}
\
{{1, a, b}, {1, a, c}, {1, b, d}} = {1}
It’s
S easily checked that T for any two sets X, Y , we have that X ∪ Y =
{X, Y } and X S ∩ Y = T{X, Y } (exercise). The real advantage of the
new operations and is that they can also be applied to infinite
sets of sets, but for now, we don’t need to worry about that.
3.4.5 The difference between one set and another are all the elements that
are in the one but not the other. The difference between X and Y is
denoted X \ Y and defined by
X \ Y = {x ∈ X : x ∈
/ Y }.
3.5.3 The Cartesian product of one set with another contains all the ordered
pairs that can be formed from taking an element of the first set as
the first component and an element of the second set as the second
component. For two sets X and Y , we write X × Y for their Cartesian
product. Formally, we can define this by saying that
X × Y = {(x, y) : x ∈ X and y ∈ Y }.
X1 × . . . × Xn = {(x1 , . . . , xn ) : x1 ∈ X1 , . . . , xn ∈ Xn }.
To illustrate, consider the sets {1, 2} and {a, b}. We get that {1, 2} ×
{a, b} = {(1, a), (1, b), (2, a), (2, b)}. Note that {a, b}×{1, 2} =
6 {1, 2}×
{a, b}, since {a, b} × {1, 2} = {(a, 1), (a, 2), (b, 1), (b, 2)}. The special
case where X1 = . . . = Xn = X will be important, where we also
denote
| × .{z
X . . × X}
n times
by X n. We have, for example, that
{1, 2}2 = {1, 2} × {1, 2} = {(1, 1), (1, 2), (2, 1), (2, 2)}.
instead, is called the range of f . The range contains the possible values
of f . We denote the range of f by rg(f ). We also write f : X → Y to
say that f is a function from X to Y , i.e. dom(f ) = X and rg(f ) = Y .
To say that function f : X → Y assigns b ∈ Y as the value to a ∈ X,
f
we write f (a) = b or a 7→ b.
3.6.5 Here are some assignments from {a, b, c, d} to {1, 2, 3, 4} that aren’t
functions:
a 1 a 1
b 2 b 2
c 3 c 3
d 4 d 4
a 1 a 1
b 2 b 2
c 3 c 3
d 4 d 4
f1 f2
3.6.6 Functions are everywhere in mathematics. Take, for example, the suc-
cessor function S : N → N, which is defined by S(n) = n + 1 for all
numbers n ∈ N. Note that the domain and the range of this func-
tion are the same, which is allowed. But functions can also operate on
other kinds of objects. Take the two sets {a, b, c, d} and {1, 2, 3, 4} from
above. We can specify the two functions f1 and f2 from the diagram
in 3.6.4 as follows:
f1 f2
a 2 a 1
b 4 b 4
c 2 c 4
d 3 d 2
CHAPTER 3. ELEMENTARY SET THEORY 51
This is called a function table. It tells us for every possible input from
{a, b, c, d} what the output in {1, 2, 3, 4} is. For f1 , we have, for ex-
ample, f1 (a) = 2, f1 (b) = 4, f1 (c) = 2, and f1 (d) = 3, while for f2 ,
we have f2 (a) = 1, f2 (b) = 4, f2 (c) = 4, and f2 (d) = 2. Note that not
every element in the range is assigned as a value to some input. This
is allowed, since the range only contains the possible values for f . The
actual values of f : X → Y are the members of the set {f (x) : x ∈ X}.
This set is called the image of f , and it’s denoted im(f ). We have, for
example, im(f1 ) = {2, 3, 4} and im(f2 ) = {1, 2, 4}.
There can, of course, be more than two cases. Consider the function
g : N → {1, 2, 3}, which assigns 1 to every even number, 2 to every
prime bigger than 2, and 3 to every other number. This function can
2
The list needs to be exclusive in order to avoid that an input gets more than one
value, and it needs to be exhaustive to ensure that every input gets a value.
CHAPTER 3. ELEMENTARY SET THEORY 52
be determined as follows:
1
if n is even
g(n) = 2 if n is prime and n > 2
3 otherwise
f f f
(a, a) 7→ 0 (b,a) 7→ 0 (c,a) 7→ 1
f f f
(a, b) 7→ 1 (b,b) 7→ 0 (c,b) 7→ 1
f f f
(a, c) 7→ 1 (b,c) 7→ 1 (c,c) 7→ 0
f a b c
a 0 1 1
b 0 0 1
c 1 1 0
The convention hereby is that the first input is in the left-most column
and the second input in the top-most row. Notice that f (x, y) 6= f (y, x)
is possible, e.g. in our case f (a, b) = 1 6= 0 = f (b, a).
So, generally, if X = {a1 , . . . , an } is a finite set, the function table for
a function f : X 2 → Y is given as follows:
f a1 ··· an
a1 f (a1 , a1 ) ··· f (a1 , an )
.. .. ..
. . .
an f (an , a1 ) ··· f (an , an )
3.6.10 So far, we spoke about functions using the informal notion of an as-
signment. Formally speaking, however, a function is typically under-
stood as a special kind of set. A function f is understood as a triple
CHAPTER 3. ELEMENTARY SET THEORY 53
(dom(f ), rg(f ), Rf ). Here, dom(f ) and rg(f ) are arbitrary sets, which
constitute the domain and range of the function respectively. The spe-
cial component is Rf , which, intuitively, is the assignment relation of
the function. More formally, Rf ⊆ dom(f ) × rg(f ) is a set of pairs
(x, y) where x ∈ dom(f ) and y ∈ rg(f ) subject to the two conditions:
f1 = ({a, b, c, d}, {1, 2, 3, 4}, {(a, 2), (b, 4), (c, 2), (d, 3)})
n
3.6.11 Finally, we can generalize our notation { m : n, m ∈ Z, m 6= 0} from
3.1.8 to the general case. For f : X → Y and X 0 ⊆ X, we define:
This is really just a useful abbreviation, which we’ll use here and there.
(i) 0 ∈ N
(ii) For all n, if n ∈ N, then n + 1 ∈ N
CHAPTER 3. ELEMENTARY SET THEORY 54
Using these two facts, we easily can show that 1, 2, 3, . . . are all natural
numbers. Take the number three. Here’s how we show that 3 ∈ N: We
know that 0 ∈ N by (i). By (ii), it follows that 0 + 1 = 1 ∈ N. Again by
(ii) it follows that 1 + 1 = 2 ∈ N. Finally, again by (ii), it follows that
2 + 1 = 3 ∈ N. This clearly generalizes to every natural number n. By
n applications of (ii), we can show that n ∈ N. The bottom-line is that
(i) and (ii) together allow us to derive for every natural number that
it is a member of the set N. But we want more. We also want to be
able to show that only natural numbers are members of N, i.e. there is
no number which is not a natural number but a member of N. To do
that, we use a simple trick: we simply stipulate that the objects which
can be shown to be members of N by (i) and (ii) are all the natural
numbers. This is typically written as follows:
Note the pattern here: we first say what the result of f (n, 0) is, and
then we say what the result of f (n, m + 1) is, but in terms of what the
result of f (n, m) is. In this way, since zero and it’s successors are all
the natural numbers, we’ve said for every number what the result of
f (n, m) is. To see that that’s the case, let’s calculate f (3, 2) using the
recursive definition (i) and (ii):
In this way of calculating the result, in each step, we need to figure out
the result for a lower number, until eventually, we need to figure out
the result for zero is. This “calling upon” results for lower numbers
is where “function recursion” gets its name from. Note that because
every number is the result of adding one to zero a bunch of times, this
procedure works.
Do you recognize the function f ? What does it do? Think about it
before you move on, we’ll answer the question in a moment.
A side-remark: function recursion is of fundamental importance in
computer implementations of calculation. You can easily see why: it
allows us to specify a function with an infinite domain in a finitary
way. Otherwise, how should a computer, with finite memory, be able
to deal with functions on the natural numbers?
3.7.4 And if a set is defined inductively, then there’s a powerful proof method
for proving things about (all) its members: proof by induction. The
idea is, once more, to follow the inductive definition of the set when
CHAPTER 3. ELEMENTARY SET THEORY 56
proving things about it. To make this idea clear, let’s use N again as
an example. Suppose that Φ(n) is a condition on natural numbers,
something like “if n is even, then n is not odd” or the like. Suppose
further that we can show the following two facts:
3.7.5 In an inductive proof, the condition (i) is called the base case and (ii)
is called the induction step. So, to be precise, the form of an induc-
tive proof over the natural numbers is always that we establish that
all natural numbers have a property by showing that (i) zero has the
property and (ii) if a number has the property, then also its successor
does. Note that for step (ii), we need to establish the truth of a condi-
tional: if a number has the property, then the successor of the number
has the property. We do this by conditional proof, i.e. we assume that
a number has the property, and we derive that its successor does, too.
In this very special case, the assumption is known as the induction
hypothesis and it is referred to as such in inductive proofs. Here is an
example of a proof by induction for over the natural numbers:
3.7.6 You will exercise some more simple cases of mathematical induction
to get the idea of how inductive proofs work. You will not have to
master the technique during the course, however—this is not a course
in number theory. In the next chapter, we’ll discuss another version
of inductive proof that you will have to master, a version of inductive
proof for formal languages.
3.7.7 Before we describe how inductive definitions work in general, let’s give
recursive definitions a slightly more precise shape. The problem we’re
tackling is to make the claim that “nothing else is a member of N”
mathematically precise. The standard idea for doing this is to define
N as the smallest set that contains zero and all its successors. Here we
think of a set X as smaller than another set Y iff X ⊆ Y . The sense
in which N is the smallest set containing zero and all its successors is
that for any set X such that X contains zero and all its successors,
we have that N ⊆ X. In other words, N is smaller than any other set
containing zero and all its successors. Just think of any other set that
also contains zero and all its successors, say Z, Q, and R. Clearly, we
have that N ⊆ Z, N ⊆ Q, and N ⊆ R. Can we find a set that contains
zero and all it’s successors but not all the members of N? If “nothing
else is a member of N” is correct, the answer would need to be: no!
So, the idea would now be to define N as the smallest set X such that
the following two conditions hold:
(i) 0 ∈ X
(ii) For all numbers x, if x ∈ X, then x + 1 ∈ X.
CHAPTER 3. ELEMENTARY SET THEORY 58
How do we know that such a set exists (and that it’s unique)? Well,
that needs to be postulated as an axiom of mathematics: in axiomatic
set theory, the claim that N, so defined, exists is known as the axiom
of infinity.
3.7.8 Having given a precise definition of N, we can now prove that certain
numbers aren’t natural, i.e. we can prove claims of the form x ∈ / N.
To see how this works, let’s prove that 21 is not a natural number:
1
Proposition. We have that 2 ∈
/ N.
Proof. Let X be some set that satisfies the conditions (i) and (ii) of
the definition of N. Suppose further that 12 ∈ X. We claim that under
this assumption, also the set
k
Y =X \{ : k ∈ Z and k is odd}
2
satisfies conditions (i) and (ii).3 We prove these in turn:
It’s not terribly important that you get all the details of this argument,
but I want you to see the general form of how you might go about
proving that something’s not a member of an inductively defined set
(and that that’s surprisingly difficult). If you really want to understand
the proof (and, again, you don’t have to), try to prove the same result
using mathematical induction.
3.7.9 What’s particularly pleasing about our precise definition of N is that
it allows us prove the principle of mathematical induction:
Theorem (Mathematical Induction). Suppose that Φ is a condition
on numbers such that:
(i) Φ(0)
(ii) for all natural numbers n ∈ N, if Φ(n), then Φ(n + 1).
Then it follows that all natural numbers satisfy the condition Φ, i.e.
we have that Φ(n), for all n ∈ N.
3.7.10 Now that you’ve seen how to recursively define the natural numbers
and how we can derive the proof principle of mathematical induction
from the definition, let’s focus on the idea of recursive definitions in
general. In order to inductively define a set, we always use the following
pattern:
CHAPTER 3. ELEMENTARY SET THEORY 60
♣, ♠ ∈ Gargle
♦♣♦, ♦♠♦ ∈ Gargle
♣♥♣, ♣♥♠, ♠♥♠ ∈ Gargle
♣♥♦♣♦, ♦♠♦♥♠, . . . ∈ Gargle
3.7.12 Next, let’s discuss how function recursion works generally. As we hinted
at above, whenever we have an inductively defined set, we can use func-
tion recursion to define a function on that set. The way this works is
as follows:
3.7.14 But wait, there’s a problem. By what we said so-far about general
recursion, it’s only guaranteed that every element gets a value. But
remember from the definition of a function, that every element needs
to get a unique value. In the case of the natural numbers, this is
guaranteed since for each natural number, there is exactly one way of
“constructing it” from zero via the successor function:
n = 0+
| . .{z
. + 1}
n times
Thus, there is only one way to calculate the value of recursive function
following the construction of the number.
But note that this is not the case for the gargles. Take the gargle
♠♥♣♥♠, for example. This gargle can constructed in two ways:
CHAPTER 3. ELEMENTARY SET THEORY 62
What does this mean? Well, every number can be “read” in exactly
one way: the number n is the n-th successor of zero. For gargles, that’s
not the case: ♠♥♣♥♠ can be constructed via ♣♥♠ and it can be
constructed via ♠♥♣. Why does this matter? Well, if we want to use
function recursion to define a function on the gargles, if we’re not
careful, it might give different results depending on how we “read” a
gargle. Take, for example, the “function” f : Gargle → {0, 1} which
is defined by recursion over the gargles as follows:
You might think that this recursion defines a proper function on the
gargles, but it does not! Why? Because it gives different values for
♠♥♣♥♠, depending on how we “read” the expression:
3.7.15 Finally, we mentioned that for every inductively defined set, we have
its own form of proof by induction. The idea that we described for
the natural numbers generalizes to a general procedure as follows. In
order to show that every element of an inductively defined satisfies a
condition, we show:
3.7.16 So, how do we prove things about gargles using induction? Well, sup-
pose we want to show that all gargles satisfy the condition Φ. What
we need establish are the following things:
(i) We need to show that ♣, ♠ all satisfy the condition, i.e. Φ(♣)
and Φ(♠). This is the base case.
(ii) And we need to show that:
(a) For all x, if x satisfies the condition, then ♦x♦ satisfies the
condition, i.e. for all x, if Φ(x), then Φ(♦x♦).
(b) For all x, y, if x and y satisfy the condition, then x♥y satisfies
the condition, i.e. for all x, y, if Φ(x) and Φ(y), then Φ(x♥y).
and
#♥ (♣) = #♠ (♣) + #♣ (♣) − 1.
We only show the latter, since the former is completely analogous.
Simply note that #♥ (♣) = 0, #♠ (♣) = 0, and #♣ (♣) = 1. So we get
then
#♥ (♦x♦) = #♠ (♦x♦) + #♣ (♦x♦) − 1.
and
#♥ (y) = #♠ (y) + #♣ (y) − 1,
then
#♥ (x♥y) = #♠ (x♥y) + #♣ (x♥y) − 1
CHAPTER 3. ELEMENTARY SET THEORY 65
= #♠ (x♥y) + #♣ (x♥y) − 1
3.7.17 We conclude the section with a guideline for writing a proof by induc-
tion:
One set is a subset of another just in case all the elements of the one
set are elements of the other. A set is a proper subset of another just
in case the one set is a subset of the other but not vice versa.
Two sets are identical iff they have precisely the same elements.
CHAPTER 3. ELEMENTARY SET THEORY 66
The union of two sets contains any element of either set, their inter-
section contains only the objects that are in both sets. The difference
of one set and another contains all the elements of the one but not the
other.
The Cartesian product of two sets is the set of all ordered pairs formed
by taking an element of the first set as the first component and an
element of the second set as the second component.
(g) Every x ∈
/ X is also such that x ∈
/ Y.
(h) Every x ∈
/ Y is also such that x ∈
/ X.
(a) X ⊆ Y and Y ⊆ X.
(b) For some object x, we have that x ∈ X iff x ∈ Y .
(c) X ⊆ Y and Y * X.
(d) There is no element x ∈ X such that x ∈
/ Y and there is no element
y ∈ Y such that y ∈/ X.
(e) When we pick any element x ∈ X, we can find a corresponding
element y ∈ Y and vice versa.
(f) If we find an element x ∈ X such that x ∈ Y , then we can find an
y ∈ Y such that y ∈ X.
(c) x ∈
/X (g) x ∈
/ X and x ∈ Y
(d) x ∈
/Y (h) x ∈
/ X and x ∈
/Y
3.9.6 Let X and Y be sets. Which of the following entails that x ∈
/ X ∪Y
for an object x?
(a) x ∈ X (e) x ∈ X and x ∈ Y
(c) x ∈
/X (g) x ∈
/ X and x ∈ Y
(d) x ∈
/Y (h) x ∈
/ X and x ∈
/Y
3.9.7 Let X and Y be sets. Which of the following entails that x ∈ X ∩ Y
for an object x?
(a) x ∈ X (e) x ∈ X and x ∈ Y
(c) x ∈
/X (g) x ∈
/ X and x ∈ Y
(d) x ∈
/Y (h) x ∈
/ X and x ∈
/Y
3.9.8 Let X and Y be sets. Which of the following entails that x ∈
/ X ∩Y
for an object x?
(a) x ∈ X (e) x ∈ X and x ∈ Y
(c) x ∈
/X (g) x ∈
/ X and x ∈ Y
(d) x ∈
/Y (h) x ∈
/ X and x ∈
/Y
3.9.9 Which of the following excludes that assignment f is a function from
X to Y ?
(d) There is some element y ∈ Y , such that there are two elements
x, x0 ∈ X such that f assigns y to both x and x0 .
3.9.10 Consider the set {n2 : n ∈ N and 0 ≤ n ≤ 10} of all the squares of
natural numbers between zero and ten . Which of the following entails
that a natural number m ∈/ {n2 : n ∈ N and 0 ≤ n ≤ 10}?
3.10 Exercises
3.10.1 [h] Let X = {1, 2, 3} and Y = {1, 3, 5}. Calculate:
(a) X ∩ Y
(b) X ∪ Y
(c) X \ Y and Y \ X
(d) ℘(X) and ℘(Y )
(e) X × Y and Y × X
3.10.3 [h] Consider the function f : {1, 2, 3}2 → {1, 2, 3} which assigns to a
pair of numbers, the smaller of the two. Write the function using all
our different function notations.
3.10.6 Use the formal definition of a function (3.6.10) to prove that if two
functions assign the same output to the same input, then they are
identical.
3.10.7 [h] Remember the gargles (3.7.11). Give recursive definitions of the
following functions:
3.10.8 [h] Use induction over the gargles to prove that every gargle contains
an even number of ♦’s (note that 0 is even).
Propositional Logic
72
Chapter 4
4.1.2 What is this structure? —First, note that the sentential operators
connect sentences to form new sentences. The operator ‘not,’ for ex-
ample, takes a sentence and makes a new one out of it, it takes us
from “two plus two equals four” to “two plus two doesn’t equal four.”
The operator ‘and,’ instead takes two sentences to form a new one;
from “two plus two equals four” and “four is even,” we get to “two
plus two equals four and four is even.” Next, note that for validity in
propositional logic, it actually doesn’t matter what the sentences are
that an operator connects. Take, for example, inference (1) from the
introduction:
(1) The letter is either in the left drawer or in the right drawer, and
it’s not in the left drawer. So, the letter is in the right drawer.
(1’) The cat is either on the mat or the dog dances tango, and the cat
isn’t on the mat. So, the dog dances tango.
73
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 74
To see this, just go through the reasoning we used to see that (1) is
valid and replace “the letter is in the left drawer” everywhere with
“the cat is on the mat” and “the letter is in the right drawer” with
“the dog dances tango.”
4.1.3 So, we can abstract away from the concrete sentences in an inference,
and replace them with sentence letters, typically written p, q, r, . . . .
The sentential operators, then, are represented by the following formal
symbols:
So, the sentence “the letter is either in the left drawer or in the right
drawer” becomes the formula (p∨q) and the sentence “the letter is not
in the left drawer” becomes ¬p. If we use the symbol ∴ to stand for
the natural language expression “so,” we can therefore fully formally
represent the inference (1) as:
(p ∨ q), ¬p ∴ q
4.1.4 To define formal language (in propositional logic and beyond) we need
to do two things: we need to specify a vocabulary—the symbols we
can use to form expression of the language—and we need to define
a grammar, which tells us which expressions of the symbols from the
vocabulary are well-formed.
We have q, r ∈ P, therefore q, r ∈ L.
Since q, r ∈ L, we have that (q ∨ r) ∈ L.
We have p ∈ P and therefore p ∈ L.
Since (q ∨ r), p ∈ L, we get that (p ∧ (q ∨ r)) ∈ L.
Proof. Let X be a set such that X satisfies conditions (i) and (ii) from
the definition of L and (p ∧ ¬) ∈ X. We claim that then the set Y
defined by:
Y = X \ {(p ∧ ¬), ¬}
also satisfies conditions (i) and (ii) and Y ⊂ X. We need to show two
things. First, we show that (i) P ⊆ Y . To see this, note that P ⊆ X
and (p ∧ ¬), ¬ ∈ / P. So it follows that for all p ∈ P, p ∈ X and
p∈/ {(p ∧ ¬), ¬}. Hence, p ∈ Y , meaning P ⊆ Y .
To see that Y satisfies condition (ii.a), let’s suppose that φ ∈ Y . Since
Y = X \{(p∧¬), ¬}, it follows that φ ∈ X. And since X is closed under
negation, we can conclude that ¬φ ∈ X. But clearly ¬φ ∈ / {(p ∧ ¬), ¬}.
Hence, φ ∈ X \ {(p ∧ ¬), ¬}, meaning φ ∈ Y .
To see that Y satisfies condition (ii.b), assume that φ, ψ ∈ Y . We now
need to show four different cases (a) (φ ∧ ψ) ∈ Y , (b) (φ ∨ ψ) ∈ Y ,
(c) (φ → ψ) ∈ Y , and (d) (φ ↔ ψ) ∈ Y . But for cases (b–d), this is
easy. Since φ, ψ ∈ Y , we get that φ, ψ ∈ X. Since X satisfies (ii.b), we
get that (φ ◦ ψ) ∈ X for ◦ = ∨, →, ↔. And trivially, for ◦ = ∨, →, ↔,
(φ ◦ ψ) ∈
/ {(p ∧ ¬), ¬}. Hence (φ ◦ ψ) ∈ Y , as desired. (Why trivially?
We’ll look at the form of the members of {(p ∧ ¬), ¬}. . . )
Only in case (a), we need to reason a bit more. We again easily get
from φ, ψ ∈ Y to φ, ψ ∈ X and from there via (ii.b) to (φ ∧ ψ) ∈ X.
But can (φ ∧ ψ) be in {(p ∧ ¬), ¬}? Well, only if φ = p and ψ = ¬.
But remember that ψ ∈ Y = X \ {(p ∧ ¬), ¬}. Hence if ψ = ¬, then
ψ ∈/ Y , which contradicts our assumption that ψ ∈ Y . Hence, using
proof by contradiction, we can conclude that (φ ∧ ψ) ∈
/ {(p ∧ ¬), ¬}.
Hence (φ ∧ ψ) ∈ Y , as desired.
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 77
So, if X satisfies (i) and (ii) and (p∧¬) ∈ X, then X is not the smallest
set that satisfies conditions (i) and (ii). Hence X 6= L. For a final proof
by contradiction, suppose that (p ∧ ¬) ∈ L. By our observation, it
would follow that L = 6 L, which is a contradiction. Hence (p ∧ ¬) ∈ / L.
As you can see, it’s quite tedious to show that something isn’t a for-
mula. In the following, we’ll develop some techniques for proving that
expressions aren’t formulas that are a bit more “user friendly.”
4.1.10 But first, let’s talk about formalization. As we said above, formaliza-
tion is the process of abstracting a natural language expression into
an expression of a formal language. We don’t do this just for fun (even
though it is fun), but with a particular aim in mind: we want to check
inferences couched in natural language for validity. How to actually
check for validity will be covered in the following chapter. For now
you can note that in order for us to be able to draw any conclusion
from our formal language expeditions back to ordinary language, we
need to make sure that, whatever we do in our formalization, we can
always reverse it—we want to be able to “translate backwards.” In
order to guarantee this, every formalization begins with a translation
key, which is basically like a cipher in cryptography. A translation key
tells us for each sentence letter which natural language sentence it
stands for.
Here’s an example of a translation key:
This is just one possible key, the following one is also perfectly fine:
As you can see, ¬, ∧, ∨, →, ↔ are basically used like their natural lan-
guage counterparts. There are some special cases, however. Note, for
example, that “The letter is not in the left drawer, but it’s also not
in the right one” becomes (¬p ∧ ¬q). This is because, from the per-
spective or propositional logic, the “but” only carries the information
that both sentences are true—the implicit sense of surprise implied
by the use of “but” is something we don’t care about from a logical
perspective.
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 79
4.1.13 To conclude our brief treatment of formalization, let me say that being
able to provide a good formalization is much like translating well from
one language to another. It requires a good understanding of both
and a careful attention to linguistic subtlety. As such, formalization
is something you’ll have to learn, slowly. You’ll be much better at it,
once you’ve properly understood how formal languages work, what the
meaning of formal expressions is, given by their semantics, and so on.
For now, my advice is just: exercise, exercise, exercise.
4.2.2 We’re going to use induction on formulas a lot in this course. Almost
always when I ask you “how are we going to prove this?,” the answer
is going to be “by induction, of course!” So, let’s be clear on how you
write a proof by induction:
4.2.4 First, we’re going to note a fact about parentheses, which essentially
depends on the fact that for every opening parentheses, there has to
be a corresponding closing one in a proper formula. The fact is the
following:
4.2.5 Before we move to the next section, we will prove one more useful
result for proving that something isn’t a formula. Note that we said
that every formula of L is made up of symbols from its vocabulary.
It’s high-time, we proved this:
theorem states that for each formula, there is a unique way to construct
that formula from the sentence letters using the sentential connectives.
Importantly, this makes formal languages computer-readable: it means
that a computer, who lacks human intuition and context-sensitivity,
can always precisely figure out what a given formula is supposed to
say.
4.3.2 The unique readability theorem is, in effect, a consequence of our tidy
use of parentheses. To illustrate how, consider the “formula” p ∧ q ∨ r,
which is of course not a proper formula, but suppose for a second that
we would allow expressions like this. Well, there would be two ways of
“reading” or parsing that formula:
p∧q∨r p∧q∨r
q r p q
This is not only bad for function recursion (for issues we discussed in
the context of the gargles) but also messes up our intended informal
reading of the formula. Suppose we use a translation key where p
stands for “I drink a coffee,” q for “I have toast,” and r for “I have
eggs.” Then, our two ways of parsing the sentence correspond to two
very different informal meanings:
The two are really very different in meaning: in the former case you
have a beverage and food and in the second either you have a beverage
and food or just some food.
But this is just a cautionary tale: the problem actually doesn’t arise in
propositional logic, as long as we use our parentheses properly—which
is what we’re going to prove in this section.
4.3.3 To state the unique readability theorem, we will make use of the notion
of a parsing tree. And before that, the notion of a tree.3 Roughly
speaking, a tree is a structure of the following form:
3
Mathematicians call the structure that we’re studying here (more correctly) a directed
rooted tree, but for simplicity we’ll just drop the modifiers.
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 84
• •
• • • • •
.. .. .. .
. . . • ..
The dots are called the nodes of the tree and the lines connecting
them the edges.
The upper-most node is called the root of the tree and the lower-
most nodes its leaves.
If x is a node in the tree and y is directly above x, i.e. there is
an edge pointing from y to x, then x is called a child of y and y
the parent of x.
A path in the tree is a sequence of nodes which are connected by
edges.
4.3.4 To define the parsing tree of a formula, we will, for the first time, make
use of function recursion over L. So let’s briefly remind ourselves how
this works in general (remember 3.7.12–13). In order to recursively
define a function over an inductively defined set:
In the case of L, this means we have to give the values of the function
for all sentence letters and we have to say how the function behaves
under the sentential operators. Note that we will have to prove that
this actually defines a function on L—remember the unique readability
issue. We’ll do in a moment. For now, we will pretend that it does and
justify that assumption ex post, i.e. afterwards.
4.3.5 We will now use function recursion to define a function T , which maps
any formula φ ∈ L to its parsing tree:
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 85
¬φ
(ii.a) T (¬φ) =
T (φ)
(φ ◦ ψ)
(ii.b) T ((φ ◦ ψ)) = for ◦ = ∧, ∨, →, ↔
T (φ) T (ψ)
What a parsing tree does is, essentially, tell us how the formula in
question was constructed. To see how, it’s best to look at some exam-
ples.
4.3.6 One useful piece of terminology: the first sentential operator who’s rule
is applied when we construct the parsing tree for a formula is called the
main operator of that formula. This operator will become particularly
important when we do semantics in the next chapter. For now, it will
allow us to refer to statements based on their main operator:
(i)
(p ∧ (p → q)) ¬q
T (((p ∧ (p → q)) → ¬q)) =
p (p → q) q
p q
Main operator: →
(ii)
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 86
(p ∧ (q ∨ ¬q))
p (q ∨ ¬q)
T ((p ∧ (q ∨ ¬q))) =
q ¬q
Main operator: ∧
(iii)
((p → q) ∨ (q → r))
T (((p → q) ∨ (q → r))) = (p → q) (q → r)
p q q r
Main operator: ∨
(iv)
¬¬¬¬q
¬¬¬q
T (¬¬¬¬q) = ¬¬q
¬q
Main operator: ¬
In each of these cases, you can read the tree from bottom to top
to get a construction of the formula in question from the sentence
letters. This is the precise sense in which a parsing tree tracks
the construction of a formula.
The following point is the most difficult in this chapter. If you don’t
get it immediately, don’t despair! Follow the advice on reading math:
try to think this through, consider examples, draw pictures, etc. And
then move on. The details of this proof are not the most important
thing to take out of this chapter—the content of the main theorem is!
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 87
4.3.8 We will now prove that our recursive definition of T indeed assigns
to each formula φ a unique parsing tree, i.e. we prove that T is a
function. We do this in two steps, by proving two central lemmas.
In order to properly state these lemmas, we need to read (i) and (ii)
from (4.3.5) as conditions on something being a tree for a formula—
otherwise, we’d already assume the truth of these lemmas. The idea
is that, for example, (4.3.5.i) says that a tree T is a parsing tree of p
iff T = p. And (4.3.5.ii.a) says that T is a parsing tree for ¬φ iff T is
of the form
¬φ
T0
(φ ◦ ψ)
T ((φ ◦ ψ)) = for ◦ = ∧, ∨, →, ↔
T (φ) T (ψ)
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 88
(i) Base case. Let p ∈ P be a sentence letter, and T1 (p) and T2 (p)
two trees satisfying the conditions (i–ii) from (4.3.5). But condi-
tion (4.3.5.i) says that T (p) = p, so T1 (p) = p = T2 (p), which is
what we needed to show.
(ii) Induction steps.
(a) Suppose the induction hypothesis that if T1 (φ) and T2 (φ) are
two trees for φ which satisfy conditions (i–ii) from (4.3.5),
then T1 (φ) = T2 (φ). Now consider two trees for ¬φ, i.e.
T1 (¬φ) and T2 (¬φ). By (4.3.5.ii.a), we have that:
¬φ ¬φ
T1 (¬φ) = and T2 (¬φ) =
T1 (φ) T2 (φ)
where T1 (φ) and T2 (φ) are trees for φ which satisfy the condi-
tions (i–ii) from (4.3.5). But then, by the induction hypoth-
esis, T1 (φ) = T2 (φ). And so, T1 (¬φ) = T2 (¬φ), as desired.
(b) Suppose the first induction hypothesis that if T1 (φ) and
T2 (φ) are two trees for φ which satisfy conditions (i–ii) from
(4.3.5), then T1 (φ) = T2 (φ). And suppose further that if
T1 (ψ) and T2 (ψ) are two trees for ψ which satisfy conditions
(i–ii) from (4.3.5), then T1 (ψ) = T2 (ψ).
Now consider two trees for (φ◦ψ), for ◦ = ∧, ∨, →, ↔, T1 ((φ◦
ψ)) and T2 ((φ ◦ ψ)). By (4.3.5.ii.a), we have that:
(φ ◦ ψ) (φ ◦ ψ)
T1 ((φ ◦ ψ)) = and T2 ((φ ◦ ψ)) =
T1 (φ) T1 (ψ) T2 (φ) T2 (ψ)
where T1 (φ) and T2 (φ) are trees for φ which satisfy the condi-
tions (i–ii) from (4.3.5), and T1 (ψ) and T2 (ψ) are trees for ψ
which satisfy the conditions (i–ii) from (4.3.5). But then, by
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 89
We conclude by using (i) and (ii) to infer by induction that the parsing
tree for every formula is unique.
Put together, the two lemmas yield our unique readability theorem:
τ
Then proceed to step 6.
5. Is the expression you’re currently looking at of the form (τ ◦ π),
◦ = ∧, ∨, →, ↔, and there is no other connective = ∧, ∨, →, ↔
such that the expression is of the form (τ 0 π 0 ) and is enclosed
in fewer parentheses than ◦?
(a) If not, terminate: σ is not a formula!
(b) If yes, apply the following rule:
(τ ◦ π)X
τ π
Then proceed to step 6.
6. In the tree you’ve constructed so far, is there an expression at a
leaf without a X next to it?
(a) If no, terminate: σ is a formula ,
(b) If yes, then pick one and look at it. Go back to step 2.
4.3.11 We will not prove that this algorithm actually completes its task, we
won’t formally verify the algorithm. To do so, is actually not that hard
given all the facts we’ve already observed. But it’s tedious and so we’ll
leave the task to the interested reader. Note that what you would need
to show are three things: (i) the algorithm always terminates, (ii) if the
algorithm terminates and says that the expression is a formula, then
it is indeed a formula, and (iii) if the algorithm terminates and says
that the expression is not a formula, then it is indeed not a formula.
Here we simply observe (again without proof) that the algorithm, if
applied to a formula, actually yields the parsing tree of that formula.
To see this, try it out! Apply the algorithm to some formulas and see
what you get. Here we give just one example:
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 91
(p ∨ (q ∨ (r ↔ (¬s ∧ t))))X5.b
¬sX4.b tX3.b
sX3.b
Note that in the first step (5.b), we parse according to the first ∨
because it’s in fewer parentheses than the second ∨, the ↔ and the ∧.
4.3.12 We conclude the section with two example applications of the algo-
rithm to illustrate how it can be used to show that something isn’t a
formula:
((p ∧ q) → ¬(r))X5.b
(p ∧ q)X5.b ¬(r)X4.b
¬¬(p(↔)q)X4.b
¬(p(↔)q)X4.b
(p(↔)q)X5.b
(p(/2.a )q)/2.a
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 92
4.4.2 The first of the two functions, we’ll define a function that maps each
formula to the set of formulas it was constructed from. These formulas
are called the sub-formulas of the formula in question. We define the
function as follows using function recursion:
¬φ
T (¬φ) =
T (φ)
We can thus use induction to infer that the claim holds for all φ.
Now think about the longest path you can travel from the
root in T (¬φ). Well, it’s going to be the longest path you
can travel in T (φ) plus one edge to the new root, i.e. ¬φ.
Since c(¬φ) = c(φ) + 1, this means that, by the induction
hypothesis, the claim holds.
(b) Assume the induction hypotheses that c(φ) is the length of
the longest path from the root in T (φ) and c(ψ) is the length
of the longest path from the root in T (ψ). By the (ii.a) defi-
nition of parsing trees, we know that:
(φ ◦ ψ)
T ((φ ◦ ψ)) =
T (φ) T (ψ)
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 95
Now think about the longest path you can travel in T ((φ◦ψ)).
Well, take the longest path you can find in either T (φ) or
T (ψ). Let’s suppose that the path is in T (φ) (if it is in T (ψ),
the argument is completely analogous). The longest path you
can travel from the root in T ((φ ◦ ψ)) is going to be precisely
this path plus the one new edge connecting T (φ) to the new
root (φ ◦ ψ). Since c((φ ◦ ψ)) = max(c(φ), c(ψ)) + 1, this just
means that the claim also holds here.
We can thus use induction to infer that the claim holds for all φ.
4.5.2 Before we begin, note that conventional notation is only ever allowed
outside the context of syntax theory, i.e. in semantics and proof theory.
And even there, it’s often better to be safe than sorry. As we said a
couple of times by now: the parentheses are there for a reason. It’s
much easier to make mistakes using conventional notation than it is
in official notation. That being said, conventional notation can be a
real boon on your wrist.
4.5.3 The first convention is that you can always omit any outermost paren-
theses. So, instead of (p ∧ q), you can simply write p ∧ q. The reasoning
behind this is that these are easy to fill in: if a logician writes p ∨ q,
it’s pretty clear what they mean: (p ∨ q).
4.5.4 The second convention is that in a series of ∨’s or ∧’s, you can leave
out the repeatedly nested parentheses. So, for example, instead of the
official ((p ∧ (q ∧ (r ∧ (s ∧ t))))), we can simply write p ∧ q ∧ r ∧ s ∧ t (also
applying the convention about outermost parentheses). Note that this
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 96
p∨q∨r p∨q∨r
q r p q
This makes the convention a bit harder to justify. But note that the two
different “readings” of the formula don’t really say anything different.
Take the following two sentences:
They really seem to say the same thing. We’ll only be able to properly
justify the convention in the next chapter, when we talk about logical
equivalence, but for now, I hope these examples illustrate why we can
allow for this little bit of ambiguity. Note that in mixed series of ∧
and ∨, we cannot omit parentheses. I.e. p ∧ (q ∨ r) needs to stay just
that.
p∧q →r p∧q →r
q r p q
now unambiguously, gets the second of the two readings. That is, p ∧
q → r is then simply read as (p ∧ q) → r. This is the idea of binding
strength: we say that ∧ binds stronger than →. This idea allows us to
leave out a bunch of parentheses, which we can easily fill in by reading
the right operator first.
4.5.6 The relative binding strength of the operators is given in the following
diagram:
¬ > ∧ = ∨ > → > ↔.
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 97
Explicitly, this means that, in a case of conflict, you always read the ↔
first, then →, then ∨ and ∧, and only finally ¬. Note that ∧ and ∨ have
precisely the same binding strength, so in expressions like p∧(q∨r), we
really can’t leave out any parentheses. But if we consider an expression
like ((p ∧ q) ↔ (p ↔ q)), we can easily leave out a some:
p q p q p q
4.5.7 These ideas need some getting used to. For that reason, there are
plenty of exercises included at the end of this section (4.8.9 and 4.8.10),
solutions for which can be found in the appendix.
Syntactic recursion works by specifying the value for the sentence let-
ters and how to calculate the value for a complex formula from the
values for its subformulas.
The parsing tree of a formula gives you its internal structure: it shows
how the formula was constructed.
4.7.3 Can you always see whether a formula is written in conventional no-
tation?
(a) Yes, I simply construct the parsing tree for the expression.
(b) No, because a formula written in notational convention does not
need to contain an even number of parentheses.
(c) Yes, you can apply the algorithm (4.3.10) for that.
(d) No, it needs to be clear from the context.
4.7.4 A formula has complexity four. Which of the following can you infer
from that?
4.8 Exercises
4.8.1 [h] Translate the following statements into a suitable propositional
language! Don’t forget the translation key.
(a) Alan Turing built the first computer but Ada Lovelace invented
the first computer algorithm.
(b) Only if Alan Turing built the first computer, it’s Monday today.
(c) Either Alan Turing or Ada Lovelace is your favorite computer
scientist.
(d) Today is Monday if and only if both yesterday was Tuesday and
tomorrow is Saturday.
4.8.2 [h] Translate the following statements into English/Dutch. Use the
following translation key:
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 100
(a) ¬¬(p ∧ q)
(b) (¬p → ¬q)
(c) (p ↔ (¬r ∧ q))
(d) ((q ∧ s) → t)
(e) ((q ∧ s) → (p ∨ r))
(f) (((p ∧ q) ∨ (r ∧ s)) ∧ ¬((p ∧ q ∧ r ∧ s)))
4.8.3 Give an inductive definition of the set of all formulas of L that only
contain p, q, ¬, ∧, (, and ).
4.8.4 Use the algorithm from 4.3.10 to decide whether the following expres-
sions are formulas:
(a) (q ↔ (p ∧ (q ∨ (r ∧ ¬s)))
(b) ((p ∧ q) ∨ (p ∧ (q → ¬q)))
(c) (p → (p → ((p ∧ p) ↔ p ∨ p)))
(d) ¬¬(¬¬p ∧ (q ∨ q))
for ◦ = ∧, ∨, →, ↔ .
4.8.7 Use proof by induction to prove that the number of elements in sub(φ)
is at most 2 · #conn (φ) + 1.
4.8.8 [h] Prove (using induction on formulas) that for each formula φ ∈ L,
the number of (’s and the number of )’s is equal. Derive as a corollary
a necessary condition for formula-hood and discuss why the condition
is better than the one given in (4.2.4).
4.8.9 Translate the following formulas written using the notational conven-
tions into official notation:
(a) ¬p ∧ q
(b) ¬(p ∧ q → ¬p ∨ ¬q)
(c) p ∨ p ↔ ¬p
(d) (p ∨ q) ∧ r
(e) p → p ↔ p → p
(f) ¬p ∧ (q ∨ r → p ↔ q)
(g) p ∧ (p ∨ q)
(h) p → q ∨ q ↔ r
(i) p → q ↔ ¬q → ¬p
(j) ¬¬¬p
(k) p → p ↔ p ∨ ¬p
(l) p ∨ q → ¬r ∧ (s ↔ p)
CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC 102
4.8.10 Take the following formulas and write them according to our nota-
tional conventions:
(a) (p ∧ q)
(b) ¬¬q
(c) (p ∧ (r ∨ q))
(d) (p → (r ∨ (p ∧ (q ↔ r))))
(e) (p ∨ ¬(p ∨ q))
(f) ((p ∧ q) → r)
(g) (((p ∨ q) → ¬q) ↔ r)
(h) ((p ∧ q) ∧ r)
(i) (p ∧ (q ∧ r))
(j) (p ∨ (q ∨ r))
(k) (p ∧ (q ∨ r))
(l) (p ∧ (q → r))
4.8.11 (This is a real challenge, only try this is you have enough time and en-
ergy): Write an algorithm that translates a formula from conventional
into official notation.
Some authors use different terminology. For example, they may call
sentence letters “propositional variables” or sentential connectives “propo-
sitional connectives.”
These are really just some of the possible differences you may encounter.
If you continue with my literature recommendations, you have to brace
yourself for that. But there are also some reasons for why it’s a good idea
to look at other texts despite these potential obstacles:
When you continue your studies, you will see that there are many,
many different notations or, more generally, ways of doing things around.
This equally applies in logic, mathematics, computer science, and other
related disciplines. The earlier you get used to the plurality, the better.
So, here are my recommendations for book-chapters that deal with the same
material in comparable ways.
Section 2.1 of Dalen, Dirk van. 2013. Logic and Structure. 5th edition.
London, UK: Springer.
One last thing: don’t buy these books until you really feel like the book will
help you a lot. Look at them in the library first (or online, if possible)!
Self Study Solutions
Some explanations in the appendix.
4.7.1 (c)
4.7.2 first (b), then (d), then (c), then
(a)
4.7.3 (d)
4.7.4 (a), (f)
104 CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC
Chapter 5
105
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 106
5.1.3 Examples. Let P = {p, q, r}. The following are all the valuations v :
{p, q, r} → {0, 1}:
5.1.4 More Examples. But even if P is infinite, for example {pi : i ∈ N}, we
can reasonably define valuations (but note that there’ll be infinitely
many, so we can’t write them all down). Here are some examples for
definitions of valuations v : {pi : i ∈ N} → {0, 1}:
5.1.5 Above we said that once we know the truth-values of the sentence
letters under a given valuation, we can calculate the truth-values of all
formulas using function recursion. In order to do so, we need to know
how the truth-value of a complex formula depends on the truth-values
of its immediate sub-formulas. Let’s begin by guiding our intuitions
first. The following principles seem plausible for all φ, ψ ∈ L, given
that ¬ means not, ∧ means and, and ∨ means or :
(v) (φ ↔ ψ) is true iff either φ and ψ are both true or φ and ψ are
both false.
5.1.7 Let’s see how we can use (i–v) to determine the truth value of for-
mulas under an assignment. In order to do so, we first try to capture
the meaning of the operators by means of so-called truth-functions.
An n-ary truth function (for n ∈ N) is a function from {0, 1}n to
{0, 1}. To each of the clauses (i–v), there corresponds a truth-function
that “mirrors” the influence of the operator on the truth-value of the
sentence. These truth-functions, in a sense, give the meaning of their
corresponding operator. So, we have functions f¬ : {0, 1} → {0, 1}
and f◦ : {0, 1}2 → {0, 1} for ◦ = ∧, ∨, →, ↔ given by the following
definitions:
f¬
0 1
1 0
f∧ 0 1
0 0 0
1 0 1
(iii) Disjunction: f∨ (x, y) = max(x, y)
f∨ 0 1
0 0 1
1 1 1
(iv) Conditional : f→ (x, y) = max(1 − x, y)
f→ 0 1
0 1 1
1 0 1
(v) Biconditional : f↔ (x, y) = min(max(1 − x, y), max(1 − y, x)).
f↔ 0 1
0 1 0
1 0 1
Let’s think this through in the case of f∧ . Studying the function-table
for f∧ , we can see that f∧ (x, y) = 1 iff x = 1 and y = 1—the only case
in which f∧ assigns the output one is if both inputs are one. Since one
means true and zero means false, this just means that f∧ assigns the
output true iff both inputs are true—which is precisely what (5.1.5.ii)
says. The truth-functions given by (i–v) are also known as the Boolean
functions or simply Booleans.
5.1.8 The Booleans f→ and f↔ are a bit hard to wrap your head around, so
let’s think about them for a second. First, f→ . There is another way
of writing down the same function, which can be found by looking at
the table. Note that there are four possible inputs: (0, 0), (0, 1), (1, 0),
and (1, 1). But in only one of these cases, does f→ assign zero, viz.
(1, 0). Remember that (φ → ψ) is false iff φ is true and ψ is false. So,
we can use definition by cases to write down the definition of f→ :
(
0 if x = 1 and y = 0
f→ (x, y) =
1 otherwise
Similarly, f↔ looks almost threatening. But look at the table! Only
for the inputs (0, 0) and (1, 1) does f↔ assign the output 1. So, we get
the following useful definition by cases of f↔ :
(
1 if x = y
f↔ (x, y) =
0 otherwise
This, I hope, is already much more transparent.
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 110
5.1.9 We will now use the Booleans to define the truth-value JφKv of a for-
mula φ ∈ L under a valuation v. More concretely, we will define the
function J·Kv : L → {0, 1} by the following recursion:
5.1.10 Note that since for every valuation v, J·Kv is a function from L to
{0, 1}, it follows immediately that for each φ ∈ L, we have that either
JφKv = 1 or JφKv = 0 (and never both). In other words, the law of
bivalence holds for our semantics.
5.1.11 It’s useful to look at the definition of truth under a valuation from
another angle, to look at it as a property of formulas. The idea is
that, instead of defining the truth-value of a formula using function
recursion as we did in 5.1.9, we could also have defined a property of
formulas using an inductive definition—just like we inductively define
sets.2 For v a valuation and φ ∈ L a formula, we write v φ to say
that φ is true under the valuation v, and we write v 2 φ to say that φ
is not true under v. To obtain an inductive definition of truth under
a valuation, we would now simply postulate the following inductive
clauses, which are derived clauses (i–v) from 5.1.5:
This definition would have worked equally well—in fact, we shall prove
in a moment that the two definitions coincide. Which of the two defi-
nitions (5.1.9 or this one) to prefer is mainly a question of preference.
Some logicians prefer 5.1.9 and some logicians prefer the above defi-
nition. In the following, we will mainly work with definition 5.1.9 (so
guess which kind of logician I am).
5.1.12 Let’s look at our two examples from before. Let v be again the val-
uation given in 5.1.3.f, i.e. v(p) = 1, v(q) = 0, and v(r) = 1. For
¬(p ∧ (r ∨ q)), we can argue:
5.1.13 We show:
Proposition. Let v be a valuation and φ ∈ L. Then JφKv = 1 iff
v φ.
5.2.2 Note that what underlies our (formal) notion of validity is a relation
among formulas, the relation that holds between a set of formulas and
another formula just in case under every valuation that makes the
set of formulas true also makes the other formula true. This notion is
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 114
5.2.3 Let’s consider some examples. When we’re writing out claims of con-
sequence, it’s common to leave out the set-brackets before the for
ease of exposition. So, instead of the more proper {p, q} p ∧ q, we’ll
typically write p, q p ∧ q.
(i) Claim. p, q p ∧ q
(v) Claim. p, p → q q
5.2.4 Note that each of the examples in 5.2.3 is a claim about concrete
formulas, i.e. specific formulas of a fixed language. But an important
aspect of logic is to figure out logical laws: patterns of valid inferences.
An example of such a patter is that φ, ψ ∴ (φ ∧ ψ) is valid for all
φ, ψ ∈ L. Remember from 5.2.2 that the idea is that φ, ψ ∴ (φ ∧ ψ) is
valid iff φ, ψ (φ ∧ ψ). So, what we have to prove in order to prove the
logical law is that for all φ, ψ ∈ L, φ, ψ (φ ∧ ψ). How would we do
something like this? Well, even though this is a claim about formulas,
we don’t need to use induction to establish this. We can simply use
the reasoning from 5.2.3.(i) and replace p with φ and q with ψ. To be
perfectly explicit, here is the argument:
In a similar way, we can also transform the other examples from 5.2.3
into logical laws.
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 117
There is, however, another kind of logical law, which requires a slightly
more general approach. Suppose that you know that Γ entails φ and
that φ together with ∆ entails ψ, for some formulas φ, ψ ∈ L and sets
of formulas Γ, ∆ ⊆ L. Can it be that Γ and ∆ together don’t entail ψ?
The answer seems to be: obviously not! If φ is true whenever the Γ’s
are true and ψ is true whenever φ and the ∆’s are true, then it seems
to follow that φ is true whenever the Γ’s and the ∆’s are true. This is
the law of the transitivity of logical consequence. It’s an example of a
more general kind of logical law, which we need to prove in a slightly
more complicated way. Let’s do this as an example:
What is this more general law good for? Well, it allows you to infer
consequence claims from other consequence claims that you’ve already
proven. We know, for example, that p, p → q q (5.2.3.v) and that
p, q p ∧ q (5.2.3.i). So, using our proposition, we can infer that
p, p → q p ∧ q. Note that we implicitly made use of our set notation
here: strictly speaking p, p → q q should be written {p, p → q} q
and p, q p ∧ q should be written {p, q} p ∧ q. So, what we can
infer using our proposition is that {p, p → q} ∪ {p} p ∧ q. But
{p, p → q} ∪ {p} = {p, p → q} (remember, with sets, repetition doesn’t
matter). So, {p, p → q} ∪ {p} p ∧ q can be written p, p → q p ∧ q.
we have that both p ¬¬p and ¬¬p p, i.e. p ¬¬p. This point
actually generalizes: two formulas are logically equivalent iff they have
the same truth-value under each valuation:
Proposition. Let φ, ψ ∈ L be formulas. Then φ ψ iff for all
valuations v, JφKv = JψKv .
(i) φ φ (Reflexivity)
(ii) If Γ φ and {φ} ∪ ∆ ψ, then Γ ∪ ∆ ψ. (Transitivity)
(iii) If Γ φ, then Γ ∪ ∆ φ. (Monotonicity)
(iv) φ, ψ φ ∧ ψ (Conjunction Introduction)
(v) φ ∧ ψ φ and φ ∧ ψ ψ (Conjunction Elimination)
(vi) φ φ ∨ ψ and ψ φ ∨ ψ (Disjunction Introduction)
(vii) If φ θ and ψ θ, then φ ∨ ψ θ. (Disjunction Elimination)
(viii) φ ∧ φ φ (Idempotence)
(ix) φ ∨ φ φ (Idempotence)
(x) φ ∧ ψ ψ ∧ φ (Commutativity)
(xi) φ ∨ ψ ψ ∨ φ (Commutativity)
(xii) (φ ∧ ψ) ∧ θ φ ∧ (ψ ∧ θ) (Associativity)
(xiii) (φ ∨ ψ) ∨ θ φ ∨ (ψ ∨ θ) (Associativity)
(xiv) φ ∧ (ψ ∨ θ) (φ ∧ ψ) ∨ (φ ∧ θ) (Distributivity)
(xv) φ ∨ (ψ ∧ θ) (φ ∨ ψ) ∧ (φ ∨ θ) (Distributivity)
(xvi) ¬¬φ φ (Double Negation)
(xvii) ¬(φ ∧ ψ) ¬φ ∨ ¬ψ (De Morgan’s Law)
(xviii) ¬(φ ∨ ψ) ¬φ ∧ ¬ψ (De Morgan’s Law)
(xix) ¬φ, φ ∨ ψ ψ (Disjunctive Syllogism)
(xx) φ → ψ ¬φ ∨ ψ (Conditional Definition)
(xxi) φ → ψ ¬ψ → ¬φ (Contraposition)
(xxii) φ → ψ, φ ψ (Modus Ponens)
(xxiii) φ → ψ, ¬ψ ¬φ (Modus Tollens)
(xxiv) φ ↔ ψ (φ → ψ) ∧ (ψ → φ) (Biconditional Introduction)
(xxv) φ ↔ ψ ¬φ ↔ ¬ψ (Biconditional Contraposition)
Proof. We leave all but (vii) as an exercise. We prove (vii) here because
it allows us to understand the idea of proof by cases better.
We want to show that if φ θ and ψ θ, then Γ ∪ {φ ∨ ψ} θ. So,
suppose that φ θ and ψ θ. This means that (a), for all valuations
v, if JφKv = 1, then JθKv = 1; and (b) for all valuations v, if JψKv = 1,
then JθKv = 1. In order to derive φ∨ψ θ, we need to show that for all
valuations v, if Jφ∨ψKv = 1, then JθKv = 1. So, let v be a valuation such
that Jφ ∨ ψKv = 1. Since Jφ ∨ ψKv = 1 and Jφ ∨ ψKv = max(JφKv , JψKv ),
we can distinguish two exhausting cases (c) JφKv = 1 and (d) JψKv = 1.
We show that in each case JθKv = 1.
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 120
(i) Claim. p ∨ q, p 2 ¬q
Countermodel. Any v such that v(p) = 1 and v(q) = 1. If v(p) = 1
and v(q) = 1, then both JpKv = 1 and JqKv = 1. And Jp ∨ qKv =
max(JpKv , JqKv ) = max(1, 1) = 1. But JqKv = 1 and J¬qKv =
1 − JqKv , so J¬qKv = 0.
(ii) Claim. p → q, q 2 p (remember inference (2) from the introduc-
tion)
Countermodel. Any v such that v(p) = 0 and v(q) = 1. If v(p) = 0
and v(q) = 1, then JpKv = 0 and JqKv = 1. Since Jp → qKv =
min(1 − JpKv , JqK), we have that Jp → qKv = max(1 − 0, 0) =
max(1, 0) = 1. But JpKv = 0.
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 121
(iii) Claim. p → q, ¬p 2 ¬q
Countermodel : Any v such that v(p) = 0 and v(q) = 1. If v(p) =
0, then JpKv = 0. So J¬pKv = 1 − JpKv = 1 and Jp → qKv =
max(1 − JpKv , JqK) = max(1 − 0, 0) = max(1, 0) = 1. But since
v(q) = 1, JqKv = 1, and so J¬qKv = 1 − JqKv = 0.
Note that the fallacies are not as formulated as neatly as the positive
laws. The reason is that it’s not the case, for example, that for all
φ, ψ ∈ L, we have that φ∨ψ, φ 2 ¬ψ. To give a kind of stupid example,
which however makes the point very clear, let φ = p and ψ = ¬p. Then
φ ∨ ψ, φ 2 ¬ψ becomes p ∨ ¬p, p 2 ¬¬p. But it’s easy to see using the
laws of logic, that this is false. By Double Negation, p ¬¬p. And by
(Monotonicity), from this we get p ∨ ¬p, p ¬¬p. So, in this specific
case, you can reason by affirming the disjunct. The point is that, in
contrast to the laws of logic, you can’t always reason like this.
5.2.10 Remember from the introduction that as a consequence of bivalence,
in classical logic there are logical truths—statements that are true in
every possible situation—and logical falsehood —statements that are
false in every possible situation. We’ll now make these notions precise.
Note that we defined the expression Γ φ for any set Γ and formula
φ. But what if Γ = ∅? We’ll let’s see what happens when we apply the
definition:
∅ φ iff for all valuations v, if JψKv for all ψ ∈ ∅, then JφKv = 1.
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 122
(i) Claim: p ∨ ¬p
(ii) Claim: (p → q) ∨ (q → p)
To see the critical identity (∗), simply note that max(x, 1) for
x ∈ {0, 1} is always going to be 1. In case (b), the reasoning is
analogous:
5.2.12 So much for logical truth. How about logical falsehood ? Well, remem-
ber that a sentence is a logical falsehood iff it’s false in all possible
situations. Formally, this means that a formula get’s value zero un-
der all valuations. But wait, we can already express this using our
terminology. Note that for all valuations v, JφKv = 0 iff J¬φKv = 1—
this follows directly from J¬φKv = 1 − JφKv . But that just means that
JφKv = 0 for all valuations v iff J¬φKv = 1 for all valuations v. But
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 124
that just means that ¬φ is valid! So, we can formally understand log-
ical falsehood in terms of logical truth: φ being logically false simply
means ¬φ.
Proof. We will actually not prove this from definitions, but rather
using the laws of logic from 5.2.6 and the result p ∨ ¬p from
5.2.11. For note that by de Morgan’s law, we have that ¬(p ∧
¬p) ¬p ∨ ¬¬p. By Double Negation, ¬¬p p and so ¬p ∨
¬¬p ¬p∨p. By Commutativity, we have that ¬p∨p p∨¬p.
So, putting all of this together and using Transitivity a bunch of
times, we get that ¬(p∧¬p) p∨¬p. And we know that p∨¬p
from 5.2.11. By definition, this means that Jp ∨ ¬pKv = 1 for all
valuations v. Since ¬(p ∧ ¬p) p ∨ ¬p, by Proposition 5.2.5, we
have that for every valuation v, Jp ∨ ¬pKv = J¬(p ∧ ¬p)Kv . But
that just means that J¬(p ∧ ¬p)Kv = 1, for all valuations v.
1. Γ ∪ {φ} ψ
2. Γ φ → ψ
5.2.16 The essence of the theorem we’re about to prove is that we can gener-
alize the idea that we’ve just described. But to see how, we first need
to prove a lemma:
Proof. We derive the equivalence using the logical laws. First, note
that φ → (ψ → θ) ¬φ ∨ ¬ψ ∨ θ using Conditional Definition
twice. Now consider (φ ∧ ψ) → θ. By Conditional Definition, we get
(φ ∧ ψ) → θ ¬(φ ∧ ψ) ∨ θ. But by De Morgan’s law ¬(φ ∧ ψ)
¬φ ∨ ¬ψ. Hence ¬(φ ∧ ψ) ∨ θ ¬φ ∨ ¬ψ ∨ θ. But now we have that
φ → (ψ → θ) ¬φ ∨ ¬ψ ∨ θ and (φ ∧ ψ) → θ ¬φ ∨ ¬ψ ∨ θ, from
which we can infer our claim by Transitivity.
φ1 , . . . , φn ψ iff (φ1 ∧ . . . ∧ φn ) → ψ
5.2.17 But first, we note in the following corollary that we can also reduce
logical equivalence to the validity of a formula—unsurprisingly, a bi-
conditional:
5.2.18 So, to sum up, by Proposition 5.2.6, we have reduced the question
of whether a (finite) set of formulas entails another formula to the
question whether a specific conditional is valid, the conditional formed
by taking the conjunction of all the members in the set as the if-
part and the potential conclusion as the then-part. In the following
section, we shall turn this observation into a decision procedure for
propositional logic.
5.3.2 The decision method that we’ll discuss in this chapter is the method
of truth-tables. It was first discovered by the Austrian philosopher
Ludwig Wittgenstein in the 20’s of the last century. But to this day,
it’s the most widely used decision procedure for propositional logic.
You will soon be able to appreciate its elegance. The idea underlying
the method is that in order to determine the truth-value of a formula,
we actually only need to know the truth-values of the sentence letters
that occur in the formula. But there are only finitely many of those and
so, there are only finitely many possible combinations of truth-values
for the sentence letters in the formula. Hence, we can write down all
the possible truth-values that a formula can take in one, finite table.
This table, the so-called truth-table for the formula is at the heart of
the decision procedure we’ll discuss in this section.
(a) The first thing you should do when you’re constructing a truth-
table for a formula is to find all the propositional letters. In our
case, we get p, q, and r.
(b) Write down all the propositional letters, followed by some space
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 128
p q r
(ii) Next, consider the upper half and lower half of the second
column, and divide them again into two parts. In this col-
umn (in our case, the q column), fill in 1s in the upper half
of the table and 0s in the lower half of every part, like this:
p q r
1 1
1 1
1 0
1 0
0 1
0 1
0 0
0 0
(iii) Proceed to the next column (in our case, the r column) and
repeat the procedure:
p q r
1 1 1
1 1 0
1 0 1
1 0 0
0 1 1
0 1 0
0 0 1
0 0 0
If you have more than 3 propositional letters, you can con-
tinue dividing the parts in two. This will always work, since
half of half of 2n will always be even.3
(f) Now that we’ve filled in all the possible combinations of truth-
values for the propositional letters, we recursively calculate the
truth-value of the whole formula following the parsing tree. In
our case, the parsing tree is this:
3
If you know how to count in binary, then you can see that I’m basically counting down
from 2n in binary.
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 130
(p ∨ q) ¬(p ∧ q)
p q (p ∧ q)
p q
function f¬ :
p q r (p ∨ q) (p ∧ q) ¬(p ∧ q)
1 1 1 1 1 0
1 1 0 1 1 0
1 0 1 1 0 1
1 0 0 1 0 1
0 1 1 1 0 1
0 1 0 1 0 1
0 0 1 0 0 1
0 0 0 0 0 1
(iv) Now we proceed to calculate the truth-value of ((p ∨ q) ∧
¬(p ∧ q)) based on the truth-values of (p ∨ q) and ¬(p ∧ q))
we’ve just calculated now using the truth-function f∧ :
In order to have a unique order for step 4., we start with the bottom-
left leaf of the tree and then try to move up and calculate what we
need to know along the way. This is precisely what we did in 5.3.3.
Here is another example (this time, just the result):
p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r)
Parsing Tree:
p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r)
p ∧ (q ∨ r) (p ∧ q) ∨ (p ∧ r)
q r p q p r
Truth-Table:
p q r q∨r p ∧ (q ∨ r) p∧q p∧r (p ∧ q) ∨ (p ∧ r) p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r)
1 1 1 1 1 1 1 1 1
1 1 0 1 1 1 0 1 1
1 0 1 1 1 0 1 1 1
1 0 0 0 0 0 0 0 1
0 1 1 1 0 0 0 0 1
0 1 0 1 0 0 0 0 1
0 0 1 1 0 0 0 0 1
0 0 0 0 0 0 0 0 1
the formula should be valid! So, the example truth-tables we just did
show that 2 ((p ∨ q) ∧ ¬(p ∧ q)) → r and p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r).
So, after 1.–4., we add the following final step:
5.3.6 How can we use the algorithm described above to determine whether a
given inference is valid? To answer this question, consider an inference
φ1 , . . . , φn ∴ ψ with finitely many premises. By definition, the inference
is valid iff φ1 , . . . , φn ψ. And we know by Proposition 5.2.16 that
φ1 , . . . , φn ψ is mathematically equivalent to (φ1 ∧ . . . ∧ φn ) → ψ.
So, we use our algorithm to determine whether (φ1 ∧ . . . ∧ φn ) → ψ is
a logical truth. If it is, then the inference is valid; and if it isn’t the
inference is invalid.
5.3.7 We will complete this chapter by proving that the algorithm works,
i.e. we will show that if the algorithm tells us that a formula is valid,
then it is valid; and we will show that if the algorithm tells us that
a formula is invalid, then it is, in fact, invalid. This proof, together
with the observation that carrying out the algorithm only takes finitely
many steps, establishes that classical propositional logic is decidable.
This is the main theorem of this chapter:
Proof. By inspection of the way the values of the truth-table are cal-
culated. You can prove this by an induction on formulas, the details
are left as an exercise for interested students.
5.3.9 Using this lemma it’s easy to show that our algorithm is correct:
Theorem (Verification of the Method of Truth-Tables.). Let φ be a
formula.
(a) φ ψ
(b) ψ
(c) ¬ψ → ¬φ
(d) ¬φ
CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC 136
5.6 Exercises
5.6.1 Prove the remaining cases of Proposition 5.1.13.
5.6.2 Prove that the two definitions of in 5.2.2 are equivalent (using Propo-
sition 5.1.13). (This is a good exercise for proof strategies!)
5.6.3 Proof the laws of Lemma 5.2.6. [h] (iii), (xiii), and (xv).
5.6.5 [h] Prove that there is no valuation v such that for all φ ∈ L, we have
JφKv = 1.
5.6.6 Prove that Γ φ iff there is no valuation v, such that JψKv = 1, for all
ψ ∈ Γ, but also JφKv = 0.
(a) [h] p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r)
(b) ¬p ∨ q → q ∧ (p ↔ q)
(c) p ∧ (q → r) ↔ (¬p ∨ q → p ∧ r)
(d) ¬(p → (q ∨ ¬r) ∧ (¬q → r))
(e) (p ↔ q ∧ r) ∨ (q ↔ r)
(f) ¬p ∨ ¬q → ¬(p ∧ q)
(g) (¬p ∨ q) → (q ∧ (p ↔ q))
(h) ((p ↔ q) → ((q ↔ r) → (p ↔ r)))
(i) (p → q) ∨ (¬q → p)
(j) (q → r) → p ∧ (q ∨ ¬r)
(k) ((p ∨ q) ∨ (¬p ∨ r)) ∨ (¬q ∨ ¬r)
(l) (p → (q → r)) → ((p → q) → (p → r))
(m) (p ∧ q) ↔ (r ∨ (¬p ∧ q))
(n) ((p → r) → ((q → r) → (p ∨ q → r)))
(o) ¬q ↔ (p → (¬r → q))
(p) (p → q) ∧ ((q → r) ∧ (r → ¬p))
(q) p → (q → (r → (¬p → (¬q → ¬r))))
(r) (p → q ∧ r) ↔ ((p → q) ∧ (p → r))
(s) p ∧ (¬p ∨ q) → (r → ¬q) ∧ (p → r)
(a) [h] p ∴ p ∨ (p ∧ q)
(b) p → ¬p ∴ ¬p
(c) p ∧ ¬p ∴ q
(d) p ∴ p ∨ ¬p
(e) q ∴ p → q
(f) p → q, q → r ∴ p → r
(g) p ↔ ¬p ∴ p ↔ (q ∧ ¬q)
Section 2.2 of Dalen, Dirk van. 2013. Logic and Structure. 5th edition.
London, UK: Springer.
5.5.3 (a–d)
5.5.2 (b)
5.5.1 (c)
Self Study Solutions
Chapter 6
Hilbert1 φ → (ψ → φ)
Hilbert2 (φ → (ψ → χ)) → ((φ → ψ) → (φ → χ))
Hilbert3 (¬φ → ¬ψ) → (ψ → φ)
Modus Ponens. From φ and (φ → ψ) infer ψ.
Definitions. From (φ ∧ ψ) infer ¬(φ → ¬ψ) and vice versa; from
(φ ∨ ψ) infer (¬φ → ψ) and vice versa; and from (φ ↔ ψ) infer
((φ → ψ) ∧ (ψ → φ)) and vice versa.
138
CHAPTER 6. TABLEAUX FOR PROPOSITIONAL LOGIC 139
6.1.3 But proving things in Hilbert systems is hard. Hilbert systems are
very economical, they only have a few axioms and rules—that’s it.
Our system, for example, has just 3 axioms and 2 rules. This makes
reasoning about our system very efficient. But it makes reasoning with
the system hard. To see how hard, here I give a derivation of p → p in
our Hilbert system:
This is how you would show that p p using a Hilbert system. Would
you have managed to find the proof yourself?
6.1.4 The next kind of proof system, we’ll discuss are sequent calculi or
Gentzen systems. A sequent is an expression of the form Γ ⇒ ∆,
where Γ and ∆ are sets of formulas. Intuitively, we read a sequent
φ1 , . . . , φn ⇒ ψ1 , . . . , ψm as the claim that φ1 ∧ . . . ∧ φn ψ1 ∨ . . . ∨ ψm ;
that is, sequents are claims about consequence. The point is that we
can derive consequence claims from other consequence claims (as we
did in the previous chapter). In the Gentzen calculus for propositional
logic, there is only one axiom (i.e. consequence claims held to be true
no matter what):
φ⇒φ (Identity)
The remaining ingredients are several rules, which allow us to infer
consequence claims from each other. These rules fall into two classes
CHAPTER 6. TABLEAUX FOR PROPOSITIONAL LOGIC 140
structural rules, which don’t involve the connectives, and logical rules,
a pair of two for each connective.
Here are the structural rules:
Γ⇒∆ Γ⇒∆
W eakL W eakR
Γ ∪ {φ} ⇒ ∆ Γ ⇒ ∆ ∪ {φ}
Γ ⇒ {φ} ∪ ∆ {φ} ∪ Γ0 ⇒ ∆0
Cut
Γ ∪ Γ0 ⇒ ∆, ∆0
Γ ⇒ ∆ ∪ {φ} Γ ∪ {φ} ⇒ ∆
¬L ¬R
Γ ∪ {¬φ} ⇒ ∆ Γ ⇒ ∆ ∪ {¬φ}
6.1.5 Gentzen calculi have some very nice properties from a theoretical per-
spective. This is why you will likely encounter them in courses that fo-
cus on proof theory. But they are a bit hard to wrap your head around
since they are very “meta:” you infer claims about consequence from
claims about consequence. Here is an example of a Gentzen proof that
¬(p ∨ q) ¬p ∧ ¬q:
p⇒p q⇒q
p ⇒ p, q W eakR q ⇒ p, q W eakR
p ⇒ p ∨ q ∨R q ⇒ p ∨ q ∨R
¬L ¬L
¬(p ∨ q), p ⇒ ∅ ¬(p ∨ q), q ⇒ ∅
¬R ¬R
¬(p ∨ q) ⇒ ¬p ¬(p ∨ q) ⇒ ¬q
∧R
¬(p ∨ q) ⇒ ¬p ∧ ¬q
CHAPTER 6. TABLEAUX FOR PROPOSITIONAL LOGIC 141
It is actually quite easy to find sequent proofs, even though they are
difficult to understand properly. Here, however, we shall not go more
into the depth of sequent calculi.
6.1.6 The third kind of proof system you should have seen is what’s called
a natural deduction system. Natural deduction systems are character-
ized by having no axioms, only rules that allow you to infer formulas
from each other. The idea of natural deduction is to model the kind of
informal reasoning we naturally do in mathematical proofs. The main
aspect is the idea of assumptions. In a natural deduction proof, you
may assume any formula at any point during the proof. But you may
only proceed via the inference rules. Some of these rules cancel previ-
ous assumptions, which is done by writing [ ] around the assumption.
Here are the natural deduction rules for propositional logic:
[φ] [¬φ]
.. ..
.. ..
φ ¬φ ψ ψ
EF Q Biv
ψ ψ
φ ψ φ∧ψ φ∧ψ
∧I ∧E1 ∧E2
φ∧ψ φ ψ
[φ] [ψ]
.. ..
.. ..
φ ψ φ∨ψ θ θ
∨I1 ∨I2 ∨E
φ∨ψ φ∨ψ θ
[φ]
..
..
ψ φ→ψ φ
→I →E
φ→ψ ψ
[p] ¬q
p∨q [q] q EF Q
q ∨E, 1
6.1.8 In this course, we will not cover Hilbert calculi, Gentzen calculi, or
natural deduction in detail. If you take a liking to one of these systems,
you can check out the references at the end of this chapter. In this
course, we’ll make use of analytic tableaux, which double as a proof
system and decision procedure for propositional logic. In the following
sections, we will motivate and develop this proof system in some more
detail.
6.2.2 But first, we need to introduce a new theoretical concept, the concept
of satisfiability. A set of formulas Γ ⊆ L is said to be satisfiable iff
there exists a valuation v such that JφKv = 1 for all φ ∈ Γ. In words, a
set of formulas is satisfiable iff there exists a valuation that makes all
the members of the set true.
6.2.4 So, what does it mean for a set of formulas to be unsatisfiable? Well,
it follows immediately from the definition that a set Γ of formulas is
unsatisfiable iff there exists no valuation v such that JφKv = 1 for all
φ ∈ Γ; in words, a set of formulas is unsatisfiable iff there is no valu-
ation that makes all the members of the set true or, equivalently, iff
every valuation makes some member false. So, intuitively, unsatisfia-
bility is a kind of inconsistency: a set of formulas is unsatisfiable iff its
members can’t all be made true by a valuation.
(a) Any set {φ, ¬φ} for φ ∈ L is unsatisfiable. This immediately fol-
lows from the fact noted in 5.1.10 that for each valuation v and
formula φ ∈ L, we have that either JφKv = 1 or JφKv = 0 (and
never both); that is J·Kv is a function from L to {0, 1}. But if
both JφKv = 1 and J¬φKv = 1, it would follow that JφKv = 1 and
JφKv = 0, since J¬φKv = 1 − JφKv . It follows, for example, more
concretely that {p, ¬p} is unsatisfiable.
(b) A more general consequence of the previous observation is that
the set L of all formulas is unsatisfiable. To see this, simply ob-
serve that φ, ¬φ ∈ L and so if L would be satisfiable (i.e. all its
members would be made true by some valuation), then JφKv = 1
and J¬φKv = 1, which we’ve just seen is impossible.
(c) The point generalizes even more:
Proposition. Let Γ, ∆ ⊆ L be sets of formulas. If Γ is unsatisfi-
able and Γ ⊆ ∆, then ∆ is unsatisfiable.
CHAPTER 6. TABLEAUX FOR PROPOSITIONAL LOGIC 144
6.2.6 The reason why we talk about satisfiability is that the method of ana-
lytic tableaux is a method for satisfiability checking: it’s an algorithm
that allows us to determine, purely syntactically, whether a set of for-
mulas in propositional logic is satisfiable. “But what does this have
to do with proof theory?” you may ask. And rightly so—we haven’t
connected the questions of satisfiability and validity yet. This is what
we’re doing in the following theorem:
1. Γ φ
2. Γ ∪ {¬φ} is unsatisfiable
6.2.8 The point of the previous theorem is that we can reduce the question
of the validity of arguments to the satisfiability of a set of formulas:
by the previous theorem, an inference is valid iff the set of premises
together with the negation of the conclusion is unsatisfiable. In the
following section, we will make use of this idea to develop the method
of analytic tableaux as a proof theory for propositional logic.
6.3.2 The aim of our algorithm is to determine whether a given, finite set of
formulas is satisfiable. So, as input, we get a set Γ of formulas. We will
check the satisfiability of Γ by constructing a tree (yet another use of
trees) according to the following recipe:
Γ = {p ∨ q, ¬p, ¬q}
Initial List:
p∨q
¬p
¬q
Γ = {p ∧ q, ¬p ∨ q, ¬(q ∧ ¬¬r)}
Initial List:
p∧q
¬p ∨ q
¬(q ∧ ¬¬r)
2. Next, we repeatedly apply the following rules:
φ φ ¬φ ¬ψ φ ψ ¬φ
ψ ¬ψ
φ ¬φ ψ φ ¬φ φ ¬φ
¬ψ ψ ¬ψ ¬ψ ψ
p∨q
¬p
¬q
p q
1
Order doesn’t matter.
CHAPTER 6. TABLEAUX FOR PROPOSITIONAL LOGIC 147
p∧q
¬p ∨ q
¬(q ∧ ¬¬r)
¬p q
¬q ¬¬¬r ¬q ¬¬¬r
¬r ¬r
3. Once we’ve completed our tableau, we check on every branch B
whether there is a p ∈ P such that p ∈ B and ¬p ∈ B.
if yes, then we say that B is closed, and mark it by writing an
7 under it;
if no, then we say that B is open.
Examples (Cont’d). In our examples, we get the following results:
p∨q
¬p
¬q
p q
7 7
CHAPTER 6. TABLEAUX FOR PROPOSITIONAL LOGIC 148
p∧q
¬p ∨ q
¬(q ∧ ¬¬r)
¬p q
¬q ¬¬¬r ¬q ¬¬¬r
7 7
¬r ¬r
7
6.3.3 Lets talk about the idea behind the algorithm for a moment. The idea
is that the rules allow us to test, step-by-step, what would need to be
the case for the formulas in the tree to be true. A rule creates new
branches if there’s more than one possibility for the formula to be true.
The idea can be given in the following two principles:
6.3.5 But for now, let’s focus on the pragmatics. We will now first discuss
how to get a valuation from an open branch that makes the formulas
on the branch—and thus the initial list—true. If B is an open branch
of a complete tableau, then we define its associated interpretation
vB : P → {0, 1} by setting:
(
1 if p ∈ B
vB (p) :=
0 if p ∈
/B
6.3.6 Example. Let’s consider our example of an open tableau from the de-
scription of the tableau method:
CHAPTER 6. TABLEAUX FOR PROPOSITIONAL LOGIC 150
p∧q
¬p ∨ q
¬(q ∧ ¬¬r)
¬p q
¬q ¬¬¬r ¬q ¬¬¬r
7 7
¬r ¬r
7
6.3.7 Note that since the initial list, the members of our set Γ, are on ev-
ery branch of tableau (they’re on the root, after all), it follows that if
there’s an open branch, then the initial list is on it. So, by the Theo-
rem stated (but not proven!) in 6.3.5, we have that vB makes all the
members of Γ true. We will use this now to define a proof method
using analytic tableaux.
6.3.8 Using the idea that Γ φ iff Γ ∪ {¬φ} is unsatisfiable (by Theorem
6.2.6), we define Γ `T ϕ as meaning that the complete tableau for
Γ ∪ {¬ϕ} is closed (i.e. not open). As a notational convention, we
usually leave out the T and just write Γ ` ϕ. So, to be perfectly explicit,
the idea is that if the tableau for Γ ∪ {¬φ} is closed, then there is no
valuation that makes all its members true, the set is unsatisfiable; but
that just means that Γ φ. If, instead, the tableau for Γ ∪ {¬ϕ} is
open, then there is such a valuation, which shows that Γ 2 φ. So, in
the tableau method, our step-by-step syntactic procedure, our proof,
is the construction of the tableau. And, as it turns out, we cannot only
use this method to derive the conclusion from the premises in all (and
only) the valid inferences; in fact, we can also show that all invalid
inferences in fact are invalid—and we get a countermodel to show this
for free, on top.
6.3.9 Note that in order to prove that a formula is a logical truth, we need
to show that it follows from the empty set. Remember: φ means
that ∅ φ. Using the method of tableaux, this means that we need to
check if the set {¬φ} is satisfiable. If it is, then there is a valuation in
CHAPTER 6. TABLEAUX FOR PROPOSITIONAL LOGIC 151
(a) De Morgan 1
¬p ∨ ¬q ` ¬(p ∧ q) ¬(p ∧ q) ` ¬p ∨ ¬q
¬p ∨ ¬q ¬(p ∧ q)
¬¬(p ∧ q) ¬(¬p ∨ ¬q)
p∧q ¬¬p
¬p ¬q ¬¬q
p p ¬p ¬q
q q p p
7 7
q q
7 7
(b) De Morgan 2
¬p ∧ ¬q ` ¬(p ∨ q) ¬(p ∨ q) ` ¬p ∧ ¬q
¬p ∧ ¬q ¬(p ∨ q)
¬¬(p ∨ q) ¬(¬p ∧ ¬q)
p∨q ¬p
p q ¬q
¬p ¬p ¬¬p ¬¬q
¬q ¬q p q
7 7 7 7
` p ∨ ¬p
¬(p ∨ ¬p)
¬p
¬¬p
p
7
` (¬p ∨ q) ↔ (p → q)
¬((¬p ∨ q) ↔ (p → q))
(¬p ∨ q) ¬(¬p ∨ q)
¬(p → q) (p → q)
p ¬¬p
¬q ¬q
¬p q ¬p q
7 7
p p
7 7
(e) Transitivitiy
CHAPTER 6. TABLEAUX FOR PROPOSITIONAL LOGIC 153
(p → q), (q → r) ` (p → r)
p→q
q→r
¬(p → r)
¬r
¬p q
¬q r ¬q r
7 7 7 7
(f) Distributivity
(p ∨ q) ∧ r ` (p ∧ r) ∨ (q ∧ r)
(p ∨ q) ∧ r
¬((p ∧ r) ∨ (q ∧ r))
p∨q
¬(p ∧ r)
¬(q ∧ r)
p q
¬p ¬r ¬p ¬r
¬q ¬r ¬q ¬r ¬q ¬r ¬q ¬r
7 7 7 7 7 7 7 7
6.3.11 Note that by Definition 6.3.8, we have that Γ 0 φ iff the tableau for
Γ ∪ {¬φ} is open. In that case, we get a countermodel showing that
Γ 2 φ for free. Here are a couple of examples:
p → q, q 0 p
p→q
q
¬p
¬p q
p ∨ q, p 0 ¬q
p∨q
p
¬¬q
p q
(p ∨ r) ∧ (q ∨ r) 0 (p ∨ q) ∧ r
(p ∨ r) ∧ (q ∨ r)
¬((p ∨ q) ∧ r)
p∨r
q∨r
¬(p ∨ q) ¬r
p r
q r q r
7 7 7
¬p
¬q
p r
q r q r
7 7 7
6.3.12 Let’s conclude with one remark. Note that, officially, we’re only allowed
to close branches once we’ve completed the entire tree. In practice,
however, it’s often possible to stop early—as soon as we find a formula
φ and its negation ¬φ on a branch, we know that we’ll also eventually
find a p and ¬p on the branch. So we can “close early.” In practice,
this will be fine but for now, I’d like you to stick to the official rules.
It’s a bit like with official notation and conventional notation. The
official rules (don’t close early) are there to ensure that no mistakes
are made. Once we’re more comfortable doing tableau—when we do
them for first-order logic—you’ll be allowed to “close early.”
An inference is valid iff the set of the premises and the negation of the
conclusion is unsatisfiable.
6.5.3 Consider a complete tableau. Which of the following entails that the
tableau is open.
(a) For no sentence letter p ∈ P is it the case that for all branches B
we have p, ¬p ∈ B.
(b) For no sentence letter p ∈ P do we have a branch B with p, ¬p ∈ B.
(c) For some sentence letter p ∈ P do we have a branch B with either
p∈/ B or ¬p ∈
/ B.
(d) For some sentence letter p ∈ P we have that for all branches B,
either p ∈
/ B or ¬p ∈
/ B.
(e) For all branches B there is a sentence letter p ∈ P such that either
p∈/ B or ¬p ∈/ B.
(f) For all branches B and all sentence letters p ∈ P we have that
either p ∈
/ B or ¬p ∈
/ B.
6.5.4 Consider a complete tableau. Which of the following entails that the
tableau is closed.
6.6 Exercises
6.6.1 [6 x] Describe the content of Theorem 6.2.6 in your words (without
symbols).
6.6.2 Prove that the following sets are unsatisfiable without using analytic
tableau!
(a) [h] p → q, r → q ` (p ∨ r) → q
(b) [h] p → (q ∧ r), ¬r ` ¬p
(c) [h] ` ((p → q) → q) → q
(d) [h] ` ((p → q) ∧ (¬p → q)) → ¬p
(e) p ↔ (q ↔ r) ` (p ↔ q) ↔ r
(f) ¬(p → q) ∧ ¬(p → r) ` ¬q ∨ ¬r
(g) p ∧ (¬r ∨ s), ¬(q → s) ` r
(h) ` (p → (q → r)) → (q → (p → r))
(i) ¬(p ∧ ¬q) ∨ r, p → (r ↔ s) ` p ↔ q
(j) p ↔ ¬¬q, ¬q → (r ∧ ¬s), s → (p ∨ q) ` (s ∧ q) → p
6.6.5 Let φ be a formula. Determine how long the tableau for {¬φ} can at
most (measured in terms of longest branch) based on φ’s complexity
c(φ).
(a) ` (¬p → p) → p
(b) ` (((p → q) → p) → p)
Natural Deduction: Section 2.4 of Dalen, Dirk van. 2013. Logic and
Structure. 5th edition. London, UK: Springer.
Self Study Solutions
6.5.1 (b), (d), (f)
6.5.2 (c), (e), (h) NB: (b) is not cor-
rect! Hint: Think of the case
Γ = ∅.
6.5.3 (b), (f)
6.5.4 (b), (e), (f)
159 CHAPTER 6. TABLEAUX FOR PROPOSITIONAL LOGIC
Chapter 7
This chapter is rather short, but it packs a punch: it contains two relatively
complicated proofs. We’re going to spend one entire lecture going through
the details.
7.1.2 The reason why having a sound and complete proof system is desir-
able is that it allows us to approach validity in a purely syntactic
fashion. Remember that proof systems are purely syntactic, they only
manipulate formulas without reference to the semantic clauses. If we
have a sound and complete proof system, this means that even though
we don’t explicitly talk about semantics in our system, we still effec-
tively capture the semantically defined notion of validity—no small
160
CHAPTER 7. SOUNDNESS AND COMPLETENESS 161
It turns out that these two properties, when thought through care-
fully lead to the desired results: down preservation leads to soundness
and up preservation leads to completeness. Effectively, what down and
up preservation together guarantee is that for each rule, we’re think-
ing through precisely the ways in which a formula can be true: down
preservation means that we’re considering all the possibilities of the
formula being true, und up preservation means that we’re considering
only possibilities of the formula being true. We’ll have to put in some
work, but that’s the essence of it. To prepare yourself for the proof,
remind yourself of the rules and check that they do indeed have the
two properties just described:
φ φ ¬φ ¬ψ φ ψ ¬φ
ψ ¬ψ
φ ¬φ ψ φ ¬φ φ ¬φ
¬ψ ψ ¬ψ ¬ψ ψ
7.2.2 In the following, we will talk about tableaux as the kinds of trees
constructed according to the rules laid out in 6.3.2. Remember that a
tableau is complete if every rule that can be applied has been applied;
otherwise we say that the tableau is incomplete. Now suppose that v
is a valuation and B a branch of a (possibly incomplete) tableau. Then
we say that v is faithful to B iff JφKv = 1, for all φ ∈ B, i.e. v is faithful
to B iff under v all the formulas on B are true. Note that the associated
interpretation vb of an open branch B in a complete tableau (6.3.5) is
a paradigm example of a faithful valuation (though we haven’t proven
this yet in generality): vB is faithful to B. So every countermodel
produced by the tableau method in 6.3.11 is a (paradigm) example of
a faithful interpretation for the open branch it was derived from. It’s
worth convincing yourselves of this fact in order to understand what’s
about to happen next. So go ahead and check that in each case in
6.3.11, vB makes all the members of B true. The concept of faithfulness
will be the central concept in our soundness and completeness proof.
7.2.3 Note that if we have an incomplete tableau and apply a rule to some
formula in it, each branch of our incomplete tableau will be extended
with new formulas (this is what it means to properly apply a rule to
an incomplete tableau, cf. 6.3.2.2). Our central lemma, which will lead
to the soundness theorem, states that by extending branches in this
way, we preserve faithfulness of valuations:
This lemma is, in a sense, a more precise version of the down preserva-
tion property. Before we set out to prove it, let’s consider an example
to see what the lemma says. Let’s do the tableau for {p ∨ q, ¬p ∨ ¬q}
step-by-step and consider the faithful valuation along the way (assum-
ing P = {p, q}). We begin with the initial list:
p∨q
¬p ∨ ¬q
CHAPTER 7. SOUNDNESS AND COMPLETENESS 164
The initial list is a limit-case of a tableau, one with only one node and
one branch. It’s easily checked that there are precisely two valuations
that are faithful to this branch (which consists solely of the initial list):
v1 with v1 (p) = 1 and v1 (q) = 0 and v2 with v2 (p) = 0 and v2 (q) = 1.
Now let’s begin constructing our tableau by applying the rule for p∨q:
p∨q
¬p ∨ ¬q
p q
p∨q
¬p ∨ ¬q
p q
¬p ¬q ¬p ¬q
7 7
the valuation makes all the formulas on that branch true—all thanks
to the fact that we could always find at least one new branch with a
true formula on it.
7.2.4 We’re now going to prove that this example generalizes, we’re going
to prove our lemma:
φ→ψ
¬φ ψ
¬ψ
is applied, which gives us one new branch B 0 = B ∪ {φ, ¬ψ}. Since
v is faithful to B and ¬(φ → ψ) ∈ B, we get that J¬(φ → ψ)Kv = 1.
CHAPTER 7. SOUNDNESS AND COMPLETENESS 166
The remaining cases work similarly and you should work them out
yourself.
7.2.5 We will now use the soundness lemma to conclude the soundness the-
orem:
Proof. We follow the proof strategy laid out in 7.2.1. We prove the
contrapositive that if Γ 2 φ, then Γ 0 φ. So, suppose that Γ 2 φ. So
there’s a valuation, v, such that JψKv = 1 for all ψ ∈ Γ and JφKv = 0.
We now successively construct the tableau for Γ∪{¬φ} and prove that
it must be open. First, we write down the initial list Γ ∪ {¬φ}. Note
that since v is such that JψKv = 1 for all ψ ∈ Γ and JφKv = 0, it follows
immediately that v is faithful to the only branch in the (incomplete)
tableau consisting only of the initial list. We now successively apply
the rules to turn our initial list into a complete tableau. Every time
we apply a rule, by our soundness lemma 7.2.3, we get at least one
branch that v is faithful to. Hence v must be faithful to at least one
branch in the complete tableau. Call this branch B.
We now conclude that B cannot be closed. We show this indirectly.
Suppose that B was closed. Then there would exists a p ∈ P such that
both p ∈ B and ¬p ∈ B. Since v is faithful to B, this would mean
that JpKv = 1 and J¬pKv = 1. But this just means that v(p) = 1 and
v(p) = 0, which is impossible. Hence B cannot be closed.
But if B cannot be closed, then B must be open. Since a tableau is
open iff at least one branch in the tableau is open (6.3.2.4), we conclude
that our complete tableau must be open. Hence Γ 0 φ, by definition,
which is what we needed to show.
Proof. Suppose that the tableau method gives the result that a set Γ is
unsatisfiable. By 6.3.2.4, this means that the tableau must be closed.
Now suppose, for proof by contradiction, that the set Γ is satisfiable.
This means, by definition, that there’s a valuation v that makes all the
members of Γ true. By the same reasoning as in the proof of Soundness,
we can conclude that there’s at least one open branch in the complete
tableau for Γ. Hence the tableau must be open, in contradiction to
our assumption that the tableau method gave the result that Γ is
unsatisfiable. Hence Γ must indeed be unsatisfiable, which is what we
needed to show.
7.3.2 We prove:
Lemma (Completeness Lemma). Let B be an open branch of a com-
plete tableau. Then vB is faithful to B.
So, what we’re going to prove is the conjunction of (a) and (b). We’re
going to do this by induction.
φ
So, it must be the case that φ ∈ B. But then, by in-
duction hypothesis 1., we get that JφKvB = 1. And since
J¬φKvB = 1 − JφKvB , we get J¬φKvB = 0, as desired.
1
Note the double negation here. This is not a typo!
CHAPTER 7. SOUNDNESS AND COMPLETENESS 169
ψ
So, we can conclude that both φ, ψ ∈ B. But by 1φ . and
1ψ ., this means that JφKvB = 1 and JψKvB = 1. Since
Jφ ∧ ψKvB = min(JφKvB , JψKvB ), we get Jφ ∧ ψKvB = 1, as
desired.
Next, suppose that ¬(φ ∧ ψ) ∈ B. Again, since B is an
open branch of a complete tableau, the rule for ¬(φ ∧ ψ)
has been applied:
¬(φ ∧ ψ)
¬φ ¬ψ
So, we can conclude that either ¬φ ∈ B or ¬ψ ∈ B. We
can therefore distinguish two cases. In the first case, if ¬φ ∈
B, we can infer from 2φ . that JφK = 0. Since Jφ ∧ ψKvB =
min(JφKvB , JψKvB ), this means we get Jφ ∧ ψKvB = 0. In the
second case, if ¬ψ ∈ B, we can infer from 2ψ . that JφK = 0.
So, we get Jφ ∧ ψKvB = 0. So either way, Jφ ∧ ψKvB = 0—as
desired.
As we said above, the remaining cases are left as exercises. Once they
are completed, we can infer the completeness lemma via induction.
CHAPTER 7. SOUNDNESS AND COMPLETENESS 170
7.3.4 Note that, just like in the case of soundness, our completeness theorem
can be interpreted as a theorem about the tableau method with respect
to satisfiability search: we’ve effectively shown that the method works
with respect to satisfiability.
7.3.5 Together with the observation that the tableau method applied to a
finite set terminates after finitely many steps, Theorems 7.2.3 and 7.3.4
give an alternative proof of Theorem 5.3.7, the decidability of classical
propositional logic:
provide new insight into the result: why it is true, what it says, how
it can be applied, etc. In the case of decidability, we have an alterna-
tive proof via tableaux. This is desirable since we already know that
many other logics (like first-order logic but also any non-classical log-
ics) don’t have (something corresponding to) a truth-table method.
So, if we want to prove decidability for these other logics, we can’t use
truth-tables. But, we can try tableaux! It is, in fact, possible to develop
tableau methods for a wide range of logics (you will see tableaux for
other logics throughout your degree). If we can develop a sound and
complete tableau method for another logic, we can at least hope that
we get decidability in this way. Unfortunately, in the case of first-order
logic, our hopes will be disappointed. But even in the failure to obtain
decidability for first-order logic lies some insight: we’ll be able to see
see why first-order logic is undecidable.
7.4.2 We’ll, in fact, still make a limiting assumption, namely that the infi-
nite premise sets we’ll be considering can be indexed or enumerated
CHAPTER 7. SOUNDNESS AND COMPLETENESS 172
7.4.3 There are many, many infinite premise sets you can imagine, here we
give just a few examples to show you what we’re dealing with:
(a) The set {p, ¬p, ¬¬p, . . .} or more precisely the smallest set X such
that p ∈ X and if φ ∈ X then ¬φ ∈ X. To have this infinite set,
we don’t even need infinitely many sentence letters.
(b) But if we do, the set P = {pi : i ∈ N} can function as an infinite
premise set.
(c) So, we can also have a set like this {¬p2i , p2i+1 : i ∈ N} which
contains ¬pi for each even i and pi for each odd i ∈ N.
(d) Let v be any valuation. Then the set Tv = {φ : JφKv = 1} is always
infinite! This idea we’ll discuss in more detail in the context of first-
order logic. But to see this, suppose that v(p) = 1 (if v(p) = 0,
the argument is completely analogous). Then JpKv = 1 and so
p ∈ Tv . But also J¬¬pKv = 1 and so ¬¬p ∈ Tv . And note that
p 6= ¬¬p—after all, p contains no negations and ¬¬p contains 2.
Hence, Tv has at least two members. But then, there’s also ¬¬¬¬p,
J¬¬¬¬pKv = 1 so ¬¬¬¬p ∈ Tv , and p 6= ¬¬¬¬p, ¬¬p 6= ¬¬¬¬p—
so Tv has at least 3 members. This clearly goes on, so for every
n, Tv has at least n members, which is just another way of saying
that Tv is an infinite set.
The definition requires that under all valuations where all the premises
are true, also the conclusion is true. There’s nothing finitary going on
here: even if there are infinitely many premises, they can all be true
under a valuation.
7.4.6 Fortunately, tableaux are not. We’ll now describe how the tableau
method works for checking whether Γ φ when Γ is infinitary. For
our algorithm in 7.3.2, we began by writing down Γ ∪ {¬φ} as the
initial list. This no longer works, since Γ is infinite. So, instead, in our
first step, what we’re going to do is to write down ¬φ as our initial
list. Then, without considering the premises for, we simply repeatedly
apply the tableau rules to make the complete tableau for ¬φ. If this
tableau closes, we can already declare that Γ ` φ, since if the tableau
for ¬φ closes, this means that φ is valid, i.e. ∅ φ, and by Monotonicity
(cf. 5.2.6) if follows that Γ φ. So, let’s continue assuming that the
tableau for ¬φ doesn’t close. Now, it will be important that we can
write Γ as {ψi : i ∈ I}, where I ⊆ N+ , or, more transparently, as
{ψ1 , ψ2 , . . .}. Now, what we’re going to do is to write ψ1 into the
initial list, which so far only contained ¬φ. Then we repeatedly apply
the rules again to the new tableau. If the tableau closes, we declare
that Γ ` φ, since we’ve just shown that ψ1 φ (we did the tableau for
{ψ1 , ¬φ}) and by Monotonicity, ψ1 , ψ2 , . . . φ follows. If the tableau
still doesn’t close, we repeat this procedure with ψ2 , then with ψ3 , and
so on. If at any step the tableau closes, we claim Γ ` φ. If we continue
going through the ψi ’s and the tableau never closes, we declare Γ 0 φ.
7.4.7 Note that if Γ 0 φ, we might never actually get the job done—we might
continue checking for an infinite amount of time (well not actually, but
we could continue indefinitely). But this doesn’t mean that we can’t
show that Γ 0 φ. It could happen, for example, that at some point
we can prove that the tableau will never close. This would require an
CHAPTER 7. SOUNDNESS AND COMPLETENESS 174
7.4.9 It is, however, still possible to prove soundness and completeness for
the infinitary tableau method just described, though we won’t do this
here.5 This might be surprising but it’s important to see that de-
cidability and soundness and completeness are not the same thing.
That we still get soundness, is not so surprising, in fact. Note that
for soundness, what matters is that if our algorithm says that a set is
unsatisfiable, then it is unsatisfiable. But the algorithm saying that a
set is unsatisfiable just means that the tableau closes. And if a tableau
closes it closes after finitely many steps (there will have to be a point
at which all branches have been closed). What might be a bit more
surprising is that we still get completeness: what we needed to show
for completeness is that the associated valuation for a branch is faith-
ful to that branch. But what if the branch is infinite? Well, note that
the definition of vB actually doesn’t require that B is finite (6.3.5):
(
1 if p ∈ B
vB (p) :=
0 if p ∈
/B
In the case of tableaux, the soundness theorem relies on the fact that
in every rule, if the upper formula is true, then at least one of the
lower formulas is true (‘down preservation’).
Truth tables don’t work for infinitary premise sets but tableaux do.
(a) There is a valid inference in which you can’t derive the conclusion
from the premises.
(b) There is an invalid inference in which you can derive the conclusion
from the premises.
(c) There is a set of premises from which you can both derive a formula
and it’s negation.
(d) There is a satisfiable set of premises from which you can derive
every formula whatsoever.
7.6.2 Which of the following entails that your proof system is incomplete?
(Assume that you’re trying to develop a proof system for classical
logic).
(a) There is a valid inference in which you can’t derive the conclusion
from the premises.
(b) There is an invalid inference in which you can derive the conclusion
from the premises.
(c) There is a set of premises from which you can’t derive any formula
whatsoever.
(d) There is a set of premises from which you can both derive a formula
and it’s negation.
7.7 Exercises
7.7.1 Check the remaining cases of Proof 7.2.4.
7.7.4 Let Γ be a set of formulas such that there exists a formula φ with
Γ 0 φ. Use the completeness theorem to conclude that Γ is satisfiable.
7.7.5 Suppose that {φ} is satisfiable and φ ` ψ. Use the soundness theorem
to conclude that ψ 0 ¬φ.
First-Order Logic
178
Chapter 8
We now begin with the study of first-order logic. As you’ll see, things will
be moving a bit faster. One important thing: I assume that the ideas and
methods of Part II are clear at this stage. So, we will not cover the same
issues in the same level of detail as in propositional logic just for first-order
logic. For example, I now assume that you know how an inductive definition
works. This allows us to focus on the more interesting aspects of first-order
logic.
(3) This ball is scarlet and everything that’s scarlet is red. So, this
ball is red.
(4) The letter is in the left drawer. So there is something in the left
drawer.
179
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 180
The moral of the story is that in predicate logic, the internal struc-
ture of the sentences is important. When all we care about are the
sentential connectives, then abstracting sentences to sentence letters
is fine; but when we care about claims, like “ there is something in the
left drawer,” then this abstraction is too coarse-grained. We need to
abstract less.
8.1.2 The first step towards first-order logic is to take into account the
grammatical structure of simple sentences. A traditional way of looking
at the structure (which is in essence still alive in linguistic syntax
theory) is to consider the term-predicate structure of sentences. A
sentence like “the ball is scarlet” says of a thing, the ball, that it has a
property, being red. The sentence talks about the ball via the singular
term “the ball” and it talks about being red using the predicate “. . . is
red.” Now just like we abstracted away from sentences via sentence
letters in propositional logic, in first-order logic, we abstract away
from terms and predicates via term symbols and predicate symbols. The
rationale is that just like in propositional logic the concrete sentences
didn’t matter for validity, in first-order logic, the concrete terms and
predicates don’t matter. To see this, consider the following inferences:
(3’) This train is slow and everything that’s slow is yellow. So, this
train is yellow.
(4’) The dog is in the car. So there is something in the car.
Both of these inferences are valid, just like their counterparts (3) and
(4). Clearly whatever terms and predicates you fill in here, the infer-
ences remain valid. So, we can abstract away from them.
These classifications, just like the examples, stem from natural lan-
guage. But it’s fruitful to compare these categories to expressions from
mathemateze that we’ve discussed in §2. In mathematics, constants
are proper names, variables are pronouns, and functions are . . . well
. . . functions. In fact, this terminology is the very same we use for the
corresponding syntactic categories in our formal language for first-
order logic. The reason for this is the origin of first-order logic as the
study of mathematical reasoning. We typically use constants a, b, c, . . .
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 181
f (a),
where c stands for Angela Merkel. This is not really different from what
happens in mathematics, when we combine mathematical operations,
as in:
(n + m) · 2
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 182
exp(n + m)
(a · b) + (c · d)
P (t),
where t stands for the ball and P for the predicate “. . . is scarlet.” The
predicate “is scarlet” is what’s called a unary predicate, it expresses a
property of one object. There are also predicates with higher arities:
“. . . is in ” is a binary predicate or relation symbol ; “. . . lies between
and —” is a ternary predicate; and so on for n-ary predicates. An n-
ary predicate expresses that a certain relation holds between n objects,
each denoted by a term. So, the general form of a simple sentence in
first-order logic is:
R(t1 , . . . , tn ),
where R is an n-ary predicate symbol and t1 , . . . , tn are terms. The
sentence “the letter is in the left drawer,” for example, is formalized
as
R(t, u),
where t stands for the letter, u for the left drawer, and R for the binary
predicate “. . . is in .”
8.1.6 Now, the real interesting part in first-order logic are the quantifiers,
they are what gives the logic its expressive strength. In first-order
logic, as we already hinted at, we consider two quantifier expressions:
“for all” and “there exists” (and synonymous expressions like “every,”
“some,” . . . ). Our inferences (3) and (4) provide examples of how these
expressions are used in natural language. Let’s briefly talk about how
we treat them in the language of first-order logic. In first-order logic,
we use the quantifiers with the help of variables to formalize general
claims, like “everything that’s scarlet is red” or “there is something
in the left drawer.” Remember that an important role of variables in
mathematics is to allow us to make general claims about mathematical
objects (cf. 2.2.6 and 2.2.7). In first-order logic, the variables play the
same role. Here’s how. Take the claim:
In any case, clearly, the two sentences are equivalent: if the one is
true, then so is the other and vice versa. So, logically, they should be
treated as the same. Now note that “object,” and “it” are indefinite
terms, they refer to one arbitrary but fixed object. They are, essen-
tially, variables! So, in half-formal terms, the structure of our sentence
is:
8.1.7 In order to formalize our inference (4), we need to talk about “there
exists,” “there is,” “some,” and so on. In first-order logic, we abstractly
represent these expressions by the existential quantifier ∃. Otherwise,
the idea is the same as in “for all.” So, from “there is something in
the left drawer” we get via “there is some object such that it is in the
left drawer” to “there is some x such that x is in the left drawer,” and
finally reach
∃xR(x, b),
where R stands for the predicate “. . . is in ” and b is a constant for
the left drawer. The whole inference (4) therefore becomes
8.1.8 Those are the basic ideas of first-order languages. To sum up, let’s
put our new vocabulary in a table together with names and intended
reading:
We’ll now make the syntax of first-order logic formally precise. At the
end of the chapter, we’ll talk about formalization in first-order logic.
8.2.2 Strictly speaking the arity function ar is always part of the signature.
However, it’s a bit annoying to always have it around since its function
is purely auxiliary. We’ll therefore introduce the notational convention
that for R ∈ R, Rn means that R is such that ar(R) = n, and similarly
for f ∈ F, f n means that f is such that ar(f ) = n. This allows us
to drop the arity function from the specification of a signature and
still record all the information it provides. Note well, however, that
the expression Rn is not a symbol of our language, only R is. The
notation Rn is purely suggestive.
1
In this chapter, L will stand for a fixed but arbitrary first-order language.
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 185
8.2.3 Examples:
SP A = ({0}, {S 1 , +2 , ·2 }, ∅),
In the following, we’ll always assume that we’re dealing with some
arbitrary but fixed signature S = (C, F, R).
f (a) = f (b),
where a stands for Ada Lovelace, b for Alan Turing, and f for “the
birthplace of . . . .” Note that we don’t need to say what = stands for,
this is clear! We’ll talk about identity some more when we talk about
formalization.
8.2.5 Remember that above (8.1.4) we mentioned that function expressions
can be nested, i.e. used within one another. This necessitates that we
give a recursive definition of the terms of our language, which is what
we’ll do next. The set T of terms is recursively defined as the smallest
set X such that:
(i) (a) V ⊆ X
(b) C ⊆ X
(ii) If t1 , . . . , tn ∈ X and f n ∈ F, then f (t1 , . . . , tn ) ∈ X
In words, the terms are all the variables and constants plus the func-
tional combinations of those.
8.2.6 Examples:
S(0), S(S(0)), . . . ∈ T
(ii) The only terms in the empty signature S∅ are the variables
x, y, z, . . . .
(iii) The only terms in the signature S∈ are ∅ and the variables.
(iv) Assuming that f 2 ∈ F, we have
f (x, x), f (x, y), f (y, x), f (y, y), f (f (x, y), f (y, x)), . . . ∈ T
8.2.7 Note that in our function expressions, we don’t pay attention to the
idea of domains and ranges we painstakingly introduced in 3.6.4: for
any term t a unary function symbol f generates a new term f (t). It is
possible, and in some cases necessary, to develop a syntax theory for
terms which takes into account the domains and ranges of functions
by means of typing. This is, for example, important when we study the
logical foundations of programming languages, which often make use
of typing. In this course, however, we won’t pay that much attention to
functions, and therefore typing. Instead, we focus on the grammar of
formulas. Correspondingly, we allow ourselves the leisurely assumption
that every function is defined for every object.
8.2.8 Now, after everything we’ve said, it should be relatively clear what the
recursive syntax of L looks like. The set L of formulas is recursively
defined as the smallest set X such that:
The initial elements of X, the formulas given by (i.a–b), are also called
atomic formulas.
8.2.10 Examples:
x = 10
S(x) = 44
2+2=4
1·1=0
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 188
∀xS(x) 6= 0
(2 · 2) = 5 ∧ S(44) = 7)
∀x∀y(x 6= y → S(x) 6= S(y))
∀x∀y(S(x) = y + 1 → S(x) = S(y))
∀x∃yS(x) = y
x=y
(x = y ∧ y 6= z)
∀x∃y(x = y ∧ ∀zy 6= z)
∀x∃yx 6= y
∃x∃y(x 6= y ∧ ∀z(z = x ∨ z = y))
∈(x, x)
∀x∈(∅, x)
¬∃x∈(x, ∅)
∀x(∈(x, y) → ∈(x, z))
∀x∀(x = y ↔ ∀z(∈(z, x) ↔ ∈(z, y)))
8.2.11 How do we prove that an expression σ is not a formula? Well, just like
in propositional logic (cf. 4.1.9). Once we’ve introduced parsing trees
in the following section, it will, in fact, be relatively straight-forward
to adopt our algorithm from 4.3.10 to first-order logic. But we shall
not do this explicitly, rather it will be left as an exercise (8.9.4). More
generally, in first-order logic, we shall not focus so much on the more
nit-picky details of syntax, like proving that a formula is an expression
or not. We have bigger fish to fry.
8.2.12 Since we’re not so much concerned with very detailed syntax, we can
already introduce the notational conventions here. Actually, they are
precisely the same as in propositional logic (cf. §4.5). To see that we
can’t leave out parentheses with the quantifiers, let’s quickly look at
one example. In the expression ∀x(P (x) → S(a)), we really cannot
leave out any parentheses. If we would, we’d get ∀xP (x) → S(a),
which is very different from ∀x(P (x) → S(a)). To see the difference,
let’s interpret P as the predicate “. . . passes,” S as “. . . is surprised,”
and a as denoting me. Under this reading, ∀xP (x) → S(a) says that
if everybody passes, then I’m surprised. This is true—though, I’d be
positively surprised. The formula ∀x(P (x) → S(a)), instead, says that
for every individual student, if that student passes, I’m surprised. This
is certainly false: I believe in every single one of you ,3
8.2.13 Also the topic of proof by induction we can handle rather quickly. Since
the set of formulas is defined recursively, proof by induction works just
like in propositional logic: we show that all formulas have a property
by showing that the atomic formulas have the property and that it’s
preserved under the constructions:
8.2.14 Note that also the set T is inductively defined, so we can also prove
things about terms by means of induction:
8.2.15 Similarly, function recursion works standardly: the sets of terms and
formulas are inductively defined, hence we can use function recursion
on them. The pattern is the same as always: give the value for the
initial elements and say how to calculate the value for more complex
elements based on the values of their components. As an example, let’s
generalize the notion of complexity from propositional logic (4.4.4) to
first-order logic. First, we define a complexity c : T → N for terms by
saying:
As you can see, things work really analogously to the way they work
in propositional logic.
f (t1 , . . . , tn )
(ii) T (f (t1 , . . . , tn )) =
T (t1 ) . . . T (tn )
8.3.3 Examples:
S(S(S(S(0))))
S(S(S(0)))
S(S(0))
S(0)
0
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 192
0 S(0) 0
f (g(a, b))
g(a, b)
a b
8.3.4 We can now give the general, recursive definition of a parsing tree for
a formula φ ∈ L:
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 193
R(t1 , . . . , tn )
(i.a) T (R(t1 , . . . , tn )) =
T (t1 ) . . . T (tn )
t1 = t2
(i.b) T (t1 = t2 ) =
T (t1 ) T (t2 )
¬φ
(ii.a) T (¬φ) =
T (φ)
(φ ◦ ψ)
(iii.b) T ((φ ◦ ψ)) = for ◦ = ∧, ∨, →, ↔
T (φ) T (ψ)
Qxφ
(ii.c) T (Qxφ) = for Q = ∀, ∃
T (φ)
8.3.5 Example. Since the idea of how to do parsing trees should be clear by
now, we do just one, more involved example:
f (a) f (b) y y
a b
8.3.7 In the following, we shall need, for technical reasons, the notion of a
stripped parsing tree. The stripped parsing tree of a formula is the re-
sult of leaving only the main operator on each node when we’re doing
the ordinary parsing tree. Here is an explicit, recursive definition of
stripped parsing trees for terms and formulas:
Terms:
f
(ii) TS (f (t1 , . . . , tn )) =
TS (t1 ) . . . TS (tn )
Formulas:
R
(i.a) TS (R(t1 , . . . , tn )) =
TS (t1 ) . . . TS (tn )
=
(i.b) TS (t1 = t2 ) =
TS (t1 ) TS (t2 )
¬
(ii.a) TS (¬φ) =
TS (φ)
◦
(iii.b) TS ((φ ◦ ψ)) = for ◦ = ∧, ∨, →, ↔
TS (φ) TS (ψ)
Qx
(ii.c) TS (Qxφ) = for Q = ∀, ∃
TS (φ)
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 195
8.3.8 Example. Here’s the stripped parsing tree for Example 8.3.5:
∀x
R ∃y
x g R
f f y y
a b
8.3.9 In the following, we shall often need to access the information provided
by parsing trees. In order to be able to do so, we need to be able to
refer to the nodes in a given tree in a clear fashion. For this purpose,
we introduce the following (standard!) naming conventions for nodes
in trees. Let me introduce the idea by means of an example. Take the
tree:
• •
• • •
r, (r, 1), (r, 1, 1), (r, 1, 2), (r, 1, 1, 1), (r, 1, 2, 1), (r, 1, 2, 2).
Note that there can be empty names for nodes. For example, the node
(r, 2, 1, 1) doesn’t denote a node in our tree.
Essentially, we name a node by giving the “directions” for someone
traveling along the edges through the nodes.4 Here is a more general,
recursive (!) definition of the name pnq of a node n in a tree:
S(S(S(S(0))))
S(S(S(0)))
S(S(0))
S(0)
0
(ii) The quantifier ∃y occurs in the formula ∀x(R(x, g(f (a), f (b))) →
∃yR(y, y)) since it labels the node (r, 1, 2) in the stripped tree:
∀x
R ∃y
x g R
f f y y
a a
(iii) The formula R(x, y) occurs twice in the formula ∀x(R(x, y) →
∃x∀y(R(y, x)∧¬R(x, y))), once at (r, 1, 1) and once at (r, 1, 2, 1, 1, 2, 1):
∀x(R(x, y) → ∃x∀y(R(y, x) ∧ ¬R(x, y)))
R(y, x) ∧ ¬R(x, y)
R(y, x) ¬R(x, y)
y x R(x, y)
x y
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 198
8.3.12 The fact that an expression can occur more than once requires us to
talk about occurrences of expressions. For many purposes we want to
be able to distinguish different occurrences of expressions, we want, for
example, to be able to distinguish the occurrence of R(x, y) at (r, 1, 1)
from the occurrence at (r, 1, 2, 1, 1, 2, 1). We do this by defining an
occurrence of an expression in a formula as the pair (n, σ) where n is
a node in the parsing tree labelled with σ.
∀x
R ∃x
x y ∀y
R ¬
y x R
x y
((r, 1, 1, 1), x)
((r, 1, 1, 2), y)
((r, 1, 2, 1, 1, 1, 1), y)
((r, 1, 2, 1, 1, 1, 2), x)
((r, 1, 2, 1, 1, 2, 1, 1), x)
((r, 1, 2, 1, 1, 2, 1, 2), y)
R(x, y) x c y R x c y
x y x y
N (x) → ∃xR(x, x) →
N (x) ∃xR(x, x) N ∃x
x R(x, x) x R
x x x x
8.4.5 Putting this all together, we get to the following official definition of a
quantifier occurrence capturing or, as we typically say in logic, binding
a variable occurrence:
8.4.7 Now, with the notion of variable binding in place, we can define the
central concept of open and closed formulas: we say that a formula is
open iff there exists a variable occurrence in the formula that is not
bound by some quantifier occurrence in the same formula. A formula
is called closed iff it’s not open, i.e. iff all variable occurrences in the
formula are bound by some quantifier occurrence.
8.4.9 In the following, we shall study only inferences involving closed for-
mulas or sentences as they are typically called. The reason for this is
that open formulas are not straight-forwardly apt to be true or false in
a possible situation: an open formula, like P (x), contains an unbound
variable, which intuitively is something like a pronoun who’s reference
you don’t know. This spells trouble for our account of valid inference.
Suppose that somebody comes into the room and declares “She’s com-
ing! So, we should all be happy.” How can you possibly determine any
relation between the truth of “she’s coming” and “we should all be
happy” without knowing who “she” refers to? It is possible to use
free variables and (disambiguated) pronouns in a reasonable, logical
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 203
Qy
TS (φ)
This means that k must be a node in TS (φ). But that would mean
that (k, Q0 x) binds (n, x) in φ. Contradiction. Hence (n, x) is also free
in Qyφ, as desired.
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 204
8.5 Substitution
8.5.1 Before we talk about formalization, we will introduce the concept of
substitution of terms for (free) variables in formulas. The point of this
operation is to be able, in a purely syntactic way, to specify what
certain pronouns stand for. Remember that in first-order logic, we
treat pronouns as variables: “it is red,” for example, is formalized as
R(x). Now, without knowing what “it” stands for, we cannot deter-
mine whether this sentence is true or false. In semantics, which we
treat in the next chapter, we will discuss a semantic way of achieving
this. But for many purposes, especially proof theory, it will be useful
to be able to do this in a purely syntactic fashion, i.e. just by manipu-
lating symbols. This is what the operation of term-substitution allows
us to do. To illustrate the idea, think of the sentence “it is red” for-
malized as R(x) again. Suppose further that in our language we refer
to the ball using the constant a. A simple way of making it explicit
that “it” stands for the ball is to replace the x in R(x) with a to get
R(a), a formula that says that the ball is red. We will now define this
operation as a general operation on formulas: the operation of a term
substituting a term t for free occurrences of a variable x in a formula
φ. For this, we write (φ)[x := t].
Note the parentheses which indicate the scope of the substitution op-
eration: where to apply the operation. Let’s go through one example
step-by-step, let’s calculate (f (a, g(h(x), c)))[x := c]:
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 205
Well, we could have done this without the recursive definition, sure.
But the point here is that we want all of our definitions to be, at least
in principle, computer implementable—and the way we can achieve
this is by defining them properly, recursively.
8.5.3 Now we can define the notion (φ)[x := t] of substituting t for all free
occurrences of x in φ. We do this recursively:
(i) (a) (R(t1 , . . . , tn ))[x := t] = R((t1 )[x := t], . . . , (tn )[x := t])
(b) (t1 = t2 )[x := t] = (t1 [x := t] = t2 [x := t])6
(ii) (a) (¬φ)[x := t] = ¬((φ)[x := t])
(b) ((φ ◦ ψ))[x := t] = ((φ)[x := t] ◦ (ψ)[x := t]) for ◦ = ∧, ∨, →
,↔
(
Qy(φ)[x := t] if y 6= x
(c) (Qyφ)[x := t] = for Q = ∀, ∃
Qyφ if y = x
The crucial clause is (ii.c), which blocks us from substituting the vari-
able as soon as we hit upon a quantifier that binds it. This is because
we only want to replace free occurrences of variables. Why? Well, first
of all, because only for free variables it’s unclear what they stand for.
So only for them do we need to use substitution to say what they
stand for. Moreover, if we replaced bound variables, we could change
the meaning of statements. To see this, note that ∃xR(x) says that
there exists a red thing (assuming that R stands for “. . . is red”). Now,
suppose that (∃xR(x))[x := a] would yield ∃xR(a). This would turn
the statement “there exists a red thing” into the statement “there ex-
ists an object such that the ball is red” (assuming that a stands for
the ball). This is not only a weird statement, it could actually be false,
even if “there exists a red thing” is true: suppose that the ball is blue
and the cup is red. Then “there exists a red thing” is true but “there
exists an object such that the ball is red” is false. /
6
Note that the symbol “=” is used in 3 different ways here: 1. in the substitution
↓ ↓ ↓
operation (t1 = t2 )[x := t] = (t1 [x := t] = t2 [x := t]), 2. as the strict identity of terms
↓
(t1 = t2 )[x := t] = (t1 [x := t] = t2 [x := t]), and 3. as the identity symbol of our language
↓ ↓
(t1 = t2 )[x := t] = (t1 [x := t] = t2 [x := t]).
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 206
8.6 Formalization
8.6.1 We conclude this chapter with a brief discussion of formalization in
first-order logic. All the points from propositional logic still apply. The
translation key in first-order logic contains the following information:
So, bottom-line, the translation key gives us the reading of the vocab-
ulary in the signature.
8.6.2 Examples.
8.6.3 Here are some standard translation patterns for existential quantifiers
in natural language (“some,” “there exists,” . . . ) using any transla-
tion key where S stands for “. . . is smart” and H stands for “. . . is
handsome.”
Somebody who’s smart exists ; ∃xS(x)
There’s somebody who’s not smart ; ∃x¬S(x)
Somebody’s smart and somebody’s ; ∃xS(x) ∧ ∃xH(x)
handsome
Somebody’s smart and handsome ; ∃x(S(x) ∧ H(x))
Nobody’s both smart and handsome ; ¬∃x(S(x) ∧ H(x))
Somebody, who’s smart, is hand- ; ∃x(S(x) ∧ H(x))
some
One very important piece of advice: what you want to say is almost
never (!):
∃x(S(x) → H(x)),
i.e. someone is such that if they’re smart, then they’re handsome.
Remember that → is the material conditional, so this statement would
already be true if there’s someone who’s not smart (clear? if not, read
5.1.6 again); and it’s only false if there is someone who’s both smart
and not handsome.
8.6.4 Here are some standard translation patterns for universal quantifiers
in natural language (“for all,” “every,” . . . ) using the same translation
key as in the previous examples:
Note well, however, that ∀x(S(x) ∧ H(x)) and ∀x(S(x) → H(x)) say
very different things: the former says everybody is both smart and
handsome, while the latter says that everybody who’s smart is also
handsome.
using free variables. Only when clearly the same thing is meant, use
the same variable, if different things could be meant, use different
variables:
He’s handsome ; H(x)
She’s handsome and smart ; H(x) ∧ S(x)
He’s handsome and he’s smart ; H(x) ∧ S(y)
He’s handsome and she’s smart ; H(x) ∧ S(y)
That’s a smart and handsome person ; H(x) ∧ S(x)
8.6.6 Last, we briefly discuss how we can express that there are a fixed
number of objects with a certain property. Let’s suppose that we want
to say that there is at least one thing that has a certain property. If
we use P as a predicate for a property, a simple formula that will do
the trick is
∃xP (x) (Exists1 )
Now, suppose that we want to say that there is at most one object
(possibly none). How can we do that? Well, a neat little mathematical
idea (that we’ve already used in §2 and in the context of functions, cf.
3.6.10) is to say that to say that at most one object is so-and-so is to
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 209
8.6.7 Ok, so far so good. Now what if we want to say that there are at least
two things that are so-and-so. Well clearly there have to be two things,
x and y that are both so-and-so. But is this enough? Well, no! The
objects x and y could be identical, in which case there would be only
one object after all. So, we need to exclude this possibility, which gives
us the following natural formula for saying that there are at least two
things:
∃x∃y(P (x) ∧ P (y) ∧ x 6= y) (Exists2 )
And what about at most two things? Well, it shouldn’t be possible
that there are three things, any potential third thing would have to
already be one of our initial two. So, generalizing the idea from (At
Most1 ), we get:
So, to say that we have exactly two P ’s, we can just conjoin (Exists2 )
and (At Most2 ):
Now, you hopefully see the pattern. Can you write a formula that says
that there are at least/at most/exactly 3 P ’s?
CHAPTER 8. SYNTAX OF FIRST-ORDER LOGIC 210
(a) y 6= x
(b) n = r
(c) m = r
(d) There is a path from m to n such that Qy is on that path (for
Q = ∃, ∀)
(e) There is a path from the root to n which does not go through m.
(f) There is a path from the root to m which goes through n.
(g) There is a path from the root to n which goes through m.
(h) There is a path from the root to m which does not go through n.
8.8.3 Let φ be a formula with precisely one free variable, x. Consider the
result of a substitution (φ)[x := t] of term t without free variables for
all free occurrences of x in φ. Which of the following cannot happen?
8.9 Exercises
8.9.1 [h] Define the notion of a subformula in first-order logic by generalizing
Definition 4.4.2.
8.9.2 [h] Prove that for each formula φ, if x is the only variable that occurs
free in φ, then Qxφ is closed for Q = ∀, ∃.
8.9.6 [h] Is it the case that every sub-formula of a sentence is itself a sen-
tence? If so, prove it. If not, give a counterexample.
8.9.7 Let x be a variable that occurs free in φ and y any other variable. Is it
always the case that y occurs free in φ[x := y]? If so, prove it. If not,
provide a counter-example.
8.9.14 Idem, maar nu met de verzameling van alle mensen als discussiedomein,
voor:
a. ∃x S(x, p)
b. ∀x ∀y (S(x, y) → G(y, x))
c. ∀x (∃y G(x, y) → ∃y S(x, y))
d. ¬∃x G(p, x) ∧ ¬∃y S(y, p)
e. ∀x (B(x) → ∃y G(y, x))
9.1.2 Note that a model for propositional logic, i.e. an assignment, inter-
prets the non-logical vocabulary of the language in question (as truth-
values). The meaning of logical vocabulary, i.e. the sentential opera-
tors, is given by the truth-functions. In first-order logic, the situation
is similar. A model interprets the non-logical vocabulary of the first-
order language in question, i.e. the signature. The meaning of the
sentential operators is still given by the truth-functions, and we know
how those work. The meaning of the quantifiers, instead, we’ll have to
study in a bit more detail.
9.1.3 Let’s begin by informally describing the idea of how we use the con-
cepts from set-theory to provide the notion of a model for a first-order
language. In §8.1, we discussed the idea that in first-order logic, we
need to take the subject-predicate structure of sentences into account
but we abstract away from the concrete terms and predicates involved.
For now, let’s focus on simple, term-property sentences, like “the ball
is red.” Logically speaking, i.e. abstracting away from the concrete
215
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 216
P (a),
9.1.4 How can we formally model this? Well, by assigning the ball as the
denotation to a and the set of all red things, {x : x is red}, as the
interpretation to P . To distinguish the actual ball from it’s name, we
call the ball JaK and use a as its name. Our observation, so far, is
that P (a) should be true under the intended interpretation of a and
P iff JaK ∈ {x : x is red}, i.e. iff the ball is a member of the set
of red things. But now remember that for our logical purposes, we
abstract away from the concrete terms and predicates involved, so we
should forget about their meaning, too: P (a) is just a formula. But we
can use the idea we just described to obtain natural truth-conditions
for P (a). All we need to know is which object a denotes and which
property, conceived as a set, P expresses. Then, we can say that P (a)
is true iff the object denoted by a is in the set expressed by P . And
that’s precisely what a model for first-order logic does: it tells us which
objects the terms denote and it tells us which properties (i.e. sets) the
predicates express. From there, the definition of truth-in-a-model flows
rather naturally.
9.1.5 Now let’s generalize the idea from the previous point. Remember, from
8.1.5, that the general form of a simple sentence in first-order logic is
R(t1 , . . . , tn ),
where a stands for “Ada Lovelace,” b for “Alan Turing,” c for “An-
gela Merkel,” and f for ‘the LCA of . . . and ,” then the value
M
Jf (a, f (b, c))K in a model M can be calculated as follows:
P (x),
J∃xφKM
α =???
J∀xφKM
α =???
J∀x(S(x) → R(x))KM M
α = 1 iff for all objects d, JS(x) → R(x)Kα[x7→d] = 1
J∀xφKM M
α = 1 iff for all objects d, JφKα[x7→d] = 1
J∃xφKM M
α = 1 iff for some d, we have JφKα[x7→d] = 1
9.1.10 Should we really consider all possible values x can take in the recursive
clauses for ∀ and ∃? There are good, intuitive reasons to say that the
answer is: no! Huh? Well, consider the statement “everybody passes
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 220
the course.” The logical form of this statement is ∀xP (x), where P
stands for “. . . passes.” If we consider all things as possible values for
x, this sentence clearly is false: if x denotes the ball, for example,
then P (x) is clearly false—a ball can’t pass the course. But that’s also
not what I meant. I mean that every student passes the course. Now,
there are two ways of going about modeling this: either we revise
the grammatical structure of our sentence to ∀x(S(x) → P (x)) or
we restrict the possible values for x. In the former case, we get the
right result, since trivial counterexamples like the ball no longer make
problems: if x denotes the ball, then S(x) is false and so S(x) → P (x)
is true. The only real counterexample will now be a student, i.e. a
member of S M , that is not a member of P M . So, the solution works.
But it has a certain flair of “cheating:” we revised the grammatical
structure of the sentence we wanted to model to something else than
what we actually said. In general, this sort of move is not liked by
logicians. The other solution, restricting the possible values, is more
generally liked. It’s the one we shall adopt: in a model M, we shall
restrict the values for all our syntactic expressions to values from a
fixed set DM —the domain of discourse in the model. The domain of
discourse fixes the kinds of things we’re talking about. In our example,
“everybody passes,” the intended domain of discourse should include
all and only the students in the course. In arbitrary model, however,
the domain can, of course, be arbitrary.1
9.1.11 Now everything is in place. We will spend the rest of the chapter
pouring the previous ideas into fully formal, precise definitions. But
before we do so, it’s worth going through two ideas that one might
have for how the quantifiers should work that actually don’t work.
This will shed light on the idea that we’re actually using in this course.
The first idea is to use substitution as follows: why don’t we say that
∀xφ is true iff (φ)[x := t] is true for every term t, and, analogously,
∃xφ is true iff for some term t, (φ)[x := t]? This is known as the
substitutional account of the quantifiers. Considering an example of a
concrete language and intuitive model quickly shows why this account
can’t be correct. Take the statement “there is a red thing,” which we
formalize as ∃xR(x) in a language with the predicate R for “. . . is red”
and additionally only the constant a for the ball. Suppose that we’re
in a model M where there are only two things, the cup and the ball.
The constant a duly denotes the ball and R expresses the property of
1
There is also a deeper, more technical reason: there is no universal set U of absolutely
everything. To see this, note that a set is a thing, so we’d get U ∈ U . But this kind of
thing usually spells trouble: we can quickly derive paradoxes when we allow for sets to
contain themselves. This is why in standard set-theory, universal sets, and more generally,
sets containing themselves are banned.
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 221
being red, which in our model is such that the cup is red but the ball
is not. Additionally, we’re working with an assignment α such that
α(x) is the ball for all variables x ∈ V. Intuitively, it’s correct that
there is a red thing, namely the cup. So, ∃R(x) should be true in the
model. And, in fact, if we use our idea from above, we get this result:
simply change the value of x to the cup and R(x) becomes true. But
there is no term that, given our model and assignment, denotes the
cup. So, we can’t find a t such that (R(x))[x := t] comes out true. Our
language is just not expressive enough to talk about all the objects in
our model. There is no natural way of fixing this. It’s simply unfeasible
to postulate that we have names for all objects in all models—there
are simply to many. There is a way of somehow fixing the idea, but we
won’t explore it in the course. We’ll return to the idea of substitution
in the proof theory chapter.
J∀x(S(x) → R(x))KM M
α = 1 iff for every assignment β, JS(x) → R(x)Kβ = 1
J∀φKM M
α = 1 iff for every assignment β, JφKβ = 1
J∃φKM M
α = 1 iff for some assignment β, JφKβ = 1
∀yR(x, y),
where R stands for “. . . is smaller than (or equal to) .” The model
the intended reading suggests is to let DM = N, i.e. we talk about the
natural numbers, RM = {(n, m) : n ≤ m} (i.e. the relation of being
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 222
smaller than: the set of numbers such that the first is smaller than
(or equal) to the second), and α(x) is the number zero. Intuitively
speaking, on this reading, ∀yR(x, y) should come out true in such a
modeling situation: zero is indeed such that it is smaller than every
other number (and identical to itself). But, alas, the present proposal
gives another verdict: it’s not the case that for every assignment β,
JR(x, y)KM β = 1. Just take any assignment β which assigns 2 to x and
1 to y. Since (2, 1) ∈/ {(n, m) : n ≤ m} = RM , we get JR(x, y)KM β = 0.
M
And so, according to the proposal, J∀yR(x, y)Kα = 0. —The problem
is that, intuitively, the value of x needs to remain fixed. Our official ac-
count from 9.1.9 guarantees this, but the account under consideration
does not. The problem has very much to do with what happens when
we have more than one quantifier in a statement. In fact, our argu-
ment can be used to show that in our intended model, J∃x∀yR(x, y)KM α
turns out to be 0, though intuitively it should be 1. To see this, note
that our proposal would say that J∃x∀yR(x, y)KM α = 1 iff there exists
M
a assignment β, such that J∀yR(x, y)Kβ = 1, which in turn would
be the case iff for every assignment γ, we have JR(x, y)KM γ = 1. But
we just figured out that no-matter what we start with, while there is
a assignment β such that J∀yR(x, y)KM β = 1, it’s not the case that,
M
then, for all assignments γ, JR(x, y)Kγ = 1. Nested quantifiers are, in
fact, the ultimate reason why we need the official definition that we
endorse.
9.1.13 That’s it, these are the ideas that we’re going to develop in this chap-
ter. Let’s briefly sum up:
The rest is, more or less, standard. Validity will be defined as truth-
preservation across all models, just like in propositional logic. We’ll
now make these concepts fully precise.
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 223
9.2.2 Examples. The following are all examples of models for their respective
signatures (I took the signatures from Example 7.2.3). It’s important
to note that for signatures with an intended reading (as in the cases
of arithmetic and set-theory), there are both “intended” and “unin-
tended” models:
9.2.5 Examples: Note that for the assignment, the only component of the
model that matters is the domain, since the variables assume values
from here.
9.2.6 With the concept of a model and an assignment in place, we can define
the denotation JtKM
α of a term t in a model M under assignment α by
the following recursion:
9.2.7 Examples:
J0KM
α =0
JxKM
α =0
JS(0)KM
α =1
Jy · S(0)KM
α =1
JS(((x · y) + z))KM
α =3
J0KM
α =0
JxKM
α =0
JS(0)KM
α =2
Jy · S(0)KM
α =0
JS(((x · y) + z))KM
α =2
J0KM
α =1
JxKM
α =1
JS(0)KM
α =3
Jy · S(0)KM
α =3
JS(((x · y) + z))KM
α =5
J0KM
α = 42
JxKM
α =0
JS(0)KM
α = 42
Jy · S(0)KM
α =1
42
=1
JS(((x · y) + z))KM 1
α = (0 ) · 2 = 0
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 227
Jf (f (x))KM M M
α = f (f (α(x)) = 1
Jg(b, c)KM M M
α = min(b , c ) = min(3, 2) = 2
Jg(b, y)KM M
α = min(b , α(y)) = min(3, 4) = 3
Jg(f (f (x)), g(b, c))KM M M
α = min(α(x), min(b , c )) = min(1, min(3, 2)) = 1
Jf (g(g(a, b), g(b, c))))KM M M M M
α = min(min(a , b ), min(b , c )) = min(min(1, 3), min(3, 2))
Note that both the model and assignment crucially affect the values
of terms. The results in weird models can be weird. Try some more
examples by yourself.
9.2.8 Finally, we shall define the crucial operation of changing the value of
a variable under an assignment, which we need for the clauses for the
quantifiers. Let α be an assignment in a model M = (DM , ·M ). We
define the function α[x 7→ d], which is the result of setting the value
of variable x ∈ V to d ∈ DM , by the following condition:
(
α(y) if y 6= x
α[x 7→ d](y) =
d if y = x
JxKM
α[x7→d] = d.
Jf (t1 , . . . , tn )KM
α = f M( Jt1 KM
α ... Jtn KM
α )
=
f M( Jt1 KM
β ... Jtn KM
β ) =Jf (t1 , . . . , tn )KM
β
The Locality Lemma essentially states that the value of a term under
an assignment only depends on the values the assignment gives to the
variables in the term. In fact, we can infer the following corollary about
ground terms, i.e. terms without variables in them
Corollary (Ground Terms Lemma). Let M be a model and t ∈ T a
ground term. Then for all assignments α, β, we have JtKM M
α = JtKβ .
the induction step, assume the induction hypothesis, that for the term
n = S(. . . S(0) . . .) we have JnKM
α = n. We need to show that for
the term S(n) = n + 1, we have JS(n)KM α = n + 1. Now note that
JS(n)KM α = S M (JnKM ) = JnKM + 1. But by the induction hypothesis,
α α
we have JnKM M
α = n, so we have JS(n)Kα = n + 1, as desired.
Note that we can use similar methods for other inductively definable
subsets of terms or formulas. We can, for example, prove facts about
all terms without variables (i.e. ground terms) by showing that all
constants have the property and the property is preserved under ap-
plying function symbols. Or, we can show that all formulas with an
even number of negations have a property by showing that all atomic
formulas have the property and that the property is preserved under
writing two negations in front of a formula. In the following, we shall
often (sometimes implicitly) make use of such “restricted” forms of
induction on terms or variables.
J∀xφKM M M
α = min({JφKα[x7→d] : d ∈ D })
Note that we’re using the min and max functions here as functions
defined on (non-empty) sets of truth-values X ⊆ {0, 1}, i.e. min(X)
is the smallest element of X and max(X) is the biggest element of X.
More explicitly, we have max({0}) = 0, max({1}) = 1, max({1, 0}) =
1, and min({0}) = 0, min({1}) = 1, min({1, 0}) = 0. It might look
like {JφKM M
α[x7→d] : d ∈ D } is a (possibly) quite big set, depend-
ing on the size of DM . But note that each of the individual values
JφKMα[x7→d] is either 0 or 1. Since multiplicity doesn’t matter in sets, the
set {JφKM M
α[x7→d] : d ∈ D } is either {0}, {1}, or {0, 1}.
9.3.2 Just like in (5.1.11), we can define truth in a model under a assignment
as a property of formulas. Here, we don’t do this as an alternative
definition, as we did in §5.1, but rather, we take the property M, α φ
of a formula being true in a model under an assignment to be defined
as follows:
M, α φ iff JφKM
α =1
9.3.3 Using this definition, we can provide the following lemma, which has
the potential to make Definition 9.3.1 more transparent:
Note that clauses (viii) and (ix) are, more or less, explicitly the clauses
we gave as our motivation in §9.1.
(i) First, let’s take the standard model (9.2.2.i.a) of SP A . Let’s take
an assignment α with α(x) = 0, α(y) = 1, α(z) = 2. We get
(a) M, α S(0) = y
To see this, simply note that JS(0)KM M M M
α = S (J0Kα ) = S (0) =
1 and JyKM α = α(y) = 1.
(b) M, α 2 S(0) = x
This follows from the previous observation that JS(0)KM α =1
M
and JxKα = α(x) = 0
(c) M, α S(0) 6= x
This follows from the previous by propositional reasoning.
(d) M, α (S(0) 6= x ∨ 4 6= 4)
This follows from the previous by propositional reasoning.
(e) M, α S(0) = x → 1 6= 1
Follows from (b) and propositional reasoning.
(f) M, α ∀x(S(x) 6= 0)
We need to show that for each n ∈ DM = N, we have
M, α[x 7→ n] S(x) 6= 0. So let n ∈ N be an arbitrary num-
ber. We know that M, α[x 7→ n] S(x) 6= 0 iff M, α[x 7→
n] 2 S(x) = 0. So, we can use indirect proof to establish
that M, α[x 7→ n] S(x) 6= 0 by leading M, α[x 7→ n]
S(x) = 0 to a contradiction. So, assume M, α[x 7→ n]
S(x) = 0. It follows that JS(x)KM M
α[x7→n] = J0Kα[x7→n] . We have
JS(x)KM M
α[x7→n] = S (n) = n + 1. And we have 0
M = 0. So
JS(x)KM M
α[x7→n] = JS(S(0))Kα[x7→1] ,
as desired.
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 232
(h) M, α ∀x∃yx · y = x.
This formula involves a nested quantifier. Let’s first unfold
what we have to show: M, α ∀x∃yx · y = x iff for all
n ∈ N, we have M, α[x 7→ n] ∃yx · y = x. And we have
M, α[x 7→ n] ∃yx · y = x iff there exists an m ∈ N such
that M, α[x 7→ n, y 7→ m] x · y = x. So, what we need to
show in order to prove that M, α ∀x∃yx · y = x is that
for each n ∈ N, there exists an m ∈ N such that M, α[x 7→
n, y 7→ m] x · y = x. So let n ∈ N be arbitrary. Now if we
set m = 1, then we get
Jx · yKM
α[x7→n,y7→1] = α[x 7→ n, y 7→ 1](x) · α[x 7→ n, y 7→ 1](y)
=n·1
=n
Jx · yKM M
α[x7→n,y7→1] = JxKα[x7→n,y7→1] ,
(b) M, α P (x)
Simply note that JxKM α = α(x) = 1 ∈ {1, 3} = P
M
(c) M, α 2 P (z)
Simply note that JzKM α = α(z) = 4 ∈ / {1, 3} = P M
(d) M, α R(x, x)
First, remember that JxKM M M
α = 1. It follows that (JxKα , JxKα ) =
M
(1, 1) ∈ {(1, 1), (1, 2), (2, 2)(2, 3), (3, 3)} ∈ R .
(e) M, α ∃y(y 6= x ∧ R(y, y))
We need to show that there exists a d ∈ DM such that
M, α[y 7→ d] y 6= x∧R(y, y). Let d = 3. We get JyKM α[y7→3] =
α[y 7→ 3](y) = 3 and 3 6= 1 = α[y 7→ 3](x). Hence M, α[y 7→
3] y 6= x. Further, since JyKM α[y7→3] = 3, we have that
(JyKα[y7→3] , JyKα[y7→3] ) = (3, 3) ∈ RM . So, we have M, α[y 7→
M M
9.3.5 Note that in order to show that quantified claims are true in a model
under an assignment we actually need to do some work. A stark con-
trast between first-order logic and propositional logic is that in the
latter, we can simply calculate the truth-value of a formula under a
assignment without too much effort. In first-order logic, in contrast,
the definition of truth in a model under an assignment is recursive
and can thus be calculated, but it is not always easy to do so; we often
need to prove non-trivial claims to establish that a quantified claim is
true in a model.
(a) M, α ∃x∀yφ iff there is a change of value of x such that for all
subsequent changes of y which keep x fixed, φ is true.
(b) M, α 2 ∃x∀yφ iff for all changes of x there is a subsequent change
of y (which keeps x the same) such that φ becomes false.
(c) M, α ∀x∀yφ iff for all changes of x and subsequent changes of
y, φ is true.
(d) M, α 2 ∀x∀yφ iff for some change of x’s value there is a change of
y’s value which keeps x’s value fixed and makes φ false.
(e) M, α ∃x∃yφ iff for some change of x’s value there is a subsequent
change of y’s value, which keeps the value of x fixed and makes φ
true
(f) M, α 2 ∃x∃yφ iff for all changes of the values of x and subsequent
changes of y, φ is false.
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 234
(g) M, α ∀x∃yφ iff for all changes of x’s value there is a change of
y’s value that leaves x fixed and makes φ true
(h) M, α 2 ∀x∃yφ iff there exists a value for x such that for all sub-
sequent changes in the value of y (keeping x fixed), φ becomes
false
These clauses can be used to help you think about what you need to
show in order to establish whether a complex quantified claim is true.
iff (Jt1 KM M M
β , . . . , Jtn Kβ ) ∈ R . Since
(
1 if (Jt1 KM M
α , . . . , Jt1 Kα ) ∈ R
M
JR(t1 , . . . , tn )KM
α =
0 otherwise
and
(
1 if (Jt1 KM M
β , . . . , Jt1 Kβ ) ∈ R
M
JR(t1 , . . . , tn )KM
β =
0 otherwise
9.3.8 We can use the Sentence Lemma to justify the following definition of
truth in a model:
9.4.2 Examples
RM = {(n, m) : n ≤ m}
It’s relatively easily checked that ∀x∃yR(x, y) is true under every
assignment in this model, since for every number there’s a bigger
number: for every n ∈ N we can pick n+1 ∈ N and get M, α[x 7→
n, y 7→ n + 1] R(x, y). At the same time, it’s not the case that
some number is bigger than all others: there is n ∈ N such that
for all m ∈ M, M, α[x 7→ n, y 7→ n + 1] R(x, y).
(viii) ∃xP (x) ∧ ∃xQ(x) 2 ∃x(P (x) ∧ Q(x))
Here’s a countermodel:
DM = {a, b}
P M = {a}
QM = {b}
In this model, there we can find aM such that M, α[x 7→ aM ]
P (x) and so M, α ∃xP (x), and we can find bM such that
M, α[x 7→ bM ] Q(x) and so M, α ∃xQ(x). But neither aM
nor bM is such that M, α[x 7→ aM /bM ] P (x) ∧ Q(x)—nothing
is both P and Q.
(ix) ∀x(P (x) ∨ Q(x)) 2 ∀xP (x) ∨ ∀xQ(x)
The same countermodel works:
DM = {a, b}
P M = {a}
QM = {b}
9.4.3 We note that all the laws of classical propositional logic are valid in
first-order logic (cf. 5.2.6). Additionally, we can prove the following
logical laws concerning the quantifiers:
Proof. We only prove (iii) and leave the rest as very useful exercises.
9.4.3 The law ∀xφ ∃xφ might seem strange, but the underlying assump-
tion that leads to it, DM 6= ∅, is necessary to get some important
logical laws to work. For example, we clearly want that ∀xP (x)
P (a) (9.4.2.i): if everybody passes, then you pass. But if we’d allow
for DM = ∅, this law could fail. For simply consider a model with
DM = ∅. In that model ∀xP (x) would be trivially true: for every
d ∈ DM , we’d have that M, α[x 7→ d] P (a). But since DM = ∅,
we can’t have aM ∈ DM and so also not in P M , which means that
M 2 P (a).
9.4.4 Next, we observe that the Deduction Theorem and the I Can’t Get
No Satisfaction Theorem both hold for first-order logic as well:
1. Γ ∪ {φ} ψ
2. Γ φ → ψ
1. Γ φ
2. Γ ∪ {¬φ} is unsatisfiable
∀xφ → (φ)[x := t]
for t a ground term, which we can infer directly from 9.4.3.i. The I
Can’t Get No Satisfaction Theorem, instead, will play the same role
in first-order logic as in propositional logic: it’s the foundation of the
tableau method, which we’ll discuss in the next chapter.
9.4.5 We conclude this chapter with a long example in which we’re going
to prove the correct answer for the Albert, Betty, Charles puzzle from
the first lecture. Here we go:
¬M (a), M (c), L(c, b), L(b, a) ∃x∃y(M (x) ∧ ¬M (y) ∧ L(x, y)).
Proof :
Let M be a model and α arbitrary, such that JM (c)KM α = 1,
J¬M (a)KMα = 1, JL(c, b)KM = 1, and JL(b, a)KM = 1. So aM ∈
α α /
M M M M M M M M
M , c ∈ M , and (c , b ), (b , a ) ∈ L . We have that
J∃x∃y(M (x)∧¬M (y)∧L(x, y))KM α = 1 holds iff there are changes
for x to d and y to d0 such that
JL(x, y))KM
α[x7→d,y7→d0 ] = 1; giving us, J∃x∃y(M (x) ∧ ¬M (y) ∧
M
L(x, y))Kα[x7→d,y7→d0 ] = 1.
– If (ii) bM ∈
/ M M , we can set d = cM and d0 = bM . In a
similar way, we get
Either way, we get J∃x∃y(M (x) ∧ ¬M (y) ∧ L(x, y))KM
α[x7→d,y7→d0 ] =
1, which is what we wanted to show.
,
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 241
The Deduction Theorem holds for first-order logic but doesn’t lead to
decidability.
9.7 Exercises
9.7.1 Determine the denotation of the following terms in the models M from
(9.2.2.i.d) under the assignment α(xi ) = 2i + 1 for i ∈ N:
(a) x2
(b) S(x2 )
(c) (x1 + x3 )
(d) S(S(S(x0 )))
(e) S(0 · x1 )
(f) 2 + 2
(g) [h] (x1 · x2 ) + x3
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 243
(h) 0 + 0
(i) (0 · 0) + 1 (you can write down a shorthand version)
(j) 42
9.7.2 (a) [h] Prove, using induction on terms, that in model (9.2.2.i.a) of
SP A , we have JnKM
α = n, for all assignments α
(b) Prove, using induction on terms, that in model (9.2.2.i.b) of SP A ,
we have JnKMα = 2 · n, for all assignments α
(c) Prove, using induction on terms, that in model (9.2.2.i.d) of SP A ,
we have JnKMα = 42, for all assignments α
9.7.3 Prove the Ground Terms Lemma as a corollary of the Term Locality
Lemma.
9.7.4 [6 x] Explain why and how the law of bivalence holds on the first-order
semantics.
9.7.5 Determine whether the following claims hold in the standard model
(9.2.2.i.a) of SP A under the assignment α(x) = 1, α(y) = 2, α(z) = 3:
(a) M, α x = 1
(b) M, α S(x) = S(S(x))
(c) M, α 2 + 2 = 4
(d) M, α 1 · 1 = 0
(e) M, α ∀xS(x) 6= 0
(f) M, α ((2 · 2) = 5 ∧ S(44) = 7)
(g) [h] M, α ∀x∀y(S(x) = S(y) → x = y)
(h) M, α ∀x∀y(S(x) = (y + 1) → S(x) = S(y))
(i) M, α ∀x∃yS(x) = y
(j) M, α ∃x∀yS(x) = y
9.7.6 Take the model (9.2.2.iii.a) for S∈ . Consider the assignment α with
α(x) = {x : x is even} and α(y) = {x : x is odd}. Prove the following
facts:
(a) M, α ∃y(y ∈ x)
(b) [h] M, α ∀x¬(x ∈ ∅)
(c) M, α ¬∃z(z ∈ x ∧ z ∈ y)
(d) M, α ∃z∀u(u ∈ z ↔ u ∈ x ∨ u ∈ y)
(e) M, α 2 ∀x∀y(x = y ↔ ∀z(z ∈ x ↔ z ∈ y)) (Hint: Note that
counterexamples can’t be sets!)
CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC 244
Hint: You will need to rely on basic number theoretic and set-theoretic
facts.
9.7.8 Find a model that shows that {(φ)[x := t] : t ∈ T } 2 ∀xφ (cf. 9.1.11).
9.7.10 Remember the numeric quantifiers from 8.6.7. Prove the following
facts:
9.7.11 This one’s a real challenge. Suppose that M is a model for a language
with a function symbol f 1 ∈ F such that:
9.7.15 For each of the following formulas, provide a model M+ and an as-
signment α+ such that the formula is true in the model under the
assignment, as well as a model M− and an assignment α− such that
the formula is false.
9.6.2 (d)
10.1 Overview
10.1.1 We shall now, once more, turn to proof theory; this time for first-order
logic. As in the case of propositional logic, there are many different
kinds of proof theories for first-order logic: Hilbert calculi, Gentzen
calculi, natural deduction calculi, . . . . In this chapter, we’ll develop
a tableau calculus for first-order logic and in the next chapter we’re
going to prove soundness and completeness. As we observed at the
end of the previous chapter, the one on semantics, the I Can’t Get No
Satisfaction Theorem, which served as the theoretical foundations for
propositional tableaux, also holds for first-order logic: we have for all
formulas φ and sets of formulas Γ that:
The idea that we’re going to once more exploit is that we can de-
velop a syntactic method for determining whether a set of formulas
is satisfiable (viz. tableaux). By determining in a purely syntactic way
whether Γ ∪ {¬φ} is satisfiable, we get a proof theory for first-order
logic.
10.1.2 There is, however, an important limitation that we’ll have to take
into account. In propositional logic, the tableau method was purely
algorithmic: we could blindly apply the rules and would always, after
a finite amount of time, get an answer about the the validity of an
inference. This gave us a route to the decidability of propositional
logic. In first-order logic, very unfortunately, things aren’t as neat:
while we can construct tableaux sort of algorithmically, it will no
longer be the case that we can blindly apply the rules and after finitely
246
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 247
many steps get an answer: valid or invalid. The “local” reason for this,
the reason why this happens with tableaux, is that (as you’ll see) first-
order tableaux can turn out to be infinite. An infinite tableau is one
with infinitely many nodes. But, as we’ll see, an infinite tableau can
nevertheless be complete, in the sense that every rule that can be
applied has been applied. This might seem surprising coming from
propositional logic, where you really could construct every tableau
by hand. This will no longer be the case in first-order logic: there are
tableaux that no human could ever write down.
10.1.3 A more general and “deeper” reason why we can’t construct tableaux
as in propositional logic is that first-order logic is provably undecid-
able:
Proving this theorem is out of reach for the methods of this course.
In order to prove it we need to think about what an “effective algo-
rithm” is in the first place. You can study the methods in “Logis-
che Complexiteit” (KI3V12013). Here we will content ourselves with
some observations about why our tableau algorithm doesn’t lead to
decidability, which will let us glimpse at why first-order logic really
is undecidable.
φ φ ¬φ ¬ψ φ ψ ¬φ
ψ ¬ψ
φ ¬φ ψ φ ¬φ φ ¬φ
¬ψ ψ ¬ψ ¬ψ ψ
¬∀xϕ ¬∃xϕ
∃x¬ϕ ∀x¬ϕ
∃xϕ ∀xϕ
10.2.5 We will need to make a few remarks about the new rules. First, look
at the rule for ∃xφ. What this rule says is that you have ∃xφ on
a node, then you extend every branch with (φ)[x := p], where p is
a new parameter, i.e. a parameter that hasn’t been used yet on the
branch. How can it happen that a parameter has already been used
on a branch? Easy: if there’s another existential quantifier around,
as in the following example:
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 250
∃x∃yR(x, y)
∃yR(p, y)
R(p, q)
∃x∃yR(x, y)
R(p, q)
∃x∃yR(x, y) ∃x∃yR(x, y)
R(p, p) ∃yR(p, y)
R(p, p)
10.2.6 Next, let’s talk about the rule for the universal quantifier. What’s im-
portant about this rule is that it has to be applied for every constant
or parameter on the branch. So, if we have, for example, ∀xP (x),
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 251
Q(a), and R(q, b) all together on one branch, we have to apply the
rule for a, q, and b, as illustrated below:
∀xP (x)
Q(a)
R(q, b)
P (a)
P (q)
P (b)
This tableau is complete because every rule that can be applied has
been applied. But, it might happen, that you first apply rules for
the universal quantifier and then continue applying rules which then
introduce new parameters. In such a case, also for those parameters
you have to apply the rule. Here’s an example:
∀xP (x)
∃yR(a, y)
P (a)
R(a, p)
P (p)
The point is that first, we applied the rule to ∀xP (x) for the constant
a which was the only constant or parameter at this point (when we
only had the initial list). But then, we applied the rule for ∃yR(a, y),
which introduced a new parameter, p, to the branch. At this point,
it became possible to apply the rule for ∀xP (x) again, and so we did.
So, even though the following looks like a good tree, it’s not:
∀xP (x)
∃yR(a, y)
P (a)
R(a, p)
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 252
10.2.7 There’s one more feature of the universal quantifier rule that we
haven’t talked about: it says under ‡ that we should pick an arbi-
trary “fresh” parameter if there are no constants or parameters on
the branch. What’s meant here is that if there are no constants or
parameters on the branch but a universally quantified claim, then do
the same as in the case of the existential rule: instantiate formula in
question with a fresh parameter that’s not yet on the branch. So, for
example, the following is such a situation:
∀xP (x)
∀x(P (x) → Q(x))
P (p)
P (p) → Q(p)
¬P (p) Q(p)
What’s the idea here? Well, for one. In a situation like in our exam-
ple, we need to get the tableau method started: if there are just a
bunch of universal quantifiers around, otherwise nothing would hap-
pen. But that’s just the superficial reason. The “deeper” reason is
our assumption that the domain of every model is non-empty (cf.
9.2.3 and 9.4.4): in any model there needs to be at least one object
in the domain, and we introduce a fresh parameter to talk about this
object. In 9.4.3–4, we showed and discussed that the law ∀xφ ∃xφ
depended on exactly the assumption of non-empty domains. Below,
we will see that we can derive ∀xφ ` ∃xφ precisely because of the
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 253
10.2.8 It’s already been implicit, but explicit is better than implicit, so let
me just mention that the motivation behind the new rules is the
same as in propositional logic, which we can re-formulate for first-
order logic as follows:
10.2.10 Examples:
∀x¬P (x)
¬P (p)
P (p)
7
P (p) ∧ Q(p)
P (p)
Q(p)
¬P (p) ¬Q(p)
7 7
∃x¬R(x, x)
¬R(p, p)
R(p, p) ∨ R(p, p)
R(p, p) R(p, p)
7 7
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 255
¬P (p)
¬Q(p)
P (p) Q(p)
7 7
∀yR(p1 , y)
∃y¬∃xR(x, y)
¬∃xR(x, p2 )
∀x¬R(x, p2 )
R(p1 , p2 )
¬R(p1 , p2 )
7
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 256
P (p)
¬S(p, p)
P (p) → ∃yS(p, y)
¬P (p) ∃yS(p, y)
7
S(p, q)
P (p)
¬S(p, q)
7
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 257
K(p)
¬S(p, p) ↔ S(p, p)
¬S(p, p) S(p, p)
S(p, p) ¬S(p, p)
7 7
¬∀xP (x)
¬∀xQ(x)
∃x¬P (x)
∃x¬Q(x)
¬P (p)
¬Q(q)
P (p) ∨ Q(p)
P (q) ∨ Q(q)
P (p) Q(p)
7 P (q) Q(q)
7
The tableau gives us that ∀x(P (x) ∨ Q(x)) 0 ∀xP (x) ∨ ∀xQ(x). Now,
remember that for open branches in complete tableau we want to have
a model that makes all their members true, the associated model. We
also get associated models in first-order logic, but it’s a bit more
complicated to define them.
10.2.12 So let B be an open branch in a complete tableau. We then define
the associated model MB as follows:
(i) DMB = {a ∈ C ∪ P ar : a occurs on B}
(ii) aMB = a for all a ∈ C ∪ P ar
(iii) RMB = {(a1 , . . . , an ) : R(a1 , . . . , an ) ∈ B}
There’s something to talk about here. There’s no typo here: the ob-
jects in the domain of MB are really the constants and parameters on
B themselves. The model is what’s known in the literature as a term-
model : it’s a model built from the expressions of our language. In this
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 259
weird model, every constant and parameter is just a name for itself.
And, given that, predicates are interpreted just like the branch says
they should be. Now, if you think back of the associated valuation of
a branch in propositional logic (6.3.5), you will note that also there,
we basically let the branch tell us what to do. In first-order logic, this
is not much different. The only somewhat weird thing is that we let
constants (and parameters) denote themselves. But what’s really so
weird about this: constants and parameters are themselves objects
(they are things you can write down, etc.), so why shouldn’t they be
allowed to “live” in a model?
10.2.13 Examples:
(i) Let’s first look at the example ∀x(P (x) ∨ Q(x)) 0 ∀xP (x) ∨
∀xQ(x) from before:
¬∀xP (x)
¬∀xQ(x)
∃x¬P (x)
∃x¬Q(x)
¬P (p)
¬Q(q)
P (p) ∨ Q(p)
P (q) ∨ Q(q)
P (p) Q(p)
7 P (q) Q(q)
7
are p and q. So, we have DMB = {p, q}. The parameters p and
q denote themselves, that is we have pMB = p and q MB = q.
The only atomic formulas occurring on the branch are P (q) and
Q(p). Correspondingly, we get P MB = {q} and QMB = {p}.
So, to sum up, our model looks like this:
DMB = {p, q}
pMB = p
q MB = q
P MB = {q}
QMB = {p}
Now it’s easily checked that in this model, ∀x(P (x) ∨ Q(x)) is
true: there are two things (p and q) and each of them is either
P or Q (p is Q and q is P ). But ∀xP (x) ∨ ∀xQ(x) is certainly
false: neither is everything P (p is not) nor is everything Q (q
is not).
(ii) The next cases I’ll handle a bit more quickly:
∀x∀y(R(x, y) → R(y, x)) 0 ∀xR(x, x)
∀x∀y(R(x, y) → R(y, x))
¬∀xR(x, x)
∃x¬R(x, x)
¬R(p, p)
R(p, p) → R(p, p)
¬R(p, p) R(p, p)
7
Associated model MB :
DMB = {p}
pMB = p
R MB = ∅
Note that this is perfectly fine: in a model, RM can be empty
(i.e. nothing stands in the relation R to anything).
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 261
P (c) → P (p)
P (c) P (c)
7
¬R(p, q)
R(q, p)
Associated model of the branch MB :
DMB = {p, q}
pMB = p
q MB = q
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 262
10.2.14 Just like in propositional logic, we’ll be able to show that the associ-
ated model makes all the formulas on the branch true. This will be
the completeness lemma for first-order logic: if B is an open branch
of a complete tableau, then all formulas in B are true in MB under
all assignments. For now, it’s a good idea to convince yourself that
in the above examples, this is indeed the case.
..
. a=b
σ ‡ [x := a]
a = a†
σ[x := b]
10.3.2 First, the a = a rule. What this rule says is that for each constant or
parameter a on the branch, you need to add a node with a = a. The
purpose of this rule is to allow us to get ` ∀x(x = x), since clearly
∀x(x = x)—the denotation of any term is identical to itself in every
model. The proof goes as follows:
¬∀x(x = x)
∃x¬x = x
¬p = p
p=p
7
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 263
Note that we’ve closed the branch here because there was an atomic
formula, p = p, such that both p = p ∈ B and ¬p = p ∈ B. Now, in
principle, the rule works quite like the universal quantifier rule in that
you need to make sure you do this for every constant or parameter on
the branch, also ones that have been created later, when you thought
you were already done with this rule. But that’s clearly nuts: this
would make our proof trees quickly explode in size. This is why we
make the following convention: we only apply the rule for a = a
if (a) thereby we can close a branch (i.e. if also ¬a = a is on the
branch) or (b) we’re dealing with an open branch of an otherwise
complete tableau. The reason behind convention (a) is clear (I hope),
the reason behind (b) will become clear when we discuss associated
models.
10.3.3 Turning to the second rule, things get a bit more complicated. It
might be useful to talk about the idea first. What the rule relies on
is the fact that if two objects a and b are identical and one of them
satisfies φ, then also the other object needs to satisfy φ—the two
objects are, after all, identical. Here is a simple application of the
rule, used to show that ` ∀x∀y(P (x) ∧ x = y → P (y)):
P (p) ∧ p = q
¬P (q)
P (p)
p=q
P (q)
7
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 264
The crucial application of the rule is in the last step here. For this
step, it was simply noted that
P (p) = (P (x))[x := p]
P (q) = (P (x))[x := q]
Since p = q was on the branch at that point, this allowed us to get
from P (p) to P (q), and thus to close the branch. Now, you may think
that this is a bit confusing. After all (P (x))[x := p] and (P (x))[x := q]
is not what’s written on the branch, P (p) and P (q) are. How could
you have seen that the rule should have been applied like this? Well,
the answer is quite simple: what the rule really tells you is that if
you have a = b on a branch and some atomic formula with either a
in it, say, R(t1 , . . . , a, . . . , tn ), then you need to replace that a with b,
you’ll get R(t1 , . . . , b, . . . , tn ). This, of course, holds equally well the
other way around (replace b with a) and with identity claims as in
the following example, which shows that a = b, b = c ` a = c
a = b, b = c ` a = c
a=b
b=c
a 6= c
a=c
7
Note that you really only need to replace terms for each other in
atomic formulas, not in more complex formulas and, in particular,
not in negated atomic formulas.
∃xS(x, a)
S(p, a)
¬(a = a) ¬∃xS(x, b)
a=a ∀x¬S(x, b)
7
¬S(p, b)
7
∃x¬∃y(P (y) ∧ x = y)
¬∃y(P (y) ∧ p = y)
∀y¬(P (y) ∧ p = y)
¬(P (p) ∧ p = p)
¬(P (a) ∧ p = a)
¬(P (b) ∧ p = b)
¬P (p) p 6= p
¬P (a) p 6= a
¬P (b) p 6= b ¬P (b) p 6= b
p=p
7
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 266
10.3.6 The solution is that we move slightly away from the notion of a term
model and consider models where the elements are sets of terms.
A term will now denote a set of terms, the set of terms that are,
according to the branch, identical to the initial term. Here’s how this
goes. Let B be a branch of a complete open tableau. We first define
the relation ∼B on terms by saying that:
a ∼B b iff a = b ∈ B.
[a]∼B = {b : a ∼B b},
10.3.7 So, here’s the definition associated model for an open branch B in a
complete tableau with identity:
[a]∼B = {a, b}
[b]∼B = {a, b}
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 267
[p]∼B = {p}
Note that [a]∼B = [b]∼B and so aMB = bMB , which is precisely what
we want since this means that MB a = b and a = b ∈ B. The
only thing that remains to be determined is the interpretation of P .
But in this case, that’s easy since there is no formula of the form
P (t) ∈ B. So, we get P MB = ∅. So, all in all, we get:
[a]∼B = {c : a ∼B c}
[b]∼B = {c : b ∼B c}
Now, by extensionality, what we need to show is that every element
of [a]∼B is an element of [b]∼B and vice versa. We’re only going to
prove one of the directions, since the other is completely analogous.
So assume that c ∈ [a]∼B , i.e. a = c ∈ B. We need to derive that
c ∈ [b]∼B , i.e. c = b ∈ B. We already know that a = b ∈ B and we’ve
assumed that a = c ∈ B. But the tableau we’re looking at is complete,
so every rule that can be applied has been applied, in particular every
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 268
..
∀xϕ . s=t
σ ‡ [x
:= s]
(ϕ)[x := t]† t = t†
σ[x := t]
Then, we say:
DMB = {[t]∼B : t ∈ T }
aMB = [a]∼B , for a ∈ C ∪ P ar
RMB = {([t1 ]∼B , . . . , [tn ]∼B ) : R(t1 , . . . , tn ) ∈ B}
The “obvious” answer is that f MB ([t1 ]∼B , . . . , [tn ]∼B ) = [f (t1 , . . . , tn )]∼B .
Why is this obvious? First, note that this really defines a function on
the terms. In particular, for every input we assign one and only one
out. This crucially hinges on the fact that we’ve “enlarged” DMB to
include also the equivalence classes of all the terms not in B: we know
that the value for f ([t]∼B ) = [f (t)]∼B , namely [f (t)]∼B ∈ DMB , but
we’re now also guaranteed that we get a value for f MB ([f (t)]∼B ),
viz. [f (f (t))]∼B ∈ DMB , and so on. The definition guarantees exactly
that the formulas on the branch involving the term f (t1 , . . . , tn ) will
be true. How so, is best illustrated by means of an example.
10.4.3 Example. Let’s consider the following derivation for 0 ∀x∀y(f (x) =
f (y) → x = y)
f (p) = f (q)
p 6= q
DMB = {[t]∼B : t ∈ T }
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 270
¬∃x∀yR(x, y)
∀x¬∀yR(x, y)
¬∀yR(p1 , y)
∃y¬R(p1 , y)
¬R(p1 , p2 )
¬∀yR(p2 , y)
∃y¬R(p2 , y)
¬R(p2 , p3 )
..
.
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 271
10.5.2 But before we discuss these implications, let’s talk about the fact
that we just wrote down an infinite tableau. Well, of course we didn’t.
What we did was to realize that if we were to continue applying the
tableau rules trying to construct the tableau for ¬∃x∀yR(x, y), we
will never get to an end. So, we can’t write down the tableau for
that formula. But does that mean that this tableau doesn’t exist? To
appreciate that the mathematical answer is No!, we have to re-think
what tableaux actually are. So far, we’ve been talking about tableaux
as a concrete tree that we write down. But, mathematically speaking,
the actual ink-and-paper (or screen-and-pixel) tableau that you write
down is not what the tableau is. A tableau, for a mathematician, is a
special kind of (graph-theoretic) tree, which in turn is a mathematical
structure that consists of a set of nodes and a set of edges connecting
them. Nothing in this requires the tree to be written down or even
be finitely writable in the first-place—it’s just a pair of sets. But
what about the rules? Well, for a mathematician, the rules we use to
construct our tableaux are just an inductive definition of the set of
tableaux! And in first-order logic, that’s how we will need to think
of tableaux as well.
10.5.3 Note that the tableau above, our example, shows that 0 ∃x∀yR(x, y),
i.e. the formula ∃x∀yR(x, y) is not derivable. In fact, infinite tableaux
can only occur in cases where something isn’t derivable. Why? Well,
because if something is derivable, then the tableau needs to close
(by definition). But if a tableau closes, it does so after finitely many
steps: there will be two nodes, one containing an atomic formula the
other its negation, which are at some point in the tree—everything
that comes after doesn’t matter (in first-order logic, we can “close
early”). But how do we know that the tableau we sketched above
doesn’t close at some point? Well, that we need to prove. But the
argument is actually not that hard:
Note that all the formulas after the initial list are of the form:
¬∀yR(pi , y), ∃y¬R(pi , y), and ¬R(pi , pi+1 ). But these statements
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 272
10.5.4 Example. The tableau for the inference from ∀x∃yR(x, y) to ∃y∀xR(x, y):
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 273
∀x∃yR(x, y) 0 ∃y∀xR(x, y)
∀x∃yR(x, y)
¬∃y∀xR(x, y)
∀y¬∀xR(x, y)
∃yR(p1 , y)
¬∀xR(x, p1 )
∃x¬R(x, p1 )
R(p1 , p2 )
¬R(p3 , p1 )
∃yR(p2 , y)
¬∀xR(x, p3 )
∃yR(p3 , y)
¬∀xR(x, p2 )
..
.
How do we see that the tableau is open? Well, we note that all
the atomic formulas on the (one and only) branch are of the form
R(pi , p2i ) and ¬R(p2i+1 , pi ). Since there is no natural number i such
that i = 2i + 1, we can conclude that we’ll never get to R(s, t) and
¬R(s, t)—the tableau never closes.
10.5.5 Do we also have associated models for infinite open branches? Why,
yes we do! Nothing in the definition of an associated model prevents
us from applying the definition to an infinite branch. Here are the
models we’d get for our two examples:
0 ∃x∀yR(x, y)
– DMB = {pi : i ∈ N}
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 274
– pM
i
B
= pi
– R M B =∅
∀x∃yR(x, y) to ∃y∀xR(x, y)
– DMB = {pi : i ∈ N}
– pM
i
B
= pi
– R M B = {(pi , p2i ) : i ∈ N}
10.5.6 This brings me to the last point of this chapter, decidability. Sound-
ness and completeness should not be confused with decidability. What
we will be able to show, the soundness and completeness theorem, is
that Γ φ iff the tableau for Γ ∪ {¬φ} is closed. But that doesn’t
mean that there’s an effective algorithm, which in a finite amount
of time determines whether Γ φ. In fact, we’ve just seen that our
algorithm can “loop” and never spit out an answer. In such cases, we
can still reason to the right answer, but this isn’t algorithmic any-
more. A computer can’t figure out that reasoning. Now, this shows
that the tableau algorithm doesn’t decide first-order logic. But the
fact that one algorithm doesn’t work, of course, doesn’t mean that
no algorithm works. What we can see, however, is that a certain
kind of algorithm will not work: one that tries to construct counter-
models for invalid inferences. The idea to construct countermodels is
something that tableaux and truth-tables have in common: in truth-
tables, we check whether there’s a line in the table that gives us a
countermodel and in tableaux we look for a branch to do the job.
And in propositional logic, this method works: since we only need to
consider the interpretations (read: truth-values) of the finitely many
sentence letters in the formula, we can do this checking in a finite
amount of time. The problem in first-order logic is that countermod-
els sometimes need to be infinite. To see this, note that some sets of
formulas have only infinite models: an example can be found in Ex-
ercise 9.7.11. If we want to show that something doesn’t follow from
such a set, we need an infinite countermodel. And we can’t possibly
search through all of those.
Now that’s a whole class of algorithms that won’t work. But in order
to show that really absolutely no algorithm can possibly work ever,
we need to dig deeper. The reasoning that establishes that is closer re-
lated to the paradoxes, like Russel’s paradox, but we won’t be able to
go into that in this course (that’s more for “Logische Complexiteit”).
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 275
(i) It’s possible that the tableau for an inference whose conclusion
is a valid formula of FOL is not closed.
(j) If you find that all the branches of a tableau for an inference
contain both a formula and its negation, then the premises entail
the conclusion.
10.8 Exercises
10.8.1 By constructing appropriate tableaux, show the following:
10.8.2 Construct tableaux to check the following. If the tableau does not
close, construct a counter-model from the open branch and check
that it works. If the tableau is infinite, see if you can find a simple
finite counter-model by trial and error.
Begin the tableaux construction, prove that the tableau is open, and
determine the associated model.
10.8.4 Use the tableau method to find models in which the following formu-
las are false:
(a) ` ∀x∀y(x = y → y = x)
CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC 277
10.8.6 [h, 6 x] It’s not possible to write an algorithm that determines whether
a formula is invalid, that is false in some model, after a finite amount
of time. Why?
Hardcore version (Not homework): It’s not even possible to find such
an algorithm for contingency, that is to determine whether a formula
is true in some models and false in others. Why?
10.7.1 (a, d, e, g, j)
Self Study Solutions
Chapter 11
This chapter is even shorter than the soundness and completeness chapter
in propositional logic. But it’s a bit like with strawberries: the smaller the
sweeter. This chapter marks the end of our investigation into logical the-
ory and it contains one of the most important results of first-order logic—
a milestone achievement of the mathematical study of valid reasoning: the
completeness proof.
11.1 Overview
11.1.1 In this chapter, we’re going to prove soundness and completeness for
first-order tableaux. A daunting task, for sure, but we can do it! The
soundness and completeness theorem will round off our treatment of
first-order logic. In fact, it will mark the end of our concrete discussion
of logical systems. In the following chapter, we’ll conclude the course
with discussion and outlook. There we will look at theorems we didn’t
prove, systems we didn’t study, and so on. So, prepare yourself for
one last-ditch effort.
11.1.2 The proofs of the soundness and completeness theorems for first-order
logic run very much along the same lines as the proofs for proposi-
tional logic. We’ll essentially spell out an up preservation lemma and
a down preservation lemma, which together guarantee soundness and
completeness.
278
CHAPTER 11. SOUNDNESS AND COMPLETENESS 279
branches just like in the finitary case. In fact, the existence of associ-
ated models is what ultimately gives us soundness and completeness.
11.1.4 But before we prove our soundness and completeness lemmas, we’ll
have to supply some auxilliary lemmas. These two lemmas, the de-
notation lemma and the locality lemma, are semantic in nature and
will figure into our proof that the associated model works in various
places. So, let’s get cracking.
The way in which the two ways are equivalent is that they either
both lead to a true statement or they both lead to a false statement:
11.2.2 Here is the precise statement of the denotation lemma and its proof:
R(t1 , . . . , t, . . . , tn ),
(Jt1 KM M M M
α[x7→JtKM ] , . . . , JtKα , . . . , Jtn Kα[x7→JtKM ] ) ∈ R .
α α
Jtn KM M
α[x7→JtKM ] = Jtn Kα .
α
But that just means that the condition for M, α[x 7→ JtKM α
R(t1 , . . . , t, . . . , tn ) reduces to (Jt1 KM
α , . . . , JtKM , . . . , Jt KM ) ∈
α n α
RM , which, as we’ve observed above, is precisely the condi-
tion for M, α R(t1 , . . . , t, . . . , tn ). The base case for t1 = t2 is
completely analogous (in fact, simpler) and is left as an exercise.
(ii) We only consider the induction step ∀xφ, the rest is left as
an exercise. So, assume the induction hypothesis that if φ is a
formula that contains x as the only free variable, then M, α
(φ)[x := t] iff M, α[x 7→ JtKM α ] φ. Now let ∀yφ be a formula
with x as its only free variable.1 Note that since x is free in
∀yφ, the variable must also be free in φ. We want to show that
M, α (∀yφ)[x := t] iff M, α[x 7→ JtKM α ] ∀yφ. So, consider
the claim that M, α (∀yφ)[x := t]. By the recursive definition
of substitution, we know that (∀yφ)[x := t] = ∀y(φ[x := t]).
Hence, we have that M, α (∀yφ)[x := t] iff M, α ∀y(φ)[x :=
t], which is the case iff for all d ∈ DM , we have that M, α[y 7→
d] (φ)[x := t]. But by the induction hypothesis, we have that
M, α[y 7→ d] (φ)[x := t] iff M, α[y 7→ d, x 7→ JtKM α ] φ. But
M
that just means that we have for all d ∈ D that M, α[y 7→
d, x 7→ JtKM
α ] φ, which by definition just means that M, α[x 7→
JtKMα ] ∀yφ, as desired.
1
Why don’t we write ∀xφ? Because in that formula x is not free!
CHAPTER 11. SOUNDNESS AND COMPLETENESS 281
11.2.3 One of the main uses of the denotation lemma is that it allows us to
derive the quantifier law ∀xφ (φ)[x := t] in a natural way. To see
this, suppose that M, α ∀xφ. This means, by definition, that for all
d ∈ DD , we have that M, α[x 7→ d] φ. So let d = JtKM α . We get that
M
M, α[x 7→ JtKα ] φ, which by the denotation lemma is equivalent
to M, α (φ)[x := t]. This law is one of the most natural quantifier
laws: it states that if everything is such that φ, then t is such that
φ. But, in order to prove it in full generality, we need the denotation
lemma. In essence, this will also be the role of the denotation lemma
in our soundness and completeness proof: the lemma allows us to
infer the truth of instances of a universal generalization from the
generalization itself.
11.2.4 The second lemma that we’re going to prove is (yet) another version
of the locality lemma (we’ve proved locality lemmas for terms and
formulas with respect to free variables in §9). The locality lemma
that we need in this chapter, is slightly different:
Lemma. Let M and N be models with DM = DN . Further, let ϕ
be a sentence such that for all constants c that occur in ϕ, cM = cN ,
for all function symbols f that occur in φ, f M = f N , and for all
predicates R that occur in ϕ, RM = RN . Then for all assignments
α, we have that M, α ϕ iff N , α ϕ.
This lemma states, in words, that if two models have the same domain
and interpret the non-logical symbols in a sentence in exactly the
same way, then they interpret the whole sentence in the same way.
Note that since the domains of the two models in the lemma are the
same, an assignment in the one model is also an assignment in the
other (remember, assignments only depend on domains).
We shall now prove this lemma:
(b) Next, consider a sentence of the form ∀xφ. Now suppose the in-
duction hypothesis that if M interprets the non-logical symbols
in a sentence φ exactly like N , then for all assignments α, we
have that M, α φ iff N , α φ. We want to derive from this
assumption that M, α ∀xφ iff N , α ∀xφ. Now, we note that
M, α ∀xφ iff for all d ∈ DM (= DN ), M, α[x 7→ d] φ. Now,
note that if M interprets the non-logical symbols in ∀xφ the
same as N , then M also interprets the non-logical symbols in
φ as N . So, we can infer by the induction hypothesis that for
all d ∈ DN , N , α[x 7→ d] φ. But that is just the condition for
N , α ∀xφ, as desired.
Now the role of the locality lemma is less intuitive than the role of
the denotation lemma. But as we’ll see in a second, it plays a central
role in our proof of the soundness lemma.
¬∀xϕ ¬∃xϕ
∃x¬ϕ ∀x¬ϕ
We’ve already observed that ¬∀xφ ∃x¬φ and that ¬∃xφ ∀x¬φ
(since it follows quickly from 9.4.3 iv and v). But that means that in
either case, we can just let M = N .
Now for the ∃xφ rule. Suppose that the last rule that’s been applied
was:
∃xϕ
†: p a fresh parameter
ϕ[x := p]†
∀xϕ
†: a any ground term on the branch
ϕ[x := a]†
s=t
σ ‡ [x := s]
σ[x := t]
have that M is faithful to the initial list. Now, every time that we
apply a rule to construct the complete tableau, we obtain a model
(possibly different from M) which is faithful to at least one branch of
that tree. This means that there exists a model N which is faithful to
some branch in the complete tableau for Γ ∪ {¬φ}. Now reasoning by
contradiction quickly shows that this branch cannot be closed. For
suppose that it were. Then there would be an atomic formula and
its negation on the branch, which would then both need to be true
in N , which is impossible. So, the branch is open, hence the tableau,
hence Γ 0 φ, as desired.
1. if φ ∈ B, then MB , α φ
2. if ¬φ ∈ B, then MB , α 2 φ
I will do the base case for R(t1 , . . . , tn ) and the cases for ∀xφ and
¬∀xφ. The cases for t1 = t2 and for ∃xφ and ¬∃xφ are left as useful
(!) exercises. The propositional cases work just like in propositional
logic.
(i) For the base case of 1., suppose that R(t1 , . . . , tn ) ∈ B. We know
that MB , α R(t1 , . . . , tn ) iff (Jt1 KM MB
α , . . . , Jt1 Kα ) ∈ R
B MB .
M
By the definition of MB , we know that R B = {([t1 ]∼B , . . . , [tn ]∼B ) :
R(t1 , . . . , tn ) ∈ B}. And you proved as an exercise in 10.4.4 that
JtKM
α = [t]∼B . Putting these two things together, the claim fol-
lows immediately.
For the base case of 2., suppose that ¬R(t1 , . . . , tn ) ∈ B. Since B
is open, we can conclude that R(t1 , . . . , tn ) ∈ / B. Since RMB =
{([t1 ]∼B , . . . , [tn ]∼B ) : R(t1 , . . . , tn ) ∈ B}, it follows that
/ RMB .
([t1 ]∼B , . . . , [tn ]∼B ) ∈
CHAPTER 11. SOUNDNESS AND COMPLETENESS 286
Since JtKM MB MB /
α = [t]∼B , we conclude that (Jt1 Kα , . . . , Jt1 Kα ) ∈
R M B , which gives us M, α 2 R(t1 , . . . , tn ) as desired.
(ii) Now, for the induction step, assume the induction hypothesis
that for all assignments α:
1. if φ ∈ B, then MB , α φ
2. if ¬φ ∈ B, then MB , α 2 φ
Now suppose that ∀xφ ∈ B. In order to show that MB , α ∀xφ
as desired, we need to show that for each d ∈ DMB , we have that
MB , α[x 7→ d] φ. Remember that DMB = {[t]∼B : t ∈ T }.
So, we have to show that for each term t, we have MB , α[x 7→
[t]∼B ] φ. Now, since ∀xφ ∈ B and B is complete, every rule
that can be applied has been applied. Since t = t ∈ B for all
t ∈ T , we can conclude that the ∀φ rule has been applied for
t, i.e. for each t ∈ T , we have (φ)[x := t] ∈ B. Hence, by the
induction hypothesis, M, α (φ)[x := t]. Note that since we’re
in tableaux, we can assume that ∀xφ is a sentence and so φ
contains at most one free variable, x. So, by the denotation
lemma, we have M, α[x 7→ JtKM α ] φ. But, we have already
B
M
observed that JtKα = [t]∼B , so for each t ∈ T , we get that
M, α[x 7→ [t]∼B ] φ, as desired.
The remaining case is ¬∀xφ ∈ B. Since the tableau is complete,
we can conclude that the ¬∀xφ rule has been applied, giving us
that ∃x¬φ ∈ B. Again, since the tableau is complete, we know
that the ∃ rule has been applied. This means that for some
(at some point fresh) parameter p, we have (¬φ)[x := p] ∈ B.
We know that (¬φ)[x := p] = ¬(φ)[x := t]. By the induction
hypothesis, we know that M, α 2 (φ)[x := t]. By the denotation
lemma, we get M, α[x 7→ JtKM M
α ] 2 φ. Since JtKα = [t]∼B , this
B
11.4.2 From the completeness lemma, the actual completeness proof follows
quickly:
11.7 Exercises
The exercises for this chapter are different. We’re getting close to the
endterm exam and it’s high-time that we think a bit more concretely
about exam preparation. The exercises for this and next lecture will
just be that: exam preparation.
In a moment, I will describe the “recipe” for the exam to you so that,
in principle, you can make as many mock exams from the questions
as you’d like. The main purpose of all of this is that you get a more
specific idea of the kind of questions I’ll ask in the exam, their difficulty
level, and so on. Fully worked out answers will be provided at the end
of the week. They will come along with a marking scheme to allow you
to gauge my expectations.
Here’s the exam recipe. The exam will consist of two parts, Part A
and Part B. The questions in Part A will be questions where I ask
you to do certain things with concrete terms, formulas, models, etc.
The questions in Part B instead are questions where I ask you to
prove things. Throughout the course, you’ve been doing exercises that
prepare you for these two kinds of questions. Some more details:
The two parts of the exam will be weighed in such a way that if you
answer all the questions in Part A correct, you’ll pass the exam with
a 6.5. The questions in Part B will then differentiate your grade. The
idea is that to get a 7.5, you should get the difficulty 1 proof correct,
to get an 8.5, you should also get the difficulty 2 proof correct, and to
get an 9.5, you should get all three proofs essentially correct. A 10 you
can get if all answers are flawless, including the difficulty 3 proof. I will
not go more into the details of points etc. since this encourages the
CHAPTER 11. SOUNDNESS AND COMPLETENESS 289
11.7.1.3 Take the signature SP A = ({0}, {S, +, ·}, ∅) and the following model
M for it:
DM = {n ∈ N : n is odd}
0M = 1
S M (n) = n + 2
(
n+m if n + mis odd
+ (n, m) =
M
n+m+1 otherwise
·M (n, m) = n · m
11.7.1.4 Consider the signature S = (∅, {f 1 }, {R2 }) and its model M given
by:
CHAPTER 11. SOUNDNESS AND COMPLETENESS 290
DM = {1, 2}
f M (1) = 2 and f M (2) = 1
RM = {(1, 2)}
The ball is round and everything round comes from Mars. So,
the ball comes from Mars.
Conclusion
292
Part V
Solutions to Selected
Exercises
293
Appendix A
Chapter 1. Introduction
1.6.1 (a) If in every situation, the premises are false, there can’t be a situa-
tion in which the premises are true and the conclusion is false, i.e.
the inference can’t be invalid. Hence the inference is valid.
(b) If in some situation the premises are true and the conclusion not,
the conclusion is false. By definition, this means that the inference
is invalid.
(c) If in no situation, the premises are true and the conclusion not,
then the inference can’t be invalid. So it must be valid.
(d) If in no situation the conclusion is false, there can’t be a situation
in which the premises are true and the conclusion is false, i.e. the
inference can’t be invalid. Hence the inference is valid.
(e) If in every situation the conclusion is false, then it’s still possible
that there is no situation in which the premises are true. But if
there’s no situation where the premises are true, then the inference
would be valid.e
(f) If in every situation where the conclusion is false, at least one
of the premises is false, then there can’t be a situation in which
the premises are true and the conclusion is false. For then, all the
premises would be true, but also at least one of them would be
false, which can’t be.
1.6.2 (a) Even if there is a situation in which both premises and conclusion
are false, there could still be no situation in which the premises
are true and the conclusion is false.
(b) There could be no situation in which the conclusion is false. Then,
trivially, in every situation where the conclusion is false, the premises
294
APPENDIX A. CHAPTER 1. INTRODUCTION 295
are true. But, at the same time, the inference would be valid, since
there couldn’t be a situation in which the premises are true and
the conclusion is false, i.e. the inference can’t be invalid.
(c) Suppose the conclusion is true in no situation. This means the
conclusion is false in every situation. But if then, there’s a situation
in which the premises are true, in that situation the conclusion
must be false. Hence, there’s a situation in which the premises are
true and the conclusion is false, so the inference is invalid.
(d) This is just the definition of what it means for an inference to be
invalid.
(e) It could still be that there is no situation in which the premises are
true. Then, trivially, in every situation in which the premises are
true, the conclusion is false. But, at the same time, there couldn’t
be a situation in which the premises are true and the conclusion
is false, the argument would be valid.
(f) There could still be a situation in which the premises are true and
the conclusion is false, all we’re given is that there is no situation
in which the premises and the conclusion are both true. This just
means that in every situation in which the premises are true, the
conclusion is false (see previous option).
1.7 Exercises
1.7.1 (a) The inference is not valid. To see this, note that we can have a
situation in which the premises are true and the conclusion is false.
Think of a situation in which there are two whales, Moby and Dick,
and one more fish, the clownfish Nemo. Moby is a blue whale and
Dick is a grey whale, Nemo is orange and white. For argument’s
sake, suppose that all whales are fish. Surely then, all blue fish
are whales, since there’s only one blue fish, the whale Moby. But
there’s a whale, Dick, which is a fish but grey. So, Dick is not a
blue fish. All in all, in the situation, the premises are true and the
conclusion is false, the inference is invalid.
(b) The inference is valid. To see this, suppose that we’re in a situa-
tion in which you didn’t not miss your train. Can it be, in such a
situation, that you still didn’t miss your train? Well, that would
mean that some statement, viz. you didn’t miss your train, is both
true and not true. But this is impossible. So we can’t have a situ-
ation in which you didn’t not miss your train but still didn’t miss
the train. This means the inference can’t be invalid, so it has to
be valid.
APPENDIX A. CHAPTER 1. INTRODUCTION 296
(c) The inference is valid. The case is very similar to the case with
the letters in the drawer. Suppose that it’s true in some situation
that if you’d checked your mail, then you’d have seen my message,
and you didn’t see it. Can it be that you checked your mail in that
situation? Well, then you’d have seen my mail and you didn’t. So
it can’t be that, in the situation, you checked your mail. So, in
every situation where the premises are true, the conclusion needs
to be true as well, i.e. the inference is valid.
(d) The inference is invalid. Think of a possible situation in which
there are no roses at all, e.g. because a rose disease wiped them
out. In such a situation, trivially, every rose would be red (can you
show me a non-red rose in the situation?). But there would be no
rose and certainly not a red one. So there’s a possible situation
in which the premises are true and the conclusion is false, the
inference is invalid.
(e) The inference is invalid. For concreteness sake, let’s suppose that
“that” is that you jumped over the Eiffel tower. Now think of a
possible situation in which you have superhuman strength and, at
the same time, pigs have wings and can fly (what a beautiful world
it would be). Well, in such a situation, we know that no matter
whether you jumped over the Eiffel tower, pigs can fly. So certainly,
if you did it, pigs can fly (how can the statement be false?). Now
suppose that in our magic land, you indeed jumped over the Eiffel
tower. Then the conclusion is false—you did actually do it. So, we
have a situation in which if you did it, then pigs can fly and you
did it—the premises are true and the conclusion is false.
If you were to add the premise that pigs don’t fly, the argument
would become valid. Check that for yourself. This shows that usual
figure of speech involved here is elliptic. It’s assumed, in the back-
ground, that pigs can’t fly.
1.7.3 Take some invalid inference. Here are two ways of making it valid:
(1) Add the conclusion of the inference as a premise. It’s easy to see
that the new inference can’t be invalid, for there would need to
be a situation in which the new premises, which now include the
conclusion, are all true but the conclusion is false. So the conclu-
sion would need to be both true and false in some situation which
can’t be. So the inference is valid.
(2) Add any contradiction, such as “the rose is red and not red” to the
premises. We’ve already seen that any inference with inconsistent
premises is valid (1.3.3), so the inference will be valid, too.
Appendix B
2.7 Exercises
2.7.1 This depends on the answers you’ve given. The following correspond
to my answers:
(a) We did not need to use any of the proof principles we discussed,
we simply produced a counterexample.
(b) We used indirect proof. The argument form was as follows:
Suppose that there is a possible situation in which the premises
are true and the conclusion is false.
We get a contradiction.
Therefore there is no situation in which the premises are true
and the conclusion false.
So, in every situation where the premises are true, so must be
the conclusion, meaning the inference is valid.
(c) Same as (b)
(d) Same as (a)
(e) Same as (a)
(f) Same as (a)
2.7.2 Here are proofs for the facts. Note that this are not the only possible
proofs, but they can function as examples. It’s a bit tricky to illustrate
the procedure that leads to these proofs, so I will present you with the
finished end-product. For advice on how to find the proofs, see the
slides.
298
APPENDIX B. CHAPTER 2. A MATH PRIMER FOR ASPIRING LOGICIANS299
(b) If the product of two numbers is odd, then at least one of the two
numbers is odd.
Precise statement. Let n and m be integers. If n · m is odd, then
either n is odd or m is odd.
How could you have seen that contrapositive proof is a good strat-
egy here? Well, whenever you have a conditional with a disjunction
in the then-part, it’s a good idea to try contrapositive proof.
(c) Every number is either even or odd.
Precise statement. Let n be a natural number. Then n is even or
n is odd (and, in fact, not both).
How could you see that you should use indirect proof to show this?
Well, whenever you try to prove that one of two cases must ob-
tain and you can’t prove them from something you already know,
indirect proof is a good idea.
(d) If you add one to an even number, you get an odd number.
Precise statement. Let n be an integer. If n is even, then n + 1 is
odd.
Why can we assume that 1 isn’t even? Well, that’s something that
can itself be proven using the methods of the next chapter. But
for the present purpose it’s fine to assume it. Remember that our
aim is to convince the reader that a purely axiomatic proof exists
and not to provide one ourselves.
(e) The product of two prime numbers is not a prime number.
Precise statement: Let n and m be natural numbers. Then, if n
and m are prime, then n · m is not prime.
(f) No prime number bigger than two is the product of an even and
an odd number.
APPENDIX B. CHAPTER 2. A MATH PRIMER FOR ASPIRING LOGICIANS301
2.7.3 (a) A necessary but not sufficient condition for n to be even is that n
is divisible by at least two numbers k, l (not necessarily different).
If n is even, then there are two such numbers, in fact one of them
is two. But there are numbers which are divisible by two distinct
numbers and not even. E.g. 15 = 3 · 5. Hence the condition is not
sufficient.
(b) A sufficient condition but not necessary for n to be even is that
it’s divisible by four. If n is divisible by four, then it’s divisible
by two and thus even. But there are even numbers which are not
divisible by four, for example, 14.
(c) A necessary and sufficient condition for n to be even is that n is
divisible by two—that’s the definition of being even. A perhaps
more interesting example is the condition that n be divisible by
an even number. If n is divisible by an even number, then it’s even
since an even number is divisible by two and a divisor of a divisor
is a divisor. And if n is even, then by definition n’s divisible by two,
which is an even number. Hence the condition is both necessary
and sufficient for n to be even.
2.7.5
3.9.3 (a) is correct by the axiom of extensionality. (b) is not correct, since
we might have, for example, one element which is in both sets (and
hence in the one iff in the other), but another which is only in one
and not the other (and hence the sets are different). (c) is more or less
obviously not enough. (d) can be seen to be correct by the reasoning
from 3.9.1.(d). (e) is not correct since it’s not enough that we can
“pair” the elements, they need to be the same. And (f) is too weak, it
only implies X ⊆ Y .
3.9.4 Remember that two sets are distinct as soon as they have different
members.
3.9.5–3.9.8 The correct answers follow immediately from the definitions of ∩ and
∪. Note that in logic and mathematics, we read “or” inclusively and
therefore (e) is also correct in 3.9.5. Note further that to say that it’s
303
APPENDIX C. CHAPTER 3. ELEMENTARY SET THEORY 304
not the case that one thing or the other is the case is to say that both
are not the case. Similarly, to say that it’s not the case that two things
are the case is to say that at least one of them is not the case. This,
hopefully, helps with 3.9.6 and 3.9.8.
3.9.9 The correct answers follow directly from the conditions on what a
function needs to do.
3.10 Exercises
3.10.1 (a) {1, 3}
(b) {1, 2, 3, 5}
(c) X \ Y = {2}, Y \ X = {5}
(d) ℘(X) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}
℘(Y ) = {∅, {1}, {3}, {5}, {1, 3}, {1, 5}, {3, 5}, {1, 3, 5}}
(e) X×Y = {(1, 1), (1, 3), (1, 5), (2, 1), (2, 3), (2, 5), (3, 1), (3, 3), (3, 5)}
Y ×X = {(1, 1), (1, 2), (1, 3), (3, 1), (3, 2), (3, 3), (5, 1), (5, 2), (5, 3)}
⇐
to prove :
If X ∪ Y = Y , then X ⊆ Y . We’ll prove the contrapositive. We
assume that X 6⊆ Y . Hence there must be some element x ∈ X
such that x 6∈ Y . As X ∪ Y contains all elements of X, it must
also contain x. As there’s one element that is in X ∪ Y and not
in Y , X ∪ Y 6= Y , which is what we needed to prove.
3.10.3
f f f
(1, 1) 7→ 1 (2, 1) 7→ 1 (3, 1) 7→ 1
f f f
1. (1, 2) 7→ 1 (2, 2) 7→ 2 (3, 2) 7→ 2
f f f
(1, 3) 7→ 1 (2, 3) 7→ 2 (3, 3) 7→ 3
f 1 2 3
1 1 1 1
2.
2 1 2 2
3 1 2 3
APPENDIX C. CHAPTER 3. ELEMENTARY SET THEORY 306
(
x if x < y,
3. f ((x, y)) =
y otherwise
3.10.8 We will prove by induction that the amount of 3’s in a gargle is always
even.
(i) Base case 1: ♠ has an even number of 3’s, as 0 is even. Base case
2: ♣ has an even number of 3’s, as 0 is even.
(ii) (a) Assume x has an even number of 3’s.Then 3x3 must also
have an even number of 3’s, as the number of 3’s of 3x3
is the number of 3’s of x+2. We know that an even number
+2 results in another even number.
(b) Assume x, y have an even number of 3’s. Then the number
of 3’s of x♥y will be the number of 3’s of x + the number of
3’s of y, which will be an even number, as an even number
added to an even number results in an even number, which
is what we needed to show.
3.10.9 We will prove that ♠3♥♠ 6∈ Gargle. We have just proven that every
gargle has an even amount of 3, but this one has exactly 1, and 1 =
0 · 2 + 1. Therefore 1 is odd, and not even. So we must conclude it’s
not a Gargle.
Appendix D
Chapter 4. Syntax of
Propositional Logic
308
APPENDIX D. CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC309
tree. Since each step in path goes from one node to another, we have
the starting node, the root, plus at least four other nodes, meaning
five nodes. Note that there can be more than five nodes in the tree,
as you can check by doing the parsing tree for φ, which we used to
explain why (b) is incorrect.
4.8 Exercises
4.8.1 Translation key:
(a) (p ∧ q)
(b) (r → p)
(c) Inclusive reading: (s ∨ t); Exclusive reading: ((s ∨ t) ∧ ¬(s ∧ t))
(d) (r ↔ (u ∧ v)).
(a) It’s not the case that I’m not both happy and clapping my hands.
(b) If I’m not happy, then I don’t clap my hands.
(c) I’m happy if and only if you’re not happy and I clap my hands.
(d) If I clap my hands and you clap your hands, then we both clap
our hands.
(e) If I clap my hands and you clap your hands, then either I’m happy
or you’re happy.
(f) Either I’m happy and clap my hands or you’re happy and clap
your hands.
4.8.3 The set of all formulas of L that only contain (symbols from) p, q, ¬, ∧, (,
and ) is the smallest set X such that:
p, q ∈ X,
if φ ∈ X, then ¬φ ∈ X,
if φ, ψ ∈ X, then (φ ∧ ψ) ∈ X.
APPENDIX D. CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC310
(q ↔ (p ∧ (q ∨ (r ∧ ¬s)))
qX (p ∧ (q ∨ (r ∧ ¬s))
pX (q ∨ (r ∧ ¬s)
qX (r ∧ ¬s/
((p ∧ q) ∨ (p ∧ (q → ¬q)))
(p ∧ q) (p ∧ (q → ¬q))
pX qX pX (q → ¬q)
qX ¬q
qX
Answer : Formula!
(p → (p → ((p ∧ p) ↔ p ∨ p)))
pX (p → ((p ∧ p) ↔ p ∨ p))
pX ((p ∧ p) ↔ p ∨ p)
(p ∧ p) p ∨ p/
pX pX
¬¬(¬¬p ∧ (q ∨ q))
¬(¬¬p ∧ (q ∨ q))
(¬¬p ∧ (q ∨ q))
¬¬p (q ∨ q)
¬p qX qX
pX
Answer : Formula!
4.8.5
4.8.7 We willen laten zien dat boor alle formules φ ∈ L, het aantal subfor-
mules maximaal tweemaal het aantal connectieven plus 1, i.e. |sub(φ)| ≤
2 · #conn (φ) + 1.
We bewijzen dit met inductie op formules.
Substitutie geeft:
Substitutie geeft:
4.8.8 We give an informal outline of the argument. This can be made precise
using function #( from 1.8.5 and an analogously defined function #) .
Claim. The number of ( and ) in a formula φ is always the same.
(i) For the base case, note that the number of both (’s and )’ in any
sentence letter p is both zero.
(ii) (a) Assume the induction hypothesis, that numbers of ( and )
in φ are the same. Consider ¬φ. Note that the number of (’s
¬φ is the same as in φ and the number of )’s in ¬φ is the
same as in φ (no new parentheses have been added). Hence,
the numbers of ( and ) in ¬φ are also the same.
(b) Assume the induction hypotheses, that numbers of ( and ) in
φ are the same and the numbers of ( and ) in ψ are the same.
Denote the number of (’s in φ by n, the number of )’s in φ by
m, the number of (’s in ψ by k, and the number of )’s in ψ by
l. We have n = m and k = l. Consider (φ ◦ ψ). The number
of (’s in (φ ◦ ψ) is n + k + 1. The number of )’s in (φ ◦ ψ) is
m + l + 1. Since n = m and k = l, n + k + 1 = m + l + 1, as
desired.
We conclude our claim by induction on formulas.
4.8.10
(a) p ∧ q
APPENDIX D. CHAPTER 4. SYNTAX OF PROPOSITIONAL LOGIC314
(b) ¬¬q
(c) p ∧ (r ∨ q)
(d) p → (r ∨ (p ∧ (q ↔ r)))
(e) p ∨ ¬(p ∨ q)
(f) p ∧ q → r
(g) p ∨ q → ¬q ↔ r
(h) p ∧ q ∧ r
(i) p ∧ q ∧ r
(j) p ∨ q ∨ r
(k) p ∧ (q ∨ r)
(l) p ∧ (q → r)
Appendix E
5.5.3 (a) entails that φ → ψ by the deduction theorem. (b) entails that
φ → ψ by the observation that if JψKv = 1 for all valuations, then also
Jφ → ψKv = max(1 − JφKv , JψKv ) = 1 for all valuations v . (c) follows
from the fact that ¬ψ → ¬φ φ → ψ by the law of contraposition.
And (d) follows from the observation that that if J¬φKv = 1 for all
valuations, then JφKv = 0 and so Jφ → ψKv = max(1 − JφKv , JψKv ) = 1
for all valuations v.
5.6 Exercises
5.6.2 (xv) We want to show that for all φ, ψ, and θ, we have
φ ∨ (ψ ∧ θ) (φ ∨ ψ) ∧ (φ ∨ θ)
We’ll prove this directly. We know that φ ψ iff for all valua-
tions v, JφKv = JψKv (see proposition 5.2.5).
315
APPENDIX E. CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC316
(xiii) Claim. (φ ∨ ψ) ∨ θ φ ∨ (ψ ∨ θ)
(xv) Claim. φ ∨ (ψ ∧ θ) (φ ∨ ψ) ∧ (φ ∨ θ)
Proof. Again, there are several ways of doing this. We show this
directly, i.e. we show that (1) φ ∨ (ψ ∧ θ) (φ ∨ ψ) ∧ (φ ∨ θ) and
(2) (φ ∨ ψ) ∧ (φ ∨ θ) φ ∨ (ψ ∧ θ) from definitions. We proceed
in turn:
1. We want to show that φ ∨ (ψ ∧ θ) (φ ∨ ψ) ∧ (φ ∨ θ), i.e. if
φ ∨ (ψ ∧ θ) is true under a valuation v, then (φ ∨ ψ) ∧ (φ ∨ θ)
is also true under v. So, suppose that Jφ ∨ (ψ ∧ θ)Kv = 1,
for an arbitrary valuation v. We know that Jφ ∨ (ψ ∧ θ)Kv =
max(JφKv , J(ψ ∧θ)Kv ) = max(JφKv , min(JψKv , JθKv ). Since Jφ∨
(ψ ∧θ)Kv = 1, we can distinguish two cases: (a) JφKv = 1 or (b)
min(JψKv , JθKv ) = 1. In case (a), we can infer that Jφ ∨ ψ)Kv =
max(JφKv , JψKv ) = 1 and Jφ ∨ θ)Kv = max(JφKv , JθKv ) = 1.
Hence J(φ ∨ ψ) ∧ (φ ∨ θ)Kv = min(Jφ ∨ ψ)Kv , Jφ ∨ θ)Kv ) = 1,
as desired. In case (b), we can infer that both JψKv = 1 or
JθKv ) = 1. Hence both Jφ ∨ ψ)Kv = max(JφKv , JψKv ) = 1 and
Jφ ∨ θKv = max(JφKv , JθKv ) = 1; so we get J(φ ∨ ψ) ∧ (φ ∨
θ)Kv = min(Jφ ∨ ψ)Kv , Jφ ∨ θ)Kv ) = 1, again as desired. So, in
either case, J(φ ∨ ψ) ∧ (φ ∨ θ)Kv = 1 proving our claim that
φ ∨ (ψ ∧ θ) (φ ∨ ψ) ∧ (φ ∨ θ).
APPENDIX E. CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC318
5.6.7 (a) p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r)
Parsing Tree:
p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r)
p ∨ (q ∧ r) (p ∨ q) ∧ (p ∨ r)
q r p q p r
Truth Table:
p q r q∧r p ∨ (q ∧ r) p∨q p∨r (p ∨ q) ∧ (p ∨ r) p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r)
1 1 1 1 1 1 1 1 1
1 1 0 0 1 1 1 1 1
1 0 1 0 1 1 1 1 1
1 0 0 0 1 1 1 1 1
0 1 1 1 1 1 1 1 1
0 1 0 0 0 1 0 0 1
0 0 1 0 0 0 1 0 1
0 0 0 0 0 0 0 0 1
APPENDIX E. CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC319
(¬p ∨ q) q ∧ (p ↔ q)
¬p q q p↔q
p p q
p q p↔q ¬p ¬p ∨ q q ∧ (p ↔ q) (¬p ∨ q) → (q ∧ (p ↔ q))
1 1 1 0 1 1 1
1 0 0 0 0 0 1
0 1 0 1 1 0 0
0 0 1 1 1 0 0
(q) p → (q → (r → (¬p → (¬q → ¬r))))
r ¬p → (¬q → ¬r)
¬p ¬q → ¬r
p ¬q ¬r
q r
Truth table on next page:
p q r ¬q ¬r ¬q → ¬r ¬p ¬p → (¬q → ¬r) r → (¬p → (¬q → ¬r)) q → (r → (¬p → (¬q → ¬r))) p → (q → (r → (¬p → (¬q → ¬r))))
1 1 1 0 0 1 0 1 1 1 1
1 1 0 0 1 1 0 1 1 1 1
1 0 1 1 0 0 0 1 1 1 1
1 0 0 1 1 1 0 1 1 1 1
0 1 1 0 0 1 1 1 1 1 1
0 1 0 0 1 1 1 1 1 1 1
0 0 1 1 0 0 1 0 0 1 1
0 0 0 1 1 1 1 1 1 1 1
APPENDIX E. CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC320
APPENDIX E. CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC321
p ∧ (¬p ∨ q) (r → ¬q) ∧ (p → r)
p ¬p ∨ q r → ¬q p → r
¬p q r ¬q p r
p q
Truth-table on next page.
p q r ¬p ¬q ¬p ∨ q r → ¬q p→r p ∧ (¬p ∨ q) (r → ¬q) ∧ (p → r) p ∧ (¬p ∨ q) → (r → ¬q) ∧ (p → r)
1 1 1 0 0 1 0 1 1 0 0
1 1 0 0 0 1 1 0 1 0 0
1 0 1 0 1 0 1 1 0 1 1
1 0 0 0 1 0 1 0 0 0 1
0 1 1 1 0 1 0 1 0 0 1
0 1 0 1 0 1 1 1 0 1 1
0 0 1 1 1 1 1 1 0 1 1
0 0 0 1 1 1 1 1 0 1 1
APPENDIX E. CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC322
APPENDIX E. CHAPTER 5. SEMANTICS FOR PROPOSITIONAL LOGIC323
Parsing Tree:
p → (p ∨ (p ∧ q))
p p ∨ (p ∧ q)
p p∧q
p q
Truth Table:
p q p∧q p ∨ (p ∧ q) p → (p ∨ (p ∧ q)
1 1 1 1 1
1 0 0 1 1
0 1 0 0 1
0 0 0 0 1
Since there are only 1’s in the final column, the formula is a logical
truth and the argument therefore valid.
Appendix F
Chapter 6. Tableaux
Propositional Logic
6.6 Exercises
6.6.1 One way of putting it is as saying that an inference is valid iff the
premises together with the negation of the conclusion are unsatisfiable
or inconsistent.
6.6.2 (a) Suppose for contradiction that there is a valuation v such that
J¬(p → q)Kv = 1 and J¬(q → p)Kv = 1. J¬(p → q)Kv = 1 would
mean that Jp → qKv = 0, from which would follow that JpKv = 1
and JqKv = 0. (An implication is not true iff the first argument
is true and the second argument is false). For J¬(q → p)Kv = 1
to hold, J(q → p)Kv = 0 must be true, from which follows that
JqKv = 1 and JpKv = 0. As we’d already established that JpKv = 1
and JqKv = 0, this is a contradiction. Hence such a v cannot exist,
so the set is unsatisfiable.
(b) This follows immediately from our observation 5.2.11.(i) that
p ∨ ¬p. This means that for all v, Jp ∨ ¬pKv = 1. Now suppose
that there is a valuation v such that J¬(p ∨ ¬p)Kv = 1. Since
J¬(p ∨ ¬p)Kv = 1 − Jp ∨ ¬pKv , it would follow that Jp ∨ ¬pKv = 0
in contradiction to 5.2.11.(i). Hence, there is no such valuation v
and {¬(p ∨ ¬p)} is unsatisfiable.
(c) Suppose for contradiction that there is a valuation v such that
J¬pKv = 1 and J¬p → pKv = 1. From J¬pKv = 1 follows that JpKv =
0 (∗). From J¬p → pKv = 1 follows that max(1 − J¬pKv , JpKv ) = 1.
So either 1−J¬pKv must be 1 or JpKv must be 1. By (∗) follows that
the latter is not the case, so 1 − J¬pKv = 1 must hold. This would
mean that J¬pKv = 0. But we’ve already assumed that J¬pKv = 1.
324
APPENDIX F. CHAPTER 6. TABLEAUX PROPOSITIONAL LOGIC325
6.6.3 We need to show two things: (a) if ¬(φ1 ∧. . .∧φn ), then {φ1 , . . . , φn }
is unsatisfiable, and (b) if {φ1 , . . . , φn } is unsatisfiable, then ¬(φ1 ∧
. . . ∧ φn ). We do so in turn:
6.6.4 (a) p → q, r → q ` (p ∨ r) → q
APPENDIX F. CHAPTER 6. TABLEAUX PROPOSITIONAL LOGIC326
p→q
r→q
¬((p ∨ r) → q)
p∨r
¬q
¬p q
p r 7
7 ¬r q
7 7
(b) p → (q ∧ r), ¬r ` ¬p
p → (q ∧ r)
¬r
¬¬p
¬p q∧r
7
q
r
7
(c) ((p → q) → q) → q
APPENDIX F. CHAPTER 6. TABLEAUX PROPOSITIONAL LOGIC327
¬(((p → q) → q) → q)
((p → q) → q)
¬q
¬(p → q) q
7
p
¬q
¬¬p
p→q
¬p → q
¬p q
7 ¬¬p q
p ↔ (q ↔ r)
¬((p ↔ q) ↔ r)
p ¬p
(q ↔ r) ¬(q ↔ r)
(p ↔ q) ¬(p ↔ q) (p ↔ q) ¬(p ↔ q)
¬r r ¬r r
q ¬q q ¬q q ¬q q ¬q
r ¬r r ¬r ¬r r ¬r r
7 p ¬p p ¬p 7 p ¬p 7 7 p ¬p
q ¬q ¬q q q ¬q ¬q q
7 7 7 7 7 7 7 7
APPENDIX F. CHAPTER 6. TABLEAUX PROPOSITIONAL LOGIC329
¬(p → q) ∧ ¬(p → r)
¬(¬q ∨ ¬r)
¬(p → q)
¬(p → r)
¬¬q
¬¬r
¬q
7
p ∧ (¬r ∨ s)
¬(q → s)
¬r
(¬r ∨ s)
¬s
¬r s
7
(p → (q → r))
¬(q → (p → r))
¬(p → r)
¬r
¬p (q → r)
7 ¬q r
7 7
p ↔ ¬¬q
¬q → (r ∧ ¬s)
s → (p ∨ q)
¬((s ∧ q) → p)
s∧q
¬p
¬s p∨q
7 p q
7 p ¬p
¬¬q ¬¬¬q
7
¬q
7
¬(p ∧ ¬q) ∨ r
p → (r ↔ s)
¬(p ↔ q)
¬(p ∧ ¬q) r
¬p (r ↔ s) ¬p (r ↔ s)
p ¬p p ¬p p ¬p p ¬p
¬q q ¬q q ¬q q ¬q q
q 7 7 r ¬r
s ¬s s ¬s
7 7
¬s
s q
r ¬r
s ¬s
APPENDIX F. CHAPTER 6. TABLEAUX PROPOSITIONAL LOGIC332
7.7 Exercises
7.7.3 (a) Claim. Every proof theoretically inconsistent set is unsatisfiable.
333
APPENDIX G. CHAPTER 7. SOUNDNESS AND COMPLETENESS334
8.9 Exercises
8.9.1 (i) (a) sub(R(t1 , . . . , tn )) = {R(t1 , . . . , tn )} for all Rn ∈ R and
t1 , . . . , tn ∈ T .
(b) sub(t1 = t2 ) = {t1 = t2 } for all t1 , t2 ∈ T .
(ii) (a) sub(¬φ) = {¬φ} ∪ sub(φ) for all φ ∈ L.
(b) sub((φ ◦ ψ)) = {(φ ◦ ψ)} ∪ sub(φ) ∪ sub(ψ) for all φ, ψ ∈ L.
(c) sub(Qxφ) = {Qxφ} ∪ sub(φ) for all φ ∈ L and Q = ∀, ∃.
8.9.6 No, this is not the case. Consider ∃xP (x). This is a sentence since
all the variables it contains are bound (the x is bound by the ∃x).
The set of sub-formulas is sub(∃xP (x)) = {∃xP (x), P (x)}. P (x) is a
sub-formula, however it is not sentences since it contains an unbound
variables, i.e. the x.
8.9.9 (i)
(∀x(R(x, y) → ∃yR(y, y)))[y := x]
∀x((R(x, y) → ∃yR(y, y)))[y := x]
∀x((R(x, y))[y := x] → (∃yR(y, y))[y := x])
335
APPENDIX H. CHAPTER 8. SYNTAX FOR FIRST-ORDER LOGIC336
8.9.12 (a) Er is een getal groter dan 4 en er is een getal kleiner dan 4.
(∃xG(x, 4) ∧ ∃xK(x, 4))
(b) Er is een even getal groter dan 3.
∃x(E(x) ∧ G(x, 3))
(c) Ieder getal groter dan 4 is ook groter dan 3.
∀x(G(x, 4) → G(x, 3))
(d) Geen getal is groter dan 3 en kleiner dan 4.
¬∃x(G(x, 3) ∧ K(x, 4)
(e) Als dit getal groter dan 4 is, dan is ieder getal dat ik hier opgeschreven
heb groter dan 4.
G(x, 4) → ∀x(N (x) → G(x, 4))
(f) Een getal dat kleiner dan 3 is, is kleiner dan 4.
∀x(K(x, 3) → K(x, 4))
APPENDIX H. CHAPTER 8. SYNTAX FOR FIRST-ORDER LOGIC337
8.9.13 (a) Een getal dat groter is dan ieder even getal, is oneven.
∀x(∀y(E(y) → G(x, y)) → O(x))
(b) Ieder getal is groter dan tenminste één getal.
∀x(∃yG(x, y))
(c) Er is een even getal dat kleiner is dan een oneven getal dat groter
is dan een oneven getal.
∃x(E(x) ∧ ∃y(O(y) ∧ K(x, y) ∧ ∃z(O(z) ∧ G(y, z))))
(d) Er is geen getal dat groter is dan ieder getal.
¬∃x(∀yG(x, y))
(e) Geen getal is groter dan zichzelf.
¬∃xG(x, x)
(f) Ieder oneven getal is groter dan 0.
∀x(O(x) → G(x, 0))
(g) Ieder oneven getal is groter dan een even getal.
∀x(O(x) → ∃y(E(y) ∧ G(x, y))
9.7 Exercises
9.7.1
(a) Jx2 KM
α = α(x2 ) = 2 · 2 + 1 = 5
(f) J2 + 2KM M M M M M M
α = + (J2K , J2K ) = + (JS(S(0))Kα , JS(S(0))Kα ) =
+M (S M (JS(0)KM M M M M M M M
α ), S (JS(0)Kα )) = + (S (J0Kα ), S (J0Kα )) =
M
+ (42, 42) = 42 · 42 = 1764
(h) J0 + 0KM M M M M M M
α = + (J0Kα , J0Kα ) = + (0 , 0 ) = 42 · 42 = 1764
(i) J(0·0)+1KM M M M M M M M M M
α = + (J0·0K , JS(0)KKα ) = + ((· (0 , 0 ), S (0 )) =
4242 · 42 = 4243
(j) J42KM
α = JS(. . . (S (0) . . .)K
M = S M (JS(. . . (S (0) . . .)KM ) = JS(. . . (S (0) . . .)KM =
| {z } | {z } | {z }
42 times 41 times 41 times
. . . = J0KM
α =0
M = 42.
339
APPENDIX I. CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC340
9.7.2
See the added bullet 9.2.10 for (a). (b) and (c) work completely analogously.
9.7.5
(a) We will first determine JxKM M
α . We get: JxKα = α(x) = 1.
Next, we determine J1KM . We get: J |{z}
1 KM = JS(0)KM M M
α = S (J0Kα ) =
=S(0)
S M (0)= 0 + 1 = 1. Because 1 = 1, it follows that JxKM M
α = J1Kα and
so M, α x = 1.
(b) We want to determine whether M, α S(x) = S(S(x)). We will first
determine JS(x)KM
α as follows:
JS(x)KM M M
α = S (JxKα ) = = S M (1) = 1 + 1 = 2
JxKM
α =α(x)=1
JS(S(x))KM M M M M M
α = S (JS(x)Kα ) = S (S (JxKα ))
= S M (S M (1)) = 1 + 1 + 1 = 3.
JxKM
α =1
J2 + 2KM M M M M M M
α = + (J2K , J2K ) = + (JS(S(0))Kα , JS(S(0))Kα )
= +M (S M (JS(0)K)M M M
α , S (JS(0)K)α )
= +M (S M (S M (J0KM M M M
α )), S (S (J0Kα )))
= +M (S M (S M (0)), S M (S M (0)))
= +M (0 + 1 + 1, 0 + 1 + 1) = 2 + 2 = 4.
We will then determine J4KM
α as follows:
J4KM M M M
α = JS(S(S(S(0))))Kα = S (JS(S(S(0)))Kα )
= S M (S M (JS(S(0))KM
α ))
= S M (S M (S M (JS(0)KM
α )))
= S M (S M (S M (S M (J0KM
α ))))
= S M (S M (S M (S M (0)))) = 0 + 1 + 1 + 1 + 1 = 4.
9.7.6
(a) In order to show that M, α ∃y y ∈ x, we need to establish (by
definition) that there exists a d ∈ DM such that M, α[y 7→ d] y ∈ x.
This, in turn, is the case iff (JyKM M
α[y7→d , JxKα[y7→d ) = (d, α(x)) = (d, {x :
x is even}) ∈∈M . Since we have ∈M = {(x, X) : x ∈ N, X ∈ ℘(N), x ∈
X}, we get that M, α[y 7→ d] y ∈ x iff d ∈ {x : x is even}. So, let
d = 2. Clearly, 2 ∈ {x : x is even} and so M, α[y 7→ 2] y ∈ x. So,
M, α ∃y y ∈ x.
9.7.10
(i) We will prove M ∃x∃y(P (x) ∧ P (y) ∧ x 6= y) iff P M has at least two
elements.
Left-to right: We will prove this using conditional proof, followed by
proof by contradiction. We begin with the conditional proof. Let M
and α be arbitrary such that M, α ∃x∃y(P (x) ∧ P (y) ∧ x 6= y).
Now, we assume the negation of our conclusion for the proof by con-
tradiction. Thus, we assume P M does not have at least two elements.
This means P M has strictly fewer than 2 elements, meaning we can
distinguish two cases: P M has 0 elements (1) and P M has 1 element
(2).
9.7.13
(a) We want to show that ∀xP (x) ∀yP (y). So, let M and α be arbitrary
such that M ∀xP (x). This means that for all d ∈ DM , M, α[x 7→
APPENDIX I. CHAPTER 9. SEMANTICS FOR FIRST-ORDER LOGIC343
9.7.14
(a) Deze claim is niet waar. Dit kan geı̈llustreerd worden met het onder-
staande tegenvoorbeeld:
DM = {a, b}
P M = {a}
QM = {a, b}
∀x(P (x) → Q(x)) is waar: als we x vervangen door a dan hebben we
dat P (a) en Q(a) waar zijn, dus P (a) → Q(a) is ook waar. Als we x ver-
vangen door b krijgen we ¬P (b), dus dan is de implicatie P (b) → Q(b)
waar. ¬∃P (x) is ook waar, want ¬P (b) is waar. ∀x¬Q(x) is echter niet
waar, want er is een element waarvoor geldt Q(X), namelijk a.
Appendix J
10.8 Exercises
10.8.1 (a) ∀xP (x)
¬∀yP (y)
∃y¬P (y)
¬P (p)
P (p)
7
344
APPENDIX J. CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC345
(b) ∃x∃yS(x, y)
¬∃y∃xS(x, y)
∃yS(p1 , y)
S(p1 , p2 )
∀y¬∃xS(x, y)
¬∃xS(x, p2 )
∀¬S(x, p2 )
¬S(p1 , p2 )
7
P (p)
¬Q(p)
∀x¬P (x)
¬P (p)
7
APPENDIX J. CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC346
Q(p)
¬P (p)
¬R(p)
P (p)
7
¬P (p1 )
P (p1 ) → Q(p1 )
∃x¬¬Q(x)
¬¬Q(p2 )
Q(p2 )
P (p2 ) → Q(p2 )
¬P (p1 ) Q(p1 )
P (p)
¬∀yQ(y)
∃y¬Q(y)
¬Q(q)
∃xP (x)
¬∀yQ(y)
∃y¬Q(y)
P (p)
¬Q(q)
P (r) → ∀yQ(y)
¬P (r) ∀yQ(y)
Q(p)
Q(q)
7
∀x∃yS(x, y)
¬∃xS(x, x)
∀x¬S(x, x)
∃yS(p1 , y)
¬S(p1 , p1 )
S(p1 , p2 )
∃yS(p2 , y)
¬S(p2 , p2 )
S(p2 , p3 )
..
.
It’s relatively straight-forward to see that the tableau will be in-
finite: the universal quantifier in ∀x∃yS(x, y) needs to be instan-
tiated for each new parameter but itself generates an existential
quantifier ∃yS(pi , y), which forces us to introduce a new param-
eter, and so on.
At the same time, the tableau will not be closed, since the only
negated atoms are going to be of the form ¬S(pi , pi ) coming
from the universal quantifier ∀x¬S(x, x); and the only un-negated
atoms come from our existential quantifiers ∃yS(pi , y), which can
never give us a formula of the form S(pi , pi ).
As our countermodel, we get MB with DMB = {p1 , p2 , . . .} and
S MB = {hp1 , p2 i, hp2 , p3 i, . . .}.
A finite countermodel for the same inference is DMB = {p1 , p2 }
and S MB = {hp1 , p2 i, hp2 , p1 i}.
APPENDIX J. CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC350
(e) ∃x¬∃yS(x, y)
¬∃x∀yS(x, y)
¬∃yS(p1 , y)
∀y¬S(p1 , y)
¬S(p1 , p1 )
∀x¬∀yS(x, y)
¬∀yS(p1 , y)
∃y¬S(p1 , y)
¬S(p1 , p2 )
¬S(p1 , p2 )
¬∀yS(p2 , y)
∃y¬S(p2 , y)
¬S(p2 , p3 )
¬S(p1 , p3 )
..
.
It’s relatively straightforward to see that the branch is infinite:
we have to continue instantiating ∀x¬∀yS(x, y) with the new pa-
rameters we introduce, then we get a new existential quantifier,
which forces us to introduce a new parameter, . . . —we have a
quantifier feedback loop. At the same time, there is never a non-
negated atomic formula on the branch (try to find the pattern).
Our countermodel thus looks like this:
– DMB = {p1 , p2 , . . .}
– S MB = ∅
Here is a finite model that works as countermodel for the same
APPENDIX J. CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC351
inference:
– DMB = {p1 }
– S MB = ∅
10.8.5 (d)
APPENDIX J. CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC352
P (p)
∀y(P (y) → p = y)
P (q) ∧ P (r)
q 6= r
P (q)
P (r)
P (q) → p = q
¬P (q) p=q
7
P (r) → p = r
¬P (r) p=r
7
q=r
7
10.8.6 The reason why it’s not possible to write such an algorithm is that
it would lead to a decision procedure for first-order logic, which we
APPENDIX J. CHAPTER 10. TABLEAUX FOR FIRST-ORDER LOGIC353
know can’t exist. Suppose you could in finitely many steps determine
whether a formula is invalid, that is: false in some model. Now suppose
you’re wondering if a given formula is valid. You run the algorithm. If
the algorithm tells you the formula is invalid, you know the answer to
your question: no. If the algorithm tells you the formula is not invalid,
well, then it must be valid; so you know the answer to your question:
yes. So, an algorithm that determines invalidity gives an algorithm
for validity. We know the later doesn’t exist, so the former can’t exist
either.
Hardcore version. Also such an algorithm would lead to a decision pro-
cedure, though in a slightly more complicated fashion. Suppose you’re
interested in whether a formula is valid but you can only determine
whether it’s contingent. First, find out whether the formula is contin-
gent. If it is, you know it can’t be valid, because a contingent formula
is false in some model. If you find out the formula is not contingent,
then there are two options: either the formula is true in every model
or it is false in every model. We need to figure out in which of the two
cases we are. But we can do this using the algorithm again. The way
this works is that you pick any contingent formula, say a non-trivial
identity claim of the form a = b. Then you consider the disjunction of
your initial form and that contingent formula. Run the algorithm on
that statement. If it turns out to be contingent, then the initial for-
mula must be false in every model. If the disjunction turns out to be
non-contingent, then the initial formula must be valid. Why so? Well,
a disjunction is true iff at least one of the disjuncts is true. Now let’s
go through the two possible situations. If the initial formula is false in
every model, then the disjunction will be true precisely in the models
where the contingent formula is true—which means the disjunction
will be itself contingent. But if the initial formula was valid, it is true
in every model, and so it’s disjunction with any other statement will
also be true in every model. So, the disjunction of our non-contingent
formula and a contingent formula will be non-contingent iff the non-
contingent formula is valid.
Appendix K
11.7.1.1 Long answer : In order to determine all variable and quantifier occur-
rences, we first construct the stripped parsing tree for the formula:
354
APPENDIX K. CHAPTER 11. SOUNDNESS AND COMPLETENESS355
∀x
∃y
R ∀x
x y ∧
P ∃y
x R
x y
11.7.1.3 Long answer : We are asked to determine the value of J(0 + x) · S(0)KM
α
for the given model and assignment. Applying the recursive definition
of the denotation of a term in a model under an assignment, we get
the following calculation:
J(0 + x) · S(0)KM M M
α = J0 + xKα · JS(0)KM
α
= (J0KM
α +
M
JxKM
α )·
M M
S (J0KM
α )
= (0M +M α(x)) ·M S M (0M )
= (1 +M 3) ·M S M (1)
=5·3
= 15
11.7.1.4 (Very) Long Answer : We claim that M, α ∀x∀y(R(x, y) → R(f (y), f (x))).
In order to determine what we need to show is, we observe the following
Since there are only 2 elements in DM = {1, 2}, there are 4 possible
choices for d and d0 to consider:
– d = 1, d0 = 1
– d = 1, d0 = 2
– d = 2, d0 = 1
– d = 2, d0 = 2
APPENDIX K. CHAPTER 11. SOUNDNESS AND COMPLETENESS357
Jf (x)KM M
α[x7→d,y7→d0 ] = f (1) = 2
Jf (y)KM M
α[x7→d,y7→d0 ] = f (2) = 1.
and so
M, α ∀x∀y(R(x, y) → R(f (y), f (x)),
as desired.
Elements of a good answer :
11.7.1.5 1. By definition, ∃x(P (x) ∧ x = c), ∀x(P (x) → Q(x)) ` Q(c) iff
the tableau for {∃x(P (x) ∧ x = c), ∀x(P (x) → Q(x)), ¬Q(c)} is
closed. Here is the tableau:
APPENDIX K. CHAPTER 11. SOUNDNESS AND COMPLETENESS358
∃x(P (x) ∧ x = c)
∀x(P (x) → Q(x))
¬Q(c)
P (p) ∧ p = c
P (p)
p=c
P (p) → Q(p)
¬P (p) Q(p)
7
¬Q(p)
7
Since the tableau is closed, we can infer the conclusion from the
premises as claimed.
Elements of a good answer :
– Explains why the tableau is done.
– Makes a tableau for Γ ∪ {¬φ} not for Γ ∪ {φ}.
– Applies all rules correctly.
– Recognizes the correct application of the identity rule to close
the second branch.
– Gets the correct answer.
2. By definition, P (c)∨(P (c)∧Q(c)), ∀x(Q(x) → ¬P (c)) ` ¬P (c) iff
the tableau for {P (c)∨(P (c)∧Q(c)), ∀x(Q(x) → ¬P (c)), ¬¬P (c)}
is closed. Here is the tableau:
APPENDIX K. CHAPTER 11. SOUNDNESS AND COMPLETENESS359
P (c)
¬Q(c) ¬P (c)
7 7
11.7.1.6 Long answer : We’re asked to determine whether the following inference
is valid:
– The ball is round, and everything round comes from Mars. So,
the ball comes from Mars.
APPENDIX K. CHAPTER 11. SOUNDNESS AND COMPLETENESS360
b : the ball
R1 : . . . is round
M1 : . . . comes from Mars
We obtain
R(b), ∀x(R(x) → M (x)) ∴ M (b)
In order to show that I’m making use of the tableau method. We know
that R(b), ∀x(R(x) → M (x)) ` M (b) iff the tableau for {R(b), ∀x(R(x) →
M (x)), ¬M (b)} is closed. Here is that tableau:
R(b)
∀x(R(x) → M (x))
¬M (b)
R(b) → M (b)
¬R(b) M (b)
7 7
Abbreviation Mistake
Error/mistake (generic)
Df. Incorrect or imprecise definition
Q? Question not read correctly
6⇒ Non-sequitur, reasoning mistake
6= Calculation mistake
? QED missing, reasoning incomplete
x? Undeclared variables
⇒? Right-to-left direction missing
APPENDIX K. CHAPTER 11. SOUNDNESS AND COMPLETENESS362
11.7.2.1 We’re asked to show that if φ is an open formula with y as its only
free variable, then ∀xφ is also an open formula (i.e. not a sentence).
We show this claim by showing that for every free occurrence of y in φ
there will be a corresponding free occurrence of y in ∀xφ. Since there
are free occurrences of y in φ, from this the claim follows.
So, consider a free occurrence of y in φ. Clearly, there is a correspond-
ing occurrence of y in ∀xφ. What remains to be shown is that the oc-
currence is free. Suppose, for indirect proof, that it’s not. This would
mean that there’s a quantifier occurrence of the form Qy in ∀xφ, which
binds the occurrence of y. That quantifier occurrence cannot have a
corresponding occurrence in φ, because then the occurrence of y in
φ would be bound, contrary to our assumption. But the only quanti-
fier occurrence that’s in ∀xφ without a corresponding occurrence in φ
is (r, ∀x). But this occurrence cannot bind any occurrence of y since
x 6= y. Hence, y needs to be free in ∀yφ, as desired.
Alternative strategy (way more complicated): Using induction on for-
mulas.
11.7.2.2 We’re asked to show that for all Γ, we have Γ ` P (c)∨¬P (c). We know,
by definition, that this is the case iff the tableau for Γ ∪ {¬(P (c) ∨
¬P (c))} is closed. But we can infer that this tableau is closed even
without knowing what the members of Γ are. To see this, note that
the initial list consists in Γ∪ {¬(P (c)∨ ¬P (c))}, so we can always close
the tableau as follows:
Γ
¬(P (c) ∨ ¬P (c)
¬P (c)
¬¬P (c)
P (c)
7
11.7.2.6 We’re asked to prove that for all terms s and t we have, in the given
model M and under the given assignment α, that JsKM M
α = JtKα . In
order to prove this fact, we show that for all t we have JtKM
α = a .
M
JsKM
α =a
M
= JtKM
α
Jf (t)KM M M M M
α = f (JtKα ) = f (a ) = a
M
So, using the principle of induction on terms, we have seen that JtKM
α =
aM for all terms t, from which our main claim follows as explained
before.
This completes our proof, we can now infer by the principle of induc-
tion over formulas that for all φ with only x free, (φ)[x := c] is a
sentence.
11.7.2.8 We’re essentially asked to show that for all models M and assignments
α, we have M, α ∀xR(x, x) iff (d, d) ∈ RM for all d ∈ DM . That is,
we need to show two things:
To see that (a) holds, assume that M, α ∀xR(x, x). This means, by
definition, that M, α[x 7→ d] R(x, x). We derive that (d, d) ∈ RM for
all d ∈ DM by contradiction. Suppose that there exists a d ∈ DM such
that (d, d) ∈/ RM . But then, we’d have that M, α[x 7→ d] 2 R(x, x),
APPENDIX K. CHAPTER 11. SOUNDNESS AND COMPLETENESS366
every φ (we proved this in 6.2.5.(c) for propositional logic, but the
proof clearly goes through for first-order logic, too). But we know by
the “I Can’t Get No Satisfaction” Theorem, that Γ ∪ {¬φ} iff Γ φ.
So, we can conclude that if Γ c 6= c, then Γ φ, as desired.
11.7.2.12 In order to define the desired function, we first define the auxiliary
function c : T → N given by the following recursion:
f (t1 , . . . , tn )
T (t1 ) . . . T (tn )
R(t1 , . . . , tn )
T (t1 ) . . . T (tn )
APPENDIX K. CHAPTER 11. SOUNDNESS AND COMPLETENESS368
s=t
T (s) T (t)
T (φ)
T (φ) T (ψ)
T (φ)
11.7.2.13 We show that Betrand is correct using logic. First, we formalize the
stranger’s claim using the following translation key:
K1 . . . is a barber
S2 . . . shaves
APPENDIX K. CHAPTER 11. SOUNDNESS AND COMPLETENESS369
K(p)
¬S(p, p) ↔ S(p, p)
¬S(p, p) S(p, p)
S(p, p) ¬S(p, p)
7 7
List of Symbols
Will be updated.
370