Basic Properties of Rings

The first theorems about an arbitrary ring, each proved from the axioms alone. The zero, negatives and the identity are unique; a times 0 is 0; the rules of signs, including why (-1)(-1) = 1; multiples and powers, and why (a + b)^2 has four terms for matrices; units and the uniqueness of inverses, with the units of the Gaussian integers found from the norm; the group of units and the order of inverses in a product; and zero divisors among matrices and functions. Worked problems from the course's assignment close the article.

In every ring, from the axioms alone: the zero, each negative and the identity (if there is one) are unique; $a \cdot 0 = 0 \cdot a = 0$; $a(-b) = (-a)b = -(ab)$ and $(-a)(-b) = ab$, so $(-1)(-1) = 1$ in every ring with identity; and $1_R = 0_R$ only in the zero ring. Rules that need commutativity, such as $(a + b)^2 = a^2 + 2ab + b^2$ and $(ab)^2 = a^2b^2$, fail for $2 \times 2$ matrices but hold, with the binomial theorem, for elements that commute. A unit has exactly one inverse, the units form a group $R^\times$ with $(ab)^{-1} = b^{-1}a^{-1}$, and the norm shows that the Gaussian integers have exactly four units, $\pm 1$ and $\pm i$. A unit is never a zero divisor, and every nonzero $2 \times 2$ matrix with determinant 0 is one.

In $\mathbb{Z}_{21}$, $-1$ is the class 20, and $20 \cdot 20 = 400 = 21 \cdot 19 + 1$, so $(-1)(-1) = 1$ there too. For $2 \times 2$ matrices, $(-I)(-I) = I$. Explanations in school appeal to patterns or to debts, and they are persuasive without being proofs. Is $(-1)(-1) = 1$ a convention that each system happens to follow, or is it forced by the ring axioms?

It is forced. One short argument settles it in every ring at once. This article derives such first consequences of the axioms. The rules for zero and for signs hold in every ring. The rules about inverses hold for the elements that have inverses, the units. Where a familiar rule needs commutativity, such as $(a + b)^2 = a^2 + 2ab + b^2$, we show a ring in which it fails.

First we prove that zero and negatives are unique and that $a \cdot 0 = 0$. Then come signs, powers and the identity. Next we define units, find those of the Gaussian integers, and see that they form a group. Finally we carry zero divisors, met for $\mathbb{Z}_n$ in Units and Zero Divisors in the Integers Modulo n, over to matrices and functions. This article is the home of units and zero divisors in a general ring.

This is the second article of Rings. It covers §3.2 of the course text (Hungerford, 2014) up to the definitions of units and zero divisors. Throughout, $R$ is a ring, and $a$, $b$, $c$ are elements of $R$.

Zero and negatives

The axioms say that a zero element exists and that each element has an additive inverse, but not that either is unique. Both are.

Proposition. A ring has exactly one zero element.

The idea: add the two candidate zeros. Each leaves the other unchanged, so the sum equals both.

Proof. Suppose $z$ and $z'$ are both zero elements, so that $a + z = a$ and $a + z' = a$ for every $a$ in $R$. Taking $a = z$ in the second equation and $a = z'$ in the first, and using commutativity of addition,

$$z = z + z' = z' + z = z'. \qquad \blacksquare$$

Proposition. Each element $a$ of a ring has exactly one additive inverse.

The idea: if $x$ and $y$ both cancel $a$, then adding $a$ and $y$ to $x$, regrouped two ways, turns $x$ into $y$.

Proof. Suppose $a + x = 0$ and $a + y = 0$. Then

$$x = x + 0 = x + (a + y) = (x + a) + y = (a + x) + y = 0 + y = y,$$

using the zero element, the second equation, associativity, commutativity, the first equation and the zero element again. $\blacksquare$

The unique additive inverse of $a$ is written $-a$, and subtraction is defined by $a - b = a + (-b)$. In $\mathbb{Z}_{21}$, $-5 = 16$, since $5 + 16 = 21 = 0$, and $3 - 5 = 3 + 16 = 19$.

Proposition (additive cancellation). If $a + b = a + c$, then $b = c$.

Proof. Add $-a$ on the left of both sides: $-a + (a + b) = -a + (a + c)$. By associativity this is $(-a + a) + b = (-a + a) + c$, that is, $0 + b = 0 + c$. Since $0 + x = x + 0 = x$ for every $x$, by commutativity, this says $b = c$. $\blacksquare$

Uniqueness gives a convenient way to identify a negative. To show that some element $y$ equals $-x$, it is enough to show $x + y = 0$. Two rules follow at once.

  • $-(-a) = a$, because $-a + a = 0$, so $a$ is the additive inverse of $-a$.
  • $-(a + b) = (-a) + (-b)$, because $(a + b) + ((-a) + (-b)) = (a + (-a)) + (b + (-b)) = 0$, after rearranging the four terms by associativity and commutativity of addition.

The uniqueness of negatives, additive cancellation and the two rules are Hungerford's Theorems 3.3 and 3.4 and parts of Theorem 3.5. All of these results use only the axioms for addition. So they hold in any system with an associative, commutative addition, a zero and negatives.

Multiplying by zero

Why should $a \cdot 0$ be 0? No axiom mentions it. The connection has to come from the distributive laws, the only axioms that involve both operations.

Proposition. For every $a$ in $R$, $a \cdot 0 = 0$ and $0 \cdot a = 0$.

The idea in one sentence: since $0 = 0 + 0$, distributing gives $a \cdot 0 = a \cdot 0 + a \cdot 0$, and an element equal to twice itself is 0.

Proof. Since $0 + 0 = 0$, the distributive law gives

$$a \cdot 0 = a(0 + 0) = a \cdot 0 + a \cdot 0.$$

The left side equals $a \cdot 0 + 0$, so $a \cdot 0 + 0 = a \cdot 0 + a \cdot 0$, and additive cancellation leaves $0 = a \cdot 0$. The other distributive law gives $0 \cdot a = (0 + 0)a = 0 \cdot a + 0 \cdot a$. So $0 \cdot a + 0 = 0 \cdot a + 0 \cdot a$, and additive cancellation leaves $0 = 0 \cdot a$. $\blacksquare$

