Proving modularity for a given elliptic curve over an imaginary quadratic field

We present an algorithm to determine if the $L$-series associated to an automorphic representation and the one associated to an elliptic curve over an imaginary quadratic field agree. By the work of Harris-Soudry-Taylor, Taylor and Berger-Harcos (cf. \cite{harris-taylor}, \cite{taylorII} and \cite{berger-harcos}) we can associate to an automorphic representation a family of compatible $p$-adic representations. Our algorithm is based on Faltings-Serre's method to prove that $p$-adic Galois representations are isomorphic.


Introduction
Modularity for rational elliptic curves was one of the biggest achievements of last century.Little is known for general number fields.In the case of totally real number fields some techniques do apply, but the result is far from being proven.The case of not totally real fields is more intractable to Taylor-Wiles machinery.In this paper we present an algorithm to determine if the L-series associated to an automorphic representation and the one associated to an elliptic curve over an imaginary quadratic field agree or not.The algorithm is based on Faltings-Serre's method to prove isomorphism of p-adic Galois representation.By the work of Harris-Soudry-Taylor, Taylor and Berger-Harcos (cf.[HST93], [Tay94] and [BH]) we can associate to an automorphic representation a family of compatible p-adic representations, and an elliptic curve has such a family of representations as well in the natural way.
The paper is organized as follows: on the first section we present the algorithms (which depend on the residual representations).On the second section we review the results of p-adic representations attached to automorphic forms on imaginary quadratic fields.On the third section we explain Falting-Serre's method on Galois representations.On the fourth section we prove that the algorithm gives the right answer.At last we show some examples and some GP code writen for the examples.

Algorithm
Let K be an imaginary quadratic field, E be an elliptic curve over K and f an automorphic form on GL 2 (A K ) whose L-series we want to compare.This algorithm answers if the 2-adic Galois representations attached to both objects are isomorphic and if the original L-series are equal.Since these Galois representations come in compatible families, in particular the algorithm determines whether the p-adic Galois representations are isomorphic or not for any prime p.It depends on the residual image of the elliptic curve representation.
The input in all cases is: K, E, n(E) (the conductor of E), n(f ) (the level of f ) and a p (f ) for some prime ideals p to be determined.By L E we denote the field obtained from K by adding the coordinates of the 2-torsion points of E.
Notation.By Q we denote an algebraic closure of Q.Let K be an imaginary quadratic extension of Q, and α an element of K.By ᾱ we denote conjugate of α.
Let L/K be field extensions and p ⊂ O K .For q ⊂ O L a prime ideal above p, we denote e(q|p) the ramification index.
(1) Let m K ⊂ O K be given by m K := p|2n(E)n(f )n(f )∆(K) p e(p) where Compute the ray class group Cl(O K , m K ).
(2) Identify the character ψ corresponding to the unique quadratic extension of K contained on L E on the computed basis.
(3) Extend {ψ} to a basis {ψ, χ i } n i=1 of the quadratic characters of Cl(O K , m).Compute prime ideals {p j } n ′ j=1 with p j ⊂ O K , p j ∤ m K , and with inertial degree 3 on L E such that (log(χ 1 (p j )), . . ., log(χ n (p j ))) n ′ j=1 = (Z/2Z) n (where we take any root of the logarithm and identify log(±1) with Z/2Z).(4) If Tr(ρ f (Frob pj )) is odd for 1 ≤ j ≤ n ′ , ρf has image isomorphic to C 3 or to S 3 with the same intermediate quadratic field as ρE .If not, end with output "the two representations are not isomorphic".(5) Compute a basis {χ i } m i=1 of cubic characters of Cl(O K , m K ) and a set of ideals {p i } m ′ i=1 such that ψ(p i ) = −1 or p i splits completely on L E and (log(χ 1 (p j )), . . ., log(χ m (p j ))) m ′ j=1 = (Z/3Z) m .(6) If Tr(ρ f (Frob pj )) is even for 1 ≤ j ≤ m ′ , ρf has S 3 image with the same intermediate quadratic field as ρE .If not, end with output "the two representations are not isomorphic".(7) Let K E be the degree two extension of K contained in L E and m KE ⊂ O KE be given by m KE := p|2n(E)n(f )n(f )∆(K) p e(p) where Compute the ray class group Cl(O KE , m KE ).(8) Identify the character ψ E corresponding to the cubic extension L E on the computed basis and extend it to a basis {ψ E , χ i } m i=1 of order three characters of Cl(O KE , m KE ).Compute prime ideals {p j } m ′ j=1 with p j ⊂ O K , ψ E (p j ) = 1 and such that (log(χ 1 (p j )), . . ., log(χ n (p j ))) (where we take any identification of the cubic roots of unity with Z/3Z).If Tr(ρ f (Frob pj )) ≡ Tr(ρ E (Frob pj )) (mod 2) for 1 ≤ j ≤ m ′ , both residual representations are isomorphic.If not, end with output "the two representations are not isomorphic".(9) Let m LE ⊂ O LE be the modulus m LE = q|2n(E)n(f )n(f )∆(K) q e(q) where e Compute the ray class group Cl(O LE , m LE ).Let {χ i } n i=1 be a basis for its quadratic characters (dual to the ray class group one computed).(10) Compute the Galois group Gal(L E /K).(11) (Computing invariant subspaces) Let σ be an order 3 element of Gal(L E /K) and solve the homogeneous system Denote by V σ the kernel.(12) Take τ an order 2 element of Gal(L/K) and compute V τ , the kernel of the same system for τ .(13) Intersect V σ with V τ .Let {χ i } m i=1 be a basis of the intersection.This gives generators for the S 3 × C 2 extensions.(14) Compute a set of ideals {p i } m ′ i=1 with p i ⊂ O K and p i ∤ m K such that (log(χ 1 (p j )), . . ., log(χ n (p j ))) where pi is any ideal of L E above p i .(15) If Tr(ρ f (Frob pi )) = Tr(ρ E (Frob pi )) for 1 ≤ i ≤ m then the two representations agree on order 6 elements, else end with output "the two representations are not isomorphic".(16) For σ an order three element, solve the homogeneous system be a basis of such subspace.This characters give all the S 4 extensions.(18) Compute a set of ideals

