Lecture Notes in Computer Science Commenced Publication in 1973 Founding and Former Series Editors: Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen
Editorial Board David Hutchison Lancaster University, UK Takeo Kanade Carnegie Mellon University, Pittsburgh, PA, USA Josef Kittler University of Surrey, Guildford, UK Jon M. Kleinberg Cornell University, Ithaca, NY, USA Alfred Kobsa University of California, Irvine, CA, USA Friedemann Mattern ETH Zurich, Switzerland John C. Mitchell Stanford University, CA, USA Moni Naor Weizmann Institute of Science, Rehovot, Israel Oscar Nierstrasz University of Bern, Switzerland C. Pandu Rangan Indian Institute of Technology, Madras, India Bernhard Steffen TU Dortmund University, Germany Madhu Sudan Microsoft Research, Cambridge, MA, USA Demetri Terzopoulos University of California, Los Angeles, CA, USA Doug Tygar University of California, Berkeley, CA, USA Gerhard Weikum Max-Planck Institute of Computer Science, Saarbruecken, Germany
6197
Guillaume Hanrot François Morain Emmanuel Thomé (Eds.)
Algorithmic Number Theory 9th International Symposium, ANTS-IX Nancy, France, July 19-23, 2010 Proceedings
13
Volume Editors Guillaume Hanrot LIP/ENS-Lyon, 46, allée d’Italie 69364 Lyon Cedex 07, France E-mail:
[email protected] François Morain LIX/École polytechnique 91128 Palaiseau Cedex, France E-mail:
[email protected] Emmanuel Thomé INRIA Nancy, projet CARAMEL 615 rue du jardin botanique 54602 Villers-lès-Nancy Cedex, France E-mail:
[email protected]
Library of Congress Control Number: 2010930653 CR Subject Classification (1998): F.2, G.2, E.3, I.1 LNCS Sublibrary: SL 1 – Theoretical Computer Science and General Issues ISSN ISBN-10 ISBN-13
0302-9743 3-642-14517-5 Springer Berlin Heidelberg New York 978-3-642-14517-9 Springer Berlin Heidelberg New York
This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer. Violations are liable to prosecution under the German Copyright Law. springer.com © Springer-Verlag Berlin Heidelberg 2010 Printed in Germany Typesetting: Camera-ready by author, data conversion by Scientific Publishing Services, Chennai, India Printed on acid-free paper 06/3180
Preface
ANTS-IX was the ninth edition of the biennial International Symposium on Algorithmic Number Theory. The first edition of this symposium was held at Cornell University in 1994. ANTS-IX was held July 19-23, 2010 at INRIA in Nancy, France. The ANTS-IX Program Committee consisted of 12 members whose names are listed on the next page. The selection of the accepted papers among the submissions was made from mid-January to end of March 2010. Each paper was thoroughly reviewed by at least two experts, including a Program Committee member. The Program Committee selected 25 high-quality articles, which are excellent representatives of the current state of the art in various areas of algorithmic number theory. The Selfridge Prize in computational number theory was awarded to the authors of the best contributed paper presented at the conference. We gratefully thank the authors of all submitted papers for their hard work which made the selection of a varied program possible. We also thank the authors of the accepted papers for their cooperation in the timely production of the revised versions. Each submitted paper was presented by one of its co-authors at the conference. Besides contributed papers, the conference included five invited talks by Henri Darmon (McGill University), Jean-Fran¸cois Mestre (Universit´e Paris 7), Gabriele Nebe (RWTH Aachen), Carl Pomerance (Dartmouth College), and Oded Regev (Tel-Aviv University). We thank the invited speakers for having been able to provide abstracts of their talk, which are reproduced in this volume. This list of invited speakers originally included Fritz Grunewald (HHU D¨ usseldorf), who unfortunately passed away on March 21, 2010, four months before the conference. A special lecture was held to honor his memory. The conference organizers wish to thank all the people who made the conference possible. In particular, we gratefully acknowledge the support of the funding institutions. May 2010
Guillaume Hanrot Fran¸cois Morain Emmanuel Thom´e
Organization
Organizing Committee Anne-Lise Charbonnier J´er´emie Detrey Pierrick Gaudry (Chair) Emmanuel Thom´e Paul Zimmermann
INRIA, Nancy, France INRIA, Nancy, France CNRS, Nancy, France INRIA, Nancy, France INRIA, Nancy, France
Program Committee Nigel Boston University of Wisconsin, USA John Cremona Warwick Mathematics Institute, UK Claus Fieker University of Sydney, Australia ´ Guillaume Hanrot (PC Chair) Ecole Normale Sup´erieure, Lyon, France Kevin Hare University of Waterloo, Canada ´ Thorsten Kleinjung Ecole Polytechnique F´ed´erale de Lausanne, Switzerland Kamal Khuri-Makdisi American University of Beirut, Lebanon ´ Fran¸cois Morain (PC Chair) Ecole Polytechnique, France Takakazu Satoh Tokyo Institute of Technology, Japan Igor Shparlinski Macquarie University, Australia Alice Silverberg University of California at Irvine, USA Frederik Vercauteren Katholieke Universiteit Leuven, Belgium
Poster Session Benjamin Smith
´ INRIA Saclay, Ecole Polytechnique, France
Sponsoring Institutions Institut National de Recherche en Informatique et Automatique (INRIA) Laboratoire Lorrain de Recherche en Informatique et Applications (LORIA) ´ Ecole Polytechnique Centre National de la Recherche Scientifique (CNRS) Microsoft Research, USA Nancy Universit´e Groupement de Recherches en Informatique Math´ematique (GDR IM) Communaut´e Urbaine du Grand Nancy Conseil R´egional de Lorraine
VIII
Organization
Conference Website The names of the winners of the Selfridge Prize, material supplementing the contributed papers, and errata for the proceedings (if relevant), as well as the abstracts of the posters and the posters presented at ANTS-IX, can be found at http://ants9.org/.
Table of Contents
Invited papers Putting the Hodge and Tate Conjectures to the Test . . . . . . . . . . . . . . . . . Henri Darmon Curves of Genus 3 With a Group of Automorphisms Isomorphic to S3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Jean-Fran¸cois Mestre
1
2
Learning with Errors over Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Oded Regev
3
Lattices and Spherical Designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Gabriele Nebe
4
Fixed Points for Discrete Logarithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mariana Levin, Carl Pomerance, and K. Soundararajan
6
Contributed papers Explicit Coleman Integration for Hyperelliptic Curves . . . . . . . . . . . . . . . . Jennifer S. Balakrishnan, Robert W. Bradshaw, and Kiran S. Kedlaya
16
Smallest Reduction Matrix of Binary Quadratic Forms: And Cryptographic Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Aurore Bernard and Nicolas Gama
32
Practical Improvements to Class Group and Regulator Computation of Real Quadratic Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Jean-Fran¸cois Biasse and Michael J. Jacobson Jr.
50
On the Use of the Negation Map in the Pollard Rho Method . . . . . . . . . . Joppe W. Bos, Thorsten Kleinjung, and Arjen K. Lenstra
66
An O(M (n) log n) Algorithm for the Jacobi Symbol . . . . . . . . . . . . . . . . . . Richard P. Brent and Paul Zimmermann
83
New Families of ECM Curves for Cunningham Numbers . . . . . . . . . . . . . . ´ Eric Brier and Christophe Clavier
96
Visualizing Elements of Sha[3] in Genus 2 Jacobians . . . . . . . . . . . . . . . . . . Nils Bruin and Sander R. Dahmen
110
X
Table of Contents
On Weil polynomials of K3 surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Andreas-Stephan Elsenhans and J¨ org Jahnel
126
Class Invariants by the CRT Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Andreas Enge and Andrew V. Sutherland
142
Short Bases of Lattices over Number Fields . . . . . . . . . . . . . . . . . . . . . . . . . Claus Fieker and Damien Stehl´e
157
On the Complexity of the Montes Ideal Factorization Algorithm . . . . . . . David Ford and Olga Veres
174
Congruent Number Theta Coefficients to 1012 . . . . . . . . . . . . . . . . . . . . . . . William B. Hart, Gonzalo Tornar´ıa, and Mark Watkins
186
Pairing the Volcano . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sorina Ionica and Antoine Joux
201
A Subexponential Algorithm for Evaluating Large Degree Isogenies . . . . David Jao and Vladimir Soukharev
219
Huff’s Model for Elliptic Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Marc Joye, Mehdi Tibouchi, and Damien Vergnaud
234
Efficient Pairing Computation With Theta Functions . . . . . . . . . . . . . . . . . David Lubicz and Damien Robert
251
Small-Span Characteristic Polynomials of Integer Symmetric Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . James McKee
270
Decomposition Attack for the Jacobian of a Hyperelliptic Curve over an Extension Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Koh-ichi Nagao
285
Factoring Polynomials over Local Fields II . . . . . . . . . . . . . . . . . . . . . . . . . . Sebastian Pauli
301
On a Problem of Hajdu and Tengely . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Samir Siksek and Michael Stoll
316
Sieving for Pseudosquares and Pseudocubes in Parallel Using Doubly-Focused Enumeration and Wheel Datastructures . . . . . . . . . . . . . . Jonathan P. Sorenson On the Extremality of an 80-Dimensional Lattice . . . . . . . . . . . . . . . . . . . . Damien Stehl´e and Mark Watkins
331
340
Table of Contents
Computing Automorphic Forms on Shimura Curves over Fields with Arbitrary Class Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . John Voight
XI
357
Improved Primality Proving with Eisenstein Pseudocubes . . . . . . . . . . . . . Kjell Wooding and H.C. Williams
372
Hyperbolic Tessellations Associated to Bianchi Groups . . . . . . . . . . . . . . . . Dan Yasaki
385
Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
397
Putting the Hodge and Tate Conjectures to the Test Henri Darmon Department of Mathematics, McGill University, Burnside Hall, Montreal, QC, Canada
[email protected]
The Hodge conjecture asserts that the presence of algebraic cycles on a (smooth, projective) variety over the complex numbers can be detected in its Betti cohomology equipped with the Hodge structure arising from its relation with complex deRham cohomology. The Tate conjecture makes a similar assertion with -adic cohomology replacing Betti cohomology. One of the difficulties with these conjectures is that the predictions that they make are often hard to test numerically, even in specific concrete instances. Unlike closely related parts of number theory (a case in point being the Birch and Swinnerton-Dyer conjecture) the study of algebraic cycles has therefore not been as strongly affected by the growth of the experimental and computational community as it perhaps could be. In this lecture, I will describe some numerical experiments that are designed to “test” the Hodge and Tate conjectures for certain varieties (of arbitrarily large dimension) which arise from elliptic curves with complex multiplication and theta series of CM Hecke characters.
G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, p. 1, 2010. c Springer-Verlag Berlin Heidelberg 2010
Curves of Genus 3 with a Group of Automorphisms Isomorphic to S3 Jean-Fran¸cois Mestre Centre de Math´ematiques de Jussieu Projet Th´eorie des Nombres
[email protected]
In this talk, we construct curves of genus 3 with automorphism group equal to S3 ; we give some applications of this construction to the problem of optimal curves, i.e. of curves over a finite field Fq having a number of points equal to the Serre-Weil bound Mq ; in particular, we prove that there exists infinitely many fields F3n having optimal curves; we prove also that there exists an integer C such that, for any finite field F7n , there exists a curve of genus 3 defined over having at least Mq − C points.
G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, p. 2, 2010. c Springer-Verlag Berlin Heidelberg 2010
Learning with Errors over Rings Oded Regev Blavatnik School of Computer Science, Tel Aviv University, Tel Aviv 69978, Israel
[email protected]
The “learning with errors” (LWE) problem is to distinguish random linear equations, which have been perturbed by a small amount of noise, from truly uniform ones. The problem has been shown to be as hard as worst-case lattice problems, and in recent years it has served as the foundation for a plethora of cryptographic applications. Unfortunately, these applications are rather inefficient due to an inherent quadratic overhead in the use of LWE. After a short introduction to the area, we will discuss recent work on making LWE and its applications truly efficient by exploiting extra algebraic structure. Namely, we will define the ring-LWE problem, and prove that it too enjoys very strong hardness guarantees. Based on joint work with Vadim Lyubashevsky and Chris Peikert.
G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, p. 3, 2010. c Springer-Verlag Berlin Heidelberg 2010
Lattices and Spherical Designs Gabriele Nebe Lehrstuhl D f¨ ur Mathematik, RWTH Aachen University, Germany
[email protected]
A lattice is a finitely generated discrete subgroup of Euclidean space. Lattices are an important algorithmic tool in number theory, integral representation theory, geometry, information theory, cryptography, crystallography and have various other applications within mathematics and beyond. Any lattice has only finitely many vectors of a given length, they form the layers of the lattice, which are finite subsets of spheres in the underlying Euclidean space. A spherical design of strength t is a finite set X = ∅ in the Euclidean 1 sphere for which the mean value |X| x∈X f (x) equals the integral of f over the sphere for all polynomials f of degree up to t. This condition is equivalent to x∈X f (x) = 0 for all non-constant harmonic polynomials of degree ≤ t. Spherical designs hence consist of well distributed points on a sphere and are relevant for numerical integration, in information theory, geometry, statistics and have applications for instance in medicine. Boris Venkov combined these two concepts in a very fruitful way that allows to use lattices to classify spherical designs and to use designs for finding good lattices. An introduction to this subject as well as some applications are given in “R´eseaux euclidiens, designs sph´eriques et formes modulaires”, Enseignement Math., Geneva, 2001. There Venkov introduces the notion of a strongly perfect lattice, which is a lattice whose minimal vectors form a spherical 4-design. Using the characterization by Korkine, Voronoi and Zolotarev one shows that strongly perfect lattices realise local maxima of the sphere packing density function on the space of all similarity classes of n-dimensional lattices (in fact in the space of all periodic packings as proved by Sch¨ urmann). All local maxima of this function are known up to dimension 8. In dimension 8 Dutour, Sch¨ urmann, Vallentin and Riener proved that there are 2408 local maxima. The densest lattice sphere packings are known up to dimension 8 and, thanks to recent results by Elkies and Kumar, in dimension 24, where the Leech lattice is the densest lattice. Combining number theory and geometry with combinatorial methods allows classify strongly perfect lattices, where a full classification up to dimension 12 is obtained in joined work with Venkov. With one exception all known strongly perfect lattices Λ have the additional property that also the dual lattice Λ∗ is strongly perfect. Such lattices are called dual strongly perfect, the classification of dual strongly perfect lattices in small dimension has been completed in dimension 14 and is an ongoing PhD project by Elisabeth Nossek in Aachen. There are two general approaches to study and construct strongly perfect lattices: by modular forms and by invariant theory of finite groups. Both concepts usually allow to show that all non-empty layers of the lattice form spherical G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 4–5, 2010. c Springer-Verlag Berlin Heidelberg 2010
Lattices and Spherical Designs
5
4-designs. Such lattices are called universally perfect and play a role in Riemannian geometry. If Λ is a universally perfect lattice then the torus Rn /Λ∗ defined by the dual lattice Λ∗ provides a strict local minimum of the height function on the set of all n-dimensional flat tori. R. Coulangeon also shows that universally perfect lattices Λ achieve local minima of Epstein’s zeta function, they are so called ζ-extreme lattices. The question to find ζ-extreme lattices has a long history going back to Sobolev’s work on numerical integration and to work of Delon´e. Universally perfect lattices are dual strongly perfect. The relation with modular forms arises, because the condition that the minimal vectors of the lattice form a 4-design means the annihilation of certain coefficients in its theta series with harmonic coefficients. In this way one can prove the strong perfectness of many extremal lattices of small level. For example there are more than 106 even unimodular lattices without roots in dimension 32 (by work of Oliver King) and the theory of modular forms shows that all of them are universally perfect; this is the only known method to prove that all these lattices are locally densest lattices. If a lattice Λ has a big automorphism group G := Aut(Λ) which has no invariant harmonic polynomials of degree 2 and 4, a condition easily expressed in terms of the character of G ≤ O(n), then Λ is universally perfect. There are many interesting lattices such as the Barnes-Wall lattices, the 248-dimensional Thompson-Smith lattice and others which are strongly perfect by this reason. Tiep and others used representation theory to classify certain matrix groups G for which all orbits form spherical 4-designs. On the other hand lattices are an important tool to find and classify good spherical designs. Fixing the strength t and the dimension n, one tries to find spherical t-designs X ⊂ S n−1 of minimal possible cardinality. If t = 2m is even, then n−1+m n−2+m |X| ≥ + m m−1 and if t = 2m + 1 is odd then n−1+m |X| ≥ 2 . m A t-design X for which equality holds is called a tight t-design. Tight t-designs in Rn with n ≥ 3 are very rare. Bannai has shown that such tight designs only exist if t ≤ 5 and t = 7, 11. The tight t-designs with t = 1, 2, 3 as well as t = 11 are completely classified whereas their classification for t = 4, 5, 7 is still an open problem. It is conjectured that there are just seven tight t-designs of dimension n ≥ 3 and strength 4, 5, 7, namely in dimensions 6,22 (t=4), 3,7,23 (t=5) respectively 8,23 (t=7); each of these is known to be unique. One possible approach to prove that there are no further tight designs X is to investigate the Euclidean lattice Λ generated by X and to obtain properties of Λ (such as its determinant or its minimum) from the design properties of X and then prove the non existence of such a lattice Λ. This strategy has been successfully applied by Bannai, Munemasa and Venkov to show that there are no further tight designs up to dimension 103.
Fixed Points for Discrete Logarithms Mariana Levin1 , Carl Pomerance2, and K. Soundararajan3 1
Graduate Group in Science and Mathematics Education University of California Berkeley, CA 94720, USA
[email protected] 2 Department of Mathematics Dartmouth College Hanover, NH 03755, USA
[email protected] 3 Department of Mathematics Stanford University Stanford, CA 94305, USA
[email protected]
Abstract. We establish a conjecture of Brizolis that for every prime p > 3 there is a primitive root g and an integer x in the interval [1, p − 1] with logg x = x. Here, log g is the discrete logarithm function to the base g for the cyclic group (Z/pZ)× . Tools include a numerically explicit “smoothed” version of the P´ olya–Vinogradov inequality for the sum of values of a Dirichlet character on an interval, a simple lower bound sieve, and an exhaustive search over small cases.
1
Introduction
If g is an element in a group G and t ∈ g, there is some integer n with g n = t. Finding a valid choice for n is known as the discrete logarithm problem. Note that if g has finite order m, then n is actually a residue class modulo m. We write logg t = n (or logg t ≡ n (mod m)) in analogy to usual logarithmic notation. Thus, the problem in the title of this paper does not seem to make good sense, since if logg x = x, then the first x is a member of the group g and the second x is either an integer or a residue class modulo m. However, sense is made of the equation through the traditional conflation of members of the ring Z/kZ with least nonnegative members of residue classes.
The work for this paper was begun at Bell Laboratories in 2001 while the first author was a summer student working with the second author. A version of this work was presented as the 2003 Master’s Thesis of the first author at U. C. Berkeley, see [3]. The second author was supported in part by NSF grant DMS-0703850. The third author was supported in part by NSF grant DMS-0500711.
G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 6–15, 2010. c Springer-Verlag Berlin Heidelberg 2010
Fixed Points for Discrete Logarithms
7
In particular, suppose G = (Z/pZ)× , where p is a prime number. This is known to be a cyclic group of order p − 1. Suppose g is a cyclic generator of this group, known as a primitive root for p. A fixed point for the discrete logarithm modulo p to the base g is then an integer x in the interval [1, p − 1] such that logg x = x, that is, g x ≡ x (mod p). (Note that if x is not restricted to the interval [1, p − 1] it is easy to find fixed points. Namely, if x is a solution to the Chinese remainder problem x ≡ 1 (mod p − 1), x ≡ g (mod p), then g x ≡ x (mod p).) Brizolis (see Guy [6, Section F9]) made the conjecture that for every prime p > 3 there is a primitive root g and an integer x in [1, p − 1] with logg x = x, that is, g x ≡ x (mod p). In this paper we prove this conjecture in a somewhat stronger form. Brizolis had noticed that if there is a primitive root x for p with x in [1, p − 1] and gcd(x, p − 1) = 1, then with y the multiplicative inverse of x modulo p − 1 and g = xy , we would have that g is a primitive root for p as well, and g x ≡ xxy ≡ x (mod p), that is, there is a solution to the fixed point problem. We shall prove then the stronger result that for each prime p > 3 there is a primitive root x for p in [1, p − 1] that is coprime to p − 1. Several authors have shown that the Brizolis property holds for all sufficiently large primes p. In particular, Zhang [12] showed the strong conjecture holds for all sufficiently large primes p, but did not give an estimate of what “sufficiently large” is. Cobeli and Zaharescu [4] also showed that the strong conjecture holds for sufficiently large primes p, and gave the details that it holds for all p > 102070 , but they indicated that their method would support a bound around 1050 . Our method is similar to that of Zhang, who used the P´ olya–Vinogradov inequality for character sums on an interval. Here we introduce a numerically explicit “smoothed” version of this inequality, see §2. In addition, we combine the traditional character-sum approach with a simple lower bound sieve. There is still some need for direct calculation for smaller values of p, which are easily handled by a short Mathematica program. In particular, we directly verified the strong conjecture for each prime p < 1.25 · 109 . We mention the article by Holden and Moree [8], which considers some related problems. The total number of solutions to g x ≡ x (mod p) as p runs up to some high bound N , where either g is restricted to be a primitive root, and where it is not so restricted, is considered in Bourgain, Konyagin, and Shparlinski [2]. The smoothed version of the P´ olya–Vinogradov inequality that we introduce in the next section is quite simple and the proof is routine, so it may be known to others. We have found it to be quite useful numerically; we hope it will find applications in “closing the gap” in other problems where character sums arise. Some notation: ω(n) denotes the number of distinct prime divisors of n.
8
2
M. Levin, C. Pomerance, and K. Soundararajan
A “Smoothed” P´ olya–Vinogradov Inequality
Let χ be a non-principal Dirichlet character to the modulus q. The P´ olya– Vinogradov inequality (independently discovered by P´ olya and Vinogradov in 1918) asserts that there is a universal constant c such that ≤ c√q log q χ(a) (1) M≤a≤M+N for any choice of numbers M, N . Let N (p) denote the numer of primitive roots g for p with g ∈ [1, p − 1] and gcd(g, p − 1) = 1. Using (1) one can show (see Zhang [12] and Campbell [3]) that N (p) =
ϕ(p − 1)2 + O(p1/2+ ), p−1
for every fixed > 0, and so N (p) > 0 for all sufficiently large p. The aim of this paper is to close the gap and find the complete set of primes p with N (p) > 0. Towards this end it would be useful to have a numerically explicit version of (1). In [3], the theorem of Bachman and Rachakonda [1] was used (plus a small unpublished improvement on a secondary term in their inequality due to the second author of the present paper). Recently, elaborating on the work in an early paper of Landau [10], plus an idea of Bateman as mentioned in Hildebrand [7], the second author in [11] proved a stronger numerically explicit version of (1). Using this simplifies the approach in [3]. However, we have found a way to simplify even further by using a “smoothed” version of (1). In this section we prove the following theorem. Theorem 1. Let χ be a primitive Dirichlet character to the modulus q > 1 and let M, N be real numbers with 0 < N ≤ q. Then √ a − M N − 1 ≤ q − √ . χ(a) 1 − N q M≤a≤M+2N Proof. We use Poisson summation, see [9, §4.3]. Let H(t) = max{0, 1 − |t|}. We wish to estimate |S|, where S :=
χ(a)H
a∈Z
a−M −1 . N
Towards this end we use the identity 1 χ(a) = χ(j)e(aj/q), ¯ τ (χ) ¯ j=0 q−1
Fixed Points for Discrete Logarithms
9
where τ (χ) ¯ is the Gauss sum for χ ¯ and e(x) := e2πix . Thus, 1 χ(j) ¯ e(aj/q)H τ (χ) ¯ j=0 q−1
S=
a∈Z
a−M −1 . N
The Fourier transform of H is ∞ 1 − cos 2πs ˆ ˆ H(s) = H(t)e(−st) dt = when s = 0, H(0) = 1, 2π 2 s2 −∞ which is nonnegative for s real. By a change of variables in the integral, we see that the Fourier transform of e(jt/q)H((t − M )/N − 1) is ˆ (s − j/q)N . N e − (M + N )(s − j/q) H Hence, by Poisson summation, we have q−1 N ˆ (n − j/q)N . χ(j) ¯ e − (M + N )(n − j/q) H S= τ (χ) ¯ j=0 n∈Z
Estimating trivially (that is, taking the absolute value of each term) and using ˆ nonnegative and χ(0) = 0, we have H q−1 N ˆ N ˆ kN |S| ≤ √ H (n − j/q)N = √ H . q j=1 q q n∈Z
k∈Z\qZ
ˆ Since (N/q)H(sN/q) is the Fourier transform of H(qt/N ), from the last calculation we have
N kN N ˆ √ N ˆ kN √ ˆ H H |S| ≤ q ≤ q − H(0) + q q q q q k∈Z k∈Z\qZ
ql √ N √ N √ N H = q − + = − √ + qH(0) = q − √ , q N q q l∈Z
by another appeal to Poisson summation and the definition of H. This completes the proof of the theorem. In our application we will need a version of Theorem 1 with the variable a satisfying a coprimality condition. We deduce such a result below. Corollary 2. Let k be a square-free integer and let χ be a primitive character to the modulus q > 1. For 0 < N ≤ q, we have √ a always 2ω(k) q χ(a) 1 − − 1 ≤ ω(k)−1 √ N q if k is even. 2 0≤a≤2N (a,k)=1
10
M. Levin, C. Pomerance, and K. Soundararajan
Proof. Since d|(k,a) μ(d) gives 1 if (a, k) = 1 and 0 otherwise, the sum in question equals ad − 1 μ(d)χ(d) χ(a) 1 − N d|k
a≤2N/d
√ and using Theorem 1 this is bounded in size by 2ω(k) q as desired. If (k, q) is even, then χ(d) = 0 for even divisors d of k, so that we achieve the bound √ 2ω(k)−1 q, again as desired. Suppose now that k is even and q is odd. For each odd divisor d of k, we group together the contribution from d and 2d, and so we may write the sum in question as ad − 1 . μ(d)χ(d) χ(a) 1 − N d|k/2
a≤2N/d a odd
We replace a in the inner sum by q + a, and since q is now odd, the condition that a is odd may be replaced with the condition that q + a = 2b is even. Thus, the above sum becomes 2d(b − q/2) μ(d)χ(d)χ(2) χ(b) 1 − − 1 , N d|k/2
q/2≤b≤q/2+N/d
and appealing again to Theorem 1 we obtain the Corollary in this case. Though we will not need it for our proof, we record the following corollary of Theorem 1. Corollary 3. Let χ be a primitive Dirichlet character to the modulus q > 1 and let M, N be real numbers with N > 0. Then, with θ the fractional part of N/q, q 3/2 a − M − 1 ≤ θ(1 − θ). χ(a) 1 − N N M≤a≤M+2N
3
A Criterion for the Brizolis Property
Let us write the largest square-free divisor of p − 1 as uv where u and v will be chosen later. We shall assume that u is even, and have in mind the situation that u is composed of the small prime factors of p − 1, and that v is composed of the large prime factors; we also allow for the possibility that v = 1. For the rest of the paper, the letter will denote a prime number. Let S denote the set of primitive roots in [1, p − 1] that are coprime to p − 1. Thus, an integer g ∈ [1, p − 1] is in S if and only if for each prime | p − 1 we have both g and g is not an -th power (mod p). Let S1 denote the set of integers in [1, p − 1] that are coprime to u and which are not equal to an -th power (mod p) for any prime dividing u. Let S2 denote the set of integers in S1 which are divisible by some prime which divides v. Let S3 denote the set
Fixed Points for Discrete Logarithms
11
of integers in S1 which equal an -th power (mod p) for some prime dividing v. Now S ⊂ S1 , and the elements in S1 that are not in S are precisely those that, for some prime | v, are either divisible by or are an -th power (mod p). Thus, S = S1 \(S2 ∪ S3 ). We seek a positive lower bound for N :=
g∈S
2g 1− − 1 , p−1
since if N > 0, then S = ∅. By our observation above we have N ≥ N1 − N2 − N3 , where, for j = 1, 2, 3, Nj =
g∈Sj
2g 1− − 1 . p−1
If d is a square-free divisor of p − 1 and g is an integer in [1, p − 1], let Cd (g) be 1 if g is a d-th power (mod p) and 0 otherwise. Thus, Cd (g) =
C (g) =
|d
⎛ 1 ⎝ = 1+ d |d
1 |d
χ of order
Note that
χ(g)
χ =χ0
⎞
1 χ(g)⎠ = d
χ(g).
m|d χ of order m
μ(d)Cd (g)
d|u
is 1 if, for each | u, g is not an -th power (mod p), and is 0 otherwise. By the above calculation, this expression is μ(d) d|u
d
χ(g) =
m|d χ of order m
χ(g)
m|u χ of order m
μ(nm) . nm
n|u/m
The inner sum here is (ϕ(u)/u)μ(m)/ϕ(m), so that N1 =
ϕ(u) u
1≤g≤p−1 (g,u)=1
2g μ(m) 1− − 1 p−1 ϕ(m) m|u
χ(g).
(2)
χ of order m
Let m | u with m > 1. Using Corollary 2, the terms above contribute an amount bounded in magnitude by ϕ(u) ω(u)−1 √ 2 p, u
12
M. Levin, C. Pomerance, and K. Soundararajan
so the total contribution over all m | u with m > 1 has magnitude at most √ ϕ(u) ω(u) 2 − 1 2ω(u)−1 p. u The sum over g in (2) with m = 1 (and so χ = χ0 ) is ϕ(u) u
1≤g≤p−1 (g,u)=1
2g ϕ(u) 1− − 1 = μ(d) p−1 u d|u
h≤(p−1)/d
2dh 1− − 1 . p−1
The inner sum over h can be evaluated explicitly: it equals (p−1)/(2d) if (p−1)/d is even, and it equals (p − 1)/(2d) − d/(2(p − 1)) if (p − 1)/d is odd. It follows that the contribution when m = 1 is 2 ϕ(u) 1 p − 1 ϕ(u) − dμ(d) u 2 u 2(p − 1) ≥
ϕ(u) u
We conclude that 2 ϕ(u) N1 ≥ u 2 ϕ(u) > u
2
d|u (p−1)/d odd
ϕ(u)2 p−1 − ≥ 2 u(p − 1)
ϕ(u) u
2
p ϕ(u) − . 2 u
p ϕ(u) ϕ(u) ω(u) √ − − 2 − 1 2ω(u)−1 p 2 u u p ϕ(u) ω(u) √ − 4 p. 2 2u
Next we turn to N2 . Since an element in S2 must be divisible by some prime |v we have that 2h ϕ(u) μ(m) 1− − 1 N2 ≤ χ(h ). p−1 u ϕ(m) |v h≤(p−1)/ (h,u)=1
χ of order m
m|u
If v = 1, then N2 = 0, so assume v > 1. The terms with m > 1 contribute, using Corollary 2, an amount bounded in size by ϕ(u) √ ω(v) 2ω(u) − 1 2ω(u)−1 p. u The main term m = 1 above contributes (arguing as in our evaluation of the main term for N1 above) ϕ(u) u
|v h≤(p−1)/ (h,u)=1
2h ϕ(u) 2 p − 1 1− − 1 ≤ + . p−1 u 2 v |v
Fixed Points for Discrete Logarithms
Since
|v
N2 ≤ ≤
13
≤ v, and using v > 1, we conclude that
ϕ(u) u ϕ(u) u
2 2
p−1 1 + 2
|v
p1 2
|v
+
ϕ(u) u
2 +
ϕ(u) √ ω(v) 2ω(u) − 1 2ω(u)−1 p u
ϕ(u) ω(u) √ 4 ω(v) p. 2u
Lastly we consider N3 . An element g of S3 must be an -th power for some prime |v, and the indicator function for this condition is 1 ψ =χ0 ψ(g), as seen above. Therefore we have that N3 is at most |v g≤p−1 (g,u)=1
2g ϕ(u) μ(m) 1− − 1 p−1 u ϕ(m) m|u
χ of order m
1 χ(g) ψ(g) . ψ =χ0
Appealing to Corollary 2 for the terms above with χψ = χ0 we find that the contribution of such terms is bounded in magnitude by √ ϕ(u) 2ω(u)−1 2 ω(v) p. u The main term χ = ψ = χ0 gives 2g ϕ(u) ϕ(u) p − 1 ϕ(u) 1 ϕ(u) 1 1− − 1 ≤ + u p−1 u u 2 p−1 |v
g≤p−1 (g,u)=1
=
|v
ϕ(u) u
Thus,
2
N3 ≤
p−1 1 + 2 v
ϕ(u) u
2
|v
1 ≤
ϕ(u) u
2
p1 . 2 |v
p 1 ϕ(u) ω(u) √ + 4 ω(v) p. 2 2u |v
Combining these bounds for N1 , N2 and N3 we obtain that N≥
ϕ(u) u
2 1 ϕ(u) p √ 1−2 − 4ω(u) (1 + 2ω(v)) p. 2 2u |v
We may conclude as follows: The Brizolis property holds for the prime p ≥ 5, if we may write the largest square-free divisor of p − 1 as uv with u even, |v 1/ < 1/2, and with √ 1 + 2ω(v) 4ω(u) u · . p> ϕ(u) 1 − 2 |v 1/
(3)
14
4
M. Levin, C. Pomerance, and K. Soundararajan
Completing the Proof
Our criterion (3) can be used in a straightforward way with v = 1 to get an upper bound for possible counterexamples to the Brizolis conjecture. Indeed, after a small calculation (using 4ω(n) < 1404n1/3 and n/ϕ(n) < 2 log log n for n larger than the product of the first eleven primes), it is seen that the Brizolis property holds for all p > 1025 . It is not pleasant to contemplate checking each prime to this point, so instead we use (3) with v > 1. Suppose ω(p − 1) = k ≥ 10, and take v to be the product of the six largest primes dividing p − 1, and u to be the product of the other smaller primes. Since ω(p − 1) ≥ 10, the primes dividing v are all at least 11, and we have that 1−2
1 |v
≥1−2
1 1 1 1 1 1 + + + + + > 0.28. 11 13 17 19 23 29
If pj denotes the j-th prime, then 4ω(u) u/ϕ(u) ≤ k−6 j=1 (4pj /(pj − 1)), and p > k p − 1 ≥ j=1 pj . So from our criterion (3), if we have k k−6 13 4pj √ , pj ≥ 0.28 j=1 pj − 1 j=1
then the Brizolis property holds for all p with ω(p − 1) = k. We verified that the inequality above holds for k = 10. If k is increased by 1 then the LHS of our √ inequality is increased by a factor of at least 31 > 5, but the RHS is increased only by a factor of at most 4 × (11/10) = 4.4. Thus, the inequality holds for all k ≥ 10. Suppose now that k = ω(p − 1) ≤ 9. If k ≥ 4, we take u to be the product of the four smallest primes dividing p − 1, and otherwise, we take u to be the product ofall the primes dividing p − 1. Then v has at most 5 prime factors, and 1 − 2 |v 1/ ≥ 1 − 2(1/11 + 1/13 + 1/17 + 1/19 + 1/23) ≥ 0.35. Further 4 p|u 4p/(p − 1) ≤ j=1 4pj /(pj − 1) = 1120. Our criterion (3) shows that if 11 2 p ≥ 1120 × = 1,239,040,000, 0.35 then p satisfies the Brizolis property. Using the functions Prime[ ] and PrimitiveRoot[ ] in Mathematica, we were able to directly exhibit a primitive root g for each prime 3 < p < 1.25 · 109 with g in [1, p − 1] and coprime to p − 1. Our program runs as follows. The function Prime[ ] allows us to sequentially step through the primes up to our bound. For each prime p returned by Prime[ ], we invoke PrimitiveRoot[p] to find the least positive primitive root r for p. We then sequentially check r2k−1 mod p for k = 1, 2, . . . until we find a value coprime to p − 1 with 2k − 1 also coprime to p − 1. The exponent being coprime to p − 1 guarantees that the power is a primitive root, and the residue being coprime to p − 1 then guarantees that we
Fixed Points for Discrete Logarithms
15
have found a member of S. If no such primitive root exists, this algorithm would not terminate, but it did, thus verifying the Brizolis property for the given range. There are various small speed-ups that one can use to augment the program. For example, if r = 2 is a primitive root and p ≡ 1 (mod 4), then note that p − 2 is a primitive root coprime to p − 1, and so work with this prime p is complete. The augmented program ran in about 90 minutes on a Dell workstation. This completes our proof of the Brizolis conjecture. Acknowledgment. We thank Richard Crandall for some technical assistance with the Mathematica program and the referees for some helpful comments.
References 1. Bachman, G., Rachakonda, L.: On a problem of Dobrowolski and Williams and the P´ olya–Vinogradov inequality. Ramanujan J. 5, 65–71 (2001) 2. Bourgain, J., Konyagin, S.V., Shparlinski, I.E.: Product sets of rationals, multiplicative translates of subgroups in residue rings, and fixed points of the discrete logarithm. Int. Math. Res. Notices, art. ID rnn090, 29 (2008) (Corrigendum: ibid. 2009, No. 16, 3146–3147) 3. Campbell, M.E.: On fixed points for discrete logarithms, Master’s Thesis, U. C. Berkeley Department of Mathematics (2003) 4. Cobeli, C., Zaharescu, A.: An exponential congruence with solutions in primitive roots. Rev. Romaine Math. Pures Appl. 44, 15–22 (1999) 5. Crandall, R., Pomerance, C.: Prime numbers: a computational perspective, 2nd edn. Springer, New York (2005) 6. Guy, R.K.: Unsolved problems in number theory. Springer, Berlin (1984) 7. Hildebrand, A.: On the constant in the P´ olya–Vinogradov inequality. Canad. Math. Bull. 31, 347–352 (1988) 8. Holden, J., Moree, P.: Some heuristics and results for small cycles of the discrete logarithm. Math. Comp. 75, 419–449 (2006) 9. Iwaniec, H., Kowalski, E.: Analytic number theory. American Math. Soc., Providence (2004) 10. Landau, E.: Absch¨ atzungen von Charaktersummen, Einheiten und Klassenzahlen. Nachrichten K¨ onigl. Ges. Wiss. G¨ ottingen, 79–97 (1918) 11. Pomerance, C.: Remarks on the P´ olya–Vinogradov inequality (submitted for publication 2010) 12. Zhang, W.-P.: On a problem of Brizolis. Pure Appl. Math. 11(Suppl.), 1–3 (1995) (Chinese. English, Chinese summary)
Explicit Coleman Integration for Hyperelliptic Curves Jennifer S. Balakrishnan1, Robert W. Bradshaw2, and Kiran S. Kedlaya1 1
Massachusetts Institute of Technology, Cambridge, MA 02139, USA
[email protected],
[email protected] 2 University of Washington, Seattle, WA 98195, USA
[email protected]
Abstract. Coleman’s theory of p-adic integration figures prominently in several number-theoretic applications, such as finding torsion and rational points on curves, and computing p-adic regulators in K-theory (including p-adic heights on elliptic curves). We describe an algorithm for computing Coleman integrals on hyperelliptic curves, and its implementation in Sage.
1
Introduction
One of the fundamental difficulties of p-adic analysis is that the totally disconnected topology of p-adic spaces makes it hard to introduce a meaningful form of antidifferentiation. It was originally discovered by Coleman that this problem can be circumvented using the principle of Frobenius equivariance. Using this idea, Coleman introduced a p-adic integration theory first on the projective line [9], then (partly jointly with de Shalit) on curves and abelian varieties [10], [8]. Alternative treatments have been given by Besser [3] using methods of p-adic cohomology, and by Berkovich [2] using the nonarchimedean Gel’fand transform. Although Coleman’s construction is in principle quite suitable for machine computation, this had only been implemented previously in the genus 0 case [5]. The purpose of this paper is to present an algorithm for computing single Coleman integrals on hyperelliptic curves of good reduction over Cp for p > 2, based on the third author’s algorithm for computing the Frobenius action on the de Rham cohomology of such curves [17]. We also describe an implementation of this algorithm in the Sage computer algebra system. For context, we indicate some of the many potential applications of explicit Coleman integration. Some of these will be treated, with additional numerical examples, in the first author’s upcoming PhD thesis. (Some of these applications will require additional refinements of our implementation; see Section 5.) – Torsion points on curves. Coleman’s original application of p-adic integration was to find torsion points on curves of genus greater than 1. This could potentially be made effective and automatic. – p-adic heights on curves. Investigations into p-adic analogues of the conjecture of Birch and Swinnerton-Dyer for Jacobians of hyperelliptic curves G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 16–31, 2010. c Springer-Verlag Berlin Heidelberg 2010
Explicit Coleman Integration for Hyperelliptic Curves
17
require computation of the Coleman-Gross height pairing [11]. This global p-adic height pairing can, in turn, be decomposed into a sum of local height pairings at each prime. In particular, for C a hyperelliptic curve over Qp with p a prime of good reduction and for D1 , D2 ∈ Div0 (C) with disjoint support, the Coleman-Gross p-adic height pairing at p is given in terms of the Coleman integral [10] ωD1 , hp (D1 , D2 ) = D2
–
–
–
–
for an appropriately constructed differential ωD1 associated to the divisor D1 . This pairing is effectively computable by work of the first author [1]. Using this work, it should be possible (using ideas of Besser [4]) to add in local heights away from p, and thus compute the Coleman-Gross height pairing on Jacobians of hyperelliptic curves. (In genus 1, one can then compare to an alternate computation based on work of Mazur-Stein-Tate [22] and Harvey [16].) p-adic regulators. A related topic to the previous one is the computation of p-adic regulators in higher K-theory of arithmetic schemes, which are expected to relate to special values of L-functions. Some computations in genus 0 have been made by Besser and de Jeu [5]. Rational points on curves: Chabauty’s method. For C a smooth proper curve over Z[ N1 ], the Chabauty condition on C is that rank J(C) Z N1 < dim J(C), where J(C) denotes the Jacobian of the curve. When the Chabauty condiP tion holds, there exists a 1-form ω on J(C)an with 0 ω = 0 for all points 1 P ∈ J(C) Z N . We might be able to compute C(Z[ N1 ]) if we can find all P points P ∈ C an such that 0 ω = 0. This method has already been used in many cases, by Coleman and many others; see [23] for a survey (circa 2007). To apply Chabauty’s method in a typical case, one needs the integral of ω at some point in a residue disc, with which one can find all zeroes of the integral in the residue disc. Several methods are suggested in [23, Remark 8.3] for doing this, including Coleman integration. However, no serious attempt has been made to use numerical Coleman integration in Chabauty’s method; it seems likely that it can handle cases where the other methods suggested in [23, Remark 8.3] for finding constants of integration prove to be impractical. Rational points on curves: nonabelian Chabauty. It may be possible to use (iterated) Coleman integration to find rational points on curves failing the Chabauty condition, using Kim’s nonabelian Chabauty method [18]. As a demonstration of the method, Kim [19] gives an explicit double integral which vanishes on the integral points of the minimal regular model of a genus 1 curve over Q of Mordell-Weil rank 1. The erratum to [19] includes a corrected formula, together with some numerical examples computed using the methods of this paper. p-adic polylogarithms and multiple zeta values. These have been introduced recently by Furusho [13], but little numerical data exists so far.
18
J.S. Balakrishnan, R.W. Bradshaw, and K.S. Kedlaya
2
Coleman’s Theory of p-adic Integration
In this section, we recall Coleman’s p-adic integration theory (for single integrals only) in the case of curves with good reduction. This theory involves some concepts from rigid analytic geometry which it would be hopeless to introduce in such limited space; some standard references are [6] and [12]. (See also [10, §1].) Let Cp be a completed algebraic closure of Qp , and let O be the valuation subring of Cp . Choose once and for all a branch of the p-adic logarithm, i.e., a homomorphism Log : C× to the disc {x ∈ Cp : |x − 1| < p → Cp whose restriction ∞ 1} is given by the logarithm series log(x) = i=1 (1−x)i /i. (The choice of branch has no effect on the integrals on differentials of the second kind, i.e., everywhere meromorphic differentials with all residues zero.) We first introduce integrals on discs and annuli within P1 . Definition 1. Let I be an open subinterval A(I) denote the of [0, +∞). Let 1 annulus (or disc) {t ∈ A1Cp : |t| ∈ I}. For i∈Z ci ti dt ∈ ΩA(I)/C and P, Q ∈ p A(I), define Q ci (Qi+1 − P i+1 ). ci ti dt = c−1 Log(Q/P ) + i+1 P i∈Z
i=−1
This is easily shown not to depend on the choice of the coordinate t. Remark 2. Note that because of the division by i + 1 in the formula for the integral, we are unable to integrate on closed discs or annuli. We next turn to curves of good reduction. Definition 3. By a curve over O, we will mean a smooth proper connected scheme X over O of relative dimension 1. Equip the function field K(X) with the p-adic absolute value, so that the elements of K(X) of norm at most 1 constitute the local ring in X of the generic point of the special fibre X of X. Let XQ denote the generic fibre of X as a rigid analytic space. There is a natural specialization map from XQ to X; the inverse image of any point of X is a subspace of XQ isomorphic to an open unit disc. We call such a disc a residue disc of X. Definition 4. Let X be a curve over O. By a wide open subspace of XQ , we will mean a rigid analytic subspace of XQ of the form {x ∈ XQ : |f (x)| < λ} for some f ∈ K(X) of absolute value 1 and some λ > 1. Coleman made the surprising discovery that there is a well-behaved integration theory on wide open subspaces of curves over O, exhibiting no phenomena of path dependence. (Note that one needs to consider wide open subspaces even to integrate differentials which are holomorphic or meromorphic on the entire curve.) In the case of hyperelliptic curves, Coleman’s construction of these integrals using Frobenius lifts will be reflected in our technique for computing the integrals. For the general case, see [10, §2], [3, §4], or [2, Theorem 1.6.1].
Explicit Coleman Integration for Hyperelliptic Curves
19
Theorem 5 (Coleman). We may assign to each curve X over O and each 1 wide open subspace W of XQ a map μW : Div0 (W ) × ΩW/C → Cp , subject to p the following conditions. (Here Div(W ) denotes the free group on the elements of W , and Div0 (W ) denotes the kernel of the degree map deg : Div(W ) → Z taking each element of W to 1.) 1 . (a) (Linearity) The map μW is linear on Div0 (W ) and Cp -linear on ΩW/C p (b) (Compatibility) For any residue disc D of X and any isomorphism ψ : W ∩ 1 D → A(I) for some interval I, the restriction of μW to Div0 (W ∩D)×ΩW/C p is compatible with Definition 1 via ψ. (c) (Change of variables) Let X be another curve over O, let W be a wide open subspace of X , and let ψ : W → W be any morphism of rigid spaces relative to an automorphism of Cp . Then
(1) μW (ψ(·), ·) = μW (·, ψ ∗ (·)). (d) (Fundamental theorem of calculus) For any Q = i ci (Pi ) ∈ Div0 (W ) and any f ∈ O(W ), μW (Q, df ) = i ci f (Pi ). Remark 6. One cannot expect path independence in the case of bad reduction. For instance, an elliptic curve over Cp with bad reduction admits a Tate uniformization, so its logarithm map has nonzero periods in general. In Berkovich’s theory of integration, this occurs because the nonarchimedean analytic space associated to this curve X has nontrivial first homology.
3
Explicit Integrals for Hyperelliptic Curves
We now specialize to the situation where p > 2 and X is a genus g hyperelliptic curve over an unramified extension K of Qp having good reduction. We will assume in addition that we have been given a model of X of the form y 2 = f (x) such that deg f (x) = 2g + 1 and f has no repeated roots modulo p. (This restriction is inherited from [17], where it is used to simplify the reduction procedure. One could reduce to this case after possibly replacing K by a larger unramified extension of Qp , by performing a linear fractional transformation in x to put one root at infinity, thus reducing the degree from 2g + 2 to 2g + 1.) We will distinguish between Weierstrass and non-Weierstrass residue discs of X, which respectively correspond to Weierstrass and non-Weierstrass points of X. To discuss the differentials we will be integrating, we review a core definition from [17]. Let X be the affine curve obtained by deleting the Weierstrass points from X, and let A = K[x, y, z]/(y 2 − f (x), yz − 1) be the coordinate ring of X . Definition 7. The Monsky-Washnitzer (MW) weak completion of A is the ring A† consisting of infinite sums of the form
∞ Bi (x) , Bi (x) ∈ K[x], deg Bi ≤ 2g , yi i=−∞
20
J.S. Balakrishnan, R.W. Bradshaw, and K.S. Kedlaya
further subject to the condition that vp (Bi (x)) grows faster than a linear function of i as i → ±∞. We make a ring out of these using the relation y 2 = f (x). These functions are holomorphic on wide opens, so we will integrate 1-forms ω = g(x, y)
dx , 2y
g(x, y) ∈ A† .
(2)
Note that we only consider 1-forms which are odd, i.e., which are negated by the hyperelliptic involution. Even 1-forms can be written in terms of x alone, and so can be integrated directly as in Definition 1. (This last statement would fail if we had taken A† to be the full p-adic completion of A, rather than the weak completion. This observation is the basis for Monsky-Washnitzer’s formal cohomology, which is used in [17].) Note that the class of allowed forms includes those meromorphic differentials on X whose poles all belong to Weierstrass residue discs. For some applications (e.g., p-adic canonical heights), it is necessary to integrate meromorphic differentials with poles in non-Weierstrass residue discs. These will be discussed in [1]. Note also that for ease of exposition, we describe all of our algorithms as if it were possible to compute exactly in A† . This is not possible for two reasons: the elements of A† correspond to infinite series, and the coefficients of these series are polynomials with p-adic coefficients. In practice, each computation will be made with suitable p-adic approximations of the truly desired quantities, so one must keep track of how much p-adic precision is needed in these estimates in order for the answers to bear a certain level of p-adic accuracy. We postpone this discussion to § 4.1. 3.1
A Basis for de Rham Cohomology
We first note that any odd differential ω as in (2) can be written uniquely as ω = df + c0 ω0 + · · · + c2g−1 ω2g−1
(3)
with f ∈ A† , ci ∈ K, and ωi =
xi dx 2y
(i = 0, . . . , 2g − 1).
(4)
That is, the ωi form a basis of the odd part of the de Rham cohomology of A† . The process of putting ω in the form (3), using the relations y 2 = f (x), dx , d(xi y j ) = 2ixi−1 y j+1 + jxi f (x)y j−1 2y can be made algorithmic; see [17, §3]. (Briefly, one uses the first relation to reduce high powers of x, and the second to reduce large positive and negative powers of y.) Using properties from Theorem 5 (linearity and the fundamental
Explicit Coleman Integration for Hyperelliptic Curves
21
theorem of calculus), the integration of ω reduces effectively to the integration of the ωi . It may be convenient for some purposes to use a different basis of de Rham cohomology. For instance, the basis xi dx/2y 3 (i = 0, . . . , 2g − 1) is crystalline (see the erratum to [17]), so Frobenius will act via a matrix with p-adically integral entries. 3.2
Tiny Integrals
Q We refer to any Coleman integral of the form P ω in which P, Q lie in the same residue disc (Weierstrass or not) as a tiny integral. As an easy first case, we give an algorithm to compute tiny integrals of basis differentials. Algorithm 8 (Tiny Coleman integrals). Input: Points P, Q ∈ X(Cp ) in the same residue disc (neither equal to the point at infinity) and a basis differential ωi . Q Output: The integral P ωi . 1. Construct a linear interpolation from P to Q. For instance, in a nonWeierstrass residue disc, we may take x(t) = (1 − t)x(P ) + tx(Q) y(t) = f (x(t)), where y(t) is expanded as a formal power series in t. 2. Formally integrate the power series in t:
Q
Q
ωi = P
xi P
dx = 2y
0
1
x(t)i dx(t) dt. 2y(t) dt
Remark 9. One can similarly integrate any ω holomorphic in the residue disc containing P and Q. If ω is only meromorphic in the disc, but has no pole at P or Q, we can first make a polar decomposition, i.e., write ω as a holomorphic differential on the disc plus some terms of the form c/(t − r)i , and integrate the latter terms directly. (If ω is everywhere meromorphic, this is achieved by a partial fractions decomposition.) 3.3
Non-Weierstrass Discs
Q We next compute integrals of the form P ωi in which P, Q ∈ X(Cp ) lie in distinct non-Weierstrass residue discs. The method of tiny integrals is not available; we instead employ Dwork’s principle of analytic continuation along Frobenius, in the form of Kedlaya’s algorithm [17] for calculating the action of Frobenius Q on de Rham cohomology. Note that we calculate the integrals P ωi for all i simultaneously. (We modify the presentation in [17] by keeping track of exact differentials, which are irrelevant for computing zeta functions.)
22
J.S. Balakrishnan, R.W. Bradshaw, and K.S. Kedlaya
Algorithm 10 (Kedlaya’s algorithm). Input: The basis differentials {ωi }2g−1 i=0 . Output: Functions fi ∈ A† and a 2g × 2g matrix M over K such that φ∗ (ωi ) = 2g−1 dfi + j=0 Mij ωj for a p-power lift of Frobenius φ. 1. Since K is an unramified extension of Qp , it carries a unique automorphism φK lifting the Frobenius automorphism x → xp on its residue field. Extend φK to a Frobenius lift on A† by setting φ(x) = xp ,
1/2 φK (f )(xp ) − f (x)p φ(y) = y p 1 + f (x)p
∞ 1/2 (φK (f )(xp ) − f (x)p )i = yp , i y 2pi i=0 noting the series converges in A† because φK (f )(xp ) − f (x)p has positive valuation. (This choice of φ(y) ensures that φ(y)2 = φ(f (x)), so that the action on A† is well-defined. 2. Use a Newton iteration to compute y/φ(y). Then for i = 0, . . . , 2g−1, proceed as in § 3.1 to write φ∗ (ωi ) = pxpi+p−1
2g−1 y dx = dfi + Mij ωj φ(y) 2y j=0
(5)
for some fi ∈ A† and some 2g × 2g matrix M over K. We may use Algorithm 10 to compute Coleman integrals between endpoints in non-Weierstrass residue discs, as follows. (Note that our recipe is essentially Coleman’s construction of the integrals in this case.) Algorithm 11 (Coleman integration in non-Weierstrass discs). Input: The basis differentials {ωi }2g−1 i=0 , points P, Q ∈ X(Cp ) in non-Weierstrass residue discs, and a positive integer m such that the residue fields of P, Q are contained in Fpm . Q Output: The integrals { P ωi }2g−1 i=0 . 1. Calculate the action of the m-th power of Frobenius on each basis element (see Remark 12): 2g−1 (φm )∗ ωi = dfi + Mij ωj . (6) j=0
2. By change of variables (see Remark 13), we obtain 2g−1 j=0
Q
(M − I)ij
ωj = fi (P ) − fi (Q) − P
φm (P )
ωi − P
Q
φm (Q)
ωi
(7)
Explicit Coleman Integration for Hyperelliptic Curves
23
(the fundamental linear system). As the eigenvalues of the matrix M are algebraic integers of Cp -norm pm/2 = 1 (see [17, §2]), the matrix M − I is Q invertible, and we may solve (7) to obtain the integrals P ωi . Remark 12. To compute the action of φm , first perform Algorithm 10 to write φ∗ ωi = dgi +
2g−1
Bij ωj .
j=0
If we view f, g as column vectors and M, B as matrices, we then have (B)g f = φm−1 (g) + Bφm−2 (g) + · · · + BφK (B) · · · φm−2 K M = BφK (B) · · · φm−1 (B). K Remark 13. We obtain (7) as follows. By change of variables, Q φm (Q) ωi = (φm )∗ ωi φm (P )
P
Q
=
(dfi + P
2g−1
Mij ωj )
j=0
= fi (Q) − fi (P ) +
2g−1 j=0
Adding
φm (P ) P
ωi +
Q
Q φm (Q)
P
ωi +
P
Q
ωj . P
ωi to both sides of this equation yields
φm (P )
ωi =
Mij
Q
φm (Q)
ωi + fi (Q) − fi (P ) +
2g−1 j=0
Q
Mij
ωj , P
which is equivalent to (7). Definition 14. A Teichm¨ uller point of XQ is a point fixed by some power of φ. Each non-Weierstrass residue disc contains a unique such point: if (x, y) ∈ X is a non-Weierstrass point, the Teichm¨ uller point in its residue disc has xcoordinate equal to the usual Teichm¨ uller lift of x. This leaves two choices for the y-coordinate, exactly one of which has the correct reduction modulo p. Note that Teichm¨ uller points are always defined over finite unramified extensions of Qp . Remark 15. A variant of Algorithm 11 is to first find the Teichm¨ uller points P , Q in the residue discs of P, Q, then note that from the fundamental linear system (7), we have Q 2g−1 (M − I)ij ωj = fi (P ) − fi (Q ). (8) j=0
P
Q Q Q From (8), we obtain the integrals P ωi . Finally, write P ωi − P ωi as the Q P sum P ωi + Q ωi of tiny integrals.
24
3.4
J.S. Balakrishnan, R.W. Bradshaw, and K.S. Kedlaya
Weierstrass Endpoints of Integration
Suppose now that P, Q lie in different residue discs, at least one of which is Weierstrass. Since a differential ω of the form (2) is not meromorphic over Weierstrass Q residue discs, we cannot always even define P ω, let alone compute it. We will thus assume (to cover most cases arising in applications) that ω is everywhere meromorphic, with no pole at either P or Q. We then make the following observation. Lemma 16. Let ω be an odd, everywhere meromorphic differential on X. Choose P, Q ∈ X(Cp ) which are not poles of ω, with P Weierstrass. Then for ι the hyQ Q perelliptic involution, P ω = 12 ι(Q) ω. In particular, if Q is also a Weierstrass Q point, then P ω = 0. Proof. Let I := points, we have
Q
ι(Q) P (−ω) = ι(Q) ω. Then by additivity P ω = P Q ι(Q) ω = 2I, from which the result follows.
in the end-
If P belongs to a Weierstrass residue disc while Q does not, we find the Weierstrass point P in the disc of P , then apply Lemma 16 to write
Q
P
ω= P
P
1 ω+ 2
Q
ω.
(9)
ι(Q)
The first integral on the right side of (9) is tiny, while the second integral involves two points in non-Weierstrass residue discs, and so may be computed as in the previous section. The situation is even better if P, Q both belong to residue discs Q containing respective Weierstrass points P , Q : in this case, by Lemma 16, P ω P Q equals the sum P ω + Q ω of tiny integrals. Remark 17. Beware that Lemma 16 does not generalize to iterated integrals. For instance, for double integrals, if both integrands are odd, the total integrand is even, so the argument of Lemma 16 tells us nothing. It is thus worth considering alternate approaches for dealing with Weierstrass discs, which may generalize better to the iterated case. We concentrate on the case where P lies in a Weierstrass residue disc but Q does not, as we may reduce to this case by splitting R Q Q ω = P ω + R ω for some auxiliary point R in a non-Weierstrass residue P disc. In Algorithm 11, the form fi belongs to A† and so need not converge at P . However, it does converge at any point R near the boundary of the disc, i.e., in the complement of a certain smaller disc which can be bounded explicitly. We R Q Q may thus write P ωi = P ωi + R ωi for suitable R in the disc of P , to obtain an analogue of the fundamental linear system (7). Similarly, when we write
Explicit Coleman Integration for Hyperelliptic Curves
25
ω as in (3), we can find R close enough to the boundary of the disc of P so that f Q R converges at R, use (3) to evaluate R ω, then compute P ω as a tiny integral. One defect of this approach is that forcing R to be close to the boundary of the residue disc of P forces R to be defined over a highly ramified extension of Qp , over which computations are more expensive. An alternate approach exploits the fact that for P in the infinite residue disc Q but distinct from the point at infinity, we may compute P ω directly using Algorithm 11. This works because both the Frobenius lift and the reduction process respect the subring of A† consisting of functions which are meromorphic at infinity. When P lies in a finite Weierstrass residue disc, we may reduce to the previous case using a change of variables on the x-line to move P to the infinite disc. However, one still must use the approach of the previous paragraph Q Q to reduce evaluation of P ω to evaluation of the P ωi .
4
Implementation Notes and Precision
We have implemented the above algorithms in Sage [24] for curves defined over Qp . In doing so, we made the following observations. 4.1
Precision Estimates
For a tiny integral, the precision of the result depends on the truncation of the power series computed. Here is the analysis for a non-Weierstrass disc; the analysis for a Weierstrass disc, using a different local interpolation, is similar. (For points over ramified extensions, one must also account for the ramification index in the bound, but it should be clear from the proof how this is done.) Q Proposition 18. Let P ω be a tiny integral in a non-Weierstrass residue disc, with P, Q defined over an unramified extension of K and accurate to n digits of precision. Let (x(t), y(t)) be the local interpolation between P and Q defined by x(t) = x(P )(1 − t) + x(Q)t = x(P ) + t(x(Q) − x(P )) y(t) = f (x(t)). Let ω = g(x, y)dx be a differential of the second kind such that h(t) = g(x(t), y(t)) belongs to O[[t]]. If we truncate h(t) modulo tm , then the computed value of the Q integral P ω will be correct to min{n, m + 1 − logp (m + 1) } digits of (absolute) precision. Proof. Let t = t(x(Q) − x(P )). As P, Q are in the same residue disc and are defined over an unramified ∞extension of K, we have vp (x(Q) − x(P )) ≥ 1. If we expand g(x(t ), y(t )) = i=0 ci (t )i , then by hypothesis ci ∈ O. Thus
26
J.S. Balakrishnan, R.W. Bradshaw, and K.S. Kedlaya
Q
Q
ω= P
g(x, y)dx P 1
g(x(t), y(t))dx(t)
= 0
=
0
=
0
x(Q)−x(P )
g(x(t ), y(t ))dt
∞ x(Q)−x(P )
ci (t )i dt
i=0
∞ ci (x(Q) − x(P ))i+1 . = i + 1 i=0
The effect of omitting ci (t )i from the expansion of g(x(t ), y(t )) for some i ≥ m is to change the final sum by a quantity of valuation at least i+1− logp (i+1) ≥ m+1− logp (m+1) . The effect of the ambiguity in P and Q is that the computed value of (x(Q) − x(P ))i+1 differs from the true value by a quantity of valuation at least i + 1 − logp (i + 1) + n − 1 ≥ n. For Coleman integrals between different residue discs, which we may assume are non-Weierstrass thanks to § 3.4, one must first account for the precision loss in Algorithm 10. According to [17, Lemmas 2,3] and the erratum to [17] (or [15]), working to precision pN in Algorithm 10 produces the fi , Mij accurately modulo pN −n for n = 1 + logp max{N, 2g + 1} . We must then take into account the objects involved in the linear system (7), as follows. Q Proposition 19. Let P ω be a Coleman integral, with ω a differential of the second kind and with P, Q in non-Weierstrass residue discs, defined over an unramified extension of Qp , and accurate to n digits of precision. Let Frob be the matrix of the action of Frobenius on the basis differentials. Set B = Frobt −I, Q and let m = vp (det(B)). Then the computed value of the integral P ω will be accurate to n − max{m, logp n } digits of precision. Proof. By the linear system (7), the Coleman integral is expressed in terms of tiny integrals, integrals of exact forms evaluated at points, and a matrix inversion. Suppose that the entries of B = Frobt −I are computed to precision n. Then taking B −1 , we have to divide by det(B), which lowers the precision by m = vp (det(B)). By Proposition 18, computing tiny integrals (with the series expansions truncated modulo tn−1 ) gives a result precise up to n− logp n digits. Q Thus the value of the integral P ω will be correct to n−max{m, logp n } digits of precision. 4.2
Complexity Analysis
We assume that asymptotically fast integer and polynomial multiplication algorithms are used; specifically addition, subtraction, multiplication, and divi sion take O(log N ) bit operations in Z/N Z and O(n) basering operations in
Explicit Coleman Integration for Hyperelliptic Curves
27
R[x]/xnR[x]. In particular, this allows arithmetic operations in Qp to n (rela log p). Using tive) digits of precision, hereafter called field operations, in time O(n Newton iteration, both square roots and the Teichm¨ uller character can be com puted to n digits of precision using O(log n) arithmetic operations. (We again consider only points in non-Weierstrass discs defined over unramified fields.) Q Proposition 20. Let P ω be a Coleman integral on a curve of genus g over Qp , 2g−i with ω = dfω + i=1 ci ωi a differential of the second kind and with P, Q in nonWeierstrass residue discs, defined over Qp , and accurate to n digits of precision. Let Frob be the matrix of the action of Frobenius on the basis differentials, and let m = vp (det(Frobt −I)). Let F (n) be the running time of evaluating fω at P Q and Q to n digits of precision. The value of the integral P ω can be computed 2 2 g + g 3 n log p). to n − max{m, logp n } digits of precision in time F (n) + O(pn (Over a degree N unramified extension of Qp , the analysis is the same with the runtime multiplied by a factor of N .) Proof. An essential input to the algorithm is the matrix of the action of Frobenius, which can be computed by Kedlaya’s algorithm to n digits of precision 2 2 in running time O(pn g ). Inverting the resulting matrix can be (na¨ıvely) done 3 with O(g ) arithmetic operations in Qp . It remains to be shown that no other step exceeds these running times. For the tiny integral on the first basis differential, the power series x(t)/y(t) = x(t)f (x(t))−1/2 can be computed modulo tn−1 log n) field operations. Each other basis using Newton iteration, requiring O(n differential can be computed from the first by multiplication by the linear poly nomial x(t) and the definite integral evaluated with O(n) field operations, for a 2 total of O(gn ) bit operations. Computing φ(P ) and φ(Q) to n digits of preci + log p) field sion is cheap; directly using the formula in Algorithm 10 uses O(g operations. The last potentially significant step is computing and evaluating the fi at each P and/or Q. The coefficients of the fi can be read off in the reduction phase of Kedlaya’s algorithm, and have O(png) terms each. Evaluating (or even 2 2 2 ) field operations, or O(pn g ) bit recording) all g of these forms takes O(png operations, which is proportional to the cost of doing the reduction. 4.3
Numerical Examples
Here are some sample computations made using our Sage implementation. Additional examples will appear in the first author’s upcoming PhD thesis. Example 21. Lepr´evost [21] showed that the divisor (1, −1) − ∞+ on the genus 2 curve y 2 = (2x − 1)(2x5 − x4 − 4x2 + 8x − 4) over Q is torsion of order 29. Consequently, the integrals of holomorphic differentials against this divisor must vanish. We may observe this vanishing numerically, as follows. Let C : y 2 = x5 +
1 33 4 3 3 3 2 1 x + x + x − x+ 16 4 8 4 16
28
J.S. Balakrishnan, R.W. Bradshaw, and K.S. Kedlaya
be the pullback of Lepr´evost’s curve by the linear fractional transformation x → (1 − 2x)/(2x) taking ∞ to 1/2. The original points (1, −1), ∞+ correspond to the points P = (−1, 1), Q = (0, 14 ) on C. The curve C has good reduction at p = 11, and we compute
Q
P
Q
ω0 =
Q
ω1 = O(116 ), P
ω2 = 7·11+6·112 +3·113 +114 +5·115 +O(116 ), P
consistent with the fact that Q − P is torsion and ω0 , ω1 are holomorphic but ω2 is not. Example 22. We give an example arising from the Chabauty method, taken from [23, § 8.1]. Let X be the curve y 2 = x(x − 1)(x − 2)(x − 5)(x − 6), whose Jacobian has Mordell-Weil rank 1. The curve X has good reduction at 7, and X(F7 ) = {(0, 0), (1, 0), (2, 0), (5, 0), (6, 0), (3, 6), (3, −6), ∞}. By [23, Theorem 5.3(2)], we know |X(Q)| ≤ 10. However, we can find 10 rational points on X: the six rational Weierstrass points, and the points (3, ±6), (10, ±120). Hence |X(Q)| = 10. Since the Chabauty condition holds, there must exist a holomorphic differQ ential ω for which ∞ ω = 0 for all Q ∈ X(Q). We can find such a differential by taking Q to be one of the rational non-Weierstrass points, then computing Q Q a := ∞ ω0 , b := ∞ ω1 and setting ω = bω0 − aω1 . For Q = (3, 6), we obtain a = 6 · 7 + 6 · 72 + 3 · 73 + 3 · 74 + 2 · 75 + O(76 ) b = 4 · 7 + 2 · 72 + 6 · 73 + 4 · 75 + O(76 ). We then verify that
R Q
ω vanishes for each of the other rational points R.
Remark 23. It is worth pointing out some facts not exposed by Example 22. For instance, since ω is already determined by a single rational non-Weierstrass point, we could have used it instead of a brute-force search to find other rational points. More seriously, in other examples, the integral ω may vanish at a point defined over a number field which has a rational multiple in the Jacobian. Such points may be difficult to find by brute-force search; it may be ∗ easier to reconstruct them from p-adic approximations, obtained by writing ∞ ω as a function of a linear parameter of a residue disc, then finding the zeroes of that function.
5
Future Directions
Here are some potential extensions of our computation of Coleman integrals.
Explicit Coleman Integration for Hyperelliptic Curves
5.1
29
Iterated Integrals
Coleman’s theory of integration is not limited to single integrals; it gives rise to an entire class of locally analytic functions, the Coleman functions, on which antidifferentiation is well-defined. In other words, one can define integrals Q ωn · · · ω1 P
which behave formally like iterated path integrals tn−1 1 t1 ··· fn (tn ) · · · f1 (t1 ) dtn · · · dt1 . 0
0
0
These appear in several applications of Coleman integration, e.g., p-adic regulators in K-theory, and the nonabelian Chabauty method. As in the case of a single integral, one can use Frobenius equivariance to compute iterated Coleman integrals on hyperelliptic curves. One obtains a linear system expressing all n-fold integrals of basis differentials in terms of lower order integrals. Note that the number of such n-fold integrals is (2g)n , so this is only feasible for small n. The cases n ≤ 4 are already useful for applications, but ideas for reducing the combinatorial explosion for larger n would also be of interest. (One must be slightly careful in dealing with Weierstrass residue discs; see Remark 17.) We have made some limited experiments with double Coleman integrals in Sage. The Fubini identity Q
Q
ω2 ω1 + P
Q
ω1 ω2 = P
Q
ω1 P
ω2 P
turns out to be a useful consistency check for both single and double integrals. 5.2
Beyond Hyperelliptic Curves
It should be possible to convert other algorithms for computing Frobenius actions on de Rham cohomology, for various classes of curves, into algorithms for computing Coleman integrals on such curves. Candidate algorithms include the adaptation of Kedlaya’s algorithm to superelliptic curves by Gaudry and G¨ urel [14], or the general algorithm for nondegenerate curves due to Castryck, Denef, and Vercauteren [7]. It should also be possible to compute Coleman integrals using Frobenius structures on Picard-Fuchs (Gauss-Manin) connections, extending Lauder’s deformation method for computing Frobenius matrices [20]. 5.3
Heights After Harvey
We noted earlier that our algorithms for Coleman integration over Qp have linear runtime dependence on the prime p, arising from the corresponding dependence
30
J.S. Balakrishnan, R.W. Bradshaw, and K.S. Kedlaya
in Kedlaya’s algorithm. In [15], Harvey gives a variant of Kedlaya’s algorithm with only square-root dependence on p (but somewhat worse dependence on other parameters), by reorganizing the computation so that the dominant step is finding the p-th term of a linear matrix recurrence whose coefficients are polynomials in the sequence index. Harvey demonstrates the practicality of his algorithm for primes greater than 250 , which may have some relevance in cryptography for finding curves of low genus with nearly prime Jacobian orders. It should be possible to use similar ideas to obtain square-root dependence on p for Coleman integration, by constructing a recurrence that computes not just the entries of the Frobenius matrix but also the values fi (P ) and fi (Q). However, this is presently a purely theoretical question, as we do not know of any applications of Coleman integration for very large p. Acknowledgments. The authors thank William Stein for access to his computer sage.math.washington.edu (funded by NSF grant DMS-0821725), and Robert Coleman and Bjorn Poonen for helpful conversations. Balakrishnan was supported by a National Defense Science and Engineering Graduate Fellowship and an NSF Graduate Research Fellowship. Bradshaw was supported by NSF grant DMS-0713225. Kedlaya was supported by NSF CAREER grant DMS0545904, the MIT NEC Research Support Fund, and the MIT Cecil and Ida Green Career Development Professorship. Some development work was carried out at the 2006 MSRI Summer Graduate Workshop on computational number theory, and the 2007 Arizona Winter School on p-adic geometry.
References 1. Balakrishnan, J.S.: Local heights on hyperelliptic curves (2010) (in preparation) 2. Berkovich, V.G.: Integration of one-forms on p-adic analytic spaces. Annals of Mathematics Studies, vol. 162. Princeton University Press, Princeton (2007) 3. Besser, A.: Coleman integration using the Tannakian formalism. Math. Ann. 322(1), 19–48 (2002) 4. Besser, A.: On the computation of p-adic height pairings on Jacobians of hyperelliptic curves, Sage Days 5 (2007), http://wiki.sagemath.org/days5/sched 5. Besser, A., de Jeu, R.: Li(p) -service? An algorithm for computing p-adic polylogarithms. Math. Comp. 77(262), 1105–1134 (2008) 6. Bosch, S., G¨ untzer, U., Remmert, R.: Non-Archimedean analysis: A systematic approach to rigid analytic geometry. Springer, Berlin (1984) 7. Castryck, W., Denef, J., Vercauteren, F.: Computing zeta functions of nondegenerate curves. IMRP Int. Math. Res. Pap., Art. ID 72017, 57 (2006) 8. Coleman, R., de Shalit, E.: p-adic regulators on curves and special values of p-adic L-functions. Invent. Math. 93(2), 239–266 (1988) 9. Coleman, R.F.: Dilogarithms, regulators and p-adic L-functions. Invent. Math. 69(2), 171–208 (1982) 10. Coleman, R.F.: Torsion points on curves and p-adic abelian integrals. Ann. of Math. (2) 121(1), 111–168 (1985) 11. Coleman, R.F., Gross, B.H.: p-adic heights on curves. In: Algebraic Number Theory – in honor of K. Iwasawa. Advanced Studies in Pure Mathematics, vol. 17, pp. 73– 81 (1989)
Explicit Coleman Integration for Hyperelliptic Curves
31
12. Fresnel, J., van der Put, M.: Rigid analytic geometry and its applications. In: Progress in Mathematics, vol. 218. Birkh¨ auser Boston Inc., Boston (2004) 13. Furusho, H.: p-adic multiple zeta values. II. Tannakian interpretations. Amer. J. Math. 129(4), 1105–1144 (2007) 14. Gaudry, P., G¨ urel, N.: An extension of Kedlaya’s point-counting algorithm to superelliptic curves. In: Boyd, C. (ed.) ASIACRYPT 2001. LNCS, vol. 2248, pp. 480–494. Springer, Heidelberg (2001) 15. Harvey, D.: Kedlaya’s algorithm in larger characteristic. Int Math Res Notices, Article ID No. rnm095, 2007, 29 (2007) 16. Harvey, D.: Efficient computation of p-adic heights. LMS J. Comput. Math. 11, 40–59 (2008) 17. Kedlaya, K.S.: Counting points on hyperelliptic curves using Monsky-Washnitzer cohomology. J. Ramanujan Math. Soc. 16, 323–338 (2001); erratum ibid 18, 417– 418 (2003) 18. Kim, M.: The unipotent Albanese map and Selmer varieties for curves. Publ. Res. Inst. Math. Sci. 45(1), 89–133 (2009) 19. Kim, M.: Massey products for elliptic curves of rank 1. J. Amer. Math. Soc. 23, 725–747 (2010); Erratum by Balakrishnan, J.S., Kedlaya, K.S., Kim, M., http://www.ucl.ac.uk/~ ucahmki/ 20. Lauder, A.G.B.: Deformation theory and the computation of zeta functions. Proc. London Math. Soc. 88(3), 565–602 (2004) 21. Lepr´evost, F.: Jacobiennes de certaines courbes de genre 2: torsion et simplicit´e. J. Th´eor. Nombres Bordeaux 7(1), 283–306 (1995) 22. Mazur, B., Stein, W., Tate, J.: Computation of p-adic heights and log convergence. Doc. Math. Extra, 577–614 (2006) (electronic) 23. McCallum, W., Poonen, B.: The method of Chabauty and Coleman (2007) (preprint) 24. Stein, W.A., et al.: Sage Mathematics Software (Version 4.3.5), The Sage Development Team (2010), http://www.sagemath.org
Smallest Reduction Matrix of Binary Quadratic Forms And Cryptographic Applications Aurore Bernard1 and Nicolas Gama2 1
XLIM, Limoges, France
[email protected] 2 GREYC Ensicaen, Caen, France
[email protected]
Abstract. We present a variant of the Lagrange-Gauss reduction of quadratic forms designed to minimize the norm of the reduction matrix within a quadratic complexity. The matrix computed by our algorithm 1 4 on the input f has norm O f 1 2 Δf , which is the square root of the best previously known bounds using classical algorithms. This new bound allows us to fully prove the heuristic lattice based attack against NICE Cryptosystems, which consists in factoring a particular subclass of integers of the form pq 2 . In the process, we set up a homogeneous variant of Boneh-Durfee-HowgraveGraham’s algorithm which finds small rational roots of a polynomial modulo unknown divisors. Such algorithm can also be used to speed-up factorization of pq r for large r.
1
Introduction
Binary quadratic forms appeared progressively in the 17-th century, when Descartes and Fermat first introduced the concept of coordinates as a tool to algebraically solve geometric problems. Those forms have wide applications in mathematics and physics, especially in geometry, numerical analysis or algebraic topology. A binary quadratic form is a homogeneous polynomial of degree two in two variables, which can be viewed as the Cartesian equation of a surface f x, y ax2 bxy cy 2 on a given basis of R2 . Of course, this equation varies with the basis of expression, and it is natural to define an equivalence relation to regroup all these possible equations into classes. Over the real field, there are six classes corresponding to the Sylvester’s signatures. They can be distinguished by the sign of the discriminant Δf b2 4ac, and the sign of a c. Forms of strictly negative discriminant (imaginary forms) have a unique zero at the origin, which is also their unique local and global extremum. Forms of strictly positive discriminant (real forms) represent a saddle-shape. Meanwhile, quadratic forms were also used over the integer ring by Fermat, Lagrange and Gauss to solve long standing problems from number theory. This time, binary quadratic forms are equations with integer coefficients of discrete G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 32–49, 2010. c Springer-Verlag Berlin Heidelberg 2010
Smallest Reduction Matrix of Binary Quadratic Forms
33
scatter-plots on a given lattice basis of Z2 . One defines a similar equivalence relation by base change, except that transformation matrices are now unimodular, and that they preserve the value of the discriminant. Problems related to this equivalence are more complicated than on the real field: for instance, in both real and imaginary cases, we do not know any polynomial way to compute the number of equivalence classes of a given discriminant. Deciding the equivalence of two forms is easy in the imaginary case, where each class contains a unique reduced representative computable in polynomial time. However, the problem is hard in the real case, where there are, depending on the notion of reduction, either an exponential number of polynomially computable reduced representatives, or a few representatives computable in exponential time. A reduction algorithm takes as input a quadratic form and outputs a reduced form and the reduction matrix, which is a unimodular base-change matrix used to obtain this form. The most famous polynomial time reduction algorithms are Lagrange algorithm [15] (1773) commonly known as ”Gauss reduction” algorithm [11] (1801). In [14] (1980), Lagarias modified the Gauss reduction algorithm for make it more efficient. This algorithm is the one used in practice, and which we refer as the Gauss reduction algorithm, or Classical Gauss, if we need to differentiate it from new flavors which we propose. The cryptanalysis of [6] shows experimental evidences that the small size of reduction matrices have important applications to the factorization of some large numbers used in public key cryptosystems, especially those of the NICE cryptosystems (see [12,13]). However the best currently known upper-bounds on the size of reduction matrices [14,1] are by an order too large, and keep all these results on the factorization heuristic. In this paper, we specially design an efficient variant of the Gauss reduction algorithm to minimize the size of transformation matrix, and we prove constructive upper-bounds which are tight both in the worst case and in the average case. These bounds, combined with an improvement of the methods of [6], allows us to prove all the above mentioned heuristics of on the factorization of integers from the NICE cryptosystems.
2
Preliminaries and Notation
In this section we recall some definitions and properties concerning binary quadratic forms. For a more detailed account of the theory see [5,4,9]. Then, we summarize some results on the norm of a matrix. Quadratic Forms. A binary quadratic form f is a homogeneous polynomial of degree two in two variables f x, y ax2 bxy cy 2 with a, b, c Z3 which we abbreviate as f a, b, c. Throughout this paper the word form will be used in the sense of binary quadratic form. It is said primitive when gcd a, b, c 1. The discriminant of f is Δf b2 4ac. A discriminant Δf is called fundamental if all the forms of discriminant Δf are necessarily primitive: for example, it is the case of all odd and square-free integers. The set of all primitive forms of discriminant Δf is denoted FΔf . We impose that the discriminant is not a perfect square then a and c are always non-zero. The form f can be factored as
34
A. Bernard and N. Gama
f x, y a x yζf x yζf where ζf and ζf are the complex roots of the univariate polynomial f x, 1 which we call the affine representation of f . When Δf 0, each root of f live in RQ and the form is real. In this case, ζf will denote the smallest root and ζf the largest one. When Δf 0, the roots are in CR and the form is imaginary. We note λ f min f x, y : x, y Z2 0, 0 the first minimum of f . We note Mt the transpose of amatrix M. The a b 2 polar representation of f is the symmetric matrix b of determinant
2 c αβ Δf 4. Let M M2 Z be a 2 2 matrix with integer enγ δ tries which we often abbreviate as α, β; γ, δ . We note Id the identity matrix of M2 Z. The composition action of M on f is defined as the form g x, y f αx βy, γx δy and it is noted g f.M. The coefficients of g are g f α, γ , b αδ γβ 2 aαβ cγδ, f β, δ. We remark that for each Composition Action.
root ζg of g,
αζg β γζg δ
is a root of f . Finally, the polar representation of g is
M f M which implies that Δg t
det M2 Δf .
Group action. Let GL2 Z be the general linear group of matrices in M2 Z which are invertible and its subgroup SL2 Z the special linear group of matrices which have a determinant equal to one. The action defined with either GL2 Z or SL2 Z on the set of primitive forms FΔf of a given discriminant is a (right) group action. Two forms f and g are equivalent if they belong to the same SL2 Z-orbit. In this case we note f g. We define Aut f the group of automorphisms of the form f FΔf as M SL2 Z, trace M 0 and f.M f . The set of all automorphisms of f is Aut f . The group Aut f is known to be cyclic, and we call its generator the fundamental automorphism of f . The largest eigenvalue of the fundamental automorphism of f is the fundamental unit. It only depends on the discriminant Δf , and will be denoted Δf .
1 0 Three specials transformations. We define the symmetry S , the 0 1 01 1h and the translation by an integer T h . They are exchange E 10 01 three (linear) transformations of GL2 Z. All matrices in GL2 Z can be written as a product of powers of these three transformations and SL2 Z is generated by the product ES and T 1. The action of these transformations on f are f.S a, b, c, f.E c, b, a f.T h a, b 2ah, f h. Note the important fact: the roots of f.S are the opposite of the roots of f and the roots of f.E are the inverse of the roots of f , and that T h subtracts h to each roots of f . Norms of matrices and forms. Let M α, β; γ, δ be a matrix in M2 Z. The Euclidean norm is M2 α2 β 2 γ 2 δ 2 , and the maximum norm is M max α, β , γ , δ . The norm M supv2 1 M.v2 is the induced Euclidean norm, which is also the square root of the largest eigenvalue of Mt M. All the norms are equivalent: M M M2 2M.
Smallest Reduction Matrix of Binary Quadratic Forms
35
Additionally, the induced norm is sub-multiplicative: if N M2 Z then MN M N and Id 1, and it is lower-bounded by the spectral radius ρ M, which is the supremum among the absolute values of the eigenvalues of M. By extension, we define the norms f ,f 2 and f of a form as the corresponding norm of its polar representation.
3
A New Reduction Algorithm for Real Quadratic Forms
A form f a, b, c is reduced if it satisfies two conditions simultaneously: a normalization condition, which defines the choice of the representative of b mod 2a, and a reduction condition, which often upper-bounds the size of a (or c). In the imaginary case, these conditions are very natural: a form is normal if and only if b a, a is minimal, and is reduced if additionally, a is the minimum λ f . A single translation is needed to normalize any form. However, the reduction condition takes more steps to be achieved. The classical Gauss reduction reduces a form by successive swaps SE and normalizations T b 2a (see [1]) until f is reduced. The Gauss reduction algorithm operates in quadratic time (see [1,21,18]). For each form f of discriminant Δf 4, there exists a unique reduced form g in each equivalence class, and a unique reduction matrix M SL2 Z such that f.M g. In this case Aut f Id . In the real case (Δf 0), the previous reduction conditions applied on f a, b, c are too restrictive, since the smallest integers α, β 0, 0 such that f α, β λ f are in general exponential in the size of f . No polynomial time algorithm can output an exponential reduction matrix. Thus, according to classical notions, f is classically normalized if and only if b a, a when a Δf and b Δ 2a, Δf when a Δf , and f is classically f reduced if additionally, Δf 2a b Δf . It is known that only a finite subset of forms of discriminant Δf are classically-reduced, and that they form a reduced cycle in each class. The Real-Gauss reduction algorithm, which uses the classical normalization, finds a reduced form equivalent to its input in quadratic time (see [1]). In this paper, given a normalized form f , we will bound the coefficients of the smallest reduction matrix M α, β; γ, δ such that g f.M ag , bg , cg is reduced. The case of imaginary forms is eased by the uniqueness of the reduction a,c . We improve this matrix. Lemma 5.6.1 in [1] give us that M 2 max upper-bound with the following theorem:
Δf
Theorem 1 (Imaginary Bound). Let f a, b, c be a normalized imaginary form of discriminant Δf 0, and M α, β; γ, δ the reduction matrix such that g f.M ag , bg , cg , M satisfies these two upper-bounds: 1) M
2) αβγδ
23
14
c
ag 1 γδ 2
2 31 4
ac Δf
14
.
36
A. Bernard and N. Gama
bounded by fore γδ
α γ b 2 Δf2 , which can be lower2a 4a 4 aag 4 cc 2 γ Δf , and similarly δ 2 Δfg . There-
Proof. One has ag f α, γ aγ 2
Δf γ 2 . It follows that 4a 4 ac . The first inequality comes from 3ag cg 3Δf
Δf ,
because
g is reduced. Unless the transformation is trivial (Id or SE), the normalization condition induces the inequalities α γ and β δ , which proves 1 1 αβγδ 4 γδ 2 . Thus, the norm of the reduction matrix is in fact basically in O
f
Δf
.
In the real case however, this proof would not apply directly, because the Δf b 2 α term
γ 2a 4a2 can be exponentially close to 0. The problem is that in the real case, each reduced cycle contains a large (often exponential) number of equivalent reduced forms, and some of them are exponentially far from f . A constructive approach is needed to build a polynomial reduction matrix. The analysis of the Gauss reduction algorithm in [1,14] basically proves that the norm of the computed reduction matrix is bounded by O f . In this paper, we study a variant of this algorithm which finds a reduction matrix of norm
Δf and we verify that it is tight even in the average case. We define new relaxed notions of reduction and normalization, and express them according to the roots of the forms, which is more intuitive than the classical conditions on the coefficients: O
f
Definition 1. A real binary quadratic form f is: – primary normalized if 0 ζf 1 and primary reduced if also ζf 1 – secondary normalized if 1 ζf 0 and secondary reduced if also 1 ζf . Finally f is largely reduced if it is either primary or secondary reduced. Both primary and secondary notions are exchanged by the action of S, which negates the roots. Furthermore, primary and secondary reductions are exchanged by E, which inverts the roots. As usual, primary and secondary normalization can always be achieved by the action of some T h. Note that a classically normalized form, which has by definition at least one root in the interval 1, 1, is either primary or secondary normalized. Similarly, a classically reduced form a, b, c is a largely-reduced form satisfying b 0, which can again be ensured by the action of S. Our main contribution is to solve the following problems, which are equivalent. Lemma 1. The two problems are equivalent: 1. Smallest SL2 Z matrix Given a classically-normalized real form f , find M SL2 Z such that f.M is classically-reduced and M is minimal. 2. Smallest GL2 Z matrix Given a primary-normalized real form f , find M GL2 Z such that f.M is largely-reduced and M is minimal.
Smallest Reduction Matrix of Binary Quadratic Forms
37
Proof. From a solution M GL2 Z of Problem 2, one deduces a solution of Problem 1 by left-multiplication by Id or S to make the normalization of the input correspond, followed by a right-multiplication by Id or S to force the coefficient b of the reduced form to be positive, followed by a right multiplication by Id or E so that the determinant is 1. The reduction of Problem 2 to Problem 1 is similar. Since Id, S and E are permutation matrices, they do not modify these norms or . Remark that, reducing a problem to the other also preserves the absolute value of the product of the coefficients in each row of the reduction matrices. Lemma 1 motivates the search of a reduction algorithm solving the less restrictive Problem 2, since we can use the above permutation matrices to return to classical notions in SL2 Z. 3.1
Algorithm and Analysis
Let f be a real form. We define the two integers h f and hf as hf hf
ζf
and
ζf . It is easy to show that h f and hf are respectively the unique integers
such that f.T h f is primary-normalized, and f.T hf is secondary-normalized. Among the two integers hf , h f the one of smallest absolute value is noted h f : that is h f hf if hf hf , and h f hf otherwise. In other words, h f is the shortest normalization of f . As a comparison, there is only a single integer νf in the classical case such that f.T νf is classically-normalized, νf being one of the integers hf , h f but not necessarily the one with the smallest absolute value. Our reduction algorithm, is a variant of the Gauss reduction which operates in GL2 Z. It alternates exchange E and the shortest normalization T h f at each loop, and terminates on a largely-reduced form. As we will see later, any kind 1 of normalization by hf or h f would make a reduction algorithm terminate , but the choice of the shortest normalization h f instead of the classical νf (especially during the last steps) is the key element to minimize the reduction matrix. The main result of the section is the following theorem on the quality of the output of our algorithm, which is the real-case analogue of Theorem 1. Algorithm 1. RedGL2 Input: f a, b, c a primary-normalized form Output: f.M a largely-reduced form and M GL2 Z 1: M Id 2: while f not largely-reduced do 3: f f.E and M ME 4: f f.T hf and M MT hf 5: end while 6: return f and M
1
Exchange step Normalization step
The original Gauss algorithm of 1801 used actually the largest normalization at each step. The number of reduction steps is exponential on some entries. Lagarias introduced the classical normalization to obtain a quadratic complexity
38
A. Bernard and N. Gama
Theorem 2 (Real bound). Let f a, b, c be a primary-normalized form oflogdiscriminant Δ 0. Given f as input, RedGL2 terminates after at most
a Δ 4 iterations where ω 15 is the gold number. Its output M 2 log ω 2 α, β; γ, δ and fr
1) M 4
2) αβγδ
14
a
f.M ar , br , cr satisfies:
ar
γδ 2 1
21
a Δ.
Before proving this theorem, we remark that the best known upper-bounds achieved by the classical Gauss algorithm under the conditions same (see theo1 rem 4.4 of [1]) are M a 1 1 Δ and γδ 2 a Δ 1 1 Δ. They are basically the square of the upper-bounds of RedGL2. Figure 1 and 2 illustrate respectively the families of forms Fn n, b, 1 and Gn n, n, 1 with n N and b 2n 3 2 3 , which are families of forms where the Gauss reduction algorithm outputs reduction matrices Δ times larger than our variant RedGL2. Finally, note that a multiplicative triangular inequality on the norms of the polar representations of f fr .M 1 yields f fr 2M, which confirms the optimality of Theorem 2 in average. The analysis of Gauss reduction algo log a Δ rithm in [1] upper-bounds the number of iterations by 2 log 2 2 reduction steps. Our upper-bound on the number of iterations of RedGL2 is tight in the worst case, and is only by a multiplicative factor around 1.4 larger than the maximum number of iterations of the Gauss reduction algorithm. However the primary goal of RedGL2 is the minimization of the reduction matrix. 3.2
Proof of Theorem 2
To prove Theorem 2, we first study the termination cases, characterized by the presence of integers between the roots of f.E, and where the choice of the shortest normalization is of greatest importance. Eventually, we shall treat the general case and the complexity. Termination cases. We first study the two cases where the algorithm terminates in a single step of reduction. The first one deals with normal form f containing exactly one integer between its roots. This is the only case where hf h f , so all notions of normalizations (classical, primary, secondary, shortest) coincide. Lemma 2. Let f a, b, c be a real form satisfying 1 ζf 0 ζf 1, and h h f.E . The form fr f.ET h ar , br , cr is largely-reduced, and its coefficients satisfy ar c, cr a, and h2 ar a. Proof. The reduction matrix from f to fr is ET h 0, 1; 1, h. Consider the parabola p x cx2 bx a which is the affine representation of g f.E. Then we have h h g , and ζg hg 1 1 h g ζg , cr p h g b and p 0 a. By definition of h we have two cases: if 2c 0 then we have h hg 0 b 2c, else we have b 2c 0 h h g . In both cases we
Smallest Reduction Matrix of Binary Quadratic Forms px=cx2 +bx+a
h
px=cx2+bx+a
a
a
h
ζg ζg
0 νg
b
2c
Gauss
ζg
h=hg νg
cr
39
h-1
ζg h =hg
cr
h-1
Red GL2
Fig. 1. Illustration of Lemma 2 This figure illustrates the convexity inequalities of Lemma 2. In this case, the shortest normalization chosen by RedGL2 is hg ζg , which can be O Δ smaller than the classical normalization ν g ζg in Gauss Algorithm. It is clear that cr is in the interval 0, a . Comparison of heights of the two rectangles on the same convex and decreasing branch of the parabola, gives ch2 a .
Fig. 2. Illustration of Lemma 3 This figure is the analogue for Lemma 3. In this case, the shortest normalization chosen by RedGL2 is hg ζg , which can be O Δ smaller than the classical normalization in Gauss algorithm is ν g ζg . Inequality on the slopes of p before and after ζg gives cr a . Comparison of heights of the two rectangles on the same convex and decreasing branch of the parabola, gives ch 12 a .
graphically verify that cr p h p 0 a (see Figure 1). A convexity inequality on p between 0, h and b 2c, b 2c h shows a cr ch2. Since a and cr have the same sign and a is larger, then a ar h2 . Theorem 2 holds in this termination case: the reduction matrix is M 0, 1; 1, h. By Lemma 2, its norm satisfies M h a ar . Since f fr .M 1 , its first coefficient is a ar h2 br h cr , thus br h a cr ar h2 and br h2 4ar cr h2 Δ h2 a2 c2r a2r h4 2acr 2aar h2 2ar cr h2 a cr ar h2 2 9a2 , which proves the second point of Theorem 2. The second case of single-step termination concerns normalized form f such that at least two integers lie between the roots of f.E (namely hf.E h f.E ). We just write a proof for primary-normalized forms, but it can be easily extended to secondary-normalized forms. Lemma 3. Let f a, b, c be a real form satisfying 0 ζf ζf 1, and such that hf.E h f.E . If h h f.E , then fr f.ET h ar , br , cr is secondaryreduced, and its coefficients satisfy ar c, cr a, and h2 ar 4a. Proof. The proof of this lemma is also based on convexity inequalities. Let g f.E, of affine representation p x cx2 bx a. Note that h ζg 2. Again, one has p 0 a, p h cr . It follows from the definition that fr is
40
A. Bernard and N. Gama
secondary-reduced. The reduction matrix is M 0, 1; 1, h, which proves ar c. Application of a convexity inequality (see Figure 2) on p in the two intervals b b 0; h 1 and 2c h 1; 2c of same length yields ar h 12 a p h 1 a, therefore ar h2 4ar h 12 4a. Finally, another convexity inequality centered on ζg gives p
h cr .
p ζg
p 0
0
ζg
p ζg , so a p 0 h ζg
ζg
p h
h ζg
Once again, Theorem 2 holds in this termination case, but this time, M 2 h 2 a ar and Δ h2 a cr ar h2 2 6a .
General case. We now prove the general case of Theorem 2. We call fi ai , bi , ci the successive values of f at the beginning of the while loop of Algorithm 1, and hi h fi .E . We suppose that the primary-normalized form f0 does not have any integer between its roots (otherwise it would either already be reduced or as in Lemma 2). Thus 0 ζf0 ζf0 1. For each iteration i in the loop, if there is at least one integer between the roots of fi .E, then we set m i 1 and the algorithm reaches one of the two termination cases above. Otherwise the shortest normalization hi is the primary one hi h fi .E hfi .E . Thus fi is also primary-normalized and 0 ζfi ζfi 1. Note that the
distance between the roots strictly increases ζfi
ζf
ζf
i1
1
i1
i1
ζf
ζf E ζf E
ζf ζf ζf . Such process can not hold for- ever, otherwise the integer sequence of the first coefficients ai Δ ζf ζf i1
ζf
i1
i
i1
i1
i1
i
i
would be strictly decreasing. This proves the termination of the algorithm. The integer m is the smallest index, such that fm 1 .E contains at least one integer between its roots. The shortest normalization hm 1 hfm1 .E h fm1 E is in this case secondary, and satisfies hm 1 2. We eventually use the following lemma to conclude the proof of Theorem 2. Lemma 4. Let f a, b, c and g ag , bg , cg be two real forms and M α, β; γ, δ GL2 Z such that f.M g. If all the roots of g are positive and γ 0 and δ 1 then ag δ 2 a. Proof. If γ 0, then M is triangular, so α δ 1 and ag a. We now αζ β suppose γ 0. Let ζg be a root of g, then ζf γζgg δ is a root of f . We have 2 α γ ζf 1 γ ζg γδ 1 γδ thanks to the positivity conditions. Since this
bound holds for both roots of f , ag γ 2 a α γ ζf
α γ ζ a δ2 . f
We continue the proof of Theorem 2 by applying this lemma to the main loop of RedGL2. Note that for each i 1; m, the reduction matrix from f0 to fi is Mi
0 1 1 h0
0 1 0 1 ... 1 h1 1 hi 1
αi βi . γi δi
(1)
Smallest Reduction Matrix of Binary Quadratic Forms
41
Their coefficients are all positive, and satisfy these recurrence equalities for i 2: γi1 δi hi 1 δi 1 δi 2 and δ0 , δ1 1, h1 αi1 βi hi 1 βi 1 βi 2 and β0 , β1 0, 1 Since all the hj j 0..i are greater than 1, it follows that αi min βi , γi max βi , γi δi and Mi δi ω i 2 by induction and comparison to the Fibonacci sequence 2 . Applying Lemma 4 on f0 and fm 1 implies that Mm 1 2 a0 am 1 . At iteration m, Lemma 4 can be applied to fm .T 1, which has positive roots and shares its first coefficient am with fm . The transformation matrix Mm T 1 Mm 1 0, 1; 1, hm 1 1 still satisfies the conditions of Lemma 4 because hm 1 2. We obtain Mm T 12 a0 am, and finally Mm 2 4a0 am after a backwards translation by T 1. We already know that fm is secondary-normalized and that the largest root of fm is positive. There are two cases: 1. If the largest root of fm is strictly greater than 1, then r m, fr is secondaryreduced, and the reduction matrix is Mm αm , βm ; γm , δm . One already 2 has Mm 2 4a0 ar . From f0 fr .M 1 , we draw a0 ar δm br δm γm 2 2 2 2 2 2 2 2 2 cr γm , so Δδm γm br δm γm 4ar cr δm γm a0 ar δm cr γm . Since 2 2 2 by construction γm δm 1 Mm 1 and by Lemma 3 applied on fm 1 2 2 and fr , cr am 1 , one finds Δδm γm 6 a0 2 . 2. If the second root of fm is strictly lower than 1, then by Lemma 2, fm1 is αr βr 0 1 Mm , and reduced. The matrix of reduction is M 1 hm γr δr r m 1. Thus M2 Mm 2 1 hm2 4a0 am 4h2m 16a0 ar . One still has Δδr2 γr2 a0 ar δr2 cr γr2 2 21a0 2 , because cr am by Lemma 2. This concludes the proof of items 1 and 2 of Theorem 2. It remains the complexity issue, proved in the following paragraph. Complexity. We now prove the number of iterations performed by RedGL2. Two steps before the end, at iteration r 2 of RedGL2, we know that the form fr 2 ar 2 , br 2 , cr 2 satisfies Δ ar 2 , because the distance between the roots of fm1 is smaller than 1. By Lemma 4 we have ω r 4
a0 ar 2
M r 2
a0 Δ.
It follows that r 4 is upper-bounded by
log a Δ steps where ω 12 5 . 2 log ω The worst case complexity of algorithm RedGL2 is reached when all the normalizations occurring in the algorithm until the index r 2 are by h 1. For instance, we experimentally verify that it is the case on this family of inputs g. T 1E n where g is reduced and n grows. 2
The ith number of the sequence of Fibonacci numbers is bigger than ω i2 .
42
4
A. Bernard and N. Gama
Proof of Heuristic Cryptanalysis of the NICE Cryptosystems
We propose an application of the results of the previous section to the cryptanalyses of the NICE cryptosystems. There are two variants, which are by chronological order NICE Imaginary [12] (with imaginary forms), and NICE Real [13] (with real forms). Their security relies on the intractability of factorization of the public discriminant N . They were designed for a similar level of security as RSA, but with faster decryption, since the decryption process has quadratic complexity. Both are now considered as broken. The first one succumbed by a proved arithmetic attack in [7]. However, the more general attack against both versions of NICE (in [6]) using lattice reduction remains only experimental and relies on two heuristic assumptions. In this paper, we provide an alternative point of view on the lattice attack, which allows to avoid the use of these heuristics and to prove the attack entirely. Both variants of NICE (Real and Imaginary) have originally been described in terms of ideals of quadratic orders, and are based on a morphism between classes of primitive forms of fundamental discriminant p and classes of primitive forms of non-fundamental discriminant N q 2 p. These notions are actually not needed here to understand the lattice attack, therefore we will here give a simple description solely in term of quadratic forms. 4.1
Lifting Quadratic Orders
We summarize some important properties on the relation between the sets Fp and FN of primitives forms of discriminants respectively p and N q 2 p, using the terminology we introduced in the last section. For the cryptographic interest we restrict ourselves to the case where q is an odd prime. The following background theory can be found in [5,4,9]. Integer matrices of determinant q. We define an equivalence relation modulo SL2 Z between two integer matrices A and B M2 Z by A B M SL2 Z, AM B. The 2 2 integer matrices of determinant q correspond to matrices of rank 1 mod q, they fall into q 1 equivalence class, which are characterized by the (projective) direction from 0, 1, ..., q 1, of their image mod q. Each class contains a unique Hermite normal form: qk 10 Qk , k 0, . . . , q 1 or Q . 01 0q Lift. As we can see in [5, section 7], for each form f of discriminant N pq 2 and each M M2 Z of determinant q, there exists a (non-unique) form g Fp such that f g.M. When M Q , we define a particular function ϕ (also called lift ) which computes such g Fp from f a, b, c FN such that 2 gcd a, q 1 as follows: ϕ f a, bq2ah , ah q2bhc where h 1 q, . . . , 0 and h b 2a mod q. Note that all the divisions are exact since f is primitive of discriminant N 0 mod q 2 and q is an odd prime. It must be noted that the
Smallest Reduction Matrix of Binary Quadratic Forms
43
lift preserves the first coefficient a of the form. It is also clear that ϕ preserves primary normalization, because its action on the roots of f is a translation by h 0, q 1 followed by a division by q, which stabilizes the interval 0, 1 of the largest root. Finally, equivalence of forms is stable by lift !f, f FN , f f " ϕ f ϕ f . The converse is in general false. Given a form g Fp and U its fundamental automorphism, there are exactly q p q primitive forms (in FN ) among
g.Q0 , . . . , g.Qq 1 , g.Q where p q denotes the Legendre symbol. These forms split into q p q sq sets of sq equivalent forms (see [5] theorem 7.4), where sq is the order of U modulo q. The fundamental unit N is equal to the power s p q . These q p q sq different classes of equivalence are the only ones to be lifted to the class of g. Reduced cycle. Let g FΔ be a classically-reduced form of discriminant Δ 0, the right neighbour of g is the classical normalization of g.SE. If we note H g the largest normalization of g (by the integer among hg , h g of largest absolute value), then the right neighbour of g is g.SET H g.SE . Successive iterations of the right neighbour enumerates all the reduced forms equivalent to g, and define the reduced cycle of the class of g. The cardinality of such reduced cycle is in O log Δ where Δ is the fundamental unit. Principal cycle, and q-belt. The principal class of a discriminant Δ 0 is the class containing 1, 1, #. The principal form is the classical-normalization of this form, and the principal cycle ½Δ is the reduced cycle of the principal class. Note that the principal class is the only class containing a form of first (or last) coefficient equals to 1. We define the q-belt of a discriminant N pq 2 as the set of all primary normalized forms q 2 , kq, # of the principal class. Necessarily, k p, 2q p. There are exactly sq 1 forms in the q-belt of N : let g0 be the principal form 1, #, # of FN and f ϕ g0 is (necessarily) the principal form of Fp . Let U be the fundamental automorphism of f , we set by induction k0 and ki the unique integer such that U Qki1 Qki for i 1. Note that Qki U i Qk0 , and that the order of U mod q is precisely sq , therefore the sequence ki is periodic and ksq k0 . Finally, the q-belt of N is the set g1 f.Qk1 , . . . , gk f.Qksq 1 . They are indeed primary-normalized and equivalent by construction. A transformation matrix from gi to gi 1 is by construction Qki1 U Qki1 SL2 Z, because U Qki1 Qki . 4.2
Cryptosystem Real NICE
We now describe the NICE Real encryption and decryption. The public key is a composite integer N pq 2 and the secret key p, q with p and q two distinct primes of the same size, satisfies two conditions: – p is a Schinzel prime [19] which is a positive squarefree integer of the form p A2 x2 2Bx C with A, B, C, x Z, A 0 and B 2 4AC dividing 4 gcd A2 , B 2 . Such special primes implies a very low number of reduced
44
A. Bernard and N. Gama
forms in each class, namely there are O log p reduced forms in Fp in each equivalence class ([8] and [22, theorem 5.8, p. 52]). It is therefore practical to enumerate every reduced form equivalent to a given one. With a generic discriminant, the number of reduced forms per cycle would be exponential, around O p) (see [3]). To avoid any confusion, please note that even for a Schinzel prime, the number of classes in Fp remains exponential. – q is such that sq is linear in q. This imply that the number of reduced forms of discriminant N q 2 p in each equivalence class is at least linear in q and upper-bounded by O q log p, which is exponential. The encryption of a message m works as follows: m is embedded into a (usually prime) integer a p 2 which satisfies some low-probability pattern, and such 2 that q p is a square modulo a. This integer is expanded into a quadratic form fs a, b , c of discriminant q 2 p (which is not printed). The ciphertext is a random reduced form fc equivalent to fs (there are exponentially many). It can be generated from fs by successive multiplications by random unimodular matrices and reductions. The decryption algorithm lifts the ciphertext in Fp and enumerate all the reduced forms equivalent to ϕ fc , looking for the pattern. Of course, the knowledge of q is needed to compute ϕ. There are only O log p of them. It will necessarily find it, because the (unknown) lift of fs fc is an equivalent form ϕ fs a, #, #, whose normalization a, #, # is reduced due to the small size of a, and it satisfies the pattern by construction. Due to the small number of reduced forms, it is likely the only one of the small reduced cycle to satisfy the pattern, and the plaintext m is eventually extracted from a. 4.3
Cryptanalysis
The cryptanalysis of NICE Real presented in [6] works as follows. The authors present an algorithm inspired of Coppersmith methods (see [10,17]), which solves in polynomial time the equation au2 buv xv 2 0 mod q 2 in the variables u, v, q where N pq 2 is known and max u, v O N 1 9 . They call this algorithm Homogeneous-Coppersmith in [6]. Their cryptanalysis of NICE Real is: Pick3 a form g of the principal cycle, and try to solve the equation g u, v 0 mod q 2 with Homogeneous-Coppersmith. Repeat this until it finds a solution u, v, q and return the private key q. The proof of the attack of [6] relies on this heuristic assumption: Assumption 1. The cardinality of the set A g 1 O N 9 and g u, v 0 mod q 2 is linear in sq . 3
½N ,
u, v max u, v
The authors of [6] enumerates the forms sequentially, until it finds a solvable one. They need an assumption not only on the large number of such forms, but also on their regular repartition on the principal cycle. Randomizing the enumeration avoids to prove the assumption on regular repartition (Heuristic 2 in [6]), which is feasable using the distance introduced in Theorem 3, but is beyond the scope of this paper.
Smallest Reduction Matrix of Binary Quadratic Forms
45
The authors of [6] experimentally verify this assumption. Namely, if g¯k denotes the reduction of the form gk q 2 , #, # of the q-belt by Classical Gauss reduction. The bottom two coefficients of the reduction matrix satisfy g¯k δ, γ q 2 . Homogeneous-Coppersmith experimentally recovers δ, γ for most of the g¯k and even a few of their direct left or right neighbours on the principal cycle. This indicates that the norm of the reduction matrix is in general upper-bounded by O N 1 9 . However we also found rare cases of g¯k where the norm of reduction matrix was by an order greater than N 1 9 , and on which Homogeneous-Coppersmith algorithm cannot find any solution. We call these particular forms unbalanced, because they have in general an unusually small coefficient. The main three difficulties which prevented the authors of [6] to prove Assumption 1 were to justify that that the proportion of unbalanced forms is negligible among the set of g¯k , that the reduction matrix using Classical Gauss reduction is bounded by O N 1 9 , and that Classical Gauss is injective on a large enough subset of the q-belt, which prevents g¯k from being too small. Our first improvement in their analysis is to replace the Classical Gauss reduction algorithm with RedGL2. This allows to square-root the upper-bounds on the reduction matrix as of Theorem 2. Thus we define gˆk as the reduction by RedGL2 of the q-belt form gk for each k. We ensure that gˆk is classically reduced and that the reduction matrix has determinant 1 using Lemma 1. The first point of Theorem 2 implies that the norm of the reduction matrix is in O N 1 9 as soon as the smallest coefficient of gˆk is greater than N 4 9 . We can either prove that this condition is satisfied by a large proportion of the gk , or we can also circumvent this limitation by using the second point of Theorem 2, which indicates that the size of the product uv is always upper-bounded by O N 1 6 . We therefore improve the Homogeneous-Coppersmith algorithm so that it also finds unbalanced solutions: namely, we design a rational variant of Boneh-DurfeeHowgraveGraham algorithm [2] which in particular solves g u, v au2 buv cv 2 0 mod q 2 on u, v, q as soon as the product uv is in O N 2 9 . Our new polynomial attack on Nice Real is the following: Randomly select a form g on the principal cycle ½N , and try to solve g u, v 0 mod q 2 in u, v, q using Rational-BonehDurfeeHowgraveGraham. Repeat until it finds a solution, and return q. The proof of this attack works in two steps: first, we prove (in Theorem 3) that the above-defined gˆk represent a non-negligible proportion of the principal cycle, and second, we prove (in Section 4.4) that Rational-BonehDurfeeHowgraveGraham finds q from any of the gˆk in polynomial time. Definition 2 (distance). we define a notion of distance between two equivalent forms f g as dist f, g min log M, M SL2 Z and f.M g . Let f, g, h be three equivalent forms in FΔ , the distance function satisfies the following properties: 1. dist f, g dist g, f 0 2. dist f, g 0 f g or f
g.SE
46
A. Bernard and N. Gama
3. dist f, h dist f, g dist g, h 4. if M SL2 Z satisfies f.M g and log M.
M
Δ , then dist f, g
Proof. The first three points follow from basic properties of the induced norm, and the fact that only isometries have a unit norm. To prove the fourth statement, let U be the fundamental automorphism of f , the eigenvalues of U are Δ and Δ1 . Any non-trivial automorphism V of f satisfies V Δ , because V is a non-zero power of U , and its spectral radius is a positive power of Δ . The matrix M of the fourth point is necessarily the smallest transformation matrix from f to g, otherwise any matrix X SL2 Z such that f.X g and X M would produce a non-trivial automorphism MX 1 of f of too small norm MX 1 Δ , which is impossible. One of the greatest advantage of this distance is the fourth statement, which in general indicates that any polynomial transformation matrix is necessarily the smallest one. This allows to efficiently lower-bound a distance. As shown in the proof, it is essential that the group of automorphism is cyclic, the fourth statement would be false on GL2 Z. The authors of [6] used another distance between f, g , which could have been formalized as the smallest k N such that k there exists h1 , . . . , hk such that i1 SET hi transforms f into g or g.SE. Inside the reduced cycle, this corresponds to Shanks distance [20]. Unfortunately, it does not satisfy any equivalent of the fourth point: there is no way to efficiently verify that a given distance, as small as it could be, is correct. All the variants we found of this distance, which aims to approximate this statement, based either on the logarithms of the hi or some maximum norms, break the positive definiteness or the triangular inequality. This explains why we do not base our proof on Shanks distance and introduce our own instead. Theorem 3. Given a NICE modulus N pq 2 , the set A gˆk RedGL2 gk , k 1, . . . sq 1 of the reduced of the q-belt has at least K.sq elements for some constant K 0. Proof. We now call Up the fundamental automorphism of the principal form of Fp . We verify that Upj 2 jp p j and that for all i, j, Qki1 Upj Qkij transforms gi into gij . Its norm is bounded by 1q Qki U j Qkij 4q jp p j . Due to point 4, for all j 1, sq 2 2, the distance dist gi , gij log Qki1 Upj Qkij is greater than j log p log 2q . By Theorem 2, the norm 2 of the reduction matrix from a gi to gˆi is upper-bounded by 2 21q N 42q p, and it follows that dist gˆi , gˆij j log p log 3528q 3 p. For this reason, if j log 3528q 3 p log p , then dist gˆi , gˆij 0 and gˆi gˆij . Using the NICE parameters, one has log 3528q 3p log p 3, thus the forms gˆ1 , gˆ4 , gˆ7 , . . . , gˆ3n1 are distinct (with n sq 6.
Smallest Reduction Matrix of Binary Quadratic Forms
4.4
47
Rational Improvement of the Boneh-Durfee-HowgraveGraham’s Algorithm
In this section, we describe our Rational-BonehDurfeeHowgraveGraham algorithm as a variant of Boneh Durfee Howgrave-Graham algorithm [2] solving rational linear equations u v C 0 mod q in the variables u, v, q when a multiple N pq r is known. The description of Rational-BonehDurfeeHowgraveGraham is summarized in Algorithm 2. Among others, it can be used to solve all the equations gˆk u, v au2 buv cv 2 0 mod q 2 of discriminant pq 2 of the previous section, because they are equivalent to u v b 2a 0 mod q. Since the solution we are looking for satisfies uv O N 1 6 , the following Theorem 4 proves that Rational-BonehDurfeeHowgraveGraham finds all solutions uv O N 2 9 , and concludes the proof of our new attack on Nice Real. More generally, given a polynomial P , the technique due to Boneh Durfee Howgrave-Graham transforms the equation P u v 0 mod q, into a lattice L of dimension m and bounded determinant, and whose short vectors are orthogonal to the integer vector S um , um 1 v, ..., uv m 1 , v m . The solutions u and v can be extracted from any of those short lattice vectors. This lattice is described by a basis B, whose rows contain the coefficients of m 1-degree polynomials having u v as a root modulo a power of q. When u and v have approximately the same size (like in Homogeneous-Coppersmith of [6]), the celebrated LLL reduction algorithm on B outputs directly the desired vector orthogonal to S. Otherwise, when u and v are unbalanced, say for instance that u is 1000 times larger than v, one first needs to re-balance the lattice by multiplying each i-th column by C i , where C is close to 1000, and only then reduce the basis. The original Boneh-Durfee-HowgraveGraham’s algorithm, which interests in integer solutions (arbitrary u and v 1), follows the above rule: the lattice basis which is actually LLL-reduced is the basis of Homogeneous-Coppersmith where each i-th column has been multiplied by X i , where X is a power of 2 just larger than the solution u. More generally, if we don’t know the relative balance between u and v but only know that the size of uv is n-bits, then we can test the n possible powers of two sequentially within a linear-factor overhead. Besides, we remark that instead of multiplying the columns of the input Homogeneous-Coppersmith basis by 1, 2, 4, ..., 2m, we describe the exact same lattice by multiplying the columns of the LLL-reduced basis, and the second one is almost reduced (LLL terminates in a very few steps). Thus after the reduction of the first Homogeneous-Coppersmith basis, one obtains all the other possible balances of u and v for free. Theorem 4. Given any integer N pq r (where p and q are unknown), and a r bound β 14 q log q log N , Algorithm 2 terminates in polynomial time, and finds a solution (if it exists) of the equation uv c mod q where u, v are unknown integers satisfying uv β. u Proof. Let U, V R2 such
that
U and v 1 log qr . ters m N 0 and t mlog
N
V . We use the same parame-
We denote by Rm X, Y the span of homogeneous polynomials of degree m, and we define the isomorphism ϕ : Rm X, Y $ Rm1 which computes
48
A. Bernard and N. Gama
Algorithm 2. Rational Boneh-Durfee-HowgraveGraham Input: An integer N N of the form pq r (p and q are unknown), an integer c logq r log N 0, N 1 and a bound β 14 q Output: u, v N3 such that uv c mod q and u v β if it exists 1: Choose the smallest m such that
m1logq r logN
1
1
1
N 2 8r m 1 2
m11
1.5, and set t
. tk
2: Compute the family Pk X, Y N r X cY k Y mk for k 0..m 3: for l 0 to log2β do 4: U 2l ; V β 2l 5: Express (or update) the family Pk k0..m on the monomial k mk Y X , and form a matrix B Mm1 Z U k V mk k0..m 6: LLL-reduce B, and call α0 , . . . , αm the first vector αk k 7: for each rational root uv of RX m k0 U k V mk X 0 do 8: if uv β and gcdu cv, N is non-trivial return u, v 9: end for 10: end for k
basis
mk
Y the coordinates of a polynomial on the basis X U k V mk k0..m . For instance, k m k k m k U V ek where ek is the k-th canonical basis vector. Let ϕX Y tk Pk k0..m be the family Pk X, Y N r X cY k Y m k Rm X, Y . By m construction, any integer linear combination R k0 Z Pk satisfy R u, v 0 mod q t and R u, v m 1 ϕ R2 (using Cauchy-Schwartz inequality). We now suppose that ϕ R is a short vector of the lattice generated by the (triangular) basis B ϕ Pk k1,m . By that, we mean ϕ R2 1.08m1 det B 1 m1 . Such a vector can be found by running the LLL algorithm on the lattice basis B (see [16]). The remainder of the proof is just a formal verification that when m grows, det B is small enough to guaranty that R u, v q t , and therefore that R u, v 0 (in Z). Since R is homogeneous, this allows to recover u and v.
5
Conclusion
We saw that reduction algorithms are conceptually simpler to study in GL2 Z, because we mostly manipulate only positive matrices, which are easy to bound. The precision of our analysis, in the worst case and also in the average case, allows us to fully prove a lattice-based total-break attack against Nice cryptosystems [12,13], which is unusual in the history of lattice based cryptology. A further lead would be to extend these results on the reduction of the forms in higher dimension. Acknowledgements. We would like to thank Fabien Laguillaumie and Guilhem Castagnos for useful discussions and valuable comments on this paper.
Smallest Reduction Matrix of Binary Quadratic Forms
49
References 1. Biehl, I., Buchmann, J.: An analysis of the reduction algorithms for binary quadratic forms. In: Voronoi’s Impact on Modern Science, pp. 71–98 (1999) 2. Boneh, D., Durfee, G., Howgrave-Graham, N.A.: Factoring n pr q for large r. In: Wiener, M. (ed.) CRYPTO 1999. LNCS, vol. 1666, p. 326. Springer, Heidelberg (1999) 3. Buchmann, J., Thiel, C., Williams, H.: Short representation of quadratic integers. Proc. of CANT 1992, Math. Appl. 325, 159–185 (1995) 4. Buchmann, J., Vollmer, U.: Binary Quadratic Forms An Algorithmic Approach. Springer, Heidelberg (2007) 5. Buell, D.A.: Binary Quadratic Forms Classical Theory and Modern Computations. Springer, Heidelberg (1989) 6. Castagnos, G., Joux, A., Laguillaumie, F., Nguyen, P.Q.: Factoring pq 2 with quadratic forms: Nice cryptanalyses. In: Matsui, M. (ed.) ASIACRYPT 2009. LNCS, vol. 5912, pp. 469–486. Springer, Heidelberg (2009) 7. Castagnos, G., Laguillaumie, F.: On the security of cryptosystems with quadratic decryption: The nicest cryptanalysis. In: Joux, A. (ed.) EUROCRYPT 2009. LNCS, vol. 5479, pp. 260–277. Springer, Heidelberg (2010) 8. Cheng, K.H.F., Williams, H.C.: Some results concerning certain periodic continued fractions. Acta Arith. 117, 247–264 (2005) 9. Cohen, H.: A Course in Computational Algebraic Number Theory, 2nd edn. Springer, Heidelberg (1995) 10. Coppersmith, D.: Small solutions to polynomial equations, and low exponent RSA vulnerabilities. J. of Cryptology 10(4), 233–260 (1997); Revised version of two articles from Eurocrypt 1996 (1996) 11. Gauss, C.F.: Disquisitiones Arithrneticae. PhD thesis (1801) 12. Hartmann, M., Paulus, S., Takagi, T.: NICE - New Ideal Coset Encryption. In: Ko¸c, C.K., ¸ Paar, C. (eds.) CHES 1999. LNCS, vol. 1717, pp. 328–339. Springer, Heidelberg (1999) 13. Jacobson, M.J., Scheidler, R., Weimer, D.: An adaptation of the NICE cryptosystem to real quadratic orders. In: Vaudenay, S. (ed.) AFRICACRYPT 2008. LNCS, vol. 5023, pp. 191–208. Springer, Heidelberg (2008) 14. Lagarias, J.C.: Worst-case complexity bounds for algorithms in the theory of integral quadratic forms. Journal of Algorithm 1, 142–186 (1980) 15. Lagrange, J.L.: Recherches d’arithm´etique. Nouveaux M´emoires de l’Acad´emie de Berlin (1773) 16. Lenstra, A.K., Lenstra Jr., H.W., Lov´ asz, L.: Factoring polynomials with rational coefficients. Mathematische Ann. 261, 513–534 (1982) 17. May, A.: Using LLL-reduction for solving RSA and factorization problems: A survey. In: Nguyen, P., Vallee, B. (eds.) The LLL algorithm, survey and Applications, Information Security and Cryptography, pp. 315–348 (2010) 18. Nguyen, P.Q., Stehl´e, D.: Low-dimensional lattice basis reduction revisited (extended abstract). In: Proceedings of ANTS VI. LNCS, Springer, Heidelberg (2004) 19. Schinzel, A.: On some problems of the arithmetical theory of continued fractions. Acta Arithmetica 6, 393–413 (1961) 20. Shanks, D.: The infrastructure of a real quadratic field and its applications. In: Proc. NTC 1992, pp. 217–224 (1972) 21. Vallee, B., Vera, A.: Lattice reduction in two dimensions: Analyses under realistic probalistic models. In: Proc. of AofA 2007, DMTCS AH, pp. 181–216 (2007) 22. Weimer, D.: An Adaptation of the NICE Cryptosystem to Real Quadratic Orders, Master’s thesis. PhD thesis, Technische Universitat Darmstadt (2004)
Practical Improvements to Class Group and Regulator Computation of Real Quadratic Fields Jean-Fran¸cois Biasse1 and Michael J. Jacobson, Jr.2, 1
´ Ecole Polytechnique, 91128 Palaiseau, France
[email protected] 2 Department of Computer Science, University of Calgary 2500 University Drive NW, Calgary, Alberta, Canada T2N 1N4
[email protected]
Abstract. We present improvements to the index-calculus algorithm for the computation of the ideal class group and regulator of a real quadratic field. Our improvements consist of applying the double large prime strategy, an improved structured Gaussian elimination strategy, and the use of Bernstein’s batch smoothness algorithm. We achieve a significant speed-up and are able to compute the ideal class group structure and the regulator corresponding to a number field with a 110decimal digit discriminant.
1
Introduction
Computing invariants of real quadratic fields, in particular the ideal class group and the regulator, has been of interest since the time of Gauss, and today has a variety of applications. For example, solving the well-known Pell equation is intimately linked to computing the regulator, and integer factorization algorithms have been developed that make use of this invariant. Public-key cryptosystems have also been developed whose security is related to the presumed difficulty of these computational tasks. See [16] for details. The fastest algorithm for computing the ideal class group and regulator in practice is a variation of Buchmann’s index-calculus algorithm [6] due to Jacobson [14]. The algorithm on which it is based has subexponential complexity in the size of the discriminant of the field. The version in [14] includes several practical enhancements, including the use of self-initialized sieving to generate relations, a single large-prime variant (based on that of Buchmann and D¨ ullman [7] in the case of imaginary quadratic fields), and a practical version of the required linear algebra. This approach proved to work well, enabling the computation of the ideal class group and regulator of a real quadratic field with a 101-decimal digit discriminant [15]. Unfortunately, both the complexity results of Buchmann’s algorithm and the correctness of the output are dependent on the Generalized Riemann Hypothesis (GRH). Nevertheless, for fields with large discriminants, this approach is the only one that works.
The second author is supported in part by NSERC of Canada.
G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 50–65, 2010. c Springer-Verlag Berlin Heidelberg 2010
Improvements in Real Quadratic Number Fields
51
Recently, Biasse [4] presented practical improvements to the corresponding algorithm for imaginary quadratic fields. These included a double large prime variant and improved algorithms for the required linear algebra. The resulting algorithm was indeed faster then the previous state-of-the-art [14], and enabled the computation of the ideal class group of an imaginary quadratic field with 110 decimal digit discriminant. In this paper, we describe a number of practical improvements to the indexcalculus algorithm for computing the class group and regulator of a real quadratic field. In addition to adaptations of Biasse’s improvements in the imaginary case, we have found some modifications designed to improve the regulator computation part of the algorithm. We also investigate applying an idea of Bernstein [3] to factor residues produced by the sieve using a batch smoothness test. Extensive computations demonstrating the effectiveness of our improvements are presented, including the computation of class group and regulator of a real quadratic field with 110 decimal digit discriminant. This paper is organized as follows. In the next section, we briefly recall the required background of real quadratic fields, and give an overview of the indexcalculus algorithm using self-initialized sieving. Our improvements to the algorithm are described in Section 3, followed by numerical results in Section 4.
2
Real Quadratic Fields
We present an overview of required concepts related to real quadratic fields and the index-calculus √ algorithm for computing invariants. For more details, see [16]. Let K = Q( Δ) be the real quadratic field of discriminant Δ, where Δ is a positive integer congruent to 0 or 1 modulo 4 with Δ or Δ/4 square-free. The integral closure of Z in K, called the maximal order, is denoted by OΔ . An interesting aspect of real quadratic fields is that their maximal orders contain infinitely many non-trivial units, i.e., units that are not roots of unity. More precisely, the unit group of OΔ consists of an order 2 torsion subgroup and an infinite cyclic group. The smallest unit greater than 1, denoted by εΔ , is called the fundamental unit. The regulator of OΔ is defined as RΔ = log εΔ . The fractional ideals of K play an important role in the index-calculus algorithm described in this paper. In our setting, a fractional ideal is a rank 2 Z-submodule of K. Any fractional ideal can be represented as √ b+ Δ s aZ + Z , a= d 2 where a, b, s, d ∈ Z and 4a | b2 − Δ. The integers a, s, and d are unique, and b is defined modulo 2a. The ideal a is said to be primitive if s = 1, and da ⊆ OΔ is integral. The norm of a is given by N (a) = as2 /d2 . Ideals can be multiplied using Gauss’s composition formulas for indefinite binary quadratic forms. Ideal norm respects ideal multiplication, and the set
52
J.-F. Biasse and M.J. Jacobson
IΔ forms an infinite abelian group with identity OΔ under this operation. The inverse of a is √ −b + Δ d −1 a = aZ + Z . sa 2 by the prime ideals of OΔ , namely those integral The group IΔ is generated √ ideals of the form pZ + (bp + Δ)/2Z where p is a prime that is split or ramified in K. As OΔ is a Dedekind domain, the integral part of any fractional ideal can be factored uniquely as a product of prime ideals. To factor a, it suffices to factor N (a) and, for each prime p dividing the norm, determine whether the prime ideal p or p−1 divides a according to whether b ≡ bp or −bp modulo 2p. The ideal class group, denoted by ClΔ , is the factor group IΔ /PΔ , where PΔ ⊆ IΔ is the subgroup of principal ideals. The class group is finite abelian, and its order is called the class number, denoted by hΔ . By computing the class group we mean computing the elementary divisors m1 , . . . , ml with mi+1 | mi for 1 ≤ i < l such that ClΔ ∼ = Z/m1 Z × · · · × Z/ml Z. 2.1
The Index-Calculus Algorithm
Like other index-calculus algorithms, the algorithm for computing the class group and regulator relies on finding certain smooth quantities, those whose prime divisors are all small in some sense. In the case of quadratic fields, one searches for smooth principal ideals for which all prime ideal divisors have norm less than a given bound B1 . The set of prime ideals B = {p1 , . . . , pn } with N pi ≤ B1 is called the factor base. A principal ideal (α) = pe11 . . . penn with α ∈ K that factors completely over the factor base yields the relation (e1 , . . . , en , log |α|). The key to the index-calculus algorithm is the fact, proved by Buchmann [6], that the set of all relations forms a sublattice Λ ⊂ Zn × R of determinant hΔ RΔ provided that the prime ideals in the factor base generate ClΔ . This follows, in part, due to the fact that L, the integer component of Λ, is the kernel of the homomorphism from Zn to ClΔ given by pe11 . . . penn for (e1 , . . . , en ) ∈ Zn . If p1 , . . . , pn generate ClΔ , then this homomorphism is surjective, and the homomorphism theorem then implies that Zn /L ∼ = ClΔ . The main idea behind the index-calculus algorithm is to find random relations until they generate the entire relation lattice Λ. Let Λ denote the sublattice of Λ generated by the relations that have been computed. To determine whether Λ = Λ, one computes an approximation h∗ of hΔ RΔ such that h∗ < hΔ RΔ < 2h∗ . The value h∗ is obtained by approximating the L-function L(1, χΔ ), where χΔ denotes the Kronecker symbol (Δ/p), and applying the analytic class number formula. If Λ ⊂ Λ, then det(Λ ) is a integer multiple of hΔ RΔ . Thus, Λ = Λ as soon as det(Λ ) < 2h∗ , because hΔ RΔ is the only integer multiple of itself in the interval (h∗ , 2h∗ ).
Improvements in Real Quadratic Number Fields
53
As described in [14], an adaptation of the strategy used in the self-initialized quadratic sieve (SIQS) factoring algorithm is used √ to compute relations. First, compute the ideal a√= pe11 . . . penn = (1/d)[aZ + (b + Δ)/2Z] with N (a) = a/d2 . Let α = (ax + (b + Δ)/2y)/d with x, y ∈ Z be an arbitrary element in a. Then √ √ b− Δ 1 b+ Δ y ax + y = (a/d2 )(ax2 + bxy + cy 2 ) N (α) = 2 ax + d 2 2 where c = (b2 − Δ)/(4a). Because ideal norm is multiplicative, there exists an ideal b with N (b) = ax2 + bxy + cy 2 such that (α) = ab. Thus, finding x and y such that N (b) factors over the norms of the prime ideals in the factor base yields a relation. Such x and y can be found by sieving the polynomial ϕ(x, y) = ax2 + bxy + cy 2 , and a careful selection of the ideals a yields a generalization of self-initialization, in which the coefficients of the sieving polynomials and their roots modulo the prime ideal norms can be computed quickly. In practice, we use ϕ(x, 1) for sieving, so that the algorithm resembles the SIQS more closely. For more details, see [14] or [16]. The determinant of the relation lattice Λ is computed in two stages. The first step is to compute the determinant of the integer part of this sublattice by finding a basis in Hermite normal form (HNF). Once Λ has full rank, the determinant of this basis is computed as the product of the diagonal elements in a matrix representation of the basis vectors. The group structure is then computed by finding the Smith normal form of this matrix. The real part of det(Λ ), a multiple of the regulator RΔ , is computed by first finding a basis of the kernel of the matrix consisting of the integer parts of the relations. Every vector (k1 , . . . , km ) ∈ Zm in the kernel corresponds to a multiple of the regulator computed with mRΔ = k1 log |α1 | + · · · + km log |αm |. The “real gcd” of the multiples m1 RΔ , . . . , mn RΔ computed from each basis vector of the kernel, defined as gcd(m1 , . . . , mn )RΔ , is then the real part of det(Λ ). An algorithm of Maurer [21] can be used to compute the real gcd efficiently and with guaranteed numerical accuracy given explicit representations of the αi and the kernel vectors. As mentioned in the introduction, the correctness of this algorithm depends on the truth of the Generalized Riemann Hypothesis. In fact, the GRH must be invoked in two places. The first is to compute a sufficiently accurate approximation h∗ of hΔ RΔ via a method due to Bach [2]. Without the GRH, an exponential number of terms in the Euler product used to approximate L(1, χΔ ) must be used (see, for example, [20]). The second is to ensure that the factor base generates ClΔ . Without the GRH, an exponential size factor base is required, whereas by a theorem of Bach [1] the prime ideals of norm less than 6 log(Δ)2 suffice. In practice, an even smaller factor base is often used, but in that case, the factor base must be verified by showing that every remaining prime ideal with norm less than Bach’s bound can be factored over the ideals in the factor base.
54
J.-F. Biasse and M.J. Jacobson
3
Practical Improvements
In this section, we describe our practical improvements for computing the class group structure and the regulator of a the real quadratic field. Some of these improvements, such as the double large prime variant and structured Gaussian elimination, were used in [4] for the simpler case of imaginary quadratic number fields. On the other hand, the batch smoothness test and system solving based methods for computing the regulator had never been implemented in the context of number fields before. 3.1
Relation Collection
Improving the relation collection phase allows us to speed up every other stage of the algorithm. Indeed, the faster the relations are found, the smaller the factor base can be, thus reducing the dimensions of the relation matrix and the time taken by the linear algebra phase. In addition, the verification phase also relies on our ability to find relations and therefore benefits from improvements to the relation collection phase. Throughout the rest of the paper, M denotes the relation matrix, the matrix whose rows are the integer parts of the relations. Large prime variants. The large prime variants were developed in the context of integer factorization to speed up the relation collection phase in both the quadratic sieve and the number field sieve. A single large prime variant was described by Buchmann and D¨ ullman [7] for computing the class group of an imaginary quadratic field, and adapted to the real case by Jacobson [14]. Biasse [4] described how the double large prime strategy could be using in the imaginary case, and obtained a significant speed-up. The idea is to keep relations involving one or two extra primes not in the factor base of norm less than B2 ≥ B1 . These relations thus have the form (α) = pe11 . . . penn p and (α) = pe11 . . . penn pp for pi in B, and for p, p of norm less than B2 . We will refer to these types of partial relations as 1-partial relations and 2-partial relations, respectively. Keeping partial relations only involving one large prime is the single large prime variant, whereas keeping those involving one or two is the double large prime variant which was first described by Lenstra and Manasse [17]. We do not consider the case of more large primes, but it is a possibility that has been studied in the context of factorization [10]. Partial relations may be identified as follows. Let m be the remainder of ϕ(x, 1) after the division by all primes p ≤ B1 , and assume that B2 < B12 . If m = 1 then we have a full relation. If m ≤ B2 then we have a 1-partial relation. We can see here that detecting 1-partial relations is almost for free. If we also intend to collect 2-partial relations then we have to consider the following possibilities:
Improvements in Real Quadratic Number Fields
1. 2. 3. 4.
55
m > B22 ; m is prime and m > B2 ; m is prime and m ≤ B2 ; m is composite and B12 < m ≤ B22 .
In Cases 1 and 2 we discard the relation. In Case 3 we have a 1-partial relation, and in Case 4 we have m = pp where p = N (p) and p = N (p ). Cases 1, 2, and 3 can be checked very easily, but if none are satisfied we need to factor m in order to determine whether Case 4 is satisfied. We used Milan’s implementation of the SQUFOF algorithm [22] based on the theoretical work of [12] to factor the m values produced. Even though we might have to factor the remainder, partial relations are found much faster than full relations. However, the dimensions of the resulting matrix are much larger, thus preventing us from running the linear algebra phase directly on the resulting relation matrix. In addition, we have to find many more relations since we have to produce a full rank matrix. We will see in §3.2 how to reduce the dimensions of the relation matrix using Gaussian elimination techniques. Batch smoothness test. After detecting potential candidates for smooth integers via the SIQS, one has to certify their smoothness. In [4,14], this was done by trial division with the primes in the factor base. The time taken by trial division can be shortened by using Bernstein’s batch smoothness test [3], which uses a product tree structure and modular arithmetic to factor a batch of residues simultaneously in time O b(log b)2 log log b where b is the total number of input bits. Instead of testing the smoothness of every potential candidate as soon as they are discovered, we rather stored them and tested them at the same time using Bernstein’s method as soon their number exceeded a certain limit. This improvement has an effect that is all the more important when the time spent in the trial division is long. In our algorithm, this time mostly depends on the tolerance value T, a parameter used to control the number of candidates yielded by the sieve for smoothness testing. 3.2
Structured Gaussian Elimination
As mentioned in §2.1, in order to determine whether the computed relations generate the entire relation lattice, we need to compute the HNF basis of the sublattice they generate. This can be done by putting the integer components of the relations as rows in a relation matrix, and computing the HNF. The first step when using large primes is to compute full relations from all of the partial relations. Traditionally, rows were recombined to give full relations as follows. In the case of 1-partial relations, any pair of relations involving the same large prime p were recombined into a full relation. In the case of 2-partial relations, Lenstra [17] described the construction of a graph whose vertices were the relations and whose edges linked vertices having one large prime in common.
56
J.-F. Biasse and M.J. Jacobson
Finding independent cycles in this graph allows us to recombine partial relations into full relations. In this paper, we instead follow the approach of Cavallar [8], developed for the number field sieve, and adapted by the first author to the computation of ideal class group structures in imaginary quadratic number fields [4], which uses Gaussian elimination on columns. The ideas is to eliminate columns using structured Gaussian strategies until the dimensions of the matrix are small enough to allow the computation of the HNF with standard algorithms. Let us recall a few definitions. First, subtracting two rows is called merging. If two relations corresponding to rows r1 and r2 share the same prime p with coefficients c1 and c2 respectively, then multiplying r1 by c2 and r2 by c1 and merging is called pivoting. Finally, finding a sequence of pivots leading to the elimination of a column of Hamming weight k is a k-way merge. We aim to reduce the dimensions of the relation matrix by performing kway merges on the columns of weight k = 1, . . . , w in increasing order for a certain bound w. To limit the growth of the density and of the size of the coefficients induced by these operations, we used optimized pivoting strategies. In what follows we describe an algorithm performing k-way merges to minimize the growth of both the density and the size of the coefficients, thus allowing us to go deeper in the elimination process and delay the explosion of the coefficients. As in [4], we define a cost function C mapping rows onto the integers. The one used in [4] satisfied 1+c 1, (1) C(r) = 1≤|ei |≤Q
|ej |>Q
where c and Q are positive numbers, and r = [e1 , . . . , en ] is a row corresponding to (α) = i pei i . This way, the heaviest rows are those which have a high density and large coefficients. In our experiments for this work, we used a different cost function, see §4.1. Then, to perform a k-way merge on a given column, we construct a complete graph G of size k such that – the vertices are the rows ri , and – every edge linking ri and rj has weight C(rij ), where rij is obtained by pivoting ri and rj . Finding the best sequence of pivots with respect to the chosen cost function C is equivalent to finding the minimum spanning tree T of G, and then recombining every row r with its parent starting with the leaves of T . Unlike in [4], we need to keep track of the permutations we apply to the relation matrix, and of the empty columns representing primes of norm less than 6 log2 Δ. This will be required for the regulator computation part of the algorithm described next. 3.3
Regulator Computation
As mentioned in §2.1, the usual way to compute the regulator is to find a basis of the kernel of the relation matrix, compute integer multiples of the regulator
Improvements in Real Quadratic Number Fields
57
from these basis vectors, and compute their real gcd using Maurer’s algorithm [21]. If det Λ > 2h∗ , then either the class number or regulator computed is too large, and we need to find extra relations corresponding to new generators, and new kernel vectors involving them. In this section, we describe a way of taking advantage of the large number of generators involved in the different partial relations. Indeed, the dimensions of the relation matrix before the Gaussian elimination stage is much larger than in the base scenario and thus involves more generators. Consequently, given a set of k ≤ dim(ker M ) kernel vectors (uj1 , . . . , ujn )j≤k , the probability that the corresponding elements vj := uj1 log |α1 | + . . . + ujn log |αn | , where αi is the generator of the i-th relation, can be recombined into R is much larger. On the other hand, the dimensions of the matrix prevents us from running a kernel computation directly after the relation collection phase. Thus, rather than attempting to compute the kernel, we use a method similar to that of Vollmer [24] based on solving linear systems. The first step of our algorithm consists of putting the matrix in a pseudo-lower triangular form using a permutation obtained during the Gaussian elimination phase. Indeed, as part of this computation we obtain a unimodular matrix U ∈ Zn×n such that ⎛ ⎞ ⎜ ⎜ A ⎜ ⎜ ⎜ ⎜ ⎜ UM = ⎜ ⎜ ⎜ ⎜ ⎜ (∗) ⎜ ⎜ ⎝
⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ 1 (0) ⎟ ⎟. ⎟ ⎟ ⎟ .. ⎟ . ⎟ ⎠ (∗) 1 (0)
Thus, solving a linear system of the form xM = b for a vector b ∈ Zm boils down to solving a system of the form x A = b , then doing a trivial descent through the diagonal entries which equal 1 and finally permuting back the coefficients using U . To solve the small linear systems, we used the algorithm certSolveRedLong from the IML library [9]. It takes a single precision dense representation of A and returns an LLL-reduced solution. Once M is in pseudo-lower triangular form, we draw a set of relations r1 , . . . rd which are not already rows of M , and for each ri , i ≤ d, we solve the system xi A = ri . We then augment M with the rows ri for i ≤ d and the vectors xi with d extra coordinates, which are all set to zero except for the i-th which is set to −1.
58
J.-F. Biasse and M.J. Jacobson
⎞
⎛ ⎜ ⎜ M := ⎜ ⎝
M ri
⎟ ⎟ ⎟ xi := xi 0 . . . 0 −1 0 . . . 0 . ⎠
We clearly have xi M = 0 for i ≤ d, and the xi can be used to find a multiple of RΔ as described in §2.1.
4
Numerical Results
In this section, we give numerical results showing the impact of our improvements. For each timing, we specify the architecture used. All the timings were obtained with our code in C++ based on the libraries GMP [11], NTL [23], IML [9] and Linbox [19]. All timings are in CPU seconds. 4.1
Comparative Timings
The state of the art concerning class group and regulator computation was established in [14], where all the timings were obtained with the SPARCStation II architecture. In addition, most of the code used at the time is unavailable now, including the HNF computation algorithm. Thus, providing a meaningful comparison between our methods and those of [14] is difficult. We chose to implement the HNF computation algorithm in a way that resembles the one of [14], but takes advantage of the libraries available today for computing the determinant and the modular HNF. We used this implementation in each different scenario. The relation collection phase is easier to compare, since our method relies on SIQS. In the following, we will refer to the base case as the strategy consisting of finding the relation matrix without using the large prime variants or the smoothness batch test, and calculating the regulator by computing its kernel with the algorithm nullspaceLong from IML library. It differs from the 0 large prime case (0LP) where we use the algorithm described in §3.3 for computing the regulator, along with a relation collection phase that does not use large primes. We also denote the 1 large prime scenario by 1LP, the 2 large primes by 2LP and 2LP Batch when using batch smoothness test. Relation collection phase. In Table 1, we give the time taken to collect all necessary relations. Without large primes, we collected |B| + 100 relations, whereas when we allow large primes we need to collect enough relations to ensure that the number of rows is larger than the number of non-empty columns. We used a 2.4 GHz Opteron with 16GB of memory and took Δ = 4(10n + 3) with 40 ≤ n ≤ 70. For each discriminant, we used the optimal parameters given in [14], including the size of the factor base, even if we tend to reduce this parameter when optimizing the overall time. The only parameter we modified is the tolerance value for the SIQS, as a higher tolerance value is required for the large prime variations. In each case we took B2 = 12B1 . It is shown in [4] that the ratio B2 /B1 does not have an important impact on the sieving time.
Improvements in Real Quadratic Number Fields
59
Table 1. Comparative table of the relation collection time n 0LP 1LP 2LP 2LP Batch 40 0.83 0.48 0.63 0.90 45 6.70 3.10 2.70 2.20 50 23.00 9.50 9.20 6.10 55 56.00 26.00 23.00 15.00 60 202.00 86.00 69.00 41.00 65 1195.00 513.00 354.00 227.00 70 4653.00 1906.00 1049.00 834.00
The timings in Table 1 correspond to the optimal value of the tolerance value in each case, found by trying values between 1.7 and 4, and keeping the optimum for each scenario. For 0LP, the optimal value is between 1.7 and 2.3 whereas it is around 2.3 for 1LP, 2.8 for 2LP and 3.0 for 2LP Batch. The latter case has a higher optimal tolerance value because using the batch smoothness test allows one to spend more time factoring the residues. When using Bernstein’s smoothness test, we took batches of 100 residues. In our experiments, this value did not seem to have an important effect on the relation collection time. We observe in Table 1 that the use of the large prime variants has a strong impact on the relation collection phase, and that using the smoothness batch test strategy yields an additional speed-up of approximately 20% over the double large prime strategy. Structured Gaussian elimination. Structured Gaussian elimination allows us to reduce the time taken by the linear algebra phase by reducing the dimensions of the relation matrix. Our method minimizes the growth of the density and of the size of the coefficients. To illustrate the impact of the algorithm described in §3.2, we monitor in Table 2 the evolution of the dimensions of the matrix, the average Hamming weight of its rows, the extremal values of its coefficients and the time taken for computing its HNF in the case of a relation matrix corresponding to Δ = 4(1060 + 3). We keep track of these values after all i-way merges for some values of i between 5 and 170. The original dimensions of the matrix are 2000 × 1700, and the timings are obtained on a 2.4 Ghz Opteron with 32GB of memory. In [4], the first author regularly deleted the rows having the largest coefficients. To do this, we need to create more rows than in the base case. To provide a fair comparison between the two strategies, we used the same relation matrix resulting from a relation collection phase without large primes, and with as few rows as was required to use the same algorithm as in [14]. We therefore had to drop the regular row deletion. We also tuned the cost function to compensate for the resulting growth of the coefficients, using 1 + 100 |ej | , C(r) = 1≤|ei |≤8
instead of (1).
|ej |>8
60
J.-F. Biasse and M.J. Jacobson
The HNF computation consists of taking the GCD of the determinants of two different submatrices of the matrix after elimination using Linbox, and using the modular HNF of NTL with this value. Indeed, this GCD (which is likely to be relatively small) is a multiple of hΔ . This method, combined with an elimination strategy due to Havas [13], was used in [14] and implemented in LiDIA [18]. As this implementation is no longer available, we instead refer to the timings of our code, which has the advantage of using the best linear algebra libraries available today. Table 2. Comparative table of elimination strategies Naive Gauss i Row Nb Col Nb Average weight max coeff min coeff HNF time 5 1189 1067 27.9 14 -17 357.9 10 921 799 49.3 22 -19 184.8 30 757 635 112.7 51 -50 106.6 50 718 596 160.1 81 -91 93.7 70 699 577 186.3 116 -104 85.6 90 684 562 205.5 137 -90 79.0 125 664 542 249.0 140 -146 73.8 160 655 533 282.4 167 -155 72.0 170 654 532 286.4 167 -155 222.4 With dedicated elimination strategy i Row Nb Col Nb Average weight max coeff min coeff HNF time 5 1200 1078 26.8 13 -12 368.0 10 928 806 42.6 20 -15 187.2 30 746 624 82.5 33 -27 100.8 50 702 580 107.6 64 -37 84.3 70 672 550 136.6 304 -676 73.4 90 656 534 157.6 1278 -1088 67.5 125 637 515 187.1 3360 -2942 63.4 160 619 497 214.6 5324 -3560 56.9 170 615 493 247.1 36761280 -22009088 192.6
Table 2 shows that the use of our elimination strategy leads to a matrix with smaller dimensions (493 rows with our method, 533 with the naive elimination) and lower density (the average weight of its rows is of 214 with our method and 282 with the naive elimination). These differences result in an improvement of the time taken by the HNF computation: 56.9 seconds with our method against 72.0 seconds with the naive Gaussian elimination. The regular cancellation of the rows having the largest coefficients over the course of the algorithm would delay the explosion of the coefficient size, but require more rows for the original matrix. This brutal increase in the size of the extremal values of the matrix can be seen in Table 2. At this point these higher values propagate during pivoting operations, and any further column elimination becomes counter-productive.
Improvements in Real Quadratic Number Fields
61
Factor base verification. The improvements in the relation collection phase have an impact on the factor base verification. The impact of the smoothness batch test is straightforward, whereas the large prime variants act in a more subtle way. Indeed, we create many more relations when using the large prime variants, and the relations created involve primes of larger norm. Therefore, a given prime not in B of norm less than 6 log2 Δ is more likely to appear in a relation, and thus not to need to be verified. Table 3 shows the impact of the large prime variants and of the batch smoothness test on the verification time. We used a 2.4 GHz Opteron with 16GB of memory. We considered discriminants of the form Δ = 4(10n + 3) for n between 40 and 70, and we chose in every case the factor base giving the best results for the base scenario. Table 3. Comparative table of the factor base verification time n 40 45 50 55 60 65 70
0LP 17.0 77.0 147.0 308.0 826.0 8176.0 9639.0
1LP 11.0 44.0 85.0 167.0 225.0 1606.0 4133.0
2LP 2LP Batch 11.0 6.2 30.0 18.0 52.0 43.0 134.0 110.0 282.0 274.0 1760.0 1689.0 5777.0 2706.0
Regulator computation. Our method for computing the regulator avoids computing the relation matrix kernel. Instead, we need to solve a few linear systems involving the matrix resulting from the Gaussian elimination. To illustrate the impact of this algorithm, we used the relation matrix obtained in the base case for discriminants of the form 4(10n + 3) for n between 40 and 70. The timings are obtained on a 2.4GHz Opteron with 16GB of memory. In Table 4, the timings corresponding to our system solving approach are taken with seven kernel vectors. However, in most cases only two or three vectors are required to compute the regulator. As most of the time taken by our approach Table 4. Comparative table of regulator computation time n Kernel Computation System Solving 40 15.0 6.2 45 18.0 8.3 50 38.0 20.0 55 257.0 49.0 60 286.0 103.0 65 5009.0 336.0 70 10030.0 643.0
62
J.-F. Biasse and M.J. Jacobson Table 5. Effect on the overall time n 40
45
50
55
60
65
70
strategy base 0LP 1LP 2LP 2LP Batch base 0LP 1LP 2LP 2LP Batch base 0LP 1LP 2LP 2LP Batch base 0LP 1LP 2LP 2LP Batch base 0LP 1LP 2LP 2LP Batch base 0LP 1LP 2LP 2LP Batch base 0LP 1LP 2LP 2LP Batch
|B| relations elimination HNF regulator verification total 400 0.8 0.1 3.2 14.6 16.8 35.6 400 0.7 0.1 2.2 6.0 16.6 25.7 300 0.8 0.2 2.5 6.4 13.1 23.1 250 1.7 0.3 4.8 8.7 18.0 33.3 250 0.5 0.2 3.6 6.7 4.4 15.5 500 6.7 0.1 5.1 18.0 77.0 107.0 500 5.9 0.2 4.9 10.0 85.0 106.0 400 4.0 0.4 6.0 11.0 50.0 71.0 350 3.8 0.5 12.0 17.0 36.0 69.0 350 2.6 1.1 9.0 14.0 30.0 57.0 750 23.0 0.3 16.0 38.0 147.0 224.0 700 21.0 0.4 15.0 20.0 147.0 203.0 450 20.0 0.4 10.0 17.0 108.0 155.0 400 14.0 0.8 22.0 23.0 74.0 133.0 400 10.0 0.6 21.0 25.0 62.0 119.0 1200 129.0 1.9 60.0 257.0 308.0 756.0 1300 47.0 0.7 52.0 49.0 265.0 414.0 650 61.0 0.7 28.0 33.0 255.0 378.0 550 40.0 1.1 48.0 48.0 177.0 313.0 550 34.0 1.0 47.0 48.0 141.0 271.0 1700 322.0 2.9 95.0 286.0 830.0 1535.0 1700 187.0 1.3 106.0 103.0 846.0 1244.0 750 309.0 1.0 45.0 64.0 865.0 1284.0 700 143.0 2.1 152.0 137.0 365.0 799.0 700 142.0 1.8 103.0 100.0 309.0 655.0 2700 10757.0 12.0 652.0 5009.0 8176.0 24607.0 2700 1225.0 2.8 489.0 336.0 3676.0 5730.0 1900 1003.0 15.0 318.0 262.0 2984.0 4583.0 1200 753.0 4.7 525.0 398.0 1943.0 3624.0 1000 1030.0 35.0 199.0 219.0 1642.0 3125.0 3700 17255.0 24.0 1869.0 10031.0 9639.0 38818.0 3600 4934.0 19.0 1028.0 644.0 9967.0 16591.0 2500 3066.0 17.0 845.0 646.0 9005.0 13579.0 1700 2414.0 27.0 2054.0 1295.0 4590.0 10379.0 1700 2588.0 20.0 1372.0 934.0 5078.0 9991.0
is spent on system solving, we see that computing fewer kernel vectors would result in an improvement of the timings, at the risk of obtaining a multiple of the regulator. Overall time. We have studied the individual impact of our improvements on each stage of the algorithm. We now present their effect on the overall time taken by the algorithm, including the factor base verification time, for discriminants of the form Δ = 4(10n + 3) with 40 ≤ n ≤ 70 on a 2.4 GHz Opteron with 16GB of memory. We used the same parameters as in [14], except for the tolerance
Improvements in Real Quadratic Number Fields
63
and the size of the factor base. We notice in Table 5 that the optimal size of the factor base is smaller when we use improvements for the sieving phase. For example the optimal size for the double large prime variant is half the one of the base case scenario. This results in an improvement in the HNF and regulator computation whereas the relation collection time can remain unchanged, or even increase. The tolerance value we chose varies only with the strategy, but not with the size of the discriminant. We chose 2.0 for the base case and 0LP whereas we set it to 2.3 for 1LP, 2.8 for 2LP and 3.0 for 2LP Batch. We eliminated columns of weight up to w = 150 since Table 2 indicates that further elimination is counter-productive. Table 5 shows that there is an overall speed-up of of a factor of 2 for the smallest discriminants and 4 for the largest. The base case with the largest discriminants suffers from the necessity of finding some relations in a more randomized way. This ensures that we can get full rank submatrices of the relation matrix after the Gaussian elimination to compute a small multiple of hΔ . Matrices produced using the large prime variants do not need this extra step, even with the largest discriminants. This naturally affects the sieving time, since we cannot use SIQS for that purpose, but also affects phases relying on linear algebra. Indeed, elimination produces a matrix with larger entries and dimensions. 4.2
Large Example
The improvements we described allow us to compute class groups and regulators of real number fields with larger discriminants than was previously possible. The key is to parallelize the relation collection and verification phase, while the linear algebra has to be performed the usual way. These methods were successfully used in [4] to compute the class group structure of an imaginary quadratic field with a 110-digit discriminant. We used a cluster with 260 2.4GHz Xeon cores to compute a relation matrix corresponding to the discriminant Δ110 := 4(10110 +3) in 4 days. We allowed two large primes, used a tolerance value of 3.0, tested batches of 100 residues, took w = 250 and set |B| = 13000 . Then, we used three 2.4 GHz Opterons with 32GB of memory each to compute determinants of full-rank submatrices of the relation matrix after the Gaussian elimination in 1 day, and one 2.4GHz Opteron to compute the HNF modulo the GCD of these determinants in 3 days. We had to find 4018 extra relations during the verification phase that took 4 days on 96 2.4GHz Xeon cores. We thus obtained that (2) ClΔ110 ∼ = Z/12Z × Z/2Z , and the corresponding regulator is RΔ110 ≈ 70795074091059722608293227655184666748799878533480399.6730200233 .
We estimate that it would take two weeks (4000 relations per day) to complete the relation collection for Δ120 with the same factor base as Δ110 , thus requiring a similar time for the linear algebra.
64
5
J.-F. Biasse and M.J. Jacobson
Conclusions
Recently, our work has been extended to the problems of principal ideal testing and solving the discrete logarithm problem in the ideal class group [5]. The double large prime variant and improvements to relation generation translated directly to improvements in this context. However, HNF computations are not required for this problem, and linear system solving over Z can be used instead. The numerical results were used to give estimates for discriminant sizes that offer equivalent security to recommended sizes of RSA moduli. Some possibilities for further improvements remain to be investigated. For example, a lattice sieving strategy could be used to sieve ϕ(x, y) instead of ϕ(x, 1). Factor refinement and coprime factorization techniques may be a useful alternative to Bernstein’s batch smoothness test. Multiple large primes have been successfully used for integer factorization and could also be tried in our context. There is also still room for improvement to the linear algebra components. For example, a HNF algorithm that exploits the natural sparseness of the relation matrix, perhaps as a black-box algorithm, would be useful. If such an algorithm were available, we could reconsider using Gaussian elimination techniques since they induce a densification of the matrix. We could also study the effect of other dense HNF algorithms in existing linear algebra packages such as KASH, Pari, Sage and especially MAGMA which seems to have the most efficient HNF algorithm for our types of matrices. In that case, we would need the elimination phase regardless of how these algorithms are affected by the density and the size of the coefficients of the matrix. Indeed, we cannot afford manipulating a dense representation of the matrix before the Gaussian elimination phase.
References 1. Bach, E.: Explicit bounds for primality testing and related problems. Math. Comp. 55(191), 355–380 (1990) 2. Bach, E.: Improved approximations for Euler products. In: Number Theory: CMS Proc., vol. 15, pp. 13–28. Amer. Math. Soc., Providence (1995) 3. Bernstein, D.: How to find smooth parts of integers. Mathematics of Computation (submited) 4. Biasse, J.-F.: Improvements in the computation of ideal class groups of imaginary quadratic number fields. In: Advances in Mathematics of Communications (to appear 2010) 5. Biasse, J.-F., Jacobson Jr., M.J., Silvester, A.K.: Security estimates for quadratic field based cryptosystems. In: ACISP (to appear 2010) 6. Buchmann, J.: A subexponential algorithm for the determination of class groups and regulators of algebraic number fields. In: S´eminaire de Th´eorie des Nombres (Paris), pp. 27–41 (1988-1989) 7. Buchmann, J., D¨ ullmann, S.: Distributed class group computation. In: Festschrift aus Anlaß des sechzigsten Geburtstages von Herrn Prof. Dr. G. Hotz, pp. 69–79. Universit¨ at des Saarlandes (1991), Teubner, Stuttgart (1992)
Improvements in Real Quadratic Number Fields
65
8. Cavallar, S.: Strategies in filtering in the number field sieve. In: Bosma, W. (ed.) ANTS 2000. LNCS, vol. 1838, pp. 209–232. Springer, Heidelberg (2000) 9. Chen, Z., Storjohann, A., Fletcher, C.: IML: Integer Matrix Library. Software (2010), http://www.cs.uwaterloo.ca/~ astorjoh/iml.html 10. Dodson, B., Leyland, P.C., Lenstra, A.K., Muffett, A., Wagstaff, S.: MPQS with three large primes. In: Fieker, C., Kohel, D.R. (eds.) ANTS 2002. LNCS, vol. 2369, pp. 446–460. Springer, Heidelberg (2002) 11. GMP, The GNU multiple precision bignum library. Software (2010), http://gmp-lib.org/ 12. Gower, J.E., Wagstaff, S.: Square form factorization. Mathematics of Computation 77, 551–588 (2008) 13. Havas, G., Majewski, B.S.: Integer matrix diagonalization. Journal of Symbolic Computing 24, 399–408 (1997) 14. Jacobson Jr., M.J.: Subexponential class group computation in quadratic orders, Ph.D. thesis, Technische Universitt Darmstadt, Darmstadt, Germany (1999) 15. Jacobson Jr., M.J., Scheidler, R., Williams, H.C.: The efficiency and security of a real quadratic field based key exchange protocol. In: Public-Key Cryptography and Computational Number Theory, Warsaw, Poland, pp. 89–112. de Gruyter (2001) 16. Jacobson Jr., M.J., Williams, H.C.: Solving the Pell equation. CMS Books in Mathematics. Springer, Heidelberg (2009) ISBN 978-0-387-84922-5 17. Lenstra, A.K., Manasse, M.S.: Factoring with two large primes (extended abstract). In: Damg˚ ard, I.B. (ed.) EUROCRYPT 1990. LNCS, vol. 473, pp. 72–82. Springer, Heidelberg (1991) 18. LiDIA Group, LiDIA: a c++ library for computational number theory. Software, Technische Universit¨ at Darmstadt, Germany (1997), http://www.informatik.tu-darmstadt.de/TI/LiDIA 19. LinBox, Project LinBox: Exact computational linear algebra. Software (2010), http://www.linalg.org/ 20. Louboutin, S.: Computation of class numbers of quadratic number fields. Math. Comp. 71(240), 1735–1743 (2002) 21. Maurer, M.: Regulator approximation and fundamental unit computation for real quadratic orders, Ph.D. thesis, Technische Universitt Darmstadt, Darmstadt, Germany (1999) 22. Milan, J.: Tifa. Software (2010), http://www.lix.polytechnique.fr/Labo/Jerome-Milan/tifa/tifa.xhtml 23. Shoup, V.: NTL: A Library for doing Number Theory. Software (2010), http://www-shoup.net/ntl 24. Vollmer, U.: An accelerated Buchmann algorithm for regulator computation in real quadratic fields. In: Fieker, C., Kohel, D.R. (eds.) ANTS 2002. LNCS, vol. 2369, pp. 148–162. Springer, Heidelberg (2002)
On the Use of the Negation Map in the Pollard Rho Method Joppe W. Bos, Thorsten Kleinjung, and Arjen K. Lenstra Laboratory for Cryptologic Algorithms EPFL, Station 14, CH-1015 Lausanne, Switzerland
Abstract. The negation map can be used to speed up the Pollard rho method to compute discrete logarithms in groups of elliptic curves over finite fields. It is well known that the random walks used by Pollard rho when combined with the negation map get trapped in fruitless cycles. We show that previously published approaches to deal with this problem are plagued by recurring cycles, and we propose effective alternative countermeasures. As a result, fruitless cycles can be resolved, but the best speedup we managed to achieve is√by a factor of only 1.29. Although this is less than the speedup factor of 2 generally reported in the literature, it is supported by practical evidence. Keywords: Pollard’s rho method, fruitless cycles, negation map.
1
Introduction
The difficulty of the elliptic curve discrete logarithm problem (ECDLP) underlies the security of cryptographic schemes based on elliptic curves over finite fields [11,13]. The best method known to solve ECDLP for curves without special properties is the parallelized [17] Pollard rho method [15]. A common optimization is to halve the search space by identifying a point with its inverse [18,9,7]. Because representatives for the equivalence classes can quickly be computed using the negation√map, this equivalence relation may result in a speedup by a factor of up to 2 when solving ECDLP. For the elliptic curves over binary extension fields F2t from [12], order t equivalence relations can be used as well, √ resulting in a speedup by a factor of up to 2t [18,9]. Usage of the negation map in the context of the Pollard rho method leads to fruitless cycles, useless cycles trapping the random walks. An analysis of their likelihood of occurrence appeared in [7]. Various methods have been proposed [18,9] to deal with them, all leading to costlier random walks and administrative overhead. The literature suggests that √ the resulting inefficiencies are negligible, and that a speedup by a factor of 2 is attainable [1, Section 19.5.5]. We analyze fruitless cycles and the previously published methods to avoid their ill effects and show that current approaches to escape from cycles suffer from recurring cycles. These may have contributed to the lack of practical usage of the negation map to solve prime field ECDLPs: it was not used for the solutions G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 66–82, 2010. c Springer-Verlag Berlin Heidelberg 2010
On the Use of the Negation Map in the Pollard Rho Method
67
[10,6] of the 79-, 89-, 97- and 109-bit prime field Certicom challenges [5]. Neither was it used by the independent current 112-bit prime field record [3]. We present and analyze alternative methods to deal with fruitless cycles. All our analyses are supported by experiments. We found that the negation map indeed leads to a speedup, but we have √ not been able to reach more than a factor of 1.29, somewhat short of the 2 that we had hoped for. We also found that the best attainable speedup depends on the platform one uses: for instance, if the Pollard rho method is parallelized in SIMD fashion, it is a challenge to achieve any speedup at all. This has consequences for the applicability of the negation map in large scale prime field ECDLP solution attempts. For such efforts, all participating processors must use the same random walk definition, so one may desire to gear the implementation towards processors with the best performance/price ratio, such as graphics cards (which are SIMT, a SIMD variant). The negation map (while dealing with cycles) slows down random walks in three ways. In the first place, on average more elliptic curve group operations are required per step of each walk. This is unavoidable and attempts should be made to minimize the number of additional operations. Secondly, dealing with cycles entails administrative overhead and branching, which cause a non-negligible slowdown when running multiple walks in SIMD-parallel fashion. Finally, the best way to counter the effect of the higher average number of group operations per step is making the walks “more random” by allowing a finer grained decision per step. However, the beneficial effects of this approach are, in most circumstances on current processors, wiped out by cache inefficiencies. It will be seen that it is best to strike a balance between the first and third of these slowdowns. The second slowdown somewhat affects regular PCs, but is a major obstacle to the negation map in SIMD environments. This paper is organized as follows. Section 2 recalls background on ECDLP, the Pollard rho method and fruitless cycles. Section 3 introduces recurring cycles and presents and analyzes new methods to deal with them. Section 4 compares the various cycle reduction, detection, and escape methods in practice.
2 2.1
Preliminaries The Elliptic Curve Discrete Logarithm Problem
Let Fp denote a finite field of odd prime characteristic p. Any a, b ∈ Fp with 4a3 + 27b2 = 0 define an elliptic curve Ea,b over Fp . The additively written group of points Ea,b (Fp ) of Ea,b over Fp is defined as the zero point o along with the set of pairs (x, y) ∈ Fp × Fp that satisfy the shortened Weierstrass equation y 2 = x3 + ax + b. Let p, a, b and g ∈ Ea,b (Fp ) of prime order q be such that the index [Ea,b (Fp ) : g] is small. For h ∈ g, the ECDLP is to find an integer m such that mg = h. For curves without special properties, solving ECDLP is √ believed to require an effort on the order of q. Pollard’s rho method achieves this run time, while requiring more or less constant memory.
68
2.2
J.W. Bos, T. Kleinjung, and A.K. Lenstra
Pollard’s Rho Method
If objects are selected truly at random and with replacement from q objects, the conditional probability at step n + 1 of finding the first duplicate (or collision) is nq (if n < q). Via straightforward arguments this leads to πq/2 for the expected number of steps until the first collision. If random objects are selected as ug + vh ∈ g for random integer multipliers u, v, a collision corresponds to u, v, u ¯, v¯ such that ug + vh = u ¯g + v¯h. Unless v¯ ≡ v mod q, the value m = u−¯ u mod q solves the discrete logarithm problem. The expected number of steps v ¯−v of this idealized version of Pollard’s rho method [15] is πq/2. r-adding and r+s-mixed walks. Pollard’s rho method uses an approximation of a truly random walk in g. Let, for a small integer r, an index function : g → [0, r − 1] induce an r-partition g = ∪r−1 i=0 Gi of g, where Gi = {x : x ∈ g, (x) = i} and all Gi have cardinality close to qr . For random integers ui , vi , elements fi = ui g + vi h ∈ g are precomputed for 0 ≤ i < r. Starting at a random but known multiple of g, the successor of a point p of the walk is defined as p + f(p) ∈ g. It is easy to keep track of the u, v such that p = ug + vh. Such an r-adding walk results in anexpected number of steps until a collision occurs that is somewhat larger than πq/2, as shown by Brent and Pollard [4] i and expanded upon in [2]. Assume that is perfectly random. Let pi = #G q . A point in the walk is said to belong to class i if its predecessor upon its first occurrence belongs to Gi . If the nth point belongs to Gj (with probability pj ) and the (n + 1)st point produces the first collision, the collision point cannot be of class j (this happens with probability pj ), since then the collision would have occurred in step n. Therefore, the probability that the first collision occurs at step n + 1 is r−1 n (1 − p2j ). q j=0 With q =
1−
q r−1 j=0
p2j
this is
n q .
We get via the same arguments referred to above
πq = 2
2(1 −
πq r−1 j=0
p2j )
(1)
for the expected number of steps until the first collision. Pollard [15] uses r = 3, f0 = h, and f2 = g, but replaces the i = 1 case by the doubling 2p. Teske [16] shows that a larger r, such as r = 20, leads to better performance on average, conform the analysis, even if none of the choices does an explicit doubling, as Pollard’s i = 1 case. Inclusion of doublings leads to r + s-mixed walks: with : g → [0, r + s − 1] q , the next point equals partitioning g into r + s parts of cardinality close to r+s p + f(p) if 0 ≤ (p) < r, but 2p if (p) ≥ r. Pollard’s walk is a 2 + 1-mixed walk. The analysis above applies again, assuming that we consider the doublings as one class, hit with probability pD . Experiments by Teske show that best performance is achieved for rs between 14 and 12 but that apart from the case r = 3 mixed
On the Use of the Negation Map in the Pollard Rho Method
69
walks are not significantly better. The analysis and our own experiments, as reported below, suggest that the optimal ratio rs is close to zero. Per step the occurrence probability of the event p = fi (and thus a chance to solve the discrete logarithm problem) is negligible compared to the probability of a birthday collision. So, for r-adding walks doublings most likely will not occur. Parallelized random walks. Parallelization of Pollard’s rho method does not consist of running any number of random walks in parallel, until one of √ them M , so collides: on M processors the expected speedup would be by a factor of √ overall it would require M more processing power than a single processor. The proper way to parallelize Pollard’s rho method is presented in [17]. It achieves an M -fold speedup on M processors, thus requiring the same overall processing 1 th of the time. Different processes must be power as a single process, but in M able to efficiently recognize if, probably at different points in time, their walks collide. To achieve this, each process generates a single random walk, each from its own random starting point, but all using the same index function and the same fi ’s. As soon as a walk hits upon a distinguished point, this point is reported. The idea is that when two walks collide – without noticing it – they will keep taking the same steps (because they use the same walk definition) and will thus both ultimately reach the same distinguished point. This will be noticed when the colliding distinguished point is reported. The discrete logarithm can then be computed from the two, hopefully distinct, pairs of integer multipliers u, v that correspond to the same distinguished point. A distinguished point must be easy to recognize, occur with low enough probability to make it possible to store them all and to efficiently find collisions, but occur often enough for every walk to hit one. The distinguishing property could be that k specific bits of the point’s x-coordinate are zero, in which case walks may hit a distinguished point once every 2k steps. The parallelized version of Pollard’s rho method requires a unique, and thus affine, point representation to make the walks well-defined and to recognize distinguished points. The fastest suitable type of elliptic curve group arithmetic uses the affine Weierstrass point representation. Per group operation, it requires a (usually expensive) modular inversion. Its cost is amortized among the walks running in parallel per processor, at the cost of three modular multiplications per step per walk, using Montgomery’s simultaneous inversion [14]. Point doubling requires an extra modular squaring compared to regular non-doubling point addition. This makes doubling on average about 76 times slower than regular addition when parallelized walks and simultaneous inversion are used. Using automorphisms. Following [18], define an equivalence relation ∼ on g by p ∼ −p for p ∈ g and, instead of searching g of size q, search g/∼ of size about q2 . Denoting the equivalence class containing p and −p by ∼p, it may be represented by the element with y-coordinate of least absolute value. It is trivial to calculate since −(x, y) = (x, −y) for (x, √y) ∈ g. Thus, using this negation map one would expect to save a factor of 2 in the number of steps. √ For r-adding and r + s-mixed walks the speedup by a factor of 2 is slightly too pessimistic. Let the definitions of pi , pD , and of class i be as above. Assume
70
J.W. Bos, T. Kleinjung, and A.K. Lenstra
Table 1. Number of steps required by the Pollard rho method in random elliptic curve groups of 31-bit q over prime fields of random 31-bit prime characteristic p, prime order divided by πq/2 or by πq/4 (without or with the negation map). Lowest and highest averages are over 10 measurements. Each measurement calculates the average number of steps taken until a collision occurs, over 100 000 collision searches where for each search a prime p and an elliptic curve over Fp are randomly selected until the order q of the group of points is prime. Overall average is the average of the 10 averages (thus, the average over one million searches). Expression (1) and (2) columns are the quotients as 1 expected based on expressions (1) (with pi = 1r for 0 ≤ i < r) and (2) (with pi = r+s s for 0 ≤ i < r and pD = r+s ), respectively. Those expressions are for q → ∞ and indeed for larger (smaller) q they give a better (worse) fit. Without negation map Averages Expression lowest overall highest (1) 8-adding 1.079 1.083 1.085 1.069 16-adding 1.032 1.037 1.040 1.033 32-adding 1.014 1.018 1.019 1.016 16 + 4-mixed 1.041 1.043 1.044 1.043 16 + 8-mixed 1.075 1.078 1.081 1.078
With negation map Averages Expression lowest overall highest (2) 1.035 1.039 1.042 1.033 1.015 1.017 1.020 1.016 1.007 1.009 1.011 1.008 1.036 1.038 1.040 1.031 1.075 1.077 1.079 1.069
that the nth point belongs to Gj and that the (n + 1)st point produces the first collision while hitting the representative p, directly or after negation. If this step is a doubling then the analysis is as above. This happens with probability p2D . Otherwise, we only exclude the case that, as a result of just the addition, the two predecessors hit the same point (p or −p). This happens with probability Therefore, the probability that the first collision occurs at step n + 1 is
p2j 2 .
r−1 2 pj 2n (1 − p2D − ). q 2 j=0
As above we get
πq 4(1 −
p2D
−
1 2
r−1 j=0
p2j )
(2)
for the expected number of steps until√the first collision. For the same parameter values this expression is more than 2 smaller than Expression (1). However, usage of the negation map requires modifications to the iteration function due to the occurrence of fruitless cycles. This disadvantage of the negation map was already pointed out in [9,18]. It is the focus of this article. The group g may admit other trivially computable maps. For Koblitz curves the √ Frobenius automorphism of a degree t binary extension field leads to a further t-fold speedup. This does not apply to the case considered here. Small scale experiments. We checked the accuracy of predictions based on expressions (1) and (2). The results, for 31-bit primes q, are listed in Table 1.
On the Use of the Negation Map in the Pollard Rho Method
71
With all averages larger than 1, both r-adding and r + s-mixed walks on average perform worse than truly random walks. For most walks with the negation map the averages are lower than their negation-less counterparts, indicating√that the reduction factor in the expected number of steps is indeed larger than 2. This does not imply a speedup by the same factor, because to obtain the figures costly fruitless cycle detection methods had to be used. It can be seen that r + s-mixed walks are disadvantageous if s > r4 . 2.3
Fruitless Cycles
Straightforward application of the negation map to Pollard’s rho method with r-adding or r + s-mixed walks does not work due to fruitless cycles. This section describes the current state-of-the-art of dealing with those cycles. Length 2 cycles. If a random walk step goes from p to −p − fi (with probability 12 , for some i) and −p − fi ∈ Gi (with probability 1r ), then the next point after −p − fi is p again (with probability 1), thereby cancelling the effect of the previous step. It follows that a fruitless 2-cycle starts from a random point with 1 probability 2r , cf. [7, Proposition 31]. This 2-cycle is denoted as (i,−)
(i,−)
p −→ −(p + fi ) −→ p. Here “(i, s)” with s ∈ {−, +} indicates that addition constant fi is added to a point p after which the result is left as is (s = +) or negated (s = −) to find the correct representative (p + fi if s = +, or −p − fi if s = −). Any walk with two consecutive steps “(i, −)” is trapped in an infinite loop. Because this happens 1 , all walks can be expected to end up in fruitless cycles after with probability 2r a moderate number of steps when the negation map is used with r-adding walks. Looking ahead to reduce 2-cycles. To reduce the occurrence of 2-cycles, Wiener and Zuccherato propose to use a more costly iteration function that results in a lower probability that two successive points belong to the same partition [18]. This can be achieved by using the first i of (p), (p) + 1, . . ., (p) + r − 1 such that i mod r = (∼ (p + fi )), if such an index exists (here and in the sequel indices i in fi are understood to be taken modulo r). Thus, define the next point as f (p) with f : g → g defined by E(p) if j = (∼(p + fj )) for 0 ≤ j < r f (p) = ∼(p + fi ) with i ≥ (p) minimal s.t. (∼(p + fi )) = i mod r. The function E : g → g may restart the walk at a new random initial point. The latter is expected to happen once every rr steps and will therefore not affect the The expected cost per step of the walk is increased by a factor of r efficiency. 1 1 1 i=0 r i , which lies between 1 + r and 1 + r−1 . Dealing with fruitless cycles in general. Although the look-ahead technique reduces the frequency of 2-cycles, they may still occur [18]. This is elaborated upon in Section 3. Even so, it is well known that just addressing 2-cycles does
72
J.W. Bos, T. Kleinjung, and A.K. Lenstra 4.5e+06 4e+06
steps / second
3.5e+06 3e+06 2.5e+06 2e+06 1.5e+06 1e+06 500000 0
2
4
6
8
10
log2 (r)
12
14
16
18
Fig. 1. Total number of steps per second as a function of r, taken by 200 parallel r-adding walks sharing the modular inversion and not using the negation map, for Pollard’s rho method applied to a 131-bit prime ECDLP
not solve the problem of fruitless cycles, because longer cycles will occur as well. Reducing their occurrence requires additional overhead on top of what is already incurred to reduce 2-cycles. Given that fruitless cycles are unavoidable, they must be effectively dealt with when they occur. In [9] a general approach is proposed to detect cycles and to escape from them: after α steps record a length β sequence of successive points and compare the next point to these β points. If a cycle is detected a cycle representative p is chosen deterministically from which the cycle is escaped. One may add f(p)+c for a fixed c ∈ [2, r − 1] (the choice c = 1 is bad as it could lead to an immediate cycle recurrence). Instead one may add a distinct precomputed value f that does not depend on the escape-point, or one may add f(p) from a distinct list of r precomputed values f0 , f1 , . . . , fr−1 . In the next section we discuss fruitless cycles in greater detail and propose alternative methods that avoid problems that the method from [9] may run into.
3
Improved Fruitless Cycle Handling
The probability to enter a fruitless cycle decreases with increasing r [7]. This does not imply that it suffices to take r large enough to make the probability sufficiently low. Fig. 1 depicts the effect of increasing r-values on the performance of an r-adding walk, measured as number of steps per second. The performance deterioration can be attributed to the increasing rate of cache misses during retrieval of the addition constants fi . The effect varies between processors, implementations, and elliptic curves. It is worsened for more contrived walks, such as those using the negation map where cycle reduction, detection and escape methods are unavoidable. Unless the expected overall number of steps (of or√ der q) is too small to be of interest, r cannot be chosen large enough to both
On the Use of the Negation Map in the Pollard Rho Method
(i,−)
(i,−) −p−fi =q
p (i,−)
(i−1, ..)
(∼(p+fi−1 )) = i−1
73
(i−1, ..)
(∼(q+fi−1 )) = i−1
−p−fi =q
p (i−1, ..)
(i,−)
p¯ = ∼(p+fi−1 )
¯q = ∼(q+fi−1 )
(j, ..) (∼(p¯ +fj )) ∈ {i−1, j}
(i−1, ..)
(k, ..) (∼(¯q +fk )) ∈ {i−1, k}
Fig. 2. 2-cycles caused by 2-cycle reduction (left) and 4-cycle reduction. The dotted steps are prevented.
avoid fruitless cycles and achieve adequate performance. Therefore, in this section we concentrate on other ways to deal with fruitless cycles. We first discuss short-cycle reduction techniques, next discuss cycle detection methods and analyze their behavior, and finally propose alternative methods. 3.1
Short Fruitless Cycle Reduction
2-cycles. Unfortunately, the look-ahead technique to reduce 2-cycles presented above introduces new 2-cycles. The dotted lines in the left example in Fig. 2 are the steps taken by the regular iteration function, the new cycle is depicted by the solid lines which are the steps taken as a result of f (p) and f (q). This new cycle occurs with probability 2r13 . It is the most likely 2-cycle introduced by the look-ahead technique. Lemma 1. The probability to enter a fruitless 2-cycle when looking ahead to reduce 2-cycles while using an r-adding walk is 1 2r
r−1 2
1 1 (rr−1 − 1)2 1 = = + O . i 2r−1 2 3 r 2r (r − 1) 2r r4 i=1
Proof. With i as in the definition of f , the probability is r−c that i ≥ (p) + c for 0 ≤ c < r (considering the case E(p) as i = ∞), hence i = (p) + c with 1 probability r−1 r rc . We compute the probability of entering a cycle consisting of points p and q starting at p. Let j = (p) and k = (q), and let the steps from p to q and back be adding fj+c and fk+d , respectively. This implies that j + c ≡ k + d mod r and that the step from p to q involves a negation. From the definition of f it follows
74
J.W. Bos, T. Kleinjung, and A.K. Lenstra
(∼(p˜ + fk )) ∈ {i, k} (k, ..) p˜ =∼(p + fi ) (i, ..) p
(∼(˜q + fn ) ∈ {j, n} (n, ..) ∼(−p − fj+1 + fj ) = ˜q (j + 1,−)
(i + 1,+)
(j, ..) −p − fj+1 (i + 1,+) −p − fi+1 − fj+1
p + fi+1 (j, ..)
(j + 1,−)
p¯ =∼(p + fi+1 + fj ) (l, ..) (∼(p¯ + fl )) ∈ {j, l}
(i, ..) ∼(−p − fi+1 − fj+1 + fi ) = ¯q (m, ..) (∼ (¯q + fm )) ∈ {i, m}
Fig. 3. A 4-cycle when the 4-cycle reduction method is used
that (q) ≡ j + c mod r, thus d = 0 and by symmetry c = 0. Since j is given and k is determined by j, c and d, the probabilities must be summed over all possible c and d. The probability for a c, d pair is the product of the following probabilities: • • •
r−1 1 r rc 1 2 1 r−1
•
1 rd
for the first step being c; for the sign; for (∼(p + fj+c )) = k (we know already that (∼(p + fj+c )) ≡ j + c ≡ k mod r); for the second step being d (since (∼(q + fk+d )) ≡ k + d mod r).
This results in the probability
r−1 r−1 1 1 1 . 2r c=1 rc rd
d=1
We conclude that, even when the look-ahead technique is used, 2-cycles are still too likely to occur for relevant values of q and r. Some of the new 2-cycles are prevented by other short-cycle reduction methods, but the remaining ones must be dealt with using detection and escape methods. This is discussed below. 4-cycles. Unless the addition constants fi have been chosen poorly, 3-cycles do not occur as a direct result of the negation map, so that 4-cycles are the next type of short cycles to be considered. Excluding again that the fi have unlikely properties, a fruitless 4-cycle without proper sub-cycle is of the form (i,+)
(j,−)
(i,+)
(j,−)
p −→ p + fi −→ −p − fi − fj −→ −p − fj −→ p. The cycle may be entered at any of its four points. Hence, a fruitless 4-cycle starts from a random point with probability r−1 4r 3 . This is a lower bound for the probability of occurrence of 4-cycles when looking ahead to reduce 2-cycles.
On the Use of the Negation Map in the Pollard Rho Method
75
An extension of the 2-cycle reduction method looks ahead to the first two successors of a point, thereby reducing the frequency of 2-cycles and 4-cycles, while still being deterministic: ⎧ E(p) if j ∈ {(q), (∼(q + f(q) ))} or (q) = (∼(q + f(q) )) ⎪ ⎪ ⎨ where q =∼(p + fj ), for 0 ≤ j < r, g(p) = q =∼(p + f ) ⎪ i with i ≥ (p) minimal s.t. ⎪ ⎩ i mod r = (q) = (∼(q + f(q) )) = i mod r. Compared to f (p), the probability that E is called increases from ( 1r )r to at least ( 2r )r because (∼(q + f(q) )) ∈ {j mod r, (q)} with probability 2r for each j. This times slower than the standard one, because iteration function is at least r+4 r with probability 2r at least two additional group operations need to be carried 1 2 out, an effect that is slightly alleviated by a factor of ( r−1 r ) since the image of g q. The value ∼(q+f(q)) can be is a subset of g of cardinality approximately r−1 r stored for use in the next iteration. Usage of g reduces the occurrence of 4-cycles, and also prevents some of the 2-cycles newly introduced by the 2-cycle reduction method (such as the one depicted on the left in Fig. 2). But g introduces new types of 2-cycles and 4-cycles as well, both of which do indeed occur in practice. A newly introduced 2-cycle is shown in the right example in Fig. 2. There the 2 points ¯ p and ¯ q are ∈ Gi−1 ∪ Gi . This 2-cycle occurs with probability 2(r−2) (r−1)r 4 , which is therefore a lower bound for the probability of 2-cycles when using the 4-cycle reduction method. Fig. 3 depicts an example of a newly introduced 4cycle: the points reached via dotted lines belong to a partition different from their predecessors. The probability that such a 4-cycle starts from a random 4 (r−1) point is at least 4(r−2) . r 11 We have not been able to design or to find in the literature short-cycle reduction methods that do not introduce other (lower probability) short cycles. We therefore turn our attention to cycle detection and escape methods. 3.2
Cycle Detection and Escape
Recurring cycles. The cycle detection and escape method from [9] described in Section 2.3, does not prevent recurrence to the same cycle. When using f(p)+c to escape (we fixed c = 4 as it worked as well as any other choice = 1), Fig. 4 depicts how the (wavy) escape from the (solid) 4-cycle recurs to the 4-cycle via one of the dotted possibilities. The probability of recurrence depends on the escape method and on which point in the cycle the walk recurs to. With f(p)+c 1 as escape, immediate recurrence to the escape point happens with probability 2r 1 when no cycle reduction is used, recurrence happens with probability at least 2r2 2
with 2-cycle reduction, and with probability at least (r−2) with 4-cycle and thus r4 2-cycle reduction. Similar recurrences occur, with lower probabilities, when f or f(p) are used to escape. Lemma 2. Lower bounds for the probabilities to enter 2-cycles or 4-cycles or to recur to cycles for three different cycle escape methods are listed in Table 2
76
J.W. Bos, T. Kleinjung, and A.K. Lenstra
−p − fi − fj (i, +)
(j, −)
−p − fj
p + fi (k, −)
p
(i, +)
(k, +) (j, −)
−p − fk − fj
(k, +)
−p − fi − fk
(i, −)
(j, −)
p + fk
Fig. 4. Escaping from a fruitless 4-cycle, and recurring to it (i = j = k = i)
if no cycle reduction, or 2-cycle reduction (f ), or 4-cycle reduction (g) is used, along with a lower bound for the slowdown factor caused by f or g. Proof. The proofs for many entries of Table 2 were given earlier. We prove the entries in rows four and five. Let p be the escape point and let q be the point it escapes to. Using f or f(p) one can recur to the escape point p by entering another cycle at q and escaping from it at q again. This new cycle could be a 2-cycle. For this to happen the first escape step to q has to involve a negation (probability 12 ), a 2-cycle has to be entered at q (probabilities in first row, but see below), the escape point of this 2-cycle has to be q (probability 12 ), and, in the case of fi , the partition that q belongs to has to be the same as the one p belongs to (probability 1r ). In the case of 4-cycle reduction the probability to enter a 2-cycle at q is slightly lower since we do not have the information that (∼(q + f(q) )) = (q); a calculation analogous to the one done at the end of Section 3.1 produces the values listed in the table. 6-cycles. With proper fi and no sub-cycle, a common 6-cycle is of the form (i,+)
(j,−)
(k,+)
(i,+)
(j,−)
(k,+)
p −→ p+fi −→ −p−fi −fj −→ −p−fi −fj +fk −→ −p−fj +fk −→ p−fk −→ p (i = j = k = i) where with appropriate sign changes steps four and five may be swapped. It may be entered at any of its six points and occurs, when using 4-cycle reduction, with probability 4r13 + O( r14 ). A lower bound to recur to it follows by multiplying this probability with the recurring probabilities from Table 2.
On the Use of the Negation Map in the Pollard Rho Method
77
Table 2. Summary of effect of cycle reduction, detection, and escape methods. With the exception of the two bold entries, all figures are lower bounds. Probability to enter
Cycle reduction method:
none
2-cycle 4-cycle
⎧ ⎪ ⎨ f(p)+c Probability to recur to escape point using f ⎪ ⎩ f(p) Slowdown factor of iteration function
3.3
2-cycle
4-cycle
1 2r r−1 4r3
1 2r 3 r−1 4r 3
2(r−2)2 (r−1)r 4 4(r−2)4 (r−1) r 11
1 2r 1 8r 1 8r 2
1 2r 2 1 8r 3 1 8r 4
(r−2)2 r4 (r−2)2 2r 5 (r−2)2 2r 6
n/a
r+1 r
r+4 r
Alternative Approaches
The purpose √ of using the negation map is to obtain a speedup, hopefully by a factor of 2. From Fig. 1 it follows that large r-values cannot be used. From Table 2 it follows that for small r-values and relevant q-values fruitless cycles are likely to occur and recur. Medium r-values look the most promising, but are not compatible with all environments. Since fruitless cycle occurrence and recurrence cannot be rooted out, alternative methods are needed if we want to make the negation map useful. In this section several possibilities are offered. Heuristic. A cycle with at least one doubling is most likely not fruitless. Proof. Let p = ug + vh be a point on the cycle. The subsequent points are obtained by adding one of the fi or by doubling, and negating if needed, thus are up to sign linear combinations of the fi and a power-of-two multiple of p. If c ≥ 1 is the number of doublings in the cycle, we get a relation of the form p = ±2c p +
r−1
ci fi = ±2c p +
i=0
(1 ∓ 2c )u −
r−1 i=0
r−1 i=0
ci u i
ci u i g +
r−1
g+
ci vi h
and thus
i=0
(1 ∓ 2c )v −
r−1
ci vi
h = 0,
i=0
r−1 where ci ∈ Z. Since 1 ∓ 2c = 0, the expression (1 ∓ 2c )u − i=0 ci ui is most likely not divisible by the group order. This also holds if {fi : 0 ≤ i < r} is enlarged with f or with {fi : 0 ≤ i < r}. This concludes our heuristic argument. Cycle reduction by doubling. The regular structure required for cycles is caused by repeated addition and subtraction using the same set of constants. This structure would be broken effectively by using an occasional doubling, i.e., a mixed walk. If such walks are used, the heuristics suggest that cycles occur
78
J.W. Bos, T. Kleinjung, and A.K. Lenstra
only between two doublings. If the doubling frequency is sufficiently high, only short cycles would have to be dealt with. As borne out by expressions (1) and (2) when using the idealized values pi = 1 s r+s for 0 ≤ i < r and pD = r+s for r > 0, and as supported by the experiments reported in Table 1, an r + s-mixed walk with s > 1 always displays noticeably less random behavior than a well-partitioned r -adding walk for any r > r. Nevertheless, using properly tuned r + s-mixed walks may be a way to address the cycle problem while avoiding impractically large r-values. However, r + s-mixed walks have disadvantages caused by the underlying arithmetic. Given the relative speeds of addition and doubling, an r + s-mixed times slower than an r-adding walk. In a SIMD environment walk is r+7s/6 r+s where many walks are processed simultaneously, per step a fraction of about r r+s of the walks will do an addition, whereas the others do a doubling. If the addition and doubling code differ, as is the case for the affine Weierstrass representation, the two types of steps cannot be executed simultaneously. Thus, in such environments, to avoid a slowdown by a factor of more than 2 one needs to swap walks to make all parallel step-operations identical (at non-negligible overhead), or one has to settle for a suboptimal affine point representation that allows identical code. SIMD-application of the negation map and the possibility of another point representation are subjects for further study. Doubling based cycle reduction and escape. Taking into account that doubling should not be used too frequently, usage could be limited to cycle reduction or escape. This would not solve the SIMD-issue, but the relative inefficiency and non-randomness would be addressed. If doublings are used to escape from fruitless cycles, they would not recur, as that would contradict the heuristics. Cycle reduction using doubling replaces f (p) and g(p) by f¯(p) and g¯(p), respectively, where ∼(p + f(p) ) if (p) = (∼(p + f(p) )), ¯ f (p) = ∼(2p) otherwise, g¯(p) =
q =∼(p + f(p) ) if (q) = (p) = (∼(q + f(q) )) = (q), ∼(2p) otherwise.
It follows from the heuristics that these functions avoid recurring fruitless cycles. Alternative cycle detection. Because shorter cycles are more frequent, a potentially interesting modification of the cycle detection method from [9] (described at the end of Section 2.3) would be to occasionally compare a point to its kth successor, where k is the least common multiple of all even short cycle lengths that one wants to catch. Detecting, for instance, cycles up to length 1 th comparison per step. This can be done in several steps, 12 requires only 120 recording every 12th point to catch 4- and 6-cycles, recording every 10th of these recorded points to catch 8- and 10-cycles, etc. It can be combined with the regular method with large α and β to catch longer cycles infrequently. However, if a cycle has been detected the k points need to be recorded as before, so an escape point can be chosen deterministically. This argues against
On the Use of the Negation Map in the Pollard Rho Method
79
using large k. It also suggests that an improvement can be expected only if cycles occur with low probability, and therefore that the improvement will be marginal at best (cf. α and β choices in Section 4). For this reason we did not conduct extensive experiments with this method.
4
Comparison
We implemented and compared on a traditional non-SIMD platform all previously published and newly proposed methods to deal with fruitless cycles when using the negation map. Here we report on our findings. It quickly turned out that the cycle detection methods from [9] when combined with doubling based cycle reduction and escape, are considerably more efficient than r+s-mixed walks with their on average slower steps and less random behavior. Mixed walks are therefore not further discussed. Experiments with the alternative cycle detection method were quickly abandoned as well. For each combination of iteration function, escape method, and r-value a search was conducted to determine the α and β to be used for the cycle detection method from [9]. Using a heuristic argument that for β = 2k with k much smaller than r, cycles of length ≥ β occur with probability on the order of (k−1)! , values (2r)k for k that make this probability low enough resulted in good initial values for the search for close to optimal α and β. To give some examples, for “f , e,” as explained in Table 3 we used α = 31 and β = 20 for r = 16, α = 3264 and β = 12 for r = 128, and α = 52 418 and β = 10 for r = 256. For “f¯, ¯e” and the same r-values we used the same β-values but replaced the α-values by 1 618, 838 848, and 53 687 081, respectively. Each of the benchmarks presented in Table 3 was run on a single core of an AMD Phenom 2.2GHz 4-core processor, with each of the four cores processing a different combination. A 10-bit distinguishing property was used to get a significant amount of data in a reasonable amount of time. This somewhat affects the performance, but not the cycle behavior as walks continue after hitting a distinguished point. The figures in millions as given in the table are thus an underestimate for the actual per-core yield in units when a more realistic 30-bit distinguishing property would be used (since 230 /210 = 220 ≈ 106 ). In order to be able to compare the long term yield figures, the expected number of steps must be taken into account using expressions 1 and 2. As a 1 2 result, the yields are corrected by a factor of ( r−1 r ) for the iteration functions 1 2 that do not use the negation map, and by a factor of ( 2r−1 r ) for the others, with 1 r an extra factor of ( r−1 ) 2 for g and g¯. After this correction, the best iteration function without the negation map is the one with r = 64. Comparing that one with each iteration function that uses the negation map, thus boosting the 63 12 63 12 or C = (( 2r−1 latter’s yield ratio by a factor of C = (( 2r−1 r )/( 64 )) r−1 )/( 64 )) for g and g¯, leads to the long term speedup figure given in Table 3. Note that the correction factor√C depends on the iteration function, and is close to and for some r larger than 2.
80
J.W. Bos, T. Kleinjung, and A.K. Lenstra
Table 3. For the (iteration function, escape method, r-value) combinations specified, the non-italics entries list the long term yield (millions of distinguished points, found during the second half hour) and the long term speedup over the best r-value (r = 64) without the negation map, taking into account the correction factor C as explained in the text. Cycle detection and subsequent escape by adding f(p)+4 , f , f(p) and by doubling is indicated by “e,” “e ,” “e ” and by “¯e,” respectively. The iteration functions f (2-cycle reduction), g (4-cycle and 2-cycle reduction), f¯ (2-cycle reduction using doubling), and g¯ (4-cycle and 2-cycle reduction using doubling) are as in sections 2.3, 3.1 and 3.3. The yields are for 256 parallel walks (sharing the inversion) for a 131-bit ECDLP with a 131-bit prime order group. The yields during the first half hour are almost consistently higher, considerably so for poorly performing combinations. They are not meaningful and are thus not listed. The italics entries are A above D, followed 9 −A) , as explained in the text. by the maximal achievable speedup factor of C(10 109 +D/6 †: This applies to “no reduction, no escape,” “just f ,” “just f¯,” “just e,” and “just e .” r = 16
r = 32
Without negation map 7.29: 0.98 7.28: 0.99 With negation map 0.00: 0.00 0.00: 0.00 † 0.00: 0.00 0.00: 0.00 just g 0.00: 0.00 0.00: 0.00 just g ¯ 0.00: 0.00 0.00: 0.00 just e 3.34: 0.64 4.89: 0.95 just ¯ e 0.00: 0.00 0.00: 0.00 f, e 9 .4e8 6 .6e8 0 .0e0 }0 .48 0 .0e0 }0 .08 0.00: 0.00 3.24: 0.63 f , e 8 .0e7 3 .9e8 0 .0e0 }0 .86 0 .0e0 }1 .30 0.00: 0.00 5.34: 1.04 f , e 6 .0e7 1 .3e8 0 .0e0 }1 .22 0 .0e0 }1 .33 3.71: 0.72 6.36: 1.24 f, ¯ e 9 .2e7 6 .8e7 9 .9e5 }1 .27 2 .8e5 }1 .32 0.00: 0.00 0.01: 0.00 g, e 8 .7e8 3 .7e8 0 .0e0 }0 .19 0 .0e0 }0 .91 0.00: 0.00 0.01: 0.00 g, e 7 .8e8 3 .0e8 0 .0e0 }1 .00 0 .0e0 }0 .32 0.00: 0.00 1.09: 0.21 g, e 7 .6e8 1 .2e8 0 .0e0 }1 .27 0 .0e0 }0 .34 0.76: 0.15 5.91: 1.17 g, ¯ e 1 .7e8 3 .3e8 1 .6e5 }0 .97 6 .0e4 }1 .19 0.00: 0.00 0.00: 0.00 f¯, e 8 .7e8 4 .3e8 2 .4e6 }0 .18 1 .7e7 }0 .80 0.01: 0.0 4.24: 0.82 f¯, e 6 .8e7 2 .6e8 4 .3e7 }1 .03 2 .9e7 }1 .31 1.34: 0.26 5.80: 1.13 f¯, e 8 .9e7 5 .3e7 5 .2e7 }1 .27 2 .9e7 }1 .33 5.58: 1.06 6.14: 1.18 f¯, ¯ e 6 .1e7 3 .7e7 4 .2e7 }1 .31 3 .0e7 }1 .36 2.56: 0.51 5.80: 1.15 g ¯, e 1 .4e8 7 .9e7 9 .9e7 }1 .23 5 .6e7 }1 .31 4.74: 0.94 5.88: 1.16 g ¯, e 7 .8e7 1 .2e8 1 .0e8 }1 .25 5 .6e7 }1 .31 4.72: 0.94 5.80: 1.15 g ¯, e 7 .7e7 1 .2e8 1 .0e8 }1 .25 5 .6e7 }1 .31 4.83: 0.96 5.87: 1.16 g ¯, ¯ e 7 .9e7 1 .2e8 1 .0e8 }1 .25 5 .6e7 }1 .31
r = 64
r = 128
r = 256
r = 512
7.27: 1.00
7.19: 0.99
6.97: 0.96
6.78: 0.94
0.00: 0.00 0.00: 0.00 0.00: 0.00 0.00: 0.00 5.85: 1.14 1.52: 0.30 1 .0e8 0 .0e0 }1 .28 6.04: 1.18 4 .6e7 0 .0e0 }1 .35 6.21: 1.21 4 .2e7 0 .0e0 }1 .36 6.50: 1.27 4 .2e7 6 .5e4 }1 .36 4.89: 0.96 6 .6e7 0 .0e0 }1 .34 5.32: 1.05 6 .0e7 0 .0e0 }1 .35 5.37: 1.13 6 .0e7 0 .0e0 }1 .35 6.02: 1.18 8 .1e7 8 .1e3 }1 .32 2.70: 0.53 5 .4e7 1 .5e7 }1 .34 6.32: 1.23 3 .9e7 1 .5e7 }1 .36 6.23: 1.22 3 .9e7 1 .5e7 }1 .36 6.34: 1.23 1 .8e7 1 .5e7 }1 .39 6.02: 1.18 5 .1e7 2 .9e7 }1 .35 6.14: 1.21 5 .3e7 2 .9e7 }1 .35 6.08: 1.20 5 .3e7 2 .9e7 }1 .35 6.09: 1.20 5 .2e7 2 .9e7 }1 .35
0.00: 0.00 0.00: 0.00 0.75: 0.15 0.61: 0.12 6.10: 1.19 5.93: 1.16 3 .6e7 0 .0e0 }1 .37 6.41: 1.25 3 .3e7 0 .0e0 }1 .38 6.30: 1.23 3 .3e7 0 .0e0 }1 .38 6.57: 1.29 3 .3e7 1 .5e4 }1 .38 6.22: 1.22 4 .2e7 0 .0e0 }1 .37 6.26: 1.23 4 .1e7 0 .0e0 }1 .37 6.08: 1.20 4 .2e7 0 .0e0 }1 .37 6.25: 1.23 5 .4e7 1 .0e3 }1 .35 5.96: 1.16 1 .1e7 7 .7e6 }1 .41 6.43: 1.26 3 .2e7 7 .6e6 }1 .38 6.21: 1.22 3 .6e7 7 .5e6 }1 .37 6.42: 1.25 1 .1e7 7 .7e6 }1 .41 6.09: 1.20 4 .1e7 1 .5e7 }1 .37 6.28: 1.23 3 .9e7 1 .5e7 }1 .37 6.05: 1.19 3 .8e7 1 .5e7 }1 .37 6.16: 1.21 4 .0e7 1 .5e7 }1 .37
0.00: 0.00 0.04: 0.01 4.90: 0.96 4.94: 0.97 6.28: 1.23 6.47: 1.27 2 .9e7 0 .0e0 }1 .38 6.29: 1.23 2 .9e7 0 .0e0 }1 .38 6.20: 1.21 2 .9e7 0 .0e0 }1 .38 6.47: 1.27 2 .9e7 3 .8e3 }1 .38 6.23: 1.22 3 .3e7 0 .0e0 }1 .38 6.25: 1.23 3 .0e7 0 .0e0 }1 .38 6.06: 1.19 3 .5e7 0 .0e0 }1 .38 6.13: 1.20 4 .0e7 1 .2e2 }1 .37 6.34: 1.24 1 .0e7 3 .9e6 }1 .41 6.33: 1.24 2 .8e7 3 .8e6 }1 .38 6.15: 1.20 2 .8e7 3 .8e6 }1 .38 6.27: 1.23 1 .0e7 3 .9e6 }1 .41 6.19: 1.21 2 .6e7 7 .6e6 }1 .39 6.05: 1.19 2 .6e7 7 .6e6 }1 .39 5.91: 1.16 1 .8e7 7 .6e6 }1 .40 6.09: 1.20 2 .6e7 7 .6e6 }1 .39
0.00: 0.00 3.59: 0.70 5.90: 1.16 5.73: 1.12 6.18: 1.21 6.36: 1.25 2 .5e7 0 .0e0 }1 .39 6.21: 1.22 2 .6e7 0 .0e0 }1 .39 5.99: 1.17 2 .7e7 0 .0e0 }1 .39 6.30: 1.25 2 .7e7 9 .7e2 }1 .39 6.05: 1.19 1 .3e7 0 .0e0 }1 .41 6.11: 1.20 5 .5e7 0 .0e0 }1 .35 5.86: 1.15 4 .3e7 0 .0e0 }1 .37 6.00: 1.18 2 .7e7 9 .0e0 }1 .39 6.20: 1.21 1 .4e7 1 .9e6 }1 .40 6.20: 1.22 2 .7e7 1 .9e6 }1 .39 6.00: 1.18 2 .6e7 1 .9e6 }1 .39 6.07: 1.19 1 .4e7 1 .9e6 }1 .40 5.74: 1.13 7 .7e6 3 .9e6 }1 .41 5.80: 1.14 7 .7e6 3 .9e6 }1 .41 5.67: 1.11 7 .7e6 3 .9e6 }1 .41 5.70: 1.12 7 .7e6 3 .9e6 }1 .41
On the Use of the Negation Map in the Pollard Rho Method
81
Non-doubling 2-cycle reduction (f ) with doubling-based cycle escape (¯e) and r = 128 performed best, with an overall speedup by a factor of 1.29: although fewer distinguished points are found than for the best case without the negation map (r = 64), there is a considerable overall gain because fewer distinguished points (by a factor of C, for the relevant C) should suffice. For r = 16 most iteration functions with the negation map perform poorly. √ We measured to what extent our failure to achieve a speedup by a factor of 2 can be blamed on cycle detection and escape and other overheads, and which part is due to the higher average cost of the iteration function. For most combinations in Table 3 we counted the number S of useful steps performed when doing 109 group operations, while keeping track of the number D of doublings among them. Here a step is useful if it is not taken as part of a fruitless cycle, so all D doublings are useful. Without the negation map, S would be 109 and D = 0; this is the basis for the comparison. With the negation map, A = 109 − S is counted as the number of additional additions due to cycle reductions or fruitless cycles. , so that it The inherent slowdown of that iteration function is then 1 + A+D/6 S 9
−A) CS can achieve a speedup by a factor of at most S+A+D/6 = C(10 109 +D/6 , with C as defined above. Based on Table 3 and Fig. 1, we√conclude that our failure to better approach the optimal speedup by a factor of 2 is due to an onset of cache effects combined with various overheads. The italics figures from Table 3 make us believe that improvements may be obtained when using better implementations.
Previous results. The only publication that we know that presents practical data about Pollard’s rho method used with the negation map is [8]. Only relatively small ECDLPs were solved (42- and 43-bit prime fields) and small r-values were avoided. The adverse cycle behavior that we witnessed can therefore not be expected and we doubt if the results reported are significant for the sizes that we consider. Only mixed walks were used, and an overall speedup by a factor of about 1.35 was reported. Cycle escaping was done by jumping to the sum of all points in a cycle, which cannot be expected to work in general because the sum may depend just on the addition constants.
5
Conclusion
With judicious application of doubling, usage of the negation map to solve ECDLPs over prime fields using Pollard’s rho method can indeed be recommended. In the best of circumstances that √ we have been able to create, however, the speedup falls short of the hoped for 2, but is with 1.29 still considerable. This conclusion does not apply to SIMD-environments where occasional doublings cause considerable delays. Alternative point representations need to be considered to assess the usefulness of the negation map for SIMD platforms, in particular because such platforms are becoming popular again. Acknowledgements. This work was supported by the Swiss National Science Foundation under grant numbers 200021-119776 and 206021-117409 and
82
J.W. Bos, T. Kleinjung, and A.K. Lenstra
by EPFL DIT. We gratefully acknowledge useful suggestions by Marcelo E. Kaihara and very insightful comments by the ANTS reviewers.
References 1. Avanzi, R.M., Cohen, H., Doche, C., Frey, G., Lange, T., Nguyen, K., Vercauteren, F.: Handbook of Elliptic and Hyperelliptic Curve Cryptography. Chapman & Hall/CRC (2006) 2. Bailey, D.V., et al.: Breaking ECC2K-130. In: Cryptology ePrint Archive, Report 2009/541 (2009), http://eprint.iacr.org/ 3. Bos, J.W., Kaihara, M.E., Montgomery, P.L.: Pollard rho on the PlayStation 3. In: Workshop record of SHARCS 2009, pp. 35–50 (2009), http://www.hyperelliptic.org/tanja/SHARCS/record2.pdf 4. Brent, R.P., Pollard, J.M.: Factorization of the eighth Fermat number. Math. Comp. 36(154), 627–630 (1981) 5. Certicom. Certicom ECC Challenge (1997), http://www.certicom.com/images/pdfs/cert_ecc_challenge.pdf 6. Certicom. Press release: Certicom announces elliptic curve cryptosystem (ECC) challenge winner (2002), http://www.certicom.com/index.php/2002-press-releases/ 38-2002-press-releases/340-notre-dame-mathematician-solveseccp-109-encryption-key-problem-issued-in-1997 7. Duursma, I.M., Gaudry, P., Morain, F.: Speeding up the discrete log computation on curves with automorphisms. In: Lam, K.-Y., Okamoto, E., Xing, C. (eds.) ASIACRYPT 1999. LNCS, vol. 1716, pp. 103–121. Springer, Heidelberg (1999) 8. Escott, A.E., Sager, J.C., Selkirk, A.P.L., Tsapakidis, D.: Attacking elliptic curve cryptosystems using the parallel Pollard rho method. CryptoBytes Technical Newsletter 4(2), 15–19 (1999), ftp.rsasecurity.com/pub/cryptobytes/crypto4n2.pdf 9. Gallant, R.P., Lambert, R.J., Vanstone, S.A.: Improving the parallelized Pollard lambda search on anomalous binary curves. Math. Comp. 69(232), 1699–1705 (2000) 10. Harley, R.: Elliptic curve discrete logarithms project, http://pauillac.inria.fr/~harley/ 11. Koblitz, N.: Elliptic curve cryptosystems. Math. Comp. 48, 203–209 (1987) 12. Koblitz, N.: CM-curves with good cryptographic properties. In: Feigenbaum, J. (ed.) CRYPTO 1991. LNCS, vol. 576, pp. 279–287. Springer, Heidelberg (1992) 13. Miller, V.S.: Use of elliptic curves in cryptography. In: Williams, H.C. (ed.) CRYPTO 1985. LNCS, vol. 218, pp. 417–426. Springer, Heidelberg (1986) 14. Montgomery, P.L.: Speeding the Pollard and elliptic curve methods of factorization. Math. Comp. 48, 243–264 (1987) 15. Pollard, J.M.: Monte Carlo methods for index computation (mod p). Math. Comp. 32, 918–924 (1978) 16. Teske, E.: On random walks for Pollard’s rho method. Math. Comp. 70(234), 809– 825 (2001) 17. van Oorschot, P.C., Wiener, M.J.: Parallel collision search with cryptanalytic applications. Journal of Cryptology 12(1), 1–28 (1999) 18. Wiener, M.J., Zuccherato, R.J.: Faster attacks on elliptic curve cryptosystems. In: Tavares, S., Meijer, H. (eds.) SAC 1998. LNCS, vol. 1556, pp. 190–200. Springer, Heidelberg (1999)
An O(M (n) log n) Algorithm for the Jacobi Symbol Richard P. Brent1 and Paul Zimmermann2 1 2
Australian National University, Canberra, Australia INRIA Nancy - Grand Est, Villers-l`es-Nancy, France
Abstract. The best known algorithm to compute the Jacobi symbol of two n-bit integers runs in time O(M (n) log n), using Sch¨ onhage’s fast continued fraction algorithm combined with an identity due to Gauss. We give a different O(M (n) log n) algorithm based on the binary recursive gcd algorithm of Stehl´e and Zimmermann. Our implementation — which to our knowledge is the first to run in time O(M (n) log n) — is faster than GMP’s quadratic implementation for inputs larger than about 10000 decimal digits.
1
Introduction
We want to compute the Jacobi symbol1 (b|a) for n-bit integers a and b, where a is odd positive. We give three algorithms based on the 2-adic gcd from Stehl´e and Zimmermann [13]. First we give an algorithm whose worst-case time bound is 3 ); we call this the cubic algorithm although this is pessimistic O(M (n)n2 ) = O(n since the algorithm is quadratic on average as shown in [5], and probably also in the worst case. We then show how to reduce the worst-case to O(M (n)n) = 2 ) by combining sequences of “ugly” iterations (defined in Section 1.1) into O(n one “harmless” iteration. Finally, we obtain an algorithm with worst-case time O(M (n) log n). This is, up to a constant factor, the same as the time bound for the best known algorithm, apparently never published in full, but sketched in Bach [1] and in more detail in Bach and Shallit [2] (with credit to Bachmann [3]). The latter algorithm makes use of the Knuth-Sch¨ onhage fast continued fraction algorithm [9] and an identity of Gauss [6]. Although this algorithm has been attributed to Sch¨ onhage, Sch¨ onhage himself gives a different O(M (n) log n) algorithm [10,15] which does not depend on the identity of Gauss. The algorithm is mentioned in Sch¨ onhage’s book [11, §7.2.3], but no details are given there. With our algorithm it is not necessary to compute the full continued fraction or to use the identity of Gauss for the Jacobi symbol. Thus, it provides an alternative that may be easier to implement. 1
Notation: we write the Jacobi symbol (b|a), since this is easier to typeset and as less ambiguous than the more usual ab . Also, M (n) is the time to multiply n-bit (n)) means O(f (n)(log f (n))c ) for some constant c ≥ 0. numbers, and O(f
G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 83–95, 2010. c Springer-Verlag Berlin Heidelberg 2010
84
R.P. Brent and P. Zimmermann
It is possible to modify some of the other fast GCD algorithms considered by M¨ oller [8] to compute the Jacobi symbol, but we do not consider such possibilities here. At best they give a small constant factor speedup over our algorithm. We recall the main identities satisfied by the Jacobi symbol: (bc|a) = (b|a)(c|a); 2 (2|a) = (−1)(a −1)/8 ; (b|a) = (−1)(a−1)(b−1)/4 (a|b) for a, b odd; and (b|a) = 0 if (a, b) = 1. Note that all our algorithms compute (b|a) with b even positive and a odd positive. For the more general case where b is any integer, we can reduce to b even and positive using (b|a) = (−1)(a−1)/2 (−b|a) if b is negative, and (b|a) = (b+a|a) if b is odd. We first describe a cubic algorithm to compute the Jacobi symbol. The quadratic algorithm in Section 2 is based on this cubic algorithm, and the subquadratic algorithm in Section 3 uses the same ideas as the quadratic algorithm but with an asymptotically fast recursive implementation. For a ∈ Z, the notation ν(a) denotes the 2-adic valuation ν2 (a) of a, that is the maximum k such that 2k |a, or +∞ if a = 0. 1.1
Binary Division with Positive Quotient
Throughout the paper we use the binary division with positive quotient defined by Algorithm 1.1. Compared to the “centered division” of [13], it returns a quotient in [1, 2j+1 − 1] instead of in [1 − 2j , 2j − 1]. Note that the quotient q is always odd. Algorithm 1.1. BinaryDividePos Input: a, b ∈ N with ν(a) = 0 < ν(b) = j Output: q and r = a + qb/2j such that 0 < q < 2j+1 , ν(b) < ν(r) q is odd and positive 1: q ← −a/(b/2j ) mod 2j+1 2: return q, r = a + qb/2j .
With this binary division, we define Algorithm CubicBinaryJacobi, where the fact that the quotient q is positive ensures that all a, b terms computed remain positive, and a remains odd, thus (b|a) remains well-defined.2 Theorem 1. Algorithm CubicBinaryJacobi is correct (assuming it terminates). Proof. We prove that the following invariant holds during the algorithm, if a0 , b0 are the initial values of a, b: (b0 |a0 ) = (−1)s (b|a). This is true before we enter the while-loop, since s = 0, a = a0 , and b = b0 . For each step in the while loop, we divide b by 2j , swap a and b = b/2j , replace a 2
M¨ oller says in [8]: “if one tries to use positive quotients 0 < q < 2k+1 , the [binary gcd] algorithm no longer terminates”. However, with a modified stopping criterion as in Algorithm CubicBinaryJacobi, the algorithm terminates (we prove this below).
An O(M (n) log n) Algorithm for the Jacobi Symbol
85
Algorithm 1.2. CubicBinaryJacobi Input: a, b ∈ N with ν(a) = 0 < ν(b) Output: Jacobi symbol (b|a) 1: s ← 0, j ← ν(b) 2: while 2j a = b do 3: b ← b/2j 4: (q, r) ← BinaryDividePos(a, b) 2 5: s ← (s + j(a2 − 1)/8 + (a − 1)(b − 1)/4 + j(b − 1)/8) mod 2 j 6: (a, b) ← (b , r/2 ), j ← ν(b) 7: if a = 1 then return (−1)s else return 0
by r = a + qb , and divide r by 2j . The Jacobi symbol is modified by a factor 2 (−1)j(a −1)/8 for the division of b by 2j , by a factor (−1)(a−1)(b −1)/4 for the 2 interchange of a and b , and by a factor (−1)j(b −1)/8 for the division of r by 2j . At the end of the loop, we have gcd(a0 , b0 ) = a; if a = 1, since (b|1) = 1, we have (b0 |a0 ) = (−1)s , otherwise (b0 |a0 ) = 0. Lemma 1. The quantity a + 2b is non-increasing in Algorithm CubicBinaryJacobi. Proof. At each iteration of the “while” loop, a becomes b/2j , and b becomes (a + qb/2j )/2j . In matrix notation a 0 1/2j a ← . (1) b 1/2j q/22j b Therefore a + 2b becomes a + qb/2j b 2a b +2 = j + (1 + 2q/2j ) j . j j 2 2 2 2
(2)
Since j ≥ 1, the first term is bounded by a. In the second term, q ≤ 2j+1 − 1, thus the second term is bounded by (5/2j − 2/22j )b, which is bounded by 9b/8 for j ≥ 2, and equals 2b for j = 1. If j ≥ 2, then a + 2b is multiplied by a factor at most 9/16. If j = q = 1 then a + 2b decreases, but by a factor which could be arbitrarily close to 1. The only case where a + 2b does not decrease is when j = 1 and q = 3; in this case a + 2b is unchanged. This motivates us to define three classes of iterations: good, bad, and ugly. Let us say that we have a good iteration when j ≥ 2, a bad iteration when j = q = 1, and an ugly iteration when j = 1 and q = 3. Since q is odd and 1 ≤ q ≤ 2j+1 − 1, this covers all possibilities. For a bad iteration, (a, b) becomes (b/2, a/2 + b/4), and for an ugly iteration, (a, b) becomes (b/2, a/2 + 3b/4). We denote the matrices corresponding to good, bad and ugly iterations by G, B and U respectively. Thus
86
R.P. Brent and P. Zimmermann
G = Gj,q =
0 1/2j 1/2j q/4j
, B=
0 1/2 1/2 1/4
, U=
0 1/2 1/2 3/4
.
The effect of m successive ugly iterations is easily seen to be given by the matrix 1 1 + 4(−1/4)m 2 − 2(−1/4)m m U = . (3) 5 2 − 2(−1/4)m 4 + (−1/4)m Assume we start from (a, b) = (a0 , b0 ), and after m > 0 successive ugly iterations we get values (am , bm ). Then, from Equation (3), 5am = (a + 2b) + 2(2a − b)(−1/4)m , m
5bm = 2(a + 2b) − (2a − b)(−1/4) .
(4) (5)
We can not have 2a0 = b0 or the algorithm would have terminated. However, am must be an integer. This gives an upper bound on m. For a0 , b0 of n bits, the number of successive ugly iterations is bounded by n/2 + O(1) (a precise statement is made in Lemma 2). If there were no bad iterations, this would prove that for n-bit inputs the number of iterations is O(n2 ), since each sequence of ugly iterations would be followed by at least one good iteration. Bad iterations can be handled by a more complicated argument which we omit, since they will be considered in detail in §2 when we discuss the complexity of the quadratic algorithm (see the proof of Theorem 2). Since the number of iterations is O(n2 ) from Theorem 2, and each iteration costs time O(M (n)), the overall time for Algorithm CubicBinaryJacobi is 3 ). Note that this worst-case bound is almost certainly too O(n2 M (n)) = O(n pessimistic (see §4).
2
A Provably Quadratic Algorithm
Suppose we have a sequence of m > 0 ugly iterations. It is possible to combine the m ugly iterations into one harmless iteration which is not much more expensive than a normal (good or bad) iteration. Also, it is possible to predict the maximal such m in advance. Using this trick, we reduce the number of iterations (good, 2 ). Without loss bad and harmless) to O(n) and their cost to O(M (n)n) = O(n of generality, suppose that we start from (a0 , b0 ) = (a, b). Lemma 2. If μ = ν(a−b/2), then we have exactly μ/2 ugly iterations starting from (a, b), followed by a good iteration if μ is even, and by a bad iteration if μ is odd. Proof. We prove the lemma by induction on μ. If μ = 0, a − b/2 is odd, but a is odd, so b/2 is even, which yields j ≥ 2 in BinaryDividePos, thus a, b yield a good iteration. If μ = 1, a − b/2 is even, which implies that b/2 is odd, thus we have j = 1. If we had q = 3 in BinaryDividePos, this would mean that
An O(M (n) log n) Algorithm for the Jacobi Symbol
87
a + 3(b/2) = 0 mod 4, or equivalently a − b/2 = 0 mod 4, which is incompatible with μ = 1. Thus we have q = 1, and a bad iteration. Now assume μ ≥ 2. The first iteration is ugly since 4 divides a − b/2, which implies that b/2 is odd. Thus j = 1, and a − b/2 = 0 mod 4 implies that q = 3. After one ugly iteration (a, b) becomes (b/2, a/2 + 3b/4), thus a − b/2 becomes −(a − b/2)/4, and the 2-valuation of a − b/2 decreases by 2. From the above, we see that, for a sequence of m ugly iterations, a0 , a1 , . . . , am satisfy the three-term recurrence 4ai+1 − 3ai − ai−1 = 0 for 0 < i < m, and similarly for b0 , b1 , . . . , bm . It follows that ai = a mod 4, and similarly bi = b mod 4, for 1 ≤ i < m. We can modify Algorithm CubicBinaryJacobi to consolidate m consecutive ugly iterations into one harmless iteration, using the expressions (4)–(5) for am and bm (we give an optimised evaluation below). It remains to modify step 5 of CubicBinaryJacobi to take account of the m updates to s. Since j = 1 for each ugly iteration, we have to increment s by an amount 2 a2i − 1 bi − 1 ai − 1 bi − 1 + + mod 2, δ= 8 8 2 2 0≤i<m
where we write bi for bi /2. However, ai+1 = bi for 0 ≤ i < m, so the terms involving division by 8 “collapse” mod 2, leaving just the first and last terms. The terms involving two divisions by 2 are all equal to (a − 1)/2 · (b − 1)/2 mod 2, using the observation that ai mod 4 is constant for 0 ≤ i < m. Thus 2 a0 − 1 a2m − 1 a0 − 1 a1 − 1 + +m δ= mod 2. 8 8 2 2 One further simplification is possible. Since a0 = a1 mod 4, and a0 is odd, we can replace a1 by a0 in the last term, and use the fact that x2 = x mod 2 to obtain 2 a0 − 1 a2m − 1 a0 − 1 + +m δ= mod 2. (6) 8 8 2 We can economise the computation of am and bm from (4)–(5) by first computing d = a − b , m = ν(d) div 2, c = (d − (−1)m (d/4m ))/5, where the divisions by 4m and by 5 are exact; then am = a − 4c, bm = b + 2c. From these observations, it is easy to modify Algorithm CubicBinaryJacobi to obtain Algorithm QuadraticBinaryJacobi. In this algorithm, steps 7–11 implement a harmless iteration equivalent to m > 0 consecutive ugly iterations; steps 13–14 implement bad and good iterations, and the remaining steps are common to both. Step 5 of Algorithm CubicBinaryJacobi is split into three steps 4, 13 and 15. In the case of a harmless iteration, the computation of δ satisfying (6) is implicit in steps 4, 10 and 15.
88
R.P. Brent and P. Zimmermann
Algorithm 2.1. QuadraticBinaryJacobi Input: a, b ∈ N with ν(a) = 0 < ν(b) Output: Jacobi symbol (b|a) 1: s ← 0, j ← ν(b) 2: while 2j a = b do 3: b ← b/2j 4: s ← (s + j(a2 − 1)/8) mod 2 5: (q, r) ← BinaryDividePos(a, b) 6: if (j, q) = (1, 3) then 7: d ← a − b 8: m ← ν(d) div 2 9: c ← (d − (−1)m d/4m )/5 10: s ← (s + m(a − 1)/2) mod 2 11: (a, b) ← (a − 4c, b + 2c) 12: else 13: s ← (s + (a − 1)(b − 1)/4) mod 2 14: (a, b) ← (b , r/2j ) 15: s ← (s + j(a2 − 1)/8) mod 2, j ← ν(b) 16: if a = 1 then return (−1)s else return 0
harmless iteration
good or bad iteration
Theorem 2. Algorithm QuadraticBinaryJacobi is correct and terminates after O(n) iterations of the “while” loop (steps 2–15) if the inputs are positive integers of at most n bits, with 0 = ν(a) < ν(b). Proof. Correctness follows from the equivalence to Algorithm CubicBinaryJacobi. To prove that convergence takes O(n) iterations, we show that a + 2b is multiplied by a factor at most 5/8 in each block of three iterations. This is true if the block includes at least one good iteration, so we need only consider harmless and bad iterations. Two harmless iterations do not occur in succession, so the block must include either (harmless, bad) or (bad, bad). In the first case, the corresponding matrix is BU m = BU · U m−1 for some m > 0. We saw in §1.1 that the matrix U leaves a + 2b unchanged, so U m−1 also leaves a + 2b unchanged, and we need only consider the effect of BU . Suppose that (a, b) is transformed into ( a, b) by BU . Thus a a 1/4 3/8 a . b = BU b = 1/8 7/16 b We see that a + 2b =
5 a 5b + ≤ (a + 2b). 2 4 8
The case of two successive bad iterations is similar – just replace BU by B 2 in the above, and deduce that a + 2b ≤ (a + 2b)/2. We conclude that the number of iterations of the while loop is at most cn + O(1), where c = 3/ log2 (8/5) ≈ 4.4243.
An O(M (n) log n) Algorithm for the Jacobi Symbol
89
Remarks 1. A more complicated argument along similar lines can reduce the constant c to √ 2/ log2 (1/ρ(BU )) = 2/ log2 ((11 − 57)/2) ≈ 2.5424. Here ρ denotes the spectral radius: ρ(A) = limk→∞ ||Ak ||1/k . 2. In practice QuadraticBinaryJacobi is not much (if any) faster than CubicBinaryJacobi. Its advantage is simply the better worst-case time bound. A heuristic argument suggests that on average only 1/4 of the iterations of CubicBinaryJacobi are ugly. 3. Our implementations of CubicBinaryJacobi and QuadraticBinaryJacobi are slower than GMP’s O(n2 ) algorithm (which is based on Stein’s binary gcd, as in Shallit and Sorenson [12]). However, in the next section we use the ideas of our QuadraticBinaryJacobi algorithm to get an O(M (n) log n) algorithm. We do not see how to modify the algorithm of Shallit and Sorenson to do this.3
3
An O(M (n) log n) Algorithm
Algorithm HalfBinaryJacobi below is a modification of Algorithm Half-GB-gcd from [13]. (Algorithm Half-GB-gcd is a subquadratic right-to-left gcd algorithm; for more on the general structure of subquadratic gcd algorithms, we refer the reader to M¨ oller [8].) The main differences between Half-GB-gcd and our algorithm are the following: 1. binary division with positive (not centered) quotient is used; 2. the algorithm returns an integer s such that if a, b are the inputs, c, d the output values defined by Theorem 3, then (b|a) = (−1)s (d|c); 3. at steps 4 and 27, we reduce mod 22k1 +2 (resp. 22k2 +2 ) instead of mod 22k1 +1 (resp. 22k2 +1 ), so that we have enough information to correctly update s0 at steps 10, 17, 21 and 25; 4. we have to “cut” some harmless iterations in two (step 15). Remarks. The matrix Q occurring at step 19 is just 22m U m , where U m is given by Equation (3). Similarly, the matrix Q occurring at step 23 is 22j0 Gj0 ,q . In practice, steps 13–20 can be omitted (so the algorithm becomes a fast version of CubicBinaryJacobi) – this variant is simpler and slightly faster on average. We now state our main theorem. Its proof is based on comparing the GB sequence of a, b and that of a1 , b1 , where a1 = a mod 22k1 +2 and b1 = b mod 22k1 +2 . The GB — which stands for Generalized Binary division, see [13] — sequence of a, b is the sequence of remainders we obtain by applying the binary division iteratively. Two GB sequences match if they produce the same binary quotients qi . 3
In Algorithm Binary Jacobi of [12], it is necessary to know the sign of a − n (b − a in our notation) to decide whether to perform an interchange. This makes it difficult to construct an recursive O(M (n) log n) algorithm along the lines of Algorithm HalfBinaryJacobi.
90
R.P. Brent and P. Zimmermann
Algorithm 3.1. HalfBinaryJacobi Input: a ∈ N, b ∈ N ∪ {0} with 0 = ν(a) < ν(b), and k ∈ N Output: two integers s, j and a 2 × 2 matrix R 1: if ν(b) > k then 10 2: Return 0, 0, 01 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28:
b = 0 is possible
k1 ← k/2 a1 ← a mod 22k1 +2 , b1 ← b mod 22k1 +2 s1 , j1 , R ← HalfBinaryJacobi(a1 , b1 , k1 ) a ← 2−2j1 (R1,1 a + R1,2 b), b ← 2−2j1 (R2,1 a + R2,2 b) j0 ← ν(b ) if j0 + j1 > k then Return s1 , j1 , R 2 s0 ← j0 (a − 1)/8 mod 2 q, r ← BinaryDividePos(a , b ) b ← b /2j0 if (j0 , q) = (1, 3) then d ← a − b m ← min(ν(d) div 2, k − j1 ) c ← (d − (−1)m d/4m )/5 s0 ← s0 + m(a − 1)/2 mod 2 harmless iteration (a2 , b2) ← (a − 4c, 2(b + c)) (4m + 4(−1)m )/5 2(4m − (−1)m )/5 Q← 2(4m − (−1)m )/5 (4m+1 + (−1)m )/5 else s0 ← s0 + (a − 1)(b − 1)/4 mod 2 r/2j0 ) good or bad iteration (a2 , b2) ← (b , j0 0 2 Q← 2j0 q m ← j0 s0 ← s0 + j0 (a22 − 1)/8 mod 2 k2 ← k − (m + j1 ) s2 , j2 , S ← HalfBinaryJacobi(a2 mod 22k2 +2 , b2 mod 22k2 +2 , k2 ) Return (s0 + s1 + s2 ) mod 2, j1 + j2 + m, S × Q × R
An O(M (n) log n) Algorithm for the Jacobi Symbol
91
Theorem 3. Let a, b, k be the inputs of Algorithm HalfBinaryJacobi, and s, j, R the corresponding outputs. If dc = 2−2j R ab , then: (b|a) = (−1)s (d|c)
and
ν(2j c) ≤ k < ν(2j d).
Proof (outline). We prove the theorem by induction on the parameter k. The key ingredient is that if we reduce a, b mod 22k1 +1 in step 4, then the GB sequence of a1 , b1 matches that of a, b, for the terms computed by the recursive call at step 5. This is a consequence of [13, Lemma 7] (which also holds for binary division with positive quotient). It follows that in all the binary divisions with inputs ai , bi in that recursive call, ai and bi /2ji match modulo 2ji +1 the corresponding values that would be obtained from the full inputs a, b (otherwise the corresponding binary quotient qi would be wrong). Since here we reduce a, b mod 22k1 +2 instead of mod 22k1 +1 , ai and bi /2ji now match modulo 2ji +2 — instead of modulo 2ji +1 — the values that would be obtained from the full inputs a, b, where 2ji +2 ≥ 8 since ji ≥ 1. At step 10, s0 depends only on j0 mod 2 and a mod 8, at step 17 it depends on m mod 2 and a mod 4, and at step 21 on a mod 4 and b mod 4. Since a and b at step 21 correspond to some ai and bi /2ji , it follows that a and b agree mod 8 with the values that would be computed from the full inputs, and thus the correction s0 is correct. This proves by induction that (b|a) = (−1)s (d|c). Now we prove that ν(2j c) ≤ k < ν(2j d). If there is no harmless iteration, it is a consequence of the proof of Theorem 1 in [13]. In case there is a harmless iteration, first assume that m = ν(d) div 2 at step 15. The new values a2 , b2 at step 18 correspond to m successive ugly iterations, which yield j = j1 + m ≤ k. Thus ν(2j a2 ) ≤ k: we did not go too far, and since we are computing the same sequence of quotients as Algorithm QuadraticBinaryJacobi, the result follows. Now if k − j1 < ν(d) div 2, we would go too far if we performed ν(d) div 2 ugly iterations, since it would give j0 := ν(d) div 2 > k −j1 , thus j := j1 +j0 > k, and ν(2j a2 ) would exceed k. This is the reason why we “cut” the harmless iteration at m = k − j1 (step 15). The other invariants are unchanged. Finally we can present our O(M (n) log n) Algorithm FastBinaryJacobi, which computes the Jacobi symbol by calling Algorithm HalfBinaryJacobi. The general structure is similar to that described in [8] for several asymptotically fast GCD algorithms. Daireaux, Maume-Deschamps and Vall´ee [5] prove that, for the positive binary division, the average increase of the most significant bits is 0.65 bits/iteration (which partly cancels an average decrease of two least significant bits per iteration); compare this with only 0.05 bits/iteration on average for the centered division.4
4
We have computed more accurate values of these constants: 0.651993 and 0.048857 respectively.
92
R.P. Brent and P. Zimmermann
Algorithm 3.2. FastBinaryJacobi Input: a, b ∈ N with 0 = ν(a) < ν(b) Output: Jacobi symbol (b|a) 1: s ← 0, j ← ν(b) 2: while 2j a = b do 3: k ← max(ν(b), (b) div 3) 4: s , j, R ← HalfBinaryJacobi(a, b, k) 5: s ← (s + s ) mod 2 6: (a, b) ← 2−2j (R1,1 a + R1,2 b, R2,1 a + R2,2 b), 7: if a = 1 then return (−1)s else return 0
4
(b) is length of b in bits
j ← ν(b)
Experimental Results
We have implemented the different algorithms in C (using 64-bit integers) and in GMP (using multiple-precision integers), as well as in Maple/Magma (for testing purposes). For max(a, b) < 226 the maximum number of iterations of Algorithm CubicBinaryJacobi is 64, with a = 15548029 and b = 66067306. The number of iterations seems to be O(n) for a, b < 2n : see Table 1. This is plausible because, from heuristic probabilistic arguments, we expect about half of the iterations to be good, and experiments confirm this. For example, if we consider all admissible a, b < 220 , the cumulated number of iterations is 3.585×1012 for 238 calls, i.e., an average of 13.04 iterations per call (max 48); the cumulated number of good, bad and ugly iterations is 51.78%, 25.47%, and 22.75% respectively. For a, b < 260 , a random sample of 108 pairs (a, b) gave 42.72 iterations per call (max 89), with 50.54%, 25.14%, and 24.31% for good, bad and ugly respectively. These ratios seem to be converging to the heuristically expected 1/2 = 50%, 1/4 = 25%, and 1/4 = 25%. When we consider all admissible a, b < 220 , the maximum number of iterations of QuadraticBinaryJacobi is 37 when a = 933531, b = 869894, the cumulated number of iterations is 3.405 × 1012 (12.39 per call), the cumulated number of good, bad and harmless iterations is 54.51%, 26.82%, and 18.67% respectively. For a, b < 260 , a random sample of 108 pairs (a, b) gave 40.21 iterations per call (max 76), with 53.70%, 26.71%, and 19.59% for good, bad and harmless respectively. These ratios seem to be converging to the heuristically expected 8/15 = 53.33%, 4/15 = 26.67%, and 1/5 = 20%. We have also compared the time and average number of iterations for huge numbers, using the fast gcd algorithm in GMP, say gcd — which implements the algorithm from [8] — and an implementation of the algorithm from [13], say bgcd. For inputs of one million 64-bit words, gcd takes about 45.8s on a 2.83Ghz Core 2, while bgcd takes about 48.3s and 32,800,000 iterations: this is in accordance with the fact proven in [5] that each step of the binary gcd discards on average two least significant bits, and adds on average about 0.05 most significant bits. Our algorithm bjacobi (based on Algorithms 3.1–3.2) takes about 83.1s
An O(M (n) log n) Algorithm for the Jacobi Symbol
93
1e+06 mpz_jacobi FastBinaryJacobi 100000 10000 1000 100 10 1 0.1 0.01 0.001 0.0001 1
10
100
1000
10000
100000
Fig. 1. Comparison of GMP 4.3.1 mpz jacobi routine with our FastBinaryJacobi implementation in log-log scale. The x-axis is in 64-bit words, the y-axis in milliseconds on a 2.83Ghz Core 2. Table 1. Worst cases for CubicBinaryJacobi(b|a), max(a, b) < 2n n iterations example (a, b) 5 6 (7, 30) 10 19 (549, 802) 15 34 (23449, 19250) 20 48 (656227, 352966) 21 51 (1596811, 1493782)
n iterations example (a, b) 22 53 (2214985, 2781506) 23 55 (1383497, 8292658) 24 58 (2236963, 12862534) 25 62 (28662247, 30847950) 26 64 (15548029, 66067306)
and 47,500,000 iterations (for a version with steps 13–20 of Algorithm 3.1 omitted in the basecase routine), which agrees with the theoretical drift of 0.651993 bits per iteration. The break-even point between the O(n2 ) implementation of the Jacobi symbol in GMP 4.3.1 and our O(M (n) log n) implementation is about 535 words, that is about 34, 240 bits or about 10, 300 decimal digits (see Fig. 1).
5
Concluding Remarks
Weilert [15] says: “We are not able to use a GCD calculation in Z[i] similar to the binary GCD algorithm · · · because we do not get a corresponding quotient
94
R.P. Brent and P. Zimmermann
sequence in an obvious manner ”. In a sense we filled that gap for the computation of the Jacobi symbol, because we showed how it can be computed using a binary GCD algorithm without the need for a quotient sequence. We showed how to compute the Jacobi symbol with an asymptotically fast time bound, using such a binary GCD algorithm. Our implementation is faster than a good O(n2 ) implementation for numbers with bitsize n > 35000. Our subquadratic implementation is available from http://www.loria.fr/~zimmerma/ software/#jacobi. Binary division with a centered quotient does not seem to give a subquadratic algorithm; however we can use it with the “cubic” algorithm (which then becomes provably quadratic) since then we control the sign of a, b. For a better quadratic algorithm, we can choose the quotient q so that abq < 0, by replacing q by q − 2j+1 if necessary: experimentally, this gains on average 2.194231 bits per iteration, compared to 1.951143 for the centered quotient, and 1.348008 for the positive quotient. In comparison, Stein’s “binary” algorithm gains on average 1.416488 bits per iteration [4, §7][7, §4.5.2]. Acknowledgement. We thank Steven Galbraith who asked us about the existence of an O(M (n) log n) algorithm for the Jacobi symbol, Arnold Sch¨ onhage for his comments and a pointer to the work of his former student Andr´e Weilert, Damien Stehl´e who suggested adapting the binary gcd algorithm, and Marco Bodrato and Niels M¨oller for testing our implementation. We also thank the two anonymous reviewers, especially the one who actually implemented our new algorithm in Magma! We thank INRIA for its support of the ANC “´equipe associ´ee”. The first author acknowledges the support of the Australian Research Council.
References 1. Bach, E.: A note on square roots in finite fields. IEEE Trans. on Information Theory 36(6), 1494–1498 (1990) 2. Bach, E., Shallit, J.O.: Algorithmic Number Theory: Efficient Algorithms, vol. 1. MIT Press, Cambridge (1996) (Solution to problem 5.52) 3. Bachmann, P.: Niedere Zahlentheorie, Teubner, Leipzig, vol. 1 (1902); Reprinted by Chelsea, New York (1968) 4. Brent, R.P.: Twenty years’ analysis of the binary Euclidean algorithm. In: Davies, J., Roscoe, A.W., Woodcock, J. (eds.) Millennial Perspectives in Computer Science: Proceedings of the 1999 Oxford - Microsoft Symposium in honour of Professor Sir Antony Hoare, Palgrave, New York, pp. 41–53 (2000), http://wwwmaths.anu.edu.au/~brent/pub/pub183.html 5. Daireaux, B., Maume-Deschamps, V., Vall´ee, B.: The Lyapunov tortoise and the dyadic hare. In: Proceedings of the 2005 International Conference on Analysis of Algorithms, DMTCS Proc. AD, pp. 71–94 (2005), http://www.dmtcs.org/dmtcs-ojs/index.php/proceedings/issue/view/81 6. Gauss, C.F.: Theorematis fundamentalis in doctrina de residuis quadraticis, demonstrationes et ampliatones novæ. Comm. Soc. Reg. Sci. Gottingensis Rec. 4 (presented February 10, 1817) (1818); Reprinted in Carl Friedrich Gauss Werke, Bd. 2: H¨ ohere Arithmetik, G¨ ottingen, pp. 47–64 (1876)
An O(M (n) log n) Algorithm for the Jacobi Symbol
95
7. Knuth, D.E.: The Art of Computer Programming. In: Seminumerical Algorithms, 3rd edn., vol. 2, Addison-Wesley, Reading (1997) 8. M¨ oller, N.: On Sch¨ onhage’s algorithm and subquadratic integer GCD computation. Mathematics of Computation 77(261), 589–607 (2008) 9. Sch¨ onhage, A.: Schnelle Berechnung von Kettenbruchentwicklungen. Acta Informatica 1, 139–144 (1971) 10. Sch¨ onhage, A.: Personal communication by email (December 2009) 11. Sch¨ onhage, A., Grotefeld, A.F.W., Vetter, E.: Fast Algorithms: A Multitape Turing Machine Implementation. BI-Wissenschaftsverlag, Mannheim (1994) 12. Shallit, J., Sorenson, J.: A binary algorithm for the Jacobi symbol. ACM SIGSAM Bulletin 27(1), 4–11 (1993), http://euclid.butler.edu/~sorenson/papers/binjac.ps 13. Stehl´e, D., Zimmermann, P.: A binary recursive gcd algorithm. In: Buell, D.A. (ed.) ANTS 2004. LNCS, vol. 3076, pp. 411–425. Springer, Heidelberg (2004) 14. Vall´ee, B.: A unifying framework for the analysis of a class of Euclidean algorithms. In: Gonnet, G.H., Viola, A. (eds.) LATIN 2000. LNCS, vol. 1776, pp. 343–354. Springer, Heidelberg (2000) 15. Weilert, A.: Fast Computation of the Biquadratic Residue Symbol. Journal of Number Theory 96, 133–151 (2002)
New Families of ECM Curves for Cunningham Numbers ´ Eric Brier1 and Christophe Clavier2,3
2
1 Ingenico S.A. 1, rue Claude Chappe, B.P. 346, 07530 Guilherand-Granges, France
[email protected] Institut d’Ing´enierie Informatique de Limoges (3iL) 43, rue Sainte Anne F-87000 Limoges
[email protected] 3 Universit´e de Limoges – XLIM D´epartement de Math´ematiques et Informatique 83, rue d’Isle F-87000 Limoges
[email protected]
Abstract. In this paper we study structures related to torsion of elliptic curves defined over number fields. The aim is to build families of elliptic curves more efficient to help factoring numbers of special form, including numbers from the Cunningham Project. We exhibit a family of curves with rational Z/4Z × Z/4Z torsion and positive rank over the field Q(ζ8 ) and a family of elliptic curves with rational Z/6Z × Z/3Z torsion and positive rank over the field Q(ζ3 ). These families have been used in finding new prime factors for the numbers 2972 + 1 and 21048 + 1. Along the way, we classify and give a parameterization of modular curves for some torsion subgroups.
1
Introduction
The Elliptic Curve Method (ECM in short) is a factoring algorithm, whose complexity depends on the size of the smallest prime factor instead of the size of the number to be factored. It can be seen as a variation of the p − 1 method. The idea is to build an elliptic curve over the ring Z/N Z with a point P on it and to compute the scalar multiplication M · P . Since N is not a prime, the elliptic curve is not defined over a field. However, computations are done as if we were working on a field and if something fails, this means that a non-trivial factor of N has been found. The number M is chosen to be the product of powers of small primes and thus, a prime factor p is found as soon as the order of the elliptic curve reduced modulo p is smooth. G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 96–109, 2010. c Springer-Verlag Berlin Heidelberg 2010
New Families of ECM Curves for Cunningham Numbers
97
Many improvements of the ECM are described in the literature. We will focus on an improvement consisting in choosing the elliptic curve as the reduction modulo N of an elliptic curve defined over the field Q with a non-trivial torsion group and positive rank. The torsion group of an elliptic curve is the group of elements of finite order and the rank is the number of generators of the torsionfree part of the group. As soon as small prime factors have been removed from N , the torsion group is preserved in most cases by the modulo N reduction of the curve, which helps to make the order of the curve smooth. The positive rank is needed to set the starting point P of the algorithm. Possible torsion groups for elliptic curves defined over Q are in finite number, with maximal order 16. For each possible torsion group, at least a family of elliptic curves with positive rank has been found. The idea we follow in this paper is to use a number field K for which reduction modulo N can be made explicit and to build over K an elliptic curve with positive rank and a torsion subgroup as large as possible. Let us give an example : if the number to be factored is of the form N = u2 + 1, we can make use of the field K = Q(i) with mapping i → u. The numbers of the Cunningham Project (i.e. numbers of the form am ±1) allow to use m-th roots of unity. It will be interesting to focus on cyclotomic fields or on their subfields. It is important to note that all quadratic extensions of Q lie in cyclotomic fields. The paper is organized as follows. Section 2 introduces the necessary notions about modular curves and classifies torsion subgroups that can be of any interest for ECM integer factoring. Section 3 is devoted to construction of parameterized elliptic curves with given torsion subgroup over some cyclotomic extensions of the field of rationals. Section 4 focuses on the search for infinite subfamilies of elliptic curves having nonzero rank, which is mandatory to ECM usage. Section 5 rephrases previous sections results in the context of ECM and gives some instances of new prime factors of Cunningham Project numbers discovered thanks to the work presented here. Finally, section 6 concludes and suggests some research areas to go further.
2
Elliptic Curve Torsion and Modular Curves
An elliptic curve E defined over a number field K turns out to be a commutative group. The Mordell-Weil theorem states that this group is finitely generated and can be written as: E(K) ∼ = T ⊗ Zr where the integer r is called rank and T is the so called torsion group, which consists in elements of finite order. Furthermore, T is isomorphic to Z/m1 Z × Z/m2 Z with the constraints that m2 divides m1 and the m2 -th roots of unity all lie in the field K. Whereas it is conjectured that the rank is not constrained, the torsion group can take only finitely many different shapes over the field of rationals:
98
´ Brier and C. Clavier E.
Theorem 1 (Mazur). The torsion group T of an elliptic curve defined over the field Q is isomorphic to one of the following groups: Z/mZ with 1 ≤ m ≤ 10 or m = 12 Z/2mZ × Z/2Z with 1 ≤ m ≤ 4 This theorem is effective in the sense that for each of these cases, it is possible to give equations of elliptic curves. These parameterizations come from modular curves. Over the field C of complex numbers, there is a one-to-one correspondance between isomorphism classes of elliptic curves and the Riemann Surface X(1), which is the quotient H∗ /SL2 (Z), where H∗ is the compactified Poincar´e halfplane. For any subgroup Γ of SL2 (Z), the quotient surface H∗ /Γ is called a modular curve. Extending notations of [3], we define the following subgroups of SL2 (Z): a b Γ (m) = ∈ SL2 (Z), a ≡ d ≡ 1 mod m, b ≡ c ≡ 0 mod m c d Γ1 (m) = Γ0 (m) =
a b c d a b c d
∈ SL2 (Z), a ≡ d ≡ 1 mod m, c ≡ 0 mod m
∈ SL2 (Z), c ≡ 0 mod m
and the quotients: X(m) = H∗ /Γ (m) X1 (m) = H∗ /Γ1 (m) X0 (m) = H∗ /Γ0 (m) X1 (m1 , m2 ) = H∗ /(Γ1 (m1 ) ∩ Γ (m2 )) when m2 |m1 A point on the surface X(m) corresponds to an elliptic curve together with a basis for its [m]-torsion subgroup, up to isomorphism. A point on the surface X1 (m) corresponds, up to isomorphism, to an elliptic curve together with a [m]torsion point. A point on the surface X0 (m) corresponds, up to isomorphism, to an elliptic curve together with a cyclic torsion subgroup of order m. A point on the surface X(m1 , m2 ) corresponds to an elliptic curve with a [m1 ]-torsion point and an independent [m2 ]-torsion point. Though these notions make use of complex number and analytical tools, the modular curves can also be represented as algebraic curves. An algebraic model of X1 (m) can be found over Q and the correspondance with an elliptic curve and a [m]-torsion point on it is algebraic and defined over Q. The curve X(m) involves the full [m]-torsion subgroup and, due to existence of Weil pairing, m-th roots of unity are involved. The rational models and correspondance for X(m) (resp. X1 (m1 , m2 )) are defined over the cyclotomic field Q(ζm ) (resp. Q(ζm2 )). The modular curves associated to torsion
New Families of ECM Curves for Cunningham Numbers
99
subgroups in Mazur’s theorem are genus 0 algebraic curves. This explains why it is possible to give parametric Weierstrass equations. The Elliptic Curve Method needs a non-bounded number of elliptic curves to compute with. Since algebraic curves of genus greater than 2 have only finitely many rational points over a given number field, we will focus only on torsion structures for which the associated modular curve has genus 0 or 1. Computing the genus of an algebraic curve is not an easy task in the general case but the task is easy with a computer for modular curves of rather small level. A theorem from Shimura states that the genus of the modular curve X1 (p) for a prime p ≥ 5 is given by : g=
(p − 5)(p − 7) . 24
This implies that the only primes for which the genus of X1 (p) is 0 or 1 are {2, 3, 5, 7, 11}. When n|m, there is a surjective mapping X1 (m) → X1 (n), and thus the genus of X1 (m) is at least the genus of X1 (n). Computing the genus of X1 (m) for rather small values of m being easy, we can increase the power of these primes until the genus is strictly greater than 1 and we get that the only prime powers for which the genus of X1 (pe ) is 0 or 1 are {2, 4, 8, 3, 9, 5, 7, 11}. Now, combining this finite set, it is possible to check the following proposition with a finite amount of work: Proposition 1. The integers m such that X1 (m) is of genus 0 or 1 are {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15} When m2 |m1 , there is a surjective mapping X1 (m1 , m2 ) → X1 (m1 ), and thus the genus of X1 (m1 , m2 ) is at least the genus of X1 (m1 ). This implies that if the genus of the modular curve X1 (m1 , m2 ) is 0 or 1, the number m1 is in the list given in proposition 1. Building on this, for any m1 in this list, we can check if the genus of X1 (m1 , m2 ) is 0 or 1 for all divisors m2 of m1 . The result is given in next proposition. Proposition 2. The torsion groups for which the associated modular curve is of genus 0 are: Z/2Z, Z/3Z, Z/4Z, Z/5Z, Z/6Z, Z/7Z Z/8Z, Z/9Z Z/10Z Z/12Z
Z/2Z × Z/2Z Z/3Z × Z/3Z Z/4Z × Z/2Z, Z/5Z × Z/5Z Z/6Z × Z/2Z, Z/8Z × Z/2Z
Z/4Z × Z/4Z Z/6Z × Z/3Z
100
´ Brier and C. Clavier E.
The torsion groups for which the associated modular curve is of genus 1 are: Z/6Z × Z/6Z Z/8Z × Z/4Z Z/9Z × Z/3Z Z/10Z × Z/2Z Z/11Z Z/12Z × Z/2Z Z/14Z Z/15Z
3
Parameterization of Elliptic Curves with Given Torsion Structure
When the base field is Q, several papers (e.g. [8] and [4]) describe the construction of elliptic curves with prescribed torsion groups. We will study cases that need to work over extensions. 3.1
Construction of Z/3Z × Z/3Z
To study torsion points, one can use the division polynomials, whose roots are the abscises of torsion points. Since we wish all 3-torsion points to be rational, we start by imposing two rational roots x1 and x2 to the polynomial ϕ3 (x) = 3x4 + 6ax2 + 12bx − a2 The system ϕ3 (x1 ) = ϕ3 (x2 ) = 0 considered as equations in the variables a and b has roots if and only if −3x1 x2 is a square. A convenient parameterization is x1 = 6ξ x2 = −2ρ2 ξ and the corresponding parameters are a = −12ξ 2 ρ(ρ2 − 3ρ + 3) b = 2ξ 3 (ρ2 − 3)(ρ4 − 6ρ3 + 18ρ2 − 18ρ + 9) At this stage, we introduce two linear factors in ϕ3 . The remaining quadratic factor of ϕ3 has discriminant equal to −3(ρ − 1)2 (ρ − 3)2 . We need −3 to be a square, which is natural since the Weil pairing introduces cubic roots of unity. We thus have x-coordinates of point of order 3 rational. We now turn on to y-coordinates. Substitutions of x1 and x2 in x3 + ax + b yield y12 = 2ξ 3 (ρ − 3)2 (ρ2 + 3)2 and y12 = −6ξ 3 (ρ − 1)2 (ρ2 + 3)2 . To obtain squares, we set ξ = 2λ2 and for convenience ρ = 1 − τ . In conclusion, an elliptic curve in short Weierstrass form has rational 3-torsion over Q(ζ3 ) if and only if its parameters can be written as: a = 48λ4 (τ 3 − 1) b = 16λ6 (τ 6 − 20τ 3 − 8)
New Families of ECM Curves for Cunningham Numbers
3.2
101
Construction of Z/6Z × Z/3Z
Given as an input the results of previous section, we now have to ensure that x3 + ax + b has a linear factor to get a point of order 2. In a first step, we set x = ξλ2 to get rid of the homogeneity parameter λ. We consider then x3 + ax + b as a equation in ξ and τ 3 , which is quadratic relatively to the unknown τ 3 . The discriminant of this quadratic equation is −(ξ − 12)3 . It is natural to set ξ = 12 − ν 2 . We now have: x3 + ax + b = λ6 (6ν 2 + ν 3 − 4τ 3 − 32)(6ν 2 − ν 3 − 4τ 3 − 32) Both factors differ only in a sign change for ν. We will keep the first factor, which is a cubic in ν and τ . Since the underlying modular curve has genus 0, this curve must have a singularity. We easily find that the point (ν = −4, τ = 0) is singular and to reduce the degree of the curve, we set ν = μτ − 4. After replacement and factorization, we have a degree one equation in τ . To keep consistency in notations and to avoid denominators, we rename μ as 1/τ and modify the scaling factor λ. In conclusion, an elliptic curve in short Weierstrass form has rational 3-torsion and a point of order 2 over Q(ζ3 ) if and only if its parameters can be written as: a = −3λ4 (τ 12 − 8τ 9 + 240τ 6 − 464τ 3 + 16) b = −2λ6 (τ 18 − 12τ 15 − 480τ 12 + 3080τ 9 − 12072τ 6 + 4128τ 3 + 64) 3.3
Modular Curve for Z/6Z × Z/6Z
We know that the modular curve X(6) has genus 1. In this section, we will give a very simple model for this elliptic curve. Let us start with the equation for Z/6Z× Z/3Z torsion subgroup. The polynomial x3 + ax + b has by construction a linear and a quadratic factor. The discriminant of the quadratic factor is −9(8τ 3 − 1)3 . From this we derive the following model: X(6) : s2 = t3 + 1 3.4
Modular Curve for Z/9Z × Z/3Z
We start from parameterization of curves with full 3-torsion. One can note that the parameter is involved only to the third power, we thus note σ = τ 3 and will work in a first stage only with σ. We introduce the polynomial χ9 whose roots are the sums of x-coordinates of points in cyclic subgroups of order 9 and whose degree is 12: χ9 (z) = z 12 + 792az 10 + 47520bz 9 + ... − 3543478272a6 We can de-homogenize this polynomial by setting λ = 1 and, since a and b are polynomials in σ, we get a polynomial equation in z and σ having a quadratic factor in σ. This factor has a root iff z − 48 is six times a square. We set
102
´ Brier and C. Clavier E.
z = 6ζ 2 + 48 and get σ = (ζ 3 + 6ζ 2 + 12ζ + 72)/8. We can now factor the division polynomial ϕ9 (x) and obtain an equation of degree 3 in x and 6 in ζ. The solution x = 12 and ζ = −2 being a singularity, we set x = 12 + ξ(ζ + 2)2 and obtain the relation ζ = −2
ξ 3 + 3ξ 2 − 6ξ + 1 ξ 3 − 3ξ 2 + 1
We are guaranteed that a point of order 9 has rational x-coordinate, its happens that the y-coordinate is also rational. It is now time to remember that σ must be a cube. Elliptic curve with torsion group of type Z/9Z × Z/3Z have same parameters as for Z/3Z × Z/3Z, provided that τ3 =
8(ξ 2 − ξ + 1)3 (ξ 3 − 6ξ 2 + 3ξ + 1) (ξ 3 − 3ξ 2 + 1)3
Some algebraic manipulations turn the equation σ 3 = ξ 3 − 6ξ 2 + 3ξ + 1 into the elliptic model: X1 (9, 3) : s2 = t3 + 16 3.5
Construction of Z/4Z × Z/4Z
In short Weierstrass form, points of order 2 are points whose y-coordinate is 0. It follows that the general form of curve with Z/2Z torsion is: y 2 = (x − u)(x2 + ux + v) For the same reasons the general form of curve with Z/2Z × Z/2Z torsion is: y 2 = (x − u)(x − v)(x + u + v) On this elliptic curve, a point P = (x, y) can be written P = 2Q iff the numbers x − u, x − v and x + u + v are squares, see [2, Theorem 4.2 page 85]. Thus, if we require that all 4-torsion are rational, all 2-torsion points must be doubles and we ask for 0, ±(u − v), ±(2u + v) and ±(u + 2v) being squares. One can note that −1 has to be a square, which is not a surprise: if 4-torsion is rational, the Weil pairing will produce fourth roots of unity, i.e. square roots of −1. We first impose 2u + v and 2v + u to be squares. To do so, we invert the system: u = (2r2 − s2 )/3 2u + v = r2 ⇐⇒ 2 v = (2s2 − r2 )/3 u + 2v = s Then, it remains to ensure that u − v is also a square. The factorization of u − v is (r − s)(r + s). It is convenient to write r = μ + ν and s = μ − ν. We get u − v = 4μν, which must be a square. We can set μ = τ 2 ν. Last, to get rid of denominators, we set ν = 3λ. In conclusion, an elliptic curve in short Weierstrass form has rational 4-torsion over Q(ζ4 ) if and only if its parameters can be written as: a = −27λ4 (τ 8 + 14τ 4 + 1) b = 54λ6 (τ 12 − 33τ 8 − 33τ 4 + 1)
New Families of ECM Curves for Cunningham Numbers
3.6
103
Modular Curve for Z/8Z × Z/4Z
To obtain a point of order 8, one of the points of order 4 must be expressed as the doubling of a rational point. We take for instance one of the points with x = 3τ 4 − 15. Differences with x-coordinates of 2-torsion points must be squares, these differences factor as: −18 (τ 2 + 1) 18 (τ 2 − 1) 9 (τ 4 − 1) We can easily impose the second expression to be a square by setting τ = (κ2 + 2)/(κ2 − 2) Then, the two other expressions are squares iff κ4 + 4 is a square. In the equation σ 2 = κ4 + 4, we apply the change of variables σ = s2 /t2 − 2t and κ = −s/t and get the model: X1 (8, 4) : s2 = t3 − t 3.7
Construction of Z/5Z × Z/5Z
To reach full rational 5-torsion, we begin with two rational cyclic subgroups of order 5. Let χ5 denote the polynomial, whose roots are the sums of x-coordinates of points over the 6 cyclic subgroups of order 5: χ5 (z) = z 6 + 20az 4 + 160bz 3 − 80a2 z 2 − 128abz − 80b2 We note z1 and z2 two roots of χ5 and to take benefit of symmetry use the transformation z1 = u + v and z2 = u − v. We consider the system χ5 (z1 ) = χ5 (z2 ) = 0 as equations in a and b and eliminate the unknown a, obtaining a quartic in b with parameters u and v. It is then convenient to set b = (u2 − v 2 )β to reduce degrees in u and v. This quartic presents a strong singularity when v = 0 and β = u/4, which leads us to set β = (u/4 + γv/8). The result is still a quartic in γ but the degree in v fell down to 2 and the discriminant of this quadratic equation in v is a square iff 9 − 5γ 2 is five times a square. We use conic parameterization techniques to obtain: γ=
6(μ2 + μ − 1) 5(μ2 + 1)
Now v can be expressed as the product of u and a rational function of μ. We unroll substitutions to get the value of b and come back to equations χ5 (z1 ) = χ5 (z2 ) = 0. They have a common linear factor in a and we now have values for a and b. Knowing that χ5 has two rational roots, we can strengthen our wishes and factor the division polynomial ϕ5 . No surprise that we get two quadratic factors, whose discriminants are squares if and only if μ2 + 1 and 5(μ2 + 1) are squares.
104
´ Brier and C. Clavier E.
We remember that we are working over the field of fifth roots of unity, in which 5 is a square. We just have to set μ=
2τ τ2 − 1
Now that x-coordinates for 5-torsion points are rational, we choose the value of homogeneity parameter u to have y-coordinates rationals u = −6λ2 (τ 2 + 1)(τ 4 − 2τ 3 − 6τ 2 + 2τ + 1)(2τ 4 + τ 3 + 3τ 2 − τ + 2) In conclusion, an elliptic curve in short Weierstrass form has full rational 5-torsion over Q(ζ5 ) if and only if its parameters can be written as: a = −27λ4 (τ 20 + 228τ 15 + 494τ 10 − 228τ 5 + 1) b = 54λ6 (τ 30 − 522τ 25 − 10005τ 20 − 10005τ 10 + 522τ 5 + 1)
4 4.1
Construction of Elliptic Curve with Large Prescribed Torsion and Positive Rank Description of the Method
For an elliptic curve being useful for the Elliptic Curve Method, its rank has to be non-zero. This means that we still have to produce sub-families of curves with an extra rational point. When the modular curve is of genus 1, we did not find any method because we are lacking of freedom on the parameters. This section is devoted to the method we use to produce sub-families with positive rank in the case of a parameterization by P1 (K). In this case, the parameters a and b are, up to the scaling factor λ, polynomials in K(τ ) and we can take x to be also a polynomial x = λ2 ξ(τ ). Then x3 + ax + b becomes itself λ6 times a polynomial. The polynomial ξ being fixed, we can look for values of τ , which turns x3 + ax + b into a square. This approach is equivalent to looking for rational points on hyperelliptic curves of rather high genus and will yield only finitely many curves. Our method consists in choosing the polynomial ξ in such a way that x3 + ax + b contains as much as possible of square factors. We note a = λ4 α(τ ), b = λ6 β(τ ) and σ(τ ) = ξ(τ )3 + α(τ )ξ(τ ) + β(τ ). For readability, we will omit the parameter τ for polynomial and all derivatives will be taken relatively to τ . We wish to have square factors, i.e. relations of type σ ≡ 0 mod (τ − τ0 )2 . In most cases, this relation imposes to define ξ modulo (τ − τ0 )2 . Since increasing the degree of ξ will in the end increase the degree of σ, we try to obtain this relation with a constraint only on ξ modulo (τ − τ0 ). Let us compute derivatives: σ = (3ξ 2 + α)ξ + (ξα + β ) To avoid constraints modulo (τ − τ0 )2 , we must keep freedom on ξ , which leads to 3ξ 2 + α = 0. Combining this relation with ξ 3 + αξ + β, we get the criterion
New Families of ECM Curves for Cunningham Numbers
105
Δ = 4α3 + 27β 2 = 0 and the value for ξ = −3β/2α. Now, we have to check that ξα + β = 0. Under the previous conditions, this is equivalent to Δ = 0. The values τ0 that will be of interest will thus be multiple roots of the discriminant Δ. To have a maximum number of degrees of freedom, for each of these roots we try to impose conditions on ξ modulo (τ − τ0 )e and check whether we get σ ≡ 0 mod (τ − τ0 )2e . The last step is to combine multiple roots using the Chinese Remainder Theorem in K[τ ]. For each possible τ0 , we fix ξ modulo some power (τ − τ0 )e , the exponent e being less than the maximum ”useful” exponent. We obtain candidates for ξ and for each candidate we factor σ. Since we wish to have σ being a square, we write σ = σ12 σ0 with σ0 square-free. If ξ does not correspond to torsion points and if the degree of σ0 is less than 5, we can parameterize by a curve of genus 0 or 1. If the auxiliary curve is of genus one (i.e. an elliptic curve) and if we can exhibit a point, we build an infinite family of elliptic curves with given torsion and rank at least one. 4.2
Results for Z/4Z × Z/4Z
Taking the values for a and b given in section 3.5, we first factor the discriminant Δ = −24 312 τ 4 (τ − 1)4 (τ + 1)4 (τ 2 + 1)4 The values of interest for τ are {0, 1, −1, ι, −ι}. We then check that each of them can be used up to the second power. The number of candidates we can generate for ξ is 35 . To simplify exploration of all these candidates, we compute once for all a polynomial Ξ that satisfies all modular conditions Ξ = 9τ 8 − 24τ 4 + 3 take its remainder modulo the polynomial τ e0 (τ − 1)e1 (τ + 1)e−1 (τ − ι)eι (τ − ι)e−ι We get values σ0 of degree 0 that are of no interest since they correspond to torsion points. We get no values of degree 1, 16 different values of degree 2, 32 of degree 3 and 62 of degree 4. The simplest value of σ0 is 36 (τ 2 − 3), which corresponds to ξ = 9τ 6 − 15τ 4 − 9τ 2 + 3. To turn σ0 into a square, one can set τ=
ν2 + 3 and λ = 8ν 3 2ν
Unrolling substitutions, we have ⎧ a = −432ν 4 (ν 16 + 24ν 14 + 476ν 12 + 4200ν 10 + 18022ν 8 ⎪ ⎪ ⎪ ⎪ +37800ν 6 + 38556ν 4 + 17496ν 2 + 6561) ⎪ ⎪ ⎨ b = 3456ν 6 (ν 24 + 36ν 22 + 66ν 20 − 6732ν 18 − 101409ν 16 − 707256ν 14 ⎪ ⎪ ⎪ ⎪ −2772260ν 12 − 6365304ν 10 − 8214129ν 8 − 4907628ν 6 ⎪ ⎪ ⎩ +433026ν 4 + 2125764ν 2 + 531441)
´ Brier and C. Clavier E.
106
The point of infinite order is given by ⎧ ⎨ x = 3 (3ν 12 + 34ν 10 + 117ν 8 + 316ν 6 + 1053ν 4 + 2754ν 2 + 2187) ⎩
y = 27 (ν 2 − 3)(ν 2 + 1)(ν 2 + 9)(ν 6 + 5ν 4 + 15ν 2 + 27)2
The choice of parameters giving such a torsion group when −1 is a square has also been studied to speed-up factorisation in [9]. 4.3
Results for Z/6Z × Z/3Z
Following the same steps, we start from formulae given in section 3.2 and factor the discriminant: Δ = −28 36 τ 3 (τ 3 + 1)6 (τ 3 − 8)3 The values of interest for τ0 are {−1, −ζ3, −ζ32 , 0, 2, 2ζ3 , 2ζ32 }. Only the first 3 values can be used up to the second power, the four last ones being of interest only to the first power. The solution for all modular constraints is Ξ = 2τ 9 − 9τ 6 − 42τ 3 − 4 The 432 possible candidates for ξ yield 32 cases where σ0 is of degree 4. Among them, one of the simplest corresponds to σ0 = −3τ (5τ 3 + 32) with ξ = −13τ 6 − 44τ 3 − 4. The elliptic curve ρ2 = −3τ (5τ 3 + 32) has nonzero rank over Q, a point of infinite order being (−1, 9). The points of this auxiliary elliptic curve parameterize an infinite family of elliptic curve having nonzero rank over Q and a torsion group containing Z/6Z × Z/3Z over Q(ζ3 ) 4.4
Results for Z/5Z × Z/5Z
Once again, we start by factoring: Δ = −28 312 τ 5 (τ 10 − 11τ 5 − 1)5 The eleven values of interest for τ0 can all be used up to the second power and the polynomial compatible with all constraints is Ξ=−
1 (252τ 20 − 5508τ 15 + 29019τ 10 + 7686τ 5 + 75) 25
Unfortunately, the 311 possible candidates for ξ all give σ0 polynomials of degree five or more, except for those corresponding to 5-torsion points. We also noticed that α is of degree 20 and β of degree 30. If we restrict ourselves to polynomials of degree 10 for ξ, the degree of σ will not exceed 30. In the case the leading coefficient of ξ is −3, the degree of σ falls down to 28. One can see this as using the value τ0 = ∞. This is compatible with 10 modular constraints and we also tried the 24068 candidates built this way, with no success. Remark: To speed up computations and avoid to compute in a quartic extension of Q, we instead performed this computations in the field F32621 , which contains fifth roots of unity. For sure, if a solution had been found, we would have needed to perform actual computations in Q(ζ5 ).
New Families of ECM Curves for Cunningham Numbers
4.5
107
Half Way to Z/8Z × Z/4Z
As the modular curve X1 (8, 4) is of genus one, we lack freedom on curve parameters to ensure in addition a non zero rank. We will try to cover a part of the path from X1 (4, 4) to X1 (8, 4). We elaborate on the results of section 4.2 and will use the same parameterization, with a dedicated choice of values for the parameter ν. As in section 3.5, we use the characterization of points P that can be written P = [2]Q with Q a point with rational coordinates. Among the twelve points of order 4, there is one that needs the quantities ν(ν 2 + 3) and (ν 2 + 1)(ν 2 + 9) to be squares. Would both be squares, we would get a point of order 8. We limit ourselves to the first condition only. At this stage, it is quite natural to consider the elliptic curve μ2 = ν(ν 2 + 3). The rank of this auxiliary curve over the field Q is one and an infinite subgroup is generated by the point P0 = (1, 2). Each of the points [k]P0 with k ∈ N yields a value of ν to be plugged into the formulæ of section 4.2. We thus get a infinite family of elliptic curves with nonzero rank, Z/4Z×Z/4Z torsion over Q(ζ4 ), and better chances to get Z/8Z × Z/4Z torsion over the same number field.
5
Application to Factoring
One can see an ECM implementation as a black box taking as inputs: A number N to be factored Elliptic curve paramaters a and b Coordinates of a point P on the curve modulo N and computing the scalar multiplication M · P on this curve for a smooth large integer M, expecting the result being at infinity for some prime factor of N . In most implementations, projective coordinates are used and if M · P is at infinity modulo a prime factor, this factor can be retrieved by a simple GCD between the number to be factored and the third coordinate. For full explanations on implementations and improvements of ECM, see [10], [1] and [7]. For the torsion groups Z/4Z×Z/4Z and Z/6Z×Z/3Z, we found curves having parameters and a point of infinite order defined over Q. These curves can be used for any number to be factored N . However, the benefit of torsion is attained only when one knowns that suitable roots of unity exist in the finite fields defined by prime factors of N . For order 16 torsion groups, numbers of the form a4n −b4n or a2n + b2n satisfy these conditions. The torsion group of order 18 can be used on numbers of the form a3n ± b3n . The suggested extension towards torsion group of order 32 can be used for numbers of the form a8n − b8n or a4n + b4n . To implement results of section 4.2, the parameter ν can be chosen at random or iteratively on integers. To implement results of section 4.3, things are slightly
108
´ Brier and C. Clavier E.
less simple, since an auxiliary elliptic curve has to be used. In this case one has to select an integer k randomly or in sequence, compute a scalar multiplication on the auxiliary elliptic curve to get the inputs of ECM. We adapted our ECM implementation in order to use these new families of elliptic curves. Making use of results on Z/4Z × Z/4Z torsion we found several factors of Cunningham numbers. Among them, one can mention the larger one: 5546025484206613872527377154544456740766039233|21048 + 1 We won’t give here full details of the factorization since they do not correspond to notations of these paper, this factor having been found in an early stage of development of this paper. We also implemented the variant with Z/6Z×Z/3Z torsion. Among the factors we found, the larger to mention is 1581214773543289355763694808184205062516817|2972 + 1 This factor has been discovered using the input parameters: ⎧ a = 29826081614523423723477944537088124780779 ⎪ ⎪ ⎨ b = 129980809632665349776106077981744185363149 ⎪ x = 479946793455925131408573042432160264988537 ⎪ ⎩ y = 341223966666174229961942234304018968605682
mod p mod p mod p mod p
The order of the curve modulo p factors as: #E(Fp ) = 2 × 32 × 29 × 241 × 691 × 5279 × 20353 × 252589 × 1489097 × 2258261 × 199312079
6
Conclusion
We exhibited two torsion groups, that can be used for ECM factoring, of orders 16 and 18. Classical implementations make use of the torsion group Z/8Z×Z/2Z that can be used for all numbers but of slightly smaller order. It would be really interesting to have a precise analysis of complexity improvements obtained by using torsion groups, as well as partial construction of torsion structure as in section 4.5. In the case of torsion group of order 25, we did not succeed in constructing elliptic curves having nonzero rank. This by no way means that no such curves exist. Solving this issue would result in specific implementations for numbers of the form a5n ± 1 with the larger available torsion group. Some torsion groups correspond to a modular curve of genus one. The obstruction in using them for ECM is the lack of freedom to build curve with nonzero rank: to build a curve with this torsion, one only have to select a multiple of a generator on this modular curve. Several approaches could improve the situation: being able to construct a large number of curves with nonzero rank
New Families of ECM Curves for Cunningham Numbers
109
by using rank computation software or being able to construct a point on the curve modulo N after the curve has been generated. Last, while infinite families of curves are needed for ECM factoring of integers, individual curves providing large torsion groups over some number fields could be used during the sieving phase of the special number field sieve (see [5] and [6]). Though further research is needed to hunt for interesting individual curves, we quote one preliminary result: the choice of ν = 1 in section 4.2 ensures a torsion subgroup of order 32 over the fields Q(ζ24 ) and Q(ζ40 ) and of order 64 over the field Q(ζ120 ).
References 1. Cohen, H.: A Course in Computational Algebraic Number Theory. Graduate Texts in Mathematics, vol. 138. Springer, Heidelberg (1991) 2. Knapp, A.W.: Elliptic Curves. Princeton University Press, Princeton (1992) 3. Koblitz, N.: Introduction to Elliptic Curves and Modular Forms. Graduate Texts in Mathematics, vol. 97. Springer, Heidelberg (1993) 4. Kubert, D.S.: Universal bounds on the torsion of elliptic curves. In: Proceedings of the London Mathematical Society, pp. 193–237 (1976) 5. Lenstra, A.K., Lenstra, H.W.: The Development of the Number Field Sieve. LNM, vol. 1554. Springer, Heidelberg (1993) 6. Lenstra, A.K., Lenstra, H.W., Manasse, M.S., Pollard, J.M.: The Factorization of the Ninth Fermat Number. In: Mathematics of Computation, vol. 61. American Mathematical Society, Providence (1993) 7. Lenstra, H.W.: Factoring integers with elliptic curves. Annals of Mathematics 126, 649–673 (1987) 8. Mazur, B.: Rational isogenies of prime degree. Invent. Math., 129–162 (1978) 9. Montgomery, P.L.: Speeding the pollard and elliptic curve methods of factorization. Mathematics of Computation 48, 243–264 (1987) 10. Zimmermann, P., Dodson, B.: Twenty Years of ECM. In: Hess, F., Pauli, S., Pohst, M. (eds.) ANTS 2006. LNCS, vol. 4076, pp. 525–542. Springer, Heidelberg (2006)
Visualizing Elements of Sha[3] in Genus 2 Jacobians Nils Bruin and Sander R. Dahmen Department of Mathematics, Simon Fraser University, Burnaby, BC, Canada
[email protected],
[email protected]
Abstract. Mazur proved that any element ξ of order three in the Shafarevich-Tate group of an elliptic curve E over a number field k can be made visible in an abelian surface A in the sense that ξ lies in the kernel of the natural homomorphism between the cohomology groups H 1 (Gal(k/k), E) → H 1 (Gal(k/k), A). However, the abelian surface in Mazur’s construction is almost never a jacobian of a genus 2 curve. In this paper we show that any element of order three in the ShafarevichTate group of an elliptic curve over a number field can be visualized in the jacobians of a genus 2 curve. Moreover, we describe how to get explicit models of the genus 2 curves involved.
1
Introduction
Let E be an elliptic curve over a field k with separable closure k. We write H 1 (k, E[3]) := H 1 (Gal(k/k), E[3](k)) for the first galois cohomology group taking values in the 3-torsion of E (the notation H i (k, A) is used similarly for other group schemes A/k later in this paper). We are primarily concerned with the question which δ ∈ H 1 (k, E[3]) are visible in the jacobian of a genus 2 curve. Mazur defines visibility in the following way. Let 0 → E → A → B → 0 be a short exact sequence of abelian varieties over k. By taking galois cohomology, we obtain the exact sequence A(k)
/ B(k)
/ H 1 (k, E)
φ
/ H 1 (k, A) .
(1.1)
Elements of the kernel of φ are said to be visible in A. Mazur chose this term because a model of the principal homogeneous space corresponding to an element ξ ∈ H 1 (k, E) that is visible in A can be obtained as a fiber of A over a point in B(k) (this can readily be seen from (1.1)). By extension, we say that δ ∈ H 1 (k, E[n]) is visible in A if the image of δ under the natural homomorphism H 1 (k, E[n]) → H 1 (k, E) is visible in A. Let us restrict to the case that k is a number field for the rest of this section. Inspired by some surprising experimental data [4], Mazur [5] proved, that for any element ξ in the Shafarevich-Tate group X(E/k) of order three, there exists an abelian variety A over k such that ξ is visible in A. The abelian variety that
Research of both authors supported by NSERC.
G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 110–125, 2010. c Springer-Verlag Berlin Heidelberg 2010
Visualizing Elements of Sha[3] in Genus 2 Jacobians
111
Mazur constructs is almost never principally polarizable over k and hence is almost never a jacobian of a genus 2 curve. In the present paper, we show that any element from X(E/k)[3] is in fact visible in the jacobian of a genus 2 curve. Moreover, we describe how to get an explicit model of such a genus 2 curve.
2
Torsors and Theta Groups
Throughout this section let n > 1 be an integer, let k be a perfect field of characteristic not dividing n and let E denote an elliptic curve over k. In [2], many equivalent interpretations are given for the group H 1 (k, E[n]). For our purposes, we need two classes of objects. The first is most closely related with descent in general and our question in particular. We consider E-torsors under E[n](k) and, following [2], call them n-coverings. Definition 1. An n-covering π : C → E of an elliptic curve E is an unramified covering over k that is galois and irreducible over k, with Autk (C/E) E[n](k). Two n-coverings π1 : C1 → E, π2 : C2 → E are called isomorphic if there exists a k-morphism φ : C1 → C2 such that π1 = π2 ◦ φ. Over k, all n-coverings are isomorphic to the trivial n-covering, the multiplicationby-n map [n] : E → E. Proposition 1 ([2, Proposition 1.14]). The k-isomorphism classes of n-coverings of E are classified by H 1 (k, E[n]). For δ ∈ H 1 (k, E[n]) we denote by Cδ the curve in the covering Cδ → E corresponding to δ. We remark that δ ∈ H 1 (k, E[n]) has trivial image in H 1 (k, E) if and only if Cδ has a k-rational point. We write O for the identity on E. The complete linear system |n·O| determines a morphism E → Pn−1 , where the translation action of E[n] extends to a linear action on Pn−1 . This gives a projective representation E[n] → PGLn . The lift of this representation to GLn gives rise to a group ΘE , which fits in the following diagram. 1
/ Gm
1
/ Gm
αE
/ ΘE / GLn
βE
/ E[n]
/1
/ PGLn
/1
(2.1)
The group E[n](k) carries additional structure. It also has the Weil pairing eE , which is a non-degenerate alternating galois covariant pairing taking values in the n-th roots of unity eE : E[n](k) × E[n](k) → μn (k). The commutator of ΘE corresponds to the Weil pairing, meaning that for x, y ∈ ΘE we have xyx−1 y −1 = αE (eE (βE (x), βE (y))).
112
N. Bruin and S.R. Dahmen
Definition 2. A theta group for E[n] is a central extension of group schemes β
α
1 → Gm → Θ → E[n] → 1 such that the Weil-pairing on E[n] corresponds to the commutator, i.e. for x, y ∈ Θ we have xyx−1 y −1 = α(eE (β(x), β(y))). Two theta groups 1 → Gm → Θi → E[n] → 1,
i = 1, 2
are called isomorphic if there exists a group scheme isomorphism φ : Θ1 → Θ2 over k making the following diagram commutative. 1
/ Gm
/ Θ1
/ Gm
/ Θ2
/ E[n]
/1
/ E[n]
/1
φ
1
Over k, all theta-groups are isomorphic to ΘE as central extensions; see [2, Lemma 1.30]. Proposition 2. ([2, Proposition 1.31]). Let E[n] be the n-torsion subscheme of an elliptic curve E over a field k, equipped with its Weil pairing. The isomorphism classes of theta-groups for E[n] over k are classified by H 1 (k, E[n]). The theta group associated to δ ∈ H 1 (k, E[n]) may allow for a matrix representation Θ → GLn that fits in a diagram like (2.1). This is measured by the obstruction map Ob introduced in [6] and [2]. This map can be obtained by taking non-abelian galois cohomology of the defining sequence of ΘE : Ob
· · · −→ H 1 (k, ΘE ) −→ H 1 (k, E[n]) −→ H 2 (k, Gm ) = Br(k) −→ · · · . Note that, except in some trivial cases, Ob is not a group homomorphism. The map Ob also has an interpretation in terms of n-coverings. Let C → E be an n-covering associated to δ ∈ H 1 (k, E[n]). We have that Ob(δ) = 0 if and only if C admits a model C → Pn−1 with Autk (C/E) = E[n](k) acting linearly, in which case C is k-isomorphic to E as a curve and the covering C → E is simply a translation composed with multiplication-by-n. Remark 1. Note that if k is a number field, then any element in Br(k) that restricts to the trivial element in Br(kv ) in all completions kv of k, is trivial itself. It follows that Ob is trivial on the n-Selmer group S (n) (E/k).
Visualizing Elements of Sha[3] in Genus 2 Jacobians
3
113
Visibility in Surfaces
Let E1 be an elliptic curve over a perfect field k of characteristic distinct from 3. In what follows, we will consider δ ∈ H 1 (k, E1 [3]) with Ob(δ) = 0. A possible way of constructing an abelian surface A such that δ is visible in A starts by taking a suitable elliptic curve E2 /k together with a k-group scheme isomorphism λ : E1 [3] → E2 [3]. Let Δ ⊂ E1 × E2 be the graph of λ so that Δ(k) = {(P, λ(P )) : P ∈ E1 [3](k)}. Let A := (E1 × E2 )/Δ and write φ : E1 × E2 → A for the corresponding isogeny. Since Δ ⊂ E1 [3] × E2 [3], we have another isogeny φ : A → E1 × E2 such that φ
φ ◦ φ = 3. We write p∗ for the composition E1 → (E1 × E2 ) → A and p∗ for the φ
composition A → (E1 × E2 ) → E1 and q ∗ , q∗ for the corresponding morphisms concerning E2 . It is straightforward to verify that p∗ , q ∗ are embeddings, that φ = p∗ − q ∗ (where the projections are understood), and that φ = p∗ × q∗ . We combine the galois cohomology of the short exact sequences p∗
q∗
q∗
p∗
0 → E1 → A → E2 → 0, 0 → E2 → A → E1 → 0, and 3
0 → Ei [3] → Ei → Ei → 0 for i = 1, 2 to obtain the big (symmetric) commutative diagram with exact rows and columns E2 (k) 3
E2 (k) α
E1 (k)
3
/ E1 (k)
/ H 1 (k, Δ)
p∗
/ E1 (k)
/ H 1 (k, E2 )
p∗
A(k)
q∗
/ A(k) q∗
E2 (k) / H 1 (k, E1 ) / H 1 (k, A)
where we note that H 1 (k, Δ) H 1 (k, E1 [3]) H 1 (k, E2 [3]). We see that δ is visible in A precisely if δ ∈ H 1 (k, E1 [3]) = H 1 (k, Δ) lies in the image of α, i.e., if the curve Cλ(δ) corresponding to λ(δ) ∈ H 1 (k, E2 [3]) has a rational point. We summarize these observations, which are due to Mazur. Lemma 1. Let E1 be an elliptic curve over a perfect field k of characteristic distinct from 3 and let δ ∈ H 1 (k, E[3]) with Ob(δ) = 0. Suppose that there exists an elliptic curve E2 /k and a k-group scheme isomorphism λ : E1 [3] → E2 [3] such that the curve Cλ(δ) corresponding to λ(δ) has a k-rational point. Then δ is visible in the abelian surface (E1 × E2 )/Δ where Δ denotes the graph of λ.
114
N. Bruin and S.R. Dahmen
Mazur also observed, in the case of a number field k, that if δ ∈ S (3) (E/k), then Cδ admits a plane cubic model. Furthermore, there is a pencil of cubics through the 9 flexes of Cδ , and each non-singular member corresponds to a 3-covering Ct → Et , where Et [3] E[3] and Ct → Et represents δ. It is therefore easy to find a t such that Ct has a rational point; simply pick a rational point and solve for t. To refine the construction, one can ask Question 1. Can one make δ ∈ H 1 (k, E[3]) visible in the jacobian of a genus 2 curve? Note that E1 ×E2 is principally polarized via the product polarization. This gives rise to a Weil pairing on (E1 × E2 )[3], corresponding to the product pairing. If A is a jacobian, then A must be principally polarized over k. One way this could happen is if the isogeny φ : E1 × E2 → A gives rise to a principal polarization. This would be the case if the kernel Δ is a maximal isotropic subgroup of E1 [3]× E2 [3] with respect to the product pairing. That means that λ : E1 [3] → E2 [3] must be an anti-isometry, i.e. for all P, Q ∈ E1 [3] we must have eE2 (λ(P ), λ(Q)) = eE1 (P, Q)−1 . Note that the original cubic C is a member of the pencil that Mazur constructs, so in his construction λ is actually an isometry, i.e. it preserves the Weil-pairing. Below we consider a pencil of cubics that leads to an anti-isometry λ.
4
Anti-isometric Pencils
Let k be a perfect field of characteristic distinct from 2, 3. Following [7], we associate to a ternary cubic form F ∈ k[x, y, z] three more ternary cubic forms. Namely, the Hessian of F ∂F 2 ∂F 2 ∂F 2 ∂x∂y ∂x∂z 2 2 2 1 ∂x∂x ∂F ∂F ∂F , H(F ) := − ∂y∂x ∂y∂z 2 ∂F 2 ∂y∂y 2 ∂F ∂F 2 ∂z∂x ∂z∂y ∂z∂z
the Caylean of F
∂F (0, z, −y) ∂x 1 ∂F P (F ) := − ∂x (−z, 0, x) xyz ∂F ∂x (y, −x, 0)
∂F ∂y (0, z, −y) ∂F ∂y (−z, 0, x) ∂F ∂y (y, −x, 0)
∂F ∂z (0, z, −y) ∂F ∂z (−z, 0, x) ∂F ∂z (y, −x, 0)
and a ternary cubic form denoted Q(F ), for which we refer to [7, Section 11.2]. For most cases one can take Q(F ) to be H(P (F )) or P (H(F )), but there are some exceptional cases where P (F ), Q(F ) span an appropriate pencil and P (F ), H(P (F )) do not. The left action of GL3 on k 3 induces a right action of GL3 on ternary cubic forms (or, more generally, on k[x, y, z]). For a ternary cubic form F and an M ∈ GL3 we denote this action simply by F ◦M . The significance
Visualizing Elements of Sha[3] in Genus 2 Jacobians
115
of the three associated ternary cubic forms lies in the fact that H(F ) depends covariantly on F (of weight 2) and P (F ) and Q(F ) depend contravariantly on F (of weights 4 and 6 respectively). This means that for every ternary cubic form F and every M ∈ GL3 we have, with d := det M that H(F ◦ M ) = d2 H(F ) ◦ M P (F ◦ M ) = d4 P (F ) ◦ M −T Q(F ◦ M ) = d6 Q(F ) ◦ M −T , where M −T denotes the inverse transpose of M . Now consider a smooth cubic curve C in P2 given by the zero locus of a ternary cubic form F . Then C has exactly 9 different flex points Φ, which all lie on the (not necessarily smooth) curve given by H(F ) = 0. The smoothness of C guarantees that F and H(F ) will be linearly independent over k. Hence Φ can be described as the intersection F = H(F ) = 0. We call Φ the flex scheme of C. At least one of P (F ) and Q(F ) turns out to be nonsingular (still assuming that C is nonsingular) and the intersection P (F ) = Q(F ) = 0 equals the flex points Φ∗ of the nonsingular cubics among P (F ) and Q(F ) (if, say, P (F ) is nonsingular, then Φ∗ can of course also be written as P (F ) = H(P (F )) = 0). We can consider the pencil of cubics through Φ, explicitly given by C(s:t) : sF (x, y, z) + tH(F )(x, y, z) = 0.
(4.1)
Classical invariant theory tells us the following. This pencil has exactly 4 singular members and all other members have flex scheme equal to Φ. Conversely, any nonsingular cubic with flex scheme Φ occurs in this pencil. Furthermore, both P (sF + tH(F )) and Q(sF + tH(F )) are linear combinations of P (F ) and Q(F ). This shows that the flex scheme Φ∗ is independent of the choice of C through Φ and only depends on Φ. We call Φ∗ the dual flex scheme of Φ and we will justify this name below. As a simple, but important example we take F := x3 + y 3 + z 3 . Then we compute H(F ) = −108xyz,
P (F ) = −54xyz,
Q(F ) = 324(x3 + y 3 + z 3 ).
Now define Φ0 to be the flex scheme of F = 0, i.e. Φ0 := {[x : y : z] ∈ P2 : x3 + y 3 + z 3 = xyz = 0}.
(4.2)
Then we see that the flex scheme given by P (F ) = Q(F ) = 0 (which is the flex scheme of Q(F ) = 0) equals Φ0 , i.e. Φ∗0 = Φ0 . The pencil of cubics through Φ0 (note that 108 = 0 in k), which is given by s(x3 + y 3 + z 3 ) = txyz,
116
N. Bruin and S.R. Dahmen
is a model over k for the universal elliptic curve over the (genus zero) modular curve X(3); see [5, p. 225]. Geometrically all flex schemes are linear transformations of each other. In particular, for any flex scheme Φ there exists an M ∈ GL3 (k) such that Φ = M Φ0 . This shows that the pencil (4.1) associates to a general flex scheme Φ is a twist of the universal elliptic curve over X(3). The contravariance of P and Q implies that the assignment Φ → Φ∗ has the contravariance property that for any flex scheme Φ and M ∈ GL3 (M Φ)∗ = M −T Φ∗ .
(4.3)
We also note that this implies that the assignment Φ → Φ∗∗ := (Φ∗ )∗ is covariant in the sense that for any flex scheme Φ and M ∈ GL3 we have (M Φ)∗∗ = M Φ∗∗ . Writing Φ = M Φ0 and using (Φ0 )∗∗ = Φ∗0 = Φ0 we now get Φ∗∗ = (M Φ0 )∗∗ = M Φ∗∗ 0 = M Φ0 = Φ. This justifies calling Φ∗ the dual flex scheme of Φ. Remark 2. In the discussion above it was convenient to consider just one projective plane P2 . A more canonical way would be to consider a projective plane P2 with coordinates x, y, z (for a point) and the dual projective plane, denoted (P2 )∗ , where the point with coordinates u, v, w describes the line ux+vy +wz = 0. Now let C be a smooth cubic curve in P2 given by the zero locus of the ternary cubic form F (x, y, z) with flex scheme Φ. The 9 tangent lines through Φ determine 9 points in (P2 )∗ . Generically, these 9 points in (P2 )∗ will not be the flex points of a smooth cubic curve, hence generically there will a unique cubic curve going through these points. This curve in (P2 )∗ is exactly given by the zero locus of the Caylean, i.e. P (F )(u, v, w) = 0; see also [10, pp.151,190–191]. Moreover, if the characteristic of k is zero, then it turns out that this cubic curve is nonsingular if and only if the j-invariant of C is nonzero. To any flex scheme Φ we associate a group Θ(Φ) ⊂ GL3 as follows. Choose a nonsingular cubic curve C through Φ and let E be its jacobian. After identifying E and C as curves over k, we get an action of E[3] on C, which extends to a linear action on P2 . This determines an embedding χ : E[3] → PGL3 . Obviously, the image χ(E[3]) only depends on Φ. We define Θ(Φ) to be the inverse image of χ(E[3]) in GL3 . Actually Θ(Φ) can be defined just in terms of Φ, without choosing C, since it turns out that χ(E[3]) consists exactly of the linear transformations that preserve Φ. (One way of quickly finding these linear transformations explicitly is by using the fact that, for any two distinct points of Φ, the line through these two points intersects Φ in a unique third point.) The construction gives rise to the theta group 1 → Gm → Θ(Φ) → E[3] → 1. Note that the isomorphism class of this theta group may still depend on the choice of identification of C with E. This corresponds to the choice of an isomorphism between Θ(Φ)/Gm and E[3]. If Φ is defined over k, then E[3] and
Visualizing Elements of Sha[3] in Genus 2 Jacobians
117
Θ(Φ) are also defined over k and the element in H 1 (k, E[3]) corresponding to this theta group is the same as the element corresponding to the 3-covering C → C/E[3] E for any nonsingular cubic curve C through Φ. The construction also shows that for any M ∈ GL3 we have Θ(M Φ) = M Θ(Φ)M −1 .
(4.4)
Proposition 3. Let Φ1 ⊂ P2 be a flex scheme and let Φ2 := Φ∗1 be the dual flex scheme. For i = 1, 2 let Ci be a smooth plane cubic with flex scheme Φi , denote its jacobian by Ei and consider an induced theta group 1
/ Gm
αi
/ Θ(Φi )
βi
/ Ei [3]
/1.
(4.5)
Then the outer automorphism (−T ) : GL3 → GL3 given by M → M −T , yields an isomorphism Θ(Φ1 ) → Θ(Φ2 ). There exists an anti-isometry λ : E1 [3] → E2 [3] making the following diagram commutative. 1
/ Gm
α1
/ Θ(Φ1 )
α2
/ Θ(Φ2 )
x→x−1
1
/ Gm
β1
(−T ) β2
/ E1 [3]
/1
(4.6)
λ
/ E2 [3]
/1
In particular, let δi ∈ H 1 (k, Ei [3]) correspond to the theta group (4.5). Then under the isomorphism H 1 (k, E1 [3]) H 1 (k, E2 [3]) induced by λ, the cocycle δ1 maps to δ2 . Proof. Once the isomorphism Θ(Φ1 ) → Θ(Φ2 ) given by M → M −T is established, the existence of an isomorphism λ : E1 [3] → E2 [3] making the diagram (4.6) commutative, follows immediately. That λ must be an anti-isometry can readily be seen as follows. Let P, Q ∈ E1 [3] and choose x, y ∈ Θ(Φ1 ) such that P = β1 (x) and Q = β1 (y). Then α2 (eE2 (λ(P ), λ(Q))) = α2 (eE2 (β2 (x−T ), β2 (y −T ))) = x−T y −T xT y T = (xyx−1 y −1 )−T = α1 (eE1 (β1 (x), β1 (y)))−T = α1 (eE1 (P, Q)−1 ). The last statement of the proposition is also immediate, so we are left with ∼ establishing (−T ) : Θ(Φ1 ) → Θ(Φ2 ). It suffices to show that for a flex scheme 2 −T Φ ⊂ P we have Θ(Φ) = Θ(Φ∗ ). Write Φ = M Φ0 for some M ∈ GL3 with Φ0 given by (4.2). Then a straightforward calculation shows that Θ(Φ0 )−T = Θ(Φ0 ). We also know that Φ∗0 = Φ0 , so we get Θ(Φ0 )−T = Θ(Φ∗0 ). Together with (4.3) and (4.4) we finally obtain,
118
N. Bruin and S.R. Dahmen
Θ(Φ)−T = Θ(M Φ0 )−T = M −T Θ(Φ0 )−T M T = M −T Θ(Φ∗0 )(M −T )−1 = Θ(M −T Φ∗0 ) = Θ((M Φ0 )∗ ) = Θ(Φ∗ ).
Remark 3. The construction above of the dual flex scheme Φ∗ of a flex scheme Φ involved choosing a smooth cubic going through Φ. Without using theta groups, it was not obvious from this construction that the degree 9 ´etale algebra k(Φ) is isomorphic to k(Φ∗ ). However, there exists a nice explicit geometric construction of the dual flex scheme that remedies these shortcomings of the earlier construction. Given a flex scheme Φ, we proceed as follows. We label its 9 points over k with P1 , . . . , P9 . There are 4 sets of 3 lines, (corresponding to the 4 singular members of the pencil of cubics through φ) containing these points. We label the line that contains Pi , Pj , Pk with l{i,j,k} . One can label the points such that the subscripts are {1, 2, 3} {1, 4, 7} {1, 5, 9} {1, 6, 8} {4, 5, 6} , {2, 5, 8} , {2, 6, 7} , {2, 4, 9} , {7, 8, 9} {3, 6, 9} {3, 4, 8} {3, 5, 7} Naturally, two different lines l{i1 ,j1 ,k1 } , l{i2 ,j2 ,k2 } meet in a unique point. If for example i1 = i2 , then the intersection point is Pi1 . If the two sets {i1 , j1 , k1 } {i2 , j2 , k2 } are disjoint, then the two lines meet in a point outside Φ. We name this point L{i3 ,j3 ,k3 } , where {i1 , j1 , k1 , i2 , j2 , k2 , i3 , j3 , k3 } = {1, . . . , 9}. As it turns out, the four points that have i in their label all lie on a line pi . It is also straightforward to check that the pi together with the L{i,j,k} form a configuration in (P2 )∗ that is completely dual to the Pi with the l{i,j,k} . The pi form the k points of a flex scheme in (P2 )∗ , which is justifiably a flex scheme Φ∗ dual to Φ, and its construction immediately implies the contravariance property (M Φ)∗ = M −T Φ∗ . We can easily verify that the two constructions of Φ∗ coincide for one flex scheme, for instance Φ0 . The general result then follows because any flex scheme can be expressed as M Φ0 for some M ∈ GL3 (k). Since the action of Gal(k/k) on {P1 , . . . , P9 } must act via collinearity-preserving permutations, we see that if σ(Pi ) = Pσ(i) , then σ(pi ) = pσ(i) . Hence, we see that the k-points of Φ and its dual have the same Galois action and hence k(Φ) is isomorphic as a k-algebra to k(Φ∗ ).
5
Recovering the Genus 2 Curve
Let k be a field and let E1 , E2 be two elliptic curves over k with an anti-isometry λ : E1 [3] → E2 [3] and denote by Δ the graph of λ as before. Recall that E1 × E2 is
Visualizing Elements of Sha[3] in Genus 2 Jacobians
119
principally polarized via the product polarization and that the induced polarization on A := (E1 × E2 )/Δ is also principal in this case. It is a classical fact that if A is not geometrically isomorphic to a product of elliptic curves, then A (together with its principal polarization) is isomorphic to the jacobian of a genus 2 curve C. Let us assume from now on that E1 and E2 are non-isogenous. In [8] it is shown that in this case A is always isomorphic over k to the jacobian of a genus 2 curve C/k. This is enough to get our main theoretical result. Theorem 4. Let E be an elliptic curve over a number field k and let ξ ∈ X(E/k)[3]. Then ξ is visible in the jacobian of a genus 2 curve C/k. Proof. Let δ ∈ S (3) (E/k) be a cocycle representing ξ. By Proposition 2, there is a 3-covering Cδ → E corresponding to δ. According to Remark 1, we have that Ob(δ) = 0 and hence that Cδ ⊂ P2 . Let Φ ⊂ P2 be its flex scheme. The construction in Section 4 gives us a pencil of cubics through Φ∗ , so we can easily pick a non-singular one with a rational point. It follows from Proposition 3 that such a curve is of the form Cλ(δ) for some elliptic curve E2 and some anti-isometry λ : E[3] → E2 [3]. This places us in the situation of Lemma 1, so δ is visible in an abelian surface A = (E × E2 )/Δ. We have ensured that λ is an anti-isometry, which implies that the surface is principally polarized. As long as we make sure that E, E2 are non-isogenous (and this is easy given the freedom we have in choosing Cλ (δ)) it follows that A is a jacobian.
Remark 4. We could of course state a more general result about visibility of elements δ ∈ H 1 (k, E[3]) with Ob(δ) = 0 for an elliptic curves E over a perfect field k of characteristic distinct from 2 or 3. Note however that if k is too small, there might not be enough non-isogenous elliptic curves available. The exclusion of fields of characteristic 3 is a serious one, the exclusion of non-perfect fields less so. Most of what we are saying could be generalized to the non-perfect case, basically because for an elliptic curve over any field of characteristic distinct from 3, the multiplication by 3 map is separable. The exclusion of fields of characteristic 2 stems from the fact that the necessary invariant theory in this case is not readily available. We continue with the construction of the genus 2 curve C. Define the divisor Θ := 01 × E2 + E1 × 02 on E1 × E2 , which gives a principal polarization on E1 × E2 . Next, consider the set D of effective divisors on E1 × E2 over k which are linearly equivalent to 3Θ and invariant under Δ. Also consider the set C of effective divisors C on A over k whose pull-back to E1 × E2 are linearly equivalent to 3Θ and which satisfy (C · C) = 2. Frey and Kani show that there exist unique curves D ∈ D and C ∈ C defined over k which are invariant under multiplication by −1. Furthermore, because E1 and E2 are not isogenous, D and C are irreducible smooth curves of genus 10 and 2 respectively and the natural map D → C is unramified of degree 9. If k is a perfect field of characteristic distinct from 2 or 3, the curves D and C can be explicitly constructed as follows. Embed E1 in P2 , given by, say
120
N. Bruin and S.R. Dahmen
F (x, y, z) = 0, for a ternary cubic F/k (such an F is readily obtained if E1 is given by a Weierstrass model). Express E2 as G := sP (F ) + tQ(F ) = 0 for some s, t ∈ k. This way, we obtain an embedding of E1 × E2 in P2 × P2 given by F (x, y, z) = G(u, v, w) = 0. Moreover, by appealing to Proposition 3 we obtain that the curve on this surface given by xu + yv + zw = 0 must be the curve D. The genus 2 curve C is the image of D in (E1 × E2 )/Δ. E1 × E2O OOO OOO OOO O' [3]×[3] (E1 × E2 )/Δ o ooo o o oo wooo E1 × E2 The map [3] × [3] is much more accessible, though. We claim that the subgroup of E1 [3] × E2 [3] under which D is invariant is equal to Δ. Hence, we can find a (singular) model of C as a curve on E1 × E2 by computing ([3] × [3])(D). This can easily be done via interpolation, as explained in the next section by means of an example. As for our claim above, suppose that D is invariant under some / Δ. Without loss of generality we may assume that σ ∈ E1 [3] × E2 [3] with σ ∈ σ = (P, 0E2 ) ∈ E1 [3] × E2 [3] with P = 0E1 . Denote by M ∈ PGL3 (k) the linear action corresponding to translation by P . Now for all ([x : y : z], [u : v : w]) on D we have (x, y, z)(u, v, t)T = (x, y, z)M T (u, v, w)T = 0. This yields (u, v, t) = (x, y, z) × (x, y, z)M T , where × denotes the standard cross product. This association actually defines a birational transformation φ : P2 → P2 (a Cremona transformation with singular points corresponding to the eigenspaces of M ). Note that φ is defined on all the [x : y : z] on E1 , so the image of E1 under φ is an irreducible curve birational to E1 . Together with the assumption that E1 and E2 are not isogenous, we get that this image intersects E2 in only finitely many points, so D is not invariant under σ.
6
Examples
Following the first example in [4, Table 1], consider the elliptic curve 681b1 (in Cremona’s notation), given by the minimal Weierstrass equation E1 : y 2 + xy = x3 + x2 − 1154x − 15345. It turns out that the plane cubic curve C1 : x3 + 5x2 y + 5x2 z + 2xy 2 + xyz + xz 2 + y 3 − 5y 2 z + 2yz 2 + 6z 3 = 0
Visualizing Elements of Sha[3] in Genus 2 Jacobians
121
defines an element ξ (up to inverse) of order three in X(E1 /Q). The contravariants, denoted P0 , Q0 , are given by P0 = −478x3 + 2525x2 y + 916x2 z − 1127xy 2 + 29xyz −160xz 2 + 753y 3 − 1228y 2z + 260yz 2 + 301z 3, Q0 = −122314x3 + 618551x2y + 191092x2z − 271157xy 2 − 7825xyz −28120xz 2 + 184011y 3 − 264916y 2z + 55892yz 2 + 73663z 3. Now the curve C2 : 55033P0 − 235Q0 = 0 has a rational point [x : y : z] = [10 : 8 : 7] and its jacobian is the elliptic curve 681c1, given by the minimal Weierstrass equation E2 : y 2 + y = x3 − x2 + 2. To construct the corresponding genus two curve C such that ξ becomes visible in its jacobian we could take the curve in C1 × C2 ⊂ P2 × P2 with coordinates ([x : y : z], [u : v : w]) given by the equation xu + yv + zw = 0, and take its image under C1 × C2 → E1 × E2 , since this is a twist of [3] × [3] : E1 × E2 → E1 × E2 anyway. We will follow Section 5 more closely. Obviously, E1 is given by F = 0 if we define F := y 2 z + xyz − (x3 + x2 z − 1154xz 2 − 15345z 3). The contravariants of the ternary cubic F are given by P = −2308x3 + 3462x2 y − 5x2 z − 275056xy 2 + 5xyz +6xz 2 + 136951y 3 + 13853y 2z − 3yz 2, Q = −725020x3 + 1087530x2y + 27721x2z − 65861608xy 2 − 27721xyz −30xz 2 + 32749549y 3 + 3217559y 2z + 15yz 2 + 24z 3 . Write j(s, t) for the j-invariant of the curve given by sP +tQ = 0. The j-invariant of E2 equals −4096/2043 and the equation j(s, t) = −4096/2043 has exactly one solution in P1 (Q), namely [s : t] = [55033 : −235] (compare with the definition of C2 ). This gives us a new model for E2 , namely E2 : 55033P − 235Q = 0. We consider the surface E1 × E2 embedded in P2 × P2 as F (x, y, z) = 0,
55033P (u, v, w) − 235Q(u, v, w) = 0.
The curve D on this surface is given by xu + yv + zw = 0.
122
N. Bruin and S.R. Dahmen
The image of D under multiplication by 3 on E1 × E2 is the genus two curve C. Using the defining properties of C from Section 5 (such as the invariance under multiplication by −1), we get that as a curve on E1 × E2 it must be of the form axu + byv + czw + dxw + ezu = 0 for some a, b, c, d, e ∈ Q. We simply generate 4 points on C (over a number field), compute the image under multiplication by 3 of these points and solve for a, b, c, d, e. If the dimension of the solution space is greater than 1, we must of course add points (or take 4 better ones) so that the solution space becomes 1-dimensional. This gives us our equation for C. By a linear change of the u, v, w coordinates we can change the model for E2 back to the original minimal Weierstrass model. Thus, the model for E1 × E2 embedded in P2 × P2 is E1 : y 2 z + xyz = x3 + x2 z − 1154xz 2 − 15345z 3, E2 : v 2 w + vw2 = u3 − u2 w + 2w3 and C is the curve on this surface given by 4xu − 155zu + xv + 2yv − 40xw + yw + 1314zw = 0. Hyperelliptic models for C are Y 2 + (X + 1)Y = 3X 5 + 5X 4 + X 3 − 8X 2 − 5X + 2 or Y 2 = (3X − 1)(X + 1)(4X 3 + 4X 2 − 9). Next, consider the elliptic curve 2006e1, given by the minimal Weierstrass equation E1 : y 2 + xy = x3 + x2 − 58293654x − 171333232940. It turns out that the plane cubic curve C1 : 20x3 +44x2 y +21x2z −77xy 2 +71xyz +44xz 2 +31y 3 +3y 2 z +150yz 2 +z 3 = 0 defines an element ξ (up to inverse) of order three in X(E1 /Q). In the sixth example in [4, Table 1] the elliptic curve E2 which ‘explains’ X(E1 /Q) is 2006d1. However, for this choice of E2 , there only exists an isometry between E1 [3] and E2 [3] and not an anti-isometry. The corresponding abelian surface (E1 × E2 )/Δ visualizing ξ will not be the jacobian of a genus 2 curve. If instead we take for E2 the elliptic curve 6018c1, then we do have an anti-isometry between E1 [3] and E2 [3]. Following the same route as in the first example, we find that ξ is visible in the jacobian of the genus 2 curve C with hyperelliptic models Y 2 + (X 2 + X)Y = − 9675X 6 − 94041X 5 − 914X 4 + 1301674X 3 − 352310X 2 − 2071181X − 945269
or
Y = 43(2X + 13)(18X − 81X + 89)(25X 3 + 193X 2 + 224X + 76). 2
2
Visualizing Elements of Sha[3] in Genus 2 Jacobians
7
123
Applications to 3-Descent
In this section we survey some of the ways in which explicit visibility might aid computations of Mordell-Weil groups and related quantities of elliptic curves. We recall that given an abelian variety A over a number field k, the group X(A/k) ⊂ H 1 (k, A) consists of the cocycle classes that are everywhere locally trivial. It measures the difference between the Mordell-Weil group A(k) and the Selmer 1 group S(A/k) ⊂ lim ←−n H (k, A[n]) which is an everywhere local approximation to A(k), in the sense that the following sequence is exact. 0 → A(k) → S(A/k) → X(A/k) → 0 An n-descent usually means an explicit computational process to compute S (n) (A/k) = S(A/k)/nS(A/k) ⊂ H 1 (k, A[n]). It provides a bound on rkA(k) and conversely, if A(k) is known, then we can use 0 → A(k)/nA(k) → S (n) (A/k) → X(A/k)[n] → 0 to compute #X(A/k)[n] and thus obtain information on #X(A/k). In principle, one can use visibility to refine this information. We will argue using an example. Stein and Watkins [12] found the following elliptic curve E : y 2 + xy = x3 − x2 + 94x + 9. Using a 2-descent and some point searching (with for instance Magma [1]) it is straightforward to verify that E(Q) Z × Z and that #X(E/Q)[2] = 1. Using a 3-descent (see [2, 3, 11], implemented in Magma), with unproved S-unit data we find that C1 : x3 + 2x2 z + 2xy 2 + xyz − xz 2 − y 3 + 3y 2 z − 6yz 2 + z 3 = 0, C2 : x3 − 2xy 2 + 3xyz + 2y 3 + y 2 z + yz 2 + 3z 3 = 0 are 3-coverings of E that have points everywhere locally and we can verify by looking at preimages of representatives of E(Q)/3E(Q) that C1 , C2 have no rational points. The same process allows us to find more than 18 such spaces, verifying unconditionally that #X(E/Q)[3] ≥ 9. The conditional 3-descent computation suggests that C1 , C2 represent cocycles generating S (3) (E/Q)/E(Q), so one expects that #X(E/Q)[3] = 9 and indeed BSD predicts that #X(E/Q) = 9. Visibility could help with proving that #X(E/Q)[3∞ ] = 9. The construction in this paper yields an abelian surface A = Jac(C), together with a map φ∗ : X(E/Q) × X(E /Q) → X(A/Q) where we know that ker(φ∗ ) is contained in the 3-torsion, because multiplicationby-three factors through φ. If we can make sure that ker(φ∗ ) contains the classes
124
N. Bruin and S.R. Dahmen
represented by C1 , C2 (this implies that E (Q) is of rank at least 2), it may well be that #X(A/Q)[3] = 1. If we can compute S (3) (A/Q), we can check this and the result would follow. Thus, visibility allows us to substitute a 9-descent on an elliptic curve with a 3-descent on the Jacobian of a genus 2 curve. Both are theoretically computable, but in neither case does it seem practical at this point. Since A has a 3-isogeny to E × E , the 3-torsion algebra (generically of degree 80), splits in two algebras of degrees 72 and 8 respectively. However, doing class group computations for degree 72 algebras over Q still seems well out of range. It is conceivable that some appropriate galois-stable set S of divisors on C exists with #S < 72. The group Sp4 (F3 ) has an index 27 subgroup, for instance, predicting a transitive action on 27 objects somewhere. If for some fixed divisor D0 we have that A[3] = [D − D0 ] : D ∈ S, it may be possible to adapt ideas about fake Selmer groups [9] for application to A and only require class group information for algebras of degree #S. At this point it is unclear if this approach has any advantages to a direct 9descent on E and whether either method can be made practical for the example given in this section. Acknowledgments. The authors would like to thank the referees, who provided various helpful comments which found their way into this article.
References [1] Bosma, W., Cannon, J., Playoust, C.: The Magma computer algebra system is described in the Magma algebra system. I. The user language. J. Symbolic Comput. 24(3-4), 235–265 (1997) [2] Cremona, J.E., Fisher, T.A., O’Neil, C., Simon, D., Stoll, M.: Explicit n-descent on elliptic curves. I. Algebra. J. Reine Angew. Math. 615, 121–155 (2008) [3] Cremona, J.E., Fisher, T.A., Stoll, M.: Minimisation and reduction of 2-, 3- and 4-coverings of elliptic curves, arXiv: 0908.1741 (2009), http://arxiv.org/abs/0908.1741 [4] Cremona, J.E., Mazur, B.: Visualizing elements in the Shafarevich-Tate group. Experiment. Math. 9(1), 13–28 (2000) [5] Mazur, B.: Visualizing elements of order three in the Shafarevich-Tate group. Asian J. Math. 3(1), 221–232 (1999); Sir Michael Atiyah: a great mathematician of the twentieth century [6] O’Neil, C.: The period-index obstruction for elliptic curves. J. Number Theory 95(2), 329–339 (2002) [7] Fisher, T.: The Hessian of a genus one curve, arXiv: math/0610403 (2006), http://arxiv.org/abs/math/0610403 [8] Frey, G., Kani, E.: Curves of genus 2 covering elliptic curves and an arithmetical application. In: Arithmetic Algebraic Geometry (Texel, 1989), pp. 153–176 (1991) [9] Poonen, B., Schaefer, E.F.: Explicit descent for Jacobians of cyclic covers of the projective line. J. Reine Angew. Math. 488, 141–188 (1997)
Visualizing Elements of Sha[3] in Genus 2 Jacobians
125
[10] Salmon, G.: A treatise on the higher plane curves, 3rd edn. Hodges, Foster, and Figgis, Grafton Street, Dublin (1879) [11] Schaefer, E.F., Stoll, M.: How to do a p-descent on an elliptic curve. Trans. Amer. Math. Soc. 356(3), 1209–1231 (2004) [12] Stein, W.A., Watkins, M.: A database of elliptic curves—first report. In: Fieker, C., Kohel, D.R. (eds.) ANTS 2002. LNCS, vol. 2369, pp. 267–275. Springer, Heidelberg (2002), http://wstein.org/Tables/ecdb/
On Weil Polynomials of K3 Surfaces Andreas-Stephan Elsenhans1, and J¨ org Jahnel2 1
2
Universit¨ at Bayreuth, Mathematisches Institut, Universit¨ atsstraße 30, D-95447 Bayreuth, Germany
[email protected] Fachbereich 6, Mathematik, Universit¨ at Siegen, Walter-Flex-Straße 3, D-57072 Siegen, Germany
[email protected]
Abstract. For K3 surfaces, we derive some conditions the characteristic polynomial of the Frobenius on the ´etale cohomology must satisfy. These conditions may be used to speed up the computation of Picard numbers and the decision of the sign in the functional equation∗∗ . Our investigations are based on the Artin-Tate formula.
1
Introduction
√ An algebraic integer such that all its conjugates have absolute value r is called an r-Weil number. Correspondingly, a possibly √ reducible monic polynomial Φ ∈ Z[T ] such that all roots have absolute value r is called an r-Weil polynomial. Let q be a prime power and r = q k . Then, for every smooth projective variety V over Fq , the eigenvalues of the Frobenius endomorphism Frob on the ´etale cohomology H´ekt (VFq, Ql ) are r-Weil numbers [3, Lemme 1.7]. Conversely, every q k -Weil number is an eigenvalue of Frob on H´ekt (VFq, Ql ) for a suitable smooth projective variety V over Fq . Actually, this fact is a direct consequence of the results of T. Honda [9]. In this note, we will study the Weil numbers of K3 surfaces. As the second Betti number of a K3 surface is b2 (V ) = 22 and q is always a root of the characteristic polynomial, the possible Weil numbers are of degree at most 20. We will show that not all q 2 -Weil polynomials Φ ∈ Z[T ] satisfying deg Φ = 22 and Φ(q) = 0 occur as characteristic polynomials of Frob on the ´etale cohomology of K3 surfaces. Concerning K3 surfaces of fixed degree, even more restrictions result. Our investigations are based on the Artin-Tate formula which we will recall in section 3.
The first author was partially supported by the Deutsche Forschungsgemeinschaft (DFG) through a funded research project. The computer part of this work was executed on the Sun Fire V20z Servers of the Gauß Laboratory for Scientific Computing at the G¨ ottingen Mathematisches Institut. Both authors are grateful to Prof. Y. Tschinkel for the permission to use these machines as well as to the system administrators for their support.
G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 126–141, 2010. c Springer-Verlag Berlin Heidelberg 2010
On Weil Polynomials of K3 Surfaces
127
An application. The characteristic polynomial of Frob may be computed by counting points over extensions of the ground field. Indeed, for V a K3 surface over Fq , the Lefschetz trace formula [13, Ch. VI, §12] yields tr(Frobe ) = #V (Fqe ) − q 2e − 1. When we denote the eigenvalues of Frob by r1 , . . . , r22 , we have e tr(Frobe ) = r1e + · · · + r22 =: σe (r1 , . . . , r22 ). Newton’s identity [20] sk (r1 , . . . , r22 ) =
k−1 1 (−1)k+j+1 σk−j (r1 , . . . , r22 )sj (r1 , . . . , r22 ) k j=0
shows that the knowledge of σe (r1 , . . . , r22 ), for e = 1, . . . , k, is sufficient in order to determine the coefficient (−1)k sk of T 22−k of the characteristic polynomial Φ of Frob. Further, there is the functional equation q deg Φ Φ(T ) = ±T deg Φ Φ(q 2/T )
(1)
which, as deg Φ = 22, relates the coefficient of T k with that of T 22−k . Nevertheless, this method is time-consuming. The size of the fields to be considered grows exponentially. One would like to avoid point counting over large fields and, nevertheless, determine Φ sufficiently well in order to decide things such as the sign in (1). Algorithms of this type were presented in [6]. For example, Algorithm 22 of [6] verifies that the geometric Picard rank is 2, having counted points over Fp , . . . , Fp9 for p a prime number. The main result of the present article leads to a more substantial approach to this problem. In fact, we will show that certain hypothetical characteristic polynomials are impossible, in general. This leads to an improvement of [6, Algorithm 22]. Sections 7 and 8 will be devoted to examples showing how this improvement works in practice. Remark 1. A continuation of this application, which we have in mind, is the computation of the geometric Picard rank for K3 surfaces over Q. Here, the general strategy is to use reduction modulo p. One applies the inequality rk Pic(VQ ) ≤ rk Pic(VFp ) which is true for every smooth variety V over Q and every prime p of good reduction. Then, the number of eigenvalues of Frob which are roots of unity is an upper bound for the Picard number. More details are given in [6] and [7].
2
The Galois Group of a Weil Polynomial
For a randomly chosen irreducible polynomial over Q, one expects the Galois group to be the full symmetric group. In this sense, the irreducible factors of a Weil polynomial are not very random. When we consider the operation of Frob on a cohomology group of even degree, cyclotomic factors do arise. They correspond to the algebraic part of the cohomology, i.e., to the image of the Picard group and its analogues in higher codimension. The corresponding Galois group is always abelian.
128
A.-S. Elsenhans and J. Jahnel
Concerning the remaining factors, still, there are restrictions on the Galois group. Note that, for each root of an irreducible r-Weil polynomial not of degree 1, the complex conjugate is a root, too. This means, the roots come in pairs. The product of each pair is equal to r. The Galois group therefore acts on the pairs. For a suitable integer n, it is a subgroup of the semi-direct product (Z/2Z)n Sn ⊂ S2n . Here, each factor (Z/2Z) acts on one pair by complex conjugation. The complex conjugation itself belongs to the center of the group. An experimental result. One could ask for further restrictions on the Galois group. For that, we computed the characteristic polynomial of Frob for a few thousand randomly chosen K3 surfaces. In each case, the factorization of that polynomial had precisely one irreducible factor which was not cyclotomic. This coincides with Zarhin’s results [18] for ordinary K3 surfaces. Furthermore, in the vast majority of the examples, the Galois group of the last factor was actually equal to the semi-direct product (Z/2Z)n Sn ⊂ S2n . For example, this was true for 875 out of 1 000 K3 surfaces of degree 2 over F3 and 923 out of 1 000 K3 surfaces of degree 2 over F7 . The resolvent algebra. Let Φ ∈ Q[T ] be a polynomial such that its set of roots is of the particular form {r1 , r1 , . . . , rn , rn } such that r1 r1 = . . . = rn rn =: r ∈ Q. Then, the sums r1 + r1 , . . . , rn + rn are the roots of a polynomial R ∈ Q[T ] of half the degree. We will call R the resolvent polynomial and A := Q[T ]/R the resolvent algebra of Φ. Remarks 2. a) When Φ √ is an r-Weil polynomial of even degree, the assumption r is a root of even multiplicity (or no root) of Φ. In this is satisfied if and only if √ case, (− r) has even multiplicity, too. In fact, this means exactly that Φ fulfills the functional equation (1) with the plus sign. b) On the other hand, when one wants to verify that a given polynomial satisfying the functional equation is, in fact, a Weil polynomial, the resolvent is helpful. √ Observe that the roots of the initial polynomial are all of absolute value √ √r if and only if the roots of the resolvent are all real and in the interval [−2 r, 2 r]. That property may easily be checked using Sturm’s chain theorem. This is a fast and exact replacement of [6, Algorithm 23].
3
The Artin-Tate Formula
Let us recall the Artin-Tate conjecture in the special case of a K3 surface. Conjecture 3 (Artin-Tate). Let V be a K3 surface over a finite field Fq . Denote by ρ the rank and by Δ the discriminant of the Picard group of V, defined over Fq . Then, lim Φ(T )ρ T →q (T −q) |Δ| = 21−ρ . q #Br(V )
On Weil Polynomials of K3 Surfaces
129
Here, Φ denotes the characteristic polynomial of Frob on H´e2t (VFq, Ql ). Finally, Br(V ) is the Brauer group of V . Remarks 4. i) The characteristic polynomial Φ is independent of the choice of the auxiliary prime l as long as l = p for q = pe [3, Th´eor`eme 1.6]. ii) For a general non-singular, projective surface, the exponent of q in the numerator is b2 (V ) − h02 (V ) − ρ. Here, h02 (V ) denotes the Hodge number. iii) The Artin-Tate conjecture is proven for most K3 surfaces. Most notably, the Tate conjecture implies the Artin-Tate conjecture [11, Theorem 6.1]. iv) The Tate conjecture claims that all zeroes of Φ of the form qζ for ζ a root of unity belong to the algebraic part of H´e2t (VFq, Ql ). I.e., it asserts that the transcendental part never generates a zero of this form. The evidence for this is overwhelming as far as K3 surfaces are concerned. The Tate conjecture is proven for elliptic K3 surfaces [1] and ordinary K3 surfaces [15]. In characteristic different from 2 and 3, even more particular cases were successfully treated [16]. v) It is expected that Br(V ) is always a finite group. This is actually equivalent to the Tate conjecture. In this case, #Br(V ) is automatically a perfect square. We may therefore compute the square class of Δ making use of the ArtinTate conjecture. An unconditional version of the Artin-Tate formula Notation 5. i) For n a positive integer, we will denote by μn the sheaf of n-th roots of unity with respect to the fppf topology. When l is a prime number, d d (VFq, Tl μ) := lim Hfppf (VFq, μle ). we put Hfppf ←e− ii) For l a prime number and M an abelian group, the notation Ml-pow shall be used for the l-power torsion subgroup of M . Similarly, we will write Ml-div ⊆ Ml-pow for the subgroup of infinitely l-divisible elements. iii) We will denote by M Frob and MFrob the invariants, respectively coinvariants, under the operation of Frob on the abelian group M . The coinvariants may have for the torsion-free quotient. torsion even when M is torsion-free. Write MFrob Proposition 6. Let V be a K3 surface over a finite field Fq and l be any prime. Write Φ for the characteristic polynomial of Frob on the ´etale cohomology of VFq and ρ for the multiplicity of q as a zero of Φ. i) Then, the Brauer group Br(V ) is a torsion group. The quotient Br0 (V, l) := Br(V )l-pow / Br(V )l-div is a finite group of square order. 2 (VFq, Tl μ)Frob is a free Zl -module of rank ρ. ii) Further, Hfppf iii) Denote by Δl the discriminant of the bilinear form 2 2 Hfppf (VFq, Tl μ)Frob × Hfppf (VFq, Tl μ)Frob −→ Zl
130
A.-S. Elsenhans and J. Jahnel
defined by Poincar´e duality. Then, νl (Δl ) = νl
Φ(T ) lim ρ T →q (T −q) q21−ρ #Br0 (V,l)
.
Proof. i) Finiteness of Br0 (V, l) follows immediately from [8, (8.9)]. Further, there is a non-degenerate alternating pairing Br0 (V, l) × Br0 (V, l) → Ql /Zl constructed in [19, Lemma 3.4.1]. This ensures that the group order is a perfect square. ii) and iii) We denote the zeroes of Φ by r1 , . . . , r22 . 2 First case. l = p. Here, H := Hfppf (VFq, Tl μ) = H´e2t (VFq, Zl (1)) is the same as l-adic ´etale cohomology. It is a free Zl -module of rank 22. In the present case, the operation of Frob on H is known to be semi-simple [4, Corollary 1.10]. The eigenvalues are r1 /q, . . . , r22 /q. Assertion ii) follows immediately from this. Further, we have νl (Δl ) = νl (#coker(H Frob → Hom(H Frob , Zl ))), the map being induced by Poincar´e duality. Identifying Hom(H, Zl ) with H, the module Hom(H Frob , Zl ) goes over into HFrob . Here, as shown in [19, Proposition 1.4.2], (HFrob )tors ∼ ho= Br0 (V, l). Further, the order of the cokernel of the canonical (1 − rj /q). momorphism H Frob → HFrob is equal to the l-primary part of rj =q Altogether, this implies the claim. Second case. l = p. Here, some modifications are necessary which are described in [11]. More concretely, the short exact sequence 2 n 0 → Pic(VFq)⊗Z Zp → Hfppf (VFq, Tp μ) → lim ←− Br(VFq)p → 0 2 immediately shows that H := Hfppf (VFq, Tp μ) is a torsion-free Zp -module. Otherwise, its structure is rather different from the previous case. The rank of H is, in general, less than 22. Eigenvalues of Frob are only those rj /q which are units in Qp [11, 1.4]. But this is enough to show ii). Generally, there are unipotent connected quasi-algebraic groups U d and ´etale group schemes Dnd for d = 2, 3 and n 0 which provide short exact sequences d 0 → U d (Fq ) → Hfppf (VFq, μpn) → Dnd (Fq ) → 0. For varying n, the vector groups 3 U (Fq ) are connected by identities. Further, Dn3 = 0. Hence, if dim U 3 = s then 3 (VFq, Tp μ)Frob = q s the operation of Frob being semi-simple. Actually, one #Hfppf has s = 0 except when V is supersingular. Poincar´e duality is available [12, Theorem 5.2 and Corollary 2.7.c)] only at the level of torsion coefficients. Thereby, U 2 (Fq ) and U 3 (Fq ) are dual to each other. 2 1 2 One has ← lim − U (Fq )2= 0 and R lim ←∼ − U (Fq2) = 0 as the connecting homomorphisms are zero. Hence, Hfppf (VFq, Tp μ) = lim Dn (Fq ). Further, it turns out that the ho←− momorphism HFrob → Hom(H Frob , Zp ) does not need to be bijective. It has a cokernel exactly of order q s (cf. [11, Lemma 5.2]). Summarizing, we find that Δp has the same p-adic valuation as qs · (1 − rj /q) . νp (rj /q)=0 rj =q
On Weil Polynomials of K3 Surfaces
131
For iii), it remains to show p-adic units, the product of the following. Up tos−1 the remaining factors, i.e. (1 − rj /q), equals q . This is worked out in [11, νp (rj /q)=0 sec. 7]. 2 (VFq, Tl μ)Frob ∼ Remark 7. The Tate conjecture implies Hfppf = Pic(VFq )⊗ZZl . Further, it is equivalent to Br(V )l-div = 0. Thus, Proposition 6 goes over into the Artin-Tate formula in its usual form. However, the Tate conjecture is unknown in general, even for K3 surfaces. For this reason, we prefer to apply the version of the Artin-Tate formula which holds unconditionally.
4
The Rank-1 Condition
Let V be a K3 surface of degree d over a finite field Fq . Assume that q is a simple zero of the characteristic polynomial of Frob. Then, the Tate conjecture is true for V and the arithmetic Picard rank is equal to 1. The discriminant of Pic(V ) is equal to d. A comparison with the analytic discriminant computed via the ArtinTate formula leads to a non-trivial condition for hypothetical Weil polynomials. Remarks 8. a) This is a condition for rank-1 surfaces of a given degree d. It is not a condition for K3 surfaces, in general. b) The degree of a K3 surface may be any even integer greater than zero. On the other hand, when the arithmetic Picard rank is 1, the number (−q) is necessarily among the Frobenius eigenvalues. Hence, the Artin-Tate formula can generate only even numbers. c) The Artin-Tate conjecture implies the inequality #Br(V )|Δ| ≤ 222−ρ q. Thus, the left hand side is O(q). Observe the following striking consequence. Over the field Fq , there is no K3 surface of a square-free degree d > 221 q and arithmetic Picard rank 1. Remark 9. The rank-1 condition may be extended to other situations where a subgroup of the Picard group is known. For this, one has to compare the predicted ranks and discriminants with the known ones.
5
The Field Extension Condition
Notation 10. For q a positive integer, let Φ be a q 2 -Weil polynomial. Then, we will write q c − rjc (c) EΦ := q (c−1)(21−ρ) . q − rj rj =q
Here, rj runs over all the zeroes of Φ. Further, ρ is the multiplicity of the zero q. Observation 11 (Field extension for the characteristic polynomial). Let V be any smooth, projective variety over Fq and j (T − rj ) the characteristic polynomial on H´e2t (VFq, Ql ). Then, the corresponding polynomial for VFqd of Frob d is j (T − rj ).
132
A.-S. Elsenhans and J. Jahnel
Theorem 12. Let V be a K3 surface over Fq . Further, let c be a positive in(c) teger. Then, for Φ the characteristic polynomial of Frob, the expression EΦ is a perfect square in Q. (c) Proof. If there is an rj = q such that rjc = q c then EΦ = 0. Otherwise, for every 2 Frobqc 2 prime l, Hfppf(VFq, Tl μ) is a sublattice of finite index in Hfppf (VFq, Tl μ)Frobq . In particular, the discriminants differ by a factor being a perfect square. Dividing the Artin-Tate formulas for VFqc and VFq through each other yields that (c) (c) νl (EΦ ) is even for every l. Finally, it is easy to see that EΦ > 0. (c)
Remark 13. Assume the Tate conjecture. Then, EΦ is non-zero if and only if rk Pic(VFq) = rk Pic(VFqc). (c)
Definition 14. We will call the condition on EΦ to be a perfect square, the field extension condition for the field extension Fqc /Fq . (c)
Explicit computation of the expression EΦ . Our goal is now to describe (c) the square class of EΦ more explicitly. It will turn out that, for an arbitrary Weil (c) polynomial, EΦ may be a non-square. In other words, Theorem 12 provides a non-trivial condition. Remark 15. A priori, there are infinitely many conditions, one for each value of c. The main result of this section is that there is in fact only one condition. Further, this condition may be checked easily. Lemma 16. Let f ∈ Q[T ] be a q 2 -Weil polynomial. Suppose f (q) = 0 and f (−q) = 0. Then, for r1 , . . . , r2l the zeroes of f , 2l q c − rjc (Q∗ )2 ∪ {0} for c odd, ∈ f (−q)(Q∗ )2 ∪ {0} for c even. q − rj j=1 Further, the left hand side is actually in f (−q)(Q∗ )2 for c = 2. Proof. First observe that, for c = 2, the numerators q 2 − rj2 are all non-zero according to the assumption. Hence, the additional assertion is clear once we showed the main one. For that, let us start with the contribution of one pair of complex conjugate roots. Put rj = q(u + iv). Then, the corresponding factor is (q c − rjc )(q c − r cj ) (q c − q c (u + iv)c )(q c − q c (u − iv)c ) = (q − rj )(q − r j ) (q − q(u + iv))(q − q(u − iv) = q 2(c−1)
c−1
(1 − ζck (u + iv))(1 − ζck (u − iv)) .
k=1
Using (u + iv)(u − iv) = 1, we get q 2(c−1)
c−1 k=1
(1 − 2ζck u + ζc2k ) .
On Weil Polynomials of K3 Surfaces
133
Next, for k = c/2, let us multiply the factors for k and c − k. This yields (1 − 2ζck u + ζc2k )(1 − 2ζcc−k u + ζc2c−2k ) = 2 + 4u2 − 8u Re(ζck ) + 2 Re(ζc2k ) . As Re(ζc2k ) = 2 Re(ζck )2 − 1, the latter term is the same as 4u2 − 8u Re(ζck ) + 4 Re(ζck )2 = (2u − 2 Re(ζck ))2 . Multiplying over all k such that 1 ≤ k < c/2, we find a square in Q(u). Consequently, up to the factor for k = c/2, if present, the contribution of the pair {rj , rj } is a square in the resolvent algebra A of f . Multiplying over all l pairs means to form a norm for the extension A/Q. As the norm of a square is a square, the result is a perfect square in Q. For c odd, this completes the argument. For c even, the factors for k = c/2 are still missing. These are the ones for ζck = −1. We find the product l
(1 + rj /q)(1 + r j /q) = q −2l f (−q) .
j=1
The assertion follows. Proposition 17. Let Φ be a q -Weil polynomial of even degree. Then, (Q∗ )2 ∪ {0} for c odd, (c) EΦ ∈ qΦ(−q)(Q∗ )2 ∪ {0} for c even. 2
For c = 2, we actually have EΦ ∈ qΦ(−q)(Q∗ )2 . Proof. First case: c is odd. Then, the denominator q (c−1)(21−ρ) is a perfect square. The zeroes (−q) con(c) tribute factors q c−1 which are squares, too. Finally, the contribution to EΦ of the zeroes not being real is a perfect square according to Lemma 16. Second case: c is even. (c) If (−q) is a zero of Φ then EΦ = 0. This coincides with the claim as Φ(−q) = 0. Otherwise, write Φ(T ) = (T − q)ρ f (T ) where f (q) = 0 and f (−q) = 0. By assumption, ρ is even. Hence, q (c−1)(21−ρ) is in the square class of q. Further, the zeroes of Φ differing from q are exactly the zeroes of f . Their contribution is in f (−q)(Q∗ )2 for c = 2 and in f (−q)(Q∗ )2 ∪ {0}, in general. As ρ is even, f (−q)(Q∗ )2 is the same class as Φ(−q)(Q∗ )2 . The assertion follows. (c)
Corollary 18. Let f ∈ Z[T ] be a q 2 -Weil polynomial. i) Then, all field extension conditions for Fqc /Fq are satisfied if only if the condition for the quadratic extension Fq2 /Fq does hold. ii) For extensions of odd degree, the field extension condition is always satisfied. iii) If Fq and Fq2 lead to different Picard ranks then all the field extension conditions are satisfied. Remark 19. One might want to study the field extension conditions for Fqac /Fqa , i.e., for an extended ground field. Our calculations show that this does not lead to new conditions.
134
A.-S. Elsenhans and J. Jahnel
Simplification of the field extension test. Denote by φn the n-th cyclotomic polynomial. Correspondingly, there is the monic polynomial ψn given by ψn (T ) := q ϕ(n) φn (T /q). This is a q 2 -Weil polynomial. Lemma 20. Let n > 1 be an integer. Then, ⎧ ⎨ (Q∗ )2 if n is not a power of 2 , ψn (−q) ∈ 2(Q∗ )2 for n = 2m , m ≥ 2 , ⎩ {0} for n = 2 . Proof. It is well known (see, e.g., [14, sec. 3]) that φn (−1) = 1 unless n is e−1 a power of 2. Further, the formula φ2e (t) = t2 + 1 shows φ2 (−1) = 0 and φ2e (−1) = 2 for e > 1. Observe, finally, that ϕ(n) is always even for n > 2. Remark 21. The result used here is a very special case of the value of a cyclotomic polynomial at a root of unity. Theorem 22. Let Φ ∈ Z[T ] be a q 2 -Weil polynomial of even degree. Factorize Φ as Φ(T ) = (T − q)r (T + q)s ψn1 (T ) · . . . · ψnk (T )Φ1 (T ) such that Φ1 has no root being a root of unity multiplied by q. Denote by M the number of the powers of 2 among the n1 , . . . , nk . Then, i) if c is odd then EΦ ∈ (Q∗ )2 ∪ {0}. (c)
(c)
ii) If c is even and s > 0 then EΦ = 0 for every c. iii) Finally, if c is even and s = 0 then EΦ ∈ 2MqΦ1 (−q)(Q∗ )2 ∪ {0}. Furthermore, for c = 2, one actually has (c)
EΦ ∈ 2MqΦ1 (−q)(Q∗ )2 . (2)
Proof. i) and ii) are immediate consequences from Proposition 17. For iii), observe the assumption implies that r is even. In particular, (−2q)r is a perfect square. The assertion now follows from Proposition 17 together with Corollary 20. Remark 23. Suppose Φ ∈ Z[T ] is a q 2 -Weil polynomial of degree 22. In order to show that Φ may not be the characteristic polynomial of the Frobenius for a K3 surface over Fq , it suffices to verify that s = 0 and 2MqΦ1 (−q) is a non-square. Example 24. As an example, we look at K3 surfaces of Picard rank 18 such that the Picard group is defined over an extension of odd degree. Then, (−q) is not an eigenvalue of the Frobenius. The transcendental part of the characteristic polynomial is given by (T 4 + aT 3 + bT 2 + aq 2 T + q 4 ). Hence, the field extension condition usually requires that (2q 2 − 2aq + b)q is a perfect square. If, however, the cyclotomic factors contain an odd number of type ψ2n then 2(2q 2 − 2aq + b)q is required to be a square.
On Weil Polynomials of K3 Surfaces
6
135
The Special Case of a Degree-2 Surface – Twisting
When a K3 surface has a non-trivial automorphism, one can hope to get more conditions by inspecting the corresponding twist. This is the case for degree-2 surfaces. The Twist. Let the K3 surface V be given by the equation w2 = f6 (x, y, z) . Then, for n a non-square in Fq , consider the twist V of V given by nw2 = f6 (x, y, z) . Fact 25. Assume that q, r2 , . . . , r22 are the eigenvalues of Frob for V . Then, the eigenvalues for V are q, −r2 , . . . , −r22 . Proof. For e even, VFqe and V Fqe are isomorphic. When e is odd, we have #V (Fqe ) + #V (Fqe ) = 2·#P2 (Fqe ) = 2q 2e + 2q e + 2 . It is easy to check that the Lefschetz trace formula, applied to the eigenval ues q, −r2 , . . . , −r22 , implies exactly this relation. Proposition 26. Let V be a K3 surface of degree 2 over Fq . Denote by Φ the the corresponding polynomial characteristic polynomial of Frob for V and by Φ for the twist V . does not have a zero at (−q). i) Then, Φ has a simple zero at q if and only if Φ I.e., the rank-1 condition can be applied to the one precisely when the field extension condition is non-empty for the other one. ii) The two conditions are equivalent to each other. Proof. i) immediately follows from Fact 25. ii) By assumption, we can write Φ(T ) = (T − q)(T + q)2n−1 f (T ). Here both, f (q) and f (−q) are non-zero. Fact 25 shows, the corresponding polyno ) = (T − q)2n f (−T ). Using these two formulas, one mial for the twist is Φ(T can make the conditions explicit. The rank-1 condition for Φ simply means (2q)2n−1 f (q) = 2 in Q∗/(Q∗ )2 which is equivalent to saying that qf (q) is a per fect square. This is precisely the field extension condition for Φ.
7
Examples
Let us show in detail the data for a few examples. Our goal is to illustrate how the Artin-Tate conditions work in practice. Example 27 (A K3 surface of degree 2 over F7 ). Consider the surface V over F7 , given by w2 = y 6 + 3z 6 + 5xz 5 + 5x2 y 4 + x2 z 4 + 3x3 y 3 + x3 z 3 + 5x4 y 2 + x4 z 2 + 5x5 y + 2x6 . Over F7 , . . . , F79 , there are exactly 66, 2 378, 118 113, 5 768 710, 282 535 041,
136
A.-S. Elsenhans and J. Jahnel
13 841 275 877, 678 223 852 225, 33 232 944 372 654, and 1 628 413 551 007 224 points. We claim that rk Pic(VF7 ) = 2. Assuming the characteristic polynomial of the Frobenius has more than two zeroes of the form 7 times a root of unity, [6, Algorithm 22] leaves us with three candidates Φ1 , Φ2 , Φ3 . Φi (t) = t22 − 16 t21 + 140 t20 − 1 029 t19 + 5 831 t18 − 36 015 t17 + 268 912 t16 − 1 882 384 t15 + 11 529 602 t14 − 46 118 408 t13 + ai t12 + bi t11 + ci t10 + (−1)ji [−110 730 297 608 t9 + 1 356 446 145 698 t8 − 10 851 569 165 584 t7 + 75 960 984 159 088 t6 − 498 493 958 544 015 t5 + 3 954 718 737 782 519 t4 − 34 196 685 556 119 429 t3 + 227 977 903 707 462 860 t2 − 1 276 676 260 761 792 016 t + 3 909 821 048 582 988 049]
for j1 = 0,
(a1 , b1 , c1 ) = (161 414 428, −1 129 900 996, 7 909 306 972) ,
j2 = 1,
(a2 , b2 , c2 ) = ( 80 707 214,
0, −3 954 653 486) ,
j3 = 1,
(a3 , b3 , c3 ) = (121 060 821,
0, −5 931 980 229) .
Each of the three polynomials leads to an upper bound of 4 for the rank of the geometric Picard group. All three have roots of absolute value 7, only. Applying the Artin-Tate formula, we find the following. Table 1. Hypothetical ranks and discriminants polynomial Φ1 Φ2 Φ3
field F7 F49 F7 F49 F7 F49
arithmetic Picard rank 2 2 1 2 1 2
#Br(V )|Δ| 58 4524 4 1996 6 2997
The polynomial Φ1 is excluded by the field extension condition as the two values in the rightmost column define different square classes. On the other hand, the rank-1 condition excludes Φ2 and Φ3 since we have a degree-2 example. Thus, relative to the Tate conjecture, geometric Picard rank 2 is proven. Example 28 (continuation). On the same surface, point counting over F710 leads to a number of 79 792 267 067 823 523. For the characteristic polynomial of the Frobenius, we find the two candidates Φ4 , Φ5 , Φi (t) = t22 − 16 t21 + 140 t20 − 1 029 t19 + 5 831 t18 − 36 015 t17 + 268 912 t16 − 1 882 384 t15 + 11 529 602 t14 − 46 118 408 t13 + 40 353 607 t12 + ai t11 + (−1)ji [ −1 977 326 743 t10 + 110 730 297 608 t9 − 1 356 446 145 698 t8 + 10 851 569 165 584 t7 − 75 960 984 159 088 t6 + 498 493 958 544 015 t5 − 3 954 718 737 782 51 9t4 + 34 196 685 556 119 429 t3 − 227 977 903 707 462 860 t2 + 1 276 676 260 761 792 016 t − 3 909 821 048 582 988 049]
On Weil Polynomials of K3 Surfaces
137
for j4 = 0, a4 = 0, j5 = 1, and a5 = 564 950 498. Φ4 corresponds to the minus sign in the functional equation, Φ5 to the case of the plus sign. Both candidates, according to the Tate conjecture, imply geometric Picard rank 2. To decide which sign is the right one, one would first check the absolute values of the roots. Unfortunately, both polynomials only have roots of absolute value 7. The Artin-Tate formula provides the picture given in the table below. Table 2. Hypothetical ranks and discriminants polynomial Φ4 Φ5
field F7 F49 F7 F49
arithmetic Picard rank 1 2 2 2
#Br(V )|Δ| 2 997 55 4125
Thus, Φ5 is excluded by the field extension condition. The minus sign in the functional equation is correct. Example 29 (A K3 surface of degree 8 over F3 ). Consider the complete intersection V of the three quadrics in P5F3 , given by q1 , q2 , and q3 , q1 := −xy + xz + xu + xv + xw − y 2 − yz − yv + yw + z 2 + zu + zw − u2 − uw + v 2 + w2 , q2 := −x2 + xy + xz − xv + xw − y 2 + yz − yu − yv + yw − zu − zw + uw − v 2 + vw , q3 := xu − yz . V is smooth and, therefore, a K3 surface. As q3 is of rank 4, V carries an elliptic fibration. There are precisely 14, 98, 794, 6 710, 59 129, 532 460, 4 784 990, 43 049 510, and 387 374 024 points over F3 , . . . , F39 . From these data, let us check whether one can prove rk Pic(VF3 ) = 2. Assume that the characteristic polynomial of the Frobenius has more than two zeroes of the form 3 times a root of unity. Then, [6, Algorithm 22] leaves us with five polynomials Ψ1 , . . . , Ψ5 , Ψi (t) = t22 − 4 t21 + 27 t18 + 81 t17 − 243 t16 + 6 561 t13 + a1 t12 + b1 t11 + c1 t10 + (−1)ji [531 441 t9 − 14 348 907 t6 + 43 046 721 t5 + 129 140 163 t4 − 13 947 137 604 t + 31 381 059 609]
for
j1 = 0,
(ai , bi , ci ) = (−59 049, 236 196, −531 441) ,
j2 = 0,
(a2 , b2 , c2 ) = (
j3 = 0,
(a3 , b3 , c3 ) = ( 19 683, −236 196, 177 147) ,
0, −118 098,
0) ,
j4 = 1,
(a4 , b4 , c4 ) = (−59 049,
0, 531 441) ,
j5 = 1,
(a5 , b5 , c5 ) = (−39 366,
0, 354 294) .
Applying the Artin-Tate formula to these polynomials, we obtain the following data.
138
A.-S. Elsenhans and J. Jahnel Table 3. Hypothetical ranks and discriminants polynomial Ψ1 Ψ2 Ψ3 Ψ4 Ψ5
field F3 F9 F3 F9 F3 F9 F3 F9 F3 F9
arithmetic Picard rank 2 4 2 2 2 2 3 4 1 2
#Br(V )|Δ| 24 1116 27 81 28 112 144 1152 2 65
Observe that an elliptic surface of Picard rank 2 automatically has a discriminant of the form (−n2 ) for n an integer. We may therefore exclude everything except for Ψ4 . Note that Ψ2 is, in addition, incompatible with the field extension condition. Thus, using the numbers of points over the fields up to F39 , we only obtain that, either the geometric Picard rank is equal to 2, or Ψ4 is the characteristic polynomial of the Frobenius in which case it is 4. Example 30 (continuation). The number of points over F310 is 34 871 648 631. This additional information reproduces Ψ1 and Ψ4 as possible characteristic polynomials of Frob. Consequently, the minus sign holds in the functional equation and the geometric Picard rank of V is equal to 4.
8
Statistics
We tested the Artin-Tate conditions on samples of K3 surfaces of degrees 2, 4, 6, and 8. The possibilities of computing are limited by the fact that point counting over large finite fields is slow. In degree 2, decoupling [6, Algorithm 17] (see also [5]) leads to a substantial speed-up. In higher degrees, one may focus on elliptic K3 surfaces and exploit the fact that point counting on the elliptic fibers is fast. The numbers and particularities of the examples treated are listed in Table 4. Table 4. Numbers of examples computed d d d d
= = = =
2 4 6 8
p=2 1000 rand 1000 rand 1000 rand 1000 rand
p=3 1000 rand 1000 ell 1000 ell 1000 ell
p=5 1000 dec
p=7 1000 dec
dec = decoupled, ell = elliptic, rand = random
The remaining parameters of the surfaces were chosen by a random number generator. We stored the equations and the numbers of points over Fp , . . . , Fp10 in a file.
On Weil Polynomials of K3 Surfaces
139
Results I. Point counting until Fp9 . First, we tried to show that the geometric Picard-rank was equal to 2 only using the numbers of rational points over Fp , . . . , Fp9 . I.e., we applied [6, Algorithm 22]. This algorithm produces a list of hypothetical Weil polynomials for each surface. If one is able to exclude all of them then, relative to the Tate conjecture, rank 2 is proven. To exclude a particular polynomial, we first checked whether the roots are of absolute value p. When a surface was known to be elliptic over Fp , we checked in addition that the predicted Picard rank over Fp was at least equal to 2. Then, we applied the Artin-Tate conditions to the polynomials. We checked the field extension condition and the rank-1 condition. For surfaces known to be elliptic over Fp , we observed the fact that arithmetic Picard rank 2 forces the discriminant to be minus a perfect square. The results are summarized in Table 5. Table 5. Distribution of the remaining hypothetical characteristic polynomials d = 2, p = 2 d = 2, p = 3 d = 2, p = 5 d = 2, p = 7 d = 4, p = 2 d = 4, p = 3 d = 6, p = 2 d = 6, p = 3 d = 8, p = 2 d = 8, p = 3
Number of polynomials without with A-T conditions without with A-T conditions without with A-T conditions without with A-T conditions without with A-T conditions without with A-T conditions without with A-T conditions without with A-T conditions without with A-T conditions without with A-T conditions
0 84 149 116 214 85 158 92 214 40 81 22 53 39 83 16 50 25 29 12 20
1 479 598 480 573 581 651 534 611 532 638 669 785 549 645 713 797 657 723 720 803
2 312 218 285 193 209 169 232 154 303 249 242 161 312 257 217 148 268 239 236 175
3 89 28 88 20 96 20 98 21 87 27 57 1 70 14 47 5 38 5 27 2
4 21 7 24 0 25 2 37 0 29 5 9 0 22 1 7 0 8 4 4 0
5 12 0 4 0 4 0 7 0 8 0 1 0 6 0 0 0 4 0 1 0
6 3 0 3 0 0 0 0 0 1 0 0 0 2 0 0 0 0 0 0 0
Results II. Point counting until Fp10 . Using data up to Fp10 , one obtains two hypothetical Weil polynomials for each of the surfaces. The two polynomials correspond to the possible signs in the functional equation (1). One has to exclude one of them. For this, we first checked the absolute values of the roots. For surfaces known to be elliptic over Fp , we then tested whether the predicted arithmetic Picard rank is at least 2. Then, we applied the Artin-Tate conditions. We checked the field extensions and the rank-1 condition. For elliptic surfaces, supposed to be of arithmetic Picard rank 2, we tested, in addition, whether the predicted discriminant was minus a square. Table 6 shows the number of surfaces with known signs. In the case that the sign is not known, we computed the numbers of points predicted over further extensions of Fp . Comparing these numbers for both hypothetical polynomials indicates whether further point counting would lead to a decision of the sign. We count how often which fields had to be considered in order to decide the sign.
140
A.-S. Elsenhans and J. Jahnel Table 6. Sign decision in the functional equation p d Known signs without A-T Known signs using A-T Remaining unknown signs Data up to Fp11 insufficient Data up to Fp12 insufficient Data up to Fp13 insufficient Data up to Fp14 insufficient Data up to Fp15 insufficient Data up to Fp16 insufficient Data up to Fp17 insufficient Data up to Fp18 insufficient Data up to Fp19 insufficient Data up to Fp20 insufficient
2 2 768 863 137 84 41 22 13 7 4 4 4 2 0
3 2 843 940 60 23 11 5 2 0 0 0 0 0 0
5 2 864 940 60 15 2 1 0 0 0 0 0 0 0
7 2 869 961 39 12 1 0 0 0 0 0 0 0 0
2 4 761 863 137 69 39 24 12 8 3 2 0 0 0
3 4 876 943 57 19 3 2 0 0 0 0 0 0 0
2 6 790 868 132 77 42 20 13 7 2 2 1 1 0
3 6 888 933 67 25 11 2 1 0 0 0 0 0 0
2 8 822 867 133 72 47 24 8 5 4 0 0 0 0
3 8 897 944 56 21 7 2 0 0 0 0 0 0 0
Using these data, we repeated our attempt to prove that the geometric Picard rank is equal to 2. More precisely, we checked whether only two roots of the characteristic polynomial are of the form p times a root of unity. The numbers of surfaces for which we succeeded are listed in Table 7. Table 7. Numbers of rank-2 cases using Fp10 -data p = 2, d = 2 p = 3, d = 2 p = 5, d = 2 p = 7, d = 2 p = 2, d = 4 p = 3, d = 4 p = 2, d = 6 p = 3, d = 6 p = 2, d = 8 p = 3, d = 8
without with A-T without with A-T without with A-T without with A-T without with A-T without with A-T without with A-T without with A-T without with A-T without with A-T
conditions conditions conditions conditions conditions conditions conditions conditions conditions conditions
rank 2 proven 271 278 397 409 353 360 460 464 132 138 79 79 145 152 74 74 65 65 23 23
rank 2 possible 330 301 460 428 425 382 511 476 197 163 114 81 183 163 101 81 93 74 47 25
Conclusion. The Artin-Tate conditions usually halve the number of cases with unknown signs. Furthermore, they double the number of cases where geometric Picard rank 2 may be proven only using data up to Fp9 . Comparing Table 5 with Table 7, we see, however, that still only about one half of the cases with Picard rank 2 may be detected when counting until Fp9 . Remark 31. Let us finally mention that the Artin-Tate conditions came to us as a big surprise. It is astonishing that the Artin-Tate formula may be incompatible with itself under field extensions. Thus, it seems not entirely unlikely that there are even more constraints and one can still do better.
On Weil Polynomials of K3 Surfaces
141
References 1. Artin, M., Swinnerton-Dyer, S.P.: The Shafarevich-Tate conjecture for pencils of elliptic curves on K3 surfaces. Invent. Math. 20, 249–266 (1973) 2. Beauville, A.: Surfaces alg´ebriques complexes, Ast´erisque 54, Soci´et´e Math´ematique de France, Paris (1978) 3. Deligne, P.: La conjecture de Weil I. Publ. Math. IHES 43, 273–307 (1974) 4. Deligne, P.: Rel`evement des surfaces K3 en caract´eristique nulle. In: Prepared for publication by Luc Illusie, Algebraic surfaces (Orsay 1976–78). LNM, vol. 868, pp. 58–79. Springer, Berlin (1981) 5. Elsenhans, A.-S., Jahnel, J.: The Asymptotics of Points of Bounded Height on Diagonal Cubic and Quartic Threefolds. In: Algorithmic Number Theory (ANTS 7), pp. 317–332. Springer, Berlin (2006) 6. Elsenhans, A.S., Jahnel, J.: K3 surfaces of Picard rank one and degree two. In: Algorithmic Number Theory (ANTS 8), pp. 212–225. Springer, Berlin (2008) 7. Elsenhans, A.S., Jahnel, J.: On the computation of the Picard group for K3 surfaces (2009) (preprint) 8. Grothendieck, A.: Le groupe de Brauer, III: Exemples et compl´ements. In: Grothendieck, A. (ed.) Dix expos´es sur la Cohomologie des sch´emas, pp. 88–188. North-Holland, Amsterdam (1968) 9. Honda, T.: Isogeny classes of abelian varieties over finite fields. J. Math. Soc. Japan 20, 83–95 (1968) 10. van Luijk, R.: K3 surfaces with Picard number one and infinitely many rational points. Algebra & Number Theory 1, 1–15 (2007) 11. Milne, J.S.: On a conjecture of Artin and Tate. Ann. of Math. 102, 517–533 (1975) ´ 12. Milne, J.S.: Duality in the flat cohomology of a surface. Ann. Sci. Ecole Norm. Sup., 4e s´erie 9, 171–201 (1976) ´ 13. Milne, J.S.: Etale Cohomology. Princeton University Press, Princeton (1980) 14. Motose, K.: On values of cyclotomic polynomials. VIII. Bull. Fac. Sci. Technol. Hirosaki Univ. 9, 15–27 (2006) 15. Nygaard, N.O.: The Tate conjecture for ordinary K3 surfaces over finite fields. Invent. Math. 74, 213–237 (1983) 16. Nygaard, N.O., Ogus, A.: Tate’s conjecture for K3 surfaces of finite height. Ann. of Math. 122, 461–507 (1985) 17. Tate, J.: Conjectures on algebraic cycles in l-adic cohomology. In: Motives, Proc. Sympos. Pure Math., vol. 55(1), pp. 71–83. Amer. Math. Soc., Providence (1994) 18. Zarhin, Y.I.: Transcendental cycles on ordinary K3 surfaces over finite fields. Duke Math. J. 72, 65–83 (1993) 19. Zarhin, Y.I.: The Brauer group of an abelian variety over a finite field. Izv. Akad. Nauk SSSR Ser. Mat. 46, 211–243 (1982) (Russian) 20. Zeilberger, D.: A combinatorial proof of Newtons’s identities. Discrete Math. 49, 319 (1984)
Class Invariants by the CRT Method Andreas Enge1 and Andrew V. Sutherland2 2
1 INRIA Bordeaux–Sud-Ouest, France Massachusetts Institute of Technology, Cambridge, MA 02139, USA
Abstract. We adapt the CRT approach for computing Hilbert class polynomials to handle a wide range of class invariants. For suitable discriminants D, this improves its performance by a large constant factor, more than 200 in the most favourable circumstances. This has enabled record-breaking constructions of elliptic curves via the CM method, including examples with |D| > 1015 .
1
Introduction
Every ordinary elliptic curve E over a finite field Fq has complex multiplication by an imaginary quadratic order O, by which we mean that the endomorphism ring End(E) is isomorphic to O. The Deuring lifting theorem implies that E ˆ is the reduction of an elliptic curve E/C that also has complex multiplication by O. Let K denote the fraction field of O. The j-invariant of Eˆ is an algebraic integer whose minimal polynomial over K is the Hilbert class polynomial HD , where D is the discriminant of O. Notably, the polynomial HD actually lies in Z[X], and its splitting field is the ring class field KO for the order O. Conversely, an elliptic curve E/Fq with complex multiplication by O exists whenever q satisfies the norm equation 4q = t2 − v 2 D, with t, v ∈ Z and t ≡ 0 modulo the characteristic of Fq . In this case HD splits completely over Fq , and its roots are precisely the j-invariants of the elliptic curves E/Fq that have complex multiplication by O. Such a curve has q + 1 ± t points, where t is determined, up to a sign, by the norm equation. With a judicious selection of D and q one may obtain a curve with prescribed order. This is known as the CM method. The main challenge for the CM method is to obtain the polynomial HD , which has degree equal to the class number h(D), and total size O(|D|1+ ). There are three approaches to computing HD , all of which, under reasonable assumptions, can achieve a running time of O(|D|1+ ). These include the complex analytic method [12], a p-adic algorithm [9, 7], and an approach based on the Chinese Remainder Theorem (CRT) [2]. The first is the most widely used, and it is quite efficient; the range of discriminants to which it may be applied is limited not by its running time, but by the space required. The polynomial HD is already likely to exceed available memory when |D| > 109 , hence one seeks to apply the CM method to alternative class polynomials that have smaller coefficients than HD . This makes computations with |D| > 1010 feasible. Recently, a modified version of the CRT approach was proposed that greatly reduces the space required for the CM method [30]. Under the Generalised Riemann Hypothesis (GRH), this algorithm is able to compute HD mod P using G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 142–156, 2010. c Springer-Verlag Berlin Heidelberg 2010
Class Invariants by the CRT Method
143
O(|D|1/2+ log P ) space and O(|D|1+ ) time. (Here and in the following, all complexity estimates refer to bit operations.) The reduced space complexity allows it to handle much larger discriminants, including examples with |D| > 1013 . An apparent limitation of the CRT approach is that it depends on some specific features of the j-function. As noted in [2], this potentially precludes it from computing class polynomials other than HD . The purpose of the present article is to show how these obstructions may be overcome, allowing us to apply the CRT method to many functions other than j, including two infinite families. Subject to suitable constraints on D, we may then compute a class polynomial with smaller coefficients than HD (by a factor of up to 72), and, in certain cases, with smaller degree (by a factor of 2). Remarkably, the actual running time with the CRT method is typically better than the size difference would suggest. Fewer CRT moduli are needed, and we may choose a subset for which the computation is substantially faster than on average. We start §2 with a brief overview of the CRT method, and then describe a new technique to improve its performance, which also turns out to be crucial for certain class invariants. After discussing families of invariants in §3, we consider CRT-based approaches applicable to the different families and give a general algorithm in §4. Computational results and performance data appear in §5.
2 2.1
Hilbert Class Polynomials via the CRT The Algorithm of Belding, Br¨ oker, Enge, Lauter and Sutherland
The basic idea of the CRT-based algorithm for Hilbert class polynomials is to compute HD modulo many small primes p, and then lift its coefficients by Chinese remaindering to integers, or to their reductions modulo a large (typically prime) integer P , via the explicit CRT [4, Thm. 3.1]. The latter approach suffices for most applications, and while it does not substantially reduce the running time (the same number of small primes is required), it can be accomplished using only O(|D|1/2+ log P ) space with the method of [30, §6]. For future reference, we summarise the algorithm to compute HD mod p for a prime p that splits completely in the ring class field KO . Let h = h(D). Algorithm 1 (Computing HD mod p) 1. Find the j-invariant j1 of an elliptic curve E/Fp with End(E) ∼ = O. 2. Enumerate the other roots j2 , . . . , jh of HD mod p. 3. Compute HD (X) mod p = (X − j1 ) · · · (X − jh ). The first step is achieved by varying j1 (systematically or randomly) over the elements of Fp until it corresponds to a suitable curve; details and many practical improvements are given in [2, 30]. The third step is a standard building block of computer algebra. Our interest lies in Step 2.
144
A. Enge and A.V. Sutherland
Enumerating the Roots of HD mod p
2.2
The key idea in [2] leading to a quasi-linear complexity is to apply the Galois action of Cl(O) Gal(KO /K). The group Cl(O) acts on the roots of HD , and when p splits completely in KO there is a corresponding action on the set EllO (Fp ) = {j1 , . . . , jh } containing the roots of HD mod p. For an ideal class [a] in Cl(O) and a j-invariant ji ∈ EllO (Fp ), let us write [a]ji for the image of ji under the Galois action of [a]. We then have EllO (Fp ) = {[a]j1 : [a] ∈ Cl(O)}. As in [30, §5], we use a polycyclic presentation defined by a sequence of ideals l1 , . . . , lm with prime norms 1 , . . . , m whose classes generate Cl(O). The relative order rk is the least positive integer for which [lrkk ] ∈ [l1 ], . . . , [lk−1 ]. We may then uniquely write [a] = [le11 ] · · · [lemm ], with 0 ≤ ek < rk . To maximise performance, we use a presentation in which 1 < · · · < m , with each k as small as possible subject to rk > 1. Note that the relative order rk divides the order nk of [lk ] in Cl(O), but for k > 1 we can (and often do) have rk < nk . For each ji ∈ EllO (Fp ) and each O-ideal l of prime norm , the j-invariant [l]ji corresponds to an -isogenous curve, which we may obtain as a root of Φ (ji , X), where Φ ∈ Z[J, J ] is the classical modularpolynomial [31, §69]. The polynomial Φ has the pair of functions j(z), j(z) as roots, and parameterises isogenies of degree . Fixing an isomorphism End(E) ∼ = O, we let π ∈ O denote the Frobenius endomorphism. When the order Z[π] is maximal at , the univariate polynomial Φ (ji , X) ∈ Fp [X] has exactly two roots [l]ji and [¯l]ji when splits in O, and a single root [l]ji if is ramified [25, Prop. 23]. To simplify matters, we assume here that Z[π] is maximal at each k , but this is not necessary, see [30, §4]. We may enumerate EllO (Fp ) = {[a]j1 : [a] ∈ [l1 ], . . . , [lm ]} via [30, Alg. 1.3]: Algorithm 2 (Enumerating EllO (Fp ) — Step 2 of Algorithm 1) 1. Let j2 be an arbitrary root of Φm (j1 , X) in Fp . 2. For i from 3 to rm , let ji be the root of Φm (ji−1 , X)/(X − ji−2 ) in Fp . 3. If m > 1, then for i from 1 to rm : Recursively enumerate the set {[a]ji : [a] ∈ [l1 ], . . . , [lm−1 ]}. In general there are two distinct choices for j2 , but either will do. Once j2 is chosen, j3 , . . . , jrm are determined. The sequence (j1 , . . . , jrm ) corresponds to a path of m -isogenies; we call this path an m -thread. The choice of j2 in Step 1 may change the order in which EllO (Fp ) is enumerated. Three of the sixteen possibilities when m = 2, r1 = 4, and r2 = 3 are shown below; we assume [l32 ] = [l1 ], and label each vertex [le2 ]j1 by the exponent e. 0 l2 1 l2 2
l1 l1 l1
3 4 5
l1 l1 l1
6 7 8
l1 l1 l1
9
0 l2
10
1 l2
11
2
¯l1 ¯l1 l1
9 10 5
¯l1 ¯l1 l1
6 7 8
¯l1 ¯l1 l1
3
0 ¯l2
4
11 ¯l2
11
10
l1 ¯l1 l1
3 8 1
l1 ¯l1 l1
6 5 4
l1 ¯l1 l1
9 2 7
Bold edges indicate where a choice was made. Regardless of these choices, Algorithm 2 correctly enumerates EllO (Fp ) in every case [30, Prop. 5].
Class Invariants by the CRT Method
2.3
145
Finding Roots with Greatest Common Divisors (gcds)
The potentially haphazard manner in which Algorithm 2 enumerates EllO (Fp ) is not a problem when computing HD , but it can complicate matters when we wish to compute other class polynomials. We could distinguish the actions of l and ¯l using an Elkies kernel polynomial [10], as suggested in [7, §5], however this slows down the algorithm significantly. An alternative approach using polynomial gcds turns out to be much more efficient, and actually speeds up Algorithm 2, making it already a useful improvement when computing HD . We need not distinguish the actions of l and ¯l at this stage, but we wish to ensure that our enumeration of EllO (Fp ) makes a consistent choice of direction each time it starts an -thread. The first -thread may be oriented arbitrarily, but for each subsequent -thread (j1 , j2 , . . . , jr ), we apply Lemma 1 below. This allows us to “square the corner” by choosing j2 as the unique common root of Φ (X, j1 ) and Φ (X, j2 ), where (j1 , . . . , jr ) is a previously computed -thread and j1 is -isogenous to j1 . The edge (j1 , j1 ) lies in an -thread that has already been computed, for some > . j1 l j1
l j 2 l
l j2
l j 3
l
· · · l jr
j1 l j1
l j 2
l j 3
l
l
l
j2
l
j3
l
· · · l jr
l
l · · · l jr
Having computed j2 , we could compute j3 , . . . , jr as before, but it is usually better to continue using gcds, as depicted above. Asymptotically, both rootfinding and gcd computations are dominated by the O(2 M(log p)) time it takes to instantiate Φ (X, ji ) mod p, but in practice is small, and we effectively gain a factor of O(log p) by using gcds when ≈ . This can substantially reduce the running time of Algorithm 2, as may be seen in Table 1 of §5. With the gcd approach described total number of root-finding m above,the m operations can be reduced from k=1 rk to k=1 rk . When m is large, this is a big improvement, but it is no help when m = 1, as necessarily occurs when h(D) is prime. However, even in this case we can apply gcds by looking for an auxiliary ideal l1 , with prime norm 1 , for which [l1 ] = [le1 ]. When r1 is large, such an l1 is easy to find, and we may choose the best combination of 1 and e available. This idea generalises to k -threads, where we seek [lk ] ∈ [l1 ] . . . , [lk ]\[l1 ] . . . , [lk−1 ]. Lemma 1. Let j1 , j2 ∈ EllO (Fp ), and let 1 , 2 = p be distinct primes with 421 22 < |D|. Then gcd Φ1 (j1 , X), Φ2 (j2 , X) has degree at most 1. Proof. It follows from [25, Prop. 23] that Φ1 (X, j1 ) and Φ2 (X, j2 ) have at most two common roots in the algebraic closure Fp , which in fact lie in EllO (Fp ). If there are exactly two, then both 1 = l1 l1 and 2 = l2 l2 split in O, and one of l21 l22 or l21¯l22 is principal with a non-rational generator. We thus have a norm equation 421 22 = a2 − b2 D with a, b ∈ Z and b = 0, and the lemma follows.
146
3
A. Enge and A.V. Sutherland
Class Invariants
Due to the large size of HD , much effort has been spent seeking smaller generators of KO . For a modular function f and O = Z[τ ], with τ in the upper half plane, we call f (τ ) a class invariant if f (τ ) ∈ KO . The class polynomial for f is HD [f ](X) = (X − [a]f (τ )) . [a]∈Cl(O)
The contemporary tool for determining class invariants is Shimura’s reciprocity law; see [28, Th. 4] for a fairly general result. Class invariants arising from many different modular functions have been described in the literature; we briefly summarise some of the most useful ones. Let η be Dedekind’s function, and let ζn = exp(2πi/n). Weber considered z+1 √ η(2z) η z2 −1 η 2 , f1 (z) = , f2 (z) = 2 , f = ζ48 η(z) η(z) η(z) √ 3 powers of which yield class invariants when D j, which 2 = −1, and also γ2 = is a class invariant whenever 3 D. The Weber functions can be generalised [15, 16, 21, 20, 23], and we have the simple and double η-quotients z z z η η N p1 η p2 with N = p1 p2 , ; wp1 ,p2 = wN (z) = z η(z) η(z) η p1 p2
where p1 and p2 are primes. Subject to constraints on D, including that no prime dividing N is inert in O, suitable yield class invariants, powers of these functions see [15, 16]. For s = 24/ gcd 24, (p1 − 1)(p2 − 1) , the canonical power wsp1 ,p2 0 is invariant under the Fricke involution W |N : z → −N z for Γ (N ), equivalently, the Atkin-Lehner involution of level N , by [17, Thm. 2]. The theory of [28] applies to any functions for Γ0 (N ), in particular to those of primelevel N invariant under the Fricke involution, which yield class invariants D = −1. Atkin developed a method to compute such functions AN , which when N are conjectured to have a pole of minimal order at the unique cusp [10, 26]. These are used in the SEA algorithm, and can be found in Magma or Pari/GP. The functions above all yield algebraic integers, so HD [f ] ∈ OK [X]. Except for weN or when gcd(N, D) = 1, in which cases additional restrictions may apply, one actually has HD [f ] ∈ Z[X], cf. [16, Cor. 3.1]. The (logarithmic) height of HD [f ] = ai X i is log max |ai |, which determines the precision needed to compute the ai . We let cD (f ) denote the ratio of the heights of HD [j] and HD [f ]. With c(f ) = lim|D|→∞ cD (f ), we have: c(γ2 ) = 3; c(f) = 72 (when D 2 = 1); c(weN ) =
24(N + 1) ; e(N − 1)
c(wsp1 ,p2 ) =
12ψ(p1 p2 ) ; s(p1 − 1)(p2 − 1)
c(AN ) =
N +1 , 2|vN |
where e divides the exponent s defined above, vN is the order of the pole of AN at the cusp, and ψ(p1 p2 ) is (p1 + 1)(p2 + 1) when p1 = p2 , and p1 (p1 + 1) when
Class Invariants by the CRT Method
147
p1 = p2 . Morain observed in [27] that c(A71 ) = 36, which is so far the best value known when D 2 = −1. We conjecture that in fact for all primes N > 11 with +1 N ≡ 11 mod 60 we have c(AN ) = 30 NN−11 , and that for N ≡ −1 mod 60 we have c(AN ) = 30. This implies that given an arbitrary discriminant D, we can always choose N so that AN yields class invariants with cD (AN ) ≥ 30 + o(1). When the prime divisors of N are all ramified in K, both wp1 ,p2 and AN yield class polynomials that are squares in Z[X], see [11, §1.6] and [18]. Taking the square root of such a class polynomial reduces both its degree and its height by a factor of 2. For a composite fundamental discriminant D (the most common case), this applies to HD [AN ] for any prime N | D. In the best case, D is divisible by 71, and we obtain a class polynomial that is 144 times smaller than HD . 3.1
Modular Polynomials
Each function f (z) considered above is related to j(z) by a modular polynomial Ψf ∈ Z[F, J] satisfying Ψf (f (z), j(z)) = 0. For primes not dividing the level N , we let Φ,f denote the minimal polynomial satisfying Φ ,f (f (z), f (z)) = 0; it is a factor of ResJ ResJ (Φ (J, J ), Ψf (F, J)), Ψf (F , J ) , and as such, an element of Z[F, F ]. Thus Φ,f generalises the classical modular polynomial Φ = Φ,j . The polynomial Φ,f has degree d(+1) in F and F , where d divides degJ Ψf , see [6, §6.8], and 2d divides degJ Ψf when f is invariant under the Fricke involution. In general, d is maximal, and d = 1 is achievable only in the relatively few cases where X0 (N ), respectively X0+ (N ), is of genus 0 and, moreover, f is a hauptmodul, that is, it generates the function field of the curve. Happily, this includes many cases of practical interest. The polynomial Ψf characterises the analytic function f in an algebraic way; when d = 1, the polynomials Φ and Φ,f algebraically characterise -isogenies between elliptic curves given by their j-invariants, or by class invariants derived from f , respectively. These are key ingredients for the CRT method.
4
CRT Algorithms for Class Invariants
To adapt Algorithm 1 to class invariants arising from a modular function f (z) other than j(z), we only need to consider Algorithm 2. Our objective is to enumerate the roots of HD [f ] mod p for suitable primes p, which we are free to choose. This may be done in one of two ways. The most direct approach computes an “f -invariant” f1 , corresponding to j1 , then enumerates f2 , . . . , fh using the modular polynomials Φ,f . Alternatively, we may enumerate j1 , . . . , jh as before, and from these derive f1 , . . . , fh . The latter approach is not as efficient, but it applies to a wider range of functions, including two infinite families. Several problems arise. First, an elliptic curve E/Fp with CM by O unambiguously defines a j-invariant j1 = j(E), but not the corresponding f1 . The f1 we seek is a root of ψf (X) = Ψf (X, j1 ) mod p, but ψf may have other roots, which may or may not be class invariants. The same problem occurs for the
148
A. Enge and A.V. Sutherland
p-adic lifting algorithm and can be solved generically [6, §6]; we describe some more efficient solutions, which are in part specific to certain types of functions. When ψf has multiple roots that are class invariants, these may be roots of distinct class polynomials. We are generally happy to compute any one of these, but it is imperative that we compute the reduction of “the same” class polynomial HD [f ] modulo each prime p. The lemma below helps to address these issues for at least two infinite families of functions: the double η-quotients wp1 ,p2 and the Atkin functions AN . 0 Lemma 2. Let f be a modular function Γ (N ), invariant under the Fricke −1for involution W |N , such that f (z) and f z have rational q-expansions. Let the imaginary quadratic order O have conductor coprime to N and contain an √ √ B 2 −D 0+ D ideal n = N, B0 +2 D . Let A0 = 04N and τ0 = −B2A , and assume that 0 gcd(A0 , N ) = 1. Then f (τ0 ) is a class invariant, and if f (τ ) is any of its conjugates under the action of Gal(KO /K) we have Ψf f (τ ), j(τ ) = 0 and Ψf f (τ ), [n]j(τ ) = 0. Proof. By definition, Ψf f (z), j(z) = 0. Applying the Fricke involution yields = Ψf f (z), j Nz . The 0 = Ψf ((W |N f )(z), (W |N j)(z)) = Ψf f (z), j −N z result, we may assume value f (τ0 ) is a class invariant by [28, Th. 4]. By the same −B+√D with gcd(A, N ) = 1 that τ is the basis quotient of an ideal a = A, 2 √ τ −B+ D and B ≡ B0 mod 2N . Then . It is the basis quotient of an = AN, N 2 τ , and replacing z above by τ completes the proof. follows that [n]j(τ ) = j N
If we arrange the roots of HD into a graph of n-isogeny cycles corresponding to the action of n, the lemma yields a dual graph defined on the roots of HD [f ], in which vertices f (τ ) correspond to edges j(τ ), [n]j(τ ) . In computational terms, f (τ ) is a root of gcd Ψf X, j(τ ) , Ψf X, [n]j(τ ) . Generically, we expect this gcd to have no other roots modulo primes p that split completely in KO . For a finite number of such primes, there may be additional roots. We have observed this for p dividing the conductor of the order generated by f (τ ) in the maximal order of KO . Such primes may either be excluded from our CRT computations, or addressed by one of the techniques described in §4.3. 4.1
Direct Enumeration
When the polynomials Φ,f have degree + 1 we can apply Algorithm 2 with essentially no modification; the only new consideration is that must not divide the level N , but we can exclude such when choosing a polycyclic presentation for Cl(O). When the degree is greater than + 1 the situation is more complex, moreover the most efficient algorithms for computing modular polynomials do not apply [8, 13], making it difficult to obtain Φ,f unless is very small. Thus in practice we do not use Φ,f in this case; instead we apply the methods of §4.3 or §4.4. For the remainder of this subsection and the next we assume that we do have polynomials Φ,f of degree + 1 with which to enumerate f1 , . . . , fh , and
Class Invariants by the CRT Method
149
consider how to determine a starting point f1 , given the j-invariant j1 = j(E) of an elliptic curve E/Fp with CM by O. When ψf (X) = Ψf (X, j1 ) mod p has only one root, our choice of f1 is immediately determined. This is usually not the case, but we may be able to ensure it by restricting our choice of p. As an example, for f = γ2 with 3 D, if we require that p ≡ 2 mod 3, then f1 is the unique cube root of j1 in Fp . If we additionally have D ≡ 1 mod 8 and p ≡ 3 mod 4, then the equation γ2 = (f24 − 16)/f8 uniquely determines the square of the Weber f function, by [8, Lem. 7.3]. To treat f itself we need an additional trick described in §4.2. The next simplest case occurs when only one of the roots of ψf is a class invariant. This necessarily happens when f is invariant under the Fricke involution and all the primes dividing N are ramified in O. In the context of Lemma 2, each root of HD [f ] then corresponds to an isolated edge j(τ ), [n]j(τ ) in the n-isogeny graph on the roots of HD , and we compute f1 as the unique root of ¯, and each f (τ ) occurs twice gcd Ψf (X, j1 ), Ψf (X, [n]j1 ) . In this situation n = n as a root of HD [f ]. By using a polycyclic presentation for Cl(O)/[n] rather than Cl(O), we enumerate each double root of HD [f ] mod p just once. Even when ψf has multiple roots that are class invariants, it may happen that they are all roots of the same class polynomial. This applies to the Atkin functions f = AN . When N is a split prime, there are two N -isogenous pairs (j1 , [n]j1 ) and ([¯ n]j1 , j1 ) in EllO (Fp ), and under Lemma 2 these correspond to roots f1 and [¯ n]f1 of ψf . Both are roots of HD [f ], and we may choose either. The situation is slightly more complicated for the double η-quotients wp1 ,p2 , with N = p1 p2 composite. If p1 = p1 ¯ p1 and p2 = p2 ¯p2 both split and p1 = p2 , then there are four distinct N -isogenies corresponding to four roots of ψf . Two of these roots are related by the action of [n] = [p1 p2 ]; they belong to the same class polynomial, which we choose as HD [f ] mod p. The other two are related p2 ] and are roots of a different class polynomial. We make an arbitrary by [p1 ¯ choice for f1 , explicitly compute [n]f1 , and then check whether it occurs among the other three roots; if not, we correct the initial choice. The techniques of §4.3 may be used to efficiently determine the action of [n]. Listed below are some of the modular functions f for which the roots of HD [f ] mod p may be directly enumerated, with sufficient constraints on D and p. In each case p splits completely in KO and D < −4N 2 has conductor u. (1) γ2 , with 3 D and p ≡ 2 mod 3; (2) f2 , with D ≡ 1 mod 8, 3 D, and p ≡ 11 mod 12; (3) wsN , for N ∈ {3, 5, 7, 13} and s = 24/ gcd(24, N − 1), with N | D and N u; (4) w25 , with 3 D, 5 | D, and 5 u; (5) AN , for N ∈ {3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 41, 47, 59, 71}, with and N u.
D N
= −1
(6) wsp1 ,p2 , for (p1 , p2 ) ∈ {(2, 3), (2, 5), (2, 7), (2, 13), (3, 5), (3, 7), (3, 13), (5, 7)} and s = 24/ gcd 24, (p1 − 1)(p2 − 1) , with pD1 , pD2 = −1 and p1 , p2 u. (7) w63,3 with D 3 = 1 and 3 u.
150
4.2
A. Enge and A.V. Sutherland
The Trace Trick
In §4.1 we were able to treat the square of the Weber f function but not f itself. To remedy this, we generalise a method suggested to us by Reinier Br¨oker. We consider the situation where there are two modular functions f and f that are roots of Ψf (X, j(z)), both of which yield class invariants for O, and we wish to apply the direct enumeration approach. We assume that p is chosen so that ψf (X) = Ψf (X, j1 ) mod p has exactly two roots, and depending on which root we take as f1 , we may compute the reduction of either HD [f ](X) or HD [f ](X) modulo p. In the case of Weber f, we have f = −f , and HD [f ] differs from HD [f ] only in the sign of every other coefficient. ai X i ; most of the time, Consider a fixed coefficient ai of HD [f ](X) = the trace t = −ah−1 = f1 + · · · + fh will do (if f = −f , we need to use ai with i ≡ h mod 2). The two roots f1 and f1 lead to two possibilities t and t modulo p. However, the elementary symmetric functions T1 = t + t and T2 = tt are unambiguous modulo p. Computing these modulo many primes p yields T1 and T2 as integers (via the CRT), from which t and t are obtained as roots of the quadratic equation X 2 − T1 X + T2 . If these are different, we arbitrarily pick one of them, which, going back, determines the set of conjugates {f1 , . . . , fh } or {f1 , . . . , fh } to take modulo each of the primes p t − t . In the unlikely event that they are the same (the suspicion t = t being confirmed after, say, looking at the second prime), we need to switch to a different coefficient ai . If f and f differ by a simple transformation (such as f = −f ), the second set of conjugates and the value t are obtained essentially for free. As a special case, when h is odd and the class invariants are units (as with Weber f), we can simply fix t = a0 = 1, and need not compute T1 = 0 and T2 = −1. The key point is that the number of primes p we use to determine t is much less than the number of primes we use to compute HD [f ]. Asymptotically, the logarithmic height of the trace is smaller than the height bound we use for HD [f ] by a factor quasi-linear in log |D|, under the GRH. In practical terms, determining t typically requires less than one tenth of the primes used to compute HD [f ], and these computations can be combined. The approach described above generalises immediately to more than two roots, but this case does not occur for the functions we examine. Unfortunately it can be used only in conjunction with the direct enumeration approach of §4.1; otherwise we would have to consistently distinguish not only between f1 and f1 , but also between fi and fi for i = 2, . . . , h. 4.3
Enumeration via the Fricke Involution
For functions f to which Lemma 2 applies, we can readily obtain the roots of HD [f ] mod p without using the polynomials Φ,f . We instead enumerate the roots of HD mod p (using the polynomials Φ ), and arrange them into a graph G of n-isogeny cycles, where n is the ideal of norm N appearing in Lemma 2. We then obtain roots of HD [f ] mod p by computing gcd Ψf (X, ji ), Ψf (X, [n]ji ) for each edge (ji , [n]ji ) in G.
Class Invariants by the CRT Method
151
The graph G is composed of h/n cycles of length n, where n is the order of [n] in Cl(O). We assume that the O-ideals of norm N are all non-principal and inequivalent (by requiring |D| > 4N 2 if needed). When every prime dividing N is ramified in O we have n = 2; as noted in §4.1, every root of HD [f ] then occurs with multiplicity 2, and we may compute the square-root of HD [f ] by taking each root just once. Otherwise we have n > 2. Let [l1 ], . . . , [lm ] be a polycyclic presentation for Cl(O) with relative orders √ r1 , . . . , rm , as in §2.2. For k from 1 to m let us fix lk = k , −Bk2+ D with Bk ≥ 0. To each vector e = (e1 , . . . , em ) with 0 ≤ ek < rk , we associate a unique root je enumerated by Algorithm 2, corresponding to the path taken from j1 to je , where ek counts steps taken along an k -thread. For o = (0, . . . , 0) we have jo = j1 , and in general je = [lσ1 1 e1 · · · lσmm em ]jo , with σk = ±1. Using the method of §2.3 to consistently orient the k -threads ensures that each σk depends only on the orientation of the first k -thread. To compute the graph G we must determine the signs σk . For those [lk ] of order 2, we let σk = 1. We additionally fix σk = 1 for the least k = k0 (if any) for which [lk ] has order greater than 2, since we need not distinguish the actions of n ¯. It suffices to show how to determine σk , given that we know σ1 , . . . , σk−1 . and n We may assume [lk0 ] and [lk ] both have order greater than 2, with k0 < k ≤ m. Let l be an auxiliary ideal of prime norm such that [l] = [ab] = [le11 · · · lekk ], with 0 ≤ ei < ri , where b = lekk , and [a] and [b] have order greater than 2. Our ˇ assumptions guarantee that such an l exists, by the Cebotarev density theorem, and under the GRH, is relatively small [1]. The fact that [a] and [b] have order ¯ is distinct from [l] and its inverse. It follows that greater than 2 ensures that [ab] σk = 1 if and only if Φ (jo , je ) = 0, where e = (e1 , . . . , ek , 0, . . . , 0). Having determined the σk , we compute the unique vector v = (v1 , . . . , vm ) for which [n] = [lσ1 1 v1 · · · lσmm vm ]. We then have [n]jo = jv , yielding the edge (jo , jv ) of G. In general, we obtain the vector corresponding to [n]je by computing e + v xk−1 and using relations [lrkk ] = [lx1 1 · · · lk−1 ] to reduce the result, cf. [30, §5]. This method may be used with any function f satisfying Lemma 2, and in particular it applies to two infinite families of functions: D = −1 and N u. (8) AN , for N > 2 prime, with N s (9) wp1 ,p2 , for p1 , p2 primes not both 2, with pD1 , pD2 = −1 and p1 , p2 u. As above, u denotes the conductor of D < −4N 2 . As noted earlier, for certain primes p we may have difficulty computing the edges of G when gcd Ψf (X, ji ), Ψf (X, [n]ji ) has more than one root in Fp . While we need not use such primes, it is often easy to determine the correct root. Here we give two heuristic techniques for doing so. The first applies when N is prime, as with the Atkin functions. In this case problems can arise when HD [f ] has repeated roots modulo p. By Kummer’s criterion, this can happen only when p divides the discriminant of HD [f ], and even then, a repeated root x1 is only actually a problem when it corresponds to two alternating edges in G, say (j1 , j2 ) and (j3 , j4 ), with the edge (j2 , j3 ) between them.
152
A. Enge and A.V. Sutherland
In this scenario we will get two roots x1 and x2 of gcd Ψf (X, j2 ), Ψf (X, j3 ) . But if we already know that x1 corresponds to (j1 , j2 ), we can unambiguously choose x2 . In each of the N -isogeny cycles of G, it is enough to find a single edge that yields a unique root. If no such edge exists, then every edge must yield the same two roots x1 and x2 , and we count each with multiplicity n/2. The second technique applies when the roots of HD [f ] are units, as with the double η-quotients [16, Thm. 3.3]. The product of the roots is then ±1. Assuming that the number of edges in G for which multiple roots arise is small (it is usually zero, and rarely more than one or two), we simply test all the possible choices of roots and see which yield ±1. If only one combination works, then the correct choices are determined. This is not guaranteed to happen, but in practice it almost always does. 4.4
A General Algorithm
We now briefly consider the case of an arbitrary modular function f of level N , and sketch a general algorithm to compute HD [f ] with the CRT method. Let us assume that f (τ ) is a class invariant, and let D be the discriminant and u the conductor of the order O = [1, τ ]. The roots of Ψf (X, j(τ )) ∈ KO [X] lie in the ray class field of conductor uN over K, and some number n of these, including f (τ ), actually lie in the ring class field KO . We may determine n using the method described in [6, §6.4], which computes the action of (O/N O)∗ /O∗ on the roots of Ψf (X, j(τ )). We note that the complexity of this task is essentially fixed as a function of |D|. Having determined n, we use Algorithm 2 to enumerate the roots j1 , . . . , jh of HD mod p as usual, but if for any ji we find that Ψf (X, ji ) mod p does not have (1) (n) exactly n roots fi , . . . , fi , we exclude the prime p from our computations. The number of such p is finite and may be bounded in terms of the discriminants of the polynomials Ψf (X, α) as α ranges over the roots of HD [f ]. We then h n (r) compute the polynomial H(X) = i=1 r=1 X − fi of degree nh in Fp [X]. After doing this for sufficiently many primes p, we can lift the coefficients by Chinese remaindering to the integers. The resulting H is a product of n distinct class polynomials, all of which may be obtained by factoring H in Z[X]. Under suitable heuristic assumptions (including the GRH), the total time to compute HD [f ] is quasi-linear in |D|, including the time to factor H. This approach is practically efficient only when n is small, but then it can be quite useful. A notable example is the modular function g for which Ψg (X, J) = (X 12 − 6X 6 − 27)3 − JX 18 . This function was originally proposed by Atkin, and is closely related to certain class invariants of Ramanujan [3, Thm. 4.1]. The function g yields class invariants when D ≡ 13 mod 24. In terms of our generic algorithm, we have n = 2, and for p ≡ 2 mod 3 we get exactly two roots of Ψg (X, ji ) mod p, which differ only in sign. Thus H(X) = HD [g 2 ](X 2 ) = HD [g](X)HD [g](−X), and from this we easily obtain HD [g 2 ], and also HD [g] if desired.
Class Invariants by the CRT Method
5
153
Computational Results
This section provides performance data for the techniques developed above. We used AMD Phenom II 945 CPUs clocked at 3.0 GHz for our tests; the software was implemented using the gmp [22] and zn poly [24] libraries, and compiled with gcc [19]. To compute the class polynomial HD [f ], we require a bound on the size of its coefficients. Unfortunately, provably accurate bounds for functions f other than j are generally unavailable. As a heuristic, we take the bound B on the coefficients of HD given by [30, Lem. 8], divide log2 B by the asymptotic height factor c(f ), and add a “safety margin” of 256 bits. We note that with the CM method, the correctness of the final result can be efficiently and unconditionally confirmed [5], so we are generally happy to work with a heuristic bound. 5.1
Class Polynomial Computations Using the CRT Method
Our first set of tests measures the improvement relative to previous computations with the CRT method. We used discriminants related to the construction of a large set of pairing-friendly elliptic curves, see [30, §8] for details. We reconstructed many of these curves, first using the Hilbert class polynomial HD , and then using an alternative class polynomial HD [f ]. In each case we used the explicit CRT to compute HD or HD [f ] modulo a large prime q (170 to 256 bits). Table 1 gives results for four discriminants with |D| ≈ 1010 , three of which appear in [30, Table 2]. Each column lists times for three class polynomial computations. First, we give the total time Ttot to compute HD mod q, including the time Tenum spent enumerating EllD (Fp ), for all the small primes p, using Algorithm 2 as it appears in §2.2. We then list the times Tenum and Ttot obtained when Algorithm 2 is modified to use gcd computations whenever it is advantageous to do so, as explained in §2.3. The gcd approach typically speeds up Algorithm 2 by a factor of 2 or more. For the third computation we selected a function f that yields class invariants for D, and computed HD [f ] mod q. This polynomial can be used in place of HD in the CM method (one extracts a root x0 of HD [f ] mod q, and then extracts a root of Ψf (x0 , J) mod q). For each function f we give a “size factor”, which approximates the ratio of the total size of HD to HD [f ] (over Z). In the first three examples this is just the height factor c(f ), but in Example 4 it is 4c(f ) because the prime 59 is ramified and we actually work with the square root of HD [A59 ], as noted in §4.1, reducing both the height and degree by a factor of 2. /Ttot [f ] attributable to computing HD [f ] rather We then list the speedup Ttot than HD . Remarkably, in each case this speedup is about twice what one would expect from the height factor. This is explained by a particular feature of the CRT method: The cost of computing HD mod p for small primes p varies significantly, and, as explained in [30, §3], one can accelerate the CRT method with a careful choice of primes. When fewer small primes are needed, we choose those for which Step 1 of Algorithm 1 can be performed most quickly. [f ] achieved. The last line in Table 1 lists the total speedup Ttot /Ttot
154
A. Enge and A.V. Sutherland Table 1. Example class polynomial computations (times in CPU seconds) Example 1
Example 2
Example 3
Example 4
|D| h(D) log2 B r (r11 , . . . , kk )
13569850003 20203 2272564 (720203 )
11039933587 11280 1359134 (171128 , 1910 )
12901800539 54706 5469776 (327038 , 52 )
12042704347 9788 1207412 (292447 , 312 , 432 )
Tenum (roots) Ttot
6440 19900
10200 23700
10800 52200
21700 42400
Tenum (gcds) Ttot
2510 15900
2140 15500
3440 44700
4780 25300
A71 36 213
A47 24 305
A71 36 629
A59 120* 191
75 93
51 78
71 83
132 222
Function f Size factor [f ] Ttot /Ttot [f ]) Speedup (Ttot [f ]) Speedup (Ttot /Ttot
5.2
Comparison to the Complex Analytic Method
Our second set of tests compares the CRT approach to the complex analytic method. For each of the five discriminants listed in Table 2 we computed class polynomials HD [f ] for the double η-quotient w3,13 and the Weber f function, using both the CRT approach described here, and the implementation [14] of the complex analytic method as described in [12]. With the CRT we computed HD [f ] both over Z and modulo a 256-bit prime q; for the complex analytic method these times are essentially the same. Table 2. CRT vs. complex analytic (times in CPU seconds) complex analytic
CRT mod q
CRT
|D|
h(D)
w3,13
f
w3,13
f
w3,13
f
6961631 23512271 98016239 357116231 2093236031
5000 10000 20000 40000 100000
15 106 819 6210 91000
5.4 33 262 1900 27900
2.2 10 52 248 2200
1.0 4.1 22 101 870
2.1 9.8 47 213 1800
1.0 4.0 22 94 770
We also tested a “worst case” scenario for the CRT approach: the discriminant D = −85702502803, for which the smallest non-inert prime is 1 = 109. Choosing the function most suitable to each method, the complex analytic method computes HD [w109,127 ] in 8310 seconds, while the CRT method computes HD [A131 ]
Class Invariants by the CRT Method
155
in 7150 seconds. The CRT approach benefits from the attractive height factor of the Atkin functions, c(A131 ) = 33 versus c(w109,127 ) ≈ 12.4, and the use of gcds in Algorithm 2. Without these improvements, the time to compute HD with the CRT method is 1460000 seconds. The techniques presented here yield more than a 200-fold speedup in this example. 5.3
A Record-Breaking CM Construction
To test the scalability of the CRT approach, we constructed an elliptic curve using |D| = 1000000013079299 > 1015 , with h(D) = 10034174 > 107 . This yielded a curve y 2 = x3 − 3x + c of prime order n over the prime field Fq , where c = 12229445650235697471539531853482081746072487194452039355467804333684298579047; q = 28948022309329048855892746252171981646113288548904805961094058424256743169033; n = 28948022309329048855892746252171981646453570915825744424557433031688511408013.
This curve was obtained by computing the square root of HD [A71 ] modulo q, a polynomial of degree h(D)/2 = 5017087. The height bound of 21533832 bits was achieved with 438709 small primes p, the largest of which was 53 bits in size. The class polynomial computation took slightly less than a week using 32 cores, approximately 200 days of CPU time. Extracting a root over Fq took 25 hours of CPU time using NTL [29]. We estimate that the size of HD [A71 ] is over 13 terabytes, and that the size of the Hilbert class polynomial HD is nearly 2 petabytes. The size of HD [A71 ] mod q, however, is under 200 megabytes, and less than 800 megabytes of memory (per core) were needed to compute it.
References [1] Bach, E.: Explicit bounds for primality testing and related problems. Mathematics of Computation 55(191), 355–380 (1990) [2] Belding, J., Br¨ oker, R., Enge, A., Lauter, K.: Computing Hilbert class polynomials. In: van der Poorten, A.J., Stein, A. (eds.) ANTS-VIII 2008. LNCS, vol. 5011, pp. 282–295. Springer, Heidelberg (2008) [3] Berndt, B.C., Chan, H.H.: Ramanujan and the modular j-invariant. Canadian Mathematical Bulletin 42(4), 427–440 (1999) [4] Bernstein, D.J.: Modular exponentiation via the explicit Chinese Remainder Theorem. Mathematics of Computation 76, 443–454 (2007) [5] Bisson, G., Sutherland, A.V.: Computing the endomorphism ring of an ordinary elliptic curve over a finite field. Journal of Number Theory (2009) (to appear), http://arxiv.org/abs/0902.4670 [6] Br¨ oker, R.: Constructing elliptic curves of prescribed order. Universiteit Leiden, Proefschrift (2006) [7] Br¨ oker, R.: A p-adic algorithm to compute the Hilbert class polynomial. Mathematics of Computation 77, 2417–2435 (2008) [8] Br¨ oker, R., Lauter, K., Sutherland, A.V.: Modular polynomials via isogeny volcanoes (2009) (preprint), http://arxiv.org/abs/1001.0402
156
A. Enge and A.V. Sutherland
[9] Couveignes, J.-M., Henocq, T.: Action of modular correspondences around CM points. In: Fieker, C., Kohel, D.R. (eds.) ANTS 2002. LNCS, vol. 2369, pp. 234– 243. Springer, Heidelberg (2002) [10] Elkies, N.D.: Elliptic and modular curves over finite fields and related computational issues. In: Buell, D.A., Teitelbaum, J.T. (eds.) Computational Perspectives on Number Theory, pp. 21–76. AMS, Providence (1998) [11] Enge, A.: Courbes alg´ebriques et cryptologie. In: Habilitation ` a diriger des recherches, vol. 7. Universit´e Denis Diderot, Paris (2007) [12] Enge, A.: The complexity of class polynomial computation via floating point approximations. Mathematics of Computation 78(266), 1089–1107 (2009) [13] Enge, A.: Computing modular polynomials in quasi-linear time. Mathematics of Computation 78(267), 1809–1824 (2009) [14] Enge, A.: cm, 0.2 edition (2010), http://cm.multiprecision.org/ [15] Enge, A., Morain, F.: Generalised Weber functions. I. Technical Report 385608, HAL-INRIA (2009), http://hal.inria.fr/inria-00385608 [16] Enge, A., Schertz, R.: Constructing elliptic curves over finite fields using double eta-quotients. Journal de Th´eorie des Nombres de Bordeaux 16, 555–568 (2004) [17] Enge, A., Schertz, R.: Modular curves of composite level. Acta Arithmetica 118(2), 129–141 (2005) [18] Enge, A., Schertz, R.: Singular values of multiple eta-quotients for ramified primes (in preparation 2010) [19] Free Software Foundation. GNU Compiler Collection, 4.2.4 edition (2008), http://gcc.gnu.org/ [20] Gee, A.: Class fields by Shimura reciprocity. Universiteit Leiden, Proefschrift (2001) [21] Gee, A., Stevenhagen, P.: Generating class fields using Shimura reciprocity. In: Buhler, J.P. (ed.) ANTS 1998. LNCS, vol. 1423, pp. 441–453. Springer, Heidelberg (1998) [22] Granlund, T., et al.: gmp, 4.3.1 edition (2009). http://gmplib.org/. [23] Hajir, F., Villegas, F.R.: Explicit elliptic units, I. Duke Mathematical Journal 90(3), 495–521 (1997) [24] Harvey, D.: zn poly: a library for polynomial arithmetic, 0.9 edn. (2008), http://cims.nyu.edu/~ harvey/zn_poly [25] Kohel, D.: Endomorphism rings of elliptic curves over finite fields. PhD thesis, University of California at Berkeley (1996) [26] Morain, F.: Calcul du nombre de points sur une courbe elliptique dans un corps fini: aspects algorithmiques. Journal de Th´eorie des Nombres de Bordeaux 7(1), 111–138 (1995) [27] Morain, F.: Advances in the CM method for elliptic curves. In: Slides of Fields Cryptography Retrospective Meeting, May 11-15 (2009), http://www.lix.polytechnique.fr/~ morain/Exposes/fields09.pdf [28] Schertz, R.: Weber’s class invariants revisited. Journal de Th´eorie des Nombres de Bordeaux 14(1), 325–343 (2002) [29] Shoup, V.: NTL: A library for doing number theory, 5.5 edn. (2008), http://www.shoup.net/ntl/ [30] Sutherland, A.V.: Computing Hilbert class polynomials with the Chinese Remainder Theorem. Mathematics of Computation (to appear 2010), http://arxiv.org/abs/0903.2785 [31] Weber, H.: Lehrbuch der Algebra, 3rd edn., vol. III. Chelsea, New York (1961)
Short Bases of Lattices over Number Fields Claus Fieker1 and Damien Stehl´e1,2 1
Magma Computer Algebra Group, School of Mathematics and Statistics, University of Sydney, NSW 2006, Australia 2 CNRS and Macquarie University
[email protected],
[email protected]
Abstract. Lattices over number fields arise from a variety of sources in algorithmic algebra and more recently cryptography. Similar to the classical case of Z-lattices, the choice of a nice, “short” (pseudo)-basis is important in many applications. In this article, we provide the first algorithm that computes such a “short” (pseudo)-basis. We utilize the LLL algorithm for Z-lattices together with the Bosma-Pohst-Cohen Hermite Normal Form and some size reduction technique to find a pseudo-basis where each basis vector belongs to the lattice and the product of the norms of the basis vectors is bounded by the lattice determinant, up to a multiplicative factor that is a field invariant. As it runs in polynomial time, this provides an effective variant of Minkowski’s second theorem for lattices over number fields.
1
Introduction
Let K be a number field and OK be its maximal order. An OK -module M is a finitely generated set of elements which is closed under addition and multiplication by elements in OK . Frequently, we have M ⊆ K m for some m. In the case of K being Q, we have OK = Z, thus OK -modules are just the classical Z-lattices. Since Z is a principal ideal domain, every (torsion free) module is free, thus there exists a basis b1 , . . . , bn ∈ M for some n ≤ m such that M = ⊕i≤n Zbi . Any two bases (bi )i and (ci )i have the same cardinality and are linked by some unimodular matrix T ∈ GL(n, Z). The choice of a good basis is crucial for almost all computational problems attached to M . Generally one tries to find a basis whose vectors have short Euclidean norms, using, for example, the LLL algorithm [15]. Replacing Z by the maximal order OK makes the classification more complicated since OK may no longer be a principal ideal domain. However, since OK is still a Dedekind domain, the modules M ⊆ K m have a well known structure ([7, Cor. 1.2.25], [23, Th. 81:3]): there exist linearly independent elements b1 , . . . , bn ∈ K m and (non-zero fractional) ideals b1 , . . . , bn such that M = ⊕i≤n bi bi , i.e., every b ∈ M has a unique representation as b = i≤n xi bi with xi ∈ bi for all i ≤ n. Such a representation is commonly called a pseudo-basis. It should be noted that bi may not belong to M , and in fact bi ∈ M if and only if 1 ∈ bi . Similarly to the case of Z-lattices, different pseudo-bases share the same cardinality, and it is known how to move from a pseudo-basis to another. G. Hanrot, F. Morain, and E. Thom´ e (Eds.): ANTS-IX 2010, LNCS 6197, pp. 157–173, 2010. c Springer-Verlag Berlin Heidelberg 2010
158
C. Fieker and D. Stehl´e
As for Z-lattices, the choice of the pseudo-basis is of utmost importance. However, a key difference is that no analogue of LLL is known, as repeatedly noted in [7]. There have been attempts [10,22,11] but the algorithms are either limited to certain fields or give no guaranteed bounds on the output size. While every OK -module is also a Z-lattice and can thus be analyzed with all the tools available over Z, for many applications the additional structure as an OK -module is important. This structure is typically lost when applying techniques over Z. Originally, OK -modules mainly came from the study of finite extensions of K but now they occur in a wider range of problems from group theory (matrix groups and representations [9]) to applications in geometry (automorphism algebras of Abelian varieties). OK -modules also occur in lattice-based cryptography [17,19,24,25,26], and in that context the module rank n is usually polylogarithmic in the degree of the number field. Cryptography based on OK modules is increasingly popular, as on one side they lead to compact representations and to fast operations, and on the other side they enjoy a worst-case to average-case reduction for variants of the shortest vector problem, which allows the cryptographic security to be based on worst-case hardness assumptions. As diverse as the applications are the requirements: only one (or more) short module element(s) may be needed, or a short (pseudo)-basis may be required, some applications rely on canonical representations, while any representation may suffice for others. We note that canonical representations tend to have components that are much larger than short representations as obtained by lattice reduction or our techniques. To find one short element it suffices to consider the underlying Z-module (of dimension nd with d = [K : Q]). For Z-lattices contained in Qm , a canonical representation is the Hermite Normal Form (HNF). It has been generalized (BPC-HNF) to OK -modules contained in K m by Bosma and Pohst [4] and Cohen [7, Chap. 1.4] (see also [12]). Our results. In the present work, we describe an algorithm that computes a pseudo-basis made of short vectors. Given an arbitrary pseudo-basis [(ai )i , (ai )i ] of a module M ⊆ K m , it returns a pseudo-basis [(bi )i , (bi )i ] such that: 2
∀i ≤ n : bi ∈ M, N (bi ) ∈ [2−O(d ) , 1] and bi ≤ 2O(dn) λi (M ), where the O(·)’s depend only on the field K and the choice of a given LLLreduced integral basis, the euclidean norm · is a module extension of the T2 -norm over K, and the λi (M )’s correspond to the module minima. We refer to Corollary 1 for a precise statement. Overall, this provides a module equivalent to LLL-reduced bases of Z-lattices in the sense that the vectors cannot be arbitrarily longer than the minima. Since it runs in polynomial time, it can also be interpreted as an effective approximate variant of the adaptation to OK -modules of Minkowski’s second theorem (given in Theorem 2). We also study the representation of one-dimensional OK -modules, i.e., modules that are isomorphic to ideals of OK . We show how to modify Belabas’ 2-element representation algorithm [2, Alg. 6.15] so that the output is provably small. Combining the latter and our module pseudo-reduction algorithm leads to compact representations of OK -modules.
Short Bases of Lattices over Number Fields
159
The most natural approach to obtain reduced pseudo-bases consists in trying to generalize LLL, but as mentioned earlier all previous attempts have only partially succeeded. In contrast, we start by viewing the OK -module as a highdimensional Z-lattice. We find short module elements by applying LLL to a basis of the latter lattice and interpreting the output as module elements. At this point, we have a pseudo-basis (the input) and a full-rank set of short module vectors (produced by LLL). If we had a Z-lattice instead of an OK -module, we would then use a technique common in the lattice-based cryptography community (see, e.g., [20, Le. 7.1]), consisting in using the HNF to convert a full rank set of short lattice vectors to a short basis. We adapt this technique to number fields, using the BPC-HNF and introducing a size-reduction algorithm for pseudo-bases. Let us compare (pseudo-)LLL-reduced and BPC-HNF pseudo-bases. A theoretical advantage of the LLL approach is that it is not restricted to K m but also works in a continuous extension (similarly to LLL-reduction being welldefined for real lattices). It should also be significantly more efficient to work with pseudo-bases made of short vectors because smaller integers and polynomials of smaller degrees are involved. On the other side, (pseudo-)LLL-reduced pseudo-bases are far from being unique, and seem more expensive to obtain. Road-map. In Section 2, we give some reminders and elementary results on lattices, number fields and modules. In Section 3, we modify Belabas’ 2-element representation algorithm for ideals of OK , as described above. We then give our module reduction algorithm in Section 4. Finally, in Section 5 we describe our implementation and give some examples. Implementation. The algorithms have been implemented in the Magma computer algebra system [3,18] and are available on request. They will be part of upcoming releases.
2
Preliminaries
We assume the reader is familiar with the geometry of numbers and algebraic number theory. We refer to [16,20], [5,21] and [7, Chap. 1] for introductions to the computational aspects of lattices, elementary algebraic number theory and to modules over Dedekind domains, respectively. 2.1
Lattices
In this work, we will call any finitely generated free Z-module L a lattice. A usual lattice corresponds to the case where L is a discrete additive subgroup of Rn for some n. Any lattice can be written L = ⊕i≤d Zbi . If the bi ’s are Z-free, they are called a basis of L. A given lattice may have infinitely many bases but their cardinality d is constant and called rank. Any two bases are related by a unimodular transformation, i.e., one is obtained from the other by multiplying by a matrix in Zd×d of determinant ±1. If L ⊆ Qn is of rank d, then there exists a basis B = (bi )i ∈ Qn×d of L such that μj = min{i : Bi,j = 0} (strictly) increases with j, and for all j > k we
160
C. Fieker and D. Stehl´e
have Bμj ,j > Bμj ,k ≥ 0. If d = n, this means that B is a row-wise diagonally strictly dominant lower triangular matrix and that its entries are non-negative. This basis is unique and called the Hermite Normal Form (HNF) of L. It can be computed in polynomial time from any basis [13]. In order to quantify the smallness of an element of a lattice L, we associate to L map a basis (bi )i a positive definite bilinear form q : LR × LR → R. We use it to to its Gram matrix Gq (b1 , . . . , bd ) := (q(bi , bj ))i,j . We denote q(b, b) by bq , and may omit the subscript if it is clear from the context. The determinant of L, defined as detq (L) = det(Gq (b1 , . . . , bd ))1/2 , does not depend on the particular choice of the basis of L. Note that if L ⊆ Rn and q is the euclidean inner product, then det(L) is the d-dimensional volume of the parallelepiped { i yi bi : yi ∈ [0, 1]}. We define the lattice minima as follows: ∀i ≤ d, λi,q (L) = min{r : ∃c1 , . . . , ci ∈ L free, maxk≤i ck q ≤ r}. √ d Minkowski’s second theorem states that i≤d λi,q (L) ≤ d detq (L). Frequently one tries to represent a lattice L by a basis that approximates the minima. In this article, we assume that we have an algorithm LatRed that takes as input an arbitrary basis of L and returns a reduced basis satisfying bi ≤ γλi (L), for all i ≤ d. For example, if we use the LLL algorithm [15], then we can take γ = 2d/2 . We proceed as follows: compute the Gram matrix G of the input basis; use the Gram matrix LLL algorithm (see, e.g., [5, p. 88]), to find U unimodular such that U t GU is reduced; apply U to the input lattice basis. If the arithmetic over L is efficient, and if q can be efficiently computed or approximated with high accuracy, then this provides an efficient algorithm. Apart from being well-defined for more general lattices (not only for lattices on a rational vector space), a significant advantage of the LLL-reduction over the HNF is that it provides small lattice elements. However, it seems more expensive to obtain and the uniqueness of the representation is lost. Taking√ the HKZ-reduction instead of the LLLreduction allows one to take γ = 1/2 d + 3 (see [14]), but the complexity of the best algorithm for computing it [1] is exponential in d. ∗ ∗ ∗ Let (bi )i≤d be a lattice j, we define μi,j = q(b i , bj )/q(bj , bj ), basis. For any i > ∗ ∗ where bi = argminbi + j
Short Bases of Lattices over Number Fields
161
this technique to modules, we describe it briefly. Since the si ’s belong to the lattice, there exists T ∈ Zd×d such that (si )i = (ai )i · T . We compute the HNF T t of T t : T t = T t (U −1 )t with U unimodular. We thus have (si )i = (bi )i · T where (bi )i := (ai )i · U is a lattice basis and T is upper triangular with diagonal entries ≥ 1. The shape of T implies that for any i we have b∗i √≤ s∗i . Sizereducing the basis (bi )i leads to a basis (bi )i such that max bi ≤ d max s∗i ≤ √ d max si . It can be checked that if L ⊆ Qn , then all the computations may be performed in polynomial time. 2.2
Number Fields
Let K be a number field of degree d, with real and complex embeddings (θi )i≤s1 , (θi )s1
162
C. Fieker and D. Stehl´e
once and for all, it may prove interesting to strongly reduce it. We have the following result. Lemma √ d √ 1. If (ri )i is a LatRed-reduced integral basis of K, then max ri ≤ dγ ΔK . Proof. Using the reducedness and Minkowski’s second theorem, we get ri 2 ≤ 2d d 2/d γ d ΔK . The arithmetic-geometric inequality gives 1 ≤ N (ri ) ≤ ri 2 /d for all i, which provides the result. The bounds of our main results involve the quantity max ri . Lemma 1 allows one to express them with field invariants only. We choose to keep max ri in our bounds since it can be much smaller, as in the case of cyclotomic number fields. With our a choice of integral basis, any element of OK with small T2 -norm can be represented with a small number of bits. Lemma 2. Assume that (ri )i is a LatRed-reduced integral basis of K. If x = xi ri ∈ K, then max |xi | ≤ 23d/2 x. Proof. We show by induction of i that ∀i : |xi | ≤ 2d−i
x . minj rj∗
First, we have x ≥ |xd |rd∗ . Suppose now that i < d and that the result holds ∗ that x ≥ |x + for any j > i. The GSO of the ri ’s shows i j>i μj,i xj |ri . ∗ Therefore, we have |xi | ≤ x/ri + j>i |xj |, which gives the bound. To complete the proof, note that the reducedness of the ri ’s gives minj rj∗ ≥ √ 2−d/2 minj rj , and that rj ≥ d for all j. 2.3
OK -Modules
Let b1 , . . . , bn ∈ KRm with n = rankK (bi )i , and b1 , . . . , bn be fractional ideals of OK . The OK -module M [(bi )i , (bi )i ] spanned by the pseudo-basis [(bi )i , (bi )i ] is bi bi . The bi ’s are called the coefficient ideals. As each bi is a Z-lattice, so (j) (j) is M . More precisely, if bi = j≤d Zβi , then M = i,j Zβi bi . Two pseudobases [(bi )i , (bi )i ] and [(ci )i , (ci )i ] represent the same OK -module M if and only if there exists a non-singular U ∈ K n×n with ([23, §81 C]): 1. (c1 , . . . , cn ) = (b1 , . . . , bn )U ; 2. For all i, j, we have Ui,j ∈ bi c−1 j ; −1 . 3. For all i, j, we have Ui,j ∈ ci b−1 j , where U = U Cohen [6] generalized the HNF to modules in K m . The algorithm of [4] may also be interpreted as such a generalization. We refer to [12, Chap. 4] for a detailed exposure and comparison.
Short Bases of Lattices over Number Fields
163
Theorem 1. Let M ⊆ K m be an OK -module of rank n. There exists a pseudobasis [(bi )i , (bi )i ] of M such that μj = min{i : Bi,j = 0} (strictly) increases with j, for all j we have Bμj ,j = 1 and for all j > k the entry Bμj ,k ∈ K is size-reduced modulo the HNF of bj b−1 k . This unique pseudo-basis is called the HNF of M . It can be computed in polynomial time from any pseudo-basis of M . Similarly to the HNF for lattices, the above HNF can only handle OK -modules M ⊆ K m (as opposed to KRm ) and does not necessarily contain small elements of M . We now define the concept of small-ness for elements of KRm . For any = (b1 , . . . , bm )t ∈ KRm , we define T2⊗m (b, b ) = two vectors b = (b1 , . . . , bm )t , b T2⊗m (b, b) by b. Notice that for any (r, b) ∈ i≤m T2 (bi , bi ), and we denote KR × KRm , we have rb ≤ r · b. With this definition at hand, we can define the minima of M : ∀i ≤ n, λi (M ) = min{r : ∃c1 , . . . , ci ∈ M, rankK (ck )k = i and max ck ≤ r}. Let [(bi )i , (bi )i ] be a pseudo-basis of an OK -module M ⊆ KRm . Assume that bi = (j) j≤d Zβi . We define det(M ) as the square root of the determinant of the nd×nd (j )
symmetric positive definite matrix T2⊗m (βi bi , βi bi )i,j;i ,j . This is a module invariant. When M is a non-zero fractional ideal of OK , this matches detT2 (M ). It should be noted that det(M ) is not immediately related to the (Steinitz) class of M nor to the maximal exterior power of M . The following is a direct consequence of Minkowski’s second theorem over Z-lattices. Theorem 2. Let M ⊆ KRm be an OK -module of rank n. Then i≤n λi (M ) ≤ √ n dn det(M )1/d . (j)
Proof. The module M can be seen as a lattice L of dimension nd, with det(M ) = √ dn det(L). Minkowski’s second theorem asserts that i≤nd λi (L) ≤ dn det(L). Let c1 , . . . , cnd ∈ M be free over the integers such that ci = λi (L) holds for all i. For all i ≤ n, let φ(i) = min(j : rankK (c1 , . . . , cj ) = i). As OK has rank d as a Z-module, we have φ(i) ≤ (i − 1)d + 1. We conclude with the following sequence of inequalities: √ n 1 1 λi (M ) ≤ cφ(i) ≤ λ(i−1)d+1 (L) ≤ λi (L) d ≤ dn det(M ) d . i≤n
i≤n
i≤n
i≤dn
We now extend the concept of GSO. Let [(bi ) i , (bi )i ] be a pseudo-basis of an OK -module M . We define b∗i = argminbi + j
3
Small 2-Element Representation of an Ideal
We start our study of OK -modules by the one-dimensional case, i.e., fractional ideals of K. There are several ways of representing an ideal I = 0. A natural approach is to provide a basis (bi )i≤d ∈ K d , or the coordinates matrix
164
C. Fieker and D. Stehl´e
of a basis with respect to an integral basis (ri )i of K. This coordinates matrix belongs to Qd×d, and it may prove interesting to find the basis of kI such that the coordinates matrix is in HNF, for the smallest non-zero integer k such that kI is integral. This representation requires a space of O(d log N (kI)+log k+ d2 ) = O(d log N (I) + d2 + d2 log k) bits. Alternatively, one may use the so-called two-element representation: any ideal I may be written I = (x1 ) + (x2 ) for some x1 , x2 ∈ I. A classical way to obtain such a representation consists in taking an arbitrary x1 ∈ I and then choosing x2 uniformly in I modulo (x1 ) (the latterbeing a full-rank sublattice of the former). This succeeds with probability ≥ (1 − 1/N (p)), where the product is taken over the prime ideals p that divide (x1 )/I (see [2, Le. 6.14]). If N (x1 )/N (I) is small and if there do not exist too many prime ideals of small norm, then the success probability is large. Belabas [2, Alg. 6.15] proposed a probabilistic polynomial time variant, which always succeeds with high probability. However, the obtained representation of I may still be of bit-size Ω(d log N (I) + d + d2 log k). We modify Belabas’ algorithm to provide a 2-element representation made of small elements: I = (x1 ) + (x2 ) with both x1 and x2 small. For instance, the first element x1 is chosen to be the first element of a LatRed-reduced basis of I. This may be seen as a rigorous variant of [7, Alg. 1.3.15], in which smallness was provided but the success probability could be small. Although our analysis is close to Belabas’, we give a full proof, as there are quite a few small differences. Theorem 3. Let (ri )i be an integral basis of a number field K. There exists a probabilistic polynomial time algorithm that takes as inputs a Z-basis of a non-zero fractional ideal I of OK and a success parameter t (in unary), and returns x1 , x2 ∈ I such that I = (x1 ) + (x2 ) holds with probability 1 − 2−t , and: 4
4
d max ri 4 · N (I) d , x1 , x2 ≤ 4γ 8 ΔK
(1)
where · corresponds to the T2 norm and γ is the LatRed approximation constant. As a consequence, the ideal I may be represented on 5 log2 N (I) + O(log ΔK + d(d + log k + log max ri )) bits, where k is the smallest non-zero integer such that kI is integral and the ri ’s are assumed LatRed-reduced. 4
d Let us comment on (1). The quantity 4γ 8 ΔK is an invariant of the field, and 4 max ri is independent from I (and can be bounded using Lemma 1). The 4 only term that is not an invariant is N (I) d . If x1 and x2 were basis vectors of 1 4 a reduced basis of I, we would expect N (I) d instead of N (I) d (see (2) below). We do not know how to reach this bound for x2 . Let us now prove Theorem 3. Since the smallest integer k such that kI is integral can be computed efficiently, we assume that I is integral. As the ideal I is given by a Z-basis, we can find a basis of it that is LatRed-reduced (for T2 ). The algorithm of Figure 1 is an adaptation of [2, Alg. 6.15]. We follow the
Short Bases of Lattices over Number Fields
165
Inputs: A LatRed-reduced basis of a non-zero integral ideal I of OK ; a success parameter t. Output: x1 , x2 ∈ I such that I = (x1 ) + (x2 ), or Fail. 1. Let x1 be the first basis element; a := (x1 ). If I = a, return x1 and x2 := 0. 2. Find y such that y log y = log N (a); S := {p prime : N (p) ≤ y}. −1 3. a0 := p∈S pνp (a) ; I0 := p∈S pνp (I) ; a1 := aa−1 0 ; I1 := II0 . 4. For i := 1 to 2t do 5. Sample π1 uniformly in I1 /a1 . If I1 = a1 + (π1 ), then go to Step 7. 6. Return Fail. 7. Let b be the first element of a LatRed-reduced basis of a1 . 8. Size-reduce π1 with respect to the b · ri ’s. 9. Using [2, Alg. 6.8], find π0 ∈ OK such that νp (π0 ) = νp (I0 ) for all p ∈ S. 10. Let b be the first element of a LatRed-reduced basis of p∈S pνp (I0 )+1 . 11. Size-reduce π0 with respect to the b · ri ’s. 12. Using [2, Alg. 5.4], find α0 ∈ a0 and α1 ∈ a1 such that α0 + α1 = 1. 13. Let b be the first element of a LatRed-reduced basis of a. 14. Size-reduce α0 and α1 with respect to the b · ri ’s. 15. Return x1 and x2 := (π0 α1 + α0 )(π1 α0 + α1 ). Fig. 1. Computing a small 2-element representation of an integral ideal
algorithm step by step. The reducedness of the input directly gives that x1 ≤ 1/2d γΔK N (I)1/d . By using the arithmetic-geometric inequality, we obtain: 1
1 γΔ 2d 1 N (a) = N (x1 ) ≤ √ x1 ≤ √ K N (I) d . d d 1 d
1 d
(2)
As a consequence, the variable y of Step 2, can be bounded by a polynomial in d, log N (I) and log ΔK . This ensures that the computation of S can be done in polynomial time. At Step 3, the computations of a0 , I0 , a1 and I1 can be performed in polynomial time: this follows from the above study of S. We have a = a0 a1 and I = I0 I1 . We also have Ii |ai and Ii + a1−i = OK for i ∈ {0, 1}. As a1 is a full-rank sublattice of I1 , sampling π1 uniformly in I1 /a1 can be done in polynomial time. The equality I1 = a1 + (π1 ) can also be tested in polynomial time (see, e.g., [20, Prop. 8.2]). By adapting the analysis of [2, Le. 6.1], we obtain: Pr [I1 = a1 + (π1 )] ≥
1−
p prime, p|a1
1 N (p)
logy N (a) 1 1 ≥ . ≥ 1− y e
As a consequence, the algorithm returns Fail at Step 6 with probability ≤ 2−t . At Step 8, the b·ri ’s are a basis of a sublattice of a1 . Therefore, after Step 8, we still have I1 = a1 + (π1 ). After the size-reduction of π1 with respect to the b · ri ’s, we have: √ √ √ 1 1 2d N (a1 ) d max ri . π1 ≤ d max bri ≤ db max ri ≤ dγΔK i
i
i
166
C. Fieker and D. Stehl´e
It is shown in [2] that Step 9 can be performed in polynomial time. The bounds on S imply that Step 10 can be done in polynomial time. Step 11 ensures that ⎞ d1 ⎛ √ √ 1 1 2 2d 2d N⎝ pνp (I0 )+1 ⎠ max ri ≤ dγΔK N (I0 ) d max ri . π0 ≤ dγΔK i
p∈S
i
After Step 11, we still have that νp (π0 ) = νp (I0 ), for all p ∈ S, and thus I0 = a0 + (π0 ). It is shown in [2] that Step 12 can be performed in polynomial time. √ 1 1 2d Step 14 ensures that α0 , α1 ≤ dγΔK N (a) d maxi ri . Since a = a0 a1 , we still have αi ∈ ai after Step 14, for i ∈ {0, 1}. At Step 15, we have: x2 ≤ (π0 α1 + α0 ) (π1 α0 + α1 )
2 2 2 1 d ≤ d2 γ 4 ΔK max ri 4 N (a) d N (I0 ) d + 1 N (a1 ) d + 1 i
2 d
4
≤ 4d γ ΔK max ri 4 N (a) d , 2 4
i
where we used the fact that N (a1 ) = N (a)/N (a0 ) ≤ N (a)/N (I0 ). Combining the latter with (2) provides the upper bound on x2 from Theorem 3. Also, we have that πi := πi α1−i + αi is congruent to πi modulo ai and to 1 modulo a1−i , for i ∈ {0, 1}. Therefore, we have Ii = ai + (πi ) and Ii + (πi−1 )= OK . Finally, we obtain I = I0 I1 = a0 a1 + (π0 π1 ) = (x1 ) + (x2 ), thus proving the correctness of the algorithm. We now consider the amount of space needed to represent the coordinates (j) of x1 and x2 with respect to the integral basis (ri )i . We write xj = yi ri (j) (j) with yi ∈ Z and j ∈ {1, 2}. Using Lemma 2, we have that each yi may be stored on log2 xj + O(d) bits. Combining the latter with (2) and (1) provides the result.
4
Computing Short Pseudo-bases
In this section, we (constructively) show that any OK -module M ⊆ KRm always has a pseudo-basis [(bi )i , (bi )i ] such that the bi ’s belong to M and are not much longer than the module minima. 4.1
From a Short Basis of a Submodule to a Short Pseudo-basis
We are going to generalize to OK -modules the technique we mentioned at the end of Section 2.1, that takes as inputs a basis of a lattice L and a short basis of a full-rank sub-lattice of L, and returns a short basis of L. We split the algorithm into several smaller ones that may be of independent interest. The algorithm of Figure 2 takes as inputs a pseudo-basis [(ai )i , (ai )i ] of an OK module M ⊆ KRm and a full-rank set of short module vectors (si )i , and returns a pseudo-basis [(bi )i , (bi )i ] of M such that bi ∈ spanj≤i sj . This can be interpreted
Short Bases of Lattices over Number Fields
167
Inputs: A pseudo-basis [(ai )i , (ai )i ] of an OK -module M ⊆ KRm , a full-rank set (si )i of vectors in M . Output: A pseudo-basis of M . 1. Compute T ∈ K n×n such that (s1 , . . . , sn ) = (a1 , . . . , an )T . 2. Let t1 , . . . , tn be the columns of T t . −1 3. Compute the BPC-HNF [(ti )i , (b−1 i )i ] of the pseudo-basis [(ti )i , (ai )i ]. t −1 4. Let T be the matrix whose rows are the (ti ) ’s, and U = T (T ) ∈ K n×n . 5. Let (b1 , . . . , bn ) = (a1 , . . . , an )U . 6. Return [(bi )i , (bi )i ]. Fig. 2. Constructing a pseudo-basis with small GSO
as a constructive variant of [23, Th. 81.3]. The HNF over lattices is replaced by the BPC-HNF (Theorem 1), with special care being taken for the coefficient ideals. Theorem 4. If given as inputs a pseudo-basis [(ai )i , (ai )i ] of a module M ⊆ KRm and a full-rank set (si )i of vectors in M , then the algorithm of Figure 2 returns a pseudo-basis [(bi )i , (bi )i ] of M , which satisfies, for all i ≤ n: bi ∈ M ; bi ∈ spanj≤i sj ; b∗i = s∗i . If M ⊆ K m , then it terminates in polynomial time. Proof. We first prove that [(bi )i , (bi )i ] is a pseudo-basis of M . We have (bi )i = (ai )i · U , with U ∈ K n×n non-singular. It therefore suffices to prove that for −1 any i, j, we have Ui,j ∈ ai b−1 and Ui,j ∈ bi a−1 . This is j j , where U = U −1 −1 ensured by Theorem 1: as the pseudo-bases [(ti )i , (bi )i ] and [(ti )i , (ai )i ] span −1 ∈ a−1 the same module, we have Uj,i i bj and Uj,i ∈ bi aj , for any i, j. Because of the definitions of T, T , U and (bi )i , we have (si )i = (bi )i · T . Furthermore, by Theorem 1, the matrix T is upper triangular with diagonal coefficientsequal to 1. We thus have bi ∈ spanj≤i sj , for all i. In fact, we even have bi + j
maxj≤i N (bj ) N (bi )
d1
max a∗j . j≤i
If M ⊆ K m and LatRed is LLL, then it terminates in polynomial time. Proof. The operations performed on the pseudo-basis can be checked to preserve the generated module and the b∗i ’s. Steps 2, 6 and 7 ensure that the μi,j ’s of the √ 1 1 2d d N (b−1 output pseudo-basis satisfy μi,j ≤ dγΔK i bj ) maxk rk . Pythagoras’ theorem then provides the result.
168
C. Fieker and D. Stehl´e
Input: A pseudo-basis [(ai )i , (ai )i ] of an OK -module M ⊆ KRm . Output: A pseudo-basis of M . 1. [(bi )i , (bi )i ] := [(ai )i , (ai )i ]. 2. For j ≤ i, let xi,j be the first element of a LatRed basis of b−1 i bj . 3. For i from 2 to n, do 4. For j from i − 1 to 1, do 5. Compute the GSO decomposition bi = b∗i + j
The adaptation to OK -modules of [20, Le. 7.1] is given in Figure 4. The aim maxj≤i N (bj ) from Theorem 5. of Steps 2–4 is to allow us to bound the term N (bi )
Inputs: A pseudo-basis [(ai )i , (ai )i ] of an OK -module M ⊆ KRm , a free full-rank set (si )i of vectors in M . Output: A pseudo-basis of M . 1. Use the algorithm of Figure 2 to obtain a pseudo-basis [(bi )i , (bi )i ] of M . 2. For any i ≤ n, 3. Let x ∈ bi be the first vector of a LatRed basis of bi , 4. bi := (x)−1 bi ; bi := xbi . 5. Return the output of the algorithm of Figure 3, given [(bi )i , (bi )i ] as input. Fig. 4. From small vectors to a small pseudo-basis
Theorem 6. If given as inputs a pseudo-basis [(ai )i , (ai )i ] of an OK -module M ⊆ KRm and a full-rank set (si )i of vectors in M , then the algorithm of Figfor all i: bi ∈ M , ure 4 returns a pseudo-basis [(bi )i , (bi )i ] of M , such that √ d 1 d 2d √ 1 , 1 and spanj≤i bj = spanj≤i sj , b∗i ≤ γΔK s∗i , N (bi ) ∈ γ Δ K
bi ≤
3 √ 3 2d nγ ΔK max rk · max sj .
k
j≤i
If M ⊆ K m and LatRed is LLL, then it terminates in polynomial time. Proof. The fact that the algorithm returns a pseudo-basis of M is easy to check. Also, at the end of Step 1, we have that bi ∈ M , for all i. Since the x of Step 3 belongs to bi , the latter fact is preserved throughout the rest of the execution. The equality spanj≤i bj = spanj≤i sj directly derives from Theorems 4 and 5.
Short Bases of Lattices over Number Fields
169
At any time after Step 1, we have OK ⊆ bi and thus N (bi ) ≤ 1. At Step 3, we 1
1
2d 2d have x ≤ γΔK N (bi ) d . This gives that after Step 4 we have b∗i ≤ γΔK s∗i , which is preserved throughout √ Step √ 5. Also, the arithmetic-geometric inequality implies that N (x) ≤ (γ/ d)d ΔK N (bi ). Therefore, after Step 4 the quan √ d 1 tity N (bi ) has been divided by N (x) and we have N (bi ) ≥ γd √Δ . Using K Theorem 5, this allows us to derive that at the end of the execution we have:
bi ≤
√
1
1 2d
dnγΔK
√ d1 1 ΔK 2d max rk √ · γΔK max s∗j . k j≤i ( d/γ)d
The inequalities s∗j ≤ sj lead to the result. 4.2
Computing a Short Pseudo-basis
Suppose we have a pseudo-basis of an OK -module M of rank n. We can expand it to obtain a basis of M as a Z-module. By LLL-reducing the latter with respect to T2 , we obtain dn module vectors whose integer linear combinations span M . By using linear algebra over K, it is possible to select n module vectors s1 , . . . , sn among these dn vectors, such that rankK (si ) = n. Furthermore, thanks to the initial reduction, these vectors are also small, and we can apply Theorem 6. Corollary 1. There exists an algorithm that takes as input a pseudo-basis of [(bi )i , (bi )i ] of M , such an OK -module M ⊆ KRm and returns a pseudo-basis
√ d d √ 1 , 1 and that for all i: bi ∈ M , N (bi ) ∈ γ Δ K
bi ≤ 2
dn 2
√
3
2d nγ 3 ΔK max rk 2 · λi (M ).
k
Therefore: i
bi ≤ 2
dn2 2
√ 3n 1 2d ( dn)n γ 3n ΔK max rk 2n · (det(M )) d . k
If M ⊆ K m and LatRed is LLL, then it terminates in polynomial time, and the output may be stored on a number of bits bounded by m log2 det(M ) + O md2 n2 + nm log ΔK + mdn log max rk . k
Proof. Let L denote M when considered as a lattice. Let (si )i≤dn be a LLLreduced basis of L. We have si ≤ 2dn/2 λi (L), for all i. Let ψ(i) = min(j : rankK (sk )k≤j = i). Since K has degree d, we have ψ(i) ≤ d(i − 1) + 1, for all i. We use the sψ(i) ’s as input to the algorithm of Figure 4. The first statement on the bi ’s derives from Theorem 6 and the fact that λψ(i) (L) ≤ maxk rk · λ ψ(i)/d (M ) ≤ maxk rk · λi (M ). By combining Theorem 2 and the latter, we obtain the second statement on the bi ’s.
170
C. Fieker and D. Stehl´e
We now consider the bit-size of the representation when M ⊆ K m . Using Lemma 2 for the first component of the pseudo-basis, we obtain that the bit-size of the latter is ≤ md(log2 bi + O(nd)). To represent the ideal coefficients, we use Theorem 3 with the inverses of the ideals. The latter are integral, and 2 have norms ≤ 2d ΔK . Therefore, each of these can be represented on O(d2 + log ΔK + d log maxk rk ) bits. This completes the proof of the theorem. Note that the norm bound on the ideals depends only on the field and the choice for LatRed and is, in particular, independent of M . By applying Corollary 1 with m = n = 1, we obtain yet another compact representation of ideals of K. If I is an ideal and k is the smallest non-zero integer such that kI is integral, then we see that I can be represented on log2 N (I) + O(log ΔK + d(d + log k + log maxi ri )) bits. If N (I) is large, this representation is smaller than the one from Theorem 3, but for a small N (I), this is the opposite a