-
Notifications
You must be signed in to change notification settings - Fork 0
/
Deg2K3RankUpperBound
130 lines (113 loc) · 3.88 KB
/
Deg2K3RankUpperBound
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
This file contains version 1.2 of Dino Festis code: "Van Luijk method for degree 2 K3 surfaces".
The most recent version can be found on the website:
https://sites.google.com/view/dinofesti/documents
*/
/*
The function checks whether a polynomial of degree at most 22 is cyclotomic.
The degree is important, because the test is tailored to this degree. In fact the n-th Cyclotomic Polynomial has degree d=phi(n), where phi() is Euler's totient function.
Using the lower bounds for phi(), you can prove that if n>=210 then phi(n)>=48, so we know that n<=210.
Looking at the ratio n/phi(n) for all the n<210 such that phi(n)<=22, you get that this ratio is at most 15/4, from which it follows that n<4*phi(n)=4d, the bound used in the test.
*/
function IsCyclotomic(f)
if not IsIrreducible(f) then
return false;
end if;
if Degree(f) eq 1 then
if Eltseq(f) in {[-1,1],[1,1]} then
return true;
else
return false;
end if;
end if;
K<a>:=NumberField(f);
rs:=Roots(f,K);
r:=rs[1][1];
d:=Degree(f);
for i in [1..4*d] do
ri:=r^i;
if ri eq 1 then
return true;
end if;
end for;
return false;
end function;
/* Given a homogeneous polynomial f defining a smooth curve C, the function returns all the primes p up to B such that the reduction of C mod p is smooth */
function PrimesGoodReduction(f,B)
IP2<x,y,z>:=ProjectivePlane(Rationals());
C:=Curve(IP2, Evaluate(f,[x,y,z]));
assert IsNonsingular(C);
ps:=PrimesUpTo(B);
if ps[1] eq 2 then
Remove(~ps,1);
end if;
gps:=[];
for p in ps do
Cp:=Reduction(C,p);
if IsNonsingular(Cp) then
Append(~gps,p);
end if;
end for;
return gps;
end function;
/* Given a prime p and a homogeneous polynomial f with integral coefficients defining a smooth sextic curve over IF_p, the function below returns the geometric Picard number of the K3 surface S:w^2=f defined over IF_p; it also returns the discriminant of the geometric Picard lattice of S up to squares */
function Deg2PicNumberModp(f,p)
Rp<x,y,z>:=PolynomialRing(GF(p),3);
fp:=Rp!Evaluate(f,[x,y,z]);
assert IsHomogeneous(f);
IP2p:=ProjectiveSpace(Rp);
Bp:=Curve(IP2p,fp);
if not IsReduced(Bp) then
return(<0,0,0>);
end if;
R<u>:=PolynomialRing(Rationals());
wp,wpsing:=WeilPolynomialOfDegree2K3Surface(fp);
if wpsing eq 0 then
return(<0,0,0>);
end if;
wp:=R!wp;
fwp:=Factorization(wp);
ufwp:=[Evaluate(f[1],p*u)/(p^(Degree(f[1]))) : f in fwp];
ci:=[IsCyclotomic(f) : f in ufwp];
cfwp:=[<fwp[i][1],fwp[i][2],ci[i]> : i in [1..#ci]];
tfwp:=[1] cat [f[1]^f[2] : f in cfwp | not f[3]];
twp:=&*tfwp;
twp:=R!(Numerator(Evaluate(R!twp,1/u)));
dp:=SquarefreeFactorization(Abs(Integers()!(p*Evaluate(twp,1/p))));
rp:=Degree(&*[f[1]^f[2] : f in cfwp | f[3]]);
rsingp:=Degree(wpsing);
return(<rp,rsingp,dp>);
end function;
/* Given a homogeneous polynomial f of degree 6, and let X be the degree 2 K3 surface define by w^2=f.
The function returns an upper bound for X using van Luijk's method for all primes of good reductions of X up to B.
It can take long. The bottleneck is the function WeilPolynomialOfDegree2K3Surface */
function Deg2K3RankUpperBound(f,B)
ps:=Remove(PrimesUpTo(B),1);
Remove(~ps,1);
R<u>:=PolynomialRing(Rationals());
resp:=<0,0,0>;
while resp eq <0,0,0> do
p:=ps[1];
resp:=Deg2PicNumberModp(f,p);
Remove(~ps,1);
if ps eq [] then
return(resp);
end if;
end while;
rp:=resp[1];rsingp:=resp[2];dp:=resp[3];
rhop:=rp+rsingp;
for p1 in ps do
resp1:=Deg2PicNumberModp(f,p1);
if resp1 ne <0,0,0> then
rp1:=resp1[1];rsingp1:=resp1[2];dp1:=resp1[3];
rhop1:=rp1+rsingp1;
if rhop1 lt rhop then
rhop:=rhop1; dp:=dp1; p:=p1;
end if;
if rhop1 eq rhop and dp1 ne dp then
return <rhop-1, <p, rhop, dp>, <p1, rhop1, dp1>>;
end if;
end if;
end for;
return <rhop,<p, rhop, dp>>;
end function;