2.2.
Residual image trivial or isomorphic to C 2 .
(1) Chose prime ideals P i , i = 1, 2 such that 2 has no inertial degree on where α i is a root of Frob Pi .If Tr(ρ E (Frob Pi )) = Tr(ρ f (Frob Pi )), end with output "the two representations are not isomorphic".(2) Let m K ⊂ O K be given by m Compute the ray class group Cl(O K , m K ).
(3) For each index two subgroup of Cl(O K , m K ) (plus the whole group), take the corresponding quadratic (or trivial) extension L. In L, take the modulus p) , where and compute the ray class group Cl(O L , m L ). (4) Compute a set of generators {χ j } n j=1 for the cubic characters of Cl(O L , m L ), and find prime ideals {q j } n ′ j=1 of O L , with q j ∤ m L and such that (log(χ 1 (q j )), . . ., log(χ n (q j ))) n ′ j=1 = (Z/3Z) n .(5) Consider the collection {p 1 , . . ., p m } of all prime ideals of O K which are below the prime ideals found on step (3).(6) If Tr(ρ f (Frob pi )) ≡ 0 (mod 2) for each i = 1, . . ., m, then ρf has image trivial or isomorphic to C 2 .Otherwise, output "the two representations are not isomorphic".(7) Compute a basis Remark 1.The algorithm can be slightly improved.In step (8), instead of aiming at the whole C r 2 , we can stop when we reach a non-cubic set.Definition.Let V be a finite dimensional vector space.A subset T of V is called non-cubic if each homogeneous polynomial on V of degree 3 that is zero on T , is zero on V .
In particular, the whole space V is non-cubic.
(1) Chose prime ideals P i , i = 1, 2 such that 2 has no inertial degree on where α i is a root of Frob Pi .If Tr(ρ E (Frob Pi )) = Tr(ρ f (Frob Pi )), end with output "the two representations are not isomorphic".
(2) Let m K ⊂ O K be given by m p) , where Compute the ray class group Cl(O K , m K ).(3) Identify the character ψ E corresponding to the cubic Galois extension L E on the computed basis.(4) Find a basis {χ i } n i=1 of the quadratic characters of Cl(O K , m K ).Compute prime ideals {p j } n ′ j=1 with p j ⊂ O K , p j ∤ m, ψ(p j ) = 1 and such that (log(χ 1 (p j )), . . ., log(χ n (p j ))) ) n (where we take any root of the logarithm and identify log(±1) with Z/2Z).
(5) If Tr(ρ f (Frob pj )) is odd for 1 ≤ j ≤ n ′ , ρf has image isomorphic to C 3 .If not, end with output "the two representations are not isomorphic".(6) Extend {ψ E } to a basis {ψ E , χ i } m i=1 of order three characters of ) m (where we take any root of the logarithm and identify log of the cubic roots of unity with Z/3Z).If Tr(ρ f (Frob pj )) ≡ Tr(ρ E (Frob pj )) (mod 2) for 1 ≤ j ≤ m ′ , the two residual representations are isomorphic.If not, end with output "the two representations are not isomorphic".(7) Apply the previous case, steps (7) to (10), with K replaced by L E .

