Rings: Definition and Examples

The definition of a ring, abstracted from the arithmetic of the integers and the integers modulo n. The eight ring axioms and what they leave out, commutative rings and rings with identity, and a catalog of examples (number systems, multiples of n, the Gaussian integers, polynomials, 2 x 2 matrices with a rotation and a reflection that do not commute, and functions under pointwise operations), with systems that fail to be rings and the axiom each one breaks.

In the integers modulo 21, $20 + 1 = 0$ and $20 \cdot 20 = 1$, and yet addition and multiplication there obey the same laws as in the integers. Five familiar systems share those laws. The integers $\mathbb{Z}$ are the model, and $\mathbb{Z}_n$ is a finite copy of them. Polynomials are added and multiplied by collecting terms. Square matrices are added entry by entry and multiplied by the row-times-column rule. Real-valued functions are added and multiplied point by point, so that the product of $x^2$ and $x + 1$ is $x^3 + x^2$. The elements are numbers, classes of integers, formal expressions, arrays and functions. What exactly do the five systems have in common, and what can be proved from it alone?

The answer is a definition. A ring is a set with an addition and a multiplication that obey a fixed list of laws. The list contains the laws that the arguments of the first two units actually used, and nothing else. A theorem derived from the list then holds in all five systems at once, and in every other ring. This article is the canonical home of the definition: later articles in the course build on it and link here rather than restating it.

First we state the eight axioms and the two laws they leave out, commutativity of multiplication and an identity. Then we work through a catalog of examples. The running ones for this unit are $\mathbb{Z}_{21}$, the Gaussian integers, and a rotation and a reflection of the plane that do not commute. Finally we look at systems that fail to be rings, to see what each axiom contributes.

This is the first article of Rings. It covers the definition and examples in §3.1 of the course text (Hungerford, 2014); the subrings and products at the end of that section are in Subrings and Direct Products of Rings. It assumes the integers modulo $n$ and the laws of arithmetic proved there.

The definition

Definition. A ring is a nonempty set $R$ with two operations, called addition and multiplication and written $a + b$ and $ab$, that satisfy the following axioms for all $a$, $b$, $c$ in $R$.

Addition.

  1. $a + b \in R$ (closure under addition).
  2. $(a + b) + c = a + (b + c)$ (associativity of addition).
  3. $a + b = b + a$ (commutativity of addition).
  4. There is an element $0_R$ in $R$ with $a + 0_R = a$ for every $a$ in $R$ (a zero element).
  5. For each $a$ in $R$ there is an element $x$ in $R$ with $a + x = 0_R$ (additive inverses).

Multiplication.

  1. $ab \in R$ (closure under multiplication).
  2. $(ab)c = a(bc)$ (associativity of multiplication).

Both operations.

  1. $a(b + c) = ab + ac$ and $(a + b)c = ac + bc$ (the distributive laws).

An operation on $R$ is a rule that assigns to each ordered pair of elements of $R$ exactly one result. The closure axioms say that the result lies in $R$ again. The sum of two even integers is even. The sum of two primes need not be prime ($3 + 5 = 8$), so addition is not an operation on the set of primes. The zero element is written $0_R$, or just $0$ when the ring is clear. It need not be the number zero: in a ring of matrices it is the zero matrix.

Axioms 1 to 5 concern addition alone. They say that $R$ with its addition behaves like the integers with theirs. Axioms 6 and 7 ask very little of multiplication. The distributive laws are the only axioms that connect the two operations. They are stated on both sides because multiplication need not be commutative. As the next article shows, every rule linking the two operations, such as $a \cdot 0 = 0$, has to be derived from them.

The axioms are the laws that the theorem on the laws of arithmetic in $\mathbb{Z}_n$ established for the integers modulo $n$, with two of those laws dropped: commutativity of multiplication and the existence of an identity $1$. Neither list says anything about division. Each dropped law fails in some important system, and rings that keep it are given special names.

Commutative rings and rings with identity

Definition. A ring $R$ is commutative if $ab = ba$ for all $a$ and $b$ in $R$. A ring $R$ is a ring with identity if it contains an element $1_R$ with

$$a \, 1_R = a = 1_R \, a \quad \text{for every } a \in R.$$

The element $1_R$ is the identity (or unity) of $R$. Both equations are needed in the definition when $R$ is not commutative. The two properties are independent, and all four combinations occur:

With identity Without identity
Commutative $\mathbb{Z}$, $\mathbb{Z}_n$, $\mathbb{Q}$, $\mathbb{R}$, $\mathbb{C}$, polynomials, functions the even integers $2\mathbb{Z}$
Not commutative $2 \times 2$ real matrices $2 \times 2$ matrices with even integer entries

The examples are described below. Most theorems in the later units of the course assume both properties.

