# Elementary Invariants

These functions return some simple information partially defining a local ring.

## `Prime(L): RngPad -> RngIntElt`

## `Prime(L): FldPad -> RngIntElt`

## `Prime(L): RngPadRes -> RngIntElt`

## `Prime(L): RngPadResExt -> RngIntElt`

Given a local ring or field $L$, return the prime $p$ defining the $p$-adic ring or field underlying $L$. This is also the characteristic of the residue class field of $L$.

## `InertiaDegree(L): RngPad -> RngIntElt`

## `InertiaDegree(L): FldPad -> RngIntElt`

## `InertiaDegree(L): RngPadRes -> RngIntElt`

## `InertiaDegree(L): RngPadResExt -> RngIntElt`

Return the inertia degree of the local ring or field $L$ over its coefficient ring.

## `InertiaDegree(K, L): RngPad, RngPad -> RngIntElt`

## `InertiaDegree(K, L): FldPad, FldPad -> RngIntElt`

## `InertiaDegree(K, L): RngPadRes, RngPadRes -> RngIntElt`

## `InertiaDegree(K, L): RngPadResExt, RngPadResExt -> RngIntElt`

Return the inertia degree of the local ring or field $K$ relative to its subring $L$.

## `AbsoluteInertiaDegree(L): RngPad -> RngIntElt`

## `AbsoluteInertiaDegree(L): FldPad -> RngIntElt`

## `AbsoluteInertiaDegree(L): RngPadRes -> RngIntElt`

## `AbsoluteInertiaDegree(L): RngPadResExt -> RngIntElt`

## `AbsoluteInertiaIndex(L): RngPad -> RngIntElt`

## `AbsoluteInertiaIndex(L): FldPad -> RngIntElt`

## `AbsoluteInertiaIndex(L): RngPadRes -> RngIntElt`

## `AbsoluteInertiaIndex(L): RngPadResExt -> RngIntElt`

Return the inertia degree of the local ring or field $L$ over the $p$-adic ring.

## `RamificationDegree(L): RngPad -> RngIntElt`

## `RamificationDegree(L): FldPad -> RngIntElt`

## `RamificationDegree(L): RngPadRes -> RngIntElt`

## `RamificationDegree(L): RngPadResExt -> RngIntElt`

## `RamificationIndex(L): RngPad -> RngIntElt`

## `RamificationIndex(L): FldPad -> RngIntElt`

## `RamificationIndex(L): RngPadRes -> RngIntElt`

## `RamificationIndex(L): RngPadResExt -> RngIntElt`

Return the ramification degree of the local ring or field $L$ over its coefficient ring.

## `RamificationDegree(K, L): RngPad, RngPad -> RngIntElt`

## `RamificationDegree(K, L): FldPad, FldPad -> RngIntElt`

## `RamificationDegree(K, L): RngPadRes, RngPadRes -> RngIntElt`

## `RamificationDegree(K, L): RngPadResExt, RngPadResExt -> RngIntElt`

## `RamificationIndex(K, L): RngPad, RngPad -> RngIntElt`

## `RamificationIndex(K, L): FldPad, FldPad -> RngIntElt`

## `RamificationIndex(K, L): RngPadRes, RngPadRes -> RngIntElt`

## `RamificationIndex(K, L): RngPadResExt, RngPadResExt -> RngIntElt`

Return the ramification degree of the local ring or field $K$ relative to its subring $L$.

## `AbsoluteRamificationDegree(L): RngPad -> RngIntElt`

## `AbsoluteRamificationDegree(L): FldPad -> RngIntElt`

## `AbsoluteRamificationDegree(L): RngPadRes -> RngIntElt`

## `AbsoluteRamificationDegree(L): RngPadResExt -> RngIntElt`

## `AbsoluteRamificationIndex(L): RngPad -> RngIntElt`

## `AbsoluteRamificationIndex(L): FldPad -> RngIntElt`

## `AbsoluteRamificationIndex(L): RngPadRes -> RngIntElt`

## `AbsoluteRamificationIndex(L): RngPadResExt -> RngIntElt`

Return the ramification degree of the local ring or field $L$ over the $p$-adic ring.

## `AbsoluteDegree(L): RngPad -> RngIntElt`

The degree of $L$ over ${\mathbb{Z}}_p$.

## `Degree(L): RngPad -> RngIntElt`

## `Degree(L): FldPad -> RngIntElt`

## `Degree(L): RngPadRes -> RngIntElt`

## `Degree(L): RngPadResExt -> RngIntElt`

Return the degree of the local ring or field $L$ over its coefficient ring.

## `Degree(K, L): RngPad, RngPad -> RngIntElt`

## `Degree(K, L): FldPad, FldPad -> RngIntElt`

## `Degree(K, L): RngPadRes, RngPadRes -> RngIntElt`

## `Degree(K, L): RngPadResExt, RngPadResExt -> RngIntElt`

Return the degree of the local ring or field $K$ relative to its subring $L$.

## `DefiningPolynomial(L): RngPad -> RngUPolElt`

