Contents / Mathematical Logic / Predicate Logic
Chapter 2
Predicate Logic
First-order logic, predicates, quantifiers, free and bound variables, and interpretations.
Introduction
Propositional logic treats a sentence as an unanalysed atom. It can tell you that if "Socrates is a man" then "Socrates is mortal", but it cannot see inside either sentence, and so it cannot explain why the inference from "every man is mortal" to "Socrates is mortal" is valid. First-order logic — predicate logic — opens the atom. It names objects with terms, says things about them with predicates, and quantifies over them with and . The result is a language in which essentially all of mathematics can be written down, together with a semantics precise enough to say what those sentences mean and a proof calculus that is sound and complete for that semantics.
This chapter builds the subject in the order the definitions actually depend on each other: first the language (pure syntax, no meaning at all), then the bookkeeping of free and bound variables and substitution, then structures and Tarski's recursive definition of truth, then entailment and validity, then two theorems that tie syntax and semantics together — prenex normal form and the soundness of a proof calculus.
2.1First-Order Languages: Terms, Formulas, Unique Readability
A first-order language is a purely formal object: a set of symbols and rules for stringing them together. Nothing in this section is about truth. Meaning arrives two sections later, and keeping the two apart is the single most important habit in the subject — it is what makes it possible to ask whether a syntactic notion (provability) matches a semantic one (truth in every structure).
Definition 2.1 (First-order language). A first-order language consists of
- logical symbols, the same for every language: variables (an infinite supply), connectives , quantifiers , the equality symbol , and the punctuation marks , and the comma;
- a signature: a set of constant symbols , a set of function symbols each with an arity , and a set of relation (predicate) symbols each with an arity .
The logical symbols are fixed furniture; a language is its signature.
Notation. We write for the language of arithmetic ( a constant, unary, and binary, a binary relation), and for the language of groups. Arities are part of the data: the same symbol cannot be unary in one formula and binary in the next.
Terms are the noun phrases of the language: expressions that name objects. They are generated from below, and the phrase "nothing else is a term" in the definition is doing real work — it is what licenses proof by induction on terms.
Definition 2.2 (Term). The set of -terms is the smallest set such that
- every variable is in ;
- every constant symbol of is in ;
- if is an -ary function symbol of and , then the string is in .
A term containing no variables is a closed term (or ground term).
Because is the smallest such set, every term is built by finitely many applications of these clauses, and a property that holds of variables and constants and is preserved by clause 3 holds of every term. That is the induction principle for terms, used throughout the chapter without further comment.
Definition 2.3 (Atomic formula). An atomic -formula is a string of one of the two shapes
where is an -ary relation symbol of and are -terms. A -ary relation symbol standing alone is atomic too; it behaves exactly like a propositional variable.
Definition 2.4 (Well-formed formula). The set of -formulas (well-formed formulas, wffs) is the smallest set with
- every atomic -formula is in ;
- if then ;
- if then , and are in ;
- if and is a variable then and are in .
Pitfall. A term is never a formula and a formula is never a term. names the number two; it is not true or false, and is not a grammatical mistake to be argued about — it is simply not a string the definition generates. Conversely is a formula and may not be fed to : does not exist. The quick test is the outermost symbol: a function symbol, constant or variable gives a term; a relation symbol, connective or quantifier gives a formula.
The official definition brackets everything, so formulas are strings like . In practice we drop outer parentheses and use the precedence , then , then , then , with a quantifier taking the longest following subformula as its scope. These are abbreviations in the metalanguage, not changes to the language.
Unique readability
Every definition by recursion on formulas — the free variables of a formula, substitution, and above all Tarski's definition of truth — presupposes that a formula can be taken apart in exactly one way. If the string could also be read as , a recursion could assign it two different values and would not define a function at all. That this never happens is a theorem, not an observation.
Theorem 2.5 (Unique readability of terms). No proper non-empty initial segment of an -term is itself an -term. Consequently every term has exactly one of the forms "a variable", "a constant", or , and in the last case and are uniquely determined.
Proof. Assign a weight to each symbol: for an -ary function symbol ; for variables and constants; for the comma and both parentheses. For a string , let be the sum of the weights of its symbols.
Claim. for every term , and for every proper non-empty initial segment of a term.
Both parts go by induction on . If is a variable or a constant then , and has no proper non-empty initial segment, so the second part is vacuous. If then, using ,
For the second part, a proper non-empty initial segment of is either the single symbol , or , or followed by , a separator, and an initial segment of (possibly empty, possibly all of ) for some . In the last case
where holds by the induction hypothesis ( if is a proper segment, if , and if empty). The first two cases give .
Now suppose a term were a proper initial segment of a term. The claim gives , contradicting . For the consequence: the first symbol decides the clause, since variables, constants and function symbols are distinct symbols. If and are the same string, then and are initial segments of one another, hence equal by the first part; strip them and repeat.∎
Theorem 2.6 (Unique readability of formulas). Every -formula has exactly one of the forms , , , for a unique binary connective , , ; and in each case the constituents are uniquely determined.
Proof (Sketch — rests on induction on formulas and Theorem *Unique readability of terms*). The same weight argument, now counting parentheses: give weight , weight , and every other symbol weight . By induction on formulas, every formula has total weight and every proper non-empty initial segment has weight ; hence no proper initial segment of a formula is a formula. Uniqueness of the decomposition follows: an atomic formula is recognised because it does not begin with , and in a non-atomic formula the symbol just after the opening is , or — or else the formula is binary, and then its connective is the unique symbol at which the running parenthesis weight first returns to . The argument rests on nothing beyond induction on formulas and Unique readability of terms, which supplies the atomic case.∎
Remark. Unique readability is exactly what the bracketing convention buys, and it is genuinely lost without it: with and unbracketed, the string has two parses. Our informal precedence rules restore a unique parse, which is what makes them legitimate abbreviations — each abbreviated string denotes one official string.
Example 2.8 (Term, formula, or neither). In the language , decide for each of , and whether it is a term, a formula, or neither.
Solution. — officially — is a term: the outermost symbol is the binary function symbol applied to two terms. It names an object and has no truth value.
is an atomic formula: the binary relation symbol applied to two terms.
is neither. Clause 4 of Well-formed formula requires a formula after the quantifier, and is a term. No insertion of brackets repairs it; the string is simply not generated. □□
Example 2.9 (Counting symbol occurrences). How many occurrences of function symbols does the -term contain?
Solution. Read the term as a tree and count the internal nodes, which are exactly the function-symbol occurrences.
Officially the term is . The root is : one occurrence. The left argument has two occurrences of . The right argument has one and one . The leaves — two occurrences of the constant and one of the variable — contribute nothing, since neither constants nor variables are function symbols.
Final answer: . As a check, the weight identity of Unique readability of terms must give : the binary symbols and weigh each, the three occurrences of the unary weigh each, and the three leaves weigh each, so . ✓ □□
2.2Quantifiers, Duality, and the Quantifier Equivalences
Quantifiers are what separate first-order logic from propositional logic, and their content is two ideas: a quantifier ranges over a domain, and the two quantifiers are dual under negation. This section states the equivalences the rest of the chapter uses, each with the side condition that makes it true. The semantics justifying them is given in full in Structures and Tarski's Definition of Truth; here the reading " says holds of every object of the domain, says it holds of at least one" is enough to state the laws precisely and to see why each side condition is needed.
Definition 2.10 (Logical equivalence). Formulas and are logically equivalent, written , if in every structure and under every variable assignment, is satisfied exactly when is. Equivalence is a relation between formulas asserted in the metalanguage; is not a symbol of the object language.
Theorem 2.11 (Duality of the quantifiers). For every formula and every variable ,
Consequently and : either quantifier may be taken as primitive and the other defined from it.
Proof. Fix a structure with domain and an assignment . By the satisfaction clauses, is satisfied iff is satisfied under modified to send to , for every . Hence is satisfied iff it is not the case that every works, i.e. iff some makes fail, i.e. iff some makes hold — which is exactly satisfaction of . The middle step, "not every " "some not", is the classical negation of a universal claim over the set , available because the metatheory is classical.
The second equivalence is the first applied to , together with : from , negate both sides. The two consequences follow by negating each equivalence once more.∎
Intuition. is a conjunction over the domain and a disjunction. If is finite then really is and really is . Duality is then literally De Morgan's law stretched over the domain, and every other law in this section is a fact about conjunctions and disjunctions read through that dictionary. It is a reliable way to guess which laws should hold before proving them — and the infinite case is why they must still be proved.
Proposition 2.12 (Quantifiers distribute one way only). For all formulas and every variable ,
The mixed forms fail. Only the one-way implications
hold in general, and their converses are refutable.
Proof. For the first equivalence: holds iff for every both and hold of , which is the same statement about as "( holds of every ) and ( holds of every ) ". The second equivalence follows from the first by Duality of the quantifiers, applied to and .
The surviving implications are immediate: a single witness for witnesses each conjunct separately; and if holds of every then does.
One counter-model refutes both converses. Take with and , and put , . Then is true — each element lies in or in — while is false, since neither predicate holds of both elements. Dually is true while is false, as no element lies in both.∎
Pitfall. The failure of is the formal content of the equivocation "some students are athletes and some students are musicians, therefore some student is both". Two existential statements deliver two witnesses, not one shared witness. The same slip appears in analysis whenever "for each there is a " is treated as "there is a for each ".
Theorem 2.13 (Quantifier order). Let and be distinct variables and any formula. Then
and , while the converse entailment fails.
Proof. Like quantifiers commute because "for every pair " does not depend on the order in which the two coordinates are presented, and likewise for "for some pair"; formally, both sides unwind to the same condition on by two applications of the satisfaction clause.
For the mixed direction, suppose is satisfied, witnessed by : then holds for every assigned to while is assigned that single . So given any , the element witnesses for that , and follows.
For the failure of the converse, take with the usual , and . Then is true — take — while asserts a natural number strictly above every natural number, itself included, and is false.∎
Intuition. Read as "you move first, then I answer", and as "I must commit first, before seeing your move". Committing first is harder, so is the stronger statement and implies the other. This is exactly the difference between continuity, where may depend on the point, and uniform continuity, where one must serve every point — and it explains why the second is a genuinely stronger hypothesis rather than a restatement.
Proposition 2.14 (Pulling a quantifier out). Suppose does not occur free in . Then
Each of these can fail if is free in .
Proof. Because is not free in , the truth value of does not change when the assignment to is varied — this is Truth depends only on the free variables, proved in the semantics section. Write for " is satisfied when is assigned ", and let be the fixed truth value of . Over a non-empty domain the four claims become
The first, second and fourth are distributions of a constant through a quantifier and use only in the left-to-right direction of the second. The third is the interesting one. () If fails then some has , and that satisfies vacuously; if instead holds, every satisfies , and supplies one. () If some satisfies and holds, then holds, hence . Non-emptiness of the domain was used twice, which is where the standing assumption that domains are non-empty earns its keep.
For failure without the side condition, take the fourth law with , so that is free in . The right-hand side is valid. The left-hand side is refuted in the structure , under the assignment : the antecedent holds and the consequent fails. The two sides differ because on the right the previously free of has been captured by the new quantifier — the phenomenon analysed in the next section.∎
Example 2.15 (Negating a nested sentence). Negate and drive the negation inwards until no stands in front of a quantifier.
Solution. Apply Duality of the quantifiers to the outer :
Use :
Apply duality again, to the inner :
Check the reading: the original says "every has a -partner", so its negation should say "some has no -partner at all", which is what the last line states. □□
Example 2.16 (Formalising continuity and negating it). Write " is continuous at " as a first-order formula and negate it, keeping track of the quantifier order.
Solution. With variables ranging over the reals and the obvious symbols,
Negate and push inwards, using duality at each quantifier and , at each connective:
This is the usual discontinuity criterion: one bad that no can meet, with an offending point for each . Observe that the prefix became — the order is preserved while each quantifier flips. Had the original been (uniform continuity's shape), the negation would have a different shape too, which by Quantifier order is not an equivalent statement. □□
Example 2.17 (Which distribution law applies). Over the domain , let say " is even" and say " is odd". Evaluate all four combinations of with distributed across and .
Solution. is false and is false — consistent with the equivalence in Quantifiers distribute one way only.
is true and is true — again the equivalence.
is true (every integer is even or odd) but is false: the failing mixed case.
is false but is true: the other failing mixed case. □□
Summary. swaps the quantifiers. distributes over and over , never the reverse. Like quantifiers commute; mixed ones do not, and is the stronger prefix. A quantifier may be pulled across a subformula exactly when its variable is not free there.
2.3Scope, Free and Bound Variables, and Substitution
A variable occurrence in a formula plays one of two utterly different roles. Either it is a genuine blank, waiting to be filled by an object — a free occurrence — or it is a piece of internal plumbing belonging to a quantifier, in which case its name is arbitrary. Nearly every technical error in first-order logic is a confusion of the two, and the machinery of this section exists to make the distinction mechanical.
Definition 2.18 (Scope). In the formula or , the scope of that quantifier occurrence is the subformula . Scope is determined by the official bracketing and is therefore unambiguous, by Unique readability of formulas.
Definition 2.19 (Free and bound occurrences). An occurrence of a variable in a formula is bound if it lies within the scope of some occurrence of or in , or is the occurrence immediately following such a quantifier symbol; otherwise it is free. The set of free variables of is defined by recursion:
- and , where is the set of variables occurring in the term ;
- and for a binary connective ;
- .
This recursion is legitimate exactly because of Unique readability of formulas.
Definition 2.20 (Sentence). A formula with is a sentence (a closed formula). The universal closure of , written , is where list .
The same variable may occur both free and bound in one formula: in the first is free and the second bound, so even though a quantifier for is present. Nothing is wrong with such a formula, but it is hard to read, and the renaming result below lets us avoid writing them.
Intuition. A free variable is a pronoun with no antecedent: "he is tall" is neither true nor false until someone says who. A bound variable is a dummy index — the in or the in , which you can rename without changing anything, and which cannot be "given a value" from outside. A sentence is a formula with no pronouns left: it makes a claim that a structure can settle by itself.
Proposition 2.21 (Renaming bound variables). Let be a formula and a variable not occurring at all in . Then
where replaces every free occurrence of in by . Formulas related by finitely many such renamings are called alpha-equivalent; alpha-equivalent formulas have the same free variables and are satisfied by the same assignments in the same structures.
Proof (Sketch — the full induction is in Enderton §2.4 and van Dalen §2.3). The requirement that be entirely fresh guarantees that no occurrence of introduced by the substitution falls inside the scope of a quantifier on , so the new binds exactly the occurrences the old bound. Satisfaction is then preserved by The substitution lemma below, applied with the term , together with the observation that and agree on all variables relevant to the two formulas. The full argument is an induction on carried out in Enderton §2.4 and van Dalen §2.3.∎
Substitution and the capture problem
To use a universal statement we instantiate it: from we want with replaced by a term naming the object we have in mind. Making that operation safe is the one genuinely delicate definition in elementary first-order logic.
Definition 2.22 (Substitution). For a term , the formula is obtained by replacing every free occurrence of in by . Formally, by recursion: on atomic formulas, replace by throughout each term; and the binary connectives commute with the operation; and
and likewise for . Bound occurrences are therefore never touched.
Definition 2.23 (Substitutable (free for)). The term is substitutable for in (older texts: " is free for in ") if no free occurrence of in lies within the scope of a quantifier or for some variable occurring in . Equivalently, by recursion: any is substitutable for in an atomic formula; substitutability commutes with and the binary connectives; and is substitutable for in iff either , or ( and is substitutable for in ).
Pitfall. Substitution without checking substitutability is variable capture, and it turns valid principles into invalid ones. Take , which in any structure with at least two elements says "something differs from ", and substitute the term :
which is false in every structure. The free of walked into the scope of and was captured; a statement about an arbitrary object became a statement about the quantifier's own dummy. The repair is always the same: rename the bound variable first, using Renaming bound variables, so that becomes , and then substitute to get , which says what it should.
Theorem 2.24 (The substitution lemma). Let be a structure, an assignment, a formula, a variable and a term that is substitutable for in . Then
where is the value of in under and is modified to send to . In words: substituting a term and then evaluating gives the same answer as evaluating the term and then assigning its value to .
Proof. First, for terms: an induction on shows . It is immediate for a constant and for a variable (the two cases and ), and the inductive step for applies to the induction hypotheses.
Now induct on . For atomic the claim is the term case applied inside each argument. The connective cases are immediate, since both substitution and satisfaction commute with .
The quantifier case is where substitutability is used. Consider .
Case . Then and . By Truth depends only on the free variables, changing the value assigned to cannot affect satisfaction of , so both sides agree.
Case and . Again the substitution does nothing and the relevance lemma settles it.
Case and . Substitutability forces and makes substitutable for in . Now , so the left-hand side says: for every , is satisfied under . By the induction hypothesis that is: for every , is satisfied under . Because does not occur in , the value of is unaffected by what is assigned, so . Writing and using to swap the two modifications, the condition becomes: for every , is satisfied under — which is precisely satisfaction of under , the right-hand side. The case of is identical with "every" replaced by "some".∎
Remark. The single line that would break without substitutability is " ". If occurred in , the term would be re-evaluated inside the quantifier and would mean something different for each — which is exactly what capture is. It is worth noticing that the hypothesis is used at one point only; everything else in the proof is bookkeeping.
Example 2.26 (Counting free occurrences). Count the free occurrences of variables, with multiplicity, in , and give of the formula.
Solution. Take the four variable occurrences inside the predicates one at a time.
The in lies in the scope of , so it is bound.
The in : the only -quantifier is , whose scope is alone. This occurrence is in the antecedent of the implication, outside that scope, so it is free.
The in lies in the scope of : bound.
The in has no quantifier anywhere: free.
So there are free occurrences, and . Final answer: . The formula is therefore not a sentence, and its truth value in a structure depends on what and are assigned. □□
Example 2.27 (Is this substitution legal?). Decide whether is substitutable for in , and compute the result of the substitution after any repair needed.
Solution. Check each free occurrence of . The occurrence in lies inside , and , so is not substitutable for in : a blind substitution would produce , in which the of the term has been captured. (The occurrence in is harmless, since does not occur in .)
Repair by Renaming bound variables, choosing a variable fresh for both and , say :
Now is substitutable, and
Both occurrences of are free, as they should be. □□
Example 2.28 (A sentence versus an open formula). In the language , classify and , and say what each requires in order to have a truth value.
Solution. , so it is a sentence: a structure alone settles it (true in , false in a finite linear order).
, so it is an open formula. It expresses a property of one object, and to give it a truth value we need a structure and an assignment of a value to — or we may take its universal closure , which is the first sentence again. □□
2.4Structures and Tarski's Definition of Truth
So far no string has meant anything. To give the language meaning we supply a world for it to talk about — a structure — and then define, by recursion on formulas, what it is for a formula to be satisfied there. The definition is due to Tarski, and its central feature is that the truth of a compound formula is explained entirely in terms of the truth of its immediate constituents. That is what makes truth a well-defined mathematical object rather than an appeal to intuition.
Definition 2.29 (Structure). An -structure consists of
- a non-empty set , the domain (or universe);
- for each constant symbol of , an element ;
- for each -ary function symbol , a function (total, and defined on all of );
- for each -ary relation symbol , a set .
The equality symbol is not interpreted: it is always read as genuine identity on .
Remark. Non-emptiness is a convention with consequences, and it is the convention of classical first-order logic. If were allowed, would be vacuously true and vacuously false for every , so — a theorem of the standard calculus — would fail. Free logic drops the convention and pays for it with a modified proof system; we keep it, and Pulling a quantifier out showed exactly where it is used.
Definition 2.30 (Variable assignment). A variable assignment in is a function from the set of variables to . For , the modified assignment agrees with everywhere except that it sends to .
Definition 2.31 (Value of a term). The value of a term is defined by recursion on :
- for a variable ;
- for a constant ;
- .
The recursion is well defined by Unique readability of terms.
Definition 2.32 (Satisfaction (Tarski)). For an -structure , an assignment and a formula , the relation (" satisfies in ") is defined by recursion on :
- iff ;
- iff ;
- iff ;
- iff and ; similarly with "or", and iff or ;
- iff for every ;
- iff for some .
Intuition. Clauses 5 and 6 are the whole idea, and they are subtler than they look. We cannot say " is true iff is true for every ", because is not a formula — the domain element is not a symbol of the language, and in an uncountable structure most elements have no name at all. Tarski's device is to leave the formula alone and vary the assignment instead. That is why satisfaction is defined for formulas-with-assignments rather than for sentences directly, even though sentences are what we ultimately care about.
Theorem 2.33 (Truth depends only on the free variables). Let be a formula and let be assignments in that agree on every variable in . Then
In particular, if is a sentence then either every assignment satisfies it or none does.
Proof. First, for terms: if and agree on then , by induction on — immediate for constants and variables, and preserved by clause 3 of Value of a term.
Now induct on . If is atomic, its free variables are exactly the variables of its terms, so the term case gives equal values and hence the same truth value by clauses 1–2. The cases of and the binary connectives are immediate from the induction hypothesis, since of a compound contains of each part.
Let and suppose agree on . For any the assignments and agree on all of : on they both give , and elsewhere they inherit the agreement. By the induction hypothesis they satisfy together or not at all, so the condition "for every " holds for iff it holds for . The case is identical with "some" in place of "every". The final claim is the case , where the hypothesis on is vacuous.∎
Definition 2.34 (Truth in a structure, model). For a sentence we write — " is true in ", " is a model of " — if for some (equivalently, by Truth depends only on the free variables, for every) assignment . For a set of sentences, means for every . For a formula with free variables, abbreviates truth of its universal closure.
Pitfall. carries three different jobs in the literature and they must not be run together: (satisfaction by an assignment), (truth in a structure), and (entailment, defined in the next section). The symbol between the turnstiles tells you which: a structure on the left means truth, a set of sentences on the left means entailment. None of them is , which is about proofs and never mentions a structure at all.
Example 2.35 (Evaluating quantifiers in a small structure). Let have domain and interpret a binary relation symbol as . Decide the truth of and of .
Solution. For , clause 6 asks for some such that holds under .
Try : clause 5 requires for every . Both and are in , so the inner universal holds and is a witness. Hence the sentence is true.
For , clause 5 requires every to have a partner. For , the partner works. For we need some with , and contains no pair whose first coordinate is . So the sentence is false.
This does not contradict Quantifier order, which compares with for a fixed matrix . Here the two sentences are not of that pair: the second was obtained by exchanging the roles of and in the matrix as well as in the prefix. The genuine consequence of Quantifier order is that must also be true in — and it is, since relates to both elements. □□
Example 2.36 (The same sentence in two structures). Let be . Exhibit a model and a counter-model.
Solution. Take with domain and the usual strict order. Given any , the element witnesses the inner existential, so .
Take with domain and the usual order restricted to it. For there is no with , so the inner existential fails and .
The same string of symbols is true in one structure and false in another. A sentence by itself is not true or false; it is true in a structure. □□
Example 2.37 (Counting structures on a fixed domain). How many structures for a language with a single binary relation symbol have domain ?
Solution. Such a structure is determined by , and nothing else: there are no constant or function symbols to interpret, and the domain is fixed.
, and a subset includes or excludes each of the pairs independently, so there are
structures. Final answer: . Two of them are the extremes and ; the sentence is true in exactly one of the . □□
Example 2.38 (Satisfaction of an open formula). In the structure with domain and the usual order, which assignments satisfy ?
Solution. By Truth depends only on the free variables, only matters, since . Write . Clause 6 asks for an integer with , which has a solution exactly when the open interval contains an integer, i.e. when .
So the satisfying assignments are exactly those with ; for instance works with , while fails because contains no integer and fails because is empty. Final answer: . □□
2.5Entailment, Validity, and Truth in a Structure
With satisfaction in place we can define the notion logic is really about: an argument is valid when the conclusion cannot fail while the premises hold — in any structure whatsoever. The point of quantifying over all structures is that it removes the subject matter from the question. Whether holds has nothing to do with numbers, sets or people; it holds whatever , and the domain are, and that is what makes it logic.
Definition 2.39 (Entailment, validity, satisfiability). Let be a set of sentences and a sentence.
- entails , written , if every structure that is a model of is a model of .
- is valid (logically true), written , if every structure is a model of it — the case .
- is satisfiable if some structure is a model of it; is refutable if is satisfiable.
- and are logically equivalent iff , which reconciles this with Logical equivalence.
Pitfall. Truth in a structure is not validity, and this is the most consequential distinction in the chapter. The sentence is true in the structure and false in the structure of real matrices under multiplication. It is therefore true-in-a-structure but not valid. A valid sentence is one no structure can refute; there is no privileged "intended" structure in logic, and an argument that a sentence is "obviously true" about the intended one says nothing about validity. Soundness runs from provability to validity, not from truth in one's favourite model to provability.
Proposition 2.40 (Semantic deduction and refutation). For sentences and a set of sentences :
- if and only if ;
- if and only if is unsatisfiable;
- if and only if is unsatisfiable.
Proof. (1) () Let . If then is a model of , so by hypothesis, and clause 4 of Satisfaction (Tarski) gives ; if , the same clause gives it directly. () Let . Then and , so .
(2) () A model of would be a model of satisfying , hence not , contradicting . () If but , then by clause 3, so is satisfiable.
(3) is (2) with , since every structure is a model of .∎
Remark. Part (2) is why automated theorem provers refute instead of proving: to establish they add to the premises and search for a contradiction. Resolution, tableaux and SMT solvers are all built on that reduction.
Theorem 2.41 (Instantiation and generalisation are valid). Let be a formula, a variable and a term substitutable for in . Then
where validity of a formula with free variables means validity of its universal closure.
Proof. Fix and an assignment , and suppose . Put . Clause 5 of Satisfaction (Tarski) applied with this particular gives . Since is substitutable for in , The substitution lemma converts this into . As and were arbitrary, the implication is satisfied everywhere.
The second formula is the first read through duality: assume , so by the substitution lemma with , and clause 6 needs only that one witness.∎
Pitfall. Both halves collapse without substitutability. With and , the instance has a true antecedent in any two-element structure and a consequent false in every structure, so it is not valid. Nothing is wrong with the theorem; the hypothesis was violated, since is not substitutable for in .
Example 2.42 (Valid, satisfiable but not valid, or unsatisfiable). Classify each of the following: (a) ; (b) ; (c) .
Solution. (a) is valid, the "drinker paradox". Fix with domain . If holds, then every makes the implication true, and is non-empty, so a witness exists. If fails, some has , and that makes the antecedent of the implication false, hence the implication true. Either way a witness exists.
(b) is satisfiable but not valid. It is true in any structure where the consequent holds. It fails in with domain and , by the counter-model in Quantifier order.
(c) is unsatisfiable: clauses 3 and 4 of Satisfaction (Tarski) make unsatisfiable under every assignment, so no witness can exist in any structure. □□
Example 2.43 (Deciding an entailment). Does ? Does ?
Solution. The first entailment holds. Let model both premises. The second premise gives with . The first premise, instantiated at via Instantiation and generalisation are valid, gives , so , and witnesses .
The second fails. Take , , . Then is true vacuously, is true, and is false. This is the quantified form of affirming the consequent. □□
Theorem 2.44 (Compactness). A set of first-order sentences has a model if and only if every finite subset of has a model.
Proof (Sketch — rests on the completeness theorem, not proved here). The direction () is trivial: a model of models each subset. The direction () is not proved here. It follows from the completeness theorem stated in the next section: if had no model then , so by completeness ; a derivation is a finite object and uses only finitely many members of , so some finite has , and by soundness has no model. The proof therefore rests on completeness (Gödel 1929), which is beyond this chapter; Henkin's construction is the standard route.∎
Remark. Compactness is the engine of model theory. Adding constants with the sentences for to the axioms of any theory with arbitrarily large finite models shows that theory has an infinite model; the same trick, run over a non-standard element, produces non-standard models of arithmetic and the infinitesimals of non-standard analysis. It also shows first-order logic cannot express "the domain is finite": a sentence with only finite models of unbounded size would contradict compactness.
2.6Prenex Normal Form
A formula in which quantifiers are scattered through the structure is hard to reason about: one cannot see at a glance how many alternations it contains, and the alternation count is exactly what measures the logical complexity of a statement. Prenex normal form pushes every quantifier to the front, leaving a quantifier-free body behind. The theorem below says this is always possible, and the proof is an algorithm.
Definition 2.45 (Prenex normal form). A formula is in prenex normal form if it has the shape
where each is or , the variables are distinct, and the matrix contains no quantifier. The string is the prefix; is allowed.
Theorem 2.46 (Prenex normal form). Every first-order formula is logically equivalent to a formula in prenex normal form with . Moreover can be computed from by an algorithm.
Proof. Induct on the structure of , producing a prenex equivalent at each step.
Atomic . Already prenex, with empty prefix.
. By the induction hypothesis with quantifier-free. Applying Duality of the quantifiers times, once per quantifier from the outside in,
where and . The matrix is quantifier-free, so this is prenex. Each application is legitimate because equivalence is a congruence: replacing a subformula by an equivalent one preserves satisfaction, as an easy induction on the surrounding context shows.
(and the other binary connectives). By the induction hypothesis and . First rename: by Renaming bound variables, choose the and all distinct from one another and not free in either formula — this is the step that makes the whole construction work, and it is always available because there are infinitely many variables and each formula is finite. Now every is not free in and every is not free in , so Pulling a quantifier out applies repeatedly, moving the prefix of outwards through and then the prefix of outwards:
For the same argument applies, with the third law of Pulling a quantifier out flipping each quantifier that is moved out of the antecedent and the fourth leaving untouched those moved out of the consequent.
or . By the induction hypothesis ; prefixing the quantifier gives a prenex formula at once, after renaming if it collides with some .
Each step either leaves the free variables alone or removes and restores the same binding, so is preserved. The induction is finite and every step is effective — rename, then apply a fixed list of equivalences — so it is an algorithm.∎
Pitfall. The renaming step is not optional bookkeeping. Without it the construction is wrong, not merely inelegant: pulled out naively becomes , which Quantifiers distribute one way only showed is not equivalent to it. Rename first, to , and the correct prenex form drops out.
Remark. Prenex form is not unique. prenexes to or to , depending on which conjunct's prefix you extract first, and by Quantifier order those two prefixes are in general inequivalent — here they happen to be equivalent because the matrix splits. What is an invariant of a formula, not of a particular prenex form, is the least possible number of quantifier alternations; that number defines the arithmetical hierarchy , in which formulas ( over a decidable matrix) are the semi-decidable properties.
Example 2.47 (Prenexing a formula with a shared variable). Put into prenex normal form.
Solution. Rename the bound variables apart first, by Renaming bound variables:
Pull the antecedent's quantifier out. By the third law of Pulling a quantifier out, , valid here because is not free in :
Now pull out from the consequent, using — the dual of the fourth law, valid since is not free in :
The prefix has quantifiers and no alternation, so the sentence is over its matrix. □□
Example 2.48 (A formula whose negation changes the prefix). Prenex and count the alternations.
Solution. Apply Duality of the quantifiers twice, outside in:
with . Push the negation into the quantifier-free matrix by De Morgan:
So the prenex form is
The prefix is : one alternation, the same count as the original , as duality guarantees. Final answer: alternation. □□
2.7A Proof Calculus and Its Soundness
Everything so far has been semantic: truth, satisfaction, entailment, all defined by quantifying over structures. That is not something one can carry out by inspection — checking means surveying every structure, of every cardinality. A proof calculus replaces this with a finite, checkable, purely syntactic game, and the two theorems that connect the game to the semantics are soundness (everything provable is true) and completeness (everything true is provable). We set up a Hilbert-style calculus and prove soundness in full; completeness is stated and attributed.
Definition 2.49 (A Hilbert calculus for first-order logic). Fix as primitive ( being defined from them by duality). The logical axioms are all universal closures of formulas of the following shapes, for any formulas , variable and term :
- A1 ;
- A2 ;
- A3 ;
- A4 , provided is substitutable for in ;
- A5 ;
- A6 , provided .
The single rule of inference is modus ponens: from and infer .
A derivation of from a set of formulas is a finite sequence with , each being a logical axiom, a member of , or obtained from two earlier entries by modus ponens. We write when such a derivation exists, and for .
Remark. Taking the universal closures of the axiom schemes lets generalisation be absorbed into the axioms, so modus ponens can be the only rule. Presentations that state the axioms without closure need a second rule, "from infer ", and must then restrict it so that is not free in the premises — otherwise becomes derivable, which is false semantically. Both designs exist in the literature and prove the same theorems; the restriction has to be paid somewhere.
Pitfall. The side conditions on A4 and A6 are not decoration. Drop the one on A4 and the capture instance becomes an axiom, deriving a falsehood from a truth. Drop the one on A6 and becomes an axiom, which Pulling a quantifier out already refuted in a two-element structure. Soundness is exactly the theorem that with the conditions in place, no such thing can happen.
Theorem 2.50 (Soundness). If then . In particular, if then is valid, and a theory with a model is consistent.
Proof. It suffices to show two things: (i) every logical axiom is valid, and (ii) modus ponens preserves satisfaction. Then an induction on the length of a derivation gives the theorem: fix and an assignment ; every entry of the derivation is satisfied by in , being a valid axiom, a member of , or a modus ponens consequence of two earlier satisfied entries.
(ii) is clause 4 of Satisfaction (Tarski): if satisfies and , then since it satisfies the first disjunct of the clause fails, so it satisfies .
For (i), note first that it suffices to check each axiom shape is satisfied by every assignment in every structure, since validity of a formula is validity of its universal closure, and clause 5 of Satisfaction (Tarski) says the closure is satisfied precisely when the open formula is satisfied under all modified assignments.
A1–A3 are propositional tautologies in the shapes , and clauses 3 and 4 of the satisfaction definition evaluate and exactly as the truth tables do. So under any fixed the three formulas reduce to tautologies of the two truth values assigned to their constituents.
A4 is Instantiation and generalisation are valid, whose proof used the substitutability hypothesis through The substitution lemma.
A5. Fix and suppose satisfies and ; we must satisfy . Let be arbitrary. By clause 5 twice, satisfies both and , hence satisfies by (ii). As was arbitrary, clause 5 gives .
A6. Suppose and satisfies in . For any , the assignments and differ only at , which is not free in ; by Truth depends only on the free variables, satisfies as well. Since was arbitrary, clause 5 gives . This is the step that the side condition makes possible, and the only place in the proof where it is used.
Finally, the consistency claim: if had a model and also and , then would satisfy both and , contradicting clause 3.∎
Theorem 2.51 (Gödel's completeness theorem). For any set of first-order formulas and any formula , if then . Together with Soundness, if and only if .
Proof (Sketch — Henkin's construction, not carried out here). Not proved here. The standard argument (Henkin) is the contrapositive: if then is consistent; extend it to a maximal consistent set that also contains a witness for each existential formula it contains, adding fresh constants as needed; then build a structure whose domain is the set of closed terms modulo provable equality, interpreting each symbol by itself. A "truth lemma", proved by induction on formulas, shows this term structure satisfies exactly the sentences in the maximal set, hence models , so . It rests on Zorn's lemma (or König's lemma in the countable case) and on the axioms above being strong enough to prove the deduction theorem. Full accounts are in Enderton §2.5 and van Dalen §3.1.∎
Intuition. Soundness is the easy half and the indispensable one: it is what makes a proof worth writing, because it certifies that no derivation can lead from true premises to a false conclusion. Completeness is the surprising half — that a fixed, finite list of axiom schemes and one rule suffice to reach every semantic consequence, over every signature and every cardinality of structure. It is also what makes first-order validity semi-decidable: search all derivations, and if is valid you will eventually find one. Church and Turing showed you cannot do better than semi-decidable — there is no algorithm that always halts and decides validity.
Example 2.52 (A derivation and what soundness tells us). Derive in the calculus, and identify where non-emptiness of the domain is used.
Solution. Recall abbreviates .
- — A4, with , which is substitutable for in .
- — A4 again.
- From 1 and 2, propositional reasoning (A1–A3 with modus ponens) yields : assuming the antecedent gives by 1, while would give by 2, a contradiction, so .
- The conclusion is by the abbreviation.
Non-emptiness enters not in the derivation but in Soundness: step 1 is valid because clause 5 of the satisfaction definition can be instantiated at the element — and an assignment into an empty domain does not exist. Over empty domains this sentence is false, so the calculus would be unsound; the two conventions stand or fall together. □□
Example 2.53 (Using soundness to show something is unprovable). Show that is not derivable in the calculus.
Solution. By Soundness, a derivable formula is valid, so it is enough to exhibit one structure refuting it — the contrapositive of soundness is the standard tool for unprovability.
Take and . Then is true, witnessed by , while is false because . Clause 4 of Satisfaction (Tarski) makes the implication false in , so it is not valid, so by soundness it has no derivation.
Note what was not needed: no search through derivations, and no appeal to completeness. Soundness alone converts a semantic counter-model into a syntactic non-existence claim. □□
- Confusing truth in a structure with validity. is true in and false in matrices; truth in your favourite model is not a licence to assert a sentence as a theorem of logic. Soundness runs from to , never from truth in one structure to .
- Substituting without checking substitutability. Replacing by a term whose variables get captured turns valid instantiation into nonsense — the standard example being with . Rename the bound variable first.
- Swapping quantifier order. and are not equivalent; only holds. This is the continuity versus uniform continuity distinction.
- Distributing a quantifier over the wrong connective. distributes over and over ; the mixed forms fail, and "some and some " never yields "some that is ".
- Prenexing without renaming apart. Pulling both quantifiers of to the front under one silently strengthens the formula. Rename first.
- Treating a free variable as universally quantified. An open formula has no truth value in a structure until an assignment is supplied; a derivation that generalises on a variable free in the premises is invalid, which is exactly what the side condition on A6 blocks.
- Forgetting that domains are non-empty. is derivable, and it is valid only because every structure has at least one element.
- Mixing up and . The first is about structures, the second about derivations. That they coincide for first-order logic is Gödel's completeness theorem, a hard result, not a definition.