Let " ":WFF→ω be the encoding function. It is injective.
Let Diag(x,y) be a sentence that is true iff y encodes (∃a)(a=x∧P), where "P"=x.
e.g. if "0=0"=5 and "(∃a)(a=5∧0=0)"=6, then Diag(5,6) is true.
Now, let A(a) := (∃y)(Diag(a,y)∧φ(y)) where φ is any formula.
Let G := (∃a)(a="A(a)"∧A(a)).
Then, ⊢ Diag("A(a)","G") from the definition of G and Diag.
Also:
⊢ G ⟺ A("A(a)")
⊢ G ⟺ (∃y)(Diag("A(a)",y)∧φ(y))
⊢ G ⟺ φ("G")