Show that $P^TAP$ and $A$ have the same rank and same number of positive eigenvalues counting multiplicities If $P$ is a non singular matrix and $A$ is a symmetric matrix show that $P^TAP$ and $A$ have the same rank and same number of positive eigenvalues counting multiplicities.
Since $A$ is symmetric so $A=QDQ^T$ for some orthogonal matrix $Q$ and some diagonal matrix $D$. Now the diagonal entries of $D$ are the eigenvalues of $A$.
But I can't proceed after that. Please help. 
 A: As Will Jagy's comment above notes, this is a result known as Sylvester's law of inertia.  Note that the argument given here can be fleshed out into a full proof. But that's boring, so here's another approach
Sketch: Note by the min-max theorem that the number of positive eigenvalues is also the dimension of the largest subspace $S \subset \Bbb R^n$ such that for every $x \in S \setminus \{0\}$, we have $x^TAx > 0$.  
Show that if $S$ is such a subspace for $A$, then the image of $S$ under $P^{-1}$ is such a subspace for $P^TAP$.  Thus, $P^TAP$ has at least as many positive eigenvalues of $A$.  By the symmetry of our argument, $A$ has at least as many positive eigenvalues as $P^TAP$.  Thus, they have the same number of positive eigenvalues.
A: In a question about a transformation of matrices $A\mapsto P^TAP$ for some invertible $P$, it is almost always useful to associate to such matrices the bilinear form $(x,y)\mapsto (x\mid Ay)=x^TAy$ (the middle expression denotes the standard inner product on $\Bbb R^n$), since this transformation corresponds to just a change of coordinates for that associated bilinear form. In other words after the transformation one can consider one has the same bilinear form on an abstract vector space$~V$, but using a different basis of$~V$ to map $V$ isomorphically to$~\Bbb R^n$. Indeed, if after a change of basis, a vector with coordinates $x$ is the one that used to have coordinates $Px$, then in the new coordinates the bilinear form is given by $(x,y)\mapsto (Px\mid APy)=x^TP^TAPy$, and encoded by the matrix $P^TAP$. Any property of the matrix that reflects a property of the bilinear form will then automatically be invariant under this transformation.
Now it is given that $A$ is real symmetric (so we are dealing with symmetric bilinear forms), and we know by the spectral theorem that such matrices are always diagonalisable. However eigenvectors and eigenvalues of $A$ are not properties of the associated bilinear form. Indeed if $Px$ is an eigenvector for$~A$ this does not mean that $x$ is an eigenvector of $P^TAP$, and even though that is the case when $P$ is simply scalar multiplication by $\mu$, one sees that in that case the associated eigenvalue gets multiplied by $\mu^2$.
There is one possible exception: the eigenspace for a possible eigenvalues $\lambda=0$ of$~A$ corresponds to the subspace of vectors that are orthogonal for the symmetric bilinear form to all vectors of the space, and the subspace of such vectors is an attribute of that form (its radical). The dimension of this radical is the complement (with respect to the dimension$~n$) of the rank of$~A$, and it follows that this rank is invariant under the transformation. (This is also clear more elementarily because rank is unaffected by left or right multiplication by an invertible matrix.)
Though the eigenspace decomposition of $A$ cannot be expressed in terms of the bilinear form, a basis of eigenvectors for $A$ does provide for a set of coordinates in which the form has a particularly simple expression, namely as a weighted sum of products of corresponding coordinates from the two vectors (no cross terms). The weights are eigenvalues, which as we have seen can be affected coordinate change, but this cannot change their signs. The restriction of bilinear form to the direct sum $S$ of all eigenspaces with positive eigenvalues is positive definite. This does not characterise $S$ in terms of the bilinear form (there are vectors $x\notin S$ with $(x\mid Ax)>0$, as well as other subspaces with positive definite restriction, and indeed $S$ can change under changes of basis), but it is easy to see that $S$ is a subspace of maximal possible dimension with the property of having a positive definite restriction: $S$ is complementary to the sum $N$ of all eigenspaces with eigenvalues $\lambda\leq0$, and any subspace that intersects $N$ non trivially will have nonzero vectors $x$ with $(x\mid Ax)\leq0$. Therefore the quantity $\dim S$ is determined by the bilinear form, and this is the " number of positive eigenvalues counting multiplicities" the question asks about.
