Multiplicative \(p\)-adics

Multiplicative \(p\)-adics over Number Fields

Let \(K\) be a number field and let \(p\) be a finite prime of \(K\), i.e. a prime ideal of its ring of integers. Write \(K_p\) for the field of \(p\)-adic numbers, i.e. the completion of \(K\) at \(p\). This file implementes the unit group \(K_p^*\) of \(K_p\), i.e. the group of multiplicative \(p\)-adics, in the class MultiplicativePAdics.

sage: M = MultiplicativePAdics(QQ, 2); M
Group of multiplicative 2-adics of Rational Field
sage: M.prime()
2
sage: M.number_field()
Rational Field

The corresponding elements are implemented as instances of MultiplicativePAdic. Such an instance \(a\) consists of a center \(x \in K^*\) and a precision \(n \in \ZZ_{\geq 0} \cup \{\infty\}\). The represented subset of \(a\) is the subgroup \(x \cdot U_p(n)\) of \(K_p^*\), where we write \(U_p(n)\) for the \(n\)-th multiplicative subgroup at \(p\):

\[\begin{split}U_p(n) = \begin{cases} O_p^* & \text{ if } n = 0; \\ 1 + p^n O_p & \text{ if } n \in \ZZ_{>0}; \\ \{1\} & \text{ if } n = \infty, \end{cases}\end{split}\]

where \(O_p\) denotes the ring of \(p\)-adic integers, i.e. the valuation ring of \(K_p\).

sage: a = M(3, 4); a
3 * U(4)
sage: a.center()
3
sage: a.precision()
4
sage: [n for n in range(-50, 50) if a.represents(n)]
[-45, -29, -13, 3, 19, 35]

The following multiplicative \(p\)-adic only representes \(1/7\):

sage: b = M(1/7, oo); b
1/7
sage: b.precision()
+Infinity

We keep the center relatively small using HNF-reduction:

sage: c = M(-100, 1); c
4 * U(1)
sage: c.center()
4

Multiplication and division are implemented:

sage: a * b
3/7 * U(4)
sage: b / c
1/28 * U(1)
sage: c / a
4/3 * U(1)

These operations satisfy that the represented subset of the product/quotient equals the product/quotient of the represented subsets of the inputs.

Each multiplicative \(p\)-adic only represents elements of \(K_p^*\) of equal \(p\)-adic valuation.

sage: a.valuation()
0
sage: b.valuation()
0
sage: c.valuation()
2

Let us demonstrate the same functionality as above over a non-trivial number field.

We create a number field, take a prime \(p\) of it above \(11\) and create the corresponding group of multiplicative \(p\)-adics:

sage: K.<a> = NumberField(x^3+x+1)
sage: p = K.prime_above(11)
sage: M = MultiplicativePAdics(K, p); M
Group of multiplicative (11, a^2 - 4)-adics of Number Field in a with defining polynomial x^3 + x + 1
sage: M.prime()
Fractional ideal (a - 2)
sage: M.number_field()
Number Field in a with defining polynomial x^3 + x + 1

We create some multiplicative \(p\)-adics and perform arithmetic. Note that the centers are being “reduced” automatically (although for very small input values the reduced center may actually be bigger).

sage: b = M(a^2-4, 0); b
55*a^2 * U(0)
sage: b.valuation()
1
sage: c = M(97, 2); c
-39*a^2 * U(2)
sage: b * c
11*a^2 * U(0)
sage: b / c
(-47*a^2 - 16/39) * U(0)

As the the open multiplicative subgroups \(\{U_p(n) \mid n \in \ZZ_{\geq 0}\}\) form a basis of open neighborhoods of \(1\) in \(K_p^*\) and \(K^*\) lies dense in \(K_p^*\), we can approximate any \(\alpha \in K_p^*\) arbitrarily closely by a multiplicative \(p\)-adic in the following sense: for every neighborhood \(U\) of \(\alpha\) in \(K_p^*\), there exists a multiplicative \(p\)-adic representing \(\alpha\) and with represented subset contained in \(U\).

See also

idele

REFERENCES:

[Her2021] Mathé Hertogh, Computing with adèles and idèles, master’s thesis, Leiden University, 2021.

This implementation of multiplicative \(p\)-adics is based on [Her2021]. An extensive exposition of properties, design choices and two applications can be found there.

AUTHORS:

  • Mathé Hertogh (2021-07): initial version based on [Her2021]

adeles.multiplicative_padic.MulPAdic(p, data)

Create a multiplicative p-adic based on data

INPUT:

  • p – a finite prime of some number field, as described by is_finite_prime(); determines the prime \(p\) of the multiplicative \(p\)-adic we create

  • data – data from which to construct the multiplicative p-adic. This can be:

    • a single value from which a multiplicative p-adic can be created, such as a non-zero element of the base number field or a multiplicative p-adic itself;

    • an iterable of length 2, where the first value denotes a center and the second value denotes a precision, i.e. data[0] is a non-zero element of the base number field and data[1] is a non-negative integer or Infinity.

