75. Quantifiers

75.1 Definition: universal quantifier

Let $Q(x)$ be a predicate. The statement $(\forall x)Q(x)$ is true if and only if $Q(x)$ is true for every value of the variable $x$. The symbol $\forall$ is called the universal quantifier.

75.1.1 Example Let $P(x)$ be the statement $(x > 5)\Rightarrow (x >3)$. $P(x)$ is universally true, that is, it is true for every real number $x$. Therefore, the expression $(\forall x)P(x)$ is true.

We defined $\forall$ in 13.2; now we will go into more detail.

75.1.2 Showing the types of the variables A short way of saying that $x$ is of type real and that $(\forall x)Q(x)$ is to write $(\forall x{:}\mathrm{R})Q(x)$, read “for all $x$ of type $\mathrm{R}$, $Q(x)$” or “for all real numbers $x$, $Q(x)$”.

75.1.3 Example The statement $(\forall n{:}\mathrm{Z})((n >5)$ is false because “$n >5$” is false for $n= 3$ (and for an infinite number of other values of $n$).

75.1.4 Example The statement $(\forall n{:}\mathrm{Z})((n > 5)\vee (n <5))$ is false because the statement “$(n > 5)\vee (n <5)$” is false when $n= 5$. Note that in contrast to Example 75.1.3, $n= 5$ is the only value for which the statement “$(n > 5)\vee (n <5)$” is false.

A statement like $(\forall x)Q(x)$ is true if $Q(x)$ is true no matter what is substituted for $x$ (so long as it is of the correct type). If there is even one $x$ for which $Q(x)$ is false, then $(\forall x)Q(x)$ is false. A value of $x$ with this property is important enought to have a name:

75.2 Definition: counterexample

Let $Q(x)$ denote a predicate. An instance of $x$ for which $Q(x)$ is false is called a counterexample to the statement $(\forall x)Q(x)$. If there is a counterexample to the statement $(\forall x)Q(x)$, then that statement is false.

75.2.1 Example $(\forall x{:}\mathrm{N})((x \leq 5)\vee (x \geq 6))$ is true, but $(\forall x{:}\mathrm{R})((x \leq 5)\vee (x \geq 6))$ is false (counterexample: $\frac{11}{2}$).

75.2.2 Example A counterexample to the statement $(\forall n{:}\mathrm{Z})((n >5)$ is 3; in fact there are an infinite number of counterexamples to this statement. In contrast, the statement $(\forall n{:}\mathrm{Z})((n > 5)\vee (n <5))$ has exactly one counterexample.

75.2.3 Exercise Find a universal statement about integers that has exactly 42 counterexamples.

75.2.4 Exercise Find a universal statement about real numbers that has exactly 42 counterexamples.

75.3 Definition: existential quantifier

Let $Q(x)$ be a predicate. The statement $(\exists x)Q(x)$ means there is some value of $x$ for which the predicate $Q(x)$ is true. The symbol $\exists$ is called an existential quantifier, and a statement of the form $(\exists x)Q(x)$ is called an existential statement. A value $c$ for which $Q(c)$ is true is called a witness to the statement $(\exists x)Q(x)$.

75.3.1 Remark One may indicate the type of the variable in an existential statement in the same way as in a universal statement.

75.3.2 Example Let $x$ be a real variable and let $Q(x)$ be the predicate $x >50$. This is certainly not true for all integers $x$. $Q(40)$ is false, for example. However, $Q(62)$ is true. Thus there are some integers $x$ for which $Q(x)$ is true. Therefore $(\exists x{:}\mathrm{R})Q(x)$ is true, and 62 is a witness.

75.3.3 Exercise Find an existential statement about real numbers with exactly 42 witnesses.

75.3.4 Exercise In the following sentences, the variables are always natural numbers. $P(n)$ means $n$ is a prime, $E(n)$ means $n$ is even. State which are true and which are false. Give reasons for your answers.

a) $(\exists n)\bigl(E(n)\wedge P(n)\bigr)$

b) $(\forall n)\bigl(E(n)\vee P(n)\bigr)$

c) $(\exists n)(E(n)\Rightarrow P(n))$

d) $(\forall n)(E(n)\Rightarrow P(n))$

(Answer on page 247.)

75.3.5 Exercise Which of these statements are true for all possible one-variable predicates $P(x)$ and $Q(x)$? Give counterexamples for those which are not always true.

a) $(\forall x)(P(x)\wedge Q(x))\Rightarrow (\forall x)P(x)\wedge (\forall x)Q(x)$

b) $(\forall x)P(x)\wedge (\forall x)Q(x)\Rightarrow (\forall x)(P(x)\wedge Q(x))$

c) $(\exists x)(P(x)\wedge Q(x))\Rightarrow (\exists x)P(x)\wedge (\exists x)Q(x)$

d) $(\exists x)P(x)\wedge (\exists x)Q(x)\Rightarrow (\exists x)(P(x)\wedge Q(x))$

(Answer on page 247.)

75.3.6 Exercise Do the same as for Problem 75.3.5 with ‘$\vee$’ in the statements in place of ‘$\wedge$’.

75.3.7 Exercise Do the same as for Problem 75.3.5 with ‘$\Rightarrow$’ in the statements in place of ‘$\wedge$’.

75.3.8 Usage The symbols $\forall$ and $\exists$ are called quantifiers. The use of quantifiers makes an extension of the propositional calculus called the predicate calculus which allows one to say things about an infinite number of instances in a way that the propositional calculus does not.

Pages 112–113 of the book (PDF).