Fake p-adic completions

p-adic fields as completions of absolute number fields

This module realizes a class FakepAdicCompletion which represents a \(p\)-adic number field \(K\). Internally, the \(p\)-adic number field is represented by a number field \(K_0\) together with a discrete valuation \(v_K\) on \(K_0\) which extends the \(p\)-adic valuation \(v_p\) on \(\mathbb{Q}\), such that \(K\) is the completion of \(K_0\) at \(v_K\).

Our main goal is to be able to compute weak \(p\)-adic Galois extensions of \(p\)-adic number fields of large degree. We want to:

  • compute efficiently with general extensions of \(\mathbb{Q}_p\) of high ramification index (up to several hundreds)
  • obtain provably correct results.

Both objectives seem difficult to reach with the existing functionality of Sage. Therefore, we decided to represent a \(p\)-adic number field \(K\) by a pair \((K_0, v_K)\), where \(K_0\) is an absolute number field and \(v_K\) is a discrete valuation on \(K_0\) extending the`p`-adic valuation \(v_p\) on \(\mathbb{Q}\), for some prime \(p\). A more systematic realization of this idea, Julian Rueth’s Sage package completion, should soon be part of Sage.

The first advantage of our approach (which adresses the first point above) is that arithmetic in absolute number fields is reasonably fast in Sage. Moreover, since there are many pairs \((K_0, v_K)\) which have the same completion, we can choose \(K_0\) in such a way that certain operations we use heavily (like evaluation of \(v_K\)) can be done very efficiently. At the moment, we choose \((K_0,v_K)\) such that

  • \(v_K\) is the unique extension of \(v_p\) to \(K_0\),
  • \(K_0/\mathbb{Q}\) is generated by a uniformizer \(\pi_K\) of \(v_K\).

For instance, these assumptions allow us to easily write down a \(p\)-integral basis for \(K_0/\mathbb{Q}\) which is also an integral basis for \(K/\mathbb{Q}_p\). We can also choose \(K_0\) such that the defining polynomial has small coefficients.

The second advantage is that, since for most of our needs we do not really need the \(p\)-adic number field \(K\) explicitly, we can instead work with the henselization \(K^h\) of \((K_0,v_K)\) which is an exact field: an element of \(K^h\) is uniquely determined by a finite amount of data, namely its minimal polynomial over \(\mathbb{Q}\) and a sufficiently precise approximation by an element of \(K_0\). Moreover, \(K^h\) only depends on the \(p\)-adic number field \(K\) but not on our particular choice of \(K_0\).

The main drawback of our approach is that morphisms between two \(p\)-adic number fields \(K\) and \(L\) are somewhat difficult to realize: the problem is that for our particular choice of the underlying number fields \(K_0\) and \(L_0\), there may not exist a nonzero morphism \(K_0\to L_0\) even if \(K\) is a subfield of \(L\).

AUTHORS:

  • Stefan Wewers (2017-08-24): initial version

EXAMPLES:

TO DO:

  • one should try to always find a totally ramified extension (but it is not so clear how to do that)
class mclf.padic_extensions.fake_padic_completions.FakepAdicCompletion(K0, vK)

Bases: SageObject

Return the completion of a number field at a \(p\)-adic valuation.

INPUT:

  • K0 – an absolute number field,
  • vK – a \(p\)-adic valuation on K0.

We assume that \(v_K\) is the unique extension of the \(p\)-adic extension \(v_p\) on \(\mathbb{Q}\) to \(K_0\), and that the standard generator \(\pi_K\) of \(K_0/\mathbb{Q}\) is a uniformizer for \(v_K\). If this is not the case, an error is raised.

absolute_degree()

Return the degree of this p-adic field as an extension of \(\mathbb{Q}_p\).

absolute_inertia_degree()

Return the absolute inertia degree of this p-adic extension.

absolute_ramification_degree()

Return the absolute ramification degree of this p-adic extension.

approximate_factorization(f, only_ramified_factors=False)

Return a list of approximate irreducible factors of f.

INPUT:

  • f – a squarefree univariate polynomial over \(K_0\), the number field underlying this p-adic field \(K\)
  • only_ramified_factors – boolean (default: False)

