|
We first prove the rearrangement inequality for the case $n=2$ Let $x_1,x_2,y_1,y_2$ be real numbers such that $x_1\le x_2$ and $y_1\le y_2$ Then $$ (x_2-x_1)(y_2-y_1)\ge 0, $$ and therefore $$ x_1y_1+x_2y_2\ge x_1y_2+x_2y_1. $$ Equality holds iff $x_1=x_2$ or $y_1=y_2$
For the general case, let $x_1,x_2,\ldots,x_n$ and $y_1,y_2,\ldots,y_n$ be real numbers such that $x_1\le x_2\le\cdots\le x_n$ Suppose that $(z_1,z_2,\ldots,z_n)$ is a permutation (rearrangement) of $\{y_1,y_2,\ldots,y_n\}$ such that the sum $$ x_1z_1+x_2z_2+\cdots+x_nz_n $$ is maximized. If there exists a pair $i<j$ with $z_i>z_j$ then $x_iz_j+x_jz_i\ge x_iz_i+x_jz_j$ (the $n=2$ case); equality holds iff $x_i=x_j$ Therefore, $x_1z_1+x_2z_2+\cdots+x_nz_n$ is not maximal unless
$z_1\le z_2\le\cdots\le z_n$ or $x_i=x_j$ for all pairs $i<j$ such that $z_i>z_j$ In the latter case, we can consecutively interchange these pairs until $z_1\le z_2\le\cdots\le z_n$ (this is possible because the number of pairs $i<j$ with $z_i>z_j$ decreases with each step). So $x_1z_1+x_2z_2+\cdots+x_nz_n$ is maximized if $$ z_1\le z_2\le\cdots\le z_n. $$ To show that $x_1z_1+x_2z_2+\cdots+x_nz_n$ is minimal for a permutation $(z_1,z_2,\ldots,z_n)$ of $\{y_1,y_2,\ldots,y_n\}$ if $z_1\ge z_2\ge\cdots\ge z_n$ observe that $-(x_1z_1+x_2z_2+\cdots+x_nz_n)=x_1(-z_1)+x_2(-z_2)+\cdots+x_n(-z_n)$ is maximized if $-z_1\le-z_2\le\cdots\le-z_n$ This implies that $x_1z_1+x_2z_2+\cdots+x_nz_n$ is minimized if $$ z_1\ge z_2\ge\cdots\ge z_n. $$
|