Visual walkthrough — Pseudoinverse
Step 1 — What does a matrix even do to space?
WHAT. We draw the input world (left) and the output world (right). The machine carries the arrow across.
WHY. Before "inverting" anything, we must picture what forward motion looks like. An inverse is just "walk back along this arrow." If forward motion loses information, backward motion cannot be perfect — and that loss is the whole reason exists.
PICTURE. Look at the figure. The input vector (lavender) is squeezed and rotated into (coral) living on the tilted column-space sheet. Not every point in the output world lies on that sheet — those unreachable points are exactly where trouble begins.
In symbols, reading each piece:
Step 2 — The problem: is off the sheet
WHAT. We place (coral dot) floating above the tilted sheet, and mark the closest point on the sheet as .
WHY this idea and not another. "Closest" is the only fair meaning of best when exact is impossible. Closest means shortest distance — and shortest distance from a point to a flat sheet is always measured along the perpendicular (any slanted path is longer). That perpendicular is the seed of everything.
PICTURE. The dashed coral line from down to meets the sheet at a right angle (the small square). The length of that dashed line is the error we cannot avoid — the residual.
We square the length only because squaring removes the awkward square-root and gives a smooth bowl-shaped function that is easy to minimise — the minimum sits at the same place either way.
Step 3 — The perpendicular condition (this is orthogonal projection)
WHAT. We say " is perpendicular to all columns of " in one clean line.
WHY the dot product / transpose. To test perpendicularity against every column at once, we hit the residual with (each row of is a column of ). Getting all zeros means "no leftover leans along the sheet." This is the exact algebraic twin of the geometric right angle in Step 2 — see Orthogonal Projection.
PICTURE. The residual arrow (coral) stands up off the mint sheet; the columns lie flat in it. Every angle between the residual and a column is .
Expanding the bracket gives the normal equations — "normal" is old-fashioned for "perpendicular":
Step 4 — Tall case: solve it, and is born
WHAT. We isolate by undoing . Whatever now multiplies is the pseudoinverse — that is literally its definition here.
WHY this is allowed. Independent columns are exactly the condition that has no zero direction, so its ordinary inverse exists. If columns were dependent, would flatten a direction to zero and refuse to invert — that is Step 6.
PICTURE. (mint arrow) travels from the floating back into the input world, landing on the least-squares answer . It is a genuine left inverse: doing then returns you exactly, since
This is precisely Least Squares Regression: the best-fit line lives here.
Step 5 — Fat case: too many answers, pick the shortest
WHAT. Among all valid , we single out the one with the smallest length .
WHY "shortest". All solutions differ only by vectors in the null space (directions crushes to zero — free, wasted energy; see Four Fundamental Subspaces). Removing all null-space content leaves the unique piece lying in the row space. The trick forces into the row space automatically, killing the junk. Shortest = perpendicular to the solution line.
PICTURE. The green solution line drifts through space; the mint dot is the point on it nearest the origin, sitting perpendicular to the line's direction (the null-space arrow).
Here is a right inverse: .
Step 6 — The degenerate case: a squashed direction
WHAT. We picture the machine flattening a whole axis to zero — a pancake.
WHY we cannot fake it. Someone always suggests "just divide by a tiny instead of zero." But explodes, blasting noise sky-high (parent Mistake 3). The truthful move: a crushed direction carries no information, so its inverse contribution is exactly zero.
PICTURE. The input square (lavender) is pressed flat onto a single line (coral). The vertical direction is gone forever — no honest arrow brings it back.
Step 7 — SVD: the universal machine, direction by direction
WHAT. Because are pure rotations, undoing them is just rotating back (, ). Only the stretch step needs care.
WHY invert nonzeros only. In the diagonal , a nonzero stretch is reversed by shrinking with . A zero stretch (a crushed direction from Step 6) has no reverse — you leave it as a zero. Read term by term:
PICTURE. Follow the three coloured stages left-to-right for : rotate, stretch, rotate. Then the return path runs right-to-left: unrotate, un-stretch (only live axes), unrotate. The dead axis stays flat both ways.
This single formula reproduces Step 4 and Step 5 as special cases, and survives Step 6 unscathed. The squared stretches are the eigenvalues of .
The one-picture summary
The whole journey on one canvas: forward through we rotate, stretch, rotate and may lose a direction; backward through we unrotate, un-stretch the live parts, unrotate — recovering everything recoverable and nothing more.
Recall Feynman retelling — the whole walkthrough in plain words
A matrix is a machine that grabs your arrow and reshapes it, dropping it onto a flat sheet. You then ask it to hand your arrow back.
If your target floats off the sheet (noisy data), a perfect return is impossible — so drops a straight-down perpendicular to the nearest sheet point and returns that. That perpendicular is least squares (Steps 2–4), giving for tall matrices.
If instead the machine allows many correct returns (wide matrix), picks the shortest, laziest one — no wasted null-space wandering (Step 5), giving .
And when the machine flattens a direction to nothing (Step 6), no honest arrow can un-flatten it — so leaves it at zero. The SVD (Step 7) does this automatically: undo the rotations, invert only the living stretches, skip the dead ones. That is — the one formula to rule them all.
Recall
The residual at the least-squares solution is perpendicular to what? ::: The column space of (every column of ). Why is invertible in the tall case but not the rank-deficient case? ::: Independent columns give no zero direction; rank deficiency leaves a crushed direction that maps to zero. In the SVD formula, what happens to a zero singular value? ::: It stays zero in — that direction carries no information to invert. What makes the fat-matrix answer unique among infinitely many solutions? ::: It is the shortest one, perpendicular to the null space (all null content removed).
Connections
- Pseudoinverse — parent note; this page is its visual derivation.
- Orthogonal Projection — Step 2–3, the perpendicular that defines "closest."
- Least Squares Regression — Step 4, the tall-matrix application.
- Singular Value Decomposition — Step 7, the universal engine.
- Four Fundamental Subspaces — column space, row space, null space throughout.
- Eigenvalues and Eigenvectors — as eigenvalues of .
- Matrix Inverse — the special square case where all this collapses to .