Zero divisor

In abstract algebra, an element $a$ of a ring $R$ is called a left zero divisor if there exists a nonzero $x$ in $R$ such that $ax = 0$, or equivalently if the map from $R$ to $R$ that sends $x$ to $ax$ is not injective. Similarly, an element $ax = ay$ of a ring is called a right zero divisor if there exists a nonzero $x$ in $y$ such that $a(x − y) = 0$. This is a partial case of divisibility in rings. An element that is a left or a right zero divisor is simply called a zero divisor. An element $a$ that is both a left and a right zero divisor is called a two-sided zero divisor (the nonzero $y$ such that $R$ may be different from the nonzero $ya = 0$ such that $a$). If the ring is commutative, then the left and right zero divisors are the same.

An element of a ring that is not a left zero divisor (respectively, not a right zero divisor) is called left regular or left cancellable (respectively, right regular or right cancellable). An element of a ring that is left and right cancellable, and is hence not a zero divisor, is called regular or cancellable, or a non-zero-divisor. A zero divisor that is nonzero is called a nonzero zero divisor or a nontrivial zero divisor. A non-zero ring with no nontrivial zero divisors is called a domain.

Examples
$$\begin{pmatrix}1&1\\2&2\end{pmatrix}\begin{pmatrix}1&1\\-1&-1\end{pmatrix}=\begin{pmatrix}-2&1\\-2&1\end{pmatrix}\begin{pmatrix}1&1\\2&2\end{pmatrix}=\begin{pmatrix}0&0\\0&0\end{pmatrix} ,$$ $$\begin{pmatrix}1&0\\0&0\end{pmatrix}\begin{pmatrix}0&0\\0&1\end{pmatrix} =\begin{pmatrix}0&0\\0&1\end{pmatrix}\begin{pmatrix}1&0\\0&0\end{pmatrix} =\begin{pmatrix}0&0\\0&0\end{pmatrix}.$$
 * In the ring $\mathbb{Z}/4\mathbb{Z}$, the residue class $$\overline{2}$$ is a zero divisor since $$\overline{2} \times \overline{2}=\overline{4}=\overline{0}$$.
 * The only zero divisor of the ring $$\mathbb{Z}$$ of integers is $$0$$.
 * A nilpotent element of a nonzero ring is always a two-sided zero divisor.
 * An idempotent element $$e\ne 1$$ of a ring is always a two-sided zero divisor, since $$e(1-e)=0=(1-e)e$$.
 * The ring of n&thinsp;×&thinsp;n matrices over a field has nonzero zero divisors if n ≥ 2. Examples of zero divisors in the ring of 2&thinsp;×&thinsp;2 matrices (over any nonzero ring) are shown here:
 * A direct product of two or more nonzero rings always has nonzero zero divisors. For example, in $$R_1 \times R_2$$ with each $$R_i$$ nonzero, $$(1,0)(0,1) = (0,0)$$, so $$(1,0)$$ is a zero divisor.
 * Let $$K$$ be a field and $$G$$ be a group. Suppose that $$G$$ has an element $$g$$ of finite order $$n > 1$$. Then in the group ring $$K[G]$$ one has $$(1-g)(1+g+ \cdots +g^{n-1})=1-g^{n}=0$$, with neither factor being zero, so $$1-g$$ is a nonzero zero divisor in $$K[G]$$.

