In “Friendly introduction to mathematical logic” by Leary, an example is mentioned to demonstrate the importance of defining substitutions and then substitutability as follows:
let $\sigma$ be the $L$-formula, $\forall x\exists y ¬(x=y)$; then when we replace $x$ by $y$ in the formula, the truth value changes, and this is considered as an example for unwanted substitutions. So, we define substitutions and substitutability formally.
The problem is that, according to the formal definition of substitution, this example is not even a substitution!
Because one of the clauses of the definition says that: if $t$ is a term, $x,y$ are variables and $\sigma$ is a formula then,
if $\sigma$ is $(\forall x) (\alpha) $ then $\sigma ^y_t$ is $(\forall x)(\alpha ^y_t)$ if $x\not= y$ and is itself otherwise.
In our example, we have $x=y$ so $\sigma ^x_y$ is $\sigma$ and there is no change in the formula. hence, such replacement is not a substitution. Am I getting it wrong?
I've checked the errata, no thing is mentioned about this particular example.
I'll refer to (one of) my preferred textbooks :
he defines substitution by recursion :
[...]
Then he discuss the fallacy of substituting $y$ for $x$ into $∀x¬∀y(x=y)$, getting the wrong : $¬∀y(y=y)$, which again is exactly your example.
Thus [page 113] he defines :
[...]
The two definitions are exactly the same as in Christopher Leary, A Friendly Introduction to Mathematical Logic (2000), pages 39-41.
I think that you are "not seeing" the difference between the two concepts because you are thinking only to one part of the problem :
This clause prevent us from replacing the bound variable. I.e. with $∀y(x=y)$ we can perform $(∀y(x=y))_t^x$ to get $∀y(t=y)$ but we cannot perform $(∀y(x=y))_t^y$.
But we have another possible (bad) case : when $t$ has free variables inside, included the "degenerate" case when $t$ is $y$.
In this case the above clause tells us nothing, because we are trying to put $t$ (i.e. $y$) in place of $x$ inside $∀y(x=y)$. In this case $x$ is not the bound variable (which is $y$) but the result is still not what we expect.
The formula :
is true in a model with only one object, while :
is true in every model.