# Basis and dim of the set of all $n\times n$ symmetric matrices.

An $n \times n$ square matrix $A$ is called symmetric if $A^T = A$ Show that the set of all $n \times n$ symmetric matrices, denoted $S$, is a subspace of $M_n(\mathbb{R})$. Give a basis for $S$ and determine $\dim S.$

How does one prove stuff about an $n \times n$ matrix? I can't write out elements to show closure. I can see why it is true, but I don't know how to prove it.

Symmetric + symmetric will definitely be symmetric. Ideas would be greatly appreciated.

• Write the elements of $A$ as $a_{ij}$. Then, $A$ is symmetric iff for all $1 \le i,j \le n$, $a_{ij} = a_{ji}$. This should help you with both parts, since matrix addition is elementwise. You can then write something like "Let $A = (a_{ij})$ be an element of $S$." – qaphla Jun 25 '14 at 0:47

To show that $S$ is a subspace, you need to show that

1. $A,B \in S \implies A+B \in S$
2. $A \in S$, $k \in \mathbb{R} \implies kA \in S$.

If $A,B \in S$, then $A^T = A$ and $B^T = B$. Then, $(A+B)^T = A^T+B^T = A+B$, so $A+B \in S$.

That proves the first part without writing out all the entries. Can you do the second part now?

To figure out the dimension of $S$, notice that to specify an element $A \in S$, you only need to specify the entries in the "upper-half" of $A$, i.e. $A_{ij}$ such that $1 \le i \le j \le n$. How many entries is this?

Alternatively, enzotib's answer shows you how to get a basis of $S$, so you can just count the number of elements in the basis to get the dimension of $S$.

Think of the most elementary symmetric matrices, there are two type:

1. the matrices with all zeros and only a $1$ in an element of the diagonal
2. the matrices with all zeros and only two $1$'s in an off-diagonal term and its symmetric

For example, in $M_2$: $$\begin{pmatrix} 1&0\\ 0&0 \end{pmatrix},\quad \begin{pmatrix} 0&0\\ 0&1 \end{pmatrix},\quad \begin{pmatrix} 0&1\\ 1&0 \end{pmatrix}$$ In $M_3$: $$\begin{pmatrix} 1&0&0\\ 0&0&0\\ 0&0&0 \end{pmatrix},\quad \begin{pmatrix} 0&0&0\\ 0&1&0\\ 0&0&0 \end{pmatrix},\quad \begin{pmatrix} 0&0&0\\ 0&0&0\\ 0&0&1 \end{pmatrix},\\ \begin{pmatrix} 0&1&0\\ 1&0&0\\ 0&0&0 \end{pmatrix},\quad \begin{pmatrix} 0&0&1\\ 0&0&0\\ 1&0&0 \end{pmatrix},\quad \begin{pmatrix} 0&0&0\\ 0&0&1\\ 0&1&0 \end{pmatrix}$$ Next, see that every symmetric matrix is a linear combinations of these matrices.
Next, prove that they are linearly independent.