Stopped random walk is not uniformly integrable I know that in general Doob's Optional Stopping Theorem doesn't hold for unbounded stopping times, but that it does when the system up to the stopping time is uniformly integrable.
One counter example in the unbounded stopping time case is given by $X_n=\eta_1+\eta_2+\cdots+\eta_n$, where the $\eta_i$ are i.i.d. and take values $\pm 1$ each with probability 1/2. Let $\tau = \inf\{n: X_n=1\}$. In this case, $E[X_\tau] = 1\neq 0 = E[X_0]$.
However, I'm struggling to see why the martingale in this case is not UI. I have some intuition here: even though our stopping time is a.s. finite, it isn't uniformly bounded in $\omega$, so for any $M$ there are always a nontrivial set of paths $\omega$ for which $\tau>M$. This gives us more time and opportunity to have $X_n$ with nonzero probability of having $|X_n|>M$ before time $\tau$ (clearly, not possibly when $n<M$). Still I'd like to see a more formal run-down of what's going on here, and why this case is not uniformly integrable, if possible.
 A: It follows from the optional stopping theorem that $(X_{n \wedge \tau})_{n \in \mathbb{N}}$ is a martingale; in particular, $\mathbb{E}(X_{n \wedge \tau}) = \mathbb{E}(X_0)=0$. Since \begin{align*} 0 = \mathbb{E}(X_{\tau \wedge n}) &= \mathbb{E}(X_{\tau \wedge n} 1_{\{\tau \leq n\}}) + \mathbb{E}(X_{\tau \wedge n} 1_{\{\tau>n\}}) \\ & = 1 \cdot \mathbb{P}(\tau \leq n) + \mathbb{E}(X_{\tau \wedge n} 1_{\{\tau>n\}}) \end{align*} we find that $$\mathbb{E}(X_{\tau \wedge n} 1_{\{\tau>n\}}) = - \mathbb{P}(\tau \leq n). \tag{1}$$
On the other hand, we have for any fixed $R>1$ that
\begin{align*} \mathbb{E}(X_{\tau \wedge n} 1_{\{\tau>n\}}) &= \mathbb{E}(X_{\tau \wedge n} 1_{\{X_{\tau \wedge n} \leq -1\}}) \\ &= \mathbb{E}(X_{\tau \wedge n} 1_{\{-R < X_{\tau \wedge n} \leq -1\}})  + \mathbb{E}(X_{\tau \wedge n} 1_{\{X_{\tau \wedge n} \leq -R\}}) \\
&\geq -R \mathbb{P}(\tau>n) +  \mathbb{E}(X_{\tau \wedge n} 1_{\{X_{\tau \wedge n} \leq -R\}}). \tag{2} \end{align*}
Hence,
$$\mathbb{E}(X_{\tau \wedge n} 1_{\{X_{\tau \wedge n} \leq -R\}}) \leq R \mathbb{P}(\tau>n) - \mathbb{P}(\tau \leq n) \xrightarrow[]{n \to \infty} 0-1 = -1.$$
In particular, there exists for any $R>0$ some $n \gg 1$ sufficiently large such that
$$\mathbb{E}(X_{\tau \wedge n} 1_{\{X_{\tau \wedge n} \leq -R\}}) \leq - \frac{1}{2},$$
i.e.
$$\mathbb{E}(|X_{\tau \wedge n}| 1_{\{X_{\tau \wedge n} \leq -R\}}) \geq \frac{1}{2}$$
which clearly shows that $(X_{n \wedge \tau})_{n \in \mathbb{N}}$ fails to be uniformly integrable.
Remark: A useful criterion to prove that a sequence $(Y_n)_n$ fails to be uniformly integrable is to show that $(Y_n)_{n \in \mathbb{N}}$ is unbounded in $L^1$, i.e. $\sup_{n \in \mathbb{N}} \mathbb{E}(|Y_n|)<\infty$. However, we cannot use this criterion here since $(X_{n \wedge \tau})_{n \in \mathbb{N}}$ is bounded in $L^1$.
