# Basis For Subspace Consisting of Matrices Commute With a Given Diagonal Matrix

## Problem 287

Let $V$ be the vector space of all $3\times 3$ real matrices.
Let $A$ be the matrix given below and we define
$W=\{M\in V \mid AM=MA\}.$ That is, $W$ consists of matrices that commute with $A$.
Then $W$ is a subspace of $V$.

Determine which matrices are in the subspace $W$ and find the dimension of $W$.

(a) $A=\begin{bmatrix} a & 0 & 0 \\ 0 &b &0 \\ 0 & 0 & c \end{bmatrix},$ where $a, b, c$ are distinct real numbers.

(b) $A=\begin{bmatrix} a & 0 & 0 \\ 0 &a &0 \\ 0 & 0 & b \end{bmatrix},$ where $a, b$ are distinct real numbers.

## Solution.

### (a) Diagonal matrix with distinct diagonal entries

Let us first determine when a matrix $M$ commutes with $A$.
Let
$M=\begin{bmatrix} a_{1 1} & a_{1 2} & a_{1 3} \\ a_{2 1} & a_{2 2} & a_{2 3} \\ a_{3 1} & a_{3 2} & a_{3 3} \end{bmatrix}$ and suppose that $AM=MA$:
$\begin{bmatrix} a & 0 & 0 \\ 0 & b &0 \\ 0 & 0 & c \end{bmatrix} \begin{bmatrix} a_{1 1} & a_{1 2} & a_{1 3} \\ a_{2 1} & a_{2 2} & a_{2 3} \\ a_{3 1} & a_{3 2} & a_{3 3} \end{bmatrix} = \begin{bmatrix} a_{1 1} & a_{1 2} & a_{1 3} \\ a_{2 1} & a_{2 2} & a_{2 3} \\ a_{3 1} & a_{3 2} & a_{3 3} \end{bmatrix} \begin{bmatrix} a & 0 & 0 \\ 0 &b &0 \\ 0 & 0 & c \end{bmatrix}.$ Computing matrix products, we obtain
$\begin{bmatrix} aa_{1 1} & aa_{1 2} & aa_{1 3} \\ ba_{2 1} & ba_{2 2} & ba_{2 3} \\ ca_{3 1} & ca_{3 2} &c a_{3 3} \end{bmatrix} = \begin{bmatrix} a_{1 1}a & a_{1 2}b & a_{1 3}c \\ a_{2 1}a & a_{2 2}b & a_{2 3}c\\ a_{3 1}a & a_{3 2}b & a_{3 3}c \end{bmatrix}. \tag{*}$ Compare the $(1,2)$ entries and we have $aa_{1 2}=ba_{1 2}$.
Since $a\neq b$, we must have $a_{1 2}=0$.

Similarly, comparing the off-diagonal entries and noting $a, b, c$ are distinct, we find that off diagonal entries $a_{i j} , i\neq j$ must be $0$.

Thus, $M$ commutes with $A$ if and only if
$M=\begin{bmatrix} a_{1 1} & 0 & 0 \\ 0 & a_{2 2} & 0 \\ 0 & 0 & a_{3 3} \end{bmatrix}.$

Therefore, the subspace $W$ consists of all $3\times 3$ diagonal matrices:
$W=\{W\in V\mid W \text{ is diagonal}\}.$ Then it is easy to see that the set $\{E_{1 1}, E_{2 2}, E_{3 3}\}$ is a basis for $W$, where $E_{i j}$ is the $3\times 3$ matrix whose $(i,j)$-entry is $1$ and the other entries are zero. Thus the dimension of $W$ is $3$.

### (b) Diagonal matrix two diagonal entries are the same

Now consider the case
$A=\begin{bmatrix} a & 0 & 0 \\ 0 &a &0 \\ 0 & 0 & b \end{bmatrix}.$ Let
$M=\begin{bmatrix} a_{1 1} & a_{1 2} & a_{1 3} \\ a_{2 1} & a_{2 2} & a_{2 3} \\ a_{3 1} & a_{3 2} & a_{3 3} \end{bmatrix}$ and compute $AM=MA$ as in part (a) (or you just need to replace $b, c$ in (*) by $a, b$, respectively) and obtain
$\begin{bmatrix} aa_{1 1} & aa_{1 2} & aa_{1 3} \\ aa_{2 1} & aa_{2 2} & aa_{2 3} \\ ba_{3 1} & ba_{3 2} & ba_{3 3} \end{bmatrix} = \begin{bmatrix} a_{1 1}a & a_{1 2}a & a_{1 3}b \\ a_{2 1}a & a_{2 2}a & a_{2 3}b\\ a_{3 1}a & a_{3 2}a & a_{3 3}b \end{bmatrix}.$ Comparing entries and noting $a\neq b$, we have
$a_{1 3}=0, a_{2 3}=0, a_{3 1}=0, a_{3 2}=0.$

