Zulip Chat Archive

Stream: maths

Topic: Gödel's Incompleteness Theorem


Palalansoukî (Sep 04 2024 at 15:55):

Last year, I completed a formal proof of Gödel's first incompleteness theorem, and this time, I have finished formalizing the proof of second incompleteness theorem. I proved that a theory TT, which is stronger than IΣ1\mathsf{I}\Sigma_1​, Δ1\Delta_1-definable, and has N\mathbb{N} as a model, cannot prove or disprove a statement asserting its own consistency:

theorem goedel_second_incompleteness [𝐈𝚺₁  T] [T.Delta1Definable] [System.Consistent T] :
    T  ↑𝗖𝗼𝗻

theorem consistent_undecidable [𝐈𝚺₁  T] [T.Delta1Definable] [ ⊧ₘ* T] :
    System.Undecidable T ↑𝗖𝗼𝗻

The formal proof of G2 has already been done using Isabelle, but my result is stronger. The result in Isabelle is based on the theory of hereditary finite sets (HF\mathsf{HF}), which is equivalent to Peano arithmetic, but I proved it for a weaker theory, IΣ1\mathsf{I}\Sigma_1. This is likely the first formalization.

I also showed a stronger result on the first incompleteness theorem than before, proving the incompleteness of Cobham's R0\mathsf{R}_0. R0\mathsf{R}_0 is a theory of arithmetic weaker than Robinson's Q\mathsf{Q}, known as the weakest theory where essential incompleteness holds. This is also likely the first formalization of this.

theorem goedel_first_incompleteness [𝐑₀  T] [T.Delta1Definable] [Sigma1Sound T] :
    ¬System.Complete T

In addition, there are several important theorems as byproducts, which I hope to include in mathlib in the future.

There are a few things to note. First, the definition of the arithmetical hierarchy differs slightly from the standard one. Typically, Σn\Sigma_n/Πn\Pi_n-formula is defined as a formula with quantifiers alternating nn times starting with \exists/\forall, but in my formalization, Σn\Sigma_n/Πn\Pi_n​ is defined as those closed by \land/\lor/bounded quantifiers. However, since it is known that IΣnIΣ0(Σn)\mathsf{I}\Sigma_n \vdash \mathsf{I}\Sigma_0(\Sigma_n), there is no issue in terms of the provability strength of IΣn\mathsf{I}\Sigma_n.

Also, I adopted Tait-calculus as a proof system. Tait-calculus has fewer inference rules, making the formalization easier to handle, but the formulas themselves must satisfy the De Morgan rules. Because of this, it is not directly compatible with ModelTheory in mathlib.

Adam Topaz (Sep 04 2024 at 16:05):

Congratulations! This is really great!

Aaron Anderson (Sep 05 2024 at 00:30):

Just checking what you mean by saying "the formulas themselves must satisfy the De Morgan rules" - do you mean that you're requiring that not/neg isn't part of the inductive definition?

Palalansoukî (Sep 05 2024 at 02:26):

That's right. Formulas are defined as

ABR(v)R(v)ABABAAA | B | R(\vec{v}) | \overline{R}(\vec{v}) | \top | \bot | A \land B | A \lor B | \forall A | \exists A

and negation is defined inductively.

¬R(v)R(v)\lnot R(\vec{v}) \coloneqq \overline{R}(\vec{v})
¬R(v)R(v)\lnot\overline{R}(\vec{v}) \coloneqq R(\vec{v})
¬\lnot\top \coloneqq \bot
¬\lnot\bot \coloneqq \top
¬(AB)¬A¬B\lnot(A \land B) \coloneqq \lnot A \lor \lnot B
¬(AB)¬A¬B\lnot(A \lor B) \coloneqq \lnot A \land \lnot B
¬A¬A\lnot\forall A \coloneqq \exists \lnot A
¬A¬A\lnot\exists A \coloneqq \forall \lnot A

Also in ModelTheory the equality symbol is always included in the atomic formula, but not in my formalization. However, it would be possible to define appropriate translations between each other.

David Michael Roberts (Sep 05 2024 at 06:26):

Cool! Could you say what the language and axioms for R_0 are in the usual mathematical vernacular? I guess this is the formal definition: https://github.com/FormalizedFormalLogic/Foundation/blob/41ecee31d573798ea47f005189841c76041090b5/Logic/FirstOrder/Arith/Theory.lean#L21-L26

I think I'm most mystified by leastNumber...

Palalansoukî (Sep 05 2024 at 06:52):

In my formalization, Language of R0\mathsf{R}_0 is LOR{0,1,+,,=,<}\mathcal{L}_\mathrm{OR} \coloneqq \{0, 1, +, \cdot, =, <\}, and R0\mathsf{R}_0 consists of axioms of equality and following infinite axioms.
Ω1:n+m=n+m\Omega_1: \overline{n} + \overline{m} = \overline{n + m} for all n,mNn, m \in \mathbb{N}
Ω2:nm=nm\Omega_2: \overline{n} \cdot \overline{m} = \overline{n m} for all n,mNn, m \in \mathbb{N}
Ω3:nm\Omega_3: \overline{n} \neq \overline{m} for all n,mNn, m \in \mathbb{N}, such that nmn \ne m
Ω4:(x)[x<nx=0x=1x=n1]\Omega_4: (\forall x)[x < \overline{n} \leftrightarrow x = \overline{0} \lor x = \overline{1} \lor \cdots \lor x = \overline{n - 1}] for all nNn \in \mathbb{N}
n\overline{n} is a numeral of nn, defined as
n{1++1nif n00if n=0 \overline{n} \coloneqq \begin{cases} \underbrace{1 + \cdots + 1}_{n} & \text{if } n \ne 0 \\ 0 & \text{if } n = 0\end{cases}

leastNumber is the least number principle Lφ\mathsf{L}\varphi, but it is just defined and not used.

Nir Paz (Sep 08 2024 at 16:26):

This is really cool!
Could you explain why the exponential function's graph is sigma 0? I can't figure it out

Palalansoukî (Sep 08 2024 at 16:47):

Technically, the proof is quite complex. The core of the proof is to use the definition of exponential (2x2^x) by prefix induction used by Buss.

20:=122n:=2n2n22n+1:=22n2n2^0 := 1 \\ 2^{2n} := 2^n \cdot 2^n \\ 2^{2n + 1} := 2 \cdot 2^n \cdot 2^n

The proof can be found in Logical Foundations of Proof Complexity by Cook & Nguyen or Metamathematics of First-Order Arithmetic by Hajek & Pudlak.

Palalansoukî (Sep 20 2024 at 12:32):

I opened a PR to update the Freek's list. #16968


Last updated: May 02 2025 at 03:31 UTC