Predicates
A predicate is a statement containing variables that becomes a proposition when values are substituted.
Notation
- P(x): predicate with one variable
- Q(x,y): predicate with two variables
Example
Let P(x): "x>3"
- P(4) is true
- P(2) is false
Quantifiers
Universal Quantifier (∀)
∀xP(x)
Means: "For all x, P(x) is true"
True when: P(x) is true for every element in the domain.
Existential Quantifier (∃)
∃xP(x)
Means: "There exists an x such that P(x) is true"
True when: P(x) is true for at least one element in the domain.
Uniqueness Quantifier (∃!)
∃!xP(x)
Means: "There exists exactly one x such that P(x) is true"
∃!xP(x)≡∃x(P(x)∧∀y(P(y)→y=x))
Domain of Discourse
The domain (or universe of discourse) specifies what values variables can take.
Example
If domain is Z+ (positive integers):
- ∀x(x>0) is true
- ∃x(x<0) is false
Negating Quantifiers
De Morgan's Laws for Quantifiers
¬∀xP(x)≡∃x¬P(x)
¬∃xP(x)≡∀x¬P(x)
Example
¬"All students passed" ≡ "Some student did not pass"
¬∀xPassed(x)≡∃x¬Passed(x)
Nested Quantifiers
Order Matters!
∀x∃yP(x,y)≡∃y∀xP(x,y)
Examples
Let L(x,y): "x loves y"
| Statement | Meaning |
|---|
| ∀x∀yL(x,y) | Everyone loves everyone |
| ∃x∃yL(x,y) | Someone loves someone |
| ∀x∃yL(x,y) | Everyone loves someone |
| ∃y∀xL(x,y) | Someone is loved by everyone |
| ∃x∀yL(x,y) | Someone loves everyone |
Negating Nested Quantifiers
Move negation inward, flipping each quantifier:
¬∀x∃yP(x,y)≡∃x∀y¬P(x,y)
Example
¬"Every student has taken some course"
= "Some student has taken no courses"
¬∀s∃cTaken(s,c)≡∃s∀c¬Taken(s,c)
Translating English to Logic
Common Patterns
| English | Logical Form |
|---|
| All A are B | ∀x(A(x)→B(x)) |
| Some A are B | ∃x(A(x)∧B(x)) |
| No A are B | ∀x(A(x)→¬B(x)) |
| Some A are not B | ∃x(A(x)∧¬B(x)) |
Example
"Every prime greater than 2 is odd"
Let P(x): "x is prime", G(x): "x>2", O(x): "x is odd"
∀x((P(x)∧G(x))→O(x))
Bound and Free Variables
- Bound variable: Quantified variable
- Free variable: Not quantified
In ∀x(P(x)∧Q(x,y)):
Rules of Inference for Quantifiers
Universal Instantiation
P(c)∀xP(x) for any c in domain
Universal Generalization
∀xP(x)P(c) for arbitrary c
Existential Instantiation
P(c) for some element c∃xP(x)
Existential Generalization
∃xP(x)P(c) for some element c