[guided]The reason we took a **minimum-length** subwalk is exactly so that we could run an excision argument: any repetition gives us a way to shorten, and minimality forbids shortening, so repetitions are forbidden.
Suppose for contradiction that $W'$ has a repeated vertex: there are indices $p < q$ in $\{0, 1, \ldots, m\}$ with $w'_p = w'_q$. Define
\begin{align*}
W'' := w'_0, w'_1, \ldots, w'_p, w'_{q+1}, w'_{q+2}, \ldots, w'_m.
\end{align*}
We have cut out the segment $w'_{p+1}, w'_{p+2}, \ldots, w'_q$ and stitched the remaining pieces at the common vertex. Why does this still form an $x$–$y$ walk?
- The starting vertex of $W''$ is $w'_0 = x$ and the ending vertex is $w'_m = y$ (or $w'_p = w'_q = y$ in the boundary case $q = m$, which still gives endpoint $y$).
- Every consecutive pair of vertices in $W''$, **except possibly the splice point**, is a consecutive pair in $W'$ and therefore an edge of $G$. At the splice point, the consecutive pair is $w'_p$ followed by $w'_{q+1}$. Now $w'_p = w'_q$, so this pair is literally the same two vertices as $w'_q, w'_{q+1}$, which is an edge of $W'$ (and hence of $G$).
So $W''$ is an $x$–$y$ walk. Is it a subwalk of $W$? Yes: $W'$ was a subsequence of $W$ (a selection of indices into $W$), and $W''$ is obtained from $W'$ by dropping further entries, so $W''$ is also a subsequence of $W$ — a sub-subsequence is still a subsequence.
How long is $W''$? We removed $q - p$ entries (namely $w'_{p+1}, \ldots, w'_q$), so $W''$ has $m + 1 - (q - p)$ vertices and therefore $m - (q - p)$ edges. Since $p < q$, we have $q - p \ge 1$, so $W''$ is strictly shorter than $W'$.
We have constructed an $x$–$y$ subwalk of $W$ strictly shorter than $W'$. This contradicts the choice of $W'$ as a minimum-length such subwalk. The assumption of a repeated vertex therefore fails, so the vertices $w'_0, \ldots, w'_m$ are pairwise distinct.[/guided]