Dimension of a vector space consisting of two $2$ by $2$ matrices that commute with all $2$ by $2$ matrices. What is the dimension of the vector space that consists of $2$ by $2$ matrices that commute with all $2$ by $2$ matrices?
Let $A$ be a matrix that commutes with all $2$ by $2$ matrices and let $B$ be any $2$ by $2$ matrix.
So if I pick $B$ to be $\begin{pmatrix}1&2\\ 3&4\end{pmatrix}$ and generalize $A$ to be $\begin{pmatrix}a&b\\ c&d\end{pmatrix}$, and I multiply them together, I get that:
$AB$ $=$ $\begin{pmatrix}a+2c&b+2d\\ 3a+4c&3b+4d\end{pmatrix}$ and $BA$ $=$ $\begin{pmatrix}a+3b&2a+4b\\ c+3d&2c+4d\end{pmatrix}$.
After setting the respective elements equal to each other and subtracting them from each other so that I got an equation that equalled $0$, I got the matrix ($a$ is the first column, $b$ is the second column, $c$ is the third column, $d$ is the fourth column):
\begin{pmatrix}0&-3&2&0\\ -2&-3&0&2\\ 3&0&3&-3\\ 0&3&-2&0\end{pmatrix}
Which row reduced to:
\begin{pmatrix}1&0&1&-1\\ 0&1&\frac{-2}{3}&0\\ 0&0&0&0\\ 0&0&0&0\end{pmatrix}
Since the rank of this matrix is $2$ that would mean that the dimension of the space is also $2$, but I am not sure if the way I have done it is correct. Especially since I have only picked one specific matrix to represent $B$.
Any help?

It appears that you’re looking for all $2\times2$ that commute with every $2\times2$ matrix, that is, matrices $A$ such that $[A,X]=AX-XA=0$ for all $X$. Let $$A=\begin{bmatrix}a&b\\c&d\end{bmatrix}.$$ Since this has to commute with every $2\times2$ matrix, it has to commute with the elements of the standard basis, so we compute $$\begin{bmatrix}a&b\\c&d\end{bmatrix}\begin{bmatrix}1&0\\0&0\end{bmatrix} - \begin{bmatrix}1&0\\0&0\end{bmatrix} \begin{bmatrix}a&b\\c&d\end{bmatrix} = \begin{bmatrix}0&-b\\c&0\end{bmatrix},$$ therefore $b=c=0$. Continuing on to the next basis element, $$\begin{bmatrix}a&0\\0&d\end{bmatrix}\begin{bmatrix}0&1\\0&0\end{bmatrix} - \begin{bmatrix}0&1\\0&0\end{bmatrix} \begin{bmatrix}a&0\\0&d\end{bmatrix} = \begin{bmatrix}0&a-d\\0&0\end{bmatrix},$$ so $a=d$. I’ll leave it to you to verify that the other two standard basis matrices don’t introduce any other constraints. Thus, the matrices that commute with every standard basis matrix are of the form $aI$, which clearly commutes with every $2\times2$ matrix as well. It should be obvious that these matrices do indeed form a subspace of the space of $2\times2$ matrices and what the dimension of that subspace is.
