Ma · Mathematics

What Conditions Make the Product of Two Matrices Zero?

Published By the 9to5Science editorial team

At a glance

  1. 1. Check dimensions

    Write A as m by n and B as n by p; their product is an m by p matrix.

  2. 2. Compare image and kernel

    AB is zero exactly when every column of B lies in the kernel of A.

  3. 3. Use the rank bound

    Rank-nullity gives rank(A) plus rank(B) at most n, the shared inner dimension.

  4. 4. Check the actual matrices

    The rank bound is necessary, but for specified matrices you must verify that A annihilates every column of B.

Try it: Matrix calculator

The condition AB=0AB=0 does not usually force either matrix to be zero. Instead, it says that the output of BB always lands in directions that AA sends to zero.

Suppose AA is an m×nm\times n matrix and BB is an n×pn\times p matrix, with entries over a field such as R\mathbb{R} or C\mathbb{C}. Their product is an m×pm\times p matrix. The key condition is

im⁡(B)⊆ker⁡(A).\operatorname{im}(B)\subseteq\ker(A).

Here, im⁡(B)\operatorname{im}(B) is the space spanned by the columns of BB, and ker⁡(A)\ker(A) is the set of vectors xx for which Ax=0Ax=0.

The exact condition for AB=0AB=0

View the matrices as linear maps:

B:Fp→Fn,A:Fn→Fm.B: \mathbb{F}^p\to\mathbb{F}^n, \qquad A: \mathbb{F}^n\to\mathbb{F}^m.

The composition ABAB first applies BB, then applies AA. Thus AB=0AB=0 precisely when A(Bx)=0A(Bx)=0 for every x∈Fpx\in\mathbb{F}^p. This means that each vector produced by BB is in the kernel of AA.

Equivalently, check the columns individually: if b1,…,bpb_1,\ldots,b_p are the columns of BB, then

AB=0⟺Abj=0 for every j.AB=0 \quad\Longleftrightarrow\quad Ab_j=0\text{ for every }j.

This is often the quickest way to test a particular pair of matrices.

A rank condition that must hold

By rank-nullity, the dimension of the kernel of AA is n−rank⁡(A)n-\operatorname{rank}(A). If AB=0AB=0, then the image of BB is contained in that kernel, so

rank⁡(B)≤dim⁡ker⁡(A)=n−rank⁡(A).\operatorname{rank}(B)\leq \dim\ker(A)=n-\operatorname{rank}(A).

Therefore,

rank⁡(A)+rank⁡(B)≤n.\operatorname{rank}(A)+\operatorname{rank}(B)\leq n.

The number nn here is the shared inner dimension: the number of columns of AA, which must equal the number of rows of BB.

This rank inequality is necessary for a given pair to have zero product, but it is not sufficient by itself. The column space of BB must actually lie in the kernel of $A.

Worked example

Let

A=[100000],B=[001001].A=\begin{bmatrix} 1&0&0\\ 0&0&0 \end{bmatrix}, \qquad B=\begin{bmatrix} 0&0\\ 1&0\\ 0&1 \end{bmatrix}.

Here AA is 2×32\times3 and BB is 3×23\times2, so the product is defined and will be 2×22\times2. The columns of BB are

[010]and[001].\begin{bmatrix}0\\1\\0\end{bmatrix} \quad\text{and}\quad \begin{bmatrix}0\\0\\1\end{bmatrix}.

The kernel of AA consists of vectors whose first coordinate is zero. Both columns of BB satisfy that condition. Direct multiplication confirms it:

AB=[100000][001001]=[0000].AB= \begin{bmatrix} 1&0&0\\ 0&0&0 \end{bmatrix} \begin{bmatrix} 0&0\\ 1&0\\ 0&1 \end{bmatrix} = \begin{bmatrix} 0&0\\ 0&0 \end{bmatrix}.

In this example, rank⁡(A)=1\operatorname{rank}(A)=1 and rank⁡(B)=2\operatorname{rank}(B)=2, so their ranks add to 33, the shared inner dimension.

What the condition says in special cases

  • If AA is invertible, then ker⁡(A)={0}\ker(A)=\{0\}. The condition AB=0AB=0 therefore forces B=0B=0.
  • If BB has full row rank nn, then im⁡(B)=Fn\operatorname{im}(B)=\mathbb{F}^n. For AB=0AB=0, AA must vanish on all of Fn\mathbb{F}^n, so A=0A=0.
  • If both matrices are square and invertible, their product cannot be zero.
  • If both matrices are nonzero, the shared dimension must be at least 22. For inner dimension 11, a nonzero AA is a nonzero column and a nonzero BB is a nonzero row; their product is a nonzero outer product.

In particular, for square n×nn\times n matrices, a nonzero product-zero pair requires each matrix to have rank at most n−1n-1, and their ranks must add to at most nn.

Common mistakes

Assuming one factor must be zero. This is true for scalar numbers, but not for matrices. For instance, the worked example has two nonzero factors and a zero product.

Using only the rank inequality. The inequality limits the possible ranks, but it does not establish that the vectors in the image of BB are in the kernel of AA. Check the columns or compute the product.

Confusing the dimensions. The product ABAB is defined when the number of columns of AA equals the number of rows of BB. Its zero matrix has the outer dimensions, m×pm\times p; it need not be square.

Reversing the order. In general, AB=0AB=0 does not imply BA=0BA=0. The two products may even have different dimensions or one may be undefined. The relevant condition for AB=0AB=0 is that BB‘s image lies in AA‘s kernel.

References

  1. Linear Algebra Done Right — Sheldon Axler
  2. Introduction to Linear Algebra — Gilbert Strang

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.