Thus, $M$ commutes with $A$ is and only if
$M=\begin{bmatrix} a_{1 1} & a_{1 2} & 0 \\ a_{2 1} & a_{2 2} & 0 \\ 0 & 0 & a_{3 3} \end{bmatrix},$ and hence the subspace $W$ consists of such matrices.
From this, we see that the set
$\{E_{1 1}, E_{1 2}, E_{2 1}, E_{2 2}, E_{3 3}\}$ is a basis for $W$, and we conclude that the dimension of $W$ is $5$.

### More from my site

• Prove a Given Subset is a Subspace and Find a Basis and Dimension Let $A=\begin{bmatrix} 4 & 1\\ 3& 2 \end{bmatrix}$ and consider the following subset $V$ of the 2-dimensional vector space $\R^2$. $V=\{\mathbf{x}\in \R^2 \mid A\mathbf{x}=5\mathbf{x}\}.$ (a) Prove that the subset $V$ is a subspace of $\R^2$. (b) Find a basis for […]
• Basis and Dimension of the Subspace of All Polynomials of Degree 4 or Less Satisfying Some Conditions. Let $P_4$ be the vector space consisting of all polynomials of degree $4$ or less with real number coefficients. Let $W$ be the subspace of $P_2$ by $W=\{ p(x)\in P_4 \mid p(1)+p(-1)=0 \text{ and } p(2)+p(-2)=0 \}.$ Find a basis of the subspace $W$ and determine the dimension of […]
• Vector Space of Polynomials and Coordinate Vectors Let $P_2$ be the vector space of all polynomials of degree two or less. Consider the subset in $P_2$ $Q=\{ p_1(x), p_2(x), p_3(x), p_4(x)\},$ where \begin{align*} &p_1(x)=x^2+2x+1, &p_2(x)=2x^2+3x+1, \\ &p_3(x)=2x^2, &p_4(x)=2x^2+x+1. \end{align*} (a) Use the basis […]
• Dimension of the Sum of Two Subspaces Let $U$ and $V$ be finite dimensional subspaces in a vector space over a scalar field $K$. Then prove that $\dim(U+V) \leq \dim(U)+\dim(V).$   Definition (The sum of subspaces). Recall that the sum of subspaces $U$ and $V$ is $U+V=\{\mathbf{x}+\mathbf{y} \mid […] • Symmetric Matrices and the Product of Two Matrices Let A and B be n \times n real symmetric matrices. Prove the followings. (a) The product AB is symmetric if and only if AB=BA. (b) If the product AB is a diagonal matrix, then AB=BA. Hint. A matrix A is called symmetric if A=A^{\trans}. In […] • Linear Properties of Matrix Multiplication and the Null Space of a Matrix Let A be an m \times n matrix. Let \calN(A) be the null space of A. Suppose that \mathbf{u} \in \calN(A) and \mathbf{v} \in \calN(A). Let \mathbf{w}=3\mathbf{u}-5\mathbf{v}. Then find A\mathbf{w}. Hint. Recall that the null space of an […] • The Subset Consisting of the Zero Vector is a Subspace and its Dimension is Zero Let V be a subset of the vector space \R^n consisting only of the zero vector of \R^n. Namely V=\{\mathbf{0}\}. Then prove that V is a subspace of \R^n. Proof. To prove that V=\{\mathbf{0}\} is a subspace of \R^n, we check the following subspace […] • A Matrix Commuting With a Diagonal Matrix with Distinct Entries is Diagonal Let \[D=\begin{bmatrix} d_1 & 0 & \dots & 0 \\ 0 &d_2 & \dots & 0 \\ \vdots & & \ddots & \vdots \\ 0 & 0 & \dots & d_n \end{bmatrix}$ be a diagonal matrix with distinct diagonal entries: $d_i\neq d_j$ if $i\neq j$. Let $A=(a_{ij})$ be an $n\times n$ matrix […]

#### You may also like...

##### Determine Whether a Set of Functions $f(x)$ such that $f(x)=f(1-x)$ is a Subspace

Let $V$ be the vector space over $\R$ of all real valued function on the interval $[0, 1]$ and let...

Close