Generalized Inverse in terms of Projection Matrices Definition:
A matrix $G$ is called the generalized inverse(g-inverse) or Pseudo inverse of $A$ iff $AGA=A$
It should be noted that g inverses are not unique.While looking at the different expressions for g inverse I came across the following
For a given matrix $A$ and a given g inverse $G$.$X$ is a g-inverse of $A$ iff there are matrices $V$ and $W$ such that $X=G+V(I-P_A)+(I-P_{A^*})W$.Where $P_A$ and $P_{A^*}$ are projections onto the column spaces of $A$ and $A^*$.($A^*$ is the conjugate transpose of $A$)
I want to know what is the inspiration towards coming up with such an expression and how something like this can be proved.
N.B: I am just a 1st yr undergraduate so I am not familiar with many higher level topics
 A: It basically arises from the expansion of the right hand side of
$$
X-G=[(I_n-\Pi_1)+\Pi_1]\ (X-G)\ [(I_m-\Pi_2)+\Pi_2]
$$
for some appropriate projection matrices $\Pi_1$ and $\Pi_2$.
Let $A\in\mathbb F^{m\times n}$ and $A^g,G,X\in\mathbb F^{n\times m}$ be any three generalised inverses of $A$. Let $\Delta=X-G\in\mathbb F^{n\times m}$. Then $A\Delta A=0$ and hence
\begin{aligned}
\Delta&=(I_n-A^gA)\Delta+A^gA\Delta\\
&=(I_n-A^gA)\underbrace{\Delta}_W+\underbrace{A^gA\Delta}_V(I_m-AA^g)+A^g\underbrace{A\Delta A}_0A^g.\\
\end{aligned}
Therefore
$$
X=G+(I_n-A^gA)W+V(I_m-AA^g)\tag{1}
$$
for some matrices $V$ and $W$ of appropriate sizes. Since $A^g$ is a generalised inverse of $A$, both $(I_n-A^gA)$ and $(I_m-AA^g)$ are idempotent, i.e., they are projection matrices.
In particular, if the underlying field is real or complex and if you take $A^g=A^+$, the Moore-Penrose pseudo-inverse of $A$, then $AA^g$ becomes the orthogonal projection matrix $P_A$ and $A^gA$ becomes $P_{A^\ast}$. However, the form $(1)$ is more general, as we can use any sort of generalised inverse and it works over any field.
