passagemath-schemes 10.6.40__cp314-cp314-macosx_13_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-schemes might be problematic. Click here for more details.

Files changed (314) hide show
  1. passagemath_schemes/.dylibs/libflint.22.0.dylib +0 -0
  2. passagemath_schemes/.dylibs/libgmp.10.dylib +0 -0
  3. passagemath_schemes/.dylibs/libgmpxx.4.dylib +0 -0
  4. passagemath_schemes/.dylibs/libmpfr.6.dylib +0 -0
  5. passagemath_schemes/__init__.py +3 -0
  6. passagemath_schemes-10.6.40.dist-info/METADATA +204 -0
  7. passagemath_schemes-10.6.40.dist-info/METADATA.bak +205 -0
  8. passagemath_schemes-10.6.40.dist-info/RECORD +314 -0
  9. passagemath_schemes-10.6.40.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.6.40.dist-info/top_level.txt +3 -0
  11. sage/all__sagemath_schemes.py +23 -0
  12. sage/databases/all__sagemath_schemes.py +7 -0
  13. sage/databases/cremona.py +1723 -0
  14. sage/dynamics/all__sagemath_schemes.py +2 -0
  15. sage/dynamics/arithmetic_dynamics/affine_ds.py +1083 -0
  16. sage/dynamics/arithmetic_dynamics/all.py +14 -0
  17. sage/dynamics/arithmetic_dynamics/berkovich_ds.py +1101 -0
  18. sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py +1543 -0
  19. sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py +2426 -0
  20. sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py +1169 -0
  21. sage/dynamics/arithmetic_dynamics/generic_ds.py +663 -0
  22. sage/dynamics/arithmetic_dynamics/product_projective_ds.py +339 -0
  23. sage/dynamics/arithmetic_dynamics/projective_ds.py +9558 -0
  24. sage/dynamics/arithmetic_dynamics/projective_ds_helper.cpython-314-darwin.so +0 -0
  25. sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx +301 -0
  26. sage/dynamics/arithmetic_dynamics/wehlerK3.py +2576 -0
  27. sage/lfunctions/all.py +18 -0
  28. sage/lfunctions/dokchitser.py +745 -0
  29. sage/lfunctions/pari.py +818 -0
  30. sage/lfunctions/zero_sums.cpython-314-darwin.so +0 -0
  31. sage/lfunctions/zero_sums.pyx +1847 -0
  32. sage/modular/abvar/abvar.py +5135 -0
  33. sage/modular/abvar/abvar_ambient_jacobian.py +413 -0
  34. sage/modular/abvar/abvar_newform.py +244 -0
  35. sage/modular/abvar/all.py +8 -0
  36. sage/modular/abvar/constructor.py +186 -0
  37. sage/modular/abvar/cuspidal_subgroup.py +371 -0
  38. sage/modular/abvar/finite_subgroup.py +896 -0
  39. sage/modular/abvar/homology.py +720 -0
  40. sage/modular/abvar/homspace.py +998 -0
  41. sage/modular/abvar/lseries.py +415 -0
  42. sage/modular/abvar/morphism.py +935 -0
  43. sage/modular/abvar/torsion_point.py +274 -0
  44. sage/modular/abvar/torsion_subgroup.py +740 -0
  45. sage/modular/all.py +43 -0
  46. sage/modular/arithgroup/all.py +20 -0
  47. sage/modular/arithgroup/arithgroup_element.cpython-314-darwin.so +0 -0
  48. sage/modular/arithgroup/arithgroup_element.pyx +474 -0
  49. sage/modular/arithgroup/arithgroup_generic.py +1402 -0
  50. sage/modular/arithgroup/arithgroup_perm.py +2692 -0
  51. sage/modular/arithgroup/congroup.cpython-314-darwin.so +0 -0
  52. sage/modular/arithgroup/congroup.pyx +334 -0
  53. sage/modular/arithgroup/congroup_gamma.py +363 -0
  54. sage/modular/arithgroup/congroup_gamma0.py +692 -0
  55. sage/modular/arithgroup/congroup_gamma1.py +653 -0
  56. sage/modular/arithgroup/congroup_gammaH.py +1469 -0
  57. sage/modular/arithgroup/congroup_generic.py +628 -0
  58. sage/modular/arithgroup/congroup_sl2z.py +267 -0
  59. sage/modular/arithgroup/farey_symbol.cpython-314-darwin.so +0 -0
  60. sage/modular/arithgroup/farey_symbol.pyx +1066 -0
  61. sage/modular/arithgroup/tests.py +418 -0
  62. sage/modular/btquotients/all.py +4 -0
  63. sage/modular/btquotients/btquotient.py +3753 -0
  64. sage/modular/btquotients/pautomorphicform.py +2570 -0
  65. sage/modular/buzzard.py +100 -0
  66. sage/modular/congroup.py +29 -0
  67. sage/modular/congroup_element.py +13 -0
  68. sage/modular/cusps.py +1109 -0
  69. sage/modular/cusps_nf.py +1270 -0
  70. sage/modular/dims.py +569 -0
  71. sage/modular/dirichlet.py +3310 -0
  72. sage/modular/drinfeld_modform/all.py +2 -0
  73. sage/modular/drinfeld_modform/element.py +446 -0
  74. sage/modular/drinfeld_modform/ring.py +773 -0
  75. sage/modular/drinfeld_modform/tutorial.py +236 -0
  76. sage/modular/etaproducts.py +1065 -0
  77. sage/modular/hecke/algebra.py +746 -0
  78. sage/modular/hecke/all.py +20 -0
  79. sage/modular/hecke/ambient_module.py +1019 -0
  80. sage/modular/hecke/degenmap.py +119 -0
  81. sage/modular/hecke/element.py +325 -0
  82. sage/modular/hecke/hecke_operator.py +780 -0
  83. sage/modular/hecke/homspace.py +206 -0
  84. sage/modular/hecke/module.py +1767 -0
  85. sage/modular/hecke/morphism.py +174 -0
  86. sage/modular/hecke/submodule.py +989 -0
  87. sage/modular/hypergeometric_misc.cpython-314-darwin.so +0 -0
  88. sage/modular/hypergeometric_misc.pxd +4 -0
  89. sage/modular/hypergeometric_misc.pyx +166 -0
  90. sage/modular/hypergeometric_motive.py +2017 -0
  91. sage/modular/local_comp/all.py +2 -0
  92. sage/modular/local_comp/liftings.py +292 -0
  93. sage/modular/local_comp/local_comp.py +1071 -0
  94. sage/modular/local_comp/smoothchar.py +1825 -0
  95. sage/modular/local_comp/type_space.py +748 -0
  96. sage/modular/modform/all.py +30 -0
  97. sage/modular/modform/ambient.py +815 -0
  98. sage/modular/modform/ambient_R.py +177 -0
  99. sage/modular/modform/ambient_eps.py +306 -0
  100. sage/modular/modform/ambient_g0.py +124 -0
  101. sage/modular/modform/ambient_g1.py +204 -0
  102. sage/modular/modform/constructor.py +545 -0
  103. sage/modular/modform/cuspidal_submodule.py +708 -0
  104. sage/modular/modform/defaults.py +14 -0
  105. sage/modular/modform/eis_series.py +505 -0
  106. sage/modular/modform/eisenstein_submodule.py +663 -0
  107. sage/modular/modform/element.py +4131 -0
  108. sage/modular/modform/find_generators.py +59 -0
  109. sage/modular/modform/half_integral.py +154 -0
  110. sage/modular/modform/hecke_operator_on_qexp.py +247 -0
  111. sage/modular/modform/j_invariant.py +47 -0
  112. sage/modular/modform/l_series_gross_zagier.py +133 -0
  113. sage/modular/modform/l_series_gross_zagier_coeffs.cpython-314-darwin.so +0 -0
  114. sage/modular/modform/l_series_gross_zagier_coeffs.pyx +177 -0
  115. sage/modular/modform/notes.py +45 -0
  116. sage/modular/modform/numerical.py +514 -0
  117. sage/modular/modform/periods.py +14 -0
  118. sage/modular/modform/ring.py +1257 -0
  119. sage/modular/modform/space.py +1860 -0
  120. sage/modular/modform/submodule.py +118 -0
  121. sage/modular/modform/tests.py +64 -0
  122. sage/modular/modform/theta.py +110 -0
  123. sage/modular/modform/vm_basis.py +381 -0
  124. sage/modular/modform/weight1.py +220 -0
  125. sage/modular/modform_hecketriangle/abstract_ring.py +1932 -0
  126. sage/modular/modform_hecketriangle/abstract_space.py +2528 -0
  127. sage/modular/modform_hecketriangle/all.py +30 -0
  128. sage/modular/modform_hecketriangle/analytic_type.py +590 -0
  129. sage/modular/modform_hecketriangle/constructor.py +416 -0
  130. sage/modular/modform_hecketriangle/element.py +351 -0
  131. sage/modular/modform_hecketriangle/functors.py +752 -0
  132. sage/modular/modform_hecketriangle/graded_ring.py +541 -0
  133. sage/modular/modform_hecketriangle/graded_ring_element.py +2225 -0
  134. sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +3352 -0
  135. sage/modular/modform_hecketriangle/hecke_triangle_groups.py +1432 -0
  136. sage/modular/modform_hecketriangle/readme.py +1214 -0
  137. sage/modular/modform_hecketriangle/series_constructor.py +580 -0
  138. sage/modular/modform_hecketriangle/space.py +1037 -0
  139. sage/modular/modform_hecketriangle/subspace.py +423 -0
  140. sage/modular/modsym/all.py +17 -0
  141. sage/modular/modsym/ambient.py +3846 -0
  142. sage/modular/modsym/boundary.py +1420 -0
  143. sage/modular/modsym/element.py +336 -0
  144. sage/modular/modsym/g1list.py +178 -0
  145. sage/modular/modsym/ghlist.py +182 -0
  146. sage/modular/modsym/hecke_operator.py +73 -0
  147. sage/modular/modsym/manin_symbol.cpython-314-darwin.so +0 -0
  148. sage/modular/modsym/manin_symbol.pxd +5 -0
  149. sage/modular/modsym/manin_symbol.pyx +497 -0
  150. sage/modular/modsym/manin_symbol_list.py +1295 -0
  151. sage/modular/modsym/modsym.py +400 -0
  152. sage/modular/modsym/modular_symbols.py +384 -0
  153. sage/modular/modsym/p1list.cpython-314-darwin.so +0 -0
  154. sage/modular/modsym/p1list.pxd +29 -0
  155. sage/modular/modsym/p1list.pyx +1372 -0
  156. sage/modular/modsym/p1list_nf.py +1241 -0
  157. sage/modular/modsym/relation_matrix.py +591 -0
  158. sage/modular/modsym/relation_matrix_pyx.cpython-314-darwin.so +0 -0
  159. sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
  160. sage/modular/modsym/space.py +2468 -0
  161. sage/modular/modsym/subspace.py +455 -0
  162. sage/modular/modsym/tests.py +375 -0
  163. sage/modular/multiple_zeta.py +2632 -0
  164. sage/modular/multiple_zeta_F_algebra.py +786 -0
  165. sage/modular/overconvergent/all.py +6 -0
  166. sage/modular/overconvergent/genus0.py +1878 -0
  167. sage/modular/overconvergent/hecke_series.py +1187 -0
  168. sage/modular/overconvergent/weightspace.py +778 -0
  169. sage/modular/pollack_stevens/all.py +4 -0
  170. sage/modular/pollack_stevens/distributions.py +874 -0
  171. sage/modular/pollack_stevens/fund_domain.py +1572 -0
  172. sage/modular/pollack_stevens/manin_map.py +859 -0
  173. sage/modular/pollack_stevens/modsym.py +1593 -0
  174. sage/modular/pollack_stevens/padic_lseries.py +417 -0
  175. sage/modular/pollack_stevens/sigma0.py +534 -0
  176. sage/modular/pollack_stevens/space.py +1076 -0
  177. sage/modular/quasimodform/all.py +3 -0
  178. sage/modular/quasimodform/element.py +845 -0
  179. sage/modular/quasimodform/ring.py +828 -0
  180. sage/modular/quatalg/all.py +3 -0
  181. sage/modular/quatalg/brandt.py +1642 -0
  182. sage/modular/ssmod/all.py +8 -0
  183. sage/modular/ssmod/ssmod.py +827 -0
  184. sage/rings/all__sagemath_schemes.py +1 -0
  185. sage/rings/polynomial/all__sagemath_schemes.py +1 -0
  186. sage/rings/polynomial/binary_form_reduce.py +585 -0
  187. sage/schemes/all.py +41 -0
  188. sage/schemes/berkovich/all.py +6 -0
  189. sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
  190. sage/schemes/berkovich/berkovich_space.py +748 -0
  191. sage/schemes/curves/affine_curve.py +2928 -0
  192. sage/schemes/curves/all.py +33 -0
  193. sage/schemes/curves/closed_point.py +434 -0
  194. sage/schemes/curves/constructor.py +381 -0
  195. sage/schemes/curves/curve.py +542 -0
  196. sage/schemes/curves/plane_curve_arrangement.py +1283 -0
  197. sage/schemes/curves/point.py +463 -0
  198. sage/schemes/curves/projective_curve.py +3026 -0
  199. sage/schemes/curves/zariski_vankampen.py +1932 -0
  200. sage/schemes/cyclic_covers/all.py +2 -0
  201. sage/schemes/cyclic_covers/charpoly_frobenius.py +320 -0
  202. sage/schemes/cyclic_covers/constructor.py +137 -0
  203. sage/schemes/cyclic_covers/cycliccover_finite_field.py +1309 -0
  204. sage/schemes/cyclic_covers/cycliccover_generic.py +310 -0
  205. sage/schemes/elliptic_curves/BSD.py +1036 -0
  206. sage/schemes/elliptic_curves/Qcurves.py +592 -0
  207. sage/schemes/elliptic_curves/addition_formulas_ring.py +94 -0
  208. sage/schemes/elliptic_curves/all.py +49 -0
  209. sage/schemes/elliptic_curves/cardinality.py +609 -0
  210. sage/schemes/elliptic_curves/cm.py +1102 -0
  211. sage/schemes/elliptic_curves/constructor.py +1552 -0
  212. sage/schemes/elliptic_curves/ec_database.py +175 -0
  213. sage/schemes/elliptic_curves/ell_curve_isogeny.py +3972 -0
  214. sage/schemes/elliptic_curves/ell_egros.py +459 -0
  215. sage/schemes/elliptic_curves/ell_field.py +2836 -0
  216. sage/schemes/elliptic_curves/ell_finite_field.py +3359 -0
  217. sage/schemes/elliptic_curves/ell_generic.py +3760 -0
  218. sage/schemes/elliptic_curves/ell_local_data.py +1207 -0
  219. sage/schemes/elliptic_curves/ell_modular_symbols.py +775 -0
  220. sage/schemes/elliptic_curves/ell_number_field.py +4220 -0
  221. sage/schemes/elliptic_curves/ell_padic_field.py +107 -0
  222. sage/schemes/elliptic_curves/ell_point.py +4787 -0
  223. sage/schemes/elliptic_curves/ell_rational_field.py +7368 -0
  224. sage/schemes/elliptic_curves/ell_tate_curve.py +671 -0
  225. sage/schemes/elliptic_curves/ell_torsion.py +436 -0
  226. sage/schemes/elliptic_curves/ell_wp.py +352 -0
  227. sage/schemes/elliptic_curves/formal_group.py +760 -0
  228. sage/schemes/elliptic_curves/gal_reps.py +1459 -0
  229. sage/schemes/elliptic_curves/gal_reps_number_field.py +1669 -0
  230. sage/schemes/elliptic_curves/gp_simon.py +152 -0
  231. sage/schemes/elliptic_curves/heegner.py +7335 -0
  232. sage/schemes/elliptic_curves/height.py +2109 -0
  233. sage/schemes/elliptic_curves/hom.py +1406 -0
  234. sage/schemes/elliptic_curves/hom_composite.py +934 -0
  235. sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
  236. sage/schemes/elliptic_curves/hom_scalar.py +531 -0
  237. sage/schemes/elliptic_curves/hom_sum.py +682 -0
  238. sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
  239. sage/schemes/elliptic_curves/homset.py +271 -0
  240. sage/schemes/elliptic_curves/isogeny_class.py +1521 -0
  241. sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
  242. sage/schemes/elliptic_curves/jacobian.py +237 -0
  243. sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
  244. sage/schemes/elliptic_curves/kraus.py +1014 -0
  245. sage/schemes/elliptic_curves/lseries_ell.py +943 -0
  246. sage/schemes/elliptic_curves/mod5family.py +105 -0
  247. sage/schemes/elliptic_curves/mod_poly.py +197 -0
  248. sage/schemes/elliptic_curves/mod_sym_num.cpython-314-darwin.so +0 -0
  249. sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
  250. sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
  251. sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
  252. sage/schemes/elliptic_curves/padics.py +1816 -0
  253. sage/schemes/elliptic_curves/period_lattice.py +2234 -0
  254. sage/schemes/elliptic_curves/period_lattice_region.cpython-314-darwin.so +0 -0
  255. sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
  256. sage/schemes/elliptic_curves/saturation.py +715 -0
  257. sage/schemes/elliptic_curves/sha_tate.py +1158 -0
  258. sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
  259. sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
  260. sage/schemes/hyperelliptic_curves/all.py +6 -0
  261. sage/schemes/hyperelliptic_curves/constructor.py +291 -0
  262. sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1914 -0
  263. sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
  264. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +954 -0
  265. sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
  266. sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
  267. sage/schemes/hyperelliptic_curves/invariants.py +410 -0
  268. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +315 -0
  269. sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
  270. sage/schemes/hyperelliptic_curves/jacobian_generic.py +419 -0
  271. sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
  272. sage/schemes/hyperelliptic_curves/jacobian_morphism.py +875 -0
  273. sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
  274. sage/schemes/hyperelliptic_curves/mestre.py +302 -0
  275. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3871 -0
  276. sage/schemes/jacobians/abstract_jacobian.py +277 -0
  277. sage/schemes/jacobians/all.py +2 -0
  278. sage/schemes/overview.py +161 -0
  279. sage/schemes/plane_conics/all.py +22 -0
  280. sage/schemes/plane_conics/con_field.py +1296 -0
  281. sage/schemes/plane_conics/con_finite_field.py +158 -0
  282. sage/schemes/plane_conics/con_number_field.py +456 -0
  283. sage/schemes/plane_conics/con_rational_field.py +406 -0
  284. sage/schemes/plane_conics/con_rational_function_field.py +580 -0
  285. sage/schemes/plane_conics/constructor.py +249 -0
  286. sage/schemes/plane_quartics/all.py +2 -0
  287. sage/schemes/plane_quartics/quartic_constructor.py +71 -0
  288. sage/schemes/plane_quartics/quartic_generic.py +73 -0
  289. sage/schemes/riemann_surfaces/all.py +1 -0
  290. sage/schemes/riemann_surfaces/riemann_surface.py +4117 -0
  291. sage_wheels/share/cremona/cremona_mini.db +0 -0
  292. sage_wheels/share/ellcurves/rank0 +30427 -0
  293. sage_wheels/share/ellcurves/rank1 +31871 -0
  294. sage_wheels/share/ellcurves/rank10 +6 -0
  295. sage_wheels/share/ellcurves/rank11 +6 -0
  296. sage_wheels/share/ellcurves/rank12 +1 -0
  297. sage_wheels/share/ellcurves/rank14 +1 -0
  298. sage_wheels/share/ellcurves/rank15 +1 -0
  299. sage_wheels/share/ellcurves/rank17 +1 -0
  300. sage_wheels/share/ellcurves/rank19 +1 -0
  301. sage_wheels/share/ellcurves/rank2 +2388 -0
  302. sage_wheels/share/ellcurves/rank20 +1 -0
  303. sage_wheels/share/ellcurves/rank21 +1 -0
  304. sage_wheels/share/ellcurves/rank22 +1 -0
  305. sage_wheels/share/ellcurves/rank23 +1 -0
  306. sage_wheels/share/ellcurves/rank24 +1 -0
  307. sage_wheels/share/ellcurves/rank28 +1 -0
  308. sage_wheels/share/ellcurves/rank3 +836 -0
  309. sage_wheels/share/ellcurves/rank4 +10 -0
  310. sage_wheels/share/ellcurves/rank5 +5 -0
  311. sage_wheels/share/ellcurves/rank6 +5 -0
  312. sage_wheels/share/ellcurves/rank7 +5 -0
  313. sage_wheels/share/ellcurves/rank8 +6 -0
  314. sage_wheels/share/ellcurves/rank9 +7 -0
