Solution 4. To shorten the displays, write \(p(x_a, \ldots, x_b)\) for \(\mathbb{P}(X_a = x_a, \ldots, X_b = x_b)\), and \(p(x_a \mid x_c, \ldots, x_d)\) for \(\mathbb{P}(X_a = x_a \mid X_c = x_c, \ldots, X_d = x_d)\). Each value’s subscript says which variable takes it.
First, for each \(s\) with \(t + N \le s \le n\), the condition on \(X_t, \ldots, X_{s-1}\) can be cut to the \(N - 1\) variables just before \(X_s\): for values with \(p(x_t, \ldots, x_{s-1}) > 0\),
\[
\begin{aligned}
p(x_s \mid x_t, \ldots, x_{s-1})
&= \sum_{x_1, \ldots, x_{t-1}} p(x_1, \ldots, x_{t-1} \mid x_t, \ldots, x_{s-1}) \, p(x_s \mid x_1, \ldots, x_{s-1}) \\
&= \sum_{x_1, \ldots, x_{t-1}} p(x_1, \ldots, x_{t-1} \mid x_t, \ldots, x_{s-1}) \, p(x_s \mid x_{s-N+1}, \ldots, x_{s-1}) \\
&= p(x_s \mid x_{s-N+1}, \ldots, x_{s-1}) \sum_{x_1, \ldots, x_{t-1}} p(x_1, \ldots, x_{t-1} \mid x_t, \ldots, x_{s-1}) \\
&= p(x_s \mid x_{s-N+1}, \ldots, x_{s-1}).
\end{aligned}
\tag{141}\]
The first line is the law of total probability, given \(X_t, \ldots, X_{s-1}\). The second line is the \(N\)-gram model, which applies because \(s > N\). The third line takes the factor that does not depend on \(x_1, \ldots, x_{t-1}\) out of the sum. The fourth line uses that a conditional probability mass function sums to \(1\). Because \(s - N + 1 \ge t + 1\), the same holds with \(t + 1\) in place of \(t\).
Write \(R\) for the product of these factors:
\[R = \prod_{s=t+N}^{n} p(x_s \mid x_{s-N+1}, \ldots, x_{s-1}). \tag{142}\]
The product is empty, and \(R\) is \(1\), when \(n = t + N - 1\). No factor involves \(x_t\), because each starts at \(x_{s-N+1}\) with \(s - N + 1 \ge t + 1\). Applying the multiplication rule once for each \(s\) from \(t + N\) to \(n\), and then the cut above to each factor, gives
\[
\begin{aligned}
p(x_t, \ldots, x_n)
&= p(x_t, \ldots, x_{t+N-1}) \prod_{s=t+N}^{n} p(x_s \mid x_t, \ldots, x_{s-1}) \\
&= p(x_t, \ldots, x_{t+N-1}) \, R.
\end{aligned}
\tag{143}\]
The same two steps, starting from \(x_{t+1}\), give
\[
\begin{aligned}
p(x_{t+1}, \ldots, x_n)
&= p(x_{t+1}, \ldots, x_{t+N-1}) \prod_{s=t+N}^{n} p(x_s \mid x_{t+1}, \ldots, x_{s-1}) \\
&= p(x_{t+1}, \ldots, x_{t+N-1}) \, R.
\end{aligned}
\tag{144}\]
The left side of the second display is positive by assumption, so \(R > 0\) and \(p(x_{t+1}, \ldots, x_{t+N-1}) > 0\). By the definition of conditional probability,
\[
\begin{aligned}
p(x_t \mid x_{t+1}, \ldots, x_n)
&= \frac{p(x_t, \ldots, x_n)}{p(x_{t+1}, \ldots, x_n)} \\
&= \frac{p(x_t, \ldots, x_{t+N-1}) \, R}{p(x_{t+1}, \ldots, x_{t+N-1}) \, R} \\
&= \frac{p(x_t, \ldots, x_{t+N-1})}{p(x_{t+1}, \ldots, x_{t+N-1})} \\
&= p(x_t \mid x_{t+1}, \ldots, x_{t+N-1}).
\end{aligned}
\tag{145}\]
The second line substitutes the two displays above, the third cancels \(R\), and the fourth is the definition of conditional probability again.