Skip to content

2.2 Quantifiers and Scope

Universal and existential quantifiers, scope, free variables, bound variables, and variable capture.

Quantifiers are the symbols that allow first order logic to express statements about many objects at once, and they are the main feature that separates first order logic from propositional logic.

Universal and Existential Quantifiers

There are two basic quantifiers:

\forall

and:

\exists

The universal quantifier \forall is read as “for all”, and it is used to state that a formula holds for every object in the domain under consideration.

The existential quantifier \exists is read as “there exists”, and it is used to state that a formula holds for at least one object in the domain under consideration.

For example:

xP(x) \forall x \, P(x)

says that every object has property PP, while:

xP(x) \exists x \, P(x)

says that at least one object has property PP.

Definition 2.9 (Scope)

The scope of a quantifier is the part of the formula to which the quantifier applies.

In the formula:

x(P(x)Q(x)) \forall x \, (P(x) \to Q(x))

the scope of x\forall x is:

P(x)Q(x) P(x) \to Q(x)

Thus both occurrences of xx in this formula are controlled by the quantifier.

In contrast, in the formula:

(xP(x))Q(x) (\forall x \, P(x)) \to Q(x)

the scope of x\forall x is only:

P(x) P(x)

The occurrence of xx in Q(x)Q(x) is outside the scope of the quantifier and is therefore free.

Definition 2.10 (Free and Bound Occurrences)

An occurrence of a variable in a formula is bound if it lies inside the scope of a quantifier for that same variable.

An occurrence of a variable is free if it is not bound.

For example, in:

xP(x,y) \forall x \, P(x, y)

the occurrence of xx is bound, while the occurrence of yy is free.

In:

y(P(x,y)Q(y)) \exists y \, (P(x, y) \land Q(y))

the occurrences of yy are bound, while the occurrence of xx is free.

This distinction is important because the truth of a formula with free variables depends on an assignment of values to those variables.

Example 2.11

Consider:

x(x<y) \forall x \, (x < y)

The variable xx is bound, because it occurs within the scope of x\forall x.

The variable yy is free, because no quantifier binds it.

Thus the formula says that every object is less than the object assigned to yy, and its truth depends on which object yy denotes.

Definition 2.12 (Sentence)

A sentence is a formula with no free variables.

For example:

x(x=x) \forall x \, (x = x)

is a sentence.

The formula:

x=x x = x

is not a sentence, because the variable xx occurs freely.

Sentences are the formulas that can be assigned truth values in a structure without requiring an additional assignment for free variables.

Order of Quantifiers

The order of quantifiers matters.

The formula:

xyR(x,y) \forall x \, \exists y \, R(x, y)

says that for every object xx, there is some object yy related to xx.

The formula:

yxR(x,y) \exists y \, \forall x \, R(x, y)

says that there is one object yy that is related to every object xx.

These two formulas generally have different meanings.

For example, if R(x,y)R(x, y) means:

x<y x < y

then:

xy(x<y) \forall x \, \exists y \, (x < y)

says that every object has a larger object.

But:

yx(x<y) \exists y \, \forall x \, (x < y)

says that there is one object larger than every object.

In the natural numbers, the first statement is true, while the second statement is false.

Definition 2.13 (Restricted Quantifiers)

A restricted universal quantifier:

xSA(x) \forall x \in S \, A(x)

is an abbreviation for:

x(xSA(x)) \forall x \, (x \in S \to A(x))

A restricted existential quantifier:

xSA(x) \exists x \in S \, A(x)

is an abbreviation for:

x(xSA(x)) \exists x \, (x \in S \land A(x))

The difference between implication and conjunction in these translations is important.

For a universal statement, objects outside SS should not matter, so implication is used.

For an existential statement, the object must both belong to SS and satisfy A(x)A(x), so conjunction is used.

Example 2.14

The statement:

xN(x+0=x) \forall x \in \mathbb{N} \, (x + 0 = x)

means:

x(xNx+0=x) \forall x \, (x \in \mathbb{N} \to x + 0 = x)

The statement:

xN(x2=4) \exists x \in \mathbb{N} \, (x^2 = 4)

means:

x(xNx2=4) \exists x \, (x \in \mathbb{N} \land x^2 = 4)

These are not new primitive forms of first order logic, but convenient abbreviations.

Lemma 2.15 (Negating Quantifiers)

For every formula A(x)A(x), the following equivalences hold:

¬xA(x)x¬A(x) ¬\forall x \, A(x) \equiv \exists x \, ¬A(x)

and:

¬xA(x)x¬A(x) ¬\exists x \, A(x) \equiv \forall x \, ¬A(x)

Proof

The formula:

¬xA(x) ¬\forall x \, A(x)

says that it is not the case that A(x)A(x) holds for every object xx.

This means that there is at least one object xx for which A(x)A(x) fails.

Thus:

¬xA(x)x¬A(x) ¬\forall x \, A(x) \equiv \exists x \, ¬A(x)

Similarly, the formula:

¬xA(x) ¬\exists x \, A(x)

says that there is no object xx for which A(x)A(x) holds.

This means that every object xx fails to satisfy A(x)A(x).

Thus:

¬xA(x)x¬A(x) ¬\exists x \, A(x) \equiv \forall x \, ¬A(x)

Example 2.16

The negation of:

xP(x) \forall x \, P(x)

is:

x¬P(x) \exists x \, ¬P(x)

This says that not every object has property PP exactly when at least one object fails to have property PP.

The negation of:

xP(x) \exists x \, P(x)

is:

x¬P(x) \forall x \, ¬P(x)

This says that there is no object with property PP exactly when every object fails to have property PP.

Definition 2.17 (Variable Capture)

Variable capture occurs when a substitution causes a variable that was free to become bound by a quantifier.

For example, consider:

xP(x,y) \forall x \, P(x, y)

The variable yy is free.

If we replace yy by xx without changing bound variables first, we obtain:

xP(x,x) \forall x \, P(x, x)

The newly inserted xx now lies inside the scope of x\forall x, so it has become bound.

This changes the syntactic role of the variable and may change the meaning of the formula.

Lemma 2.18 (Renaming Bound Variables)

Bound variables may be renamed as long as no free variable becomes captured.

For example:

xP(x,y) \forall x \, P(x, y)

may be renamed as:

zP(z,y) \forall z \, P(z, y)

provided that zz does not already occur in a way that would create confusion or capture.

Proof

A bound variable functions only as a placeholder for objects ranging over the domain.

Changing the name of a bound variable does not change the structure of quantification, as long as the change is made consistently throughout the scope of the quantifier and does not capture any free variables.

Thus the formulas:

xP(x,y) \forall x \, P(x, y)

and:

zP(z,y) \forall z \, P(z, y)

have the same logical content.

The restriction about capture is necessary because replacing xx by a variable already free in the formula can change which occurrences are bound and which occurrences remain free.