@@ -0,0 +1,1158 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.graphs
3
+ r"""
4
+ Tate-Shafarevich group
5
+
6
+ If `E` is an elliptic curve over a global field `K`, the Tate-Shafarevich
7
+ group is the subgroup of elements in `H^1(K,E)` which map to zero under every
8
+ global-to-local restriction map `H^1(K,E) \to H^1(K_v,E)`, one for each place
9
+ `v` of `K`.
10
+
11
+ The group is usually denoted by the Russian letter Sha (Ш), in this document
12
+ it will be denoted by `Sha`.
13
+
14
+ `Sha` is known to be an abelian torsion group. It is conjectured that the
15
+ Tate-Shafarevich group is finite for any elliptic curve over a global field.
16
+ But it is not known in general.
17
+
18
+ A theorem of Kolyvagin and Gross-Zagier using Heegner points shows that if the
19
+ `L`-series of an elliptic curve `E/\QQ` does not vanish at 1 or has a simple
20
+ zero there, then `Sha` is finite.
21
+
22
+ A theorem of Kato, together with theorems from Iwasawa theory, allows for
23
+ certain primes `p` to show that the `p`-primary part of `Sha` is finite and
24
+ gives an effective upper bound for it.
25
+
26
+ The (`p`-adic) conjecture of Birch and Swinnerton-Dyer predicts the order of
27
+ `Sha` from the leading term of the (`p`-adic) `L`-series of the elliptic curve.
28
+
29
+ Sage can compute a few things about `Sha`. The commands ``an``,
30
+ ``an_numerical`` and ``an_padic`` compute the conjectural order of `Sha` as a
31
+ real or `p`-adic number. With ``p_primary_bound`` one can find an upper bound
32
+ of the size of the `p`-primary part of `Sha`. Finally, if the analytic rank is
33
+ at most 1, then ``bound_kato`` and ``bound_kolyvagin`` find all primes for
34
+ which the theorems of Kato and Kolyvagin respectively do not prove the
35
+ triviality the `p`-primary part of `Sha`.
36
+
37
+ EXAMPLES::
38
+
39
+ sage: E = EllipticCurve('11a1')
40
+ sage: S = E.sha()
41
+ sage: S.bound_kato()
42
+ [2]
43
+ sage: S.bound_kolyvagin()
44
+ ([2, 5], 1)
45
+ sage: S.an_padic(7,3)
46
+ 1 + O(7^5)
47
+ sage: S.an()
48
+ 1
49
+ sage: S.an_numerical()
50
+ 1.00000000000000
51
+
52
+ sage: E = EllipticCurve('389a')
53
+ sage: S = E.sha(); S
54
+ Tate-Shafarevich group for the
55
+ Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
56
+ sage: S.an_numerical()
57
+ 1.00000000000000
58
+ sage: S.p_primary_bound(5)
59
+ 0
60
+ sage: S.an_padic(5)
61
+ 1 + O(5)
62
+ sage: S.an_padic(5,prec=4) # long time (2s on sage.math, 2011)
63
+ 1 + O(5^3)
64
+
65
+ AUTHORS:
66
+
67
+ - William Stein (2007) -- initial version
68
+
69
+ - Chris Wuthrich (April 2009) -- reformat docstrings
70
+
71
+ - Aly Deines, Chris Wuthrich, Jeaninne Van Order (2016-03): Added
72
+ functionality that tests the Skinner-Urban condition.
73
+ """
74
+ # ****************************************************************************
75
+ # Copyright (C) 2007 William Stein <wstein@gmail.com>
76
+ #
77
+ # Distributed under the terms of the GNU General Public License (GPL)
78
+ # as published by the Free Software Foundation; either version 2 of
79
+ # the License, or (at your option) any later version.
80
+ # https://www.gnu.org/licenses/
81
+ # ****************************************************************************
82
+
83
+ from math import sqrt
84
+
85
+ import sage.arith.all as arith
86
+
87
+ from sage.misc.lazy_import import lazy_import
88
+ from sage.misc.verbose import verbose
89
+ from sage.modules.free_module_element import vector
90
+ from sage.rings.integer import Integer
91
+ from sage.rings.integer_ring import ZZ
92
+ from sage.rings.rational_field import Q
93
+ from sage.rings.real_mpfi import RIF
94
+ from sage.rings.real_mpfr import RealField
95
+ from sage.structure.sage_object import SageObject
96
+
97
+ lazy_import("sage.functions.log", "log")
98
+ lazy_import("sage.rings.padics.factory", "Qp")
99
+
100
+ factor = arith.factor
101
+ valuation = arith.valuation
102
+
103
+
104
+ class Sha(SageObject):
105
+ r"""
106
+ The Tate-Shafarevich group associated to an elliptic curve.
107
+
108
+ If `E` is an elliptic curve over a global field `K`, the Tate-Shafarevich
109
+ group is the subgroup of elements in `H^1(K,E)` which map to zero under
110
+ every global-to-local restriction map `H^1(K,E) \to H^1(K_v,E)`, one for
111
+ each place `v` of `K`.
112
+
113
+ EXAMPLES::
114
+
115
+ sage: E = EllipticCurve('571a1')
116
+ sage: E._set_gens([]) # curve has rank 0, but non-trivial Sha[2]
117
+ sage: S = E.sha()
118
+ sage: S.bound_kato()
119
+ [2]
120
+ sage: S.bound_kolyvagin()
121
+ ([2], 1)
122
+ sage: S.an_padic(7,3)
123
+ 4 + O(7^5)
124
+ sage: S.an()
125
+ 4
126
+ sage: S.an_numerical()
127
+ 4.00000000000000
128
+
129
+ sage: E = EllipticCurve('389a')
130
+ sage: S = E.sha(); S
131
+ Tate-Shafarevich group for the
132
+ Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
133
+ sage: S.an_numerical()
134
+ 1.00000000000000
135
+ sage: S.p_primary_bound(5) # long time
136
+ 0
137
+ sage: S.an_padic(5) # long time
138
+ 1 + O(5)
139
+ sage: S.an_padic(5,prec=4) # very long time
140
+ 1 + O(5^3)
141
+ """
142
+ def __init__(self, E):
143
+ r"""
144
+ The Tate-Shafarevich group associated to an elliptic curve.
145
+
146
+ INPUT:
147
+
148
+ - ``E`` -- an elliptic curve over `\QQ`
149
+
150
+ EXAMPLES::
151
+
152
+ sage: E = EllipticCurve('11a1')
153
+ sage: S = E.sha()
154
+ sage: S
155
+ Tate-Shafarevich group for the
156
+ Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
157
+
158
+ sage: S == loads(dumps(S))
159
+ True
160
+ """
161
+ self.E = E
162
+ self.Emin = E.minimal_model() if not E.is_minimal() else E
163
+
164
+ def __eq__(self, other):
165
+ r"""
166
+ Compare two Tate-Shafarevich groups by simply comparing the
167
+ elliptic curves.
168
+
169
+ EXAMPLES::
170
+
171
+ sage: E = EllipticCurve('37a1')
172
+ sage: S = E.sha()
173
+ sage: S == S
174
+ True
175
+ """
176
+ if not isinstance(other, Sha):
177
+ return False
178
+ return self.E == other.E
179
+
180
+ def __ne__(self, other):
181
+ """
182
+ Check whether ``self`` is not equal to ``other``.
183
+
184
+ EXAMPLES::
185
+
186
+ sage: E = EllipticCurve('37a1')
187
+ sage: S = E.sha()
188
+ sage: S != S
189
+ False
190
+ """
191
+ return not (self == other)
192
+
193
+ def __repr__(self):
194
+ r"""
195
+ String representation of the Tate-Shafarevich group.
196
+
197
+ EXAMPLES::
198
+
199
+ sage: E = EllipticCurve('11a1')
200
+ sage: S = E.sha()
201
+ sage: S.__repr__()
202
+ 'Tate-Shafarevich group for the Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field'
203
+ """
204
+ return "Tate-Shafarevich group for the " + repr(self.E)
205
+
206
+ ########################################################################
207
+ # Functions related to the BSD conjecture.
208
+ ########################################################################
209
+
210
+ def an_numerical(self, prec=None,
211
+ use_database=True, proof=None):
212
+ r"""
213
+ Return the numerical analytic order of `Sha`, which is
214
+ a floating point number in all cases.
215
+
216
+ INPUT:
217
+
218
+ - ``prec`` -- integer (default: 53); bits precision -- used
219
+ for the `L`-series computation, period, regulator, etc.
220
+ - ``use_database`` -- whether the rank and generators should
221
+ be looked up in the database if possible. Default is ``True``
222
+ - ``proof`` -- boolean or ``None`` (default: ``None``, see proof.[tab] or
223
+ sage.structure.proof) proof option passed
224
+ onto regulator and rank computation.
225
+
226
+ .. NOTE::
227
+
228
+ See also the :meth:`an` command, which will return a
229
+ provably correct integer when the rank is 0 or 1.
230
+
231
+ .. WARNING::
232
+
233
+ If the curve's generators are not known, computing
234
+ them may be very time-consuming. Also, computation of the
235
+ `L`-series derivative will be time-consuming for large rank and
236
+ large conductor, and the computation time for this may
237
+ increase substantially at greater precision. However, use of
238
+ very low precision less than about 10 can cause the underlying
239
+ PARI library functions to fail.
240
+
241
+ EXAMPLES::
242
+
243
+ sage: EllipticCurve('11a').sha().an_numerical()
244
+ 1.00000000000000
245
+ sage: EllipticCurve('37a').sha().an_numerical()
246
+ 1.00000000000000
247
+ sage: EllipticCurve('389a').sha().an_numerical()
248
+ 1.00000000000000
249
+ sage: EllipticCurve('66b3').sha().an_numerical()
250
+ 4.00000000000000
251
+ sage: EllipticCurve('5077a').sha().an_numerical()
252
+ 1.00000000000000
253
+
254
+ A rank 4 curve::
255
+
256
+ sage: EllipticCurve([1, -1, 0, -79, 289]).sha().an_numerical() # long time (3s on sage.math, 2011)
257
+ 1.00000000000000
258
+
259
+ A rank 5 curve::
260
+
261
+ sage: EllipticCurve([0, 0, 1, -79, 342]).sha().an_numerical(prec=10, proof=False) # long time (22s on sage.math, 2011)
262
+ 1.0
263
+
264
+ See :issue:`1115`::
265
+
266
+ sage: sha = EllipticCurve('37a1').sha()
267
+ sage: [sha.an_numerical(prec) for prec in range(40,100,10)] # long time (3s on sage.math, 2013)
268
+ [1.0000000000,
269
+ 1.0000000000000,
270
+ 1.0000000000000000,
271
+ 1.0000000000000000000,
272
+ 1.0000000000000000000000,
273
+ 1.0000000000000000000000000]
274
+ """
275
+ if prec is None:
276
+ prec = RealField().precision()
277
+ RR = RealField(prec)
278
+ prec2 = prec + 2
279
+ RR2 = RealField(prec2)
280
+ try:
281
+ an = self.__an_numerical
282
+ if an.parent().precision() >= prec:
283
+ return RR(an)
284
+ else: # cached precision too low
285
+ pass
286
+ except AttributeError:
287
+ pass
288
+ # it's critical to switch to the minimal model.
289
+ E = self.Emin
290
+ r = Integer(E.rank(use_database=use_database, proof=proof))
291
+ L = E.lseries().dokchitser(prec=prec2)
292
+ Lr = RR2(L.derivative(1, r)) # L.derivative() returns a Complex
293
+ Om = RR2(E.period_lattice().omega(prec2))
294
+ Reg = E.regulator(use_database=use_database, proof=proof, precision=prec2)
295
+ T = E.torsion_order()
296
+ cp = E.tamagawa_product()
297
+ Sha = RR((Lr * T * T) / (r.factorial() * Om * cp * Reg))
298
+ self.__an_numerical = Sha
299
+ return Sha
300
+
301
+ def an(self, use_database=False, descent_second_limit=12):
302
+ r"""
303
+ Return the Birch and Swinnerton-Dyer conjectural order of `Sha`
304
+ as a provably correct integer, unless the analytic rank is > 1,
305
+ in which case this function returns a numerical value.
306
+
307
+ INPUT:
308
+
309
+ - ``use_database`` -- boolean (default: ``False``); if ``True``, try
310
+ to use any databases installed to lookup the analytic order of
311
+ `Sha`, if possible. The order of `Sha` is computed if it cannot
312
+ be looked up.
313
+
314
+ - ``descent_second_limit`` -- integer (default: 12); limit to use on
315
+ point searching for the quartic twist in the hard case
316
+
317
+ This result is proved correct if the order of vanishing is 0
318
+ and the Manin constant is <= 2.
319
+
320
+ If the optional parameter ``use_database`` is ``True`` (default:
321
+ ``False``), this function returns the analytic order of `Sha` as
322
+ listed in Cremona's tables, if this curve appears in Cremona's
323
+ tables.
324
+
325
+ NOTE:
326
+
327
+ If you come across the following error::
328
+
329
+ sage: E = EllipticCurve([0, 0, 1, -34874, -2506691])
330
+ sage: E.sha().an()
331
+ Traceback (most recent call last):
332
+ ...
333
+ RuntimeError: Unable to compute the rank, hence generators, with certainty
334
+ (lower bound=0, generators found=()). This could be because Sha(E/Q)[2] is
335
+ nontrivial. Try increasing descent_second_limit then trying this command again.
336
+
337
+ You can increase the ``descent_second_limit`` (in the above example,
338
+ set to the default, 12) option to try again::
339
+
340
+ sage: E.sha().an(descent_second_limit=16) # long time (2s on sage.math, 2011)
341
+ 1
342
+
343
+ EXAMPLES::
344
+
345
+ sage: E = EllipticCurve([0, -1, 1, -10, -20]) # 11A = X_0(11)
346
+ sage: E.sha().an()
347
+ 1
348
+ sage: E = EllipticCurve([0, -1, 1, 0, 0]) # X_1(11)
349
+ sage: E.sha().an()
350
+ 1
351
+
352
+ sage: EllipticCurve('14a4').sha().an()
353
+ 1
354
+ sage: EllipticCurve('14a4').sha().an(use_database=True) # will be faster if you have large Cremona database installed
355
+ 1
356
+
357
+ The smallest conductor curve with nontrivial `Sha`::
358
+
359
+ sage: E = EllipticCurve([1,1,1,-352,-2689]) # 66b3
360
+ sage: E.sha().an()
361
+ 4
362
+
363
+ The four optimal quotients with nontrivial `Sha` and conductor <= 1000::
364
+
365
+ sage: E = EllipticCurve([0, -1, 1, -929, -10595]) # 571A
366
+ sage: E.sha().an()
367
+ 4
368
+ sage: E = EllipticCurve([1, 1, 0, -1154, -15345]) # 681B
369
+ sage: E.sha().an()
370
+ 9
371
+ sage: E = EllipticCurve([0, -1, 0, -900, -10098]) # 960D
372
+ sage: E.sha().an()
373
+ 4
374
+ sage: E = EllipticCurve([0, 1, 0, -20, -42]) # 960N
375
+ sage: E.sha().an()
376
+ 4
377
+
378
+ The smallest conductor curve of rank > 1::
379
+
380
+ sage: E = EllipticCurve([0, 1, 1, -2, 0]) # 389A (rank 2)
381
+ sage: E.sha().an()
382
+ 1.00000000000000
383
+
384
+ The following are examples that require computation of the Mordell-
385
+ Weil group and regulator::
386
+
387
+ sage: E = EllipticCurve([0, 0, 1, -1, 0]) # 37A (rank 1)
388
+ sage: E.sha().an()
389
+ 1
390
+
391
+ sage: E = EllipticCurve("1610f3")
392
+ sage: E.sha().an()
393
+ 4
394
+
395
+ In this case the input curve is not minimal, and if this function did
396
+ not transform it to be minimal, it would give nonsense::
397
+
398
+ sage: E = EllipticCurve([0, -432*6^2])
399
+ sage: E.sha().an()
400
+ 1
401
+
402
+ See :issue:`10096`: this used to give the wrong result 6.0000
403
+ before since the minimal model was not used::
404
+
405
+ sage: E = EllipticCurve([1215*1216, 0]) # non-minimal model
406
+ sage: E.sha().an() # long time (2s on sage.math, 2011)
407
+ 1.00000000000000
408
+ sage: E.minimal_model().sha().an() # long time (1s on sage.math, 2011)
409
+ 1.00000000000000
410
+ """
411
+ if hasattr(self, '__an'):
412
+ return self.__an
413
+ if use_database:
414
+ d = self.Emin.database_curve()
415
+ if hasattr(d, 'db_extra'):
416
+ self.__an = Integer(round(float(d.db_extra[4])))
417
+ return self.__an
418
+
419
+ # it's critical to switch to the minimal model.
420
+ E = self.Emin
421
+ eps = E.root_number()
422
+ if eps == 1:
423
+ L1_over_omega = E.lseries().L_ratio()
424
+ if L1_over_omega == 0: # order of vanishing is at least 2
425
+ return self.an_numerical(use_database=use_database)
426
+ T = E.torsion_subgroup().order()
427
+ Sha = (L1_over_omega * T * T) / Q(E.tamagawa_product())
428
+ try:
429
+ Sha = Integer(Sha)
430
+ except ValueError:
431
+ raise RuntimeError("There is a bug in an, since the computed conjectural order of Sha is %s, which is not an integer." % Sha)
432
+ if not arith.is_square(Sha):
433
+ raise RuntimeError("There is a bug in an, since the computed conjectural order of Sha is %s, which is not a square." % Sha)
434
+ E.__an = Sha
435
+ self.__an = Sha
436
+ return Sha
437
+
438
+ else: # rank > 0 (Not provably correct)
439
+ L1, error_bound = E.lseries().deriv_at1(10 * sqrt(E.conductor()) + 10)
440
+ if abs(L1) < error_bound:
441
+ s = self.an_numerical()
442
+ E.__an = s
443
+ self.__an = s
444
+ return s
445
+
446
+ regulator = E.regulator(use_database=use_database, descent_second_limit=descent_second_limit)
447
+ T = E.torsion_subgroup().order()
448
+ omega = E.period_lattice().omega()
449
+ Sha = ((L1 * T * T) / (E.tamagawa_product() * regulator * omega)).round()
450
+ try:
451
+ Sha = Integer(Sha)
452
+ except ValueError:
453
+ raise RuntimeError("There is a bug in an, since the computed conjectural order of Sha is %s, which is not an integer." % Sha)
454
+ if not arith.is_square(Sha):
455
+ raise RuntimeError("There is a bug in an, since the computed conjectural order of Sha is %s, which is not a square." % Sha)
456
+ E.__an = Sha
457
+ self.__an = Sha
458
+ return Sha
459
+
460
+ def an_padic(self, p, prec=0, use_twists=True):
461
+ r"""
462
+ Return the conjectural order of `Sha(E/\QQ)`,
463
+ according to the `p`-adic analogue of the Birch
464
+ and Swinnerton-Dyer conjecture as formulated
465
+ in [MTT1986]_ and [BP1993]_.
466
+
467
+ INPUT:
468
+
469
+ - ``p`` -- a prime > 3
470
+
471
+ - ``prec`` -- (optional) the precision used in the computation of the
472
+ `p`-adic L-Series
473
+
474
+ - ``use_twists`` -- boolean (default: ``True``); if ``True`` the algorithm may
475
+ change to a quadratic twist with minimal conductor to do the modular
476
+ symbol computations rather than using the modular symbols of the
477
+ curve itself. If ``False`` it forces the computation using the
478
+ modular symbols of the curve itself.
479
+
480
+ OUTPUT: `p`-adic number - that conjecturally equals `\# Sha(E/\QQ)`.
481
+
482
+ If ``prec`` is set to zero (default) then the precision is set so that
483
+ at least the first `p`-adic digit of conjectural `\# Sha(E/\QQ)` is
484
+ determined.
485
+
486
+ EXAMPLES:
487
+
488
+ Good ordinary examples::
489
+
490
+ sage: EllipticCurve('11a1').sha().an_padic(5) # rank 0
491
+ 1 + O(5^22)
492
+ sage: EllipticCurve('43a1').sha().an_padic(5) # rank 1
493
+ 1 + O(5)
494
+ sage: EllipticCurve('389a1').sha().an_padic(5,4) # rank 2, long time (2s on sage.math, 2011)
495
+ 1 + O(5^3)
496
+ sage: EllipticCurve('858k2').sha().an_padic(7) # rank 0, non trivial sha, long time (10s on sage.math, 2011)
497
+ 7^2 + O(7^24)
498
+ sage: EllipticCurve('300b2').sha().an_padic(3) # 9 elements in sha, long time (2s on sage.math, 2011)
499
+ 3^2 + O(3^24)
500
+ sage: EllipticCurve('300b2').sha().an_padic(7, prec=6) # long time
501
+ 2 + 7 + O(7^8)
502
+
503
+ Exceptional cases::
504
+
505
+ sage: EllipticCurve('11a1').sha().an_padic(11) # rank 0
506
+ 1 + O(11^22)
507
+ sage: EllipticCurve('130a1').sha().an_padic(5) # rank 1
508
+ 1 + O(5)
509
+
510
+ Non-split, but rank 0 case (:issue:`7331`)::
511
+
512
+ sage: EllipticCurve('270b1').sha().an_padic(5) # rank 0, long time (2s on sage.math, 2011)
513
+ 1 + O(5^22)
514
+
515
+ The output has the correct sign::
516
+
517
+ sage: EllipticCurve('123a1').sha().an_padic(41) # rank 1, long time (3s on sage.math, 2011)
518
+ 1 + O(41)
519
+
520
+ Supersingular cases::
521
+
522
+ sage: EllipticCurve('34a1').sha().an_padic(5) # rank 0
523
+ 1 + O(5^22)
524
+ sage: EllipticCurve('53a1').sha().an_padic(5) # rank 1, long time (11s on sage.math, 2011)
525
+ 1 + O(5)
526
+
527
+ Cases that use a twist to a lower conductor::
528
+
529
+ sage: EllipticCurve('99a1').sha().an_padic(5)
530
+ 1 + O(5)
531
+ sage: EllipticCurve('240d3').sha().an_padic(5) # sha has 4 elements here
532
+ 4 + O(5)
533
+ sage: EllipticCurve('448c5').sha().an_padic(7, prec=4, use_twists=False) # long time (2s on sage.math, 2011)
534
+ 2 + 7 + O(7^6)
535
+ sage: EllipticCurve([-19,34]).sha().an_padic(5) # see trac #6455, long time (4s on sage.math, 2011)
536
+ 1 + O(5)
537
+
538
+ Test for :issue:`15737`::
539
+
540
+ sage: E = EllipticCurve([-100,0])
541
+ sage: s = E.sha()
542
+ sage: s.an_padic(13)
543
+ 1 + O(13^20)
544
+ """
545
+ try:
546
+ return self.__an_padic[(p, prec)]
547
+ except AttributeError:
548
+ self.__an_padic = {}
549
+ except KeyError:
550
+ pass
551
+
552
+ E = self.Emin
553
+ tam = E.tamagawa_product()
554
+ tors = E.torsion_order()**2
555
+ r = E.rank()
556
+ if r > 0:
557
+ reg = E.padic_regulator(p)
558
+ else:
559
+ if E.is_supersingular(p):
560
+ reg = vector([Qp(p, 20)(1), 0])
561
+ else:
562
+ reg = Qp(p, 20)(1)
563
+
564
+ if use_twists and p > 2:
565
+ Et, D = E.minimal_quadratic_twist()
566
+ # trac 6455 : we have to assure that the twist back is allowed
567
+ D = ZZ(D)
568
+ if not D % p:
569
+ D = D // p
570
+ for ell in D.prime_divisors():
571
+ if ell % 2:
572
+ if not Et.conductor() % ell**2:
573
+ D = D // ell
574
+ ve = valuation(D, 2)
575
+ de = (D >> ve).abs()
576
+ if de % 4 == 3:
577
+ de = -de
578
+ Et = E.quadratic_twist(de)
579
+ # now check individually if we can twist by -1 or 2 or -2
580
+ Nmin = Et.conductor()
581
+ Dmax = de
582
+ for DD in [-4 * de, 8 * de, -8 * de]:
583
+ Et = E.quadratic_twist(DD)
584
+ if Et.conductor() < Nmin and valuation(Et.conductor(), 2) <= valuation(DD, 2):
585
+ Nmin = Et.conductor()
586
+ Dmax = DD
587
+ D = Dmax
588
+ Et = E.quadratic_twist(D)
589
+ lp = Et.padic_lseries(p)
590
+ else:
591
+ lp = E.padic_lseries(p)
592
+ D = 1
593
+
594
+ if r == 0 and D == 1:
595
+ # short cut for rank 0 curves, we do not
596
+ # to compute the p-adic L-function, the leading
597
+ # term will be the L-value divided by the Neron
598
+ # period.
599
+ ms = E.modular_symbol(sign=+1, normalize='L_ratio')
600
+ lstar = ms(0) / E.real_components()
601
+ bsd = tam / tors
602
+ if prec == 0:
603
+ # prec = valuation(lstar/bsd, p)
604
+ prec = 20
605
+ shan = Qp(p, prec=prec + 2)(lstar / bsd)
606
+
607
+ elif E.is_ordinary(p):
608
+ K = reg.parent()
609
+ lg = log(K(1 + p))
610
+
611
+ if (E.is_good(p) or E.ap(p) == -1):
612
+ if not E.is_good(p):
613
+ eps = 2
614
+ else:
615
+ eps = (1 - arith.kronecker_symbol(D, p) / lp.alpha())**2
616
+ # according to the p-adic BSD this should be equal to the leading term of the p-adic L-series divided by sha:
617
+ bsdp = tam * reg * eps / tors / lg**r
618
+ else:
619
+ r += 1 # exceptional zero
620
+ eq = E.tate_curve(p)
621
+ Li = eq.L_invariant()
622
+
623
+ # according to the p-adic BSD (Mazur-Tate-Teitelbaum)
624
+ # this should be equal to the leading term of the p-adic L-series divided by sha:
625
+ bsdp = tam * reg * Li / tors / lg**r
626
+
627
+ v = bsdp.valuation()
628
+ if v > 0:
629
+ verbose("the prime is irregular for this curve.")
630
+
631
+ # determine how much prec we need to prove at least the
632
+ # triviality of the p-primary part of Sha
633
+
634
+ if prec == 0:
635
+ n = max(v, 2)
636
+ bounds = lp._prec_bounds(n, r + 1)
637
+ while bounds[r] <= v:
638
+ n += 1
639
+ bounds = lp._prec_bounds(n, r + 1)
640
+ verbose("set precision to %s" % n)
641
+ else:
642
+ n = max(2, prec)
643
+
644
+ not_yet_enough_prec = True
645
+ while not_yet_enough_prec:
646
+ lps = lp.series(n, quadratic_twist=D, prec=r + 1)
647
+ lstar = lps[r]
648
+ if (lstar != 0) or (prec != 0):
649
+ not_yet_enough_prec = False
650
+ else:
651
+ n += 1
652
+ verbose("increased precision to %s" % n)
653
+
654
+ shan = lstar / bsdp
655
+
656
+ elif E.is_supersingular(p):
657
+ K = reg[0].parent()
658
+ lg = log(K(1 + p))
659
+
660
+ # according to the p-adic BSD this should be equal to the leading term of the D_p - valued
661
+ # L-series :
662
+ bsdp = tam / tors / lg**r * reg
663
+ # note this is an element in Q_p^2
664
+
665
+ verbose("the algebraic leading terms : %s" % bsdp)
666
+
667
+ v = [bsdp[0].valuation(), bsdp[1].valuation()]
668
+
669
+ if prec == 0:
670
+ n = max(min(v) + 2, 3)
671
+ else:
672
+ n = max(3, prec)
673
+
674
+ verbose("...computing the p-adic L-series")
675
+ not_yet_enough_prec = True
676
+ while not_yet_enough_prec:
677
+ lps = lp.Dp_valued_series(n, quadratic_twist=D, prec=r + 1)
678
+ lstar = [lps[0][r], lps[1][r]]
679
+ verbose("the leading terms : %s" % lstar)
680
+ if (lstar[0] != 0 or lstar[1] != 0) or (prec != 0):
681
+ not_yet_enough_prec = False
682
+ else:
683
+ n += 1
684
+ verbose("increased precision to %s" % n)
685
+
686
+ verbose("...putting things together")
687
+ if bsdp[0] != 0:
688
+ shan0 = lstar[0] / bsdp[0]
689
+ else:
690
+ shan0 = 0 # this should actually never happen
691
+ if bsdp[1] != 0:
692
+ shan1 = lstar[1] / bsdp[1]
693
+ else:
694
+ shan1 = 0 # this should conjecturally only happen when the rank is 0
695
+ verbose(f"the two values for Sha : {shan0}, {shan1}")
696
+
697
+ # check consistency (the first two are only here to avoid a bug in the p-adic L-series
698
+ # (namely the coefficients of zero-relative precision are treated as zero)
699
+ if shan0 != 0 and shan1 != 0 and shan0 - shan1 != 0:
700
+ raise RuntimeError("There must be a bug in the supersingular routines for the p-adic BSD.")
701
+
702
+ # take the better
703
+ if shan1 == 0 or shan0.precision_relative() > shan1.precision_relative():
704
+ shan = shan0
705
+ else:
706
+ shan = shan1
707
+
708
+ else:
709
+ raise ValueError("The curve has to have semi-stable reduction at p.")
710
+
711
+ self.__an_padic[(p, prec)] = shan
712
+ return shan
713
+
714
+ def p_primary_order(self, p):
715
+ r"""
716
+ Return the order of the `p`-primary part of the Tate-Shafarevich
717
+ group.
718
+
719
+ This uses the result of Skinner and Urban [SU2014]_ on the
720
+ main conjecture in Iwasawa theory. In particular the elliptic
721
+ curve must have good ordinary reduction at `p`, the residual
722
+ Galois representation must be surjective. Furthermore there must
723
+ be an auxiliary prime `\ell` dividing the conductor of the curve
724
+ exactly once such that the residual representation is ramified
725
+ at `p`.
726
+
727
+ INPUT:
728
+
729
+ - ``p`` -- an odd prime
730
+
731
+ OUTPUT:
732
+
733
+ - ``e`` -- nonnegative integer such that `p^e` is the
734
+ order of the `p`-primary order if the conditions are satisfied
735
+ and raises a :exc:`ValueError` otherwise.
736
+
737
+ EXAMPLES::
738
+
739
+ sage: E = EllipticCurve("389a1") # rank 2
740
+ sage: E.sha().p_primary_order(5)
741
+ 0
742
+ sage: E = EllipticCurve("11a1")
743
+ sage: E.sha().p_primary_order(7)
744
+ 0
745
+ sage: E.sha().p_primary_order(5)
746
+ Traceback (most recent call last):
747
+ ...
748
+ ValueError: The order is not provably known using Skinner-Urban.
749
+ Try running p_primary_bound to get a bound.
750
+ """
751
+ E = self.E
752
+ # does not work if p = 2
753
+ if p == 2:
754
+ raise ValueError(f"{p} is not an odd prime")
755
+ if (E.is_ordinary(p) and E.conductor() % p and
756
+ E.galois_representation().is_surjective(p)):
757
+ N = E.conductor()
758
+ fac = N.factor()
759
+ # the auxiliary prime will be one dividing the conductor
760
+ if all(E.tate_curve(ell).parameter().valuation() % p == 0
761
+ for ell, e in fac if e == 1):
762
+ raise ValueError("The order is not provably known using Skinner-Urban.\n" +
763
+ "Try running p_primary_bound to get a bound.")
764
+ else:
765
+ raise ValueError("The order is not provably known using Skinner-Urban.\n" +
766
+ "Try running p_primary_bound to get a bound.")
767
+ return self.p_primary_bound(p)
768
+
769
+ def p_primary_bound(self, p):
770
+ r"""
771
+ Return a provable upper bound for the order of the
772
+ `p`-primary part `Sha(E)(p)` of the Tate-Shafarevich group.
773
+
774
+ INPUT:
775
+
776
+ - ``p`` -- a prime > 2
777
+
778
+ OUTPUT:
779
+
780
+ - ``e`` -- nonnegative integer such that `p^e` is an upper
781
+ bound for the order of `Sha(E)(p)`
782
+
783
+ In particular, if this algorithm does not fail, then it proves
784
+ that the `p`-primary part of `Sha` is finite. This works also
785
+ for curves of rank > 1.
786
+
787
+ Note also that this bound is sharp if one assumes the main conjecture
788
+ of Iwasawa theory of elliptic curves. One may use the method
789
+ ``p_primary_order`` for checking if the extra conditions hold under
790
+ which the main conjecture is known by the work of Skinner and Urban.
791
+ This then returns the provable `p`-primary part of the Tate-Shafarevich
792
+ group.
793
+
794
+ Currently the algorithm is only implemented when the following
795
+ conditions are verified:
796
+
797
+ - The `p`-adic Galois representation must be surjective or
798
+ must have its image contained in a Borel subgroup.
799
+
800
+ - The reduction at `p` is not allowed to be additive.
801
+
802
+ - If the reduction at `p` is non-split multiplicative, then
803
+ the rank must be 0.
804
+
805
+ - If `p = 3`, then the reduction at 3 must be good ordinary or
806
+ split multiplicative, and the rank must be 0.
807
+
808
+ ALGORITHM:
809
+
810
+ The algorithm is described in [SW2013]_. The results for the
811
+ reducible case can be found in [Wu2004]_. The main ingredient is
812
+ Kato's result on the main conjecture in Iwasawa theory.
813
+
814
+ EXAMPLES::
815
+
816
+ sage: e = EllipticCurve('11a3')
817
+ sage: e.sha().p_primary_bound(3)
818
+ 0
819
+ sage: e.sha().p_primary_bound(5)
820
+ 0
821
+ sage: e.sha().p_primary_bound(7)
822
+ 0
823
+ sage: e.sha().p_primary_bound(11)
824
+ 0
825
+ sage: e.sha().p_primary_bound(13)
826
+ 0
827
+
828
+ sage: e = EllipticCurve('389a1')
829
+ sage: e.sha().p_primary_bound(5)
830
+ 0
831
+ sage: e.sha().p_primary_bound(7)
832
+ 0
833
+ sage: e.sha().p_primary_bound(11)
834
+ 0
835
+ sage: e.sha().p_primary_bound(13)
836
+ 0
837
+
838
+ sage: e = EllipticCurve('858k2')
839
+ sage: e.sha().p_primary_bound(3) # long time (10s on sage.math, 2011)
840
+ 0
841
+
842
+ Some checks for :issue:`6406` and :issue:`16959`::
843
+
844
+ sage: e.sha().p_primary_bound(7) # long time
845
+ 2
846
+
847
+ sage: E = EllipticCurve('608b1')
848
+ sage: E.sha().p_primary_bound(5)
849
+ Traceback (most recent call last):
850
+ ...
851
+ ValueError: The p-adic Galois representation is not surjective or reducible.
852
+ Current knowledge about Euler systems does not provide an upper bound
853
+ in this case. Try an_padic for a conjectural bound.
854
+
855
+ sage: E.sha().an_padic(5) # long time
856
+ 1 + O(5^22)
857
+
858
+ sage: E = EllipticCurve("5040bi1")
859
+ sage: E.sha().p_primary_bound(5) # long time
860
+ 0
861
+ """
862
+ p = Integer(p)
863
+ if p == 2:
864
+ raise ValueError("The prime p must be odd.")
865
+ E = self.Emin
866
+ if not (E.is_ordinary(p) or E.is_good(p)):
867
+ raise ValueError("The curve has to have semi-stable reduction at p.")
868
+ rho = E.galois_representation()
869
+ su = rho.is_surjective(p)
870
+ re = rho.is_reducible(p)
871
+ if not su and not re:
872
+ raise ValueError("The p-adic Galois representation is not surjective or reducible. Current knowledge about Euler systems does not provide an upper bound in this case. Try an_padic for a conjectural bound.")
873
+ shan = self.an_padic(p, prec=0, use_twists=True)
874
+ if shan == 0:
875
+ raise RuntimeError("There is a bug in an_padic.")
876
+ return shan.valuation()
877
+
878
+ def two_selmer_bound(self):
879
+ r"""
880
+ Return the 2-rank, i.e. the `\GF{2}`-dimension
881
+ of the 2-torsion part of `Sha`, provided we can determine the
882
+ rank of `E`.
883
+
884
+ EXAMPLES::
885
+
886
+ sage: sh = EllipticCurve('571a1').sha()
887
+ sage: sh.two_selmer_bound()
888
+ 2
889
+ sage: sh.an()
890
+ 4
891
+
892
+ sage: sh = EllipticCurve('66a1').sha()
893
+ sage: sh.two_selmer_bound()
894
+ 0
895
+ sage: sh.an()
896
+ 1
897
+
898
+ sage: sh = EllipticCurve('960d1').sha()
899
+ sage: sh.two_selmer_bound()
900
+ 2
901
+ sage: sh.an()
902
+ 4
903
+ """
904
+ E = self.Emin
905
+ S = E.selmer_rank()
906
+ r = E.rank()
907
+ t = E.two_torsion_rank()
908
+ b = S - r - t
909
+ return 0 if b < 0 else b
910
+
911
+ def bound_kolyvagin(self, D=0, regulator=None,
912
+ ignore_nonsurj_hypothesis=False):
913
+ r"""
914
+ Given a fundamental discriminant `D \neq -3,-4` that satisfies the
915
+ Heegner hypothesis for `E`, return a list of primes so that
916
+ Kolyvagin's theorem (as in Gross's paper) implies that any
917
+ prime divisor of `Sha` is in this list.
918
+
919
+ INPUT:
920
+
921
+ - ``D`` -- (optional) a fundamental discriminant < -4 that satisfies
922
+ the Heegner hypothesis for `E`; if not given, use the first such `D`
923
+ - ``regulator`` -- (optional) regulator of `E(K)`; if not given, will
924
+ be computed (which could take a long time)
925
+ - ``ignore_nonsurj_hypothesis`` -- (default: ``False``);
926
+ if ``True``, then gives the bound coming from Heegner point
927
+ index, but without any hypothesis on surjectivity
928
+ of the mod-`p` representation
929
+
930
+ OUTPUT:
931
+
932
+ - ``list`` -- list of primes such that if `p` divides `Sha(E/K)`, then
933
+ `p` is in this list, unless `E/K` has complex multiplication or
934
+ analytic rank greater than 2 (in which case we return 0)
935
+
936
+ - ``index`` -- the odd part of the index of the Heegner point in the full
937
+ group of `K`-rational points on `E` (if `E` has CM, returns 0)
938
+
939
+ REMARKS:
940
+
941
+ 1) We do not have to assume that the Manin constant is 1
942
+ (or a power of 2). If the Manin constant were
943
+ divisible by a prime, that prime would get included in
944
+ the list of bad primes.
945
+
946
+ 2) We assume the Gross-Zagier theorem is true under the
947
+ hypothesis that `gcd(N,D) = 1`, instead of the stronger
948
+ hypothesis `gcd(2\cdot N,D)=1` that is in the original
949
+ Gross-Zagier paper. That Gross-Zagier is true when
950
+ `gcd(N,D)=1` is "well-known" to the experts, but does not
951
+ seem to written up well in the literature.
952
+
953
+ 3) Correctness of the computation is guaranteed using
954
+ interval arithmetic, under the assumption that the
955
+ regulator, square root, and period lattice are
956
+ computed to precision at least `10^{-10}`, i.e., they are
957
+ correct up to addition or a real number with absolute
958
+ value less than `10^{-10}`.
959
+
960
+ EXAMPLES::
961
+
962
+ sage: E = EllipticCurve('37a')
963
+ sage: E.sha().bound_kolyvagin()
964
+ ([2], 1)
965
+ sage: E = EllipticCurve('141a')
966
+ sage: E.sha().an()
967
+ 1
968
+ sage: E.sha().bound_kolyvagin()
969
+ ([2, 7], 49)
970
+
971
+ We get no information when the curve has rank 2.::
972
+
973
+ sage: E = EllipticCurve('389a')
974
+ sage: E.sha().bound_kolyvagin()
975
+ (0, 0)
976
+ sage: E = EllipticCurve('681b')
977
+ sage: E.sha().an()
978
+ 9
979
+ sage: E.sha().bound_kolyvagin()
980
+ ([2, 3], 9)
981
+ """
982
+ E = self.Emin
983
+ if E.has_cm():
984
+ return 0, 0
985
+
986
+ if D == 0:
987
+ D = -5
988
+ while not E.satisfies_heegner_hypothesis(D):
989
+ D -= 1
990
+
991
+ if not E.satisfies_heegner_hypothesis(D):
992
+ raise ArithmeticError("Discriminant (=%s) must be a fundamental discriminant that satisfies the Heegner hypothesis." % D)
993
+ if D == -3 or D == -4:
994
+ raise ArithmeticError("Discriminant (=%s) must not be -3 or -4." % D)
995
+ eps = E.root_number()
996
+ L1_vanishes = E.lseries().L1_vanishes()
997
+ if eps == 1 and L1_vanishes:
998
+ return 0, 0 # rank even hence >= 2, so Kolyvagin gives nothing.
999
+ alpha = sqrt(abs(D)) / (2 * E.period_lattice().complex_area())
1000
+ F = E.quadratic_twist(D)
1001
+ k_E = 2 * sqrt(E.conductor()) + 10
1002
+ k_F = 2 * sqrt(F.conductor()) + 10
1003
+ # k_E = 2
1004
+ # k_F = 2
1005
+
1006
+ MIN_ERR = 1e-10
1007
+ # we assume that regulator and
1008
+ # discriminant, etc., computed to this accuracy.
1009
+
1010
+ tries = 0
1011
+ while True:
1012
+ tries += 1
1013
+ if tries >= 6:
1014
+ raise RuntimeError("Too many precision increases in bound_kolyvagin")
1015
+ if eps == 1: # E has even rank
1016
+ verbose("Conductor of twist = %s" % F.conductor())
1017
+ LF1, err_F = F.lseries().deriv_at1(k_F)
1018
+ LE1, err_E = E.lseries().at1(k_E)
1019
+ err_F = max(err_F, MIN_ERR)
1020
+ err_E = max(err_E, MIN_ERR)
1021
+ if regulator is not None:
1022
+ hZ = regulator / 2
1023
+ else:
1024
+ hZ = F.regulator(use_database=True) / 2
1025
+ I = RIF(alpha) * RIF(LE1-err_E, LE1+err_E) * RIF(LF1-err_F, LF1+err_F) / RIF(hZ)
1026
+
1027
+ else: # E has odd rank
1028
+
1029
+ if regulator is not None:
1030
+ hZ = regulator / 2
1031
+ else:
1032
+ hZ = E.regulator(use_database=True) / 2
1033
+ LE1, err_E = E.lseries().deriv_at1(k_E)
1034
+ LF1, err_F = F.lseries().at1(k_F)
1035
+ err_F = max(err_F, MIN_ERR)
1036
+ err_E = max(err_E, MIN_ERR)
1037
+ # I = alpha * LE1 * LF1 / hZ
1038
+
1039
+ I = RIF(alpha) * RIF(LE1-err_E, LE1+err_E) * RIF(LF1-err_F, LF1+err_F) / RIF(hZ)
1040
+
1041
+ verbose('interval = %s' % I)
1042
+ t, n = I.is_int()
1043
+ if t:
1044
+ break
1045
+ elif I.absolute_diameter() < 1:
1046
+ raise RuntimeError("Problem in bound_kolyvagin; square of index is not an integer -- D={}, I={}.".format(D, I))
1047
+ verbose("Doubling bounds")
1048
+ k_E *= 2
1049
+ k_F *= 2
1050
+ # end while
1051
+
1052
+ # We include 2 since Kolyvagin (in Gross) says nothing there
1053
+ if n == 0:
1054
+ return 0, 0 # no bound
1055
+ B = [2]
1056
+ for p, e in n.factor():
1057
+ if p > 2:
1058
+ if e % 2:
1059
+ raise RuntimeError("Problem in bound_kolyvagin; square of index is not a perfect square! D={}, I={}, n={}, e={}.".format(D, I, n, e))
1060
+ B.append(p)
1061
+ else:
1062
+ n >>= e # replace n by its odd part
1063
+ if not ignore_nonsurj_hypothesis:
1064
+ B.extend(E.galois_representation().non_surjective())
1065
+ return sorted({int(x) for x in B}), n
1066
+
1067
+ def bound_kato(self):
1068
+ r"""
1069
+ Return a list of primes `p` such that the theorems of Kato's [Kat2004]_
1070
+ and others (e.g., as explained in a thesis of Grigor Grigorov [Gri2005]_)
1071
+ imply that if `p` divides the order of `Sha(E/\QQ)` then `p` is in
1072
+ the list.
1073
+
1074
+ If `L(E,1) = 0`, then this function gives no information, so
1075
+ it returns ``False``.
1076
+
1077
+ THEOREM: Suppose `L(E,1) \neq 0` and `p \neq 2` is a prime such
1078
+ that
1079
+
1080
+ - `E` does not have additive reduction at `p`,
1081
+ - either the `p`-adic representation is surjective or has its
1082
+ image contained in a Borel subgroup.
1083
+
1084
+ Then `{ord}_p(\#Sha(E))` is bounded from above by the `p`-adic valuation of `L(E,1)\cdot\#E(\QQ)_{tor}^2 / (\Omega_E \cdot \prod c_v)`.
1085
+
1086
+ If the `L`-series vanishes, the method ``p_primary_bound`` can be used instead.
1087
+
1088
+ EXAMPLES::
1089
+
1090
+ sage: E = EllipticCurve([0, -1, 1, -10, -20]) # 11A = X_0(11)
1091
+ sage: E.sha().bound_kato()
1092
+ [2]
1093
+ sage: E = EllipticCurve([0, -1, 1, 0, 0]) # X_1(11)
1094
+ sage: E.sha().bound_kato()
1095
+ [2]
1096
+ sage: E = EllipticCurve([1,1,1,-352,-2689]) # 66B3
1097
+ sage: E.sha().bound_kato()
1098
+ [2]
1099
+
1100
+ For the following curve one really has that 25 divides the
1101
+ order of `Sha` (by [GJPST2009]_)::
1102
+
1103
+ sage: E = EllipticCurve([1, -1, 0, -332311, -73733731]) # 1058D1
1104
+ sage: E.sha().bound_kato() # long time (about 1 second)
1105
+ [2, 5, 23]
1106
+ sage: E.galois_representation().non_surjective() # long time (about 1 second)
1107
+ []
1108
+
1109
+ For this one, `Sha` is divisible by 7::
1110
+
1111
+ sage: E = EllipticCurve([0, 0, 0, -4062871, -3152083138]) # 3364C1
1112
+ sage: E.sha().bound_kato() # long time (< 10 seconds)
1113
+ [2, 7, 29]
1114
+
1115
+ No information about curves of rank > 0::
1116
+
1117
+ sage: E = EllipticCurve([0, 0, 1, -1, 0]) # 37A (rank 1)
1118
+ sage: E.sha().bound_kato()
1119
+ False
1120
+ """
1121
+ E = self.Emin
1122
+ if E.has_cm():
1123
+ return False
1124
+ if E.lseries().L1_vanishes():
1125
+ return False
1126
+ B = [2]
1127
+ rho = E.galois_representation()
1128
+ B.extend(p for p in rho.non_surjective()
1129
+ if p > 2 and p not in rho.reducible_primes())
1130
+ B.extend(p for p in E.conductor().prime_divisors()
1131
+ if E.has_additive_reduction(p))
1132
+
1133
+ # The only other p that might divide B are those that divide
1134
+ # the integer 2*#E(Q)_tor^2 * L(E,1)/omega. So we compute
1135
+ # that to sufficient precision to determine it. Note that
1136
+ # we have to assume the Manin constant is <=2 in order to provably
1137
+ # compute L(E,1)/omega.
1138
+ for p, n in self.an().factor():
1139
+ if n >= 2: # use parity of Sha
1140
+ B.append(int(p))
1141
+ return sorted(set(B))
1142
+
1143
+ def bound(self):
1144
+ r"""
1145
+ Compute a provably correct bound on the order of the Tate-Shafarevich
1146
+ group of this curve.
1147
+
1148
+ The bound is either ``False`` (no bound) or a list ``B`` of primes
1149
+ such that any prime divisor of the order of `Sha` is in this list.
1150
+
1151
+ EXAMPLES::
1152
+
1153
+ sage: EllipticCurve('37a').sha().bound()
1154
+ ([2], 1)
1155
+ """
1156
+ if self.Emin.lseries().L1_vanishes():
1157
+ return self.bound_kolyvagin()
1158
+ return self.bound_kato()