The Generalized Inverse

You learned to "undo" a matrix with its inverse G^{-1}: multiply by it and Gm = d unravels into m = G^{-1}d. Clean — but it only works when G is square and non-singular. Real inverse problems almost never oblige. A survey with 500 measurements and 3 unknowns gives a tall 500\times3 matrix; a blurry image reconstructed from too few measurements gives a wide one; and rank-deficient operators are everywhere. G^{-1} simply does not exist for any of them.

So do we give up on "inverting"? No — we generalize it. The Moore–Penrose pseudoinverse G^{+} extends the idea of an inverse to any matrix at all — tall, wide, square, full-rank or rank-deficient — and always returns one sensible, well-defined answer. Its defining promise:

\hat m = G^{+}d \text{ is always the least-squares, minimum-norm solution.}

Read that as a two-part guarantee. First, it fits the data as well as possible (least squares). Second, among all the equally-good fits, it picks the smallest model (minimum norm). One symbol, one answer, every shape of problem.

Two regimes, one symbol

The single symbol G^{+} quietly switches behaviour depending on the shape of the problem — and in each regime it reduces to a formula you may already know.

And when G is square and invertible, both formulas collapse back to the ordinary inverse: G^{+} = G^{-1}. So the pseudoinverse doesn't replace what you know — it contains it as the special case, and reaches out to cover all the cases the ordinary inverse could not.

When G is rank-deficient, neither formula applies — the matrix you would need to invert (G^{\mathsf T}G or GG^{\mathsf T}) is itself singular. The pseudoinverse still exists, but to build it we need a decomposition that exposes the rank directly — the SVD, the universal route to G^{+}.

Worked example: over-determined — one unknown, two readings

Suppose one unknown m is measured twice, giving d = (2, 4)^{\mathsf T}, with model G = (1, 1)^{\mathsf T} (both readings should equal m). No single m gives both a 2 and a 4, so this is over-determined. Apply the tall formula: G^{\mathsf T}G = 2, G^{\mathsf T}d = 6, so

\hat m = G^{+}d = (G^{\mathsf T}G)^{-1}G^{\mathsf T}d = \tfrac{1}{2}\cdot 6 = 3.

The pseudoinverse hands back the average of the two readings — the honest least-squares compromise between the conflicting measurements.

Worked example: under-determined — one reading, two unknowns

Now flip it. A single equation m_1 + m_2 = 6 constrains two unknowns: G = (1, 1) (a wide matrix), d = 6. There are infinitely many exact solutions — (6,0), (0,6), (-100, 106), all fit perfectly. Which one should an honest method report? The pseudoinverse picks the minimum-norm solution: the point on the solution line closest to the origin. Using the wide formula G^{+} = G^{\mathsf T}(GG^{\mathsf T})^{-1} with GG^{\mathsf T} = 2,

\hat m = G^{+}d = \begin{bmatrix} 1 \\ 1 \end{bmatrix}\tfrac{1}{2}\cdot 6 = \begin{bmatrix} 3 \\ 3 \end{bmatrix}.

Out of infinitely many models that fit, it chooses (3, 3) — the least "extreme" one, splitting the total evenly and refusing to invent a wild swing between the two components that the single measurement never demanded. Minimum norm is the mathematical form of "don't claim more structure than the data forces on you."

What makes it the generalized inverse

You might wonder: couldn't you invent a dozen different "sort-of-inverses" for a non-square matrix? You can — but only one satisfies all four of the conditions Roger Penrose wrote down in 1955, and that uniqueness is what earns G^{+} the definite article. The conditions say, in plain terms:

Those last two projections are the geometric heart of the story. GG^{+} projects the data d orthogonally onto the column space (the reachable part) — that is the least-squares step. And G^{+}G projects any model onto the row space, throwing away the null-space component that the data can never see — that is the minimum-norm step. The two projections, packed into one matrix, are exactly why G^{+}d is simultaneously the best fit and the smallest model.

There is a single number that ties it back to the ordinary inverse. If G happens to be square with no zero singular values, both projections become the full identity, both Penrose "sandwich" identities collapse to GG^{+} = I, and G^{+} is forced to equal G^{-1}. The generalized inverse was the ordinary inverse all along, just stretched to survive the cases where the ordinary one falls apart.

It is tempting to think G^{+} solves ill-posed problems. It does not. The pseudoinverse fixes the questions of existence and uniqueness: it always returns exactly one, well-defined answer, no matter the shape or rank of G. But it does nothing for stability.

If G is ill-conditioned, then G^{+} carries enormous entries, and \hat m = G^{+}d multiplies your measurement noise by those enormous numbers. The "minimum-norm least-squares solution" can still be a noise-amplified catastrophe — wildly oscillating, physically meaningless, and utterly wrong, even though it is the mathematically correct pseudoinverse answer. A well-defined answer is not the same as a trustworthy one. To tame an ill-posed problem you must add extra information — you need Tikhonov regularization or the truncated SVD, which trade a little bias for a huge gain in stability. The pseudoinverse gets you a solution; regularization gets you a solution you can believe.

Cleanly, the pseudoinverse is computed from the SVD: decompose G = U\Sigma V^{\mathsf T}, invert the non-zero singular values, and reassemble. You almost never do this by hand, because every numerical computing environment ships it as a single built-in function — \texttt{pinv} in MATLAB, NumPy, Julia, and the rest. One command that gracefully handles over-determined, under-determined, and square systems alike, without you having to check which case you are in.

That one function quietly powers a surprising amount of daily life: your phone fixing its GPS position from more satellites than the minimum needed, a spreadsheet drawing a trendline through scattered points, a robot arm working out joint angles, an economist fitting a model to messy data. Every time, the same idea — extend "inverse" to any matrix, and let it pick the sensible answer.