\\ This files contains some pari/gp routines needed \\ for the paper \\ "On a Shimura Curve that is a Counterexample to the Hasse Principle" \\ by Siksek and Skorobogatov kill(x); kill(y); kill(u); kill(v); \\ if v^2=a*u^4+b*u^3+c*u^2+d*u+q^2 (i.e. with rat point (0,q)) \\ this function gives Weierstrass equation and maps \\ result is in the format [ell,[x,y],[u,v]] where ell \\ is the Weierstrass elliptic curve \\ [x,y] are given in terms of u,v and [u,v] given in terms \\ of x,y {quarToEll(a,b,c,d,q)=local(a1,a2,a3,a4,a6,P1,P2,ell,f,g); a1=d/q; a2=c-d^2/(4*q^2); a3=2*q*b; a4=-4*q^2*a; a6=a2*a4; ell=[a1,a2,a3,a4,a6]; ell=ellinit(ell,1); P1=[(2*q*(v+q)+d*u)/u^2,(4*q^2*(v+q)+2*q*(d*u+c*u^2)-d^2*u^2/(2*q))/u^3]; f=(2*q*(x+c)-d^2/(2*q))/y; g=-q+f*(f*x-d)/(2*q); P2=[f,g]; [ell,P1,P2] } \\ Henceforth a quartic of the form v^2=a*u^4+b*u^3+c*u^2+d*u+e \\ will be represented by a vector [a,b,c,d,e] \\ Given a "quartic" with rational point "Point" \\ this function gives a vector of the form [quartic,Point,ell,Phi,Psi] \\ where ell is the corresponding Weierstrass elliptic curve (in \\ ellinit(,1)) form and \\ Phi : quartic ---> ell is the map taking Point to infinity \\ and Psi is the inverse of Phi \\ Phi=[x,y] where x,y are given in terms of u,v and \\ Psi=[u,v] given in terms where u ,v are given in terms of x,y {quarToEll2(quartic,Point)=local(a,b,c,d,e,u0,v0,a1,b1,c1,d1,e1,trip,ell,Phi,Psi); a=quartic[1]; b=quartic[2]; c=quartic[3]; d=quartic[4]; e=quartic[5]; u0=Point[1]; v0=Point[2]; a1=a; b1=b+4*a*u0; c1=c+3*b*u0+6*a*u0^2; d1=d+2*c*u0+3*b*u0^2+4*a*u0^3; e1=e+d*u0+c*u0^2+b*u0^3+a*u0^4; trip=quarToEll(a1,b1,c1,d1,v0); ell=trip[1]; Phi=trip[2]; Phi=subst(Phi,u,u-u0); Psi=trip[3]; Psi=[Psi[1]+u0,Psi[2]]; [quartic,Point,ell,Phi,Psi] } \\ Given a Quint=[quartic,Point,ell,Phi,Psi] \\ and a vector V=[u,r,s,t] the following \\ makes the change of coordinates on ell \\ according to V and then updates the \\ maps Phi and Psi {ChangCoord(Quint,V)=local(ell,Phi,Psi); ell=ellchangecurve(Quint[3],V); Phi=ellchangepoint(Quint[4],V); Psi=Quint[5]; Psi=subst(Psi,x,V[1]^2*x+V[2]); Psi=subst(Psi,y,V[1]^3*y+V[3]*V[1]^2*x+V[4]); [Quint[1],Quint[2],ell,Phi,Psi]} \\the following removes a1,a3 from the equation of ell in Quint {Short(Quint)=local(a1,a3,V); a1=Quint[3][1]; a3=Quint[3][3]; V=[1,0,-a1/2,-a3/2]; ChangCoord(Quint,V)} \\ the following removes a1,a2,a3 from the elliptic curve in Quint { VeryShort(Quint)=local(a2,V); Quint=Short(Quint); a2=Quint[3][2]; V=[1,-a2/3,0,0]; ChangCoord(Quint,V) } \\ The following function checks if a Point is on the \\ quartic. { isOnQuartic(quartic,Point)=local(g,g1,v,res); g=Pol(quartic,u); g1=subst(g,u,Point[1]); v=Point[2]; if(v^2-g1==0,res=1; print("point IS ON curve"),res=0; print("point IS NOT ON curve")); res } { MapEllToQuar(Quint,S)=local(P,Psi); Psi=Quint[5]; if(S==[0],P=Quint[2], P=subst(subst(Psi,y,S[2]),x,S[1])); P }