# Ticket #9054: trac_9054_polynomial_base_field.patch

File trac_9054_polynomial_base_field.patch, 1.7 KB (added by saraedum, 10 years ago)

polynomial used for a field extension must be defined over the base field

• ## sage/rings/function_field/function_field.py

```exporting patch:
# HG changeset patch
# User Julian Rüth <julian.rueth@gmail.com>
# Date 1307562725 -7200
# Node ID e515debf2b340e3d58cb352452503702b39e4385
# Parent  3ff1fea4eb0e943ae478fcf59a159d34b059d8d3
Trac 9054: polynomial must be defined over the base field

diff -r 3ff1fea4eb0e -r e515debf2b34 sage/rings/function_field/function_field.py```
 a sage: K.extension(y^5 - x^3 - 3*x + x*y) Function field in y defined by y^5 + x*y - x^3 - 3*x A nonintegral defining polynomial:: sage: K. = FunctionField(QQ); R. = K[] sage: K.extension(t*y^3 + (1/t)*y + t^3/(t+1)) Function field in y defined by t*y^3 + 1/t*y + t^3/(t + 1) """ from sage.rings.polynomial.all import is_Polynomial if names is None: names = f.variable_name() if not is_Polynomial(f): raise TypeError, "polynomial must be a polynomial" if f.parent().base_ring() is not self: raise ValueError, "The polynomial must be defined over the base field" return FunctionField_polymod(f, names) def order_with_basis(self, basis, check=True): We make another extension of a rational function field:: sage: R2. = FunctionField(QQ); S2. = R2[] sage: L2. = R.extension((4*w)^2 - (t+1)^3 - 1) sage: L2. = R2.extension((4*w)^2 - (t+1)^3 - 1) We define a morphism, by givin the images of generators::