Search

Search papers and lessons

Schur Complement

Level 3 · 12 min read

The Schur complement is what remains of one block of a partitioned matrix after eliminating the other block, and it lets a large linear system be solved in smaller pieces.

On this page

  • Colour = topic mix
  • Linear algebra
  • Discrete math
  • Sign in to see your progress

TL;DR

Split a square matrix into four blocks, and suppose the top-left block AA is easy to invert. The Schur complement is S=D−CA−1BS = D - C A^{-1} B, where DD is the bottom-right block. It is the matrix you get after you remove the top-left block from the problem, and it is smaller than the original whenever AA is not a single number.

Solving a big system becomes two smaller solves: one with SS, then one with AA. This is the algebra behind block Gaussian elimination, and it appears wherever a large problem has a sparse, block-structured shape.

Where you'll see it: in bundle adjustment, where a 3D reconstruction is refined by solving a huge least-squares system whose cameras and points split cleanly into blocks, and in Gaussian-process and Kalman-filter updates, where a joint covariance is partitioned into observed and unobserved parts.

Intuition

Elimination, one block at a time

Solving a system of linear equations by hand, you use one equation to remove a variable from the others, then repeat on the smaller system. Block elimination does the same thing with groups of variables. If the group xx is the one you can eliminate cheaply, you solve for xx in terms of yy, substitute into the second group of equations, and what remains is a system only in yy. That remaining system is governed by the Schur complement.

The name fits the idea: it is the complement of the block you removed, the part of the matrix still standing once the easy block has been cleared away.

Why it is useful

Imagine a matrix with a structure like this:

M=(ABCD).M = \begin{pmatrix} A & B \\ C & D \end{pmatrix}.

If AA is diagonal, its inverse is trivial to compute: divide each diagonal entry by a number. If AA is also large, that cheapness is worth a lot. The Schur complement lets you pay the cost of inverting AA once, cheaply, and then work with a smaller matrix in place of MM.

flowchart LR
  M[Full system with blocks A B C D] --> E[Eliminate A: cheap because A is diagonal]
  E --> S[Schur complement S = D minus C A inverse B]
  S --> Y[Solve smaller system for the second group]
  Y --> X[Back-substitute to get the first group]

The math

Partitioned matrices and the complement

Let MM be a (p+q)×(p+q)(p+q) \times (p+q) matrix partitioned as above, where AA is p×pp \times p and invertible, BB is p×qp \times q, CC is q×pq \times p, and DD is q×qq \times q. The Schur complement of AA in MM is

S=D−CA−1B,S = D - C A^{-1} B,

a q×qq \times q matrix. The matrix A−1A^{-1} is the inverse of AA, and CA−1BC A^{-1} B is the product of three matrices, computed with the usual matrix multiplication rules.

Solving a block system

Consider the system M(xy)=(fg)M \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} f \\ g \end{pmatrix}, which expands to two equations:

Ax+By=f,Cx+Dy=g.A x + B y = f, \qquad C x + D y = g.

Solve the first for xx: x=A−1(f−By)x = A^{-1}(f - B y). Substitute into the second:

CA−1(f−By)+Dy=g⟹(D−CA−1B) y=g−CA−1f.C A^{-1}(f - B y) + D y = g \quad\Longrightarrow\quad (D - C A^{-1} B)\, y = g - C A^{-1} f.

So yy solves a system with the Schur complement as its matrix, and then x=A−1(f−By)x = A^{-1}(f - B y) recovers the first group. Only one inverse of AA is needed, and it appears in the form A−1BA^{-1} B, A−1fA^{-1} f and CA−1BC A^{-1} B.

The determinant identity

The determinant of the full matrix splits as

det⁡M=det⁡(A) det⁡(S),\det M = \det(A)\,\det(S),

valid whenever AA is invertible. It follows from factoring MM into three pieces:

