# Euclidean domain

In mathematics, more specifically in ring theory, a Euclidean domain (also called a Euclidean ring) is an integral domain that can be endowed with a Euclidean function which allows a suitable generalization of Euclidean division of integers. This generalized Euclidean algorithm can be put to many of the same uses as Euclid's original algorithm in the ring of integers: in any Euclidean domain, one can apply the Euclidean algorithm to compute the greatest common divisor of any two elements. In particular, the greatest common divisor of any two elements exists and can be written as a linear combination of them (Bézout's identity). In particular, the existence of efficient algorithms for Euclidean division of integers and of polynomials in one variable over a field is of basic importance in computer algebra.
It is important to compare the class of Euclidean domains with the larger class of principal ideal domains (PIDs). An arbitrary PID has much the same "structural properties" of a Euclidean domain (or, indeed, even of the ring of integers), but lacks an analogue of the Euclidean algorithm and extended Euclidean algorithm to compute greatest common divisors. So, given an integral domain R, it is often very useful to know that R has a Euclidean function: in particular, this implies that R is a PID. However, if there is no "obvious" Euclidean function, then determining whether R is a PID is generally a much easier problem than determining whether it is a Euclidean domain.
Every ideal in a Euclidean domain is principal, which implies a suitable generalization of the fundamental theorem of arithmetic: every Euclidean domain is also a unique factorization domain. Euclidean domains appear in the following chain of class inclusions:
    rngs ⊃ rings ⊃ commutative rings ⊃ integral domains ⊃ integrally closed domains ⊃ GCD domains ⊃ unique factorization domains ⊃ principal ideal domains ⊃ Euclidean domains ⊃ fields ⊃ algebraically closed fields

## Definition

Let R be an integral domain. A Euclidean function on R is a function f from R \ {0} to the non-negative integers satisfying the following fundamental division-with-remainder property:
* (EF1) If a and b are in R and b is nonzero, then there exist q and r in R such that a = bq + r and either r = 0 or f (r) < f (b).
A Euclidean domain is an integral domain which can be endowed with at least one Euclidean function. A particular Euclidean function f is not part of the definition of a Euclidean domain, as, in general, a Euclidean domain may admit many different Euclidean functions.
In this context, q and r are called respectively a quotient and a remainder of the division (or Euclidean division) of a by b. In contrast with the case of integers and polynomials, the quotient is generally not uniquely defined, but when a quotient has been chosen, the remainder is uniquely defined.
Most algebra texts require a Euclidean function to have the following additional property:
* (EF2) For all nonzero a and b in R, f (a) ≤ f (ab).
However, one can show that (EF1) alone suffices to define a Euclidean domain; if an integral domain R is endowed with a function g satisfying (EF1), then R can also be endowed with a function satisfying both (EF1) and (EF2) simultaneously. Indeed, for a in R \ {0} , one can define f (a) as follows:
    $f(a)=\min _{x\in R\setminus \{0\}}g(xa)$
In words, one may define f (a) to be the minimum value attained by g on the set of all non-zero elements of the principal ideal generated by a.
A Euclidean function f is multiplicative if f (ab) = f (a) f (b) and f (a) is never zero. It follows that f (1) = 1. More generally, f (a) = 1 if and only if a is a unit.

### Notes on the definition

Many authors use other terms in place of "Euclidean function", such as "degree function", "valuation function", "gauge function" or "norm function". Some authors also require the domain of the Euclidean function to be the entire ring R; however, this does not essentially affect the definition, since (EF1) does not involve the value of f (0). The definition is sometimes generalized by allowing the Euclidean function to take its values in any well-ordered set; this weakening does not affect the most important implications of the Euclidean property.
The property (EF1) can be restated as follows: for any principal ideal I of R with nonzero generator b, all nonzero classes of the quotient ring R/I have a representative r with f (r) < f (b). Since the possible values of f are well-ordered, this property can be established by showing that f (r) < f (b) for any r ∉ I with minimal value of f (r) in its class. Note that, for a Euclidean function that is so established, there need not exist an effective method to determine q and r in (EF1).

## Examples

