# Differential Rings and Fields

## Creation

There are two ways to create a differential ring. The first creation is a general creation of a differential ring, for which the user specifies the ring and its derivation. The second creates a differential field which has the structure of a rational function field of transcendence degree $1$ over its base field. Its derivation is specified by a differential.

Once a differential ring is created one can ask for its ring or field of fractions.

### `DifferentialRing(P, f, C): Rng, Map, Rng -> RngDiff`

Given a ring $P$ and derivation $f$ acting on $P$, return the differential ring isomorphic to $P$, with induced derivation $f$ acting on it, and ring of constants $C$. The ring $C$ should be a subring of $P$ on which $f$ is zero.

### `Example: Diff Ring Create (ex-dba016)`

Here we illustrate the creation and printing of a general differential ring.

```magma
> P := PolynomialRing(Rationals());
> f := map<P->P | a:->5*Derivative(a)>;
> R := DifferentialRing(P, f, Rationals());
> R;
Differential Ring of Univariate Polynomial Ring over
Rational Field with derivation given by Mapping
from: RngUPol: P to RngUPol: P given by a rule [no inverse]

```

### `RationalDifferentialField(C): Fld -> RngDiff`

The differential field in one variable over the constant field $C$. If this field is called $F$, say, then the derivation on $F$ is given by ${d} / (1) {d} (F.1)$, where $F.1$ is the variable of $F$, and $(1) {d} (F.1)$ is its differential in the differential space of $F$. Any exact field with polynomial GCD is valid input for $C$.

### `Example: Rat Diff Field Create (ex-c5e585)`

Here we illustrate the creation and printing of the differential field obtained from the command `RationalDifferentialField`.

```magma
> F<z> := RationalDifferentialField(Rationals());
> F;
Differential Ring of Algebraic function field defined over
Rational Field by $.2 - 4711 with
derivation given by (1) d(z)

```

### `DifferentialLaurentSeriesRing(C): Fld -> RngDiff`

The differential Laurent series ring (in one variable) over the constant field $C$. If this field is called $F$, say, then the derivation on $F$ is given by $F.1 \cdot {d} /  {d} (F.1)$, where $F.1$ is the variable of $F$.

### `Example: Diff Laur Ser Ring Create (ex-d698ec)`

This example illustrates the creation and printing of the differential Laurent series ring obtained from the command `DifferentialLaurentSeriesRing`.

```magma
> S<t> := DifferentialLaurentSeriesRing(Rationals());
> S;
Differential Ring of Laurent series field in t over Rational Field
with derivation given by Mapping from: Laurent series field in t over Rational
Field to Laurent series field in t over Rational Field given by a rule [no
inverse]

```

### `RingOfFractions(R): RngDiff -> RngDiff, Map`

Returns the differential ring $R[r^{-1}: r \in R {\rm\ not \ a\ zero\ divisor}]$ of fractions of the differential ring $R$, together with the inclusion map from $R$ to the newly created ring.

### `FieldOfFractions(R): RngDiff -> RngDiff, Map`

Returns the differential field of fractions of the differential ring $R$, together with the inclusion map from $R$ to the newly created field.

### `AssignNames(~R, S): RngDiff, [MonStgElt]`

Given a differential ring $R$ with $n$ indeterminates and a sequence $S$ of $n$ strings, assign the elements of $S$ to the names of the variables of $R$.

This procedure only changes the names used in the printing of the elements of $R$.

## Creation of Differential Ring Elements

The easiest way to create an element in a given ring is to use the angle bracket construction to attach names to the indeterminates of the ring. Others are given below.

### `Name(R, i): RngDiff, RngIntElt -> RngDiffElt`

### `R . i: RngDiff, RngIntElt -> RngDiffElt`

The $i$-th indeterminate of the differential ring $R$, where $i$ is between $1$ and the number of generators of $R$.

### `R ! s: RngDiff, RngElt -> RngDiffElt`

Coerce the element $s$ in the differential ring $R$. Elements that are coercible are elements that are coercible in the underlying ring of the differential ring $R$.

### `Zero(R): RngDiff -> RngDiffElt`

The zero element of the differential ring $R$.

### `One(R): RngDiff -> RngDiffElt`

### `Identity(R): RngDiff -> RngDiffElt`

The identity element of the differential ring $R$.

### `SeparatingElement(F): RngDiff -> RngDiffElt`

Returns the separating element of the algebraic differential field $F$.

### `Example: Diff Ring Element Creation (ex-284f4d)`

We construct the differential field $F={\mathbb{Q}}(z)$ with derivation ${d}/ {d}z$ and show some of the elements that can be created.

```magma
> F<z> := RationalDifferentialField(Rationals());
> F.1;
z
> two := F!2;
> two;
2
> Parent(two) eq F;
true
> Zero(F); One(F);
0
1
> Parent(Zero(F)) eq F and Parent(Identity(F)) eq F;
true
> elt := SeparatingElement(F);
> elt;
z
> ISA(Type(elt),RngDiffElt);
true
> Parent(elt) eq F;
true
> elt eq F!SeparatingElement(UnderlyingRing(F));
true

```