The proof uses the fact that $0 + 0 = 0$ and nothing about what 0 "is". It never uses associativity or commutativity of multiplication, or a 1, so it holds even in $2\mathbb{Z}$. In $M_2(\mathbb{R})$ it says that any matrix times the zero matrix is the zero matrix, and in the ring of functions that $f \cdot 0$ is the zero function. Both are obvious by computation; the point is that they did not need computing.

Signs

With $a \cdot 0 = 0$ in hand, the rules of signs follow from the same device: show that something adds to $ab$ to give 0, and conclude by uniqueness that it is $-(ab)$.

Proposition. For all $a$ and $b$ in $R$:

  1. $a(-b) = -(ab) = (-a)b$;
  2. $(-a)(-b) = ab$;
  3. $a(b - c) = ab - ac$ and $(a - b)c = ac - bc$.

If $R$ has an identity, then also

  1. $(-1)a = -a = a(-1)$, and in particular $(-1)(-1) = 1$.

Proof. (1) By the distributive law and the previous proposition,

$$ab + a(-b) = a(b + (-b)) = a \cdot 0 = 0.$$

So $a(-b)$ is an additive inverse of $ab$, and by uniqueness $a(-b) = -(ab)$. By the other distributive law, $ab + (-a)b = (a + (-a))b = 0 \cdot b = 0$, so $(-a)b = -(ab)$ as well.

(2) Apply (1) twice, the second time with $-a$ in place of $a$, and then the rule $-(-x) = x$:

$$(-a)(-b) = -((-a)b) = -(-(ab)) = ab.$$

(3) $a(b - c) = a(b + (-c)) = ab + a(-c) = ab + (-(ac)) = ab - ac$, by the distributive law and (1). By the other distributive law and (1), $(a - b)c = (a + (-b))c = ac + (-b)c = ac + (-(bc)) = ac - bc$.

(4) By (1), $(-1)b = -(1 \cdot b) = -b$ for every $b$, and $a(-1) = -(a \cdot 1) = -a$ for every $a$. Taking $b = -1$ gives $(-1)(-1) = -(-1) = 1$. $\blacksquare$

This is the course text's Theorem 3.5 and Judson's Proposition 16.1.8. It answers the opening question. In every ring with identity, $(-1)(-1) = 1$, because $-1$ times anything is the negative of that thing, and the negative of $-1$ is $1$. No ring can be built in which $(-1)(-1) = -1$ unless $1 = -1$, as happens in $\mathbb{Z}_2$.

The script checks the rules numerically in $M_2(\mathbb{Z})$ with

$$A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, \quad B = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}, \quad AB = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}:$$

both $A(-B)$ and $(-A)B$ equal $\begin{pmatrix} -2 & -1 \\ -1 & -1 \end{pmatrix} = -(AB)$, and $(-A)(-B) = AB$. In $\mathbb{Z}_{21}$ it confirms $(-a)(-b) = ab$ for all 441 pairs.

Example (a product of two negatives). In $\mathbb{Z}_{21}$, $-2 = 19$ and $-10 = 11$, so $19 \cdot 11 = 20$ without any long multiplication. By rule (2), $19 \cdot 11 = (-2)(-10) = 2 \cdot 10 = 20$. Multiplying out confirms it: $19 \cdot 11 = 209 = 21 \cdot 9 + 20$.

Multiples and powers

Repeated addition and repeated multiplication need notation. For a positive integer $n$ define

$$na = \underbrace{a + a + \cdots + a}_{n \text{ terms}}, \qquad 0a = 0, \qquad (-n)a = n(-a),$$

and for a positive integer $n$ define $a^n = a \cdot a \cdots a$ with $n$ factors. By associativity no parentheses are needed in either expression, as is shown after the rules below. To have a definite meaning in the meantime, both expressions are built one step at a time:

$$1a = a, \quad (n + 1)a = na + a, \qquad a^1 = a, \quad a^{n + 1} = a^n a.$$

Induction on the number of terms proves the expected rules for all integers $m$ and $n$ and all positive integers $k$ and $l$:

$$(m + n)a = ma + na, \qquad m(na) = (mn)a, \qquad n(a + b) = na + nb,$$

$$a^k a^l = a^{k + l}, \qquad (a^k)^l = a^{kl}.$$

One more rule connects multiples with products. For every integer $n$,

$$(na)b = n(ab) = a(nb).$$

Proof of the rules. Throughout, $j$, $k$ and $l$ are positive integers, and $m$ and $n$ are any integers.

Step 1: $(k + l)a = ka + la$. Induction on $l$. For $l = 1$ this is the definition of $(k + 1)a$. If it holds for $l$, then by associativity

$$(k + l + 1)a = (k + l)a + a = (ka + la) + a = ka + (la + a) = ka + (l + 1)a.$$

Step 2: $k(a + b) = ka + kb$, and $k0 = 0$. Induction on $k$. For $k = 1$ both are clear. If they hold for $k$, then

$$(k + 1)(a + b) = k(a + b) + (a + b) = (ka + kb) + (a + b) = (ka + a) + (kb + b) = (k + 1)a + (k + 1)b,$$

after rearranging the four terms by associativity and commutativity of addition, and $(k + 1)0 = k0 + 0 = 0 + 0 = 0$.

Step 3: $(-n)a = -(na)$. For $n = k$ positive, Step 2 gives $ka + k(-a) = k(a + (-a)) = k0 = 0$. So $k(-a) = -(ka)$ by uniqueness of negatives, and $(-k)a = k(-a)$ by definition. For $n = 0$ both sides are 0. For $n = -k$, the left side is $ka$, and the right side is $-(k(-a)) = -(-(ka)) = ka$.

Step 4: $(m + n)a = ma + na$. If $m = 0$ or $n = 0$, the two sides agree because $0a = 0$. If both are positive, this is Step 1. If both are negative, say $m = -j$ and $n = -k$, then by Step 1 applied to $-a$,

$$(m + n)a = (j + k)(-a) = j(-a) + k(-a) = ma + na.$$

