Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*- Function Field Morphisms
AUTHORS:
- William Stein (2010): initial version
- Julian Rüth (2011-09-14, 2014-06-23, 2017-08-21): refactored class hierarchy; added derivation classes; morphisms to/from fraction fields
EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[] sage: K.hom(1/x) Function Field endomorphism of Rational function field in x over Rational Field Defn: x |--> 1/x sage: L.<y> = K.extension(y^2 - x) sage: K.hom(y) Function Field morphism: From: Rational function field in x over Rational Field To: Function field in y defined by y^2 - x Defn: x |--> y sage: L.hom([y,x]) Function Field endomorphism of Function field in y defined by y^2 - x Defn: y |--> y x |--> x sage: L.hom([x,y]) Traceback (most recent call last): ... ValueError: invalid morphism """ #***************************************************************************** # Copyright (C) 2010 William Stein <wstein@gmail.com> # Copyright (C) 2011-2017 Julian Rüth <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 # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ #*****************************************************************************
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
""" r""" Initialize a derivation from ``K`` to ``K``.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: d = K.derivation() # indirect doctest
""" raise ValueError("K must be a function field")
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'
"""
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
"""
""" A derivation on a rational function field.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: d = K.derivation() sage: isinstance(d, sage.rings.function_field.maps.FunctionFieldDerivation_rational) True """ """ Initialize a derivation of ``K`` which sends the generator of ``K`` to ``u``.
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() # indirect doctest sage: type(d) <class 'sage.rings.function_field.maps.FunctionFieldDerivation_rational'> """
""" 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 """
else:
""" The unique extension of the derivation ``d`` to ``L``.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x) sage: d = L.derivation() """ """ Initialization.
INPUT:
- ``L`` -- a function field which is a separable extension of the domain of ``d``
- ``d`` -- a derivation on the base function field of ``L``
EXAMPLES::
sage: K.<x> = FunctionField(GF(3)) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x) sage: d = L.derivation() # indirect doctest sage: type(d) <class 'sage.rings.function_field.maps.FunctionFieldDerivation_separable'> """
raise ValueError("L must be a separable extension of its base field.")
r""" Evaluate the derivation on ``x``.
INPUT:
- ``x`` -- an element of the function field
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x) sage: d = L.derivation() sage: d(x) # indirect doctest 1 sage: d(y) (-1/2/-x)*y sage: d(y^2) 1 """ return self.codomain().zero()
""" Return the string representation of the map.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x) sage: L.derivation() # indirect doctest Derivation map: From: Function field in y defined by y^2 - x To: Function field in y defined by y^2 - x Defn: y |--> (-1/2/-x)*y
sage: R.<z> = L[] sage: M.<z> = L.extension(z^2 - y) sage: M.derivation() Derivation map: From: Function field in z defined by z^2 - y To: Function field in z defined by z^2 - y Defn: y |--> (-1/2/-x)*y z |--> 1/4/x*z """ else:
r""" A base class for isomorphisms involving function fields.
EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[] sage: L.<y> = K.extension(y^2 - x*y + 4*x^3) sage: V, f, t = L.vector_space() sage: isinstance(f, sage.rings.function_field.maps.FunctionFieldIsomorphism) True """ """ Return the type of this map (an isomorphism), for the purposes of printing this map.
EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[] sage: L.<y> = K.extension(y^2 - x*y + 4*x^3) sage: V, f, t = L.vector_space() sage: f._repr_type() 'Isomorphism' """
""" Return True, since this isomorphism is injective.
EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[] sage: L.<y> = K.extension(y^2 - x*y + 4*x^3) sage: V, f, t = L.vector_space() sage: f.is_injective() True """
""" Return True, since this isomorphism is surjective.
EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[] sage: L.<y> = K.extension(y^2 - x*y + 4*x^3) sage: V, f, t = L.vector_space() sage: f.is_surjective() True """
r""" Compare this map to ``other``.
.. NOTE::
This implementation assumes that this isomorphism is defined by its domain and codomain. Isomorphisms for which this is not true must override this implementation.
EXAMPLES::
sage: K = QQ['x'].fraction_field() sage: L = K.function_field() sage: f = K.coerce_map_from(L)
sage: K = QQbar['x'].fraction_field() sage: L = K.function_field() sage: g = K.coerce_map_from(L)
sage: f == g False sage: f == f True
""" return NotImplemented
r""" Return a hash value of this map.
This implementation assumes that this isomorphism is defined by its domain and codomain. Isomorphisms for which this is not true should override this implementation.
EXAMPLES::
sage: K = QQ['x'].fraction_field() sage: L = K.function_field() sage: f = K.coerce_map_from(L) sage: hash(f) == hash(f) True
"""
r""" An isomorphism from a vector space to 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: V, f, t = L.vector_space(); f Isomorphism morphism: From: Vector space of dimension 2 over Rational function field in x over Rational Field To: Function field in y defined by y^2 - x*y + 4*x^3 """ """ EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[] sage: L.<y> = K.extension(y^2 - x*y + 4*x^3) sage: V, f, t = L.vector_space(); type(f) <class 'sage.rings.function_field.maps.MapVectorSpaceToFunctionField'> """
""" Map ``v`` to the function field.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x*y + 4*x^3) sage: V, f, t = L.vector_space() sage: f(x*V.0 + (1/x^3)*V.1) # indirect doctest 1/x^3*y + x
TESTS:
Test that this map is a bijection for some random inputs::
sage: R.<z> = L[] sage: M.<z> = L.extension(z^3 - y - x) sage: for F in [K,L,M]: ....: for base in F._intermediate_fields(K): ....: V, f, t = F.vector_space(base) ....: for i in range(100): ....: a = F.random_element() ....: assert(f(t(a)) == a)
"""
# construct the basis composed of powers of the generators of all the # intermediate fields, i.e., 1, x, y, x*y, ...
# multiply the entries of v with the values in basis
""" An isomorphism from a function field to a vector space.
EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[] sage: L.<y> = K.extension(y^2 - x*y + 4*x^3) sage: V, f, t = L.vector_space(); t Isomorphism morphism: From: Function field in y defined by y^2 - x*y + 4*x^3 To: Vector space of dimension 2 over Rational function field in x over Rational Field """ """ EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[] sage: L.<y> = K.extension(y^2 - x*y + 4*x^3) sage: V, f, t = L.vector_space(); type(t) <class 'sage.rings.function_field.maps.MapFunctionFieldToVectorSpace'> """
""" Map ``x`` to the vector space.
EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[] sage: L.<y> = K.extension(y^2 - x*y + 4*x^3) sage: V, f, t = L.vector_space() sage: t(x + (1/x^3)*y) # indirect doctest (x, 1/x^3)
TESTS:
Test that this map is a bijection for some random inputs::
sage: R.<z> = L[] sage: M.<z> = L.extension(z^3 - y - x) sage: for F in [K,L,M]: ....: for base in F._intermediate_fields(K): ....: V, f, t = F.vector_space(base) ....: for i in range(100): ....: a = V.random_element() ....: assert(t(f(a)) == a)
"""
r""" Base class for morphisms between function fields. """ """ EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: f = K.hom(1/x); f Function Field endomorphism of Rational function field in x over Rational Field Defn: x |--> 1/x sage: isinstance(f, sage.rings.function_field.maps.FunctionFieldMorphism) True """
r""" Return the type of this map (a morphism of function fields), for the purposes of printing this map.
EXAMPLES::
sage: K.<x> = FunctionField(GF(7)); R.<y> = K[] sage: L.<y> = K.extension(y^3 + 6*x^3 + x) sage: f = L.hom(y*2) sage: f._repr_type() 'Function Field'
"""
""" EXAMPLES::
sage: K.<x> = FunctionField(GF(7)); R.<y> = K[] sage: L.<y> = K.extension(y^3 + 6*x^3 + x) sage: f = L.hom(y*2) sage: f._repr_defn() 'y |--> 2*y' """
""" Morphism from a finite extension of a function field to a function field.
EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[] sage: L.<y> = K.extension(y^2 - x) sage: f = L.hom(-y); f Function Field endomorphism of Function field in y defined by y^2 - x Defn: y |--> -y """ """ EXAMPLES::
sage: K.<x> = FunctionField(GF(7)); R.<y> = K[] sage: L.<y> = K.extension(y^3 + 6*x^3 + x) sage: f = L.hom(y*2); f Function Field endomorphism of Function field in y defined by y^3 + 6*x^3 + x Defn: y |--> 2*y sage: type(f) <class 'sage.rings.function_field.maps.FunctionFieldMorphism_polymod'> sage: factor(L.polynomial()) y^3 + 6*x^3 + x sage: f(y).charpoly('y') y^3 + 6*x^3 + x """ # Verify that the morphism is valid:
""" EXAMPLES::
sage: K.<x> = FunctionField(GF(7)); R.<y> = K[] sage: L.<y> = K.extension(y^3 + 6*x^3 + x); f = L.hom(y*2) sage: f(y/x + x^2/(x+1)) # indirect doctest 2/x*y + x^2/(x + 1) sage: f(y) 2*y """
""" Morphism from a rational function field to a function field.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: f = K.hom(1/x); f Function Field endomorphism of Rational function field in x over Rational Field Defn: x |--> 1/x """ """ EXAMPLES::
sage: K.<x> = FunctionField(GF(7)) sage: f = K.hom(1/x); f Function Field endomorphism of Rational function field in x over Finite Field of size 7 Defn: x |--> 1/x sage: type(f) <class 'sage.rings.function_field.maps.FunctionFieldMorphism_rational'> """
""" EXAMPLES::
sage: K.<x> = FunctionField(GF(7)) sage: f = K.hom(1/x); f Function Field endomorphism of Rational function field in x over Finite Field of size 7 Defn: x |--> 1/x sage: f(x+1) # indirect doctest (x + 1)/x sage: 1/x + 1 (x + 1)/x
You can specify a morphism on the base ring::
sage: Qi = GaussianIntegers().fraction_field() sage: i = Qi.gen() sage: K.<x> = FunctionField(Qi) sage: phi1 = Qi.hom([CC.gen()]) sage: phi2 = Qi.hom([-CC.gen()]) sage: f = K.hom(CC.pi(),phi1) sage: f(1+i+x) 4.14159265358979 + 1.00000000000000*I sage: g = K.hom(CC.pi(),phi2) sage: g(1+i+x) 4.14159265358979 - 1.00000000000000*I """ else:
r""" Conversion map from the function field to its constant base field.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: QQ.convert_map_from(K) Conversion map: From: Rational function field in x over Rational Field To: Rational Field
""" r""" TESTS::
sage: K.<x> = FunctionField(QQ) sage: f = QQ.convert_map_from(K) sage: from sage.rings.function_field.maps import FunctionFieldConversionToConstantBaseField sage: isinstance(f, FunctionFieldConversionToConstantBaseField) True
"""
r""" Return the type of this map (a conversion), for the purposes of printing out self.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: QQ.convert_map_from(K) # indirect doctest Conversion map: From: Rational function field in x over Rational Field To: Rational Field
"""
""" EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: QQ(K(1)) # indirect doctest 1
"""
r""" Isomorphism from rational function field to the isomorphic fraction field of a polynomial ring.
EXAMPLES::
sage: K = QQ['x'].fraction_field() sage: L = K.function_field() sage: f = K.coerce_map_from(L); f Isomorphism morphism: From: Rational function field in x over Rational Field To: Fraction Field of Univariate Polynomial Ring in x over Rational Field
.. SEEALSO::
:class:`FractionFieldToFunctionField`
TESTS::
sage: from sage.rings.function_field.maps import FunctionFieldToFractionField sage: isinstance(f, FunctionFieldToFractionField) True sage: TestSuite(f).run()
""" r""" Return the value of this map at ``f``.
EXAMPLES::
sage: K = QQ['x'].fraction_field() sage: L = K.function_field() sage: f = K.coerce_map_from(L) sage: f(~L.gen()) 1/x
"""
r""" Return the inverse map of this isomorphism.
EXAMPLES::
sage: K = QQ['x'].fraction_field() sage: L = K.function_field() sage: f = K.coerce_map_from(L) sage: f.section() Isomorphism morphism: From: Fraction Field of Univariate Polynomial Ring in x over Rational Field To: Rational function field in x over Rational Field
"""
r""" Isomorphism from a fraction field of a polynomial ring to the isomorphic function field.
EXAMPLES::
sage: K = QQ['x'].fraction_field() sage: L = K.function_field() sage: f = L.coerce_map_from(K); f Isomorphism morphism: From: Fraction Field of Univariate Polynomial Ring in x over Rational Field To: Rational function field in x over Rational Field
.. SEEALSO::
:class:`FunctionFieldToFractionField`
TESTS::
sage: from sage.rings.function_field.maps import FractionFieldToFunctionField sage: isinstance(f, FractionFieldToFunctionField) True sage: TestSuite(f).run()
""" r""" Return the value of this morphism at ``f``.
EXAMPLES::
sage: K = QQ['x'].fraction_field() sage: L = K.function_field() sage: f = L.coerce_map_from(K) sage: f(~K.gen()) 1/x """
r""" Return the inverse map of this isomorphism.
EXAMPLES::
sage: K = QQ['x'].fraction_field() sage: L = K.function_field() sage: f = L.coerce_map_from(K) sage: f.section() Isomorphism morphism: From: Rational function field in x over Rational Field To: Fraction Field of Univariate Polynomial Ring in x over Rational Field
""" |