Function Fields#

A function field (of one variable) is a finitely generated field extension of transcendence degree one. In Sage, a function field can be a rational function field or a finite extension of a function field.

EXAMPLES:

We create a rational function field:

sage: # needs sage.rings.finite_rings
sage: K.<x> = FunctionField(GF(5^2,'a')); K
Rational function field in x over Finite Field in a of size 5^2
sage: K.genus()
0
sage: f = (x^2 + x + 1) / (x^3 + 1)
sage: f
(x^2 + x + 1)/(x^3 + 1)
sage: f^3
(x^6 + 3*x^5 + x^4 + 2*x^3 + x^2 + 3*x + 1)/(x^9 + 3*x^6 + 3*x^3 + 1)

Then we create an extension of the rational function field, and do some simple arithmetic in it:

sage: # needs sage.rings.finite_rings sage.rings.function_field
sage: R.<y> = K[]
sage: L.<y> = K.extension(y^3 - (x^3 + 2*x*y + 1/x)); L
Function field in y defined by y^3 + 3*x*y + (4*x^4 + 4)/x
sage: y^2
y^2
sage: y^3
2*x*y + (x^4 + 1)/x
sage: a = 1/y; a
(x/(x^4 + 1))*y^2 + 3*x^2/(x^4 + 1)
sage: a * y
1

We next make an extension of the above function field, illustrating that arithmetic with a tower of three fields is fully supported:

sage: # needs sage.rings.finite_rings sage.rings.function_field
sage: S.<t> = L[]
sage: M.<t> = L.extension(t^2 - x*y)
sage: M
Function field in t defined by t^2 + 4*x*y
sage: t^2
x*y
sage: 1/t
((1/(x^4 + 1))*y^2 + 3*x/(x^4 + 1))*t
sage: M.base_field()
Function field in y defined by y^3 + 3*x*y + (4*x^4 + 4)/x
sage: M.base_field().base_field()
Rational function field in x over Finite Field in a of size 5^2

It is also possible to construct function fields over an imperfect base field:

sage: N.<u> = FunctionField(K)                                                      # needs sage.rings.finite_rings

and inseparable extension function fields:

sage: J.<x> = FunctionField(GF(5)); J
Rational function field in x over Finite Field of size 5
sage: T.<v> = J[]
sage: O.<v> = J.extension(v^5 - x); O                                               # needs sage.rings.function_field
Function field in v defined by v^5 + 4*x

Function fields over the rational field are supported:

sage: # needs sage.rings.function_field
sage: F.<x> = FunctionField(QQ)
sage: R.<Y> = F[]
sage: L.<y> = F.extension(Y^2 - x^8 - 1)
sage: O = L.maximal_order()
sage: I = O.ideal(x, y - 1)
sage: P = I.place()
sage: D = P.divisor()
sage: D.basis_function_space()
[1]
sage: (2*D).basis_function_space()
[1]
sage: (3*D).basis_function_space()
[1]
sage: (4*D).basis_function_space()
[1, 1/x^4*y + 1/x^4]

sage: # needs sage.rings.function_field
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.divisor()
2*Place (x, y, (1/(x^3 + x^2 + x))*y^2)
 + 2*Place (x^2 + x + 1, y, (1/(x^3 + x^2 + x))*y^2)

sage: # needs sage.rings.function_field
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.divisor()
- Place (x, x*y)
 + Place (x^2 + 1, x*y)

Function fields over the algebraic field are supported:

sage: # needs sage.rings.function_field sage.rings.number_field
sage: K.<x> = FunctionField(QQbar); _.<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 - I, x*y)
 - Place (x, x*y)
 + Place (x + I, x*y)
