3

I'm trying to develop a good intuition for how Gödel's first incompleteness theorem works. I think I've got most of it, but there's one step involving a lemma I haven't been able to really get.

Here's my sense of how the proof works:

  1. Show there's a way to give each formula and proof a unique natural number (its "Gödel encoding").
  2. Show that this lets formulas refer to formulas and proofs. Intuitively this lets us write formulas that say things like "The formula with Gödel encoding $x$ has proof $P$."
  3. Construct a variable formula $f(x)$ that in effect says "The formula with Gödel encoding $x$ has no proof."
  4. Via a magical "diagonal lemma", we know there's a natural number $n$ such that the Gödel encoding of $f(n)$ is $n$.
  5. $f(n)$ is, in effect, the statement "This statement is unprovable." If it's true, then it's unprovable, meaning there are true statements the system cannot prove — i.e. it's incomplete. If $f(n)$ is false, then it's provable, meaning the system can prove false things and is inconsistent. QED.

I'd like some kind of intuition for that diagonal lemma in step 4 that feels as intuitive to me as the rest of the argument. LLMs haven't been helpful here; they keep either walking through their version of the proof, or saying extremely vague things like "The lemma involves self-reference."

Another way to say it is, I'm looking for the "key" that "unlocks" the diagonal lemma. Roughly the way that the statement "This statement is unprovable" sort of "unlocks" the overall proof: if I know that's what I'm aiming for, and why, then the formalism is mostly about checking the details of how I construct that statement.

