<s>[INST] Finding right inverse matrix Given a $3\times 4$ matrix $A$ such as 
$$
        \begin{pmatrix}
        1 & 1 & 1 & 1 \\
        0 & 1 & 1 & 0 \\
        0 & 0 & 1 & 1 \\
        \end{pmatrix}
,$$ 
find a matrix $B_{4\times 3}$  such that
$$AB =
        \begin{pmatrix}
        1 & 0 & 0  \\
        0 & 1 & 0  \\
        0 & 0 & 1  \\
        \end{pmatrix}
$$
Apart from simply multiplying $A$ with $B$ and generating a $12$ variable system of equations, is there any simpler way of finding $B$ ?
 [/INST] Consider the following case:
$$\begin{bmatrix}1&1&1&1\\0&1&1&0\\0&0&1&1\end{bmatrix}\times \begin{bmatrix}0&0&0\\?&?&?\\?&?&?\\?&?&?\end{bmatrix}=I$$
Removing the first row, the remaining matrix is square:
$$\begin{bmatrix}?&?&?\\?&?&?\\?&?&?\end{bmatrix}=\begin{bmatrix}1&1&1\\1&1&0\\0&1&1\end{bmatrix}^{-1}=\begin{bmatrix}1&0&-1\\-1&1&1\\1&-1&0\end{bmatrix}$$
$$B=\begin{bmatrix}0&0&0\\1&0&-1\\-1&1&1\\1&-1&0\end{bmatrix}$$
Of course there are infinite number of solutions
</s>