Quantum Mechanics and Schur's lemma Today i was studying on a textbook and i crossed a paragraph that confused me a little.
Suppose you have an algebra generated by $\hat{X}$ and $\hat{P}$ and a function $f(\hat{X},\hat{P})$ that commutes with $\hat{X}$ and $\hat{P}$. Then you can prove that this function is proportional to the identity.
Here comes the issue, i don't understand the proof of this.
Reasoning in Position representation (meaning that $\hat{X}=x$ and $\hat{P}=-i\hbar\frac{d}{dx}$), i don't get why $[x,f]=0$ implies that $f=f(x)$ and why $[-i\hbar\frac{d}{dx},f]=0$ implies that $i\hbar\frac{df(x)}{dx}=0$.
 A: If $[x,f]=0$ then $f$ belongs to the commutant of $x$. Of course $x$ is in such a commutant, but $p$ isn't, therefore $f$ is a function of $x$ alone. Now, for any vector $\psi$ in the Hilbert space of the Schroedinger representation,
$$(f\psi)'(x) - (f\psi') = 0,\qquad\forall x$$
which implies that $(f'\psi)(x)=0$ for any $x$, hence $f'$ is the zero operator. Therefore $[p,f]=0$ implies $f'=0$, i.e. $f$ is a constant multiple of the identity operator.
A: Let $\psi(x)$ be any wave function, and assume $f$ can be formally expanded:$f=\sum_{km} a_{km} x^k p^m$. Then
\begin{align}
[x,f]\psi(x)&=x\left(\sum_{km} a_{km} x^k p^m\right)\psi(x)- \left(\sum_{km} a_{km} x^k p^m x\right)\psi(x)\, ,\\
&=\left(\left(\sum_{km} a_{km} x^{k} xp^m\right)- \left(\sum_k a_{km} x^k p^m x\right)\right)\psi(x)\, ,\\
&=\sum_{km}a_{km}x^k [x,p^m]\psi(x)\, .
\end{align}
If $[x,f]=0$, and since $[x,p^m]\ne 0$ unless $m=0$, it must hold that $a_{km}=0$ for $m\ne 0$, or 
$$
f=f(x)=\sum_{k}\tilde a_k x^k\, .
$$
Now consider $g(x,p)$
\begin{align}
[p,g(x,p)]\psi(x)&= p\left(\sum_{km} b_{km} x^k p^m\right) \psi(x) -\left(\sum_{km} b_{km} x^k p^m\right) p\psi(x)\, ,\\
&=\sum_{km} b_{km} [p,x^k] p^m\psi(x)\, .
\end{align}
Again, if you assume $[p,g]=0$ then the rhs is never $0$ unless $k=0$, implying this time that $g=g(p)$ only.
