/*
This is the file of the computation for n = 4. I apply Flynn and Wetherell's idea and elliptic curve Chabauty to compute the points.
It is enough to work only for the elliptic curve E1 : y^2 = x^3 + 48. It holds E1(Q) = Z with generator given by (1,7)
*/
_ := PolynomialRing(Rationals());
K := NumberField(x^3 + 48);
P := ProjectiveSpace(Rationals(),1);
/* Elliptic curve Chabauty for E1*/
E1 := EllipticCurve([0,a,0,a^2,0]);
u1 := mapP | [X1,Z1]>;
s1, G1, G1toE1 := PseudoMordellWeilGroup(E1);
if not s1 then
print "Problem with the determination of the Mordell-Weil group of E1";
end if;
V1,R1 := Chabauty(G1toE1,u1);
/* Elliptic urve Chabauty for E2*/
E2 := EllipticCurve([0,(1-a)*a,0,(1-a)^2*a^2,0]);
u2 := map P | [X2/(1-a),Z2]>;
s2, G2, G2toE2 := PseudoMordellWeilGroup(E2);
if not s2 then
print "Problem with the determinanation of Mordell-Weil group of E2";
end if;
V2,R2 := Chabauty(G2toE2,u2);