sage: pl = I.divisor().support()[0]
sage: m = L.completion(pl, prec=5)
sage: m(x)
I + s + O(s^5)
sage: m(y)                                  # long time (4s)
-2*s + (-4 - I)*s^2 + (-15 - 4*I)*s^3 + (-75 - 23*I)*s^4 + (-413 - 154*I)*s^5 + O(s^6)
sage: m(y)^2 + m(y) + m(x) + 1/m(x)         # long time (8s)
O(s^5)

Global function fields#

A global function field in Sage is an extension field of a rational function field over a finite constant field by an irreducible separable polynomial over the rational function field.

EXAMPLES:

A fundamental computation for a global or any function field is to get a basis of its maximal order and maximal infinite order, and then do arithmetic with ideals of those maximal orders:

sage: # needs sage.rings.function_field
sage: K.<x> = FunctionField(GF(3)); _.<t> = K[]
sage: L.<y> = K.extension(t^4 + t - x^5)
sage: O = L.maximal_order()
sage: O.basis()
(1, y, 1/x*y^2 + 1/x*y, 1/x^3*y^3 + 2/x^3*y^2 + 1/x^3*y)
sage: I = O.ideal(x,y); I
Ideal (x, y) of Maximal order of Function field in y defined by y^4 + y + 2*x^5
sage: J = I^-1
sage: J.basis_matrix()
[  1   0   0   0]
[1/x 1/x   0   0]
[  0   0   1   0]
[  0   0   0   1]
sage: L.maximal_order_infinite().basis()
(1, 1/x^2*y, 1/x^3*y^2, 1/x^4*y^3)

As an example of the most sophisticated computations that Sage can do with a global function field, we compute all the Weierstrass places of the Klein quartic over \(\GF{2}\) and gap numbers for ordinary places:

sage: # needs sage.rings.function_field
sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^3 + x^3*Y + x)
sage: L.genus()
3
sage: L.weierstrass_places()                                                        # needs sage.modules
[Place (1/x, 1/x^3*y^2 + 1/x),
 Place (1/x, 1/x^3*y^2 + 1/x^2*y + 1),
 Place (x, y),
 Place (x + 1, (x^3 + 1)*y + x + 1),
 Place (x^3 + x + 1, y + 1),
 Place (x^3 + x + 1, y + x^2),
 Place (x^3 + x + 1, y + x^2 + 1),
 Place (x^3 + x^2 + 1, y + x),
 Place (x^3 + x^2 + 1, y + x^2 + 1),
 Place (x^3 + x^2 + 1, y + x^2 + x + 1)]
sage: L.gaps()                                                                      # needs sage.modules
[1, 2, 3]

The gap numbers for Weierstrass places are of course not ordinary:

sage: # needs sage.modules sage.rings.function_field
sage: p1,p2,p3 = L.weierstrass_places()[:3]
sage: p1.gaps()
[1, 2, 4]
sage: p2.gaps()
[1, 2, 4]
sage: p3.gaps()
[1, 2, 4]

AUTHORS:

  • William Stein (2010): initial version

  • Robert Bradshaw (2010-05-30): added is_finite()

  • Julian Rüth (2011-06-08, 2011-09-14, 2014-06-23, 2014-06-24, 2016-11-13): fixed hom(), extension(); use @cached_method; added derivation(); added support for relative vector spaces; fixed conversion to base fields

  • Maarten Derickx (2011-09-11): added doctests

  • Syed Ahmad Lavasani (2011-12-16): added genus(), is_RationalFunctionField()

  • Simon King (2014-10-29): Use the same generator names for a function field extension and the underlying polynomial ring.

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

  • Brent Baccala (2019-12-20): added function fields over number fields and QQbar

class sage.rings.function_field.function_field.FunctionField(base_field, names, category=Category of function fields)#

Bases: Field

Abstract base class for all function fields.

INPUT:

  • base_field – field; the base of this function field

  • names – string that gives the name of the generator

EXAMPLES:

sage: K.<x> = FunctionField(QQ)
sage: K
Rational function field in x over Rational Field
basis_of_differentials_of_first_kind()#

