A new computational approach to ideal theory in number fields
aa r X i v : . [ m a t h . N T ] J u l A NEW COMPUTATIONAL APPROACH TO IDEAL THEORY INNUMBER FIELDS
JORDI GU `ARDIA, JES ´US MONTES, AND ENRIC NART
Abstract.
Let K be the number field determined by a monic irreduciblepolynomial f ( x ) with integer coefficients. In previous papers we parameter-ized the prime ideals of K in terms of certain invariants attached to Newtonpolygons of higher order of the defining equation f ( x ). In this paper we showhow to carry out the basic operations on fractional ideals of K in terms ofthese constructive representations of the prime ideals. From a computationalperspective, these results facilitate the manipulation of fractional ideals of K avoiding two heavy tasks: the construction of the maximal order of K and thefactorization of the discriminant of f ( x ). The main computational ingredientis Montes algorithm, which is an extremely fast procedure to construct theprime ideals. Introduction
Let K be a number field of degree n and Z K its ring of integers. An essentialtask in Algorithmic Number Theory is to construct the prime ideals of K in termsof a defining equation of K , usually given by a monic and irreducible polynomial f ( x ) ∈ Z [ x ]. The standard approach to do this, followed by most of the algebraicmanipulators like Kant , Pari , Magma or Sage , is based on the previous computationof an integral basis of Z K . This approach has a drawback: one needs to factorizethe discriminant, disc( f ), of f ( x ), which can be a heavy task, even in number fieldsof low degree, if f ( x ) has large coefficients.In this paper we present a direct construction of the prime ideals, that avoidsthe computation of the maximal order of K and the factorization of disc( f ). Thefollowing tasks concerning fractional ideals can be carried out using this construc-tion:(1) Compute the p -adic valuation, v p : K ∗ → Z , for any prime ideal p of K .(2) Obtain the prime ideal decomposition of a fractional ideal.(3) Compute a two-element representation of a fractional ideal.(4) Add, multiply and intersect fractional ideals.(5) Compute the reduction maps, Z K → Z K / p .(6) Solve Chinese remainders problems.Moreover, along the construction of a prime ideal p , lying over a prime number p , a Z p -basis of the ring of integers of the local field K p is obtained as a by-product.Hence, from the prime ideal decomposition of the ideal p Z K we are also able toderive the resolution of another task: Mathematics Subject Classification.
Primary 11Y40; Secondary 11Y05, 11R04, 11R27.
Key words and phrases. discriminant, fractional ideal, Montes algorithm, Newton polygon,number field, factorization.Partially supported by MTM2009-13060-C02-02 and MTM2009-10359 from the Spanish MEC. (7) Compute a p -integral basis of K .For a given prime number p , the prime ideals of K lying above p are in one-to-one correspondence with the irreducible factors of f ( x ) in Z p [ x ] [Hen08]. In[HN08] we proved a series of recurrent generalizations of Hensel lemma, leading to aconstructive procedure to obtain a family of f -complete types , that parameterize theirreducible factors of f ( x ) in Z p [ x ]. A type is an object that gathers combinatorialand arithmetic data attached to Newton polygons of f ( x ) of higher order, andan f -complete type contains enough information to single out a p -adic irreduciblefactor of f ( x ). In [GMN08] we described Montes algorithm, which optimizes theconstruction of the f -complete types; it outputs a list of f -complete and optimaltypes that parameterize the prime ideals of K lying above p , and contain valuablearithmetic information on each prime ideal. All these results were based on thePhD thesis of the second author [Mon99]. The algorithm is extremely fast inpractice; its complexity has been recently estimated to be O ( n ǫ δ + n ǫ δ ǫ ),where δ = log(disc( f )) [FV10].In [GMN09b] we reinterpreted the invariants stored by the types in terms ofthe Okutsu polynomials attached to the p -adic irreducible factors of f ( x ) [Oku82].Suppose t is the f -complete and optimal type attached to a prime ideal p , cor-responding to a monic irreducible factor f p ( x ) ∈ Z p [ x ]; then, the arithmetic in-formation stored in t is synthesized by two invariants of f p ( x ): an Okutsu frame [ φ ( x ) , . . . , φ r ( x )] and a Montes approximation φ p ( x ) (cf. loc.cit.). The monicpolynomials φ , . . . , φ r , φ p have integer coefficients and they are all irreducible over Z p [ x ]; the polynomial φ p ( x ) is “sufficiently close” to f p ( x ). We say that p = [ p ; φ , . . . , φ r , φ p ] , is the Okutsu-Montes representation of the prime ideal p . Thus, from the compu-tational point of view, p is structured in r + 1 levels and at each level one needsto compute (and store) several Okutsu invariants that are omitted in this nota-tion. This computational representation of p is essentially canonical: the Okutsuinvariants of p , distributed along the different levels, depend only on the definingequation f ( x ). These invariants provide a rich and exhaustive source of informa-tion about the arithmetic properties of p , which is crucial in the computationaltreatment of p .From a historical perspective, the sake for a constructive representation of idealsgoes back to the very foundation of algebraic number theory. Kummer had theinsight that the prime numbers factorize in number fields into the product of prime“ideal numbers”, and he tried to construct them as symbols [ p ; φ ], where φ ( x ) is amonic lift to Z [ x ] of an irreducible factor of f ( x ) modulo p . Dedekind showed thatthese ideas led to a coherent theory only in the case that p does not divide the index i ( f ) := ( Z K : Z [ x ] / ( f ( x ))). This constructive approach could not be universallyused because there are number fields in which p divides the index of all definingequations [Ded78]. Fortunately, this obstacle led Dedekind to invent ideal theory asthe only way to perform a decent arithmetic in number fields. Ore, in his Phd thesis[Ore23], tried to regain the constructive approach to ideal theory. He generalizedand improved the classical tool of Newton polygons and showed that under theassumption that the defining equation is p -regular (a much weaker condition thanDedekind’s condition p ∤ i ( f )), the prime ideals dividing p can be parameterizedas p = [ p ; φ, φ p ] (in our notation), where φ p ( x ) ∈ Z [ x ] is certain polynomial whose NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 3 φ -Newton polygon is one-sided and the residual polynomial attached to this side isirreducible (cf. section 1). The contribution of [Mon99] was to extend Ore’s ideasin order to obtain a similar construction of the prime ideals in the general case.The aim of this paper is to show how to use this constructive representation ofthe prime ideals to carry out the above mentioned tasks (1)-(6) on fractional idealsand to compute p -integral bases. The outline of the paper is as follows. In section1 we recall the structure of types, we describe their invariants, and we review theprocess of construction of the Okutsu-Montes representations of the prime ideals.In section 2 we show how to compute the p -adic valuation of K with respect to aprime ideal p ; this is the key ingredient to obtain the factorization of a fractionalideal as a product of prime ideals (with integer exponents). The operations ofsum, multiplication and intersection of fractional ideals are trivially based on thesetasks. In section 3 we show how to find integral elements α p ∈ Z K such that p is theideal of Z K generated by p and α p ; this leads to the computation of a two-elementrepresentation of any fractional ideal. In section 4, we show how to compute residueclasses modulo prime ideals and we design a chinese remainder theorem routine.Section 5 is devoted to the construction of a p -integral basis.We have implemented a package in Magma that performs all the above mentionedtasks; in section 6 we present several examples showing the excellent performanceof the package in cases that the standard packages cannot deal with. Our routineswork extremely fast as long as we deal only with fractional ideals whose norm maybe factorized. Even in cases where disc( f ) may be factorized and an integral basisof Z K is available, our methods work faster than the standard ones if the degree of K is not too small. Mainly, this is due to the fact that we avoid the use of linearalgebra routines (computation of Z -bases of ideals, Hermite and Smith normalforms of n × n matrices, etc.), that dominate the complexity when the degree n grows. Finally, in section 7 we make some comments on the apparent limits of theseMontes’ techniques: they are not yet able to test if a fractional ideal is principal.We also briefly mention how to extend the results of this paper to the function fieldcase and the similar challenges that arise in this geometric context. Notations.
Throughout the paper we fix a monic irreducible polynomial f ( x ) ∈ Z [ x ] of degree n , and a root θ ∈ Q of f ( x ). We let K = Q ( θ ) be the number fieldgenerated by θ , and Z K its ring of integers.1. Okutsu-Montes representations of prime ideals
Let p be a prime number. In this section we recall Montes algorithm and wedescribe the structure of the f -complete and optimal types that parameterize theprime ideals of K lying over p . The results are mainly extracted from [HN08] (HNstanding for “Higher Newton”) and [GMN08].Given a field F and two polynomials ϕ ( y ) , ψ ( y ) ∈ F [ y ], we write ϕ ( y ) ∼ ψ ( y )to indicate that there exists a constant c ∈ F ∗ such that ϕ ( y ) = cψ ( y ).1.1. Types and their invariants.
Let v : Q ∗ p → Q be the canonical extension ofthe p -adic valuation of Q p to a fixed algebraic closure. We extend v to the discretevaluation v on the field Q p ( x ), determined by: v : Q p [ x ] −→ Z ∪ {∞} , v ( b + · · · + b r x r ) := min { v ( b j ) , ≤ j ≤ r } . GU`ARDIA, MONTES, AND NART
Denote by F := GF( p ) the prime field of characteristic p , and consider the 0-th residual polynomial operator R : Z p [ x ] −→ F [ y ] , g ( x ) g ( y ) /p v ( g ) , where, : Z p [ y ] → F [ y ], is the natural reduction map. A type of order zero , t = ψ ( y ), is just a monic irreducible polynomial ψ ( y ) ∈ F [ y ]. A representative of t isany monic polynomial φ ( x ) ∈ Z [ x ] such that R ( φ ) = ψ . The pair ( φ , v ) can beused to attach a Newton polygon to any nonzero polynomial g ( x ) ∈ Q p [ x ]. If g ( x ) = P s ≥ a s ( x ) φ ( x ) s is the φ -adic development of g ( x ), then N ( g ) := N φ ,v ( g )is the lower convex envelope of the set of points of the plane with coordinates( s, v ( a s ( x ) φ ( x ) s )) [HN08, Sec.1].Let λ ∈ Q − be a negative rational number, λ = − h /e , with h , e po-sitive coprime integers. The triple ( φ , v , λ ) determines a discrete valuation v on Q p ( x ), constructed as follows: for any nonzero polynomial g ( x ) ∈ Z p [ x ], take a lineof slope λ far below N ( g ) and let it shift upwards till it touches the polygon forthe first time; if H is the ordinate at the origin of this line, then v ( g ( x )) = e H , bydefinition. Also, the triple ( φ , v , λ ) determines a residual polynomial operator R := R φ ,v ,λ : Z p [ x ] −→ F [ y ] , F := F [ y ] / ( ψ ( y )) , which is a kind of reduction of first order of g ( x ) [HN08, Def.1.9].Let ψ ( y ) ∈ F [ y ] be a monic irreducible polynomial, ψ ( y ) = y . The triple t = ( φ ( x ); λ , ψ ( y )) is called a type of order one . Given any such type, one cancompute a representative of t ; that is, a monic polynomial φ ( x ) ∈ Z [ x ] of degree e deg ψ deg φ , satisfying R ( φ )( y ) ∼ ψ ( y ). Now we may start over with thepair ( φ , v ) and repeat all constructions in order two.The iteration of this procedure leads to the concept of type of order r [HN08,Sec.2]. A type of order r ≥ t = ( φ ( x ); λ , φ ( x ); · · · ; λ r − , φ r ( x ); λ r , ψ r ( y )) , where φ ( x ) , . . . , φ r ( x ) are monic polynomials in Z [ x ] that are irreducible in Z p [ x ], λ , . . . , λ r are negative rational numbers, and ψ r ( y ) is a polynomial over certainfinite field F r (to be specified below), that satisfy the following recursive properties:(1) φ ( x ) is irreducible modulo p . We define ψ ( y ) := R ( φ )( y ) ∈ F [ y ], F = F [ y ] / ( ψ ( y )).(2) For all 1 ≤ i < r , N i ( φ i +1 ) := N φ i ,v i ( φ i +1 ) is one-sided of slope λ i , and R i ( φ i +1 )( y ) := R φ i ,v i ,λ i ( φ i +1 )( y ) ∼ ψ i ( y ), for some monic irreducible poly-nomial ψ i ( y ) ∈ F i [ y ]. We define F i +1 = F i [ y ] / ( ψ i ( y )).(3) ψ r ( y ) ∈ F r [ y ] is a monic irreducible polynomial, ψ r ( y ) = y .Thus, a type of order r is an object structured in r levels. In the computationalrepresentation of a type, several invariants are stored at each level, 1 ≤ i ≤ r . Themost important ones are: φ i ( x ) , monic polynomial in Z [ x ] , irreducible over Z p [ x ] m i , deg φ i ( x ) ,v i ( φ i ) non-negative integer ,λ i = − h i /e i , h i , e i positive coprime integers ,ℓ i , ℓ ′ i , a pair of integers satisfying ℓ i h i − ℓ ′ i e i = 1 ,ψ i ( y ) , monic irreducible polynomial in F i [ y ] ,f i deg ψ i ( y ) ,z i the class of y in F i +1 , so that ψ i ( z i ) = 0 . NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 5
Take f := deg ψ , and let z ∈ F be the class of y , so that ψ ( z ) = 0. Notethat m i = ( f f · · · f i − )( e · · · e i − ), F i +1 = F i [ z i ], and dim F F i +1 = f f · · · f i .The discrete valuations v , . . . , v r +1 on the field Q p ( x ) are essential invariants ofthe type. Definition 1.1.
Let g ( x ) ∈ Z p [ x ] be a monic separable polynomial, and t a type oforder r ≥ .(1) We say that t divides g ( x ) (and we write t | g ( x ) ), if ψ r ( y ) divides R r ( g )( y ) in F r [ y ] .(2) We say that t is g -complete if ord ψ r ( R r ( g )) = 1 . In this case, t singlesout a monic irreducible factor g t ( x ) ∈ Z p [ x ] of g ( x ) , uniquely determined by theproperty R r ( g t )( y ) ∼ ψ r ( y ) . If K t is the extension of Q p determined by g t ( x ) , then e ( K t / Q p ) = e · · · e r , f ( K t / Q p ) = f f · · · f r . (3) A representative of t is a monic polynomial φ r +1 ( x ) ∈ Z [ x ] , of degree m r +1 = e r f r m r such that R r ( φ r +1 )( y ) ∼ ψ r ( y ) . This polynomial is necessarilyirreducible in Z p [ x ] . By the definition of a type, each φ i +1 ( x ) is a representative ofthe truncated type of order i Trunc i ( t ) := ( φ ( x ); λ , φ ( x ); · · · ; λ i − , φ i ( x ); λ i , ψ i ( y )) . (4) We say that t is optimal if m < · · · < m r , or equivalently, if e i f i > , forall ≤ i < r . Lemma 1.2.
Let t be a type of order r . Then, v j ( φ i ) = ( m i /m j ) v j ( φ j ) , for all j < i ≤ r .Proof. Let φ i ( x ) = P s ≥ a s ( x ) φ j ( x ) s be the φ j -adic development of φ i . By [HN08,Lem.2.17], v j ( φ i ) = min s ≥ { v j ( a s φ sj ) } . Now, N j ( φ i ) is one-sided of slope λ j ,because φ i is a polynomial of type Trunc j ( t ) [HN08, Def.2.1+Lem.2.4]. Sincethe principal term of the development is φ m i /m j j , we get v j ( φ i ) = v j ( φ m i /m j j ) =( m i /m j ) v j ( φ j ). (cid:3) Certain rational functions.
Let t be a type of order r . We attach to t seve-ral rational functions in Q ( x ) [HN08, Sec.2.4]. Note that v i ( φ i ) is always divisibleby e i − [HN08, Thm.2.11]. Definition 1.3.
Let π ( x ) = 1 , π ( x ) = p . We define recursively for all ≤ i ≤ r : Φ i ( x ) = φ i ( x ) π i − ( x ) v i ( φ i ) /e i − , γ i ( x ) = Φ i ( x ) e i π i ( x ) h i , π i +1 ( x ) = Φ i ( x ) ℓ i π i ( x ) ℓ ′ i . These rational functions can be written as a product of powers of p, φ ( x ) , . . . , φ r ( x ) ,with integer exponents. Notation.
Let Ψ( x ) = p n φ ( x ) n · · · φ s ( x ) n s ∈ Q ( x ) be a rational function whichis a product of powers of p, φ , . . . , φ s , with integer exponents. We denote:log Ψ = ( n , . . . , n s ) ∈ Z s +1 . The next result is inspired in [HN08, Cor.4.26].
Lemma 1.4.
Let F ( x ) ∈ Z p [ x ] be a monic irreducible polynomial divisible by t , andlet α ∈ Q p be a root of F ( x ) . For some ≤ s ≤ r , let Ψ( x ) = p n φ ( x ) n · · · φ s ( x ) n s be a rational function in Q ( x ) , such that v (Ψ( α )) = 0 . Then, Ψ( x ) = γ ( x ) t · · · γ s ( x ) t s , GU`ARDIA, MONTES, AND NART for certain integer exponents t , . . . , t s ∈ Z , which can be computed by the followingrecursive procedure: vector= ( n , . . . , n s ) for i=s to 1 by -1 do t i =vector[i]/ e i vector=vector- t i log γ i end for Proof.
By [HN08, (17)] and [HN08, Cor.3.2]:log Φ s = ( . . . . . . , , log π s = ( . . . . . . , , log γ s = ( . . . . . . , e s ) ∈ Z s +1 ,v ( φ s ( α )) = s X i =1 e i f i · · · e s − f s − h i e · · · e i , v ( γ s ( α )) = 0 . Since v (Ψ( α )) = 0, the formula for v ( φ s ( α )) shows that e s | n s . Thus, we can replaceΨ( x ) by Ψ( x ) γ − n s /e s s and iterate the argument. Since v ( γ s ( α )) = 0, the new Ψ( x )satisfies v (Ψ( α )) = 0 as well, and the s -th coordinate of log Ψ is zero. At thelast step ( s = 1), we get Ψ( x ) = p n ′ φ n ′ , with n ′ + n ′ ( h /e ) = 0. Then, clearlyΨ( x ) = γ ( x ) n ′ /e . (cid:3) Montes algorithm and the secondary invariants.
Let f ( x ) ∈ Z [ x ] be amonic irreducible polynomial. At the input of the pair ( f ( x ) , p ), Montes algorithmcomputes a family t , . . . , t s of f -complete and optimal types in one-to-one cor-respondence with the irreducible factors f t ( x ) , . . . , f t s ( x ) of f ( x ) in Z p [ x ]. Thisone-to-one correspondence is determined by:(1) For all 1 ≤ i ≤ s , the type t i is f t i -complete.(2) For all j = i , the type t j does not divide f t i ( x ).The algorithm starts by computing the order zero types determined by the irre-ducible factors of f ( x ) modulo p , and then proceeds to enlarge them in a convenientway till the whole list of f -complete optimal types is obtained [GMN08].With regard to the computation of generators of the prime ideals and chineseremainder multipliers, the algorithm is slightly modified to compute and store someother (secondary) invariants at each level of all types t considered by the algorithm:Refinements i , a list of pairs [ φ ( x ) , λ ], where φ is a representative ofTrunc i − ( t ) and λ a negative slope ,u i , a nonnegative integer called the height , Quot i , a list of e i polynomials in Z [ x ] , log Φ i , a vector ( n , . . . , n i ) ∈ Z i +1 , log π i , a vector ( n , . . . , n i − , ∈ Z i +1 , log γ i , a vector ( n , . . . , n i ) ∈ Z i +1 . Let us briefly explain the flow of the algorithm and the computation of theseinvariants. Suppose a type of order i − f ( x ) is considered, t = ( φ ( x ); λ , φ ( x ); · · · ; λ i − , φ i − ; λ i − , ψ i − ( y )) . A representative φ i ( x ) is constructed. Suppose that either i = 1 or m < · · · < m i .Let ℓ = ord ψ i − R i − ( f ). If t is not f -complete ( ℓ > f -complete types. To carry out this NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 7 ramification process we compute simultaneously the first ℓ + 1 coefficients of the φ i -adic development of f ( x ) and the corresponding quotients:(1) f ( x ) = φ i ( x ) q ( x ) + a ( x ) ,q ( x ) = φ i ( x ) q ( x ) + a ( x ) , · · · · · · q ℓ ( x ) = φ i ( x ) q ℓ +1 ( x ) + a ℓ ( x ) . The Newton polygon of i -th order of f ( x ), N i ( f ), is the lower convex envelopeof the set of points ( s, v i ( a s φ si )) of the plane, for all s ≥
0. However, we needto build up only the principal part of this polygon, N − i ( f ) = N − φ i ,v i ( f ), formedby the sides of negative slope of N i ( f ). By [HN08, Lem.2.17], this latter polygonis the lower convex envelope of the set of points ( s, v i ( a s φ si )) of the plane, for0 ≤ s ≤ ℓ . For each side of slope (say) λ of N − i ( f ), the residual polynomial R λ ( f )( y ) = R φ i ,v i ,λ ( f )( y ) ∈ F i [ y ] is computed and factorized into a product ofirreducible factors. The type t branches in principle into as many types as pairs( λ, ψ ( y )), where λ runs on the negative slopes of N − i ( f ) and ψ ( y ) runs on thedifferent irreducible factors of R λ ( f )( y ). If one of these branches t λ,ψ := ( φ ( x ); λ , φ ( x ); · · · ; λ i − , φ i ( x ); λ, ψ ( y )) , is f -complete, we store this type in an specific list and we go on with the analysisof other branches. Otherwise, we compute a representative φ λ,ψ ( x ) of t λ,ψ . Let e be the least non-negative denominator of λ and f = deg ψ . Then we proceed in adifferent way according to ef = 1 or ef > ef >
1, then deg φ λ,ψ > m i , so that φ i +1 := φ λ,ψ may be used to enlarge t λ,ψ into several optimal types of order i + 1. We store the invariants φ i , m i = deg φ i , v i ( φ i ) , λ i = λ, h i , e i = e, ℓ i , ℓ ′ i , ψ i = ψ, f i = f, z i ,u i , Quot i , log Φ i , log π i , log γ i at the i -th level of t λ,ψ , and then we proceed to enlarge the type. The invariant v i ( φ i ) is recursively computed by using [HN08, Prop.2.7+Thm.2.11]: v i ( φ i ) = (cid:26) , if i = 1 ,e i − f i − ( e i − v i − ( φ i − ) + h i − ) , if i > . Let s i be the abscissa of the right end point of the side of N − i ( f ) of slope λ ; thesecondary invariants are computed as:(2) u i = v i ( a s i ) , Quot i = [1 , q s i − ( x ) , . . . , q s i − e +1 ( x )] , log Φ i = ( n , . . . , n i − , , where ( n , . . . , n i − ) = − ( v i ( φ i ) /e i − ) log π i − , log π i = ℓ i − log Φ i − − ℓ ′ i − log π i − , log γ i = e i log Φ i − h i log π i . For i = 1 we take log Φ = (0 ,
1) and log π = (1 , λ and not on ψ . They are computed only once for eachside of N − i ( f ) and then stored in the different optimal branches that share the sameslope. The type t λ,ψ of order i is then ready for further analysis.If ef = 1 then deg φ λ,ψ = m i , so that the enlargements of t λ,ψ that would resultfrom building up an ( i + 1)-th level from φ λ,ψ would not be optimal. In this case, GU`ARDIA, MONTES, AND NART we replace t λ,ψ by all types t ′ λ ′ ,ψ ′ := ( φ ( x ); λ , φ ( x ); · · · ; λ i − , φ ′ i ( x ); λ ′ , ψ ′ ( y )) , obtained by enlarging t with i -th levels deduced from the consideration of φ λ,ψ as anew (and better) representative of t : φ ′ i ( x ) := φ λ,ψ ( x ), but taking into account onlythe slopes λ ′ of N φ ′ i ,v i ( f ) satisfying λ ′ < λ ; this is called a refinement step [GMN08,Sect.3.2]. If the total number of pairs ( λ, ψ ) is greater than one, we append to thelist Refinements i of all types t ′ λ ′ ,ψ ′ the pair [ φ i ( x ) , λ ]. Some of these new branches t ′ λ ′ ,ψ ′ of order i may be f -complete, some may lead to optimal enlargements andsome may lead to further refinement at the i -th level. Thus, in general, the listRefinements i of a type t is an ordered sequence of pairs:Refinements i = [[ φ (1) i , λ (1) i ] , · · · , [ φ ( s ) i , λ ( s ) i ]] , reflecting the fact that along the construction of t , s or more successive refine-ment steps occurred at the i -th level. All polynomials φ ( k ) i are representatives ofTrunc i − ( t ), and the slopes λ ( k ) i grow strictly in absolute size: | λ (1) i | < · · · < | λ ( s ) i | .We recall that we store only the pairs [ φ ( k ) i , λ ( k ) i ] corresponding to a refinement stepthat occurred simultaneously with some branching. For instance, if N − φ ( k ) i ,v i ( f ) hasonly one side with integer slope λ ( k ) i ∈ Z (i.e. e = 1) and the corresponding residualpolynomial is the power of an irreducible polynomial of degree one ( f = 1), thenthe pair [ φ ( k ) i , λ ( k ) i ] is not included in the list Refinements i .After a finite number of branching, enlargement and/or refinement steps, alltypes become f -complete and optimal. If t is an f -complete and optimal type oforder r , then the Okutsu depth of f t ( x ) is [GMN09b, Thm.4.2]:(3) R = (cid:26) r, if e r f r > ,r − , if e r f r = 1 . The invariants v i +1 , h i , e i , f i at each level 1 ≤ i ≤ R are canonical (dependonly on f ( x )) [GMN09b, Cor.3.7]. On the other hand, the polynomials φ i ( x ) , ψ i ( y )depend on several choices, some of them caused by the lifting of elements of afinite field to rings of characteristic zero. However, the sequence [ φ , . . . , φ R ] is an Okutsu frame of f t ( x ) [GMN09b, Sec.2]; in the original terminology of Okutsu, thepolynomials φ , . . . , φ R are primitive divisor polynomials of f t ( x ) [Oku82].1.4. Montes approximations to the irreducible p -adic factors. Once an f -complete and optimal type t of order r is computed, Montes algorithm attaches toit an ( r + 1)-level that carries only the invariants:(4) φ r +1 , m r +1 , v r +1 ( φ r +1 ) , λ r +1 = − h r +1 , e r +1 = 1 , ψ r +1 , f r +1 = 1 ,z r +1 , log Φ r +1 , log π r +1 , log γ r +1 . The polynomial φ r +1 ( x ) is a representative of t . The invariants λ r +1 , ψ r +1 arededuced from the computation of the principal part of the Newton polygon of( r + 1)-th order of f ( x ) (which is a single side of length one) and the correspondingresidual polynomial R r +1 ( f )( y ) ∈ F r +1 [ y ] (which has degree one).If p is the prime ideal corresponding to t , we denote f p ( x ) := f t ( x ) ∈ Z p [ x ] , φ p ( x ) := φ r +1 ( x ) ∈ Z [ x ] , F p := F r +1 , t p := ( φ ; λ , φ ; · · · , φ r ; λ r , φ p ; λ r +1 , ψ r +1 ) , NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 9 and we say that p = [ p ; φ , . . . , φ r , φ p ] is the Okutsu-Montes representation of p .Note that t p is still an f -complete type of order r + 1, but it may eventually benon-optimal because m r +1 = m r , if e r f r = 1.The polynomial φ p ( x ) is a Montes approximation to the p -adic irreducible factor f p ( x ) [GMN09b, Sec.4.1]. Several arithmetic tasks involving prime ideals (tasks (1),(3), (5), (6) and (7) from the list given in the Introduction) require the computationof a Montes approximation with a sufficiently large value of the last slope | λ r +1 | = h r +1 . This can be achieved by applying a finite number of refinement steps at the( r + 1)-th level, to the type t p of order r + 1, as described in [GMN09b, Sec.4.3].This procedure has a linear convergence. In [GNP10] a more efficient single-factorlift algorithm is developed, which is able to improve the Montes approximations to f p ( x ) with quadratic convergence.2. p -adic valuation and factorization In section 2.1 we compute the p -adic valuation, v p : K ∗ → Z , determined by aprime ideal p , in terms of the data contained in the Okutsu-Montes representationof p . In section 2.2 we describe a procedure to find the prime ideal decompositionof any fractional ideal of K . From the computational point of view, this procedureis based on three ingredients:(1) The factorization of integers.(2) Montes algorithm to find the prime ideal decomposition of a prime number.(3) The computation of v p for some prime ideals p .The routines (2) and (3) run extremely fast in practice (see section 6).It is well-known how to add, multiply and intersect fractional ideals once theirprime ideal factorization is available. We omit the description of the routines thatcarry out these tasks.From now on, to any prime ideal p of K we attach the data t p , f p ( x ), φ p ( x ), F p ,described in section 1.4. Also, we choose a root θ p ∈ Q p of f p ( x ), we consider thelocal field K p = Q p ( θ p ), and we denote by Z K p the ring of integers of K p .2.1. Computation of the p -adic valuation. Let p be a prime number and v : Q ∗ p → Q , the canonical p -adic valuation. Let p be a prime ideal of K lyingabove p , corresponding to an f -complete type t p with an added ( r + 1)-th level, asindicated in section 1.4. We shall freely use all invariants of t p described in section1. By item 2 of Definition 1.1 we know that e ( p /p ) = e · · · e r , f ( p /p ) = f f · · · f r . The residue field Z K p / p Z K p can be identified to the finite field F p := F r +1 = F [ z , z , . . . , z r ] . More precisely, in [HN08, (27)] we construct an explicit isomorphism(5) γ : F p −→ ∼ Z K p / p Z K p , z θ p , z γ ( θ p ) , . . . , z r γ r ( θ p ) , where we indicate by a bar the canonical reduction map, Z K p −→ Z K p / p Z K p . Wedenote by lred p : Z K p −→ F p , the reduction map obtained by composition of thecanonical reduction map with the inverse of the isomorphism (5).(6) lred p : Z K p −→ Z K p / p Z K p γ − −→ F p . Consider the topological embedding ι p : K ֒ → K p determined by sending θ to θ p .We have: v p ( α ) = e ( p /p ) v ( ι p ( α )), for all α ∈ K . In particular, for any polynomial g ( x ) ∈ Z [ x ],(7) v p ( g ( θ )) = e ( p /p ) v ( g ( θ p )) . Any α ∈ K ∗ can be expressed as α = ( a/b ) g ( θ ), for some coprime positiveintegers a, b and some primitive polynomial g ( x ) ∈ Z [ x ]. By (7), v p ( α ) = e ( p /p )( v ( g ( θ p )) + v ( a/b )) . Thus, it is sufficient to learn to compute v ( g ( θ p )). The condition v ( g ( θ p )) = 0 iseasy to check [GMN09b, Lem.2.2]:(8) v ( g ( θ p )) = 0 ⇐⇒ ψ ∤ R ( g ) . If ψ | R ( g ), the computation of v ( g ( θ p )) can be based on the following proposition,which is easily deduced from [HN08, Prop.3.5] and [HN08, Cor.3.2]. Proposition 2.1.
Let p , f p ( x ) , θ p be as above. Let t be a type of order R dividing f p ( x ) , and let g ( x ) ∈ Z [ x ] be a nonzero polynomial. For any ≤ i ≤ R , take a line L λ i of slope λ i far below N i ( g ) , and let it shift upwards till it touches the polygonfor the first time. Let S be the intersection of this line with N i ( g ) , let ( s, u ) be thecoordinates of the left end point of S , and let H = u + s | λ i | be the ordinate at theorigin of this line. Then, (1) v ( g ( θ p )) ≥ H/e · · · e i − , and equality holds if and only if Trunc i ( t ) ∤ g ( x ) . (2) If equality holds, then v ( g ( θ p )) = v (Φ i ( θ p ) s π i ( θ p ) u ) and lred p (cid:18) g ( θ p )Φ i ( θ p ) s π i ( θ p ) u (cid:19) = R i ( g )( z i ) = 0 . (cid:3) Figure 1 shows that the segment S may eventually be reduced to a point. Inthis case, the residual polynomial R i ( g )( y ) is a constant [HN08, Def.2.21], so thatTrunc i ( t ) ∤ g ( x ) automatically holds. •• ❅❅❅❅ PPPP❆❆❆ ❆❆❆ ❍❍❍❍❍❍❍❍❍❍ L λ i N i ( g ) uH Ss •• ❍❍❍ ❍❍❍ PPPP❆❆❆❆ ❆❆❆❆ ❍❍❍❍❍❍❍❍❍❍❍❍ L λ i SsN i ( g ) uH Figure 1We may compute v p ( g ( θ )) = e ( p /p ) v ( g ( θ p )) by applying Proposition 2.1 to thetype t p . If for some 1 ≤ i ≤ r + 1, the truncated type Trunc i ( t p ) does not divide g ( x ), we compute v ( g ( θ p )) as indicated in item 1 of this proposition. Nevertheless,it may occur that Trunc i ( t p ) divides g ( x ) for all 1 ≤ i ≤ r + 1 (for instance, if g ( x ) is a multiple of φ p ( x ) = φ r +1 ( x )). In this case, we compute an improvement ofthe Montes approximation φ p ( x ) by applying the single-factor lift routine [GNP10];then, we replace the ( r + 1)-th level of t p by the invariants (4) determined by thenew choice of φ r +1 ( x ) = φ p ( x ), and we test again if t p = Trunc r +1 ( t p ) divides g ( x ). NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 11 If t p divides g ( x ), then φ p ( x ) is simultaneously close to a p -adic irreducible factorof f ( x ) and to a p -adic irreducible factor of g ( x ); hence, if f ( x ) and g ( x ) do nothave a common p -adic irreducible factor, after a finite number of steps the renewedtype t p will not divide g ( x ). On the other hand, if f ( x ) and g ( x ) have a common p -adic irreducible factor, they must have a common irreducible factor in Z [ x ] too;since f ( x ) is irreducible, necessarily f ( x ) divides g ( x ) and g ( θ ) = 0.We may summarize the routine to compute v p ( α ) as follows. Input: α ∈ K ∗ and a prime ideal p determined by a type t p of order r + 1. Output: v p ( α ). Write α = ab g ( θ ), with a, b coprime integers and g ( x ) ∈ Z [ x ] primitive. Compute ν = v ( a/b ). if ψ ∤ R ( g ) then return v p ( α ) = e ( p /p ) ν . for i = 1 to r + 1 docompute N − i ( g ), R i ( g ), and the ordinate H of Proposition 2.1.if ψ i ∤ R i ( g ) then return v p ( α ) = e ( p /p )(( H/e · · · e i − ) + ν ).end for. while ψ r +1 | R r +1 ( g ) doimprove φ p and compute the new values λ r +1 , ψ r +1 .compute N − r +1 ( g ), R r +1 ( g ), and the ordinate H of Proposition 2.1.end while. return v p ( α ) = e ( p /p )(( H/e · · · e r ) + ν ).2.2. Factorization of fractional ideals.
For any α ∈ K ∗ , the factorization ofthe principal ideal generated by α is α Z K = Y p p v p ( α ) . Let α = ( a/b ) g ( θ ), for some positive coprime integers a, b and some primitivepolynomial g ( x ) ∈ Z [ x ]. Then, v p ( α ) = 0 for all prime ideals p whose underlyingprime number p does not divide the product ab N K/ Q ( g ( θ )) = ab Resultant( f, g ).Also, if p is a prime ideal of K and a , b are fractional ideals, we have v p ( a + b ) = min { v p ( a ) , v p ( b ) } . Thus, the p -adic valuation of the fractional ideal a generated by α , . . . , α m ∈ K ∗ is: v p ( a ) = min ≤ i ≤ m { v p ( α i ) } .After these considerations, it is straightforward to deduce a factorization routineof fractional ideals from the routines computing prime ideal decompositions of primenumbers and p -valuations of elements of K ∗ with respect to prime ideals p . Input: a family α , . . . , α m ∈ K ∗ of generators of a fractional ideal a . Output: the prime ideal decomposition a = Q p p a p . For each 1 ≤ i ≤ m , write α i = ( a i /b i ) g i ( θ ), with a i , b i coprime integers and g i ( x ) ∈ Z [ x ] primitive; then compute N i = N K/ Q ( g i ( θ )). Compute N = gcd( a N , . . . , a m N m ) and M = lcm( b , . . . , b m ). Factorize N and M and store all their prime factors in a list P . For each p ∈ P apply Montes algorithm to obtain the prime ideal decompositionof p , and for each p | p , take a p = min ≤ i ≤ m { v p ( α i ) } . Return the list of pairs [ p , a p ] for all p with a p = 0. The bottleneck of this routine is step 3. We get a fast factorization routine inthe number field K , as long as the integers N , M attached to the ideal a may beeasily factorized. 3. Computation of generators
In [GMN08, Sec.4] we gave an algorithm to compute generators of the primeideals as certain rational functions of the φ -polynomials. Some inversions in K ,one for each prime ideal, were needed. These inversions dominated the complexityof the algorithm, and they were a bottleneck that prevented the computation ofgenerators for number fields of large degree.In sections 3.1 and 3.2 we construct a two-element representation of prime ideals,which does not need any inversion in K . As a consequence, this construction worksextremely fast in practice even for number fields of large degree (see section 6). Insection 3.3 we easily derive two-element representations of fractional ideals.For any prime ideal p of K we keep the notations for t p , f p ( x ), φ p ( x ), F p , θ p , K p , Z K p , as introduced in section 2.3.1. Local generators of the prime ideals.Definition 3.1.
A pseudo-generator of a prime ideal p of K is an integral element π ∈ Z K such that v p ( π ) = 1 . Let p be a prime number, and let p = [ p ; φ , . . . , φ r , φ p ] be a prime ideal factorof p Z K , corresponding to an f -complete type t p with an added ( r + 1)-th level, asindicated in section 1.4. In this section we show how to compute a pseudogeneratorof p from the secondary invariants u i , Quot i , of t p , for 1 ≤ i ≤ r , computed alongthe flow of Montes algorithm as indicated in (2).For each level 1 ≤ i ≤ r , let us denote:Quot i = [ Q i, ( x ) , . . . , Q i,e i − ( x )] . Recall that Q i, ( x ) = 1, and for 0 < j < e i , the polynomial Q i,j ( x ) ∈ Z [ x ] is the( s i − j )-th quotient of the φ i -adic development of f ( x ) (cf. (1)), where s i is theabscissa of the right end point of the side of slope λ i of N − i ( f ). Also, let us define H i, = 0 , H i,j = u i + j ( | λ i | + v i ( φ i )) e · · · e i − , ∀ < j < e i . Proposition 3.2.
For each level ≤ i ≤ r and subindex ≤ j < e i : (1) v q ( Q i,j ( θ )) ≥ e ( q /p ) H i,j , for all prime ideals q | p . (2) v p ( Q i,j ( θ )) = e ( p /p ) H i,j .Proof. Item 1 being proved in [GMN09a, Prop.10], let us prove item 2. Fix alevel 1 ≤ i ≤ r and a subindex 0 ≤ j < e i . Let ℓ i = ord ψ i − R i − ( f ), and let f ( x ) = P s ≥ a s φ si be the φ i -adic development of f ( x ). The Newton polygon of i -thorder of f ( x ), N i ( f ), is the lower convex envelope of the cloud of points ( s, v i ( a s φ si )),for all s ≥
0. The principal part N − i ( f ) is equal to N i ( f ) ∩ ([0 , ℓ i ] × R ); the typicalshape of this polygon is illustrated in Figure 2. Let S λ i be the side of slope λ i ofthis polygon, and s i the abscissa of the right end point of S λ i . NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 13 • • ••◦ • ❏❏❏❏❏ ❏❏❏❏❏ PPPPPPPPPPPPPPPPPPPPPPPPPP❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤ ............... .......... N − i ( f ) S λ i t s i ℓ i s i − e i v i ( f ) H ✛ ✲ N − i ( q t φ ti ) Figure 2For any 0 ≤ t ≤ ℓ i , let q t ( x ) be the t -th quotient of the φ i -adic development (see(1)). We have f ( x ) = q t ( x ) φ i ( x ) t + r t ( x ), with r t ( x ) = X ≤ s
1, we canalways find a pseudo-generator of p by computing a suitable product of quotientsin the lists Quot i , divided by a suitable power of p . Corollary 3.3. (1)
Let j , . . . , j r be subindices satisfying, ≤ j i < e i , for all ≤ i ≤ r . Then,the following element belongs to Z K : π j ,...,j r := Q ,j ( θ ) · · · Q r,j r ( θ ) /p ⌊ H ,j + ··· + H r,jr ⌋ . (2) If e ( p /p ) > , there is a unique family j , . . . , j r as above, for which v p ( π j ,...,j r ) = 1 . This family may be recursively computed as follows: j r ≡ h − r (mod e r ) , res r := ( j r h r − /e r ,j r − ≡ − h − r − ( u r + j r v r ( φ r ) + res r ) (mod e r − ) , res r − := ( j r − h r − + u r + j r v r ( φ r ) + res r ) /e r − , · · · · · · j ≡ − h − ( u + j v ( φ ) + res ) (mod e ) . Proof.
Item 1 is an immediate consequence of item 1 of Proposition 3.2.Also, by Proposition 3.2, v p ( π j ,...,j r ) = e ( p /p ) ( H ,j + · · · + H r,j r − ⌊ H ,j + · · · + H r,j r ⌋ ) . Thus, item 2 states that there is a unique family j , . . . , j r such that H ,j + · · · + H r,j r ≡ e ( p /p ) (mod Z ) . Since e ( p /p ) = e · · · e r and | λ i | = h i /e i , this is equivalent to: u + j v ( φ )+ j h + u + j v ( φ ) e + · · ·· · · + j r − h r − + u r + j r v r ( φ r ) e · · · e r − + j r h r e · · · e r ≡ e · · · e r (mod Z ) . Clearly this congruence has a unique solution j , . . . , j r satisfying 0 ≤ j i < e i , forall 1 ≤ i ≤ r , and this solution may be recursively obtained by the proceduredescribed in item 2. (cid:3) The only property of t p that we used in in Corollary 3.3 is: e · · · e r = e ( p /p ).Thus, we don’t need to use all levels of t p to compute a pseudo-generator of p ; inpractice we take r to be the minimum level such that e · · · e r = e ( p /p ).3.2. Generators of the prime ideals.
Let p be a prime number, and P the setof prime ideals of K lying over p . Once we have pseudo-generators π p ∈ p of all p ∈ P , in order to find generators we need only to compute a family of integralelements, { b p ∈ Z K } p ∈ P , satisfying:(10) v p ( b p ) = 0 , ∀ p ∈ P , v q ( b p ) > , ∀ q , p ∈ P , q = p . Then, for each p ∈ P , the integral element: α p := b p π p + X q ∈ P , q = p b q ∈ Z K clearly satisfies: v p ( α p ) = 1, v q ( α p ) = 0, for all q = p . Therefore, p is the idealgenerated by p and α p . The rest of this section is devoted to the construction ofthese multipliers { b p } . NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 15
Let ( t p ) p ∈ P be the parameterization of the set P by a family of f -complete typesobtained by an application of Montes algorithm. As usual, we suppose that each t p has been conveniently enlarged with an ( r p + 1)-th level, as indicated in section1.4. From now on we provide the invariants of t p with a subscript p to distinguishthe prime ideal they belong to: r p , φ i, p , m i, p , λ i, p , etc.The integral elements b p will be constructed as suitable products of φ -polynomialsdivided by suitable powers of p . The crucial ingredient is Proposition 3.8, that com-putes v p ( φ i, q ( θ )) for all p = q in P , and all 1 ≤ i ≤ r q + 1. Definition 3.4.
For any pair p , q ∈ P , we define the index of coincidence betweenthe types t p and t q as: i ( t p , t q ) = (cid:26) , if ψ , p = ψ , q , min { j ∈ Z > | ( φ j, p , λ j, p , ψ j, p ) = ( φ j, q , λ j, q , ψ j, q ) } , if ψ , p = ψ , q . Alternatively, i ( t p , t q ) is the least subindex j for which Trunc j ( t p ) = Trunc j ( t q ) . Remark 3.5.
By definition, φ i, p = φ i, q , λ i, p = λ i, q , ψ i, p = ψ i, q , ∀ i < i ( t p , t q ) . Hence, by the definition of the p -adic valuations v i, p , v i, q , and by [HN08, Thm.2.11] , we get: v i, p = v i, q , m i, p = m i, q , v i, p ( φ i, p ) = v i, q ( φ i, q ) , ∀ i ≤ i ( t p , t q ) . Lemma 3.6. If p , q ∈ P , and p = q , then i ( t p , t q ) ≤ min { r p , r q } .Proof. Suppose r p ≤ r q and i ( t p , t q ) = r p + 1. Then, Trunc r p ( t p ) = Trunc r p ( t q ).Since the type Trunc r p ( t p ) is f -complete, it singles out a unique p -adic irreduciblefactor of f ( x ) (item 2 of Definition 1.1). Hence, Trunc r p ( t q ) is also f -complete andit singles out the same p -adic irreducible factor of f ( x ). This implies that p = q . (cid:3) By (7) and (9), for all 1 ≤ i ≤ r p + 1 we have(11) v p ( φ i, p ( θ )) = e ( p /p ) v i, p ( φ i, p ) + | λ i, p | e , p · · · e i − , p . In order to compute the values of v p ( φ i, q ( θ )), for p = q , we need still anotherdefinition. Definition 3.7.
Let p , q ∈ P , q = p , and j = i ( t p , t q ) . Let s p = j, p ,and consider the list Ref p obtained by extending the list Refinements j, p by addingthe pair [ φ j, p , λ j, p ] at the last position: Ref p = hh φ (1) j, p , λ (1) j, p i , · · · , h φ ( s p ) j, p , λ ( s p ) j, p i , h φ ( s p +1) j, p , λ ( s p +1) j, p i := [ φ j, p , λ j, p ] i . Let
Ref q be the analogous list for the prime ideal q .We define the greatest common φ -polynomial of the pair ( t p , t q ) to be the moreadvanced common φ -polynomial in the two lists Ref p , Ref q . We denote it by: φ ( p , q ) := φ ( k ) j, p = φ ( k ) j, q , for the maximum index k such that φ ( k ) j, p = φ ( k ) j, q .We define the hidden slopes of the pair ( t p , t q ) to be: λ qp := λ ( k ) j, p , λ pq := λ ( k ) j, q . Remarks. (1) By the concrete way the processes of branching, enlarging and/or refiningwere defined, this polynomial φ ( p , q ) always exists. In fact, let us show that we musthave φ (1) j, p = φ (1) j, q . Since Trunc j − ( t p ) = Trunc j − ( t q ), this type had some originalrepresentative (say) φ j . By considering N − φ j ,v j ( f ) and the irreducible factors ofall residual polynomials of all sides, we had different branches ( λ, ψ ) to analyze; ifthere was only one branch, the algorithm necessarily performed a refinement step,because otherwise we would have i ( t p , t q ) > j . After eventually a finite number ofthese unibranch refinement steps (that were not stored in the list Refinements j ), weconsidered some representative, let us call it φ j again, leading to several branches.One of these branches led later to the type t p and one of them (maybe still the same)to the type t q . If the p -branch experimented refinement, the list Refinements j, p had φ (1) j, p = φ j as its initial φ -polynomial; if the p -branch was f -complete or had to beenlarged, then the list Refinements j, p remained empty and we had φ j, p = φ j . Inany case, φ j is the first φ -polynomial of the list Ref p .(2) All φ ( ℓ ) j, p , φ ( ℓ ) j, q are representatives of t j − := Trunc j − ( t p ) = Trunc j − ( t q );in particular, all these polynomials have degree m j . With the obvious meaning for ψ ( ℓ ) j, p , we have necessarily: h φ ( k ) j, p , λ ( k ) j, p , ψ ( k ) j, p i = h φ ( k ) j, q , λ ( k ) j, q , ψ ( k ) j, q i , h φ ( ℓ ) j, p , λ ( ℓ ) j, p , ψ ( ℓ ) j, p i = h φ ( ℓ ) j, q , λ ( ℓ ) j, q , ψ ( ℓ ) j, q i , for all 1 ≤ ℓ < k . Thus, φ ( p , q ) is the first representative of t j − for which thebranches of t p and t q are different.(3) Caution: we may have Ref p = Ref q . In this case φ ( p , q ) = φ j, p = φ j, q and λ qp = λ j, p = λ j, q = λ pq ; the branches of t p and t q are distinguished by ψ j, p = ψ j, q . Proposition 3.8.
Let p , q ∈ P , p = q , and j = i ( t p , t q ) . Let φ ( p , q ) be the greatestcommon φ -polynomial of the pair ( t p , t q ) and λ qp , λ pq the hidden slopes. For any ≤ i ≤ r q + 1 , v p ( φ i, q ( θ )) e ( p /p ) = , if j = 0 ,v i ( φ i ) + | λ i | e · · · e i − , if i < j,v j ( φ j ) + | λ qp | e · · · e j − , if i = j and φ j, q = φ ( p , q ) ,v j ( φ j ) + min {| λ qp | , | λ pq |} e · · · e j − , if i = j and φ j, q = φ ( p , q ) ,m i, q m j · v j ( φ j ) + min {| λ qp | , | λ pq |} e · · · e j − , if i > j > . In these formulas we omit the subscripts p , q when the invariants of the twotypes coincide (cf. Remark 3.5).Proof. The case j = 0 was seen in (8). The cases i < j and i = j , φ j, q = φ ( p , q ),are a consequence of (11). NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 17
Suppose i > j > φ j, p = φ j, q ; we have then, φ ( p , q ) = φ j, p = φ j, q and λ qp = λ j, p , λ pq = λ j, q . We compute v p ( φ i, q ( θ )) by applying Proposition 2.1 to thepolynomial g ( x ) = φ i, q ( x ) and the type t p . Since v j, p = v j, q and φ j, p = φ j, q , wehave N j, p ( φ i, q ) = N j, q ( φ i, q ). On the other hand, we saw in the proof of Lemma 1.2that N j, q ( φ i, q ) is one-sided of slope λ j, q . Figure 3 shows the three possibilities forthe line L λ j, p of slope λ j, p that first touches N j, p ( φ i, q ) from below. • • ❅❅❅❅❅ ❅❅❅❅❅ .............................. v j ( φ i, q ) m i, q /m j λ j, q L λ j, p H λ j, p < λ j, q •• ❅❅❅❅❅ ❅❅❅❅❅ ....... ....... v j ( φ i, q ) m i, q /m j λ j, q L λ j, p H λ j, p = λ j, q •• ❅❅❅❅❅ ❅❅❅❅❅ ............................................... v j ( φ i, q ) m i, q /m j λ j, q L λ j, p H λ j, p > λ j, q Figure 3A glance at Figure 3 shows that H = v j ( φ i, q ) + m i, q m j min {| λ j, p | , | λ j, q |} = m i, q m j ( v j ( φ j ) + min {| λ j, p | , | λ j, q |} ) , the last equality by Lemma 1.2. Now, if λ j, p = λ j, q , the line L λ j, p touches thepolygon only at one point, and the residual polynomial R j, p ( φ i, q )( y ) is a constant.If λ j, p = λ j, q , then L λ j, p contains N j, p ( φ i, q ) and R j, p ( φ i, q ) = R j, q ( φ i, q ) is a powerof ψ j, q , up to a multiplicative constant. In this case, necessarily ψ j, q = ψ j, p , by thedefinition of j = i ( t p , t q ). Therefore, Trunc j ( t p ) never divides φ i, q , and Proposition2.1 shows that v ( φ i, q ( θ p )) = H/ ( e · · · e j − ). By (7), we get the desired expressionfor v p ( φ i, q ( θ )).Suppose now i > j > φ j, p = φ j, q , or i = j , φ j, q = φ ( p , q ). Consider a new type˜ t p , constructed as follows: if φ j, p = φ ( p , q ), we take ˜ t p = t p , and if φ j, p = φ ( p , q ),we take˜ t p = ( φ ; λ , φ ; · · · , φ j − ; λ j − , φ ( p , q ); λ qp , φ j, p ; λ j, p − λ qp , φ j +1 , p ; λ j +1 , p , · · · , φ r p +1 , p ; λ r p +1 , p , ψ r p +1 , p ) . By [GMN08, Cor.3.6], ˜ t p is a type, and it is also f -complete. If φ j, p = φ ( p , q ) then˜ t p is not optimal because deg φ ( p , q ) = deg φ j, p , but optimality is not necessary toapply Proposition 2.1.We consider an analogous construction for ˜ t q . The new types satisfy i (˜ t p , ˜ t q ) = j and they have the same j -th φ -polynomial; finally if i = j , the polynomial φ i, q isthe ( j + 1)-th φ -polynomial of ˜ t q . Therefore, the computation of v p ( φ i, q ) is deducedby the same arguments as above. (cid:3) We are ready to construct the family { b p } p ∈ P . Consider the following equivalencerelation in the set P : p ∼ q ⇐⇒ ψ , p = ψ , q , and denote by [ p ] the class of any p ∈ P .For each class [ p ], let φ , [ p ] ( x ) ∈ Z [ x ] be the first φ -polynomial in any list Ref q for some q ∈ [ p ]; we saw in the first remark following Definition 3.7 that all lists Ref q , for q ∈ [ p ], have the same initial φ -polynomial. Now, for each q ∈ [ p ], denoteby λ , q the first slope in the list Ref q . In other words, for any q ∈ [ p ], we have( φ , [ p ] , λ , q ) = ( φ , q , λ , q ) , if Refinements , q is empty , (cid:16) φ (1)1 , q , λ (1)1 , q (cid:17) , if Refinements , q is not empty . By (8) and (9),(12) v q ( φ , [ p ] ( θ )) = ( , if q [ p ] ,e ( q /p ) | λ , q | , if q ∈ [ p ] . Consider now, for each class [ p ]: B [ p ] ( x ) := Y [ q ] =[ p ] φ , [ q ] ( x ) . Fix a prime ideal p ∈ P . If p ] = 1, the element b p = ( B [ p ] ( θ )) satisfies (10)already. Suppose now p ] >
1. For all l ∈ [ p ], l = p , let φ l = φ r l +1 , l be the Montesapproximation to f l ( x ) contained in t l ; consider the least positive numerator anddenominator of the rational number v p ( φ l ( θ )) /e ( p /p ) (which has been computed inProposition 3.8): v p ( φ l ( θ )) e ( p /p ) = n l d l , gcd( n l , d l ) = 1 . We look for an integral element of the form:(13) b p = ( B [ p ] ( θ )) m Q l ∈ [ p ] , l = p φ l ( θ ) d l p N , where the exponents N, m are given by N = X l ∈ [ p ] , l = p n l , m = & max q ∈ P , q [ p ] ( N e ( q /p ) + 2 e ( q /p ) | λ , q | )' . Take q [ p ]. By (8) and (12), we have v q Y l ∈ [ p ] , l = p φ l ( θ ) d l = 0 , v q ( B [ p ] ( θ )) = v q ( φ , [ q ] ( θ )) = e ( q /p ) | λ , q | . Hence, v q ( p N b p ) = m e ( q /p ) | λ , q | ≥ N e ( q /p ) + 2, so that v q ( b p ) >
1, as desired.For the prime p itself, we have v p ( B [ p ] ( θ )) = 0 and, by construction, v p ( b p ) = X l ∈ [ p ] , l = p d l v p ( φ l ( θ )) − N e ( p /p ) = 0 . Finally, for a prime l ∈ [ p ], l = p , we have v l ( B [ p ] ( θ )) = 0 and v l ( b p ) = V + V − N e ( l /p ) , V := X l ′ ∈ [ p ] , l ′ = p , l v l ( φ l ′ ( θ ) d l ′ ) , V := v l ( φ l ( θ ) d l ) . Lemma 3.6 and Proposition 3.8 show that V (as all invariants we used so far)depends only on the numerical invariants of the types t l , t l ′ , of level 1 ≤ i ≤ i ( t l , t l ′ ) ≤ min { r l , r l ′ } , and not on the quality of the Montes approximations φ l ′ . NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 19
On the other hand, V depends on the choice of φ l as a Montes approximation of f l ( x ); by (11): V = v l ( φ l ( θ ) d l ) = d l e ( l /p ) v r l +1 , l ( φ l ) + h r l +1 , l e , l · · · e r l , l = d l ( v r l +1 , l ( φ l ) + h r l +1 , l ) . Hence, for all l ∈ [ p ], l = p , we improve the Montes approximation φ l till we get h r l +1 , l ≥ N e ( l /p ) − V d l − v r l +1 , l ( φ l ) . This ensures that v l ( b p ) >
1, as desired.3.3.
Two-element representation of a fractional ideal.
Any fractional ideal a of K admits a two-element representation: a = ( ℓ, α ), where α ∈ K and ℓ = ℓ ( a ) ∈ Q is the least positive rational number contained in a . It is straightforwardto obtain such a representation from the two-element representation of the primeideals obtained in the last section. For the sake of completeness we briefly describethe routine. For each prime ideal p of K , we have computed an integral element α p ∈ Z K such that v p ( α p ) = 1 , v q ( α p ) = 0 , ∀ q | p, q = p . These elements are of the form: α p = p ν p h p ( θ ), where ν p ∈ Z and h p ( x ) ∈ Z [ x ] isa primitive polynomial. Generically, ν p ≤
0, except for the special case p = p Z K ,where ν p = 1, h p ( x ) = 1. Let us writeN K/ Q ( h p ( θ )) = p µ p N p , with p ∤ N p . Suppose first that a = Q p | p p a p has support only in prime ideals dividing p . Wetake then: α = Y p | p α a p p Y a p < N | a p | p , H := (cid:24) max p | p (cid:26) a p e ( p /p ) (cid:27)(cid:25) . One checks easily that ℓ ( a ) = p H and a = ( p H , α ).In the general case, we write a = Q p ∈P a p , where P is a finite set of primenumbers and a p is divided only by prime ideals lying over p . For each a p we finda two-element representation a p = ( p H p , α p ); then, the two-element representationof a is: a = Y p ∈P p H p , X p ∈P Y q ∈P , q = p q H q +1 α p . Note that the second generator α constructed in this way satisfies: v p ( α ) = v p ( a ),for all p with v p ( a ) = 0, which is slightly stronger than the condition a = ( ℓ, α ).4. Residue classes and Chinese remainder theorem
In this section we show how to compute residue classes modulo prime ideals, andwe design a chinese remainder theorem routine. As in the previous sections, thiswill be done without constructing (a basis of) the maximal order of K and withoutthe necessity to invert elements in the number field. Only some inversions in thefinite residue fields are required.For any prime ideal p of K we keep the notations for t p , f p ( x ), φ p ( x ), F p , θ p , K p , Z K p , as introduced in section 2. Residue classes modulo a prime ideal.
Let p be a prime ideal of K ,corresponding to an f -complete type t p with an added ( r + 1)-th level, as indicatedin section 1.4.The finite field F p := F r +1 may be considered as a computational representationof the residue field Z K / p . In fact, fix the topological embedding, ι p : K ֒ → K p , de-termined by sending θ to θ p , and consider the reduction modulo p map obtained bycomposition of the embedding Z K ֒ → Z K p with the local reduction map constructedin (6): red p : Z K ֒ → Z K p lred p −→ F p . The commutative diagram: Z K ֒ → Z K p lred p −→ F p ↓ ↓ k Z K / p −→ ∼ Z K p / p Z K p γ − −→ ∼ F p shows that our reduction map red p coincides with the canonical reduction map, Z k −→ Z K / p , up to certain isomorphism Z K / p −→ ∼ F p .The problem has now a computational perspective; we want to find a routinethat computes red p ( α ) ∈ F p for any given integral element α ∈ Z K . To this end,it is sufficient to have a routine that computes lred p ( α ) ∈ F p , for any p -integral α ∈ K . Let us show that this latter routine may be based on item 2 of Proposition2.1 and Lemma 1.4.Any α ∈ Z K can be written in a unique way as: α = ab g ( θ ) p N , where a, b are positive coprime integers not divisible by p and g ( x ) ∈ Z [ x ] is aprimitive polynomial. Clearly,red p ( α ) = lred p ( ι p ( α )) = lred p ( a/b ) lred p ( g ( θ p ) /p N ) , and lred p ( a/b ) ∈ F p is the element in the prime field determined by the quotient ofthe classes modulo p of a and b . Thus, we need only to compute lred p ( g ( θ p ) /p N ).If N = 0, then lred p ( g ( θ p )) = red p ( g ( θ )) is just the class of g ( x ) modulo theideal ( p, φ , p ( x )). In other words, if g ( x ) ∈ F [ x ] is the polynomial obtained byreduction of the coefficients of g ( x ) modulo p , then red p ( g ( θ )) = g ( z ) ∈ F , p ⊆ F p .If N >
0, we look for the first index, 1 ≤ i ≤ r + 1, for which the truncationTrunc i ( t ) does not divide g ( x ). In the paragraph following Proposition 2.1 weshowed that this will always occur, eventually (for i = r + 1) after improving theMontes approximation φ p = φ r +1 . By Proposition 2.1, there is a computable point( s, u ) ∈ N i ( g ) such that v ( g ( θ p )) = ( sh i + ue i ) / ( e · · · e i ) = v (Φ i ( θ p ) s π i ( θ p ) u ), andlred p (cid:18) g ( θ p )Φ i ( θ p ) s π i ( θ p ) u (cid:19) = R i ( g )( z i ) = 0 . Now, if ( sh i + ue i ) / ( e · · · e i ) > N , we have lred p ( g ( θ p ) /p N ) = 0; on the other hand,if ( sh i + ue i ) / ( e · · · e i ) = N , we have(14) lred p (cid:18) g ( θ p ) p N (cid:19) = R i ( g )( z i ) · lred p (cid:18) Φ i ( θ p ) s π i ( θ p ) u p N (cid:19) = R i ( g )( z i ) z t · · · z t i i , NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 21 where p − N Φ i ( θ p ) s π i ( θ p ) u = γ t · · · γ t i i , and the vector ( t , . . . , t i ) ∈ Z i can be foundby the procedure of Lemma 1.4, applied to the input vectorlog (cid:0) p − N Φ i ( x ) s π i ( x ) u (cid:1) = ( − N, , . . . ,
0) + s log Φ i + u log π i . Since log Φ i , log π i have been stored as secondary invariants of t p , we get in thisway a really fast computation of lred p ( p − N g ( θ p )).This ends the computation of the reduction modulo p map red p .4.2. Chinese remainder theorem.
It is straightforward to design a chinese re-mainders routine once the following problem is solved.
Problem.
Let p be a prime number, P the set of prime ideals of K lying above p ,and ( a p ) p ∈ P a family of non-negative integers. Find a family ( c p ) p ∈ P of integralelements c p ∈ Z K such that, c p ≡ p a p ) , c p ≡ q a q ) , ∀ q ∈ P , q = p , for all p ∈ P . There is an easy solution to this problem: take the element b p ∈ Z K satis-fying (10), constructed in section 3.2, and consider c p = ( b p ) p t ( q p − , where q p =N K/ Q ( p ) = F p , and t is sufficiently large. However, the element c p constructedin this way is not useful for practical purposes because it may have a huge normand a huge height (very large numerators or denominators of the coefficients of itsstandard representation as a polynomial in θ ), if q p or t are large. Instead, we shallrefine the construction of the element b p to get a small size solution c p to the aboveproblem.First we deal with the particular case a p = 1. The idea is to get an element b p ∈ Z K satisfying v p ( b p ) = 0 , v q ( b p ) ≥ a q , ∀ q ∈ P , q = p , and then find β ∈ K such that v p ( β ) = 0, c p := b p β is integral, and c p ≡ p ).Since we know the two-element representation q = ( p, α q ) of the prime ideals, wecould take b p = Q q ∈ P , q = p ( α q ) a q . Again, this might lead to a b p with large size,so that a direct construction of b p is preferable in order to keep its size as small aspossible.Thus, we consider an element b p ∈ Z K as in (13): b p = ( B [ p ] ( x )) m Q l ∈ [ p ] , l = p φ l ( x ) d l p N , with N = P l ∈ [ p ] , l = p d l v ( φ l ( θ p )) = P l ∈ [ p ] , l = p n l . By construction, v p ( b p ) = 0.Let i = max q ∈ P , q = p { i ( t p , t q ) } ; Lemma 3.6 shows that i ≤ r p . From now on, weuse only invariants of the type t p and we drop the subindex p in the notation. Let M = , if i = 0 , (cid:24) v i +1 ( φ i +1 )) e · · · e i (cid:25) , if i > . Arguing as in section 3.2, we can take m sufficiently large, and each φ l ( x ) suffi-ciently close to the p -adic irreducible factor f l ( x ), so that(15) v q ( b p ) ≥ a q + M e ( q /p ) , ∀ q ∈ P , q = p , while keeping the denominator p N and the condition v p ( b p ) = 0. In particular, b p belongs to Z K . The idea is to multiply b p by some element in K that conve-niently modifies its residue class modulo p . We split this task into two parts, thatmay be considered as a kind of respective inversion modulo p of ( B [ p ] ( θ )) m and p − N Q l ∈ [ p ] , l = p φ l ( θ ) d l .Let h ( x ) = ( B [ p ] ( x )) m . Then, ζ := red p ( h ( θ )) ∈ F ⊆ F p is just the classof h ( x ) modulo the ideal ( p, φ ( x )). We invert ζ in F and represent the inverse ζ − = P ( z ), as a polynomial in z of degree less than f , with coefficients in theprime field F . Take β = P ( θ ), where P ( x ) ∈ Z [ x ] is an arbitrary lift of P ( x );clearly, h ( θ ) β ≡ p ).Let now g ( x ) = p − N Q l ∈ [ p ] , l = p φ l ( x ) d l . If [ p ] = { p } , then i = 0, N = M = 0, g ( x ) = 1 and we are done. Suppose [ p ] ! { p } , so that 1 ≤ i ≤ r p . By the definitionof the index of coincidence, we have Trunc i ( t p ) ∤ φ l ( x ), for all l = p ; by the Theoremof the product [HN08, Thm.2.26], Trunc i ( t p ) ∤ g ( x ). Therefore, as we saw in thelast section, ξ := lred p ( p − N g ( θ p )) = R i ( g )( z i ) z t · · · z t i i ∈ F i +1 , for some easily computable sequence of integers ( t , . . . , t i ). Let V = e · · · e i M ; by[HN08, Cor.3.2], v (cid:0) π i +1 ( θ p ) V (cid:1) = M . Compute a vector ( t ′ , . . . , t ′ i ) ∈ Z i such that p − M π i +1 ( x ) V = γ t ′ · · · γ t ′ i i , as indicated in Lemma 1.4, and take ξ ′ := z t ′ · · · z t ′ i i ∈ F i +1 . Let ϕ ( y ) ∈ F i [ y ] be the unique polynomial of degree less than f i , such that ϕ ( z i ) = z ℓ i V/e i i ( ξξ ′ ) − . Let ν = ord y ϕ ( y ). Clearly, V ≥ v i +1 ( φ i +1 ) = e i f i v i +1 ( φ i ) , the last equality by [HN08, Thm.2.11]. Therefore, we can apply the constructivemethod described in [HN08, Prop.2.10] to compute a polynomial P ( x ) ∈ Z [ x ] sa-tisfying the following properties:deg P ( x ) < m i +1 , v i +1 ( P ) = V, y ν R i ( P )( y ) = ϕ ( y ) . A look at the proof of [HN08, Prop.2.10] shows that N i ( P ) is one sided of slope λ i and its end points have abscissa e i ν and e i deg ϕ (cf. Figure 4). •• ❍❍❍❍❍❍❍❍❍❍❍❍ ❍❍❍❍❍ N i ( P ) L λ i V/e i e i deg ϕe i ν Figure 4
Claim: lred p ( p − M P ( θ p )) = ξ − .In fact, since deg P ( x ) < m i +1 and v i +1 ( P ) = V , the Newton polygon N i +1 ( P )is the single point (0 , V ); in particular, Trunc i +1 ( t p ) does not divide P ( x ) andProposition 2.1 shows that v ( P ( θ p )) = M andlred p (cid:0) P ( θ p ) /π i +1 ( θ p ) V (cid:1) = R i +1 ( P )( z i +1 ) = 0 . NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 23
Actually, R i +1 ( P )( y ) has degree 0 and it represents a constant in F i +1 that wedenote simply by R i +1 ( P ). By (14),lred p (cid:0) p − M P ( θ p ) (cid:1) = R i +1 ( P ) lred p ( p − M π i +1 ( θ p ) V ) = R i +1 ( P ) ξ ′ . By the very definition of the residual polynomial [HN08, Defs.2.20+2.21], we have R i +1 ( P ) = z ( e i ν − ℓ i V ) /e i i R i ( P )( z i ) = z − ℓ i V/e i i ϕ ( z i ) = ( ξξ ′ ) − , and the Claim is proven.Finally, consider c p = b p β ( p − M P ( θ )) . The condition (15) ensures that c p belongs to Z K (although p − M P ( θ ) might notbe integral) and satisfies v q ( c p ) ≥ a q , for all q ∈ P , q = p . By construction,red p ( c p ) = lred p ( ι p ( c p )) = 1.It remains to solve our Problem when a p >
1. In this case, we find c ∈ Z K suchthat c ≡ p ) , c ≡ q a q ) , ∀ q ∈ P , q = p , and we take c p = ( c − m + 1, where m is the least odd integer that is greater thanor equal to a p /v p ( c − p -integral bases Let p be a prime number and let F p be the prime field of characteristic p .A p -integral basis of K is a family of n Z -linearly independent integral elements α , . . . , α n ∈ Z K such that p ∤ (cid:0) Z K : (cid:10) α , . . . , α n (cid:11) Z (cid:1) , or equivalently, such that the family α ⊗ , . . . , α n ⊗ F p -linearly independentin the F p -algebra Z K ⊗ Z F p .If the discriminant disc( f ) of f ( x ) may be factorized, the computation of anintegral basis of K (a Z -basis of Z K ) is based on the computation of p -integralbases for the different primes p that divide disc( f ).Anyhow, even when disc( f ) may not be factorized, the computation of a p -integral basis of K for a given prime p is an interesting task on its own. In thissection we show how to carry out this task from the data captured by the Okutsu-Montes representations of the prime ideals p lying over p . For any such prime idealwe keep the notations for f p ( x ), φ p ( x ), F p , θ p , K p , Z K p , as introduced in section 2.5.1. Local exponent of a prime ideal.
Let P be the set of prime ideals lyingover p . For any p ∈ P we fix the topological embedding K ֒ → K p determined bysending θ to θ p . Definition 5.1.
We define the local exponent of p ∈ P to be the least positiveinteger exp( p ) such that p exp( p ) Z K p ⊆ Z p [ θ p ] . Note that exp( p ) is an invariant of the irreducible polynomial f p ( x ) ∈ Z p [ x ] , but itis not an intrinsic invariant of p . The computation of exp( p ) is easily derived from the results of [GMN09b].Let p = [ p ; φ , . . . , φ r , φ p ] be the Okutsu-Montes representation of p , as indicatedin section 1.4. By [GMN09b, Lem.4.5]: f p ( x ) ≡ φ p ( x ) (mod m ⌈ ν ⌉ ) , where ν = ν p + ( h r +1 /e ( p /p )) , and ν p is the rational number ν p := h e + h e e + · · · + h r e · · · e r . Caution: this number is not always an invariant of f p ( x ). If e r f r = 1, the Okutsudepth of f p ( x ) is R = r − h r depends on the choice of φ r .Denote φ ( x ) = x , m = 1, m r +1 = n p := e ( p /p ) f ( p /p ). Any integer 0 ≤ m For all p ∈ P , we have exp( p ) = ⌊ µ p ⌋ , where µ p := v r +1 ( φ r +1 ) e ( p /p ) − ν p = r X i =1 ( e i f i · · · e r f r − h i e · · · e i . Note that µ p is an Okutsu invariant, because it depends only on e i , f i , h i , for1 ≤ i ≤ R , where R is the Okutsu depth of f p ( x ). If R = r − 1, then e r f r = 1 andthe summand of µ p corresponding to i = r vanishes. NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 25 Computation of a p -integral basis. Along the computation of the primeideal decomposition of the ideal p Z K (by a single call to Montes algorithm) we caneasily store the local exponents exp( p ), and the numerators g m ( x ) and denominators p ν m of all Z p -bases of Z K p given in (16), for all p ∈ P .It is well-known how to derive a p -integral basis from all these local bases. Letus briefly describe a concrete procedure to do this, taken from [Ore25].We apply the method described at the end of section 3.2 to compute multipliers { b p } p ∈ P satisfying:(18) v p ( b p ) = 0 , v q ( b p ) ≥ (exp( p ) + 1) e ( q /p ) , ∀ q ∈ P , q = p . Consider the family obtained by multiplying each local basis (16) by its correspond-ing multiplier: B p := (cid:20) b p , b p g ( θ ) p ν , . . . , b p g n p − ( θ ) p ν n p − (cid:21) . Then, B := S p ∈ P B p is a p -integral basis of K .In fact, although the elements g m ( θ ) /p ν m are not (globally) integral, (18) showsthat the products α m, p := b p ( g m ( θ ) /p ν m ) belong all to Z K and satisfy v q ( α m, p ) ≥ e ( q /p ) , ∀ q ∈ P , q = p . It is easy to deduce from this fact that the family of all α m, p determines an F p -linearly independent family of the algebra Z K ⊗ Z F p .6. Some examples We have implemented the algorithms described above in a package for Magma.The arithmetic of number fields in any algebraic manipulator has to face two prob-lems: the factorization of the discriminant and the memory requirements for largedegrees. Our package allows the user to skip the first problem, while it uses verylittle memory, expanding Magma’s capabilities by far. The package which can bedownloaded from its web page ( http:/ma4-upc.edu/ ∼ guardia/+Ideals.html ),is described in detail in the accompanying paper [GMN10]. We include here afew examples which exhibit the power of the package in different situations. Moreexhaustive tests of Montes algorithm have been presented in [GMN08], [GMN09a].The computations in these examples have been done with Magma v2.15-11 in aLinux server, with two Intel Quad Core processors, running at 3.0 Ghz, with 32Gbof RAM memory.6.1. Large degree. Consider the number field K = Q ( θ ) given by a root θ ∈ Q ofthe polynomial f ( x ) = x + 2 x + 2 . The factorization of the discriminantof f is Disc( f ) = 2 p , with p = 337572698551220494882323528404563236947916489629537. The large de-gree of f makes impossible to work in this number field using the standard func-tions of Magma, even after factorizing the discriminant, since the computation ofthe integral basis is necessary for these functions. But our algorithms avoid thiscomputation, so that we can work with ideals in K . For instance, in the table below we show the local index of the primes dividing Disc( f ) and the time takento decompose them in K . Ideal Index Time2 Z K . s Z K . s Z K 20 0 . s Z K . s Z K . s Z K . s Z K . sp Z K s Thus, we need less than 90 seconds to see that the discriminant of K isDisc( K ) = 2 p . The running times in the table show clearly that the cost of the factorizationsincreases mainly because of the size of the numbers involved, and that the indexhas not a serious impact on them. The largest type appearing in these computationshas order 3, and it appears along the factorization of the ideal 2 Z K , which is2 Z K = p ( p ′ ) p ( p ′ ) p , where p ef stands for a prime ideal with residual degree f and ramification index e .While we cannot expect to factor the ideals I = ( θ + 50) Z K , J = ( θ + 10) Z K in areasonable time, it takes 0.03 seconds to compute the factorization of its sum: I + J = p ( p ′ ) p ( p ′ ) p . The decomposition of 5 in the maximal order Z K is5 Z K = p ( p ′ ) p ( p ′ ) p p p ( p ′ ) . With the residue map computation explained in subsection 4.1, we may check veryquickly that θ ≡ ζ (mod p ) , where Z K / p ≃ F [ ζ ], with ζ + 2 ζ + 3 = 0. The Chinese remainder algorithmworks also very fast in this number field.6.2. Small degree, large coefficients. The space of modular forms of level 1and degree 76 has dimension 6. The newforms in this space are defined over thenumber field K = Q ( θ ), where θ ∈ Q is a root of the polynomial: f ( x ) = x + 57080822040 x − x − x +9757628454131691442128845013041495838774263808 x +290013995562379500498435975003716024800114593761580810240 x − . The discriminant of f ( x ) isDisc( f ) = 2 · · · M, where M is a composite integer of 135 decimal figures which we have not been ableto factorize. J. Rasmussen asked us ([Ras10]) for a test to check certain divisibility NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 27 conditions on the ring of integers of K , related to his work on congruences satisfiedby the coefficients of certain modular forms. The time to find the decomposition ofthe primes in the set S := { , , , , , , , , , , , , , , } is almost negligible, since it involves only types of order at most 1. The table belowshows the local indices of these primes:Ideal Index2 Z K Z K Z K Z K Z K Z K Z K Z K Z K Z K Z K Z K Z K Z K Z K K is Disc( K ) = 59 · N , where N is divisible by atleast one of the prime factors of M , since M is not a square. The ideal primedecomposition of 3 in Z K is 3 Z K = p p p ′ p ′′ p ′′′ . The algorithm explained in section 3 provides generators for all these ideals: p = 3 Z K + 3 − (4 θ + 4311 θ + 1717038 θ + 2900691 θ + 820125 θ + 2834352) Z K p = 3 Z K + 3 − (2 θ + 1815 θ + 586980 θ + 732159 θ + 658287 θ + 1535274) Z K p ′ = 3 Z K + 3 − (2 θ + 2031 θ + 662796 θ + 1123632 θ + 1071630 θ + 295245) Z K p ′′ = 3 Z K + 3 − (2 θ + 2307 θ + 910872 θ + 847584 θ + 398034 θ + 1121931 Z K p ′′′ = 3 Z K + 3 − (2 θ + 2091 θ + 708696 θ + 646380 θ + 634230 θ + 1121931) Z K Applying the algorithm described in section 4, we can compute without much effortan element α ∈ K satisfying α ≡ p ) , α ≡ θ (mod p ) ,α ≡ θ (cid:0) mod ( p ′ ) (cid:1) , α ≡ θ (cid:0) mod ( p ′′ ) (cid:1) , α ≡ θ (cid:0) mod ( p ′′′ ) (cid:1) . We may take, for instance: α = 3 − (786086 θ + 445989 θ + 196857 θ + 1159353 θ + 649539 θ + 354294) . Following the algorithm for p -adic valuations introduced in section 2, we can checkthis result computing the valuations of the differences r − θ j at the prime idealsdividing 3: v p ( α − 1) = 1 , v p ( α − θ ) = 7 , v p ′ ( α − θ ) = 4 , v p ′′ ( α − θ ) = 4 , v p ′′′ ( α − θ ) = 4 . All these computations are almost immediate. Even the computation of an S -integral basis takes only 0.06 seconds.6.3. Medium degree. Consider the polynomials: φ = x + 1 , φ = φ + 2 ,φ = φ + 8 , φ = φ + 4 φ φ + 32 ,φ = φ + 256 φ , f = φ φ + 2 . Let K = Q ( θ ) be the number field of degree 20 determined by a root θ ∈ Q of f . Forthe prime p = 2, the polynomial f has two complete types, with associated Okutsuframes [ φ , φ ] and [ φ , φ , φ ], which give rise to the two prime ideals of Z K over2. The concrete decomposition is 2 Z K = p p , where f ( p i / 2) = i , e ( p i / 2) = 4 i .The discriminant of f isDisc( f ) = 2 · · · · · · · · . In this example we may compare the performance of the standard Magma func-tions and that of our package, since Magma can determine the ring of integers of K .Once the factorization of Disc( f ) is known, Magma takes 5.8 seconds to determine Z K , and 0.08 seconds to find the decomposition of the prime 2 in Z K . Our packagetakes 0.3 seconds to see that Disc( K ) = 2 − Disc( f ), and during this computationalready finds the decomposition of all the primes dividing the discriminant. Ourprogram can also compute a 2-integral basis of K , which is already a global integralbasis, in 0.02 seconds. 7. Conclusions Challenges. We described routines to perform the basic tasks concerningfractional ideals of a number field, based on the Okutsu-Montes representations ofthe prime ideals [Mon99], [HN08]. This avoids the factorization of the discriminantof a defining equation and the construction of the maximal order. These routinesare very fast in practice, as long as one deals with fractional ideals whose normmay be factorized.A big challenge arises: is it possible to combine these techniques with some kindof LLL reduction to test if a fractional ideal is principal?Also, the generators of the prime ideals constructed in this paper have smallheight as vectors in Q n (the coefficients of its standard representation as a poly-nomial in θ ). This may have some advantages, but in many applications it ispreferable to have generators of small norm. A solution to the above mentionedchallenge would probably lead to a procedure to find generators of small norm too.7.2. Comparison with the standard methods. Suppose the discriminant ofthe defining equation of the number field may be factorized. Most of the methodsto compute a Z -basis of the maximal order are based on variants of the Round 2and Round 4 algorithms of Zassenhaus. The procedure of section 5 yields a muchfaster computation of an integral basis and the discriminant of the field.Once the maximal order is constructed, we can compare our routines for themanipulation of fractional ideals with the standard ones. The routines based onthe Okutsu-Montes representations of the prime ideals are faster, mainly because NEW COMPUTATIONAL APPROACH TO IDEAL THEORY IN NUMBER FIELDS 29 they avoid the usual linear algebra techniques (computation of bases of the ideals,Hermite and Smith normal forms, etc.), which become slow if the degree of thenumber field grows.7.3. Curves over finite fields. The results of these paper are easily extendableto function fields. If C is a curve over a finite field, there is a natural identificationof rational prime divisors of C with prime ideals of the integral closures of certainsubrings of the function field [Hess99], [Hess02]. Montes algorithm may be appliedas well to construct these prime ideals, and the routines of this paper lead to parallelroutines to find the divisor of a function, or to construct a function with zeros andpoles of a prescribed order, at a finite number of places.The results of section 5 may be used to efficiently compute bases of the abovementioned integral closures too. However, the big challenge of section 7.1 has itsparallel in the geometric situation: we hope that the techniques of this paper maybe used to find better routines to compute bases of the Riemann-Roch spaces andto deal with reduced divisors. This would open the door to operate in the groupPic ( C ) of rational points of the Jacobian of C , for curves with plane models ofvery large degree. References [Ded78] R. Dedekind, ¨Uber den Zusammenhang zwischen der Theorie der Ideale und der Theorieder h¨oheren Kongruenzen , Abhandlungen der K¨oniglichen Gesellschaft der Wissenschaften zuG¨ottingen (1878), pp. 1–23.[FV10] D. Ford, O. Veres, On the Complexity of the Montes Ideal Factorization Algorithm , in G.Hanrot and F. Morain and E. Thom´e, Algorithmic Number Theory , , LNCS, Springer Verlag 2010.[HN08] J. Gu`ardia, J. Montes, E. Nart, Newton polygons of higher order in algebraic numbertheory , arXiv:0807.2620v2 [math.NT].[GMN08] J. Gu`ardia, J. Montes, E. Nart, Higher Newton polygons in the computation of dis-criminants and prime ideal decomposition in number fields , arXiv:0807.4065v3[math.NT].[GMN09a] J. Gu`ardia, J. Montes, E. Nart, Higher Newton polygons and integral bases , arXiv:0902.4428v1[math.NT].[GMN09b] J. Gu`ardia, J. Montes, E. Nart, Okutsu invariants and Newton polygons , Acta Arith-metica, to appear, arXiv: 0911.0286v3[math.NT].[GMN10] J. Gu`ardia, J. Montes, E. Nart, Arithmetic in big number fields: The ’+Ideals’ package,arXiv: 1005.4596v1[math.NT].[GNP10] J. Gu`ardia, E. Nart, S. Pauli, Single-factor lift for polynomials over local fields , inpreparation.[Hen08] K. Hensel, Theorie der algebraischen Zahlen , Teubner, Leipzig, Berlin, 1908.[Hess99] F. Hess, Zur Divisorenklassengruppenberechnung in globalen Funktionenk¨orpern , Ph. D.Thesis, Technische Universit¨at Berlin 1999.[Hess02] F. Hess, Computing Riemann-Roch spaces in algebraic function fields and related topics ,Journal of Symbolic Computation 33 (2002), 425–445.[Mon99] J. Montes, Pol´ıgonos de Newton de orden superior y aplicaciones aritm´eticas , Tesi Doc-toral, Universitat de Barcelona 1999.[Oku82] K. Okutsu, Construction of integral basis, I, II , Proceedings of the Japan Academy, ,Ser. A (1982), 47–49, 87–89.[Ore23] Ø. Ore, Zur Theorie der algebraischen K¨orper , Acta Mathematica (1923), pp. 219–314.[Ore25] Ø. Ore, Bestimmung der Diskriminanten algebraischer K¨orper , Acta Mathematica (1925), pp. 303–344.[Ras10] Rasmussen, J., Personal communication. Departament de Matem`atica Aplicada IV, Escola Polit`ecnica Superior d’Enginyerade Vilanova i la Geltr´u, Av. V´ıctor Balaguer s/n. E-08800 Vilanova i la Geltr´u,Catalonia E-mail address : [email protected] Departament de Ci`encies Econ`omiques i Socials, Facultat de Ci`encies Socials, Uni-versitat Abat Oliba CEU, Bellesguard 30, E-08022 Barcelona, Catalonia, Spain E-mail address : [email protected] Departament de Matem`atiques, Universitat Aut`onoma de Barcelona, Edifici C, E-08193 Bellaterra, Barcelona, Catalonia, Spain E-mail address ::