Subspace of the real matrices generated by the matrices of the form $AB-BA$ Let $S$ be the subspace of vector space of all real $n\times\ n$ matrices generated by all matrices of the form $AB-BA$ with $A$ and $B$ in vector space all $n\times\ n$. What is the dimension of $S$?
 A: As the matrices are highly non-commutative, the following isomorphism shouldn't be to surprising:
$$\frac{M_n(k)}{[M_n(k),M_n(k)]}\cong k.$$
(This follows as the zeroth cohomology of a $k$-algebra is a Morita invariant). Here $k$ denotes an arbitrary field. Notice that $\text{Tr}:M_n(k)\rightarrow k$ is a surjective linear map. By the first isomorphism theorem, we have that $\frac{M_n(k)}{\ker(\text{Tr})}\cong k$. Since $[M_n(k),M_n(k)]\subseteq \ker(\text{Tr})$ and by the above isomorphism, we conclude that $[M_n(k),M_n(k)]=\ker(\text{Tr})$, which we needed to show.
A: Name $E_{ij}=(e_{kl})$ the matrix with all coefficients vanishing except $e_{ij}=1$.
then for $i,j,k,l \in \{1, \dots, n\}$ you have:
$$E_{ij}E_{kl} = \delta_{jk}E_{il}$$ where $\delta_{ij}$ is kronecker delta symbol.
Therefore
$$E_{ij}E_{kl}-E_{kl}E_{ij} = \delta_{jk}E_{il}-\delta_{li}E_{kj}.$$
Taking $j = k$ and $l \neq i$ you get
$$E_{ij}E_{kl}-E_{kl}E_{ij} = E_{il}.$$
Which means that you can get all matrices of the form $E_{il}$ with $l \neq i$ by the operation $AB-BA$. By linear combinations, you get all the matrices having zeros on the diagonal.
Now taking $j = k$ and $l = i$ you get
$$E_{ij}E_{kl}-E_{kl}E_{ij} = E_{ii} - E_{jj}.$$ Which means all the matrices with all coefficients equal to zero except a one and a minus one on the diagonal. And those matrices generate by linear combinations all the diagonal matrices with a zero trace.
Combining all the avove, we've proven that the subspace of the matrices space you're looking for is the subspace of matrices with zero trace.
