I was trying to prove the following:
Claim(Sylvester's law of inertia): Let $A$ be a real $n\times n$ symmetric matrix. It is known that there exists an invertible real matrix $P$ such that $$P^tAP=\left[\begin{array}{ccc} I_{p}\\ & -I_{m}\\ & & 0_{z} \end{array}\right].$$The numbers $p,m,z$ are independent of choice of $P$.
I think I could prove it; in a pretty straight forward manner, actually. But I cannot find any reference that uses the same argument as mine, and I am a little uncertain whether my proof is really correct. Below I will write my proof. I would like to know whether it is valid. Any critique/advice/comment is appreciated. Thanks in advance!
(My proof) Let $V=\mathbb{R}^n$. Let $(\ ,):V\times V\to \mathbb R$ be the symmetric form given by the equation $(X,Y)=X^tAY$. Suppose that $P_j$, for $j=1,2$, are real invertible matrices such that $${P_j}^tAP_j=\left[\begin{array}{ccc} I_{p_j}\\ & -I_{m_j}\\ & & 0_{z_j} \end{array}\right].$$ Our goal is to prove that $(p_1,m_1,z_1)=(p_2,m_2,z_2)$.
Let $W_{j,+},\ W_{j,-},\ W_{j,0}$ denote the subspaces of $V$ spanned by the first $p_j$ columns, the next $m_j$ columns, and the last $z_j$ columns of $P_j$, respectively. Then we have $$V=W_{j,+}\oplus W_{j,-}\oplus W_{j,0}.$$ It follows that $$W_{1,+}=(W_{1,+}\cap W_{2,+})\oplus (W_{1,+}\cap W_{2,-})\oplus (W_{1,+}\cap W_{2,0}).$$ Now the form $(\ ,)$ is positive definite on $W_{j,+}$, negative definite on $W_{j,-}$, and zero on $W_{j,0}$; thus $W_{1,+}\cap W_{2,-}=W_{1,+}\cap W_{2,0}=\{0\}$. It follows that $W_{1,+}=W_{1,+}\cap W_{2,+}$, so that $p_1\leq p_2.$ Symmetry proves that $p_1=p_2$.
An entirely similar argument proves that $m_1=m_2$. The claim follows. $\square$