Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/sage/rings/function_field/function_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,22 @@ def extension(self, f, names=None):

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)

TESTS:

Verify that :issue:`41095` has been resolved::

sage: K.<x> = FunctionField(GF(2))
sage: R.<t> = PolynomialRing(K)
sage: L.<y> = K.extension(t^2 + t*x)
sage: M.<z> = L.extension(t^3 + x)
sage: M.base_ring() is K
False
sage: M.base_ring() is L
True
"""
from . import constructor
return constructor.FunctionFieldExtension(f, names)
return constructor.FunctionFieldExtension(f.change_ring(self), names)

def order_with_basis(self, basis, check: bool = True):
"""
Expand Down
32 changes: 0 additions & 32 deletions src/sage/rings/function_field/function_field_rational.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,38 +430,6 @@ def _factor_univariate_polynomial(self, f, proof=None):
from sage.structure.factorization import Factorization
return Factorization(w, unit=unit)

def extension(self, f, names=None):
"""
Create an extension `L = K[y]/(f(y))` of the rational function field.

INPUT:

- ``f`` -- univariate polynomial over self

- ``names`` -- string or length-1 tuple

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
Copy link
Contributor

@cxzhong cxzhong Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, we can not use K.extension like this? I think it is better to preserve these tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand, isn't it exactly line 456 in function_field.py? I feel like these tests were run twice, but maybe there is something silly I am missing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand, isn't it exactly line 456 in function_field.py? I feel like these tests were run twice, but maybe there is something silly I am missing?

The base field is QQ, a rational number field. But in line 456 examples, its base field is GF(2). This examples is used to detect the extension method on the function field based on a rational number field.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand, isn't it exactly line 456 in function_field.py? I feel like these tests were run twice, but maybe there is something silly I am missing?

I think you can add this into the line456 test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I need another cup of black tea, I agree that the tests I added (starting line 475) are on GF(2), but it seems to me that the tests between line 456 and 469 are precisely the ones I deleted, with QQ. I just ran diff on these lines and the only difference is lines 463/464 vs 454/455. Maybe we can keep the small difference? But I don't see the GF(2) thing?

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)) # needs sage.rings.function_field
Function field in y defined by y^3 + 1/t*y + 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)
"""
from . import constructor
return constructor.FunctionFieldExtension(f, names)

@cached_method
def polynomial_ring(self, var='x'):
"""
Expand Down
Loading