# Creation of Class Fields

Since the beginning of class field theory one of the core problems has been to find defining equations for the fields. Although most of the original proofs are essentially constructive, they rely on complicated and involved computations and thus were not suited for hand computations.

The method used here to compute defining equations is essentially the same as the one used for number fields. The main differences are due to the problem of $p$-extensions in characteristic $p$ where Artin-Schreier-Witt theory is used, and the fact that the divisor class group is infinite.

## `AbelianExtension(D, U): DivFunElt, GrpAb -> FldFunAb`

Given an effective divisor $D$ and a subgroup $U$ of the ray class group, (see [`RayClassGroup`](class-groups.md#function-fldfunab-rayclassgroup)), ${\operatorname{Cl}}_D$ of $D$ such that the quotient ${\operatorname{Cl}}_D/U$ is finite, create the extension defined by this data. Note that, at this point, no defining equations are computed.

## `MaximalAbelianSubfield(K): FldFunG -> FldFunAb`

For a relative extension $K/k$ of global function fields, compute the maximal abelian subfield $K/A/k$ of $K/k$ as an abelian extension of $k$. In particular, this function compute the norm group of $K/k$ as a subgroup of a suitable ray class group.

## `HilbertClassField(K, p): FldFun, PlcFunElt -> FldFunAb`

For a global function field $K$ and a place $p$ of $K$, compute the (a) Hilbert class field of $K$ as an abelian extension of $K$. This field is characterised by being the maximal abelian unramified extension of $K$ where $p$ is totally split.

## `FunctionField(A): FldFunAb -> FldFun`

```magma
WithAut: BoolElt                       Default: false
verbose: ClassField                    Default: Verbose : 3
```

Given an abelian extension of function fields as created by [`AbelianExtension`](#function-fldfunab-abelianextension), compute defining equations for the corresponding (ray) class field.

More precisely: Let ${\operatorname{Cl}}/U = \prod {\operatorname{Cl}}/U_i$ be a decomposition of the norm group of $A$ such that the ${\operatorname{Cl}}/U_i$ are cyclic of prime power order. Then for each $U_i$ the function will compute a defining equation, thus $A$ is represented by the compositum.

If `WithAut` is `true`, the second sequence returned contains a generating automorphism for each of the fields returned as the first return value. If `WithAut` is `false`, the first (and only) return value is a function field in non-simple representation.

## `MaximalOrderFinite(A): FldFunAb -> RngFunOrd`

## `MaximalOrderInfinite(A): FldFunAb -> RngFunOrd`

Compute a finite or an infinite maximal order of the function field of the abelian extension $A$.

This computes the maximal orders of each function field defined by each of the defining polynomials of the function field of $A$ then combines them and finishes off the computation by using the algorithm of [[Buchmann and Lenstra jr, 1994](../../references.md#cite-buchman-lenstra)] on the result. As the cyclic components are essentially Kummer, Artin–Schreier or Artin–Schreier—Witt extensions the algorithms in [[Sutherland, 2012](../../references.md#cite-suth-max-kummer), [Sutherland, 2013](../../references.md#cite-suth-artin)] and [[Sutherland, 2016](../../references.md#cite-suth-asw)] are used to compute the maximal orders of the component function fields.

## `Example: classfields (ex-df5eee)`

First we have to create a function field, a divisor and a ray class group:

```magma
> k<w> := GF(4);
> kt<t> := PolynomialRing(k);
> ktx<x> := PolynomialRing(kt);
> K := FunctionField(x^3-w*t*x^2+x+t);
> lp := Places(K, 2);
> D := 4*lp[2]+2*lp[6];
> R, mR := RayClassGroup(D);

```

Let us compute the maximal extension of exponent $5$ such that the infinite place is totally split. This means that we

- have to create a subgroup of $R$ containing the image of the infinite place

- compute the fifth power of $R$

- combine the two groups

and use this as input to the class field computation:

```magma
> inf := InfinitePlaces(K);
> U1 := sub<R | [x@@ mR : x in inf]>;
> U2 := sub<R | [5*R.i : i in [1..Ngens(R)]]>;
> U3 := sub<R | U1, U2>;
> A := AbelianExtension(D, U3);
> A;
Abelian extension of type [ 5 ]
Defined modulo 4*(t^2 + t + w, $.1 + w^2*t + 1) +
2*(t^2 + w^2*t + w^2, $.1 + w*t + w)
over Algebraic function field defined over
Univariate rational function field over GF(2^2) by
x^3 + w*t*x^2 + x + t
> FunctionField(A);
Algebraic function field defined over K by
$.1^5 + (w*K.1^2 + (w*t + w^2)*K.1 + (w^2*t^2 + t
    + w^2))*$.1^3 + ((t^2 + 1)*K.1^2 + w*t*K.1 +
    (w*t^4 + w))*$.1 + (t^3 + w*t^2 + w^2*t)*K.1^2
    + (w*t^4 + w^2*t^2 + w^2)*K.1 + t^4 + w^2*t^3
    + w^2*t + w
> E := $1;
> #InfinitePlaces(E);
10

```

Which shows that all the places in `inf` split completely. To finish we compute maximal orders of $A$.

```magma
> MaximalOrderFinite(A);
Maximal Order of Algebraic function field defined over K by
$.1^5 + (t*K.1^2 + (w*t^2 + w^2)*K.1 + (w*t^2 + t + w))*$.1^3 + ((t^2 + w)*K.1^2
    + w^2*t^3*K.1 + (t^4 + t^2 + w^2))*$.1 + (t^4 + w^2*t^2 + w*t + w)*K.1^2 +
    (w*t^5 + w*t^4 + w*t^3)*K.1 + w^2*t^5 + t^4 + w*t^3 + w^2*t + 1 over Maximal
    Equation Order of K over Univariate Polynomial Ring in t over GF(2^2)
> MaximalOrderInfinite(A);
Maximal Order of Algebraic function field defined over K by
$.1^5 + (w^2*K.1^2 + (w^2*t + 1)*K.1 + (t^2 + w*t + 1))*$.1^3 + ((w^2*t^2 +
    w^2)*K.1^2 + t*K.1 + (t^4 + 1))*$.1 + (w*t^3 + w^2*t^2 + t)*K.1^2 + (w^2*t^4
    + t^2 + 1)*K.1 + w*t^4 + t^3 + t + w^2 over Maximal Order of K over
    Valuation ring of Univariate rational function field over GF(2^2) with
    generator 1/t
> DiscriminantDivisor(A);
4*(t^2 + t + w, K.1 + w^2*t + 1) + 4*(t^2 + w^2*t + w^2, K.1 + w*t + w)
> $1 eq Divisor(Discriminant($3)) + Divisor(Discriminant($2));
true

```

## `Example: classfields2 (ex-5a3adf)`

Now, suppose we still want the infinite places to split, but now we are looking for degree $4$ extensions such that the quotient of genus by number of rational places is maximal:

```magma
> q, mq := quo<R | U1>;
> l4 := [ x`subgroup : x in Subgroups(q : Quot := [4])];
> #l4;
7168
> A := [AbelianExtension(D, x@@mq) : x in l4];
> s4 := [<Genus(a), NumberOfPlacesOfDegreeOne(a), a> : a in A];
> Maximum([x[2]/x[1] : x in s4]);
16/5 15
> E := FunctionField(s4[15][3]);
> l22 := [ x`subgroup : x in Subgroups(q : Quot := [2,2])];
> #l22;
43435

```

Since this is quite a lot, we won’t investigate them here further. But we will compute the maximal orders.

```magma
> MaximalOrderFinite(s4[15][3]);
Maximal Order of E over Maximal Equation Order of K over Univariate Polynomial
Ring in t over GF(2^2)
> MaximalOrderInfinite(s4[15][3]);
Maximal Order of E over Maximal Order of K over Valuation ring of Univariate
rational function field over GF(2^2) with generator 1/t

```
