Godel's Incompleteness Theorem

Create a meta function 𝐠 that bijects between natural numbers and formulas of a formal system F that has first order logic and Peano arithmetic. Also create a meta function 𝐤 that turns the meta natural numbers into the symbols for the formal systems Peano arithmetic numerals.

Diagonal Lemma

Make substitution function that applies to the Godel numeral of a function with a single free variable with a Peano arithmetic numeral.

a=𝐠("α()")
𝐬𝐮𝐛(a,b)=α(𝐤(b))

Then define diagonalization function.

𝐝(n)=𝐬𝐮𝐛(n,n)

and a formula.

Fγ(x)=y[Diag(x,y)ψ(y)]

and Diag is a function satisfying

(𝐝(x)=y)Diag(𝐤(x),𝐤(y))

let

p=𝐠("γ(x)")

then let

ϕγ(p)y[Diag(𝐤(p),y)ψ(y)]

Then prove that

𝐝(p)=𝐬𝐮𝐛(p,p)=𝐠("γ(𝐤(p))")=𝐠("ϕ")

and substituting

Fϕy[𝐤(𝐠("ϕ"))=yψ(y)]

then

ϕψ(𝐤(𝐠("ϕ")))

First incompleteness theorem

Use diagonal lemma to make

G¬ProvF(𝐤(𝐠(G)))

So if G is provable it is true but that means it's not provable. If ¬G is provable then it means that G is provable so the formal system isn't consistent