Godel & Incompleteness

Godel numbering, self-reference, and the limits of proof

Godel and Incompleteness

In 1931, Kurt Godel proved one of the most profound results in mathematics: any consistent formal system powerful enough to express basic arithmetic contains true statements that cannot be proved within the system. This incompleteness theorem shattered the hope that mathematics could be completely formalized.

In this lesson, you will see how Godel numbers encode formulas as integers, how self-reference creates the unprovable sentence, and where different theories fall on the completeness spectrum.

Godel Numbering

Godel's first insight: formulas are just strings of symbols, and strings can be encoded as numbers. Each symbol gets a code, and a formula becomes a sequence of codes, which is then packed into a single number using prime factorization. This allows arithmetic to "talk about" its own formulas.

SymbolCodePrime^code012^1=53^5015^1
Godel Number (product of prime powers):
2^1 × 3^5 × 5^1
= 2430
Decoding (recovering the formula):
Divide out 2: exponent = 1 symbol = "0"
Divide out 3: exponent = 5 symbol = "="
Divide out 5: exponent = 1 symbol = "0"
Recovered: 0 = 0
Symbol Encoding Table:
"0"=1"S"=2"+"=3"×"=4"="=5"("=6")"=7""=8""=9"¬"=10""=11""=12"x"=13"y"=14

Key insight: Godel numbering is a bijection between formulas and natural numbers. Since arithmetic can reason about natural numbers, it can indirectly reason about its own syntax -- the key to self-reference.

The Self-Reference Machine

Godel's second insight: using Godel numbering, one can construct a sentence G that effectively says "G is not provable." If G were provable, it would be false (since it says it isn't provable) -- contradicting consistency. So G is not provable. But then G is true! There is a true sentence that the system cannot prove.

Step 1: Encoding Formulas as Numbers∀x (x = x) → Gödel number: 2⁸ × 3¹³ × 5⁶ × ...
Every formula in our formal system can be assigned a unique natural number — its Gödel number. This turns syntax into arithmetic.
Key Insight:Formulas become numbers. We can do arithmetic ON formulas.
1 / 5

Key insight: The construction is analogous to the liar paradox ("this sentence is false") but replaces "false" with "not provable." Truth and provability diverge: there exist true but unprovable statements.

The Incompleteness Landscape

Not all theories are incomplete. Propositional logic and Presburger arithmetic (natural numbers with addition but no multiplication) are decidable and complete. It is the combination of addition AND multiplication that creates enough expressive power for self-reference, and hence incompleteness.

Fully Tame\u2190 spectrum \u2192Wild
Property Definitions:
Complete: Every true sentence is provable
Decidable: An algorithm can determine truth
Axiomatizable: Axioms can be listed by algorithm

Key insight: Incompleteness is not a bug but a fundamental feature of sufficiently powerful formal systems. It tells us that mathematical truth transcends any particular formal system.

Key Takeaways

  • Godel numbering lets arithmetic encode and reason about its own formulas.
  • Self-reference produces a true sentence that is not provable in the system.
  • Incompleteness requires enough expressive power (addition + multiplication).
  • Simple theories (propositional logic, Presburger) can be complete and decidable.