How can a stopping time be independent of its stochastic process? I was reading about a special case of Wald's equation, which led me to the following question:

If $X_t$ is a sequence of iid RV's, and $\tau$ is a stopping time for this discrete stochastic process, how is it possible for $\tau$ to be independent of $X_i$'s? Wouldn't this violate the definition of a stopping time which says that we should be able to tell if the stopping time is equal to $k$ by looking only at $X_1$,...,$X_k$? Doesn't a stopping time by definition depend on the process?

I'm asking because I saw an example of an independent stopping time in my text: do a random walk on the integers, and at every step flip a coin, when the coin is heads for the first time, stop. But I cannot see why this is a stopping time because if you were given $X_1,...,X_k$ here, you don't have enough information to conclude whether $k$ is the time to stop.
Indeed $\tau$ need not be independent of the process $\{X_n\}$. In the example where $\mathbb P(X_1=1)=1-\mathbb P(X_1=-1)=p$ and $$\tau=\inf\{n&gt;0:X_n=1\}, $$ we have $$\tau = \sum_{n=1}^\infty p(1-p)^{n-1}\mathsf 1_{\{X_n=1\}\cap\{X_{n-1}=\cdots=X_1=-1\}}, $$ so $\sigma(\tau)\subset\sigma\left(\bigcup_{n=1}^\infty X_n \right)$ as $\tau$ is a measurable function of $\{X_n\}$.

In general, a nonnegative integer-valued random variable $T$ is a stopping time with respect to the filtration $\{\mathcal F_n\}$ if $\{T= n\}\in\mathcal F_n$ for all $n$. This implies that $$\sigma(T)=\sigma\left(\bigcup_{n=0}^\infty \{T=n\}\right)\subset\sigma\left(\bigcup_{n=0}^\infty \mathcal F_n\right),$$ so $T$ is independent of $\{X_n\}$ if and only if $\mathbb P(A)\in\{0,1\}$ for all $A\in\sigma(T)$, i.e. $\mathbb P(T=n)=1$ for some $n$.
The crux is in the measurability condition. Independent T is not adapted to the natural filtration of the process, of course, rather requires additional randomisation. You can think of larger filtration, generated at step n by X_1,...,X_n and another independent variable Y (which can be Y=T itself), then T qualifies as so-called randomised stopping time. Note that for the proof of Wald's identity we only need independence of {T>n} and X_j's with j>n.