EXAMPLES:

sage: a = MulPAdic(2, (2/3, 5))
sage: a, a.parent()
(2/3 * U(5), Group of multiplicative 2-adics of Rational Field)
sage: b = MulPAdic(7, 5/7)
sage: b, b.parent()
(5/7, Group of multiplicative 7-adics of Rational Field)
sage: c = MulPAdic(7, b)
sage: c, c.parent()
(5/7, Group of multiplicative 7-adics of Rational Field)
sage: K.<a> = NumberField(x^2-5)
sage: b = MulPAdic(a, (a+1, 3))
sage: b, b.parent()
((a + 1) * U(3),
 Group of multiplicative (5, 1/2*a + 5/2)-adics of Number Field in a with defining polynomial x^2 - 5)
sage: c = MulPAdic(K.ideal(3), [a/10, 0])
sage: c, c.parent()
(1/10*a * U(0),
 Group of multiplicative (3)-adics of Number Field in a with defining polynomial x^2 - 5)

TESTS:

sage: MulPAdic(4, 1) Traceback (most recent call last): … ValueError: p must be a finite prime of a number field sage: MulPAdic(5, oo) Traceback (most recent call last): … TypeError: can’t construct a multiplicative p-adic from +Infinity sage: MulPAdic(3, [“blah”]) Traceback (most recent call last): … TypeError: can’t construct a multiplicative p-adic from [‘blah’]

class adeles.multiplicative_padic.MultiplicativePAdic(parent, center, prec)

Bases: sage.structure.element.MultiplicativeGroupElement

Multiplicative \(p\)-adic, for \(p\) a finite prime of a number field

REFERENCES:

Section 3.5 of [Her2021].

_mul_(other)

Return the product of this multiplicative \(p\)-adic and other

The product of two multiplicative \(p\)-adics \(a\) and \(b\) is a multiplicative \(p\)-adic with represented subset equal to the product of the represented subsets of \(a\) and \(b\).

EXAMPLES:

sage: M = MultiplicativePAdics(QQ, 5)
sage: M(1/2, 3) * M(1/3, 10)
1/6 * U(3)
sage: M(5/9, 11) * M(3)
5/3 * U(11)
sage: K.<a> = NumberField(x^2+1)
sage: M = MultiplicativePAdics(K, 3)
sage: M(1/3, 4) * M(a, 8)
1/3*a * U(4)
sage: M(1, 0) * M(-1, 3)
-1 * U(0)

REFERENCES:

Section Arithmetic in Section 3.5 of [Her2021].

_div_(other)

Return the quotient of this multiplicative \(p\)-adic by other

This quotient is defined to be self * other.inverse().

EXAMPLES:

sage: M = MultiplicativePAdics(QQ, 2)
sage: M(2, 5) / M(4, 7)
1/2 * U(5)
sage: M(1)/M(4,7)
1/4 * U(7)
sage: K.<a> = NumberField(x^7-10)
sage: M = MultiplicativePAdics(K, K.prime_above(23))
sage: M(2*a) / M(a)
2
sage: M(a^5, 2) / M(a^4, 3)
49/976 * U(2)

REFERENCES:

Section Arithmetic in Section 3.5 of [Her2021].

_richcmp_(other, op)

Return the result of operator op applied to self and other

Only equality and inequality are implented.

Two representations of multipicative \(p\)-adics are considered equal if their represented subsets have non-empty intersection. This is equivalent to one of them being included in the other.

Inequality is defined as not being equal, i.e. having disjoint represented subsets.

EXAMPLES:

sage: M = MultiplicativePAdics(QQ, 2)
sage: M(17, 10) == M(1, 4)
True
sage: M(17, 10) == M(1, 5)
False
sage: M(17, 10) != M(1, 5)
True
sage: K.<a> = NumberField(x^2-x-1)
sage: M = MultiplicativePAdics(K, 7)
sage: M(1/2, 2) == M(99/2, 3)
True
sage: M(1/2, 3) == M(99/2, 3)
False
sage: M(a, 0) == 3*a+1
True

REFERENCES:

Section 5.4 of [Her2021].

center()

Return the center of this multiplicative \(p\)-adic

EXAMPLES:

sage: M = MultiplicativePAdics(QQ, 97)
sage: M(-1, 1).center()
96
inverse()

Return the product of this multiplicative \(p\)-adic and other

The inverse of this multiplicative \(p\)-adic is the multiplicative \(p\)-adic with the same precision and whose center is inversed.

EXAMPLES:

sage: M = MultiplicativePAdics(QQ, 7)
sage: M(1/2, 5).inverse()
2 * U(5)
sage: M(2/11, oo).inverse()
11/2
sage: K.<a> = NumberField(x^3+10)
sage: M = MultiplicativePAdics(K, K.ideal(11, a-1))
sage: M(a^2, 0).inverse()
-1/10*a * U(0)
sage: M(-a/3, oo).inverse()
3/10*a^2

REFERENCES:

Section Arithmetic in Section 3.5 of [Her2021].

prec()

Return the precision of this multiplicative \(p\)-adic

EXAMPLES:

sage: M = MultiplicativePAdics(QQ, 97)
sage: M(79, 0).precision()
0
sage: M(79, oo).precision()
+Infinity
precision()

Return the precision of this multiplicative \(p\)-adic

EXAMPLES:

sage: M = MultiplicativePAdics(QQ, 97)
sage: M(79, 20).precision()
20
represents(element)

Return whether or not this multipicative \(p\)-adic represents element

This multiplicative \(p\)-adic represents all elements in its represented subset, which is the subset subset \(x \cdot U_p^n\) of \(K_p^*\), where

  • \(K\) denotes our base number field;

  • \(K_p^*\) denotes the unit group of the completion of \(K\) at \(p\), i.e. the multiplicative group of the field of \(p\)-adic numbers;

  • \(x \in K^*\) denotes self.center();

  • \(n \in \ZZ_{\geq 0} \cup \{\infty\}\) denotes self.precision();

  • \(U_p(n)\) denotes the \(n\)-th multiplicative subgroup at \(p\), i.e. the subgroup

    \[\begin{split}U_p(n) = \begin{cases} O_p^* & \text{ if } n = 0; \\ 1 + p^n O_p & \text{ if } n \in \ZZ_{>0}; \\ \{1\} & \text{ if } n = \infty, \end{cases}\end{split}\]

    with \(O_p\) denoting the ring of \(p\)-adic integers.

EXAMPLES:

sage: M = MultiplicativePAdics(QQ, 3)
sage: a = M(1, 3)
sage: X = sorted(set([m/n for m in srange(-18, 18) for n in srange(1, 18)]))
sage: [x for x in X if a.represents(x)]
[-17/10, -16/11, -14/13, -13/14, -11/16, -10/17, 1]
sage: -16/11 - 1 # does this really have valuation at least 3 at 3? (yes)
-27/11
sage: b = M(2/3, 3)
sage: [x for x in X if b.represents(x)]
[-17/15, 2/3]
sage: (-17/15)/(2/3)-1 # this should have valuation at least 3 at 3
-27/10
sage: M(9, 0).represents(9/100)
True
sage: K.<a> = NumberField(x^2+1)
sage: M = MultiplicativePAdics(K, a+1)
sage: b = M(a, 6)
sage: Y = sorted(set([m/n for m in srange(-7, 7) for n in srange(1, 7)]))
sage: R = [y*a+z for y in Y for z in Y if b.represents(y*a+z)]; R
[-7*a, -5/3*a, -3/5*a, a]
sage: all([(r/a-1).valuation(a+1) >= 6 for r in R])
True
valuation()

Return the valuation at \(p\) of this multipicative \(p\)-adic

EXAMPLES:

sage: M = MultiplicativePAdics(QQ, 5)
sage: M(1/25, 10).valuation()
-2
sage: K.<a> = NumberField(x^2+1)
sage: M = MultiplicativePAdics(K, a+1)
sage: M(4, 100).valuation()
4
class adeles.multiplicative_padic.MultiplicativePAdics(K, p)

Bases: sage.structure.unique_representation.UniqueRepresentation, sage.groups.group.Group

Group of Multiplicative \(p\)-adics, for \(p\) a finite prime of a number field

REFERENCES:

Section 3.5 of [Her2021].

_element_constructor_(center, prec=+ Infinity)

Construct a multiplicative \(p\)-adic

INPUT:

  • center – non-zero element of our base number field; the center

  • prec – non-negative integer of Infinity; the precision

EXAMPLES:

sage: M = MultiplicativePAdics(QQ, 2)
sage: M(3/4, 10)
3/4 * U(10)
sage: M(79)
79
sage: K.<a> = NumberField(x^2+21)
sage: M = MultiplicativePAdics(K, K.ideal(5, a+3))
sage: M(-a, 0)
-a * U(0)
sage: M(a+1, 5)
-661*a * U(5)
sage: M(a/3)
1/3*a
Element

alias of MultiplicativePAdic

gen(n=0)

Return the n-th generator of this group

As this group has only one generator, we only accept n == 0.

INPUT:

  • n – the index of the generator to return (default: 0); must be zero

EXAMPLES:

sage: MultiplicativePAdics(QQ, 7).gen()
1
sage: MultiplicativePAdics(QQ, 7).gen(0)
1

TESTS:

sage: MultiplicativePAdics(QQ, 7).gen(1)
Traceback (most recent call last):
...
IndexError: n must be 0
gens()

Return a tuple of generators of this group, which is (1,)

EXAMPLES:

sage: MultiplicativePAdics(QQ, 3).gens()
(1,)
is_abelian()

Return True, indicating that this group is abelian

EXAMPLES:

sage: MultiplicativePAdics(QQ, 2).is_abelian()
True
is_commutative()

Return True, indicating that this group is commutative

EXAMPLES:

sage: MultiplicativePAdics(QQ, 5).is_commutative()
True
is_exact()

Return False, indicating that doing arithmetic can lead to precision loss

EXAMPLES:

sage: MultiplicativePAdics(QQ, 2).is_exact()
False
is_finite()

Return False, indicating that this group is not finite

EXAMPLES:

sage: MultiplicativePAdics(QQ, 17).is_finite()
False
ngens()

Return the number of generators of this group, which is \(1\)

EXAMPLES:

sage: MultiplicativePAdics(QQ, 97).ngens()
1
number_field()

Return the base number field of this group of multiplicative \(p\)-adics

EXAMPLES:

sage: K.<a> = NumberField(x^4+5)
sage: M = MultiplicativePAdics(K, K.ideal(7, a+2))
sage: M.number_field()
Number Field in a with defining polynomial x^4 + 5
order()

Return the order of this group, which is Infinity

The order of a group is its number of elements.

EXAMPLES:

sage: MultiplicativePAdics(QQ, 5).order()
+Infinity
prime()

Return the prime \(p\) of this group of multiplicative \(p\)-adics

This group is the unit group of the completion of a number field \(K\) at a finite prime \(p\) of \(K\). We return this \(p\).

If our base number field is \(\QQ\), then \(p\) is a prime number in \(\ZZ\). Otherwise \(p\) is a prime ideal of the ring of integers of \(K\).

EXAMPLES:

sage: MultiplicativePAdics(QQ, 17).prime()
17
sage: K.<a> = NumberField(x^2-x-1)
sage: MultiplicativePAdics(K, 3).prime()
Fractional ideal (3)
prime_name()

Return a string representing our prime, as returned by prime()

EXAMPLES:

sage: MultiplicativePAdics(QQ, 5).prime_name()
'5'
sage: K.<a> = NumberField(x^2-71)
sage: MultiplicativePAdics(K, 3).prime_name()
'(3)'
sage: MultiplicativePAdics(K, -a+8).prime_name()
'(7, a + 6)'
random_element()

Return a random element of this group

EXAMPLES:

sage: [M.random_element() for n in range(8)] # random
[59048 * U(10),
 5/2 * U(0),
 8 * U(15),
 2 * U(1),
 1/15 * U(1),
 7,
 1/2 * U(5),
 8 * U(2)]
sage: K.<a> = NumberField(x^3-7)
sage: M = MultiplicativePAdics(K, K.prime_above(2))
sage: [M.random_element() for n in range(8)] # random
[a^2 * U(1),
 a^2 + 1/13*a - 3,
 -15/44*a^2 * U(2),
 -1/40*a^2,
 1/2*a * U(0),
 a^2 * U(1),
 -1/8*a * U(3),
 1/2*a - 1]
some_elements()

Return some elements of this group

EXAMPLES:

sage: MultiplicativePAdics(QQ, 5).some_elements()
[2/3 * U(6), 1, 1 * U(0), 2, 121/5 * U(3)]
sage: K.<a> = CyclotomicField(17)
sage: MultiplicativePAdics(K, K.prime_above(17)).some_elements()
[(5*a^15 - 6*a^14 - 4*a^13 - 8*a^12 + a^11 - 4*a^10 - 1/3*a) * U(6),
 1,
 a^15 * U(0),
 a + 1,
 (-6*a^15 + 8*a^14 - 3*a^13 + 1/5*a) * U(3)]
adeles.multiplicative_padic.is_finite_prime(p, K)

Return whether or not p is a finite prime of the number field K

By a finite prime of \(\QQ\) we mean a prime number. For K a non-trivial number field, a finite prime of K is a prime ideal of the ring of integers of K

INPUT:

  • p – any object; p will be checked to see if it is a finite prime of K

  • K – a number field

EXAMPLES:

sage: is_finite_prime(2, QQ)
True
sage: is_finite_prime(10, QQ)
False
sage: is_finite_prime(ZZ.ideal(5), QQ)
False
sage: K.<a> = NumberField(x^2+5)
sage: is_finite_prime(2, K) # 2 ramifies
False
sage: is_finite_prime(K.ideal(2, a+1), K)
True
sage: is_finite_prime(11, K) # 11 is inert
True

TESTS:

sage: is_finite_prime("blah", QQ)
False
sage: is_finite_prime([], K)
False