Solution (source code)

= Solution

The <Reverse-order law for the Moore--Penrose inverse> is false in general. Take
$$
A=\begin{pmatrix}1&0\\0&2\\0&0\end{pmatrix},
\qquad
B=\begin{pmatrix}1\\1\end{pmatrix}.
$$
Then
$$
(AB)^\dagger=\begin{pmatrix}1/5&2/5&0\end{pmatrix},
\qquad
B^\dagger A^\dagger=\begin{pmatrix}1/2&1/4&0\end{pmatrix}.
$$
A sufficient condition is
$$
\operatorname{rank}(A)=n,
\qquad
\operatorname{rank}(B)=n,
$$
so that $A$ has <full column rank> and $B$ has <full row rank>. Indeed $A^\dagger A=I_n$ and $BB^\dagger=I_n$; these identities make $B^\dagger A^\dagger$ satisfy all four <Penrose equations> for $AB$.