Predicate Logic Solution 1
Predicate Logic Solution 1
Predicate Logic Solution 1
Exercises on slide 20
Exercise 1
Show [p ∧ (p → q)] → q is a tautology.
Solution
Let us make a truth table for this proposition:
p q p→q p ∧ (p → q) [p ∧ (p → q)] → q
T T T T T
T F F F T
F T T F T
F F T F T
All truth values of [p ∧ (p → q)] → q in the truth table are true no matter what the truth values
of its simple components. So this proposition is a tautology by definition.
Exercise 2
Show (p → q) ↔ (q̄ → p̄) is a tautology.
Solution
Let us make a truth table for this proposition:
p q q̄ p̄ p → q q̄ → p̄ (p → q) ↔ (q̄ → p̄)
T T F F T T T
T F T F F F T
F T F T T T T
F F T T T T T
All truth values of (p → q) ↔ (q̄ → p̄) in the truth table are true no matter what the truth values
of its simple components. So this proposition is a tautology by definition.
1
Exercise 3
Show [q̄ ∧ (p → q)] → p̄ is a tautology.
Solution
Let us make a truth table for this proposition:
p q q̄ p̄ p → q q̄ ∧ (p → q) [q̄ ∧ (p → q)] → p̄
T T F F T F T
T F T F F F T
F T F T T F T
F F T T T T T
All truth values of [q̄ ∧ (p → q)] → p̄ in the truth table are true no matter what the truth values
of its simple components. So this proposition is a tautology by definition.
Exercise 4
Why can no simple proposition be a tautology?
Solution
It is because a simple proposition is a declarative statement which is either true or false by
definition, so it is not necessarily always true. For example a simple proposition Sun is shining
is not always true.
Exercise on slide 25
What about the correctness of the argument (p → q) ∧ (r → p̄) ∧ r ` q̄?
Solution
Let us try to use inference rules:
1. r (premise)
2. r → p̄ (premise)
3. p̄ (from 1 and 2 using Modus Ponens)
4. ?
Further application of the inference rules will not prove the correctness of the argument. So let
us make a truth table for ((p → q) ∧ (r → p̄) ∧ r) → q̄
2
As it follows from the truth table, ((p → q) ∧ (r → p̄) ∧ r) → q̄ is not a tautology, so the
argument (p → q) ∧ (r → p̄) ∧ r ` q̄ is not valid. In particular a counter example for it is when
p, q and r are false, true and true correspondently.
Exercises on slide 34
Exercise 1
Translate the following into symbolic form:
(i) Everybody likes him
(ii) Somebody cried out for help and called the police
(iii) Nobody can ignore her
Solution
(i) (∀x)L(x), where L(x) - x likes him.
(ii) (∃x)[H(x) ∧ P (x)], where H(x) - x cried out for help and P (x) - x called the police
(iii) ∼ (∃x)I(x) or (∀x)[∼ I(x)], where I(x) - x can ignore her
UoD for these examples are all human beings.
Exercise 2
Find an UoD and two unary predicates P (x) and Q(x) such that (∀x)[P (x) → Q(x)].
Solution
UoB - all human beings.
P (x) - x is a student and Q(x) - x is intelligent. Whenever a human being is a student, he is
intelligent.
Exercise 3
Find an UoD and two unary predicates P (x) and Q(x) such that (∃x)[P (x) ∧ Q(x)] is false but
(∃x)P (x) ∧ (∃x)Q(x) is true.
3
c) UoB - all integers.
P (x) - x > 5 and Q(x) - x < 3.
Exercise 4
Show that (∀x)P (x) ` (∃x)P (x)
Solution
1. (∀x)P (x) (premise)
2. P (a) for some a from UoD (from 1 using Universal Specification)
3. (∃x)P (x) (from 2 using Existential Generalisation)
Exercise 5
Given the premises (∃x)P (x) and (∀x)[P (x) → Q(x)] give a series of steps concluding that
(∃x)Q(x)
Solution
1. (∃x)P (x) (premise)
2. P (a) for some a from UoD (from 1 using Existential Specification)
3. (∀x)[P (x) → Q(x)] (premise)
4. P (a) → Q(a) for some a from UoD (from 3 using Universal Specification)
5. Q(a) for some a from UoD (from 2 and 4 using Modus Ponens)
6. (∃x)Q(x) (from 5 using Existential Generalisation).
Exercise on slide 37
Show ∼ (∀x)(∃y)P (x, y) ≡ (∃x)(∀y)[∼ P (x, y)] using the logical equivalence above and using
the fact that logically equivalent propositions can be interchanged in a compound proposition
Solution
∼ (∀x)(∃y)P (x, y) ≡ (∃x)(∀y)[∼ P (x, y)] if and only if ∼ (∀x)(∃y)P (x, y) ↔ (∃x)(∀y)[∼
P (x, y)] is a tautology. And ∼ (∀x)(∃y)P (x, y) ↔ (∃x)(∀y)[∼ P (x, y)] is a tautology if
and only if ∼ (∀x)(∃y)P (x, y) → (∃x)(∀y)[∼ P (x, y)] and (∃x)(∀y)[∼ P (x, y)] → [∼
(∀x)(∃y)P (x, y)] are tautologies.
We will use the facts that ∼ (∀x)F (x) ≡ (∃x)[∼ F (x)] and ∼ (∃x)F (x) ≡ (∀x)[∼ F (x)] for
any F (x).
Let us show that whenever ∼ (∀x)(∃y)P (x, y) is true then (∃x)(∀y)[∼ P (x, y)] is true.
4
Let ∼ (∀x)(∃y)P (x, y) is true, and let Q(x) = (∃y)P (x, y) then ∼ (∀x)Q(x) is true and
∼ (∀x)Q(x) ≡ ∃x[∼ Q(x)], so ∃x[∼ Q(x)] is true.
Using Existential Specification if ∃x[∼ Q(x)] is true, then ∼ Q(a) is true for some a in UoD.
But ∼ Q(a) =∼ (∃y)P (a, y) and ∼ (∃y)P (a, y) ≡ (∀y)[∼ P (a, y)], so (∀y)[∼ P (a, y)] is true
for some a in UoD. Using Existential Generalisation (∃x)(∀y)[∼ P (x, y)] is true.
And let us show that whenever (∃x)(∀y)[∼ P (x, y)] is true then ∼ (∀x)(∃y)P (x, y) is true.
Let (∃x)(∀y)[∼ P (x, y)] is true, and let Q(x) = (∀y)[∼ P (x, y)], so (∃x)Q(x) is true. Then
using Existential Specification Q(a) is true for some a in UoD.
Q(a) = (∀y)[∼ P (a, y)] and (∀y)[∼ P (a, y)] ≡∼ (∃y)P (a, y), so ∼ (∃y)P (a, y) is true for
some a in UoD.
Let L(a) = (∃y)P (a, y), then ∼ L(a) is true for some a in UoD. Using Existential Generalisa-
tion (∃x)[∼ L(x)] is true. But (∃x)[∼ L(x)] ≡∼ (∀x)L(x), and so ∼ (∀x)L(x) is true. Hence
∼ (∀x)(∃y)[P (x, y)] is true.
By this we have proved that ∼ (∀x)(∃y)P (x, y) ↔ (∃x)(∀y)[∼ P (x, y)] is a tautology. There-
fore ∼ (∀x)(∃y)P (x, y) ≡ (∃x)(∀y)[∼ P (x, y)].
5
Solution
(v)
p q r p∨q p∨q r∨p (p ∨ q) ↔ (r ∨ p)
T T T T F T F
T T F T F T F
T F T T F T F
T F F T F T F
F T T T F T F
F T F T F F T
F F T F T T T
F F F F T F F
Solution
1 2 3 4
p q p∨q p→q p̄ ∨ q p∧q p → (p ∨ q) (p → q) ∧ (p̄ ∨ q) (p ∨ q) ↔ (q ∨ p) (p ∧ q) → p
T T T T T T T T T T
T F T F F F T F T T
F T T T T F T T T T
F F F T T F T T T T
tautology neither tautology tautology
6
5 7 6
p q p∧q p∨q (p ∧ q) ∧ (p ∨ q) p̄ ∧ q p ∨ q̄ (p̄ ∧ q) ∧ (p ∨ q̄) p→q (p → q) → (p ∧ q)
T T T F F F T F T T
T F F F F F T F F T
F T F F F T F F T F
F F F T F F T F T F
contradiction contradiction neither
8
p q r p → q̄ r̄ → p (p → q̄) ∨ (r̄ → p)
T T T F T T
T T F F T T
T F T T T T
T F F T T T
F T T T T T
F T F T F T
F F T T T T
F F F T F T
tautology
Solution
To prove task 1,2 and 3 we must show that (p → q) ↔ (p̄ ∨ q), (p ∧ q) ↔ (p → q̄) and
(p∨q) ↔ (p∨q̄) are tautologies.
1 2
p q p→q p̄ ∨ q (p → q) ↔ (p̄ ∨ q) p ∧ q p → q̄ p → q̄ (p ∧ q) ↔ (p → q̄)
T T T T T T F T T
T F F F T F T F T
F T T T T F T F T
F F T T T F T F T
3
p q p∨q p∨q p∨q̄ p∨q ↔ (p∨q̄)
T T F T T T
T F T F F T
F T T F F T
F F F T T T
As it follows from the truth tables above, (p → q) ↔ (p̄ ∨ q), (p ∧ q) ↔ (p → q̄) and (p∨q) ↔
(p∨q̄) are tautologies.
7
Exercise 1.4.3 page 27
Test the validity of the following arguments.
3. James is either a policeman or a footballer. If he is a policeman, then he has big feet. James
has not got big feet so he is a footballer.
Solution
Let p, q and r be:
p: James is a policeman
q: James is a footballer
r: James has big feet.
Then the argument will be: (p∨q) ∧ (p → r) ∧ r̄ ` q, where (p∨q), (p → r) and r̄ are premises
and q is a conclusion.
An alternative argument will be (p∨q) ∧ (p → r) ` (r̄ → q), where (p∨q) and (p → r)
are premises and (r̄ → q) is a conclusion. It is because ((a ∧ b) → c) ≡ (a → (b → c))
for any a, b and c. Let us check the validity of the first argument by building a truth table for
(p∨q) ∧ (p → r) ∧ r̄ → q
As it follows from the truth table above, (p∨q) ∧ (p → r) ∧ r̄ → q is a tautology, so the argument
(p∨q) ∧ (p → r) ∧ r̄ ` q is valid.
8
(v)(∀x)(∀y)[P (x, y) ∨ Q(x, y)]
(vi)(∃x)S(x)∧ ∼ (∀x)R(x)
(vii)(∃y)(∀x)[S(y) ∧ Q(x, y)]
(viii)(∀x)(∀y)[{R(x) ∧ S(y)} → Q(x, y)]
Solution
(i) T, ∃x, x = 9, that R(x) is true
(ii) F, counter example y = 10
(iii) T, for any real number always exists another real number that is less then it.
(iv) F, there is no such real number that is grater or equal to all other real numbers.
(v) T, any two real numbers x and y are either x > y or x ≤ y.
(vi) T, there exist real numbers that are grater than 9, and not all real numbers are equal to 9
(vii) F, there is no such real number that is grater or equal to all other real numbers, even if this
number is grater than 9.
(viii) T, this follows from the fact that (∀x)R(x) is false. Therefore (∀x)(∀y)[R(x) ∧ S(y)] is
also false, so (∀x)(∀y)[{R(x) ∧ S(y)} → Q(x, y)] is true.