There remains the case of one positive and one negative integer. Exchanging $m$ and $n$ changes neither side, so let $m = j$ and $n = -k$. Then $na = -(ka)$ by Step 3.

  • If $j > k$, Step 1 gives $ja = (j - k)a + ka$. Adding $-(ka)$ to both sides gives $(j - k)a = ja + (-(ka))$, which is $(m + n)a = ma + na$.
  • If $j = k$, then $(m + n)a = 0a = 0 = ja + (-(ja)) = ma + na$.
  • If $j < k$, Step 1 gives $ka = (k - j)a + ja$, so $(k - j)a = ka + (-(ja))$. By Step 3 and the rules $-(x + y) = (-x) + (-y)$ and $-(-x) = x$,

$$(m + n)a = (-(k - j))a = -\big((k - j)a\big) = -\big(ka + (-(ja))\big) = -(ka) + ja = na + ma = ma + na.$$

Step 5: $n(a + b) = na + nb$. For $n$ positive this is Step 2, and for $n = 0$ it reads $0 = 0 + 0$. For $n = -k$, by the rule for the negative of a sum and Step 2,

$$n(a + b) = k(-(a + b)) = k((-a) + (-b)) = k(-a) + k(-b) = na + nb.$$

Step 6: $m(na) = (mn)a$. For $m = j$ positive, induction on $j$. For $j = 1$ both sides are $na$. If it holds for $j$, then by Step 4

$$(j + 1)(na) = j(na) + na = (jn)a + na = (jn + n)a = ((j + 1)n)a.$$

For $m = 0$ both sides are 0. For $m = -j$, by Step 3 and the positive case,

$$m(na) = j(-(na)) = j((-n)a) = (j(-n))a = (mn)a.$$

Step 7: $(na)b = n(ab) = a(nb)$. For $n = k$ positive, induction on $k$. For $k = 1$ all three are $ab$. If the rule holds for $k$, then by the distributive laws

$$((k + 1)a)b = (ka + a)b = (ka)b + ab = k(ab) + ab = (k + 1)(ab),$$

$$a((k + 1)b) = a(kb + b) = a(kb) + ab = k(ab) + ab = (k + 1)(ab).$$

For $n = 0$ the rule reads $0 \cdot b = 0 = a \cdot 0$, the proposition on multiplying by zero. For $n = -k$, by the rules of signs and the positive case,

$$((-k)a)b = (k(-a))b = k((-a)b) = k(-(ab)) = (-k)(ab), \qquad a((-k)b) = a(k(-b)) = k(a(-b)) = k(-(ab)) = (-k)(ab).$$

Step 8: powers. First, $a^k a^l = a^{k + l}$ for all positive $k$ and $l$, by induction on $l$ with $k$ fixed. For $l = 1$ it is the definition of $a^{k + 1}$. If it holds for $l$, then by associativity

$$a^k a^{l + 1} = a^k (a^l a) = (a^k a^l) a = a^{k + l} a = a^{k + l + 1}.$$

Next, $(a^k)^l = a^{kl}$, by induction on $l$. For $l = 1$ both sides are $a^k$. If it holds for $l$, then by the definition of powers and the first rule, now proved for all positive exponents,

$$(a^k)^{l + 1} = (a^k)^l a^k = a^{kl} a^k = a^{kl + k}. \qquad \blacksquare$$

Now the claim about parentheses. Every way of grouping a product of $n$ factors $a$ gives $a^n$. For $n = 1$ and $n = 2$ there is only one grouping. For larger $n$, the last multiplication carried out joins a grouped product of $k$ factors and a grouped product of $n - k$ factors. By induction on $n$ these are $a^k$ and $a^{n - k}$, and $a^k a^{n - k} = a^n$ by Step 8. For sums, the last addition joins a grouped sum of $k$ terms and one of $n - k$ terms. By induction these are $ka$ and $(n - k)a$, and $ka + (n - k)a = na$ by Step 1.

The integer $n$ in $na$ is not an element of $R$, so $na$ is not a ring product. In a ring with identity, though, $na = (n1)a$ by Step 7, which rests on the distributive law: $(n1)a = n(1a) = na$. Here $n1$ is an element of $R$, equal to $1 + \cdots + 1$ when $n$ is positive. In $\mathbb{Z}_{21}$, $5 \cdot 4 = 20$ and $(-5) \cdot 4 = 5 \cdot (-4) = 5 \cdot 17 = 85 = 1$. The script checks Steps 1 to 7 for all $a$ and $b$ in $\mathbb{Z}_{21}$ and $m$, $n$ from $-6$ to 6, computing each multiple from the step-by-step definition. If $R$ has an identity, $a^0$ is defined to be $1$. The two rules for powers then hold when $k$ or $l$ is 0 as well: $a^k a^0 = a^k \cdot 1 = a^k$, $a^0 a^l = 1 \cdot a^l = a^l$, $(a^k)^0 = 1 = a^0$, and $(a^0)^l = 1^l = 1$ because $1 \cdot 1 = 1$.

What needs commutativity

Two familiar rules need commutativity of multiplication: $(ab)^n = a^n b^n$, and the binomial expansion. Without commutativity, the distributive laws give only

$$(a + b)^2 = (a + b)a + (a + b)b = a^2 + ba + ab + b^2,$$

and the middle terms combine into $2ab$ exactly when $ab = ba$ (Hungerford, 2014, §3.2, makes the same point). Indeed $ba + ab = ab + ab$ holds if and only if $ba = ab$, by additive cancellation. In a commutative ring the usual binomial theorem holds. More precisely, both rules hold for any two elements that commute with each other.

Proposition. Let $a$ and $b$ be elements of a ring with $ab = ba$, and let $n$ be a positive integer. Then

  1. $(ab)^n = a^n b^n$;
  2. (binomial theorem) $(a + b)^n = \sum_{k=0}^{n} \binom{n}{k} a^{n-k} b^k$.

