Ideals of function fields - Algebraic Function Fields

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

# Ideals of function fields

Ideals of an order of a function field include all fractional ideals of the order. Sage provides basic arithmetic with fractional ideals.

The fractional ideals of the maximal order of a global function field forms a multiplicative monoid. Sage allows advanced arithmetic with the fractional ideals. For example, an ideal of the maximal order can be factored into a product of prime ideals.

EXAMPLES:

Ideals in the maximal order of a rational function field:

Sage

    sage: K.<x> = FunctionField(QQ)
    sage: O = K.maximal_order()
    sage: I = O.ideal(x^3 + 1); I
    Ideal (x^3 + 1) of Maximal order of Rational function field in x over Rational Field
    sage: I^2
    Ideal (x^6 + 2*x^3 + 1) of Maximal order of Rational function field in x over Rational Field
    sage: ~I
    Ideal (1/(x^3 + 1)) of Maximal order of Rational function field in x over Rational Field
    sage: ~I * I
    Ideal (1) of Maximal order of Rational function field in x over Rational Field

Python

    >>> from sage.all import *
    >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1)
    >>> O = K.maximal_order()
    >>> I = O.ideal(x**Integer(3) + Integer(1)); I
    Ideal (x^3 + 1) of Maximal order of Rational function field in x over Rational Field
    >>> I**Integer(2)
    Ideal (x^6 + 2*x^3 + 1) of Maximal order of Rational function field in x over Rational Field
    >>> ~I
    Ideal (1/(x^3 + 1)) of Maximal order of Rational function field in x over Rational Field
    >>> ~I * I
    Ideal (1) of Maximal order of Rational function field in x over Rational Field

Ideals in the equation order of an extension of a rational function field:

Sage

    sage: K.<x> = FunctionField(QQ); R.<y> = K[]
    sage: L.<y> = K.extension(y^2 - x^3 - 1)                                                                            # needs sage.rings.function_field
    sage: O = L.equation_order()                                                                                        # needs sage.rings.function_field
    sage: I = O.ideal(y); I                                                                                             # needs sage.rings.function_field
    Ideal (x^3 + 1, -y) of Order in Function field in y defined by y^2 - x^3 - 1
    sage: I^2                                                                                                           # needs sage.rings.function_field
    Ideal (x^3 + 1, (-x^3 - 1)*y) of Order in Function field in y defined by y^2 - x^3 - 1

[Python]

    >>> from sage.all import *
    >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); R = K['y']; (y,) = R._first_ngens(1)
    >>> L = K.extension(y**Integer(2) - x**Integer(3) - Integer(1), names=('y',)); (y,) = L._first_ngens(1)# needs sage.rings.function_field
    >>> O = L.equation_order()                                                                                        # needs sage.rings.function_field
    >>> I = O.ideal(y); I                                                                                             # needs sage.rings.function_field
    Ideal (x^3 + 1, -y) of Order in Function field in y defined by y^2 - x^3 - 1
    >>> I**Integer(2)                                                                                                           # needs sage.rings.function_field
    Ideal (x^3 + 1, (-x^3 - 1)*y) of Order in Function field in y defined by y^2 - x^3 - 1

Ideals in the maximal order of a global function field:

Sage

    sage: K.<x> = FunctionField(GF(2)); R.<y> = K[]
    sage: L.<y> = K.extension(y^2 - x^3*y - x)                                                                          # needs sage.rings.function_field
    sage: O = L.maximal_order()                                                                                         # needs sage.rings.function_field
    sage: I = O.ideal(y)                                                                                                # needs sage.rings.function_field
    sage: I^2                                                                                                           # needs sage.rings.function_field
    Ideal (x) of Maximal order of Function field in y defined by y^2 + x^3*y + x
    sage: ~I                                                                                                            # needs sage.rings.function_field
    Ideal (1/x*y) of Maximal order of Function field in y defined by y^2 + x^3*y + x
    sage: ~I * I                                                                                                        # needs sage.rings.function_field
    Ideal (1) of Maximal order of Function field in y defined by y^2 + x^3*y + x

    sage: J = O.ideal(x + y) * I                                                                                        # needs sage.rings.finite_rings sage.rings.function_field
    sage: J.factor()                                                                                                    # needs sage.rings.finite_rings sage.rings.function_field
    (Ideal (y) of Maximal order of Function field in y defined by y^2 + x^3*y + x)^2 *
    (Ideal (x^3 + x + 1, y + x) of Maximal order of Function field in y defined by y^2 + x^3*y + x)

Python

    >>> from sage.all import *
    >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1); R = K['y']; (y,) = R._first_ngens(1)
    >>> L = K.extension(y**Integer(2) - x**Integer(3)*y - x, names=('y',)); (y,) = L._first_ngens(1)# needs sage.rings.function_field
    >>> O = L.maximal_order()                                                                                         # needs sage.rings.function_field
    >>> I = O.ideal(y)                                                                                                # needs sage.rings.function_field
    >>> I**Integer(2)                                                                                                           # needs sage.rings.function_field
    Ideal (x) of Maximal order of Function field in y defined by y^2 + x^3*y + x
    >>> ~I                                                                                                            # needs sage.rings.function_field
    Ideal (1/x*y) of Maximal order of Function field in y defined by y^2 + x^3*y + x
    >>> ~I * I                                                                                                        # needs sage.rings.function_field
    Ideal (1) of Maximal order of Function field in y defined by y^2 + x^3*y + x

    >>> J = O.ideal(x + y) * I                                                                                        # needs sage.rings.finite_rings sage.rings.function_field
    >>> J.factor()                                                                                                    # needs sage.rings.finite_rings sage.rings.function_field
    (Ideal (y) of Maximal order of Function field in y defined by y^2 + x^3*y + x)^2 *
    (Ideal (x^3 + x + 1, y + x) of Maximal order of Function field in y defined by y^2 + x^3*y + x)

Ideals in the maximal infinite order of a global function field:

Sage

    sage: K.<x> = FunctionField(GF(3^2)); R.<t> = K[]
    sage: F.<y> = K.extension(t^3 + t^2 - x^4)                                                                          # needs sage.rings.function_field
    sage: Oinf = F.maximal_order_infinite()                                                                             # needs sage.rings.function_field
    sage: I = Oinf.ideal(1/y)                                                                                           # needs sage.rings.function_field
    sage: I + I == I
    True
    sage: I^2                                                                                                           # needs sage.rings.function_field
    Ideal (1/x^4*y) of Maximal infinite order of Function field in y defined by y^3 + y^2 + 2*x^4
    sage: ~I                                                                                                            # needs sage.rings.function_field
    Ideal (y) of Maximal infinite order of Function field in y defined by y^3 + y^2 + 2*x^4
    sage: ~I * I                                                                                                        # needs sage.rings.function_field
    Ideal (1) of Maximal infinite order of Function field in y defined by y^3 + y^2 + 2*x^4
    sage: I.factor()                                                                                                    # needs sage.rings.function_field
    (Ideal (1/x^3*y^2) of Maximal infinite order of Function field in y defined by y^3 + y^2 + 2*x^4)^4

[Python]

    >>> from sage.all import *
    >>> K = FunctionField(GF(Integer(3)**Integer(2)), names=('x',)); (x,) = K._first_ngens(1); R = K['t']; (t,) = R._first_ngens(1)
    >>> F = K.extension(t**Integer(3) + t**Integer(2) - x**Integer(4), names=('y',)); (y,) = F._first_ngens(1)# needs sage.rings.function_field
    >>> Oinf = F.maximal_order_infinite()                                                                             # needs sage.rings.function_field
    >>> I = Oinf.ideal(Integer(1)/y)                                                                                           # needs sage.rings.function_field
    >>> I + I == I
    True
    >>> I**Integer(2)                                                                                                           # needs sage.rings.function_field
    Ideal (1/x^4*y) of Maximal infinite order of Function field in y defined by y^3 + y^2 + 2*x^4
    >>> ~I                                                                                                            # needs sage.rings.function_field
    Ideal (y) of Maximal infinite order of Function field in y defined by y^3 + y^2 + 2*x^4
    >>> ~I * I                                                                                                        # needs sage.rings.function_field
    Ideal (1) of Maximal infinite order of Function field in y defined by y^3 + y^2 + 2*x^4
    >>> I.factor()                                                                                                    # needs sage.rings.function_field
    (Ideal (1/x^3*y^2) of Maximal infinite order of Function field in y defined by y^3 + y^2 + 2*x^4)^4

AUTHORS:

- William Stein (2010): initial version

- Maarten Derickx (2011-09-14): fixed ideal_with_gens_over_base()

- Kwankyu Lee (2017-04-30): added ideals for global function fields

class sage.rings.function_field.ideal.FunctionFieldIdeal(ring)

  Bases: `Element`

  Base class of fractional ideals of function fields.

  INPUT:

  - `ring` – ring of the ideal

  EXAMPLES:

  Sage

      sage: K.<x> = FunctionField(GF(7))
      sage: O = K.equation_order()
      sage: O.ideal(x^3 + 1)
      Ideal (x^3 + 1) of Maximal order of Rational function field in x over Finite Field of size 7

  Python

      >>> from sage.all import *
      >>> K = FunctionField(GF(Integer(7)), names=('x',)); (x,) = K._first_ngens(1)
      >>> O = K.equation_order()
      >>> O.ideal(x**Integer(3) + Integer(1))
      Ideal (x^3 + 1) of Maximal order of Rational function field in x over Finite Field of size 7

  base_ring()

    Return the base ring of this ideal.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(QQ); R.<y> = K[]
        sage: L.<y> = K.extension(y^2 - x^3 - 1)
        sage: O = L.equation_order()
        sage: I = O.ideal(x^2 + 1)
        sage: I.base_ring()
        Order in Function field in y defined by y^2 - x^3 - 1

    Python

        >>> from sage.all import *
        >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); R = K['y']; (y,) = R._first_ngens(1)
        >>> L = K.extension(y**Integer(2) - x**Integer(3) - Integer(1), names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.equation_order()
        >>> I = O.ideal(x**Integer(2) + Integer(1))
        >>> I.base_ring()
        Order in Function field in y defined by y^2 - x^3 - 1

  divisor()

    Return the divisor corresponding to the ideal.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(GF(4))
        sage: O = K.maximal_order()
        sage: I = O.ideal(x*(x + 1)^2/(x^2 + x + 1))
        sage: I.divisor()
        Place (x) + 2*Place (x + 1) - Place (x + z2) - Place (x + z2 + 1)

        sage: Oinf = K.maximal_order_infinite()
        sage: I = Oinf.ideal((x + 1)/(x^3 + 1))
        sage: I.divisor()
        2*Place (1/x)

        sage: K.<x> = FunctionField(GF(2)); _.<T> = PolynomialRing(K)
        sage: F.<y> = K.extension(T^3 - x^2*(x^2 + x + 1)^2)
        sage: O = F.maximal_order()
        sage: I = O.ideal(y)
        sage: I.divisor()
        2*Place (x, (1/(x^3 + x^2 + x))*y^2)
         + 2*Place (x^2 + x + 1, (1/(x^3 + x^2 + x))*y^2)

        sage: Oinf = F.maximal_order_infinite()
        sage: I = Oinf.ideal(y)
        sage: I.divisor()
        -2*Place (1/x, 1/x^4*y^2 + 1/x^2*y + 1)
         - 2*Place (1/x, 1/x^2*y + 1)

        sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
        sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
        sage: O = L.maximal_order()
        sage: I = O.ideal(y)
        sage: I.divisor()
        - Place (x, x*y)
         + 2*Place (x + 1, x*y)

        sage: Oinf = L.maximal_order_infinite()
        sage: I = Oinf.ideal(y)
        sage: I.divisor()
        - Place (1/x, 1/x*y)

    Python

        >>> from sage.all import *
        >>> K = FunctionField(GF(Integer(4)), names=('x',)); (x,) = K._first_ngens(1)
        >>> O = K.maximal_order()
        >>> I = O.ideal(x*(x + Integer(1))**Integer(2)/(x**Integer(2) + x + Integer(1)))
        >>> I.divisor()
        Place (x) + 2*Place (x + 1) - Place (x + z2) - Place (x + z2 + 1)

        >>> Oinf = K.maximal_order_infinite()
        >>> I = Oinf.ideal((x + Integer(1))/(x**Integer(3) + Integer(1)))
        >>> I.divisor()
        2*Place (1/x)

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1); _ = PolynomialRing(K, names=('T',)); (T,) = _._first_ngens(1)
        >>> F = K.extension(T**Integer(3) - x**Integer(2)*(x**Integer(2) + x + Integer(1))**Integer(2), names=('y',)); (y,) = F._first_ngens(1)
        >>> O = F.maximal_order()
        >>> I = O.ideal(y)
        >>> I.divisor()
        2*Place (x, (1/(x^3 + x^2 + x))*y^2)
         + 2*Place (x^2 + x + 1, (1/(x^3 + x^2 + x))*y^2)

        >>> Oinf = F.maximal_order_infinite()
        >>> I = Oinf.ideal(y)
        >>> I.divisor()
        -2*Place (1/x, 1/x^4*y^2 + 1/x^2*y + 1)
         - 2*Place (1/x, 1/x^2*y + 1)

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1); _ = K['Y']; (Y,) = _._first_ngens(1)
        >>> L = K.extension(Y**Integer(2) + Y + x + Integer(1)/x, names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.maximal_order()
        >>> I = O.ideal(y)
        >>> I.divisor()
        - Place (x, x*y)
         + 2*Place (x + 1, x*y)

        >>> Oinf = L.maximal_order_infinite()
        >>> I = Oinf.ideal(y)
        >>> I.divisor()
        - Place (1/x, 1/x*y)

  divisor_of_poles()

    Return the divisor of poles corresponding to the ideal.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(GF(4))
        sage: O = K.maximal_order()
        sage: I = O.ideal(x*(x + 1)^2/(x^2 + x + 1))
        sage: I.divisor_of_poles()
        Place (x + z2) + Place (x + z2 + 1)

        sage: K.<x> = FunctionField(GF(2))
        sage: Oinf = K.maximal_order_infinite()
        sage: I = Oinf.ideal((x + 1)/(x^3 + 1))
        sage: I.divisor_of_poles()
        0

        sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
        sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
        sage: O = L.maximal_order()
        sage: I = O.ideal(y)
        sage: I.divisor_of_poles()
        Place (x, x*y)

    Python

        >>> from sage.all import *
        >>> K = FunctionField(GF(Integer(4)), names=('x',)); (x,) = K._first_ngens(1)
        >>> O = K.maximal_order()
        >>> I = O.ideal(x*(x + Integer(1))**Integer(2)/(x**Integer(2) + x + Integer(1)))
        >>> I.divisor_of_poles()
        Place (x + z2) + Place (x + z2 + 1)

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1)
        >>> Oinf = K.maximal_order_infinite()
        >>> I = Oinf.ideal((x + Integer(1))/(x**Integer(3) + Integer(1)))
        >>> I.divisor_of_poles()
        0

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1); _ = K['Y']; (Y,) = _._first_ngens(1)
        >>> L = K.extension(Y**Integer(2) + Y + x + Integer(1)/x, names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.maximal_order()
        >>> I = O.ideal(y)
        >>> I.divisor_of_poles()
        Place (x, x*y)

  divisor_of_zeros()

    Return the divisor of zeros corresponding to the ideal.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(GF(4))
        sage: O = K.maximal_order()
        sage: I = O.ideal(x*(x + 1)^2/(x^2 + x + 1))
        sage: I.divisor_of_zeros()
        Place (x) + 2*Place (x + 1)

        sage: K.<x> = FunctionField(GF(2))
        sage: Oinf = K.maximal_order_infinite()
        sage: I = Oinf.ideal((x + 1)/(x^3 + 1))
        sage: I.divisor_of_zeros()
        2*Place (1/x)

        sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
        sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
        sage: O = L.maximal_order()
        sage: I = O.ideal(y)
        sage: I.divisor_of_zeros()
        2*Place (x + 1, x*y)

    Python

        >>> from sage.all import *
        >>> K = FunctionField(GF(Integer(4)), names=('x',)); (x,) = K._first_ngens(1)
        >>> O = K.maximal_order()
        >>> I = O.ideal(x*(x + Integer(1))**Integer(2)/(x**Integer(2) + x + Integer(1)))
        >>> I.divisor_of_zeros()
        Place (x) + 2*Place (x + 1)

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1)
        >>> Oinf = K.maximal_order_infinite()
        >>> I = Oinf.ideal((x + Integer(1))/(x**Integer(3) + Integer(1)))
        >>> I.divisor_of_zeros()
        2*Place (1/x)

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1); _ = K['Y']; (Y,) = _._first_ngens(1)
        >>> L = K.extension(Y**Integer(2) + Y + x + Integer(1)/x, names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.maximal_order()
        >>> I = O.ideal(y)
        >>> I.divisor_of_zeros()
        2*Place (x + 1, x*y)

  factor()

    Return the factorization of this ideal.

    Subclass of this class should define `_factor()` method that returns a list of prime ideal and multiplicity pairs.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(GF(4))
        sage: O = K.maximal_order()
        sage: I = O.ideal(x^3*(x + 1)^2)
        sage: I.factor()
        (Ideal (x) of Maximal order of Rational function field in x
        over Finite Field in z2 of size 2^2)^3 *
        (Ideal (x + 1) of Maximal order of Rational function field in x
        over Finite Field in z2 of size 2^2)^2

        sage: Oinf = K.maximal_order_infinite()
        sage: I = Oinf.ideal((x + 1)/(x^3 + 1))
        sage: I.factor()
        (Ideal (1/x) of Maximal infinite order of Rational function field in x
        over Finite Field in z2 of size 2^2)^2

        sage: K.<x> = FunctionField(GF(2)); _.<T> = PolynomialRing(K)
        sage: F.<y> = K.extension(T^3 - x^2*(x^2 + x + 1)^2)
        sage: O = F.maximal_order()
        sage: I = O.ideal(y)
        sage: I == I.factor().prod()
        True

        sage: Oinf = F.maximal_order_infinite()
        sage: f= 1/x
        sage: I = Oinf.ideal(f)
        sage: I.factor()
        (Ideal ((1/(x^4 + x^3 + x^2))*y^2 + 1/x^2*y + 1) of Maximal infinite order
        of Function field in y defined by y^3 + x^6 + x^4 + x^2) *
        (Ideal ((1/(x^4 + x^3 + x^2))*y^2 + 1) of Maximal infinite order
        of Function field in y defined by y^3 + x^6 + x^4 + x^2)

        sage: K.<x> = FunctionField(QQ); _.<Y> = K[]
        sage: F.<y> = K.extension(Y^3 - x^2*(x^2 + x + 1)^2)
        sage: O = F.maximal_order()
        sage: I = O.ideal(y)
        sage: I == I.factor().prod()
        True

        sage: K.<x> = FunctionField(QQ); _.<Y> = K[]
        sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
        sage: O = L.maximal_order()
        sage: I = O.ideal(y)
        sage: I == I.factor().prod()
        True

    Python

        >>> from sage.all import *
        >>> K = FunctionField(GF(Integer(4)), names=('x',)); (x,) = K._first_ngens(1)
        >>> O = K.maximal_order()
        >>> I = O.ideal(x**Integer(3)*(x + Integer(1))**Integer(2))
        >>> I.factor()
        (Ideal (x) of Maximal order of Rational function field in x
        over Finite Field in z2 of size 2^2)^3 *
        (Ideal (x + 1) of Maximal order of Rational function field in x
        over Finite Field in z2 of size 2^2)^2

        >>> Oinf = K.maximal_order_infinite()
        >>> I = Oinf.ideal((x + Integer(1))/(x**Integer(3) + Integer(1)))
        >>> I.factor()
        (Ideal (1/x) of Maximal infinite order of Rational function field in x
        over Finite Field in z2 of size 2^2)^2

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1); _ = PolynomialRing(K, names=('T',)); (T,) = _._first_ngens(1)
        >>> F = K.extension(T**Integer(3) - x**Integer(2)*(x**Integer(2) + x + Integer(1))**Integer(2), names=('y',)); (y,) = F._first_ngens(1)
        >>> O = F.maximal_order()
        >>> I = O.ideal(y)
        >>> I == I.factor().prod()
        True

        >>> Oinf = F.maximal_order_infinite()
        >>> f= Integer(1)/x
        >>> I = Oinf.ideal(f)
        >>> I.factor()
        (Ideal ((1/(x^4 + x^3 + x^2))*y^2 + 1/x^2*y + 1) of Maximal infinite order
        of Function field in y defined by y^3 + x^6 + x^4 + x^2) *
        (Ideal ((1/(x^4 + x^3 + x^2))*y^2 + 1) of Maximal infinite order
        of Function field in y defined by y^3 + x^6 + x^4 + x^2)

        >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); _ = K['Y']; (Y,) = _._first_ngens(1)
        >>> F = K.extension(Y**Integer(3) - x**Integer(2)*(x**Integer(2) + x + Integer(1))**Integer(2), names=('y',)); (y,) = F._first_ngens(1)
        >>> O = F.maximal_order()
        >>> I = O.ideal(y)
        >>> I == I.factor().prod()
        True

        >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); _ = K['Y']; (Y,) = _._first_ngens(1)
        >>> L = K.extension(Y**Integer(2) + Y + x + Integer(1)/x, names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.maximal_order()
        >>> I = O.ideal(y)
        >>> I == I.factor().prod()
        True

  gens_reduced()

    Return reduced generators.

    For now, this method just looks at the generators and sees if any can be removed without changing the ideal. It prefers principal representations (a single generator) over all others, and otherwise picks the generator set with the shortest print representation.

    This method is provided so that ideals in function fields have the method `gens_reduced()`, just like ideals of number fields. Sage linear algebra machinery sometimes requires this.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(GF(7))
        sage: O = K.equation_order()
        sage: I = O.ideal(x, x^2, x^2 + x)
        sage: I.gens_reduced()
        (x,)

    Python

        >>> from sage.all import *
        >>> K = FunctionField(GF(Integer(7)), names=('x',)); (x,) = K._first_ngens(1)
        >>> O = K.equation_order()
        >>> I = O.ideal(x, x**Integer(2), x**Integer(2) + x)
        >>> I.gens_reduced()
        (x,)

  place()

    Return the place associated with this prime ideal.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(GF(4))
        sage: O = K.maximal_order()
        sage: I = O.ideal(x^2 + x + 1)
        sage: I.place()
        Traceback (most recent call last):
        ...
        TypeError: not a prime ideal
        sage: I = O.ideal(x^3 + x + 1)
        sage: I.place()
        Place (x^3 + x + 1)

        sage: K.<x> = FunctionField(GF(2))
        sage: Oinf = K.maximal_order_infinite()
        sage: I = Oinf.ideal((x + 1)/(x^3 + 1))
        sage: p = I.factor()[0][0]
        sage: p.place()
        Place (1/x)

        sage: K.<x> = FunctionField(GF(2)); _.<t> = PolynomialRing(K)
        sage: F.<y> = K.extension(t^3 - x^2*(x^2+x+1)^2)
        sage: O = F.maximal_order()
        sage: I = O.ideal(y)
        sage: [f.place() for f,_ in I.factor()]
        [Place (x, (1/(x^3 + x^2 + x))*y^2),
         Place (x^2 + x + 1, (1/(x^3 + x^2 + x))*y^2)]

        sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
        sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
        sage: O = L.maximal_order()
        sage: I = O.ideal(y)
        sage: [f.place() for f,_ in I.factor()]
        [Place (x, x*y), Place (x + 1, x*y)]

        sage: K.<x> = FunctionField(GF(3^2)); R.<t> = PolynomialRing(K)
        sage: F.<y> = K.extension(t^3 + t^2 - x^4)
        sage: Oinf = F.maximal_order_infinite()
        sage: I = Oinf.ideal(1/x)
        sage: I.factor()
        (Ideal (1/x^3*y^2) of Maximal infinite order of Function field
        in y defined by y^3 + y^2 + 2*x^4)^3
        sage: J = I.factor()[0][0]
        sage: J.is_prime()
        True
        sage: J.place()
        Place (1/x, 1/x^3*y^2)

        sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
        sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
        sage: Oinf = L.maximal_order_infinite()
        sage: I = Oinf.ideal(1/x)
        sage: I.factor()
        (Ideal (1/x*y) of Maximal infinite order of Function field in y
        defined by y^2 + y + (x^2 + 1)/x)^2
        sage: J = I.factor()[0][0]
        sage: J.is_prime()
        True
        sage: J.place()
        Place (1/x, 1/x*y)

    Python

        >>> from sage.all import *
        >>> K = FunctionField(GF(Integer(4)), names=('x',)); (x,) = K._first_ngens(1)
        >>> O = K.maximal_order()
        >>> I = O.ideal(x**Integer(2) + x + Integer(1))
        >>> I.place()
        Traceback (most recent call last):
        ...
        TypeError: not a prime ideal
        >>> I = O.ideal(x**Integer(3) + x + Integer(1))
        >>> I.place()
        Place (x^3 + x + 1)

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1)
        >>> Oinf = K.maximal_order_infinite()
        >>> I = Oinf.ideal((x + Integer(1))/(x**Integer(3) + Integer(1)))
        >>> p = I.factor()[Integer(0)][Integer(0)]
        >>> p.place()
        Place (1/x)

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1); _ = PolynomialRing(K, names=('t',)); (t,) = _._first_ngens(1)
        >>> F = K.extension(t**Integer(3) - x**Integer(2)*(x**Integer(2)+x+Integer(1))**Integer(2), names=('y',)); (y,) = F._first_ngens(1)
        >>> O = F.maximal_order()
        >>> I = O.ideal(y)
        >>> [f.place() for f,_ in I.factor()]
        [Place (x, (1/(x^3 + x^2 + x))*y^2),
         Place (x^2 + x + 1, (1/(x^3 + x^2 + x))*y^2)]

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1); _ = K['Y']; (Y,) = _._first_ngens(1)
        >>> L = K.extension(Y**Integer(2) + Y + x + Integer(1)/x, names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.maximal_order()
        >>> I = O.ideal(y)
        >>> [f.place() for f,_ in I.factor()]
        [Place (x, x*y), Place (x + 1, x*y)]

        >>> K = FunctionField(GF(Integer(3)**Integer(2)), names=('x',)); (x,) = K._first_ngens(1); R = PolynomialRing(K, names=('t',)); (t,) = R._first_ngens(1)
        >>> F = K.extension(t**Integer(3) + t**Integer(2) - x**Integer(4), names=('y',)); (y,) = F._first_ngens(1)
        >>> Oinf = F.maximal_order_infinite()
        >>> I = Oinf.ideal(Integer(1)/x)
        >>> I.factor()
        (Ideal (1/x^3*y^2) of Maximal infinite order of Function field
        in y defined by y^3 + y^2 + 2*x^4)^3
        >>> J = I.factor()[Integer(0)][Integer(0)]
        >>> J.is_prime()
        True
        >>> J.place()
        Place (1/x, 1/x^3*y^2)

        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1); _ = K['Y']; (Y,) = _._first_ngens(1)
        >>> L = K.extension(Y**Integer(2) + Y + x + Integer(1)/x, names=('y',)); (y,) = L._first_ngens(1)
        >>> Oinf = L.maximal_order_infinite()
        >>> I = Oinf.ideal(Integer(1)/x)
        >>> I.factor()
        (Ideal (1/x*y) of Maximal infinite order of Function field in y
        defined by y^2 + y + (x^2 + 1)/x)^2
        >>> J = I.factor()[Integer(0)][Integer(0)]
        >>> J.is_prime()
        True
        >>> J.place()
        Place (1/x, 1/x*y)

  ring()

    Return the ring to which this ideal belongs.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(GF(7))
        sage: O = K.equation_order()
        sage: I = O.ideal(x, x^2, x^2 + x)
        sage: I.ring()
        Maximal order of Rational function field in x over Finite Field of size 7

    Python

        >>> from sage.all import *
        >>> K = FunctionField(GF(Integer(7)), names=('x',)); (x,) = K._first_ngens(1)
        >>> O = K.equation_order()
        >>> I = O.ideal(x, x**Integer(2), x**Integer(2) + x)
        >>> I.ring()
        Maximal order of Rational function field in x over Finite Field of size 7

class sage.rings.function_field.ideal.FunctionFieldIdealInfinite(ring)

  Bases: `FunctionFieldIdeal`

  Base class of ideals of maximal infinite orders

class sage.rings.function_field.ideal.FunctionFieldIdealInfinite_module(ring, module)

  Bases: `FunctionFieldIdealInfinite`, `Ideal_generic`

  A fractional ideal specified by a finitely generated module over the integers of the base field.

  INPUT:

  - `ring` – order in a function field

  - `module` – module

  EXAMPLES:

  Sage

      sage: K.<x> = FunctionField(QQ); R.<y> = K[]
      sage: L.<y> = K.extension(y^2 - x^3 - 1)
      sage: O = L.equation_order()
      sage: O.ideal(y)
      Ideal (x^3 + 1, -y) of Order in Function field in y defined by y^2 - x^3 - 1

  Python

      >>> from sage.all import *
      >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); R = K['y']; (y,) = R._first_ngens(1)
      >>> L = K.extension(y**Integer(2) - x**Integer(3) - Integer(1), names=('y',)); (y,) = L._first_ngens(1)
      >>> O = L.equation_order()
      >>> O.ideal(y)
      Ideal (x^3 + 1, -y) of Order in Function field in y defined by y^2 - x^3 - 1

  module()

    Return the module over the maximal order of the base field that underlies this ideal.

    The formation of the module is compatible with the vector space corresponding to the function field.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(GF(7))
        sage: O = K.maximal_order(); O
        Maximal order of Rational function field in x over Finite Field of size 7
        sage: K.polynomial_ring()
        Univariate Polynomial Ring in x over
         Rational function field in x over Finite Field of size 7
        sage: I = O.ideal([x^2 + 1, x*(x^2+1)])
        sage: I.gens()
        (x^2 + 1,)
        sage: I.module()                                                            # needs sage.modules
        Free module of degree 1 and rank 1 over
         Maximal order of Rational function field in x over Finite Field of size 7
        Echelon basis matrix:
        [x^2 + 1]
        sage: V, from_V, to_V = K.vector_space(); V                                 # needs sage.modules
        Vector space of dimension 1 over
         Rational function field in x over Finite Field of size 7
        sage: I.module().is_submodule(V)                                            # needs sage.modules
        True

    Python

        >>> from sage.all import *
        >>> K = FunctionField(GF(Integer(7)), names=('x',)); (x,) = K._first_ngens(1)
        >>> O = K.maximal_order(); O
        Maximal order of Rational function field in x over Finite Field of size 7
        >>> K.polynomial_ring()
        Univariate Polynomial Ring in x over
         Rational function field in x over Finite Field of size 7
        >>> I = O.ideal([x**Integer(2) + Integer(1), x*(x**Integer(2)+Integer(1))])
        >>> I.gens()
        (x^2 + 1,)
        >>> I.module()                                                            # needs sage.modules
        Free module of degree 1 and rank 1 over
         Maximal order of Rational function field in x over Finite Field of size 7
        Echelon basis matrix:
        [x^2 + 1]
        >>> V, from_V, to_V = K.vector_space(); V                                 # needs sage.modules
        Vector space of dimension 1 over
         Rational function field in x over Finite Field of size 7
        >>> I.module().is_submodule(V)                                            # needs sage.modules
        True

class sage.rings.function_field.ideal.FunctionFieldIdeal_module(ring, module)

  Bases: `FunctionFieldIdeal`, `Ideal_generic`

  A fractional ideal specified by a finitely generated module over the integers of the base field.

  INPUT:

  - `ring` – an order in a function field

  - `module` – a module of the order

  EXAMPLES:

  An ideal in an extension of a rational function field:

  Sage

      sage: K.<x> = FunctionField(QQ); R.<y> = K[]
      sage: L.<y> = K.extension(y^2 - x^3 - 1)
      sage: O = L.equation_order()
      sage: I = O.ideal(y)
      sage: I
      Ideal (x^3 + 1, -y) of Order in Function field in y defined by y^2 - x^3 - 1
      sage: I^2
      Ideal (x^3 + 1, (-x^3 - 1)*y) of Order in Function field in y defined by y^2 - x^3 - 1

  Python

      >>> from sage.all import *
      >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); R = K['y']; (y,) = R._first_ngens(1)
      >>> L = K.extension(y**Integer(2) - x**Integer(3) - Integer(1), names=('y',)); (y,) = L._first_ngens(1)
      >>> O = L.equation_order()
      >>> I = O.ideal(y)
      >>> I
      Ideal (x^3 + 1, -y) of Order in Function field in y defined by y^2 - x^3 - 1
      >>> I**Integer(2)
      Ideal (x^3 + 1, (-x^3 - 1)*y) of Order in Function field in y defined by y^2 - x^3 - 1

  gen(i)

    Return the `i`-th generator in the current basis of this ideal.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(QQ); R.<y> = K[]
        sage: L.<y> = K.extension(y^2 - x^3 - 1)
        sage: O = L.equation_order()
        sage: I = O.ideal(x^2 + 1)
        sage: I.gen(1)
        (x^2 + 1)*y

    Python

        >>> from sage.all import *
        >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); R = K['y']; (y,) = R._first_ngens(1)
        >>> L = K.extension(y**Integer(2) - x**Integer(3) - Integer(1), names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.equation_order()
        >>> I = O.ideal(x**Integer(2) + Integer(1))
        >>> I.gen(Integer(1))
        (x^2 + 1)*y

  gens()

    Return a set of generators of this ideal.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(QQ); R.<y> = K[]
        sage: L.<y> = K.extension(y^2 - x^3 - 1)
        sage: O = L.equation_order()
        sage: I = O.ideal(x^2 + 1)
        sage: I.gens()
        (x^2 + 1, (x^2 + 1)*y)

    Python

        >>> from sage.all import *
        >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); R = K['y']; (y,) = R._first_ngens(1)
        >>> L = K.extension(y**Integer(2) - x**Integer(3) - Integer(1), names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.equation_order()
        >>> I = O.ideal(x**Integer(2) + Integer(1))
        >>> I.gens()
        (x^2 + 1, (x^2 + 1)*y)

  intersection(other)

    Return the intersection of this ideal and `other`.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(QQ); R.<y> = K[]
        sage: L.<y> = K.extension(y^2 - x^3 - 1)
        sage: O = L.equation_order()
        sage: I = O.ideal(y^3); J = O.ideal(y^2)
        sage: Z = I.intersection(J); Z
        Ideal (x^6 + 2*x^3 + 1, (-x^3 - 1)*y) of Order in Function field in y defined by y^2 - x^3 - 1
        sage: y^2 in Z
        False
        sage: y^3 in Z
        True

    Python

        >>> from sage.all import *
        >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); R = K['y']; (y,) = R._first_ngens(1)
        >>> L = K.extension(y**Integer(2) - x**Integer(3) - Integer(1), names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.equation_order()
        >>> I = O.ideal(y**Integer(3)); J = O.ideal(y**Integer(2))
        >>> Z = I.intersection(J); Z
        Ideal (x^6 + 2*x^3 + 1, (-x^3 - 1)*y) of Order in Function field in y defined by y^2 - x^3 - 1
        >>> y**Integer(2) in Z
        False
        >>> y**Integer(3) in Z
        True

  module()

    Return the module over the maximal order of the base field that underlies this ideal.

    The formation of the module is compatible with the vector space corresponding to the function field.

    OUTPUT: a module over the maximal order of the base field of the ideal

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(QQ); R.<y> = K[]
        sage: L.<y> = K.extension(y^2 - x^3 - 1)
        sage: O = L.equation_order();  O
        Order in Function field in y defined by y^2 - x^3 - 1
        sage: I = O.ideal(x^2 + 1)
        sage: I.gens()
        (x^2 + 1, (x^2 + 1)*y)
        sage: I.module()
        Free module of degree 2 and rank 2 over Maximal order of Rational function field in x over Rational Field
        Echelon basis matrix:
        [x^2 + 1       0]
        [      0 x^2 + 1]
        sage: V, from_V, to_V = L.vector_space(); V
        Vector space of dimension 2 over Rational function field in x over Rational Field
        sage: I.module().is_submodule(V)
        True

    Python

        >>> from sage.all import *
        >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); R = K['y']; (y,) = R._first_ngens(1)
        >>> L = K.extension(y**Integer(2) - x**Integer(3) - Integer(1), names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.equation_order();  O
        Order in Function field in y defined by y^2 - x^3 - 1
        >>> I = O.ideal(x**Integer(2) + Integer(1))
        >>> I.gens()
        (x^2 + 1, (x^2 + 1)*y)
        >>> I.module()
        Free module of degree 2 and rank 2 over Maximal order of Rational function field in x over Rational Field
        Echelon basis matrix:
        [x^2 + 1       0]
        [      0 x^2 + 1]
        >>> V, from_V, to_V = L.vector_space(); V
        Vector space of dimension 2 over Rational function field in x over Rational Field
        >>> I.module().is_submodule(V)
        True

  ngens()

    Return the number of generators in the basis.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(QQ); R.<y> = K[]
        sage: L.<y> = K.extension(y^2 - x^3 - 1)
        sage: O = L.equation_order()
        sage: I = O.ideal(x^2 + 1)
        sage: I.ngens()
        2

    Python

        >>> from sage.all import *
        >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1); R = K['y']; (y,) = R._first_ngens(1)
        >>> L = K.extension(y**Integer(2) - x**Integer(3) - Integer(1), names=('y',)); (y,) = L._first_ngens(1)
        >>> O = L.equation_order()
        >>> I = O.ideal(x**Integer(2) + Integer(1))
        >>> I.ngens()
        2

class sage.rings.function_field.ideal.IdealMonoid(R)

  Bases: `UniqueRepresentation`, `Parent`

  The monoid of ideals in orders of function fields.

  INPUT:

  - `R` – order

  EXAMPLES:

  Sage

      sage: K.<x> = FunctionField(GF(2))
      sage: O = K.maximal_order()
      sage: M = O.ideal_monoid(); M
      Monoid of ideals of Maximal order of Rational function field in x over Finite Field of size 2

  Python

      >>> from sage.all import *
      >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1)
      >>> O = K.maximal_order()
      >>> M = O.ideal_monoid(); M
      Monoid of ideals of Maximal order of Rational function field in x over Finite Field of size 2

  ring()

    Return the ring of which this is the ideal monoid.

    EXAMPLES:

    Sage

        sage: K.<x> = FunctionField(GF(2))
        sage: O = K.maximal_order()
        sage: M = O.ideal_monoid(); M.ring() is O
        True

    Python

        >>> from sage.all import *
        >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1)
        >>> O = K.maximal_order()
        >>> M = O.ideal_monoid(); M.ring() is O
        True