# Differentials

Spaces of differentials of function fields can be created and the differentials belonging to them manipulated. Divisors can be created from differentials and modules generated by a collection of differentials can be formed.

## Creation of Structures

### `DifferentialSpace(F): FldFunG -> DiffFun`

The space of differentials of the algebraic function field $F/k$.

## Creation of Elements

The simplest ways of creating a differential are given below.

### `Differential(a): FldFunGElt -> DiffFunElt`

### `Differential(a): RngFunOrdElt -> DiffFunElt`

Create the differential $d(a)$ of the function field or order element $a$.

### `Identity(D): DiffFun -> DiffFunElt`

### `Id(D): DiffFun -> DiffFunElt`

The identity differential of the space of differentials $D$.

### `IsCanonical(D): DivFunElt -> BoolElt, DiffFunElt`

Returns `true` iff the divisor $D$ is canonical and a differential having $D$ as its divisor.

## Related Structures

### `FunctionField(D): DiffFun -> FldFun`

The function field of the differentials in the space $D$.

### `FunctionField(d): DiffFunElt -> FldFun`

The function field of the differential $d$.

## Subspaces

### `SpaceOfDifferentialsFirstKind(F): FldFunG -> ModFld, Map`

### `SpaceOfHolomorphicDifferentials(F): FldFunG -> ModFld, Map`

A vector space and the isomorphism from this space to the space of differentials of the first kind (holomorphic differentials) of the function field $F/k$.

### `BasisOfDifferentialsFirstKind(F): FldFunG -> SeqEnum[DiffFunElt]`

### `BasisOfHolomorphicDifferentials(F): FldFunG -> SeqEnum[DiffFunElt]`

A basis of the space of differentials of the first kind (holomorphic differentials) of the function field $F/k$.

### `DifferentialBasis(D): DivFunElt -> [DiffFunElt]`

Computes a basis for the space of differentials

$$
\Omega(D) := \{\;
   \omega \in \Omega(F/k) \;|\; (\omega) \geq D \;\}
$$

for a divisor $D$ of an algebraic function field $F/k$.

### `DifferentialSpace(D): DivFunElt -> ModFld, Map`

A vector space and the isomorphism from this space to the differential space of the divisor $D$.

### `Example: Div Diff (ex-b69721)`

This example illustrates the differential space of a divisor and some of the operations that can be done with it.

```magma
> Q := Rationals();
> Qx<x> := PolynomialRing(Q);
> Qxy<y> := PolynomialRing(Qx);
> f1 := y^2 - (x-1)*(x-2)*(x-3)*(x-5)*(x-6);
> F := FunctionField(f1);
> d := Divisor(F.1) + Divisor(F!BaseRing(F).1);
> V1 := DifferentialSpace(d);
> d := 2*Divisor(F.1) - Divisor(F!BaseRing(F).1);
> V2 := DifferentialSpace(d);
> V1;
KModule V1 of dimension 2 over Rational Field
> V2;
KModule V2 of dimension 2 over Rational Field
> V1 meet V2;
KModule of dimension 0 over Rational Field
> D := DifferentialSpace(F);
> v := V1 ! [2/9, 4/9]; v;
V1: (2/9 4/9)
> D!v;
(2/9*x^2 + 4/9*x) d(x)
> V1!$1;
V1: (2/9 4/9)
> BasisOfDifferentialsFirstKind(F);
[ (x/(x^5 - 17*x^4 + 107*x^3 - 307*x^2 + 396*x - 180)*F.1) d(x), (1/(x^5 -
    17*x^4 + 107*x^3 - 307*x^2 + 396*x - 180)*F.1) d(x) ]

```

## Structure Predicates

### `D1 eq D2: DiffFun, DiffFun -> BoolElt`

Return `true` if the spaces of differentials $D1$ and $D2$ are the same.

## Operations on Elements

A number of general operations for elements are also provided for differentials as well as a number of specific functions for differentials.

### Arithmetic Operators

