# Rearrangement inequality

In mathematics, the rearrangement inequality[1] states that

${\displaystyle x_{n}y_{1}+\cdots +x_{1}y_{n}\leq x_{\sigma (1)}y_{1}+\cdots +x_{\sigma (n)}y_{n}\leq x_{1}y_{1}+\cdots +x_{n}y_{n}}$

for every choice of real numbers

${\displaystyle x_{1}\leq \cdots \leq x_{n}\quad {\text{and}}\quad y_{1}\leq \cdots \leq y_{n}}$

and every permutation

${\displaystyle x_{\sigma (1)},\dots ,x_{\sigma (n)}\,}$

of x1, . . ., xn. If the numbers are different, meaning that

${\displaystyle x_{1}<\cdots

then the lower bound is attained only for the permutation which reverses the order, i.e. σ(i) = n − i + 1 for all i = 1, ..., n, and the upper bound is attained only for the identity, i.e. σ(i) = i for all i = 1, ..., n.

Note that the rearrangement inequality makes no assumptions on the signs of the real numbers.

## Applications

Many famous inequalities can be proved by the rearrangement inequality, such as the arithmetic mean – geometric mean inequality, the Cauchy–Schwarz inequality, and Chebyshev's sum inequality.

## Proof

The lower bound follows by applying the upper bound to

${\displaystyle -x_{n}\leq \cdots \leq -x_{1}.}$

Therefore, it suffices to prove the upper bound. Since there are only finitely many permutations, there exists at least one for which

${\displaystyle x_{\sigma (1)}y_{1}+\cdots +x_{\sigma (n)}y_{n}}$

is maximal. In case there are several permutations with this property, let σ denote one with the highest number of fixed points.

We will now prove by contradiction, that σ has to be the identity (then we are done). Assume that σ is NOT the identity. Then there exists a j in {1, ..., n − 1} such that σ(j) ≠ j and σ(i) = i for all i in {1, ..., j − 1}. Hence σ(j) > j and there exists a k in {j + 1, ..., n} with σ(k) = j. Now

${\displaystyle j

Therefore,

${\displaystyle 0\leq (x_{\sigma (j)}-x_{j})(y_{k}-y_{j}).\quad (2)}$

Expanding this product and rearranging gives

${\displaystyle x_{\sigma (j)}y_{j}+x_{j}y_{k}\leq x_{j}y_{j}+x_{\sigma (j)}y_{k}\,,\quad (3)}$

hence the permutation

${\displaystyle \tau (i):={\begin{cases}i&{\text{for }}i\in \{1,\ldots ,j\},\\\sigma (j)&{\text{for }}i=k,\\\sigma (i)&{\text{for }}i\in \{j+1,\ldots ,n\}\setminus \{k\},\end{cases}}}$

which arises from σ by exchanging the values σ(j) and σ(k), has at least one additional fixed point compared to σ, namely at j, and also attains the maximum. This contradicts the choice of σ.

If

${\displaystyle x_{1}<\cdots

then we have strict inequalities at (1), (2), and (3), hence the maximum can only be attained by the identity, any other permutation σ cannot be optimal.