// degree-11.m /////////////////////////////////////////////////////////////////
// 
// Benjamin Smith
// INRIA Saclay -- Île-de-France 2009
// 
// Contact: smith@lix.polytechnique.fr
//
// File last updated 15 June 2010
//
// This file is distributed with the article
// "Families of explicitly isogenous Jacobians of variable-separated curves"
//
// This file is an executable Magma program: see
//	http://magma.maths.usyd.edu.au/
// It contains a series of definitions, followed by a series of assertions
// to verify the correctness of the definitions.
// If the assertions are correct, then no output is produced.
// If the assertions no not hold, then executing this file will produce a
// runtime error.
// 
// We define:
//     	k        : The base field (a quadratic imaginary field)
//	alpha_11 : A generator of k over QQ
//	sigma    : The automorphism of k corresponding to complex conjugation
//     	f_11     : A univariate polynomial over k 
//	g_11     : A univariate polynomial over k
//	A_11     : A bivariate polynomial over k
//	B_11     : A bivariate polynomial over k
//	M_10	 : A 10x10 matrix over k
//
// The file concludes with an assertion: 
//	f_11(x_1) - g_11(x_2) = A_11(x_1,x_2)B_11(x_1,x_2).
// 
// Briefly, the correspondence V(y_1 - y_2, A_11(x_1,x_2))
// induces an isogeny between the Jacobians of the curves
//     X: P_d(y_1) = f_11(x_1)   and   Y: P_d(y_2) = g_11(x_2) 
// where P_d is the generic monic polynomial of degree d.
//
// The isogeny splits multiplication-by-3 .
//
// The regular differentials on X (resp. Y) 
// have bases of the form 
//      w_{i,j} = y_1^{i-1}d(x_1^j)/P_d'(y_1)   (on X)
// and
//      w_{i,j}' = y_2^{i-1}d(x_2^j)/P_d'(y_2)  (on Y),
// where (i,j) ranges over the interior integer points of the Newton polygon
// of X and Y, which is { (x,y) in RR^2 : x >= 0, y >= 0, dx + 11y <= 11d }.
//
// The homomorphism of regular differentials induced by the isogeny
// is given by the diagonal block matrix \oplus_i M_j ,
// where M_j is the upper-left jxj submatrix of M_10.
//
// We note that f_11 = 11g, where g is the polynomial defined in \S5.2 
// of Cassou-Nogues and Couveignes, "Factorisations explicites de g(y)-h(z)".

// To navigate through this file, use the following tags:
//	BASEFIELD	: Section defining base field and sigma
//	POLYNOMIALS	: Section defining f_11
//	FACTORS		: Section defining A_11 and B_11
//	MATRIX		: Section defining M_10
//	ASSERTIONS	: Section containing assertions

// Section BASEFIELD ///////////////////////////////////////////////////////////

k := ext<RationalField( )|Polynomial([3,1,1])>;
alpha_11 := k.1;

sigma := hom< k -> k | Norm(alpha_11)/alpha_11 > ;


// Section POLYNOMIALS /////////////////////////////////////////////////////////

f_11 := Polynomial([
  198*alpha_11,
  -264*alpha_11 - 1551,
  -1100*alpha_11 + 220,
  693*alpha_11 + 693,
  -330*alpha_11 - 1320,
  -231*alpha_11 + 165,
  176*alpha_11,
  -33*alpha_11 - 132,
  22,
  11*alpha_11,
  0,
  1
]);

g_11 := Polynomial([sigma(c): c in Coefficients(f_11)]);


// Section FACTORS /////////////////////////////////////////////////////////////

R := PolynomialRing(k,2);
x_1 := R.1;
x_2 := R.2;

