The Woodbury matrix identity is a useful identity in linear algebra. It says that you can invert the sum of a matrix plus a \(k\)-rank correction by doing a rank \(k\)-correction to the inverse of the original matrix. It is also called matrix inversion lemma or Sherman-Morrison-Woodbury formula.

More explicitly the identity states:

\[\left( \mathbf{A} + \mathbf{U}\mathbf{C}\mathbf{V} \right)^{-1} = \mathbf{A}^{-1} - \mathbf{A}^{-1} \mathbf{U}\left( \mathbf{C}^{-1} + \mathbf{V} \mathbf{A}^{-1} \mathbf{U} \right)^{-1} V \mathbf{A}^{-1}\]

where \(\mathbf{A},\mathbf{U},\mathbf{C},\mathbf{V}\) are all matrices with the correct shapes, specifically, \(\mathbf{A}\) is a square \(n\times n\), \(\mathbf{U}\) is \(n \times k\), \(\mathbf{C}\) is \(k\times k\) and \(\mathbf{V}\) is \(k \times n\).

A more general form of the Woodbury matrix identity can be found using blockwise matrix inversion.

Further reading

Read more in the science topic.

Let's talk!

I'm Carlo Nicolini — I am interested on the reliability of AI reasoning systems (interpretability, inference-time methods, probabilistic language programming) and on quantitative portfolio optimization (I am a maintainer of skfolio). If you're working on something in these areas and think we might collaborate, chat, discuss, I'm happy to talk about it!

The best way to reach me is on via DM on LinkedIn.