Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Derivations for rational function fields
Browse files Browse the repository at this point in the history
  • Loading branch information
saraedum committed Jun 23, 2014
1 parent 920c16e commit dc81be8
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 6 deletions.
51 changes: 47 additions & 4 deletions src/sage/rings/function_field/function_field.py
Expand Up @@ -7,12 +7,11 @@
- Robert Bradshaw (2010-05-30): added is_finite()
- Julian Rueth (2011-06-08): fixed hom(), extension()
- Julian Rueth (2011-06-08, 2011-09-14, 2014-06-23): fixed hom(), extension();
use @cached_method; added derivation()
- Maarten Derickx (2011-09-11): added doctests
- Julian Rueth (2011-09-14): use @cached_method
- Syed Ahmad Lavasani (2011-12-16): added genus(), is_RationalFunctionField()
EXAMPLES:
Expand Down Expand Up @@ -67,7 +66,7 @@
#*****************************************************************************
# Copyright (C) 2010 William Stein <wstein@gmail.com>
# Copyright (C) 2010 Robert Bradshaw <robertwb@math.washington.edu>
# Copyright (C) 2011 Julian Rueth <julian.rueth@gmail.com>
# Copyright (C) 2011-2014 Julian Rueth <julian.rueth@gmail.com>
# Copyright (C) 2011 Maarten Derickx <m.derickx.student@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
Expand Down Expand Up @@ -1441,3 +1440,47 @@ def genus(self):
"""
return 0

@cached_method
def derivation(self):
"""
Return a generator of the space of derivations over the constant base
field of this function field.
A derivation on `R` is map `R\to R` with
`D(\alpha+\beta)=D(\alpha)+D(\beta)` and `D(\alpha\beta)=\beta
D(\alpha)+\alpha D(\beta)` for all `\alpha,\beta\in R`. For a function
field `K(x)` with `K` perfect, the derivations form a one-dimensional
`K`-vector space generated by the extension of the usual derivation on
`K[x]` (cf. Proposition 10 in [GT1996]_.)
OUTPUT:
An endofunction on this function field.
REFERENCES::
.. [GT1996] Gianni, P., & Trager, B. (1996). Square-free algorithms in
positive characteristic. Applicable Algebra in Engineering,
Communication and Computing, 7(1), 1-14.
EXAMPLES::
sage: K.<x> = FunctionField(GF(3))
sage: K.derivation()
Derivation map:
From: Rational function field in x over Finite Field of size 3
To: Rational function field in x over Finite Field of size 3
TESTS::
sage: L.<y> = FunctionField(K)
sage: L.derivation()
Traceback (most recent call last):
...
NotImplementedError: not implemented for non-perfect base fields
"""
from maps import FunctionFieldDerivation_rational
if not self.constant_base_field().is_perfect():
raise NotImplementedError("not implemented for non-perfect base fields")
return FunctionFieldDerivation_rational(self, self.one())
141 changes: 139 additions & 2 deletions src/sage/rings/function_field/maps.py
Expand Up @@ -5,7 +5,8 @@
- William Stein (2010): initial version
- Julian Rueth (2011-09-14): refactored class hierarchy
- Julian Rueth (2011-09-14, 2014-06-23): refactored class hierarchy; added
derivation classes
EXAMPLES::
Expand All @@ -24,7 +25,7 @@
"""
#*****************************************************************************
# Copyright (C) 2010 William Stein <wstein@gmail.com>
# Copyright (C) 2011 Julian Rueth <julian.rueth@gmail.com>
# Copyright (C) 2011-2014 Julian Rueth <julian.rueth@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation; either version 2 of
Expand All @@ -33,8 +34,144 @@
#*****************************************************************************

from sage.categories.morphism import Morphism
from sage.categories.map import Map
from sage.rings.morphism import RingHomomorphism

class FunctionFieldDerivation(Map):
r"""
A base class for derivations on function fields.
A derivation on `R` is map `R\to R` with
`D(\alpha+\beta)=D(\alpha)+D(\beta)` and `D(\alpha\beta)=\beta
D(\alpha)+\alpha D(\beta)` for all `\alpha,\beta\in R`.
EXAMPLES::
sage: K.<x> = FunctionField(QQ)
sage: d = K.derivation()
sage: isinstance(d, sage.rings.function_field.maps.FunctionFieldDerivation)
True
"""
def __init__(self, K):
r"""
Initialize a derivation from ``K`` to ``K``.
EXAMPLES::
sage: K.<x> = FunctionField(QQ)
sage: d = K.derivation() # indirect doctest
"""
from function_field import is_FunctionField
if not is_FunctionField(K):
raise ValueError("K must be a function field")
self.__field = K
from sage.categories.homset import Hom
from sage.categories.sets_cat import Sets
Map.__init__(self, Hom(K,K,Sets()))

def _repr_type(self):
r"""
Return the type of this map (a derivation), for the purposes of printing out self.
EXAMPLES::
sage: K.<x> = FunctionField(QQ)
sage: d = K.derivation()
sage: d._repr_type()
'Derivation'
"""
return "Derivation"

def is_injective(self):
r"""
Return whether this derivation is injective.
OUTPUT:
Returns ``False`` since derivations are never injective.
EXAMPLES::
sage: K.<x> = FunctionField(QQ)
sage: d = K.derivation()
sage: d.is_injective()
False
"""
return False

class FunctionFieldDerivation_rational(FunctionFieldDerivation):
r"""
A derivation on a rational function field.
INPUT:
- ``K`` -- a rational function field
- ``u`` -- an element of ``K``, the image of the generator of ``K`` under
the derivation.
EXAMPLES::
sage: K.<x> = FunctionField(QQ)
sage: d = K.derivation()
sage: isinstance(d, sage.rings.function_field.maps.FunctionFieldDerivation_rational)
True
"""
def __init__(self, K, u):
r"""
Initialize a derivation of ``K`` which sends the generator of ``K`` to
``u``.
EXAMPLES::
sage: K.<x> = FunctionField(QQ)
sage: d = K.derivation() # indirect doctest
"""
from function_field import is_RationalFunctionField
if not is_RationalFunctionField(K):
raise ValueError("K must be a rational function field")
if u.parent() is not K:
raise ValueError("u must be an element in K")
FunctionFieldDerivation.__init__(self, K)
self._u = u

def _call_(self, x):
r"""
Compute the derivation of ``x``.
INPUT:
- ``x`` -- an element of the rational function field
EXAMPLES::
sage: K.<x> = FunctionField(QQ)
sage: d = K.derivation()
sage: d(x) # indirect doctest
1
sage: d(x^3)
3*x^2
sage: d(1/x)
-1/x^2
"""
f,g = x.numerator(),x.denominator()

if not f.gcd(g).is_one():
raise NotImplementedError("derivations only implemented for rational functions with coprime numerator and denominator.")

numerator = f.derivative()*g - f*g.derivative()
if numerator.is_zero():
return self.codomain().zero()
else:
return self._u * self.codomain()( numerator / g**2 )

class FunctionFieldIsomorphism(Morphism):
r"""
A base class for isomorphisms between function fields and
Expand Down

0 comments on commit dc81be8

Please sign in to comment.