A_11 := x_1^5 - alpha_11*x_1^4*x_2 - x_1^3*x_2^2 + (4*alpha_11 + 2)*x_1^3 
	+ x_1^2*x_2^3 + (alpha_11 + 6)*x_1^2*x_2 + (-2*alpha_11 + 10)*x_1^2 
	+ (-alpha_11 - 1)*x_1*x_2^4 + (alpha_11 - 5)*x_1*x_2^2 
	+ (-12*alpha_11 - 6)*x_1*x_2 + (8*alpha_11 - 7)*x_1 - x_2^5 
	+ (4*alpha_11 + 2)*x_2^3 + (-2*alpha_11 - 12)*x_2^2 
	+ (8*alpha_11 + 15)*x_2 + 12*alpha_11 + 6
;

B_11 :=	x_1^6 + alpha_11*x_1^5*x_2 + (-alpha_11 - 2)*x_1^4*x_2^2 
	+ (7*alpha_11 - 2)*x_1^4 + 2*x_1^3*x_2^3 + (-8*alpha_11 - 15)*x_1^3*x_2 
	+ (2*alpha_11 + 12)*x_1^3 + (alpha_11 - 1)*x_1^2*x_2^4 + 22*x_1^2*x_2^2 
	+ (10*alpha_11 - 6)*x_1^2*x_2 + (-19*alpha_11 - 37)*x_1^2 
	+ (-alpha_11 - 1)*x_1*x_2^5 + (8*alpha_11 - 7)*x_1*x_2^3 
	+ (-10*alpha_11 - 16)*x_1*x_2^2 + 33*x_1*x_2 + (32*alpha_11 - 28)*x_1 
	+ x_2^6 + (-7*alpha_11 - 9)*x_2^4 + (-2*alpha_11 + 10)*x_2^3 
	+ (19*alpha_11 - 18)*x_2^2 + (-32*alpha_11 - 60)*x_2 + 33
;

// Section MATRIX //////////////////////////////////////////////////////////////

M_10 := Matrix(
[
  [
    alpha_11,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    0,
    -alpha_11 - 1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    3*alpha_11 + 18,
    0,
    alpha_11,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    0,
    0,
    0,
    alpha_11,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    -75*alpha_11 + 45,
    20*alpha_11 + 10,
    5*alpha_11 + 30,
    0,
    alpha_11,
    0,
    0,
    0,
    0,
    0
  ],
  [
    36*alpha_11 - 180,
    -3*alpha_11 + 15,
    -24*alpha_11 - 12,
    12*alpha_11 + 6,
    0,
    -alpha_11 - 1,
    0,
    0,
    0,
    0
  ],
  [
    -693*alpha_11 - 924,
    126*alpha_11 + 140,
    -105*alpha_11 + 140,
    -28*alpha_11 - 14,
    14*alpha_11 + 7,
    0,
    -alpha_11 - 1,
    0,
    0,
    0
  ],
  [
    2112*alpha_11 + 1056,
    -528*alpha_11 + 88,
    -16*alpha_11 - 976,
    144*alpha_11 + 336,
    -32*alpha_11 - 16,
    8*alpha_11 - 40,
    0,
    -alpha_11 - 1,
    0,
    0
  ],
  [
    -891*alpha_11 - 8613,
    396*alpha_11 + 2376,
    -1023*alpha_11 - 1089,
    -234*alpha_11 - 216,
    45*alpha_11 + 270,
    36*alpha_11 + 18,
    0,
    0,
    alpha_11,
    0
  ],
  [
    10560*alpha_11 + 41580,
    -6765*alpha_11 - 10340,
    7260*alpha_11,
    -770*alpha_11 + 4070,
    -160*alpha_11 - 960,
    455*alpha_11 + 365,
    0,
    10*alpha_11 - 50,
    0,
    -alpha_11 - 1
  ]
]
);

// Section ASSERTIONS //////////////////////////////////////////////////////////

assert (Evaluate(f_11,x_1) - Evaluate(g_11,x_2)) eq A_11*B_11;
sigmaM_10 := Matrix(10,10,[sigma(M_10[i][j]): i, j in [1..10]]);
assert M_10*sigmaM_10 eq 3*IdentityMatrix(k,10);

// End of File degree-11.m /////////////////////////////////////////////////////
