*(This is part of my series on algebraic number theory.)*

We have seen that most of the number systems we are familiar with (the rational, real, and complex numbers) are fields. There is one notable exception: the set $\mathbf{Z}$ of integers. Indeed, if you try to tick all the boxes in the definition of a field, you see that $\mathbf{Z}$ does not fulfill all the requirements. It comes close, however: the only requirement it fails to fulfill is the existence of multiplicative inverses for all its elements. Perhaps then it might be worthwhile to relax our requirements a little and consider sets which have the same properties as $\mathbf{Z}$. This post deals with such sets, called *rings*.

**2.1 Rings**

Just like a field, a *ring* $R$ is a set with two operations called *addition* and *multiplication*. Addition is noted $+$, and multiplication is noted $\cdot$ or $\times$, or simply by juxtaposition if no ambiguity ensues. The requirements for addition are the same as those for a field: addition is associative and commutative, has an identity element noted $0$, and every element $a$ in $R$ has an additive inverse noted $-a$. However, for the most basic form of a ring we only require that multiplication be associative. We also have the distributivity law, but since we do not require that multiplication be commutative, we must state explicitly that we require both $a(b+c) = ab+ac$ and $(b+c)a = ba+ca$.

We still have $0a = a0 = 0$ for any element $a$ of $R$ (this is a consequence of the distributivity law and the fact that $0$ is the additive identity). Also, we still have the cancellation law for addition, and we can still define the operation of substraction in the same way as for a field.

*Examples:*

- As asserted above, the set $\mathbf{Z}$ of integers is a ring.
- A field $F$ satisfies all the requirements for a ring (since they are a subset of the requirements for a field), and so it is also a ring.
- If $F$ is a field, the set $F[x]$ of polynomials in one indeterminate with coefficients in $F$ is a ring. Note that, just like $\mathbf{Z}$, the only field requirement it fails to satisfy is the existence of multiplicative inverses for all its elements. The rings $\mathbf{Z}$ and $F[x]$ actually have a lot of other properties in common.
- If $R$ is a ring, we can also define the set $R[x]$ of polynomials in one indeterminate with coefficients in $R$ in the obvious manner. It is again a ring.
- Looking back at the definition of $\mathbf{F}_p$ in the first post on fields, the analogous structure obtained when we replace the prime $p$ by any positive integer $n$ is a ring, sometimes noted $\mathbf{Z}_n$. Again, the only field requirement it fails to satisfy is the existence of multiplicative inverses for all its elements. However, it lacks most of the other nice properties of $\mathbf{Z}$ and $F[x]$.

**2.2 Commutative rings and rings with unity**

If multiplication in a ring $R$ is commutative, then $R$ is a *commutative ring*. If multiplication in $R$ has an identity element, we note it $1$ and we say that $R$ is a *ring with unity*. Note that we do not require that $1 \ne 0$. There is exactly one ring such that $1 = 0$, it is the *zero ring* (also called the *trivial ring*), which contains only the element $0$ (the definition of the operations is then trivial: $0+0 = 0$ and $0 \times 0 = 0$). The definition of a *commutative ring with unity* is then obvious. We will be mostly concerned with such rings.

*Examples:*

- $F$, $\mathbf{Z}$, $F[x]$, $\mathbf{Z}_n$ are commutative rings with unity.
- The ring $2\mathbf{Z}$ of even integers is a commutative ring without unity.
- If $n$ is an integer greater than $1$, the set $M_n(F)$ of $n\times n$ matrices with coefficients in $F$ with the usual matrix addition and multiplication is a non-commutative ring with unity.
- The ring $R[x]$ inherits from $R$ the properties of being commutative and/or with unity.

**2.3 Units**

If $R$ is a ring with unity $1$, then we can ask ourselves which elements of $R$ have multiplicative inverses. Those elements are called *units*. (Yes, those two terms are regrettably very close, be careful to not mix them up.) $1$ is always a unit, but there may be others. Recall that if $R$ is a field, then *all* its non-zero elements are units. However, even if $R$ is not a field, it may be that some of its non-zero elements, besides $1$, are units.

*Examples:*

- The units in $\mathbf{Z}$ are $1$ and $-1$. In general, $-1$ is always a unit, but $1$ and $-1$ may actually be the same element (consider for example the ring $\mathbf{F}_2$).
- The units in $F[x]$ are the non-zero constant polynomials. Indeed, since $F$ is a field, for any non-zero constant polynomial $a$ we have the constant polynomial $a^{-1}$, which is the multiplicative inverse of $a$.
- In general the constant polynomials corresponding to the units in a ring $R$ are units in $R[x]$. They are not in generall
*all*the units of $R[x]$, however. For example the non-constant polynomial $2x+1$ is a unit in the ring $\mathbf{Z}_4[x]$. - By Bézout’s identity, the units of $\mathbf{Z}_n$ are precisely the elements which are relatively prime with $n$. Thus we see that $\mathbf{Z}_p$, for a prime $p$, is a field, since all the integers between $1$ and $p-1$ are relatively prime with $p$.

**Next:** Unique factorisation