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.
 A: To show that $S$ is a subspace, you need to show that


*

*$A,B \in S \implies A+B \in S$

*$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$. 
A: Think of the most elementary symmetric matrices, there are two type:


*

*the matrices with all zeros and only a $1$ in an element of the diagonal

*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.
