How can we know if a vector is in the range of a matrix? When I was reading the A.5.5 on Page 651 of B&V's Convex Optimization book. It presents a method to distinguish if a vector is in the range of a matrix $A$.

The range condition $Bv \in \mathcal{R}(A)$ can also be expressed as $(I − AA^{\dagger})Bv = 0$.

where $A$ is singular and $A^{\dagger}$ the Moore Penrose inverse of $A$. We can denote $Bv$ as $b$ to simplify the notation, i.e.,
$$\tag{1}
b\in\mathcal{R}(A)\Leftrightarrow (I − AA^{\dagger})b = 0
$$
I can prove the above from left to right as follows.
From the definition of Moore Penrose inverse, we have $A A^{\dagger} A=A$. Since $b\in\mathcal{R}(A)$, we can find a $x$
such that $Ax=b$. Then we have the following derivation
$$
(I − AA^{\dagger})b =b − AA^{\dagger}b = Ax− AA^{\dagger}Ax=Ax−Ax=0
$$
But I failed to show the reverse. Any instruction will be appreciated.
 A: For the Moore-Penrose inverse you have (see below)
$$
AA^\dagger = P_{\operatorname{ran}A}\qquad\text{and}\qquad A^\dagger A = P_{\operatorname{ran}A^*},
$$
where $P_M$ denotes the orthogonal projection onto the subspace $M$. Therefore,
$$
(I-AA^\dagger)b=0\;\Longleftrightarrow\; b = P_{\operatorname{ran}A}b.
$$
Hence, if this holds, then $b\in\operatorname{ran}A$. Conversely, if $b\in\operatorname{ran}A$, then $P_{\operatorname{ran}A}b = b$.

The Moore-Penrose inverse can be defined as follows. Let $A : \mathbb R^n\to\mathbb R^m$ be linear. Then
$$
\mathbb R^n = \ker A\oplus\operatorname{im}(A^\top)
$$
and
$$
\mathbb R^m = \ker(A^\top)\oplus\operatorname{im}A.
$$
Consider the restriction $R := A|_{\operatorname{im}(A^\top)}$. Since $\operatorname{im}(A^\top)$ is complementary to $\ker A$, we have that $R$ is injective. It maps $\operatorname{im}(A^\top)$ bijectively onto $\operatorname{im}A$, that is, $R : \operatorname{im}(A^\top)\to\operatorname{im}A$. The Moore-Penrose inverse can be defined as
$$
A^\dagger := R^{-1}P_{\operatorname{im}A}.
$$
As $R^{-1}$ is the inverse actio of $A$ on $\operatorname{im}(A^\top)$, we have $AA^\dagger = P_{\operatorname{im}A}$.
