# General Structure Invariants

## `Characteristic(F): FldFun -> RngIntElt`

## `Characteristic(O): RngFunOrd -> RngIntElt`

The characteristic of the function field $F/k$ or one of its orders $O$.

## `IsPerfect(F): Fld -> BoolElt`

Applies to any field in Magma. Returns whether $F$ is perfect.

## `Degree(F): FldFunG -> RngIntElt`

## `Degree(F, G): FldFun, FldFun -> RngIntElt`

## `Degree(O): RngFunOrd -> RngIntElt`

The degree $[F:G]$ of the field extension $F/G$ where $G$ is the base field of $F$ unless specified. For an order $O$, this function returns the rank of $O$ as a module over its coefficient ring. Note that this rank is equal to the degree $[F:G]$ where $F$ and $G$ are the field of fractions of $O$ and the coefficient ring of $O$ respectively.

## `AbsoluteDegree(F): FldFunG -> RngIntElt`

## `AbsoluteDegree(O): RngFunOrd -> RngIntElt`

The degree of the function field $F$ or the order $O$ as a finite extension of $k(x)$ or $k[x]$ or as an infinite extension of $k$.

## `DefiningPolynomial(F): FldFun -> RngUPolElt`

## `DefiningPolynomial(O): RngFunOrd -> RngUPolElt`

The defining polynomial of the function field $F$ over its coefficient ring. For an order $O$ belonging to a function field $F$, this function returns the defining polynomial of $O$, which may be different from that of $F/k(x, \alpha_1, \ldots, \alpha_r)$.

## `DefiningPolynomials(F): FldFun -> [RngUPolElt]`

## `DefiningPolynomials(O): RngFunOrd -> [RngUPolElt]`

Return the defining polynomials of the function field $F$ or the order $O$ as a sequence of polynomials over the coefficient ring.

## `Basis(F): FldFunG -> SeqEnum[FldFunElt]`

## `Basis(O): RngFunOrd -> SeqEnum[FldFunElt]`

## `Basis(O, R): RngFunOrd, Rng -> SeqEnum[RngElt]`

The basis $1, \alpha, \dots, \alpha^{n-1}$ of the function field $F[\alpha]$ over the coefficient field.

Given an order $O$ belonging to a function field $F$, this function returns the basis of $O$ in the form of function field elements.

Given an additional ring $R$, return the basis of $O$ as elements of $R$.

## `TransformationMatrix(O1, O2): RngFunOrd, RngFunOrd -> AlgMatElt, RngElt`

Return the matrix $M$ and a denominator $d$ which transforms elements of the order $O1$ into elements of the order $O2$.

## `CoefficientIdeals(O): RngFunOrd -> [RngFunOrdIdl]`

The coefficient ideals of the order $O$ of a relative extension. These are the ideals $\{A_i\}$ of the coefficient ring of $O$ such that for every element $e$ of $O$, $e = \sum_i a_i*b_i$ where $\{b_i\}$ is the basis returned for $O$ and each $a_i \in A_i$.

## `BasisMatrix(O): RngFunOrd -> AlgMatElt`

Given an order $O$ in a function field $F$ of degree $n$, this returns an $n\times n$ matrix whose $i$-th row contains the coefficients for the $i$-th basis element of $O$ with respect to the power basis of $F$. Thus, if $b_i$ is the $i$-th basis element of $O$,

$$
b_i=\sum_{j=1}^{n}M_{ij}\alpha^{j-1}
$$

where $M$ is the matrix and $\alpha$ is the generator of $F$.

## `PrimitiveElement(O): RngFunOrd -> RngFunOrdElt`

A root of the defining polynomial of the order $O$.

## `Discriminant(O): RngFunOrd -> .`

The discriminant of the order $O$, up to a unit in its coefficient ring.

## `AbsoluteDiscriminant(O): RngFunOrd -> .`

The discriminant of the order $O$ of an algebraic function field $F$ over the bottom coefficient ring of $O$, (the subring of the rational function field $F$ extends).

## `DimensionOfExactConstantField(F): FldFunG -> RngIntElt`

## `DegreeOfExactConstantField(F): FldFunG -> RngIntElt`

The dimension of the exact constant field of the function field $F/k$ over $k$. The exact constant field is the algebraic closure of $k$ in $F$.

## `Genus(F): FldFunG -> RngIntElt`

```magma
Al     : MonStgElt                    Default: 
IsExact: BoolElt                      Default: false
```

