Problem 1
Let and be real numbers. Prove that if is any permutation of , then .
Step 4 of 5: Sort any permutation into the fully ordered one by repeated swaps
Detailed analysis
Take any permutation of that is not already sorted as . Then it must contain at least one inversion with ; by the lemma, swapping them gives a new permutation with no smaller, and strictly fewer inversions (an elementary counting fact about adjacent-style swaps on a finite sequence). Repeating this finitely many times eliminates every inversion, since the number of inversions is a nonnegative integer that strictly decreases at each step, and the process must terminate at the fully sorted sequence itself. Along the way never decreased, so its final value is at least as large as the value we started with.