Here $\binom{n}{k} = \frac{n!}{k!\,(n - k)!}$ is the binomial coefficient, a positive integer, and each term is a multiple in the sense defined above. The terms with $k = 0$ and $k = n$ are read as $a^n$ and $b^n$. That agrees with the convention $x^0 = 1$ when the ring has an identity.

The idea: when $a$ and $b$ commute, every $a$ can be moved to the left of every $b$, and then like terms can be collected.

Proof. First, $b^k a = a b^k$ for every positive integer $k$, by induction. For $k = 1$ it is the hypothesis. If it holds for $k$, then $b^{k+1} a = b^k (ba) = b^k (ab) = (b^k a) b = (a b^k) b = a b^{k+1}$.

(1) Induction on $n$. For $n = 1$ there is nothing to prove. If $(ab)^n = a^n b^n$, then

$$(ab)^{n+1} = (ab)^n (ab) = a^n (b^n a) b = a^n (a b^n) b = a^{n+1} b^{n+1}.$$

(2) The binomial coefficients satisfy $\binom{n}{0} = \binom{n}{n} = 1$ and Pascal's rule: for $1 \le k \le n$,

$$\binom{n}{k-1} + \binom{n}{k} = \frac{n!}{(k-1)!\,(n-k)!} \left( \frac{1}{n - k + 1} + \frac{1}{k} \right) = \frac{n!}{(k-1)!\,(n-k)!} \cdot \frac{n + 1}{k\,(n - k + 1)} = \binom{n+1}{k}.$$

By induction on $n$, the rule shows that every $\binom{n}{k}$ is a positive integer: each coefficient for $n + 1$ is 1 or a sum of two coefficients for $n$.

Now induction on $n$. For $n = 1$ the formula reads $a + b$. Suppose it holds for $n$. Then $(a + b)^{n+1} = (a + b)^n a + (a + b)^n b$. Multiply each term of $(a + b)^n$ by $a$ and by $b$, using Step 7 above to move the integer coefficient outside and $b^k a = a b^k$:

$$\binom{n}{k} a^{n-k} b^k \cdot a = \binom{n}{k} a^{n+1-k} b^k, \qquad \binom{n}{k} a^{n-k} b^k \cdot b = \binom{n}{k} a^{n-k} b^{k+1}.$$

So, renaming $k + 1$ as $k$ in the second sum,

$$(a + b)^{n+1} = \sum_{k=0}^{n} \binom{n}{k} a^{n+1-k} b^k + \sum_{k=1}^{n+1} \binom{n}{k-1} a^{n+1-k} b^k.$$

The term with $k = 0$ is $a^{n+1}$ and the term with $k = n + 1$ is $b^{n+1}$. For $1 \le k \le n$ the two sums each contribute a multiple of $a^{n+1-k} b^k$, and by the rule $(m + n)x = mx + nx$ and Pascal's rule the coefficients add to $\binom{n+1}{k}$. That is the formula for $n + 1$. $\blacksquare$

For $n = 2$ the binomial theorem reads $(a + b)^2 = a^2 + 2ab + b^2$. Without commutativity the rule for powers of a product fails as well. By associativity $(ab)^2 = abab$ and $a^2b^2 = aabb$, and the two differ by the order of the middle pair. With the matrices $A$ and $B$ above, where $AB \neq BA$, the script finds

$$(AB)^2 = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}^2 = \begin{pmatrix} 5 & 3 \\ 3 & 2 \end{pmatrix}, \qquad A^2 B^2 = \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix} = \begin{pmatrix} 5 & 2 \\ 2 & 1 \end{pmatrix}.$$

Example (the identity commutes with everything). The expansion $(A + I)^2 = A^2 + 2A + I$ holds for the matrix $A$ above, although $A$ does not commute with $B$, and it holds for every square matrix $A$. The identity commutes with everything, $AI = A = IA$, so the middle terms $AI + IA$ combine into $2A$. The script confirms that both sides equal $\begin{pmatrix} 4 & 4 \\ 0 & 4 \end{pmatrix}$.

The identity

The zero is unique. So is the identity, when there is one.

Proposition. A ring has at most one identity.

The idea, as for the zero: multiply the two candidates, and the product equals both.

Proof. Suppose $e$ and $e'$ both satisfy $ea = a = ae$ and $e'a = a = ae'$ for every $a$. Then $e = ee'$, because $e'$ is an identity, and $ee' = e'$, because $e$ is an identity. So $e = e'$. $\blacksquare$

The proof uses each identity on one side only, so it shows a little more. An element that is an identity on the left equals any element that is an identity on the right.

Proposition. In a ring with identity, if $1_R = 0_R$, then $R = \{0_R\}$.

Proof. For every $a$ in $R$, $a = a \cdot 1_R = a \cdot 0_R = 0_R$, by the proposition on multiplying by zero. $\blacksquare$

So the condition $1_R \neq 0_R$, which the definitions of integral domains and fields impose, excludes exactly one ring, the zero ring.

Units

In $\mathbb{Z}_{21}$, 10 had the inverse 19 and 14 had none. In a ring that may not be commutative, an inverse has to work on both sides.

Definition. Let $R$ be a ring with identity. An element $a$ of $R$ is a unit if there is an element $b$ of $R$ with

$$ab = 1_R = ba.$$

Such a $b$ is a (multiplicative) inverse of $a$.

In a noncommutative ring both equations are required. For $\mathbb{Z}_n$, where multiplication commutes, this is the definition in Units and Zero Divisors in the Integers Modulo n.

Proposition. A unit has exactly one inverse.

The idea: if $b$ and $c$ are both inverses of $a$, then $a$ sends $b - c$ to 0, and multiplying by $b$ undoes $a$, so $b - c$ is 0.

Proof. Suppose $b$ and $c$ are both inverses of $a$. Then $ab = 1 = ac$, so by the rules of signs

$$a(b - c) = ab - ac = 1 - 1 = 0.$$

Multiplying on the left by $b$ and using $ba = 1$,

$$b - c = 1(b - c) = (ba)(b - c) = b\big(a(b - c)\big) = b \cdot 0 = 0,$$

so $b = c$. $\blacksquare$

