Correct version of an inequality Does any one knows the correct version of the inequality:
Let $a_1,\cdots,a_n\in \mathbb R$ and $b_1,\cdots,b_n\in \mathbb R$  with $\sum_{j=1}^n b_j=0$. Then
$$
\left(\sum_{j=1}^n a_jb_j \right)^2\leq \left(\sum_{j=1}^n a_j^2-\left(\sum_{j=1}^n a_j\right)^2\right)\sum_{j=1}^n b_j^2\,,
$$
proposed in https://link.springer.com/content/pdf/10.1007%2F978-1-4939-1926-0_2.pdf Exercise 2.51, page 23?
Indeed, the statement as such is incorrect. e.g. taking $n=2$ and $a_1=a_2=1$, the statement yields
$$
0\leq 2-2^2.
$$
 A: I believe the issue is that rather than sums, those should be means. That is,
$$
\left[\frac{1}{n}\sum_{j=1}^na_j^2 - \left(\frac{1}{n}\sum_{j=1}^na_j\right)^2\right]\left(\frac{1}{n}\sum_{j=1}^n b_j^2\right)\ge\left(\frac{1}{n}\sum_{j=1}^na_jb_j\right)^2
$$
This can also be written more compactly in vector notation:
$$
 \left[\frac{|\mathbf{a}|^2}{n}-\left(\frac{\mathbf{a}\cdot\mathbf{1}}{n}\right)^2\right]\frac{|\mathbf{b}|^2}{n}\ge \left(\frac{\mathbf{a}\cdot\mathbf{b}}{n}\right)^2,
$$
where $\mathbf{1}$ is the vector of all $1$'s We now use the  well-known statistics identity $\langle (x - \langle x\rangle)^2\rangle = \langle x^2\rangle - \langle x\rangle ^2$ to deduce that $|\mathbf{a}|^2/n - (\mathbf{a}\cdot \mathbf{1}/n)^2 = |\mathbf{a}-(\mathbf{a}\cdot\mathbf{1}/n)\mathbf{1}|^2/n$. Then we apply Cauchy-Schwartz to the LHS:
\begin{multline}
\left[\frac{|\mathbf{a}|^2}{n}-\left(\frac{\mathbf{a}\cdot\mathbf{1}}{n}\right)^2\right]\frac{|\mathbf{b}|^2}{n} = \frac{1}{n^2}\left|\mathbf{a}-\left(\frac{\mathbf{a}\cdot\mathbf{1}}{n}\right)\mathbf{1}\right|^2|\mathbf{b}|^2\\\ge\frac{1}{n^2}\left[\mathbf{a}\cdot\mathbf{b}-\frac{(\mathbf{a}\cdot\mathbf{1})(\mathbf{1}\cdot\mathbf{b})}{n}\right]^2 = \left(\frac{\mathbf{a}\cdot\mathbf{b}}{n}\right)^2,
\end{multline}
where the last equality comes from $\sum_{j=1}^n b_j = 0$, i.e., $\mathbf{1}\cdot\mathbf{b} = 0$.
