What is a basis for $V_A$? PROBLEM
If $A \in \mathbb{F}^{3 \times 3}$ is given by 
$$A := \left[\begin{array}{ccc} 1 & 0 & 0 \\
                               0 & 3 & 0 \\
          0 & 0 & 1 \\ \end{array}\right],$$
find a basis for
$$V_A = \{B \in \mathbb{F}^{3 \times 3} | AB = BA\}.$$
MY TRY
I write out $B$ explicitly as
$$B := \left[\begin{array}{ccc} a & b & c \\
                               d & e & f \\
          g & h & i \\ \end{array}\right],$$
then $$AB = BA$$ is equivalent to
$$\left[\begin{array}{ccc} 1 & 0 & 0 \\
                               0 & 3 & 0 \\
          0 & 0 & 1 \\ \end{array}\right]\left[\begin{array}{ccc} a & b & c \\
                               d & e & f \\
          g & h & i \\ \end{array}\right] = \left[\begin{array}{ccc} a & b & c \\
                               d & e & f \\
          g & h & i \\ \end{array}\right]\left[\begin{array}{ccc} 1 & 0 & 0 \\
                               0 & 3 & 0 \\
          0 & 0 & 1 \\ \end{array}\right]$$
which in turn is equivalent to the simultaneous system of equations
$$\left\{\begin{array}{ccc} a=a & 3b=b & c=c \\
                               d=3d & 3e=3e & f=3f \\
          g=g & 3h=h & i=i \\ \end{array}\right\},$$
which then gives the general form of $B$, as follows:
$$B = \left[\begin{array}{ccc} a & 0 & c \\
                               0 & 3e & 0 \\
          g & 0 & i \\ \end{array}\right].$$
Note that we can write $B$ as the following linear combination:
$$B = \left[\begin{array}{ccc} a & 0 & c \\
                               0 & 3e & 0 \\
          g & 0 & i \\ \end{array}\right] = \left[\begin{array}{ccc} a & 0 & 0 \\
                               0 & 3e & 0 \\
          0 & 0 & i \\ \end{array}\right] + \left[\begin{array}{ccc} 0 & 0 & c \\
                               0 & 0 & 0 \\
          0 & 0 & 0 \\ \end{array}\right] +
\left[\begin{array}{ccc} 0 & 0 & 0 \\
                               0 & 0 & 0 \\
          g & 0 & 0 \\ \end{array}\right].$$
This implies that the set
$$S = \Bigg\{\left[\begin{array}{ccc} a & 0 & 0 \\
                               0 & 3e & 0 \\
          0 & 0 & i \\ \end{array}\right],  \left[\begin{array}{ccc} 0 & 0 & c \\
                               0 & 0 & 0 \\
          0 & 0 & 0 \\ \end{array}\right],
\left[\begin{array}{ccc} 0 & 0 & 0 \\
                               0 & 0 & 0 \\
          g & 0 & 0 \\ \end{array}\right]\Bigg\}$$
spans $V_A$.  In addition, $S$ is clearly linearly independent.  Therefore, $S$ is a basis for $V_A$.
QUERY

Is my solution correct?  If it is wrong, where is the error and how can it be mended?


There's a problem near the end. An example of a basis will be$$S=\left\{\begin{bmatrix}1&0&0\\0&0&0\\0&0&0\end{bmatrix},\begin{bmatrix}0&0&0\\0&1&0\\0&0&0\end{bmatrix},\begin{bmatrix}0&0&0\\0&0&0\\0&0&1\end{bmatrix},\begin{bmatrix}0&0&1\\0&0&0\\0&0&0\end{bmatrix},\begin{bmatrix}0&0&0\\0&0&0\\1&0&0\end{bmatrix}\right\}.$$
