[step:Count the intermediate strings and conclude]
Partition the intermediate strings by their length: for $\ell \in \{1, 2, \dots, |w|\}$ define
\begin{align*}
I_\ell &:= \{\, i \in \{0, 1, \dots, n\} \;\big|\; |\sigma_i| = \ell \,\}.
\end{align*}
From the previous step, $I_1, I_2, \dots, I_{|w|}$ partition $\{0, 1, \dots, n\}$, so
\begin{align*}
n + 1 &= \sum_{\ell = 1}^{|w|} |I_\ell|.
\end{align*}
For each $\ell$, the map
\begin{align*}
I_\ell &\to \Omega^\ell \\
i &\mapsto \sigma_i
\end{align*}
is injective because the intermediate strings are pairwise distinct (third step). The codomain $\Omega^\ell$ has exactly $|\Omega|^\ell$ elements, being the set of length-$\ell$ words over the finite alphabet $\Omega$. Hence
\begin{align*}
|I_\ell| &\leq |\Omega|^\ell.
\end{align*}
Summing over $\ell$,
\begin{align*}
n + 1 &= \sum_{\ell = 1}^{|w|} |I_\ell| \leq \sum_{\ell = 1}^{|w|} |\Omega|^\ell = N.
\end{align*}
Therefore $n \leq N - 1 \leq N$, and the fixed derivation has length at most $N$. This proves the forward direction and, combined with the backward direction from the first step, gives the biconditional claimed by the theorem.
[/step]