TITLE: A matrix $M$ that commutes with any matrix is of the form $M=\alpha I$
QUESTION [6 upvotes]: I feel like this is probably a simple proof but I can't quite come up with it in an elegant way nor could I find it here.
Prove that if a matrix $M$ commutes with any matrix then $M$ is of the form $M=\alpha I$.
Proving the contrapositive seems like the natural way to go where we can logically transform $\lnot \forall A(MA = AM)$ into $\exists A (MA \neq AM)$ but assuming that $M \neq \alpha I$ immediately becomes messy. Is there a nice way out of this or is it inevitably going to get messy?

REPLY [6 votes]: Here is a coordinate-free proof. For any nonzero vector $x$, let $B$ be a linear map whose null space is spanned by $x$. Then $Ax\in\ker B$ because $B(Ax)=ABx=0$. As $\ker B$ is one-dimensional, $Ax=\lambda_xx$ for some scalar $\lambda_x$ that may depend on $x$.
Now, given any two nonzero vectors $x$ and $y$, if they are linearly dependent, then $y=kx$ for some scalar $k$. It follows that $\lambda_xy=\lambda_xkx=k\lambda_xx=kAx=Ay=\lambda_yy$ and hence $\lambda_x=\lambda_y$.
If $x$ and $y$ are linearly independent instead, then $0=Ax+Ay-A(x+y)=\lambda_xx+\lambda_yy-\lambda_{x+y}(x+y)$. By linear independence, we must have $\lambda_x=\lambda_{x+y}=\lambda_y$.
In other words, the factor $\lambda_x$ is identical for every nonzero vector $x$, i.e. there exist some $\lambda$ such that $Ax=\lambda x$ for every $x$, meaning that $A=\lambda I$.