Skip to main content

Quantifiers

There are two quantifiers:

  • x\forall x reads "for all xx"

  • x\exists x reads "there exists xx such that..."

Example 1

Consider the statement (x0)(y)(xy=1)(\forall x \neq 0) (\exists y) (xy = 1) says that every xx other than zero has a multiplicative inverse. This statement is valid over R\mathbb{R} and Q\mathbb{Q} but not Z\mathbb{Z}. Therefore, the validity of a statement depends crucially on the universe we are working in. We often make the universe explicit by writing (xU)(\forall x \in U) where UU is the universe.

Example 2

The statement "there exists an integer between 55 and 88" can be written mathematically as (xZ)(5x8)(\exists x \in \mathbb{Z})(5 \le x \le 8).

Notice that the statement "(5x8)(5 ≤ x ≤ 8)" is not a proposition. We call it a propositional formula P(x) (or a predicate).

Example 3

The ordering of the quantifier matters. Consider the following two statements:

  • (xZ)(yZ)(yx)(\exists x \in \mathbb{Z}) (\forall y \in \mathbb{Z}) (y\le x). This statement reads "there exists a largest integer".
  • (yZ)(xZ)(yx)(\forall y \in \mathbb{Z}) (\exists x\in \mathbb{Z}) (y \le x). This statement can be read as "given an integer, there is a larger (or equal) one".

Obviously, the first statement is false, while the second is true.

Negation: Let PP and QQ be propositions. The negation of conjunction ¬(PQ)\neg (P \land Q) is the same as (¬P¬Q)(\neg P \lor \neg Q). Similarly for the negation of disjunction ¬(PQ)¬P¬Q\neg(P \lor Q) \equiv \neg P \land \neg Q. These simple rules are known as De Morgan’s Laws. Since we can view (xU)P(x)(\exists x \in U) P(x) as aUP(a)\bigvee_{a\in U} P(a) (read as the conjunction of P(a)P(a) with a over UU), it should be intuitive to believe that ¬(xU)P(x)\neg (\exists x \in U) P(x) is the same as (xU)¬P(x)(\forall x \in U) \neg P(x). Similar rules apply to the universal quantifier, i.e., ¬(xU)P(x)(xU)¬P(x)\neg(\forall x \in U)P(x) \equiv (\exists x \in U) \neg P(x).

Example 4 (Distinct solutions)

How to write a statement "there are at least two distinct integers that satisfy P(x)P(x)"? One way to do it is (xZ)(yZ)((xy)P(x)P(y))(\exists x \in \mathbb{Z}) (\exists y \in \mathbb{Z}) ((x \neq y) \land P(x) \land P(y)). What about the statement "there are at most two distinct integers that satisfy P(x)"? Here it is:

(x)(y)(q)[P(q)(q=xq=y)](\exists x)(\exists y)(\forall q)[P(q) \Rightarrow (q = x \lor q = y)]
Example 5 (Two-player game)

In a two-player game (like chess), the statement "Black will checkmate in two turns" can also be written using alternating quantifiers. Let us try to understand this. Let B(x,y)B(x, y) be the predicate indicating that if White uses strategy y and Black uses x, then Black wins. So we can write (y)(x)B(x,y)(\forall y)(\exists x)B(x, y) to say that no matter how White plays the current turn, Black has a strategy to win.