// degree-15.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_15: A generator of k over QQ
//	K	: A rational function field over k
//	t	: A generator of K over k
//	sigma	: An automorphism of K extending complex conjugation on k
//     	f_15	: A univariate polynomial over K 
//	g_15	: A univariate polynomial over K
//	A_15	: A bivariate polynomial over K
//	B_15	: A bivariate polynomial over K
//	M_14	: A 14x14 matrix over K
//
// The file concludes with an assertion: 
//	f_15(x_1) - g_15(x_2) = A_15(x_1,x_2)B_15(x_1,x_2).
// 
//
// Briefly, the correspondence V(y_1 - y_2, A_15(x_1,x_2))
// induces an isogeny between the Jacobians of the curves
//     X: P_d(y_1) = f_15(x_1)   and   Y: P_d(y_2) = g_15(x_2) 
// where P_d is the generic monic polynomial of degree d.
//
// The isogeny splits multiplication-by-4 .
//
// 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 + 15y <= 15d }.
//
// 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_14.
//
// We note that f_15 = 15g, where g is the polynomial defined in \S5.4 
// 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_15 and g_15
//	FACTORS		: Section defining A_15 and B_15
//	MATRIX		: Section defining M_14
//	ASSERTIONS	: Section containing assertions

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

k := ext< RationalField( ) | Polynomial([4,-1,1]) > ;
alpha_15 := k.1;
K := FunctionField(k);
t := K.1;

sigma := hom< K -> K | hom< k -> K | Norm(alpha_15)/alpha_15 >, t > ;

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

f_15 := Polynomial([
	15*675*(- 8 + alpha_15)*(- 16 + t)*t^6,
	- 15*135/16*(7*alpha_15 + 5)*(4*t - 100 - 75*alpha_15)*(5*alpha_15 - 4 + 4*t)*t^5,
	15*9/2554*(403*alpha_15 -  1559)*(5108*t -  39620 + 9165*alpha_15)*t^5,
	15*9/16816*(- 133 + 9*alpha_15)*(50448*t^2 -  1260960*t -  162040*t*alpha_15 + 23500 -  320375*alpha_15)*t^4,
	15*3/877444*(3233*alpha_15 + 2051)*(877444*t -  2162500 + 1339725*alpha_15)*t^4,
	15*3/36391540*(- 1581 + 1945*alpha_15)*(7278308*t + 14685825*alpha_15- 113700500)*t^4,
	- 15*4/259891*(548*alpha_15 - 1939)*(259891*t +106365*alpha_15 - 26420)*t^3,
	15*3/76579*(239+46*alpha_15)*(76579*t - 462560 + 198260*alpha_15)*t^3,
	- 15*(649*alpha_15 + 703)*t^3,
	- 15*1/454794*(- 349 + 261*alpha_15 )*(151598*t -  109260 + 141075*alpha_15)*t^2,
	15*2*(37*alpha_15 -  71)*t^2,
	- 15*(5*alpha_15 + 21)*t^2,
	15*(alpha_15 + 7)*t,
	15*(- 1 + alpha_15)*t,
	0,
	1
]);

g_15 := - Polynomial([sigma(c): c in Coefficients(f_15)]);
// Note the minus sign in the definition of g_15 !


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

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

A_15 := x_1^7 + (1-alpha_15)*x_1^6*x_2 - 2*x_1^5*x_2^2 + (alpha_15+1)*x_1^4*x_2^3 
	+ (-alpha_15 + 2)*x_1^3*x_2^4 
	- 2*x_1^2*x_2^5 
	+ alpha_15*x_1*x_2^6 
	+ x_2^7 
	+ t*( 
		(7*alpha_15-3)*x_1^5 
		+ 22*x_1^4*x_2 
		- (10*alpha_15 + 2)*x_1^3*x_2^2 
		+ (-12 + 10*alpha_15)*x_1^2*x_2^3 
		+ 22*x_1*x_2^4 
		+ (-7*alpha_15+4)*x_2^5 
		+ (5*alpha_15+65)*x_1^4
		+ (-50*alpha_15 + 70)*x_1^3*x_2 
		- 90*x_1^2*x_2^2 
		+ (50*alpha_15 + 20)*x_1*x_2^3 
		+ (-5*alpha_15+70)*x_2^4 
	)
	+ t^2*( 
		(-69 + 9*alpha_15)*x_1^3 
		+ (39*alpha_15 + 33)*x_1^2*x_2 
		+ (72 - 39*alpha_15)*x_1*x_2^2 
		+ (-60-9*alpha_15)*x_2^3 
		+ (210*alpha_15 - 150)*x_1^2 
		+ 450*x_1*x_2 
		+ (60 - 210*alpha_15)*x_2^2 
		+ (-45*t - 63*alpha_15*t + 900 + 225*alpha_15)*x_1
		+ (-108*t + 63*alpha_15*t + 1125 - 225*alpha_15)*x_2 
		- 675*t
	)
