---
title: "Creation Functions"
canonical: "https://docs.magma-maths.org/v2.30-1/LocalFields/ValuationRings/creation.html"
source: "https://docs.magma-maths.org/v2.30-1/LocalFields/ValuationRings/creation.md"
part: "Local Fields"
chapter: "Valuation Rings"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Local Fields", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/index-local-fields.md"}
  - {"title": "Valuation Rings", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/ValuationRings/index-valuation-rings.md"}
prev: {"title": "Introduction", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/ValuationRings/introduction.md"}
next: {"title": "Structure Operations", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/ValuationRings/structure.md"}
intrinsics:
  - {"name": "ValuationRing", "signature": "ValuationRing(Q, p): FldRat, RngIntElt -> RngVal"}
  - {"name": "ValuationRing", "signature": "ValuationRing(F, f): FldFunRat, RngUPolElt -> RngVal"}
  - {"name": "ValuationRing", "signature": "ValuationRing(F): FldFunRat -> RngVal"}
  - {"name": "ValuationRing", "signature": "ValuationRing(K, p): FldNum, RngOrdIdl -> RngVal"}
  - {"name": "ValuationRing", "signature": "ValuationRing(K, p): FldFun, RngFunOrdIdl -> RngVal"}
  - {"name": "!", "signature": "V ! r: RngVal, FldFunElt -> RngValElt"}
  - {"name": "!", "signature": "V ! r: RngVal, FldRatElt -> RngValElt"}
---

# Creation Functions

## Creation of Structures

<a id="function-valuationring-fldrat-rngintelt"></a>
### `ValuationRing(Q, p): FldRat, RngIntElt -> RngVal`

Given the rational field $Q$ and a rational prime number $p$, create the valuation ring $R$ corresponding to the discrete non-Archimedean valuation $v_p$, consisting of rational numbers $r$ such that $v_p(r)\geq 0$, that is, $r={x\over y}\in{\mathbb{Q}}$ such that $p\not\vert\, y$.

<a id="function-valuationring-fldfunrat-rngupolelt"></a>
### `ValuationRing(F, f): FldFunRat, RngUPolElt -> RngVal`

Given the rational function field $F$ as a field of fractions of the univariate polynomial ring $K[x]$ over a field $K$, as well as a monic irreducible polynomial $f\in K[x]$, create the valuation ring $R$ corresponding to the discrete non-Archimedean valuation $v_f$. Thus $R$ consists of rational functions ${g\over h}\in F$ with $v_f(g/h)\geq 0$, that is, with $f\not\vert\, h$.

<a id="function-valuationring-fldfunrat"></a>
### `ValuationRing(F): FldFunRat -> RngVal`

Given the rational function field $F$ as a field of fractions of the univariate polynomial ring $K[x]$ over a field $K$, create the valuation ring $R$ corresponding to $v_{\infty}$, consisting of ${g\over h}\in F$ such that $\deg(h)\geq\deg(g)$.

<a id="function-valuationring-fldnum-rngordidl"></a>
### `ValuationRing(K, p): FldNum, RngOrdIdl -> RngVal`

<a id="function-valuationring-fldfun-rngfunordidl"></a>
### `ValuationRing(K, p): FldFun, RngFunOrdIdl -> RngVal`

Given an algebraic number field or function field $K$ and a prime ideal $p$ contained in $K$, construct the valuation ring $R$ corresponding to the valuation given by the prime ideal $p$.

## Creation of Elements

<a id="operation-op-rngval-fldfunelt"></a>
### `V ! r: RngVal, FldFunElt -> RngValElt`

<a id="operation-op-rngval-fldratelt"></a>
### `V ! r: RngVal, FldRatElt -> RngValElt`

Given a valuation ring $V$ and an element of the field of fractions $F$ of $V$ (from which $V$ was created), coerce the element $r$ into $V$. This is only possible for elements $r\in F$ for which the valuation on $V$ is non-negative, an error occurs if this is not the case.
