Basis for set of nxn matrices with trace = 0 I am trying to find a basis for the set of all $n \times n$ matrices with trace $0$.  I know that part of that basis will be matrices with $1$ in only one entry and $0$ for all others for entries outside the diagonal, as they are not relevant.
I don't understand though how to generalize for the entries on the diagonal.  Maybe just one matrix with $1$ in the $(1, 1)$ position and a $-1$ in all other $n - 1$ positions?
 A: The matrix unit $E_{ij}$ is the matrix with $1$ in the $(i, j)$-entry and $0$ everywhere else.  A basis for your space consists is
$$
\{ E_{ij} \; \mid \; i \ne j \} \cup \{ E_{ii} - E_{i+1, i+1} \; \mid \; 1 \le i < n \}.
$$
Notice that there are $n(n-1)$ of the off diagonal matrices and $n-1$ of the diagonal ones, for a total of $n^2 - 1$ matrices.  This is the right size set since your space is the null space of the onto map
$$
\operatorname{tr}: \Bbb{R}^{n^2} \to \Bbb{R}.
$$
A: In order to finish constructing your basis, you could add the set of matrices for which the $(1,1)$ entry is $1$, the $(i,i)$ entry is $-1$ for some $i \neq 1$, and all other entries are zero.
Note that the space of $n\times n$ matrices with trace $0$ is $n^2 - 1$ dimensional, so you should have this many elements in your basis in total.
A: Since you have to find the dimension of the subspace of all matrices whose trace is $0$, having a linear transformation T: $M(n×n)→ ℝ$, all it really comes down to is finding the size of ker(T). 
In order to do so, notice that the standard matrix for the given transformation will have the dimension $1$ × $n^2$. Hence, applying Gauss Jordan, we get only one pivot variable and $n^2-1$ free variables. Since the number of free variables gives us the nullity of T (dimension of the kernel), and it is equal to the dimension of the subspace we're looking for, dimension of all n × n matrices with zero trace is simply $n^2-1$.
Then you can figure out what the actual basis could look like.
A: Note that trace equals zero says that the $n,n$ term is given by the remaining. So start with the usual basis with 
$$
A_{k,m}=1, ~~~  (k,m) \ne (n,n),\\ A_{i, j} = 0 , ~~~~(i,j) \ne (k, m), \\
A_{n,n} = -\sum_{i=1}^{n-1} A_{i,i}$$
Thus the basis has $n^2-1$ elements.
A: Consider the subspace $W = \{ A \in M_{n \times n}(F) : tr(A) = 0\} = \{ A \in M_{n \times n}(F) : \sum_{i=1}^{n} A_{ii} = 0\}.$ Now, we apply the standard representation of $M_{n \times n}(F)$ with respect to the matrix units $\beta,$ which is an isomorphism $\phi_{\beta}$ from $M_{n \times n}(F)$ onto $F^{n^{2}}.$ Namely, we express each element of $W$ as a coordinate vector relative to $\beta,$ i.e.,
$$\phi_{\beta}(W) = \{ (A_{11},A_{12},\dots,A_{21},A_{22},\dots,A_{nn}) \in F^{n^{2}} : \sum_{i=1}^{n} A_{ii} = 0\}.$$
Next, we encode the linear constraint $\sum_{i=1}^{n} A_{ii} = 0$ into the following matrix
$$B = \begin{pmatrix} 1 & 0 & \cdots & 0 & 1 & \cdots & 1\end{pmatrix},$$
since the solution set of the corresponding homogeneous system:
$$B \begin{pmatrix} A_{11} \\ A_{12} \\ \vdots \\ A_{21} \\ A_{22} \\ \vdots \\ A_{nn} \end{pmatrix} = 0$$
satisfies the constraint. Now, we identify the solution set as the null space $N(B),$ then we apply the dimension theorem ($dim(N(B)) = nullity(B) = dim(F^{n^{2}}) - rank(B)$). Thus, the problem is to find a subset of the null space with exactly $n^{2} - 1$ linearly independent vectors.
To obtain this subset, we identify the $B_{11} = 1$ entry as the pivot variable. Next, we identify the remaining entries as the free variables. Then, we obtain a solution
$$\{ (0,1,\dots,0,0,\dots,0),\dots, (-1,0,\dots,0,1,\dots,0),\dots,(-1,0,\dots,0,0,\dots,1)\},$$
where we have expressed the vectors as $n^{2}$-tuples. Lastly, we apply the inverse of the standard representation $\phi_{\beta}^{-1}$ to the solution in order to return square matrices instead of coordinate vectors.
