Over a commutative ring, is a non-invertible matrix necessarily a zero divisor?

I know that over a field, every non-invertible matrix is a zero divisor. Does the same hold for matrices over an arbitrary commutative ring?

• Isn't $\pmatrix{1&2\\3&4}$ non-invertible over $\Bbb Z$? Commented Jul 1, 2017 at 7:35
• @LordSharktheUnknown thanks! Commented Jul 1, 2017 at 7:38
• In short, the answer is "no" when there exists a matrix whose determinant is neither a unit nor a zero divisor (zero included). Closely related (when the ring is not commutative): Is every noninvertible matrix a zero divisor?. Loosely related (when the commutative ring enjoys some special property): Do these matrix rings have non-zero elements that are neither units nor zero divisors?. Commented Jul 1, 2017 at 8:04
• Another simple counterexample: let your matrix ring be a $1 \times 1$ matrix ring over any integral domain which isn't a field. Commented Jul 1, 2017 at 8:15

In the case of $1\times 1$ matrices, which are just elements of the ring, you are asking whether every non-unit in a ring must be a zero divisor. This is obviously false, for instance, in the ring $\mathbb{Z}$.

• A good third of the questions we see here on matrices are answered by looking at 1-times-1 matrices ;-) Commented Jul 1, 2017 at 20:02

In $p$-adics any integer ending with $0$ is noninvertible, but a zero product requires a zero factor. Multiplication of two $p$-adic integers with only a finite number of total terminal zero digits gives a product with only that number of terminal zeroes.

The determinant makes sense for matrices over a commutative ring $R$ and it's easy to prove that the square matrix $A$ is invertible if and only if $\det A$ is invertible in the base ring.

On the other hand, if $d=\det A$ is not a zero divisor, then it becomes invertible in the full ring of quotients $Q(R)$ of $R$ (that is, $S^{-1}R$, where $S$ is the set of non zero divisors, which is a multiplicative set).

Thus the matrix $A$ becomes invertible when seen (via the canonical map $\lambda\colon R\to Q(R)$) as a matrix with entries in $Q(R)$. If $A$ is a (left) zero divisor (over $R$), there exists a nonzero matrix $B$ with $AB=0$. However, the canonical map $\lambda$ is injective, so when we see these matrices over $Q(R)$ we have the same relation and invertibility of $A$ forces $B=0$: contradiction. The same if $A$ is a right zero divisor.

Thus $A$ can be a zero divisor only if $\det A$ is a zero divisor in $R$ (including $0$, of course).