Changing summation indices How does one prove the following result, where $x$ is a three-parameter function defined on $\mathbb Z^3$? $$ \Sigma_{\ell=1}^{P}\Sigma^{\ell-1}_{i=0}  x(\ell,i,\ell-i) \quad = \quad \Sigma^{P}_{j=1}\Sigma^{P-j}_{i=0} x(i+j,i,j)$$
So far, I've realised three things:
$\\$
(1) $\Sigma_{\ell=1}^{P}\Sigma^{\ell-1}_{i=0} 1 = p(p-1)/2 =\Sigma^{P}_{j=1}\Sigma^{P-j}_{i=0} 1 \\$
(2) The regions $\{0\leq i \leq \ell -1 \leq p -1, \ell>1\}$ and $\{0\leq j-1 \leq i+j -1 \leq p-1\}$, both in $\mathbb Z^2$, describe isosceles triangles (respectively, bottom-left triangle and bottom-right triangle of square with sides $\overline{(1,1)(1,p)}$ and $\overline{(1,1)(p-1,1)}\\$).
(3) It is tempting to quick-and-dirtily substitute $\ell = i+j$, and one does get
$$ \Sigma_{\ell=1}^{P}\Sigma^{\ell-1}_{i=0}  x(\ell,i,\ell-i) \quad = \quad\Sigma_{j+i=1}^{P}\Sigma^{j+i-1}_{i=0}  x(j+i,i,j) \quad$$
which gives the right indices for the arguments of $x$, but the upper bound on the second summation is nonsensical (what is a sum ranging from $i=0$ up to $i=j+i-1$?)
PS: This appears in "Differential Eq. Driven by Rough Signal", Revista Matemática Iberoeamicana, Lyons, 1998.
 A: To restate your question, you are asking why
$$
\sum_{(\ell,i,j)\in A}x(\ell,i,j)=\sum_{(\ell,i,j)\in B}x(\ell,i,j),
$$
where
$$
A=\{(\ell,i,\ell-i)\in \mathbb Z^3\mid 1\le \ell \le P,0\le i\le \ell-1\}\\
B=\{(i+j,i,j)\in \mathbb Z^3\mid 1\le j \le P,0\le i\le P-j\}
$$
The reason is that $A=B$; both summations are over the same set of integer vectors, so they are equal.
To prove $A=B$, you just need to show every vector in $A$ is also in $B$, and that every vector in $B$ is also in $A$. I will help you with the first part.
Let $(\ell,i,\ell-i)$ be a vector in $A$. By definition of $A$, we know $$1\le \ell \le P\quad\text{and}\quad 0\le i\le \ell-1$$Define $j:=\ell-i$. Note that
$$
\begin{align}
\begin{array}{l}
j=\ell-i\le P-i\le P,\\
j=\ell-i\ge\ell-(\ell-1)=1
\end{array} 
&\implies 1\le j \le P \tag1\\\\
i+j=\ell\le P
&\implies i\le P-j\tag2
\end{align}
$$
We have shown that $(i,j)$ satisfies all of the conditions defining $B$. This means that $(i+j,i,j)=(\ell,i,\ell-i)$ is an element of $B$, so $A\subseteq B$
The same type of reasoning proves $B\subseteq A$. I encourage you to write out the details yourself.

The above is the rigorous proof of equality. Here is the intuition, and the way I think about these problems when I see them in the wild.
Let's say you start with $\sum_{\ell=1}^P\sum_{i=0}^{\ell-1} x(\ell,i,\ell-i)$, and you want to transform in into $$\sum_{j=?}^?\sum_{i=?}^?x(i+j,i,j),$$but you do not know what the bounds are. We proceed the same way you do when switching the order of summation for multivariable integrals. First, figure out the bounds on the variables for the original sum. The outer sum goes $\ell=1$ to $P$, and the inner from $i=0$ to $\ell-1$, so we get
$$
0\le i\le \ell-1,\qquad 1\le \ell \le P
$$
Now, to get from a sum of $x(\ell,i,\ell-i)$ to $x(i+j,i,j)$, it is clear we need to let $j=\ell-i$. Since $j$ is the outer summation variable for the new sum, we need to figure out the bounds on $j$ implies by those on $i$ and $\ell$. See $(1)$ for what this work looks like. Since the conclusion is $1\le j \le P$, we have deduced the outer limits are $1$ to $P$. Similarly, proceeding as in $(2)$, you can deduce the inner limits are $0$ to $P-j$.
A: The following might also be sometimes useful. At first we bring lower and upper indices of the sums in similar form to ease comparison. Then we check if we can derive from it the wanted equality.

Left-hand side and right-hand side:
\begin{align*}
\sum_{l=1}^{P}\sum_{i=0}^{l-1}x(l,i,l-i)
&=\sum_{l=0}^{P-1}\sum_{i=0}^lx(l+1,i,l+1-i)\tag{1.1}\\
&=\sum_{\color{blue}{0\leq i\leq l\leq P-1}}x(l+1,i,l+1-i)\tag{1.2}\\
\\
\sum_{j=1}^P\sum_{i=0}^{P-j}x(i+j,i,j)
&=\sum_{j=0}^{P-1}\sum_{i=0}^{P-j-1}x(i+j+1,i,j+1)\tag{2.1}\\
&=\sum_{j=0}^{P-1}\sum_{i=0}^jx(i+P-j,i,P-j)\tag{2.2}\\
&=\sum_{\color{blue}{0\leq i\leq j\leq P-1}}x(i+P-j,i,P-j)\tag{2.3}
\end{align*}
Analysis:

*

*The index regions in (1.2) and (2.3) show that $0\leq i\leq P-1$ in both cases indicating a mapping $i\to i$ which is consistent with the middle argument in $x(\cdot,\Box,\cdot)$.


*We have $i\leq l\leq P-1$ at the LHS and $i\leq j\leq P-1$ at the RHS. So, both indices $l$ and $j$ are going from $i$ to $P-1$.


*The leftmost argument in $x(\Box,\cdot,\cdot)$ indicates a mapping
\begin{align*}
l\to i+P-j-1\qquad\text{resp.}\qquad j\to i-l+P-1\tag{3}
\end{align*}
which coincides with the rightmost argument in $x(\cdot,\cdot,\Box)$ as well!


*Finally we need to show that $l$ and $j$ are bijectively mapped via (3). Since we have according to (3)
\begin{align*}
\begin{array}{l|cccccc}
l&i,&i+1,&i+2,&\ldots,&P-2,&P-1\\
j&P-1,&P-2,&P-3,&\ldots,&i+1,&i
\end{array}
\end{align*}
just a reverse ordering of ${i,i+1,\ldots,P-1}$ when using $l$ resp. $j$.
Conclusion: The equality of the sums (1.2) and (2.3) follows.

Comment:

*

*In (1.1) we shift the index $l$ to start with $l=0$ to conveniently write the index region als inequality chain in (1.2).


*In (2.1) we shift the index $j$ to start with $j=0$.


*In (2.2) we change the order summation of the outer sum $j \to P-1-j$.


*In (2.3) we also write the index region as inequality chain to ease comparison with (1.2).
