TITLE: Doob-style second moment martingale inequality
QUESTION [10 upvotes]: Let $\{X_k\}_{k=0}^{\infty}$ be a martingale, supposing
  $X_0 = 0$ and $E[{X_n}^2] <\infty$. Prove that $$P\left(\max_{1\le k
 \le n} X_k \ge r \right) \le \frac{E[{X_n}^2]}{E[{X_n}^2] + r^2}$$ for
  all $r>0$.

I have tried to emulate the proof of the Doob maximal inequality as follows. Let $T = \min\{k\, : \, X_k \ge r\}$. Then by Jensen's inequality, $\{{X_k}^2\}$ is a submartingale, so that $E[{X_{T\wedge n}}^2] \le E[{X_n}^2]$ via optional stopping theorem. Since $${X_{T\wedge n}}^2 \ge \mathbb{1}_{T\le n} r^2 + \mathbb{1}_{T> n} {X_n}^2$$ it follows $$E[{X_{T\wedge n}}^2] \ge r^2 P(T\le n) + E[{X_n}^2 \mathbb{1}_{T>n}] $$ If this is the right approach, then we next will have to prove $E[{X_n}^2 \mathbb{1}_{T>n}] \ge P(T\le n) E[{X_n}^2]$ but I am not able to show this. I have tried Cauchy-Schwarz and Jensen's, both to no avail. So I expect this approach is too weak.
Another observation I made is the following: By Cauchy-Schwarz, $$E[X_{T\wedge n} \mathbb{1}_{T>n} ]^2 \le E[{X_{T\wedge n}}^2 \mathbb{1}_{T>n}] P(T>n) \le r^2 P(T>n)^2$$ since $X_{T\wedge n} \le r$ when $T>n$. But also $$E[X_{T\wedge n} \mathbb{1}_{T> n} ]^2 = E[X_{T\wedge n} \mathbb{1}_{T\le n} ]^2\ge E[r\cdot \mathbb{1}_{T\le n}]^2 = r^2 P(T\le n)^2$$ by using optional stopping theorem to see $E[X_{T\wedge n}] = E[X_0] = 0$. Thus $P(T\le n) \le P(T>n)$. But I don't know how to proceed from here. Any help/hints are much appreciated!

REPLY [12 votes]: $\{X_k\}$ cannot be a nonnegative MTG with $X_0=0$. So, I assume it is just a MTG.
Using the original Doob's weak inequality, for some $z >-r$ (and noticing that $\mathsf{E}X_n=0$):

\begin{align}
\mathsf{P}\!\left(\max_{1\le k\le n}{X_k}\ge r\right)&\le \mathsf{P}\!\left(\max_{1\le k\le n}{(X_k+z)^2}\ge (r+z)^2\right) \\
&\le\frac{1}{(r+z)^2}\mathsf{E}[X_n+z]^2 \\
&=\frac{1}{(r+z)^2}\left(\mathsf{E}X_n^2+z^2\right).
\end{align}

Optimizing the RHS over $z$ we get

$$
\frac{d}{dz}\frac{1}{(r+z)^2}\left(\mathsf{E}X_n^2+z^2\right)=\frac{2z}{(r+z)^2}-\frac{2\left(\mathsf{E}X_n^2+z^2\right)}{(r+z)^3}=0 \Rightarrow
$$
$$
z^*=r^{-1}\mathsf{E}X_n^2.
$$

Finally,

$$
\mathsf{P}\!\left(\max_{1\le k\le n}{X_k}\ge r\right)\le \frac{1}{\left(r+r^{-1}\mathsf{E}X_n^2\right)^2}\left(\mathsf{E}X_n^2+[r^{-1}\mathsf{E}X_n^2]^2\right)=\frac{\mathsf{E}X_n^2}{\mathsf{E}X_n^2+r^2}.
$$