Subspaces containing matrices that commute with a given matrix

Problem:

Determine the subspace of R(2 by 2) consisting of all matrices that commute with the given matrix:

(1 0 ) =B

(0 -1)

Attempt at sol'n:

I wanted a general 2 by 2 matrix A so that AB=BA. Multiplying out component wise, I think that it must be the case that a11=a11, a12=-a12=0, -a21=a21=0, and -a22=-a22. So I think that

(1 0 ) (a11 0 ) = (a11 0 ) (1 0 )

(0 -1) (0 -a22) (0 -a22) (0 -1)

And I already know that if S is a subspace of R(n by n) where S is the set of all matrices that commute with a fixed vector in R(n by n) that S is a subspace of R(n by n).

So is the above sufficient or do I need to do something entirely different?

Re: Subspaces containing matrices that commute with a given matrix

You're pretty much there, I'd say. The subspace you're seeking is the subspace of diagonal matrices. All you need check is closure under scalar multiplication and vector addition, which is easy.

Re: Subspaces containing matrices that commute with a given matrix

Well I know from the fact that S is a subspace of R(n by n) that my particular example is closed under addition and multiplication (right?). But I'm not sure how to write my answer in set builder notation. For my particular S,

S={A such that ?}

Re: Subspaces containing matrices that commute with a given matrix

You can do the commuting-with-fixed-vector approach, or the approach I mentioned. As for writing your final subspace in set builder notation, how about this:

$\displaystyle S=\left\{M\in\mathbb{R}^{2\times 2}\Big|M=\begin{bmatrix}x&0\\ 0&y\end{bmatrix}\;\text{for some}\; x,y\in\mathbb{R}\right\}.$

Re: Subspaces containing matrices that commute with a given matrix

I think I understand. Thank you for your time.

Re: Subspaces containing matrices that commute with a given matrix

You're very welcome. Have a good one!