We are given an $m\times n$ matrix $A$, where $m>n$, and a symmetric orthogonal projection matrix $P$. The projection matrix has $p$ nonzero eigenvalues and $p<n$. Is it possible to find a transformation that partitions $A$ into blocks of rows that are and are not affected by $P$, while preserving the value of $\text{trace}(APA^T)$?
The partitioning should have the form $$A' = \begin{bmatrix}X \\ Y\end{bmatrix},$$ where $X$ is $p\times n$ and $Y$ is $m-p \times n$. The effect of the projection matrix can be expressed $$A'P = \begin{bmatrix}X \\ Y\end{bmatrix}P = \begin{bmatrix}X \\ YP\end{bmatrix}.$$
First attempt: The trace is preserved under a similarity transform, i.e. $$\text{trace}(APA^T) = \text{trace}(WAPA^TW^{-1}).$$ Now the question is if it is possible to find such $W$ that satisfies $$WA=A'.$$
Here is where I get stuck though. Maybe it is possible to construct $W$ from the eigenvectors of $P$?
After discussing this question with @joriki in the chat above, I formulated the problem more precisely. It turns out that this partitioning can be done and in many different ways. One would, however, have to make more assumptions in order to find an explicit solution.
In brief, the partitioning can be accomplished by first transforming $A$ into a matrix that has zeros in the last $m-n$ rows. This is done by factoring as $A=QL$, where $Q$ is an orthogonal matrix and $L$ is a lower trapezoidal matrix. Then the first $n$ rows of $L$ can be transformed in a way that $p$ of them are invariant under the given projection and $n-p$ would be annihilated.