Formal Reasoning
Formal Reasoning
Herman Geuvers
Partly based on the reader of fall of 2002 by Henk Barendregt and Bas Spitters,
and with thanks to Wim Gielen for his reader Discrete Wiskunde.
Revised and expanded, fall of 2008, by Engelbert Hubbers and Freek Wiedijk.
Translated fall of 2016 by Kelley van Evert.
The course notes for 20172018 are not completely ready yet,
so the empty chapters will be filled in during the course.
September 1, 2017
Contents
Table of contents 1
1 Propositional logic 2
1.1 Formal languages and natural languages . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Connectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Meaning and truth tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Models and truth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Logical equivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.7 Logical consequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.8 Important concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2 Predicate logic 10
2.1 Predicates, relations and constants . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 The language of predicate logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 Truth and deduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4 The language of predicate logic with equality . . . . . . . . . . . . . . . . . . . 18
2.5 Important concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3 Languages 21
4 Automata 22
5 Discrete mathematics 23
6 Modal logic 24
Bibliography 25
Index 26
1
Chapter 1
Propositional logic
In this chapter we discuss propositional logic, often also called propositional calculus.
1.2 Dictionary
We can also formalize this situation with a small dictionary.
R it rains
S the sun shines
RB there is a rainbow
W I get wet
D I stay dry
Out Im outside
In Im inside
So then, the sentence we introduced above becomes if R and Out, then W. Similarly, we
could form statements as: if RB, then S, S and RB, or if R and In, then D.
2
1.3 Connectives
We can also translate the connectives, which well do like this:
Now, the sentences we formed above become RBS, SRB, and (RIn)D.
Exercise 1.A
Form sentences in our formal language that correspond to the following English sentences:
(i) Its neither raining, nor is the sun shining.
(ii) The sun shines unless it rains
(iii) Either the sun shines, or it rains. (But not both simultaneously.)
(iv) There is only a rainbow if the sun is shining and its raining.
(v) If Im outside, I get wet, but only if it rains.
So far, weve modelled our symbols (like and ) to be very much like the English connec-
tives. One of these English connectives is the word or, which combines smaller statements
into larger, new statements. However, the meaning of the English word or can be a bit
ambiguous. Take the following proposition: 1 + 1 = 2 or 2 + 3 = 5. Is it true, or not? It
turns out that people sometimes differ in opinion on this, and when you think about it a
bit, there are two distinct meanings that or can have in the English language. Students of
Information Science and Artificial Intelligence obviously dont like these ambiguities, so well
simply choose the meaning of to be one of the two usual meanings of or: well agree that
A or B is also true in the case that both A and B are true in of themselves. Definition 1.5
will formalize this agreement.
Exercise 1.B
Can you also express f g using the other connectives? If so, show how.
Exercise 1.C
Translate the following formal sentences into English:
(i) R S
(ii) RB (R S)
(iii) Out In
(iv) Out In
Definition 1.1
The language of propositional logic is defined to be as follows. Let A be an infinite collection
of atomic propositions (also sometimes called propositional variables or letters):
A := {a, b, c, d, a1 , a2 , a3 , . . .}
1
Mathematicians will often simply write iff instead of the lengthier if and only if.
3
Let V be the set of connectives:
V := {, , , , }
Let H be the set of parentheses:
H := {(, )}
Then, let the alphabet be the set := A V H, where stands for the union of two sets.
Now, we can form the words of our language:
1. Any atomic proposition is a word.
2. If f and g are words, then so too are (f g), (f g), (f g), (f g) , and f .
3. All words are made in this way. (No additional words exist.)
We call the words of this language propositions.
Convention 1.2
Usually, we omit the outermost parentheses of a formula, thus for example writing ab instead
of (ab). Of course we cannot always do the same with the inner parentheses, take for example
the logically inequivalent (R S) RB and R (S RB). What we can do, is agree upon
a notation in which were allowed to omit some of the parentheses. We do this by defining a
priority for each connective:
binds stronger than
binds stronger than
binds stronger than
binds stronger than
This means that we must interpret the formula In RB Out S R as the formula
((In RB) Out) ( S R).
Only using these priorities is not enough though: it only describes where the implicit
parentheses are in the case of different connectives. When statements are built up by repeated
use of the same connective, it is not clear yet where these parentheses should be read.
For example, should we parse Out R W as expressing (Out R) W or as
expressing Out (R W)? This is formalized by defining the associativity of the operators.
Convention 1.3
The connectives , , , and are right associative. This means that, if v {, , , },
then we must read
A v B v C
as expressing
A v (B v C)
Note, though, that this is a choice that is sometimes made differently, outside of this course.
So sometimes, in other readers and books on logic, an other choice might be made.
Remark 1.4
(This remark may only have meaning to you after reading Chapter 3, Languages and au-
tomata; so after reading that chapter, you might want to reread this remark.) The for-
mal definition of our language, with the help of a context-free grammar , is as follows: Let
= A V H, that is to say = {a, b, c, . . . , , , , , , , (, )}. Then the language is
defined by the grammar
S a | b | c | . . . | S | (S S) | (S S) | (S S) | (S S)
Obviously, in stead of the dots all other symbols of the alphabet A should be listed.
4
1.4 Meaning and truth tables
The sentence if a and b, then a is true, whatever you substitute for a and b. So, wed like to
be able to say: the sentence a b a is true2 . But we cant, because we havent formally
defined what that means yet. As of yet, a b a is only one of the words of our formal
language. Which is why well now turn to defining the meaning of a word (or statement) of
language, specifically speaking, when such a statement of logic would be true.
For the atomic propositions, we can think of any number of simple statements, such as
2=3, or Jolly Jumper is a horse, or it rains. In classical logic, which is our focus in this
course, we simply assume that these atomic propositions may be true, or false. We dont
further concern ourselves with the specific truth or falsity of particular statements like on
January the 1st of 2050 itll rain in Nijmegen.
The truth of atomic propositions will be defined solely by their interpretation in a model .
For example, 2=3 is not true in the model of natural numbers. And Jolly Jumper is a horse
is true in the model that is a comic of Lucky Luke. And the sentence it rains was not true
in Nijmegen, on the 17th of September of 2002.
Now lets take a look at the composite sentence a b. We would want this sentence to be
true in a model, exactly in the case that both a and b are true in that model. If we then just
enumerate the possible truth values of a and of b, we can define the truth of a b in terms of
these.
In Computing Science, we often simply write 1 for true, and 0 for false. Logical operations,
then, are the elementary operations on bits.
So, we get the following truth table:
x y xy
0 0 0
0 1 0
1 0 0
1 1 1
And what of the if. . . , then. . . construction to combine statements into larger ones?
Here, too, natural language is somewhat ambiguous at times. For example, what if A is false,
but B is true. Is the sentence if A, then B true? Examples are:
if 1 + 1 = 3, then 2 + 2 = 6
if I jump off the Erasmus building, Ill turn into a bird
if I understand this stuff, my name is Alpje
Well put an end to all this vagueness by simply agreeing upon the truth tables for the
connectives (and writing A B instead of if A, then B), in this next definition.
Definition 1.5
The truth tables for the logical connectives are defined to be:
x y xy x y xy
x x 0 0 0 0 0 0
0 1 0 1 0 0 1 1
1 0 1 0 0 1 0 1
1 1 1 1 1 1
2
Note: a b a should be read as (a b) a
5
x y xy x y xy
0 0 1 0 0 1
0 1 1 0 1 0
1 0 0 1 0 0
1 1 1 1 1 1
Using our truth tables, we can determine the truth value of complex propositions from
the truth values of the individual atomic propositions. We do this by writing out larger truth
tables for these complex propositions.
Example 1.6
This is the truth table for the formula a b a:
a b ab a aba
0 0 0 0 1
0 1 1 0 0
1 0 1 1 1
1 1 1 1 1
Exercise 1.D
Find the truth tables for:
(i) a a (iv) a b a
(ii) (a b) a (v) a (b a)
(iii) a (b a) (vi) a b
6
(i) a a (v) a (b a)
(ii) a (a a) (vi) aba
(iii) aa (vii) a (b a)
(iv) (a b) a (viii) aba
Exercise 1.F
Let f and g be arbitrary propositions. Find out whether the following statements hold.
Explain your answers.
(i) If |= f and |= g, then |= f g.
(ii) If not |= f , then |= f .
(iii) If |= f or |= g, then |= f g.
(iv) If (if |= f , then |= g), then |= f g.
(v) If |= f, then not |= f .
(vi) If |= f g, then |= f or |= g.
(vii) If |= f g, then (if |= f , then |= g).
(viii) If |= f g, then (|= f if and only if |= g).
(ix) If (|= f if and only if |= g), then |= f g.
In this case, apparently, the placement of parentheses doesnt really matter. For this
reason, in some cases we simply omit such superfluous parentheses. In convention 1.3 we
agreed that all binary connectives would be right associative. But here, we see that this
choice, at least for and , is arbitrary: had we agreed that and associate to the left,
then that would have had no consequence for the truth value of the composite propositions.3
In exercise 1.D weve seen that for the connective , it actually does matter in which direction
it associates!
Remark 1.12
The propositions a b and b a are mathematically speaking logically equivalent. In English
though, the sentence they married and had a baby often means something entirely different
compared to they had a baby and married.
Here are a number of logically equivalences that demonstrate the distributivity of the
operators , , and over parentheses. The first two are called the De Morgan laws.
3
The reason that we chose for the right associativity of and is to be consistent with the proof system
Coq that will be used in the course Assertion and Argumentation.
7
1. (f g) f g.
2. (f g) f g.
3. f (g h) f g f h.4
4. f g h (f g) (f h).
Exercise 1.H
Let f and g be propositions. Is the following statement true? f g if and only if |= f g.
(i) a b |= a (iii) a |= a b
(ii) a b |= a (iv) a a |= b
Theorem 1.14
Let f and g be propositions. Then the following holds:
|= f g if and only if f |= g.
You should now be able to find a proof for this proposition. [Hint: Take a look at exercises
1.F and 1.I.]
Remark 1.15
Note that the symbols |= and were not included in the definition of the propositions of
our formal language. These symbols are not a part of the language, but are merely used
to speak mathematically about the language. Specifically, this means that constructions as
(f g) (|= g) and |= f are simply meaningless, and we should try to avoid writing
down such invalid constructions.
Remark 1.16
For more on logic, you can have a look at books like [3] and [2].
4
Note: by the conventions we specified for parentheses, this should be read as (f g) (f h).
8
1.8 Important concepts
alphabet, 4 1, 5
and true in a model, 6
f g, 3 truth, 6
assignment, 6 truth table, 5
finite assignment, 6
associativity, 4 union
right associative, 4 , 4
atomic proposition, 3
valuation, 6
connective, 3
De Morgan, 7
dictionary, 2
false
0, 5
if and only if
f g, 3
iff, 3
if, then
f g, 3
logical consequence, 8
f |= g, 8
logical entailment, 8
logically equivalent, 7
f g, 7
logically true, 6
|= f , 6
tautology, 6
logically valid, 6
valid, 6
model, 6
not
f , 3
or
f g, 3
parenthesis, 4
priority, 4
proposition, 4
propositional calculus, 2
propositional letter, 3
propositional logic, 2
propositional variable, 3
true
9
Chapter 2
Predicate logic
Instead of discussing the truth of this sentence, we are going to find out how to write it in a
formal way. Hopefully, this will then help us analyze the truth of such sentences. To jump
right in, well give a formal account of the sentence after defining the dictionary:
W set of (all) women
M set of (all) men
L(x, y) x loves y
H(x) x is happy
The symbol stands for for all, and the symbol stands for there exists. The
symbol denotes the membership of an element in a set, and , which weve encountered
before, stands for the union of two sets. If we translate the formal sentence back to English,
in a very literal way, we get:
For every woman it holds that, if there is a person that she loves, she is happy,
and for every man it holds that, if there is person that loves him, he is happy.
You should now check whether this is indeed the same as the sentence that we started with,
and whether you can see how this is indeed represented in the formal translation above. Note
our use of the square parentheses [ ] (also called brackets.) This is only for readability though,
so that you can easily see which parenthesis belongs to which.
Because it enables us to translate a sentence, well also call our dictionary an interpretation.
10
SH Sharon is happy
KH Koos is happy
But suppose we add more people to our statements, like Joris, and Maud. Well easily
end up with an inconveniently lengthy dictionary soon, because we have to add an atomic
proposition for every new person (JH, M H, . . . ).
This is why we now take a better look at the form of the statement that
Sharon is happy
and find out that it is of the shape of a predicate H( ) applied to a subject s (Sharon). Lets
write that as H(s). The immediate benefit is that we can now also write the very similar
for the subjects k, j, and m. Instead of subjects, well often speak of constants.
Also for our list of subjects, well use our dictionary to formally denote which subject
belongs to which name. Moreover, well indicate to which domain each of our subjects belongs.
s Sharon women
k Koos men
j Joris men
m Maud women
Maybe the real benefit of our new system is not yet entirely clear. (Now that we have one
predicate H added to four subjects s, k, j, m, making a total of five symbols, which is more
than the four we started out with: SH, KH, JH, M H. . . ) But suppose now that our subjects
would gain a number of other qualities, such as:
T (x) x is tall
B(x) x is beautiful
N (x) x is nice
I(x) x is intelligent
Moreover, besides our predicates (qualities), we also have (binary) relations, like the one we
used above:
L(x, y) : x loves y.
Now we can take the following sentence
I(s) B(s)
h i
x M N (x) T (x) y W [L(x, y) B(y) I(y)] .
I(s) B(s)
x M [N (x) T (x) L(x, s)]?
Notice that we take these two statements in the sentence above, and join them together to a
single formula with the symbol. And that, although the formula doesnt state that Sharon
11
is a woman, that it doesnt need to, because we already defined that s women in the
dictionary. (So we dont need to add something like for example s W in the formula.)
The difference between the first and the second formal translation lies in what what referred
to as this character. (This might refer to Sharon, or it might refer to intelligent and
beautiful woman.) It is not logic that decides such questions, but logic does make it explicit
that this choice has to be made. Said differently: it makes explicit the ambiguities that often
occur in the English (or any other natural) language.
Exercise 2.A
Give two possible translations for the following sentence.
Now lets translate the other way around, and decode a formula.
Exercise 2.B
Translate the following sentences to English.
h i
(i) x M T (x) w W [B(w) I(w) L(x, w)]
h i
(ii) x M T (x) w W [B(w) I(w) L(x, w)] w0 W [I(w0 ) L(w0 , x)]
3. Domains, such as M, V, E, . . .,
4. Relation symbols, each with a fixed arity, that we sometimes explicitly annotate them
with, as in P 1 , R2 , T 3 , . . . So this means that P 1 takes a single argument, R2 takes two
arguments, etc.
5. The atoms, or atomic formulas, are P 1 (t), R2 (t1 , t2 ), T 3 (t1 , t2 , t3 ) etc., in which t, t1 ,
t2 , t3 , etc. are either variables or individual constants.
Convention 2.2
Just as in propositional logic, we usually omit the outermost parentheses. And to be able to
omit excessive parentheses within formulas, we expand upon our previous convention 1.2 for
propositional logic, adding the following:
12
Somewhat opposing what we said earlier, in the case of and , we add brackets for readability.
So instead of (x D f ), as in the definition, we write x D [f ]. And if we have a consecutive
series of the same quantifiers over the same domain, we may group these quantifications:
x D [y D [f ]] may be abbreviated to x, y D [f ]. Note that you are not allowed to
combine existential and universal quantifications in such an abbreviation.
If you take a look back at our first formula (2.1) this chapter, you can see that it actually quite
inconsistently uses parentheses and brackets. If we write it out as per the official definition,
it would read:
You can see why we prefer to somewhat liberally use parentheses and brackets for read-
ability. Let us take a look at the meaning of all the parentheses in this official version of the
formula:
w W H (v)
x (M W ) L (v, x) x (M W ) L (x, m) H (m)
m M
|{z}
| {z } | {z } |{z} | {z } | {z }
1 2 2 1 2 2
| {z } | {z }
3 3
| {z } | {z }
4 4
| {z } | {z }
5 5
| {z }
6
1. These parentheses are used for the readability of the domain, which is the union of the
sets M and W in this case. (The parentheses are not required by definition 2.1.)
2. These parentheses are needed because L(v, x), H(v), L(x, m), and H(m) are atomic
formulas, so the parentheses are required.
6. These parentheses are needed because the conjunction with requires them.
Remark 2.3
Grammar of predicate logic.
Just as with propositional logic we can define the language of predicate logic as a formal
language, with a grammar. This is done as follows. (You should reread this after having met
grammars in Chapter 3 about languages.)
13
Individual := Variable | Name
Variable := x, y, z, x1 , y1 , z1 , . . .
Name := a, b, c, d, e, . . .
Domain := D, E, . . .
Atom := P 1 (Individual) | R2 (Individual,Individual)
| T 3 (Individual,Individual,Individual) | . . .
Formula := Atom
| Formula
| (Formula Formula) | (Formula Formula)
| (Formula Formula) | (Formula Formula)
| ( Variable Domain Formula)
| ( Variable Domain Formula)
Exercise 2.C
Formalize the following sentence.
Sharon is beautiful; there is a guy who feels good about himself whom she loves.
Here, well treat feeling good about oneself as being in love with oneself.
Exercise 2.D
Formalize the following sentences:
(i) For every x and y we have: x loves y only if x feels good about him- or herself.
(ii) For every x and y we have: x loves y if he or she feels good about him- or herself.
(iii) For every x and y we have: x loves y exactly in the case that y feels good about him- or
herself.
(Note how we cut back on parentheses.) When is a formula true? Truth is relative and
depends upon an interpretation and a model.
Definition 2.4
A model is that piece of the real world in which formulas gain meaning by means of an
interpretation.
Because we havent yet explained what an interpretation is, this definition isnt really con-
clusive. But before we introduce the concept of an interpretation, let us first explain with a
few examples what we mean with a piece of the real world. Central here is the choice of the
domains that we choose, or how we restrict ourselves to a certain part of them, and which
predicates and relations are known within those domains.
1. Model M1
14
Domain(s) all students in the lecture hall
Predicate(s) is female
is more than 20 years old
Relation(s) has a student number lower than
is not older than
is sitting next to
2. Model M2
Domain(s) people
animals
Predicate(s) is female
is human
is canine
Relation(s) owns
is older than
In the case of the students in the lecture hall, we can determine which are female and not.
And if Sharon and Maud would happen to be present, it could be determined whether theyre
sitting next to each other. In the other case, there are biologists who can determine for any
animal whether it is a dog or not, and furthermore it is usually easy to establish whether
someone is the owner of a certain animal. In which way this is done, should actually still be
formally agreed upon, if we wish to have an exact model.
The important aspect is that, if we wish to use a certain part of the world as a domain
for predicate logic, we should have a conclusive and consistent way of determining the truth
of statements about predicates over subjects and relations between subjects of the domain.
Now we can define the notion of an interpretation.
Definition 2.5
An interpretation is given by a dictionary, which states:
2. Which subjects are referred to by the names (and to which domain sets these belong),
3. Which predicates and relations are referred to by the predicate and relation symbols.
In particular, then, the interpretation establishes a clear connection between the symbols in
formulas and the model that were looking at. In the literature, the interpretation is therefore
often done via an interpretation function. See for example [3].
Definition 2.6
A formula f is called true in a model under a given interpretation if the translation given by
the interpretation is actually true in the model.
Example 2.7
In the running example of Sharon, Koos, Joris, and Maud, the interpretation has been given
in the dictionary we introduced: we know exactly what is meant with the formulas L(s, k)
and x M L(x, s). The model is the factual situation involving these people, in which we
can indeed determine whether L(s, k) happens to be true (whether Sharon loves Koos), and
whether x M L(x, s) happens to be true (whether there is some guy who loves Sharon).
Whether the formulas F1 and F2 are true within M1 , can thus only be determined if we also
define an interpretation which gives meaning to the symbols. Here are three different possible
interpretations:
15
1. Interpretation I1
D all students in the lecture hall
K(x, y) x has a student number that is lower than that of y
2. Interpretation I2
D all students in the lecture hall
K(x, y) x is not older than y
3. Interpretation I3
D all students in the lecture hall
K(x, y) x is sitting next to y
We can assess the truth of the formulas F1 resp. F2 , in these models and under the given
interpretations, by checking whether the propositions hold that these formulas express, within
the models, and under the interpretations.
Exercise 2.E
(i) Verify that F2 does not hold in M1 under the interpretation I1 . But does F1 hold?
(ii) Verify that F1 holds in M1 under the interpretation I2 . Does F2 hold as well?
(iii) Check whether F1 in M1 is true under the interpretation of I3 , by looking around in
class. And check whether F2 is true or not, as well.
Because model M1 only mentions a single domain, it would seem as if every interpretation
would have to speak of the same domain. But this is not the case, as we can see in the
following interpretations for model M2 :
1. Interpretation I4
D people
K(x, y) x isnt older than y
2. Interpretation I5
D people as well as animals
K(x, y) x owns y
Note that in the case of I5 , that if x is an animal and y is a person, the statement K(x, y)
is automatically false, because animals dont own people.
3. Interpretation I6
D animals
K(x, y) y is older than x
Lets now take a look at the formulas G1 and G2 , and two models in which well interpret
them. (Note their difference to F1 and F2 .)
16
And two self-evident accompanying interpretations: Interpretation I7 :
D N
K(x, y) x < y
and interpretation I8 :
D Q
K(x, y) x < y
In model M3 under interpretation I7 the formula G1 is true. Indeed, for every number x N
we can easily find a number y N, for example y = x + 1, such that x < y. In model M4
under interpretation I8 the formula G1 is true as well. Again, we can take y = x + 1 and x < y
holds. Whenever we have such a method in which we can state precisely how to obtain a y
for any x, we speak of having an algorithm or recipe.
Convention 2.9
If a formula f is true in a model M under the interpretation I, we denote this by
(M, I) |= f
(M3 , I7 ) |= G1
(M4 , I8 ) |= G1
If we hadnt given the models M3 and M4 a name, we could also have simply written this as
follows:
((N, <), I7 ) |= G1
((Q, <), I8 ) |= G1
Because the (important part of the) model is often already expressed in the given inter-
pretation, we will often omit an exact definition of the model.
Exercise 2.F
Verify that G2 is indeed true in model M4 under the interpretation I8 , but not in model
M3 under the interpretation I7 . Stated differently: verify that ((Q, <), I8 ) |= G2 , and ((N, <
), I7 ) 6|= G2 .
Exercise 2.G
Define the interpretation I9 as:
D N
K(x, y) x=2y
Are the formulas G1 and/or G2 true under this interpretation?
Exercise 2.H
Define the interpretation I10 as:
D Q
K(x, y) x=2y
Are the formulas G1 and/or G2 true under this interpretation?
Exercise 2.I
We take as model the countries of Europe, and the following interpretation I11 :
17
E the set of countries of Europe
n The Netherlands
g Germany
i Ireland
B(x, y) x borders y
T (x, y, z) x, y, and z share a tripoint (where the borders of all three countries meet)
(i) Formalize the sentence The Netherlands and Germany share a tripoint.
(ii) Which of the following formulas are true in this model and under this interpretation?
(1) G3 := x Ey E[B(x, y)]
(2) G4 := x, y E[(z E T (x, y, z)) B(x, y)]
(3) G5 := x E[B(i, x) y E[T (i, x, y)]].
Exercise 2.J
Find a model M5 and an interpretation I12 such that this formula holds:
In convention 2.9 weve seen that we write (M, I) |= f in the case that the formula f of
predicate logic (with or without equality, which will be discussed in Section 2.4) is true in
a model M under the translation given by an interpretation (or, dictionary) I. Now, well
expand a bit upon this definition.
Definition 2.10
A formula f of predicate logic f is said to be logically true, or logically valid, which we then
denote |= f , when for any model and any interpretation, the translation holds in that model.
We often omit the logically part, simply writing that f is true or f is valid instead of writing
that f is logically true or logically valid .
Example 2.11
Consider the following statements:
(i) |= xD [P (x) P (x)].
(ii) |= (xDyD [P (x, y)]) (yDxD [P (x, y)]).
(iii) 6|= (yDxD [P (x, y)]) (xDyD [P (x, y)]).
The formula within statement (iii) is not true, which can be seen by taking the interpretation
D := N and P (x, y) := x>y. Under this interpretation, yDxD [P (x, y)] is true, because
for every y N we can indeed find a larger x N, but xDyD [P (x, y)] is not true,
because there is no biggest number x N. So the implication is false.
Definition 2.12
Suppose f and g are two formulas of predicate logic. We say that g follows from f , denoted
as f |= g, when |= f g. Which means that in every situation in which f is true, g is true
as well.
Statement (ii) above tells us that yDxD [P (x, y)] follows from xDyD [P (x, y)].
18
To be able to formalize this, we require an equality relation. Then, we can write:
Exercise 2.L
Use the interpretation I13 of exercise 2.K to formalize the following properties.
(i) C(x, y): x and y have had a child together.
(ii) B(x, y): x is a brother of y (take care: refer also to the next item).
(iii) S(x, y): x is a step-sister to y.
Translate the following formulas back to English.
(iv) xHyH P (x, y). And is this true?
(v) z1 Hz2 H[(xHy1 Hy2 H P (x, y1 ) P (y1 , z1 ) P (x, y2 ) P (y2 , z2 ))
(wH(P (z1 , w) P (z2 , w)))]. And is this true?
Exercise 2.M
Given the interpretation I14 :
D N
A(x, y, z) x+y =z
M (x, y, z) xy =z
Formalize the following:
(i) x < y.
(ii) x | y (x divides y).
(iii) x is a prime number.
19
2.5 Important concepts
follows from
f |= g, 18
for all
, 10
formula, 12
fractions
Q, 16
interpretation, 15
interpretation function, 15
model, 14
natural numbers
N, 16
predicate, 11
predicate logic, 12
predicate logic with equality, 19
quality, 11
rational numbers
Q, 16
relation, 11
relation symbol, 12
subject, 11
true
20
Chapter 3
Languages
21
Chapter 4
Automata
22
Chapter 5
Discrete mathematics
23
Chapter 6
Modal logic
24
Bibliography
[1] W. Gielen. Discrete wiskunde voor informatici. Katholieke Universiteit Nijmegen - Sub-
faculteit Wiskunde 2002.
[2] M. Huth and M. Ryan. Logic in Computer Science. Cambridge University Press, 2004.
ISBN 0-521-54310-X.
[3] J.F.A.K. van Benthem, H.P. van Ditmarsch, J.S. Lodder, J. Ketting, and W.P.M. Meyer-
Viol. Logica voor informatici. Pearson Addison-Wesley, Nederland, 2003. ISBN 90-430-
0722-6 (dit boek wordt ook gebruikt in het college Beweren en Bewijzen).
25
Index
(M, I) |= f , 17 Coq, 7
0, 5
1, 5 De Morgan, 7
=, 19 dictionary, 2, 10, 18
N, 16 different, 19
Q, 16 domain, 11, 12, 14
, 4, 10
element of
, 10
, 10
, 10
equality relation, 19
, 10
equals
|= f , 6, 18
=, 19
f , 3
exactly
f g, 7
exactly one, 19
f g, 3
exactly one, 19
f g, 3
exists
f g, 3
, 10
f g, 3
f |= g, 8, 18 false, 5
0, 5
algorithm, 17
finite assignment, 6
alphabet, 4
follows from
and
f |= g, 18
f g, 3
for all
arity, 12
, 10
assignment, 6
formula, 12
finite assignment, 6
fractions
associativity, 4
Q, 16
right associative, 4, 7
at least grammar, 13
at least two, 19 context-free, 4
at least two, 19
at most if and only if
at most three, 19 f g, 3
at most three, 19 iff, 3
atom, 12 if, then
atom proposition, 6 f g, 3
atomic formula, 12 iff, 3
atomic proposition, 36 individual constant
constant, 19
bracket, 10 interpretation, 10, 14, 15, 18
interpretation function, 15
connective, 35
is equal to, 19
constant, 11, 12, 19
context-free, 4 logical consequence, 8
26
f |= g, 8 true in a model, 6
logical entailment, 8 true in a model under a given interpreta-
logically equivalent, 7 tion, 15
f g, 7 truth, 6
logically true, 6, 18 true in a model under an interpretation
|= f , 6 (M, I) |= f , 17
tautology, 6 truth table, 5, 6
logically valid, 6, 18 truth tables, 7
valid, 6
union, 4
model, 5, 6, 14 , 4, 10
or word, 4
f g, 3
parenthesis, 4
predicate, 11, 14
predicate logic, 12, 13, 18, 19
predicate logic with equality, 19
predicate logic with equality, 19
priority, 4
proposition, 4, 68
propositional calculus, 2
propositional letter, 3
propositional logic, 2, 3, 6, 12, 13
propositional variable, 3
quality, 11
quantifier, 12
rational numbers
Q, 16
recipe, 17
relation, 11, 14
relation symbol, 12
relation symbol, 12
right associative, 4, 7
square parenthesis, 10
subject, 11
tautology, 6
true, 5, 14, 18
1, 5
logically true, 18
|= f , 18
true in a model, 6
true in a model under a given interpre-
tation, 15
27