Practice Prob5 With Sol
Practice Prob5 With Sol
• You must solve all problems to get the maximum benefit from practice problems.
• You must not submit your solutions to these problems. These are not going to be graded.
1. Naturally deduced
Prove that the following sequents are valid. In other words, show the following syntactic
entailments using natural deduction proof rules for propositional logic:
(a) ⊢ ((a ∨ (¬a ∧ b) → (a ∨ b))
Solution:
1. (a ∨ (¬a ∧ b)) assumption
2. a assumption
3. a∨b ∨i 2
4. ¬a ∧ b assumption
5. b ∧e 4
6. a∨b ∨i 5
7. a∨b ∨e 1, 2-3, 4-6
8. (a ∨ (¬a ∧ b)) → (a ∨ b) →i 1-7
(d) a → b, b → c, c → ¬a ⊢ ¬a
Solution:
1. a→b (Premise)
2. b→c (Premise)
3. c → ¬a (Premise)
4. a assume
5. b →e 4,1
6. c →e 5,2
7. ¬a →e 6,3
8. ⊥ ¬e 4, 7
9. ¬a ¬i 4-8
(b) Identify the syntactically correct FOL formula(s), also give reason(s) why each of
them is correct/incorrect.
i. f1 (x)
ii. ∀xf1 (x)
iii. ∃yf2 (x, c) > c
iv. ∀xf2 (x, c) > 0
v. ∃x>c f1 (x) > y
ii. Correct.
iii. Correct. Note that a variable does not have to be used for it to be quantified
over.
v. Incorrect. The quantifiers are over variables and variables only, that is, you
cannot use formulae or non-variable terms. Here x > c is a FOL formula.
(c) Express the FOL formula in (b)-v a syntactically correct form, ensuring that it has
the same ‘meaning’.
Solution:
∃x((x > c) ∧ (f1 (x) > y))
The above statement means that ‘there exists x such that f1 (x) > y and x > c’.
Which is same as saying ‘there exists x > c such that f1 (x) > y’.
(d) Express the following syntactically incorrect FOL formula in a syntactically correct
form, ensuring that it has the same ‘meaning’.
∀x>c f1 (x) > y
Solution: The intent here was to say that ”for all x > c, f1 (x) > y holds”. How-
ever, we can’t write x > c along with a quantifier in first-order logic. Remember,
the syntax of quantifiers allows us to only write ∀x (or ∃x) for a variable x. Hence,
we have to express our intent as follows:
Solution:
i. Free variable: y.
free f1 (x) > c = {x}, free f1 (y) > f1 (x) = {x,
y}.
Therefore, free (f1 (x) > c) → (f1 (y) > f1 (x)) = {x, y}.
And finally, free ∀x((f1 (x) > c) → (f1 (y) > f1 (x))) = {x, y} \ {x} = {y}.
Note that since the quantifier on x applies to all the occurrences of x, x is a
bound variable. y does not any quantifier, so, it is free.
Solution: We can use the fact that for natural numbers, a set is finite if and only if it
has an upper bound. So a predicate is true for infinitely numbers can be thought of as:
for all numbers, there’s is a bigger number for which the predicate is true. Similarly for
the second part, we can think of the statement as: there is a bound above which for all
(b) There must be a bound x, above which for every number y, P (y) is true i.e if a
number y is bigger than the bound, P (y) must be true.
It is true that P satisfying (b) implies P satisfies (a). If P (x) is false for finitely many
x, it has to be true for infinitely many x, as both the sets where P (x) is true and P (x)
is false put together constitute the set of natural numbers which is infinite.
(a) implies (b) is false, just because there are infinitely many x for which P (x) is true,
doesn’t mean there are only finitely many x for which P (x) is false. For example there
are infinitely many even numbers, but there are also infinitely many numbers which are
not even.
Solution:
∧y1 ̸= y3 ∧ y1 ̸= y4 ∧ y2 ̸= y3 ∧ y2 ̸= y4 ∧ y3 ̸= y4 ∧
Teaches(z, y1 ) ∧ Teaches(z, y2 ) ∧ Teaches(z, y3 ) ∧ Teaches(z, y4 )))
6. There is at least one student and at least one professor, such that the
student has not been taught by the professor.
∃x ∃z S(x) ∧ P (z) ∧ ∀y (Teaches(z, y) → ¬Enrolled(x, y))
Solution: First, we will prove a useful fact: If a contradiction can be derived from
a set of sentences, then any formula can be derived from that set (Bertrand Russell
famously used a result similar to this to prove he was the Pope, when questioned by a
student to derive the statement ”I am the Pope”, from the premise ”1=0”).
Statement Justification
F ⊢ (F ∧ ¬F ) Premise
F ⊢F ∧-Elimination
F ⊢ (F ∨ G) ∨-Introduction
F ⊢ (¬F →− G) →
− -Definition
F ⊢ (¬F ) ∧-Elimination
F ⊢G ∨-Modus Ponens
Solution: For the conjunction of the first two sentences, simply take the structure
with Z as the Universe and E as the set of all ordered pairs of adjacent integers. For
the conjunction of the second two sentences, let the relation E be empty on some non-
empty Universe, thus not satisfying reflexivity. For the conjunction of sentences 1 and
3, consider E as the ≤ relation on the real numbers.
Solution:
(a) The condition enforced by this sentence is that there is an edge between every pair
of distinct nodes, and there is no self-loop. Hence, the sentence evaluates to true
over a complete graph over the graph nodes.
(c) The condition is that there should be atleast some node which is not connected to
any other node (including itself).