TITLE: Proof of a matrix identity involving the Moore-Penrose pseudo-inverse.
QUESTION [5 upvotes]: I'm having trouble proving the following.
$A^\top B A (A^\top B A)^{\dagger} A^\top B = A^\top B$
In the above, $A$ ($n \times m$) and $B$ ($n \times n$) are any matrices (i.e. possibly rank-deficient).
Edit: OK, I see it doesn't hold for general $B$. But what about the case where $A$ is still arbitrary, but $B$ is invertible? 
I have made two attempts. First, there is the well-known identity $A^\top B A (A^\top B A)^{\dagger} A^\top B A = A^\top B A$. But this doesn't imply the result because $A$ may have linearly dependent rows.
Also, it is easy to show the result for $B=I$ by taking the SVD of $A$ and cancelling terms on the left-hand side. Sadly, this doesn't seem to generalize.
I apologize in advance if the question is trivial - I am a computer scientist and don't have much experience doing this sort of thing.

REPLY [2 votes]: $\def\Id{\operatorname{Id}}\def\B{\begin{pmatrix} 0 & 1 \\ 0 & 0\end{pmatrix}}\def\C{\begin{pmatrix} 0 & 1 \\ 1 & 0\end{pmatrix}}$Sure, that this is correct? Let $A = B = \B$. Then 
\[
  A^\top BA = \B^\top BA = \B^\top \B^2 = 0.
\]
so $(A^\top BA)^\dagger = 0$. But
\[ A^\top B = \begin{pmatrix} 0 & 0 \\ 1 & 0\end{pmatrix} \B = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}
\]
So $A^\top B A(A^\top BA)^\dagger A^\top B = 0 \ne A^\top B$.

Addendum: Invertibility of $B$ isn't sufficient either. Let $A = \B$ and $B = \C$, then
\[
A^\top BA = \B^\top \C \B = \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix}\begin{pmatrix}0 & 0 \\0 & 1 \end{pmatrix} = 0
\]
Hence again $(A^\top B A)^\dagger = 0$, but $A^\top B \ne 0$, as $A \ne 0$ and $B$ is invertible.