# Structure Operations on Differential Rings

## Category and Parent

Differential Rings form the Magma category `RngDiff`. The notional power structures exist as parents of differential rings.

### `Category(R): RngDiff -> RngDiff`

### `Type(R): RngDiff -> RngDiff`

The category, or type, of the differential ring $R$.

### `Parent(R): RngDiff -> PowStr`

The power structure of the differential ring $R$.

## Related Structures

The underlying ring and constant ring from which the differential ring was created can each be retrieved as described below. There is also the concept of a base ring. If one has created a differential extension $M/F$ in Magma, then $F$ is the *base ring* of $M$.

### `UnderlyingRing(R): RngDiff -> Rng`

The underlying ring of the differential ring $R$. The type of the underlying ring indicates what ring $R$ inherits from.

### `UnderlyingField(R): RngDiff -> Rng`

The underlying ring of the differential ring $R$, provided it is a field.

### `BaseRing(R): RngDiff -> Rng`

The base ring of the differential ring $R$.

### `BaseField(R): RngDiff -> Rng`

The base ring of the differential ring $R$, provided it is a field.

### `ConstantRing(R): RngDiff -> Rng`

The constant ring of the differential ring $R$. The derivation of $R$ acts trivially on the constant ring. It is therefore contained in the differential ring of constants of $R$.

### `ConstantField(R): RngDiff -> Rng`

The constant ring of the differential ring $R$, provided it is a field.

### `ExactConstantField(F): RngDiff -> RngDiff, Map`

The exact constant field of $F$, i.e. the algebraic closure in $F$ of the constant field of $F$, together with the inclusion map to $F$. The field $F$ must be a function field. The differential field $F$ must have been created with respect to a differential. If the derivation of $F$ has been constructed with respect to a differential, then the exact constant field coincides with the differential field of constants of $F$.

### `Generators(R): RngDiff -> SeqEnum`

The list of generators of the differential ring $R$. If there is no list assigned to $R$, one is constructed by default from the underlying ring of $R$.

### `Example: Diff Ring Related Structures (ex-64f77a)`

First we construct the differential field $F={\mathbb{Q}}(z)$ with derivation ${d}/ {d}z$ and show what some of the related structures are. Then we construct the field extension $M={\mathbb{Q}}(z,\alpha)$, where $\alpha$ is a root of the polynomial $X^2-2$. We do this with the usual `ext< >` constructor. For $M$ we again derive some related structures.

```magma
> F<z> := RationalDifferentialField(Rationals());
> ConstantRing(F);
Rational Field
> UnderlyingRing(F);
Algebraic function field defined over Rational Field by
$.2 - 4711
>
> _<X> := PolynomialRing(F);
> M<alpha> := ext< F | X^2-2 >;
> BaseRing(M);
Differential Ring of Algebraic function field defined over Rational Field by
$.2 - 4711
with derivation given by (1) d(z)
> BaseRing(M) eq F;
true
> ConstantRing(M);
Rational Field
> E := ExactConstantField(M);
> E;
Number Field with defining polynomial $.1^2 - 2 over the Rational Field
> Generators(M);
[ alpha ]

```

### `Example: Diff Laur Ser Related Structures (ex-326abb)`

Related structures also exist for differential Laurent series rings.

```magma
> S<t>:=DifferentialLaurentSeriesRing(Rationals());
> UnderlyingRing(S);
Laurent series field in t over Rational Field
> ConstantRing(S);
Rational Field
> Generators(S);
[ t ]

```

## Derivation and Differential

The derivation of a differential ring and its differential, whenever applicable, can be retrieved as indicated below.

### `Derivation(R): RngDiff -> Map`

The derivation of the differential ring $R$.

### `Differential(F): RngDiff -> DiffFunElt`

The differential belonging to the derivation of the differential field $F$. The field $F$ must have been constructed in such a way that its derivation is defined by a differential.

### `Example: Diff Ring Derivation Differential (ex-627c5f)`

```magma
> F<z> := RationalDifferentialField(Rationals());
> Derivation(F);
Mapping from: RngDiff: F to RngDiff: F given by a rule [no inverse]
> Differential(F);
(1) d(z)

```

## Numerical Invariants

### `Ngens(R): RngDiff -> RngIntElt`

The number of indeterminates associated with the differential ring $R$.

## Predicates and Booleans

### `R eq F: RngDiff, RngDiff -> BoolElt`

Returns `true` if and only if the differential rings $R$ and $F$ are the same.

### `IsIdentical(R, F): RngDiff, RngDiff -> BoolElt`

Returns `true` if and only if the differential rings $R$ and $F$ are identical.