M=(I0CA−1I)(A00S)(IA−1B0I).M = \begin{pmatrix} I & 0 \\ C A^{-1} & I \end{pmatrix}\begin{pmatrix} A & 0 \\ 0 & S \end{pmatrix}\begin{pmatrix} I & A^{-1} B \\ 0 & I \end{pmatrix}.

Multiplying out recovers MM (the lower-right entry is CA−1B+S=DC A^{-1} B + S = D). The outer matrices are triangular with ones on the diagonal, so each has determinant 1, and the middle one has determinant det⁡Adet⁡S\det A \det S. The identity is also how the determinant of a large matrix is computed in pieces.

The inverse of the lower-right block

The same algebra gives the lower-right block of M−1M^{-1} as S−1S^{-1}. So the Schur complement is not only a solver tool: it is exactly the block of the inverse that a statistician or an engineer usually needs when only part of the system is of interest.

Positivity

If MM is symmetric and positive definite, then AA and SS are also positive definite. This is what makes the complement safe to use in covariance calculations, where MM is a joint covariance matrix and SS is the conditional covariance of one group given the other.

Worked examples

Example
A 2 by 2 matrix with scalar blocks

Take M=(2112)M = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}, so A=2A = 2, B=1B = 1, C=1C = 1, D=2D = 2.

  1. Invert the top-left block: A−1=12=0.5A^{-1} = \frac{1}{2} = 0.5.
  2. Compute CA−1B=1×0.5×1=0.5C A^{-1} B = 1 \times 0.5 \times 1 = 0.5.
  3. Form the complement: S=D−CA−1B=2−0.5=1.5S = D - C A^{-1} B = 2 - 0.5 = 1.5.
  4. Check the determinant identity: det⁡M=2⋅2−1⋅1=3\det M = 2 \cdot 2 - 1 \cdot 1 = 3, and det⁡(A)det⁡(S)=2×1.5=3\det(A)\det(S) = 2 \times 1.5 = 3. They agree.
  5. Solve M(xy)=(33)M \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 3 \\ 3 \end{pmatrix} by the block method. The reduced equation is Sy=g−CA−1fS y = g - C A^{-1} f, so 1.5 y=3−0.5×3=1.51.5\,y = 3 - 0.5 \times 3 = 1.5, giving y=1y = 1.
  6. Recover x=A−1(f−By)=0.5×(3−1)=1x = A^{-1}(f - B y) = 0.5 \times (3 - 1) = 1.
  7. Check in the original system: 2(1)+1(1)=32(1) + 1(1) = 3 and 1(1)+2(1)=31(1) + 2(1) = 3. Both hold.

Interpretation: the block method gave the right answer using a 1×11 \times 1 system instead of a 2×22 \times 2 one. With blocks of size one this saves little. The saving grows when AA is large and diagonal.

Example
A 3 by 3 case with a 2 by 2 block

Take M=(201011113)M = \begin{pmatrix} 2 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 3 \end{pmatrix}, with A=(2001)A = \begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix}, B=(11)B = \begin{pmatrix} 1 \\ 1 \end{pmatrix}, C=(11)C = \begin{pmatrix} 1 & 1 \end{pmatrix} and D=3D = 3.

  1. Because AA is diagonal, A−1=(0.5001)A^{-1} = \begin{pmatrix} 0.5 & 0 \\ 0 & 1 \end{pmatrix}. This is the cheap step.
  2. Compute A−1B=(0.51)A^{-1} B = \begin{pmatrix} 0.5 \\ 1 \end{pmatrix}.
  3. Compute CA−1B=1×0.5+1×1=1.5C A^{-1} B = 1 \times 0.5 + 1 \times 1 = 1.5.
  4. Form the complement: S=3−1.5=1.5S = 3 - 1.5 = 1.5. It is a 1×11 \times 1 matrix, so the reduced system is a single equation.
  5. Check the determinant: det⁡M=2(1⋅3−1⋅1)+1(0⋅1−1⋅1)=4−1=3\det M = 2(1 \cdot 3 - 1 \cdot 1) + 1(0 \cdot 1 - 1 \cdot 1) = 4 - 1 = 3. And det⁡(A)det⁡(S)=(2⋅1)×1.5=3\det(A)\det(S) = (2 \cdot 1) \times 1.5 = 3. They agree.

