Changing the order of finite double summations Let $I = \{1, 2, \ldots, n\}$ with two indices $i, j$. Then can we do the following:
$$\sum_{i \in I} \sum_{j \in I \setminus \{i\}} a_j = \sum_{j \in I \setminus \{i\}} \sum_{i = 1} a_i = (n - 1)[a_1 + a_2 + \cdots + a_n]?$$
Although the outer sum is dependent on the inner sum's index, I still think we can do this change of order in the above summation. Am I wrong?
Here's my proof:
\begin{align}
\sum_{i \in I} \sum_{j \in I \setminus \{i\}} a_j & = \sum_{i \in I} a_1 + \dots + a_{i - 1} + a_{i + 1} + \dots + a_n \\
& = [0 \cdot a_1 + a_2 + a_3 + \dots + a_n] + [a_1 + 0 \cdot a_2 + a_3 + \dots + a_n] + [a_1 + a_2 + \dots + a_{n - 1} + 0 \cdot a_n] \\
& = (n - 1) \cdot \sum_{i \in I} a_i
\end{align}
as for specific values of $i$, we can omit undefined terms like $a_{n + 1}$ or $a_0$. The last equality comes from noting that $\sum_{i = 1} ^ {n} \alpha = \alpha \cdot n$, where $\alpha$ is any scalar.
I'd appreciate any help on this. Thank you.
 A: Let $A=\sum_{i \in I} a_i$.  Then 
$$\sum_{j \in I \setminus \{i\}}a_j=A-a_i\\
\sum_{i \in I} \sum_{j \in I \setminus \{i\}} a_j = \sum_{i \in I} \left(A-a_i\right)=nA-A=(n-1)A$$
Your interchange of summations does not work because in the second version $i$ is a dummy variable in the inner summation so the outer summation cannot reference it.  
It would be more usual to write your double sum
$$\sum_{i=1}^n \sum_{\substack{j=1\\j \neq i}}^n$$
A: This has already been hinted at, but 
$$\sum_{j \in I \setminus \{i\}} \sum_{i \in I} a_i$$
does not mean what you think it means. It means you have an inner sum
$\sum_{i = 1} a_i$ that is always the same,
and an outer sum over some set $I \setminus\{i\}$ where $i$ is some externally-defined variable that has no particular relationship to the $i$ in the inner sum.
(This is already confusing, isn't it? 
That's the first reason why this is a bad idea.)
So depending on whether this externally-defined $i$ satisfies $i\in I$ or 
$i \not\in I,$ you add up either $n-1$ or $n$ copies of the inner sum.
The correct way to switch the order of the sums is
$$\sum_{i \in I} \sum_{j \in I \setminus \{i\}} a_j 
= \sum_{j \in I} \sum_{i \in I \setminus \{j\}} a_j. $$
Notice that the subscript is still $j$ on the right-hand side of the equation;
if you also change the subscript to $i$, all you've done is to write the exact same sum using different choices of dummy variables.
It turns out that switching the order of summation actually does help, because
$$ \sum_{i \in I \setminus \{j\}} a_j = (n - 1)a_j $$
when $j \in I,$ and now we sum these terms over $j \in I$ to get
$$ \sum_{j \in I}  (n - 1)a_j =  (n - 1) \sum_{j \in I} a_j
 =  (n - 1) \sum_{i \in I} a_i.$$
