torsionb.red 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. module torsionb;
  2. % Author: James H. Davenport.
  3. fluid '(!*tra !*trmin intvar nestedsqrts);
  4. exports bound!-torsion;
  5. symbolic procedure bound!-torsion(divisor,dof1k);
  6. % Version 1 (see Trinity Thesis for difference).
  7. begin
  8. scalar field,prime1,prime2,prime3,minimum,places;
  9. scalar non!-p1,non!-p2,non!-p3,curve,curve2,nestedsqrts;
  10. places:=for each u in divisor
  11. collect car u;
  12. curve:=getsqrtsfromplaces places;
  13. if nestedsqrts
  14. then rerror(algint,3,"Not yet implemented")
  15. else curve2:=curve;
  16. for each u in places do begin
  17. u:=rfirstsubs u;
  18. if eqcar(u,'quotient) and cadr u = 1
  19. then return;
  20. u:=substitutesq(simp u,list(intvar . 0));
  21. field:=union(field,sqrtsinsq(u,nil));
  22. u:=list(intvar . prepsq u);
  23. for each v in curve2 do
  24. field:=union(field,sqrtsinsq(substitutesq(v,u),nil));
  25. end;
  26. prime1:=2;
  27. while null (non!-p1:=good!-reduction(curve,dof1k,field,prime1)) do
  28. prime1:=nextprime prime1;
  29. prime2:=nextprime prime1;
  30. while null (non!-p2:=good!-reduction(curve,dof1k,field,prime2)) do
  31. prime2:=nextprime prime2;
  32. prime3:=nextprime prime2;
  33. while null (non!-p3:=good!-reduction(curve,dof1k,field,prime3)) do
  34. prime3:=nextprime prime3;
  35. minimum:=fix sqrt float(non!-p1*non!-p2*non!-p3);
  36. minimum:=min(minimum,non!-p1*max!-power(prime1,min(non!-p2,non!-p3)));
  37. minimum:=min(minimum,non!-p2*max!-power(prime2,min(non!-p1,non!-p3)));
  38. minimum:=min(minimum,non!-p3*max!-power(prime3,min(non!-p2,non!-p1)));
  39. if !*tra or !*trmin then <<
  40. princ "Torsion is bounded by ";
  41. printc minimum >>;
  42. return minimum
  43. end;
  44. symbolic procedure max!-power(p,n);
  45. % Greatest power of p not greater than n.
  46. begin scalar ans;
  47. ans:=1;
  48. while ans<=n do
  49. ans:=ans*p;
  50. ans:=ans/p;
  51. end;
  52. symbolic procedure good!-reduction(curve,dof1k,field,prime);
  53. begin
  54. scalar u;
  55. u:=algebraic!-factorise(prime,field);
  56. interr "Good reduction not finished";
  57. end;
  58. endmodule;
  59. end;