# Function Field Elements¶

Function Field Elements

AUTHORS:

• William Stein: initial version
• Robert Bradshaw (2010-05-27): cythonize function field elements
• Julian Rueth (2011-06-28): treat zero correctly
• Maarten Derickx (2011-09-11): added doctests, fixed pickling
class sage.rings.function_field.function_field_element.FunctionFieldElement

The abstract base class for function field elements.

EXAMPLES:

sage: t = FunctionField(QQ,'t').gen()
sage: isinstance(t, sage.rings.function_field.function_field_element.FunctionFieldElement)
True

characteristic_polynomial(*args, **kwds)

Return the characteristic polynomial of this function field element. Give an optional input string to name the variable in the characteristic polynomial.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3); R.<z> = L[]
sage: M.<z> = L.extension(z^3 - y^2*z + x)
sage: x.characteristic_polynomial('W')
W - x
sage: y.characteristic_polynomial('W')
W^2 - x*W + 4*x^3
sage: z.characteristic_polynomial('W')
W^3 + (-x*y + 4*x^3)*W + x

charpoly(*args, **kwds)

Return the characteristic polynomial of this function field element. Give an optional input string to name the variable in the characteristic polynomial.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3); R.<z> = L[]
sage: M.<z> = L.extension(z^3 - y^2*z + x)
sage: x.characteristic_polynomial('W')
W - x
sage: y.characteristic_polynomial('W')
W^2 - x*W + 4*x^3
sage: z.characteristic_polynomial('W')
W^3 + (-x*y + 4*x^3)*W + x

is_integral()

Determine if self is integral over the maximal order of the base field.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: y.is_integral()
True
sage: (y/x).is_integral()
True
sage: (y/x)^2 - (y/x) + 4*x
0
sage: (y/x^2).is_integral()
False
sage: (y/x).minimal_polynomial('W')
W^2 - W + 4*x

matrix()

Return the matrix of multiplication by self, interpreting self as an element of a vector space over its base field.

EXAMPLES:

A rational function field:

sage: K.<t> = FunctionField(QQ)
sage: t.matrix()
[t]
sage: (1/(t+1)).matrix()
[1/(t + 1)]


Now an example in a nontrivial extension of a rational function field:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: y.matrix()
[     0      1]
[-4*x^3      x]
sage: y.matrix().charpoly('Z')
Z^2 - x*Z + 4*x^3


An example in a relative extension, where neither function field is rational:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: M.<T> = L[]; Z.<alpha> = L.extension(T^3 - y^2*T + x)
sage: alpha.matrix()
[          0           1           0]
[          0           0           1]
[         -x x*y - 4*x^3           0]


We show that this matrix does indeed work as expected when making a vector space from a function field:

sage: K.<x>=FunctionField(QQ)
sage: R.<y> = K[]
sage: L.<y> = K.extension(y^5 - (x^3 + 2*x*y + 1/x))
sage: V, from_V, to_V = L.vector_space()
sage: y5 = to_V(y^5); y5
((x^4 + 1)/x, 2*x, 0, 0, 0)
sage: y4y = to_V(y^4) * y.matrix(); y4y
((x^4 + 1)/x, 2*x, 0, 0, 0)
sage: y5 == y4y
True

minimal_polynomial(*args, **kwds)

Return the minimal polynomial of this function field element. Give an optional input string to name the variable in the characteristic polynomial.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3); R.<z> = L[]
sage: M.<z> = L.extension(z^3 - y^2*z + x)
sage: x.minimal_polynomial('W')
W - x
sage: y.minimal_polynomial('W')
W^2 - x*W + 4*x^3
sage: z.minimal_polynomial('W')
W^3 + (-x*y + 4*x^3)*W + x

minpoly(*args, **kwds)

Return the minimal polynomial of this function field element. Give an optional input string to name the variable in the characteristic polynomial.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3); R.<z> = L[]
sage: M.<z> = L.extension(z^3 - y^2*z + x)
sage: x.minimal_polynomial('W')
W - x
sage: y.minimal_polynomial('W')
W^2 - x*W + 4*x^3
sage: z.minimal_polynomial('W')
W^3 + (-x*y + 4*x^3)*W + x

norm()

Return the norm of this function field element.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: y.norm()
4*x^3


The norm is relative:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3); R.<z> = L[]
sage: M.<z> = L.extension(z^3 - y^2*z + x)
sage: z.norm()
-x
sage: z.norm().parent()
Function field in y defined by y^2 - x*y + 4*x^3

trace()

Return the trace of this function field element.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: y.trace()
x

class sage.rings.function_field.function_field_element.FunctionFieldElement_polymod

Elements of a finite extension of a function field.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: x*y + 1/x^3
x*y + 1/x^3

element()