Interpretation: the 3×33 \times 3 problem reduced to inverting a diagonal 2×22 \times 2 block and solving one scalar equation. The same pattern, with AA of size thousands and diagonal, is how the largest reconstruction problems stay tractable.

Tradeoffs and failure modes

SituationProblemBetter choice
AA is diagonal or sparseInverting AA is cheap, so the method pays offUse the Schur complement
AA is dense and smallThe block bookkeeping costs more than it savesSolve the whole system directly
AA is singular or nearly soA−1A^{-1} does not exist or is unstable, so SS is not definedReorder the blocks, or use a pivoted factorisation
SS is formed explicitly for a huge problemForming CA−1BC A^{-1} B can fill in sparsity and run out of memoryKeep SS implicit and use iterative solvers, or precondition
Only a numerical solution is neededRounding in A−1A^{-1} spreads into SSFactor AA rather than forming its inverse

The most common error is to write A−1A^{-1} in code when a factorisation of AA would be both faster and more accurate. The algebra says "invert", but in practice you rarely do.

History

Issai Schur studied block quotients of matrices in the early twentieth century, in work on bounded analytic functions and matrix theory. The name "Schur complement" was given later, and it is usually credited to Emilie Haynsworth, who used the term in the late 1960s when she studied the inertia of partitioned Hermitian matrices. Its value in applied work grew with numerical linear algebra, where block elimination and sparse factorisations became the standard way to solve large systems. In computer vision, the trick became central to bundle adjustment in the 1990s and 2000s, because the sparse block structure of camera and point parameters makes the Schur-reduced system small enough to solve many times per second. It caught on because it turns an algebraic identity into a practical speed-up.

Check yourself

QuestionWhat is the Schur complement of AA in M=(ABCD)M = \begin{pmatrix} A & B \\ C & D \end{pmatrix}?Show answer

It is S=D−CA−1BS = D - C A^{-1} B, the bottom-right block of MM with the part coming from eliminating the top-left block AA subtracted off. It is defined when AA is invertible.

QuestionTake A=4A = 4, B=2B = 2, C=2C = 2, D=5D = 5 as scalars. Compute SS and check det⁡M=det⁡(A)det⁡(S)\det M = \det(A)\det(S).Show answer

S=5−2⋅14⋅2=5−1=4S = 5 - 2 \cdot \frac{1}{4} \cdot 2 = 5 - 1 = 4. The determinant of MM is 4⋅5−2⋅2=164 \cdot 5 - 2 \cdot 2 = 16, and det⁡(A)det⁡(S)=4×4=16\det(A)\det(S) = 4 \times 4 = 16. They agree.

QuestionWhy is it cheaper to solve the block system with SS when AA is diagonal?Show answer

Inverting a diagonal matrix only requires inverting each diagonal entry, which costs one division per entry. The reduced system in SS is then the only dense solve left, and it is smaller than the original whenever AA has more than one row.

QuestionIn bundle adjustment, why are the point-to-point interactions in the matrix block diagonal?Show answer

Two 3D points do not appear together in any reprojection error, because each error term involves one point and one camera. So the block that couples points to points is diagonal in the point blocks, and each 3×33 \times 3 point block can be inverted independently.

QuestionWhy should you avoid forming A−1A^{-1} explicitly in a numerical solver?Show answer

Explicit inversion can lose accuracy when AA is ill-conditioned and can destroy sparsity. A factorisation of AA, applied to the right-hand sides, gives the same products A−1BA^{-1} B and A−1fA^{-1} f with better stability and less work.

Sources