Skip to content

Predicate Logic

Predicate Logic = First Order Logic

  • Cannot represent statements involving objects and their properties
  • Cannot express “for all” or “there exists”
  • Cannot handle relationships between objects
  • Cannot generalize patterns

Example limitations:

  • “All students passed” - cannot express relationship between students and passing
  • “Some number is prime” - cannot quantify over numbers
  • “Every integer has a successor” - cannot express universal property
  • Propositional logic treats “John is tall” and “Mary is tall” as unrelated
  • Extends propositional logic with variables, predicates, and quantifiers
  • Also called First Order Logic (FOL)
  • Can express properties of objects and relationships
  • More expressive power than propositional logic

Components:

  1. Variables: x, y, z (represent objects)
  2. Predicates: P(x), Q(x,y) (properties/relations)
  3. Quantifiers: ∀ (for all), ∃ (there exists)
  4. Connectives: ¬, ∧, ∨, →, ↔ (same as propositional logic)
  5. Constants: a, b, c (specific objects)
  6. Functions: f(x), g(x,y) (map objects to objects)
  • A predicate is a statement with variables that becomes a proposition when values are assigned
  • Notation: P(x), Q(x,y), R(x,y,z)
  • P(x) - unary predicate (one variable)
  • Q(x,y) - binary predicate (two variables)

Examples:

  • P(x): “x is even”
    • P(4) → True (4 is even)
    • P(5) → False (5 is not even)
  • Q(x,y): “x > y”
    • Q(5,3) → True
    • Q(2,7) → False
  • R(x): “x is a prime number”
  • S(x,y): “x is a parent of y”

Truth value:

  • Predicate alone has NO truth value
  • Becomes proposition when:
    • Variables are assigned values, OR
    • Variables are quantified
  • Set of all possible values that variables can take
  • Must be clearly defined
  • Affects truth value of quantified statements

Examples:

  • Domain = Z\mathbb{Z} (Integers): {…, -2, -1, 0, 1, 2, …}
  • Domain = N\mathbb{N} (Natural numbers): {0, 1, 2, 3, …}
  • Domain = Students in a class
  • Domain = All humans
  • Domain = Real numbers R\mathbb{R}

GATE Important:

  • Same statement can be true in one domain, false in another
  • Always check domain carefully

Example:

  • x(x20)\forall x (x^2 \geq 0)
    • True if domain = R\mathbb{R} (Real numbers)
    • Also true if domain = Z\mathbb{Z} (Integers)

Used to specify how many elements in the domain satisfy a predicate

Universal Quantifier (∀) - “For All”
Section titled “Universal Quantifier (∀) - “For All””

Notation: x,P(x)\forall x , P(x)

Meaning: P(x) is true for ALL x in the domain

Truth condition:

  • True: P(x) is true for every single element
  • False: If even ONE element violates P(x)

Examples:

  • x(x>0)\forall x (x > 0) - “All x are positive”

    • False in domain Z\mathbb{Z} (integers include negatives)
    • True in domain N+\mathbb{N}^+ (positive naturals)
  • x(x20)\forall x (x^2 \geq 0) - “Square of every x is non-negative”

    • True in domain R\mathbb{R} (real numbers)
  • x,Student(x)Passed(x)\forall x , \text{Student}(x) \to \text{Passed}(x) - “All students passed”

Key point: One counterexample makes it false

Existential Quantifier (∃) - “There Exists”
Section titled “Existential Quantifier (∃) - “There Exists””

Notation: x,P(x)\exists x , P(x)

Meaning: There exists AT LEAST ONE x such that P(x) is true

Truth condition:

  • True: If at least one element satisfies P(x)
  • False: If NO element satisfies P(x)

Examples:

  • x(x2=4)\exists x (x^2 = 4) - “There exists x whose square is 4”

    • True in domain Z\mathbb{Z} (x = 2 or x = -2)
  • x(x>10)\exists x (x > 10) - “There exists x greater than 10”

    • True in domain N\mathbb{N} (many such numbers exist)
    • False in domain {1, 2, 3, 4, 5}
  • x,Prime(x)Even(x)\exists x , \text{Prime}(x) \land \text{Even}(x) - “There exists an even prime”

    • True (x = 2)

