User:IssaRice/Computability and logic/Diagonalization lemma

From Machinelearning

The diagonalization lemma, also called the Godel-Carnap fixed point theorem, is a fixed point theorem in logic.

Rogers's fixed point theorem

Let f be a total computable function. Then there exists an index e such that φeφf(e).

(simplified)

Define d(x)=φx(x) (this is actually slightly wrong, but it brings out the analogy better).

Consider the function fd. This is partial recursive, so fdφi for some index i.

Now φf(d(i))φφi(i) since fdφi. This is equivalent to φd(i) by definition of d. Thus, we may take e=d(i) to complete the proof.

Diagonalization lemma

(semantic version)

Let A be a formula with one free variable. Then there exists a sentence G such that G iff A(G).

Define diag(x) to be C(C) where x=C. In other words, given a number x, the function diag finds the formula with that Godel number, then diagonalizes it (i.e. substitutes the Godel number of the formula into the formula itself), then returns the Godel number of the resulting sentence.

Let B be A(diag(x)), and let G be B(B).

Then G is A(diag(B)), by substituting x=B in the definition of B.

We also have diag(B)=B(B) by definition of diag. By definition of G, this is G, so we have diag(B)=G.

To complete the proof, apply A to both sides of the final equality to obtain A(diag(B)) iff A(G); this simplifies to G iff A(G).

Comparison table

Some things to notice:

  • The two theorems are essentially identical, with identical proofs, as seen by the matching rows. The analogy breaks down slightly at the very end, where we apply φf() vs A() (the latter corresponds to f until the very end).
  • In the partial recursive functions world, it's easy to go from the index (e.g. e) to the partial function (φe). In the formulas world it's the reverse, where it's easy to go from a formula (e.g. A) to its Godel number A).
Step Rogers's fixed point theorem Diagonalization lemma
Theorem statement (note: quantifiers are part of the metalanguage) (fe)φeφf(e) (AG)GA(G)
Given mapping f A
Definition of diagonal function d(x)=φx(x) diag(C)=C(C)
Composition of given mapping with diagonal function (givendiagonal) f(d(x)) A(diag(x))
Naming the givendiagonal composition fd (name not given because compositions are easy to express outside a formal language) B
Index of givendiagonal composition i B
Expanding using definition of diagonal d(i)=φi(i) diag(B)=B(B)
The givendiagonal composition applied to own index (i.e. diagonalization of the composition) fd(i) B(B)
G defined φi(i) (no equivalent definition) G is B(B)
f(d(i))=φi(i) A(diag(B))B(B)
Renaming index e=d(i) G=diag(B)
Leibniz law to previous row Apply φf() to obtain φf(e)=φf(d(i)) Apply A() to obtain A(G)A(diag(B))
Use definition of G φf(e)=φφi(i)=φe A(G)B(B)G
(Definition of G)? φi(i) is f(d(i)) G is A(diag(B))