### `IsDomain(R): RngDiff -> BoolElt`

Returns `true` if and only if the differential ring $R$ is a domain.

### `IsField(R): RngDiff -> BoolElt`

Returns `true` if and only if the differential ring $R$ is field.

### `IsDifferentialField(R): Rng -> BoolElt`

Returns `true` if and only if the ring $R$ is a differential field.

### `IsAlgebraicDifferentialField(R): Rng -> BoolElt`

Returns `true` if and only if the field structure of the differential ring $R$ is an algebraic function field.

### `IsDifferentialSeriesRing(R): Rng -> BoolElt`

Returns `true` if and only if the underlying ring of the differential ring $R$ is a series ring.

### `IsDifferentialLaurentSeriesRing(R): Rng -> BoolElt`

Returns `true` if and only if the underlying ring of the differential ring $R$ is a Laurent series ring and $R$ has been created with a known constant ring.

### `Example: Diff Rings Booleans (ex-913ce7)`

This example shows some booleans for various differential rings.

```magma
> F<z>:=RationalDifferentialField(Rationals());
> S<t>:=DifferentialLaurentSeriesRing(Rationals());
> IsAlgebraicDifferentialField(F);
true
> IsDifferentialSeriesRing(F);
false
> IsAlgebraicDifferentialField(S);
false
> IsDifferentialSeriesRing(S);
true
> IsDifferentialLaurentSeriesRing(S);
true

```

### `HasProjectiveDerivation(F): RngDiff -> BoolElt`

Returns `true` if and only if $F$ is a differential ring with derivation weakly of the form $(F.1)\cdot d/d(F.1)$.

### `HasZeroDerivation(F): RngDiff -> BoolElt`

Returns `true` if and only if the algebraic differential field or differential series ring $F$ has zero derivation. When $F$ is a series ring we relax being zero to being weakly zero.

### `Example: Diff Rings Booleans Derivation (ex-a3014d)`

```magma
> F<z>:=RationalDifferentialField(Rationals());
> S<t>:=DifferentialLaurentSeriesRing(Rationals());
> HasProjectiveDerivation(F);
false
> HasProjectiveDerivation(ChangeDerivation(F,z));
true
> HasZeroDerivation(F);
false
> HasProjectiveDerivation(S);
true
> HasProjectiveDerivation(ChangeDerivation(S,S!3));
false
> HasZeroDerivation(S);
false

```

## Precision

### `RelativePrecision(F): RngDiff -> RngElt`

Returns the relative precision of the underlying series ring of F.

### `RelativePrecisionOfDerivation(F): RngDiff -> RngElt`

Given a differential Laurent series ring $F$, returns the relative precision of the ring derivative of $F.1$.

### `Example: Diff Rings Relative Precision (ex-4674cf)`

This example illustrate the relative precision of differential rings.

```magma
> S<t>:=DifferentialLaurentSeriesRing(Rationals());
> Derivative(t);
t
> IsDifferentialLaurentSeriesRing(S);
true
> RelativePrecision(S);
20
> RelativePrecision(UnderlyingRing(S));
20;
> V<w>:=DifferentialLaurentSeriesRing(Rationals():Precision:=30);
> RelativePrecision(V);
30
> RelativePrecision(V) eq RelativePrecision(UnderlyingRing(V));
true

```

### `Example Differential Ring Relative Precision Derivation (ex-617005)`

```magma
> S<t> := DifferentialLaurentSeriesRing(Rationals());
> RelativePrecisionOfDerivation(S);
Infinity
> V<w> := ChangeDerivation(S,t+O(t^6));
> Derivation(V)(w);
w^2 + O(w^7)
> RelativePrecisionOfDerivation(V);
5

```

### `ChangePrecision(F, p): RngDiff, RngElt -> RngDiff, Map`

Returns the differential series ring isomorphic to $F$ with relative precision $p$. The map returned is the induced map of $F$ to the new field.

### `Example: Diff Rings Change Precision (ex-d18d60)`

```magma
> S<t>:=DifferentialLaurentSeriesRing(Rationals());
> RelativePrecision(S);
20
> V<w>,mp :=  ChangePrecision(S,10);
> Type(V);
RngDiff
> IsDifferentialLaurentSeriesRing(V);
true
> RelativePrecision(V);
10
> RelativePrecision(1/(w-1)) eq 10;
true
> mp(t) eq w;
true
> w@@mp eq t;
true
> derivt := Derivation(S)(t);
> derivt;
t
> derivw := Derivation(V)(w);
> derivw;
w
> mp(derivt) eq Derivation(V)(w);
true

```
