I'm again having some trouble understanding a solution of an exercise of chapter 1 of Stanley Combinatorics volume 1. It's the exercise 10 that requires to prove that the number of ways we can choose a subset of $[2n]$ satisfying the following properties:
- It contains exactly $s$ even elements and $r$ odd ones,
- It doesn't contain consecutive elements,
is $\binom{n-r}{s}\binom{n-s}{r}$. The author states that we can construct a bijection between the valid subsets and the multisets that contain exactly $s$ even elements and $r$ odd elements (counted with multiplicity) of the set $[2(n-r-s+1)]$. One direction of the bijection is stated clearly: given a valid subset $S=\left\{a_1<...<a_{r+s}\right\}$ we define its associated multiset as $$\{a_1,a_2-2,a_3-4,...,a_{r+s}-2(r+s-1)\}.$$ Then the author essentially says that an inverse can be constructed. How?
One thing to note is that the "doesn't contain consecutive elements" condition ensures that $$a_1 \le a_2 - 2 \le a_3 - 4 \le \cdots \le a_{r+s} - 2(r+s-1).$$
So, given a valid multiset $\{b_1 \le b_2 \le \cdots \le b_{r+s}\}$ from $[2(n-r-s+1)]$, consider the mapping to $\{b_1, b_2 + 2, b_3 + 4, \ldots, b_{r+s}+2(r+s-1)\}$. You can check that