Key point: One example makes it true

Notation: !x,P(x)\exists! x , P(x)

Meaning: There exists EXACTLY ONE x such that P(x) is true

Expansion: !x,P(x)x,(P(x)y,(P(y)y=x))\exists! x , P(x) \equiv \exists x , (P(x) \land \forall y , (P(y) \to y = x))

Example:

  • !x(x+5=8)\exists! x (x + 5 = 8) - “There exists exactly one x such that x + 5 = 8”
    • True (only x = 3)
  • Multiple quantifiers in same statement
  • Order matters critically

Examples:

1. x,y,P(x,y)\forall x , \exists y , P(x,y)

  • “For every x, there exists some y such that P(x,y)”
  • For each x, we can pick DIFFERENT y
  • Example: x,y,(y>x)\forall x , \exists y , (y > x) - True in Z\mathbb{Z}
    • For any integer x, there exists larger integer y

2. y,x,P(x,y)\exists y , \forall x , P(x,y)

  • “There exists one y that works for ALL x”
  • Same y must work for every x
  • Example: y,x,(y>x)\exists y , \forall x , (y > x) - False in Z\mathbb{Z}
    • No single integer is greater than all integers

Key GATE Point: x,y,P(x,y)≢y,x,P(x,y)\forall x , \exists y , P(x,y) \not\equiv \exists y , \forall x , P(x,y)

More Examples:

3. x,y,P(x,y)\forall x , \forall y , P(x,y)

  • Same as y,x,P(x,y)\forall y , \forall x , P(x,y) (order doesn’t matter for same quantifier)
  • “For all x and all y, P(x,y) is true”

4. x,y,P(x,y)\exists x , \exists y , P(x,y)

  • Same as y,x,P(x,y)\exists y , \exists x , P(x,y) (order doesn’t matter for same quantifier)
  • “There exist x and y such that P(x,y) is true”

5. x,y,z,P(x,y,z)\forall x , \exists y , \forall z , P(x,y,z)

  • For every x, there exists y (possibly different for each x), such that for all z, P(x,y,z)

Truth Table for Nested Quantifiers:

StatementMeaning
x,y,P(x,y)\forall x , \forall y , P(x,y)P holds for all pairs
x,y,P(x,y)\exists x , \exists y , P(x,y)P holds for at least one pair
x,y,P(x,y)\forall x , \exists y , P(x,y)For each x, some y works
x,y,P(x,y)\exists x , \forall y , P(x,y)Some x works for all y
y,x,P(x,y)\exists y , \forall x , P(x,y)Some y works for all x (NOT same as above)

Bound Variable:

  • Variable that is quantified
  • Scope limited to quantifier

Free Variable:

  • Variable NOT quantified
  • Truth value depends on assignment

Examples:

1. x,P(x,y)\forall x , P(x, y)

  • x → bound (quantified by ∀)
  • y → free (not quantified)
  • Truth value depends on value of y

2. x,(P(x)Q(x,y))\exists x , (P(x) \land Q(x, y))

  • x → bound
  • y → free

3. x,y,R(x,y,z)\forall x , \exists y , R(x, y, z)

  • x → bound by ∀
  • y → bound by ∃
  • z → free

4. x,P(x)\forall x , P(x)

  • x → bound
  • No free variables (closed formula)

GATE Important:

  • Formula with no free variables = Sentence/Closed Formula
  • Formula with free variables = Open Formula
  • Only sentences have definite truth values
  • Portion of formula where quantifier applies
  • Usually indicated by parentheses

Examples:

1. x,(P(x)Q(x))\forall x , (P(x) \to Q(x))

  • Scope of ∀x: entire (P(x)Q(x))(P(x) \to Q(x))

2. (x,P(x))Q(y)(\forall x , P(x)) \to Q(y)

  • Scope of ∀x: only P(x)P(x)
  • y is free in Q(y)

