TITLE: How do you find a basis for the set of all $3 \times 3$ matrices whose rows and columns add up to zero?
QUESTION [8 upvotes]: If $W$ is the set of all $3 \times 3$ matrices whose rows and columns add up to zero, how would you find a basis for this? There seem to be so many scenarios we'd need to cover, I can't find a way to succinctly find the answer / represent it well.
On a related note, how would you extend the basis to be a basis for $M_3(R)$? (I feel like I might be able to get this one, though, once I can clearly find a basis to begin with.)
Thanks in advance for the advice.

REPLY [7 votes]: Douglas' observation that the upper left $2\times2$ submatrix determines the remaining values suggests another solution: We can take the canonical basis for $2\times2$ matrices and fill in the third row and column for each of its elements; the result is
$$
\pmatrix{
1&0&-1\\
0&0&0\\
-1&0&1},
\pmatrix{
0&1&-1\\
0&0&0\\
0&-1&1},
\pmatrix{
0&0&0\\
1&0&-1\\
-1&0&1},
\pmatrix{
0&0&0\\
0&1&-1\\
0&-1&1}\;.
$$