# Finding all left inverses of a matrix

For large rectangular matrices, is this something that is easy or possible to achieve in the programming language R? Or to get all possible equations, must one solve equations by hand? I see notes about SVD here https://math.stackexchange.com/questions/1694351/finding-all-left-inverses-of-a-matrix, done on a 2 x 3 matrix. what if the matrix was ~ 200 x 10? how would one begin?

There will be an infinite number of left inverses. We can find a template for them using the pracma library in R. Let $$A$$ be a 200x10 matrix. The first step is to find one left inverse $$B$$, which we do as follows.
B <- pracma::pinv(A)

Now suppose that $$C$$ is some other left inverse, meaning $$C A = I = B A$$ and hence $$(C-B)A=\mathbf{0}.$$ Then $$C$$ is $$B$$ plus a 10x200 matrix composed of rows from the left null space of $$A$$. Since $$A$$ has rank at most 10, the dimension of the left null space will be at least 200-10 = 190. We can get a basis for it as follows.
basis <-  A |> t() |> pracma::nullspace() |> t()

Since the nullspace() function computes the right null space of a matrix, we transpose $$A$$ and then transpose the resulting basis matrix. So every vector in the left null space of $$A$$ is a linear combination of rows of the basis matrix, and therefore every left inverse of $$A$$ can be expressed as $$B$$ plus a matrix whose rows are linear combinations of the basis rows.