# what is the dimension of the subspace?

what is the dimension of the set of $n\times n$ matrices whose sum of first row and diagonal entries are each $0$, I know that set of all trace $0$ matrices is of dimension $n^2-1$ by using rank-nullity theorem to this linear map $A\mapsto trace(A)$, so here another condition is added $x_{11}+\dots +x_{1n}=0$ along with $x_{11}+\dots+x_{nn}=0$ so if I define the linear map $A\mapsto \sum_{i=1}^{n} x_{1i}$ then clearly this is also a linear functional hence this set of matrices has the dimension $n^2-1$, so when both simultaneously happen, the dimension will be $n^2-2$? please help.

-
If it has dimension $n^2-2$, then it must be the kernel of a surjective linear map to a two-dimensional space. Can you find such a map? –  Chris Eagle Oct 27 '12 at 10:18
at this moment I am getting $A\mapsto (trace(A),\sum_{i=1}^{n} x_{1i})$ is a map from $M_n(\mathbb{R})\rightarrow \mathbb{R}^2$, let me think if this works –  La Belle Noiseuse Oct 27 '12 at 10:25
yes kernel is precisely those matrices I want –  La Belle Noiseuse Oct 27 '12 at 10:28

Another way to do this question is to plug your subspaces into this formula: $$\dim(S \cap T)=\dim(S)+\dim(T)-\dim(S+T).$$ It is not too hard to see that if $n \ne 1$, $S+T$ is just the space of all $n \times n$ matrices, so you end up with $$\dim(S \cap T)=n^2-1+n^2-1-n^2=n^2-2.$$ Note that if $n=1$, the dimension is not $-1$!
Edit: If we are given a $3 \times 3$ matrix $$\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix},$$ we can split it up as follows: $$\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix} = \begin{bmatrix}0&0&0\\d&e&f\\g&h&a+i\end{bmatrix} + \begin{bmatrix}a&b&c\\0&0&0\\0&0&-a\end{bmatrix}.$$ It should be clear why this works for any $n \times n$ matrix except for the case $n=1$.
could you tell me why $S+T=M_n(\mathbb{R})$? –  La Belle Noiseuse Oct 27 '12 at 10:47