#### `r * x: RngElt, DiffFunElt -> DiffFunElt`

#### `x * r: DiffFunElt, RngElt -> DiffFunElt`

#### `x + y: DiffFunElt, DiffFunElt -> DiffFunElt`

#### `- x: DiffFunElt -> DiffFunElt`

#### `x - y: DiffFunElt, DiffFunElt -> DiffFunElt`

#### `x / y: DiffFunElt, DiffFunElt -> FldFunGElt`

#### `x / r: DiffFunElt, RngElt -> DiffFunElt`

The operations on differentials are inherited from the vector space structure of the space of differentials. Additionally, this space is one–dimensional as a vector space over the function field itself. The quotient $x/y$ of two differentials $x$ and $y$ then gives the unique $r \in F$ such that $x = ry$.

### Equality and Membership

#### `x eq y: DiffFunElt, DiffFunElt -> BoolElt`

Returns `true` if $x$ and $y$ are the same differential.

#### `x in D: Any, DiffFun -> BoolElt`

Returns `true` if $x$ is in the space of differentials $D$.

### Predicates on Elements

#### `IsExact(d): DiffFunElt -> BoolElt, FldFunGElt`

Return whether $d$ is known to be an exact differential. If `true` additionally return a generator. If $d$ is not already known to be exact then no attempts to determine whether $d$ is exact or not are currently undertaken.

#### `IsZero(d): DiffFunElt -> BoolElt`

Return `true` if $d$ is the zero differential.

### Functions on Elements

#### `Valuation(d, P): DiffFunElt, PlcFunElt -> RngIntElt`

The valuation of the differential $d$ at the place $P$.

#### `Divisor(d): DiffFunElt -> DivFunElt`

The divisor $(d)$ of the differential $d$.

#### `Residue(d, P): DiffFunElt, PlcFunElt -> RngElt`

The residue of the differential $d$ at the place $P$, where $P$ must (currently) have degree one.

#### `Example: Diff Fun (ex-7c77de)`

```magma
> PF<x> := PolynomialRing(GF(31, 3));
> P<y> := PolynomialRing(PF);
> FF1<b> := ext<FieldOfFractions(PF) | y^2 - x>;
> P<y> := PolynomialRing(FF1);
> FF2<d> := ext<FF1 | y^3 - b : Check := false>;
> Differential(d);
(26/x*d) d(x)
> I := Random(FF2, 2)*MaximalOrderInfinite(FF2);
> P := Place(Factorization(I)[1][1]);
> Valuation(Differential(d), P);
-2
> IsExact(Differential(Random(FF2, 2)));
true

```

#### `Module(L, R): SeqEnum[ DiffFunElt ], Rng -> Mod, Map, SeqEnum[ ModElt ]`

```magma
IsBasis  : BoolElt                    Default: false
PreImages: BoolElt                    Default: false
```

The $R$-module generated by the differentials in the sequence $L$ as an abstract module, together with the map into the space of differentials. The resulting modules can be used for intersection and inner sum computations.

If the optional parameter `IsBasis` is set `true` the function assumes that the given elements form a basis of the module to be computed.

If the optional parameter `PreImages` is set `true` then the preimages of the given elements under the map are returned as the third return value.

Both optional parameters are mainly used to save computation time.

#### `Relations(L, R): SeqEnum[ DiffFunElt ], Rng -> ModTupRng`

#### `Relations(L, R, m): SeqEnum[ DiffFunElt ], Rng, RngIntElt -> ModTupRng`

The module of $R$-linear relations between the differentials of the sequence $L$. The integer $m$ is used for the following: Let the elements of $L$ be $a_1, \dots, a_n$, $V$ be the relation module $\subseteq R^n$ and define $M := \{\, \sum_{i=1}^m v_i a_i \,|\, v = (v_i)_i \in V \,\}$. The function tries to compute a generating system of $V$ such that the corresponding generating system of $M$ consists of “small” elements.