OUTPUT: a list of pairs \((g,e)\), where \(g\) is an approximate irreducible factor of \(f\) over \(K\) and \(e>=1\). The pairs \((g,e)\) are in bijection with the irreducible factors of \(f\) over \(K\). If \((g,e)\) corresponds to the irreducible factor \(f_i' then \) and \(f_i\) generate the same extension of \(K\). In particular, \(f_i\) and \(g\) have the same degree. Moreover \(e\) is the ramification degree of the extension of \(K\) generated by \(g\) (or \(f_i\)).

If only_ramified_factors is True then all pairs \((g,e)\) with \(e=1\) are omitted.

At the moment we have to assume that \(f\) is monic and integral with respect to \(v_K\) (and hence all roots have nonnegative valuation).

approximate_irreducible_factor(f)

Return one approximate irreducible factor of a given polynomial.

INPUT:

  • f – a squarefree and integral polynomial over the number field K_0 underlying this \(p\)-adic number field \(K\).

Output:

Either a monic poynomial \(g\) over \(K_0\) which is an approximate irreducible factor of \(f\), or a positive integer \(e\).

The polynomial \(g\) is then irreducible over \(K\) and the extension of \(K\) generated by adjoining a root of \(g\) is contained in the splitting field of \(f\).

If an integer \(e\) is retuned, then any tame extension of \(K\) of ramification degree \(e\) is a weak splitting field of \(f\) over \(K\).

TODO:

One should also allow a list of polynomials as input.

base_change_matrix(integral_basis='standard', precision=20)

Return the base change matrix to an integral basis.

INPUT:

  • integral_basis – a string (default: “standard”)
  • precision – a positive integer

OUTPUT:

An invertible \((n,n)\)-matrix \(S\) over \(\mathbb{Q}\) with the following property: for an element \(a\) of \(K_0\), the vector S*a.vector() gives the representation of \(a\) as a linear combination of integral_basis.

TODO:

  • clarify the role of precision in this function
base_valuation()

Return the \(p\)-adic valuation.

characteristic_polynomial(f, g)

Return the characteristic polynomial of an element of a simple extension of \(K\).

INPUT:

  • f, g – univariate monic polynomials over \(K\)

OUTPUT:

the characteristic polynomial of the element \(\beta=g(\alpha)\) with respect to the relative extension \(L=K[\alpha]/K\), where \(\alpha\) is a formal root of \(f\). Of course, \(L\) is a field only if \(f\) i irreducible, but this is not checked, and no error would occur within this function if \(f\) is reducible.

characteristic_polynomial_mod(f, N)

Return the absolute characteristic polynomial of the root of a given polynomial, modulo \(p^N\).

INPUT:

  • f – a monic \(p\)-integral and irreducible polynomial over the underlying number field \(K\)
  • N – a positive integer

OUTPUT:

the absolute characteristic polynomial of a root of \(f\), modulo \(p^N\).

degree()

Return the degree of this p-adic field as an extension of \(\mathbb{Q}_p\).

element_from_vector(v, integral_basis='standard')

Return the element corresponding to a given vector.

INPUT:

  • v – a vector of rational numbers with length equal to the degree of \(K\)
  • integral_basis – a string (default: “standard”)

OUTPUT:

the linear combination of the canonical integral basis of \(K\) corresponding to \(v\).

extension(f, embedding=False)

Return a \(p\)-adic extension such that f has a root in an unramified extension of it.

INPUT:

  • f – a monic univariate polynomial over the number field \(K_0\) underlying this p-adic extension \(K\), which is irreducible over \(K\).
  • embedding – a boolean (default: False)

OUTPUT:

A \(p\)-adic extension \(L\) of \(K\) such that f has a root in an unramified extension of \(L\), or (if embedding is True) the pair \((L,\phi)\), where \(\phi\) is the canonical embedding of \(K\) into \(L\).

If \(K_0\) is the underlying number field, then \(f\in K_0[x]\) is irreducible over the completion \(K\); the resulting finite extension \(L/K\) is a subextension of the extension of \(K\)

\[K[x]/(f).\]

However, the number field \(L_0\) underlying \(L\) is in general not equal to \(K_0[x]/(f)\), and there may not exist any embedding of \(K_0\) into \(L_0\).

generator()

Return the standard generator of this p-adic extension.

inertia_degree()

Return the absolute inertia degree of this p-adic extension.

integral_basis_of_unramified_subfield(precision=5)

Return an (approximate) integral basis of the maximal unramified subfield.

INPUT:

  • precison – a positive integer

OUTPUT:

A list \(\alpha=(\alpha_0,\ldots,\alpha_{m-1})\) of elements of \(K_0\) which approximate (with precision \(p^N\) an integral basis of the maximal unramified subfield.

is_Qp()

Return True if this is the padic-completion of the field of rational numbers.

is_approximate_irreducible_factor(g, f, v=None)

Check whether g is an approximate irreducible factor of f.

INPUT:

  • g: univariate polynomial over the underlying number field \(K_0\)
  • f: univariate polynomial over \(K_0\)
  • v: a MacLane valuation on \(K_0[x]\) approximating g, or None; here approximating means that LimitValuation(v, g) is well-defined.

Output: True if g is an approximate irreducible factor of f, i.e. if g is irreducible over \(K\) and Krasner’s condition is satified, If true, the stem field of g over \(K\) is a subfield of the splitting field of f over \(K\).

Her we say that Krasner’s Condition holds if for some root \(\alpha\) of \(g\) there exists a root \(\beta\) of \(f\) such that \(\alpha\) is \(p\)-adically closer to \(\beta\) than to any other root of \(g\).

Note that if \(\deg(g)=1\) then the condition is nontrivial, even though the conclusion from Krasner’s Lemma is trivial.

matrix(a, integral_basis='standard')

Return the matrix representing the element a.

INPUT:

  • a – an element of the underlying number field of this p-adic extension
  • integral_basis – a string (default: “standard”)

OUTPUT:

The matrix representing the element \(a\) of the underlying number field \(K\), with respect to the canonical \(p\)-integral basis.

minpoly_over_unramified_subextension(N)

Return the minimal polynomial of the standard uniformizer of this \(p\)-adic number field \(K\), relative to the maximal unramified subfield, as a polynomial over \(K\) itself.

INPUT:

  • N – a positive integer

OUTPUT:

A polynomial \(P\) over the number field \(K_0\) underlying \(K\). \(P\) is an approximation (with precision N) of the minimal polynomial of the standard uniformizer \(\pi\) of \(K\), relative to the maximal unramified subfield \(K_{nr}\) of \(K\). Moreover, \(P(\pi)=0\) holds exactly.

If the approximation is sufficient (note: this still has to be made precise) then \(P\) has a root \(\pi_1\) in \(K\) which is also a uniformizer of \(K\), and \(K = K_{nr}[\pi_1]\).

NOTE:

To check that \(P\) is ok, it should suffice to see that \(P\) is “Eisenstein over \(K_nr\)” and has a root in \(K\). Unfortunately, the coefficient will likely not lie in \(K_{nr}\) exactly, and so this criterion probably makes no sense.

normalized_valuation()

Return the normalized valuation on this p-adic field.

Here normalized means that the valuation takes the value \(1\) on a uniformizer.

number_field()

Return the number field representing this p-adic extension.

p()

Return the prime \(p\).

polynomial()

Return the minimal polynomial of the standard generator of \(K\).

ramification_degree()

Return the absolute ramification degree of this p-adic extension.

ramified_extension(n, embedding=False)

Return a purely ramified extension with given ramification degree.

INPUT:

  • n – a positive integer
  • embedding – a boolean (default: False)

OUTPUT:

A finite extension \(L\) of this p-adic field \(K\) such that \(L/K\) is purely ramified, of degree n. If embedding is True then the pair \((L,\phi)\) is returned, where \(\phi:K\to L\) is the canonical embedding.

reduce(a, N)

Return an approximation of a which is reduced modulo \(p^N\).

INPUT:

  • a – an element of the underlying number field \(K\)
  • N – a positive Integer

OUTPUT: an element \(\tilde{a}\) of \(K\) which is congruent to \(a\) modulo \(p^N\), and whose representation in terms of the canonical integral basis of \(K\) has coefficents of the form \(c/p^m\), with \(0\leq c < p^N\) and \(m\geq 0\).

reduce_rational_number(a, N)

Return an approximation of a which is reduced modulo \(p^N\).

INPUT:

  • a – a rational number
  • N – a positive Integer

OUTPUT: an element \(\tilde{a}\) of \(\mathbb{Q}\) which is congruent to \(a\) modulo \(p^N\), of the form \(c/p^m\), with \(0\leq c < p^N\) and \(m\geq 0\).

simplify_irreducible_polynomial(f)

Return a simpler polynomial generating the same extension.

INPUT:

  • f – an univariate polynomial over the underlying number field \(K\) which is integral and irreducible over \(\hat{K}\)

OUTPUT:

A polynomial \(g\) over \(K\) which is irreducible over \(\hat{K}\), and which generates the same extension of \(\hat{K}\) as \(f\).

subfield(alpha, e)

Return a subfield approximated by a given element.

INPUT:

  • alpha – an element of the number field \(K_0\) underlying \(K\)
  • e – a divisor of the absolute degree of \(K_0\)

OUTPUT:

A \(p\)-adic number field \(L\) with ramification index \(e\) which has an embedding into \(K\), or None if no such field can be found.

If \(L\) is a subfield of \(K\) with ramification index \(e\) and \(\alpha_i\) is a sequence of element of \(K_0\) converging to a generator of \(L\), then calling K.subfield(alpha_i,e) will find the subfield \(L\) for \(i\) sufficiently large.

TODO:

One easy improvement could be to not try to embed L into K after every MacLane step, but only for the last step before the degree of v jumps.

uniformizer()

Return the standard unifomizer of this p-adic extension.

valuation()

Return the valuation on the underlying number field of this p-adic extension.

vector(a, integral_basis='standard')

Return the vector corresponding to an element of the underlying number field.

INPUT:

  • a – an element of the number field \(K_0\) underlying this \(p\)-adic number field
  • integral_basis – a string (default: “standard”)

OUTPUT:

the vector of coefficients corresponding to the representation of \(a\) as a linear combination of an integral basis of \(K\).

If integral_basis is “standard” then we use the integral basis

\[p^\lceil i/e \rceil \pi^i, i=0,\ldots,n,\]

where \(\pi\) is the standard uniformizer of \(L\), \(e\) is the absolute ramification degree and \(n\) the absolute degree of \(K\).

If it is mixed then we use the integral basis

\[\pi^i \alpha_j, i=0,\ldots,e-1, j=0,\ldots,n/e-1,\]

where \(\alpha_j\) is an approximation of an integral basis of the maximal unramified subfield.

weak_splitting_field(F)

Return the weak splitting field of a list of polynomials.

INPUT:

  • F – a polynomial over the underlying number field \(K_0\), or a list of polynomials

OUTPUT:

A weak splitting field \(L/K\) of F.

This means that \(F\) splits over an unramified extension of \(L\).

Note:

This function works at the moment only for the base field \(\mathbb{Q}_p\).

TODO:

The following trick should give a massive improvement for large examples: Instead of calling K.approximate_factorization(F) one should calling a new version of K.approximate_irreducible_factor(F, *options*).

The function approximate_irreducible_factor(..) would do a MacLane approximation with require_maximal_degree=True. From the resulting v’s one can then select (according to the options) one which, after enough MacLane steps, gives an approximate irreducible factor.

The point is that the test for being an approximate factor seems to be the most time consuming for large examples. A further speedup could be obtained by

  • either finding a more clever way to test,
  • or by simply doing several MacLane steps before testing.

The options should be set such that factors are chosen accoring to the following rules:

  1. one prefers purely ramified factors over factors with inertia
  2. one prefers purely wild factors over mixed factors
  3. one prefers mixed factors over tame factors

Note that for tame factors the inertia may be ignored, hence they may be considered as purely ramified. However, it is better to leave them until the end, because doing a tame extension is almost trivial. It is not clear to me whether a purely wild factor with inertia is better than a mixed unramified factor.

EXAMPLES:

The following example created an error in a previous version

sage: from mclf import *
sage: v_2 = QQ.valuation(2)
sage: Q2 = FakepAdicCompletion(QQ, v_2)
sage: R.<x> = QQ[]
sage: f = x^12 + 192*x^9 - 5352*x^6 + 33344*x^3 - 293568
sage: L = Q2.weak_splitting_field(f)
sage: L.ramification_degree()
4

Check that non-integral polynomials are allowed as well

sage: Q2.weak_splitting_field(2*x^2 + 1)
2-adic completion of Number Field in pi2 with defining polynomial x^2 + 2