Return a basis of the space of holomorphic differentials of this function field.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: K.basis_of_holomorphic_differentials()                                # needs sage.libs.pari sage.modules
[]

sage: K.<x> = FunctionField(GF(5)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^3 - (x^3 - 1)/(x^3 - 2))                        # needs sage.rings.function_field
sage: L.basis_of_holomorphic_differentials()                                # needs sage.modules sage.rings.function_field
[((x/(x^3 + 4))*y) d(x),
 ((1/(x^3 + 4))*y) d(x),
 ((x/(x^3 + 4))*y^2) d(x),
 ((1/(x^3 + 4))*y^2) d(x)]
basis_of_holomorphic_differentials()#

Return a basis of the space of holomorphic differentials of this function field.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: K.basis_of_holomorphic_differentials()                                # needs sage.libs.pari sage.modules
[]

sage: K.<x> = FunctionField(GF(5)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^3 - (x^3 - 1)/(x^3 - 2))                        # needs sage.rings.function_field
sage: L.basis_of_holomorphic_differentials()                                # needs sage.modules sage.rings.function_field
[((x/(x^3 + 4))*y) d(x),
 ((1/(x^3 + 4))*y) d(x),
 ((x/(x^3 + 4))*y^2) d(x),
 ((1/(x^3 + 4))*y^2) d(x)]
characteristic()#

Return the characteristic of the function field.

EXAMPLES:

sage: K.<x> = FunctionField(QQ)
sage: K.characteristic()
0
sage: K.<x> = FunctionField(QQbar)                                          # needs sage.rings.number_field
sage: K.characteristic()
0
sage: K.<x> = FunctionField(GF(7))
sage: K.characteristic()
7
sage: R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x)                                          # needs sage.rings.function_field
sage: L.characteristic()                                                    # needs sage.rings.function_field
7
completion(place, name=None, prec=None, gen_name=None)#

Return the completion of the function field at the place.

INPUT:

  • place – place

  • name – string; name of the series variable

  • prec – positive integer; default precision

  • gen_name – string; name of the generator of the residue field; used only when the place is non-rational

EXAMPLES:

sage: # needs sage.rings.function_field
sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
sage: p = L.places_finite()[0]
sage: m = L.completion(p); m
Completion map:
  From: Function field in y defined by y^2 + y + (x^2 + 1)/x
  To:   Laurent Series Ring in s over Finite Field of size 2
sage: m(x, 10)
s^2 + s^3 + s^4 + s^5 + s^7 + s^8 + s^9 + s^10 + O(s^12)
sage: m(y, 10)
s^-1 + 1 + s^3 + s^5 + s^7 + O(s^9)

sage: # needs sage.rings.function_field
sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
sage: p = L.places_finite()[0]
sage: m = L.completion(p); m
Completion map:
  From: Function field in y defined by y^2 + y + (x^2 + 1)/x
  To:   Laurent Series Ring in s over Finite Field of size 2
sage: m(x, 10)
s^2 + s^3 + s^4 + s^5 + s^7 + s^8 + s^9 + s^10 + O(s^12)
sage: m(y, 10)
s^-1 + 1 + s^3 + s^5 + s^7 + O(s^9)

sage: K.<x> = FunctionField(GF(2))
sage: p = K.places_finite()[0]; p                                           # needs sage.libs.pari
Place (x)
sage: m = K.completion(p); m                                                # needs sage.rings.function_field
Completion map:
  From: Rational function field in x over Finite Field of size 2
  To:   Laurent Series Ring in s over Finite Field of size 2
sage: m(1/(x+1))                                                            # needs sage.rings.function_field
1 + s + s^2 + s^3 + s^4 + s^5 + s^6 + s^7 + s^8 + s^9 + s^10 + s^11 + s^12
+ s^13 + s^14 + s^15 + s^16 + s^17 + s^18 + s^19 + O(s^20)

