I was working through the exercises of chapter 3 from Boyd & Vandenberghe's Convex Optimization but I'm a bit confused by the solution for Ex 3.19(a). It says that:-
for $\alpha_1 \geq \alpha_2 \geq \alpha_3 \geq ... \geq \alpha_r \geq 0$ and $x_{[i]}$ denotes the $i^{th}$ largest component of $x$,
\begin{alignat*}{1} f(x) &= \sum_{i=1}^{r} \alpha_ix_{[i]}\\ &= \alpha_r(x_{[1]}+x_{[2]}+\ldots+x_{[r]}) + (\alpha_{r-1}-\alpha_r)(x_{[1]}+x_{[2]}+\ldots+x_{[r-1]}) \\ &\hspace{5mm}+ (\alpha_{r-2}-\alpha_{r-1})(x_{[1]}+x_{[2]}+\ldots+x_{[r-2]}) + \ldots + (\alpha_1-\alpha_2)x_{[1]} \end{alignat*}
I cant seem to understand how these two are equivalent. Any additional steps in between would be appreciated. Thank you.