The first one.
We use the following notation:
- \(X_1\): state before applying \(K_\text{alt}\)
- \(X_2\): intermediate state obtained from \(K_1\) (called
intermediate_point
in the code)
- \(X_3\): state after applying \(K_\text{alt}\)
We have:
\[\begin{align*}
K_\text{alt}(x' | x) &= \mathbb{P}(X_3 = x' | X_1 = x) \\
&= \sum_{\check x} \mathbb{P}(X_3 = x', X_2 = \check x | X_1 = x) \;\;\text{(marginalization)} \\
&= \sum_{\check x} \mathbb{P}(X_2 = \check x | X_1 = x) \mathbb{P}(X_3 = x' | X_2 = \check x, X_1 = x) \;\;\text{(chain rule)} \\
&= \sum_{\check x} \mathbb{P}(X_2 = \check x | X_1 = x) \mathbb{P}(X_3 = x' | X_2 = \check x) \;\;\text{(Markov assumption)} \\
&= \sum_{\check x} K_1(\check x | x) K_2(x' | \check x) \;\;\text{(by definition)}.
\end{align*}\]