The same idea, multiplying by an inverse to undo a product, reappears below in the proof that a unit is not a zero divisor. Judson (2026, Propositions 3.2.10 and 3.2.11) proves the uniqueness of the identity and of inverses for groups, by these two arguments. The inverse of a unit $a$ is written $a^{-1}$. It is itself a unit with inverse $a$, since the defining equations are symmetric in $a$ and $b$.

Examples of units

  • Integers. The units of $\mathbb{Z}$ are $1$ and $-1$. If $ab = 1$ in $\mathbb{Z}$, then $\lvert a \rvert \lvert b \rvert = 1$ with $\lvert a \rvert, \lvert b \rvert$ positive integers, so $\lvert a \rvert = 1$.
  • Number fields. In $\mathbb{Q}$, $\mathbb{R}$ and $\mathbb{C}$ every nonzero element is a unit.
  • Integers modulo $n$. The units of $\mathbb{Z}_n$ are the classes $[a]$ with $\gcd(a, n) = 1$, by the theorem in Units and Zero Divisors in the Integers Modulo n; $\mathbb{Z}_{21}$ has twelve.
  • Matrices. A matrix $X = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$ in $M_2(\mathbb{R})$ is a unit (an invertible matrix) exactly when its determinant $ad - bc$ is nonzero. Its inverse is then $\frac{1}{ad - bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$. To see this, let $X' = \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$. Multiplying out gives $XX' = (ad - bc)I = X'X$, so when $ad - bc \neq 0$ the matrix $\frac{1}{ad - bc}X'$ is an inverse of $X$. Conversely, if $XY = I$, then $\det X \det Y = \det I = 1$ by the product rule for determinants computed in Rings: Definition and Examples, so $\det X \neq 0$. For example $C = \begin{pmatrix} 3 & 1 \\ 4 & 2 \end{pmatrix}$ has determinant 2 and inverse $\begin{pmatrix} 1 & -1/2 \\ -2 & 3/2 \end{pmatrix}$; the script confirms that both products are $I$.
  • Functions. A function $f$ in $F(\mathbb{R})$ is a unit exactly when $f(x) \neq 0$ for every $x$. If so, the function $g(x) = 1/f(x)$ satisfies $fg = 1 = gf$, the constant function 1. If $f(c) = 0$ for some $c$, then $(fg)(c) = 0 \neq 1$ for every $g$. So $x^2 + 1$ is a unit, with inverse $1/(x^2 + 1)$, while $x$ is not.

A common slip is to read "the inverse of $f$" as the inverse function. In the ring, the inverse is the reciprocal. For $h(x) = 2x + 1$, the ring inverse takes the value $1/7$ at $x = 3$, while the inverse function $(x - 1)/2$ takes the value 1 there.

Example (two functions). In $F(\mathbb{R})$, the function $\sin x$ is not a unit and $2 + \sin x$ is. The first has a zero, $\sin 0 = 0$. The function $2 + \sin x$ is a unit, because $\sin x \ge -1$ makes $2 + \sin x \ge 1$, so it is never 0; its inverse is $1/(2 + \sin x)$.

The units of the Gaussian integers

Only four Gaussian integers are units. In $\mathbb{C}$, every nonzero Gaussian integer has an inverse, but usually not one in $\mathbb{Z}[i]$: $1/(2 + i) = (2 - i)/5 = 0.4 - 0.2i$. A size function finds the units exactly.

Definition. The norm of a Gaussian integer $z = a + bi$ is $N(z) = a^2 + b^2$, the square of its distance from 0 in the plane.

Lemma. For all Gaussian integers $z$ and $w$, $N(zw) = N(z)N(w)$.

The idea: expand both sides; the cross terms $\pm 2abcd$ cancel.

Proof. Let $z = a + bi$ and $w = c + di$, so that $zw = (ac - bd) + (ad + bc)i$. Expanding,

$$(ac - bd)^2 + (ad + bc)^2 = a^2c^2 - 2abcd + b^2d^2 + a^2d^2 + 2abcd + b^2c^2 = (a^2 + b^2)(c^2 + d^2). \qquad \blacksquare$$

Proposition. The units of $\mathbb{Z}[i]$ are $1$, $-1$, $i$ and $-i$.

The plan: a unit multiplies to 1, whose norm is 1. Norms multiply and are nonnegative integers, so a unit must have norm 1, and only four Gaussian integers do.

Proof. Each of the four is a unit: $1 \cdot 1 = 1$, $(-1)(-1) = 1$ and $i(-i) = -i^2 = 1$. Conversely, suppose $zw = 1$ in $\mathbb{Z}[i]$. By the lemma, $N(z)N(w) = N(1) = 1$. Norms of Gaussian integers are nonnegative integers, so $N(z) = 1$, that is, $a^2 + b^2 = 1$ with $a$ and $b$ integers. The only solutions are $(a, b) = (\pm 1, 0)$ and $(0, \pm 1)$, which give $z = \pm 1$ and $z = \pm i$. $\blacksquare$

This is the argument of Judson (2026, Example 16.2.1). The script confirms it by searching all products of Gaussian integers with parts between $-20$ and $20$. The norm also shows at a glance that $2 + i$ is not a unit: its norm is 5, and no Gaussian integer has norm $1/5$.

The Gaussian integers with real and imaginary parts from -3 to 3, as points of the plane. Notice that the four units 1, i, -1 and -i (blue) are the only points on the circle of norm 1. The product of 2 + i (norm 5, green) and 1 - i (norm 2, yellow) is 3 - i, which lies on the circle of norm 10 (orange): norms multiply, so an element with norm greater than 1 cannot multiply to 1.
The Gaussian integers with real and imaginary parts from -3 to 3, as points of the plane. Notice that the four units 1, i, -1 and -i (blue) are the only points on the circle of norm 1. The product of 2 + i (norm 5, green) and 1 - i (norm 2, yellow) is 3 - i, which lies on the circle of norm 10 (orange): norms multiply, so an element with norm greater than 1 cannot multiply to 1.

Example (a factor of 13, and a power of $i$). $(3 + 2i)(3 - 2i) = 13$, so 13 is a multiple of $3 + 2i$ in $\mathbb{Z}[i]$. Still, $3 + 2i$ is not a unit, while $i^7$ is one. The norm of $3 + 2i$ is $3^2 + 2^2 = 13$, not 1, and in $\mathbb{C}$ its inverse is $(3 - 2i)/13$, which is not a Gaussian integer. $i^7$ is a unit. Since $i^4 = 1$, $i^7 = i^3 = -i$, which has norm 1 and inverse $i$.

Products of units

Products of units are again units. Without commutativity the inverse has to be guessed with care.

Proposition. Let $R$ be a ring with identity. If $a$ and $b$ are units, then $ab$ is a unit, and

$$(ab)^{-1} = b^{-1}a^{-1}.$$

The idea: to undo "first $b$, then $a$", undo $a$ first and then $b$. The formula can also be found rather than guessed. If $ab$ had an inverse $x$, then $abx = 1$; multiplying on the left by $a^{-1}$ gives $bx = a^{-1}$, and then by $b^{-1}$ gives $x = b^{-1}a^{-1}$. So $b^{-1}a^{-1}$ is the only candidate, and the proof checks that it works.

Proof. Let $u = b^{-1}a^{-1}$. Work from the inside out. Multiplying $u$ on the left by $b$ cancels the factor $b^{-1}$: by associativity, $bu = (bb^{-1})a^{-1} = a^{-1}$. Multiplying that by $a$ then gives

$$(ab)u = a(bu) = aa^{-1} = 1.$$

In the other order, $ua = b^{-1}(a^{-1}a) = b^{-1}$, so $u(ab) = (ua)b = b^{-1}b = 1$. Both equations in the definition of a unit hold, so $ab$ is a unit with inverse $u$. $\blacksquare$

The order of the factors is reversed, as with undoing two actions: to undo putting on socks and then shoes, take off the shoes first. In a commutative ring the order does not matter. Among matrices, where $a^{-1}$ and $b^{-1}$ need not commute, it does. The same statement for groups is Judson's Proposition 3.2.12.

With the facts that $1$ is a unit, since $1 \cdot 1 = 1$, and that the inverse of a unit is a unit, the proposition says that the units of $R$ form a closed system under multiplication. This set is the group of units of $R$, written $R^\times$:

$$\mathbb{Z}^\times = \{1, -1\}, \qquad \mathbb{Z}[i]^\times = \{1, -1, i, -i\}, \qquad \mathbb{Q}^\times = \mathbb{Q} \setminus \{0\},$$

and $\mathbb{Z}_{21}^\times$ is the set of twelve units listed in Units and Zero Divisors in the Integers Modulo n, also written $U(21)$. Groups are defined in Groups: Definition and First Examples, and $R^\times$ is one of the main sources of examples.

Zero divisors

At the other extreme from units are nonzero elements that multiply something nonzero to 0.

Definition. A nonzero element $a$ of a ring $R$ is a zero divisor if there is a nonzero element $c$ of $R$ with $ac = 0$ or $ca = 0$.

In a commutative ring the two conditions coincide. In $\mathbb{Z}_{21}$, $14 \cdot 3 = 0$, so 14 and 3 are zero divisors. In $M_2(\mathbb{R})$,

$$D = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, \quad E = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}, \quad DE = ED = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix},$$

