# equal ranks for symmetric matrices of the form $A = P^tBP$?

If $A$ and $B$ are symmetric matrices related by $A = P^tBP$, where P is invertible, does it follow that the ranks of $A$ and $B$ are equal?

-
In fact multiplying by an invertible matrix does not change rank, hence $\operatorname{rank}(B)=\operatorname{rank}(BP)=\operatorname{rank}(P^TBP)$. –  Martin Sleziak Sep 11 '12 at 18:53
Hint: $x\in \operatorname{Ker}A$ then $Px\in \operatorname{Ker}B$. $x\in \operatorname{Ker}B$ then $P^{-1}x\in \operatorname{Ker}A$. Conclude that $\operatorname{dim} (\operatorname{Ker}A)= \operatorname{dim}(\operatorname{Ker}B)$