sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.4k stars 474 forks source link

genus() returns negative value. #30916

Open iwaokimura opened 3 years ago

iwaokimura commented 3 years ago

genus() for an algebraic function field returns negative value. This is because a defining polynomial is not irreducible over a base field, the extension() method should raise an error.

Example (reporoduced on Sagemath 9.1 on CoCalc):

In [1]: k=FunctionField(FiniteField(5), "T");  k
Rational function field in T over Finite Field of size 5
In [2]: T=k.gen(); T
T
In [3]: u=polygen(k, "u"); u
u
In [4]: M.<u>=k.extension(4*u^4 + T^4); M
Function field in u defined by 4*u^4 + T^4
In [5]: M.genus()
-3

https://cocalc.com/share/ce68244ea486c63589f53b34c52a58272fe33a4c/2020-11-15-104533.ipynb?viewer=share

Component: number theory

Keywords: genus, function field

Branch/Commit: u/gh-DavidAyotte/genus___returns_negativevalue @ bd4224b

Issue created by migration from https://trac.sagemath.org/ticket/30916

iwaokimura commented 3 years ago

Description changed:

--- 
+++ 
@@ -1,6 +1,7 @@
 genus() for an algebraic function field returns negative value.
 This is because a defining polynomial is not irreducible over a base field, the extension() method should raise an error.
-Example:
+
+Example (reporoduced on Sagemath 9.1 on CoCalc):

In [1]: k=FunctionField(FiniteField(5), "T"); k @@ -14,3 +15,4 @@ In [5]: M.genus() -3

+https://cocalc.com/share/ce68244ea486c63589f53b34c52a58272fe33a4c/2020-11-15-104533.ipynb?viewer=share
DavidAyotte commented 3 years ago
comment:3

Hello! I've looked at the source code and it is indeed possible to create a "Function field extension" using an reducible polynomial. In fact, the class "FunctionField_polymod" state this warning:

.. WARNING::

        It is not checked if the polynomial used to define the function field is irreducible
        Hence it is not guaranteed that this object really is a field!
        This is illustrated below.

    ::

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

I believe that one workaround to this could be to add a keyword "check=False" that would verify if the defining polynomial is irreducible. The default value would be "False" since a lot a code seems to depend of the fact that we can create an extension which is not a field (i.e. a ring extension). But maybe there is a better way to do this.

DavidAyotte commented 3 years ago

Branch: u/gh-DavidAyotte/genus___returns_negativevalue

DavidAyotte commented 3 years ago
comment:5

I have added a keyword "check" to the method "extension". If anybody has a better way to do this feel free to change it.


New commits:

bd4224bAdded irreducibility verificator (check=False) for extension method
DavidAyotte commented 3 years ago

Commit: bd4224b

mkoeppe commented 3 years ago
comment:7

Moving to 9.4, as 9.3 has been released.