# Do commuting matrices share the same eigenvectors?

In one of my exams I'm asked to prove the following

Suppose $$A,B\in \mathbb R^{n\times n}$$, and $$AB=BA$$, then $$A,B$$ share the same eigenvectors.

My attempt is let $$\xi$$ be an eigenvector corresponding to $$\lambda$$ of $$A$$, then $$A\xi=\lambda\xi$$, then I want to show $$\xi$$ is also some eigenvector of $$B$$ but I get stuck.

• It's enough to make both matrices diagonalizable. Apr 9, 2015 at 14:40
• Take $A=I$ and $B=2I$, then they have different eigenvalues but they commute. What you can say, though, is that if $AB=BA$ then $A$ is diagonalizable iff $B$ is and then they can be diagonalized simultaneously Apr 9, 2015 at 14:43
• @Vim: read math.stackexchange.com/questions/6258/…. Apr 9, 2015 at 14:43

The answer is in the book Linear Algebra and its Application by Gilbert Strang. I'll just write down what he said in the book.

Starting from $$Ax=\lambda x$$, we have

$$ABx = BAx = B \lambda x = \lambda Bx$$

Thus $$x$$ and $$Bx$$ are both eigenvectors of $$A$$, sharing the same $$\lambda$$ (or else $$Bx = 0$$). If we assume for convenience that the eigenvalues of $$A$$ are distinct – the eigenspaces are one dimensional – then $$Bx$$ must be a multiple of $$x$$. In other words $$x$$ is an eigenvector of $$B$$ as well as $$A$$.

There's another proof using diagonalization in the book.

• So the assertion holds if $A$ and $B$ only have eigenvalues of multiplicity 1. This is probably the best we can hope for. Apr 9, 2015 at 16:23

Commuting matrices do not necessarily share all eigenvector, but generally do share a common eigenvector.

Let $$A,B\in\mathbb{C}^{n\times n}$$ such that $$AB=BA$$. There is always a nonzero subspace of $$\mathbb{C}^n$$ which is both $$A$$-invariant and $$B$$-invariant (namely $$\mathbb{C}^n$$ itself). Among all these subspaces, there exists hence an invariant subspace $$\mathcal{S}$$ of the minimal (nonzero) dimension.

We show that $$\mathcal{S}$$ is spanned by some common eigenvectors of $$A$$ and $$B$$. Assume that, say, for $$A$$, there is a nonzero $$y\in \mathcal{S}$$ such that $$y$$ is not an eigenvector of $$A$$. Since $$\mathcal{S}$$ is $$A$$-invariant, it contains some eigenvector $$x$$ of $$A$$; say, $$Ax=\lambda x$$ for some $$\lambda\in\mathbb{C}$$. Let $$\mathcal{S}_{A,\lambda}:=\{z\in \mathcal{S}:Az=\lambda z\}$$. By the assumption, $$\mathcal{S}_{A,\lambda}$$ is a proper (but nonzero) subspace of $$\mathcal{S}$$ (since $$y\not\in\mathcal{S}_{A,\lambda}$$).

We know that for any $$z\in \mathcal{S}_{A,\lambda}$$, $$Bz\in \mathcal{S}$$ since $$\mathcal{S}_{A,\lambda}\subset\mathcal{S}$$ and $$\mathcal{S}$$ is $$B$$-invariant. However, $$A$$ and $$B$$ commute so $$ABz=BAz=\lambda Bz \quad \Rightarrow\quad Bz\in \mathcal{S}_{A,\lambda}.$$ This means that $$\mathcal{S}_{A,\lambda}$$ is $$B$$-invariant. Since $$\mathcal{S}_{A,\lambda}$$ is both $$A$$- and $$B$$-invariant and is a proper (nonzero) subspace of $$\mathcal{S}$$, we have a contradiction. Hence every nonzero vector in $$\mathcal{S}$$ is an eigenvector of both $$A$$ and $$B$$.

EDIT: A nonzero $$A$$-invariant subspace $$\mathcal{S}$$ of $$\mathbb{C}^n$$ contains an eigenvector of $$A$$.

