logo

Derivation of the Sherman-Morrison Formula 📂Matrix Algebra

Derivation of the Sherman-Morrison Formula

Theorem

Invertible matrix for ARn×nA \in \mathbb{R}^{n \times n} and u,vRn\mathbf{u} , \mathbf{v} \in \mathbb{R}^{n}, the following holds true. 1+vTA1u0    :(A+uvT)1 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} \ne 0 \iff \exists : \left( A + \mathbf{u} \mathbf{v}^{T} \right)^{-1}

Sherman-Morrison Formula

When (A+uvT)1\left( A + \mathbf{u} \mathbf{v}^{T} \right)^{-1} exists, the concrete formula is as follows. (A+uvT)1=A1A1uvTA11+vTA1u \left( A + \mathbf{u} \mathbf{v}^{T} \right)^{-1} = A^{-1} - {{ A^{-1} \mathbf{u} \mathbf{v}^{T} A^{-1} } \over { 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} }}

Explanation

The Sherman-Morrison formula itself can be widely used, such as in statistics to prove the Pearson theorem, etc. However, when just considering the proof of existence, one immediate application is to easily check whether an inverse matrix still exists when a small perturbation uvT\mathbf{u} \mathbf{v}^{T} is applied to AA, or when a specific row or column is added or subtracted.

The Sherman-Morrison formula itself shows that it is possible to find a new inverse matrix without going through the process of recalculating the inverse matrix through A1A^{-1}, using only matrix multiplication, scalar multiplication, addition, and subtraction. Compared to the effort of calculating an inverse matrix from scratch, this method is so efficient that it can hardly be called a calculation.

Proof 1

Existence

Matrix determinant lemma: For the invertible matrix ARn×nA \in \mathbb{R}^{n \times n} and u,vRn\mathbf{u} , \mathbf{v} \in \mathbb{R}^{n}, the following holds true. det(A+uvT)=(1+vTA1u)detA \det \left( A + \mathbf{u} \mathbf{v}^{T} \right) = \left( 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} \right) \det A

According to the matrix determinant lemma, det(A+uvT)=(1+vTA1u)detA \det \left( A + \mathbf{u} \mathbf{v}^{T} \right) = \left( 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} \right) \det A since AA is assumed to be an invertible matrix, detA0\det A \ne 0, and the necessary and sufficient condition for det(A+uvT)=0\det \left( A + \mathbf{u} \mathbf{v}^{T} \right) = 0 to hold is (1+vTA1u)=0\left( 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} \right) = 0.

Formula

It’s sufficient to just multiply (A+uvT)\left( A + \mathbf{u} \mathbf{v}^{T} \right) and (A1A1uvTA11+vTA1u)\left( A^{-1} - {{ A^{-1} \mathbf{u} \mathbf{v}^{T} A^{-1} } \over { 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} }} \right) and check if it’s the identity matrix II. (A+uvT)(A1A1uvTA11+vTA1u)=AA1+uvTA1AA1uvTA1+uvTA1uvTA11+vTA1u=I+uvTA1uvTA1+uvTA1uvTA11+vTA1u=I+uvTA1u(1+vTA1u)vTA11+vTA1u=I+uvTA1uvTA1=I \begin{align*} & \left( A + \mathbf{u} \mathbf{v}^{T} \right) \left( A^{-1} - {{ A^{-1} \mathbf{u} \mathbf{v}^{T} A^{-1} } \over { 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} }} \right) \\ =& A A^{-1} + \mathbf{u} \mathbf{v}^{T} A^{-1} - {{ A A^{-1} \mathbf{u} \mathbf{v}^{T} A^{-1} + \mathbf{u} \mathbf{v}^{T} A^{-1} \mathbf{u} \mathbf{v}^{T} A^{-1} } \over { 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} }} \\ =& I + \mathbf{u} \mathbf{v}^{T} A^{-1} - {{ \mathbf{u} \mathbf{v}^{T} A^{-1} + \mathbf{u} \mathbf{v}^{T} A^{-1} \mathbf{u} \mathbf{v}^{T} A^{-1} } \over { 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} }} \\ =& I + \mathbf{u} \mathbf{v}^{T} A^{-1} - {{ \mathbf{u} \left( 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} \right) \mathbf{v}^{T} A^{-1} } \over { 1 + \mathbf{v}^{T} A^{-1} \mathbf{u} }} \\ =& I + \mathbf{u} \mathbf{v}^{T} A^{-1} - \mathbf{u} \mathbf{v}^{T} A^{-1} \\ =& I \end{align*} Even if the order of multiplication is reversed, the result is the same, but this is omitted.