3. x,P(x)Q(y)\forall x , P(x) \land Q(y)

  • Ambiguous! Use parentheses
  • Could mean: x,(P(x)Q(y))\forall x , (P(x) \land Q(y)) OR (x,P(x))Q(y)(\forall x , P(x)) \land Q(y)

Convention:

  • Quantifier has lowest precedence
  • x,P(x)Q(x)\forall x , P(x) \land Q(x) means x,(P(x)Q(x))\forall x , (P(x) \land Q(x))

Same connectives as propositional logic, but operate on predicates:

  • ¬P(x)\neg P(x) - NOT
  • P(x)Q(x)P(x) \land Q(x) - AND
  • P(x)Q(x)P(x) \lor Q(x) - OR
  • P(x)Q(x)P(x) \to Q(x) - Implication
  • P(x)Q(x)P(x) \leftrightarrow Q(x) - Biconditional

Examples:

  • x,(P(x)Q(x))\forall x , (P(x) \to Q(x)) - “If x has property P, then x has property Q”
  • x,(P(x)Q(x))\exists x , (P(x) \land Q(x)) - “There exists x with both properties P and Q”
  • x,(P(x)Q(x))\forall x , (P(x) \lor Q(x)) - “Every x has property P or property Q”
Negation of Quantifiers (Very Important for GATE)
Section titled “Negation of Quantifiers (Very Important for GATE)”

Rule 1: ¬(x,P(x))x,¬P(x)\neg(\forall x , P(x)) \equiv \exists x , \neg P(x)

Meaning:

  • “NOT all x satisfy P” = “There exists x that does NOT satisfy P”

Example:

  • Statement: “All students passed”
  • Negation: “At least one student did not pass”

Rule 2: ¬(x,P(x))x,¬P(x)\neg(\exists x , P(x)) \equiv \forall x , \neg P(x)

Meaning:

  • “There does NOT exist x satisfying P” = “All x do NOT satisfy P”

Example:

  • Statement: “There exists a perfect square that is negative”
  • Negation: “All perfect squares are non-negative”

Nested Quantifiers Negation:

1. ¬(x,y,P(x,y))\neg(\forall x , \exists y , P(x,y)) x,¬(y,P(x,y))\equiv \exists x , \neg(\exists y , P(x,y)) x,y,¬P(x,y)\equiv \exists x , \forall y , \neg P(x,y)

2. ¬(x,y,P(x,y))\neg(\exists x , \forall y , P(x,y)) x,¬(y,P(x,y))\equiv \forall x , \neg(\forall y , P(x,y)) x,y,¬P(x,y)\equiv \forall x , \exists y , \neg P(x,y)

General Rule:

  • Push negation inward
  • Flip each quantifier (∀ becomes ∃, ∃ becomes ∀)
  • Negate the predicate at the end

GATE Major Trap:

  • ¬x,P(x)≢x,¬P(x)\neg \forall x , P(x) \not\equiv \forall x , \neg P(x)
  • Correct: ¬x,P(x)x,¬P(x)\neg \forall x , P(x) \equiv \exists x , \neg P(x)

Definition: Two formulas are equivalent if they have same truth value for all interpretations

Important Equivalences:

1. Distributive Laws: x,(P(x)Q(x))(x,P(x))(x,Q(x))\forall x , (P(x) \land Q(x)) \equiv (\forall x , P(x)) \land (\forall x , Q(x)) x,(P(x)Q(x))(x,P(x))(x,Q(x))\exists x , (P(x) \lor Q(x)) \equiv (\exists x , P(x)) \lor (\exists x , Q(x))

WARNING - NOT Equivalent: x,(P(x)Q(x))≢(x,P(x))(x,Q(x))\forall x , (P(x) \lor Q(x)) \not\equiv (\forall x , P(x)) \lor (\forall x , Q(x)) x,(P(x)Q(x))≢(x,P(x))(x,Q(x))\exists x , (P(x) \land Q(x)) \not\equiv (\exists x , P(x)) \land (\exists x , Q(x))

2. De Morgan’s for Quantifiers: ¬(x,P(x))x,¬P(x)\neg(\forall x , P(x)) \equiv \exists x , \neg P(x) ¬(x,P(x))x,¬P(x)\neg(\exists x , P(x)) \equiv \forall x , \neg P(x)

