Predicate Logic
809 words
4 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Predicate Logic ## 🎯 Learning Objectives - Distinguish predicates from propositions - Use universal ($\forall$) and existential ($\exists$) quantifiers - Translate between English statements and logical notation - Negate quantified statements correctly - Understand nested quantifiers and their order * * * ## 2.1...

Predicate Logic
🎯 Learning Objectives
- Distinguish predicates from propositions
- Use universal (∀) and existential (∃) quantifiers
- Translate between English statements and logical notation
- Negate quantified statements correctly
- Understand nested quantifiers and their order
2.1 Intuition: Beyond Atomic Statements
Propositional logic treats "x > 5" as a single letter P, but something is lost — the structure inside. Predicate logic lets us say: "For all x, if x>5 then x>3" — capturing the internal structure.
🔑 Key Insight: Predicates are like functions that return truth values: P(x) is true or false depending on x.
2.2 Predicates and Quantifiers
Predicates
A predicate P(x) is a statement involving a variable x. Its truth value depends on x.
Example: P(x)="x is prime."
- P(2) = True
- P(4) = False
- P(x) is not a proposition until x is specified or quantified.
Universal Quantifier (∀)
∀xP(x) means "P(x) is true for all x in the domain."
Existential Quantifier (∃)
∃xP(x) means "There exists an x such that P(x) is true."
| Statement | In English | True If... |
|---|---|---|
| ∀xP(x) | All x satisfy P | Every single x makes P true |
| ∃xP(x) | Some x satisfies P | At least one x makes P true |
2.3 Quantifier Negation
¬∀xP(x)≡∃x¬P(x) ¬∃xP(x)≡∀x¬P(x)Intuition: "Not everyone passed" = "There is someone who didn't pass."
Example: Negate "All swans are white."
- Original: ∀x(Sw(x)→Wh(x))
- Negation: ¬∀x(Sw(x)→Wh(x))≡∃x¬(Sw(x)→Wh(x))
- ≡∃x(Sw(x)∧¬Wh(x))
- English: "There exists a swan that is not white."
2.4 Nested Quantifiers
Statements with two or more quantifiers:
| Statement | Meaning | True When |
|---|---|---|
| ∀x∀yP(x,y) | For all x and all y , P holds | Always true |
| ∀x∃yP(x,y) | For each x , there is some y | y can depend on x |
| ∃x∀yP(x,y) | There's an x that works for all y | One x fits all |
| ∃x∃yP(x,y) | There exist x and y | Some pair exists |
Order Matters!
- ∀x∃y(y=x2) is true over real numbers (every number has a square)
- ∃y∀x(y=x2) is false (no single number equals every square)
2.5 Translating English to Logic
Example 1: "Everyone has someone they love."
- ∀x∃yL(x,y) where L(x,y) = "x loves y" Example 2: "There is a person who loves everyone."
- ∃x∀yL(x,y) Example 3: "If all men are mortal and Socrates is a man, then Socrates is mortal."
- [∀x(M(x)→R(x))∧M(s)]→R(s)
- M(x) = "x is a man", R(x) = "x is mortal", s = Socrates
2.6 Multiple Domain Considerations
Sometimes quantifiers range over different domains:
This is the definition of continuity — ϵ ranges over positive reals, δ over positive reals, x over real numbers.
📊 Formula Summary
| Law | Rule |
|---|---|
| Negate ∀ | ¬∀xP(x)≡∃x¬P(x) |
| Negate ∃ | ¬∃xP(x)≡∀x¬P(x) |
| Order matters | ∀x∃y≡∃y∀x |
✅ Practice Questions
Q1: Translate: "No one is perfect."
Solution¬∃xP(x) where P(x) = "x is perfect." Equivalent to ∀x¬P(x). Q2: Negate "Everyone passed the exam." SolutionOriginal: ∀xP(x). Negation: ∃x¬P(x) = "Someone did not pass." Q3: Determine truth: ∀x∈Z ∃y∈Z (x+y=0). SolutionTrue. For any integer x, choose y=−x. Then x+(−x)=0. Q4: Determine truth: ∃y∈Z ∀x∈Z (x+y=0). SolutionFalse. We'd need a single y such that x+y=0 for ALL x. If y=0, then x=0 for all x — false. No such y exists. Q5: Write the logical form of: "Some students in this class have taken every course in the program." Solution∃x(S(x)∧∀y(C(y)→T(x,y))) where S(x) = "x is a student in this class," C(y) = "y is a course in the program," T(x,y) = "x has taken y." Join Discord PreviousPropositional LogicNextQuantifier Applications