How it can be show that:
$$ \sum_{m=0}^{n-k} {n-m-1\choose n-k-m} \\ = [z^{n-k}] (1+z)^{n-1} \sum_{m=0}^{n-k} z^m (1+z)^{-m} $$
I tried to use binomial theorem, but since the upper limit does not mach to $n-m-1$ in the binomial coefficient then I could not continue. If you want to prove that please start with the left hand side
Start from right hand side \begin{equation}\begin{aligned} \sum_{m=0}^{n-k}z^m(1+z)^{n-m-1}&=\sum_{m=0}^{n-k}\sum_{\ell=0}^{n-m-1}z^{m+\ell}\begin{pmatrix}n-m-1\\\ell\end{pmatrix}\\ \end{aligned}\end{equation} So we see the coefficient of $z^{n-k}$ is at $\ell=n-k-m$, and the result follows.