Examples of Euclidean domains include:
* Any field. Define f (x) = 1 for all nonzero x.
* Z, the ring of integers. Define f (n) = |n|, the absolute value of n.
* Z[ i ], the ring of Gaussian integers. Define f (a + bi) = a$^2$ + b$^2$, the norm of the Gaussian integer a + bi.
* Z[ω] (where ω is a primitive (non-real) cube root of unity), the ring of Eisenstein integers. Define f (a + bω) = a$^2$ − ab + b$^2$, the norm of the Eisenstein integer a + bω.
* K[X], the ring of polynomials over a field K. For each nonzero polynomial P, define f (P) to be the degree of P.
* K[[X]], the ring of formal power series over the field K. For each nonzero power series P, define f (P) as the order of P, that is the degree of the smallest power of X occurring in P. In particular, for two nonzero power series P and Q, f (P) ≤ f (Q) if and only if P divides Q.
* Any discrete valuation ring. Define f (x) to be the highest power of the maximal ideal M containing x. Equivalently, let g be a generator of M, and v be the unique integer such that g $^v$ is an associate of x, then define f (x) = v. The previous example K[[X]] is a special case of this.
* A Dedekind domain with finitely many nonzero prime ideals P$_1$, ..., P$_n$. Define $f(x)=\sum _{i=1}^{n}v_{i}(x)$, where v$_i$ is the discrete valuation corresponding to the ideal P$_i$.
Examples of domains that are not Euclidean domains include:
* Every domain that is not a principal ideal domain, such as the ring of polynomials in at least two indeterminates over a field, or the ring of univariate polynomials with integer coefficients, or the number ring Z[ √−5 ].
* The ring of integers of Q( √−19 ), consisting of the numbers ⁠a + b√−19/2⁠ where a and b are integers and both even or both odd. It is a principal ideal domain that is not Euclidean.This was proved by Theodore Motzkin and was the first case known.
* The ring A = R[X, Y]/(X$^2$ + Y$^2$ + 1) is also a principal ideal domain that is not Euclidean. To see that it is not a Euclidean domain, it suffices to show that for every non-zero prime $p\in A$, the map $A^{\times }\to (A/p)^{\times }$ induced by the quotient map $A\to A/p$ is not surjective.

## Properties

Let R be a domain and f a Euclidean function on R. Then:
* R is a principal ideal domain (PID). In fact, if I is a nonzero ideal of R then any element a of I \ {0} with minimal value (on that set) of f(a) is a generator of I. As a consequence R is also a unique factorization domain and a Noetherian ring. With respect to general principal ideal domains, the existence of factorizations (i.e., that R is an atomic domain) is particularly easy to prove in Euclidean domains: choosing a Euclidean function f satisfying (EF2), x cannot have any decomposition into more than f(x) nonunit factors, so starting with x and repeatedly decomposing reducible factors is bound to produce a factorization into irreducible elements.
* Any element of R at which f takes its globally minimal value is invertible in R. If an f satisfying (EF2) is chosen, then the converse also holds, and f takes its minimal value exactly at the invertible elements of R.
* If Euclidean division is algorithmic, that is, if there is an algorithm for computing the quotient and the remainder, then an extended Euclidean algorithm can be defined exactly as in the case of integers.
* If a Euclidean domain is not a field then it has an element a with the following property: any element x not divisible by a can be written as x = ay + u for some unit u and some element y. This follows by taking a to be a non-unit with f(a) as small as possible. This strange property can be used to show that some principal ideal domains are not Euclidean domains, as not all PIDs have this property. For example, for d = −19, −43, −67, −163, the ring of integers of $\mathbf {Q} ({\sqrt {d}}\,)$ is a PID which is not Euclidean, but the cases d = −1, −2, −3, −7, −11 are Euclidean.
However, in many finite extensions of Q with trivial class group, the ring of integers is Euclidean (not necessarily with respect to the absolute value of the field norm; see below). Assuming the extended Riemann hypothesis, if K is a finite extension of Q and the ring of integers of K is a PID with an infinite number of units, then the ring of integers is Euclidean. In particular this applies to the case of totally real quadratic number fields with trivial class group. In addition (and without assuming ERH), if the field K is a Galois extension of Q, has trivial class group and unit rank strictly greater than three, then the ring of integers is Euclidean. An immediate corollary of this is that if the number field is Galois over Q, its class group is trivial and the extension has degree greater than 8 then the ring of integers is necessarily Euclidean.

## Norm-Euclidean fields

Algebraic number fields K come with a canonical norm function on them: the absolute value of the field norm N that takes an algebraic element α to the product of all the conjugates of α. This norm maps the ring of integers of a number field K, say O$_K$, to the nonnegative rational integers, so it is a candidate to be a Euclidean norm on this ring. If this norm satisfies the axioms of a Euclidean function then the number field K is called norm-Euclidean or simply Euclidean. Strictly speaking it is the ring of integers that is Euclidean since fields are trivially Euclidean domains, but the terminology is standard.
If a field is not norm-Euclidean then that does not mean the ring of integers is not Euclidean, just that the field norm does not satisfy the axioms of a Euclidean function. In fact, the rings of integers of number fields may be divided in several classes:
* Those that are not principal and therefore not Euclidean, such as the integers of $\mathbf {Q} ({\sqrt {-5}}\,)$
* Those that are principal and not Euclidean, such as the integers of $\mathbf {Q} ({\sqrt {-19}}\,)$
* Those that are Euclidean and not norm-Euclidean, such as the integers of $\mathbf {Q} ({\sqrt {69}}\,)$
* Those that are norm-Euclidean, such as Gaussian integers (integers of $\mathbf {Q} ({\sqrt {-1}}\,)$)
The norm-Euclidean quadratic fields have been fully classified; they are $\mathbf {Q} ({\sqrt {d}}\,)$ where $d$ takes the values
    −11, −7, −3, −2, −1, 2, 3, 5, 6, 7, 11, 13, 17, 19, 21, 29, 33, 37, 41, 57, 73 (sequence A048981 in the OEIS).
Every Euclidean imaginary quadratic field is norm-Euclidean and is one of the five first fields in the preceding list.