sage: p = K.place_infinite(); p
Place (1/x)
sage: m = K.completion(p); m                                                # needs sage.rings.function_field
Completion map:
  From: Rational function field in x over Finite Field of size 2
  To:   Laurent Series Ring in s over Finite Field of size 2
sage: m(x)                                                                  # needs sage.rings.function_field
s^-1 + O(s^19)

sage: m = K.completion(p, prec=infinity); m                                 # needs sage.rings.function_field
Completion map:
  From: Rational function field in x over Finite Field of size 2
  To:   Lazy Laurent Series Ring in s over Finite Field of size 2
sage: f = m(x); f                                                           # needs sage.rings.function_field
s^-1 + ...
sage: f.coefficient(100)                                                    # needs sage.rings.function_field
0

sage: # needs sage.rings.function_field
sage: K.<x> = FunctionField(QQ); _.<Y> = K[]
sage: L.<y> = K.extension(Y^2 - x)
sage: O = L.maximal_order()
sage: decomp = O.decomposition(K.maximal_order().ideal(x - 1))
sage: pls = (decomp[0][0].place(), decomp[1][0].place())
sage: m = L.completion(pls[0]); m
Completion map:
  From: Function field in y defined by y^2 - x
  To:   Laurent Series Ring in s over Rational Field
sage: xe = m(x)
sage: ye = m(y)
sage: ye^2 - xe == 0
True

sage: # needs sage.rings.function_field
sage: decomp2 = O.decomposition(K.maximal_order().ideal(x^2 + 1))
sage: pls2 = decomp2[0][0].place()
sage: m = L.completion(pls2); m
Completion map:
  From: Function field in y defined by y^2 - x
  To:   Laurent Series Ring in s over
         Number Field in a with defining polynomial x^4 + 2*x^2 + 4*x + 2
sage: xe = m(x)
sage: ye = m(y)
sage: ye^2 - xe == 0
True
divisor_group()#

Return the group of divisors attached to the function field.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: K.divisor_group()                                                     # needs sage.modules
Divisor group of Rational function field in t over Rational Field

sage: _.<Y> = K[]
sage: L.<y> = K.extension(Y^3 - (t^3 - 1)/(t^3 - 2))                        # needs sage.rings.function_field
sage: L.divisor_group()                                                     # needs sage.modules sage.rings.function_field
Divisor group of Function field in y defined by y^3 + (-t^3 + 1)/(t^3 - 2)

sage: K.<x> = FunctionField(GF(5)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^3 - (x^3 - 1)/(x^3 - 2))                        # needs sage.rings.function_field
sage: L.divisor_group()                                                     # needs sage.modules sage.rings.function_field
Divisor group of Function field in y defined by y^3 + (4*x^3 + 1)/(x^3 + 3)
extension(f, names=None)#

Create an extension \(K(y)\) of this function field \(K\) extended with a root \(y\) of the univariate polynomial \(f\) over \(K\).

INPUT:

  • f – univariate polynomial over \(K\)

  • names – string or tuple of length 1 that names the variable \(y\)

OUTPUT:

  • a function field

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: K.extension(y^5 - x^3 - 3*x + x*y)                                    # needs sage.rings.function_field
Function field in y defined by y^5 + x*y - x^3 - 3*x

A nonintegral defining polynomial:

sage: K.<t> = FunctionField(QQ); R.<y> = K[]
sage: K.extension(y^3 + (1/t)*y + t^3/(t+1), 'z')                           # needs sage.rings.function_field
Function field in z defined by z^3 + 1/t*z + t^3/(t + 1)

The defining polynomial need not be monic or integral:

sage: K.extension(t*y^3 + (1/t)*y + t^3/(t+1))                              # needs sage.rings.function_field
Function field in y defined by t*y^3 + 1/t*y + t^3/(t + 1)
extension_constant_field(k)#

