Professional Documents
Culture Documents
Solutions to tutorial 8
6 October 2023
(a) Define the symbol < so that is has its usual intuitive meaning: x < y means that
x is strictly less than y. In other words, write a formula φ(x, y) containing two
free variables, x and y, such that, from the intuitive point of view, φ(x, y) is true
of natural numbers n and m if, and only if, n < m. Once this is done, you may
assume, for the rest of the questions, that you have < available as part of the
signature.
x < y := ∃z ¬(z = 0) ∧ (x + z = y) .
(b) Translate into the language of arithmetic the following sentences (you may now
freely use the symbol <):
i. There is no largest natural number.
∀x ∃y (x < y).
ii. For every natural number n, there exists no natural number bigger than n
and smaller than n + 1.
iii. If a natural number is bigger than 0, but less than 3, then it is either 1 or 2.
∀x (0 < x ∧ x < s(s(s(0)))) → (x = s(0) ∨ x = s(s(0))) .
(c) Define the unary predicate letter Prime so that, intuitively, Prime(x) is true if,
and only if, x stands for a prime number. Once this is done, you may assume, for
the rest of the questions, that you have Prime available as part of the signature.
Prime(x) := ∀y ∀z (y × z = x) → (y = s(0) ∨ z = s(0)) ∧ ¬(x = s(0)).
1
(d) Translate into the language of arithmetic the following sentences (you may now
freely use the symbol Prime):
i. There are infinitely many prime numbers.
∀x Prime(x) → ∃y (x < y ∧ Prime(y)) .
ii. Every even number greater than two can be expressed as the sum of two
primes (this is the Goldbach Conjecture).
Even(x) := ∃y y × s(s(0)) = x ;
∀x (Even(x) ∧ s(s(0)) < x)→∃y∃z (Prime(y) ∧ Prime(z) ∧ y + z = x) .
iii. There are infinitely many pairs (n, m) of natural numbers such that m = n + 2
and both n and m are prime (this is the Twin Prime Conjecture).
2. Consider again the language of arithmetic from Question 1 and consider the formula
φ = ∀x ∃y (s(x) < y) in this language.
(a) Find a model M1 such that M |= φ.
M2 = ({0, 1}, I), where I(s) is the following function on {0, 1}: I(s)(0) = 1 and I(s)(1) = 1.
(b) Find a model M2 such that M |= ¬φ.
(c) Write a formula that is true in a model if, and only if, the domain of the model
consists of exactly two elements.
3. Prove, using models, that the following formulas are validities of first-order logic:
(a) ∀x (P (x) ∧ Q(x)) → (∀x P (x) ∧ ∀x Q(x));
Suppose otherwise. Then there exists a model M = (D, I) such that M ̸|= ∀x (P (x)∧Q(x)) →
(∀x P (x) ∧ ∀x Q(x)). Then,
(1) M |= ∀x (P (x) ∧ Q(x));
(2) M |̸ = ∀x P (x) ∧ ∀x Q(x).
By (2), either M ̸|= ∀x P (x) or M ̸|= ∀x Q(x). We consider two cases.
Case M ̸|= ∀x P (x): In this case, there exists a ∈ D such that M ̸|= P (a). By (1),
M |= P (b) ∧ Q(b), for every b ∈ D; in particular, M |= P (a) ∧ Q(a). But then M |= P (a), in
contradiction with M ̸|= P (a).
Case M ̸|= ∀x Q(x): In this case, there exists a ∈ D such that M ̸|= Q(a). By (1),
M |= P (b) ∧ Q(b), for every b ∈ D; in particular, M |= P (a) ∧ Q(a). But then M |= Q(a), in
contradiction with M ̸|= Q(a).
2
(b) ∃x (P (x) ∨ Q(x)) → (∃x P (x) ∨ ∃x Q(x)).
Suppose otherwise. Then there exists a model M = (D, I) such that M ̸|= ∃x (P (x)∨Q(x)) →
(∃x P (x) ∨ ∃x Q(x)). Then,
(1) M |= ∃x (P (x) ∨ Q(x));
(2) M |̸ = ∃x P (x) ∨ ∃x Q(x).
By (2), M ̸|= ∃x P (x) and M ̸|= ∃x Q(x). By (1), there exists a ∈ D such that M |= P (a) ∨ Q(a).
Hence, M |= P (a) or M |= Q(a). We consider two cases.
Case M |= P (a): Since M ̸|= ∃x P (x), it follows that M ̸|= P (b) whenever b ∈ D. In particu-
lar, M ̸|= P (a), in contradiction with M |= P (a).
Case M |= Q(a): Since M ̸|= ∃x Q(x), it follows that M ̸|= Q(b) whenever b ∈ D. In particu-
lar, M ̸|= Q(a), in contradiction with M |= Q(a).
4. Prove, using models, that the following formulas are not validities of first-order logic:
(a) ∀x (P (x) ∨ Q(x)) → (∀x P (x) ∨ ∀x Q(x));
Consider the following model: M = (D, I), where D = {a, b}, I(P ) = {⟨a⟩}, and I(Q) =
{⟨b⟩}. Then M |= P (a) and M |= Q(b). Since D = {a, b}, it follows that M |= ∀x (P (x) ∨ Q(x)).
On the other hand, since M ̸|= P (b), surely M ̸|= ∀x P (x), and since M ̸|= Q(a), surely M ̸|=
∀x Q(x). Hence, M ̸|= ∀x P (x)∨∀x Q(x). Thus, M ̸|= ∀x (P (x)∨Q(x)) → (∀x P (x)∨∀x Q(x)).
This means that ∀x (P (x) ∨ Q(x)) → (∀x P (x) ∨ ∀x Q(x)) is not valid.
5. Consider the following signature of a language meant for describing a fixed compu-
tation by a fixed Turing machine M (the presumed domain of discourse is natural
numbers, which shall be used to number the steps of the computation and the cells
of M ’s tape; it shall be assumed that the tape of M extends infinitely to the right,
but has the leftmost cell, numbered 0; we shall need a special symbol, the end-of-tape
marker, which shall always be written in the leftmost cell, so that M knows not to
move left of the leftmost cell; the states of M are assumed to be q0 , q1 , etc., with q0
being the starting state, q1 the accepting state, and q2 the rejecting state; the symbols
of M ’s alphabet are assumed to be s0 , s1 , etc., with s0 being the blank and s1 being
the end-of-tape marker):
the constant symbol 0;
the unary function symbol s (‘successor’ on natural numbers);
the binary predicate letter x < y (‘number x is strictly less than number y’);
the binary predicate letter C(x, y) (‘at step x, the machine M scans cell tape
number y’);
the unary predicate letter Qk (x) (‘at step x, the machine M is in state qk ’);
3
the binary predicate letter Sk (x, y) (‘at step x, the cell y contains symbol sk ’).
(a) Write a formula describing the initial configuration of M on the empty word given
as input.
φε = C(0, 0) ∧ Q0 (0) ∧ S1 (0, 0) ∧ ∀x (x ̸= 0 → S0 (0, x)).
(b) Write a formula saying that, at every step of the computation, M scans exactly
one cell of its tape.
φ1 = ∀x ∃y C(x, y) ∧ ∀z (C(x, z) → z = y) .
(c) Write a formula saying that, at every step of the computation, M is in a unique
state.
|Q−1|
_ ^
φ2 = ∀x (Qk (x) ∧ ¬Qj (x)).
k=0 j̸=k
(d) Write a formula saying that, at every step of the computation, each cell of the
tape contains exactly one symbol.
|Γ−1|
_ ^
φ3 = ∀x∀y (Sk (x, y) ∧ ¬Sj (x, y)).
k=0 j̸=k