Gödel Numbering & Incompleteness Theorems
How finite syntax becomes arithmetic, how the diagonal lemma produces a sentence that talks about its own provability, and exactly what Gödel's two incompleteness theorems do—and do not—say.
Gödel's decisive move was not a paradoxical English sentence. It was a compiler: encode every finite symbol string, formula, and proof as a natural number, then show that elementary arithmetic can express the mechanical relations among those codes. Once a theory can reason about its own proof checker, the diagonal lemma can construct a sentence whose arithmetic content tracks its own provability. Incompleteness is the resulting limit on effective formal theories strong enough for arithmetic, not a claim that every mathematical question is unknowable.
Three notions that must stay separate #
| Notion | Question | Where it lives |
|---|---|---|
| Syntactic completeness of | For every sentence , does or ? | Formal derivations |
| Semantic truth | Is true in a particular structure, such as the standard natural numbers ? | Models |
| Decidability | Is there an algorithm that always determines whether ? | Computation |
Gödel's completeness theorem for first-order logic says that every semantically valid first-order formula is formally derivable. His incompleteness theorem says that certain particular, effective theories of arithmetic cannot decide every sentence in their language. There is no contradiction: one result relates validity across all models to a proof calculus; the other concerns what follows from one recursively presented set of arithmetic axioms.
Arithmetizing syntax #
Assign every primitive symbol a positive integer. A finite sequence of symbol codes can then be encoded, for example, as
where is the $k$th prime. Unique prime factorization makes the sequence recoverable. Real proofs use a convenient effective coding—not necessarily this one—but the chosen code is incidental. What matters is that encoding, decoding, concatenation, substitution, and well-formedness are computable arithmetic operations.
This turns metasyntactic questions into number-theoretic predicates:
- : codes a well-formed formula;
- : substitute the term coded by for the variable coded by in the formula coded by ;
- : codes a valid -proof whose last line has code ;
- : the sentence coded by is provable in .
The proof relation is decidable when the axiom system is presented in a suitable effective form, and it is representable inside weak arithmetic. The theory is therefore not equipped with a magical truth predicate; it contains an arithmetic model of a proof checker.
flowchart TD
S["Finite syntax"] -->|"Gödel code"| N["Natural numbers"]
N --> R["Arithmetic predicates for formula, substitution, proof"]
R --> P["Prov_T(n)"]
P --> D["Diagonal fixed point G"]
D --> I["Limits on what T can prove"]
The diagonal lemma: controlled self-reference #
For any one-variable formula , the diagonal lemma constructs a sentence such that
where is the numeral denoting the Gödel code of . The construction is the formal analogue of giving a program its own source code: a substitution function first turns a formula's code into the code of that formula applied to its own code, and representability brings that operation inside arithmetic.
Choose . The resulting Gödel sentence satisfies
It is useful to read this as "the particular sentence with this code has no -proof," but the displayed biconditional—not an informal quotation—is the actual mathematical object.
First incompleteness theorem #
Assume is consistent. If , then there is a concrete proof code . Because proof checking is representable, can verify that code and prove . But also proves , yielding a contradiction. Therefore .
The other direction needs care:
- Gödel's original argument used -consistency to obtain .
- Rosser's refinement constructs a different sentence comparing the shortest proofs of it and its negation; ordinary consistency then suffices to show that neither side is provable.
Thus a standard modern form is:
"Unprovable" is relative to . Adding as a new axiom may decide that sentence, but the stronger effective theory—if it remains consistent—has a new independent sentence. The theorem blocks a final effective completion, not the extension of any particular theory.
When may the Gödel sentence be called true? #
Provability is syntactic; truth is semantic. If is sound in the standard natural numbers, then is true in : there really is no natural number coding a -proof of it. Consistency alone is enough for the unprovability half of the argument, but it does not justify casually identifying everything cannot refute with standard truth.
This distinction also explains two important counterpoints:
- True arithmetic, the set of all sentences true in , is complete, but it is not computably axiomatizable.
- Presburger arithmetic, which has addition but not multiplication, is complete and decidable. It is not strong enough for the arithmetization required by the theorem.
Incompleteness is a three-way constraint: a theory cannot simultaneously retain the relevant arithmetic strength, effective axiomatization, consistency, and completeness.
Second incompleteness theorem #
Let
be the standard arithmetical statement that no -proof of a contradiction exists. Under the usual representability and derivability conditions on the chosen provability predicate, the reasoning about can itself be formalized in strongly enough to establish
If a consistent proved , it would prove , contradicting the first theorem's unprovability result. Hence:
This does not say that consistency proofs are impossible. A stronger theory may prove ; the theorem says that then inherits the analogous question about . It also does not apply to arbitrary sentences merely called "consistency": the formalized proof predicate and its derivability properties matter.
Incompleteness implies an algorithmic boundary #
Proofs of a computably axiomatized theory can be enumerated. If such a theory were also consistent and complete, an algorithm deciding theoremhood could run two proof searches in parallel: one for , one for . Completeness guarantees that one search finishes, and consistency guarantees that they do not both succeed. For sufficiently strong arithmetic, incompleteness prevents this route; theoremhood is computably enumerable but undecidable.
That connection is not an accident. Gödel coding supplies the data representation, representability supplies an interpreter for effective operations, and diagonalization lets the system confront the behavior of its own proof enumeration. The same pattern reappears in the halting problem.
Misreadings to reject #
A practical reasoning checklist #
When an incompleteness claim appears, ask:
- Which theory ? Its language, axioms, and proof calculus must be fixed.
- Is effective? Can its axioms or proofs be mechanically enumerated?
- How strong is it? Can it represent the required syntax and elementary arithmetic?
- Which assumption is used? Consistency, -consistency, or soundness are not interchangeable.
- Is the claim syntactic or semantic? "Not provable in " and "false in " answer different questions.
- Is consistency internalized canonically? The second theorem concerns a represented proof predicate satisfying precise derivability conditions.