Return the constant field extension with constant field \(k\).

INPUT:

  • k – an extension field of the constant field of this function field

EXAMPLES:

sage: # needs sage.rings.function_field
sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
sage: F.<y> = K.extension(Y^2 + Y + x + 1/x)
sage: E = F.extension_constant_field(GF(2^4))
sage: E
Function field in y defined by y^2 + y + (x^2 + 1)/x over its base
sage: E.constant_base_field()
Finite Field in z4 of size 2^4
is_finite()#

Return whether the function field is finite, which is false.

EXAMPLES:

sage: R.<t> = FunctionField(QQ)
sage: R.is_finite()
False
sage: R.<t> = FunctionField(GF(7))
sage: R.is_finite()
False
is_global()#

Return whether the function field is global, that is, whether the constant field is finite.

EXAMPLES:

sage: R.<t> = FunctionField(QQ)
sage: R.is_global()
False
sage: R.<t> = FunctionField(QQbar)                                          # needs sage.rings.number_field
sage: R.is_global()
False
sage: R.<t> = FunctionField(GF(7))
sage: R.is_global()
True
is_perfect()#

Return whether the field is perfect, i.e., its characteristic \(p\) is zero or every element has a \(p\)-th root.

EXAMPLES:

sage: FunctionField(QQ, 'x').is_perfect()
True
sage: FunctionField(GF(2), 'x').is_perfect()
False
order(x, check=True)#

Return the order generated by x over the base maximal order.

INPUT:

  • x – element or list of elements of the function field

  • check – boolean; if True, check that x really generates an order

EXAMPLES:

sage: # needs sage.rings.function_field
sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^3 + x^3 + 4*x + 1)
sage: O = L.order(y); O                                                     # needs sage.modules
Order in Function field in y defined by y^3 + x^3 + 4*x + 1
sage: O.basis()                                                             # needs sage.modules
(1, y, y^2)

sage: Z = K.order(x); Z                                                     # needs sage.modules sage.rings.function_field
Order in Rational function field in x over Rational Field
sage: Z.basis()                                                             # needs sage.modules sage.rings.function_field
(1,)

Orders with multiple generators are not yet supported:

sage: Z = K.order([x, x^2]); Z                                              # needs sage.rings.function_field
Traceback (most recent call last):
...
NotImplementedError
order_infinite(x, check=True)#

Return the order generated by x over the maximal infinite order.

INPUT:

  • x – element or a list of elements of the function field

  • check – boolean; if True, check that x really generates an order

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^3 + x^3 + 4*x + 1)                              # needs sage.rings.function_field
sage: L.order_infinite(y)           # not implemented                       # needs sage.modules sage.rings.function_field

sage: Z = K.order(x); Z                                                     # needs sage.modules
Order in Rational function field in x over Rational Field
sage: Z.basis()                                                             # needs sage.modules
(1,)

Orders with multiple generators, not yet supported:

sage: Z = K.order_infinite([x, x^2]); Z
Traceback (most recent call last):
...
NotImplementedError
order_infinite_with_basis(basis, check=True)#

Return the order with given basis over the maximal infinite order of the base field.

INPUT:

  • basis – list of elements of the function field

  • check – boolean (default: True); if True, check that the basis is really linearly independent and that the module it spans is closed under multiplication, and contains the identity element.

EXAMPLES:

sage: # needs sage.rings.function_field
sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^3 + x^3 + 4*x + 1)
sage: O = L.order_infinite_with_basis([1, 1/x*y, 1/x^2*y^2]); O
Infinite order in Function field in y defined by y^3 + x^3 + 4*x + 1
sage: O.basis()
(1, 1/x*y, 1/x^2*y^2)

Note that 1 does not need to be an element of the basis, as long it is in the module spanned by it:

