# Looking for proof of “ two congruent symmetric matrices with real entries have the same numbers of positive, negative, and zero eigenvalues ”

For any real square matrix $X$ let $P(X)$ denote the no. of its positive eigenvalues counting multiplicity . Let $A$ be a real symmetric $n \times n$ matrix and $B$ be a real invertible $n \times n$ matrix , then we know by Sylvester's law $P(A)=P(B^tAB)$ ; can anyone please give an elaborate proof of this or provide a pdf link ?

Let $\lambda_1\geq\ldots\geq\lambda_n$ be the eigenvalues of $A$ and let $\{v_1,\ldots,v_n\}$ be an orthonormal basis of $\mathbb{R}^n$ formed by eigenvectors of $A$ associated to $\{\lambda_1,\ldots,\lambda_n\}$.
Lemma: If $W$ is a $k$ dimensional subspace of $\mathbb{R}^n$ such that $w^tAw>0, \forall w\in W\setminus\{0\}$ then $P(A)\geq k$.
Notice that if $P(A)=k$ then $W=\text{span}\{B^{-1}v_1,\ldots,B^{-1}v_k\}$ is a k-dimensional subspace such that $w^tB^tABw>0, \forall w\in W\setminus\{0\}$. Thus, $P(B^tAB)\geq k= P(A)$ by the lemma above.
Now, since $A=(B^{-1})^t(B^tAB)B^{-1}$ then $P(A)\geq P(B^tAB)$.