# generalized inverse and trace of their product with the original matrix

Let $B^{-}$ be a generalized inverse of a symmetric matrix $B$ and assume $B^{-}$ is also symmetric. Show that if $P = BB^{−}$ , then rank of $B$ is the same as trace of $P$

-

Hint: Let $\mathrm{rank}(B)=r$. We can write $B=Q(D_r\oplus 0_{n-r})Q^T$ where $Q$ is a real orthogonal matrix and $D_r$ is an $r\times r$ nonzero diagonal matrix. The Moore-Penrose generalized inverse is then $Q(D_r^{-1}\oplus 0_{n-r})Q^T$.