# Matrices commute if and only if they share a common basis of eigenvectors?

I've come across a paper that mentions the fact that matrices commute if and only if they share a common basis of eigenvectors. Where can I find a proof of this statement?

• You can find a good and detailed discussion of this fact in the book "Linear Algebra", by Kenneth Hoffman and Ray Kunze, chapter 6 (Elementary Canonical forms). Oct 7 '10 at 17:00
• As a physics student, I would like to mention that this simple theorem, is tremendously useful and important in quantum mechanics, and gives rise to the concepts of compatible and incompatible variables, which is essential for the measurements and probabilistic interpretation of quantum mechanics.
– user23238
Feb 17 '13 at 13:01

Suppose that $A$ and $B$ are $n\times n$ matrices, with complex entries say, that commute.
Then we decompose $\mathbb C^n$ as a direct sum of eigenspaces of $A$, say $\mathbb C^n = E_{\lambda_1} \oplus \cdots \oplus E_{\lambda_m}$, where $\lambda_1,\ldots, \lambda_m$ are the eigenvalues of $A$, and $E_{\lambda_i}$ is the eigenspace for $\lambda_i$. (Here $m \leq n$, but some eigenspaces could be of dimension bigger than one, so we need not have $m = n$.)

Now one sees that since $B$ commutes with $A$, $B$ preserves each of the $E_{\lambda_i}$: If $A v = \lambda_i v,$ then $A (B v) = (AB)v = (BA)v = B(Av) = B(\lambda_i v) = \lambda_i Bv.$

Now we consider $B$ restricted to each $E_{\lambda_i}$ separately, and decompose each $E_{\lambda_i}$ into a sum of eigenspaces for $B$. Putting all these decompositions together, we get a decomposition of $\mathbb C^n$ into a direct sum of spaces, each of which is a simultaneous eigenspace for $A$ and $B$.

NB: I am cheating here, in that $A$ and $B$ may not be diagonalizable (and then the statement of your question is not literally true), but in this case, if you replace "eigenspace" by "generalized eigenspace", the above argument goes through just as well.

• I'm a bit unclear on "putting decompositions together" part...does it give you an explicit form for the common set of eigenvectors? Oct 7 '10 at 18:32
• @Yaroslav: Dear Yaroslav, Yes, you will be able to get an explicit form for the common set of eigenvectors, but it may be complicated to compute (at least if you are computing by hand). What you need to do is to find a basis for each $E_{\lambda_i}$. You can then write a matrix for $B$ (restricted to $E_{\lambda_i}$) in terms of this basis, and then by the usual diagonalization procedure (applied to this new matrix) find a new basis for $E_{\lambda_i}$ consisting of eigenvectors for $B$. (So these will be simultaneous eigenvectors for $B$ and $A$ --- with $A$-eigenvalue all equal to ... Oct 7 '10 at 18:33
• ... $\lambda_i$.) You do this for each $\lambda_i$, and putting all of the bases you found for each $E_{\lambda_i}$ together, you get a basis for $\mathbb C^n$ consisting of simultaneous eigenvectors. As Qiaochu points out, the situation is easiest when all the $E_{\lambda_i}$ are one-dimensional (i.e. when $A$ has distinct eigenvalues) since then you don't need to do the second step of computing eigenvectors for $B$; each $E_{\lambda_i}$ will automatically consists of simultaneous eigenvectors for $A$ and $B$ (again, this is just in the special case when $A$ has distinct eigenvalues). Oct 7 '10 at 18:37
• Also, as your probably know, in the quantum mechanics literature, the situation when the $E_{\lambda_i}$ are bigger than one-dimensional is sometimes referred to by saying that the operator $A$ has degeneracies. Oct 7 '10 at 18:38
• @MattE Hi Matt, can you explain a little bit in detail on what can be said when $A$ or $B$ is not diagonalizable? As in this case one is no longer guaranteed to have the relation $Av = \lambda_iv$, and I don't see how your argument can be extended. In particular, given two commuting matrices $A$ and $B$, if $B$ is symmetric and $A$ is not diagonalizable, is a subspace of $\mathbb{R}^n$ that is invariant under $A$ also invariant under $B$? Mar 11 '17 at 18:28

This is false in a sort of trivial way. The identity matrix $I$ commutes with every matrix and has eigenvector set all of the underlying vector space $V$, but no non-central matrix has this property.

What is true is that two matrices which commute and are also diagonalizable are simultaneously diagonalizable. The proof is particularly simple if at least one of the two matrices has distinct eigenvalues.