so $D$ and $E$ are zero divisors. Geometrically, $D$ projects the plane onto the horizontal axis and $E$ onto the vertical axis; projecting onto one axis and then onto the other sends every point to the origin. Both have determinant 0. Every nonzero matrix $X = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$ with determinant 0 is a zero divisor. The matrix $X' = \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$ has the entries of $X$ up to sign and position, so it is nonzero, and $XX' = (ad - bc)I$ is the zero matrix, by the computation in the list of units above. In the language of linear algebra, $X$ sends each column of $X'$ to the zero vector, and at least one of those columns is nonzero. No matrix with nonzero determinant is a zero divisor, by the next proposition.

Proposition. In a ring with identity, a unit is not a zero divisor.

The idea: multiplying by a unit loses no information, because the multiplication can be undone. If $ac = 0$, undoing the multiplication by $a$ turns 0 back into $c$; but undoing it also turns 0 into 0, so $c = 0$.

Proof. Let $a$ be a unit, and consider the function $\lambda: R \to R$, $\lambda(x) = ax$, that multiplies on the left by $a$, together with $\mu(x) = a^{-1}x$. By associativity, $\mu(\lambda(x)) = (a^{-1}a)x = x$ and $\lambda(\mu(x)) = (aa^{-1})x = x$ for every $x$, so $\mu$ is an inverse function of $\lambda$ and $\lambda$ is a bijection. A bijection takes each value once. Since $\lambda(0) = a \cdot 0 = 0$ by the proposition on multiplying by zero, $0$ is the only element that $\lambda$ sends to $0$; that is, $ac = 0$ only for $c = 0$. Now multiply on the right. Let $\rho(x) = xa$ and $\sigma(x) = xa^{-1}$. By associativity, $\sigma(\rho(x)) = x(aa^{-1}) = x$ and $\rho(\sigma(x)) = x(a^{-1}a) = x$ for every $x$, so $\rho$ is a bijection with inverse function $\sigma$, and $\rho(0) = 0 \cdot a = 0$. Hence $ca = 0$ only for $c = 0$. $\blacksquare$

The bijection $\lambda$ is the "rearranging" that Fermat's little theorem uses for the units of $\mathbb{Z}_n$, and Cayley's theorem uses for every group.

Functions

The ring of functions $F(\mathbb{R})$ has many zero divisors. Let

$$f(x) = \max(\sin x, 0), \qquad g(x) = \max(-\sin x, 0),$$

the positive and the negative arches of the sine curve. Where $\sin x \ge 0$, $g(x) = 0$, and where $\sin x \le 0$, $f(x) = 0$. So the product $fg$ is the zero function, although neither $f$ nor $g$ is: $f(\pi/2) = 1$ and $g(-\pi/2) = 1$.

