The problem is:
Why is $$ \sum_{n=0}^{k}|m-n|=\sum_{n=0}^{m}(m-n)+\sum_{n=m}^{k}(n-m)\;?$$
The problem is:
Why is $$ \sum_{n=0}^{k}|m-n|=\sum_{n=0}^{m}(m-n)+\sum_{n=m}^{k}(n-m)\;?$$
On
Note that $|m-n|=m-n$ for $n< m$ and $|m-n|=n-m$ for $n\ge m$.The given sum can thus be split as $$ \sum_{n=0}^k|m-n|=\sum_{n=0}^{m-1}|m-n|+\sum_{n=m}^{k}|m-n|=\sum_{n=0}^{m-1}(m-n)+\sum_{n=m}^{k}(n-m).$$ The only remaining difference is that the summand for $n=m$ is missing from the first sum. But since $|m-m|=0$, this doesn't matter.
Implicitly, we used $0\le m\le k$ in the above. But the result also holds for $m>k$ or $m<0$, provided one interpretes sums with lower index greater than upper index accordingly.
\begin{align} \sum_{n=0}^{k}|m-n|&= \sum_{n=0, n \le m}^{k}|m-n| + \sum_{n=0, n \ge m}^{k}|m-n| \\ &= \sum_{n=0}^{m}|m-n| + \sum_{n= m }^{k}|m-n|\\ &= \sum_{n=0}^{m}(m-n) + \sum_{n= m}^{k}(n-m) \end{align}