42.01.09 · mathematical-logic / first-order-logic-completeness

Gödel Numbering, the Fixed-Point Lemma, and the Incompleteness Theorems

shipped3 tiersLean: none

Anchor (Master): Enderton 2001 *A Mathematical Introduction to Logic* 2e §3.4-3.5; Boolos, Burgess and Jeffrey 2007 *Computability and Logic* 5e (Cambridge) Ch. 17-18 (the diagonal lemma, the first and second incompleteness theorems, the derivability conditions); Smorynski 1977 'The incompleteness theorems' in the *Handbook of Mathematical Logic* (North-Holland) (the modal/derivability-condition treatment, Löb's theorem, provability logic GL); Hájek and Pudlák 1993 *Metamathematics of First-Order Arithmetic* (Springer) Ch. I, III (the formalised $\Sigma_1$-completeness and the second theorem inside $I\Sigma_1$); Lindström 1997 *Aspects of Incompleteness* (Springer) (the interpretability and reflection landscape, Rosser's trick, the structure of the $\Pi_1$/$\Sigma_1$ independent sentences)

Intuition Beginner

The previous unit showed that arithmetic can mirror any computation. This unit cashes that in for the most famous result in logic. The first move is a coding trick. Pick a fixed scheme that turns every symbol, every formula, and every written proof into a whole number — the way text is stored as numbers inside a computer. Once that is fixed, a statement about formulas becomes a statement about numbers, and a theory that talks about numbers can be made to talk about its own sentences and its own proofs.

Now comes the surprising part. Using this coding, you can build a single sentence that, read through the code, says of itself: "I have no proof in this theory." Call it . Think about whether could be provable. If the theory could prove , then would be a proved sentence that announces it has no proof — the theory would be proving a falsehood. A trustworthy theory does not do that. So is not provable. But that is exactly what claims. So is true and yet unprovable.

The conclusion is stark. Any reasonable theory of arithmetic — one that is consistent and whose axioms a machine can list — must leave some true statements unproved. You cannot fix this by adding more axioms: the same trick builds a new unprovable truth for the patched-up theory. There is no complete, consistent, machine-checkable bible of all arithmetic truths.

A second sentence makes it worse. The statement "this theory is consistent" can itself be coded as a sentence of arithmetic. A consistent theory cannot prove its own consistency. The theory's faith in itself is one thing it can never establish from the inside.

Visual Beginner

The picture is a loop that bites its own tail. A coding scheme sends each sentence to a number; a special sentence is built so that, decoded, it talks about its own number. The diagram traces how "I am unprovable" closes the loop.

   STEP 1: code everything as numbers
       sentence  phi   --->  number  #phi
       a proof   P     --->  number  #P
       "p is a proof of the sentence coded x"  ---> a number-relation Prf(p, x)

   STEP 2: build a sentence G that points back at its own code

        G   says:   "there is NO number p with  Prf( p , #G )"
                                                       ^^^^
                                  G's claim is ABOUT G's own code

   STEP 3: ask if G can be proved

        if the theory proves G   -->  there IS a proof of G
                                  -->  so "no proof of G" is FALSE
                                  -->  the theory proved a falsehood   (not allowed)

        therefore   G is NOT provable
        but that is exactly what G says   -->  G is TRUE

   RESULT:  a sentence that is true but has no proof.

A code is a fixed dictionary: every sentence gets a number, no two sentences share a number, and you can mechanically translate back and forth. Once " is a proof of the sentence with number " is itself a relation between numbers, arithmetic can express it, and the self-pointing sentence becomes possible.

sentence built what it says about itself the outcome
"I am not provable" true but unprovable
Con "this theory is consistent" true but unprovable (if the theory is consistent)
(a Liar) "I am false / I am untrue" shows truth is not codeable at all

The same self-pointing move yields three results: an unprovable truth, an unprovable consistency, and the impossibility of a truth-detector.

Worked example Beginner