Conventions differ between textbooks. The course text, like Judson (2026, §16.1), does not require a ring to have an identity, and that is the convention here. Many other books build an identity into the definition of a ring. Readers moving between books should check which convention is in force.

A single element with $0 + 0 = 0$ and $0 \cdot 0 = 0$ satisfies every axiom, with $0$ serving as the identity too. This zero ring is the ring $\mathbb{Z}_1$. It is the only ring in which $1_R = 0_R$, as the next article proves, and definitions that need to exclude it require $1_R \neq 0_R$. The empty set is not a ring, because axiom 4 requires a zero element.

A common first reading is that a ring is a system in which "the usual algebra" works. That is too generous. The axioms promise associativity and distributivity, but not that $ab = ba$, not that there is a 1, and not that anything can be divided. The examples below show each of these failing in a natural ring.

Examples

Which systems satisfy the eight axioms? Each example below checks them, usually by inheriting them from a larger system where they are already known.

Number systems

The integers, the rational numbers, the real numbers and the complex numbers, $\mathbb{Z}$, $\mathbb{Q}$, $\mathbb{R}$ and $\mathbb{C}$, are commutative rings with identity under their usual operations. Each is contained in the next. The operations of the larger system, restricted to the smaller one, are its own operations, a relation studied in Subrings and Direct Products of Rings. For example $\frac{2}{3} \cdot \frac{9}{4} = \frac{3}{2}$ and $\frac{2}{3} + \frac{9}{4} = \frac{35}{12}$ in $\mathbb{Q}$. The laws for these systems are taken as known, from the construction of the number systems.

The integers modulo $n$

For every positive integer $n$, the set $\mathbb{Z}_n$ of congruence classes modulo $n$ is a commutative ring with identity $[1]$ and zero $[0]$. That is precisely the theorem on the laws of arithmetic in $\mathbb{Z}_n$. Its proof showed that each law is inherited from the same law in $\mathbb{Z}$. The script for this article also checks every axiom exhaustively for $n \le 12$. For $n = 1$ the ring is the zero ring.

Multiples of $n$

For an integer $n \ge 2$, let $n\mathbb{Z} = \{\ldots, -2n, -n, 0, n, 2n, \ldots\}$ be the set of multiples of $n$. It is closed under addition and multiplication, and it contains $0$ and the negative of each of its elements. The remaining axioms hold because they hold for all integers. So $n\mathbb{Z}$ is a commutative ring. It has no identity. For $2\mathbb{Z}$: an identity $e$ would satisfy $e \cdot 2 = 2$, which forces $e = 1$, and 1 is not even. The same argument works for every $n \ge 2$.

The Gaussian integers

The Gaussian integers are the complex numbers whose real and imaginary parts are both integers:

$$\mathbb{Z}[i] = \{\, a + bi : a, b \in \mathbb{Z} \,\}, \qquad i^2 = -1.$$

Adding and multiplying as complex numbers gives

$$(a + bi) + (c + di) = (a + c) + (b + d)i, \qquad (a + bi)(c + di) = (ac - bd) + (ad + bc)i.$$

Both results again have integer parts, so the operations of $\mathbb{C}$ are operations on $\mathbb{Z}[i]$. For example $(2 + 3i)(4 - i) = 8 - 2i + 12i - 3i^2 = 11 + 10i$. The associative, commutative and distributive laws hold in $\mathbb{Z}[i]$ because they hold for all complex numbers. The zero $0 = 0 + 0i$, the identity $1 = 1 + 0i$ and the negative $-a - bi$ of each element are Gaussian integers. So $\mathbb{Z}[i]$ is a commutative ring with identity (Judson, 2026, Example 16.2.1).

It is a running example in this unit. Its units are found in Basic Properties of Rings, and its finite cousins $\mathbb{Z}_n[i]$ decide which small rings are fields.

Polynomials

For a ring $R$, the polynomials $a_0 + a_1 x + \cdots + a_m x^m$ with coefficients $a_k$ in $R$ form a ring $R[x]$. The rules are the usual ones: add coefficients of like powers, and multiply by distributing and collecting powers of $x$. In $\mathbb{Z}[x]$,

$$(1 + 2x)(3 - x + x^2) = 3 + 5x - x^2 + 2x^3.$$

When the coefficients come from a ring other than the integers, familiar facts can fail. In $\mathbb{Z}_6[x]$, $(2x)(3x) = 6x^2 = 0$. Two polynomials of degree 1 have the zero polynomial as their product, because $2 \cdot 3 = 0$ in $\mathbb{Z}_6$. Polynomial rings are the subject of the polynomial unit.

Matrices

Let $M_2(\mathbb{R})$ be the set of $2 \times 2$ matrices with real entries, with the usual matrix addition and multiplication:

