First-Order Logic and Predicate Calculus

First-Order Logic (FOL), also called predicate calculus, is a formal system that extends propositional logic with quantifiers (∀, ∃), variables, predicates, and functions, allowing precise statements about objects and their relationships. Key result: FOL is sound and complete (Gödel, 1929) — every logically valid formula is provable, and every provable formula is valid. Where it applies: mathematics foundations, automated theorem proving, formal verification, database query languages, and the semantics of natural language. Who/when: Frege (1879), Peirce, Skolem, Hilbert & Ackermann, and Gödel (1929–1930).

First-order logic is the standard formal language for expressing mathematical statements with quantification over individuals. It augments propositional logic — which can only combine atomic truth-bearers with connectives — by introducing a domain of objects, variables ranging over that domain, predicate symbols denoting properties and relations, function symbols, and the two quantifiers "for all" (∀) and "there exists" (∃). Its central importance lies in being expressive enough to formalize essentially all of classical mathematics (via set theory) while remaining tame enough to enjoy a complete proof system. A surprising fact: although FOL is complete, it is also undecidable (Church–Turing, 1936) — there is no algorithm that decides validity in general — and it cannot pin down the natural numbers up to isomorphism (the Löwenheim–Skolem theorems guarantee unintended models of every size).

The Core Insight

Propositional logic treats "Socrates is mortal" as a single opaque atom. First-order logic decomposes it into a predicate applied to a term: . By introducing variables and quantifiers, we can then say things like "every human is mortal," , and combine such statements to derive new ones. The genius is the clean separation between syntax (what strings count as formulas and proofs) and semantics (what those strings mean over a structure), bridged by the soundness and completeness theorems.

Formal Statement

The Language (Signature) of First-Order Logic

A first-order signature (or vocabulary) consists of:

  • A set of constant symbols (names for fixed objects).
  • A set of function symbols , each with an arity .
  • A set of predicate (relation) symbols , each with an arity .

Together with a fixed countable supply of variables , the logical symbols , the quantifiers , the equality symbol (in FOL with equality), and parentheses.

Terms are defined recursively:
1
⟳A term is either a variable, a constant, or a function symbol applied to the right number of previously-built terms; this recursion bottoms out at variables and constants.
Formulas are defined recursively:
2
⟳Atomic formulas come from applying a predicate to terms or asserting equality; complex formulas are built by connectives and quantifiers. The first two cases (atomic) anchor the recursion.

Free and Bound Variables; Sentences

An occurrence of a variable is bound if it lies within the scope of a quantifier or ; otherwise it is free. A formula with no free variables is a sentence (closed formula). Only sentences have a definite truth value in a structure. The set of free variables of is written .

The substitution replaces every free occurrence of by the term , provided is free for in (no variable of becomes accidentally captured by a quantifier).

Structures and Satisfaction (Tarskian Semantics)

A structure (model) for signature consists of a nonempty domain and an interpretation assigning:

  • to each constant an element ;
  • to each -ary function symbol a function ;
  • to each -ary predicate a relation .

A variable assignment maps variables to elements of . The value of a term and the satisfaction relation are defined recursively. The two crucial clauses are:

3
⟳The universal quantifier is satisfied exactly when the body holds under every possible reassignment of to an element of the domain — the assignment agrees with except it sends to .
4
⟳The existential is the dual; satisfaction needs only one witness . Note , so [4] follows from [3] and the clause for .

Validity, Satisfiability, Entailment

  • is valid () if for every structure and assignment.
  • is satisfiable if some structure satisfies it.
  • A set of sentences entails () if every model of all of is also a model of .
5
⟳If every model of satisfies , no model can satisfy both and , and conversely; this is the semantic refutation principle underlying resolution.

Gödel's Completeness Theorem (1929)

For a first-order theory with a sound and complete deductive system (e.g., a Hilbert system or natural deduction):

6
⟳Soundness () is proved by induction on proof length, checking each inference rule preserves truth. Completeness () is proved by contraposition: if then is consistent, hence (Henkin construction) has a model, so .

Compactness and Löwenheim–Skolem

Compactness: has a model iff every finite subset of has a model. Downward Löwenheim–Skolem: If a countable signature theory has an infinite model, it has a countably infinite model. Upward Löwenheim–Skolem: If it has an infinite model, it has models of every infinite cardinality .

Why It Holds / Derivation

Soundness of First-Order Deduction

We show by induction on the length of the derivation, using a natural-deduction-style system.

