[step:Prove the invariance relation $\rho = \rho P$ by conditioning on the previous state]We must show $\rho_j = \sum_{i \in S} p_{i,j} \, \rho_i$ for every $j \in S$. Expanding the definition:
\begin{align*}
\rho_j = \mathbb{E}_k[W_j] = \sum_{m=1}^{\infty} \mathbb{P}_k(X_m = j,\, T_k \geq m),
\end{align*}
where the upper limit is extended to $\infty$ since $\mathbb{P}_k(X_m = j, T_k \geq m) = 0$ for $m > T_k$.
Condition on the state $X_{m-1}$ at the previous time step. The event $\{T_k \geq m\}$ means $X_1, \ldots, X_{m-1}$ are all different from $k$, which is determined by the trajectory up to time $m-1$. By the Markov property, $\mathbb{P}_k(X_m = j \mid X_{m-1} = i, T_k \geq m) = p_{i,j}$, since $\{T_k \geq m\}$ depends only on $(X_1, \ldots, X_{m-1})$. Therefore:
\begin{align*}
\rho_j &= \sum_{m=1}^{\infty} \sum_{i \in S} \mathbb{P}_k(X_m = j \mid X_{m-1} = i) \, \mathbb{P}_k(X_{m-1} = i,\, T_k \geq m) \\
&= \sum_{i \in S} p_{i,j} \sum_{m=1}^{\infty} \mathbb{P}_k(X_{m-1} = i,\, T_k \geq m).
\end{align*}
Re-index by $r = m - 1$:
\begin{align*}
\rho_j = \sum_{i \in S} p_{i,j} \sum_{r=0}^{\infty} \mathbb{P}_k(X_r = i,\, T_k \geq r + 1).
\end{align*}
[claim:The inner sum equals $\rho_i$]
For every $i \in S$,
\begin{align*}
\sum_{r=0}^{\infty} \mathbb{P}_k(X_r = i,\, T_k \geq r + 1) = \rho_i.
\end{align*}
[/claim]
[proof]
We handle two cases.
**Case $i \neqeq k$.** For $i \neqeq k$ and any $r \geq 1$, the event $\{X_r = i\}$ (with $i \neqeq k$) implies $X_r \neqeq k$, so $T_k \neqeq r$. Therefore $\{T_k \geq r\} = \{T_k \geq r+1\} \cup \{T_k = r\}$ simplifies to $\{T_k \geq r\} = \{T_k \geq r+1\}$ on the event $\{X_r = i\}$. Hence
\begin{align*}
\mathbb{P}_k(X_r = i, T_k \geq r+1) = \mathbb{P}_k(X_r = i, T_k \geq r) \quad \text{for } r \geq 1.
\end{align*}
For $r = 0$: $\mathbb{P}_k(X_0 = i, T_k \geq 1) = \mathbb{P}_k(X_0 = i) = 0$ since $X_0 = k \neqeq i$. Also, $\mathbb{P}_k(X_0 = i, T_k \geq 0) = \mathbb{P}_k(X_0 = i) = 0$. So
\begin{align*}
\sum_{r=0}^{\infty} \mathbb{P}_k(X_r = i, T_k \geq r+1) = \sum_{r=0}^{\infty} \mathbb{P}_k(X_r = i, T_k \geq r) = \sum_{r=1}^{\infty} \mathbb{P}_k(X_r = i, T_k \geq r) = \rho_i.
\end{align*}
**Case $i = k$.** The $r = 0$ term is $\mathbb{P}_k(X_0 = k, T_k \geq 1) = 1$ (since $X_0 = k$ under $\mathbb{P}_k$, and $T_k \geq 1$ by definition). For $r \geq 1$: $\{X_r = k, T_k \geq r+1\}$ requires the chain to be at $k$ at time $r$ but to have first returned to $k$ after time $r$, which means $T_k > r$; but $X_r = k$ implies $T_k \leq r$. This is a contradiction, so $\mathbb{P}_k(X_r = k, T_k \geq r+1) = 0$ for all $r \geq 1$. Hence
\begin{align*}
\sum_{r=0}^{\infty} \mathbb{P}_k(X_r = k, T_k \geq r+1) = 1 = \rho_k.
\end{align*}
[/proof]
Substituting the claim into the expression for $\rho_j$:
\begin{align*}
\rho_j = \sum_{i \in S} p_{i,j} \, \rho_i,
\end{align*}
which is exactly $\rho = \rho P$.[/step]