Why $\mathcal{S}^n_d$ is a manifold? Let $\mathcal{S}^n_d$ be the set of all $n \times n$ real symmetric matrices of rank $d$.
How can I prove that $\mathcal{S}^n_d$ is a $dn-\binom{d}{2}$ dimensional manifold?
 A: Throughout I'll refer to the block decomposition of $n\times n$ matrices
$$
A=
\begin{bmatrix}
A_{11} & A_{12} \\
A_{21} & A_{22}
\end{bmatrix}
$$
Where $A_{11}$ is $d\times d$, $A_{22}$ is $(n-d)\times(n-d)$, etc.
Let $\mathcal{S}^n$ denote the set of $n\times n$ symmetric matrices (which is a smooth manifold, since it is a vector space). One way of showing that $\mathcal{S}^n_d\subset\mathcal{S}^n$ is a smooth manifold is by showing that it is a embedded submanifold of $\mathcal{S}^n$. This can be done using slice carts:
Definition: Let $M^N$ be a smooth manifold and $S\subset M$ be a subset. A $k$-slice chart of $S$ is a chart $\varphi:U\to\mathbb{R}^N$, with $U\subset M$ open, such that $S\cap U=\varphi^{-1}(\mathbb{R}^k\times\{0\})$.
There is a pretty standard theorem which characterizes embedded submanifolds using them:
Theorem: A subset $S\subset M^N$ is a $k$-dimensional embedded submanifold of $M$ iff every point in $S$ is contained in a $k$-slice chart.
It turns out there are a convenient set of slice charts for $\mathcal{S}^n_d\subset\mathcal{S}^n$
Let $E$ be any  $n\times n$ permutation matrix, and let $U_E=\{A\in\mathcal{S}^d:\det(E^TAE)_{11}\neq 0\}$. Note that $U_E$ is open, since it is the preimage of $\mathbb{R}\setminus 0$ by a polynomial function of the matrix elements. Define a chart $\varphi_E:U_E\to\mathbb{R}^{n(n+1)/2}$ by
$$
\varphi_E(EAE^T)=\left(A_{11},\ \ \ A_{21}A_{11}^{-1},\ \ \ A_{22}-A_{21}A_{11}^{-1}A_{12}\right)
$$
Where we identify each element of $\mathbb{R}^{n(n+1)/2}=\mathbb{R}^{d(d+1)/2}\times\mathbb{R}^{(n-d)d}\times\mathbb{R}^{(n-d)(n-d+1)/2}$ with a $d\times d$ symmetric matrix, a $(n-d)\times d$ matrix, and a $(n-d)\times(n-d)$ symmetric matrix. The image of this chart is given by $\varphi_E(U_E)=\{(H,P,B):\det H\neq 0\}$, which is open, and it has a smooth inverse given by
$$
\Phi_E^{-1}(H,P,B)=E
\begin{bmatrix}
H & HP^T \\
PH & PHP^T+B
\end{bmatrix}
E^T=E
\begin{bmatrix}
I_d & 0 \\
P & I_{n-d}
\end{bmatrix}
\begin{bmatrix}
H & 0 \\
0 & B
\end{bmatrix}
\begin{bmatrix}
I_d & P^T \\
0 & I_{n-d}
\end{bmatrix}
E^T
$$
Thus $\varphi_E$ is a diffeomorphism onto its image. Since the triangular matrices in the expression for $\varphi^{-1}$ above are invertible, we have $$
\operatorname{rank}\varphi_E^{-1}(H,P,B)=\operatorname{rank}H+\operatorname{rank}B=d+\operatorname{rank}B
$$
And so $\varphi_E^{-1}(H,P,B)\in\mathcal{S}^n_d$ iff $B=0$, and thus $\varphi_E$ are slice charts. For any $A\in\mathcal{S}^n_d$ there is an $E$ such that $A\in U_E$, so $\mathcal{S}^n_d$ satisfies the slice chart condition and is thus an embedded submanifold of $\mathcal{S}^n$ of dimension $d(d+1)/2+(n-d)d=dn-\binom{d}{2}$.
