Let $$A$$ be a positive-definite Hermitian operator. The following inequality holds for any pair of states $$| u \rangle$$ and $$| v \rangle$$: $\big| \langle u | A | v \rangle \big|^2 \le \langle u | A | u \rangle \langle v | A | v \rangle \,.$ This is the Cauchy-Schwarz inequality (in a generalized form). In the case when $$A$$ is the identity operator, the inequality reads $\big| \langle u | v \rangle \big|^2 \le \langle u | u \rangle \langle v | v \rangle \,.$ Proof: Consider the state $| \psi \rangle = z | u \rangle + | v \rangle \,,$ where $$z$$ is a complex number. Since $$A$$ is positive-definite, we have $\langle \psi | A | \psi \rangle \ge 0 \,.$ This can be rewritten as $\Big( \langle u | z^* + \langle v | \Big) A \Big( z | u \rangle + | v \rangle \Big) \ge 0 \,,$ or $\langle u | A | u \rangle |z|^2 + \langle u | A | v \rangle z^* + \langle v | A | u \rangle z + \langle v | A | v \rangle \ge 0 \,.$ Since $$A^{\dagger} = A$$, the last inequality becomes $\langle u | A | u \rangle |z|^2 + \langle u | A | v \rangle z^* + \langle u | A | v \rangle^* z + \langle v | A | v \rangle \ge 0 \,.$ Let $$z = x + i y$$, where $$x$$ and $$y$$ are real. Then, $\langle u | A | u \rangle \left( x^2 + y^2 \right) + 2 \operatorname{Re} \langle u | A | v \rangle x + 2 \operatorname{Im} \langle u | A | v \rangle y + \langle v | A | v \rangle \ge 0 \,.$ Completing the squares in $$x$$ and $$y$$, we get $\left( x + \frac{\operatorname{Re} \langle u | A | v \rangle}{\langle u | A | u \rangle} \right)^2 + \left( y + \frac{ \operatorname{Im} \langle u | A | v \rangle}{\langle u | A | u \rangle} \right)^2 + \frac{\langle u | A | u \rangle \langle v | A | v \rangle - \big| \langle u | A | v \rangle \big|^2}{\langle u | A | u \rangle^2} \ge 0 \,.$ The last inequality is fulfilled for all $$x$$ and $$y$$ if and only if $\langle u | A | u \rangle \langle v | A | v \rangle - \big| \langle u | A | v \rangle \big|^2 \ge 0 \,,$ which concludes the proof.