#### `Example: Module Diff (ex-3e031a)`

This example shows some of the conversions and operations possible with the results of `Module`.

```magma
> Q := Rationals();
> Qx<x> := PolynomialRing(Q);
> Qxy<y> := PolynomialRing(Qx);
> f1 := y^2 - (x-1)*(x-2)*(x-3)*(x-5)*(x-6);
> F := FunctionField(f1);
> D := DifferentialSpace(F);
> M7 := Module([Differential(3*F.1)], FieldOfFractions(Qx));
> M8 := Module([Differential(F.1), Differential(F!BaseRing(F).1)],
> FieldOfFractions(Qx));
> M12 := M7 meet M8;
> M16 := M7 + M8;
> assert M12 subset M7;
> assert M12 subset M8;
> assert M12 subset M16;
> r := M7![&+[Random([-100, 100])/Random([1, 100])*x^i : i in [1 .. 5]]/
> &+[Random([-100, 100])/Random([1,
> 100])*x^i : i in [1 .. 5]] : j in [1 .. Dimension(M7)]];
> assert M7!D!r eq r;
> r;
M7: ((1/100*x^4 + x^3 - x^2 + 1/100*x - 1/100)/(x^4 - 1/100*x^3 - 1/100*x^2 +
    1/100*x - 1/100))
> D!r;
((3/40*x^8 + 162/25*x^7 - 20937/200*x^6 + 114873/200*x^5 - 279531/200*x^4 +
    304167/200*x^3 - 24321/40*x^2 + 303/20*x - 297/50)/(x^9 - 1701/100*x^8 +
    2679/25*x^7 - 30789/100*x^6 + 19891/50*x^5 - 3593/20*x^4 - 63/10*x^3 +
    883/100*x^2 - 144/25*x + 9/5)*F.1) d(x)

```

#### `Cartier(b): DiffFunElt -> DiffFunElt`

#### `Cartier(b, r): DiffFunElt, RngIntElt -> DiffFunElt`

The result of applying the Cartier operator $r$ times to $b$. More precisely, let $F/k$ be a function field over the perfect field $k$, $x \in F$ be a separating variable and $b = g\,dx\,\in \Omega(F/k)$ with $g \in F$ be a differential. The Cartier operator is defined by $C(b) = \left( - d^{p-1} g / dx^{p-1} \right)^{1/p} dx.$ This function computes the $r$-th iterated application of $C$ to $b$.

### Other

#### `CartierRepresentation(F): FldFunG -> AlgMatElt, SeqEnum[DiffFunElt]`

#### `CartierRepresentation(F, r): FldFunG, RngIntElt -> AlgMatElt, SeqEnum[DiffFunElt]`

Compute a row representation matrix of the Cartier operator on a basis of the space of holomorphic differentials of $F/k$ (applied $r$ times). More precisely, let $F/k$ be a function field over the perfect field $k$, $\omega_1, \dots, \omega_g \in \Omega(F/k)$ be a basis for the holomorphic differentials and $r \in {\mathbb{Z}}^{\geq 1}$. Let $M = (\lambda_{i,j})_{i,j} \in k^{g \times g}$ be the matrix such that

$$
C^r(\omega_i) =
   \sum_{m=1}^g \lambda_{i, m} \omega_m
$$

for all $1 \leq i \leq g$. This function returns $M$ and $(\omega_1, \dots, \omega_g)$.

#### `Example: Diff Cart (ex-78c02f)`

An example of a trivial cartier action.

```magma
> PF<x> := PolynomialRing(GF(31, 3));
> P<y> := PolynomialRing(PF);
> FF1<b> := ext<FieldOfFractions(PF) | y^2 - x>;
> P<y> := PolynomialRing(FF1);
> FF2<d> := ext<FF1 | y^3 - b : Check := false>;
> Cartier(Differential(d), 4);
(0) d(x)
> CartierRepresentation(FF2, 3);
Matrix with 0 rows and 0 columns
[]

```
