Question about a step in the proof of the Cauchy-Schwarz inequality in $\mathbb{C}$ I'm studying the proof of the Cauchy-Schwarz inequality, which states that for complex numbers $z_1,\ldots. z_n,w_1,\ldots, w_n$ we have $$ \Big\vert\sum_{j=1}^nz_jw_j \Big\vert^2\le \sum_{j=1}^n\vert z_j\vert^2 \sum_{j=1}^n\vert w_j\vert^2 $$
For any $\lambda\in\mathbb{C}$ we have $0\le\sum_{j=1}^n\vert z_j-\lambda \overline{w_j} \vert^2, $ and the right hand side can be expanded into 
$$
\Big(\sum_{j=1}^n\vert w_j\vert^2\Big)\vert \lambda\vert^2-2\text{Re}\,\Big(\bar\lambda\sum_{j=1}^n z_jw_j\Big)+\Big(\sum_{j=1}^n\vert z_j\vert^2\Big).
$$ 
The proof then follows by taking $\lambda=\frac{\sum_{j=1}^nw_jz_j}{\sum_{j=1}^n\vert w_j \vert^2}$. I see that this choice of $\lambda$ works but where does this choice come from?
 A: You can think of this as a vector problem in $\mathbb{C}^{n}$. You're trying to minimize
$$
           F(\lambda)=\|z-\lambda w\|^{2}=\sum_{j=1}^{n}|z_{j}-\lambda w_{j}|^{2}.
$$
By finding the $\lambda_{0}$ such that $F(\lambda) \ge F(\lambda_{0})$ you get the tightest inequality $F(\lambda_{0}) \ge 0$, which turns out to be the Cauchy-Schwarz inequality, and equality holds iff $z=\lambda_{0} w$.
This is the Complex version of the old Calculus problem of projecting $z$ onto the complex line $l=\{ \lambda w : \lambda \in \mathbb{C}\}$. The closest point projection of a point onto the line is the same as the orthogonal projection. That is,
$$
              (z-\lambda w)\cdot w = 0,
$$
where "$\cdot$" is the vector dot product in $\mathbb{C}^{n}$ given by $a\cdot b=\sum_{j}a_{j}\overline{b_{j}}$. Assuming $w$ is not the $0$ vector,
$$
              z\cdot w = \lambda |w|^{2} \implies \lambda = \frac{z\cdot w}{\|w\|^{2}}
        = \frac{\sum_{j=1}^{n}z_{j}\overline{w_{j}}}{\sum_{j=1}^{n}|w_{j}|^{2}}.
$$
Now plug $\lambda=\frac{z\cdot w}{w\cdot w}$ in to get minimum distance of $z$ to the complex line $\{ \lambda w : \lambda \in\mathbb{C}\}$:
$$
%% \begin{align}
    0 \le \|z-\lambda w\|^{2}  =(z-\lambda w)\cdot(z-\lambda w) =\|z\|^{2} - \frac{|w\cdot z|^{2}}{\|w\|^{2}}
%%       & =(z-\lambda w)\cdot z-(z-\lambda w)\cdot w \\
%%       & =(z-\lambda w)\cdot z \\
%%       & = \|z\|^{2}-\lambda w\cdot z \\
%%       & = \|z\|^{2} - \frac{z\cdot w}{\|w\|^{2}}(w\cdot z) \\
%%       & = \|z\|^{2} - \frac{|w\cdot z|^{2}}{\|w\|^{2}}.
%% \end{align}
$$
Therefore, $|z\cdot w| \le \|z\|\|w\|$, and equality holds iff $z=\lambda w$ is already on the line.
A: As
$$
a\lambda^2+b\lambda+c=\Big(\sum_{j=1}^n\vert w_j\vert^2\Big) \lambda^2-2\text{Re}\,\Big(\sum_{j=1}^n z_jw_j\Big)\lambda+\Big(\sum_{j=1}^n\vert z_j\vert^2\Big)\ge 0,
$$ 
for all $\lambda\in\mathbb R$, it means that the roots of $ax^2+bx+c$ can not be real and unequal, which implies that the discriminant is non-positive:
$$
\Delta=\text{Re}\,\Big(\sum_{j=1}^n z_jw_j\Big)^{\!2}-\Big(\sum_{j=1}^n\vert w_j\vert^2\Big)\Big(\sum_{j=1}^n\vert z_j\vert^2\Big)\le 0.
$$