One-sided zero-divisor

 * Consider the ring of (formal) matrices $$\begin{pmatrix}x&y\\0&z\end{pmatrix}$$ with $$x,z\in\mathbb{Z}$$ and $$y\in\mathbb{Z}/2\mathbb{Z}$$. Then $$\begin{pmatrix}x&y\\0&z\end{pmatrix}\begin{pmatrix}a&b\\0&c\end{pmatrix}=\begin{pmatrix}xa&xb+yc\\0&zc\end{pmatrix}$$ and $$\begin{pmatrix}a&b\\0&c\end{pmatrix}\begin{pmatrix}x&y\\0&z\end{pmatrix}=\begin{pmatrix}xa&ya+zb\\0&zc\end{pmatrix}$$. If $$x\ne0\ne z$$, then $$\begin{pmatrix}x&y\\0&z\end{pmatrix}$$ is a left zero divisor if and only if $$x$$ is even, since $$\begin{pmatrix}x&y\\0&z\end{pmatrix}\begin{pmatrix}0&1\\0&0\end{pmatrix}=\begin{pmatrix}0&x\\0&0\end{pmatrix}$$, and it is a right zero divisor if and only if $$z$$ is even for similar reasons. If either of $$x,z$$ is $$0$$, then it is a two-sided zero-divisor.
 * Here is another example of a ring with an element that is a zero divisor on one side only. Let $$S$$ be the set of all sequences of integers $$(a_1,a_2,a_3,...)$$.  Take for the ring all additive maps from $$S$$ to $$S$$, with pointwise addition and composition as the ring operations. (That is, our ring is $$\mathrm{End}(S)$$, the endomorphism ring of the additive group $$S$$.) Three examples of elements of this ring are the right shift $$R(a_1,a_2,a_3,...)=(0,a_1,a_2,...)$$, the left shift $$L(a_1,a_2,a_3,...)=(a_2,a_3,a_4,...)$$, and the projection map onto the first factor $$P(a_1,a_2,a_3,...)=(a_1,0,0,...)$$.  All three of these additive maps are not zero, and the composites $$LP$$ and $$PR$$ are both zero, so $$L$$ is a left zero divisor and $$R$$ is a right zero divisor in the ring of additive maps from $$S$$ to $$S$$.  However, $$L$$ is not a right zero divisor and $$R$$ is not a left zero divisor: the composite $$LR$$ is the identity. $$RL$$ is a two-sided zero-divisor since $$RLP=0=PRL$$, while $$LR=1$$ is not in any direction.

Non-examples

 * The ring of integers modulo a prime number has no nonzero zero divisors. Since every nonzero element is a unit, this ring is a finite field.
 * More generally, a division ring has no nonzero zero divisors.
 * A non-zero commutative ring whose only zero divisor is 0 is called an integral domain.

Properties

 * In the ring of $n$&thinsp;×&thinsp;$n$ matrices over a field, the left and right zero divisors coincide; they are precisely the singular matrices. In the ring of $n$&thinsp;×&thinsp;$n$ matrices over an integral domain, the zero divisors are precisely the matrices with determinant zero.
 * Left or right zero divisors can never be units, because if $x$ is invertible and $ax = 0$ for some nonzero $y$, then $ya = 0$, a contradiction.
 * An element is cancellable on the side on which it is regular. That is, if $a$ is a left regular, $ax = 0$ implies that $x$, and similarly for right regular.

Zero as a zero divisor
There is no need for a separate convention for the case $0 = a^{−1}0 = a^{−1}ax = x$, because the definition applies also in this case:
 * If $a$ is a ring other than the zero ring, then $ax = ay$ is a (two-sided) zero divisor, because any nonzero element $x$ satisfies $x = y$.
 * If $a = 0$ is the zero ring, in which $R$, then $0$ is not a zero divisor, because there is no nonzero element that when multiplied by $0x = 0 = x&hairsp;0$ yields $R$.

Some references include or exclude $0 = 1$ as a zero divisor in all rings by convention, but they then suffer from having to introduce exceptions in statements such as the following:
 * In a commutative ring $0$, the set of non-zero-divisors is a multiplicative set in $R$. (This, in turn, is important for the definition of the total quotient ring.)  The same is true of the set of non-left-zero-divisors and the set of non-right-zero-divisors in an arbitrary ring, commutative or not.
 * In a commutative noetherian ring $0$, the set of zero divisors is the union of the associated prime ideals of $0$.

Zero divisor on a module
Let $R$ be a commutative ring, let $M$ be an $R$-module, and let $a$ be an element of $R$. One says that $a$ is $M$-regular if the "multiplication by $a$" map $$M \,\stackrel{a}\to\, M$$ is injective, and that $a$ is a zero divisor on $M$ otherwise. The set of $M$-regular elements is a multiplicative set in $R$.

Specializing the definitions of "$M$-regular" and "zero divisor on $M$" to the case $0$ recovers the definitions of "regular" and "zero divisor" given earlier in this article.