"""Exact checks for the numbers quoted in main.tex (run with python from this folder). 1. j-invariants of the example curves (exact rationals). 2. Non-torsion of the example points via Nagell-Lutz: 2P has a non-integral coordinate. 3. Arb enclosures of varpi = Gamma(1/4)^2/(2 sqrt(2 pi)) and Omega_rho = Gamma(1/3)^3/(2^{4/3} pi). 4. Arithmetic of the counts (W88 inequality (4.1)) used in the case tables, per unit n. """ from fractions import Fraction as Fr from flint import arb, ctx def j_inv(a, b): # y^2 = x^3 + a x + b a, b = Fr(a), Fr(b) return 1728 * 4 * a**3 / (4 * a**3 + 27 * b**2) def double(P, a): x, y = map(Fr, P) lam = (3 * x * x + a) / (2 * y) x2 = lam * lam - 2 * x y2 = lam * (x - x2) - y return x2, y2 def on_curve(P, a, b): x, y = map(Fr, P) return y * y == x**3 + a * x + b curves = { "E1: y^2=x^3-2x": (-2, 0, (2, 2)), "E2: y^2=x^3+2": (0, 2, (-1, 1)), "E3: y^2=x^3-30x+56": (-30, 56, None), "E3': y^2=x^3-35x-98": (-35, -98, None), "y^2=x^3-36x": (-36, 0, (12, 36)), "y^2=x^3-2": (0, -2, (3, 5)), } for name, (a, b, P) in curves.items(): print(name, " j =", j_inv(a, b), " disc != 0:", 4 * a**3 + 27 * b**2 != 0) if P: assert on_curve(P, a, b) Q = double(P, a) assert on_curve(Q, a, b) print(" P =", P, " 2P =", Q, " non-integral (=> P non-torsion, Nagell-Lutz):", Q[0].denominator != 1 or Q[1].denominator != 1) ctx.prec = 200 pi = arb.pi() varpi =(arb("0.25").gamma() ** 2) / (2 * (2 * pi).sqrt()) om_rho = (arb(1) / 3).gamma() ** 3 / (arb(2) ** (arb(4) / 3) * pi) print("varpi =", varpi.str(30)) print("Omega_rho =", om_rho.str(30)) print("Omega_rho/varpi =", (om_rho / varpi).str(30)) # W88 (4.1) arithmetic per unit n: 2*(lam + A - wt) vs (3 - dimU)*(A - kappa), A = 6, kappa = 1. def row(lam, wt, dimU, A=6, kappa=1, dN=2): return dN * (lam + A - wt), (3 - dimU) * (A - kappa) print("T94 G'=0:", row(2, 0, 0), " axis:", row(2, 2, 1), " line:", row(1, 1, 1), " plane(2,3):", row(2, 4, 2), " plane(1,j):", row(1, 4, 2), " plane other:", row(0, 3, 2), " case B plane(2,3):", row(1, 4, 2)) print("T101a (hyperplane, A=3,k=1,d-N=1): G'=0", (1 * (2 + 3 - 0), 2 * 2), " axis1", (1 + 3 - 1, 1 * 2), " axis2", (2 + 3 - 2, 1 * 2)) print("generic-y (A=4,k=0,lam=2):", (2 * (2 + 4), 3 * 4)) print("x1 alone (A=6,k=1,lam=1):", row(1, 0, 0), " kappa deleted:", row(2, 0, 0, kappa=0), " E2 non-CM (A=7):", row(2, 0, 0, A=7))