Quantifiers PDF
Quantifiers PDF
1 Quantifiers
To formulate more complex mathematical statements, we use the quantifiers there exists,
written ∃, and for all, written ∀. If P (x) is a predicate, then
• ∀x : x2 + 1 > 0 is true, but ∀x : x2 > 2 is false, since for example x = 1 doesn’t satisfy
the predicate. On the other hand, ∃x : x2 > 2 is true, since x = 2 is an example that
satisfies it.
This, incidentally, is where the term “counterexample” comes from. If ∀x : P (x) is false,
then ∃x : P (x) — and the x that exists to satisfy P (x) is the counterexample to the claim
∀x : P (x).
On the other hand, to negate ∃x : P (x), we must claim that P (x) fails to hold for any
possible x. So again we flip the quantifier and then negate the predicate:
1
Quantifiers in standard English usage. If we think about it, this is all familiar from
standard English usage. For example, if someone says, “Everyone at Cornell is at least 18
years old,” you might reply, “No, I know someone at Cornell who’s under 18.” What are
you doing when you say this?
• To disagree with this, you’re negating the statement by flipping the ∀ to ∃ and then
negating the the predicate: “ ∃x at Cornell such that x is not at least 18 years old.”
• Note also that we’re careful about the set over which x is being quantified: the set is
all people at Cornell.
The same thing happens in the reverse direction, from ∃ to ∀: if someone says, “There’s
an NBA player who makes over ten million dollars a year,” you might disagree by saying,
“No, every NBA player makes under ten million dollars a year.”
• Suppose we claimed, “For every real number, there’s a real number larger than it.”
We’d write this as ∀x ∃y : y > x.
• Or if we wanted to claim, “There exists a Boolean formula such that every truth assign-
ment to its variables satisfies it,” we could write this as ∃ formulaF ∀ assignmentsA :
A satisfies F .
The difference between a statement that says ∀x ∃y and a statement that says ∃x ∀y
is something to watch out for. For example, if we’re talking about real numbers, then our
earlier example ∀x ∃y : y > x is true. But writing it with the quantifiers in the other order,
it would become false: ∃y ∀x : y > x. This version would require there to be a single
number that’s greater than every number.
Negating Nested Quantifiers. To negate a sequence of nested quantifiers, you flip each
quantifier in the sequence and then negate the predicate. So the negation of ∀x ∃y : P (x, y)
is ∃x ∀y : P (x, y) and So the negation of ∃x ∀y : P (x, y) and ∀x ∃y : P (x, y).
Again, after some thought, this make sense intuitively. For example, let’s take the defini-
tion of an unbounded sequence from calculus. If we have an infinite sequence of real numbers
a1 ≤ a2 ≤ a3 ≤ · · ·, then we say it’s unbounded if for every number x, it eventually grows
larger than x. You can already see the quantifiers lurking in here: ∀x ∃n : an > x.
Now, some sequences, like 1, 4, 9, 16, 25, 36, . . ., are unbounded, and some, like 21 , 43 , 87 , . . .,
are not. What does it mean for a sequence not to be unbounded: there is an upper bound
x such that every number in the sequence is at most x.
2
In fact, we could have derived this mechanically by negating the definition of unbound-
edness. If “unbounded” means ∀x ∃n : an > x, then “not unbounded” must mean (flipping
quantifiers) ∃x ∀n : an ≤ x. Notice that this is what just said, but here we worked it out
without even thinking about what the symbols mean.
More than two nested quantifiers. There’s no problem writing longer sequences of
nested quantifiers, but it’s a general rule of thumb that people really have to work, cognitively,
to handle more than two. This is why most of us have such a hard time digesting the definition
of a limit when we first learn it in calculus: limx→a f (x) = b means
∀ǫ ∃δ ∀x : (0 < |x − a| < δ) −→ |f (x) − b| < ǫ.
Given their complexity, it’s interesting to ask how often sentences with three nested
quantifiers come up in standard conversation.
There are certainly examples. Here’s one that requires a very mild knowledge of baseball,
in which all three quantifiers are hidden.
• In 1941, Joe Dimaggio had a 56-game hitting streak.
(A record, by the way, that many people think will never be broken ... )
Even if you don’t know baseball, just think of the rules this way: over the course of one
game, each player comes up to bat several times; in each at-bat, they either get a hit (a good
thing) or an out (a bad thing). So here’s what the sentence above is really saying:
• In 1941, there existed a sequence of 56 consecutive games, such that for all games in
this sequence, there was at least one at-bat in which Joe Dimaggio got a hit.
So sports fans, just like mathematicians and software designers, know how to make up
definitions (like “hitting streak”) that hide a lot of complexity.
Notice by the way that “streaks” in sports don’t generally involve three nested quantifiers;
in fact, they usually involve just two. For example, the Kansas City Royals’ 19-game losing
streak this baseball season could be written
• This past summer, there was a sequence of 15 consecutive Royals games such that for
all games in this sequence, the Royals lost.
3
1.2 Connections to Game-Playing
We used Boolean formulas to model two-player games in the previous lecture; we can also
use quantifiers for this purpose, in a very similar way. Suppose we have a game in which
players alternate moves, and we want to know whether Player 1 can force a win after at most
k moves by each side. If we simply try stating what this means, we notice the quantifier
structure very quickly: we want to know if there’s a move for Player 1, so that for any
possible move by Player 2, there’s a move for Player 1, so that for any possible move by
Player 2, and so forth, leading to a position that is a win for Player 1.
In symbols, let x1 , x2 , . . . , xk be variables corresponding to the moves by Player 1, and
let y1 , y2 , . . . , yk be variables corresponding to the moves by Player 2. Let the predicate
P (x1 , y1 , x2 , y2, . . . , xk , yk ) be T when the position after moves x1 , y1, . . . , xk , yk in order is a
win for Player 1, and let is be F otherwise. Then the question of a forced win is determined
simply by the truth or falsehood of a single quantified statement:
∃x1 ∀y1 ∃x2 ∀y2 · · · ∃xk ∀yk : P (x1 , y1 , . . . , xk , yk .
And again, the strategy for Player 1 shows up here as well: every time a quantifier of the
form ∃xi is satisfied, it says that there’s a way to set the value of xi (in other words, how
to choose the right move) to continue forcing the win.
The relationship to quantifiers is so close that people often find it useful to think about
the relationship as going in both directions: reasoning about alternating, nested quantifiers
is like thinking about a strategy in a two-player game. And this also hints at why it’s so
hard to play games like chess well. Recall that even three nested quantifiers tends to place
a large cognitive load on people; to look k moves out in chess requires manipulating 2k
nested quantifiers! In later courses, like CS 482, you’ll see actual formal evidence for why
manipulating long strings of quantifiers is a computationally intractable problem.
4
There’s no better way to ruin a joke than to try writing it out in logical notation, but
for our particular purpose here it’s useful, since it’s entirely about quantifiers. Clearly the
first sentence was meant to say: “ ∀ blocks of fifteen seconds, ∃ a person who is stealing
a car right then.” The second sentence then willfully misinterprets this by swapping the
quantifiers: “∃ a person P such that ∀ blocks of fifteen seconds, P is stealing a car right
then.”
But there are much bigger problems than this, if we want to get computers to understand
the quantifiers embedded in sentences A real difficulty is that we humans resolve the same
ambiguities differently depending on what the sentence is talking about. Here’s a nice pair of
example dialogues from Lillian Lee that illustrate this.
Did everyone have their own drink, or did they all share the same drink? Clearly everyone
had their own drink. But did everyone watch a different movie (on little personal video
players), or did they all sit around watching the same movie. Clearly everyone watched the
same movie.
So the first is, “ ∀ people P at the party ∃ a drink that P had,” while the second is “ ∃
a movie M such that ∀ people P , P saw the movie M.” In other words, we interpret the
order of quantifiers differently, even though the sentences are written exactly the same way.
The differences in interpretation come about simply because we know about the differences
between drinks and movies. This is the kind of thing that makes life very difficult for natural
language processing software.
• If the statement has the form ∀x : P (x), then the global outline is likely have the
form: Consider any possible x, and show that it satisfies the property P (x).
• If the statement has the form ∃x : P (x), then the global outline is different: One
needs to specify a particular x, and then show it satisfies P (x).
It’s particularly useful to watch for the role that ∃ plays in proofs. When you come to a ∃x,
it generally means: At this point, you have to describe an x that does what you want.
5
Quantifiers and Proofs by Contradiction. Of course, one can try looking for alternate
strategies, and proof by contradiction is one useful example of this. If you’re trying to prove
∃x : P (x), and you don’t see how to describe the x you need, you can try supposing it’s false
and looking for a contradiction. Supposing it’s false, concretely, means assuming ∀x : P (x).
You’re now in a situation where you can assume that P (x) holds for all x, and start looking
for a contradiction.
Analogously, if you don’t see how to get started proving a statement like ∀x : P (x), you
can similarly negate it and start searching for a contradiction. This means you can start by
assuming ∃x : P (x), which lets you assume the existence of a counterexample x for which
P (x) holds.