Closed Form for Number of Derangements on Finite Set/Proof 2

Proof
A derangement is a permutation that fixes no elements.

So, to compute the total number of derangements, we compute the number of permutations that fix elements, that is leave elements in the same place.

Let $\pi$ be a permutation of $S$.

Let $x, y \in S$.

Let $i$ be a position in a given permutation of set $S$, where $1 \le i \le n$.

Let $\map {P_i} \pi$ be the property that $\map \pi x = y$ at position $i$.

Let $\map N {P_i, \dots, P_j}$ be the number of permutations where $\map {P_i} \pi, \dots, \map {P_j} \pi$ hold.

If we consider all the permutations of a set where the property $P_i$ holds, we have fixed a single element of the set.

So there are $\paren {n - 1}!$ such possible permutations.

Furthermore, we could have chosen $i$ as any element in the set so there are $\dbinom n 1$ terms to choose from.

So $\map N {P_i} = \paren {n - 1}!$ and there are $\dbinom n 1$ terms.

Similarly, $\map N {P_i, P_j} = \paren {n - 2}!$ and there are $\dbinom n 2$ terms.

So now we can compute the total number of derangements: