Fraction Field of Integral Domains - General Rings, Ideals, and Morphisms

Skip to content
Back to top
View this page
Edit this page

# Fraction Field of Integral Domains

AUTHORS:

- William Stein (with input from David Joyner, David Kohel, and Joe Wetherell)

- Burcin Erocal

- Julian Rüth (2017-06-27): embedding into the field of fractions and its section

EXAMPLES:

Quotienting is a constructor for an element of the fraction field:

Sage

    sage: R.<x> = QQ[]
    sage: (x^2-1)/(x+1)
    x - 1
    sage: parent((x^2-1)/(x+1))
    Fraction Field of Univariate Polynomial Ring in x over Rational Field

Python

    >>> from sage.all import *
    >>> R = QQ['x']; (x,) = R._first_ngens(1)
    >>> (x**Integer(2)-Integer(1))/(x+Integer(1))
    x - 1
    >>> parent((x**Integer(2)-Integer(1))/(x+Integer(1)))
    Fraction Field of Univariate Polynomial Ring in x over Rational Field

The GCD is not taken (since it doesn’t converge sometimes) in the inexact case:

Sage

    sage: Z.<z> = CC[]
    sage: I = CC.gen()
    sage: (1+I+z)/(z+0.1*I)
    (z + 1.00000000000000 + I)/(z + 0.100000000000000*I)
    sage: (1+I*z)/(z+1.1)
    (I*z + 1.00000000000000)/(z + 1.10000000000000)

[Python]

    >>> from sage.all import *
    >>> Z = CC['z']; (z,) = Z._first_ngens(1)
    >>> I = CC.gen()
    >>> (Integer(1)+I+z)/(z+RealNumber('0.1')*I)
    (z + 1.00000000000000 + I)/(z + 0.100000000000000*I)
    >>> (Integer(1)+I*z)/(z+RealNumber('1.1'))
    (I*z + 1.00000000000000)/(z + 1.10000000000000)

sage.rings.fraction_field.FractionField(R, names=None)

  Create the fraction field of the integral domain `R`.

  INPUT:

  - `R` – an integral domain

  - `names` – ignored

  EXAMPLES:

  We create some example fraction fields:

  Sage

      sage: FractionField(IntegerRing())
      Rational Field
      sage: FractionField(PolynomialRing(RationalField(),'x'))
      Fraction Field of Univariate Polynomial Ring in x over Rational Field
      sage: FractionField(PolynomialRing(IntegerRing(),'x'))
      Fraction Field of Univariate Polynomial Ring in x over Integer Ring
      sage: FractionField(PolynomialRing(RationalField(),2,'x'))
      Fraction Field of Multivariate Polynomial Ring in x0, x1 over Rational Field

  Python

      >>> from sage.all import *
      >>> FractionField(IntegerRing())
      Rational Field
      >>> FractionField(PolynomialRing(RationalField(),'x'))
      Fraction Field of Univariate Polynomial Ring in x over Rational Field
      >>> FractionField(PolynomialRing(IntegerRing(),'x'))
      Fraction Field of Univariate Polynomial Ring in x over Integer Ring
      >>> FractionField(PolynomialRing(RationalField(),Integer(2),'x'))
      Fraction Field of Multivariate Polynomial Ring in x0, x1 over Rational Field

  Dividing elements often implicitly creates elements of the fraction field:

  Sage

      sage: x = PolynomialRing(RationalField(), 'x').gen()
      sage: f = x/(x+1)
      sage: g = x**3/(x+1)
      sage: f/g
      1/x^2
      sage: g/f
      x^2

  [Python]

      >>> from sage.all import *
      >>> x = PolynomialRing(RationalField(), 'x').gen()
      >>> f = x/(x+Integer(1))
      >>> g = x**Integer(3)/(x+Integer(1))
      >>> f/g
      1/x^2
      >>> g/f
      x^2

  The input must be an integral domain:

  Sage

      sage: Frac(Integers(4))
      Traceback (most recent call last):
      ...
      TypeError: R must be an integral domain

  Python

      >>> from sage.all import *
      >>> Frac(Integers(Integer(4)))
      Traceback (most recent call last):
      ...
      TypeError: R must be an integral domain

class sage.rings.fraction_field.FractionFieldEmbedding

  Bases: `DefaultConvertMap_unique`

  The embedding of an integral domain into its field of fractions.

  EXAMPLES:

  Sage

      sage: R.<x> = QQ[]
      sage: f = R.fraction_field().coerce_map_from(R); f
      Coercion map:
        From: Univariate Polynomial Ring in x over Rational Field
        To:   Fraction Field of Univariate Polynomial Ring in x over Rational Field

  Python

      >>> from sage.all import *
      >>> R = QQ['x']; (x,) = R._first_ngens(1)
      >>> f = R.fraction_field().coerce_map_from(R); f
      Coercion map:
        From: Univariate Polynomial Ring in x over Rational Field
        To:   Fraction Field of Univariate Polynomial Ring in x over Rational Field

  is_injective()

    Return whether this map is injective.

    EXAMPLES:

    The map from an integral domain to its fraction field is always injective:

    Sage

        sage: R.<x> = QQ[]
        sage: R.fraction_field().coerce_map_from(R).is_injective()
        True

    Python

        >>> from sage.all import *
        >>> R = QQ['x']; (x,) = R._first_ngens(1)
        >>> R.fraction_field().coerce_map_from(R).is_injective()
        True

  is_surjective()

    Return whether this map is surjective.

    EXAMPLES:

    Sage

        sage: R.<x> = QQ[]
        sage: R.fraction_field().coerce_map_from(R).is_surjective()
        False

    Python

        >>> from sage.all import *
        >>> R = QQ['x']; (x,) = R._first_ngens(1)
        >>> R.fraction_field().coerce_map_from(R).is_surjective()
        False

  section()

    Return a section of this map.

    EXAMPLES:

    Sage

        sage: R.<x> = QQ[]
        sage: R.fraction_field().coerce_map_from(R).section()
        Section map:
          From: Fraction Field of Univariate Polynomial Ring in x over Rational Field
          To:   Univariate Polynomial Ring in x over Rational Field

    Python

        >>> from sage.all import *
        >>> R = QQ['x']; (x,) = R._first_ngens(1)
        >>> R.fraction_field().coerce_map_from(R).section()
        Section map:
          From: Fraction Field of Univariate Polynomial Ring in x over Rational Field
          To:   Univariate Polynomial Ring in x over Rational Field

class sage.rings.fraction_field.FractionFieldEmbeddingSection

  Bases: `Section`

  The section of the embedding of an integral domain into its field of fractions.

  EXAMPLES:

  Sage

      sage: R.<x> = QQ[]
      sage: f = R.fraction_field().coerce_map_from(R).section(); f
      Section map:
        From: Fraction Field of Univariate Polynomial Ring in x over Rational Field
        To:   Univariate Polynomial Ring in x over Rational Field

  Python

      >>> from sage.all import *
      >>> R = QQ['x']; (x,) = R._first_ngens(1)
      >>> f = R.fraction_field().coerce_map_from(R).section(); f
      Section map:
        From: Fraction Field of Univariate Polynomial Ring in x over Rational Field
        To:   Univariate Polynomial Ring in x over Rational Field

class sage.rings.fraction_field.FractionField_1poly_field(R, element_class=<class 'sage.rings.fraction_field_element.FractionFieldElement_1poly_field'>)

  Bases: `FractionField_generic`

  The fraction field of a univariate polynomial ring over a field.

  Many of the functions here are included for coherence with number fields.

  class_number()

    Here for compatibility with number fields and function fields.

    EXAMPLES:

    Sage

        sage: R.<t> = GF(5)[]; K = R.fraction_field()
        sage: K.class_number()
        1

    Python

        >>> from sage.all import *
        >>> R = GF(Integer(5))['t']; (t,) = R._first_ngens(1); K = R.fraction_field()
        >>> K.class_number()
        1

  function_field()

    Return the isomorphic function field.

    EXAMPLES:

    Sage

        sage: R.<t> = GF(5)[]
        sage: K = R.fraction_field()
        sage: K.function_field()
        Rational function field in t over Finite Field of size 5

    Python

        >>> from sage.all import *
        >>> R = GF(Integer(5))['t']; (t,) = R._first_ngens(1)
        >>> K = R.fraction_field()
        >>> K.function_field()
        Rational function field in t over Finite Field of size 5

    See also

    `sage.rings.function_field.RationalFunctionField.field()`

  maximal_order()

    Return the maximal order in this fraction field.

    EXAMPLES:

    Sage

        sage: K = FractionField(GF(5)['t'])
        sage: K.maximal_order()
        Univariate Polynomial Ring in t over Finite Field of size 5

    Python

        >>> from sage.all import *
        >>> K = FractionField(GF(Integer(5))['t'])
        >>> K.maximal_order()
        Univariate Polynomial Ring in t over Finite Field of size 5

  ring_of_integers()

    Return the ring of integers in this fraction field.

    EXAMPLES:

    Sage

        sage: K = FractionField(GF(5)['t'])
        sage: K.ring_of_integers()
        Univariate Polynomial Ring in t over Finite Field of size 5

    Python

        >>> from sage.all import *
        >>> K = FractionField(GF(Integer(5))['t'])
        >>> K.ring_of_integers()
        Univariate Polynomial Ring in t over Finite Field of size 5

