Attachment 'minred-demo2.m'

Download

   1 // minred-demo2.m
   2 // Some examples to test minimisation and reduction
   3 // Version 22nd July 2008
   4 
   5 clear;
   6 
   7 Attach("g1minimisation-2008.m");
   8 Attach("g1reduction-2008.m");
   9 SetVerbose("Reduction",1);
  10 SetVerbose("Minimisation",2);
  11 SetVerbose("QuarticReduce",0);
  12 
  13 Q := Rationals();
  14 Id := IdentityMatrix;
  15 
  16 function RationalGCD(S)
  17    Z := Integers();
  18    Q := Rationals();
  19    d := LCM([Denominator(Q!x):x in S| x ne 0] cat [1]);
  20    return Universe(S)!(GCD([Z!(x*d): x in S])/d);
  21 end function;
  22 
  23 PRIM := func<seq|[Integers()|x/d: x in seq] where d is RationalGCD(seq)>;
  24 
  25 model := GenusOneModel(Q,5,
  26   [-1,-3,-3,4,0,1,0,-2,1,-1,0,0,0,-1,-2,1,0,1,-1,-1,1,1,1,-2,1,
  27   -1,-1,-2,0,1,-1,-1,-1,0,-1,-1,0,0,-1,0,0,1,0,0,-1,0,0,-1,-1,1]);
  28 
  29 print "We start with the model with coefficients";
  30 print Eltseq(model);
  31 print "We apply a random unimodular transformation";
  32 tr := RandomTransformation(5:Unimodular,Size:=100);
  33 phi := tr*model;
  34 phi1,tr1 := Reduce2008(phi);
  35 assert tr1*phi eq phi1;
  36 print "After reducing the model has coefficients";
  37 print Eltseq(phi1);
  38 print "Overall transformation";
  39 print tr1*tr;
  40 
  41 print "";
  42 
  43 print "We double the model, i.e. multiply by 2 in H^1(Q,E[5])";
  44 time model2 := DoubleGenusOneModel(model);
  45 print "The new model has coefficients";
  46 print Eltseq(model2);
  47 phi,tr := Minimise2008(model2);
  48 assert tr*model2 eq phi;
  49 phi,tr1 := Reduce2008(phi);
  50 tr := tr1*tr;
  51 assert tr*model2 eq phi;
  52 print "After minimising and reducing it has coefficients";  
  53 print Eltseq(phi);
  54 
  55 print "Doubling again gives"; // would just give (-1)*(original model)";
  56 time model4 := DoubleGenusOneModel(phi);
  57 tr1 := <Transpose(m): m in tr>;
  58 phi1 := tr1*model4;
  59 print Eltseq(phi1);
  60 print "which is simply (-1)*(original model)";
  61 assert Vector(Eltseq(phi1)) eq -Vector(Eltseq(model));
  62 
  63 print "/////////////////////////////////////////////////////////////";
  64 print "/////////////////////////////////////////////////////////////";
  65 
  66 E := EllipticCurve([ 1, 0, 1, -3961560, -3035251137 ]);
  67 P := E![-10343/9,15502/27];
  68 print "E =",aInvariants(E);
  69 print "P =",P;
  70 print "h(P)  =",Height(P); 
  71 
  72 phi,pt := GenusOneModel(5,P);
  73 print "Model has coefficients";
  74 print Eltseq(phi);
  75 print "Searching for points .....";
  76 C := Curve(phi);
  77 pts := PointSearch(C,10^4);
  78 P4Z := ProjectiveSpace(Integers(),4);
  79 print {P4Z!PRIM(Eltseq(pt)): pt in pts};
  80 print "The point that maps down to P is:  Q =",P4Z!PRIM(Eltseq(pt));
  81 // print "Computing covering map";
  82 // C,_,pi := nCovering(phi:E:=E);
  83 // print "These points map down to";
  84 // print [pi(C!Eltseq(pt)): pt in pts]; 
  85 
  86 print "/////////////////////////////////////////////////////////////";
  87 print "/////////////////////////////////////////////////////////////";
  88 
  89 E := EllipticCurve([ 1, 0, 1, -3961560, -3035251137 ]);
  90 r := 1444067711193161151653909885248174530531193797834370513997358074997\
  91   370310404457472012138726088286265069724174055954168887973156173644540\
  92   5185451187391361335833;
  93 s := -53879482447658061183722803305824349047504913109038237184003453833845\
  94   450236551860699170659516701341037148199683612682243476423780974589591\
  95   787079465837072436296880764527226540521645634714128124387816154105110\
  96   218383771518121927100986107530;
  97 t := 38696980895872965778173140061667235695331988051796572460157672420992532650171;
  98 P := E![r/t^2,s/t^3];
  99 print "E =",aInvariants(E);
 100 // print "P =",P;
 101 print "h(P)  =",Height(P); 
 102 phi,pt := GenusOneModel(5,P);
 103 print "Model has coefficients";
 104 print Eltseq(phi);
 105 print "The point that maps down to P is:  Q =",P4Z!PRIM(Eltseq(pt));
 106 
 107 SetVerbose("Reduction",0);
 108 
 109 print "";
 110 print "The same calculation for n = 2,3,4 :";
 111 print "";
 112 for n in [2..4] do
 113   model,pt := GenusOneModel(n,P);
 114   print model;
 115   pt := Eltseq(pt);
 116   if n gt 2 then pt := PRIM(pt); end if;
 117   print "Q =",pt;
 118   C,_,pi := nCovering(model:E := E);
 119   QQ := C!Eltseq(pt);
 120   assert pi(QQ) in {-P,P};
 121   print "";
 122 end for;
 123 
 124 SetVerbose("Minimisation",0);
 125 
 126 print "A comparison in the case n = 3";
 127 
 128 printf "Old version takes ";
 129 time F,map,pt := CubicFromPoint(E,P);  // 1.320 seconds 
 130 model1 := GenusOneModel(F);
 131 assert map(pt) in {-P,P};
 132 
 133 printf "New version takes ";
 134 time  model2,pt := GenusOneModel(3,P); // 0.420 seconds
 135 C,_,map := nCovering(model2:E := E);
 136 pt := C!Eltseq(pt);
 137 assert map(pt) in {-P,P};
 138 assert IsEquivalent(model1, model2);
 139 
 140 print "/////////////////////////////////////////////////////////////";
 141 print "/////////////////////////////////////////////////////////////";
 142 
 143 E := EllipticCurve([0,7823]);
 144 phi0 := GenusOneModel(Rationals(),4,
 145           [0,2,1,1,0,0,1,1,0,-2,1,0,1,-1,2,-1,2,-1,-1,1]);
 146 assert cInvariants(phi0) eq cInvariants(E);
 147 C,_,pi := nCovering(phi0:E:=E);
 148 pts := PointsQI(C,10^3);
 149 P := pi(pts[1]);
 150 // print Height(P);
 151 
 152 mymodels := [];
 153 pts := [];
 154 
 155 for n in [2..5] do
 156   phi,pt := GenusOneModel(n,P);
 157   if n eq 4 then assert IsEquivalent(phi,phi0); end if;
 158   mymodels cat:= [phi];
 159   pts cat:= [PRIM(Eltseq(pt))];
 160 end for;
 161 
 162 print "The generator for E(Q) where E : y^2 = x^3 + 7823";
 163 printf "has height h(P) = %o\n",Height(P);
 164 print "It may be found by searching for points on any of the following n-coverings.";
 165 for n in [2..5] do
 166   printf "n = %o  coeffs = %o\n",n,Eltseq(mymodels[n-1]);
 167 end for;
 168 print "The points we would need to find are";
 169 for n in [2..5] do
 170  printf "n = %o  Q = %o\n",n,pts[n-1];
 171 end for;
 172 
 173 print "/////////////////////////////////////////////////////////////";
 174 print "/////////////////////////////////////////////////////////////";
 175 
 176 print "Continuing with the last example with n = 5";
 177 E := EllipticCurve([0,7823]);
 178 phi := GenusOneModel(Rationals(),5,
 179    [-1,0,-1,0,0,0,1,-1,0,-1,1,1,0,1,-1,0,0,1,-1,0,1,1,0,0,0,
 180     0,0,1,1,-1,0,0,0,0,1,0,0,1,2,0,0,-1,0,0,0,-1,0,-1,0,0]);
 181 assert cInvariants(phi) eq cInvariants(E);
 182 C := Curve(phi);
 183 print "The genus one model with coefficients";
 184 print Eltseq(phi);
 185 print "has rational points";
 186 time pts := PointSearch(C,10^2);
 187 print {ProjectiveSpace(Integers(),4)!PRIM(Eltseq(pt)): pt in pts};
 188 
 189 print "We double this genus one model";
 190 time model2 := DoubleGenusOneModel(phi);
 191 R<x1,x2,x3,x4,x5> := PolynomialRing(phi);
 192 cc := Discriminant(phi);
 193 mat1 := Matrix(Rationals(),5,5,
 194    [ 0, 0, 0, 1, -1, 
 195      0, 0, -1, 0, -1, 
 196      0, 0, 0, 0, 1, 
 197      -1, 0, 0, 0, 0, 
 198      -1, -1, -1, 0, 0 ]);
 199 mat2 := Matrix(Rationals(),5,5,
 200    [  50, 58, 86, -74, -70, 
 201       49, 95, -59, -34, -26, 
 202       -7, -65, 27, -92, -72, 
 203       54, -6, 4, 66, -104, 
 204       86, -80, 56,-14, -4 ]);
 205 assert Determinant(mat2) eq cc;
 206 phi2 := <mat1,(1/cc)*mat2>*model2;
 207 print "The result has coefficients";
 208 print Eltseq(phi2);
 209 assert Eltseq(phi2) eq [1,0,1,-1,-1,-1,0,0,0,1,0,0,-1,0,-1,0,-1,0,0,0,0,
 210       0,0,0,-1,0,-1,-1,1,0,0,-1,0,-1,-1,0,0,0,-1,1,0,1,-1,0,0,1,0,0,0,0];
 211 print "Searching for rational points";
 212 C2 := Curve(phi2);
 213 time pts := PointSearch(C2,10^4);
 214 print {ProjectiveSpace(Integers(),4)!PRIM(Eltseq(pt)): pt in pts};
 215 print "Nothing found - but then we are looking on the wrong curve.";
 216 eqns := Equations(phi2);
 217 jmat := Matrix(R,5,5,[Derivative(q,R.i):i in [1..5],q in eqns]);
 218 S := (1/2)*Determinant(jmat);
 219 mypt := [0,2,2,3,-1];
 220 assert Evaluate(S,mypt) eq 0;
 221 printf "However, P0 = %o is a point on the secant variety S,\n",P4Z!mypt;
 222 R<x1,x2,x3,x4,x5> := PolynomialRing(phi2);
 223 tgt := &+[Evaluate(Derivative(S,R.i),mypt)*R.i:i in [1..5]];
 224 P4 := Proj(R);
 225 C := Scheme(P4,Equations(phi2));
 226 H := Scheme(P4,tgt);
 227 X := C meet H;
 228 pt := Points(X)[1];
 229 print "and the tangent space to S at P0 meets the curve at";
 230 print P4Z!PRIM(Eltseq(pt));
 231 print "Searching for points on S (a degree 5 hypersurface in P^4)";
 232 time pts := PointSearch(Scheme(P4,S),5);
 233 print [P4Z!PRIM(Eltseq(x)): x in pts];

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2010-07-06 12:43:39, 0.0 KB) [[attachment:covariants.m]]
  • [get | view] (2010-07-06 12:49:45, 29.0 KB) [[attachment:g1minimisation-2008.m]]
  • [get | view] (2010-07-06 12:50:13, 25.9 KB) [[attachment:g1reduction-2008.m]]
  • [get | view] (2010-07-06 12:50:43, 10.9 KB) [[attachment:minred-demo1.m]]
  • [get | view] (2010-07-06 12:51:02, 7.6 KB) [[attachment:minred-demo2.m]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.