$$\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} e & f \\ g & h \end{pmatrix} = \begin{pmatrix} ae + bg & af + bh \\ ce + dg & cf + dh \end{pmatrix}.$$

The zero element is the zero matrix and the identity is $I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$. Addition is entrywise, so its laws are those of $\mathbb{R}$.

Associativity of multiplication can be checked directly. Write $a_{ik}$ for the entry of $A$ in row $i$ and column $k$, and similarly for $B$ and $C$. The entry in row $i$ and column $j$ of $(AB)C$ and of $A(BC)$ are both

$$\sum_{k} \sum_{l} a_{ik} \, b_{kl} \, c_{lj},$$

summed over $k$ and $l$ from 1 to 2. The distributive laws are checked the same way. So $M_2(\mathbb{R})$ is a ring with identity. The same construction works with entries from any commutative ring with identity, such as $\mathbb{Z}$ or $\mathbb{Z}_n$, and gives a ring $M_2(\mathbb{Z})$ or $M_2(\mathbb{Z}_n)$. The $n \times n$ matrices form a ring for every $n$.

Matrix multiplication is not commutative. A $2 \times 2$ matrix describes a linear transformation of the plane, and the product $AB$ describes doing $B$ first and then $A$. Take

$$A = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}, \qquad B = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},$$

the rotation by 90 degrees counterclockwise and the reflection in the horizontal axis. Then

$$AB = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \qquad BA = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}.$$

The first is the reflection in the line $y = x$, which sends $(1, 0)$ to $(0, 1)$. The second is the reflection in the line $y = -x$, which sends $(1, 0)$ to $(0, -1)$. Reflecting and then rotating is a different motion from rotating and then reflecting.

A letter F (left) moved by the matrix products AB (middle) and BA (right), where A rotates the plane by 90 degrees and B reflects it in the horizontal axis. The dashed outline is the original F. Notice that both images are mirror images of the F, flipped across different lines (y = x for AB, y = -x for BA), so AB and BA are different matrices: multiplication in the ring of 2 x 2 matrices is not commutative.
A letter F (left) moved by the matrix products AB (middle) and BA (right), where A rotates the plane by 90 degrees and B reflects it in the horizontal axis. The dashed outline is the original F. Notice that both images are mirror images of the F, flipped across different lines (y = x for AB, y = -x for BA), so AB and BA are different matrices: multiplication in the ring of 2 x 2 matrices is not commutative.

Check your understanding. The rotation $A$ does not commute with $B$. Does it commute with $A^2$?

It does. Associativity gives $A \cdot A^2 = A^3 = A^2 \cdot A$, so any two powers of one element commute, in every ring. Here $A^2 = -I$, the rotation by 180 degrees, and the script confirms that $A \cdot A^2 = A^2 \cdot A = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}$. Noncommutativity is a property of particular pairs, not of every pair.

Restricting the entries to even integers gives a ring without identity, the fourth corner of the table above. Sums and products of matrices with even entries have even entries, so the set is closed under both operations. It is not commutative: with $P = \begin{pmatrix} 0 & 2 \\ 0 & 0 \end{pmatrix}$ and $Q = \begin{pmatrix} 0 & 0 \\ 2 & 0 \end{pmatrix}$, $PQ = \begin{pmatrix} 4 & 0 \\ 0 & 0 \end{pmatrix}$ while $QP = \begin{pmatrix} 0 & 0 \\ 0 & 4 \end{pmatrix}$. An identity $E$ would have to satisfy $E(2I) = 2I$. Since $E(2I) = 2E$, this forces $E = I$, whose entries are odd.

Functions

Let $F(\mathbb{R})$ be the set of all functions from $\mathbb{R}$ to $\mathbb{R}$, with the pointwise operations

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

To check an axiom, evaluate both sides at an arbitrary real number $x$. For associativity of multiplication, $((fg)h)(x) = (f(x) g(x)) h(x)$ and $(f(gh))(x) = f(x) (g(x) h(x))$. These are equal by associativity in $\mathbb{R}$, and two functions that agree at every $x$ are equal. Every other axiom is inherited from $\mathbb{R}$ in the same way. The zero element is the constant function $0$, the negative of $f$ is the function $x \mapsto -f(x)$, and the identity is the constant function $1$. So $F(\mathbb{R})$ is a commutative ring with identity. More generally, the functions from any nonempty set into any ring form a ring under the pointwise operations, for the same reason.

With $f(x) = x^2$ and $g(x) = x + 1$:

$x$ $(f + g)(x)$ $(fg)(x)$ $f(g(x))$
$-1$ 1 0 0
0 1 0 1
2 7 12 9

