Q:

A computation in a Hilbert space

Can someone give me an idea, why $\forall x: \left<\sum_j \lambda_j \left< x,e_j\right> e_j,x\right>\geq 0$, where  the $\lambda_j$'s are fixed, implies that all $\lambda_j$ are $\geq0$,?
(The $x$'s belong to a Hilbert space,the $e_j$'s are an orthonormal basis and the $\lambda_j$'s are real or complex .)

A:

I understand that this inequality is to hold for all $x$. (Otherwise, $x=(1,1)$ with $\lambda_1=1,\lambda_2=-1$ witnesses that it is false.)
Suppose that there is some $\lambda_i$ not real or not greater than or equal to zero. Then for $x=e_i$ we have
$$\langle\sum_j\lambda_j\langle x,e_j\rangle e_j, x\rangle=\langle \lambda_i e_i, e_i\rangle=\lambda_i \not\geq 0$$
so we have a contradiction.