Sources of two-dimensional representations of G K
Let K be an imaginary quadratic field.We want to consider two-dimensional, irreducible, p-adic representations of the group G K := Gal( Q/K).The first natural source of such representations comes from the action of G K on the torsion points of an elliptic curve E defined over K.More precisely, we consider the Tate module T p (E) which is a free rank two Z p -module with a G K -action, thus gives rise to a p-adic representation In order to make sure that the Galois representation ρ E,p is absolutely irreducible we will assume that E does not have Complex Multiplication.The ramification locus of the representation ρ E,p consists of primes of K dividing p together with the set S of primes of bad reduction of E. The family of Galois representations {ρ E,p } is a compatible family and has conductor equal to the conductor of the elliptic curve E. On the other hand, Harris-Soudry-Taylor, Taylor and Berger-Harcos (cf.[HST93], [Tay94] and [BH]) have proved that one can attach compatible families of twodimensional Galois representations {ρ p } to any regular algebraic cuspidal automorphic representation π of GL 2 (A K ), assuming that it has unitary central character ω with ω = ω c .As in the case of classical modular forms "to be attached" means that there is a correspondence between the ramification loci of π and the representation ρ p and also that, at unramified places, the characteristic polynomial of ρ p (Frob p ) agrees with the Hecke polynomial of π at p.However, since the method for constructing these Galois representations depends on using a theta lift to link with automorphic forms on GSp 4 (A Q ), it can not be excluded that the representations ρ p also ramify at the primes that ramify in K/Q.The precise statement of the result, valid only under the assumption ω = ω c , is the following (cf.[Tay94], [HST93] and [BH]): Theorem 3.1.Let S be the set of places in K dividing p or where K/Q or π or π c ramify.Then there exists an irreducible representation: such that if p is a prime of K not in S then ρ π,p is unramified at p and the characteristic polynomial of ρ π,p (Frob p ) agrees with the Hecke polynomial of π at p Remark 2. Observe that, in particular, if for some prime p ramifying in K/Q we happen to know that ρ π,p is unramified at p, the above theorem does not imply that the trace of ρ π,p (Frob p ) agrees with the Hecke eigenvalue of π at p, though it is expected that these two values should agree.It is also expected that there is a conductor for the family {ρ π,p }, i.e., that the conductor should be independent of p as in the case of elliptic curves.The value of this conductor should also agree with the level of π.
Remark 3. Since the families of Galois representations attached to an elliptic curve E over K and to a cuspidal automorphic representation π by the previous result are both compatible families, if one has for one prime p that ρ E,p ∼ = ρ π,p then the same holds for every prime p.
Remark 4.Even if an automorphic representation π as above has integer eigenvalues and the right weight so that the attached Galois representations "look like" those attached to some elliptic curve, one has to be careful because over imaginary fields such Galois representations may correspond to a "fake elliptic curve" instead.Namely, such a two-dimensional Galois representation of K may correspond to some abelian surface having Quaternionic Multiplication over K, i.e., the action of G K on the p-adic Tate module of A is isomorphic to two copies of the Galois representation.
Remark 5.At first the image is defined on a finite extension of Q p .Actually, it can be defined on the ring of integer of an at most degree 4 extension E P of Q p .Furthermore, let v i , i = 1, 2 be two unramified paces of K and let α i , β i be the roots of the characteristic polynomial of Frob vi .If α vi = β vi and, in the case v i is split, α vi + β vi = 0 then we can take E = Q[α v1 , α v2 ] and E P as its completion at any prime above p by Corollary 1 of [Tay94].
4. Faltings-Serre's method 4.1.First case: the image is absolutely irreducible.On this section we review Faltings-Serre's ( [Ser85]) method by stating the main ideas of [Sch06] (Section 5) on our particular case.Let be representations for i = 1, 2 such that they satisfy: • They have the same determinant.
• The mod l reductions are absolutely irreducible and isomorphic.
• There exists a prime p such that Tr(ρ 1 (Frob p )) = Tr(ρ 2 (Frob p )).We want to give a finite set of candidates for p. Chose the maximal r such that Tr(ρ 1 ) ≡ Tr(ρ 2 ) (mod l r ), so we obtain a non-trivial map φ : Gal(Q/K) → F l given by If we assume that ρ1 = ρ2 , we can factor φ through M 2 (F l ) ⋊ Im( ρ1 ).For doing this, An easy computation shows that the group structure on the semidirect product corresponds to the action by conjugation, i.e.
Take {( 1 1 0 1 ) , ( 1 0 1 1 ) , ( 1 0 0 1 )} as a basis for M 0 2 (F 2 ).It is clear that the action of S 3 on the last element is trivial.If we denote v 1 , v 2 the first two elements of the basis and v 3 their sum, the action of σ ∈ S 3 on the Klein group with the same action as described above we get the desired isomorphism.
Clearly the elements of S 3 × ( 0 0 0 0 ), {1} × M 0 2 (F 2 ) and σ ∈ S 3 : σ 2 = 1 × ( 1 0 0 1 ) go to 0 by φ.It can be seen that all the other elements have non-trivial image (which correspond to the elements of order 4 or 6 on S 4 × C 2 ).So we need to compute all possible extensions of L with Galois group over K isomorphic to S 4 × C 2 and primes p ⊂ K with inertial degree 4 or 6 on each field.Remark 6.In the proof given above one starts with a mod ℓ r congruence between the traces of ρ 1 and ρ 2 and uses the fact that this implies that the two mod ℓ r representations are isomorphic.This result is proved in [Ser95] (Theorem 1) but only with the assumption that the residual mod ℓ representations are absolutely irreducible.In fact, it is false in the residually reducible case, and this is one of the reasons why the above method does not extend to the case of residual image cyclic of order 3.When the residual representations are reducible there are counter-examples to this claim even assuming that they are semi-simple.We thank Professor J.-P.Serre for pointing out the following counter-example to us: take ℓ = 2 and consider two characters χ and χ ′ defined mod 2 r such that they agree mod 2 r−1 but not mod 2 r .Then χ ⊕ χ and χ ′ ⊕ χ ′ are two-dimensional Galois representations defined mod 2 r having the same trace but they are not isomorphic.4.2.Second case: the image is a 2-group.This case was treated on [Liv87], where the author proves the next Theorem: Theorem 4.1.Let K be an imaginary quadratic field, S a finite set of primes of K and E a finite extension of Q 2 .Denote by K S the compositum of all quadratic extensions of K unramified outside S and by P 2 the maximal prime ideal of O E .Suppose ρ 1 , ρ 2 : Gal(Q/K) → GL 2 (E) are continuous representations, unramified outside S, satisfying: 1. Tr(ρ 1 ) ≡ Tr(ρ 2 ) ≡ 0 (mod P 2 ) and det(ρ 1 ) ≡ det(ρ 2 ) (mod P 2 ). 2. There exists a set T of primes of K, disjoint from S, for which (i) The image of the set {Frob t } in the (Z/2Z-vector space) Then ρ 1 and ρ 2 have isomorphic semi-simplifications.
The following result is useful for identifying non-cubic subsets of (Z/2Z)-vector spaces.
Proposition 4.2.Let V be a vector space over Z/2Z.Then a function f : V → Z/2Z is represented by a homogeneous polynomial of degree 3 if and only 4.3.Third case: the image is cyclic of order 3.This is a mix of the previous two cases.Let E be a finite extension of Q 2 such that its residue field is isomorphic to F 2 .Suppose ρ 1 , ρ 2 : Gal( Q/K) → GL 2 (E) are continuous representations such that the residual representations are isomorphic and have image a cyclic group of order 3. Let K ρ be the fixed field of the residual representations kernel.If we restric the two representations to Gal( Q/K ρ ), we get: whose residual representation have trivial image.Hence we are in 2-group case for the field K ρ and Livne's Theorem 4.1 applies.

