Ler $A$ be a set in $\mathbb{Z}^d$. I want to know if the following step can be in fact justified by using the Markov property, for the markov chain $s_n$, $A\subset A'$ and $\tau_{A'}=\min\{n\geq0:S_n\notin A'\}$
\begin{equation} \begin{split} &\sum_{z\in A}{\sum_{k\geq0}{\mathbb{P}_x\left[S_j\notin A\text{ for all }j=k+1,\dots,\tau_{A'}\mid S_k=z,k<\tau_{A'}]\mathbb{P}_x[S_k=z,k<\tau_{A'}\right]}}\\ &=\sum_{z\in A}{\sum_{k\geq0}{\mathbb{P}_x\left[S_j\circ\theta_k\notin A\text{ for all }j=1,\dots,\tau_{A'}\mid S_k=z,k<\tau_{A'}\right]\mathbb{P}_x\left[S_k=z,k<\tau_{A'}\right]}}\\ &=\sum_{z\in A}{\sum_{k\geq0}{\mathbb{P}_z\left[S_j\notin A\text{ for all }j=1,\dots,\tau_{A'}\right]\mathbb{P}_x\left[S_k=z,k<\tau_{A'}\right]}}\\ \end{split} \end{equation}
My problem is the last equality. To use the MP we have usually to conditional on $S_k$. Now by writing this I realize that maybe $\{S_k=z\}\subset\{k<\tau_{A'}\}$ therefore should be fine?