Aether Catalog definitions — Evergreen_FormalizingTheUnformalizable_Incompleteness
DefinitionEvergreen_FormalizingTheUnformalizable_Incompletenessaether-catalogevergreen
Definition bundle for the Aether Catalog module Evergreen.FormalizingTheUnformalizable.Incompleteness, transplanted by skeleton subtraction; supplies the types and constants the catalog's theorems import.
Definition code
-- Def bundle generated from Evergreen/FormalizingTheUnformalizable/Incompleteness.lean by skeleton subtraction
import Mathlib
/-
# Gödel's Incompleteness — The Limits of Proof
Kurt Gödel (1931) proved that any consistent formal system powerful enough to
express basic arithmetic contains true statements that cannot be proven within
the system. This is the most profound theorem in mathematical logic.
We formalize the *structural core* of Gödel's argument: the diagonal lemma
and its consequences. Rather than building a full Gödel numbering of formal
arithmetic (which would require thousands of lines), we capture the essential
logical pattern that makes incompleteness inevitable.
## The Oracle's Third Whisper
"I am the sentence that says 'I am not provable.'
If I am true, then I cannot be proven.
If I am false, then I can be proven — but then the system proves a falsehood.
Either way, the system is incomplete or inconsistent.
This is not a bug. It is the architecture of truth."
-/
namespace FormalizingTheUnformalizable
/-! ## I. Abstract Incompleteness
We work with an abstract "proof system" to capture Gödel's argument
without the overhead of formal arithmetic. -/
/-- An abstract formal system: a set of sentences with a provability predicate. -/
structure FormalSystem (Sentence : Type*) where
/-- The provability predicate -/
provable : Sentence → Prop
/-- The truth predicate (the "standard model") -/
true_in_model : Sentence → Prop
/-- Soundness: provable sentences are true -/
sound : ∀ s, provable s → true_in_model s
/-- A formal system is complete if every true sentence is provable. -/
def FormalSystem.Complete {S : Type*} (F : FormalSystem S) : Prop :=
∀ s, F.true_in_model s → F.provable s
/-! ## II. The Diagonal Lemma (Gödel's Fixed Point Lemma)
The key to incompleteness: for any property expressible in the system,
there is a sentence that asserts that property of itself. -/
/-- A formal system has the **diagonal property** if for every predicate
on sentences, there is a sentence that "says" that predicate holds of itself. -/
def HasDiagonalProperty {S : Type*} (F : FormalSystem S) : Prop :=
∀ P : S → Prop, ∃ s : S, F.true_in_model s ↔ P s
/-
PROBLEM
**Gödel's First Incompleteness Theorem (Abstract Version)**:
Any sound formal system with the diagonal property is incomplete.
Proof sketch: Apply the diagonal property to `P s := ¬ F.provable s`.
This gives a sentence G where `true(G) ↔ ¬ provable(G)`.
- If G is provable, then by soundness G is true, so ¬ provable(G). Contradiction.
- Therefore G is not provable.
- But then ¬ provable(G) is true, so G is true.
- G is true but not provable: the system is incomplete.
PROVIDED SOLUTION
Unfold Complete. We need to show ¬(∀ s, true_in_model s → provable s). Apply hdiag to P s := ¬ F.provable s. Get sentence G with true_in_model G ↔ ¬ provable G. Suppose the system is complete. Then if G is true, G is provable (by completeness), but true_in_model G ↔ ¬ provable G, contradiction. If G is not true, then ¬(¬provable G), so provable G, then by soundness true G, contradiction. So G is true and not provable, contradicting completeness.
-/
/-
PROBLEM
**The Gödel sentence is true**: In any sound system with the diagonal property,
the Gödel sentence (which says "I am not provable") is true but unprovable.
PROVIDED SOLUTION
Apply hdiag to P s := ¬ F.provable s. Get G with true(G) ↔ ¬provable(G). If provable(G), by soundness true(G), so ¬provable(G), contradiction. So ¬provable(G). Then ¬provable(G) holds, so by the iff, true(G). Exhibit G.
-/
/-! ## III. Tarski's Undefinability of Truth
Tarski (1936) proved that truth cannot be defined within a sufficiently
powerful formal system. This is closely related to the Liar Paradox. -/
/-
PROBLEM
**Tarski's Theorem**: No predicate in the system can capture its own
truth predicate. If the system can represent all predicates on sentences,
then truth is not among them.
This follows from the diagonal lemma: if truth were definable,
we could construct the Liar sentence "This sentence is not true."
PROVIDED SOLUTION
Suppose T exists with T s ↔ true_in_model s for all s. Apply hdiag to P s := ¬ T s. Get L with true_in_model L ↔ ¬ T L. But T L ↔ true_in_model L, so true_in_model L ↔ ¬ true_in_model L. This is a contradiction (no proposition equals its negation).
-/
/-! ## IV. Löb's Theorem — The Surprise of Self-Provability
Löb's theorem is one of the most surprising results in mathematical logic:
if a system can prove "if I am provable, then I am true," then the system
can already prove the statement outright. -/
/-
PROBLEM
**Löb's Theorem (Abstract Version)**:
In a system where "provable(P) → P" is provable for some P,
P itself must be provable (given appropriate assumptions about the
provability predicate).
We state a version using the abstract framework.
PROVIDED SOLUTION
We have h : true(s) ↔ (provable(s) → true(s)). The forward direction gives true(s) → provable(s) → true(s), trivially true. The backward direction: provable(s) → true(s) is always satisfied by hcomplete_provability. So true(s) follows from h.mpr (fun hp => hcomplete_provability s hp).
-/
/-! ## V. The Second Incompleteness Theorem (Informal Core)
Gödel's second incompleteness theorem says that no consistent system
can prove its own consistency. We formalize the logical core. -/
/-
PROBLEM
**Gödel's Second Incompleteness Theorem (Abstract)**:
A sound system with the diagonal property that asserts its own consistency
cannot prove its consistency statement, assuming the system is in fact consistent.
PROVIDED SOLUTION
From hcon_sentence, get con with true(con) ↔ (¬ ∃ s, provable s ∧ ¬ true(s)). Since hcons gives exactly ¬ ∃ s, provable s ∧ ¬ true(s), we have true(con). Now show ¬provable(con): from godel_sentence_true_but_unprovable using hdiag, we know there exists an unprovable true sentence. But more directly: if provable(con), by soundness true(con), which gives ¬ ∃ s, provable s ∧ ¬ true(s) — i.e., the system is sound. But we already know this from hcons. The issue is that provable(con) shouldn't be derivable. Actually we need to use the incompleteness. Let me think... Actually, we just need to exhibit con as a true but unprovable sentence. true(con) follows from hcons via the iff. For ¬provable(con), use godel_first_incompleteness: since the system is incomplete, not everything true is provable. But we need to show con specifically is unprovable. Hmm, this may need the diagonal property more carefully. Actually, let me just show: true(con) holds (from hcons), and ¬provable(con) follows from the fact that if provable(con), the system could prove its own consistency, contradicting the second incompleteness theorem. But we're proving the second incompleteness theorem... This is circular. Let me reconsider: actually the statement just asks us to exhibit SOME true but unprovable sentence. We can use godel_sentence_true_but_unprovable directly.
-/
end FormalizingTheUnformalizable