Coverage for local/lib/python2.7/site-packages/sage/rings/valuation/mapped_valuation.py : 97%

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 -*- Valuations which are implemented through a map to another valuation
EXAMPLES:
Extensions of valuations over finite field extensions `L=K[x]/(G)` are realized through an infinite valuation on `K[x]` which maps `G` to infinity::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extension(L); w (x)-adic valuation
sage: w._base_valuation [ Gauss valuation induced by (x)-adic valuation, v(y) = 1/2 , … ]
AUTHORS:
- Julian Rüth (2016-11-10): initial version
""" #***************************************************************************** # Copyright (C) 2016-2017 Julian Rüth <julian.rueth@fsfe.org> # # 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 valuation which is implemented through another proxy "base" valuation.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extension(L); w (x)-adic valuation
TESTS::
sage: TestSuite(w).run() # long time
""" r""" .. TODO::
It is annoying that we have to wrap any possible method on ``base_valuation`` in this class. It would be nice if this would somehow be done automagically, e.g., by adding annotations to the methods in ``base_valuation`` that explain which parameters and return values need to be mapped and how.
TESTS::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x^2 + 1)
sage: v = K.valuation(0) sage: w = v.extension(L); w (x)-adic valuation sage: from sage.rings.valuation.mapped_valuation import MappedValuation_base sage: isinstance(w, MappedValuation_base) True
"""
def _repr_(self): r""" Return a printable representation of this valuation.
Subclasses must override this method.
EXAMPLES::
sage: K = QQ sage: R.<t> = K[] sage: L.<t> = K.extension(t^2 + 1) sage: v = valuations.pAdicValuation(QQ, 2) sage: v.extension(L) # indirect doctest 2-adic valuation
"""
r""" Return the residue ring of this valuation.
EXAMPLES::
sage: K = QQ sage: R.<t> = K[] sage: L.<t> = K.extension(t^2 + 1) sage: v = valuations.pAdicValuation(QQ, 2) sage: v.extension(L).residue_ring() Finite Field of size 2
"""
r""" Return a uniformizing element of this valuation.
EXAMPLES::
sage: K = QQ sage: R.<t> = K[] sage: L.<t> = K.extension(t^2 + 1) sage: v = valuations.pAdicValuation(QQ, 2) sage: v.extension(L).uniformizer() t + 1
"""
r""" Return ``f`` as an element in the domain of ``_base_valuation``.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extensions(L)[0] sage: w._to_base_domain(y).parent() Univariate Polynomial Ring in y over Rational function field in x over Rational Field
""" return self._base_valuation.domain().coerce(f)
r""" Return ``f`` as an element in the domain of this valuation.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extension(L) sage: w._from_base_domain(w._base_valuation.domain().gen()).parent() Function field in y defined by y^2 - x
"""
r""" Evaluate this valuation at ``f``.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extension(L) sage: w(y) # indirect doctest 1/2
"""
r""" Return the reduction of ``f`` in the :meth:`~sage.rings.valuation.valuation_space.DiscretePseudoValuationSpace.ElementMethods.residue_field` of this valuation.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - (x - 2))
sage: v = K.valuation(0) sage: w = v.extension(L) sage: w.reduce(y) u1
"""
r""" Lift ``F`` from the :meth:`~sage.rings.valuation.valuation_space.DiscretePseudoValuationSpace.ElementMethods.residue_field` of this valuation into its domain.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(2) sage: w = v.extension(L) sage: w.lift(w.residue_field().gen()) y
"""
r""" Return ``F``, an element of :meth:`~sage.rings.valuation.valuation_space.DiscretePseudoValuationSpace.ElementMethods.residue_ring`, as an element of the residue ring of the ``_base_valuation``.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extensions(L)[0] sage: w._to_base_residue_ring(1) 1
"""
r""" Return ``F``, an element of the residue ring of ``_base_valuation``, as an element of this valuation's :meth:`~sage.rings.valuation.valuation_space.DiscretePseudoValuationSpace.ElementMethods.residue_ring`.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extensions(L)[0] sage: w._from_base_residue_ring(1) 1
"""
r""" Check the correctness of :meth:`to_base_domain` and :meth:`from_base_domain`.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extensions(L)[0] sage: w._test_to_from_base_domain()
"""
# note that the converse might not be true
r""" Check the correctness of :meth:`to_base_residue_ring` and :meth:`from_base_residue_ring`.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extensions(L)[0] sage: w._test_to_from_base_residue_ring()
"""
r""" A valuation on a quotient of the form `L=K[x]/(G)` with an irreducible `G` which is internally backed by a pseudo-valuations on `K[x]` which sends `G` to infinity.
INPUT:
- ``parent`` -- the containing valuation space (usually the space of discrete valuations on `L`)
- ``base_valuation`` -- an infinite valuation on `K[x]` which takes `G` to infinity
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extension(L); w (x)-adic valuation
""" r""" TESTS::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x)
sage: v = K.valuation(0) sage: w = v.extension(L) sage: from sage.rings.valuation.mapped_valuation import FiniteExtensionFromInfiniteValuation sage: isinstance(w, FiniteExtensionFromInfiniteValuation) True sage: TestSuite(w).run() # long time
"""
r""" Return whether this valuation is indistinguishable from ``other``.
EXAMPLES::
sage: K = QQ sage: R.<t> = K[] sage: L.<t> = K.extension(t^2 + 1) sage: v = valuations.pAdicValuation(QQ, 2) sage: w = v.extension(L) sage: ww = v.extension(L) sage: w == ww # indirect doctest True
""" and self._base_valuation == other._base_valuation)
r""" Return the restriction of this valuation to ``ring``.
EXAMPLES::
sage: K = QQ sage: R.<t> = K[] sage: L.<t> = K.extension(t^2 + 1) sage: v = valuations.pAdicValuation(QQ, 2) sage: w = v.extension(L) sage: w.restriction(K) is v True
"""
r""" Return an element in the domain of this valuation which has positive valuation with respect to this valuation and higher valuation with respect to this valuation than with respect to ``other``.
EXAMPLES::
sage: K = QQ sage: R.<t> = K[] sage: L.<t> = K.extension(t^2 + 1) sage: v = valuations.pAdicValuation(QQ, 2) sage: w = v.extension(L) sage: v = valuations.pAdicValuation(QQ, 5) sage: u,uu = v.extensions(L) sage: u.separating_element([w,uu]) # indirect doctest 1/20*t + 7/20
""" super(FiniteExtensionFromInfiniteValuation, self)._weakly_separating_element(other)
r""" Return an estimate on the coefficient size of ``x``.
The number returned is an estimate on the factor between the number of bits used by ``x`` and the minimal number of bits used by an element congruent to ``x``.
This is used by :meth:`simplify` to decide whether simplification of coefficients is going to lead to a significant shrinking of the coefficients of ``x``.
EXAMPLES::
sage: K = QQ sage: R.<t> = K[] sage: L.<t> = K.extension(t^2 + 1) sage: v = valuations.pAdicValuation(QQ, 2) sage: w = v.extension(L) sage: w._relative_size(1024*t + 1024) 6
"""
r""" Return a simplified version of ``x``.
Produce an element which differs from ``x`` by an element of valuation strictly greater than the valuation of ``x`` (or strictly greater than ``error`` if set.)
EXAMPLES::
sage: K = QQ sage: R.<t> = K[] sage: L.<t> = K.extension(t^2 + 1) sage: v = valuations.pAdicValuation(QQ, 5) sage: u,uu = v.extensions(L) sage: f = 125*t + 1 sage: u.simplify(f, error=u(f), force=True) 1
"""
r""" Return an lower bound of this valuation at ``x``.
Use this method to get an approximation of the valuation of ``x`` when speed is more important than accuracy.
EXAMPLES::
sage: K = QQ sage: R.<t> = K[] sage: L.<t> = K.extension(t^2 + 1) sage: v = valuations.pAdicValuation(QQ, 5) sage: u,uu = v.extensions(L) sage: u.lower_bound(t + 2) 0 sage: u(t + 2) 1
"""
r""" Return an upper bound of this valuation at ``x``.
Use this method to get an approximation of the valuation of ``x`` when speed is more important than accuracy.
EXAMPLES::
sage: K = QQ sage: R.<t> = K[] sage: L.<t> = K.extension(t^2 + 1) sage: v = valuations.pAdicValuation(QQ, 5) sage: u,uu = v.extensions(L) sage: u.upper_bound(t + 2) >= 1 True sage: u(t + 2) 1
"""
r""" An extension of a valuation on a finite field extensions `L=K[x]/(G)` which is induced by an infinite limit valuation on `K[x]`.
EXAMPLES::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x) sage: v = K.valuation(1) sage: w = v.extensions(L); w [[ (x - 1)-adic valuation, v(y + 1) = 1 ]-adic valuation, [ (x - 1)-adic valuation, v(y - 1) = 1 ]-adic valuation]
TESTS::
sage: TestSuite(w[0]).run() # long time sage: TestSuite(w[1]).run() # long time
""" r""" EXAMPLES:
Note that this implementation is also used when the underlying limit is only taken over a finite sequence of valuations::
sage: K.<x> = FunctionField(QQ) sage: R.<y> = K[] sage: L.<y> = K.extension(y^2 - x) sage: v = K.valuation(2) sage: w = v.extension(L); w (x - 2)-adic valuation sage: from sage.rings.valuation.mapped_valuation import FiniteExtensionFromLimitValuation sage: isinstance(w, FiniteExtensionFromLimitValuation) True
""" # keep track of all extensions to this field extension so we can print # this valuation nicely, dropping any unnecessary information
""" Return a printable representation of this valuation.
EXAMPLES::
sage: valuations.pAdicValuation(GaussianIntegers().fraction_field(), 2) # indirect doctest 2-adic valuation
""" # print the minimal information that singles out this valuation from all approximants return "%s-adic valuation"%(self._base_valuation)
|