Two nonzero functions whose product is the zero function. Notice that f keeps the arches of sin x above the axis and g flips the arches below it, so their nonzero stretches alternate and never overlap: at every x one of the factors is 0, and the pointwise product (right) is identically 0. Both functions are continuous, so they are zero divisors in the ring of continuous functions too.
Two nonzero functions whose product is the zero function. Notice that f keeps the arches of sin x above the axis and g flips the arches below it, so their nonzero stretches alternate and never overlap: at every x one of the factors is 0, and the pointwise product (right) is identically 0. Both functions are continuous, so they are zero divisors in the ring of continuous functions too.

The example generalizes. Suppose $f$ is not the zero function but $f(c) = 0$ for some $c$. Let $g$ be the function that equals 1 at $c$ and 0 everywhere else. Then $fg$ is the zero function: at $c$ the factor $f(c)$ is 0, and elsewhere the factor $g(x)$ is 0. And $g$ is not the zero function, since $g(c) = 1$. So every nonzero function with a zero is a zero divisor, and every function without a zero is a unit. In $F(\mathbb{R})$, as in $\mathbb{Z}_n$, every nonzero element is a unit or a zero divisor.

It is tempting to conclude that every nonzero element of every ring is one or the other. That dichotomy is not a law of rings. In $\mathbb{Z}$, the integer 2 is neither a unit nor a zero divisor. In the ring of continuous functions, the function $x$ has a zero at 0, so it is not a unit there either: its product with any function takes the value 0 at 0, not 1. But it is not a zero divisor. If $xg(x) = 0$ for every $x$ with $g$ continuous, then $g(x) = 0$ for every $x \neq 0$, and continuity forces $g(0) = 0$ too. The partner $g$ that worked in $F(\mathbb{R})$ is not continuous, and no continuous partner exists.

Rings without zero divisors, where products of nonzero elements are nonzero as they are in $\mathbb{Z}$, are the subject of Integral Domains and Fields.

Worked problems

These problems are from the course's assignment on §3.1 (Problem 1) and its assignment on §4.1, §5.1 and §5.2 (Problem 2). Each is solved in full from the results of this unit.

Four problems of the assignment on §3.1 are propositions proved above, and they are not repeated here: the identity of a ring is unique; a unit has exactly one inverse; a product of units is a unit; and a unit is not a zero divisor. The last was assigned for commutative rings and is proved above for every ring with identity. One problem of that assignment remains.

Problem 1. Let $R$ be a commutative ring, and let $a$ and $b$ be zero divisors of $R$. Then $ab = 0$ or $ab$ is a zero divisor.

The assignment states this for any ring and notes that commutativity is not assumed. As posed, the statement is false: the remark after the proof gives a noncommutative ring in which a product of two zero divisors is a unit. With commutativity it holds, as follows.

The idea: whatever $b$ sends to zero, $ab$ sends to zero too.

Proof. Since $b$ is a zero divisor, there is a nonzero $y$ in $R$ with $by = 0$ or $yb = 0$. Because $R$ is commutative, these are the same equation, so $by = 0$. By associativity and the proposition on multiplying by zero,

$$(ab)y = a(by) = a \cdot 0 = 0.$$

If $ab \neq 0$, then $ab$ is a nonzero element that multiplies the nonzero element $y$ to zero, so $ab$ is a zero divisor. Otherwise $ab = 0$. $\blacksquare$

The proof used only that $b$ is a zero divisor. So in a commutative ring, the product of any element with a zero divisor is zero or a zero divisor. Both outcomes occur. In $\mathbb{Z}_{21}$ the elements 3, 6 and 7 are zero divisors, since $3 \cdot 7 = 21 = 0$ and $6 \cdot 7 = 42 = 0$. The product $3 \cdot 7$ is 0. The product $3 \cdot 6 = 18$ is not 0, and it is a zero divisor: $18 \cdot 7 = 126 = 21 \cdot 6 = 0$.

In a ring that is not commutative, the computation proves two one-sided statements. If $by = 0$ for some nonzero $y$, then $(ab)y = a(by) = 0$. If $xa = 0$ for some nonzero $x$, then $x(ab) = (xa)b = 0 \cdot b = 0$. In both cases $ab$ is zero or a zero divisor. The case left over is that $ac = 0$ for some nonzero $c$ but $xa \neq 0$ for every nonzero $x$, while $zb = 0$ for some nonzero $z$ but $by \neq 0$ for every nonzero $y$. There the statement can fail, as the remark shows with $a = \ell$ and $b = s$.

No finite ring with identity gives such an example. Suppose $R$ is finite with identity and $xa \neq 0$ for every nonzero $x$. Then the function $x \mapsto xa$ from $R$ to $R$ is one-to-one, because $xa = x'a$ gives $(x - x')a = 0$ and so $x = x'$. A one-to-one function from a finite set to itself is onto, so $xa = 1$ for some $x$. Then $ac = 0$ gives $c = (xa)c = x(ac) = 0$, which rules out $ac = 0$ with $c \neq 0$. In agreement with this, an exhaustive search of the 16 matrices of $M_2(\mathbb{Z}_2)$ finds that every product of two zero divisors is zero or a zero divisor.

Remark (the statement fails without commutativity). Let $V$ be the set of all sequences $v = (v_1, v_2, v_3, \ldots)$ of integers, added term by term. Call a function $f: V \to V$ additive if $f(v + w) = f(v) + f(w)$ for all $v$ and $w$ in $V$. Let $E$ be the set of additive functions, with the operations

$$(f + g)(v) = f(v) + g(v), \qquad (fg)(v) = f(g(v)).$$

The product is composition. $E$ is a ring with identity:

  • Closure. $(f + g)(v + w) = f(v) + f(w) + g(v) + g(w) = (f + g)(v) + (f + g)(w)$, and $(fg)(v + w) = f(g(v) + g(w)) = (fg)(v) + (fg)(w)$. So sums and products of additive functions are additive.
  • Addition. It is associative and commutative because addition of sequences is. The zero is the function that sends every sequence to the zero sequence. The negative of $f$ is $v \mapsto -f(v)$, which is additive because $-(f(v) + f(w)) = (-f(v)) + (-f(w))$.
  • Multiplication. Composition of functions is associative, and the function $v \mapsto v$ is an identity.
  • Distributive laws. $((f + g)h)(v) = f(h(v)) + g(h(v)) = (fh + gh)(v)$ by the definition of the sum. $(f(g + h))(v) = f(g(v) + h(v)) = f(g(v)) + f(h(v)) = (fg + fh)(v)$ because $f$ is additive. This is the law that failed for composition of arbitrary functions in Rings: Definition and Examples.

