Skip to content

Commit

Permalink
catch a corner case for elliptic surfaces (#3880)
Browse files Browse the repository at this point in the history
* catch a corner case for elliptic surfaces

* allow to turn minimization off

* remove forgotten show
  • Loading branch information
simonbrandhorst committed Jun 21, 2024
1 parent 8163ba8 commit 5dcfffb
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions experimental/Schemes/src/elliptic_surface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1589,12 +1589,12 @@ degree at most ``4`` to Weierstrass form, apply Tate's algorithm and
return the corresponding relatively minimal elliptic surface
as well as the coordinate transformation.
"""
function elliptic_surface(g::MPolyRingElem, P::Vector{<:RingElem})
function elliptic_surface(g::MPolyRingElem, P::Vector{<:RingElem}; minimize=true)
R = parent(g)
(x, y) = gens(R)
P = base_ring(R).(P)
g2, phi2 = transform_to_weierstrass(g, x, y, P);
Y2, phi1 = _elliptic_surface_with_trafo(g2)
Y2, phi1 = _elliptic_surface_with_trafo(g2; minimize)
return Y2, phi2 * phi1
end

Expand Down Expand Up @@ -1628,6 +1628,7 @@ function transform_to_weierstrass(g::MPolyRingElem, x::MPolyRingElem, y::MPolyRi
return switch(g_trans), new_trans
end

g = inv(coeff(g,[0,2]))*g # normalise g
kk = coefficient_ring(R)
kkx, X = polynomial_ring(kk, :x, cached=false)
kkxy, Y = polynomial_ring(kkx, :y, cached=false)
Expand All @@ -1640,11 +1641,19 @@ function transform_to_weierstrass(g::MPolyRingElem, x::MPolyRingElem, y::MPolyRi
@assert all(h->degree(h)<=4, coefficients(G)) "input polynomial must be of degree <= 4 in x"
@assert iszero(coefficients(G)[1]) "coefficient of linear term in y must be zero"
@assert isone(coefficients(G)[2]) "leading coefficient in y must be one"

if length(P) == 3 && isone(P[3])
P = P[1:2]
end


length(P) == 2 || error("need precisely two point coordinates")
(px, py) = P
if length(P) == 2
@assert iszero(evaluate(g, P)) "point does not lie on the hypersurface"
(px, py) = P
else
px = P[1]
end
# assert g.subs({x:px,y:py})==0
@assert iszero(evaluate(g, P)) "point does not lie on the hypersurface"
gx = -evaluate(g, [X + px, zero(X)])
coeff_gx = collect(coefficients(gx))
A = coeff(gx, 4)
Expand All @@ -1653,7 +1662,16 @@ function transform_to_weierstrass(g::MPolyRingElem, x::MPolyRingElem, y::MPolyRi
D = coeff(gx, 1)
E = coeff(gx, 0)
#E, D, C, B, A = coeff_gx
if !iszero(E)
if length(P)==3
@req all(h->degree(h)<=3, coefficients(G)) "infinity (0:1:0) is not a point of this hypersurface"
# y^2 = B*x^3+C*x^2+C*x+D
x1 = F(inv(B)*x)
y1 = F(inv(B)*y)
trans = MapFromFunc(F, F, f->evaluate(numerator(f), [x1, y1])//evaluate(denominator(f), [x1, y1]))
f_trans = B^2*trans(F(g))
result = numerator(B^2*f_trans)
return result, trans
elseif !iszero(E)
b = py
a4, a3, a2, a1, a0 = A,B,C,D,E
A = b
Expand Down Expand Up @@ -2286,7 +2304,7 @@ end
# The transformation is a morphism from the fraction field of the
# parent of g to the fraction field of the `ambient_coordinate_ring`
# of the `weierstrass_chart` of the resulting surface.
function _elliptic_surface_with_trafo(g::MPolyRingElem{<:AbstractAlgebra.Generic.FracFieldElem})
function _elliptic_surface_with_trafo(g::MPolyRingElem{<:AbstractAlgebra.Generic.FracFieldElem}; minimize::Bool=true)
x, y = gens(parent(g))
E = elliptic_curve(g, x, y)
kkt = base_field(E)
Expand All @@ -2296,11 +2314,12 @@ function _elliptic_surface_with_trafo(g::MPolyRingElem{<:AbstractAlgebra.Generic

# The following three commands won't work unless we convert to a rational_function_field
EE = base_change(x->evaluate(x, t), E)

EE = tates_algorithm_global(EE)
EE, _ = short_weierstrass_model(EE)
EE, _ = integral_model(EE)

if minimize
EE = tates_algorithm_global(EE)
EE, _ = short_weierstrass_model(EE)
EE, _ = integral_model(EE)
end

# ...and back.
E2 = base_change(x->evaluate(x, gen(kkt)), EE)

Expand Down

0 comments on commit 5dcfffb

Please sign in to comment.