Sylvester Determinant Theorem

lean4-prooflinear-algebravisualization
det(Im+AB)=det(In+BA)\det(I_m + AB) = \det(I_n + BA)

Statement

Let AA be an m×nm \times n matrix and BB an n×mn \times m matrix over a commutative ring RR. Then

det(Im+AB)=det(In+BA).\det(I_m + AB) = \det(I_n + BA).

This is sometimes called the Weinstein–Aronszajn identity. A striking consequence: even though ABAB is m×mm \times m and BABA is n×nn \times n (potentially very different sizes), the determinant of the identity-plus product is the same.

Visualization

Take A=(12)A = \begin{pmatrix} 1 \\ 2 \end{pmatrix} (column vector, 2×12 \times 1) and B=(34)B = \begin{pmatrix} 3 & 4 \end{pmatrix} (row vector, 1×21 \times 2).

AB=(12)(34)=(3468)R2×2AB = \begin{pmatrix} 1 \\ 2 \end{pmatrix}\begin{pmatrix} 3 & 4 \end{pmatrix} = \begin{pmatrix} 3 & 4 \\ 6 & 8 \end{pmatrix} \in \mathbb{R}^{2 \times 2}
BA=(34)(12)=(11)R1×1BA = \begin{pmatrix} 3 & 4 \end{pmatrix}\begin{pmatrix} 1 \\ 2 \end{pmatrix} = (11) \in \mathbb{R}^{1 \times 1}

Left side (2×22 \times 2):

det(I2+AB)=det(4469)=4946=3624=12.\det(I_2 + AB) = \det\begin{pmatrix} 4 & 4 \\ 6 & 9 \end{pmatrix} = 4 \cdot 9 - 4 \cdot 6 = 36 - 24 = 12.

Right side (1×11 \times 1):

det(I1+BA)=det(1+11)=det(12)=12.\det(I_1 + BA) = \det(1 + 11) = \det(12) = 12. \checkmark
QuantityValue
I2+ABI_2 + AB(4469)\begin{pmatrix} 4 & 4 \\ 6 & 9 \end{pmatrix}
det(I2+AB)\det(I_2 + AB)1212
I1+BAI_1 + BA(12)(12)
det(I1+BA)\det(I_1 + BA)1212

Proof Sketch

  1. Block matrix trick. Form the (m+n)×(m+n)(m+n)\times(m+n) block matrix
M=(ImABIn).M = \begin{pmatrix} I_m & A \\ B & I_n \end{pmatrix}.
  1. Two factorisations. Observe:
M=(Im0BIn)(ImA0In+BA)=(Im+ABA0In)(Im0BIn).M = \begin{pmatrix} I_m & 0 \\ B & I_n \end{pmatrix}\begin{pmatrix} I_m & A \\ 0 & I_n + BA \end{pmatrix} = \begin{pmatrix} I_m + AB & A \\ 0 & I_n \end{pmatrix}\begin{pmatrix} I_m & 0 \\ B & I_n \end{pmatrix}.
  1. Take determinants. The lower-triangular and upper-triangular factors have determinant 11, giving detM=det(In+BA)\det M = \det(I_n + BA) on the left and detM=det(Im+AB)\det M = \det(I_m + AB) on the right.

Connections

  • Determinant MultiplicativityDeterminant Multiplicativitydet(AB)=det(A)det(B)\det(AB) = \det(A)\,\det(B)The determinant of a product equals the product of determinantsRead more → — the proof reduces to det(M)=det(L1)det(U1)=det(U2)det(L2)\det(M) = \det(L_1)\det(U_1) = \det(U_2)\det(L_2) where each triangular factor contributes 11
  • Rank–Nullity TheoremRank–Nullity Theoremrank(f)+nullity(f)=dimV\operatorname{rank}(f) + \operatorname{nullity}(f) = \dim VThe dimensions of image and kernel of a linear map sum to the domain dimensionRead more → — when mnm \ne n, the identity det(Im+AB)=det(In+BA)\det(I_m + AB) = \det(I_n + BA) shows that the non-zero eigenvalues of ABAB and BABA coincide (both sides factor over these eigenvalues)
  • Cayley–Hamilton TheoremCayley–Hamilton TheorempA(A)=0  where  pA(λ)=det(λIA)p_A(A) = 0 \;\text{where}\; p_A(\lambda) = \det(\lambda I - A)Every square matrix satisfies its own characteristic polynomialRead more → — a polynomial identity consequence: χAB(t)/tmn=χBA(t)\chi_{AB}(t) / t^{m-n} = \chi_{BA}(t) (up to sign) follows from Sylvester's theorem applied to tIAtI - A

Lean4 Proof

import Mathlib.LinearAlgebra.Matrix.SchurComplement

/-- Sylvester's determinant theorem (Weinstein–Aronszajn identity):
    det(1 + A*B) = det(1 + B*A).
    Mathlib's direct alias is `Matrix.det_one_add_mul_comm`. -/
theorem sylvester_det
    {R : Type*} [CommRing R]
    {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n]
    (A : Matrix m n R) (B : Matrix n m R) :
    (1 + A * B).det = (1 + B * A).det :=
  Matrix.det_one_add_mul_comm A B