Proof of the Algorithm
Before giving a proof for each case we make some general considerations.The image of ρE is isomorphic to the Galois group Gal(L E /K).If E(K) has a two torsion point, its image is a 2-group.If not, assume (via a change of variables) that the elliptic curve has equation and denote by α, β, γ the roots of x 3 + a 2 x 2 + a 4 x + a 6 .Using elementary Galois theory it can be seen that L E = K[α−β].Furthermore, using elementary symmetric functions, it can be seen that α − β is a root of the polynomial Note that under the isomorphism between S 3 and GL 2 (F 2 ) given on the previous section, the order 1 or 2 elements of S 3 have even trace while the order 3 ones have odd trace.
In the case where the image is not a 2-group, we need to prove that the image lies (after conjugation) on an extension E of Q 2 with residual field F 2 .
Proof.Since E has no Complex Multiplication, if F is any quadratic field extension of Q 2 , the set of primes P such that Q 2 [α P ] = F has positive density (see for example Exercise (3) of [Ser68]).Also, the set of primes P such that α P + β P = 0 has density zero (since E has no complex multiplication, see [Ser66]), so we can find primes P such that Q 2 [α P ] = F and α P + β P = 0.The fields F 1 and F 2 obtained adding the roots of the polynomials x 2 + 14 and x 2 + 6 to Q 2 are two ramified extensions of Q 2 .Their composition is a degree 4 field extension (since the prime 2 is totally ramified on the composition of these extensions over Q).Since the set of primes innert on K have density zero, we can chose prime ideals P 1 and P 2 whose extensions of Q 2 are isomorphic to F 1 and F 2 .
Actually we search for the first two primes such that 2 has no inertial degree on the extension obtained adding to Q the roots of their Frobenius automorphisms.
The first step of the algorithm is to prove that the residual representations are indeed isomorphic so as to apply Faltings-Serre's method.In doing this we need to compute all extensions of a fixed degree (2 or 3 in our case) with prescribed ramification.Since we deal with abelian extensions, we can use class field theory.Since we are interested in the case K an imaginary quadratic field, all the ramified places of L/K are finite ones, hence m is an ideal on O K .A bound for e(p) is given by the following result.
Proposition 5.3.Let L/K be an abelian extension of prime degree p.If p ramifies on L/K, then To distinguish representations, given a character ψ of a ray class field we need to find a prime ideal p with ψ(p) = 1.Let ψ be a character of Cl(O K , m K ) of prime order p.Take any branch of the logarithm over C and identify log({ξ i p }) with Z/pZ in any way (where ξ p denotes a primitive p-th root of unity).
Proposition 5.4.Let K be a number field, m K a modulus and Cl(O K , m K ) the ray class field for m K .Let {ψ i } n i=1 be a basis of order p characters of Cl(O K , m) and {p j } n ′ j=1 be prime ideals of O K such that log(ψ 1 (p j )), . . ., log(ψ n (p j )) n ′ j=1 = (Z/pZ) n .Then for every non trivial character ψ of Cl(O K , m) of order p, ψ(p j ) = 1 for some 1 ≤ j ≤ n.
Proof.Suppose that ψ(p j ) = 1 for 1 ≤ j ≤ m.Since {ψ i } n i=1 is a basis, there exists exponents ε i such that Taking logarithm and evaluating at p j we see that (ε 1 , . . .ε n ) is a solution of the homogeneous system Since {(log(ψ 1 (p j )), . . ., log(ψ n (p j )))} m j=1 span (Z/pZ) n , the matrix has maximal rank, hence ε i = 0 and ψ is the trivial character.Remark 7. A set of prime ideals satisfying the conditions of the previous Proposition always exists by Tchebotarev's density theorem.