Now let

$$\ell(v) = (v_2, v_3, v_4, \ldots), \qquad s(v) = (0, v_1, v_2, \ldots), \qquad p(v) = (v_1, 0, 0, \ldots).$$

Each term of $\ell(v)$, $s(v)$ and $p(v)$ is a term of $v$ or 0, so all three functions are additive. None is the zero of $E$: on the sequence $(1, 1, 1, \ldots)$ they give $(1, 1, 1, \ldots)$, $(0, 1, 1, \ldots)$ and $(1, 0, 0, \ldots)$. Then

$$\ell(p(v)) = (0, 0, \ldots), \qquad p(s(v)) = p(0, v_1, v_2, \ldots) = (0, 0, \ldots), \qquad \ell(s(v)) = \ell(0, v_1, v_2, \ldots) = v.$$

So $\ell p = 0$, which makes $\ell$ a zero divisor, and $ps = 0$, which makes $s$ a zero divisor. But $\ell s = 1_E$. The identity is not zero, and it is a unit, so it is not a zero divisor. The product of the zero divisors $\ell$ and $s$ is neither zero nor a zero divisor.

Problem 2. Let $a$ and $b$ be elements of a ring $R$. (a) Expand $(a + b)^2$. (b) Expand $(a - b)(a + b)$. (c) Find two matrices $a$ and $b$ in $M_2(\mathbb{R})$ with $(a + b)^2 \neq a^2 + 2ab + b^2$. (d) Find two matrices $a$ and $b$ in $M_2(\mathbb{R})$ with $(a + b)(a - b) \neq a^2 - b^2$. Determine all pairs for which each inequality holds.

The assignment asks (a) and (b) for a noncommutative ring with identity. The expansions hold in every ring, and neither uses an identity.

(a) By the two distributive laws, as in the section on what needs commutativity,

$$(a + b)^2 = (a + b)a + (a + b)b = a^2 + ba + ab + b^2.$$

(b) By the distributive laws and the rules of signs,

$$(a - b)(a + b) = (a - b)a + (a - b)b = a^2 - ba + ab - b^2.$$

In the other order, $(a + b)(a - b) = (a + b)a - (a + b)b = a^2 + ba - ab - b^2$.

The complete answer to (c) and (d) comes from comparing these with the school formulas, using additive cancellation. $(a + b)^2 = a^2 + 2ab + b^2$ holds exactly when $ab = ba$, as shown in the section on what needs commutativity. $(a + b)(a - b) = a^2 - b^2$ holds exactly when $ba - ab = 0$, that is, when $ba = ab$. The same is true of $(a - b)(a + b) = a^2 - b^2$. So each school formula fails for exactly the pairs that do not commute, and one pair of matrices with $ab \neq ba$ answers both (c) and (d).

(c) Take the matrices of this article,

$$a = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, \qquad b = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}, \qquad ab = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}, \qquad ba = \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix}.$$

Then $a + b = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}$, $a^2 = \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}$ and $b^2 = \begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix}$, so

$$(a + b)^2 = \begin{pmatrix} 5 & 4 \\ 4 & 5 \end{pmatrix}, \qquad a^2 + 2ab + b^2 = \begin{pmatrix} 1 + 4 + 1 & 2 + 2 + 0 \\ 0 + 2 + 2 & 1 + 2 + 1 \end{pmatrix} = \begin{pmatrix} 6 & 4 \\ 4 & 4 \end{pmatrix}.$$

The two differ by $ba - ab = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}$, as part (a) predicts.

(d) With the same matrices, $a - b = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}$, and

$$(a + b)(a - b) = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}\begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix} = \begin{pmatrix} -1 & 2 \\ -2 & 1 \end{pmatrix}, \qquad a^2 - b^2 = \begin{pmatrix} 0 & 2 \\ -2 & 0 \end{pmatrix}.$$

Again the difference is $ba - ab$.

Where it leads

What we have learned

The rules for zero and signs are theorems, not conventions: $a \cdot 0 = 0$ comes from the distributive law alone, and $(-1)(-1) = 1$ in every ring with identity. Rules that need commutativity fail for matrices. Units have unique inverses and form a group, and the norm showed that the Gaussian integers have exactly four. A unit is never a zero divisor, but an element can be neither, as 2 is in $\mathbb{Z}$.

In some rings no nonzero element multiplies to zero, so that factoring and canceling work as they do in the integers. The next article, Integral Domains and Fields, names those rings and proves that the finite ones are fields.

References

  • Hungerford, T. W. (2014). Abstract Algebra: An Introduction (3rd ed.), §3.2. Brooks/Cole, Cengage Learning. The course text: the equation $a + x = 0_R$ has a unique solution (Theorem 3.3); additive cancellation (Theorem 3.4); $a \cdot 0_R = 0_R$ and the rules of signs (Theorem 3.5); multiples and powers; the definitions of unit and zero divisor in a ring. record · 44 pages
  • Judson, T. W. (2026). Abstract Algebra: Theory and Applications (annual edition, August 2026). Free online at judsonbooks.org. Proposition 16.1.8 ($a0 = 0a = 0$, $a(-b) = (-a)b = -ab$, $(-a)(-b) = ab$); Example 16.2.1 (the units of the Gaussian integers are $\pm 1$ and $\pm i$, by the norm argument); §3.2 (the group of units $U(n)$; Propositions 3.2.10 to 3.2.12, uniqueness of the identity and of inverses and $(ab)^{-1} = b^{-1}a^{-1}$ in a group). record · 44 pages

Reviewed: verified, 16 Nov 2026 · editorial review, 23 Nov 2026 · 7 revisions