# Löb's Lemma: an easier approach to Löb's Theorem

Related to: [Löb's Theorem for implicit reasoning in natural language: Löbian party invitations](https://www.lesswrong.com/posts/QsZ3ycfRYs2ps5sNA/loeb-s-theorem-for-implicit-reasoning-in-natural-language)

tl;dr: Löb's Theorem is much easier to grok if you separate the parts of the proof that use the assumption $\Box p \to p$  from the parts that don't.  The parts that don't use $\Box p \to p$ can be extracted as a stand-alone result, which I hereby dub "Löb's Lemma".

Here's how it works.

Key properties of $\vdash$ and $\Box$
-------------------------------------

Here is some standard notation.  In short, $\vdash$ is our symbol for talking about what PA can prove, and $\Box$ is shorthand for PA's symbols for talking about what (a copy of) PA can prove.

*   "$\vdash$ 1+1=2" means "Peano Arithmetic (PA) can prove that 1+1=2".  No parentheses are needed; the "$\vdash$" applies to the whole line that follows it.  Also, $\vdash$ does not stand for an expression in PA; it's a symbol we use to talk about what PA can prove.
*   "$\Box(\textrm{1+1=2})$" basically means the same thing.  More precisely, it stands for a numerical expression *within PA* that can be translated as saying "$\vdash$ 1+1=2".  This translation is possible because of something called a [Gödel numbering](https://en.wikipedia.org/wiki/G%C3%B6del_numbering) which allows PA to talk about a (numerically encoded version of) itself. 
*   "$\Box X$ " is short for "$\Box(X)$" in cases where "$X$" is just a single character of text.
*   "$X\vdash Y$" means "PA, along with X as an additional axiom/assumption, can prove Y". In this post we don't have any analogous notation for $\Box$.

The proofs here will use the following standard properties of $\vdash$ and $\Box$ ([source: Wikipedia](https://en.wikipedia.org/wiki/L%C3%B6b%27s_theorem#Modal_proof_of_L%C3%B6b's_theorem)), which respectively stand for provability and provability encoded within arithmetic.  

1.  **(necessitation)** From $\vdash A$, conclude $\vdash\Box A$.  Informally, this says that if A can be proven, then it can be proven that it can be proven (by just writing out and checking the proof within arithmetic).  Note that from $X\vdash A$ we *cannot* conclude $X\vdash \Box A$, because $\Box$ still means "PA can prove", and not "PA+X can prove".  
2.  **(internal necessitation) **$\vdash \Box A \to \Box \Box A$ . If A is provable, then it is provable that it is provable (basically the same as the previous point).
3.  **(box distributivity)** $\vdash \Box (A \to B)\rightarrow (\Box A \to \Box B)$. This rule allows one to apply modus ponens inside the provability operator. If it is provable that A implies B, and A is provable, then B is provable.
4.  **(**[**deduction theorem**](https://en.wikipedia.org/wiki/Deduction_theorem)**)** From $A \vdash B$, conclude $\vdash A\to B$: if assuming $A$ is enough to prove $B$, then it's possible to prove under no assumptions that $A \to B$. 

Point 4 is helpful and pretty intuitive, but for whatever reason isn't used in the main Wikipedia article on Löb's Theorem.

Löb's Lemma
-----------

**Claim**: Assume $\Psi$ and $p$ are any statements satisfying $\vdash \Psi \leftrightarrow \Box \Psi \to p$.  Then $\vdash \Box \Psi \leftrightarrow \Box p$.

**Intuition:** By assumption, the sentence $\Psi$ is equivalent to saying "If this sentence is provable, then $p$".  Intuitively, $\Psi$ has very little content, except for the $p$ part at the end, so it makes sense that $\Box \Psi$ boils down to nothing more than $\Box p$ in terms of logical equivalence.   
  
Reminder: this does not use the assumption $\Box p \to p$ from Löb's Theorem at all.

**Proof**:

Let's do the forward implication first:

1.  $\Box \Psi \vdash \Box\Box \Psi$                   by internal necessitation ($\Box \Psi \to \Box \Box \Psi$).
2.  $\Box \Psi\vdash  \Box( \Box \Psi \to p)$       using box distributivity on the assumption,   
                                             with $A = \Psi$ and $B = \Box \Psi \to p$.
3.  $\Box \Psi \vdash \Box p$                        from 1 and 2 by box distributivity.
4.  $\vdash \Box \Psi \to \Box p$                   from 3 by the [deduction theorem](https://en.wikipedia.org/wiki/Deduction_theorem).

Now for the backwards implication, which isn't needed for Löb's Theorem, but is handy anyway:

1.  $\vdash p \to (\Box \Psi \to p)$              is a tautology.
2.  $\vdash \Box p \to \Box(\Box \Psi \to p)$       by box distributivity on 1.
3.  $\vdash \Box \Psi \leftrightarrow \Box(\Box \Psi \to p)$      by box distributivity on the assumption.
4.  $\vdash \Box p \to \Box \Psi$                       by 2 and 3.

I like this result because both directions of the proof are fairly short, it doesn't use the assumption $\Box p \to p$ at all, and the conclusion itself is also fairly intuitive.  The statement $\Psi$ just turns out to have no content except for $p$ itself, from the perspective of writing proofs.

Löb's Theorem, now in just 6 lines
----------------------------------

If you can remember Löb's Lemma, you can write a very straightforward proof of Löb's Theorem in just 6 lines:

**Claim:** If $p$ is any sentence such that $\vdash \Box p \to p$, then $\vdash p$

**Proof:**

Let $\Psi$ be any sentence satisfying $\vdash \Psi \leftrightarrow (\Box \Psi \to p)$, which exists by the existence of modal fixed points (or by the Diagonal Lemma).

1.  $\vdash \Box \Psi \to \Box p$    by Löb's Lemma.
2.  $\vdash \Box p \to p$         by assumption.
3.  $\vdash \Box \Psi \to p$        by 1 and 2 combined.
4.  $\vdash \Psi$                    by 3 and the defining property of $\Psi$
5.  $\vdash \Box \Psi$                 by necessitation.
6.  $\vdash p$                      by 3 and 5.

«mic drop»