proof of rearrangement inequality
We first prove the rearrangement inequality for the case . Let be real numbers such that and . Then
and therefore
Equality holds iff or .
For the general case, let and be real numbers such that . Suppose that is a permutation(rearrangement) of such that the sum
is maximized. If there exists a pair with , then (the case); equality holds iff. Therefore, is not maximalunless or for all pairs such that . In the latter case, we can consecutivelyinterchange these pairs until (this ispossible because the number of pairs with decreaseswith each step). So is maximized if
To show that is minimal for apermutation of if, observe thatis maximized if . This implies that is minimized if