# Field of fractions

In abstract algebra, the field of fractions of an integral domain is the smallest field in which it can be embedded. The construction of the field of fractions is modeled on the relationship between the integral domain of integers and the field of rational numbers. Intuitively, it consists of ratios between integral domain elements.
The field of fractions of an integral domain $R$ is sometimes denoted by $\operatorname {Frac} (R)$ or $\operatorname {Quot} (R)$, and the construction is sometimes also called the fraction field, field of quotients, or quotient field of $R$. All four are in common usage, but are not to be confused with the quotient of a ring by an ideal, which is a quite different concept. For a commutative ring that is not an integral domain, the analogous construction is called the localization or ring of quotients.

## Definition

Given an integral domain $R$ and letting $R^{*}=R\setminus \{0\}$, we define an equivalence relation on $R\times R^{*}$ by letting $(n,d)\sim (m,b)$ whenever $nb=md$. We denote the equivalence class of $(n,d)$ by ${\frac {n}{d}}$. This notion of equivalence is motivated by the rational numbers $\mathbb {Q}$, which have the same property with respect to the underlying ring $\mathbb {Z}$ of integers.
Then the field of fractions is the set ${\text{Frac}}(R)=(R\times R^{*})/\sim$ with addition given by
    ${\frac {n}{d}}+{\frac {m}{b}}={\frac {nb+md}{db}}$
and multiplication given by
    ${\frac {n}{d}}\cdot {\frac {m}{b}}={\frac {nm}{db}}.$
One may check that these operations are well-defined and that, for any integral domain $R$, ${\text{Frac}}(R)$ is indeed a field. In particular, for $n,d\neq 0$, the multiplicative inverse of ${\frac {n}{d}}$ is as expected: ${\frac {d}{n}}\cdot {\frac {n}{d}}=1$.
The embedding of $R$ in $\operatorname {Frac} (R)$ maps each $n$ in $R$ to the fraction ${\frac {en}{e}}$ for any nonzero $e\in R$ (the equivalence class is independent of the choice $e$). This is modeled on the identity ${\frac {n}{1}}=n$.
The field of fractions of $R$ is characterized by the following universal property:
    if $h:R\to F$ is an injective ring homomorphism from $R$ into a field $F$, then there exists a unique ring homomorphism $g:\operatorname {Frac} (R)\to F$ that extends $h$.
There is a categorical interpretation of this construction. Let $\mathbf {C}$ be the category of integral domains and injective ring maps. The functor from $\mathbf {C}$ to the category of fields that takes every integral domain to its fraction field and every homomorphism to the induced map on fields (which exists by the universal property) is the left adjoint of the inclusion functor from the category of fields to $\mathbf {C}$. Thus the category of fields (which is a full subcategory) is a reflective subcategory of $\mathbf {C}$.
A multiplicative identity is not required for the role of the integral domain; this construction can be applied to any nonzero commutative rng $R$ with no nonzero zero divisors. The embedding is given by $r\mapsto {\frac {rs}{s}}$ for any nonzero $s\in R$.

## Examples

* The field of fractions of the ring of integers is the field of rationals: $\mathbb {Q} =\operatorname {Frac} (\mathbb {Z} )$.
* Let $R:=\{a+b\mathrm {i} \mid a,b\in \mathbb {Z} \}$ be the ring of Gaussian integers. Then $\operatorname {Frac} (R)=\{c+d\mathrm {i} \mid c,d\in \mathbb {Q} \}$, the field of Gaussian rationals.
* The field of fractions of a field is canonically isomorphic to the field itself.
* Given a field $K$, the field of fractions of the polynomial ring in one indeterminate $K[X]$ (which is an integral domain), is called the field of rational functions, field of rational fractions, or field of rational expressions and is denoted $K(X)$.
* The field of fractions of the convolution ring of half-line functions yields a space of operators, including the Dirac delta function, differential operator, and integral operator. This construction gives an alternate representation of the Laplace transform that does not depend explicitly on an integral transform.

## Generalizations
### Localization

For any commutative ring $R$ and any multiplicative set $S$ in $R$, the localization $S^{-1}R$ is the commutative ring consisting of fractions
    ${\frac {r}{s}}$
with $r\in R$ and $s\in S$, where now $(r,s)$ is equivalent to $(r',s')$ if and only if there exists $t\in S$ such that $t(rs'-r's)=0$.
Two special cases of this are notable:
* If $S$ is the complement of a prime ideal $P$, then $S^{-1}R$ is also denoted $R_{P}$. When $R$ is an integral domain and $P$ is the zero ideal, $R_{P}$ is the field of fractions of $R$.
* If $S$ is the set of non-zero-divisors in $R$, then $S^{-1}R$ is called the total quotient ring. The total quotient ring of an integral domain is its field of fractions, but the total quotient ring is defined for any commutative ring.
Note that it is permitted for $S$ to contain 0, but in that case $S^{-1}R$ will be the trivial ring.

### Semifield of fractions

The semifield of fractions of a commutative semiring in which every nonzero element is (multiplicatively) cancellative is the smallest semifield in which it can be embedded. (Note that, unlike the case of rings, a semiring with no zero divisors can still have nonzero elements that are not cancellative. For example, let $\mathbb {T}$ denote the tropical semiring and let $R=\mathbb {T} [X]$ be the polynomial semiring over $\mathbb {T}$. Then $R$ has no zero divisors, but the element $1+X$ is not cancellative because $(1+X)(1+X+X^{2})=1+X+X^{2}+X^{3}=(1+X)(1+X^{2})$).
The elements of the semifield of fractions of the commutative semiring $R$ are equivalence classes written as
    ${\frac {a}{b}}$
with $a$ and $b$ in $R$ and $b\neq 0$.