3. Implication: x,(P(x)Q(x))x,(¬P(x)Q(x))\forall x , (P(x) \to Q(x)) \equiv \forall x , (\neg P(x) \lor Q(x))

4. Contrapositive: x,(P(x)Q(x))x,(¬Q(x)¬P(x))\forall x , (P(x) \to Q(x)) \equiv \forall x , (\neg Q(x) \to \neg P(x))

5. Quantifier Commutation (Same Type): x,y,P(x,y)y,x,P(x,y)\forall x , \forall y , P(x,y) \equiv \forall y , \forall x , P(x,y) x,y,P(x,y)y,x,P(x,y)\exists x , \exists y , P(x,y) \equiv \exists y , \exists x , P(x,y)

6. Different Quantifiers - NOT Commutative: x,y,P(x,y)≢y,x,P(x,y)\forall x , \exists y , P(x,y) \not\equiv \exists y , \forall x , P(x,y)

7. Prenex Normal Form:

  • All quantifiers moved to front
  • Example: x,y,(P(x)Q(y))\forall x , \exists y , (P(x) \to Q(y)) is in prenex form

Valid (Logically True):

  • True for ALL interpretations (all domains, all predicates)
  • Example: x,P(x)x,P(x)\forall x , P(x) \to \exists x , P(x)
    • “If P holds for all, then P holds for at least one”

Satisfiable:

  • True for AT LEAST ONE interpretation
  • Example: x,P(x)\exists x , P(x)
    • Can be true in some domain

Unsatisfiable (Contradiction):

  • False for ALL interpretations
  • Example: x,P(x)x,¬P(x)\forall x , P(x) \land \exists x , \neg P(x)
    • “All x have P AND some x doesn’t have P”

Relationships:

  • Valid ⇒ Satisfiable
  • Unsatisfiable ⇒ Not Valid
  • FF is valid ⟺ ¬F\neg F is unsatisfiable
  • A statement with quantifiers assumed to be true
  • Requires formal proof or counterexample
  • Common in mathematical reasoning

Examples:

  • Goldbach’s Conjecture: n,(n>2Even(n)p,q,(Prime(p)Prime(q)n=p+q))\forall n , (n > 2 \land \text{Even}(n) \to \exists p , \exists q , (\text{Prime}(p) \land \text{Prime}(q) \land n = p + q))
  • Collatz Conjecture: Properties of iterative sequences

Domain: All people

EnglishPredicate Logic
”All students are intelligent"x,(Student(x)Intelligent(x))\forall x , (\text{Student}(x) \to \text{Intelligent}(x))
"Some student is intelligent"x,(Student(x)Intelligent(x))\exists x , (\text{Student}(x) \land \text{Intelligent}(x))
"No student is lazy"x,(Student(x)¬Lazy(x))\forall x , (\text{Student}(x) \to \neg \text{Lazy}(x))
"Not all students passed"¬x,(Student(x)Passed(x))\neg \forall x , (\text{Student}(x) \to \text{Passed}(x))
"Every student loves some professor"x,(Student(x)y,(Professor(y)Loves(x,y)))\forall x , (\text{Student}(x) \to \exists y , (\text{Professor}(y) \land \text{Loves}(x,y)))
"Some professor is loved by all students”y,(Professor(y)x,(Student(x)Loves(x,y)))\exists y , (\text{Professor}(y) \land \forall x , (\text{Student}(x) \to \text{Loves}(x,y)))

Key Pattern:

  • “All A are B” → x,(A(x)B(x))\forall x , (A(x) \to B(x)) (use →)
  • “Some A is B” → x,(A(x)B(x))\exists x , (A(x) \land B(x)) (use ∧)
  • “No A is B” → x,(A(x)¬B(x))\forall x , (A(x) \to \neg B(x))