The last column is the composition $f \circ g$, which is a different operation. Composition is associative and has an identity (the function $x \mapsto x$), but it does not distribute over pointwise addition. With $f(x) = x^2$ and $g(x) = h(x) = x$, $f(g(x) + h(x)) = 4x^2$ while $f(g(x)) + f(h(x)) = 2x^2$; at $x = 3$ these are 36 and 18. So composition cannot serve as the multiplication of a ring with pointwise addition, and the ring product of functions is always the pointwise one. The difference matters for inverses, as the next article shows: the inverse of $f$ in the ring $F(\mathbb{R})$ is the reciprocal $1/f$, not the inverse function.

The continuous functions, the differentiable functions and the polynomial functions are rings inside $F(\mathbb{R})$ with the same operations. Sums and products of such functions are again of the same kind (Subrings and Direct Products of Rings). Judson (2026, Example 16.1.5) uses the continuous functions on an interval as a basic example of a ring.

Systems that are not rings

Seeing an axiom fail shows what it contributes.

  • The subsets of a set, with union as addition and intersection as multiplication, satisfy every axiom except additive inverses (axiom 5). Union and intersection are associative, union is commutative, and the empty set plays the part of 0, since $X \cup \varnothing = X$. Intersection distributes over union from both sides, as a Venn diagram shows. But a union can only grow: $\{1\} \cup Y$ contains 1 for every $Y$, so no $Y$ gives $\{1\} \cup Y = \varnothing$. For the eight subsets of $\{1, 2, 3\}$ the script checks every law and finds that only the empty set has an additive inverse.
  • Vectors in $\mathbb{R}^3$ with the cross product satisfy every axiom except associativity of multiplication (axiom 7). The cross product distributes over vector addition, but with the standard basis vectors $e_1$, $e_2$, $e_3$,

$$(e_1 \times e_1) \times e_2 = 0 \times e_2 = 0, \qquad e_1 \times (e_1 \times e_2) = e_1 \times e_3 = -e_2.$$

$\mathbb{R}^3$ with the cross product is an example of a Lie algebra, a kind of system with a nonassociative multiplication that is studied separately. It is not a ring in the sense of this course.

Check your understanding. The $2 \times 2$ real matrices with determinant 1, under the usual operations: which axioms fail, and which hold?

The zero matrix has determinant 0, so there is no zero element (axiom 4), and addition leads out of the set: $I$ has determinant 1, but $I + I = 2I$ has determinant 4, as the script confirms (axiom 1). Multiplication behaves well. Since $\det(XY) = \det X \det Y$, products stay in the set, and $I$ belongs to it. A set closed under one operation but not the other is not a ring; it is, however, a group under multiplication, a structure the course defines later.

Why abstract

What does the definition buy? It turns a large number of separate verifications into one. The next article proves that $a \cdot 0 = 0$, that $(-a)(-b) = ab$, and that identities and inverses are unique, each from the axioms alone. Those results then hold in $\mathbb{Z}_{1729}$, in $\mathbb{Z}[i]$, for matrices and for functions, without a separate check in each.

The argument also runs in reverse. When a familiar rule fails in some ring, as commutativity fails for matrices, it cannot be a consequence of the axioms. No proof that uses only the axioms can depend on it.

The axiomatic point of view is relatively recent. From 1922 onward, Emmy Noether used axiomatic methods to develop an abstract theory of rings and their ideals (Judson, 2026, §16.4.1). Ideals, the main tool of her theory, appear in this course in the unit on Ideals and Quotient Rings.

Where it leads

What we have learned

A ring is a set with an addition and a multiplication that satisfy eight axioms: the laws of $\mathbb{Z}_n$ without commutativity of multiplication and without an identity. The integers, $\mathbb{Z}_n$, the Gaussian integers, polynomials, matrices and functions all satisfy them. The rotation and reflection showed that a ring need not be commutative, the even integers that it need not have a 1, and $\mathbb{Z}_6[x]$ that nonzero elements can multiply to zero.

The axioms say nothing directly about $a \cdot 0$ or about $(-1)(-1)$. Do the familiar answers follow from them, in every ring? The next article, Basic Properties of Rings, proves that they do, and finds the rules that do not.

References

  • Hungerford, T. W. (2014). Abstract Algebra: An Introduction (3rd ed.), §3.1. Brooks/Cole, Cengage Learning. The course text: the definition of a ring by axioms for closure, associativity, commutativity of addition, a zero element, additive inverses and distributivity; commutative rings and rings with identity; the condition $1_R \neq 0_R$ in later definitions, to exclude the zero ring. record · 44 pages
  • Judson, T. W. (2026). Abstract Algebra: Theory and Applications (annual edition, August 2026). Free online at judsonbooks.org. §16.1 (definition of a ring, with identity not required; continuous functions on an interval as a commutative ring, Example 16.1.5; $2 \times 2$ matrices as a noncommutative ring, Example 16.1.6); Example 16.2.1 (the Gaussian integers); §16.4.1, historical note on Emmy Noether. record · 44 pages