I have a strong suspicion this is a textbook linear algebra problem, but I have been unsuccessful in finding an answer.
Let $A$ be an $n \times m$ matrix and let $B$ be an $m \times n$ matrix where $n < m$. Suppose than $A$ has rank $n$ ($A$ has a right-inverse) and $B$ also has rank $n$ ($B$ has a left-inverse).
When is $AB$ invertible?
Here is what I have so far. Say that $AB$ is invertible and the inverse is $C$. Then,
$\left(CA\right) B = I_{n}$
And,
$A\left(B C\right) = I_{n}$.
Or: $BC$ must be a right-inverse of $A$ and $CA$ must be a left-inverse of $B$.
$CA = B^{-1}_{left} \implies C = B^{-1}_{left} A^{-1}_{right}$
$BC = A^{-1}_{right} \implies C = B^{-1}_{left}A^{-1}_{right}$
So, if $C$ exists, then I know what it is. If I know there is a $C$ such that $CA$ is a left-inverse of $B$ and $BC$ is a right-inverse of $A$, then the product is invertible. What I'm looking for are more primitive conditions on the matrices $A$ and $B$ that guarantee such a matrix exists.