Application of optional sampling theorem in a proof of the Burkholder-Davis-Gundy inequalitiy 
(Doob's optional sampling theorem ):Let $(X_t)_{t \in \mathbb{R}_+}$ be a right continuous martingale and $\tau \text{ and} \sigma $ be two stopping times such that $\sigma \leq \tau$ a.s. If we assume that one of the following conditions hold


*

*$X$ is closed

*$\tau$ is bounded


Then $X_{\tau}$,$X_{\sigma} \in L^1$ and 
$E[X_{\tau} \mid \mathbb{F}_{\sigma}]=X_{\sigma}$.
I don't see why the above theorem implies the last statement in the attached picture. Can you please give me a hint why?
 A: Rewriting the first formula of the proof gives
$$|M_t|^q = \underbrace{\int_0^t q \, \text{sgn}(M_s) |M_s|^{q-1} \, dM_s}_{=:X_t} + \underbrace{\frac{1}{2} q (q-1) \int_0^t |M_s|^{q-2} d\langle M \rangle_s}_{=:A_t}. \tag{1}$$
Since $(M_t)_{t \geq 0}$ is a local martingale with continuous sample paths, we know that $(X_t)_{t \geq 0}$ is a local martingale with continuous sample paths. Define a sequence of stopping times by
$$\sigma_n := \inf\{t \geq 0; |M_t| \geq n\}.$$
Then, $\sigma_n \uparrow \infty$ as $n \to \infty$, $|M_{t \wedge \sigma_n}| \leq n$, and therefore it is not difficult to see that $(\sigma_n)_{n \in \mathbb{N}}$ is a localizing sequence for $(X_t)_{t \geq 0}$ (i.e. $(X_{t \wedge \sigma_n})_{t \geq 0}$ is a martingale for each $n \in \mathbb{N}$). As $\tau$ is a bounded stopping time, Doob's optional stopping theorem yields
$$\mathbb{E}(X_{\tau \wedge \sigma_n} \mid \mathcal{F}_0) = X_0 = 0. \tag{2}$$
Applying Fatous lemma, we obtain
$$\begin{align*} \mathbb{E}(|M_{\tau}|^q \mid \mathcal{F}_0) &= \mathbb{E} \left( \lim_{n \to \infty} |M_{\tau \wedge \sigma_n}|^q \mid \mathcal{F}_0 \right) \\ &\leq \liminf_{n \to \infty} \mathbb{E}(|M_{\tau \wedge \sigma_n}|^q \mid \mathcal{F}_0) \\ &\stackrel{(1)}{=} \liminf_{n \to \infty} \left( \mathbb{E}(X_{\tau \wedge \sigma_n} \mid \mathcal{F}_0) + \mathbb{E}(A_{\tau \wedge \sigma_n} \mid \mathcal{F}_0)  \right) \\ &\stackrel{(2)}{=} \liminf_{n \to \infty} \mathbb{E}(A_{\tau \wedge \sigma_n} \mid \mathcal{F}_0) . \end{align*}$$
Finally, we can apply the monotone convergence theorem to conclude that
$$ \liminf_{n \to \infty} \mathbb{E}(A_{\tau \wedge \sigma_n} \mid \mathcal{F}_0) = \frac{1}{2} q(q-1) \mathbb{E} \left( \int_0^{\tau} |M_t|^{q-2} \, d\langle M \rangle_t \mid \mathcal{F}_0 \right).$$
Combining both calculations finishes the proof.
