Given that $Y\sim N(\mu,\sigma^2I)$ where $\mu\in V$ ($V$ is a vector space with $\dim(V)=p$. If $P_V$ is the projection matrix of $Y$ on $V$ then, we define $$\hat{\mu}=P_VY.$$ Then, $$E(||\hat{\mu}||^2)=E(\hat{\mu}'\hat{\mu})=E(Y'P_V'P_VY).$$ Until this, I understand what they're doing. What formula was used for the next step? It's probably a basic formula that I can't recall right now-
$$E(||\hat{\mu}||^2)=E(Y'P_V'P_VY)=\mu'P_V\mu+\text{trace}(P_V\sigma^2)$$
Generally, for a random vector $X$ with mean $\mu$ and covariance $\Sigma$, and some fixed (symmetric) matrix $A$, $$ E (X^T A X) = \text{tr}(A \Sigma) + \mu^T A \mu. $$ If this is an orthogonal projection, then $P$ is symmetric, and so $P^T P = P^2 = P$, the final equality holding because projections are idempotent.