sage: O = L.order_infinite_with_basis([1+1/x*y,1/x*y, 1/x^2*y^2]); O        # needs sage.rings.function_field
Infinite order in Function field in y defined by y^3 + x^3 + 4*x + 1
sage: O.basis()                                                             # needs sage.rings.function_field
(1/x*y + 1, 1/x*y, 1/x^2*y^2)

The following error is raised when the module spanned by the basis is not closed under multiplication:

sage: O = L.order_infinite_with_basis([1,y, 1/x^2*y^2]); O                  # needs sage.rings.function_field
Traceback (most recent call last):
...
ValueError: the module generated by basis (1, y, 1/x^2*y^2) must be closed under multiplication

and this happens when the identity is not in the module spanned by the basis:

sage: O = L.order_infinite_with_basis([1/x,1/x*y, 1/x^2*y^2])               # needs sage.rings.function_field
Traceback (most recent call last):
...
ValueError: the identity element must be in the module spanned by basis (1/x, 1/x*y, 1/x^2*y^2)
order_with_basis(basis, check=True)#

Return the order with given basis over the maximal order of the base field.

INPUT:

  • basis – list of elements of this function field

  • check – boolean (default: True); if True, check that the basis is really linearly independent and that the module it spans is closed under multiplication, and contains the identity element.

OUTPUT:

  • an order in the function field

EXAMPLES:

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

Note that 1 does not need to be an element of the basis, as long it is in the module spanned by it:

sage: O = L.order_with_basis([1+y, y, y^2]); O                              # needs sage.rings.function_field
Order in Function field in y defined by y^3 + x^3 + 4*x + 1
sage: O.basis()                                                             # needs sage.rings.function_field
(y + 1, y, y^2)

The following error is raised when the module spanned by the basis is not closed under multiplication:

sage: O = L.order_with_basis([1, x^2 + x*y, (2/3)*y^2]); O                  # needs sage.rings.function_field
Traceback (most recent call last):
...
ValueError: the module generated by basis (1, x*y + x^2, 2/3*y^2) must be closed under multiplication

and this happens when the identity is not in the module spanned by the basis:

sage: O = L.order_with_basis([x, x^2 + x*y, (2/3)*y^2])                     # needs sage.rings.function_field
Traceback (most recent call last):
...
ValueError: the identity element must be in the module spanned by basis (x, x*y + x^2, 2/3*y^2)
place_set()#

Return the set of all places of the function field.

EXAMPLES:

sage: K.<t> = FunctionField(GF(7))
sage: K.place_set()
Set of places of Rational function field in t over Finite Field of size 7

sage: K.<t> = FunctionField(QQ)
sage: K.place_set()
Set of places of Rational function field in t over Rational Field

sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)                                # needs sage.rings.function_field
sage: L.place_set()                                                         # needs sage.rings.function_field
Set of places of Function field in y defined by y^2 + y + (x^2 + 1)/x
rational_function_field()#

Return the rational function field from which this field has been created as an extension.

EXAMPLES:

sage: K.<x> = FunctionField(QQ)
sage: K.rational_function_field()
Rational function field in x over Rational Field

sage: R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x)                                          # needs sage.rings.function_field
sage: L.rational_function_field()                                           # needs sage.rings.function_field
Rational function field in x over Rational Field

sage: R.<z> = L[]                                                           # needs sage.rings.function_field
sage: M.<z> = L.extension(z^2 - y)                                          # needs sage.rings.function_field
sage: M.rational_function_field()                                           # needs sage.rings.function_field
Rational function field in x over Rational Field
some_elements()#

Return some elements in this function field.

EXAMPLES:

sage: K.<x> = FunctionField(QQ)
sage: K.some_elements()
[1,
 x,
 2*x,
 x/(x^2 + 2*x + 1),
 1/x^2,
 x/(x^2 - 1),
 x/(x^2 + 1),
 1/2*x/(x^2 + 1),
 0,
 1/x,
 ...]
