cs.thefarshad
medium

Predicate Logic

Predicates, names, variables, and the quantifiers ∀ and ∃ — capturing "all" and "some".

Sentence logic can’t see inside a sentence. “All circles are blue” and “Some circle is blue” both become single atoms — yet one entails the other, which sentence logic can’t explain. Predicate logic adds the missing structure.

  • Names (a,b,ca, b, c) denote particular objects; variables (x,y,zx, y, z) are placeholders.
  • Predicates (PxPx, BxBx, RxyRxy) express properties and relations: BxBx = “x is blue”, RxyRxy = “x relates to y”.
  • Quantifiers bind variables: ∀x\forall x (“for all x”) and ∃x\exists x (“there exists an x”). Teller writes these (x)(x) and (∃x)(\exists x).

A statement is evaluated in a model: a domain of objects plus an interpretation of each predicate. Pick predicates below and watch the universal and existential claims come out true or false over a fixed domain.

LetK(x) = "x is a",C(x) = "x is".
a K that is C (witness) a K that is not C (counterexample)
∀x (K(x) → C(x))every circle is blue: FALSE
∃x (K(x) ∧ C(x))some circle is blue: TRUE
At least one circle is not blue (red ring) — that single counterexample makes the universal FALSE.

The two translation patterns

The single most important habit in predicate logic — and the easiest thing to get wrong:

  • “Every K is C” is ∀x (Kx→Cx)\forall x\,(Kx \rightarrow Cx) — universal with a conditional. (Writing ∀x (Kx∧Cx)\forall x\,(Kx \land Cx) would say “everything is a K and is C”, which is far stronger.)
  • “Some K is C” is ∃x (Kx∧Cx)\exists x\,(Kx \land Cx) — existential with a conjunction. (Writing ∃x (Kx→Cx)\exists x\,(Kx \rightarrow Cx) is almost always wrong: it is satisfied by any non-K.)

A universal is falsified by a single counterexample (a K that is not C); an existential is verified by a single witness (a K that is C) — exactly the rings the visualizer draws.

Multiple quantifiers and order

Relations need several quantifiers, and order matters:

  • ∀x ∃y Lxy\forall x\,\exists y\,Lxy — “everyone loves someone (possibly different people)”.
  • ∃y ∀x Lxy\exists y\,\forall x\,Lxy — “there is someone whom everyone loves (one person)”.

The second implies the first, but not the reverse. Swapping two quantifiers of the same type (∀x∀y\forall x\forall y vs ∀y∀x\forall y\forall x) is harmless; swapping ∀\forall with ∃\exists changes the meaning.

Takeaways

  • Predicate logic adds names, variables, predicates/relations, and the quantifiers ∀\forall, ∃\exists.
  • Truth is relative to a model (domain + interpretation).
  • “Every K is C” = ∀x(Kx→Cx)\forall x(Kx \rightarrow Cx); “Some K is C” = ∃x(Kx∧Cx)\exists x(Kx \land Cx).
  • A universal falls to one counterexample; an existential needs one witness; quantifier order matters.

References

  • Paul Teller, A Modern Formal Logic Primer, Prentice Hall (1989) — free at tellerprimer.ucdavis.edu. Curriculum follows the primer; explanations and examples here are original.