Matrix Inversion Lemma — Definition, Formula & Example
The matrix inversion lemma is a formula for the inverse of a matrix that has received a low-rank change. If you already know , you can find by inverting only a small matrix instead of redoing the full inverse.
Let be an invertible matrix and an invertible matrix. Let be and be . Then is invertible if and only if is invertible. When it is, the Woodbury identity below holds. The case , , , is the Sherman–Morrison formula: , valid whenever .
Key Formula
Where:
- = Invertible n × n matrix whose inverse you already know
- = n × k matrix (often k is much smaller than n)
- = Invertible k × k matrix
- = k × n matrix
- = The small k × k matrix you actually have to invert
Worked Example
Problem: Find the inverse of using the Sherman–Morrison formula.
Step 1: Write as an easy matrix plus a rank-one update. With and , you get and . Compute the scalar in the denominator.
Step 2: Compute the numerator. Let , the matrix of all ones.
Step 3: Substitute into the formula. The only division is by the scalar .
Answer: . Check: since , .
Why It Matters
In recursive least squares, and in the Kalman filter with scalar measurements, each new measurement adds a rank-one term to a matrix whose inverse you already track. Sherman–Morrison updates that inverse in about operations instead of the roughly needed to invert from scratch. The same identity speeds up Gaussian process regression and ridge regression in machine learning when is much smaller than .
Common Mistakes
Mistake: Assuming , as if inverses split over sums.
Correction: Matrix inversion does not distribute over addition. Also, has rank at most , so for it is not even invertible. Use the full identity, and keep the products in the stated order, since is but is generally not defined.