5.1.
Residual image isomorphic to S 3 .Remark 8.If the residual representation is absolutely irreducible, we can apply a descent result (see Corollaire 5 in [Ser95], which can be applied because the Brauer group of a finite field is trivial) and conclude that since the traces are all in F 2 the representation can be defined (up to isomorphism) as a representation with values on a two-dimensional F 2 -vector space.Thus, the image can be assumed to be contained in GL 2 (F 2 ) and because of the absolute irreducibility assumption we conclude that the image has to be isomorphic to S 3 .Furthermore, we have the following result, Theorem 5.5.If the image is absolutely ireducible, then the field E can be taken to be Q 2 .
Proof.This follows from the same argument as the previous Remark.See also Corollary of [CSS97], page 256.
Remark 9. Once we prove that the residual representation of ρ π,2 has image greater than C 3 we automatically know that it can be defined on GL 2 (Z 2 ).
We have the 2-adic Galois representations ρ E and ρ f and we want to prove that they are isomorphic.We start by proving that the reduced representations are isomorphic.For doing this we compute all quadratic extensions of K using Class Field theory and Proposition 5.3.Let K E denote the quadratic extension of K contained on L E .Following the ideas of step (5) of the previous case, we can prove that L f (the fixed field of the kernel of ρ f ) contains no quadratic extension of K or contains K E (note that an ideal with inertial degree 3 on L E splits on K E ).This is done on steps (1) − (4).
Remark 10.Let P (x) denote the degree 3 polynomial in K[x] whose roots are the x-coordinates of the points of order 2 of E. The fact that the splitting field of P (x) is an S 3 extension allows us to compute how primes decompose on K E knowing how they decompose on the cubic extension K P of K obtained by adjoining any root of P (x).The factorization as well as the values of ψ(p) are given by the next table: Proof.The last two cases are clear (since the inertial degree is multiplicative and it is at most 3).The not so trivial case is the first one.Since L E /K is Galois, pO LE has 3 or 6 prime factors.Assume (1) pO LE = q 1 q 2 q 3 .
Then it must be the case that (after relabeling the ideals if needed) if σ denotes one order three element in Gal(L E /K), σ(q 1 ) = q 2 and σ 2 (q 1 ) = q 3 .Since the decomposition groups D(q i |p) have order 2 and are conjugates of each other by powers of σ, they are disjoint and they are all the order 2 subgroups of S 3 .Since K P is a degree 2 subextension of L E , it is the fixed field of an order 2 subgroup.Without loss of generality, assume K P is the fixed field of D(q 1 |p).If we intersect equation (1) with O KP we get We are assuming that (q i ∩ O KP ) = (q j ∩ O KP ) if i = j.Let τ be the non trivial element on D(q 1 |p), so τ acts trivially on K P .In particular, τ fixes q 2 ∩ O KP and τ Next we need to discard the C 3 case.Let m K be as described on step (1) of the algorithm, and Cl(O K , m K ) be the ray class field.Suppose that ρf has image isomorphic to C 3 .Let χ be (one of) the cubic character of Cl(O K , m K ) corresponding to L f .Let {χ i } m i=1 be a basis of cubic characters of Cl(O K , m K ).We look for prime ideals {p j } m ′ j=1 that are inert on K E or split completely on L E (that is, they have order 1 or 2 on S 3 and in particular have even trace for the residual representation ρE ) and such that (log(χ 1 (p j )), . . ., log(χ m (p j ))) There exists such ideals by Tchebotarev's density Theorem.By Proposition 5.4, there exists an index i 0 such that χ(p i0 ) = 1, hence Tr(ρ f (p i0 )) ≡ 1 (mod 2) while Tr(ρ E (p i0 )) ≡ 0 (mod 2).Step (6) discards this case.
Once we know that ρf has S 3 image with the same quadratic subfield as ρE , we take K E as the base field and proceed in the same way as the previous case.This is done on steps (7) and (8).
At this point we already decided whether the two residual representations are isomorphic or not.If they are, we can apply Faltings-Serre's method explained on the previous section.We look for quadratic extensions L of L unramified outside m L such that its normal closure is isomorphic to S 4 or S 3 × C 2 .
Applying Faltings-Serre's method, we need to compute all fields L with Galois group Gal( L/K) ≃ S 4 × C 2 in the S 3 case and Gal( L/K) ≃ A 4 × C 2 in the C 3 case.The group S 4 × C 2 fits in the exact sequences Every element of order 4 or 6 on S 4 × C 2 maps to an element of order 4 on S 4 or to an element of order 6 on S 3 × C 2 under the previous surjections, while any element of order 6 on A 4 × C 2 maps to an element of order 6 on C 3 × C 2 .We can restrict ourselves to compute normal extensions of L with Galois group S 4 or S 3 × C 2 in the S 3 case and normal extensions of L with Galois group C 3 × C 2 on the C 3 case.Note that in all cases the extensions are obtained by computing the normal closure of a quadratic extension.
Let m L be a modulus on L invariant under the action of Gal(L/K).Then Gal(L/K) has an action on Cl(O L , m L ) and it induces an action on the set of characters of the group.Concretely, if ψ is a character on Cl(O L , m L ) and σ ∈ Gal(L/K), σ.ψ = ψ • σ. (1) The quadratic extension of L corresponding to ψ is Galois if and only if σ.ψ = ψ for all σ ∈ Gal(L/K).
(2) The quadratic extension of L corresponding to ψ has normal closure isomorphic to S 4 if and only if the elements fixing ψ form an order 2 subgroup and (ψ)(σ.ψ)= σ 2 .ψ,where σ is any order 3 element in Gal(L/K).
Proof.Let L[ √ α] be a quadratic extension of L. The normal closure (with respect to K) is the field (where by the product we mean the smallest field containing all of them inside Q).In particular Gal( L/L) is an abelian 2-group.By the previous proposition, if L[ √ α] corresponds to the quadratic character ψ then the other ones correspond to the characters σ.ψ where σ ∈ Gal(L/K).
The first assertion is clear.To prove the second one, the condition (ψ)(σ.ψ)= σ 2 ψ and ψ being fixed by an order 2 subgroup implies that [ L : L] = 4. Hence the group Gal( L/K) fits in the exact sequence In particular Gal( L/K) is isomorphic to the semidirect product S 3 ⋉(C 2 ×C 2 ), with the action given by a morphism Θ : S 3 → GL 2 (F 2 ).Its kernel is a normal subgroup, hence it can be GL 2 (F 2 ) (i.e. the trivial action), σ (the order 3 subgroup) or trivial.The condition on the stabilizer of ψ forces the image of Θ to contain an order 3 element, hence the kernel is trivial.Up to inner automorphisms, there is a unique isomorphism from GL 2 (F 2 ) to itself (and morphisms that differ by an inner automorphism give isomorphic groups) hence Gal( L/K) ≃ S 4 as claimed.
Remark 11.On the S 4 case of the last proposition, the condition on the action of σ is necessary.Consider the extension where ξ 3 is a primitive third root of unity.It is a Galois degree 6 extension of Q with Galois group S 3 .Take as generators for the Galois group the elements σ, τ given by σ : ξ 3 → ξ 3 and σ : The extension L 1 + 3 √ 2 is clearly fixed by σ, but its normal closure has degree To compute all such extensions, we use Class Field Theory and Proposition 5.7.To compute the S 3 × C 2 extensions we follow the method of the C 3 case.The only difference is that we check for invariance under an order 3 element plus invariance under an order 2 element.This is done on steps (11) − (15).
At last, we need to compute the quadratic extensions whose normal closure has Galois group isomorphic to S 4 .Using the second part of Proposition 5.7, we need to compute quadratic characters χ such that χ(σ.χ)(σ 2 .χ)= 1 (where σ denotes an order three element of Gal(L/K)) and also whose fixed subgroup under the action of Gal(L/K) has order 2. Let S denote the set of all such characters.Since σ does not act trivially on elements of S, we find that χ, σ.χ and σ 2 .χare three different elements of S that give the same normal closure.Then we can write S as a disjoint union of three sets.Furthermore, since σ acts transitively (by multiplication on the right) on the set of order 2 elements of S 3 , we see that where V τ denotes the quadratic characters of S invariant under the action of τ and the union is disjoint.Hence each one of these sets is in bijection with all extensions L of L. We compute one subspace and use Proposition 5.4 on this subspace, noting that the elements of order 4 correspond to primes that are inert on any of the three extensions of L (corresponding to χ, σ.χ and σ 2 .χ)hence we consider not one prime above p ⊂ O K but all of them.This is done on steps (16) − (19).

