# Ring of integers

The ring of integers **Z** is the simplest possible ring of integers.^{[1]} Namely, **Z** = O_{Q} where **Q** is the field of rational numbers.^{[2]} And indeed, in algebraic number theory the elements of **Z** are often called the "rational integers" because of this.

The next simplest example is the ring of Gaussian integers **Z**[*i*], consisting of complex numbers whose real and imaginary parts are integers. It is the ring of integers in the number field **Q**(*i*) of complex numbers whose real and imaginary parts are rational numbers. Like the rational integers, it is a Euclidean domain.

The ring of integers of an algebraic number field is the unique maximal order in the field. It is always a Dedekind domain.^{[3]}

The ring of integers O_{K} is a finitely-generated **Z**-module. Indeed, it is a free **Z**-module, and thus has an **integral basis**, that is a basis *b*_{1}, ... , *b*_{n} ∈ O_{K} of the **Q**-vector space K such that each element x in O_{K} can be uniquely represented as

with *a*_{i} ∈ **Z**.^{[4]} The rank n of O_{K} as a free **Z**-module is equal to the degree of K over **Q**.

If p is a prime, *ζ* is a pth root of unity and *K* = **Q**(*ζ*) is the corresponding cyclotomic field, then an integral basis of O_{K} = **Z**[*ζ*] is given by (1, *ζ*, *ζ*^{2}, ... , *ζ*^{p−2}).^{[6]}

In a ring of integers, every element has a factorization into irreducible elements, but the ring need not have the property of unique factorization: for example, in the ring of integers **Z**[√−5], the element 6 has two essentially different factorizations into irreducibles:^{[3]}^{[8]}

A ring of integers is always a Dedekind domain, and so has unique factorization of ideals into prime ideals.^{[9]}

The units of a ring of integers *O*_{K} is a finitely generated abelian group by Dirichlet's unit theorem. The torsion subgroup consists of the roots of unity of *K*. A set of torsion-free generators is called a set of *fundamental units*.^{[10]}

One defines the ring of integers of a non-archimedean local field *F* as the set of all elements of *F* with absolute value ≤ 1; this is a ring because of the strong triangle inequality.^{[11]} If *F* is the completion of an algebraic number field, its ring of integers is the completion of the latter's ring of integers. The ring of integers of an algebraic number field may be characterised as the elements which are integers in every non-archimedean completion.^{[2]}

For example, the p-adic integers **Z**_{p} are the ring of integers of the p-adic numbers **Q**_{p} .