sage: R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x)                                           # needs sage.rings.function_field
sage: L.some_elements()                                                      # needs sage.rings.function_field
[1,
 y,
 1/x*y,
 ((x + 1)/(x^2 - 2*x + 1))*y - 2*x/(x^2 - 2*x + 1),
 1/x,
 (1/(x - 1))*y,
 (1/(x + 1))*y,
 (1/2/(x + 1))*y,
 0,
 ...]
space_of_differentials()#

Return the space of differentials attached to the function field.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: K.space_of_differentials()                                            # needs sage.modules
Space of differentials of Rational function field in t over Rational Field

sage: K.<x> = FunctionField(GF(5)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^3 - (x^3 - 1)/(x^3 - 2))                        # needs sage.rings.function_field
sage: L.space_of_differentials()                                            # needs sage.modules sage.rings.function_field
Space of differentials of Function field in y
 defined by y^3 + (4*x^3 + 1)/(x^3 + 3)
space_of_differentials_of_first_kind()#

Return the space of holomorphic differentials of this function field.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: K.space_of_holomorphic_differentials()                                # needs sage.libs.pari sage.modules
(Vector space of dimension 0 over Rational Field,
 Linear map:
   From: Vector space of dimension 0 over Rational Field
   To:   Space of differentials of Rational function field in t over Rational Field,
 Section of linear map:
   From: Space of differentials of Rational function field in t over Rational Field
   To:   Vector space of dimension 0 over Rational Field)

sage: K.<x> = FunctionField(GF(5)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^3 - (x^3 - 1)/(x^3 - 2))                        # needs sage.rings.function_field
sage: L.space_of_holomorphic_differentials()                                # needs sage.modules sage.rings.function_field
(Vector space of dimension 4 over Finite Field of size 5,
 Linear map:
   From: Vector space of dimension 4 over Finite Field of size 5
   To:   Space of differentials of Function field in y
          defined by y^3 + (4*x^3 + 1)/(x^3 + 3),
 Section of linear map:
   From: Space of differentials of Function field in y
          defined by y^3 + (4*x^3 + 1)/(x^3 + 3)
   To:   Vector space of dimension 4 over Finite Field of size 5)
space_of_holomorphic_differentials()#

Return the space of holomorphic differentials of this function field.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: K.space_of_holomorphic_differentials()                                # needs sage.libs.pari sage.modules
(Vector space of dimension 0 over Rational Field,
 Linear map:
   From: Vector space of dimension 0 over Rational Field
   To:   Space of differentials of Rational function field in t over Rational Field,
 Section of linear map:
   From: Space of differentials of Rational function field in t over Rational Field
   To:   Vector space of dimension 0 over Rational Field)

sage: K.<x> = FunctionField(GF(5)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^3 - (x^3 - 1)/(x^3 - 2))                        # needs sage.rings.function_field
sage: L.space_of_holomorphic_differentials()                                # needs sage.modules sage.rings.function_field
(Vector space of dimension 4 over Finite Field of size 5,
 Linear map:
   From: Vector space of dimension 4 over Finite Field of size 5
   To:   Space of differentials of Function field in y
          defined by y^3 + (4*x^3 + 1)/(x^3 + 3),
 Section of linear map:
   From: Space of differentials of Function field in y
          defined by y^3 + (4*x^3 + 1)/(x^3 + 3)
   To:   Vector space of dimension 4 over Finite Field of size 5)
valuation(prime)#

Return the discrete valuation on this function field defined by prime.

INPUT:

  • prime – a place of the function field, a valuation on a subring, or a valuation on another function field together with information for isomorphisms to and from that function field

EXAMPLES:

We create valuations that correspond to finite rational places of a function field:

sage: K.<x> = FunctionField(QQ)
sage: v = K.valuation(1); v                                                 # needs sage.rings.function_field
(x - 1)-adic valuation
sage: v(x)                                                                  # needs sage.rings.function_field
0
sage: v(x - 1)                                                              # needs sage.rings.function_field
1

