# Find right inverse of a matrix

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.

• Welcome to Math Stack Exchange! You might look here en.wikipedia.org/wiki/Moore–Penrose_inverse Dec 28, 2022 at 14:22

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.

• Thanks, I got it now! My reasoning starts with $AB=I$. I thought I was only using the definition with no assumptions. I realize now that the very first step can only be written under the assumption of full row rank. And yes, as you pointed out, if I further make the assumption of full column rank, $A$ is assumed to be (two-sided) invertible. That explains the solution I got for the right inverse is also the left inverse.
– July
Dec 28, 2022 at 20:50

The error is this. $$A^T A$$ is a square matrix with the same number of columns as $$A$$. If $$A$$ has full row rank but not full column rank, it can't be invertible because its rank can't be more than the rank of $$A$$. So there is no such thing as $$(A^TA)^{-1}$$ in this case.

• If I just assume $A$ has full column rank, then $A^T A$ is invertible. Using the above reasoning, I get a valid right inverse $B$. This means I don't even need the condition that $A$ has full row rank, which contradicts the existing statement (wiki, another post). Therefore, either my reasoning is wrong or the existing statement is wrong.
– July
Dec 28, 2022 at 18:44