Update: The mistake referred to in this question has now been corrected. The below refers to a previous version of the article:
The second supplement to the Stanford Encyclopaedia of Philosophy article about Gödel's incompleteness theorems concerns the proof of the diagonal lemma. The author refers to a substitution function 'subst' which takes as its first argument the Gödel number of a WFF with one free variable and its second argument the Gödel number of a numeral and which results in the Gödel number of the WFF resulting from substituting the numeral in for the free variable:
subst(⌈A(x)⌉, ⌈n⌉) = ⌈A(n)⌉,
In view of the use the author makes of this function later on in the article should the function not be one that takes as its second argument, instead of the Gödel number of the numeral, the number itself, the numeral of which will be substituted in i.e.:
substA(⌈A(x)⌉, n) = ⌈A(n)⌉,
For example, if we want to replace 'x' by '0' in 'x=0', then the second argument should be the actual number 0 not the Gödel number of the numeral '0'.
The author later outlines a formula B(x) and refers to its Gödel number as 'k' and the Gödel number of B(k) as 'm'. If we use the first definition then his assertion that subst(k, k) = m is false since k is the Gödel number of the formula 'B(x)' not the Gödel number of the numeral of the Gödel number of 'B(x)'. With the second definition, though, the assertion is true i.e substA(k,k) = m.
The second substitution function can be defined by composition from the original function and another function that I shall call 'num'. This function takes a number and returns the Gödel number of the numeral for that number in the formal theory, that is:
num(n) = ⌈n⌉
'num' corresponds to the function Z in definition 17 of Gödel's original paper. 'substA' can then be defined as:
substA(⌈A(x)⌉, n) = subst(⌈A(x)⌉,num(n) )
I'd like to know if I am correct and if not where am I going wrong?
I am also having trouble determining exactly what was intended in the article. The source of my confusion is the mixture of brackets and underlining on some of the numbers (and then boldface, later on).
In the end, the function "subst" takes actual numbers as inputs. So I believe that the following revision of the SEP article seems to work, where we remember that all the inputs to subst are numbers. In my text below, $\underline n$ is the term of the form $1 + 1 + \cdots + 1 $ that represents $n$, and $\lceil A(x)\rceil$ is the Gödel number of $A(x)$.
I have read through the lower part of the SEP article a couple times, and it seems as if this change to the beginning of the SEP article is sufficient for the lower part to go through. This does require some changes, e.g. $$ F ⊢ ∀y[S(\underline k,\underline k, y) ↔ y = ⌈B(\underline k)⌉] $$ should be $$ F ⊢ ∀y[S(\underline k,\underline k, y) ↔ y = \underline {⌈B(\underline k)⌉}] $$ with similar changes in the remainder of the argument.
Of course, (as the question shows) it is easy to miss fine details.