# Extended Examples

## `Example: ellfunfld1 (ex-4e11bd)`

In this example we construct an elliptic curve by using a pencil of cubic curves passing through 8 given points. The 8 points are defined over $GF(1831^8)$ and form a Galois orbit over $GF(1831)$.

```magma
> p := 1831;
> F := GF(p);
> Fe<u> := ext<F | 8>;
> K<t> := FunctionField(F);
> P2<X,Y,Z> := ProjectivePlane(K);
> // define the 8 points:
> points := [ [ u^(p^i), (u^3+u+1)^(p^i) ] : i in [0..7] ];
> M := [ [ p[1]^i*p[2]^j : i in [0..3-j], j in [0..3] ] : p in points ];
> // find the coefficients of 2 cubics that pass through the points:
> B := Basis(Kernel(Transpose(Matrix(M))));
> R<x,y> := PolynomialRing(F, 2);
> mono_aff := [ x^i*y^j : i in [0..3-j], j in [0..3] ];
> // f1 and f2 are the cubics:
> f1 := &+[ (F!B[1][i])*mono_aff[i] : i in [1..10] ];
> f2 := &+[ (F!B[2][i])*mono_aff[i] : i in [1..10] ];
> // Find the 9th intersection point, which we use as zero, to put
> // it to a nice Weierstrass model :
> P9 := Points(Scheme(Spec(R), [f1, f2]))[1];
> F1 := Homogenization(Evaluate(f1, [X, Y]), Z);
> F2 := Homogenization(Evaluate(f2, [X, Y]), Z);
> C := Curve(P2, F1 + t*F2);
> E := MinimalDegreeModel(EllipticCurve(C, C![P9[1], P9[2]]));

```

We could transfer the 8 points to this Weierstrass model, and use them to determine the Mordell–Weil group. Instead, we will see what Magma is able to compute just from the Weierstrass model.

```magma
> KodairaSymbols(E);
[ <I1, 1>, <I1, 7>, <II, 1>, <I1, 2> ]

```

All fibres are irreducible. According to the theory of rational elliptic surfaces, the geometric Mordell–Weil lattice should then be isomorphic to the root lattice $E_8$. We can check this. We also compute the Mordell–Weil lattice over the ground field.

```magma
> Lgeom := GeometricMordellWeilLattice(E);
> IsIsomorphic(Lgeom, Lattice("E", 8));
true
[-1  0 -2  1  1 -1  0 -1]
[ 0  0  0  1  0  0 -1  1]
[ 2  0  2 -2 -1  1  1  0]
[-2  0 -1  0  1  0  0 -1]
[ 1  0  0  1 -1 -1 -1  1]
[-1  0  0  0  1  0  1 -1]
[ 2 -1  2 -3 -1  1  1  1]
[ 1 -1  1 -1  0  0  0  0]
> L, f := MordellWeilLattice(E);
> L;
Standard Lattice of rank 1 and degree 1
Inner Product Matrix:
[8]
> f(L.1);
((1057*t^8 + 384*t^7 + 351*t^6 + 728*t^5 + 872*t^4 + 948*t^3 + 1473*t^2 + 257*t
    + 1333)/(t^6 + 100*t^5 + 1565*t^4 + 1145*t^3 + 927*t^2 + 1302*t + 1197) :
    (1202*t^12 + 1506*t^11 + 1718*t^10 + 1365*t^9 + 656*t^8 + 325*t^7
    + 1173*t^6    + 902*t^5 + 1555*t^4 + 978*t^3 + 616*t^2 + 779*t +
    964)/(t^9 + 150*t^8 + 1520*t^7 + 747*t^6 + 1065*t^5 + 340*t^4 +
    1618*t^3 + 1669*t^2 + 1150*t + 1768) : 1)

```

That the rank equals 1 is not surprising; this point corresponds to the ${\mathbb{F}}_{1831}$-rational degree 8 divisor consisting of the sum of the 8 points we started with.

To determine the $L$-function of $E$ one would normally have to count points over various extension fields of ${\mathbb{F}}_{1831}$, in this case up to ${\mathbb{F}}_{1831^4}$. This would be costly using current techniques. But since Magma is able to determine the geometric Mordell–Weil lattice, it can compute the $L$-function by simply considering the Galois action on points. Magma automatically uses this when asked for the $L$-function:

```magma
> LFunction(E);
-126330075128099803866555841*T^8 + 1

```

## `Example: Reductionmodp (ex-198933)`

In this example we determine the ${\mathbb{C}}(t)$-rank of an elliptic curve, following [[Kloosterman, 2007](../../references.md#cite-kloosterman)].

```magma
> K<t> := FunctionField(Rationals());
> E := EllipticCurve([-(2*t-1)^3*(4*t-1)^2, t*(2*t-1)^3*(4*t-1)^3]);

```

To determine where the surface has bad reduction we determine the primes at which singular fibres collapse.

```magma
> &*BadPlaces(E);
(t^5 - 99/32*t^4 + 337/128*t^3 - 251/256*t^2 + 3/16*t - 1/64)/t
> Discriminant(Numerator($1));
-87887055375/4503599627370496
> Factorisation(Numerator($1));
[ <3, 15>, <5, 3>, <7, 2> ]
> Factorisation(Denominator($2));
[ <2, 52> ]

```

So 11 and 13 are the smallest primes of good reduction. We remark that in [[Kloosterman, 2007](../../references.md#cite-kloosterman)] the primes 17 and 19 were used.

```magma
> K11<t11> := FunctionField(GF(11));
> E11 := ChangeRing(E,K11);  // Reduce E mod 11
> LFunction(E11);
161051*T^5 - 7986*T^4 - 363*T^3 - 33*T^2 - 6*T + 1
> AnalyticInformation(E11);
<0, 1, 1>
> AnalyticInformation(E11, 2);
<1, 1, 35/2>

```

So modulo 11 the rank is 0, but over ${\mathbb{F}}_{11^2}(t)$ the rank equals the geometric rank of 1, and the height of a generator is congruent to ${35 \over 2}$ modulo ${\mathbb{Q}}^2$. From this it can be concluded that the geometric rank in characteristic 0 is at most 1. As the $L$-function has odd degree 5 for any $p$ of good reduction, it will always have a zero at $1/p$ or $-1/p$ and consequently the geometric rank modulo $p$ will always be at least 1. To determine what the geometric rank is in characteristic zero, one can combine information at 2 different primes.

```magma
> K13<t13> := FunctionField(GF(13));
> E13 := ChangeRing(E, K13);  // Redude E mod 13
> AnalyticInformation(E13);
<0, 1, 1>
> AnalyticInformation(E13,2);
<1, 1, 121/2>

```

So over ${\mathbb{F}}_{13^2}(t)$ the rank equals the geometric rank of 1. The height of a generator is congruent to ${121 \over 2}$ modulo ${\mathbb{Q}}^2$. As the quotient of the heights of generators in characteristics 11 and 13 is not a square in ${\mathbb{Q}}$, there cannot exist a Mordell–Weil group in characteristic zero that both modulo 11 and 13 reduces to a finite index subgroup of the Mordell–Weil group modulo $p$. Hence one can conclude that the geometric Mordell–Weil rank in characteristic zero is zero.

## `Example: L Functionbyhand (ex-98b1c7)`

In this example we calculate part of the $L$-function of an elliptic curve for which it is not feasible to compute the $L$-function completely. The simplest way to compute an $L$-function is to call `LFunction`, which counts points on the surface over certain constant field extensions. However, if the required extension fields are too big then `LFunction` will not terminate. One can determine the required extension degrees as follows.

```magma
> K<t> := FunctionField(GF(5));
> E := EllipticCurve([t^9+t^2, t^14+t^4+t^3]);
> h2 := BettiNumber(E, 2);
> N := FrobeniusActionOnTrivialLattice(E);
> [h2, h2 - NumberOfRows(N)];
[ 34, 21 ]

```

So the $H^2$ has dimension 34, of which a 13-dimensional piece is generated by the trivial lattice and a 21-dimensional piece is unknown. To determine the $L$-function one would have to at least count points over ${\mathbb{F}}_{5^{10}}$. As this is not feasible we will instead count points over extension degrees up to 5 and print the first few coefficients of the $L$-function.

```magma
> nop := NumbersOfPointsOnSurface(E, 5);
> traces := [ nop[i] - 1 - 25^i - 5^i*Trace(N^i) : i in [1..5] ];
> CharacteristicPolynomialFromTraces(traces);
5750*T^5 + 875*T^4 - 40*T^3 - 40*T^2 + 1

```