class sage.rings.fraction_field.FractionField_generic(R, element_class=<class 'sage.rings.fraction_field_element.FractionFieldElement'>, category=Category of quotient fields)

  Bases: `Field`

  The fraction field of an integral domain.

  base_ring()

    Return the base ring of `self`.

    This is the base ring of the ring which this fraction field is the fraction field of.

    EXAMPLES:

    Sage

        sage: R = Frac(ZZ['t'])
        sage: R.base_ring()
        Integer Ring

    Python

        >>> from sage.all import *
        >>> R = Frac(ZZ['t'])
        >>> R.base_ring()
        Integer Ring

  characteristic()

    Return the characteristic of this fraction field.

    EXAMPLES:

    Sage

        sage: R = Frac(ZZ['t'])
        sage: R.base_ring()
        Integer Ring
        sage: R = Frac(ZZ['t']); R.characteristic()
        0
        sage: R = Frac(GF(5)['w']); R.characteristic()
        5

    Python

        >>> from sage.all import *
        >>> R = Frac(ZZ['t'])
        >>> R.base_ring()
        Integer Ring
        >>> R = Frac(ZZ['t']); R.characteristic()
        0
        >>> R = Frac(GF(Integer(5))['w']); R.characteristic()
        5

  construction()

    EXAMPLES:

    Sage

        sage: Frac(ZZ['x']).construction()
        (FractionField, Univariate Polynomial Ring in x over Integer Ring)
        sage: K = Frac(GF(3)['t'])
        sage: f, R = K.construction()
        sage: f(R)
        Fraction Field of Univariate Polynomial Ring in t
         over Finite Field of size 3
        sage: f(R) == K
        True

    Python

        >>> from sage.all import *
        >>> Frac(ZZ['x']).construction()
        (FractionField, Univariate Polynomial Ring in x over Integer Ring)
        >>> K = Frac(GF(Integer(3))['t'])
        >>> f, R = K.construction()
        >>> f(R)
        Fraction Field of Univariate Polynomial Ring in t
         over Finite Field of size 3
        >>> f(R) == K
        True

  gen(i=0)

    Return the `i`-th generator of `self`.

    EXAMPLES:

    Sage

        sage: R = Frac(PolynomialRing(QQ,'z',10)); R
        Fraction Field of Multivariate Polynomial Ring
         in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field
        sage: R.0
        z0
        sage: R.gen(3)
        z3
        sage: R.3
        z3

    Python

        >>> from sage.all import *
        >>> R = Frac(PolynomialRing(QQ,'z',Integer(10))); R
        Fraction Field of Multivariate Polynomial Ring
         in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field
        >>> R.gen(0)
        z0
        >>> R.gen(Integer(3))
        z3
        >>> R.gen(3)
        z3

  is_exact()

    Return if `self` is exact which is if the underlying ring is exact.

    EXAMPLES:

    Sage

        sage: Frac(ZZ['x']).is_exact()
        True
        sage: Frac(CDF['x']).is_exact()                                             # needs sage.rings.complex_double
        False

    Python

        >>> from sage.all import *
        >>> Frac(ZZ['x']).is_exact()
        True
        >>> Frac(CDF['x']).is_exact()                                             # needs sage.rings.complex_double
        False

  is_field(proof=True)

    Return `True`, since the fraction field is a field.

    EXAMPLES:

    Sage

        sage: Frac(ZZ).is_field()
        True

    Python

        >>> from sage.all import *
        >>> Frac(ZZ).is_field()
        True

  is_finite()

    Tells whether this fraction field is finite.

    Note

    A fraction field is finite if and only if the associated integral domain is finite.

    EXAMPLES:

    Sage

        sage: Frac(QQ['a','b','c']).is_finite()
        False

    Python

        >>> from sage.all import *
        >>> Frac(QQ['a','b','c']).is_finite()
        False

  ngens()

    This is the same as for the parent object.

    EXAMPLES:

    Sage

        sage: R = Frac(PolynomialRing(QQ,'z',10)); R
        Fraction Field of Multivariate Polynomial Ring
         in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field
        sage: R.ngens()
        10

    Python

        >>> from sage.all import *
        >>> R = Frac(PolynomialRing(QQ,'z',Integer(10))); R
        Fraction Field of Multivariate Polynomial Ring
         in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field
        >>> R.ngens()
        10

  random_element(*args, **kwds)

    Return a random element in this fraction field.

    The arguments are passed to the random generator of the underlying ring.

    EXAMPLES:

    Sage

        sage: F = ZZ['x'].fraction_field()
        sage: F.random_element()  # random
        (2*x - 8)/(-x^2 + x)

    Python

        >>> from sage.all import *
        >>> F = ZZ['x'].fraction_field()
        >>> F.random_element()  # random
        (2*x - 8)/(-x^2 + x)

    Sage

        sage: f = F.random_element(degree=5)
        sage: f.numerator().degree() == f.denominator().degree()
        True
        sage: f.denominator().degree() <= 5
        True
        sage: while f.numerator().degree() != 5:
        ....:      f = F.random_element(degree=5)

    [Python]

        >>> from sage.all import *
        >>> f = F.random_element(degree=Integer(5))
        >>> f.numerator().degree() == f.denominator().degree()
        True
        >>> f.denominator().degree() <= Integer(5)
        True
        >>> while f.numerator().degree() != Integer(5):
        ...      f = F.random_element(degree=Integer(5))

  ring()

    Return the ring that this is the fraction field of.

    EXAMPLES:

    Sage

        sage: R = Frac(QQ['x,y'])
        sage: R
        Fraction Field of Multivariate Polynomial Ring in x, y over Rational Field
        sage: R.ring()
        Multivariate Polynomial Ring in x, y over Rational Field

    Python

        >>> from sage.all import *
        >>> R = Frac(QQ['x,y'])
        >>> R
        Fraction Field of Multivariate Polynomial Ring in x, y over Rational Field
        >>> R.ring()
        Multivariate Polynomial Ring in x, y over Rational Field

  some_elements()

    Return some elements in this field.

    EXAMPLES:

    Sage

        sage: R.<x> = QQ[]
        sage: R.fraction_field().some_elements()
        [0,
         1,
         x,
         2*x,
         x/(x^2 + 2*x + 1),
         1/x^2,
         ...
         (2*x^2 + 2)/(x^2 + 2*x + 1),
         (2*x^2 + 2)/x^3,
         (2*x^2 + 2)/(x^2 - 1),
         2]

    Python

        >>> from sage.all import *
        >>> R = QQ['x']; (x,) = R._first_ngens(1)
        >>> R.fraction_field().some_elements()
        [0,
         1,
         x,
         2*x,
         x/(x^2 + 2*x + 1),
         1/x^2,
         ...
         (2*x^2 + 2)/(x^2 + 2*x + 1),
         (2*x^2 + 2)/x^3,
         (2*x^2 + 2)/(x^2 - 1),
         2]