Rank-one update singularity criterion (source code)

= Rank-one update singularity criterion
{title2=$A+uv^T\text{ singular}\iff1+v^TA^{-1}u=0$}

For an <invertible matrix> $A$, the <rank-one matrix update> $B=A+uv^T$ is a <singular matrix> exactly when $1+v^TA^{-1}u=0$. This follows directly from the <matrix determinant lemma>. At that value, $u\ne0$ and the nonzero <vector> $w=A^{-1}u$ satisfies
$$
Bw=u+u(v^TA^{-1}u)=0.
$$
Every <vector> in the <kernel> is a multiple of $w$, since $Bx=0$ implies $x=-A^{-1}u(v^Tx)$. The <matrix rank> therefore drops by exactly one.

For $B(t)=I+tuv^T$ with $u=(1,2)^T$ and $v=(3,-1)^T$, the update becomes a <singular matrix> at $t=-1$, and $B(t)u=(1+t)u$. At $t=-0.99$, this direction is compressed by a factor $0.01$ and the inverse amplifies it by a factor 100. The actual <spectral norm> of the <matrix inverse>, which maximizes amplification over every direction, is about $700.17853409$.

\Image[/sherman-morrison-near-singularity.png]
{title=An inverse grows large as the rank-one update approaches its singular denominator}
{description=Here $\delta=1+t>0$ and $B(t)=I+tuv^T$ uses the same example <vectors>. The left panel shows $\|B(t)^{-1}\|_2$ and its lower bound $1/\delta$, obtained from the direction $u$. The right panel shows the <condition number> $\kappa_2(B)=\|B\|_2\|B^{-1}\|_2$. Both are computed from <singular values>; the missing point $\delta=0$ has no <matrix inverse>.}

The exact formula can expose a large <condition number> in the updated <linear system> even when the original one had a small <condition number>. It does not guarantee <numerical stability> merely because its evaluation uses fewer arithmetic operations. The denominator condition certifies existence; the <condition number> and floating-point behavior address different questions about using the resulting answer.