This is a complex and important topic in mathematical logic. Let me work through this carefully and systematically.
Gödel's Incompleteness Theorem - Detailed Explanation
I need to cover:
- Gödel numbering and how it encodes formulas
- The construction of the self-referential sentence G
- How "this formula cannot be proved" is expressed arithmetically
- Why G must be true but unprovable in consistent systems
Part 1: Gödel Numbering
Gödel numbering is a method of encoding formulas of formal arithmetic as natural numbers. The key idea is to assign each symbol a unique number, then encode sequences of symbols.
Basic Assignment:
- Variables: x₁, x₂, x₃, ... → 13, 15, 17, ... (odd numbers ≥ 13)
- Logical symbols:
- ¬ → 1
- → (implication) → 3
- ∀ → 5
- ∃ → 7
- Punctuation:
- Arithmetic:
- 0 → 2
- S (successor) → 3
-
- × → 7
- = → 11
Wait, I'm being imprecise with some overlaps. Let me be more careful with a standard assignment. Different texts use slightly different numberings. Let me use a cleaner version:
Standard Gödel numbering for a formal system:
-
¬ → 1
-
→ (implication) → 2
-
∨ → 3
-
∧ → 4
-
∀ → 5
-
∃ → 6
-
( → 7
-
) → 8
-
= → 9
-
-
× → 11
-
0 (zero constant) → 12
-
S (successor) → 13
-
Variables x₀, x₁, x₂, ... → 14, 15, 16, ... (starting at 14)
Encoding sequences:
To convert a formula into a single number, I use the prime factorization method. If a formula has symbols with Gödel numbers a₁, a₂, ..., aₙ, then its Gödel number is:
G = 2^(a₁) × 3^(a₂) × 5^(a₃) × ... × p_n^(aₙ)
where p_n is the n-th prime. This ensures each formula maps to a unique natural number, and I can recover the original formula by factoring G and reading off the exponents.
For instance, "0 = 0" encodes as 2^12 × 3^9 × 5^12 since 0 has code 12, = has code 9, and 0 has code 12 again. The fundamental theorem of arithmetic guarantees this mapping is reversible.
Part 2: Encoding Arithmetic Properties as Metamathematical Formulas
The crucial move is expressing proof and formula properties directly in arithmetic. I need to define predicates that capture when one number encodes a valid proof of another.
Key definitions:
-
Proof predicate: An arithmetic formula Prov(x, y) expresses when x encodes a proof and y encodes the formula being proved. This works because checking whether x factors into a valid sequence of formulas—where each follows from axioms or prior formulas by inference rules—amounts to decidable arithmetic operations.
-
Provability: From this, I can define Prov(y) = ∃x Prov(x, y), capturing that formula y is provable by some proof.
-
Consistency: In a consistent system, we never have both Prov(y) and Prov(¬y) simultaneously for any formula y.
Part 3: The Self-Referential Construction
Gödel's breakthrough involves constructing a formula that refers to itself.
Step 1: Diagonalization
Take a formula P(x) with a single free variable and compute its Gödel number m. Then P(m) substitutes m back into the formula.
Step 2: The diagonal function
Define diag(m) = n, where m is the Gödel number of a formula P(x) and n is the Gödel number of P(m). This diagonal operation can be expressed as an arithmetic function d(m).
Step 3: The unprovable statement
Consider ¬∃x Prov(x, y), which asserts that y has no proof—that y is unprovable.
Step 4: Self-reference through diagonalization
Apply diag to the code c of this formula. We get G = diag(c), which is the Gödel number of ¬∃x Prov(x, G). Substituting G for y yields the sentence: G = ¬∃x Prov(x, G), meaning "this very formula G is not provable."
When G is factored into primes using Gödel numbering, we recover its logical structure—the negation, the existential quantifier, the proof predicate, and crucially, the self-reference to G itself.
Why G cannot be proven
Suppose G were provable in T. Then there would exist a proof with Gödel number x such that Prov(x, G) holds. But G asserts exactly that no such x exists—that ¬∃x Prov(x, G). This creates a contradiction if T is consistent. So G must be unprovable. The predicate "Prov(x, y)" can be verified computationally when x is a Gödel number of an actual proof and y is the Gödel number of the conclusion. Gödel established that if T ⊢ φ, then T itself can prove Prov(⌈φ⌉, ⌈φ⌉).
The crucial insight involves Gödel's Fixed Point Lemma: for any arithmetic formula P(x) with a single free variable, there exists a sentence φ satisfying T ⊢ φ ↔ P(⌈φ⌉). When we set P(x) = ¬Prov(x), this construction yields the self-referential sentence that generates the incompleteness result.
Assuming T is consistent, I can establish that this sentence G—defined by T ⊢ G ↔ ¬Prov(⌈G⌉)—cannot be proven within T. If T were to prove G, then by the equivalence, T would prove ¬Prov(⌈G⌉), yet the formalization of provability would simultaneously force T to prove Prov(⌈G⌉), creating a contradiction. Therefore G remains unprovable in any consistent system T. ¬∃x Prov(x, G) (from the equivalence)
- T ⊢ ∃x Prov(x, G) (from the hypothetical proof)
This creates a contradiction, so T cannot prove G while remaining consistent.
Since T is consistent and sound, G must be true even though it's unprovable in T. The fixed point ensures G states its own unprovability, and because no proof of G exists in T, the statement G itself is true in any model of T. "there is no proof of G within T."
If T actually proves G, then by the fixed point property, T would prove that G is unprovable. But we'd have a genuine proof of G in hand, creating a contradiction with T's consistency. The key insight is that T cannot simultaneously prove both G and its negation—so if assuming T ⊢ G leads to this conflict, then T must fail to prove G. So if T ⊢ G, then T ⊢ ∃x Prov(x, ⌈G⌉). But the fixed point construction gives us T ⊢ G ↔ ¬∃x Prov(x, ⌈G⌉), which means T would simultaneously prove both ∃x Prov(x, ⌈G⌉) and its negation. This contradiction shows T cannot prove G.
For the second part, suppose T ⊢ ¬G.
Then T ⊢ ∃x Prov(x, ⌈G⌉), which by the fixed point equivalence means T ⊢ ¬G. So we get T ⊢ ¬G and T ⊢ ∃x Prov(x, ⌈G⌉) simultaneously, which is again inconsistent unless we're careful about what the provability predicate actually captures.
For the second part, if T is sound and T ⊢ ¬G, then ¬G must be true in the standard model, making ∃x Prov(x, ⌈G⌉) true. But G is unprovable from part 1, so this existential statement should be false—a direct contradiction with soundness.
The resolution is that G remains unprovable under consistency, ¬G remains unprovable under both consistency and soundness, yet in the standard model G is actually true because it correctly asserts its own unprovability in T.
Starting from scratch: T is a consistent formal system like PA or ZFC that can express arithmetic. Using Gödel numbering, formulas become numbers, and the provability relation Prov(x, y) becomes a primitive recursive predicate that T can represent. The key construction yields G such that T ⊢ G ↔ ¬∃x Prov(x, ⌈G⌉). If T proves G, then a proof exists, making the existential true and contradicting what G asserts about itself. If T proves ¬G instead, soundness forces the existential to be true in reality, yet G is unprovable—another contradiction. the fixed point: T ⊢ G → ∃x Prov(x, ⌈G⌉)
- Wait, that's not quite right either.
Let me think about this differently.
By the fixed point lemma: T ⊢ G ↔ ¬∃x Prov(x, ⌈G⌉)
This is an equivalence that T proves.
Now, the question is: does T ⊢ G?
Subcase A: Suppose T ⊢ G
Then we have a proof of G. Let's say this is a finite sequence of formulas f₁, f₂, ..., fₙ = G.
Each formula in this sequence either:
- Is an axiom of T, or
- Follows from previous formulas by a rule of inference
This entire sequence can be encoded as a single Gödel number, call it d. And we can verify that d is indeed a proof of G by checking these properties—this is a finite, computational task.
The property "d is a proof of φ" can be expressed as a primitive recursive arithmetic formula Prov(d, ⌈φ⌉). Since T is strong enough to express all primitive recursive relations, we have T ⊢ Prov(d, ⌈G⌉), which gives us T ⊢ ∃x Prov(x, ⌈G⌉).
But this contradicts our fixed point equivalence: T ⊢ G ↔ ¬∃x Prov(x, ⌈G⌉).
If T ⊢ G, then T ⊢ ¬∃x Prov(x, ⌈G⌉), yet we also derived T ⊢ ∃x Prov(x, ⌈G⌉). This makes T inconsistent.
So if T is consistent, then T ⊬ G.
Subcase B: Suppose T ⊬ G
Then no proof of G exists in T, so ¬∃x Prov(x, ⌈G⌉) is true in standard arithmetic. By the equivalence, G itself must be true in the standard model. G is true but unprovable in T.
Can T prove ¬G?
If T ⊢ ¬G, then T ⊢ ∃x Prov(x, ⌈G⌉), which contradicts our assumption that T is consistent and has no proof of G. If T is sound, this contradiction becomes even sharper—T cannot prove ¬G either.
But Gödel's insight was that consistency alone suffices. Since Prov(x, ⌈G⌉) is primitive recursive, if T ⊢ ∃x Prov(x, ⌈G⌉), then there must be some specific numeral n where T ⊢ Prov(n, ⌈G⌉). Yet we know no such proof exists in T, so consistency prevents T from proving ¬G as well.
The key distinction: consistency guarantees T ⊬ G because G asserts its own unprovability. And consistency also blocks T ⊢ ¬G, since that would require T to prove a false existential statement about proofs. So from consistency alone, both G and ¬G remain unprovable in T.
Now I should organize how to present this clearly—starting with how formulas get encoded as numbers, then showing how provability becomes expressible arithmetically, then demonstrating the self-referential construction, and finally explaining why G is unprovable yet true.
Gödel's Self-Referential Sentence: Construction and Paradox
1. Gödel Numbering: Encoding Syntax as Arithmetic
Gödel's breakthrough was showing that formulas about formulas can be expressed as formulas about numbers.
Basic Encoding
Assign each symbol a unique code:
- Logical symbols: ¬→1, ∀→5, (→7, )→11
- Arithmetic: 0→2, =→9, +→10, ×→11, S(successor)→13
- Variables: x₀→14, x₁→15, x₂→16, ...
Sequential Encoding (The Prime Power Method)
For any formula, use prime factorization to recover it perfectly:
Go¨del number=2c1
where ci is the code of the i-th symbol and pn is the n-th prime.
Example: "0 = 0" becomes:
- Symbols: 0(code 2), =(code 9), 0(code 2)
- Number: 22×39×52=4
This works because of the Fundamental Theorem of Arithmetic: unique factorization means every formula has a unique number, recoverable by factoring.
2. The Provability Predicate
Encoding "x is a proof of y"
Define an arithmetic formula Prov(x,y) that holds when:
- x factors into a sequence ⟨f1,f2,…,f (Gödel-decoded)
Crucially: All these conditions are primitive recursive—they can be verified by finite computational checking of the prime factorization of x.
Unprovability as Arithmetic
Now we can express "formula y is not provable":
¬∃xProv(x,y)
This is a genuine arithmetic statement about numbers, saying "no number x has the right factorization structure to be a proof of y."
3. Gödel's Brilliant Move: Diagonalization
The Fixed-Point Construction
Step 1: Consider any formula with one free variable P(x).
Step 2: Compute the Gödel number of P(x) itself; call it ┌P┐.
Step 3: Form P(┌P┐) — substitute the code into the formula itself.
This creates a diagonal function: encode the formula's Gödel number into the formula.
Building G: The Self-Referential Sentence
Now apply this to the formula:
¬∃xProv(x,y)
which says "y is not provable."
Let c be the Gödel number of this very formula (with y free).
Apply diagonalization: Substitute c for y:
G:=¬∃xProv(x,┌G┐)
Decoded: "G is not provable in the system."
The self-reference is explicit in the prime factorization of Prov(x,┌G┐)—when you factor it out, you recover the formula containing its own Gödel number.
4. Why G is Unprovable (if T is Consistent)
Proof by Contradiction
Assume T⊢G (the system proves G).
Then a proof exists—a finite sequence of formulas with some Gödel number, say d.
Since "y is a proof of z" is primitive recursive:
T⊢Prov(d,┌G┐)
Therefore:
T⊢∃xProv(x,┌G┐)
But by our self-referential construction:
T⊢G⟺T⊢¬∃xProv(x,┌G┐)
If T⊢G, then:
T⊢¬∃xProv(x,┌G┐)
Contradiction: We have both:
- T⊢∃xProv(x,┌G┐) (from the proof existing)
- T⊢¬∃x (from G being provable)
This would make T inconsistent.
Therefore, if T is consistent: T⊢G
5. Why G is True Despite Being Unprovable
The Standard Model vs. the System
Since we've proven T⊢G:
- There genuinely is no proof of G in the system
- Therefore ∃xProv(x,┌G┐) is false in standard arithmetic
- Therefore ¬∃xProv(x,┌G┐) is true in standard arithmetic
- But this is precisely what asserts!
G is true in the standard model, but unprovable in T
The Deeper Insight
- G's self-reference works: When factored, the prime exponents reveal the formula contains its own Gödel number
- The liar's paradox is avoided: G says "I'm unprovable," not "I'm false"—avoiding contradiction
- Truth transcends proof: G is true because it correctly describes the system's limitations
- No formal system captures all arithmetic truth: There exist true sentences no recursively-axiomatized system can prove
The Prime Factorization "Magic"
The reason this works through prime factorization:
Prime factorization⟹Unique number codes⟹Every formula has a unique number⟹
The syntax of logic becomes the arithmetic of exponents
G's statement "I am not provable" is thus the number whose factorization contains the very formula expressing its own unproovability—a perfect logical knot.