Let $$S=[s_1,\ldots,s_k]\in\mathbb{C}^{n\times k}$$ be such that $$s_1,\ldots,s_k$$ form a basis of $$\mathcal{S}$$. Since $$A\mathcal{S}\subset\mathcal{S}$$, we have $$AS=SG$$ for some $$G\in\mathbb{C}^{k\times k}$$. Since $$k\geq 1$$, $$G$$ has at least one eigenpair $$(\lambda,x)$$. From $$Gx=\lambda x$$, we get $$A(Sx)=SGx=\lambda(Sx)$$ ($$Sx\neq 0$$ because $$x\neq 0$$ and $$S$$ has full column rank). The vector $$Sx\in\mathcal{S}$$ is an eigenvector of $$A$$ and, consequently, $$\mathcal{S}$$ contains at least one eigenvector of $$A$$.

EDIT: There is a nonzero $$A$$- and $$B$$-invariant subspace of $$\mathbb{C}^n$$ of the least dimension.

Let $$\mathcal{I}$$ be the set of all nonzero $$A$$- and $$B$$-invariant subspaces of $$\mathbb{C}^n$$. The set is nonempty since $$\mathbb{C}^n$$ is its own (nonzero) subspace which is both $$A$$- and $$B$$-invariant ($$A\mathbb{C}^n\subset\mathbb{C}^n$$ and $$B\mathbb{C}^n\subset\mathbb{C}^n$$). Hence the set $$\mathcal{D}:=\{\dim \mathcal{S}:\mathcal{S}\in\mathcal I\}$$ is a nonempty subset of $$\{1,\ldots,n\}$$. By the well-ordering principle, $$\mathcal{D}$$ has the least element and hence there is a nonzero $$\mathcal{S}\in\mathcal{I}$$ of the least dimension.

• It is also probably worth adding that the S as above will be spanned by some common eigenvectors of A and B which all have identical eigenvalues, since you showed that each vector in S is also an eigenvector of both A and B. May 18, 2019 at 0:03
• For a quicker proof, could you have just claimed that the \lambda-eigenspace of A is B invariant just by examining ABv=BAv (implies Bv is an A-evec)? Mar 30, 2020 at 19:47

(Modified) Answer of Qiaochu Yuan here: 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 other matrix except a multiple of the identity matrix has this property.

As noted in another answer, the statement is not true as stated, just take $$A = \begin{bmatrix}1&0\\0&1\\\end{bmatrix}, \qquad B = \begin{bmatrix}1&0\\0&2\\\end{bmatrix}.$$

What is true is that, if $A$ and $B$ are diagonalizable, then $A$ and $B$ can be simultaneously diagonalized. Thanks to Thomas Andrews for pointing out an oversight.

Applying $B$ to both sides of $\lambda \xi = A \xi$ you get $\lambda (B \xi) = B A \xi = A (B \xi)$, so either $B \xi = 0$, or $B \xi$ is an eigenvector for $A$ with respect to the eigenvalue $\lambda$.

In any case $B$ maps the eigenspace $W$ of $A$ relative to the eigenvalue $\lambda$ into itself. On $W$, $A$ acts like the scalar $\lambda$. Now one can put $B$ in diagonal form on $W$ without changing the scalar shape of $A$ on $W$.

Matrices $$A = \pmatrix{0&1\\0&0}, B = \pmatrix{1&0\\0&1}$$ commute, but they don't share the eigenvector $$\pmatrix{0\\1}$$ of $$B.$$

• (0,1) is an eigenvector of A with eigenvalue zero. More precisely, the eigenbasis of both of these matrices is the same in C^{2}- Jul 18, 2017 at 18:11

Let $$S$$ be a set of commuting matrices over an algebraically closed field $$F$$. As Algebraic Pavel said above, 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. Let us prove that this can also be seen as an easy consequence of Burnside's theorem on matrix algebras:

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 $$\langle S\rangle$$, the subalgebra of $$M_n(F)$$ generated by $$S$$. Since $$S$$ is commuting, $$\langle S\rangle$$ is also commuting and therefore $$\langle S\rangle\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 $$\langle S\rangle\neq\text{End}(V)$$, since $$\langle S\rangle$$ 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$$.