5.2.
Trivial residual image or residual image isomorphic to C 2 .The first step is to decide if we can take E to be an extension of Q 2 with residue field F 2 so as to apply Livne's Theorem 4.1.Once this is checked, the algorithm is divided into two parts.Let ρ E , ρ f : Gal( Q/K) → GL 2 (Z 2 ) be given, with the residual image of ρ E being either trivial or isomorphic to C 2 .Steps (2) to (6) serve to the purpose of seeing whether ρ f has also trivial or C 2 residual image or not.Note that the output of step (6) does not say that the residual representations are actually the same, but they have isomorphic semisimplifications (in this case it is equivalent to say that the traces are even).For example, there can be isogenous curves, one of which has trivial residual image and the other has C 2 residual image.
Suppose we computed the ideals of steps (2) − (5) and ρf has even trace on the Frobenius of these elements.We claim that ρ f has residual image either trivial or C 2 .Suppose on the contrary that ρ f has residual image isomorphic to C 3 .Let L 2 /K be the cyclic extension of K corresponding (by Galois theory) to the kernel of ρf .This corresponds to a cubic character χ of Cl(O K , m K ).An easy calculation shows that if p ⊂ O K is a prime ideal not dividing m, then χ(p) = 1 if and only if Tr(ρ f (Frob p )) = 0.This implies that χ(p j ) = 1 for each j = 1, . . ., m.But χ is a non-trivial character, then by Proposition 4.6 we get a contradiction.
Similarly, suppose that the residual image of ρ 2 is S 3 .Let L 2 /K be the S 3 extension of K corresponding (by Galois theory) to the kernel of ρf , and M 2 /K its unique quadratic subextension.The extension L 2 /M 2 corresponds to a cubic character χ of Cl(O M2 , m M2 ) and the proof follows the previous case.
Steps (7) − (10) check if the representations are indeed isomorphic once we know that the traces are even using Theorem 4.1.We need to find a finite set of primes T , which will only depend on K, and check that the representations agree at those primes.In the algorithm and in the theorem, we identify the group Gal(K S /K) with the group of quadratic characters of Cl(O K , m).In step (7), we compute the image of Frob p ∈ Gal(K S /K) via this isomorphism and compute enough prime ideals so as to get a non-cubic set of Gal(K S /K).Then the representations are isomorphic if and only if the traces at those primes agree.