• (And this can be improved to "simultaneously Jordanized", among other things) Oct 7 '10 at 13:56
• Dear Qiaochu, I suspect that the question means "admit a common set of eigenvectors", not that every eigenvector for one is an eigenvector fo the other. Oct 7 '10 at 15:19
• Yes, I meant Matt's version, the precise statement was "Thus, the Hamiltonian and all the translation operators of the crystal commute with each other. They possess, therefore, a common set of eigenstates." which I figured would have an equivalent statement in linear algebra Oct 7 '10 at 17:56
• @MarianoSuárez-Alvarez: That's not true. Take the 3 x 3 matrix nilpotent $A$ with ones just above the diagonal and all other entries zero. Then $A$ and $A^2$ commute, but are not simultaneously Jordanized (because $A$ is a single Jordan block, so any $P$ Jordanizing it must give $PAP^{-1} = A$ and thus $PA^2P^{-1} = A^2$ is not in Jordan form). It is true that any two commuting matrices can be simultaneously put in upper triangular form, though, maybe that's what you were remembering? Nov 26 '12 at 18:50
• @MarianoSuárez-Alvarez: Your comment is just wrong, as is shown in this answer. May 6 '14 at 8:52

Let $S$ be a set of commuting matrices over an algebraically closed field $F$. Then there may not be a common basis of eigenvectors (since any of them may not be diagonalizable!) but there must be at least a common eigenvector:

Burnside's theorem on matrix algebras states that if $F$ is algebraically closed, $V$ is a finite-dimensional $F$-vector space and $S$ is a proper subalgebra of $\text{End}(V)$ then there exists a nontrivial $S$-invariant subspace, i.e, there exists $W\leq V$ with $0\neq W\neq V$ such that $s(W)\subseteq W$ for every $s\in S$.

Suppose $S\subseteq M_n(F)$ with $n>1$ is commuting. Observe that a subspace of $F^n$ is $S$-invariant if and only if it is invariant for $<S>$, the subalgebra of $M_n(F)$ generated by $S$. Since $S$ is commuting, $<S>$ is also commuting and therefore $<S>\neq M_n(F)$. Burnside's theorem applies, and so there exists a proper and nontrivial subspace $V\leq F^n$ which is invariant for all $S$. If $V$ has dimension more than $1$ then $<S>\neq\text{End}(V)$, since $<S>$ is commuting, and we can apply Burnside's theorem again. By induction there exists an $S$-invariant subspace of dimension $1$, and so a common eigenvector for the matrices in $S$.

An elementary argument.

Summary: show that each eigenspace of $$A$$ has a basis such that each basis vector is contained in one of the eigenspace of $$B$$. This basis is then the simultaneous common basis we are looking for.

Suppose $$A,B$$ are both diagonalizable and they commute.

Now let $$E_{\lambda_i}$$ be eigenspaces of $$A$$ for each distinct eigenvalue $$\lambda_i$$ of $$A$$.

Now let $$F_{s_i}$$ be eigenspaces of $$B$$ for each distinct eigenvalue $$s_i$$ of $$B$$.

Now I claim that $$E_{\lambda_i}$$ (of say dimension $$m$$) has a basis $$v_1^i,...,v_m^i\in E_{\lambda_i}$$ such that each $$v_r^i$$ is in one of $$B$$'s engenspace $$F_{s_j}$$--this would imply these $$v_r^i$$ are eigenvectors of $$B$$ and $$A$$ simultaneously. Apply this to all eigenspaces $$E_{\lambda_i}, i=1,...,n$$. The collection of all $$v_r^i$$ then becomes a common basis for $$A$$ and $$B$$ as required.

To show this claim, first pick arbitrary basis $$w_1,...,w_m$$ of $$E_{\lambda_i}$$. Each $$w_i$$ can be written as sum of vectors where each vector is in one of $$B$$'s engenspace $$F_{s_j}$$. This is a subtle point so let me repeat: for each $$i=1,...,m,$$ $$w_i=z_1^i+...+z_{l_i}^i, l_i\le m$$ and $$z_k^i\in F_{s_j}$$ for some $$j$$. This is trivially true because direct sum of $$B$$'s engenspaces is the entire space.

Now we make a second claim that all $$z_k^i\in E_{\lambda_i}$$. Then the collection of all $$z_k^i$$ span $$E_{\lambda_i}$$ and thus the collection can be reduced to a basis $$v_1,...,v_m$$ where each $$v_j$$ is contained in $$E_{\lambda_i}$$ as required by the first claim.

Note that $$B$$ is invariant to $$E_{\lambda_i}$$ since $$A,B$$ commute. The second claim follows from: $$\sum_{i=1}^N z_i \in S$$ where $$z_i$$ are eigenvectors of distinct eigenvalues of $$B$$ and $$S$$ is a subspace to which $$B$$ is invariant, then $$z_i\in S,\forall i$$. We check this by induction on $$N$$. It is trivially true for $$N=1$$. Then suppose $$Bz_1=\lambda z_1$$. Since $$\lambda(z_1+...+z_N)\in S$$ and $$B(z_1+...+z_N)\in S$$, we have $$B(z_1+...+z_N)-\lambda(z_1+...+z_N)=a_2z_2+...+a_Nz_N\in S$$ for some constant $$a_i\neq 0$$--the constants are non-zero because we assumed $$z_i$$ all have distinct eigenvalues. Then apply inductive hypothesis $$z_2,...,z_N\in S$$. This would imply $$z_1\in S$$ as well. This finishes the proof.