Prove $\overline{s}_T^2+4\sum_{n=0}^{T-1}\overline{s}_n(s_{n+1}-s_n)\leq 4s_T^2$ I am working on a paper which gives a novel/trajectorial proof of Doob's maximal inequalities you can find it here. I tried to prove the following inequality given on page 2 of the paper. $$\overline{s}_T^2+4\sum_{n=0}^{T-1}\overline{s}_n(s_{n+1}-s_n)\leq 4s_T^2 $$ where $s_0,...,s_T$ are real numbers and $\overline{s}_n=\max\limits_{i\in [n]}s_i$. The author suggests to rearrange the terms and to complete the squares, but for some reason I am stuck and I don't know how to do this. Any help is very much appreciated.
 A: Here's what the authors probably had in mind: Let's first rewrite the sum on the left-hand side of your inequality. Let $0=m_0<m_1<\dotsb <m_r\leq T-1$ be those indices for which $s_{m_i}=\overline{s}_{m_i}$ (i.e., the $s_{m_i}$ are the "peaks" in the sequence $s_0,\dotsc,s_{T-1}$). For $0\leq i< r$, $$\sum_{n=m_i}^{m_{i+1}-1}\overline{s}_n(s_{n+1}-s_n)=\sum_{n=m_i}^{m_{i+1}-1}s_{m_i}(s_{n+1}-s_n)=s_{m_i}s_{m_{i+1}}-s_{m_i}^2,$$ where we use that the sum in the middle is a telescoping sum. Similar for $\sum_{n=m_i}^{T-1}\overline{s}_n(s_{n+1}-s_n)$. This allows us to rewrite the left-hand side of your  inequality as follows: \begin{align*}\overline{s}_T^2+4\sum_{n=0}^{T-1}\overline{s}_n(s_{n+1}-s_n)&=\overline{s}_T^2+4\sum_{i=0}^{r-1}s_{m_i}s_{m_{i+1}}+4s_{m_r}s_T-4\sum_{i=0}^{r}s_{m_i}^2\\ &\leq \overline{s}_T^2+4s_{m_r}s_T-2s_{m_0}^2-2s_{m_r}^2,\end{align*} where the estimate follows from $4s_{m_i}s_{m_{i+1}}-2s_{m_i}^2-2s_{m_{i+1}}^2=-2(s_{m_i}-s_{m_{i+1}})^2\leq 0$ applied for $i=0,\dotsc,r-1$. Now distinguish two cases:

*

*$s_T=\overline{s}_T$. Then $\overline{s}_T^2+4s_{m_r}s_T-2s_{m_0}^2-2s_{m_r}^2=3s_T^2-2(s_T-s_{m_r})^2-2s_{m_0}^2\leq 4s_T^2$.

*$s_T< \overline{s}_T$. Then necessarily $\overline{s}_T=s_{m_r}$ and we can estimate $$\overline{s}_T^2+4s_{m_r}s_T-2s_{m_0}^2-2s_{m_r}^2=4s_T^2-(s_{m_r}-2s_T)^2-2s_{m_0}^2\leq 4s_T^2.$$
In either case, the desired inequality follows.
