[Math] Determinant always equal to zero

determinantlinear algebra

I just finished writing a computer program that takes as input a number of matrices and computes the inverse of the product of matrices.

To test this program, I wanted to input a $3 \times 2$ matrix followed by a $2\times 3$ matrix so that the product would be a $3\times 3$ matrix. No matter how hard I try, the determinant of the product turns out to be zero and so the product is non-invertible. Is there a theorem in linear algebra that implies that the product of a $3\times 2$ matrix and $2\times 3$ matrix will always have determinant zero?

Best Answer

Yes.

If you consider a matrix $A$ as a linear mapping $v \mapsto Av$ then a square matrix has determinant different from zero if and only if the mapping is invertible. The product of matrices represents the composition of linear mappings. But for a composition to be invertible, it is required that the first mapping is injective. However a linear mapping from $3$D space to $2$D space cannot be injective...

added: alternative proof. Let $A$ be your $3\times 2$ matrix and $B$ the $2\times 3$ matrix so that $AB$ is a $3\times 3$ matrix. Now consider the $3\times 3$ matrices $A'$ and $B'$ constructed by adding a column of zeros to $A$ and a row of zeros to $B$. Then notice that $A'B'=AB$ because in the row-by-column multiplication in $A'B'$ you get the row-by-column multiplication in $AB$ plus a $0\cdot 0$. Now you know that $\det A'=\det B'=0$ hence $\det AB = \det A'B' = \det A' \det B' = 0$.