quantifiers_post_lecture oct 1.
quantifiers_post_lecture oct 1.
1
based on How To Prove It, by D. Velleman, and Discrete Mathematics, by
K. H. Rosen
Quantifiers
Suppose P(x) stands for “x is prime”.
• Is P(x) true for every x?
• Is P(x) true for some x?
• For what x does it even make sense to talk about whether
P(x) is true?
2
Quantifiers
Universe of discourse: all possible values for a variable.
∀x, P(x)
• read “for all x, P(x)”
• called a universally quantified statement
• true, if P(x) is true for every element in the universe of
discourse
• false, otherwise
∃x, P(x)
• read “there exists x, P(x)”
• called an existentially quantified statement
• true, if P(x) is true for some (at least one) element in the
universe of discourse
• false, otherwise
Quantifiers
Exercise. What do the following statements mean? Which are
true?
• ∀x, x 2 ≥ 0, with universe R (set of all real numbers).
• ∀x, x 2 ≥ 1, with universe R.
• ∃x, x 2 − 2x + 1 = 0, with universe R.
• ∃x, x 2 − 2x − 3 = 0, with universe R.
• ∃x, x 2 − 2x + 3 = 0, with universe R.
• ∃x, M(x) ∧ B(x), with universe set of all people, M(x) stands
for “x is a man”, B(x) stands for “x has brown hair”.
• ∀x, M(x) → B(x), with universe, M, and B as above.
• ∀x, M(x) ∧ B(x), with universe, M, and B as above.
• ∀x, L(x, y ), with universe set of all people, and L(x, y ) stands
for “x likes y ”.
Quantifiers
Solution.
• ∀x, x 2 ≥ 0, with universe R (set of all real numbers).
• A square of any real number is bigger than or equal to 0. True.
• ∀x, x 2 ≥ 1, with universe R.
• A square of any real number is bigger than or equal to 1. False
(for example, 02 ≱ 1).
• ∃x, x 2 − 2x + 1 = 0, with universe R.
• There is (at least one) real number x, such that
x 2 − 2x + 1 = 0. True (value 1).
• ∃x, x 2 − 2x − 3 = 0, with universe R.
• There is (at least one) real number x, such that
x 2 − 2x − 3 = 0. True (values -3, 1).
• ∃x, x 2 − 2x + 3 = 0, with universe R.
• There is (at least one) real number x, such that
x 2 − 2x + 3 = 0. False.
Quantifiers
Solution.
• ∃x, M(x) ∧ B(x), with universe set of all people, M(x) stands
for “x is a man”, B(x) stands for “x has brown hair”.
• There is (at least one) man with brown hair. True.
• ∀x, M(x) → B(x), with universe, M, and B as above.
• All men have brown hair. False.
• ∀x, M(x) ∧ B(x), with universe, M, and B as above.
• All people are men with brown hair. False.
• ∀x, L(x, y ), with universe set of all people, and L(x, y ) stands
for “x likes y ”.
• Everyone likes y . Note that y is a free variable here.
Quantifiers
Exercise. Analyse the logical forms of the following statements.
• Someone didn’t do the homework.
• Everything in the store is either overpriced or poorly made.
• Nobody’s perfect.
• Susan likes everyone who dislikes Joe.
• A ⊆ B.
• (A ∩ B) ⊆ (B \ C ).
Quantifiers
Solution.
• Someone didn’t do the homework.
• H(x) is “x did the homework”, universe is all people.
• ∃x, ¬H(x)
• Everything in the store is either overpriced or poorly made.
• S(x) is “x is sold at the store”, O(x) is “x is overpriced”,
P(x) is “x is poorly made”, universe is all products.
• ∀x, S(x) → (O(x) ∨ P(x))
• Nobody’s perfect.
• P(x) is “x is perfect”, universe is all people.
• ¬∃x, P(x)
• Susan likes everyone who dislikes Joe.
• L(x, y ) is “x likes y ”, universe is all people.
• ∀x, ¬L(x, Joe) → L(Susan, x)
• A ⊆ B.
• ∀x, x ∈ A → x ∈ B, universe U.
• (A ∩ B) ⊆ (B \ C ).
• ∀x, (x ∈ A ∧ x ∈ B) → (x ∈ B ∧ x ∈
/ C ), universe U.
Quantifiers
Exercise. Analyse the logical forms of these statements.
• Everyone in the dorm has a roommate that they don’t like.
• Nobody likes a sore loser.
• Anyone who has a friend who has the measles will have to be
quarantined.
• If anyone in the dorm has a friend who has the measles, then
everyone in the dorm will have to be quarantined.
• If A ⊆ B, then A and C \ B are disjoint.
Quantifiers
Solution. Let universe of discourse be all people.
• Everyone in the dorm has a roommate that they don’t like.
• D(x) is “x lives in the dorm”, R(x, y ) is “x is a roommate of
y ”, L(x, y ) is “x likes y ”.
• ∀x, D(x) → ∃y , R(x, y ) ∧ ¬L(x, y )
• Nobody likes a sore loser.
• S(x) is “x is a sore loser”, L(x, y ) is “x likes y ”.
• ∀x∀y , S(x) → ¬L(y , x)
• Anyone who has a friend who has the measles will have to be
quarantined.
• F (x, y ) is “x is a friend of y ”, M(x) is “x has measles”, Q(x)
is “x must be quarantined”.
• ∀x, (∃y , F (x, y ) ∧ M(y )) → Q(x)
Quantifiers
Solution. Let universe of discourse be all people.
• If anyone in the dorm has a friend who has the measles, then
everyone in the dorm will have to be quarantined.
• (∃x∃y , D(x) ∧ F (x, y ) ∧ M(y )) → (∀x, D(x) → Q(x))
• If A ⊆ B, then A and C \ B are disjoint.
• (∀x, x ∈ A → x ∈ B) → (¬∃x, x ∈ A ∧ x ∈ C ∧ x ∈
/ B)
Quantifiers
Exercise. Let the universe of discourse be N, the set of all natural
numbers. What do these statements mean? Are they true or false?
• ∀x∃y , x < y
• ∃y ∀x, x < y
• ∃x∀y , x < y
• ∀y ∃x, x < y
• ∃x∃y , x < y
• ∀x∀y , x < y
Quantifiers
Solution.
• ∀x∃y , x < y
• For every natural number x, there is a natural number bigger
than x. True.
• ∃y ∀x, x < y
• There is a natural number y , such that every natural number
is smaller than y . False.
• ∃x∀y , x < y
• There is a natural number x, such that every natural number
is bigger than x. False.
• Note that 0 doesn’t work: ∀y , 0 < y is false because 0 < y is
false when y is 0!
• How do we say “There is a natural number that is the smallest
one” then?
• ∃x∀y , x ≤ y or ∃x∀y , x ̸= y → x < y
13
Quantifiers
Solution.
• ∀y ∃x, x < y
• For every natural number y , there is a natural number smaller
than y . False.
• Not true for 0.
• ∃x∃y , x < y
• There is a natural number x that is smaller than some natural
number. True.
• ∀x∀y , x < y
• For every natural number x, all natural numbers are bigger
than x. False.
14
Quantifiers
Exercise. Let the universe of discourse be R, the set of all real
numbers. Analyse the logical forms of these statements. What
variables are free?
• Every number that is larger than x is larger than y .
• All solutions of the inequality x 3 − 3x < 3 are smaller than 10.
• If there is a number x such that x 2 + 5x = w , and there is a
number y such that 4 − y 2 = w , then w is strictly between
-10 and 10.
Quantifiers
Solution.
• Every number that is larger than x is larger than y .
• ∀z, z > x → z > y . Free variables: x, y .
• All solutions of the inequality x 3 − 3x < 3 are smaller than 10.
• ∀x, x 3 − 3x < 3 → x < 10. Free variables: none.
• If there is a number x such that x 2 + 5x = w , and there is a
number y such that 4 − y 2 = w , then w is strictly between
-10 and 10.
• (∃x, x 2 + 5x = w ∧ ∃y , 4 − y 2 = w ) → (−10 < w < 10). Free
variables: w .
Quantifiers
Exercise. Let the universe of discourse be N, the set of all natural
numbers. Translate into idiomatic mathematical English.
• ∀x, (P(x) ∧ ¬(x = 2)) → O(x), where P(x) is “x is prime”
and O(x) is “x is odd.
• ∃x, P(x) ∧ (∀y , P(y ) → y ≤ x), where P(x) is “x is a perfect
number”.
17
Quantifiers
Solution.
• ∀x, (P(x) ∧ ¬(x = 2)) → O(x), where P(x) is “x is prime”
and O(x) is “x is odd.
• Every prime number that is not 2, is odd.
• ∃x, P(x) ∧ (∀y , P(y ) → y ≤ x), where P(x) is “x is a perfect
number”.
• There is the biggest perfect number.
Quantifiers
Exercise. Let the universe of discourse be the set of all people. Let
P(x, y ) mean “x is a parent of y “. What do these statements
mean? Which are true?
• ∃x∀y , P(x, y )
• ∀x∃y , P(x, y )
• ¬∃x∃y , P(x, y )
• ∃x¬∃y , P(x, y )
• ∃x∃y , ¬P(x, y )
Quantifiers
Solution.
• ∃x∀y , P(x, y )
• There exists a person who is everyone’s parent. False.
• ∀x∃y , P(x, y )
• Everyone has a child. False.
• ¬∃x∃y , P(x, y )
• There are no people x and y , such that x is a parent of y .
False.
• ∃x¬∃y , P(x, y )
• There is a person with no children. True.
• ∃x∃y , ¬P(x, y )
• There are people x and y , such that x is not a parent of y .
True.
Logical Equivalence
Consider the statement “Nobody is perfect”.
Let the universe of discourse be the set of all people. Let P(x)
stand for “x is perfect”.
• ¬∃x, P(x)
• ∀x, ¬P(x).
Examples:
• The negation of “Everyone loves Raymond” is:
• Someone does not love Raymond.
• ¬∀x, L(x) eqv ∃x, ¬L(x)
22
Quantifier Negation
Exercise: Analyse the logical forms of the following statements,
then negate the results, and translate the resulting sentences to
English.
• Every CS major takes discrete mathematics.
• Some pets do not like walks.
• We assume this means “At least one pet does not like walks”.
• The square of every odd number is odd.
Quantifier Negation
Every CS major takes discrete mathematics.
Solution:
• Universe of discourse is students.
• Let C (x) stand for “x is a CS major”, M(x) stand for “x
takes discrete mathematics”.
• ∀x, C (x) → M(x)
• Negation:
∃!x, P(x)
• “there is exactly one x such that P(x)”
• “there is a unique x such that P(x)”
Bounded Quantifiers
A useful shorthand notation: bounded quantifier.
28
Bounded Quantifiers
Exercise. Show that Quantifier Negation Laws hold for bounded
quantifiers.
Solution.
¬∀x ∈ A, P(x)
eqv ¬∀x, x ∈ A → P(x) bounded quantifier
eqv ∃x, ¬(x ∈ A → P(x)) quantifier negation
eqv ∃x, ¬(¬x ∈ A ∨ P(x)) conditional
eqv ∃x, ¬¬x ∈ A ∧ ¬P(x) De Morgan’s
eqv ∃x, x ∈ A ∧ ¬P(x) double negation
eqv ∃x ∈ A, ¬P(x) bounded quantifier
29
Bounded Quantifiers
Exercise. Show that Quantifier Negation Laws hold for bounded
quantifiers.
Solution.
¬∃x ∈ A, P(x)
eqv ¬∃x, x ∈ A ∧ P(x) bounded quantifier
eqv ∀x, ¬(x ∈ A ∧ P(x)) quantifier negation
eqv ∀x, ¬x ∈ A ∨ ¬P(x) De Morgan’s
eqv ∀x, x ∈ A → ¬P(x) conditional
eqv ∀x ∈ A, ¬P(x) bounded quantifier
Quantifiers
31
Quantifiers
Exercise. Analyse the logical forms of these statements about
natural numbers.
• x is a perfect square.
• x is a multiple of y .
• x is a prime number. (Recall: a prime number is an integer
greater than 1, that is not a product of two smaller positive
integers).
• x is the smallest positive number that is a multiple of both y
and z.
Quantifiers
Solution.
The universe of discourse is N.
• x is a perfect square.
• ∃y , x = y 2
• x is a multiple of y .
• ∃z, x = yz
• x is a prime number (Recall: a prime number is an integer
greater than 1, that is not a product of two smaller positive
integers).
• (x > 1) ∧ ¬∃y ∃z, (0 < y < x) ∧ (0 < z < x) ∧ (x = yz)
• x is the smallest positive number that is a multiple of both y
and z.
33
Quantifiers
Exercise. Analyse the logical forms of these statements about real
numbers.
• Identity element for addition is 0.
• Every real number has an additive inverse.
• Negative numbers do not have square roots.
• Every positive number has exactly two square roots.
Quantifiers
Solution.
The universe of discourse is R.
• Identity element for addition is 0.
• ∀x, x + 0 = 0 + x = x
• Every real number has an additive inverse.
• ∀x∃y , x + y = 0
• Negative numbers do not have square roots.
• ∀x, x < 0 → ¬∃y , y 2 = x
• Every positive number has exactly two square roots.
37
Quantifiers
Exercise. Show that the statements A ⊆ B and A ∪ B = B are
equivalent.
Solution:
To show: ∀x, x ∈ A → x ∈ B and ∀x, (x ∈ A ∨ x ∈ B) ↔ x ∈ B
are equivalent.
(x ∈ A ∨ x ∈ B) ↔ x ∈ B
eqv ((x ∈ A ∨ x ∈ B) → x ∈ B)∧
(x ∈ B → (x ∈ A ∨ x ∈ B)) biconditional
eqv (x ∈ A ∨ x ∈ B) → x ∈ B tautology
eqv (x ∈ A → x ∈ B) ∧ (x ∈ B → x ∈ B) **
eqv x ∈ A → x ∈ B tautology
38
Quantifiers
Solution:
** A useful equivalence:
(P ∨ Q) → R eqv (P → R) ∧ (Q → R)
(P ∨ Q) → R
eqv ¬(P ∨ Q) ∨ R implication
eqv (¬P ∧ ¬Q) ∨ R De Morgan
eqv (¬P ∨ R) ∧ (¬Q ∨ R) distributive
eqv (P → R) ∧ (Q → R) implication
39
Quantifiers and Sets
Let’s examine the statement “All CMS students are smart.”
Let P(x) stand for “x is a CMS student” and Q(x) stand for “x is
smart”, and the universe of discourse be all people. Then:
∀x, P(x) → Q(x).
If A is the truth set of P(x) and B is the truth set of Q(x), what
is the relationship between A and B?
A B
subset A ⊆ B
40
Deductive Reasoning with Quantifiers
(Famous) Example:
41
Rules of Inference with Quantifiers
Rule of Inference Name
∀x, P(x)
Universal instantiation2
∴ P(c)
P(c) for an arbitrary c
Universal generalisation
∴ ∀x, P(x)
∃x, P(x)
Existential instantiation
∴ P(c) for some element c
P(c) for some element c
Existential generalisation
∴ ∃x, P(x)
2
c must be an element in the universe of discourse.
42
Rules of Inference with Quantifiers
(Famous) Example:
43
Rules of Inference with Quantifiers
(Famous) Example:
44
Rules of Inference with Quantifiers
Example: Prove the argument is valid.
Every UofT student has an email account. Anna does not have
an email account. Therefore, Anna is not a UofT student.
Solution.
Let U(x) stand for “x is a UofT student”, and E (x) stand for “x
has an email account”. Then
∀x, U(x) → E (x) premise 1
¬E (Anna) premise 2
∴ ¬U(Anna) conclusion
46
Rules of Inference with Quantifiers
Somebody in this class was born in July. Somebody in this class
was born on Sunday. Therefore, somebody in this class was born
on Sunday in July.
Let J(x) stand for “x has a birthday in July”, and S(x) stand for
“x has a birthday on Sunday”, and universe of discourse be people
in this class.
48
Rules of Inference with Quantifiers
Exercise: Determine whether each of these arguments is valid. If
an argument is correct, what rule(s) of inference are being used? If
it is not, what logical error occurs?
1. All convertible cars are fun to drive. Isaac’s car is not a
convertible. Therefore, Isaac’s car is not fun to drive.
2. Somebody in this class enjoys whale watching. Everyone who
enjoys whale watching, cares about ocean pollution.
Therefore, there is a person in this class who cares about
ocean pollution.
3. Every CS major takes discrete math. Natasha is taking
discrete math. Therefore, Natasha is a CS major.
4. All parrots like fruit. My pet is not a parrot. Therefore, my
pet does not like fruit.
5. All parrots like fruit. At least one of my pets is a parrot.
Therefore, at least one of my pets likes fruit.
49
Rules of Inference with Quantifiers
All convertible cars are fun to drive. Isaac’s car is not a
convertible. Therefore, Isaac’s car is not fun to drive.
Solution:
Let C (x) stand for “x is a convertible”, F (x) stand for “x is fun to
drive”, and IC stand for “Isaac’s car”. Universe of discourse is
cars. Then:
50
Rules of Inference with Quantifiers
Solution:
Then premises 1 and 2 are true, but the conclusion is false. The
argument is not valid.
51
Rules of Inference with Quantifiers
Somebody in this class enjoys whale watching. Everyone who
enjoys whale watching, cares about ocean pollution. Therefore,
there is a person in this class who cares about ocean pollution.
Solution:
Let W (x) stand for “x likes whale watching”, C (x) stand for “x is
in this class”, and O(x) stand for “x cares about ocean pollution”.
Universe of discourse is people. Then:
53
Rules of Inference with Quantifiers
Note that the following reasoning is not valid:
57
Rules of Inference with Quantifiers
Solution:
59
Rules of Inference with Quantifiers
If a real number is bigger than 1, then its square is bigger than 1.
Suppose that n2 > 1. Then n > 1.
Solution: Universe of discourse is R.
60
Rules of Inference with Quantifiers
If a real number is bigger than 3, then its square is bigger than 9.
Suppose that n2 ≤ 9. Then n ≤ 3.
Solution: Universe of discourse is R.
Proof:
61
Rules of Inference with Quantifiers
If a real number is bigger than 2, then its square is bigger than 4.
Suppose that n ≤ 2. Then n2 ≤ 4.
Solution: Universe of discourse is R.
62
Rules of Inference with Quantifiers
• How do we apply universal generalisation to conclude
∀x, P(x)?
• We begin by looking at some arbitrary element c of the
universe of discourse.
• We conclude that P(c) is true.
• We conclude that ∀x, P(x) is true.
Take arbitrary c.
...
∴ P(c)
∴ ∀x, P(x) universal generalisation
Rules of Inference with Quantifiers
Example: Prove the argument below is valid.
Everyone likes mathematics. Everyone who likes mathematics
will do well in this course. Therefore, everyone will do well in
this course.
Let M(x) be “x likes mathematics”, W (x) be “x will do well in
this course”, universe of discourse is students. Then:
(1) ∀x, M(x) premise 1
(2) ∀x, M(x) → W (x) premise 2
(3) Take arbitrary student s
(4) M(s) 1, universal instantiation
(5) M(s) → W (s) 2, universal instantiation
(6) W (s) 4, 5, Modus Ponens
(7) ∀x, W (x) 3, 6, universal generalisation
64
Rules of Inference with Quantifiers
Important: When using the Universal Generalisation rule, we
must introduce a fresh (new) variable, i.e., a variable that did
not appear in our argument / proof.
65
Rules of Inference with Quantifiers
67