Q:

AN application of Schwarz inequality.

In the proof of Chung-Erd$\ddot{o}$s inequality:

Let $X_k=1_{A_k}$,then:
$$(\mathbb E(\sum_{i=1}^nX_k))^2\le\mathbb P(\sum_{i=1}^nX_k\gt0)\mathbb E[(\sum_{i=1}^nX_k)^2]$$
The textbook said this inequality is obtained by Schwarz inequality.
But I have tried:
$$(\mathbb E(\sum_{i=1}^nX_k))^2\le(\sum_{k=1}^n1^2)(\sum^n_{k=1}(\mathbb EX_k)^2)??$$
It seems that I'm going on the wrong direction.What should I do next?

A:

Let $X=\mathbf{1}_{A_1\cup\ldots\cup A_n}$ and $\langle a, b\rangle = \mathbb{E}[a b]$ for random variables $a,b$.  Then by the Schwarz inequality
$$\mathbb{E}[\sum_{k=1}^nX_k]^2=\langle X,\sum_{k=1}^nX_k\rangle^2\leq \langle X,X\rangle\langle \sum_{k=1}^nX_k,\sum_{k=1}^nX_k\rangle = \mathbb{E}[X]\cdot\mathbb{E}\left[(\sum_{k=1}^nX_k)^2\right]$$
Note that $\mathbb{E}[X]=\mathbb{P}[A_1\cup\ldots\cup A_n]$.

