Optional sampling theorem with a.s. finite stopping time I'm trying to prove the following generalized version of Doob's optional sampling theorem: 

Let $X$ be a square integrable martingale with respect to a filtration $\mathbb F = \left\{ \mathcal F_n \right\}_{n \in \mathbb N}$ with square variation process $\langle X \rangle$. Let $\tau$ be a finite stopping time, and suppose $\mathbb E\left[\langle X \rangle_\tau \right] < \infty$. Then $$\mathbb E\left[ \left(X_\tau - X_0 \right)^2 \right] = \mathbb E\left[\langle X \rangle_\tau \right] \quad \textrm{and} \quad \mathbb E\left[ X_\tau \right] = \mathbb E\left[X_0 \right]$$

I know that $\langle X \rangle$ is the unique predictable process for which $\left(X_n^2 - \langle X \rangle_n\right)_{n \in \mathbb N}$ is a martingale, and it can be expressed in equations as $$\langle X \rangle = \sum_{i=1}^n \mathbb E\left[ \left(X_i - X_{i-1}\right)^2 \bigg| \mathcal F_{i-1}\right] \quad \textrm{and} \quad \mathbb E\left[\langle X\rangle_n\right] = \mathbf{Var}\left[X_n - X_0 \right].$$
And I know that if $\tau$ is bounded, then $\mathbb E\left[X_\tau\right] = \mathbb E\left[X_0\right]$. So I know in particular that $\mathbb E\left[X_{\tau \wedge T}\right] = \mathbb E\left[X_0\right]$ for every $T \in \mathbb N$. Clearly $X_{\tau \wedge T} \mathbb 1_{\{\tau = N\}} \to X_N \mathbb 1_{\{\tau = N\}}$ as $T \to \infty$, and $$\left|X_{\tau \wedge T} \mathbb 1_{\{\tau = N\}}\right| \leq \max_{1 \leq t \leq N} |X_t|,$$
so by dominated convergence, 
$$
\mathbb E\left[ X_{\tau \wedge T} \mathbb 1_{\{\tau = N\}}\right] \xrightarrow{T \to \infty} \mathbb E\left[ X_N \mathbb 1_{\{\tau = N\}}\right]
$$
for each $N \in \mathbb N$. I think, therefore, it follows that 
$$
\mathbb E\left[X_0\right] = \lim_{T \to \infty} \mathbb E\left[X_{\tau \wedge T}\right] = \lim_{T \to \infty} \sum_{N = 0}^\infty\mathbb E\left[X_{\tau \wedge T} \mathbb 1_{\{\tau = N\}} \right] = \sum_{N = 0}^\infty\mathbb E\left[X_{\tau} \mathbb 1_{\{\tau = N\}} \right] = \mathbb E\left[X_\tau\right].
$$
But I'm not sure if passing this limit through the sum is valid. It requires dominated convergence, i.e. that the terms $\mathbb E\left[X_{\tau \wedge T} \mathbb 1_{\{\tau = N\}} \right]$ are uniformly bounded by some function, but I don't know what that function is. Is there a better approach? 
 A: Hints:


*

*Show that for any square-integrable martingale $(M_n,\mathcal{F}_n)_{n \geq 1}$ it holds that $$\mathbb{E}(M_n M_m \mid \mathcal{F}_m) = M_m^2, \qquad m  \leq n.$$ Conclude that $$\mathbb{E}((M_n-M_m)^2) = \mathbb{E}(M_n^2-M_m^2) = \mathbb{E}(\langle M \rangle_n)- \mathbb{E}(\langle M \rangle_m), \qquad m \leq n.$$ 

*Using Step 1 for the martingale $M_n := X_{n \wedge \tau}$  gives $$\mathbb{E}((X_{n \wedge \tau}-X_{m \wedge \tau})^2) = \mathbb{E}(\langle X \rangle_{\tau \wedge n} - \langle X \rangle_{\tau \wedge m}), \qquad m \leq n.$$ Deduce from the monotonicity of $\langle X \rangle$ and the fact that $\mathbb{E}(\langle X \rangle_{\tau})< \infty$ that $$\mathbb{E}((X_{n \wedge \tau}-X_{m \wedge \tau})^2) \xrightarrow[]{m,n \to \infty} 0.$$

*By the completeness of $L^2(\mathbb{P})$ it follows that $Z := \lim_{n \to \infty} X_{n \wedge \tau}$ exists in $L^2(\mathbb{P})$. Show that $Z=X_{\tau}$.

*Combine the identities $$\mathbb{E}((X_{n \wedge \tau}-X_0)^2) = \mathbb{E}(\langle X \rangle_{\tau}) \quad \text{and} \quad \mathbb{E}(X_{\tau \wedge n}) = \mathbb{E}(X_0)$$ with Step 3 to prove the assertion.

