HWK 2
HWK 2
ERIC PETERSON*
1.2. Problem 1.5.30. Rewrite each of these statements so that negations appear only within predicates.
(1) ¬∃y∃xP (x, y):
¬∃y∃xP (x, y) ≡ ∀y¬∃xP (x, y)
≡ ∀y∃y¬P (x, y).
(2) ¬∀x∃yP (x, y):
¬∀x∃yP (x, y) ≡ ∃x¬∃yP (x, y)
≡ ∃x∀y¬P (x, y).
(3) ¬∃y(Q(y) ∧ ∀x¬R(x, y)):
¬∃y(Q(y) ∧ ∀x¬R(x, y)) ≡ ∀y¬(Q(y) ∧ ∀x¬R(x, y))
≡ ∀y(¬Q(y) ∨ ¬∀x¬R(x, y))
≡ ∀y(¬Q(y) ∨ ∃xR(x, y)).
1.3. Problem 1.5.34. Find a common domain for the variables x, y, and z for which the statement
∀x∀y((x ̸= y) → ∀z((z = x) ∨ (z = y)))
is true and another domain for which it is false.
Solution: On the domain D = {a, b} (or D = {a}, or D = ∅), this statement is true. To prove the
implication, we check that the predicate is true in the case that the antecedent is true. If x and y are distinct
elements of the domain, as indicated by the antecedent, then one must be a and the other b. Then, any third
choice of element z of the domain must also either be equal to a or b, and hence to one of x and y, proving the
claim. However, on a domain with more than two elements the claim is false. Set D = {a, b, c}. We exhibit
a counterexample by setting x = a, y = b, z = c. It is true that x ̸= y, but false that (z = x) ∨ (z = y), and
hence the implication is false.
1.4. Problem 1.5.40. Find a counterexample, if possible, to these universally quantified statements, where
the domain for all variables consists of all integers.
(1) ∀x∃y(x = 1/y): This is not true when quantified over the integers. Setting x = 2, there is no integer
“1/2” with the property xy = 1. (For the curious, this follows from order properties: since 1 is the
smallest positive integer, multiplication by any y with |y| > 1 has the property that |x| < |xy|. We
can check that y = −1, y = 0, and y = 1 each do not have the property that xy = 1, and by this
other fact, neither can any y with |y| > 1, since then 2 = |x| < |xy|, whereas |1| = 1.)
(2) ∀x∃y(y 2 − x < 100): This is also false. Set x = −100; then as y 2 is a nonnegative value, y 2 − x =
y 2 + 100 will always be at least 100, hence never less than 100.
(3) ∀x∀y(x2 ̸= y 3 ): This, too, is false. For instance, set x = y = 1; then x2 = 1 = y 3 . (More generally,
n6 for any n has both a square- and cube-root, giving candidates for x and y respectively.)
1.5. Problem 1.5.52. Express the quantification ∃!xP (x), introduced in Section 1.4, using universal quan-
tifications, existential quantifications, and logical operators.
(∃!xP (x)) ≡ ((∃xP (x)) ∧ (∀x∀y((P (x) ∧ P (y)) → (x = y)).
u→p
q →u∧t u∧t→p
q →p∧t p∧t→r∨s
q →r∨s ¬s
∴ q → r.
2.2. Problem 1.6.24. Identify the error or errors in this argument that supposedly shows that if ∀x(P (x) ∨
Q(x)) is true that ∀xP (x) ∨ ∀xQ(x) is true:
1. ∀x(P (x) ∨ Q(x)) Premise
2. P (c) ∨ Q(c) Universal instantiation from 1
3. P (c) Simplification from 2
4. ∀xP (x) Universal generalization from 3
5. Q(c) Simplification from 2
6. ∀xQ(x) Universal generalization from 5
7. ∀x(P (x) ∨ ∀xQ(x)) Conjuncation from 4 and 6.
Solution: There are three errors. First, simplification is the rule (p ∧ q) → p; the rule does not apply to
∨. This causes an error on lines 3 and 5. Finally, the conjunction rule is misapplied on the final line — look
closely at the placement of the parentheses.
2.3. Problem 1.6.28. Use rules of inference to show that if ∀x(P (x)∨Q(x)) and ∀x((¬P (x)∧Q(x)) → R(x))
are true, then ∀x(¬R(x) → P (x)) is also true, where the domains of all quantifiers are the same.
2.4. Problem 1.6.34. The Logic Problem, taken from WFF’N PROOF, The Game of Logic, has these two
assumptions:
(1) “Logic is not difficult or not many students like logic.”
(2) “If mathematics is easy, then logic is not difficult.”
We will denote by p the proposition “logic is not difficult”, by q the proposition “not many students like
logic”, and by r the proposition “mathematics is easy”. The premises then take the form r → p and p ∨ q
(which is equivalent to ¬p → q). Determine whether each of the following are valid conclusions of these
assumptions:
(1) “That mathematics is not easy, if many students like logic.” This is equivalent to ¬q → ¬r. This is
a valid syllogysm of ¬p → ¬r and ¬q → ¬p, using the contrapositives of the premises.
(2) “That not many students like logic, if mathematics is not easy.” This is equivalent to ¬r → q, which
is not a valid syllogysm of the above premises.
(3) “That mathematics is not easy or logic is difficult.” This is equivalent to ¬r ∨ ¬p ≡ r → ¬p. This
is the negation of one of the above premises and not a valid syllogysm of them.
(4) “That logic is not difficult or mathematics is not easy.” This is equivalent to p ∨ ¬r ≡ r → p, which
is one of the above premises.
(5) “That if not many students like logic, then either mathematics is not easy or logic is not difficult.”
This is equivalent to q → (¬r ∨ p), which is valid. Namely, the conclusion ¬r ∨ p can be interpreted
as the implication r → p, which is one of our hypotheses. Conjunction says that q ∧ (r → p) follows
from r → p alone.
3
3. 1.7: Introduction to Proofs
3.1. Problem 1.7.8. Prove that if n is a perfect square, then n + 2 is not a perfect square. Proof: Suppose
that n = x2 and n + 2 = y 2 , with both x and y nonnegative naturals. We know a formula for the difference
of squares:
(n + 2) − (n) = x2 − y 2
2 = (x − y)(x + y).
Since 2 is a prime number, one of these factors must be 2 and the other must be 1. Since both x and y are
assumed nonnegative, it must be that x + y > x − y, so x − y = 1 and x + y = 2. This system does not
have a solution over the naturals: the first equation begets the substitution x = 1 + y, which transforms the
second into x + y = (1 + y) + y = 1 + 2y = 2. Whenever y is an integer, this middle expression is an odd
number, and hence can never be equal to 2. So, we must have been wrong all along: there can be no pair of
perfect squares whose difference is two.
Another argument (which is also a proof by contradiction) proceeds by noting that if n = x2 and n+2 = y 2 ,
with both x and y nonnegative naturals, then n + 2 ≥ (x + 1)2 , because any perfect square greater than x2
must be at least (x + 1)2 . This gives
n + 2 ≥ (x + 1)2 = x2 + 2x + 1 = n + 2x + 1,
and hence 2x + 1 ≤ 2. Because x is a natural number, this is only possible if x = 0 and hence n = 0, but in
this case we have 2 = n + 2 = y 2 , which is impossible. So, again we must have been wrong all along: there
can be no pair of perfect squares whose difference is two.
3.2. Problem 1.7.16. Prove that if m and n are integers and mn is even, then m is even or n is even.
Proof: Suppose that m and n are both odd; we will work to show that mn is also odd. Suppose first that
it’s not. In that case, 2 divides it, and because 2 is a prime number, it must divide at least one of the two
factors m and n. However, these were assumed to be odd (i.e., indivisible by 2), and so this cannot be the
case. Hence, mn must be odd. (Note: you don’t need to go through contradiction to prove this statement,
but it does make it shorter. You’re encouraged to write a proof that doesn’t use contradiction to see that it
can be done.)
3.3. Problem 1.7.30. Show that these three statements are equivalent, where a and b are real numbers:
(1) a is less than b.
(2) The average of a and b is greater than a.
(3) The average of a and b is less than b.
Proof: We will show that 1 and 2 are equivalent, then that 1 and 3 are equivalent. Consider the following
sequence of inequalities:
a<b (Initial assumption.)
a+a<a+b (Add a to both sides.)
a+a a+b
< (Divide both sides by 2.)
2 2
a+b
a< . (Simplify the left.)
2
This shows that 1 implies 2. To show that 2 implies 1, read the same proof backwards — all the steps
involved are reversible. The equivalence between 1 and 3 can be shown be a similar sequence:
a<b (Initial assumption.)
a+b<b+b (Add b to both sides.)
a+b b+b
< (Divide both sides by 2.)
2 2
a+b
< b. (Simplify the right.)
2
4
3.4. Problem 1.7.36. Show that the propositions p1 , p2 , p3 , and p4 can be shown to be equivalent by
showing that p1 ↔ p4 , p2 ↔ p3 , and p1 ↔ p3 .
Proof: Biimplications have the property that a ↔ b and b ↔ c imply a ↔ c, and that a ↔ b is equivalent
to b ↔ a. To show that all these propositions are equivalent, we need to check that pi ↔ pj for each choice
of i < j.
• p1 ↔ p2 : This follows from p1 ↔ p3 , the last premise, and p3 ↔ p2 , the second premise.
• p1 ↔ p3 : This is the third premise.
• p1 ↔ p4 : This is the first premise.
• p2 ↔ p3 : This is the second premise.
• p2 ↔ p4 : This follows from joining p2 ↔ p1 (see earlier in this list) with the first premise p1 ↔ p4 to
form p2 ↔ p4 .
• p3 ↔ p4 : This follows from joining the last premise p3 ↔ p1 with the first premise p1 ↔ p4 to form
p3 ↔ p4 .
(Note: In general, draw a picture with a dot representing each proposition pi and a line connecting the dot
pi to the dot pj for each premise pi ↔ pj . If the picture cannot be separated into two connected parts, then
all the propositions are equivalent.)
4.2. Problem 1.8.10. Prove that either 2 · 10500 + 15 or 2 · 10500 + 16 is not a perfect square. Is your proof
constructive or nonconstructive? Proof: We can re-use the proof given earlier in these solutions. Assume
that they are both perfect squares: then the first can be expressed as x2 and the second as y 2 for distinct
positive integers x and y. We then consider their difference:
Since the only positive factors of 1 are 1 itself, it must simultaneously be the case that y−x = 1 and y+x = 1.
This is not possible, and hence both numbers cannot be perfect squares. This proof is nonconstructive — a
constructive proof would produce a factorization of one of the numbers and check that it, indeed, is not a
perfect square. Mathematica helpfully provided such a factorization of 2 · 10500 + 16:
Since not all the factors appear an even number of times (33 , for instance), this number is not a perfect
square.
5
4.3. Problem 1.8.26. Suppose that five ones and four zeroes are arranged around a circle. Between any
two equal bits you insert a 0 and and between any two unequal bits you insert a 1 to produce nine new bits.
Then you erase the nine original bits. Show that when you iterate this procedure, you can never get nine
zeroes. Proof: To ease typesetting, I’ll write strings of numbers rather than loops of them. The idea is to
construct what the previous stage must have been, given the result of such an iteration. Suppose that we’ve
ended up the string 000000000. In this case, the previous string must have all consisted of identical numbers,
i.e., either 000000000 or 111111111. We are already in the process of analyzing the first case, so we will
turn our attention to the second. In this case, the string preceding 111111111 must have consisted entirely
of alternating digits. In particular, there must have been some digit i which was a 1 — we will write this
as our first digit, which is allowed because we can always rotate the ring of numbers (and hence the digits
in our string). The string must then look like: 101010101 — but, up to rotation, this is the same string
as 010101011. Since the last two digits are identical, it’s not possible to form a string with all alternating
digits to produce 111111111. Hence, the only way to produce the string 000000000 is to begin with it or
with 111111111 — there can be no further history. Since we begin with a nonzero number of both 0 and 1
digits, we cannot be in this case, and hence cannot reach 000000000.