Matrix Determinant Lemma — Definition, Formula & Example
The matrix determinant lemma is a shortcut for finding the determinant of a matrix after you add a rank-one update to it. If you already know and , you multiply by one scalar correction factor instead of expanding a whole new determinant.
Let be an invertible matrix and let be column vectors. Then . A version that holds for every square , invertible or not, is .
Key Formula
Where:
- = An invertible matrix
- = Column vectors with entries each
- = Their outer product, an matrix of rank one (when )
- = A single number (a result)
How It Works
First prove the special case . Direct multiplication gives the block identity . Each outer factor is block triangular with determinant 1. Taking determinants of both sides therefore gives . For a general invertible , write and apply the special case with in place of .
Worked Example
Problem: Let , , and . Use the matrix determinant lemma to find .
Step 1: Since is diagonal, its determinant is the product of its diagonal entries. Its inverse just flips each diagonal entry, so is easy to compute.
Step 2: Take the dot product of with to get the scalar .
Step 3: Apply the lemma.
Answer: . You can confirm this by expanding directly, but the lemma needed only one dot product.
Why It Matters
Statistics and machine learning code often updates a covariance matrix by one rank-one term at a time, for example when adding a single data point. The lemma updates the determinant, and the log-likelihood that depends on it, in operations instead of recomputing it in . It is the determinant counterpart of the Sherman–Morrison inverse formula, and code that updates a matrix's inverse with Sherman–Morrison often updates its determinant with this lemma at the same time.
Common Mistakes
Mistake: Assuming determinants add, so that .
Correction: Determinants are not additive. For the matrix has rank at most one, so . That shortcut would wrongly return in the example above. The lemma's correct correction is the factor , which multiplies .
