Proof that if expectation of an operator is zero for all vectors, then the operator itself must be zero I was attending a Quantum Mechanics lecture when the instructor casually mentioned the following theorem:

$\langle \alpha \rvert A \rvert \alpha \rangle = 0 ~\forall \alpha \implies A=0$, where $A$ is an operator and $\rvert\alpha\rangle$ is an arbitrary ket in the complex Hilbert space. 

I have always assumed that the above theorem was 'obvious', but on second thought, it doesn't seem to be easy or trivial to prove. I tried looking at various sources for the theorem, but it seems to be surprisingly difficult to find this theorem or proof anywhere.
I would be very glad if someone would point me towards the proof of the theorem, and provide a small outline of it if possible.
 A: Pick any orthonormal basis $\lvert \psi_i\rangle$ of our Hilbert space. Then $\langle \psi_i\vert A \vert \psi_i \rangle = 0$ for all $i$ by assumption, and for $\lvert \phi_{ij}(a,b)\rangle := a\lvert \psi_i\rangle + b\lvert \psi_j\rangle$ we find
$$ \langle \phi_{ij} \vert A \vert \phi_{ij}\rangle = a^\ast b \langle \psi_i \vert A \vert \psi_j\rangle + ab^\ast \langle \psi_j \vert A \vert \psi_i\rangle = 0,$$
which for $a,b = 1$ implies
$$ \langle \psi_i \vert A \vert \psi_j \rangle = - (\langle \psi_j \vert A \vert \psi_i\rangle )^\dagger = - \langle \psi_i \vert A^\dagger \vert \psi_j \rangle $$
which means that $A = -A^\dagger$, i.e. $A$ is anti-Hermitian. Since anti-Hermitian operators are in particular normal, they are diagonalizable by the spectral theorem, and therefore $\langle \alpha \vert A \vert \alpha\rangle  = 0$ means that all eigenvalues are 0, i.e. the diagonalization of $A$ is the zero matrix, which also means $A = 0$.
Note that the application of the spectral theorem relies on the space being a complex vector space, and that the assertion would be false over a real vector space - $\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$ is a counterexample on $\mathbb{R}^2$ (but not on $\mathbb{C}^2$, since its expectations values do not vanish for all vectors there).
A: 1) Let us consider any $|u\rangle$ and $|v\rangle$.
We have:
$$
\langle u|A|u\rangle=0,~~~\langle v|A|v\rangle=0.
$$
Let us consider $|u\rangle+|v\rangle$:
$$
(\langle u|+\langle v|)A(|u\rangle+|v\rangle)=0,
\\
0=(\langle u|+\langle v|)A(|u\rangle+|v\rangle)=\langle u|A|u\rangle+\langle u|A|v\rangle+\langle v|A|u\rangle+\langle v|A|v\rangle=\langle u|A|v\rangle+\langle v|A|u\rangle
$$
Thus we get:
$$
\langle u|A|v\rangle=-\langle v|A|u\rangle.
$$
Similarly, we consider $|u\rangle+i|v\rangle$:
$$
0=(\langle u|-i\langle v|)A(|u\rangle+i|v\rangle)=\langle u|A|u\rangle+i\langle u|A|v\rangle-i\langle v|A|u\rangle+\langle v|A|v\rangle=i\langle u|A|v\rangle-i\langle v|A|u\rangle.
$$
Consequently,
$$
i\langle u|A|v\rangle=i\langle v|A|u\rangle,
\\
\langle u|A|v\rangle=\langle v|A|u\rangle.
$$
From
$$
\langle u|A|v\rangle=-\langle v|A|u\rangle,~~~\langle u|A|v\rangle=\langle v|A|u\rangle,
$$
we get
$$
\langle u|A|v\rangle=0=\langle v|A|u\rangle
$$
for any $|u\rangle$ and $|v\rangle$.
2) Let us consider any $|u\rangle$ and $|v\rangle=A|u\rangle$.
$$
0=\langle v|A|u\rangle=\langle v|v\rangle.
$$
This is possible if and only if $|v\rangle=0$.
For any $|u\rangle$ we get:
$$
A|u\rangle=0.
$$
And this is the definition of $A=0$.
A: I will give a semi mathematical point of view, and a completely intuitive point of view.
Mathematical(ish) POV
We have $$\langle \alpha |A|\alpha\rangle = 0 \  \ \forall |\alpha\rangle$$
Switching to the matrix view of operators we can say
$$A = \sum \limits_{i,j} a_{ij} |a_i\rangle\langle a_j|$$
Thus
$$|a_n|^2 ||\langle \alpha|a_n\rangle||^2 = 0 $$
Besides the trivial case the inner product will not be 0, but we also have the condition from the axioms of QM that $|a_n|^2 \geq 0 $. Thus the only way for this to be true for an arbitrary $|\alpha\rangle$ is for the coefficients to be $0$ which is equivalent to saying $A = 0$.
(Another way of seeing this is since $|\alpha \rangle$ is arbitrary, choose it to be one of the eigenvectors, $|a_n\rangle$. Each time you do this the only solution is that the coefficient is 0. Repeat $\forall n$ and you'll see that $A$ must be the $0$ operator.
A: I am a little late on this, the correct mathematical theorem (in the sense implied by @Ryan Unger in the comments) states:

Theorem: If $A:D(A)\subsetneq \mathcal{H}\rightarrow \mathcal{R}(A)\subset\mathcal{H}$ is a linear operator in a complex separable Hilbert space, then we have the following equivalence:
$$ \forall \psi\in D(A), \langle \psi,A\psi\rangle =0 \Rightarrow A\equiv \hat{0}_{\mathcal{H}} \Leftrightarrow D(A)\text{ is dense everywhere in } \mathcal{H} $$


Ideas for a proof: The vanishing of the expectation values of the domain means that $\left(D(A)\right)^{\perp}= 0$. We actually have that $\overline{D(A)}^{\perp} = 0$, because one can show that $\left(D(A)\right)^{\perp}=\overline{D(A)}^{\perp}$ by continuity of the scalar product, therefore $\overline{D(A)}=\mathcal{H}$, in other words $A$ is densely defined.

As stated, the result in the quote from the OP is valid for operators defined everywhere on the Hilbert space and is nothing but the trivial assertion that follows from $\mathcal{H}^\perp = 0$, namely that $\mathcal{R}(A)=0\Leftrightarrow A \equiv 0$.
