Small primes of degree one#

Iterator for finding several primes of absolute degree one of a number field of small prime norm.

ALGORITHM:

Let \(P\) denote the product of some set of prime numbers. (In practice, we use the product of the first 10000 primes, because Pari computes this many by default.)

Let \(K\) be a number field and let \(f(x)\) be a polynomial defining \(K\) over the rational field. Let \(\alpha\) be a root of \(f\) in \(K\).

We know that \([ O_K : \ZZ[\alpha] ]^2 = | \Delta(f(x)) / \Delta(O_K) |\), where \(\Delta\) denotes the discriminant (see, for example, Proposition 4.4.4, p165 of [Coh1993]). Therefore, after discarding primes dividing \(\Delta(f(x))\) (this includes all ramified primes), any integer \(n\) such that \(\gcd(f(n), P) > 0\) yields a prime \(p | P\) such that \(f(x)\) has a root modulo \(p\). By the condition on discriminants, this root is a single root. As is well known (see, for example Theorem 4.8.13, p199 of [Coh1993]), the ideal generated by \((p, \alpha - n)\) is prime and of degree one.

Warning

It is possible that there are no primes of \(K\) of absolute degree one of small prime norm, and it is possible that this algorithm will not find any primes of small norm.

Todo

There are situations when this will fail. There are questions of finding primes of relative degree one. There are questions of finding primes of exact degree larger than one. In short, if you can contribute, please do!

EXAMPLES:

sage: x = ZZ['x'].gen()
sage: F.<a> = NumberField(x^2 - 2)
sage: Ps = F.primes_of_degree_one_list(3)
sage: Ps # random
[Fractional ideal (2*a + 1), Fractional ideal (-3*a + 1), Fractional ideal (-a + 5)]
sage: [ P.norm() for P in Ps ] # random
[7, 17, 23]
sage: all(ZZ(P.norm()).is_prime() for P in Ps)
True
sage: all(P.residue_class_degree() == 1 for P in Ps)
True
>>> from sage.all import *
>>> x = ZZ['x'].gen()
>>> F = NumberField(x**Integer(2) - Integer(2), names=('a',)); (a,) = F._first_ngens(1)
>>> Ps = F.primes_of_degree_one_list(Integer(3))
>>> Ps # random
[Fractional ideal (2*a + 1), Fractional ideal (-3*a + 1), Fractional ideal (-a + 5)]
>>> [ P.norm() for P in Ps ] # random
[7, 17, 23]
>>> all(ZZ(P.norm()).is_prime() for P in Ps)
True
>>> all(P.residue_class_degree() == Integer(1) for P in Ps)
True

The next two examples are for relative number fields.:

sage: L.<b> = F.extension(x^3 - a)
sage: Ps = L.primes_of_degree_one_list(3)
sage: Ps # random
[Fractional ideal (17, b - 5), Fractional ideal (23, b - 4), Fractional ideal (31, b - 2)]
sage: [ P.absolute_norm() for P in Ps ] # random
[17, 23, 31]
sage: all(ZZ(P.absolute_norm()).is_prime() for P in Ps)
True
sage: all(P.residue_class_degree() == 1 for P in Ps)
True
sage: M.<c> = NumberField(x^2 - x*b^2 + b)
sage: Ps = M.primes_of_degree_one_list(3)
sage: Ps # random
[Fractional ideal (17, c - 2), Fractional ideal (c - 1), Fractional ideal (41, c + 15)]
sage: [ P.absolute_norm() for P in Ps ] # random
[17, 31, 41]
sage: all(ZZ(P.absolute_norm()).is_prime() for P in Ps)
True
sage: all(P.residue_class_degree() == 1 for P in Ps)
True
>>> from sage.all import *
>>> L = F.extension(x**Integer(3) - a, names=('b',)); (b,) = L._first_ngens(1)
>>> Ps = L.primes_of_degree_one_list(Integer(3))
>>> Ps # random
[Fractional ideal (17, b - 5), Fractional ideal (23, b - 4), Fractional ideal (31, b - 2)]
>>> [ P.absolute_norm() for P in Ps ] # random
[17, 23, 31]
>>> all(ZZ(P.absolute_norm()).is_prime() for P in Ps)
True
>>> all(P.residue_class_degree() == Integer(1) for P in Ps)
True
>>> M = NumberField(x**Integer(2) - x*b**Integer(2) + b, names=('c',)); (c,) = M._first_ngens(1)
>>> Ps = M.primes_of_degree_one_list(Integer(3))
>>> Ps # random
[Fractional ideal (17, c - 2), Fractional ideal (c - 1), Fractional ideal (41, c + 15)]
>>> [ P.absolute_norm() for P in Ps ] # random
[17, 31, 41]
>>> all(ZZ(P.absolute_norm()).is_prime() for P in Ps)
True
>>> all(P.residue_class_degree() == Integer(1) for P in Ps)
True

AUTHORS:

  • Nick Alexander (2008): initial version

  • David Loeffler (2009): fixed a bug with relative fields

  • Maarten Derickx (2017): fixed a bug with number fields not generated by an integral element

class sage.rings.number_field.small_primes_of_degree_one.Small_primes_of_degree_one_iter(field, num_integer_primes=10000, max_iterations=100)[source]#

Bases: object

Iterator that finds primes of a number field of absolute degree one and bounded small prime norm.

INPUT:

  • field – a NumberField.

  • num_integer_primes – (default: 10000) an integer. We try to find primes of absolute norm no greater than the num_integer_primes-th prime number. For example, if num_integer_primes is 2, the largest norm found will be 3, since the second prime is 3.

  • max_iterations – (default: 100) an integer. We test max_iterations integers to find small primes before raising StopIteration.

AUTHOR:

  • Nick Alexander

next()[source]#

Return a prime of absolute degree one of small prime norm.

Raises StopIteration if such a prime cannot be easily found.

EXAMPLES:

sage: x = QQ['x'].gen()
sage: K.<a> = NumberField(x^2 - 3)
sage: it = K.primes_of_degree_one_iter()
sage: [ next(it) for i in range(3) ] # random
[Fractional ideal (2*a + 1), Fractional ideal (-a + 4), Fractional ideal (3*a + 2)]
>>> from sage.all import *
>>> x = QQ['x'].gen()
>>> K = NumberField(x**Integer(2) - Integer(3), names=('a',)); (a,) = K._first_ngens(1)
>>> it = K.primes_of_degree_one_iter()
>>> [ next(it) for i in range(Integer(3)) ] # random
[Fractional ideal (2*a + 1), Fractional ideal (-a + 4), Fractional ideal (3*a + 2)]