The other counterexample can be generated with a real skew-symmetric matrix, denote it $$K$$. Consider matrix dimension $$4 \times 4$$. Take for example $$K=\begin{bmatrix} 0 & 3 & 0 & 0 \\ -3 & 0 & 0 & 0\\ 0 & 0 & 0 & 4\\ 0 & 0 & -4 & 0 \end{bmatrix}\,.$$ Now if $$K$$ is skew-symmetric then $$K^2$$ is symmetric. $$K$$ and $$K^2$$ commute as polynomials.

Now for $$K$$ we have no real eigenvectors at all, but for $$K^2$$ (as it is symmetric) there are eigenvectors which can be presented as only real. The matrices do not share any eigenvectors.

• From the above Klaus Draeger's comment "So the assertion holds if $A$ and $B$ only have eigenvalues of multiplicity $1$. This is probably the best we can hope for". Here in the case $K^2$ we have eigenvalues $-9$ and $-16$, both of multiplicity 2. Interesting that $K$ has eigenvalues only of multiplicity 1 (although conjugate in pairs). Taking this into account it is not surprise that for example $K$ and $K^3$ share the same ( complex) eigenvectors - here we have condition of multiplicity 1 fulfilled. Jan 25, 2018 at 10:04
• I don't understand this example. The vector $[i, 1, 0, 0]$ is an eigenvector of both $K$ and $K^2$. Aug 30, 2020 at 17:24
• @Jules I meaned that they do not share real eigenvectors. Aug 30, 2020 at 18:47
• Couldn't you have just taken the matrix $K = [0, 3; -3, 0]$ then? Aug 30, 2020 at 19:03
• @Jules I guess that just wanted to show that the condition - matrix has an eigenvector - doesn't imply that every commuting matrix has this vector as its own eigenvector as was falsely assumed in the OP. I suppose choice of an example is of secondary meaning. Sep 1, 2020 at 9:06

They will share an eigenvector: suppose $$Ax = ax$$, then $$BAx = Bax$$ and by commutativity $$A(Bx) = a(Bx)$$, so if $$x$$ is an eigenvector of $$A$$ then $$Bx$$ is an eigenvector of $$A$$ with the same eigenvalue. Now look at the subspace $$V$$ generated by $$x, Bx, B^2 x,...$$, which are all eigenvectors of $$A$$. Then $$V$$ is invariant under $$B$$, so $$V$$ also contains an eigenvector of $$B$$.

In fact, more is true. If $$A : V \to V$$ then we can write $$V$$ as a direct sum of subspaces $$V_\lambda$$ of generalised eigenvectors associated to each eigenvalue $$\lambda$$ of $$A$$. The $$V_\lambda$$ are $$B$$-invariant. So we can split up $$V_\lambda$$ further into a direct sum of $$V_{\lambda\mu}$$ corresponding to the different eigenvalues $$\mu$$ of $$B$$. We could continue doing this if we have more matrices $$C,D$$, and so on. This way we split $$V$$ as a direct sum, and each term of the sum is a generalised eigenspace of all the matrices.

So we can write the matrices as block diagonal matrices where the shape of the blocks is the same for all the matrices, and all the eigenvalues on the diagonal of each block are the same in all matrices. Furthermore, each block may be put in upper triangular form.

• I'm not sure that I understand you correctly but doesn't my example contradict also your argumentation? Assume we have $A=K^2$ and $x$ is a real vector. $B=K$ and commutes with $A$. Then $x,Bx, B^2x \dots$ are all real vectors and $V$ is real. But it doesn't contain eigenvector of $B$ as they are not real.. Sep 1, 2020 at 10:28
• Vectors in that subspace are not all real, you're allowed to use complex coefficients. Sep 1, 2020 at 11:25
• If we're working over the reals the whole thing is trivially false, because then we have matrices with no eigenvectors at all. Sep 1, 2020 at 11:26
• I understand that $x$ ( from it we start) is not any eigenvector of $A$ but a special one i.e. complex one ? So we have a problem what $x$ to choose for the start.. Sep 1, 2020 at 12:13
• No, it's any eigenvector. The space $span{x,Bx,B^2 x, ...}$ has complex vectors even if $x,Bx,B^2 x, ...$ are real, because the span takes any linear combination with coefficients from the field we're working over, so if we're working over $\mathbb{C}$ then those vectors can be complex. Sep 2, 2020 at 14:06