A place can also be specified with an irreducible polynomial:

sage: v = K.valuation(x - 1); v                                             # needs sage.rings.function_field
(x - 1)-adic valuation

Similarly, for a finite non-rational place:

sage: v = K.valuation(x^2 + 1); v                                           # needs sage.rings.function_field
(x^2 + 1)-adic valuation
sage: v(x^2 + 1)                                                            # needs sage.rings.function_field
1
sage: v(x)                                                                  # needs sage.rings.function_field
0

Or for the infinite place:

sage: v = K.valuation(1/x); v                                               # needs sage.rings.function_field
Valuation at the infinite place
sage: v(x)                                                                  # needs sage.rings.function_field
-1

Instead of specifying a generator of a place, we can define a valuation on a rational function field by giving a discrete valuation on the underlying polynomial ring:

sage: # needs sage.rings.function_field
sage: R.<x> = QQ[]
sage: u = valuations.GaussValuation(R, valuations.TrivialValuation(QQ))
sage: w = u.augmentation(x - 1, 1)
sage: v = K.valuation(w); v
(x - 1)-adic valuation

Note that this allows us to specify valuations which do not correspond to a place of the function field:

sage: w = valuations.GaussValuation(R, QQ.valuation(2))                     # needs sage.rings.function_field
sage: v = K.valuation(w); v                                                 # needs sage.rings.function_field
2-adic valuation

The same is possible for valuations with \(v(1/x) > 0\) by passing in an extra pair of parameters, an isomorphism between this function field and an isomorphic function field. That way you can, for example, indicate that the valuation is to be understood as a valuation on \(K[1/x]\), i.e., after applying the substitution \(x \mapsto 1/x\) (here, the inverse map is also \(x \mapsto 1/x\)):

sage: # needs sage.rings.function_field
sage: w = valuations.GaussValuation(R, QQ.valuation(2)).augmentation(x, 1)
sage: w = K.valuation(w)
sage: v = K.valuation((w, K.hom([~K.gen()]), K.hom([~K.gen()]))); v
Valuation on rational function field
induced by [ Gauss valuation induced by 2-adic valuation, v(x) = 1 ]
(in Rational function field in x over Rational Field after x |--> 1/x)

Note that classical valuations at finite places or the infinite place are always normalized such that the uniformizing element has valuation 1:

sage: # needs sage.rings.function_field
sage: K.<t> = FunctionField(GF(3))
sage: M.<x> = FunctionField(K)
sage: v = M.valuation(x^3 - t)
sage: v(x^3 - t)
1

However, if such a valuation comes out of a base change of the ground field, this is not the case anymore. In the example below, the unique extension of v to L still has valuation 1 on \(x^3 - t\) but it has valuation 1/3 on its uniformizing element \(x - w\):

sage: # needs sage.rings.function_field
sage: R.<w> = K[]
sage: L.<w> = K.extension(w^3 - t)
sage: N.<x> = FunctionField(L)
sage: w = v.extension(N)  # missing factorization, :issue:`16572`
Traceback (most recent call last):
...
NotImplementedError
sage: w(x^3 - t)                    # not tested
1
sage: w(x - w)                      # not tested
1/3

There are several ways to create valuations on extensions of rational function fields:

sage: K.<x> = FunctionField(QQ)
sage: R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x); L                                       # needs sage.rings.function_field
Function field in y defined by y^2 - x

A place that has a unique extension can just be defined downstairs:

sage: v = L.valuation(x); v                                                 # needs sage.rings.function_field
(x)-adic valuation
sage.rings.function_field.function_field.is_FunctionField(x)#

Return True if x is a function field.

EXAMPLES:

sage: from sage.rings.function_field.function_field import is_FunctionField
sage: is_FunctionField(QQ)
False
sage: is_FunctionField(FunctionField(QQ, 't'))
True