## `DefiningPolynomial(L): FldPad -> RngUPolElt`

## `DefiningPolynomial(L): RngPadRes -> RngUPolElt`

## `DefiningPolynomial(L): RngPadResExt -> RngUPolElt`

Return the minimal polynomial of the generator of $L$ over its coefficient ring. If $L$ is $p$-adic, the polynomial $x - 1$ is returned. For free precision rings and fields, the coefficients of the defining polynomial are given to the default precision of $L$.

## `DefiningPolynomial(K, L): RngPad, RngPad -> RngUPolElt`

## `DefiningPolynomial(K, L): FldPad, FldPad -> RngUPolElt`

## `DefiningPolynomial(K, L): RngPadRes, RngPadRes -> RngUPolElt`

## `DefiningPolynomial(K, L): RngPadResExt, RngPadRes -> RngUPolElt`

## `DefiningPolynomial(K, L): RngPadResExt, RngPadResExt -> RngUPolElt`

Return the minimal polynomial of the generator of $K$ over its coefficient ring $L$.

## `DefiningMap(L): RngPad -> Map`

## `DefiningMap(L): FldPad -> Map`

Given a free precision local ring or field $L$, return the map that was used to define the extension (see Section [Creation of Unbounded Precision Extensions](creation.md#loc-elementary-creation-ext-map) for information on defining extension by maps). If a map was not used, then an error is raised.

## `HasDefiningMap(L): RngPad -> BoolElt, Map`

## `DefiningMap(L): FldPad -> BoolElt, Map`

Given a free precision local ring or field $L$, return `true` if $L$ is defined by a map; if so, the defining map is also returned.

## `PrimeRing(L): RngPad -> RngPad`

## `PrimeRing(L): RngPadRes -> RngPadRes`

## `PrimeRing(L): RngPadResExt -> RngPadRes`

## `PrimeField(L): FldPad -> FldPad`

## `pAdicRing(L): RngPad -> RngPad`

## `pAdicRing(L): RngPadRes -> RngPadRes`

## `pAdicRing(L): RngPadResExt -> RngPadRes`

## `pAdicField(L): FldPad -> FldPad`

Given a local ring or field $L$, return the $p$-adic ring or field which is a subring of $L$.

## `BaseRing(L): RngPad -> RngPad`

## `BaseRing(L): RngPadRes -> RngPadRes`

## `BaseRing(L): RngPadResExt -> Rng`

## `CoefficientRing(L): RngPad -> RngPad`

## `CoefficientRing(L): RngPadRes -> RngPadRes`

## `CoefficientRing(L): RngPadResExt -> Rng`

## `BaseField(L): FldPad -> FldPad`

## `CoefficientField(L): FldPad -> FldPad`

## `BaseRing(L): FldPad -> FldPad`

Given a local ring or field $L$, return the base ring of $L$.

## `ResidueClassField(L): RngPad -> FldFin, Map`

## `ResidueClassField(L): RngPadRes -> FldFin, Map`

## `ResidueClassField(L): RngPadResExt -> FldFin, Map`

Given a local ring or field $L$, return the residue class field $K$ of $L$, and a map from $L$ to $K$.

## `ResidueSystem(R): RngPad -> [RngPadElt]`

## `ResidueSystem(R): RngPadRes -> [RngPadEltRes]`

## `ResidueSystem(R): RngPadResExt -> [RngPadEltResExt]`

## `ResidueSystem(R): FldPad -> [FldPadElt]`

Given a $p$-adic ring or field $R$, compute a set of representatives of the residue class field of $R$ as elements of $R$.

## `UniformizingElement(L): RngPad -> RngPadElt`

## `UniformizingElement(L): RngPadRes -> RngPadResElt`

## `UniformizingElement(L): RngPadResExt -> RngPadResExtElt`

## `UniformizingElement(L): FldPad -> FldPadElt`

Given a local ring or field $L$, return the uniformizing element of $L$.

## `L . 1: RngPad -> RngPadElt`

## `L . 1: RngPadRes -> RngPadResElt`

## `L . 1: RngPadResExt -> RngPadResExtElt`

## `L . 1: FldPad -> FldPadElt`

Given a local ring or field $L$, return an element $\alpha$ of $L$ such that if $K$ is $L$’s base ring or field, then the powers of $\alpha$ give a basis of $L$ as a vector space over $K$.

## `Precision(L): RngPad -> RngIntElt`

## `Precision(L): RngPadRes -> RngIntElt`

## `Precision(L): RngPadResExt -> RngIntElt`

## `Precision(L): FldPad -> RngIntElt`

Given a local ring or field $L$, return the precision with which $L$ has been created. If $L$ is a local ring this is the maximum absolute precision to which its elements can be created. If $L$ is a local field this is the maximum relative precision to which its elements can be created. If $L$ is an unbounded free precision ring or field, then infinity is returned.

## `HasPRoot(R): RngPad -> BoolElt`

Given a local ring $R$ extending ${\mathbb{Z}}_p$ for some prime $p$, decide if $R$ contains a primitive $p$-th root of unity.

## `HasRootOfUnity(L, n): RngPad, RngIntElt -> BoolElt`

Given a local ring $L$ and some positive integer $n$, decide if $L$ contains a primitive $n$th root of unity.

## `Discriminant(R): RngPad -> RngPadElt`

Compute the discriminant of the local ring $R$ over its coefficient ring. Since $R$ is defined by either an inertial polynomial or an Eisenstein one, this is equivalent to computing the discriminant of the defining polynomial.

## `Discriminant(K, k): RngPad, RngPad -> RngPadElt`

Given $p$-adic rings $K/k$, compute the discriminant of $K$ as an extension of $k$.

## `AdditiveGroup(R): RngPadRes -> GrpAb, Map`

The additive group of the $p$-adic quotient $R$ as an abelian group and the isomorphism from this group back to $R$.

## `Example: elinvar (ex-899921)`

We illustrate the functions in this section for rings. Similar constructions can be used for fields.

```magma
> Zp := pAdicRing(5, 20);
> I<a> := UnramifiedExtension(Zp, 3);
> R<x> := PolynomialRing(I);
> L<b> := ext<I | x^3 + 5*a*x^2 + 5>;
> Prime(L);
5
> InertiaDegree(L);
1

```

The inertia degree of $L$ is returned as 1 because $L$ has been defined as a totally ramified extension of $I$. However, the inertia degree of $L$ over $Z_p$ is 3, because $I$ itself is an unramified extension of $Z_p$.

```magma
> InertiaDegree(L, Zp);
3
> Degree(L);
3
> Degree(L, Zp);
9
> DefiningPolynomial(L);
x^3 + 5*a*x^2 + 5
> P<y> := PolynomialRing(Zp);
> DefiningPolynomial(I);
y^3 + 3*y + 3
> BaseRing(L);
Unramified extension defined by the polynomial x^3 + 3*x + 3
 over 5-adic ring mod 5^20
> PrimeRing(L);
5-adic ring mod 5^20
> PrimeRing(I);
5-adic ring mod 5^20
> ResidueClassField(L);
Finite field of size 5^3
Mapping from: RngPad: L to GF(5^3)
> ResidueClassField(I);
Finite field of size 5^3
Mapping from: RngPad: I to GF(5^3)

```

Here, we see that the residue class fields of $I$ and $L$ are identical. This is due to the fact that $L$ is a totally ramified extension of $I$.

```magma
> UniformizingElement(L);
b
> Precision(L);
60
> Precision(I);
20
> R<a> := ext<pAdicRing(2) | 2>;
> DefiningPolynomial(R);
(1 + O(2^20))*$.1^2 + (1 + O(2^20))*$.1 + 1 + O(2^20)
> Precision(R);
Infinity

```

## `AbsoluteRootNumber(K): FldPad -> FldCycElt`

The root number of a $p$-adic extension $K/{{\mathbb{Q}}}_p$ can be computed as in §3.3 of [[Jones and Roberts, 2006](../../references.md#cite-jones-roberts)], with the result returned (using their convention and not Deligne’s) as an element of ${{\mathbb{Q}}}(\zeta_4)$.

## `RootNumber(K): FldPad -> FldCycElt`

The root number of a relative $p$-adic extension can be computed by using `AbsoluteRootNumber` and an induction relation.

## `Example: Padic Rootno Ex (ex-f6c8be)`

We compute the root numbers of some $p$-adic extensions.

```magma
> K := ext<pAdicField(2,20)|Polynomial([10,0,1])>; K;
Totally ramified extension defined by the polynomial x^2 + 10
 over 2-adic field mod 2^20
> RootNumber(K);
-zeta_4
> K := pAdicField(3,40);
> A := AllExtensions(K,3);
> _<x> := PolynomialRing(Integers(K)); // printing
> [<RootNumber(FieldOfFractions(a)),DefiningPolynomial(a)> : a in A];
[
    <zeta_4, x^3 + 3*x + 3>,
    <-zeta_4, x^3 + 6*x + 3>,
    <1, x^3 + 3*x^2 + 3>,
    <1, x^3 + 6*x^2 + 3>,
    <1, x^3 + 6*x^2 + 12>,
    <1, x^3 + 6*x^2 + 21>,
    <zeta_4, x^3 + 3>,
    <zeta_4, x^3 + 12>,
    <zeta_4, x^3 + 21>,
    <1, x^3 + 2*x + 1>
]

```

We take an example where the relative and absolute root numbers differ.

```magma
> K := pAdicField(3,20);
> L := ext<K|Polynomial([3,0,1])>; // both ramified
> M := ext<L|Polynomial([L.1,0,1])>; // both ramified
> RootNumber(M); // relative for M/L
zeta_4
> AbsoluteRootNumber(M); // absolute for M/Q3
-zeta_4
> RootNumber(L); // intermediate field
zeta_4
> X := AbsoluteTotallyRamifiedExtension(Integers(M));
> RootNumber(FieldOfFractions(X));
-zeta_4

```
