Let denote a permutation of . define . We claim that is a bijection from to where .
is surjective: let is either greater than or smaller than . as a set, this permutation is a re-arrangement of . Hence decrementing if results in a re-arrangement of , hence .
is injective: this follows from the definition of . If it is either the case that or for any .
it is important to note that if is biijective, then is also bijective whenever A.
We say that is valid (where and ) if for every .
is valid implies is valid.
if : suppose and hence , giving , or and hence
A similar argument can be given when .
Now, let denote the set of all permutations of that are valid for a given .
define a partition of those permutations in that end with , for .
The following is a theorem: for valid permutations .
where means concatenation, (which when applied on a set means concatenation on each element, and also is applied elementwise to a set).
To prove the theorem, at least we know that the right hand side are permutations, as does not contain , and is a permutation, so the right hand side definitely contains permutations of that end in .
Now we need to show that these permutations are valid.