2.3 Predicates and Quantifiers
Section 2.1 introduced the open statement . It was not yet a proposition because the value of was missing. We now need a compact way to talk about a property that different objects may or may not have, and then make a complete claim about those objects.
A predicate records the property. A quantifier states how many objects in a chosen domain must satisfy it.
By the end of this section, you will be able to:
- identify a predicate and its domain;
- evaluate universal and existential statements using counterexamples and witnesses;
- negate quantified statements correctly;
- explain why changing the order of two quantifiers can change meaning and truth.
A predicate becomes true or false after substitution
A predicate is a sentence containing one or more variables that becomes a proposition when values are substituted for those variables.
Let
The notation names the predicate and shows that its truth depends on . Substitution produces propositions:
Before evaluating a predicate, specify its domain (also called the universe of discourse): the set of values the variable is allowed to take.
If the domain is
then may be tested only at those six values. Changing the domain can change a quantified statement’s truth. For example, “every number is positive” is true over but false over .
Predicates need not concern numbers. If is a set of devices, we may define
The expression is then a proposition about one particular device .
Universal quantification checks every object
The universal quantifier is written and read “for every” or “for all.” The statement
means “for every in domain , is true.”
Using and
check the objects one at a time:
| 1 | |
| 2 | |
| 3 | |
| 4 |
Every row passes, so is true.
To show that a universal statement is false, we do not need to inspect forever. One failing object is enough. Such an object is a counterexample. If the domain changes to , then is a counterexample because is false.
This gives two different workloads:
- proving a finite universal statement requires checking every domain element;
- refuting it requires finding one counterexample.
Existential quantification searches for one witness
The existential quantifier is written and read “there exists” or “for at least one.” The statement
means “there is at least one in for which is true.”
An object that makes the predicate true is called a witness. With and meaning , the value is a witness. We do not need every element to pass.
To prove an existential statement, exhibit one witness. To refute it over a finite domain, show that every possible object fails.
The contrast is worth memorizing through actions rather than slogans:
| Claim | To establish it | To refute it |
|---|---|---|
| check all objects | give one counterexample | |
| give one witness | show all objects fail |
Boundary case: the empty domain
If , there is no object that can violate a universal statement, so is treated as true. There is also no object that can serve as an existential witness, so is false.
This is the same pattern used in Chapter 1 to explain why : no element exists that could violate the requirement.
The habitat lets you change both the predicate and its domain. Do not watch only the final true/false badge. Locate the highlighted object: under it is a witness that makes the statement true; under a false it is a counterexample that breaks the statement.
Translate quantified language in a fixed order
Natural language often hides the domain and predicate. Translate it in three steps:
1. identify the domain;
2. define the predicate in plain language;
3. choose the quantifier that matches “every,” “some,” or “no.”
Suppose is the set of students and
Then
means “every student submitted,” while
means “at least one student submitted.”
The sentence “no student submitted” says that no witness exists:
It can also be written as
These two forms have the same meaning.
Negating a quantifier swaps the search
To negate a universal statement, we need one counterexample:
Read this as: “it is not true that every object has property ” means “there exists an object that does not have property .”
To negate an existential statement, every candidate must fail:
These are quantifier versions of De Morgan’s laws. Negation crosses the quantifier, changes to or to , and then negates the predicate.
A frequent error is to negate only the predicate while leaving the quantifier unchanged. For example, the negation of “every sensor is active” is not “every sensor is inactive.” The correct negation is “at least one sensor is inactive.” A group containing both active and inactive sensors makes the difference visible.
Predicates with two variables describe pairwise relationships
A predicate may depend on more than one variable. Let
Once both and are supplied, has a definite truth value. The ordered pair connects this idea to the Cartesian products from Section 1.3: all possible key–robot pairs form a product, and the true pairs form a relation.
Now compare two quantified statements:
and
Read quantifiers from left to right.
The first statement says:
> For every robot , we can find some key that unlocks that robot.
The chosen key may be different for different robots.
The second statement says:
> There is one key that unlocks every robot .
Now the same single key must work for all robots. This is a stronger requirement.
Consider three robots and three keys where opens , opens , and opens . Every robot has some key, so the first statement is true. No single key opens all three, so the second statement is false. The order of quantifiers therefore cannot be swapped casually.
Paint the key–robot relation rather than merely reading it. First create a distributed solution in which each robot has access but no master key exists. Then fill one entire key column and observe exactly which quantified statement changes.
From logical statements to digital decisions
We can now write precise claims, negate them, and identify the evidence that would establish or refute them. Section 2.4 returns to the two truth values from the start of this chapter and treats them as and . Boolean algebra will turn logical connectives and truth tables into rules that digital circuits can calculate.