Function: genus2red
Section: elliptic_curves
C-Name: genus2red
Prototype: GGDG
Help: genus2red(Q,P,{p}): let Q,P be polynomials with integer coefficients.
 Determines the reduction at p > 2 of the
 (proper, smooth) hyperelliptic curve C/Q: y^2+Qy = P, of genus 2.
 (The special fiber X_p of the minimal regular model X of C over Z.)
Doc: Let $Q,P$ be polynomials with integer coefficients.
 Determines the reduction at $p > 2$ of the (proper, smooth) genus~2
 curve $C/\Q$, defined by the hyperelliptic equation $y^2+Qy = P$. (The
 special fiber $X_p$ of the minimal regular model $X$ of $C$ over $\Z$.)
 If $p$ is omitted, determines the reduction type for all (odd) prime
 divisors of the discriminant.

 \noindent This function rewritten from an implementation of Liu's algorithm by
 Cohen and Liu (1994), \kbd{genus2reduction-0.3}, see
 \kbd{http://www.math.u-bordeaux1.fr/\til liu/G2R/}.

 \misctitle{CAVEAT} The function interface may change: for the
 time being, it returns $[N,\var{FaN}, T, V]$
 where $N$ is either the local conductor at $p$ or the
 global conductor, \var{FaN} is its factorization, $y^2 = T$ defines a
 minimal model over $\Z[1/2]$ and $V$ describes the reduction type at the
 various considered~$p$. Unfortunately, the program is not complete for
 $p = 2$, and we may return the odd part of the conductor only: this is the
 case if the factorization includes the (impossible) term $2^{-1}$; if the
 factorization contains another power of $2$, then this is the exact local
 conductor at $2$ and $N$ is the global conductor.

 \bprog
 ? default(debuglevel, 1);
 ? genus2red(0,x^6 + 3*x^3 + 63, 3)
 (potential) stable reduction: [1, []]
 reduction at p: [III{9}] page 184, [3, 3], f = 10
 %1 = [59049, Mat([3, 10]), x^6 + 3*x^3 + 63, [3, [1, []],
        ["[III{9}] page 184", [3, 3]]]]
 ? [N, FaN, T, V] = genus2red(x^3-x^2-1, x^2-x);  \\ X_1(13), global reduction
 p = 13
 (potential) stable reduction: [5, [Mod(0, 13), Mod(0, 13)]]
 reduction at p: [I{0}-II-0] page 159, [], f = 2
 ? N
 %3 = 169
 ? FaN
 %4 = Mat([13, 2])   \\ in particular, good reduction at 2 !
 ? T
 %5 = x^6 + 58*x^5 + 1401*x^4 + 18038*x^3 + 130546*x^2 + 503516*x + 808561
 ? V
 %6 = [[13, [5, [Mod(0, 13), Mod(0, 13)]], ["[I{0}-II-0] page 159", []]]]
 @eprog\noindent
 We now first describe the format of the vector $V = V_p$ in the case where
 $p$ was specified (local reduction at~$p$): it is a triple $[p, \var{stable},
 \var{red}]$. The component $\var{stable} = [\var{type}, \var{vecj}]$ contains
 information about the stable reduction after a field extension;
 depending on \var{type}s, the stable reduction is

 \item 1: smooth (i.e. the curve has potentially good reduction). The
       Jacobian $J(C)$ has potentially good reduction.

 \item 2: an elliptic curve $E$ with an ordinary double point; \var{vecj}
 contains $j$ mod $p$, the modular invariant of $E$. The (potential)
 semi-abelian reduction of $J(C)$ is the extension of an elliptic curve (with
 modular invariant $j$ mod $p$) by a torus.

 \item 3: a projective line with two ordinary double points. The Jacobian
 $J(C)$ has potentially multiplicative reduction.

 \item 4: the union of two projective lines crossing transversally at three
 points. The Jacobian $J(C)$ has potentially multiplicative reduction.

 \item 5: the union of two elliptic curves $E_1$ and $E_2$ intersecting
 transversally at one point; \var{vecj} contains their modular invariants
 $j_1$ and $j_2$, which may live in a quadratic extension of $\F_p$ are need
 not be distinct. The Jacobian $J(C)$ has potentially good reduction,
 isomorphic to the product of the reductions of $E_1$ and $E_2$.

 \item 6: the union of an elliptic curve $E$ and a projective line which has
 an ordinary double point, and these two components intersect transversally
 at one point; \var{vecj} contains $j$ mod $p$, the modular invariant of $E$.
 The (potential) semi-abelian reduction of $J(C)$ is the extension of an
 elliptic curve (with modular invariant $j$ mod $p$) by a torus.

 \item 7: as in type 6, but the two components are both singular. The
 Jacobian $J(C)$ has potentially multiplicative reduction.

 The component $\var{red} = [\var{NUtype}, \var{neron}]$ contains two data
 concerning the reduction at $p$ without any ramified field extension.

 The \var{NUtype} is a \typ{STR} describing the reduction at $p$ of $C$,
 following Namikawa-Ueno, \emph{The complete classification of fibers in
 pencils of curves of genus two}, Manuscripta Math., vol. 9, (1973), pages
 143-186. The reduction symbol is followed by the corresponding page number in
 this article.

 The second datum \var{neron} is the group of connected components (over an
 algebraic closure of $\F_p$) of the N\'eron model of $J(C)$, given as a
 finite abelian group (vector of elementary divisors).
 \smallskip
 If $p = 2$, the \var{red} component may be omitted altogether (and
 replaced by \kbd{[]}, in the case where the program could not compute it.
 When $p$ was not specified, $V$ is the vector of all $V_p$, for all
 considered $p$.

 \misctitle{Notes about Namikawa-Ueno types}

 \item A lower index is denoted between braces: for instance, \kbd{[I\obr
  2\cbr-II-5]} means \kbd{[I\_2-II-5]}.

 \item If $K$ and $K'$ are Kodaira symbols for singular fibers of elliptic
 curves, \kbd{[$K$-$K'$-m]} and \kbd{[$K'$-$K$-m]} are the same.

 \item \kbd{[$K$-$K'$-$-1$]}  is \kbd{[$K'$-$K$-$\alpha$]} in the notation of
 Namikawa-Ueno.

 \item The figure \kbd{[2I\_0-m]} in Namikawa-Ueno, page 159, must be denoted
 by \kbd{[2I\_0-(m+1)]}.
