# transitivity of commutator

I remember a quantum mechanics lecture where my professor said "Two matrices $A, B$ which commute with a third matrix $C$, $[A,C]=[B,C]=0$, commute with each other: $[A,B]=0$." I pointed out the identity $C=\mathbb{I}$ as an obvious counterexample, to which he restated the proposition to exclude my counterexample:

"Two matrices $A, B$ which commute with a third matrix $C\neq\mathbb{I}$, $[A,C]=[B,C]=0$, commute with each other: $[A,B]=0$."

He said further that he didn't know if this was a theorem, but he had never come across a counterexample. Thinking about it now, a straightforward exception is a block diagonal $C$ which is the identity in a given block, but not the other blocks so $C\neq\mathbb{I}$, and $A,B$ which are only nonzero in the given block.

My question is whether, apart from these trivial cases, transitivity of the commutator is generally true or not? If not what is a counterexample? If it is generally true for matrices how far can it be extended to other systems?

-
Note that if you just look at invertible matrices, this corresponds to asking which matrices have abelian centralizer. – Tobias Kildetoft May 3 '13 at 16:36
This is unlikely to be true because the Jacobi identity only implies that $[C,[A,B]]=0$. – lhf May 3 '13 at 16:37

If the eigenvalues of $C$ are all simple, then the only matrices that commute with $C$ are polynomials in $C$ and your instructor's claim is correct. If the eigenvalues of $C$ are not all simple, then claim can be false, as your example shows. You could generate further examples by taking $C$ to be diagonal with at least two diagonal entries equal.
@ChrisGodsil, physicists should be aware of the fact that this is absolutely not the case! If you just look at the angular momentum group, you know that you have $[S_k,S_l]=i\epsilon_{klm}S_m$. Still in this group you can make a Casimir operator which commutes with all of them, namely $S^2=S_x^2+S_y^2+S_z^2$. So we have that $[S_x,S^2]=0$ and $[S_y,S^2]=0$, but $[S_x,S_y]=iS_z\neq0$. And yes these angular momentum matrices are Hermitian. – Dominique May 30 '15 at 13:42
Chris Godsil has explained why your professor has such a claim. In general, the claim is incorrect. Here is a counterexample for the Hermitian case: $$A=\pmatrix{aI_n\\ &bI_n},\ B=\pmatrix{0&U\\ U^\ast&0},\ C=\pmatrix{UDU^\ast\\ &D},$$ where $a,b$ are distinct scalars, $n>1$, $U$ is unitary and $D$ is a real diagonal matrix that is not a scalar multiple of $I_n$.