
The following was proved in Proposition 7.1.11(c) (in Tao's Analysis):
7.1.11(c) (Substitution, part I) If $X$ is a finite set, $f:X\to \mathbb{R}$ is a function, and $f:Y\to X$ is a bijection, then
$$ \sum_{x\in X} f(x) = \sum_{y\in Y} f(g(y))$$
Later in proof of Lemma 7.1.13 Tao sir uses this...