Contents / Mathematical Logic / Formal Systems and Proofs
Chapter 3
Formal Systems and Proofs
Formal systems, inference rules, natural deduction, soundness, completeness, compactness, and decidability.
Introduction
A formal system replaces the informal notion of proof with a finite object that can be checked mechanically. Fix a language, fix a set of axioms, fix a handful of rules of inference, and " is provable" becomes a statement about finite strings of symbols — decidable to verify, even when it is undecidable to discover.
Running alongside it is a second, entirely different relation. Semantic entailment asks whether is true in every structure satisfying the hypotheses, a condition quantifying over structures of every cardinality. The central fact of first-order logic is that these two relations, built from unrelated materials, coincide. Soundness gives one inclusion by an induction any careful reader can run; Gödel's completeness theorem gives the other, and its proof — the Henkin construction — builds a model out of syntax itself. From that one theorem, compactness and the Löwenheim–Skolem theorems fall out as corollaries, and the chapter ends where the method reaches its limit: validity is provable, but not decidable.
3.1Axioms, Rules, and Derivations
A formal system is specified by three pieces of data, and the whole point of the specification is that nothing else is permitted to enter a proof.
Definition 3.1 (Formal system). A formal system consists of
- a language: a set of symbols together with a rule, decidable by inspection, saying which finite strings count as well-formed formulas;
- a set of axioms, a distinguished set of well-formed formulas, usually given as axiom schemas — patterns every instance of which is an axiom;
- a set of rules of inference, each a relation between a finite list of premises and a conclusion.
is effective if the three conditions "is a formula", "is an axiom" and "follows from these premises by that rule" are all decidable.
Effectiveness is not decoration. Everything in this chapter that deserves the word formal rests on it: a derivation can be checked by a clerk who does not know what the symbols mean, and — in the last section — the set of theorems can be enumerated by a machine.
Definition 3.2 (Derivation). Let be a set of formulas. A derivation of from in is a finite sequence of formulas with , in which each is
- an axiom of , or
- a member of , or
- the conclusion of a rule of whose premises all occur among .
We write , read " derives ", when such a sequence exists, and drop the subscript when is fixed. A formula with is a theorem of , written .
Notation. The turnstile is a syntactic symbol belonging to the metatheory: is a statement about the system, not a formula of it, and it is never written inside a formula. Its semantic counterpart , introduced in the next section, is a different relation with a different definition, and the two are kept apart throughout — conflating them makes the completeness theorem unstatable.
Intuition. A derivation is a board game with no hidden information. Axioms are positions you may place for free; rules say exactly which position may be added next. A referee who knows only the rulebook can confirm a win by scanning the record of play, and cannot be persuaded by a move that merely feels right.
Hilbert systems take the extreme position: many axiom schemas, one rule. The following three schemas, with modus ponens, are complete for the -fragment of propositional logic, and they are the system we work in for the rest of the section. Here range over all formulas, so each line is a schema with infinitely many instances.
Definition 3.3 (The Hilbert system ). The axioms of are all instances of
and the sole rule is modus ponens (MP): from and infer .
Example 3.4 (Deriving the identity law). Show that .
Solution. The obstacle is that has no way to "assume ": every line must be an axiom instance or an MP conclusion. The trick is to use A2 with taken to be , so that two applications of MP strip the implication down to the target.
- — A2 with , , .
- — A1 with , .
- — MP on 2 and 1.
- — A1 with , .
- — MP on 4 and 3.
Five lines, no appeal anywhere to the meaning of . □□
Five lines for is a fair warning about Hilbert systems: they are built to be easy to reason about, not to reason in. Their metatheory is short — one rule to check in the soundness induction — and that is exactly the trade we want when proving theorems about provability.
Natural deduction, due to Gentzen, makes the opposite trade. It has no axioms at all; each connective carries an introduction rule saying how to prove a formula with that connective as its main symbol, and an elimination rule saying what may be extracted from one. For implication:
The rule I formalises the move every mathematician makes without comment: suppose ; … ; therefore ; hence if then . The assumption is discharged — used inside the subproof, absent from the conclusion. In natural deduction is one line: assume , discharge it.
Hilbert systems have no such rule. What they have instead is a theorem of the metatheory saying the rule is admissible: anything I would let you conclude, can already derive. That is the deduction theorem, and it is what makes usable at all.
Theorem 3.5 (Deduction theorem). In the system , for every set of formulas and all formulas :
Proof. () Suppose . Copy that derivation, append the line (a member of ), and append by MP. This direction needs nothing beyond the definition of a derivation.
() Suppose is a derivation of from . We show by strong induction on that for every ; the case is the claim.
Case 1: is an axiom of , or . Then in one line. The A1 instance is an axiom, so MP gives in three lines.
Case 2: is itself. Then is , and the derivation in Example Deriving the identity law goes through with in place of , using only axioms, so with no hypotheses at all. This is the case that forces A2 into the axiom list: from A1 alone no derivation of exists, and the theorem would fail.
Case 3: follows by MP from earlier lines and , with . By the induction hypothesis,
Take the A2 instance
MP with the second induction hypothesis yields , and MP with the first yields .
Every line of the original derivation falls under exactly one case, so the induction is complete.∎
Read the proof again watching what it consumed. Case 1 used A1, Case 2 used A1 and A2, Case 3 used A2, and nothing anywhere used A3. The deduction theorem is a theorem about the implicational fragment: it holds in any Hilbert system containing A1 and A2 and closed under MP. That is worth remembering, because the same argument is reused verbatim for first-order systems.
Pitfall. In first-order logic the deduction theorem needs a side condition. If generalisation (from infer ) is a rule of the system, then , yet is false — read as " " in a structure with two elements. The repair is to forbid generalising on a variable occurring free in an undischarged hypothesis.
Example 3.6 (Transitivity of implication, without a subproof). Derive .
Solution. By the deduction theorem it is enough to derive from , which is immediate: with gives by MP, and with gives by MP. Three lines, then one appeal to the theorem.
Unwinding the theorem's proof mechanically would turn those three lines into a derivation of about a dozen, every one an A1 or A2 instance. That is the standard experience, and the reason one proves the deduction theorem once rather than repeating the construction each time. □□
Remark. Three properties of follow straight from Definition Derivation and are used without comment from here on. Monotonicity: if and then , since the same sequence is still a derivation. Finiteness: if then for some finite , since a derivation is a finite sequence and can cite only finitely many members of . Transitivity (cut): if and then , by concatenation. Finiteness is what will later deliver compactness, and it is a property of alone — has no comparable reason to enjoy it.
3.2Truth in a Structure: Entailment Against Derivability
Nothing in the previous section mentioned truth. A derivation is a pattern of symbols, and was settled by looking at finite strings. Semantics starts from the opposite end: it supplies the symbols with meanings and asks what is true.
Definition 3.7 (Structure). Let be a first-order language with relation symbols, function symbols and constant symbols. An -structure consists of a non-empty set , the domain, together with
- a relation for each -ary relation symbol of ,
- a function for each -ary function symbol ,
- an element for each constant symbol .
A structure interprets the symbols; an assignment , mapping variables into , interprets the free variables. Together they determine, for every formula, whether it holds — and Tarski's definition makes "determine" precise by recursion on the construction of the formula.
Definition 3.8 (Satisfaction). For an -structure and an assignment , write (" satisfies under ") according to the clauses
- iff and denote the same element of under ;
- iff the denoted tuple lies in ;
- iff fails;
- iff fails or holds;
- iff for every .
For a sentence — a formula with no free variables — the assignment is irrelevant, and we write .
Definition 3.9 (Entailment, validity, satisfiability). Let be a set of sentences and a sentence.
- is a model of , written , if for every .
- entails , written , if every model of is a model of .
- is valid, written , if every structure is a model of .
- is satisfiable if it has at least one model.
Notation. The symbol is now doing two jobs, and both are standard. With a structure on the left () it is satisfaction; with a set of sentences on the left () it is entailment. The left argument disambiguates. What never means is derivability: mentions no axioms, no rules and no proofs, and mentions no structures.
The two relations differ in kind, not merely in definition, and it pays to say exactly how.
| decided by | a finite derivation | all structures interpreting |
| witness | a finite object one can write down | none in general |
| depends on | the chosen axioms and rules | nothing but the language |
| verifying a positive case | mechanical | a proof in the metatheory |
| verifying a negative case | no finite object certifies it directly | one countermodel suffices |
Intuition. is a claim about a search space: somewhere among the finite strings there sits a certificate. is a claim about a universe: every structure whatsoever, of every size, makes true whenever it makes true. There is no a priori reason for these to have anything to do with each other, and for most consequence relations they do not. That first-order logic makes them agree is a theorem, not a definition.
Refuting an entailment is the easy direction, and the technique is always the same: exhibit one structure.
Example 3.10 (A non-entailment). Let have one binary relation . Show that
Solution. Take and . Every integer has some larger integer, so . But no integer exceeds every integer , so fails.
One structure satisfying the hypothesis and falsifying the conclusion is exactly what "not every model of the hypothesis is a model of the conclusion" asks for. □□
Pitfall. A countermodel refutes an entailment, never a derivation. The two tasks are related only through the soundness and completeness theorems, and it is worth noticing which theorem you are leaning on: using a countermodel to conclude is an application of soundness, in contrapositive form.
Example 3.11 (Entailment with an infinite hypothesis set). Let contain constants and let
Show that , and that no finite subset of decides the size of a model beyond a fixed bound.
Solution. Any model of interprets and as distinct elements, so it satisfies ; that is the entailment. For the second claim, a finite mentions only constants among for some , and a structure with elements interpreting those constants injectively — and every remaining arbitrarily — is a model of .
So each finite fragment is satisfiable in a finite domain, while itself is not: any model of the whole of has infinitely many elements. Hold on to this example. It is the mechanism behind every application of compactness later in the chapter, and behind the fact that "the domain is finite" is not expressible by any single first-order sentence. □□
Remark. Two conditions on a set will run in parallel for the rest of the chapter, and the notation separates them the same way. is satisfiable if some structure models it — a semantic condition. is consistent if — a syntactic one, defined in the section on consistency below.
That these two conditions coincide is the completeness theorem in its sharpest form, and the sections ahead earn each direction in turn: soundness gives satisfiable consistent, and the Henkin construction gives consistent satisfiable.
3.3Soundness: Derivability Implies Entailment
Soundness is the promise that the machinery of the first section never manufactures a falsehood. It is the easy half of the correspondence, and the proof is a template worth learning in full, because every extension of a formal system is verified by re-running it on the new axioms and rules.
Theorem 3.12 (Soundness). For every set of sentences and every sentence ,
The proof needs exactly two inputs, and isolating them is the whole method.
Lemma 3.13 (Axioms are valid). Every instance of A1, A2 and A3 is valid: it is true under every structure and assignment.
Proof. Fix a structure and assignment; each of then has a definite truth value, and by the satisfaction clause for it suffices to check the four (or eight) combinations.
A1, . If is false the implication is true by the clause. If is true, then is true, since its consequent is; so the implication is true again.
A2, . Suppose the whole formula were false. Then is true, is true and is false. The last makes true and false. From true and true, is true. From true and true, is true; with true this forces true, contradicting false.
A3, . Suppose it were false: then is true while is true and is false. From false, is true, so is true, so is false — contradicting true.∎
Lemma 3.14 (Modus ponens preserves truth). If and , then .
Proof. By the satisfaction clause, means that fails or holds. The first disjunct is excluded by hypothesis, so the second holds.∎
With the two lemmas in hand, the theorem is an induction on the position of a line in the derivation — the standard form of "induction on derivations" for a linear proof system.
Proof. Let be a derivation of from , and let be any model of . We prove by strong induction on that for every .
Fix and assume for all . By Definition Derivation, arises in one of three ways.
- is an axiom. Then by Lemma Axioms are valid, which holds in every structure and so in particular in .
- . Then because is a model of .
- follows by MP from and with . The induction hypothesis gives and , and Lemma Modus ponens preserves truth gives .
Hence . As was an arbitrary model of , every model of models , i.e. .∎
Remark. The induction is on the derivation, not on the formula. Structural induction on formulas is a different tool, used in the satisfaction lemmas above; induction on derivations is what lets a proof about dispose of a proof of unbounded length by looking at one line at a time. In a tree-shaped system such as natural deduction the same argument runs as induction on the height of the derivation tree, one case per rule.
Intuition. Soundness is a safety guarantee, and the shape of the argument says why it holds: truth is an invariant of the derivation process. The axioms start inside the invariant, every rule keeps you inside it, and so every line you can ever reach is inside it. An unsound system is one with either a false axiom or a rule that can step out.
The theorem is usually applied in its contrapositive form, where it becomes a tool for proving unprovability — otherwise a hard thing to establish, since no finite object certifies the absence of a derivation.
Corollary 3.15 (Consistency from satisfiability). If has a model, then there is no sentence with both and . In the vocabulary of the next section: every satisfiable set is consistent.
Proof. Suppose while and . Soundness applied twice gives and , so and . The satisfaction clause for makes the second say that fails — a contradiction.∎
Example 3.16 (Unprovability by countermodel). Show that in any sound system.
Solution. Example A non-entailment produced the structure , a model of the hypothesis in which the conclusion fails; so the entailment does not hold. If the derivation existed, soundness would force the entailment. Hence no derivation exists.
Notice what has been proved and in which system: the argument rules out a derivation in every sound system at once, without examining a single axiom list. That leverage is the practical value of soundness. □□
Pitfall. Soundness is not consistency, and consistency does not give it back. Consistency says the theory proves no contradiction; soundness says it proves nothing false in the intended structure. In the language of arithmetic the theory is consistent — the one-element structure is a model — yet thoroughly unsound for , since it proves . The implication runs one way only: a theory sound for some structure is consistent, by Corollary Consistency from satisfiability.
3.4Consistency, Maximal Consistent Sets, and Lindenbaum's Lemma
Completeness will be proved by building a model out of syntax. The raw material for that construction is a set of sentences so rich that it decides every question — a maximal consistent set — and this section assembles it. Everything here is pure proof theory: no structure is mentioned until the next section.
Definition 3.17 (Consistency). A set of sentences is inconsistent if there is a sentence with and , and consistent otherwise. We abbreviate " is inconsistent" by .
Lemma 3.18 (Ex falso). If is inconsistent then for every sentence . Consequently an inconsistent set derives everything, and consistency is equivalent to the existence of even one underivable sentence.
Proof. Suppose and , and let be arbitrary. Continue the derivations as follows. The A1 instance is an axiom, so MP with gives . The A3 instance is an axiom, so MP gives . MP with gives .∎
This is the first place A3 has earned its keep: negation is what turns one contradiction into total collapse, which is why "consistent" is such a strong condition on a set of sentences.
Lemma 3.19 (Reductio). For every set and sentence :
- is inconsistent if and only if ;
- is inconsistent if and only if .
Proof. Both "if" directions are immediate: if then derives both (by monotonicity) and (in one line), and symmetrically for (2).
For the "only if" directions, suppose is inconsistent, where is in case (1) and in case (2). Then and for some , and the deduction theorem turns these into
Two schemas of finish the job, one for each case:
Both are derivable from A1–A3 by modus ponens — routine but lengthy exercises of exactly the kind the deduction theorem exists to shorten — and two applications of MP then give in case (1) and in case (2).∎
Lemma 3.20 (Consistency is a finite condition). is consistent if and only if every finite subset of is consistent.
Proof. If some finite is inconsistent, monotonicity makes inconsistent. Conversely, if and , then by finiteness of (Remark following the deduction theorem) there are finite with and ; the finite set is then inconsistent.∎
That lemma is where compactness is really born. It is a statement about , proved from the fact that derivations are finite, and the completeness theorem is what will transport it to the semantic side.
Sets that decide everything
Definition 3.21 (Maximal consistent set). A set of sentences is maximal consistent if is consistent and no proper superset of is consistent: for every sentence , the set is inconsistent.
Lemma 3.22 (Properties of a maximal consistent set). Let be maximal consistent. Then for all sentences :
- is deductively closed: if then .
- Negation-completeness: exactly one of , holds.
- if and only if or .
Proof. (1) Suppose but . By maximality is inconsistent, so Lemma Reductio (2) gives ; with this makes inconsistent, a contradiction.
(2) Not both, since that would make inconsistent outright. At least one: if then is inconsistent by maximality, so by Lemma Reductio (2), and by part (1) above.
(3) () If and , then by MP, so by (1). () If , the A1 instance gives , hence . If instead then by (2), and the derivation inside Lemma Ex falso gives ; apply (1).∎
Intuition. A maximal consistent set is an opinionated theory: for every sentence in the language it has already taken a side, and it never contradicts itself. Clause (3) is the striking one — the membership table for inside is exactly the truth table for . That coincidence is not luck; it is the reason a maximal consistent set can be read as a model, which is precisely what the next section does.
Pitfall. Maximal consistent is not the same as complete-and-recursively-axiomatised. Lindenbaum's lemma below hands you a maximal consistent extension of any consistent theory, so every consistent theory has a negation-complete extension — and Gödel's first incompleteness theorem is not thereby contradicted. What Gödel rules out is a negation-complete effective extension of arithmetic; the set produced below is in general not decidable, and the construction gives no way to recognise its members.
Theorem 3.23 (Lindenbaum's lemma). Every consistent set of sentences is contained in a maximal consistent set .
Proof. Suppose first that the language is countable, so the sentences may be enumerated as . Define an increasing chain of sets by
and put .
Each is consistent, by induction: is consistent by hypothesis, and the recursion adds only when consistency survives.
is consistent. Suppose not. By Lemma Consistency is a finite condition some finite is inconsistent. Each member of entered at some stage, and is finite, so all of them lie in for the largest such stage — the chain is increasing. Then is inconsistent by monotonicity, contradicting the previous paragraph.
is maximal. Let and let be its index in the enumeration, . Since , the recursion must have taken the second branch, i.e. was inconsistent. As , monotonicity makes inconsistent too.
For an arbitrary language, replace the enumeration by Zorn's lemma. Order by inclusion the set of consistent supersets of ; it is non-empty since . If is a chain, then is consistent — any inconsistency would involve a finite subset, which by the chain property lies inside a single member of — so is an upper bound for . Zorn's lemma supplies a maximal element of , and maximality in is exactly maximal consistency.∎
Remark. The two arguments are the same argument. Both rest entirely on Lemma Consistency is a finite condition: consistency is a property of finite character, and a property of finite character is preserved under unions of chains. The countable case simply replaces the choice principle with an explicit enumeration, which is why it needs no appeal to the axiom of choice — worth noting, because the general Lindenbaum lemma, and hence completeness for uncountable languages, genuinely does use choice (the Boolean prime ideal theorem suffices).
Example 3.24 (Maximal consistent sets need not be unique). Let in a propositional language with one atom . Describe the maximal consistent sets extending .
Solution. By negation-completeness, a maximal consistent contains exactly one of , . Each choice extends to a maximal consistent set: take to be all sentences true under the valuation , and all sentences true under . Both are consistent (each is the set of sentences satisfied by an actual valuation, so Corollary Consistency from satisfiability applies) and each is negation-complete, hence maximal by property (2) read backwards.
So there are exactly two, one per valuation of . Lindenbaum's lemma promises a maximal extension, never a canonical one — and the ambiguity is not a defect: distinct maximal consistent sets are what distinct models look like from the syntactic side. □□
3.5Gödel's Completeness Theorem
Soundness said the proof system is safe. Completeness says it is not timid: everything that follows semantically is already derivable, so the finite certificates of the first section exhaust the infinitary relation of the second.
Theorem 3.25 (Gödel's completeness theorem). Let be a set of sentences and a sentence of a first-order language. Then
Combined with Theorem Soundness, the two relations coincide: if and only if .
Why is this surprising? quantifies over every structure interpreting the language — domains of every cardinality, a collection far too large to inspect. The theorem says that this unbounded semantic fact is always witnessed by a finite string of symbols. Nothing in the definitions suggests it; the proof has to produce the derivation, or produce something equivalent to it.
The standard route, due to Henkin, produces neither directly. It proves a statement about consistency instead, and lets Lemma Reductio convert it.
Theorem 3.26 (Model existence). Every consistent set of sentences has a model.
Proof. (Completeness, granted model existence.) Suppose and, for contradiction, . By Lemma Reductio (1), is consistent, so by model existence it has a model . Then , so gives ; but says fails. Contradiction, so .
The work is therefore entirely in model existence, proved below.∎
The idea of the construction is startling on first meeting: if the sentences cannot be interpreted by anything else, interpret them by themselves. The domain of the model will be built from the closed terms of the language, and a sentence will be declared true exactly when it belongs to a maximal consistent set. Two obstacles stand in the way, and the construction is designed around them.
Obstacle 1: existential sentences need witnesses. A maximal consistent may contain while containing no closed term with . The term model would then have to make true with nothing in its domain to satisfy . The repair is to add constants that supply the missing witnesses.
Obstacle 2: equality. The terms and are different strings, but may contain , which the model must respect. The repair is a quotient.
Definition 3.27 (Henkin theory). A set of sentences in a language has witnesses (is a Henkin theory) if for every formula with one free variable there is a closed term of such that
Lemma 3.28 (Witnesses can be added). Let be a consistent set of -sentences. Then there is a language , obtained by adding new constant symbols, and a consistent set of -sentences which has witnesses. If is countable, so is .
Proof. For each -formula with one free variable introduce a fresh constant , and let . Put
is consistent. By Lemma Consistency is a finite condition it is enough to check finite subsets, so suppose finitely many Henkin axioms were inconsistent with ; take one of them, for the formula , added last. Reductio and the deduction theorem give for the remaining set , whence and . But is fresh: it occurs nowhere in , so it behaves as a free variable, and generalising on it gives — contradicting . This freshness argument is the heart of the lemma; it is exactly the side condition on generalisation from the Pitfall in the first section, used here in the direction it was designed for.
Iterate. The new constants create new formulas, which need witnesses of their own, so repeat: and are built from and the same way. Set and . The union is consistent, again because an inconsistency would be finite and would therefore already live in some . Every -formula has all its constants in some , so its witness axiom was added at stage : has witnesses. Each stage adds countably many constants to a countable language, so is countable when is.∎
Lemma 3.29 (Truth lemma). Let be a maximal consistent Henkin theory in a language . Define a structure as follows. On the set of closed -terms put iff ; take the domain to be the set of classes ; interpret each constant as , each function symbol by , and each relation symbol by iff . Then for every -sentence ,
Proof. First, is an equivalence relation and the interpretations are well defined, because is deductively closed and the equality axioms (reflexivity, symmetry, transitivity, congruence for and ) are derivable; deductive closure, Lemma Properties of a maximal consistent set (1), puts their instances in . The domain is non-empty since has constants.
Now induct on the number of connectives and quantifiers in .
Atomic. holds iff , by definition of ; likewise for by definition of .
Negation. iff fails iff (induction hypothesis) iff (negation-completeness, property (2)) .
Implication. iff fails or , which by the induction hypothesis is " or ", which is by property (3).
Existential. Write for . Suppose . Because has witnesses, for some closed term , so by MP and deductive closure, so by the induction hypothesis — and is an element of the domain satisfying . Conversely, if then some class satisfies , so by the induction hypothesis, and is derivable, so .
Every element of the domain is for a closed term — this is why the witnesses were needed, and it is the only point where a term model differs from an arbitrary structure. The universal case follows from the existential one and negation.∎
The three lemmas now assemble with nothing left over.
Proof. (Model existence.) Let be consistent. By Lemma Witnesses can be added, extend it to a consistent with witnesses in a language . By Lindenbaum's lemma, extend to a maximal consistent set of -sentences; adding sentences preserves the witness property, so is a maximal consistent Henkin theory. By the truth lemma, for every , in particular for every . Finally, discard the interpretations of the constants of : the resulting -structure still models , since the truth of an -sentence does not depend on symbols it never mentions.∎
Intuition. The construction answers "where could a model possibly come from?" with: from the syntax, and from nothing else. The elements of the model are the names the language can write down; the facts of the model are the sentences the theory has decided to accept. Consistency is what makes this coherent, maximality is what makes every question have an answer, and the witnesses are what stop the language from asserting the existence of something it cannot name.
Remark. Three ingredients carried the proof, and none can be dropped. Lindenbaum's lemma supplies negation-completeness, without which the truth lemma has no case for . The Henkin extension supplies witnesses, without which the existential case fails. The quotient by makes equality a genuine identity rather than a relation. For a countable language the whole argument avoids the axiom of choice beyond an explicit enumeration; in general it uses the Boolean prime ideal theorem, strictly weaker than full choice.
Pitfall. Completeness is about derivability of consequences, not about theories deciding every sentence. A theory is called negation-complete when or for every ; Gödel's incompleteness theorem says no effective consistent extension of arithmetic is negation-complete. The two theorems are both Gödel's and both true, because they are about different things: the completeness theorem concerns the logic, incompleteness concerns a particular theory.
3.6Compactness and the Löwenheim–Skolem Theorems
The completeness theorem is not only a statement about proofs. Because it identifies a semantic relation with a syntactic one, every property of derivations transfers to semantics — and derivations have one property semantics had no right to expect. They are finite.
Theorem 3.31 (Compactness). Let be a set of sentences. If every finite subset of is satisfiable, then is satisfiable. Equivalently: if , then for some finite .
Proof. Suppose every finite subset of is satisfiable. By Corollary Consistency from satisfiability, every finite subset of is consistent, so is consistent by Lemma Consistency is a finite condition. By Theorem Model existence, has a model, i.e. is satisfiable.
For the second form, suppose . By completeness ; by finiteness of some finite has ; by soundness .∎
Intuition. Trace the finiteness through the argument and you see where compactness comes from. A derivation is a finite sequence, so it can cite only finitely much of ; completeness says every semantic consequence has such a derivation; therefore every semantic consequence already follows from finitely much of . The theorem is the finiteness of proofs, viewed through the mirror that completeness provides.
Pitfall. Compactness earns its keep on infinite ; on a finite it says nothing, since is one of its own finite subsets. The characteristic application has exactly the shape of Example Entailment with an infinite hypothesis set: infinitely many sentences, each finite fragment satisfiable in a small structure, and a conclusion about the infinite whole that no single fragment could reach.
Example 3.32 (Arbitrarily large finite models force an infinite one). Let be a theory with finite models of unbounded size. Show that has an infinite model.
Solution. For let
the sentence "there are at least distinct elements", and set .
Take any finite . It mentions finitely many of the ; let be the largest index among them. By hypothesis has a finite model with at least elements, and such an satisfies , hence all of . So every finite subset of is satisfiable, and compactness gives a model . Since for every , the domain of has at least elements for every : it is infinite. And .
No single finite model was infinite, of course; each finite fragment was satisfied by a different one, and compactness is exactly the tool that stitches those separate witnesses into one structure. □□
Corollary 3.33 (Finiteness is not first-order expressible). There is no set of first-order sentences whose models are exactly the finite structures — and in particular no single sentence.
Proof. Such a set would have finite models of unbounded size, since every finite structure is a model. By the example above it would then have an infinite model, contradicting the requirement that its models be exactly the finite ones.∎
Example 3.34 (Non-standard models of arithmetic). Let be the set of all first-order sentences true in the standard model of arithmetic. Produce a model of containing an element larger than every numeral.
Solution. Add a fresh constant and let
where is the numeral with ones. A finite subset mentions only for , and itself models it once is interpreted as ; the sentences of say nothing about . So every finite subset is satisfiable, and compactness gives .
In the element exceeds every numeral, so it is not the interpretation of any numeral: is a non-standard model. Yet satisfies every first-order truth of arithmetic, since . First-order logic therefore cannot pin down up to isomorphism — not even by taking every truth about it as an axiom. □□
The Henkin construction pays a second dividend, and it is a statement about size. Look again at the model built in the previous section: its domain consists of equivalence classes of closed terms of , and is countable whenever is. The model the proof produces is therefore small, whatever the theory may have been trying to describe.
Theorem 3.35 (Downward Löwenheim–Skolem). Let be a countable language. Every satisfiable set of -sentences has a countable model. More generally, for a language of cardinality , every satisfiable set has a model of cardinality at most .
Proof. Let be satisfiable; by Corollary Consistency from satisfiability it is consistent. Run the proof of Theorem Model existence. Lemma Witnesses can be added keeps a countable language countable, since each of its countably many stages adds one constant per formula of a countable language. The domain of is a set of equivalence classes of closed terms of , and there are only countably many such terms, so the domain is countable (and non-empty). The cardinality bound in the general case is the same count with in place of .∎
Theorem 3.36 (Upward Löwenheim–Skolem). If a set of sentences has an infinite model, then it has a model of every infinite cardinality at least as large as the language.
Proof. Add fresh constants and let
Any finite subset mentions finitely many constants, and the given infinite model of interprets them as distinct elements, so every finite subset is satisfiable. Compactness gives a model of , which has at least elements. Downward Löwenheim–Skolem applied to the language , of cardinality , then cuts it down to one of cardinality exactly .∎
Remark. Together the two theorems say that first-order logic is blind to cardinality above the size of the language: a theory with an infinite model has models of every sufficiently large cardinality, so no first-order theory with an infinite model is categorical. This is why "the reals are the unique complete ordered field" is not a first-order statement — completeness quantifies over subsets, and second-order quantification is exactly what first-order logic gives up in exchange for the completeness theorem.
Pitfall. Skolem's paradox is the usual stumbling block. First-order ZFC, if consistent, has a countable model by downward Löwenheim–Skolem, even though ZFC proves "there exists an uncountable set". There is no contradiction: uncountability of a set means there is no bijection between and , and a countable model may simply contain no such bijection among its elements. Uncountability is relative to the model; what looks uncountable from inside can be countable from outside.
3.7Decidability, Semi-Decidability, and the Limits of the Method
Completeness says a derivation exists whenever the entailment holds. It does not say anyone can find it, and this last section is about the gap between the two. The distinction that measures the gap is between deciding a set and merely enumerating it.
Definition 3.37 (Decidable and semi-decidable). Let be a set of finite strings (formulas, say).
- is decidable if some algorithm, on every input, halts and correctly reports whether the input is in .
- is semi-decidable (recursively enumerable) if some algorithm halts with "yes" on exactly the inputs in , and on inputs outside either halts with "no" or runs forever.
The emphasis on "halts on every input" is the whole content of the definition. A procedure that recognises theorems by searching for a proof, and never terminates when there is none, is a perfectly good semi-decision procedure and not a decision procedure at all.
Theorem 3.38 (Post's theorem). is decidable if and only if both and its complement are semi-decidable.
Proof. () A decision procedure for is in particular a semi-decision procedure for , and negating its output gives one for the complement.
() Let semi-decide and semi-decide the complement. On input , run and in parallel — alternate one step of each. Every lies in or in its complement, so exactly one of them eventually halts with "yes"; report accordingly. The procedure halts on every input, so it decides .∎
Theorem 3.39 (Theoremhood is semi-decidable). Let be an effective formal system in a countable language. Then is semi-decidable.
Proof. Because is effective, "is this finite sequence a derivation of ? " is decidable: check each line against the axiom test and the rule tests. The finite sequences of formulas over a countable language can be enumerated, so the following halts exactly on theorems: enumerate the sequences, checking each, and halt with "yes" at the first derivation of . On a non-theorem the search never ends.∎
Corollary 3.40 (Validity is semi-decidable). The set of valid first-order sentences is semi-decidable.
Proof. By completeness, is valid iff in an effective complete proof system for first-order logic, and Theorem Theoremhood is semi-decidable applies to that system.∎
This is exactly as far as the method reaches. The next theorem says that the other half of Post's criterion fails, so the search cannot be turned into a decision procedure — by any means whatever, not merely by proof search.
Theorem 3.41 (Church–Turing: undecidability of first-order validity). The set of valid sentences of first-order logic, in a language with at least one binary relation symbol, is undecidable: no algorithm halts on every input and correctly reports validity.
Proof. (Sketch; the full argument is Chapter 35 of Enderton or the standard development in any computability text.) The proof is a reduction from a known undecidable problem, the halting problem for Turing machines. Its three ingredients are:
- Arithmetisation. A Turing machine computation can be encoded in first-order logic: for each machine and input one writes down a single sentence , constructed effectively from and , whose conjuncts describe the tape alphabet, the transition table and the initial configuration.
- The reduction. is built so that halts on if and only if the sentence is valid, where asserts that a halting configuration is reached. Every model of is forced to contain a copy of the computation, so validity of the implication tracks halting exactly.
- Undecidability of halting, which is proved independently by diagonalisation.
Given a decision procedure for validity, feeding it would decide halting. No such procedure exists, so validity is undecidable. What the argument rests on is therefore: the Church–Turing thesis (that "algorithm" is captured by Turing machines), the effectiveness of the encoding in (1), and the undecidability of halting in (3).∎
Corollary 3.42 (Refutability is not semi-decidable). The set of non-valid first-order sentences is not semi-decidable.
Proof. If it were, then validity — semi-decidable by Corollary Validity is semi-decidable — and its complement would both be semi-decidable, so validity would be decidable by Post's theorem, contradicting Church–Turing.∎
Intuition. The asymmetry is the thing to carry away. A valid sentence always announces itself eventually: keep enumerating derivations and one turns up. An invalid sentence need not announce itself at all, because the countermodel that refutes it may be infinite, and no finite search is guaranteed to find it. Provability is a search with a finite certificate; refutability, in general, is not.
Decidability returns as soon as the quantifiers are tamed, and the contrast with the propositional case is instructive.
Theorem 3.43 (Propositional validity is decidable). There is an algorithm deciding whether a propositional formula is a tautology.
Proof. A formula contains finitely many atoms, say of them, and its truth value under a valuation depends only on their values. Enumerate all valuations, evaluate under each by recursion on its structure, and answer "valid" iff every valuation makes it true. The enumeration is finite, so the procedure halts on every input.∎
Example 3.44 (Running the decision procedure). Decide whether is a tautology, and count the work.
Solution. Two atoms, so valuations.
| T | T | T | T | T |
| T | F | F | F | T |
| F | T | T | T | T |
| F | F | T | T | T |
Row 2 is the instructive one: both inner implications are false, so the outer implication is true because its antecedent fails. All four rows give T, so the procedure halts and reports "valid" — the law of contraposition, as expected.
The work is rows and no more, which is what decidability requires: finite, guaranteed to terminate. It says nothing about efficiency, and indeed propositional satisfiability is NP-complete, so the practical tools (DPLL, CDCL) spend their effort avoiding the enumeration rather than improving on its bound. Slow but finite is still decidable; the first-order case is not slow, it is impossible. □□
Remark. Many fragments and theories sit on the decidable side, and each buys its decidability by giving something up.
- Monadic first-order logic (only unary relation symbols, no function symbols) is decidable — with no way to relate two elements, a formula with predicates cannot distinguish more than kinds of element, which bounds the models to check.
- Presburger arithmetic, the theory of , is decidable by quantifier elimination. Adding multiplication makes it undecidable, which is where Gödel's incompleteness theorems begin.
- Real closed fields, the theory of , is decidable by Tarski's quantifier-elimination algorithm — and is a theory with multiplication, which shows that multiplication alone is not the culprit; the ability to define the integers inside the structure is.
Pitfall. Undecidability does not mean "no proofs". Every valid sentence still has a finite derivation, and the search of Theorem Theoremhood is semi-decidable will find it. What fails is the ability to know in advance that the search will end. An automated theorem prover left running on a non-theorem is not malfunctioning; it is doing exactly what the theory predicts.
- Writing where belongs. They are different relations with different definitions: is settled by a finite derivation in a fixed system, by every structure in the language. That they agree for first-order logic is the content of two theorems, not a matter of notation.
- Using the deduction theorem without its side condition. In a first-order system with generalisation, gives only when no generalisation in the derivation was applied to a variable free in . Ignoring this "proves" .
- Confusing consistency with soundness. Consistency is internal — no contradiction is derivable. Soundness is a relation to a semantics — nothing false is derivable. A consistent theory can prove falsehoods about its intended structure.
- Confusing the completeness of a logic with the negation-completeness of a theory. Gödel proved both a completeness and an incompleteness theorem, and they are compatible: the first says the logic derives every semantic consequence, the second that no effective consistent theory of arithmetic decides every sentence.
- Applying compactness to a finite theory. A finite is a finite subset of itself, so the theorem is vacuous there. Its power is on infinite sets, where each finite fragment may have a different, smaller model.
- Expecting a canonical model from the Henkin construction. It produces some model, built from the terms of an expanded language and depending on an arbitrary maximal consistent extension. Distinct extensions give non-isomorphic models, which is exactly why Löwenheim–Skolem can vary the cardinality at will.
- Reading undecidability as a bound on proofs. Undecidable means no uniform halting decision procedure. Valid sentences retain their finite derivations; it is the non-valid ones that admit no finite certificate.