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