Return the underlying polynomial that represents this element.

EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<T> = K[] sage: L.<y> = K.extension(T^2 - x*T + 4*x^3) sage: f = y/x^2 + x/(x^2+1); f 1/x^2*y + x/(x^2 + 1) sage: f.element() 1/x^2*T + x/(x^2 + 1) sage: type(f.element()) <class ‘sage.rings.polynomial.polynomial_element_generic.Polynomial_generic_dense_field’>
list()

Return a list of coefficients of self, i.e., if self is an element of a function field K[y]/(f(y)), then return the coefficients of the reduced presentation as a polynomial in K[y].

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: a = ~(2*y + 1/x); a
(-x^2/(8*x^5 + x^2 + 1/2))*y + (2*x^3 + x)/(16*x^5 + 2*x^2 + 1)
sage: a.list()
[(2*x^3 + x)/(16*x^5 + 2*x^2 + 1), -x^2/(8*x^5 + x^2 + 1/2)]
sage: (x*y).list()
[0, x]

class sage.rings.function_field.function_field_element.FunctionFieldElement_rational

Elements of a rational function field.

EXAMPLES:

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

denominator()

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: f = (t+1) / (t^2 - 1/3); f
(t + 1)/(t^2 - 1/3)
sage: f.denominator()
t^2 - 1/3

element()

Return the underlying fraction field element that represents this element.

EXAMPLES:

sage: K.<t> = FunctionField(GF(7))
sage: t.element()
t
sage: type(t.element())
<type 'sage.rings.fraction_field_FpT.FpTElement'>

sage: K.<t> = FunctionField(GF(131101))
sage: t.element()
t
sage: type(t.element())
<class 'sage.rings.fraction_field_element.FractionFieldElement_1poly_field'>

factor()

Factor this rational function.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: f = (t+1) / (t^2 - 1/3)
sage: f.factor()
(t + 1) * (t^2 - 1/3)^-1
sage: (7*f).factor()
(7) * (t + 1) * (t^2 - 1/3)^-1
sage: ((7*f).factor()).unit()
7
sage: (f^3).factor()
(t + 1)^3 * (t^2 - 1/3)^-3

inverse_mod(I)

Return an inverse of self modulo the integral ideal $$I$$, if defined, i.e., if $$I$$ and self together generate the unit ideal.

EXAMPLES:

sage: K.<x> = FunctionField(QQ)
sage: O = K.maximal_order(); I = O.ideal(x^2+1)
sage: t = O(x+1).inverse_mod(I); t
-1/2*x + 1/2
sage: (t*(x+1) - 1) in I
True

is_square()

Returns whether self is a square.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: t.is_square()
False
sage: (t^2/4).is_square()
True
sage: f = 9 * (t+1)^6 / (t^2 - 2*t + 1); f.is_square()
True

sage: K.<t> = FunctionField(GF(5))
sage: (-t^2).is_square()
True
sage: (-t^2).sqrt()
2*t

list()

Return a list of coefficients of self, i.e., if self is an element of a function field K[y]/(f(y)), then return the coefficients of the reduced presentation as a polynomial in K[y]. Since self is a member of a rational function field, this simply returns the list $$[self]$$

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: t.list()
[t]

numerator()

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: f = (t+1) / (t^2 - 1/3); f
(t + 1)/(t^2 - 1/3)
sage: f.numerator()
t + 1

sqrt(all=False)

Returns the square root of self.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: f = t^2 - 2 + 1/t^2; f.sqrt()
(t^2 - 1)/t
sage: f = t^2; f.sqrt(all=True)
[t, -t]


TESTS:

sage: K(4/9).sqrt()
2/3
sage: K(0).sqrt(all=True)
[0]

valuation(v)

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: f = (t-1)^2 * (t+1) / (t^2 - 1/3)^3
sage: f.valuation(t-1)
2
sage: f.valuation(t)
0
sage: f.valuation(t^2 - 1/3)
-3

sage.rings.function_field.function_field_element.is_FunctionFieldElement(x)

Return True if x is any type of function field element.

EXAMPLES:

sage: t = FunctionField(QQ,'t').gen()
sage: sage.rings.function_field.function_field_element.is_FunctionFieldElement(t)
True
sage: sage.rings.function_field.function_field_element.is_FunctionFieldElement(0)
False

sage.rings.function_field.function_field_element.make_FunctionFieldElement(parent, element_class, representing_element)

Used for unpickling FunctionFieldElement objects (and subclasses).

EXAMPLES:

sage: from sage.rings.function_field.function_field_element import make_FunctionFieldElement
sage: K.<x> = FunctionField(QQ)
sage: make_FunctionFieldElement(K, K._element_class, (x+1)/x)
(x + 1)/x


Function Fields

#### Next topic

Orders in Function Fields