Predicates and Quantifiers
A predicate is a sentence with a variable, like P(x): “x is prime,” that becomes true or false once x has a value. Quantifiers turn predicates into propositions: ∀x means “for all x,” and ∃x means “there exists an x.” Predicates and quantifiers let you state and negate claims about every or some member of a set.
Before this lesson: Propositional Logic and Logical Equivalence
What is a predicate?
A sentence like “x + 3 = 7” is not a proposition, because its truth depends on x. Give it a name, P(x), and call it a predicate (or propositional function). Substituting a value turns it into a proposition: P(4) is true and P(1) is false.
The set of values x is allowed to take is the domain (also called the universe of discourse). Always state the domain, because the same quantified statement can be true over one domain and false over another. A predicate can have several variables, such as Q(x, y): “x + y = 0.”
The universal and existential quantifiers
| Statement | Read as | True when | False when |
|---|---|---|---|
| \forall x\, P(x) | for all x, P(x) | P(x) is true for every x in the domain | there is at least one x with P(x) false (a counterexample) |
| \exists x\, P(x) | there exists an x with P(x) | P(x) is true for at least one x (a witness) | P(x) is false for every x in the domain |
To prove a “for all” statement you must cover every member of the domain, so one example is never enough. To disprove it, one counterexample is enough. For a “there exists” statement it is the other way around: one witness proves it.
Quantifiers with a condition
“Every math major takes calculus” talks only about math majors. With M(x): “x is a math major” and C(x): “x takes calculus,” it is ∀x (M(x) → C(x)). “Some math major takes calculus” is ∃x (M(x) ∧ C(x)). The rule of thumb: ∀ goes with →, and ∃ goes with ∧.
Negating quantified statements
Negating a quantifier works like De Morgan’s laws: switch the quantifier and move the negation inside.
\lnot \forall x\, P(x) \equiv \exists x\, \lnot P(x) \qquad \lnot \exists x\, P(x) \equiv \forall x\, \lnot P(x)
“Not everyone passed” means “someone did not pass,” and “no one passed” means “everyone did not pass.” For nested quantifiers, apply the rule once for each quantifier, from left to right.
Nested quantifiers
When a statement has two quantifiers, their order matters. Over the integers, ∀x ∃y (x + y = 0) says every integer has an opposite, which is true. But ∃y ∀x (x + y = 0) says one single y works for every x, which is false.
Predicates and quantifiers examples
Example 1: The domain changes the answer
Find the truth value of ∀x (x2 ≥ x) when the domain is (a) the integers and (b) the real numbers.
x^2 - x = x(x - 1)
(a) Factor out the greatest common factor x.
x \le 0 \Rightarrow x(x - 1) \ge 0
Case x ≤ 0: x is zero or negative and x − 1 is negative, so the product is zero or positive.
x \ge 1 \Rightarrow x(x - 1) \ge 0
Case x ≥ 1: x is positive and x − 1 is zero or positive, so the product is zero or positive.
x^2 - x \ge 0 \Rightarrow x^2 \ge x
Every integer is in one of the two cases; add x to both sides.
x = \tfrac{1}{2}(b) Try a real number between 0 and 1.
\left(\tfrac{1}{2}\right)^2 = \tfrac{1}{4}Square it.
\tfrac{1}{4} \lt \tfrac{1}{2}So x² ≥ x is false for x = 1/2.
Answer: (a) true over the integers; (b) false over the real numbers, with counterexample x = 1/2.
Example 2: Translating English into quantifiers
The domain is the students in a class. Let S(x) be “x has a phone.” Translate each sentence.
- Every student has a phone.
- Some student has a phone.
- Some student does not have a phone.
- No student has a phone.
\forall x\, S(x)
Sentence 1: “every” is ∀.
\exists x\, S(x)
Sentence 2: “some” is ∃.
\exists x\, \lnot S(x)
Sentence 3: the negation sits inside the predicate.
\forall x\, \lnot S(x)
Sentence 4: “no student has” means “every student does not have.”
\forall x\, \lnot S(x) \equiv \lnot \exists x\, S(x)
Sentence 4 can also be written “it is not true that some student has a phone.”
Answer: ∀x S(x); ∃x S(x); ∃x ¬S(x); ∀x ¬S(x), or ¬∃x S(x). Sentence 3 is the negation of sentence 1, and sentence 4 is the negation of sentence 2.
Example 3: Negating a universal statement
The domain is the real numbers. Negate ∀x (x2 > 0) and decide which version is true.
\lnot \forall x\, (x^2 \gt 0)
Write the negation.
\equiv \exists x\, \lnot(x^2 \gt 0)
Switch ∀ to ∃ and move ¬ inside.
\equiv \exists x\, (x^2 \le 0)
“not greater than” is “less than or equal to.”
0^2 = 0
Try x = 0.
0 \le 0
So x = 0 is a witness.
Answer: the negation is ∃x (x2 ≤ 0). It is true (x = 0 is a witness), so the original statement ∀x (x2 > 0) is false.
Example 4: Negating a conditional statement
Negate “Every math major takes calculus,” ∀x (M(x) → C(x)), and write the result in words.
\lnot \forall x\, (M(x) \to C(x))
Write the negation.
\equiv \exists x\, \lnot(M(x) \to C(x))
Switch ∀ to ∃ and move ¬ inside.
\equiv \exists x\, (M(x) \land \lnot C(x))
Negation of a conditional: ¬(p → q) ≡ p ∧ ¬q.
Answer: ∃x (M(x) ∧ ¬C(x)): “Some math major does not take calculus.” It is not “Every math major does not take calculus.”
Example 5: Which tutor can help? (word problem)
A study center has students s₁, s₂, s₃ and tutors A, B, C. Let H(s, t) mean “tutor t can help student s.” The table shows when H(s, t) is true. Decide whether ∀s ∃t H(s, t) and ∃t ∀s H(s, t) are true, and say what each means.
| Student | Tutor A | Tutor B | Tutor C |
|---|---|---|---|
| s₁ | T | T | F |
| s₂ | F | T | F |
| s₃ | F | F | T |
H(s_1, A) = \text{T}s₁ has a tutor (A).
H(s_2, B) = \text{T}s₂ has a tutor (B).
H(s_3, C) = \text{T}s₃ has a tutor (C).
\forall s\, \exists t\, H(s, t) = \text{T}Every student has at least one tutor who can help.
H(s_2, A) = \text{F},\quad H(s_3, B) = \text{F},\quad H(s_1, C) = \text{F}Each tutor fails to help at least one student.
\exists t\, \forall s\, H(s, t) = \text{F}No single tutor can help everyone.
Answer: ∀s ∃t H(s, t) is true: every student can be helped by someone. ∃t ∀s H(s, t) is false: no one tutor can help all three students. Swapping the quantifiers changed the meaning.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Negating without switching the quantifier | Writing ¬∀x P(x) ≡ ∀x ¬P(x) | Switch the quantifier: ¬∀x P(x) ≡ ∃x ¬P(x). |
| Using ∧ with “every” | Writing ∀x (M(x) ∧ C(x)) for “every math major takes calculus” | That says everyone is a math major. Use ∀x (M(x) → C(x)). |
| Using → with “some” | Writing ∃x (M(x) → C(x)) for “some math major takes calculus” | That is true if anyone is not a math major. Use ∃x (M(x) ∧ C(x)). |
| Proving “for all” with one example | Checking x = 3 and concluding ∀x (x2 ≥ x) over the reals | One counterexample, x = 1/2, makes it false. |
| Ignoring the domain | Calling ∃x (x2 = 2) true over the integers | No integer squares to 2; the statement is true only over the reals. |
| Swapping nested quantifiers | Treating ∀x ∃y as the same as ∃y ∀x | In ∃y ∀x, one y must work for every x. |
Related ideas
Quantified statements are what proofs prove. The next lesson, Rules of Inference, adds rules such as universal instantiation for reasoning with them. The idea of a single counterexample also appears in inductive and deductive reasoning, and “for all n” statements about integers are often proved by mathematical induction.
Practice problems
- Let P(x) be “x + 2 = 7.” Find the truth values of P(5) and P(1).
- Over the integers, is ∃x (x2 = 2) true or false?
- Over the real numbers, is ∃x (x2 = 2) true or false?
- Over the integers, is ∀x (2x ≥ x) true or false?
- Let S(x) be “x is a square” and R(x) be “x is a rectangle.” Translate “Every square is a rectangle.”
- Let P(x) be “x is prime” and E(x) be “x is even.” Translate “Some prime number is even.”
- Over the real numbers, negate ∃x (x2 < 0). Which version is true?
- Write the negation of “Every student passed the test” in words.
- Negate ∀x ∃y (x < y) and simplify so no ¬ is left.
- Over the integers, find the truth values of ∀x ∃y (y = 2x) and ∃y ∀x (y = 2x).
Show answers
1.
5 + 2 = 7
Substitute x = 5.
1 + 2 = 3 \ne 7
Substitute x = 1.
Answer: P(5) is true and P(1) is false
2.
x = \pm\sqrt{2}The only real solutions of x² = 2.
1.4^2 = 1.96,\quad 1.5^2 = 2.25
√2 is between 1.4 and 1.5, so it is not an integer.
Answer: false; no integer squares to 2
3.
\left(\sqrt{2}\right)^2 = 2x = √2 is a real witness.
Answer: true
4.
x = -1
Try a negative integer.
2(-1) = -2
Multiply (multiplying integers: a positive times a negative is negative).
-2 \lt -1
So 2x ≥ x is false for x = −1.
Answer: false; x = −1 is a counterexample
5.
\forall x\, (S(x) \to R(x))
“Every” goes with →.
Answer: ∀x (S(x) → R(x))
6.
\exists x\, (P(x) \land E(x))
“Some” goes with ∧.
Answer: ∃x (P(x) ∧ E(x)), which is true with witness x = 2
7.
\lnot \exists x\, (x^2 \lt 0) \equiv \forall x\, \lnot(x^2 \lt 0)
Switch ∃ to ∀ and move ¬ inside.
\equiv \forall x\, (x^2 \ge 0)
“not less than” is “greater than or equal to.”
Answer: ∀x (x² ≥ 0); the negation is true, so the original is false
8.
\lnot \forall x\, P(x) \equiv \exists x\, \lnot P(x)
With P(x): x passed the test.
Answer: Some student did not pass the test
9.
\lnot \forall x\, \exists y\, (x \lt y) \equiv \exists x\, \lnot \exists y\, (x \lt y)
Negate the first quantifier.
\equiv \exists x\, \forall y\, \lnot(x \lt y)
Negate the second quantifier.
\equiv \exists x\, \forall y\, (x \ge y)
“not less than” is “greater than or equal to.”
Answer: ∃x ∀y (x ≥ y)
10.
y = 2x
For any integer x, choose y = 2x, which is an integer.
\forall x\, \exists y\, (y = 2x) = \text{T}Every x has a matching y.
x = 0 \Rightarrow y = 0
If one y worked for every x, then x = 0 would force y = 0.
x = 1 \Rightarrow y = 2 \ne 0
But x = 1 needs y = 2.
\exists y\, \forall x\, (y = 2x) = \text{F}No single y works for every x.
Answer: the first is true and the second is false
Predicates and quantifiers FAQ
What is the difference between a predicate and a proposition?
A predicate such as P(x): “x is even” has a variable, so it has no truth value yet. It becomes a proposition when you give x a value, like P(4), or add a quantifier, like ∃x P(x).
What do ∀ and ∃ mean?
∀ is the universal quantifier, read “for all” or “for every.” ∃ is the existential quantifier, read “there exists” or “for some.”
How do you negate a statement with quantifiers?
Switch each quantifier (∀ to ∃ and ∃ to ∀) and move the negation inside, then simplify. For example, ¬∀x P(x) ≡ ∃x ¬P(x).
Does the order of quantifiers matter?
Yes, when the quantifiers are different. ∀x ∃y means each x can have its own y, while ∃y ∀x means one y works for every x. Two quantifiers of the same kind can be swapped.
Summary
- A predicate P(x) becomes a proposition when x has a value or is quantified.
- ∀x P(x) is true when P(x) holds for every x in the domain; one counterexample makes it false.
- ∃x P(x) is true when P(x) holds for at least one x; one witness makes it true.
- ¬∀x P(x) ≡ ∃x ¬P(x) and ¬∃x P(x) ≡ ∀x ¬P(x).
- “Every A is B” is ∀x (A(x) → B(x)); “some A is B” is ∃x (A(x) ∧ B(x)); the order of mixed quantifiers matters.
Previous lesson: Logical Equivalence
Next lesson: Rules of Inference
Back to the Discrete Math Index