Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/schemes/elliptic_curves/sha_tate.py
8820 views
1
# -*- coding: utf-8 -*-
2
r"""
3
Tate-Shafarevich group
4
5
If `E` is an elliptic curve over a global field `K`, the Tate-Shafarevich group
6
is the subgroup of elements in `H^1(K,E)` which map to zero under every global-to-local
7
restriction map `H^1(K,E) \to H^1(K_v,E)`, one for each place `v`
8
of `K`.
9
10
The group is usually denoted by the Russian letter Sha (Ш), in this document it will be denoted by `Sha`.
11
12
`Sha` is known to be an abelian torsion group. It is conjectured that the Tate-Shafarevich group is finite for any elliptic curve over a global field. But it is not known in general.
13
14
A theorem of Kolyvagin and Gross-Zagier using Heegner points shows that if the L-series of an elliptic curve `E/\QQ` does not
15
vanish at 1 or has a simple zero there, then `Sha` is finite.
16
17
A theorem of Kato, together with theorems from Iwasawa theory, allow for certain primes `p` to show that the `p`-primary part of `Sha` is finite and gives an effective upper bound for it.
18
19
The (`p`-adic) conjecture of Birch and Swinnerton-Dyer predicts the order of `Sha` from the leading term of the (`p`-adic) L-series of the elliptic curve.
20
21
Sage can compute a few things about `Sha`. The commands ``an``,
22
``an_numerical`` and ``an_padic`` compute the conjectural order of `Sha`
23
as a real or `p`-adic number. With ``p_primary_bound`` one can find an
24
upper bound of the size of the `p`-primary part of `Sha`. Finally, if
25
the analytic rank is at most 1, then ``bound_kato`` and
26
``bound_kolyvagin`` find all primes for which the theorems of Kato
27
and Kolyvagin respectively do not prove the triviality the `p`-primary
28
part of `Sha`.
29
30
EXAMPLES::
31
32
sage: E = EllipticCurve('11a1')
33
sage: S = E.sha()
34
sage: S.bound_kato()
35
[2, 3, 5]
36
sage: S.bound_kolyvagin()
37
([2, 5], 1)
38
sage: S.an_padic(7,3)
39
1 + O(7^5)
40
sage: S.an()
41
1
42
sage: S.an_numerical()
43
1.00000000000000
44
45
sage: E = EllipticCurve('389a')
46
sage: S = E.sha(); S
47
Tate-Shafarevich group for the Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
48
sage: S.an_numerical()
49
1.00000000000000
50
sage: S.p_primary_bound(5)
51
0
52
sage: S.an_padic(5)
53
1 + O(5)
54
sage: S.an_padic(5,prec=4) # long time (2s on sage.math, 2011)
55
1 + O(5^3)
56
57
58
AUTHORS:
59
60
- William Stein (2007) -- initial version
61
62
- Chris Wuthrich (April 2009) -- reformat docstrings
63
64
"""
65
#*****************************************************************************
66
# Copyright (C) 2007 William Stein <[email protected]>
67
#
68
# Distributed under the terms of the GNU General Public License (GPL)
69
# as published by the Free Software Foundation; either version 2 of
70
# the License, or (at your option) any later version.
71
# http://www.gnu.org/licenses/
72
#*****************************************************************************
73
74
from sage.structure.sage_object import SageObject
75
from sage.rings.all import (
76
Integer,
77
RealField,
78
RationalField,
79
RIF,
80
ZZ)
81
from sage.misc.functional import log
82
from math import sqrt
83
from sage.misc.all import verbose
84
import sage.rings.arith as arith
85
from sage.rings.padics.factory import Qp
86
87
factor = arith.factor
88
valuation = arith.valuation
89
Q = RationalField()
90
91
class Sha(SageObject):
92
r"""
93
The Tate-Shafarevich group associated to an elliptic curve.
94
95
If `E` is an elliptic curve over a global field `K`, the Tate-Shafarevich group
96
is the subgroup of elements in `H^1(K,E)` which map to zero under every global-to-local
97
restriction map `H^1(K,E) \to H^1(K_v,E)`, one for each place `v`
98
of `K`.
99
100
EXAMPLES::
101
102
sage: E = EllipticCurve('571a1')
103
sage: E._set_gens([])
104
sage: S = E.sha()
105
sage: S.bound_kato()
106
[2, 3]
107
sage: S.bound_kolyvagin()
108
([2], 1)
109
sage: S.an_padic(7,3)
110
4 + O(7^5)
111
sage: S.an()
112
4
113
sage: S.an_numerical()
114
4.00000000000000
115
116
sage: E = EllipticCurve('389a')
117
sage: S = E.sha(); S
118
Tate-Shafarevich group for the Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
119
sage: S.an_numerical()
120
1.00000000000000
121
sage: S.p_primary_bound(5) # long time
122
0
123
sage: S.an_padic(5) # long time
124
1 + O(5)
125
sage: S.an_padic(5,prec=4) # long time
126
1 + O(5^3)
127
"""
128
def __init__(self, E):
129
r"""
130
The Tate-Shafarevich group associated to an elliptic curve.
131
132
INPUT:
133
134
- E -- an elliptic curve over `\QQ`
135
136
EXAMPLES::
137
138
sage: E = EllipticCurve('11a1')
139
sage: S = E.sha()
140
sage: S
141
Tate-Shafarevich group for the Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
142
143
sage: S == loads(dumps(S))
144
True
145
"""
146
self.E = E
147
self.Emin = E.minimal_model() if not E.is_minimal() else E
148
149
def __cmp__(self,other):
150
r"""
151
Compares two Tate-Shafarevich groups by simply comparing the elliptic curves.
152
153
EXAMPLES::
154
155
sage: E = EllipticCurve('37a1')
156
sage: S = E.sha()
157
sage: S == S
158
True
159
"""
160
c = cmp(type(self), type(other))
161
if c:
162
return c
163
return cmp(self.E, other.E)
164
165
def __repr__(self):
166
r"""
167
String representation of the Tate-Shafarevich group.
168
169
EXAMPLES::
170
171
sage: E = EllipticCurve('11a1')
172
sage: S = E.sha()
173
sage: S.__repr__()
174
'Tate-Shafarevich group for the Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field'
175
176
"""
177
return "Tate-Shafarevich group for the " + repr(self.E)
178
179
########################################################################
180
# Functions related to the BSD conjecture.
181
########################################################################
182
183
def an_numerical(self, prec = None,
184
use_database=True, proof=None):
185
r"""
186
Return the numerical analytic order of `Sha`, which is
187
a floating point number in all cases.
188
189
INPUT:
190
191
- ``prec`` - integer (default: 53) bits precision -- used
192
for the L-series computation, period, regulator, etc.
193
- ``use_database`` - whether the rank and generators should
194
be looked up in the database if possible. Default is ``True``
195
- ``proof`` - bool or ``None`` (default: ``None``, see proof.[tab] or
196
sage.structure.proof) proof option passed
197
onto regulator and rank computation.
198
199
.. note::
200
201
See also the :meth:`an` command, which will return a
202
provably correct integer when the rank is 0 or 1.
203
204
.. WARNING::
205
206
If the curve's generators are not known, computing
207
them may be very time-consuming. Also, computation of the
208
L-series derivative will be time-consuming for large rank and
209
large conductor, and the computation time for this may
210
increase substantially at greater precision. However, use of
211
very low precision less than about 10 can cause the underlying
212
PARI library functions to fail.
213
214
EXAMPLES::
215
216
sage: EllipticCurve('11a').sha().an_numerical()
217
1.00000000000000
218
sage: EllipticCurve('37a').sha().an_numerical()
219
1.00000000000000
220
sage: EllipticCurve('389a').sha().an_numerical()
221
1.00000000000000
222
sage: EllipticCurve('66b3').sha().an_numerical()
223
4.00000000000000
224
sage: EllipticCurve('5077a').sha().an_numerical()
225
1.00000000000000
226
227
A rank 4 curve::
228
229
sage: EllipticCurve([1, -1, 0, -79, 289]).sha().an_numerical() # long time (3s on sage.math, 2011)
230
1.00000000000000
231
232
A rank 5 curve::
233
234
sage: EllipticCurve([0, 0, 1, -79, 342]).sha().an_numerical(prec=10, proof=False) # long time (22s on sage.math, 2011)
235
1.0
236
237
See :trac:`1115`::
238
239
sage: sha=EllipticCurve('37a1').sha()
240
sage: [sha.an_numerical(prec) for prec in xrange(40,100,10)] # long time (3s on sage.math, 2013)
241
[1.0000000000,
242
1.0000000000000,
243
1.0000000000000000,
244
1.0000000000000000000,
245
1.0000000000000000000000,
246
1.0000000000000000000000000]
247
"""
248
if prec is None:
249
prec = RealField().precision()
250
RR = RealField(prec)
251
prec2 = prec+2
252
RR2 = RealField(prec2)
253
try:
254
an = self.__an_numerical
255
if an.parent().precision() >= prec:
256
return RR(an)
257
else: # cached precision too low
258
pass
259
except AttributeError:
260
pass
261
# it's critical to switch to the minimal model.
262
E = self.Emin
263
r = Integer(E.rank(use_database=use_database, proof=proof))
264
L = E.lseries().dokchitser(prec=prec2)
265
Lr= RR2(L.derivative(1,r)) # L.derivative() returns a Complex
266
Om = RR2(E.period_lattice().omega(prec2))
267
Reg = E.regulator(use_database=use_database, proof=proof, precision=prec2)
268
T = E.torsion_order()
269
cp = E.tamagawa_product()
270
Sha = RR((Lr*T*T)/(r.factorial()*Om*cp*Reg))
271
self.__an_numerical = Sha
272
return Sha
273
274
def an(self, use_database=False, descent_second_limit=12):
275
r"""
276
Returns the Birch and Swinnerton-Dyer conjectural order of `Sha`
277
as a provably correct integer, unless the analytic rank is > 1,
278
in which case this function returns a numerical value.
279
280
INPUT:
281
282
- ``use_database`` -- bool (default: ``False``); if ``True``, try to use any
283
databases installed to lookup the analytic order of `Sha`, if
284
possible. The order of `Sha` is computed if it cannot be looked up.
285
286
- ``descent_second_limit`` -- int (default: 12); limit to use on
287
point searching for the quartic twist in the hard case
288
289
This result is proved correct if the order of vanishing is 0
290
and the Manin constant is <= 2.
291
292
If the optional parameter ``use_database`` is ``True`` (default:
293
``False``), this function returns the analytic order of `Sha` as
294
listed in Cremona's tables, if this curve appears in Cremona's
295
tables.
296
297
NOTE:
298
299
If you come across the following error::
300
301
sage: E = EllipticCurve([0, 0, 1, -34874, -2506691])
302
sage: E.sha().an()
303
Traceback (most recent call last):
304
...
305
RuntimeError: Unable to compute the rank, hence generators, with certainty (lower bound=0, generators found=[]). This could be because Sha(E/Q)[2] is nontrivial.
306
Try increasing descent_second_limit then trying this command again.
307
308
You can increase the ``descent_second_limit`` (in the above example,
309
set to the default, 12) option to try again::
310
311
sage: E.sha().an(descent_second_limit=16) # long time (2s on sage.math, 2011)
312
1
313
314
EXAMPLES::
315
316
sage: E = EllipticCurve([0, -1, 1, -10, -20]) # 11A = X_0(11)
317
sage: E.sha().an()
318
1
319
sage: E = EllipticCurve([0, -1, 1, 0, 0]) # X_1(11)
320
sage: E.sha().an()
321
1
322
323
sage: EllipticCurve('14a4').sha().an()
324
1
325
sage: EllipticCurve('14a4').sha().an(use_database=True) # will be faster if you have large Cremona database installed
326
1
327
328
The smallest conductor curve with nontrivial `Sha`::
329
330
sage: E = EllipticCurve([1,1,1,-352,-2689]) # 66b3
331
sage: E.sha().an()
332
4
333
334
The four optimal quotients with nontrivial `Sha` and conductor <= 1000::
335
336
sage: E = EllipticCurve([0, -1, 1, -929, -10595]) # 571A
337
sage: E.sha().an()
338
4
339
sage: E = EllipticCurve([1, 1, 0, -1154, -15345]) # 681B
340
sage: E.sha().an()
341
9
342
sage: E = EllipticCurve([0, -1, 0, -900, -10098]) # 960D
343
sage: E.sha().an()
344
4
345
sage: E = EllipticCurve([0, 1, 0, -20, -42]) # 960N
346
sage: E.sha().an()
347
4
348
349
The smallest conductor curve of rank > 1::
350
351
sage: E = EllipticCurve([0, 1, 1, -2, 0]) # 389A (rank 2)
352
sage: E.sha().an()
353
1.00000000000000
354
355
The following are examples that require computation of the Mordell-Weil
356
group and regulator::
357
358
sage: E = EllipticCurve([0, 0, 1, -1, 0]) # 37A (rank 1)
359
sage: E.sha().an()
360
1
361
362
sage: E = EllipticCurve("1610f3")
363
sage: E.sha().an()
364
4
365
366
In this case the input curve is not minimal, and if this function did not
367
transform it to be minimal, it would give nonsense::
368
369
sage: E = EllipticCurve([0,-432*6^2])
370
sage: E.sha().an()
371
1
372
373
See :trac:`10096`: this used to give the wrong result 6.0000
374
before since the minimal model was not used::
375
376
sage: E = EllipticCurve([1215*1216,0]) # non-minimal model
377
sage: E.sha().an() # long time (2s on sage.math, 2011)
378
1.00000000000000
379
sage: E.minimal_model().sha().an() # long time (1s on sage.math, 2011)
380
1.00000000000000
381
"""
382
if hasattr(self, '__an'):
383
return self.__an
384
if use_database:
385
d = self.Emin.database_curve()
386
if hasattr(d, 'db_extra'):
387
self.__an = Integer(round(float(d.db_extra[4])))
388
return self.__an
389
390
# it's critical to switch to the minimal model.
391
E = self.Emin
392
eps = E.root_number()
393
if eps == 1:
394
L1_over_omega = E.lseries().L_ratio()
395
if L1_over_omega == 0: # order of vanishing is at least 2
396
return self.an_numerical(use_database=use_database)
397
T = E.torsion_subgroup().order()
398
Sha = (L1_over_omega * T * T) / Q(E.tamagawa_product())
399
try:
400
Sha = Integer(Sha)
401
except ValueError:
402
raise RuntimeError("There is a bug in an, since the computed conjectural order of Sha is %s, which is not an integer."%Sha)
403
if not arith.is_square(Sha):
404
raise RuntimeError("There is a bug in an, since the computed conjectural order of Sha is %s, which is not a square."%Sha)
405
E.__an = Sha
406
self.__an = Sha
407
return Sha
408
409
else: # rank > 0 (Not provably correct)
410
L1, error_bound = E.lseries().deriv_at1(10*sqrt(E.conductor()) + 10)
411
if abs(L1) < error_bound:
412
s = self.an_numerical()
413
E.__an = s
414
self.__an = s
415
return s
416
417
regulator = E.regulator(use_database=use_database, descent_second_limit=descent_second_limit)
418
T = E.torsion_subgroup().order()
419
omega = E.period_lattice().omega()
420
Sha = Integer(round ( (L1 * T * T) / (E.tamagawa_product() * regulator * omega) ))
421
try:
422
Sha = Integer(Sha)
423
except ValueError:
424
raise RuntimeError("There is a bug in an, since the computed conjectural order of Sha is %s, which is not an integer."%Sha)
425
if not arith.is_square(Sha):
426
raise RuntimeError("There is a bug in an, since the computed conjectural order of Sha is %s, which is not a square."%Sha)
427
E.__an = Sha
428
self.__an = Sha
429
return Sha
430
431
def an_padic(self, p, prec=0, use_twists=True):
432
r"""
433
Returns the conjectural order of `Sha(E/\QQ)`,
434
according to the `p`-adic analogue of the Birch
435
and Swinnerton-Dyer conjecture as formulated
436
in [MTT]_ and [BP]_.
437
438
REFERENCES:
439
440
.. [MTT] B. Mazur, J. Tate, and J. Teitelbaum, On `p`-adic
441
analogues of the conjectures of Birch and Swinnerton-Dyer,
442
Inventiones mathematicae 84, (1986), 1-48.
443
444
.. [BP] Dominique Bernardi and Bernadette Perrin-Riou,
445
Variante `p`-adique de la conjecture de Birch et
446
Swinnerton-Dyer (le cas supersingulier),
447
C. R. Acad. Sci. Paris, Ser I. Math, 317 (1993), no 3,
448
227-232.
449
450
.. [SW] William Stein and Christian Wuthrich, Computations
451
About Tate-Shafarevich Groups using Iwasawa theory,
452
preprint 2009.
453
454
INPUT:
455
456
- ``p`` - a prime > 3
457
458
- ``prec`` (optional) - the precision used in the computation of the `p`-adic L-Series
459
460
- ``use_twists`` (default = ``True``) - If ``True`` the algorithm may change
461
to a quadratic twist with minimal conductor to do the modular
462
symbol computations rather than using the modular symbols of the
463
curve itself. If ``False`` it forces the computation using the
464
modular symbols of the curve itself.
465
466
OUTPUT: `p`-adic number - that conjecturally equals `\# Sha(E/\QQ)`.
467
468
If ``prec`` is set to zero (default) then the precision is set so that
469
at least the first `p`-adic digit of conjectural `\# Sha(E/\QQ)` is
470
determined.
471
472
EXAMPLES:
473
474
Good ordinary examples::
475
476
sage: EllipticCurve('11a1').sha().an_padic(5) # rank 0
477
1 + O(5^2)
478
sage: EllipticCurve('43a1').sha().an_padic(5) # rank 1
479
1 + O(5)
480
sage: EllipticCurve('389a1').sha().an_padic(5,4) # rank 2, long time (2s on sage.math, 2011)
481
1 + O(5^3)
482
sage: EllipticCurve('858k2').sha().an_padic(7) # rank 0, non trivial sha, long time (10s on sage.math, 2011)
483
Traceback (most recent call last): # 32-bit (see ticket :trac: `112111`)
484
... # 32-bit
485
OverflowError: Python int too large to convert to C long # 32-bit
486
7^2 + O(7^6) # 64-bit
487
sage: EllipticCurve('300b2').sha().an_padic(3) # 9 elements in sha, long time (2s on sage.math, 2011)
488
3^2 + O(3^6)
489
sage: EllipticCurve('300b2').sha().an_padic(7, prec=6) # long time
490
2 + 7 + O(7^8)
491
492
Exceptional cases::
493
494
sage: EllipticCurve('11a1').sha().an_padic(11) # rank 0
495
1 + O(11^2)
496
sage: EllipticCurve('130a1').sha().an_padic(5) # rank 1
497
1 + O(5)
498
499
Non-split, but rank 0 case (:trac:`7331`)::
500
501
sage: EllipticCurve('270b1').sha().an_padic(5) # rank 0, long time (2s on sage.math, 2011)
502
1 + O(5^2)
503
504
The output has the correct sign::
505
506
sage: EllipticCurve('123a1').sha().an_padic(41) # rank 1, long time (3s on sage.math, 2011)
507
1 + O(41)
508
509
Supersingular cases::
510
511
sage: EllipticCurve('34a1').sha().an_padic(5) # rank 0
512
1 + O(5^2)
513
sage: EllipticCurve('53a1').sha().an_padic(5) # rank 1, long time (11s on sage.math, 2011)
514
1 + O(5)
515
516
Cases that use a twist to a lower conductor::
517
518
sage: EllipticCurve('99a1').sha().an_padic(5)
519
1 + O(5)
520
sage: EllipticCurve('240d3').sha().an_padic(5) # sha has 4 elements here
521
4 + O(5)
522
sage: EllipticCurve('448c5').sha().an_padic(7,prec=4, use_twists=False) # long time (2s on sage.math, 2011)
523
2 + 7 + O(7^6)
524
sage: EllipticCurve([-19,34]).sha().an_padic(5) # see :trac: `6455`, long time (4s on sage.math, 2011)
525
1 + O(5)
526
"""
527
try:
528
return self.__an_padic[(p,prec)]
529
except AttributeError:
530
self.__an_padic = {}
531
except KeyError:
532
pass
533
534
E = self.Emin
535
tam = E.tamagawa_product()
536
tors = E.torsion_order()**2
537
reg = E.padic_regulator(p)
538
# todo : here we should cache the rank computation
539
r = E.rank()
540
541
542
if use_twists and p > 2:
543
Et, D = E.minimal_quadratic_twist()
544
# trac 6455 : we have to assure that the twist back is allowed
545
D = ZZ(D)
546
if D % p == 0:
547
D = D/p
548
for ell in D.prime_divisors():
549
if ell % 2 == 1:
550
if Et.conductor() % ell**2 == 0:
551
D = D/ell
552
ve = valuation(D,2)
553
de = (D/2**ve).abs()
554
if de % 4 == 3:
555
de = -de
556
Et = E.quadratic_twist(de)
557
# now check individually if we can twist by -1 or 2 or -2
558
Nmin = Et.conductor()
559
Dmax = de
560
for DD in [-4*de,8*de,-8*de]:
561
Et = E.quadratic_twist(DD)
562
if Et.conductor() < Nmin and valuation(Et.conductor(),2) <= valuation(DD,2):
563
Nmin = Et.conductor()
564
Dmax = DD
565
D = Dmax
566
Et = E.quadratic_twist(D)
567
lp = Et.padic_lseries(p)
568
else :
569
lp = E.padic_lseries(p)
570
D = 1
571
572
if r == 0 and D == 1:
573
# short cut for rank 0 curves, we do not
574
# to compute the p-adic L-function, the leading
575
# term will be the L-value divided by the Neron
576
# period.
577
ms = E.modular_symbol(sign=+1, normalize='L_ratio')
578
lstar = ms(0)/E.real_components()
579
bsd = tam/tors
580
if prec == 0:
581
prec = valuation(lstar/bsd, p)
582
shan = Qp(p,prec=prec+2)(lstar/bsd)
583
584
585
elif E.is_ordinary(p):
586
K = reg.parent()
587
lg = log(K(1+p))
588
589
if (E.is_good(p) or E.ap(p) == -1):
590
if not E.is_good(p):
591
eps = 2
592
else:
593
eps = (1-arith.kronecker_symbol(D,p)/lp.alpha())**2
594
# according to the p-adic BSD this should be equal to the leading term of the p-adic L-series divided by sha:
595
bsdp = tam * reg * eps/tors/lg**r
596
else:
597
r += 1 # exceptional zero
598
eq = E.tate_curve(p)
599
Li = eq.L_invariant()
600
601
# according to the p-adic BSD (Mazur-Tate-Teitelbaum)
602
# this should be equal to the leading term of the p-adic L-series divided by sha:
603
bsdp = tam * reg * Li/tors/lg**r
604
605
606
v = bsdp.valuation()
607
if v > 0:
608
verbose("the prime is irregular.")
609
610
# determine how much prec we need to prove at least the triviality of
611
# the p-primary part of Sha
612
613
if prec == 0:
614
n = max(v,2)
615
bounds = lp._prec_bounds(n,r+1)
616
while bounds[r] <= v:
617
n += 1
618
bounds = lp._prec_bounds(n,r+1)
619
verbose("set precision to %s"%n)
620
else:
621
n = max(2,prec)
622
623
not_yet_enough_prec = True
624
while not_yet_enough_prec:
625
lps = lp.series(n,quadratic_twist=D,prec=r+1)
626
lstar = lps[r]
627
if (lstar != 0) or (prec != 0):
628
not_yet_enough_prec = False
629
else:
630
n += 1
631
verbose("increased precision to %s"%n)
632
633
shan = lstar/bsdp
634
635
elif E.is_supersingular(p):
636
K = reg[0].parent()
637
lg = log(K(1+p))
638
639
640
# according to the p-adic BSD this should be equal to the leading term of the D_p - valued
641
# L-series :
642
bsdp = tam /tors/lg**r * reg
643
# note this is an element in Q_p^2
644
645
verbose("the algebraic leading terms : %s"%bsdp)
646
647
v = [bsdp[0].valuation(),bsdp[1].valuation()]
648
649
if prec == 0:
650
n = max(min(v)+2,3)
651
else:
652
n = max(3,prec)
653
654
verbose("...computing the p-adic L-series")
655
not_yet_enough_prec = True
656
while not_yet_enough_prec:
657
lps = lp.Dp_valued_series(n,quadratic_twist=D,prec=r+1)
658
lstar = [lps[0][r],lps[1][r]]
659
verbose("the leading terms : %s"%lstar)
660
if (lstar[0] != 0 or lstar[1] != 0) or ( prec != 0):
661
not_yet_enough_prec = False
662
else:
663
n += 1
664
verbose("increased precision to %s"%n)
665
666
verbose("...putting things together")
667
if bsdp[0] != 0:
668
shan0 = lstar[0]/bsdp[0]
669
else:
670
shan0 = 0 # this should actually never happen
671
if bsdp[1] != 0:
672
shan1 = lstar[1]/bsdp[1]
673
else:
674
shan1 = 0 # this should conjecturally only happen when the rank is 0
675
verbose("the two values for Sha : %s"%[shan0,shan1])
676
677
# check consistency (the first two are only here to avoid a bug in the p-adic L-series
678
# (namely the coefficients of zero-relative precision are treated as zero)
679
if shan0 != 0 and shan1 != 0 and shan0 - shan1 != 0:
680
raise RuntimeError("There must be a bug in the supersingular routines for the p-adic BSD.")
681
682
#take the better
683
if shan1 == 0 or shan0.precision_relative() > shan1.precision_relative():
684
shan = shan0
685
else:
686
shan = shan1
687
688
else:
689
raise ValueError("The curve has to have semi-stable reduction at p.")
690
691
self.__an_padic[(p,prec)] = shan
692
return shan
693
694
695
def p_primary_bound(self, p):
696
r"""
697
Returns a provable upper bound for the order of `Sha(E)(p)`. In particular,
698
if this algorithm does not fail, then it proves that the `p`-primary
699
part of `Sha` is finite.
700
701
INPUT: ``p`` -- a prime > 2
702
703
OUTPUT: integer -- power of `p` that bounds the order of `Sha(E)(p)` from above
704
705
The result is a proven upper bound on the order of `Sha(E)(p)`.
706
So in particular it proves it finiteness even if the rank of
707
the curve is larger than 1. Note also that this bound is sharp
708
if one assumes the main conjecture of Iwasawa theory of
709
elliptic curves (and this is known in certain cases).
710
711
Currently the algorithm is only implemented when certain conditions are verified.
712
713
- The mod `p` Galois representation must be surjective.
714
- The reduction at `p` is not allowed to be additive.
715
- If the reduction at `p` is non-split multiplicative, then the rank has to be 0.
716
- If `p=3` then the reduction at 3 must be good ordinary or split multiplicative and the rank must be 0.
717
718
719
EXAMPLES::
720
721
sage: e = EllipticCurve('11a3')
722
sage: e.sha().p_primary_bound(3)
723
0
724
sage: e.sha().p_primary_bound(7)
725
0
726
sage: e.sha().p_primary_bound(11)
727
0
728
sage: e.sha().p_primary_bound(13)
729
0
730
731
sage: e = EllipticCurve('389a1')
732
sage: e.sha().p_primary_bound(5)
733
0
734
sage: e.sha().p_primary_bound(7)
735
0
736
sage: e.sha().p_primary_bound(11)
737
0
738
sage: e.sha().p_primary_bound(13)
739
0
740
741
sage: e = EllipticCurve('858k2')
742
sage: e.sha().p_primary_bound(3) # long time (10s on sage.math, 2011)
743
Traceback (most recent call last): # 32-bit (see :trac: `11211`)
744
... # 32-bit
745
OverflowError: Python int too large to convert to C long # 32-bit
746
0 # 64-bit
747
748
Some checks for :trac:`6406`::
749
750
sage: e.sha().p_primary_bound(7)
751
Traceback (most recent call last):
752
...
753
ValueError: The mod-p Galois representation is not surjective. Current knowledge about Euler systems does not provide an upper bound in this case. Try an_padic for a conjectural bound.
754
755
sage: e.sha().an_padic(7) # long time (depends on "e.sha().p_primary_bound(3)" above)
756
Traceback (most recent call last): # 32-bit
757
... # 32-bit
758
OverflowError: Python int too large to convert to C long # 32-bit
759
7^2 + O(7^6) # 64-bit
760
761
sage: e = EllipticCurve('11a3')
762
sage: e.sha().p_primary_bound(5)
763
Traceback (most recent call last):
764
...
765
ValueError: The mod-p Galois representation is not surjective. Current knowledge about Euler systems does not provide an upper bound in this case. Try an_padic for a conjectural bound.
766
sage: e.sha().an_padic(5)
767
1 + O(5^2)
768
"""
769
p = Integer(p)
770
E = self.Emin
771
if E.is_ordinary(p) or E.is_good(p):
772
su = E.galois_representation().is_surjective(p)
773
if not su :
774
raise ValueError("The mod-p Galois representation is not surjective. Current knowledge about Euler systems does not provide an upper bound in this case. Try an_padic for a conjectural bound.")
775
shan = self.an_padic(p,prec = 0,use_twists=True)
776
if shan == 0:
777
raise RuntimeError("There is a bug in an_padic.")
778
S = shan.valuation()
779
else:
780
raise ValueError("The curve has to have semi-stable reduction at p.")
781
782
return S
783
784
def two_selmer_bound(self):
785
r"""
786
This returns the 2-rank, i.e. the `\GF{2}`-dimension
787
of the 2-torsion part of `Sha`, provided we can determine the
788
rank of `E`.
789
790
EXAMPLES::
791
792
sage: sh = EllipticCurve('571a1').sha()
793
sage: sh.two_selmer_bound()
794
2
795
sage: sh.an()
796
4
797
798
sage: sh = EllipticCurve('66a1').sha()
799
sage: sh.two_selmer_bound()
800
0
801
sage: sh.an()
802
1
803
804
sage: sh = EllipticCurve('960d1').sha()
805
sage: sh.two_selmer_bound()
806
2
807
sage: sh.an()
808
4
809
"""
810
E = self.Emin
811
S = E.selmer_rank()
812
r = E.rank()
813
t = E.two_torsion_rank()
814
b = S - r - t
815
if b < 0 :
816
b = 0
817
return b
818
819
def bound_kolyvagin(self, D=0, regulator=None,
820
ignore_nonsurj_hypothesis=False):
821
r"""
822
Given a fundamental discriminant `D \neq -3,-4` that satisfies the
823
Heegner hypothesis for `E`, return a list of primes so that
824
Kolyvagin's theorem (as in Gross's paper) implies that any
825
prime divisor of `Sha` is in this list.
826
827
INPUT:
828
829
- ``D`` - (optional) a fundamental discriminant < -4 that satisfies the
830
Heegner hypothesis for `E`; if not given, use the first such `D`
831
- ``regulator`` -- (optional) regulator of `E(K)`; if not given, will
832
be computed (which could take a long time)
833
- ``ignore_nonsurj_hypothesis`` (optional: default ``False``) --
834
If ``True``, then gives the bound coming from Heegner point
835
index, but without any hypothesis on surjectivity
836
of the mod-`p` representation.
837
838
OUTPUT:
839
840
- list - a list of primes such that if `p` divides `Sha(E/K)`, then
841
`p` is in this list, unless `E/K` has complex multiplication or
842
analytic rank greater than 2 (in which case we return 0).
843
844
- index - the odd part of the index of the Heegner point in the full
845
group of `K`-rational points on E. (If `E` has CM, returns 0.)
846
847
REMARKS:
848
849
1) We do not have to assume that the Manin constant is 1
850
(or a power of 2). If the Manin constant were
851
divisible by a prime, that prime would get included in
852
the list of bad primes.
853
854
2) We assume the Gross-Zagier theorem is true under the
855
hypothesis that `gcd(N,D) = 1`, instead of the stronger
856
hypothesis `gcd(2\cdot N,D)=1` that is in the original
857
Gross-Zagier paper. That Gross-Zagier is true when
858
`gcd(N,D)=1` is "well-known" to the experts, but does not
859
seem to written up well in the literature.
860
861
3) Correctness of the computation is guaranteed using
862
interval arithmetic, under the assumption that the
863
regulator, square root, and period lattice are
864
computed to precision at least `10^{-10}`, i.e., they are
865
correct up to addition or a real number with absolute
866
value less than `10^{-10}`.
867
868
EXAMPLES::
869
870
sage: E = EllipticCurve('37a')
871
sage: E.sha().bound_kolyvagin()
872
([2], 1)
873
sage: E = EllipticCurve('141a')
874
sage: E.sha().an()
875
1
876
sage: E.sha().bound_kolyvagin()
877
([2, 7], 49)
878
879
We get no information when the curve has rank 2.::
880
881
sage: E = EllipticCurve('389a')
882
sage: E.sha().bound_kolyvagin()
883
(0, 0)
884
sage: E = EllipticCurve('681b')
885
sage: E.sha().an()
886
9
887
sage: E.sha().bound_kolyvagin()
888
([2, 3], 9)
889
"""
890
E = self.Emin
891
if E.has_cm():
892
return 0, 0
893
894
if D == 0:
895
D = -5
896
while not E.satisfies_heegner_hypothesis(D):
897
D -= 1
898
899
if not E.satisfies_heegner_hypothesis(D):
900
raise ArithmeticError("Discriminant (=%s) must be a fundamental discriminant that satisfies the Heegner hypothesis."%D)
901
if D == -3 or D == -4:
902
raise ArithmeticError("Discriminant (=%s) must not be -3 or -4."%D)
903
eps = E.root_number()
904
L1_vanishes = E.lseries().L1_vanishes()
905
if eps == 1 and L1_vanishes:
906
return 0, 0 # rank even hence >= 2, so Kolyvagin gives nothing.
907
alpha = sqrt(abs(D))/(2*E.period_lattice().complex_area())
908
F = E.quadratic_twist(D)
909
k_E = 2*sqrt(E.conductor()) + 10
910
k_F = 2*sqrt(F.conductor()) + 10
911
#k_E = 2
912
#k_F = 2
913
914
MIN_ERR = 1e-10 # we assume that regulator and
915
# discriminant, etc., computed to this accuracy.
916
tries = 0
917
while True:
918
tries += 1
919
if tries >= 6:
920
raise RuntimeError("Too many precision increases in bound_kolyvagin")
921
if eps == 1: # E has even rank
922
verbose("Conductor of twist = %s"%F.conductor())
923
LF1, err_F = F.lseries().deriv_at1(k_F)
924
LE1, err_E = E.lseries().at1(k_E)
925
err_F = max(err_F, MIN_ERR)
926
err_E = max(err_E, MIN_ERR)
927
if regulator != None:
928
hZ = regulator/2
929
else:
930
hZ = F.regulator(use_database=True)/2
931
#print alpha * LE1 * LF1 / hZ
932
I = RIF(alpha) * RIF(LE1-err_E,LE1+err_E) * RIF(LF1-err_F,LF1+err_F) / hZ
933
#print I
934
935
else: # E has odd rank
936
937
if regulator != None:
938
hZ = regulator/2
939
else:
940
hZ = E.regulator(use_database=True)/2
941
LE1, err_E = E.lseries().deriv_at1(k_E)
942
LF1, err_F = F.lseries().at1(k_F)
943
err_F = max(err_F, MIN_ERR)
944
err_E = max(err_E, MIN_ERR)
945
#I = alpha * LE1 * LF1 / hZ
946
947
I = RIF(alpha) * RIF(LE1-err_E,LE1+err_E) * RIF(LF1-err_F,LF1+err_F) / hZ
948
949
verbose('interval = %s'%I)
950
t, n = I.is_int()
951
if t:
952
break
953
elif I.absolute_diameter() < 1:
954
raise RuntimeError("Problem in bound_kolyvagin; square of index is not an integer -- D=%s, I=%s."%(D,I))
955
verbose("Doubling bounds")
956
k_E *= 2
957
k_F *= 2
958
# end while
959
960
# We include 2 since Kolyvagin (in Gross) says nothing there
961
if n == 0: return 0, 0 # no bound
962
F = factor(n)
963
B = [2]
964
for p, e in factor(n):
965
if p > 2:
966
if e%2 != 0:
967
raise RuntimeError("Problem in bound_kolyvagin; square of index is not a perfect square! D=%s, I=%s, n=%s, e=%s."%(D,I,n,e))
968
B.append(p)
969
else:
970
n /= 2**e # replace n by its odd part
971
if not ignore_nonsurj_hypothesis:
972
for p in E.galois_representation().non_surjective():
973
B.append(p)
974
B = list(set([int(x) for x in B]))
975
B.sort()
976
return B, n
977
978
979
def bound_kato(self):
980
r"""
981
Returns a list `p` of primes such that the theorems of Kato's [Ka]_
982
and others (e.g., as explained in a paper/thesis of Grigor
983
Grigorov [Gri]_) imply that if `p` divides the order of `Sha(E/\QQ)` then `p` is in
984
the list.
985
986
If `L(E,1) = 0`, then this function gives no information, so
987
it returns ``False``.
988
989
THEOREM (Kato): Suppose `L(E,1) \neq 0` and `p \neq 2, 3` is a prime such that
990
991
- `E` does not have additive reduction at `p`,
992
- the mod-`p` representation is surjective.
993
994
Then `{ord}_p(\#Sha(E))` divides `{ord}_p(L(E,1)\cdot\#E(\QQ)_{tor}^2/(\Omega_E \cdot \prod c_q))`.
995
996
EXAMPLES::
997
998
sage: E = EllipticCurve([0, -1, 1, -10, -20]) # 11A = X_0(11)
999
sage: E.sha().bound_kato()
1000
[2, 3, 5]
1001
sage: E = EllipticCurve([0, -1, 1, 0, 0]) # X_1(11)
1002
sage: E.sha().bound_kato()
1003
[2, 3, 5]
1004
sage: E = EllipticCurve([1,1,1,-352,-2689]) # 66B3
1005
sage: E.sha().bound_kato()
1006
[2, 3]
1007
1008
For the following curve one really has that 25 divides the order of `Sha` (by Grigorov-Stein paper [GS]_)::
1009
1010
sage: E = EllipticCurve([1, -1, 0, -332311, -73733731]) # 1058D1
1011
sage: E.sha().bound_kato() # long time (about 1 second)
1012
[2, 3, 5, 23]
1013
sage: E.galois_representation().non_surjective() # long time (about 1 second)
1014
[]
1015
1016
For this one, `Sha` is divisible by 7::
1017
1018
sage: E = EllipticCurve([0, 0, 0, -4062871, -3152083138]) # 3364C1
1019
sage: E.sha().bound_kato() # long time (< 10 seconds)
1020
[2, 3, 7, 29]
1021
1022
No information about curves of rank > 0::
1023
1024
sage: E = EllipticCurve([0, 0, 1, -1, 0]) # 37A (rank 1)
1025
sage: E.sha().bound_kato()
1026
False
1027
1028
REFERENCES:
1029
1030
.. [Ka] Kayuza Kato, `p`-adic Hodge theory and values of zeta
1031
functions of modular forms, Cohomologies `p`-adiques et
1032
applications arithmétiques III, Astérisque vol 295, SMF,
1033
Paris, 2004.
1034
1035
.. [Gri]
1036
1037
.. [GS]
1038
"""
1039
E = self.Emin
1040
if E.has_cm():
1041
return False
1042
if E.lseries().L1_vanishes():
1043
return False
1044
B = [2, 3]
1045
for p in E.galois_representation().non_surjective():
1046
if p > 3:
1047
B.append(p)
1048
for p in E.conductor().prime_divisors():
1049
if E.has_additive_reduction(p) and p not in B:
1050
B.append(p)
1051
1052
# The only other p that might divide B are those that divide
1053
# the integer 2*#E(Q)_tor^2 * L(E,1)/omega. So we compute
1054
# that to sufficient precision to determine it. Note that
1055
# we have to assume the Manin constant is <=2 in order to provably
1056
# compute L(E,1)/omega.
1057
for p, n in factor(self.an()):
1058
if n >= 2: # use parity of Sha
1059
B.append(int(p))
1060
B = list(set(B))
1061
B.sort()
1062
return B
1063
1064
def bound(self):
1065
r"""
1066
Compute a provably correct bound on the order of the Tate-Shafarevich
1067
group of this curve. The bound is either ``False`` (no bound) or a list
1068
``B`` of primes such that any divisor of `Sha` is in this list.
1069
1070
EXAMPLES::
1071
1072
sage: EllipticCurve('37a').sha().bound()
1073
([2], 1)
1074
"""
1075
if self.Emin.lseries().L1_vanishes():
1076
B = self.bound_kolyvagin()
1077
else:
1078
B = self.bound_kato()
1079
return B
1080
1081
1082