Imagine you have two finite sets, A and V, and a function $f: A \rightarrow \wp(V)$ (in my case A is a subset of V but that does not matter). We also have a function $g(a,b)$ where a is an element of A, and b is an element of V, and a function $h(c)$ where c is an element of V.
Now I have this summation:
$$\sum_{i\in A}\sum_{t\in f(i)}g(i,t)\times h(t)$$
I would like to reorder the summations to look something like below, but I believe what I have written is illegal (as I used a parameter created within the sigma):
$$\sum_{t\in f(i)}h(t)\sum_{i\in A}g(i,t)$$
What should I do?
For every $t\in V$, let $I_t=\{i\in A:t\in f(i)\}$. Then \begin{align} \sum_{i\in A}\sum_{t\in f(i)}g(i,t)h(t) &=\sum_{t\in V}\sum_{i\in I_t}g(i,t)h(t)\\ &=\sum_{t\in V}h(t)\sum_{i\in I_t}g(i,t) \end{align}