I'm looking at the proof of Wald's identity on https://inst.eecs.berkeley.edu/~ee126/fa17/wald.pdf.
On the last page, under Theorem 2, I follow the proof up to: \begin{align} \sum_{i=1}^{\infty} E[E[X_n \mathbb{1}\{N \geq n\}|X_1, \ldots, X_{n-1}]] \end{align}
But I don't understand how the paragraph that follows allows us to write \begin{align} \sum_{i=1}^{\infty} E[\mathbb{1}\{N \geq n\} E[X_n |X_1, \ldots, X_{n-1}]] \end{align}
Where the indicator random variable is pulled out of the inner expectation, which is a random variable. I understand that $\mathbb{1}\{X_n \geq n\}$ is independent of $X_n$, and in general, if $A$ and $B$ are independent random variables, then we know $P(A,B) = P(A)P(B)$ and $E[XY] = E[X]E[Y]$, and $E[XY|D] = E[X|D]E[Y|D]$. But in the above, why is $\mathbb{1}\{N \geq n\}$ no longer conditioned on $X_1, \ldots, X_{n-1}$?
As the definition of stopping time, the event $\{N ≤ n-1\}$ is completely determined by $X_1, \cdots , X_{n-1}$, that is $\{N ≤ n-1\}$ can be written as $g(X_1, \cdots , X_n)$.
And for condition expectation, $E[f(X)g\mid X]=f(X)E[g\mid X]$ so you get the next step.