I want to chase up some aspects of the question Change of variable in a double sum, which so far has not received an accepted answer. To recall what is discussed there, we have the double sum:
$$\sum_{m=1}^p\sum_{n=1}^p\exp(2\pi ik(m^2-n^2)/p),$$
and we are prompted to make use of the substitution $m=n+h$, which yields,
$$\sum_{m=1}^p\sum_{n=1}^p\exp(2\pi ik(m^2-n^2)/p)=\sum_{\color\red{h}=1}^p\sum_{n=1}^p\exp(2\pi ik(2nh+h^2)/p)$$
$$=\sum_{\color\red{h}=1}^p\sum_{n=1}^p\exp(2\pi i kh^2/p)\exp(4\pi ikhn/p)$$ $$=\sum_{\color\red{h}=1}^p\exp(2\pi i kh^2/p)\sum_{n=1}^p\exp(4\pi ikhn/p).$$ Here are the aspects which I am unsure on:
Why is it that the first sum in the double sum is now over $\color\red{h}$ and not over, say $n+h$, once we employ the substitution? Why is it just over $h$ now, and why are we allowed to ignore the $'+n'$ part of the substitution?
With the above question in mind, employing this substitution allows the elements of the double sum to "pass" to the relevant parts in the product of the exponentials. From the substitution we have that $h=m-n$, yet, the sum over $n$ passes over the exponent involving $h$ - despite $h$ being defined in terms of $n$. Why doesn't the sum over $n$ recognise the $h$ component?
In both cases, it seems a little 'hand-wavey' to me, so I would appreciate being able to understand exactly what the procedure being employed is.