5.3.
Residual image isomorphic to C 3 .Let K be an imaginary quadratic field and let be the Galois representations attached to E and f respectively.The first step is to decide if we can take E to be an extension of Q 2 with residue field F 2 .Once this is checked, we need to prove that the residual representation ρf has image isomorphic to C 3 .For doing this we start proving that it has no order 2 elements on its image.If such an element exists, there exists a degree 2 extension of K unramified outside 2n(E)n(f )n(f )∆(K).We use Proposition 5.3 and Class Field Theory to compute all such extensions.Once a basis of the quadratic characters is chosen, we apply Proposition 5.4 to find a set of ideals such that for any quadratic extension, (at least) one prime q on the set is inert on it.Since the residual image is isomorphic to a subgroup of S 3 , ρf (q) has order exactly 2. In particular its trace is even.If Tr(ρ f (p)) is odd at all primes, Im(ρ f ) contains no order 2 elements.Also since Tr(id) ≡ 0 (mod 2) we see that ρf cannot have trivial image hence its image is isomorphic to C 3 .This is done on steps (2) to (5) of the algorithm.
To prove that ρf factors through the same field as ρE we compute all cubic Galois extensions of K.This can be done using Class Field Theory again, and this explains the choice of the modulus on step (1), so as to be used for both quadratic and cubic extensions.Note that the characters χ and χ 2 give raise to the same field extension.If ψ E denotes (one of) the cubic character corresponding to L E , we extend it to a basis {ψ E , χ i } m i=1 of the cubic characters of Cl(O K , m K ) and find a set of prime ideals {p j } m ′ j=1 such that (log(χ 1 (p j )), . . ., log(χ n (p j ))) E and we are done.If not, by Proposition 5.4, there exists an index i 0 such that κ(p i0 ) = 1.Furthermore, since ψ E (p i0 ) = 1, χ(p i0 ) = 1.Hence Tr(ρ f (p i0 )) ≡ 1 (mod 2) and Tr(ρ E (p i0 )) ≡ 0 (mod 2).
At this point we already decided whether the two residual representations are isomorphic or not.If they are, we can apply Livne's Theorem 4.1 to the field L E which is the last step of the algorithm.

