How do you find a basis for the set of all $3 \times 3$ matrices whose rows and columns add up to zero? 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.
 A: 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}\;.
$$
A: Guess: I guess this is a basis: $$
\left(
\begin{array}{ccc}
1 & -1 & 0 \\
-1 & 1 & 0 \\
0 & 0 & 0 \\
\end{array}
\right),
\left(
\begin{array}{ccc}
0 & 0 & 0 \\
1 & -1 & 0 \\
-1 & 1 & 0 \\
\end{array}
\right),
\left(
\begin{array}{ccc}
0 & 1 & -1 \\
0 & -1 & 1 \\
0 & 0 & 0 \\
\end{array}
\right),
\left(
\begin{array}{ccc}
0 & 0 & 0 \\
0 & 1 & -1 \\
0 & -1 & 1 \\
\end{array}
\right).
$$
Check:  We know the vector space has dimension $4$ over $\mathbb{R}$, (or $\mathbb{Z}$), since once you fill in cells (1,1), (1,2), (2,1) (2,2), the rest is determined.
So, it is sufficient to show that
$$\left(\begin{array}{ccccccccc} 1 & -1 & 0 & -1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 
0 & 0 & 1 & -1 & 0 & -1 & 1 & 0 \\ 0 & 1 & -1 & 0 & -1 & 1 & 0 & 0 & 0 \\ 0 & 
0 & 0 & 0 & 1 & -1 & 0 & -1 & 1 \\ \end{array}\right)$$
has full rank (which I did on a computer).
A: You have six constraints, one for each row and column, but the sum of the row constraints and the sum of the column constraints are the same, so at most $5$ of the constraints are linearly independent, so the space is at least $4$-dimensional. The matrix of the first five constraints is
$$
\pmatrix{
1&1&1&0&0&0&0&0&0\\
0&0&0&1&1&1&0&0&0\\
0&0&0&0&0&0&1&1&1\\
1&0&0&1&0&0&1&0&0\\
0&1&0&0&1&0&0&1&0\\
}\;.
$$
We can guess three basis vectors by taking the three pairs of indices and placing a $\pmatrix{1&-1\\-1&1}$ matrix in the corresponding entries; that yields
$$
\pmatrix{
1&-1&0&-1&1&0&0&0&0\\
1&0&-1&0&0&0&-1&0&1\\
0&0&0&0&1&-1&0&-1&1
}
\;.
$$
Now we can take the generalized cross product of these $8$ vectors, both to check that they're all linearly independent and to find the fourth basis vector that's orthogonal to all of them. According to Wolfram|Alpha, the result is (proportional to)
$$
\pmatrix{0&1&-1&-1&0&1&1&-1&0}\;,
$$
so the matrix for one possible basis is
$$
\pmatrix{
1&-1&0&-1&1&0&0&0&0\\
1&0&-1&0&0&0&-1&0&1\\
0&0&0&0&1&-1&0&-1&1\\
0&1&-1&-1&0&1&1&-1&0
}
\;.
$$