As it is, I can't intuitively feel why the diagonal lemma wouldn't apply to the formula that says in effect "The formula with Gödel number $x$ is false." That'd let us construct the statement "This statement is false", which has a paradoxical truth value. I'm sure the lemma doesn't allow this, but I'm deducing this socially, not mathematically. (Maybe we can't construct formulas that talk about other formulas' truth values? If so, I'm not sure why not.)

I know there are a few other discussions of this already:

  • Here is someone asking about the details of the diagonal lemma. I think I understand the answer to their questions. That doesn't give me a feel for why the lemma is true though.
  • Then there's this one, which goes into way too much detail to give me the intuitive overview I'm looking for, and is about a possible alternative way of proving the lemma.
  • Someone tagged my question as duplicating this one. I like the intuitive style the answerer gives; it's exactly the right type I'm looking for. And he explains what the lemma needs to show in good clear terms. That's super a step in the direction I'm hoping for. But his explanation for the proof of the lemma seems to me to be almost entirely contained within the statement "it turns out that". ("It turns out that if you calculate the number of this formula, you get exactly the number you get by starting with the number $k$ and performing the operations described by the statement.")

I've stared at various descriptions of the lemma's proof, including its proof in Wikipedia. It feels like pressing my brain through a symbolic meat-grinder. If I stare very, very closely at each step, I can agree it follows from previous steps. But I have no idea what intuition guided anyone to write those lines. I'm way more interested in the intuition than I am in the minute details of rigor here: I can make sense of the latter with the former, but I haven't been able to make it work the other way around.

Do any of you have a guess about a "key" that might help me make sense of the diagonal lemma?

  • 1
    It's the same fundamental idea as recursion theorems, fixed-point combinators, quines... if you're familiar with those. $(\lambda x. x x)(\lambda x. x x)$ – Naïm Camille Favier Jul 31 '24 at 15:29
  • 5
    LLM “proofs” are nearly always riddled with mistakes, and their “intuitive overviews” almost always miss the salient points of the proof structure; I strongly recommend not trying to learn from them. –  Jul 31 '24 at 17:33
  • 1
    LLM ? Maybe it is a standard formulation in logic , but it would be nice if such abbreviations are explained. – Peter Jul 31 '24 at 17:59
  • 1
    @Peter LLM = "Large Language Model" (e.g. ChatGPT); certainly not logic's fault! :P – Noah Schweber Jul 31 '24 at 20:03
  • You might find my video helpful, which presents one way of thinking about it as an approximation of an infinite self-substitution. – blargoner Jul 31 '24 at 21:24
  • 4
    I don't actually think this question is a duplicate, at least not of the linked question. That question is about how the diagonal lemma leads to GIT, but this question is about explaining/proving the diagonal lemma in the first place. Moreover, while I see multiple close calls, I can't find an actual duplicate question. So I've reopened it. – Noah Schweber Aug 01 '24 at 20:22
  • Thanks @NoahSchweber. I edited it to make the point. It looks like you got to it before I finished! – Morphenius Aug 01 '24 at 20:38
  • @WhileIAm I agree. A while back I couldn't get an LLM to understand that a counterexample to $A \rightarrow B$ needs to have $A$ and ¬$B$, but it insisted on giving me ¬$A$ and $B$, even after admitting the error. :P But I couldn't find an intuitive explanation of the lemma, so I hoped to get some inspiration from its explanations. No luck! – Morphenius Aug 01 '24 at 20:41
  • @NaïmFavier I'm not sure how you're saying more than "It has something to do with self-reference". I'm also not sure what "$(\lambda x, xx)(\lambda x, xx)$" is saying. Maybe say more? – Morphenius Aug 01 '24 at 20:44
  • @blargoner Thanks, I'll take a look! – Morphenius Aug 01 '24 at 20:46
  • 1
    @Morphenius: I've added an edit regarding "this statement is false" to my answer, it's a good question! – Qiaochu Yuan Aug 01 '24 at 23:02

2 Answers2

6

Godel numbering immediately enables "self-plugging-in:" given a formula $\psi(x)$ with Godel number $n$, let $\psi^*$ be the sentence $\psi(\underline{n})$ (where $\underline{n}$ is the numeral corresponding to $n$). This is completely straightforward.

Now this doesn't yet result in self-reference since $\psi^*$ just "refers to" $\psi$. On the other hand, since $\psi^*$ was built from $\psi$, it feels like we're pretty close: we have a sentence which refers to the seed of itself. We just need to catch our tail so to speak.

To do this, we abstract a bit: the function sending the Godel number of a formula to the Godel number of that formula's starred-version is itself nicely definable (namely: representable). So for any property $P$ of sentences that we can encode in the language of arithmetic, we can use this function to write a formula $\sigma_P(x)$ which intuitively says "The sentence $\chi^*$ (where $\chi$ is the formula with Godel number $x$) has property $P$."

  • EDIT: note that the vicissitudes of first-order logic's syntax make this last step rather messy in a pretty stupid way. We have a (definition of a) function $f$ sending the Godel number of $\chi$ to the Godel number of $\chi^*$, and we want $\sigma_P(x)$ to just be $P(f(x))$. But that's not how FOL works: since the definition of the function $f$ is itself a formula $\varphi_f$, we have to instead phrase $\sigma_P(x)$ as $$\forall y[\varphi_f(x,y)\implies P(y)]$$ (or $\exists y[\varphi_f(x,y)\wedge P(y)]$ if you prefer). Really this is a historical artifact: if computer science had developed before first-order logic, we would (I hope!) have standardized a more straightforward notation for working with defined functions.

I claim that this lets us catch our tail as desired. Let $k$ be the Godel number of $\sigma_P$. Then $\sigma_P(\underline{k})$ says roughly "If you plug $\sigma_P$ into itself you get a sentence with property $P$." But $\sigma_P(\underline{k})$ is exactly the sentence you get if you "plug $\sigma_P$ into itself." We can now visualize this nicely in natural language (I think this particular phrasing is due to Hofstadter):

"Yields a sentence with property $P$ when preceded by its quotation" yields a sentence with property $P$ when preceded by its quotation.

Noah Schweber
  • 260,658
  • I think this might be what I'm looking for! I'm being interrupted and need to go, but I'll come back and stare at this and either promote it as the answer or will explain what's missing for me. In any case it looks like it's gonna be helpful for me! Thank you! – Morphenius Aug 01 '24 at 20:45
  • Okay, yes, this gives me the core. Particularly the maybe-Hofstadter statement at the end really nails it. I think that's the key for me. It'll take a bit of staring at this to really make the reasoning familiar, but I think this is the core intuition I was looking for. Thank you! – Morphenius Aug 01 '24 at 22:50
3

Edit:

As it is, I can't intuitively feel why the diagonal lemma wouldn't apply to the formula that says in effect "The formula with Gödel number $x$ is false." That'd let us construct the statement "This statement is false", which has a paradoxical truth value. I'm sure the lemma doesn't allow this, but I'm deducing this socially, not mathematically. (Maybe we can't construct formulas that talk about other formulas' truth values? If so, I'm not sure why not.)

This is a great question and it has a great answer. The answer is that this argument you've just given is a proof by contradiction that it is not possible to say "this statement is false" at all! Formally, it is not possible to construct a truth predicate in, say, Peano arithmetic, meaning a predicate $\text{True}(\ulcorner \varphi \urcorner)$ which is true exactly for the Godel codes of true statements. This is Tarski's undefinability theorem.

This says in some sense that truth, unlike provability, is not "finite." We really do not have a better way to define truth than to say, for example, that $\forall x P(x)$ is true precisely when $P(x)$ is true of all ("actual") natural numbers $x$, which is in some sense a fundamentally infinitary statement.


Personally I've never understood the diagonal lemma either. There's this intriguing paper by Yanofsky, A Universal Approach to Self-Referential Paradoxes, Incompleteness and Fixed Points, which claims that all diagonal arguments are essentially the same: the diagonal lemma, Cantor's theorem, Russell's paradox, etc. Specifically it claims that they are all essentially the same as the Lawvere fixed point theorem; this observation is due to Lawvere. I think this is quite a beautiful idea, but I've never understood this paper either! But perhaps the real key is lurking in that paper.

Fortunately, there are ways to prove the incompleteness theorems without using the diagonal lemma. The proof that makes the most sense to me is explained by Scott Aaronson here, and he introduces it as follows:

First, though, let's see how the Incompleteness Theorem is proved. People always say, "the proof of the Incompleteness Theorem was a technical tour de force, it took 30 pages, it requires an elaborate construction involving prime numbers," etc. Unbelievably, 80 years after Gödel, that's still how the proof is presented in math classes!

Alright, should I let you in on a secret? The proof of the Incompleteness Theorem is about two lines. The caveat is that, to give the two-line proof, you first need the concept of a computer.

The proof is by reduction to the halting problem. The self-reference in this argument comes from the familiar halting problem arguments where you feed a program its own source code and so forth. Once you have that:

As I said, once you have Turing's results, Gödel's results fall out for free as a bonus. Why? Well, suppose the Incompleteness Theorem was false -- that is, there existed a consistent, computable proof system F from which any statement about integers could be either proved or disproved. Then given a computer program, we could simply search through every possible proof in F, until we found either a proof that the program halts or a proof that it doesn't halt. (This is possible because the statement that a particular computer program halts is ultimately just a statement about integers.) But this would give us an algorithm to solve the halting problem, which we already know is impossible. Therefore F can't exist.

Other approaches to the incompleteness theorem are also possible, which are "powered by" other paradoxes; if we think of the diagonal lemma proof as being "powered by" the liar paradox, there's also a proof which is "powered by" the Berry paradox. This idea appears to be due to Vopěnka and Chaitin and a detailed version of the proof is given in Maroš Grego's The incompleteness theorems and Berry’s paradox.

Qiaochu Yuan
  • 468,795
  • I find this proof less satisfying because it's less constructive: it doesn't give us a specific sentence in F that shows why it isn't consistent and complete. That said, it is useful to relate two instances of self-reference together. – Naïm Camille Favier Jul 31 '24 at 19:14
  • 1
    This version implicitly uses soundness. There is a “Rosserized” version that isn’t too much more difficult… a halting problem type construction gives a Turing machine that goes through all proofs and halts if it finds a proof it doesn’t halt and enters an infinite loop if it finds a proof that it halts. Then if the system proves the machine halts it can also prove it doesn’t (by stepping through the computation) and vice versa. So if the system is consistent the machine runs forever but the system can’t prove (or refute) this. – spaceisdarkgreen Jul 31 '24 at 21:17
  • There are proofs of Gödel incompleteness in Kunens "Set Theory An Introduction to Independence Proofs", $\S14$ chapter I. I don't recall that he uses any type of "diagonal lemma" there (although I am not entirely sure what that would mean, in this context, since I have not read this post too carefully). But Kunens proof looks (by quick reading) like what Noah S. is talking about. – Ben123 Jul 31 '24 at 23:03
  • Cont. Although I should say that I still don't really think I have gotten that "aha"-moment when reading the proofs, so my understanding of the proofs are at best partial. – Ben123 Jul 31 '24 at 23:10
  • @Ben123 Theorem 14.2 is the diagonal lemma. – spaceisdarkgreen Jul 31 '24 at 23:20
  • Aha, but nowhere does Kunen (AFAICT) mention the word "diagonal"; like, my first thought was that a diagonal argument should be something akin to Cantors diagonal argument, but Kunen (atleast explicitly) says no such thing (again, AFAICT). – Ben123 Jul 31 '24 at 23:29
  • @Ben123 That there's more than a vague connection to Cantor's argument is not obvious, but it is explained in Yanofsky's paper. The diagonal lemma (and Kleene's recursion theorem if we're talking about computability) are fixed point theorems. DL says every formula has a fixed point: there's a sentence whose equivalence class mod T is unchanged when we plug its GN into the formula. Cantor's theorem can be proved by contradiction: you show that if there is a surjection $S\to P(S)$ then that's grounds for a fixed point theorem where every function $2\to 2$ has a fixed point, which is absurd. – spaceisdarkgreen Aug 01 '24 at 00:18
  • @Ben123 (Where the "grounds" for the fixed point theorem in either case are instances of the same general theorem.) – spaceisdarkgreen Aug 01 '24 at 00:26
  • 1
    Oh, this approach is really cool. Thank you, both for the Yanofsky paper and for the Aaronson argument. This way of thinking about it might address the original puzzle that caused me to want to grok the diagonal lemma's proof in the first place. Thank you! – Morphenius Aug 01 '24 at 22:38
  • @Morphenius: you're very welcome, and good luck! – Qiaochu Yuan Aug 01 '24 at 23:18