Peter Smith's formulation of the diagonalization lemma is essentially as follows, from Theorem 47 of his (fantastic) online book:
If theory T extends Robinson Arithmetic, and P is an one-place open sentence of T's language (i.e., a well-formed formula in T), then there is a sentence π s.t.:
T β’ π β P(βπβ)
Where the quine corner brackets represent the function that converts a well-formed sentence into a GΓΆdel numeral. He then defines Prf(x,y) as the T-sentence which is true when x is the GΓΆdel number of a well-formed T-proof which proves the well-formed T-formula which y is the GΓΆdel number of. And as he says on page 83, a well-formed formula in T corresponding to Prf(x,y) does in fact exist.
Then he defines Prov(y) as the provability predicate for T:
Prov(y) β‘ βx Prf(x,y).
But then here's where I'm confused: If Prf(x,y) is a well-formed formula, then βx Prf(x,y) should be one as well. And so should its negation: Β¬βx Prf(x,y). And if Β¬βx Prf(x,y) is a well-formed formula, then why wouldn't the diagonalization lemma apply to it?
Let's use NProv(y) as shorthand for Β¬βx Prf(x,y). If the diagonalization lemma applies to NProv, then we get:
T β’ π β NProv(βπβ)
And this trivially leads to inconsistency: We can show that if T β’ π then T β’ β₯, and likewise if T β’ Β¬π then T β’ β₯.
It seems to me that the fix is to edit Smith's Theorem 47 so that it says:
If theory T extends Robinson Arithmetic, and the numerical property P is captured by a one-place open sentence of T's language (i.e., a well-formed formula in T), then there is a sentence π s.t.:
T β’ π β P(βπβ)
Because then although T can express NProv by the wff Β¬βx Prf(x,y), it cannot capture it (meaning that (1) if π is true then T β’ NProv(βπβ), and (2) if π is false then T β’ Β¬NProv(βπβ)), and thus diagonalization wouldn't apply.
But I see this mistake elsewhere as well. So what's the deal? Can the fixed point lemma / diagonalization lemma be applied to any well-formed formula? And if so, why isn't NProv a well-formed formula? Or does the numerical property diagonalization is applied to need to be capturable in T? And if so, why doesn't Peter Smith's version state this?