We watch the self-reference get built with a tiny made-up coding, to see that nothing magical happens — it is bookkeeping. Suppose our only formulas are short strings, and we fix a dictionary that assigns each one a number. Say the formula " is even" gets the number , and the formula " has no proof" gets the number . These numbers are the codes.

Step 1. Set up one operation on codes: substitution. Given the code of a formula with a blank , and a number , "substitute for " produces the code of the new sentence. Write this as . For instance, is the code of " is even." This is a definite numerical operation: feed it two numbers, get one number back.

Step 2. We want a sentence that talks about its own code. The clever step is to substitute a formula's code into that same formula. Take the formula "the sentence coded has no proof," and let its code be some number, say .

Step 3. Now plug in for in that very formula. By definition the result is the sentence "the sentence coded has no proof." But is, by construction, the code of this very sentence we just wrote. So the sentence says "the sentence coded (my own code) has no proof" — it talks about itself.

Step 4. Read what it now claims: "I have no proof." We built a self-referential sentence using only the substitution operation on codes, no paradox and no infinite regress.

What this tells us: self-reference is not a mystical trick. It is the ordinary operation of plugging a formula's code into itself, which the substitution function makes a plain numerical computation. Because arithmetic can carry out that computation, arithmetic can host sentences that speak about themselves — and "I am unprovable" is one of them.

Check your understanding Beginner

Formal definition Intermediate+