GATE Trap:

  • x,(Student(x)Passed(x))\forall x , (\text{Student}(x) \land \text{Passed}(x)) is WRONG for “All students passed”
  • Correct: x,(Student(x)Passed(x))\forall x , (\text{Student}(x) \to \text{Passed}(x))
  1. Difference between ∀ and ∃
    • ∀ = all, ∃ = at least one
  2. Negation of quantified statements
    • Flip quantifier, negate predicate
  3. Order of quantifiers
    • x,y≢y,x\forall x , \exists y \not\equiv \exists y , \forall x
  4. Bound vs free variables
    • Quantified vs not quantified
  5. Valid vs satisfiable statements
    • Valid = always true, Satisfiable = sometimes true
  6. Translation from English to logic
    • “All” uses →, “Some” uses ∧
  7. Scope of quantifiers
    • Use parentheses clearly
  8. Distributive property limitations
    • Works for ∀ with ∧, ∃ with ∨ only
  9. Contrapositive in predicate logic
    • x(P(x)Q(x))x(¬Q(x)¬P(x))\forall x (P(x) \to Q(x)) \equiv \forall x (\neg Q(x) \to \neg P(x))
  10. Nested quantifier negation
    • Push negation through, flip each quantifier
  1. Universal with AND (Wrong):

    • “All students passed” ≠ x,(Student(x)Passed(x))\forall x , (\text{Student}(x) \land \text{Passed}(x))
    • Correct: x,(Student(x)Passed(x))\forall x , (\text{Student}(x) \to \text{Passed}(x))
  2. Existential with Implication (Wrong):

    • “Some student passed” ≠ x,(Student(x)Passed(x))\exists x , (\text{Student}(x) \to \text{Passed}(x))
    • Correct: x,(Student(x)Passed(x))\exists x , (\text{Student}(x) \land \text{Passed}(x))
  3. Negation Flip:

    • ¬x,P(x)≢x,¬P(x)\neg \forall x , P(x) \not\equiv \forall x , \neg P(x)
    • Correct: ¬x,P(x)x,¬P(x)\neg \forall x , P(x) \equiv \exists x , \neg P(x)
  4. Quantifier Order:

    • x,y,P(x,y)\forall x , \exists y , P(x,y) very different from y,x,P(x,y)\exists y , \forall x , P(x,y)
  5. Distribution Error:

    • x,(P(x)Q(x))≢(x,P(x))(x,Q(x))\exists x , (P(x) \land Q(x)) \not\equiv (\exists x , P(x)) \land (\exists x , Q(x))
  6. Free Variables:

    • Formula with free variables has no definite truth value

¬(x,P(x))x,¬P(x)\neg(\forall x , P(x)) \equiv \exists x , \neg P(x) ¬(x,P(x))x,¬P(x)\neg(\exists x , P(x)) \equiv \forall x , \neg P(x) x,(P(x)Q(x))(x,P(x))(x,Q(x))\forall x , (P(x) \land Q(x)) \equiv (\forall x , P(x)) \land (\forall x , Q(x)) x,(P(x)Q(x))(x,P(x))(x,Q(x))\exists x , (P(x) \lor Q(x)) \equiv (\exists x , P(x)) \lor (\exists x , Q(x)) x,(P(x)Q(x))x,(¬Q(x)¬P(x))\forall x , (P(x) \to Q(x)) \equiv \forall x , (\neg Q(x) \to \neg P(x)) x,y,P(x,y)y,x,P(x,y)\forall x , \forall y , P(x,y) \equiv \forall y , \forall x , P(x,y) x,y,P(x,y)≢y,x,P(x,y)\forall x , \exists y , P(x,y) \not\equiv \exists y , \forall x , P(x,y)

  1. Quantifier negation is critical - flip and negate
  2. Order matters for different quantifiers - ≢\forall \exists \not\equiv \exists \forall
  3. Use → for “all”, ∧ for “some” - standard pattern
  4. Bound variables are dummy variables - can be renamed
  5. Free variables prevent truth assignment - only sentences have truth values
  6. Distributive laws are limited - only certain combinations work
  7. Domain affects truth - always check universe of discourse
  8. Nested quantifiers need care - work from outside in
  9. Prenex form simplifies - move all quantifiers to front
  10. Practice translation - English ↔ Predicate Logic is key skill