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.
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$$