Fix the language of arithmetic , its standard model 42.01.04 pending, and a theory in that is recursively axiomatised (its set of axiom codes is recursive) and extends 42.01.08 pending. A Gödel numbering is an injective effective map assigning to each symbol, term, formula, and finite sequence of formulas a natural number, built from a recursive coding of finite sequences (for instance with the -th prime, or Gödel's -function coding of 42.01.08 pending). For a formula the closed term is its numeral, the -name of its code; we write for this numeral when the context is a formula slot [Enderton §3.4].

The substitution function and the diagonal function are primitive recursive, hence representable in . For recursively axiomatised the relations " codes an -formula", " codes a -axiom", and the proof predicate $$ \mathrm{Prf}_T(p, x) \equiv \text{" codes a finite -deduction whose last line is the formula coded by "} $$ are primitive recursive, so is representable in by a formula (also written ). The provability predicate is the formula $$ \mathrm{Pr}_T(x) := \exists p,\mathrm{Prf}_T(p, x), $$ and for a sentence one abbreviates . The consistency statement is the sentence $$ \mathrm{Con}_T := \neg,\mathrm{Pr}_T(\ulcorner 0 = S0\urcorner), $$ expressing that the refutable sentence has no -proof.

A theory is -consistent when for no formula does while for every ; -consistency implies consistency but is strictly stronger. The truth set is , the set of codes of true arithmetic sentences. A set is arithmetically definable when for some -formula .

Counterexamples to common slips Intermediate+

  • "The Gödel sentence is provably equivalent to a paradox, so the theory is contradictory." The Liar "I am false" is a genuine paradox because truth is not arithmetically definable (Tarski). The Gödel sentence replaces "false" with the definable predicate "not provable", which is , not "true"; self-reference through a definable predicate is consistent, and is simply true and unprovable.

  • "Incompleteness needs the full strength of ." The first theorem needs only that extends and is recursively axiomatised and consistent — no induction. Induction (e.g. ) is needed only for the second theorem, whose derivability conditions require provable -completeness inside .

  • " and both follow from consistency." Only follows from plain consistency. needs -consistency in Gödel's original argument; plain consistency suffices only after Rosser's modification of the provability predicate.

  • "The second theorem says no consistency proof of is possible." It says cannot prove in itself. A stronger theory can prove (Gentzen proved using transfinite induction up to ); the bar is on self-certification, and it is sensitive to how consistency is formalised (a Rosser or Feferman predicate can make a -variant provable).

Key theorem with proof Intermediate+

The hinge of the entire development is the diagonal lemma: arithmetic admits self-reference. Everything downstream — both incompleteness theorems, Tarski's theorem, Löb's theorem — is an instance of feeding a chosen predicate into a sentence that asserts that predicate of its own code.

Lemma (Diagonal / Fixed-Point). Let be recursively axiomatised. For every formula with one free variable there is a sentence with $$ T \vdash G \leftrightarrow \psi(\ulcorner G\urcorner). $$ [Enderton §3.4].

Proof. The diagonal function is primitive recursive, hence by the representability theorem 42.01.08 pending there is a formula representing its graph in : for all , . Define the formula $$ \theta(x) := \exists y,\big(\mathrm{Diag}(x, y) \wedge \psi(y)\big), $$ let be its code, and set , a sentence. By definition of and , . Now proves , so inside , $$ G = \theta(\underline g) = \exists y,(\mathrm{Diag}(\underline g, y) \wedge \psi(y)) ;\leftrightarrow; \psi(\underline{d(g)}) ;=; \psi(\ulcorner G\urcorner). $$ The existential collapses because pins to the single value provably in . Hence .

Theorem (Gödel's First Incompleteness Theorem). Let be consistent and recursively axiomatised. Let be a fixed point of , so . Then , and if is -consistent then ; so is incomplete. Moreover is a true sentence [Enderton §3.5].

Proof. Suppose . Then there is a -proof of , coded by some , so ; this is a true fact, so by -completeness , whence . But the fixed-point equivalence gives , so from we get , contradicting consistency. Hence .

For the second half, suppose , i.e. , that is . Since , no number actually codes a proof of , so for every the sentence is false, hence (-completeness, refuting false closed sentences) for every . Together with this is exactly an -inconsistency. So under -consistency . Finally, is true: means no codes a proof, so , and the fixed point gives ; and is because is .

Bridge. The diagonal lemma is the foundational reason a theory of numbers can refer to itself, and the first incompleteness theorem is exactly this self-reference pointed at the provability predicate that representability 42.01.08 pending makes available. It builds toward Tarski's undefinability of truth — the same diagonal aimed at a hypothetical truth predicate yields a contradiction rather than an unprovable truth, the difference being that "not provable" is definable while "true" is not — and it appears again in the second incompleteness theorem [42.01.10 context], where the metatheoretic step "if is consistent then " is itself formalised inside as . This is the central insight: the gap between truth and provability, measured by the asymmetry of 42.01.08 pending, is not an accident of a particular theory but a fixed point of the theory's own provability operator. Putting these together, completeness 42.01.06 pending and incompleteness do not conflict — completeness equates with semantic consequence across all models, while incompleteness concerns truth in the single standard model , where holds but is underivable because some nonstandard model of refutes it.

Exercises Intermediate+

Advanced results Master

The diagonal lemma supports four developments: the abstract first theorem and its hypotheses, Rosser's elimination of -consistency, the second theorem through the derivability conditions and Löb's theorem, and the landscape of concrete independent statements and the misreadings the theorems invite.

Theorem 1 (the first theorem, abstract form, and its exact hypotheses). For consistent recursively axiomatised , the Gödel sentence obtained by diagonalising is unprovable; under -consistency it is also irrefutable; in every case it is a true sentence [Boolos-Burgess-Jeffrey Ch. 17]. Each hypothesis does exact work: recursive axiomatisability makes primitive recursive and hence representable, so exists as a formula; extension of supplies -completeness, the bridge from a real proof to its formalised witness; consistency blocks ; -consistency blocks . Weakening any one breaks a step: a non-recursively-axiomatised (e.g. true arithmetic itself) has no representable proof predicate and is complete, dodging the theorem precisely because its axiom set is undefinable. The theorem is therefore not about the content of arithmetic but about the tension between effective axiomatisability and completeness.

Theorem 2 (Rosser's theorem: incompleteness from plain consistency). Replacing by the Rosser predicate and diagonalising yields a Rosser sentence with and from plain consistency alone [Lindström Ch. 2]. The asymmetry of Gödel's argument — provability is but refutability had to be controlled over all numerals — is repaired by building the comparison of proof codes into the predicate, so that both non-provability claims reduce to bounded statements that decides. Rosser's sentence is no longer simply "true": its truth value depends on the ordering of proofs, and it is not in general equivalent to , unlike the Gödel sentence. The cost of dropping -consistency is the loss of the clean "true but unprovable" reading.

Theorem 3 (the second theorem and Löb's theorem). With satisfying the Hilbert-Bernays-Löb conditions (D1) ; (D2) ; (D3) , a consistent satisfies [Enderton §3.5]. Löb's theorem iff subsumes it at , and resolves Henkin's problem: the self-asserting-provability sentence is provable. The conditions are where induction is consumed — (D3) is the internalised -completeness of 42.01.08 pending, provable only with enough induction (), which is why alone gives the first theorem but not the second. Solovay's completeness theorem identifies the schematically valid principles of with the modal logic GL (Gödel-Löb), axiom ; the second theorem and Löb's theorem are theorems of GL, so the entire calculus of provability is a decidable modal logic.

Theorem 4 (concrete independence and the limits of the theorems). Beyond the metamathematical and , there are genuinely combinatorial statements independent of : the Paris-Harrington strengthened finite Ramsey theorem and Goodstein's theorem on the termination of Goodstein sequences, each true (provable in via transfinite induction past ) but unprovable in , with the unprovability shown by encoding the -recursion that bounds 's provably total functions [Lindström Ch. 3]; these connect to the Ramsey-theoretic combinatorics of 40.05.04. What the theorems do not show: not that there are absolutely unknowable truths (each is provable in a stronger system, e.g. ); not that mathematics is inconsistent or that is ill-defined; not, against the Lucas-Penrose argument, that human minds transcend machines — that argument assumes the human can know its own consistency to assert its Gödel sentence, the very self-certification the second theorem forbids for any consistent recursively axiomatised system, so a consistent mechanical mind is in the same position and the alleged advantage evaporates. The theorems bound effective axiomatic capture, not knowledge or truth.

Synthesis. The diagonal lemma is the foundational reason every result here exists, and putting these together it organises all four developments as one construction aimed at four predicates: gives the unprovable of Theorem 1, gives the Rosser sentence of Theorem 2 that needs only consistency, gives Löb's sentence and through it the second theorem of Theorem 3, and gives the Liar that proves truth undefinable — the same self-application separating "definable predicate" (provability, ) from "undefinable predicate" (truth). This is the central insight: incompleteness is the fixed point of the provability operator, and the second theorem is dual to the first across the move from " is true" (semantic, in ) to " is provable" (syntactic, in ), a move that costs exactly the induction () needed for the derivability conditions. The provability operator generalises from arithmetic to the modal logic GL, so that the whole phenomenon is the decidable calculus of a single modality, and the theorems integrate with computation 42.04.02: the proof set is recursively enumerable and complete, its undecidability is the recursion-theoretic shadow of incompleteness, and Church's theorem on the Entscheidungsproblem 42.01.10 pending routes through the very representability 42.01.08 pending that powers . Completeness 42.01.06 pending and incompleteness are the bridge between the two readings of "": complete across all models, incomplete against the standard one — no tension, because fails in some nonstandard model of .

Full proof set Master

Proposition 1 (Diagonal lemma). For recursively axiomatised and any , there is a sentence with .

Proof. The diagonal function is primitive recursive (substitution of a numeral into a formula is a bounded recursion on the code), hence by 42.01.08 pending represented in by a formula with for each . Set , , . Then , and extends so . Substituting into , the unique survives, giving .

Proposition 2 (First incompleteness, non-provability of ). For consistent recursively axiomatised and a fixed point of , .

Proof. If then some codes a proof, so is a true closed (indeed ) sentence; by -completeness of 42.01.08 pending, , hence by existential introduction. The fixed point gives , so , and with this makes inconsistent. So , whence and : is true.

Proposition 3 (First incompleteness, non-refutability under -consistency). If moreover is -consistent, then .

Proof. By Proposition 2, , so no codes a -proof of ; each is a false closed sentence, hence for every by -completeness. Were , the fixed point gives , i.e. ; together with for all , this is an -inconsistency. So .

Proposition 4 (Tarski's undefinability of truth). No -formula satisfies for all sentences ; equivalently is not arithmetically definable.

Proof. Suppose works. Diagonalise : there is with (the diagonal lemma is provable in , sound in ). The defining property of gives , so , impossible. If were defined by , then would be such a , contradiction.

Proposition 5 (Löb's theorem). Under (D1)-(D3), implies .

Proof. Diagonalise to get with . Then ; applying (D1) and (D2) twice and (D3) once yields (the box distributes over the implication and (D3) supplies ). With the hypothesis , , which is the right side of the fixed point, so . By (D1), , and detaching gives .

Proposition 6 (Gödel's second incompleteness theorem). For consistent recursively axiomatised , .

Proof. Take in Löb's theorem; and . If , i.e. , then vacuously (its antecedent is refuted), so by Proposition 5 , i.e. , contradicting consistency. The hypothesis is used to secure (D3), the formalised -completeness inside , which alone does not provide.

Connections Master

  • Representability of recursive functions 42.01.08 pending supplies every ingredient consumed here: the proof predicate is primitive recursive and so -representable in , the substitution function is representable and so the diagonal lemma holds, and the -completeness proved there is exactly what turns a real proof into a provable formal witness and supplies derivability condition (D3) for the second theorem. That unit owns the bridge from computation to provable-numeral facts; this unit aims that bridge at the theory's own syntax to manufacture self-reference, so is the engine and is the destination of the chapter.

  • The completeness theorem for first-order logic 42.01.06 pending is the apparent foil that turns out to be no tension: completeness equates with semantic consequence over all structures, while the first incompleteness theorem concerns truth in the single standard model . The Gödel sentence is true in yet unprovable, which by completeness means some model of refutes it — a nonstandard model. Completeness even underwrites the existence of that model, so the two theorems are complementary descriptions of the same turnstile.

  • The halting problem and the recursion theorem 42.04.02 are the computational form of this unit's self-reference: Kleene's recursion theorem (a program can access its own code) is the diagonal lemma in the language of computation, and the undecidability of the halting set is the undecidability of the -complete provability set. The Gödel sentence is the proof-theoretic image of a program that halts iff it does not, and the unsolvability of halting and the unprovability of are one phenomenon in two metatheories.

  • Church's theorem and the Entscheidungsproblem 42.01.10 pending, co-produced with this unit, draw the undecidability conclusion: because is representable and the provability set is recursively enumerable but not recursive (its complement is productive), first-order validity is undecidable. The same arithmetisation that yields incompleteness yields the negative solution of Hilbert's decision problem, so and are the two faces — incompleteness and undecidability — of the representability of 42.01.08 pending.

  • The strengthened finite Ramsey theorem and combinatorial independence 40.05.04 give the concrete payoff: the Paris-Harrington principle is a true Ramsey-theoretic statement unprovable in , the first natural mathematical (rather than metamathematical) example, with unprovability shown by the -recursion bounding 's provably total functions. It instantiates this unit's general theorem in everyday combinatorics rather than in self-referential coding.

Historical & philosophical context Master

Kurt Gödel proved both incompleteness theorems in Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I (1931), constructing the proof predicate by arithmetising the syntax of Principia Mathematica via primitive recursive functions and the -function, building the self-referential sentence by the diagonal construction, and stating the second theorem (the unprovability of consistency) with only a sketch, the full proof of the derivability conditions being deferred [Enderton §3.4]. David Hilbert and Paul Bernays supplied the detailed derivability conditions and the formalised second theorem in Grundlagen der Mathematik II (1939), and Martin Hilbert Löb proved the theorem now bearing his name in "Solution of a problem of Leon Henkin" (1955), answering whether a sentence asserting its own provability is provable [Smoryński §1].

Alfred Tarski's undefinability of truth appeared in "Der Wahrheitsbegriff in den formalisierten Sprachen" (1936; Polish 1933), the semantic counterpart isolating that the obstruction is the indefinability of truth, not of provability [Boolos-Burgess-Jeffrey Ch. 17]. J. Barkley Rosser removed the -consistency hypothesis in "Extensions of some theorems of Gödel and Church" (1936) with the ordered-proof predicate. The collapse of Hilbert's programme — a finitistic, internal consistency proof for a theory containing arithmetic — followed directly from the second theorem; Gerhard Gentzen's 1936 consistency proof of by transfinite induction to showed what an external proof must cost. Robert Solovay's "Provability interpretations of modal logic" (1976) identified the modal logic GL as the complete calculus of the provability operator, and Petr Hájek and Pavel Pudlák fixed the exact fragment () over which the derivability conditions and the second theorem hold [Lindström Ch. 2].

Bibliography Master

@book{enderton2001logic,
  author    = {Enderton, Herbert B.},
  title     = {A Mathematical Introduction to Logic},
  edition   = {2},
  publisher = {Harcourt/Academic Press},
  year      = {2001}
}

@article{godel1931,
  author  = {G\"{o}del, Kurt},
  title   = {\"{U}ber formal unentscheidbare S\"{a}tze der {Principia Mathematica} und verwandter Systeme {I}},
  journal = {Monatshefte f\"{u}r Mathematik und Physik},
  volume  = {38},
  year    = {1931},
  pages   = {173--198}
}

@book{hilbertbernays1939,
  author    = {Hilbert, David and Bernays, Paul},
  title     = {Grundlagen der Mathematik II},
  publisher = {Springer},
  year      = {1939}
}

@article{lob1955,
  author  = {L\"{o}b, Martin H.},
  title   = {Solution of a problem of {Leon Henkin}},
  journal = {Journal of Symbolic Logic},
  volume  = {20},
  number  = {2},
  year    = {1955},
  pages   = {115--118}
}

@article{rosser1936,
  author  = {Rosser, J. Barkley},
  title   = {Extensions of some theorems of {G\"{o}del} and {Church}},
  journal = {Journal of Symbolic Logic},
  volume  = {1},
  number  = {3},
  year    = {1936},
  pages   = {87--91}
}

@incollection{tarski1936truth,
  author    = {Tarski, Alfred},
  title     = {Der Wahrheitsbegriff in den formalisierten Sprachen},
  journal   = {Studia Philosophica},
  volume    = {1},
  year      = {1936},
  pages     = {261--405}
}

@article{solovay1976,
  author  = {Solovay, Robert M.},
  title   = {Provability interpretations of modal logic},
  journal = {Israel Journal of Mathematics},
  volume  = {25},
  year    = {1976},
  pages   = {287--304}
}

@article{parisharrington1977,
  author  = {Paris, Jeff and Harrington, Leo},
  title   = {A mathematical incompleteness in {Peano} arithmetic},
  journal = {Handbook of Mathematical Logic},
  year    = {1977},
  pages   = {1133--1142}
}

@book{boolosburgessjeffrey2007,
  author    = {Boolos, George S. and Burgess, John P. and Jeffrey, Richard C.},
  title     = {Computability and Logic},
  edition   = {5},
  publisher = {Cambridge University Press},
  year      = {2007}
}

@book{lindstrom1997,
  author    = {Lindstr\"{o}m, Per},
  title     = {Aspects of Incompleteness},
  series    = {Lecture Notes in Logic 10},
  publisher = {Springer},
  year      = {1997}
}

@incollection{smorynski1977incompleteness,
  author    = {Smory\'{n}ski, Craig},
  title     = {The incompleteness theorems},
  booktitle = {Handbook of Mathematical Logic},
  editor    = {Barwise, Jon},
  publisher = {North-Holland},
  year      = {1977},
  pages     = {821--865}
}