;

B_15 := x_1^8 + (alpha_15 - 1)*x_1^7*x_2 + (-alpha_15 - 1)*x_1^6*x_2^2 + (8*alpha_15 - 12)*t*x_1^6 + 2*x_1^5*x_2^3 + (-9*alpha_15 - 17)*t*x_1^5*x_2 + (10*alpha_15 + 40)*t*x_1^5 + -1*x_1^4*x_2^4 + (-2*alpha_15 + 22)*t*x_1^4*x_2^2 + (25*alpha_15 - 65)*t*x_1^4*x_2 + (-32*alpha_15 - 58)*t^2*x_1^4 + 2*x_1^3*x_2^5 + -6*t*x_1^3*x_2^3 + (-40*alpha_15 + 50)*t*x_1^3*x_2^2 + (-49*alpha_15 + 81)*t^2*x_1^3*x_2 + (80*alpha_15 - 640)*t^2*x_1^3 + (alpha_15 - 2)*x_1^2*x_2^6 + (2*alpha_15 + 20)*t*x_1^2*x_2^4 + (40*alpha_15 + 10)*t*x_1^2*x_2^3 + 51*t^2*x_1^2*x_2^2 + (-400*alpha_15 + 350)*t^2*x_1^2*x_2 + ((-120*alpha_15 + 180)*t^3 + (225*alpha_15 + 300)*t^2)*x_1^2 + -alpha_15*x_1*x_2^7 + (9*alpha_15 - 26)*t*x_1*x_2^5 + (-25*alpha_15 - 40)*t*x_1*x_2^4 + (49*alpha_15 + 32)*t^2*x_1*x_2^3 + (400*alpha_15 - 50)*t^2*x_1*x_2^2 + (405*t^3 - 600*t^2)*x_1*x_2 + (-765*alpha_15 + 1620)*t^3*x_1 + x_2^8 + (-8*alpha_15 - 4)*t*x_2^6 + (-10*alpha_15 + 50)*t*x_2^5 + (32*alpha_15 - 90)*t^2*x_2^4 + (-80*alpha_15 - 560)*t^2*x_2^3 + ((120*alpha_15 + 60)*t^3 + (-225*alpha_15 + 525)*t^2)*x_2^2 + (765*alpha_15 + 855)*t^3*x_2 + 225*t^4 - 3600*t^3
;

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

