We give an example that combines functionality for small modular curves with Magma's machinery for curve quotients and elliptic curves to compute the j-invariant of a special class of elliptic curves over Q up to quadratic twist. This class of curves arose in Wiles' original paper on Fermat's Last Theorem and the Shimura-Tanayama-Weil (STW) conjecture.
The curves we want are precisely those that have a cyclic subgroup of order 5 rational over Q and for which the image of (Gal)(bar(Q)/(Q)) in GL2((F)3), giving the action on E[3], is the normaliser of a split Cartan subgroup.
Curves just satisfying the E[3] condition are classified by non-cuspidal rational points on X0(9)/w9 that are not the image of a rational point of X0(9). Such a point p lifts to a point p1 on X0(9) defined over some quadratic field K such that p1σ = w9(p1) where σ is the nontrivial automorphism of K over Q. If (E, C) is an elliptic curve/K with cyclic subgroup C=< P > rational over K that is represented by the moduli point p1, then E1=E/< 3P > can be defined over Q so that the order 3 subgroups C/< 3P > and (C/< 3P >)σ generate E1[3], are rational over K and are swapped by σ.
In the same way, adding the extra condition that there is a rational subgroup of order 5 leads to curves classified by non-cuspidal rational points of X0(45)/w9. These do not lift to rational points because X0(45) has no non-cuspidal rational points. X0(45)/w9 is Q-isogenous to the rank 0 elliptic curve X0(15) so only has finitely many rational points. If p1 is a lift, the image of p1 under the 3-projection map X0(45) -> X0(5) (z |-> 3z on complex points) is a rational point that corresponds to the desired curve E1 (with its cyclic 5-subgroup). We could apply the 3-projection all the way down to X0(1) of course, but it is slightly more efficient to just project to level 5 and remove duplicate images before computing j-invariants.
> X45<x,y,z> := SmallModularCurve(45); > w9 := AtkinLehnerInvolution(X45,45,9); > G := AutomorphismGroup(X45,[w9]); > C,prjC := CurveQuotient(G); > c_inf := Cusp(X45,45,45); > ptE := prjC(c_inf); > E1,mp1 := EllipticCurve(C,ptE); > E,mp2 := MinimalModel(E1); > prjE := Expand(prjC*mp1*mp2);
E is a minimal model for X0(45)/w9 and prjE is the projection from X0(45) to E that takes the cusp ∞ to the zero point of E. We compute the image of the cusps under prjE so as to discount these when we find all the rational points on E. Since p and w9(p) map to the same point under prjE, we only need consider cusps up to w9 equivalence. The non-rational conjugate cusps ∓ 1/3 are defined over (Q)(Sqrt( - 3)) and are swapped by w9, so map to the same rational point. The same holds for the cusps ∓ 1/15.
> i0 := prjE(Cusp(X45,45,1)); > K := QuadraticField(-3); > c3 := Cusp(X45,45,3); > c3p := X45(K)!Representative(Support(c3,K)); > i3 := E!(prjE(c3p)); > c15 := Cusp(X45,45,15); > c15p := X45(K)!Representative(Support(c15,K)); > i15 := E!(prjE(c15p)); > Ecusps := [E!0,i0,i3,i15];
E has rank zero, so we can recover all of its rational points using TorsionSubgroup. There are 8 in all, 4 of which are images of cusps. We find the 4 non-cuspidal ones and compute the pullbacks of them to X0(45). In each case, the pull back is a pair of conjugate points defined over a quadratic field. It is easiest to work with places here (and we don't have to worry about the base scheme of prjE). The pullback of each point gives a single place corresponding to the two conjugate points.
> T,mp := TorsionSubgroup(E); > Epts := [mp(g) : g in T]; > Eptsnc := [P : P in Epts | P notin Ecusps]; > plcs := [Support(Pullback(prjE,Place(p)))[1] : p in Eptsnc];
We now perform the 3-projection to X0(5) on these places and discard duplicate images.
> X5 := SmallModularCurve(5); > prj3 := ProjectionMap(X45,45,X5,5,3); > prj3 := Expand(prj3); > plcs5 := [Support(Pushforward(prj3,p))[1] : p in plcs]; > plcs5 := Setseq(Seqset(plcs5));
We compute the j-invariants of the two images and verify that they represent isogenous curves under the cyclic 5-isogeny coming from the rational 5-subgroup (i.e. they are images of each other under w5).
> js := [jInvariant(p,5) : p in plcs5]; > js; [ -1680914269/32768, 1331/8 ] > w5 := AtkinLehnerInvolution(X5,5,5); > Pullback(w5,plcs5[1]) eq plcs5[2]; true
Finally, we can use Magma intrinsics to check that the elliptic curves with these j-invariants actually do satisfy the property that the image of the action of Galois on 3-torsion is the normaliser of a split Cartan subgroup (D8). As this property remains true for quadratic twists and is unchanged by images under a rational 5-isogeny, we only need check it for one curve over Q with one of the j-invariants. We also check that a minimal twist has conductor 338 from which modularity can be checked explicitly.
> Ej := EllipticCurveWithjInvariant(js[2]); > Ej := MinimalModel(MinimalTwist(Ej)); > Conductor(Ej); 338 > ThreeTorsionType(Ej); Dihedral