Find right inverse of a matrix

linear algebramatrices

Given a matrix $A\in \mathbb{R}^{m\times n}$, the right inverse $B\in \mathbb{R}^{n\times m}$ satisfies $AB=I_{m}$.

Here is what I learned: $B$ exists iff $A$ has full row rank (?). $B$ is not unique. One possible solution is $B=A^T(AA^T)^{-1}$ if $A$ has full row rank. This is easy to see since $AB=AA^T(AA^T)^{-1}=I$ and $AA^T$ is a full rank square matrix.
[Reference: wikipedia, Berkeley, MIT
]

I tried the following calculation. It seems wrong but I cannot identify the error in reasoning. Please help me check this.
$$
AB=I \Rightarrow A^TAB=A^T I = A^T \Rightarrow (A^TA)^{-1}A^TAB= (A^TA)^{-1}A^T
\Rightarrow B=(A^TA)^{-1}A^T
$$

assuming $A$ has full column rank.

This seems wrong because: (1) This is the solution for left inverse according to MIT
, rather than the right inverse. (2) I only need the assumption that $A$ has full column rank, while the existence condition for right inverse is full row rank.

Best Answer

You assumed that $B$ is a right inverse (so $A$ has full row rank) and assumed as well that $A$ has full column rank. So you have in essence assumed that $A$ is invertible to start with.

The mistake in your reasoning is that you never checked that your $B=(A^\top A)^{-1}A^\top$ is in fact a right inverse. Did you check that $A(A^\top A)^{-1}A^\top = I_m$? Indeed, the matrix $A(A^\top A)^{-1}A^\top$ gives orthogonal projection onto the column space of $A$, and so this will be a right inverse if and only if the column space is all of $\Bbb R^m$. That is, $m=n$ and $A$ is invertible.

Related Question