The genus of the function field $F/k$. If $F$ is an extension of a rational function field over ${\mathbb{Q}}$ or ${\mathbb{F}}_q$ by a single monic integral polynomial and the parameter `Al` is set to `"Montes"` then the Montes algorithm [[Stainsby, 2018](../../references.md#cite-2015arxiv150601904s)] will be used to compute the genus.

The index $[k_0:{\rm ConstantField}(F)]$, where $k_0$ is the full constant field, is also returned. If it is known beforehand that $k_0$ is the constant field $F$ is defined over then set the parameter `IsExact := true`.

## `Example: invar (ex-a8d7ef)`

```magma
> PF<x> := PolynomialRing(GF(31, 3));
> P<y> := PolynomialRing(PF);
> FF1<b> := ext<FieldOfFractions(PF) | y^2 - x^3 + 1>;
> P<y> := PolynomialRing(FF1);
> FF2<d> := ext<FF1 | y^3 - b*x*y - 1>;
> Characteristic(FF2);
31
> EFF2I := EquationOrderInfinite(FF2);
> MFF2I := MaximalOrderInfinite(FF2);
> Degree(MFF2I) eq 3;
true
> AbsoluteDegree(EFF2I);
6
> Genus(FF2);
9
> DefiningPolynomial(EFF2I);
$.1^3 + [ 0, 30/x^3 ]*$.1 + [ 30/x^9, 0 ]
> Basis(MFF2I);
[ 1, 1/x*d, 1/x^2*d^2 ]
> Discriminant(EFF2I);
Ideal of Maximal Equation Order of FF1 over Valuation ring of Univariate
rational function field over GF(31^3)
Variables: x with generator 1/x
Generator:
(4*x^3 + 27)/x^15*b + 4/x^18
> AbsoluteOrder(EFF2I);
Order of Algebraic function field defined over Univariate rational function
field over GF(31^3) by
y^6 + 29*y^3 + (30*x^5 + x^2)*y^2 + 1 over Valuation ring of Univariate rational
function field over GF(31^3) with generator 1/x
> AbsoluteDiscriminant(EFF2I);
(2*x^9 + 25*x^6 + 6*x^3 + 29)/x^33
> Discriminant($2);
(30*x^24 + 6*x^21 + 16*x^18 + 20*x^15 + 16*x^12 + 7*x^9 + 27*x^6 + 3*x^3 +
    30)/x^48

```

## `Example: Invar Non Simple (ex-ec93f9)`

Invariants are slightly different for non–simple fields.

```magma
> P<x> := PolynomialRing(Rationals());
> P<y> := PolynomialRing(P);
> F<a, b> := FunctionField([3*y^3 - x^2, x*y^2 + 1]);
> DefiningPolynomials(F);
[
    3*y^3 - x^2,
    x*y^2 + 1
]
> DefiningPolynomials(EquationOrderFinite(F));
[
    y^3 - 1/3*x^2,
    y^2 + x
]
> DefiningPolynomials(EquationOrderInfinite(F));
[
    $.1^3 - 1/3/$.1^4,
    $.1^2 + 1/$.1
]
> Basis(F);
[
    1,
    a,
    a^2,
    $.1*b,
    $.1*a*b,
    $.1*a^2*b
]
> TransformationMatrix(EquationOrderFinite(F), MaximalOrderFinite(F));
[1 0 0 0 0 0]
[0 1 0 0 0 0]
[0 0 x 0 0 0]
[0 0 0 1 0 0]
[0 0 0 0 x 0]
[0 0 0 0 0 x]
1
> TransformationMatrix(MaximalOrderFinite(F), EquationOrderFinite(F));
[x 0 0 0 0 0]
[0 x 0 0 0 0]
[0 0 1 0 0 0]
[0 0 0 x 0 0]
[0 0 0 0 1 0]
[0 0 0 0 0 1]
x

```

## `GapNumbers(F): FldFunG -> SeqEnum[RngIntElt]`

```magma
SeparatingElement: FldFunGElt                    Default: 
```

The sequence of global gap numbers of the function field $F/k$ (in characteristic zero this is always $[1, \dots, g]$). A separating element used internally for the computation can be specified, it defaults to `SeparatingElement(F)`. See the description of [`GapNumbers`](divisors.md#function-divfunelt-gapnumbers).

## `GapNumbers(F, P): FldFunG, PlcFunElt -> SeqEnum[RngIntElt]`

## `GapNumbers(P): PlcFunElt -> SeqEnum[RngIntElt]`

The sequence of gap numbers of the function field $F/k$ at $P$ where $P$ must be a place of degree one. See the description of [`GapNumbers`](divisors.md#function-divfunelt-gapnumbers).

## `SeparatingElement(F): FldFunG -> FldFunGElt`

Returns a separating element of the function field $F/k$.

## `RamificationDivisor(F): FldFunG -> DivFunElt`

```magma
SeparatingElement: FldFunGElt                    Default: 
```

The ramification divisor of the function field $F/k$. The semantics of calling `RamificationDivisor()` with $F$ or the zero divisor of $F$ are identical. For further details see the description of [`RamificationDivisor`](divisors.md#function-divfunelt-ramificationdivisor).

## `WeierstrassPlaces(F): FldFunG -> [PlcFunElt]`

```magma
SeparatingElement: FldFunGElt                    Default: 
```

The Weierstrass places of the function field $F/k$. The semantics of calling `WeierstrassPlaces` with $F$ or the zero divisor of $F$ are identical. See the description of [`WeierstrassPlaces`](divisors.md#function-divfunelt-weierstrassplaces).

## `WronskianOrders(F): FldFunG -> [RngIntElt]`

```magma
SeparatingElement: FldFunGElt                    Default: 
```

The Wronskian orders of the function field $F/k$. The semantics of calling `WronskianOrders` with $F$ or the zero divisor of $F$ are identical. See the description of [`WronskianOrders`](divisors.md#function-divfunelt-wronskianorders).

## `Different(O): RngFunOrd -> RngFunOrdIdl`

The different of the maximal order $O$.

## `Index(O, S): RngFunOrd, RngFunOrd -> Any`

The index of $S$ in $O$ where $S$ is a suborder of $O$ and $O$ and $S$ have the same equation order.