Step 1 (Base — assumptions/axioms). If , then trivially every model of satisfies . Logical axioms (e.g., ) are tautologies, valid in every structure. Step 2 (Modus ponens). Suppose by induction and . Take any model . Then and , so by the semantic clause for , . Hence . Step 3 (Universal generalization). Suppose and ; we must show . Let under assignment . For any , since is not free in , also under , so . By [3], . Step 4 (Universal instantiation). From infer for free for . If , then holds for every domain element, in particular for , which (by the substitution lemma) is what asserts.

Each rule preserves validity over models of ; by induction the full derivation does.

Sketch of Completeness via Henkin Construction

Goal: a consistent has a model.

Step 1. Expand the language with a countable set of fresh witness constants. For each formula , add a Henkin axiom with a new constant . The resulting theory remains consistent. Step 2. Extend to a maximal consistent set (Lindenbaum's lemma): every sentence or its negation is in , and is deductively closed. Step 3. Build the term model: the domain is the set of closed terms, quotiented by the equivalence . Interpret symbols by their syntactic action on terms. Step 4 (Truth lemma). Prove by induction on formula structure that . The Henkin axioms make the existential case work: a witness constant supplies the required domain element. Step 5. Since , . Thus consistency implies satisfiability; contrapositively, .

Kurt Gödel | 1906–1978

Born in Brünn (now Brno), Gödel proved the completeness theorem for first-order logic in his 1929 doctoral dissertation at the University of Vienna, settling a problem Hilbert and Ackermann had posed. Just two years later he overturned the foundationalist program with his incompleteness theorems, showing that any consistent, sufficiently strong, recursively axiomatized theory cannot prove its own consistency and leaves true arithmetical sentences unprovable. The contrast is essential: completeness is about the logic (FOL captures all valid consequences), while incompleteness is about particular theories (no axiom set fully captures arithmetic). Gödel later emigrated to Princeton, became a close friend of Einstein, and made deep contributions to set theory (the constructible universe and the consistency of CH and AC) and even general relativity.

Building Intuition

Think of FOL as a precise grammar for "objects and their relationships." A structure is a world: a bag of objects together with facts about which properties they have and which relations hold among them. A formula with free variables is like a sentence with blanks — "___ loves ___" — that becomes true or false only once you fill the blanks with specific objects (the assignment ). The quantifiers automate the filling: says "try every object in the blank and it always works," while says "some object makes it work."

The key conceptual leap from propositional logic is quantifier scope and variable binding. The same letter can mean different things in different scopes, exactly like local variables in a programming function. Capture-avoiding substitution is the logical analogue of safe variable renaming. And the order of quantifiers matters profoundly: "" (every number has a bigger one — true for integers) is wholly different from "" (one number bigger than all — false).

Quantifier order: ∀x∃y vs ∃y∀x over a domain

Quantifier Order over domain D = {a, b, c} ∀x ∃y : R(x,y) — TRUE a b c a b c each x picks its own y ∃y ∀x : R(x,y) — FALSE here a b c y? no single y works for all x

Worked Examples

Translating and Evaluating a Sentence over the Integers

Given: Domain , with the usual interpretation of and . Consider the sentence
Step 1 — Read the structure. The quantifiers range over all integers; is integer addition; is equality. Step 2 — Verify the body for arbitrary . Fix any integer (the value assigned to ). We need a with . Step 3 — Supply a witness. Take , which exists in . Then holds. By clause [4], is satisfied under . Step 4 — Generalize. Since was arbitrary, by clause [3] the universal statement holds. Boxed answer:

Contrast: over this is false (no witness for , since ) — demonstrating that truth depends on the structure.

A Formal Natural-Deduction Proof

Given: Prove Step 1 — Existential elimination. From , introduce a fresh constant (not occurring elsewhere) with the assumption . Step 2 — Universal instantiation. From infer by substituting for (rule from proof Step 4 above). Step 3 — Modus ponens. From and derive . Step 4 — Existential introduction. From derive . Step 5 — Discharge. Since contains no occurrence of the fresh constant , the -elimination box closes legitimately, yielding from the original premises. Boxed answer:

The eigenvariable condition (fresh not in conclusion or premises) is what makes Step 5 valid; violating it leads to fallacies.

Common Misconceptions

Quantifier scope and the eigenvariable condition

A very common error is treating and as interchangeable — they are not (see the diagram above). Another frequent mistake is illegitimate substitution that captures variables: substituting for in would wrongly yield , a falsehood, because was not free for . Always rename bound variables first. Finally, in natural deduction, the eigenvariable / fresh-constant condition on -introduction and -elimination is not optional bookkeeping — dropping it lets you "prove" , which is invalid.

FOL cannot express "finitely many" or define the standard naturals

One might hope FOL can characterize the natural numbers. It cannot. By compactness, add to the Peano axioms a new constant together with the infinitely many sentences . Every finite subset is satisfiable (interpret as a large enough standard number), so by compactness the whole set has a model — a nonstandard model of arithmetic containing an "infinite" element unreachable from by finitely many successors. Likewise, "there are finitely many objects" is not expressible by any single first-order sentence, nor is the notion of a well-ordering or connectedness of a graph. These limitations motivate second-order logic and infinitary logics.

Connections

First-order logic sits between weaker and stronger systems. It strictly extends Propositional Logic by adding quantifiers and internal structure to atomic statements; conversely, the propositional fragment is recovered by treating -ary predicates as proposition letters. Above it lies Second-Order Logic, which quantifies over predicates and sets, gaining expressive power (it can characterize categorically) but losing completeness and compactness. FOL is the working language of Zermelo–Fraenkel Set Theory, in which virtually all mathematics is formalized, and its metatheory connects to Model Theory (study of structures and definability) and Computability Theory (via the undecidability of validity). The deductive side links to Natural Deduction and Resolution, the backbone of automated provers.

Real-World Applications

  1. Automated theorem proving: Systems like Vampire, E, and Prover9 use first-order resolution and superposition to prove mathematical and verification goals automatically.
  2. Formal verification of hardware/software: SMT solvers (Z3, CVC5) decide fragments of FOL with theories (arithmetic, arrays) to verify circuits, compilers, and concurrent protocols.
  3. Relational databases: SQL's core is essentially the FOL fragment relational calculus; Codd's theorem equates it with relational algebra, so every safe FOL query corresponds to an executable query plan.
  4. Knowledge representation / the Semantic Web: Description logics underpinning OWL are decidable fragments of FOL used in ontologies (e.g., medical SNOMED CT, Google's Knowledge Graph).
  5. Logic programming: Prolog computes with Horn-clause subsets of FOL via SLD-resolution, used in expert systems and natural-language parsing.
  6. Compiler and program analysis: Hoare-logic verification conditions and separation-logic proofs are discharged as FOL entailments.
  7. Formal mathematics libraries: Proof assistants (Mizar, Metamath, parts of Isabelle) encode theorems as first-order or higher-order derivations checkable by machine.

Historical Development

  • 1879 — Gottlob Frege publishes Begriffsschrift, introducing quantifiers and bound variables — the birth of modern predicate logic (in a two-dimensional notation).
  • 1885 — Charles Sanders Peirce and his student O. H. Mitchell independently develop quantifier notation; Peirce coins much of the relational vocabulary.
  • 1910–1913 — Whitehead and Russell's Principia Mathematica systematizes logic and attempts to derive mathematics from it.
  • 1915–1920 — Leopold Löwenheim (1915) and Thoralf Skolem (1920) prove the Löwenheim–Skolem theorems, exposing the existence of unintended models.
  • 1928 — Hilbert and Ackermann's Grundzüge der theoretischen Logik cleanly isolates first-order logic and poses the completeness question.
  • 1929–1930 — Kurt Gödel proves the completeness theorem in his dissertation; published 1930.
  • 1931 — Gödel's incompleteness theorems show no recursive consistent theory of arithmetic is complete.
  • 1936 — Alonzo Church and Alan Turing independently prove the undecidability of first-order validity (the Entscheidungsproblem has no solution).
  • 1949–1965 — Henkin's elegant completeness proof (1949), Robinson's resolution (1965) launching automated deduction.

Subtleties & Limits

First-order logic is undecidable in general (no algorithm decides validity), yet many fragments are decidable, and the precise boundary is a rich research area: the two-variable fragment is decidable, as is the guarded fragment, while is undecidable. Determining the exact complexity of important fragments (e.g., extensions with counting quantifiers, transitive closure, or modal/temporal operators) remains active. Open and hard practical questions include: scalable decision procedures for combined theories (SMT), the precise expressive trade-offs of description logics for the Semantic Web, and the long-standing program of finite model theory — where compactness and completeness fail and whose central question, the existence of a logic capturing exactly the polynomial-time queries (Chandra–Harel / Gurevich conjecture), is intimately tied to P versus NP.

See Also

Propositional Logic · Second-Order Logic · Model Theory · Zermelo–Fraenkel Set Theory · Gödel's Incompleteness Theorems · Natural Deduction · Resolution · Computability Theory · Finite Model Theory

Before this

Where this leads