Linear Algebra
4.68 min read

Caveats: Non-Commutativity and Zero Products

Non-commutativity: ABBAAB \neq BA in general, even for square matrices. A simple example: rotate then scale is different from scale then rotate (if scales are non-uniform). This is the most important difference from scalar arithmetic.

Zero products: For scalars, ab=0ab = 0 implies a=0a = 0 or b=0b = 0. For matrices this fails: ABAB can be the zero matrix with A0A \neq 0 and B0B \neq 0. This happens when the columns of BB all lie in the null space of AA.

No cancellation: AB=ACAB = AC does NOT imply B=CB = C (unless AA is invertible). Similarly BA=CABA = CA does not imply B=CB = C.

Formal View

Example 4.6 — Zero Product of Nonzero Matrices
A=(0100)A = \begin{pmatrix}0 & 1\\0 & 0\end{pmatrix}, B=(1000)B = \begin{pmatrix}1 & 0\\0 & 0\end{pmatrix}. Then AB=(0000)AB = \begin{pmatrix}0 & 0\\0 & 0\end{pmatrix} even though A0A \neq 0 and B0B \neq 0.

Why This Matters

These failures of familiar algebra cause subtle bugs in matrix computations and derivations.

  • In programming: matrix product order in shader code critically affects 3D rendering
  • In quantum mechanics: operator order (commutators) determines observable properties
  • Numerical: accumulation of rounding errors differs between (AB)C(AB)C and A(BC)A(BC) despite mathematical equality

Quiz

Question 1

If AB=0AB = 0, then either A=0A = 0 or B=0B = 0.

Common Mistakes

  • Applying scalar arithmetic rules (ab=baab = ba, ab=0a=0ab = 0 \Rightarrow a = 0) to matrices.
  • Canceling matrices from both sides of an equation without checking invertibility.