Examples
In this section we present three examples of elliptic curves over imaginary quadratic fields, one for each class of residual image and show how the method works.The first publications comparing elliptic curves with modular forms over imaginary quadratic fields are due to Cremona and Whitley (see [CW94]), where they consider imaginary quadratic fields with class number 1. .All computations were done using the PARI/GP system ( [PAR08]).On the next section we present the commands used to check our examples so as to serve as a guide for further cases.The routines written by the authors can be downloaded from [CNT].
6.1.Image isomorphic to S 3 .Let E be the elliptic curve with equation It has conductor n E = p2 p 13 where p2 = 2, 1 − ω and p 13 = 13, 8 + ω .There is an automorphic form of level n f = p2 p 13 (denoted by f 2 on [Lin05] table 7.1) which is the candidate to correspond to E. We know that f has a 2-adic Galois representation attached whose L-series local factors agree at all primes except (at most) {p 23 , p2 , p 2 , p 13 , p13 }.Let ρ E be the 2-adic Galois representation attached to E. Its residual representation has image isomorphic to S 3 as can easily be checked by computing the extension L E of K obtained adding the coordinates of the 2-torsion points.Using the routine setofprimes we find that the set of primes of Q[ √ −23] above {3, 5, 7, 29, 31, 41, 47} is enough for proving that the residual representations are isomorphic and that the 2-adic representations are isomorphic as well.Note that the natural answer would be the set {3, 5, 7, 11, 19, 29, 31, 37}, but since some of these ideals have norm greater than 50, they are not on table 7.1 of [Lin05].This justifies our first list.
To prove that the answer is correct, we apply the algorithm described on section 2.1: (1) Since 2 is unramified on K/Q, the modulus is m K = 2 3 13 √ −23.
(2) The ray class group is isomorphic to Remark 10 we find that the character ψ on the computed basis corresponds to χ 3 , where {χ i } is the dual basis of quadratic characters.
(3) The extended basis is {ψ, χ 1 , χ 2 , χ 4 , χ 5 , χ 6 }.Computing some prime ideals, we find that the set {p 3 , p 5 , p29 , p 31 , p 47 } has the desired properties (using Remark 10 we know that the primes with inertial degree 3 are the ones on the third case).On distinguishing one ideal from its conjugate we follow the notation of [Lin05] for consistency (although it may not be the order of GP's output).(4) Table 7.1 of [Lin05] shows that Tr(ρ f (Frob p )) is odd on all such primes p.
(5) The group of cubic characters has as dual basis for Cl(O K , m K ) the characters {χ 1 , χ 2 }, i.e. χ i (v j ) = δ i,j ξ 3 , where ξ 3 is a primitive cubic root of unity and δ i,j is Dirac's delta function.
, where χ i is the dual basis for cubic characters of Cl(O KE , m KE ).To prove this, we use Remark 1.We know that p 3 is inert on K E and ψ E (p 3 ) = 1.The prime number 7 is inert on K E hence ψ E (p 7 ) = 1; the prime 37 is inert in K, but splits as a product of two ideals on K E .Then ψ E (p 37 ) = 1 on both ideals.There is a unique (up to squares) character vanishing on them, and this is ψ E .
The basis {ψ E , χ 1 , χ 2 , χ 3 } extends {ψ E } to a basis of cubic characters.The point here is that the characters χ i need not give Galois extensions over K.A character gives a Galois extension if and only if its modulo is invariant under the action of Gal(K E /K).The characters χ 1 , χ 3 , χ 4 do satisfy this property, hence the subgroup of cubic characters of Cl(O KE , m KE ) with invariant conductor has rank 3. A basis is given by {ψ E , χ 1 , χ 3 }.If we evaluate χ 1 and χ 3 at the prime above p 3 and p 7 we see that they span the Z/3Z-module.We already compared the residual traces on these ideals, hence the two residual representations are indeed isomorphic.
(18) The prime ideals above {3, 7, 19, 29, 31} do satisfy the condition, but since the prime 19 is inert on K, its norm is bigger than 50.Nevertheless, we can replace it by the primes above 41 which are on Table 7.1 of [Lin05].(19) Looking at table 7.1 of [Lin05] we find that the two representations are indeed isomorphic.(20) From the same table we see that the factors at the primes p2 , p 2 , p 23 , p13 and p 13 also agree hence the two L-series are the same.If the stronger version of Theorem 3.1 saying that the level of the Galois representaion equals the level of the automorphic form is true, the set of primes to consider can be diminished removing the primes above 37 on the second set of primes.
Using the routine setofprimes, we find that the set is enough for checking modularity.We will confirm that this is indeed the case.
(1) The primes above 29 and 41 prove that the residual representation of the automorphic form lies on GL 2 (F 2 ), because the values of a P29 , a P29 , a P41 and a P41 are 6, 6, −2, 2 respectively.Then degree 4 extension of Q 2 has equation x 4 + 8x 3 + 144x 2 + 512x + 896, and it is totally ramified.(2) The modulus is m K = 2 3 3 2 √ −23, and the ray class group (3) − (4) There are 64 quadratic (including the trivial) extensions of K with conductor dividing m K .We calculate each one, with the corresponding ray class group described in the algorithm; we pick a basis of cubic characters of each group, and evaluate them at each prime in {5, 7, 11, 13, 17, 19, 29, 31}.We find that this set is indeed enough for proving whether ρf has residual image trivial or isomorphic to C 2 .(5) Since Tr(ρ f (Frob p )) ≡ 0 (mod 2) for the primes on the previous set (see [Lin05] table 7.1) we get that the residual image is trivial or isomorphic to C 2 .(6) − (7) The set {5, 7, 13, 29, 31, 41, 47, 59, 61, 67, 71, 83, 89, 97, 101, 127, 131, 139, 151, 163, 179, 197, 211, 233, 239, 277, 311, 349, 353, 397, 439, 443, 739, 1061, 1481} is enough.In order to see this, we must check that the Frobenius at all the primes of K above these ones cover Gal(K S /K) \ {id}.We calculate a basis {ψ 1 , ψ 2 , ψ 3 , ψ 4 , ψ 5 } for the quadratic characters of Cl(O K , m K ), and compute, for p a prime of K above one of these primes, (log ψ 1 (p), . . ., log ψ 5 (p)).We simply check that this set of coordinates has 63 elements, so the primes we listed are enough.(8) The primes listed are not on Table 7.1 of [Lin05].We asked Professor John Cremona to compute the missing values so as to prove modularity for this curve.If the stronger version of Theorem 3.1 saying that the level of the Galois representaion equals the level of the automorphic form is true, the set of primes to consider can be diminished to the primes above {5, 7, 11, 13, 17, 23, 29, 31, 47, 59, 71, 101, 131}.6.3.Image isomorphic to C 3 .Let E be the elliptic curve with equation E : y 2 = x 3 − ωx 2 + (4ω − 1)x − 5.This curve is taken from Table 7.3 of [Lin05].It has conductor p 2 2 p3 2 , where p 2 = 2, ω and p2 = 2, 1 + ω .There is an automorphic form f (denoted f 4 on [Lin05]) which has level n = p 2 2 p3 2 and is the candidate to correspond to E. From Section 2 we know that f has a Galois 2-adic representation ρ f attached to it, whose Lseries agree at all primes with the possible exceptions p 2 , p2 and p 23 , where p 23 is the unique ideal or norm 23 on K. Let ρ E denote the 2-adic Galois representation attached to E. Its residual representation has image isomorphic to C 3 as can be easily proved by computing the extension L E of K obtained adjoining the 2-torsion points coordinates.
Using the GP routine setofprimes (which can be downloaded from

Theorem 5. 2 .
If L/K is an abelian extension unramified outside the set of places {p i } n i=1 then there exists a modulus m = n i=1 p e(pi) i such that Gal(L/K) corresponds to a subgroup of the ray class group Cl(O K , m).
Lemma 5.6.If ψ is a character on Cl(O L , m L ) that corresponds to the quadratic extensionL[ √ α] and σ ∈ Gal(L/K) then σ −1 .ψcorresponds to L[ σ(α)].Proof.The character is characterized by its value on non-ramified primes.Let p be a non-ramified prime onL[ √ α]/L.It splits on L[ √ α]if and only if ψ(p) = 1.If p does not divide the fractional ideal α, this is equivalent to α being a square modulo p.But for σ ∈ Gal(L/K), α is a square modulo p if and only if σ(α) is a square modulo σ(p) hence the extension L[ σ(α)] corresponds to the character σ −1 .ψ. Proposition 5.7.Let L/K be a Galois extension with Gal(L/K) ≃ S 3 and ψ a quadratic character of Cl(O L , m L ) with m L as above.