M_14 := Matrix(
[
  [
    alpha_15 - 1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    0,
    -alpha_15 + 1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    (9*alpha_15 + 9)*t,
    0,
    -2,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    (-60*alpha_15 + 60)*t,
    (-4*alpha_15 - 28)*t,
    0,
    -alpha_15 + 1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    (-15*alpha_15 + 135)*t^2,
    (25*alpha_15 + 25)*t,
    -10*t,
    0,
    2,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    (-720*alpha_15 - 1620)*t^2,
    (129*alpha_15 - 303)*t^2,
    180*t,
    (-18*alpha_15 - 18)*t,
    0,
    2,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    (-294*alpha_15 + 861)*t^3 + (2100*alpha_15 - 4200)*t^2,
    (245*alpha_15 + 1505)*t^2,
    (119*alpha_15 - 168)*t^2,
    -105*t,
    (-7*alpha_15 - 14)*t,
    0,
    -alpha_15,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    (10200*alpha_15 - 25560)*t^3,
    (1840*alpha_15 + 496)*t^3 + (-2100*alpha_15 - 2700)*t^2,
    (-640*alpha_15 - 160)*t^2,
    (156*alpha_15 - 636)*t^2,
    (-80*alpha_15 - 80)*t,
    (-16*alpha_15 - 16)*t,
    0,
    -alpha_15 + 1,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  [
    (-5427*alpha_15 + 2943)*t^4 + (58050*alpha_15 + 102600)*t^3,
    (-13050*alpha_15 + 32310)*t^3,
    (468*alpha_15 + 2124)*t^3 - 12150*t^2,
    (2295*alpha_15 - 135)*t^2,
    (126*alpha_15 + 90)*t^2,
    -270*t,
    (18*alpha_15 - 36)*t,
    0,
    -2,
    0,
    0,
    0,
    0,
    0
  ],
  [
    (106800*alpha_15 + 23400)*t^4 + (-45000*alpha_15 + 180000)*t^3,
    (215*alpha_15 + 34025)*t^4 + (4500*alpha_15 - 82500)*t^3,
    (-5200*alpha_15 + 8600)*t^3,
    (2670*alpha_15 + 330)*t^3 + (3375*alpha_15 + 375)*t^2,
    (1500*alpha_15 - 600)*t^2,
    (160*alpha_15 - 210)*t^2,
    (100*alpha_15 - 200)*t,
    (10*alpha_15 - 30)*t,
    0,
    -2,
    0,
    0,
    0,
    0
  ],
  [
    (-23397*alpha_15 - 76527)*t^5 + (-1148400*alpha_15 + 2851200)*t^4,
    (-285890*alpha_15 - 87890)*t^4 + (140250*alpha_15 + 66000)*t^3,
    (-11946*alpha_15 + 9218)*t^4 + (138600*alpha_15 - 1650)*t^3,
    (-9900*alpha_15 + 107085)*t^3,
    (-2387*alpha_15 + 6050)*t^3 + (4950*alpha_15 - 3300)*t^2,
    (4620*alpha_15 - 2310)*t^2,
    (363*alpha_15 + 660)*t^2,
    -165*t,
    (33*alpha_15 - 66)*t,
    0,
    -alpha_15,
    0,
    0,
    0
  ],
  [
    (377100*alpha_15 + 1412100)*t^5 + (-3753000*alpha_15 - 4644000)*t^4,
    (-122052*alpha_15 + 187044)*t^5 + (820800*alpha_15 - 1908900)*t^4,
    (-77400*alpha_15 - 204480)*t^4 + 729000*t^3,
    (-63*alpha_15 + 39249)*t^4 + (-137700*alpha_15 + 81900)*t^3,
    (-8160*alpha_15 + 16680)*t^3,
    (456*alpha_15 + 3456)*t^3 + 24300*t^2,
    (-840*alpha_15 + 2400)*t^2,
    (246*alpha_15 + 6)*t^2,
    360*t,
    -24*t,
    0,
    2,
    0,
    0
  ],
  [
    (276861*alpha_15 - 824889)*t^6 + (-17472975*alpha_15 - 11789700)*t^5 + (292500*alpha_15 - 5850000)*t^4,
    (185900*alpha_15 - 7948525)*t^5 + (-672750*alpha_15 + 5265000)*t^4,
    (-8983*alpha_15 - 297570)*t^5 + (43875*alpha_15 + 2954250)*t^4,
    (-793455*alpha_15 + 435435)*t^4 + (-253500*alpha_15 + 229125)*t^3,
    (-54847*alpha_15 - 28028)*t^4 + (-38025*alpha_15 + 39000)*t^3,
    (18850*alpha_15 + 133120)*t^3,
    (-6110*alpha_15 + 21736)*t^3 + (-6825*alpha_15 + 15600)*t^2,
    (1495*alpha_15 - 3575)*t^2,
    (988*alpha_15 + 598)*t^2,
    (-65*alpha_15 + 130)*t,
    (13*alpha_15 - 104)*t,
    0,
    -alpha_15,
    0
  ],
  [
    (-3786090*alpha_15 + 18886140)*t^6 + (87444000*alpha_15 - 238392000)*t^5,
    (-935606*alpha_15 - 602987)*t^6 + (25179000*alpha_15 + 9544500)*t^5 + (-6772500*alpha_15 + 1890000)*t^4,
    (1640450*alpha_15 - 1680700)*t^5 + (-14511000*alpha_15 + 4137000)*t^4,
    (-163590*alpha_15 + 212268)*t^5 + (571725*alpha_15 - 10472175)*t^4,
    (292180*alpha_15 - 558320)*t^4 + (-105000*alpha_15 + 525000)*t^3,
    (-14623*alpha_15 + 52976)*t^4 + (-581700*alpha_15 + 495600)*t^3,
    (-35700*alpha_15 - 136080)*t^3,
    (4018*alpha_15 + 1834)*t^3 + (8400*alpha_15 + 13125)*t^2,
    (-7770*alpha_15 + 13440)*t^2,
    (-63*alpha_15 - 1134)*t^2,
    210*alpha_15*t,
    (-42*alpha_15 + 84)*t,
    0,
    alpha_15
  ]
]
);

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

assert ( Evaluate(f_15,x_1) - Evaluate(g_15,x_2)) eq A_15*B_15 ;
sigmaM_14 := Matrix(14,14,[sigma(M_14[i][j]): i, j in [1..14]]);
assert M_14*sigmaM_14 eq 4*IdentityMatrix(K,14);

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