# What are the assumptions for applying Wald's equation with a stopping time

I am trying to understand the assumptions under which I am allowed to apply Wald's equation for a sum of a random number $N$ of random variables $X_n$, $1\leq n\leq N$. There seem to be several versions of Wald's equation, and I am interested in the case where $N$ is a stopping time and the $X_t$ are not IID.

For example, assume that we have a simple random walk $X_n = X_{n-1} + Z_n - 1$, with $X_0 = 1$ and all $Z_n$ are IID binomial. Assume that I define some stopping time $N$ for $(X_n)$ which has finite expectation. One requirement for Wald's equation is that $\mathbb{E}[X_n 1_{\{N \geq n\}}] = \mathbb{E}[S_n] P(N\geq n)$ for all $n$. Is this assumption automatically fulfilled for the above random walk because $N$ is a stopping time (i.e., the indicator random varible $1_{\{N=n\}}$ is a function of $X_1, \ldots, X_n$)? My confusion comes from the fact that sometimes these requirements are stated in terms of filtrations, which I am not familiar with. For example, $N$ has to be a stopping time with respect to a filtration, and $X_n$ and $\mathcal{F}_{n-1}$ are independent for every $n$ (this is from Wikipedia for example). How do I define a filtration here and how do I check if $X_n$ is independent of $\mathcal{F}_{n-1}$? Is it possible to restate this somehow without resorting to a filtration?

Suppose $X_n = X_{n-1}$ with probability .5, and $X_n = 0$ with probability .5. We set $X_0 \ne 0$.
Let $N$ be the first $n$ such that $X_n = 0$. $N$ is a stopping time because $1_{\{N=n\}}$ is a function of $(X_1,...,X_n)$ only.
Then we have $\mathbb{E}[X_n 1_{\{N \ge n\}}] = \mathbb{E}[X_{n}]$ because $X_n \ne 0$ implies $1_{\{N \ge n\}} = 1$, but clearly $\mathbb{E}[X_{n}] > \mathbb{E}[X_{n}] P(N \ge n)$ for $n \ge 2$.
For the non-IID case the requirement $\mathbb{E}[X_n 1_{\{N \geq n\}}] = \mathbb{E}[X_n] P(N\geq n)$ is also automatically satisfied, since $1_{\{N \geq n\}}=1-1_{\{\cup_{m=1}^{n-1} (N = m) \}}$ is independent of $X_n$ by the definition of stopping time. However, $\mathbb{E}[S_n]=\mathbb{E}[X_1]\mathbb{E}[N]$ is not true anymore. The only thing that can be said is that $\mathbb{E}[S_n]=\mathbb{E}[\sum_{n=1}^N \mathbb{E}[X_n]]$.