# Integral differential forms for superelliptic curves

Sabrina Kunzweiler, Stefan Wewers

► To cite this version:

Sabrina Kunzweiler, Stefan Wewers. Integral differential forms for superelliptic curves. Mathematics of Computation, 2025, 10.1090/mcom/4115. hal-05329838

HAL Id: hal-05329838

https://hal.science/hal-05329838v1

Submitted on 24 Oct 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Integral differential forms for superelliptic curves

Sabrina Kunzweiler and Stefan Wewers

## Abstract

Given a superelliptic curve $Y_K : y^n = f(x)$ over a local field $K$, we describe the theoretical background and an implementation of a new algorithm for computing the $\mathfrak{o}_K$-lattice of integral differential forms on $Y_K$. We build on the results of [27] which describe arbitrary regular models of the projective line using only valuations. One novelty of our approach is that we construct an $\mathfrak{o}_K$-model of $Y_K$ with only rational singularities, but which may not be regular.

2020 Mathematics Subject Classification. Primary 11G20. Secondary: 14G10.

# 1 Introduction

## 1.1 Regular models, rational singularities, and integral differential forms
Let $K$ be a local field with ring of integers $\mathfrak{o}_K$ and $Y_K$ a smooth projective curve of genus $g \ge 1$ over $K$. The group of global sections of the sheaf $\Omega_{Y_K/K}$ of differential 1-forms,

$$M_K := H^0(Y_K, \Omega_{Y_K/K}),$$

is a $K$-vector space of dimension $g$. It is equipped with a natural $\mathfrak{o}_K$-lattice $M \subset M_K$, the lattice of integral differential forms. We recall the definition of $M$.

By a model of $Y_K$ we mean a proper, flat and normal relative curve $Y \to S := \text{Spec } \mathfrak{o}_K$ with generic fiber $Y_K$. On such a model there exists a natural extension $\omega_{Y/S}$ of $\Omega_{Y_K/K}$ called the canonical sheaf. It is a coherent $\mathcal{O}_Y$-sheaf such that $\omega_{Y/S}|_{Y_K} = \Omega_{Y_K/K}$. See e.g. [19, §6.4] and [22]. The group of global sections,

$$M_Y := H^0(Y, \omega_{Y/S}),$$

is a full $\mathfrak{o}_K$-lattice of $M_K$.

Let $Y, Y'$ be models of $Y_K$. We say that $Y'$ dominates $Y$ if the identity on $Y_K$ extends (uniquely) to a birational morphism $f : Y' \to Y$. If this is the case then there is a natural embedding of sheaves

$$f_*\omega_{Y'/S} \hookrightarrow \omega_{Y/S},$$

resulting in an inclusion

$$M_{Y'} \subset M_Y.$$

A point $y \in Y$ is a regular point if $\mathcal{O}_{Y,y}$ is a regular local ring. Otherwise, $y$ is called a singularity. If every point of $Y$ is regular, we say that $Y$ is a regular model. If $Y$ is an arbitrary model of $Y_K$, a desingularization of $Y$ is a regular model $Y'$ dominating $Y$. It is known that every model $Y$ has a desingularization ([18]).

We say that a point $y \in Y$ is a rational singularity if for every desingularization $f : Y' \to Y$ we have

$$(f_*\omega_{Y'/S})_y = (\omega_{Y/S})_y.$$

So if $Y$ has only rational singularities then

$$f_*\omega_{Y'/S} = \omega_{Y/S}$$

holds for every desingularization $f : Y' \to Y$.
**Proposition 1.1.** A regular point $y \in Y$ is a rational singularity.

*Proof.* The canonical sheaf $\omega_{Y/S}$ is the dualizing sheaf for the proper morphism $Y \to S$, see [19, §6.4.3] and [22]. By definition, $y$ is a rational singularity if and only if for every desingularization $f : Y' \to Y$ we have

$$ (f_*\omega_{Y'/S})_y = (\omega_{Y/S})_y. $$

By duality, this holds if and only if

$$ (R^1 f_*\mathcal{O}_{Y'})_y = 0. $$

(The latter condition is actually the usual definition of the term *rational singularity*). The statement of the proposition follows now from [17, Proposition 1.2]. □

**Corollary 1.2.** A model $Y$ of $Y_K$ has only rational singularities if and only if the $\mathfrak{O}_K$-lattice

$$ M = M_Y := H^0(Y, \omega_{Y/S}) \subset M_K $$

is minimal, among all lattices of this form. Moreover, this is the case if $Y$ is regular.

**Definition 1.3.** The lattice of integral differential forms for the curve $Y_K$ is the lattice $M_Y \subset M_K$, where $Y$ is any model of $Y_K$ with at most rational singularities.

It is an important problem in computational arithmetic geometry to compute the lattice $M$ explicitly for a given curve $Y_K$. One reason for this is that $M$ is equal to the group of global invariant differential forms on the Néron model of the Jacobian of $Y_K$ (see e.g. [31, §3.2]). Computing (the top exterior power of) the latter is an important step towards the numerical verification of the Birch and Swinnerton-Dyer conjecture for the curve $Y_K$ (see e.g. [9], [31]).

For hyperelliptic curves with semistable reduction, there exists a very compact formula that allows to determine the top exterior power of $M$, see [13] and [14]. In a more general setting, the strategy of choice for computing the lattice $M$ seems to have been to compute a regular model of $Y_K$, using one of the existing implementations, see e.g. [9], [31], [6], [23]. In [9] and [31], the implementation of regular models by Steve Donnelly in Magma ([2]) is used. The algorithm behind this implementation (successively blowing up a model in the singular points) is completely general. However, the current implementation requires some strong restrictions on the curve $Y_K$ (essentially it needs to be a smooth projective plane curve). Tim Dokchitser's Magma script [5], which is based on the preprint [6] requires that the curve $Y_K$ is given as a smooth affine curve in $\mathbb{G}_m^2$ and satisfies an extra 'genericity' condition. It is not clear to us how restrictive this assumption is. The method presented in [23] combines ideas both from [6] and [7]. So far it has only been worked out in the case of hyperelliptic curves.

In the present article, we suggest an alternative approach for computing the lattice of integral differential forms. It applies to some new cases not covered by the implementations mentioned above. It is based on the following two observations:

(a) It is often easier to find a model $Y$ with at most rational singularities (which may not be regular).

(b) In order to compute the lattice $M = M_Y$, it suffices to find explicit equations for the model $Y$ in some étale neighborhood of the generic points of the special fiber. This can also be a lot easier than to find equations for a Zariski covering of the whole model.

Both points are rather obvious, but we hope to show their usefulness by working out a special case in detail and providing a concrete implementation.
**1.2 Superelliptic curves** We continue with the notation used before. The curve $Y_K$ is called superelliptic if it is the smooth projective model of a plane affine curve given by an equation of the form

$$y^n = f(x), \qquad (1.1)$$

where $n \ge 2$ and $f \in K[x]$ is a polynomial of the form

$$f = \prod_{i=1}^{r} f_{i}^{m_{i}},$$

with $f_i \in K[x]$ irreducible, $1 \le m_i < n$ and $\sum_i \deg f_i \ge 3$. For instance, if $n = 2$ then $Y_K$ is a hyperelliptic curve. The crucial assumption we impose on $Y_K$ is:

**Assumption 1.4.** The exponent $n$ in (1.1) is invertible in the ring $\mathfrak{o}_K$.

Under this assumption, we can construct a model $Y$ of $Y_K$ with at most rational singularities as follows. The equation (1.1) presents $Y_K$ as a cyclic cover of the projective line, of degree $n$,

$$\phi_K : Y_K \to X_K := \mathbb{P}_K^1.$$

Let $D_K \subset X_K$ denote the branch locus of this cover (which is equal to the divisor of zeroes of $\mathrm{rad}(f) = \prod_i f_i$, possibly joined by the point $\infty$). Let $X$ be a model of $X_K$. We denote by $D$ the Weil divisor

$$D = D^{\mathrm{vert}} \cup D^{\mathrm{hor}} \qquad (1.2)$$

on $X$, where $D^{\mathrm{vert}} := (X \otimes k)_{\mathrm{red}}$ is the reduced special fiber of $X$ and $D^{\mathrm{hor}}$ is the Zariski closure of $D_K \subset X_K$ inside $X$. Moreover, let $Y$ denote the normalization of $X$ inside the function field of $Y_K$. This is the unique model of $Y_K$ such that the cover $\phi_K$ extends to a finite map

$$\phi : Y \to X.$$

**Theorem 1.5.** Assume the following:

(a) $n$ is invertible in $\mathfrak{o}_K$ (Assumption 1.4).

(b) The model $X$ is regular.

(c) The divisor $D$ is a normal crossing divisor.

Let $U := X \setminus D^{\mathrm{sing}}$ denote the complement of the singular points of the divisor $D$, and $V := \phi^{-1}(U)$. Then $V$ is regular, and the points in $Y \setminus V$ are rational singularities.

In particular, the model $Y$ has at most rational singularities.

*Proof.* It follows from the Assumptions (a)-(c) and a version of Abhyankar's Theorem ([10, Corollary 2.3.4]) that the map $\phi : Y \to X$ is

(i) étale over $X \setminus D$,

(ii) a Kummer cover in an étale neighborhood of a smooth point of $D$, and

(iii) a generalized Kummer cover, as defined in [10, §1], in an étale neighborhood of a singular point of $D$.

Here (ii) means that the cover is given étale locally by an equation $T^m = t$, where $t$ is a local equation for the divisor $D$ and $m | n$. It follows immediately that $V$ is regular.

Let $x \in D^{\mathrm{sing}}$ be a singular point of $D$. Then in an étale neighborhood of $x$, the divisor $D$ is given by an equation $t_1t_2 = 0$, where $(t_1, t_2)$ is a system of parameters for the regular point $x \in X$. Then (iii) means that there exist (after replacing $X$ by a sufficiently small étale neighborhood of $x$ and $Y$ by a connected component of the inverse image)
• positive integers $n_1, n_2$, invertible on $X$,

• roots of unity $\zeta_{n_1}, \zeta_{n_2} \in \mathcal{O}_X$, of order $n_1, n_2$,

• a cyclic subgroup $G = \langle g \rangle \subset \mathbb{Z}/n_1\mathbb{Z} \times \mathbb{Z}/n_2\mathbb{Z}$, and

• a finite covering of $X$-schemes

$$Z := X[T_1, T_2 | T_1^{n_1} = t_1, T_2^{n_2} = t_2] \to Y$$

such that the following holds. The generator $g = (k_1, k_2) \in \mathbb{Z}/n_1\mathbb{Z} \times \mathbb{Z}/n_2\mathbb{Z}$ of $G$ acts on $Z/X$ via

$$g^*T_1 = \zeta_{n_1}^{k_1} \cdot T_1, \quad g^*T_2 = \zeta_{n_2}^{k_2} \cdot T_2.$$

Moreover, $Y = Z/G$.

It is clear that $Z$ is regular. Therefore, the unique point $y \in Y$ lying over $x$ is a *tame quotient singularity*. By the proof of the main result of [3], *tame quotient singularities* are rational singularities<fnref n="1" />. This concludes the proof of the theorem. □

**Remark 1.6.** The statement of Theorem 1.5 applies more generally to covers of curves $\phi_K : Y_X \to X_K$ with monodromy group of order prime to the residue characteristic of $K$. For instance, if $Y_K$ is a smooth plane quartic that admits an action of the Klein 4-group $V$, then $Y_K$ may be realized as a cover of the projective line with monodromy group $V$ and we have to assume that the residue characteristic of $K$ is odd. A classification of such curves and their stable models is given in [4]. The methods developed in our work also apply to this class of curves. An explicit example is worked out in [15, Example 4.34].

More generally if $Y_K$ is any smooth plane quartic and $\phi_K$ the projection to one of the coordinate axes, then Theorem 1.5 applies if the residue characteristic of $K$ is $\ge 5$.

**Remark 1.7.** The model $Y$ from Theorem 1.5 will in general not be regular, but the singularities that appear are rather nice. Apart from being rational, they are *toric singularities* in the sense of [12], and are easy to resolve, see [11, §4.4.2]. We plan to extend our implementation to also compute regular models.

**1.3 Models and valuations** In order to use Theorem 1.5, we need to be able to find a regular model $X$ of $X_K = \mathbb{P}_K^1$ such that the divisor $D$ (which depends on $D_K$ and the model $X$) is a normal crossing divisor. Typically, taking the obvious model $X := \mathbb{P}_{\mathfrak{o}_K}^1$ (which is smooth over $\mathfrak{o}_K$ and hence regular) won't work, because the horizontal part $D^{\text{hor}}$ of $D$ (the closure of $D_K$) may not be regular, and may not intersect the vertical component $D^{\text{vert}} = \mathbb{P}_K^1$ transversally.

Our approach for constructing a suitable model $X$ is an extension of the methods introduced in [28] and [27]. The first observation is that a model $X$ of $X_K$ is uniquely determined by the finite set $V(X)$ of discrete valuations on the function field $F_X = K(x)$ corresponding to irreducible components of the special fiber $X_s$ of $X$ (see [28, §3]). For instance, the model $X = \mathbb{P}_{\mathfrak{o}_K}^1$ of $X_K = \mathbb{P}_K^1$ corresponds to the set $V(X) = \{v_0\}$, where $v_0$ is the *Gauss valuation* on $K(x)$ with respect to the parameter $x$, extending the valuation $v_K$. For an arbitrary model $X$, a valuation $v \in V(X)$ corresponding to an irreducible component $E_v \subset X$ of the special fiber can be described very explicitly, using the results of MacLane ([20]). This description is equivalent to giving an explicit equation for the scheme $X$ which is valid in a Zariski neighborhood of the generic point of $E_v$.

It is a very interesting problem to find explicit equations for $X$ in the neighborhood of an arbitrary point, knowing only the set $V(X)$. While this problem has not been solved in general, one can often extract all the information from the set $V(X)$ that one needs. For instance, in [27, §7] it is shown how to find, given an arbitrary model $X$ of $X_K = \mathbb{P}_K^1$, an enlargement $V' \supset V(X)$ such that the model $X'$ with $V(X') = V'$ is a desingularization $X' \to X$ of $X$. In §3 of the present article, this result is extended to a solution of

<footnote n="1">¹In [3] all schemes are assumed to be of finite type over a field of characteristic zero, or a localization of such schemes. But the proof goes through essentially unchanged in our situation.</footnote>
the problem posed by Theorem 1.5 and formulated at the beginning of this subsection. The essential new ingredient is to allow the set $V(X)$ to contain certain infinite pseudovaluations which correspond to the irreducible horizontal components of the divisor $D$ (i.e. to the points of $D_K$). We remark that a very similar result is obtained in [26], see also [25].

Once we have found a model $X$ satisfying the Conditions (b) and (c) of Theorem 1.5, we easily obtain the set $V(Y)$ of valuations corresponding to the vertical components of the induced model $Y$ of $Y_K$. In fact, $V(Y)$ is just the set of extensions of the valuations in $V(X)$ to the function field of $Y_K$. Since the extension $F_Y/F_X$ is given by the simple equation (1.1), it is very easy to compute $V(Y)^2$

Finally, we come back to our original goal of computing the lattice $M$ of integral differential forms. Using the fact that the canonical sheaf $\omega_{Y/S}$ is divisorial, we have

$$M = \{\omega \in M_K \mid v(\omega) \ge 0 \ \forall v \in V(Y)\}. \qquad (1.3)$$

Here $v(\omega) \in \mathbb{Z}$ denotes the order of vanishing of $\omega$ along the vertical component $E_v \subset Y$ corresponding to $v$, as a rational section of the canonical sheaf $\omega_{Y/S}$. In §4 of the present article we show how to use (1.3) to compute an explicit integral basis of $M$.

We have implemented the method described above for computing a basis of integral differential forms for a superelliptic curve (1.1) satisfying Assumption 1.4. Our implementation is written in Python/Sage ([30]) and builds upon the Sage toolbox MCLF: Models of Curves over Local Fields ([29]).

The article is organized as follows. In §2 we recall the theory of inductive valuations from [20] and prove some technical results used later. In §3 we extend the results of [27] and develop an algorithm for computing a regular model of the projective line $X$ such that the divisor $D$ (1.2) is a normal crossing divisor. In §4 we describe our main algorithm for computing the lattice of integral differential forms. Finally, in §5 we illustrate our results by working out two examples in some detail.

The results of this manuscript have been published in the first author's PhD thesis at the University of Ulm [15].

**Acknowledgments** We thank Raymond van Bommel, Andrew Obus and the anonymous referee for valuable comments that helped to improve our manuscript.

## 2 Inductive valuations

In this section we recall certain results on (pseudo)valuations on a polynomial ring which are originally due to MacLane ([20]). These results have been known and used a lot by experts in valuation theory. In recent years, they also have found many applications in algorithmic number theory (see e.g. [8]) and arithmetic geometry (see e.g. [28], [27], [26]).

In this and the next section, there is quite some overlap with the articles [27] and [26], the reason being that our main assumptions and also our focus are somewhat different. For instance, in this article we can't afford to assume that the residue field $k$ of our ground field $K$ is algebraically closed, a very helpful assumption made in [27] and [26]. Another reason for being a bit repetitive is that we want to treat classical valuations and certain pseudovaluations on an equal footing.

**2.1 MacLane pseudovaluations** Throughout, $K$ denotes a field which is complete with respect to a normalized discrete valuation

$$v_K : K \to \hat{\mathbb{Q}} := \mathbb{Q} \cup \{\infty\}$$

(normalized means that $v_K(K^\times) = \mathbb{Z}$). We denote by $\mathfrak{o}_K$ the valuation ring, $\pi_K$ an arbitrary uniformizer and $k := \mathfrak{o}_K/(\pi_K)$ the residue field of $v_K$.

Let $K[x]$ be the polynomial ring over $K$ in some unknown $x$. A polynomial $f = \sum_i a_i x^i$ is said to be integral if $v_K(a_i) \ge 0$ for all $i$.

<footnote n="2">²The methods from [20] and [28] apply to arbitrary extensions of function fields.</footnote>
**Definition 2.1.** A map

$$v: K[x] \to \hat{\mathbb{Q}}$$

is called a pseudovaluation if $v(1) = 0$ and

(a) $v(fg) = v(f) + v(g),$

(b) $v(f + g) \geq \min(v(f), v(g))$, for all $f, g \in K[x]$.

Here we use the usual conventions regarding the symbol $\infty$. Conditions (a) and (b) show that $I_v := v^{-1}(\infty) \triangleleft K[x]$ is a prime ideal and that $v$ induces a valuation

$$\bar{v}: K[x]/I_v \to \hat{\mathbb{Q}}.$$

If $I_v = (0)$ then $v = \bar{v}$ is simply a valuation in the usual sense. It extends uniquely to a valuation on the fraction field $K(x)$ of $K[x]$, which we will also denote by $v$. We write $k(v)$ for the residue field of $v$.

If $I_v \neq (0)$ then we call $v$ an infinite pseudovaluation. If this is the case, $I_v \triangleleft K[x]$ is a maximal ideal and $K_v := K[x]/I_v$ is a finite field extension of $K$. We also write $k(v)$ for the residue field of the induced valuation $\bar{v}$ on $K_v$.

Assume that (a) and (b) hold. Then $v$ is called a MacLane pseudovaluation if moreover the following holds:

(c) $v|_K = v_K,$

(d) $v(x) \geq 0,$

(e) $v$ is discrete, i.e. $v(K[x]) \cap \mathbb{Q} = \frac{1}{e_v}\mathbb{Z}$, for some positive integer $e_v$,

(f) if $I_v = (0)$, then the extension $k(v)/k$ has transcendence degree one (note that $k \subset k(v)$ because of Condition (c)).

We write

$$V(K[x])^* = V(K[x]) \dot{\cup} V(K[x])_{\infty}$$

for the set of all MacLane pseudovaluations, given by the disjoint union of the subset of all MacLane valuations, $V(K[x])$, and the subset of the infinite MacLane pseudovaluations, $V(K[x])_{\infty}$. We define a partial order $\leq$ on $V(K[x])^*$ by

$$v \leq v' \quad :\Leftrightarrow \quad v(f) \leq v'(f) \quad \forall f \in K[x].$$

**Example 2.2.** The Gauss valuation $v_0: K[x] \to \hat{\mathbb{Q}}$ is defined by

$$v_0(\sum_{i=0}^{d} a_i x^i) := \min_i v_K(a_i),$$

for polynomials $f = \sum_i a_i x^i \in K[x]$. One checks that $v$ is a MacLane valuation with residue field $k(v_0) = k(\bar{x})$ (where $\bar{x}$ is the image of $x$ in $k(v_0)$).

It is immediately clear from the above definitions that the Gauss valuation $v_0$ is the least element of $V(K[x])^*$. Also, $f \in K[x]$ is integral if and only if $v_0(f) \geq 0$ if and only if $v(f) \geq 0$ for all $v \in V(K[x])$.

**Remark 2.3.** Let $v \in V(K[x])_{\infty}$ be an infinite pseudovaluation. Then $I_v = (g)$, for a unique monic, integral and irreducible polynomial $g$. Since $K_v := K[x]/(g)$ is a finite field extension of $K$ and $K$ is complete with respect to $v_K$, the induced valuation $\bar{v}$ is the unique extension of $v_K$ to $K_v$. It follows that $v$ is uniquely determined by $g$. Conversely, if $g \in K[x]$ is monic, irreducible and integral, then there exists a unique infinite MacLane pseudovaluation $v$ such that $v(g) = \infty$.

It also follows that an infinite pseudovaluation is a maximal element of $V(K[x])$ (we will see later that they are exactly the maximal elements).
**Remark 2.4.** To $v \in V(K[x])^*$ we can associate the multiplicative seminorm

$$ \|\cdot\|_v : K[x] \to \mathbb{R}_{\ge 0}, \quad \|f\|_v := q^{-v(f)}, $$

where $q > 1$ is fixed. By Condition (c), $\|\cdot\|_v$ is an extension of the nonarchimedean absolute value $\|\cdot\|$ on $K$. Therefore, we may regard $V(K[x])^*$ as a subset of the analytic $K$-space $(A_K^1)^{\text{an}}$, as defined in [1]. Condition (d) means that $\|\cdot\|_v$ lies on the closed unit disk, and Condition (e) and (f) mean that $\|\cdot\|_v$ is either a point of type I (if $v$ is an infinite pseudovaluation), or a point of type II (if $v$ is a MacLane valuation). See [1, §4.2].

Some of the results in this article could probably be expressed more elegantly using the language of nonarchimedean analytic spaces. However, since the core of this work deals very explicitly with MacLane valuations as defined above, we decided to phrase everything in this language.

**2.2 Key polynomials and augmentation** A MacLane valuation $v \in V(K[x])$ can be augmented with a key polynomial $\phi \in K[x]$ to obtain a valuation $v' \ge v$. This process is explained in the following.

**Definition 2.5.** Let $v \in V(K[x])$ be a MacLane valuation and $f, g, h \in K[x]$.

(i) We say that $f, g$ are $v$-equivalent (written as $f \sim_v g$) if $v(f - g) > v(f) = v(g)$.

(ii) The polynomial $f$ is said to $v$-divide $g$ (written as $f|_v g$) if $g \sim_v fh$, for some $h \in K[x]$. It is called $v$-irreducible if $f|_v gh$ implies $f|_v g$ or $f|_v h$, and $v$-minimal if $f|_v g$ implies $\deg(f) \le \deg(g)$.

(iii) A polynomial $\phi \in K[x]$ is called a key polynomial for $v$ if $\phi$ is monic, integral, $v$-irreducible and $v$-minimal.

See [20, §1], or [28, §4.1.1].

**Example 2.6.** Let $v_0 : \mathbb{Q}_3[x] \to \hat{\mathbb{Q}}$ be the Gauss valuation (Example 2.2). It is easy to see that all monic linear polynomials are key polynomials for $v_0$.

The polynomial $f = x^2 + x + 1 \in \mathbb{Q}_3[x]$ is not a key polynomial for $v_0$ since it is not $v_0$-irreducible. To see this, note that

$$ 0 = v_0((x+2)^2) = v_0(f) < v_0((x+2)^2 - f) = v_0(3x+3) = 1. $$

On the other hand, the quadratic polynomial $g = x^2 + 1$ is a key polynomial for $v_0$. In general, one can show that any monic polynomial $\phi$ of positive degree is a key polynomial for $v_0$ if and only if $v_0(\phi) = 0$ and the reduction $\bar{\phi} \in \mathbb{F}_3[x]$ is irreducible, see [28, Lemma 4.8].

**Remark 2.7.** One immediate consequence of these definitions is that any key polynomial $\phi$ for $v$ is irreducible (as an element of $K[x]$).

Let $\phi$ be a key polynomial for $v \in V(K[x])$ and $\lambda \in \hat{\mathbb{Q}}$ such that $\lambda \ge v(\phi)$. Then one can define a new MacLane pseudovaluation

$$ v' = [v, v'(\phi) = \lambda] \in V(K[x])^* $$

as follows. Any polynomial $f \in K[x]$ can be uniquely written as

$$ f = \sum_i f_i \phi^i, $$

with $\deg f_i < \deg \phi$. Then

$$ v'(f) := \min_i (v(f_i) + i \cdot \lambda). $$

See [28, Definition 4.9]. We call $v'$ the augmentation of $v$ with respect to $(\phi, \lambda)$. It holds that $v \le v'$ and $v < v'$ if and only if $v(\phi) < \lambda$, see [20, §5]. In the latter case we say that $v'$ is a proper augmentation$^3$ of $v$. Also, $v'$ is a MacLane valuation if and only if $\lambda \ne \infty$.

<footnote>$^3$In [20] and [28], only proper augmentations are called augmentations. Here we follow the convention introduced in [27].</footnote>
**Remark 2.8.** If $v' = [v, v'(\phi) = \lambda]$ is an augmentation of $v$, then $\lambda$ and $\deg(\phi)$ only depend on $v$ and $v'$, but $\phi$ does not. More precisely, if $w = [v, w(\psi) = \mu]$ is another augmentation of $v$ then $v' = w$ if and only if $\lambda = \mu$, $\deg(\phi) = \deg(\psi)$ and

$$v(\phi - \psi) \geq \lambda.$$

See [20, Theorem 15.3] or [28, Theorem 4.33].

**2.3 Representing MacLane pseudovaluations as inductive valuations** The process of augmenting a given valuation can of course be iterated, giving rise to the notion of an inductive valuation. The main result of [20] is that every MacLane pseudovaluation is inductive.

**Definition 2.9.** A MacLane pseudovaluation $v$ is called inductive if there exists a chain of MacLane pseudovaluations

$$v_0 = v_0, v_1, \dots, v_n = v,$$

such that $v_i$ is a proper augmentation of $v_{i-1}$, for $i = 1, \dots, n$. We call $v_0, \dots, v_n$ an augmentation chain representing $v$.

We write an inductive valuation as in Definition 2.10 as

$$v = [v_0, v_1(\phi_1) = \lambda_1, \dots, v_n(\phi_n) = \lambda_n]. \qquad (2.1)$$

Here it is understood that $v_0 = v_0$ is the Gauss valuation, that $v_n = v$, that $\phi_i$ is a key polynomial for $v_{i-1}$, $\lambda_i > v_{i-1}(\phi_i)$ and that $v_i = [v_{i-1}, v_i(\phi_i) = \lambda_i]$. Also, $\lambda_i \neq \infty$ for $i < n$. We say that the augmentation chain $v_0, \dots, v_n$ is minimal if

$$\deg \phi_1 < \dots < \deg \phi_n. \qquad (2.2)$$

**Proposition 2.10.** Let $v \in V(K[x])^*$. Then there exists a unique minimal augmentation chain representing $v$. In particular, $v$ is inductive.

*Proof.* This is the combination of Theorem 8.1 and Theorem 15.3 of [20]. See also Theorem 4.31 and Theorem 4.33 of [28]. □

**Definition 2.11.** Given $v \in V(K[x])^*$, let $v_0, \dots, v_n$ be the unique minimal augmentation chain representing $v$. The valuations $v_0, \dots, v_{n-1}$ are called the *predecessors* of $v$. We set

$$P(v) := \{v_0, \dots, v_{n-1}\}.$$

We call $v_{n-1}$ the *immediate predecessor* of $v$. Note that $v_0 = v_0$ is the Gauss valuation, by definition.

**Lemma 2.12.** Let $v, w \in V(K[x])^*$ be MacLane pseudovaluations such that $v \le w$. Then $P(v) \subset P(w)$.

*Proof.* This follows from [28, Corollary 4.37]. □

**2.4 Residue classes and discoids** Let $v \in V(K[x])$ be a MacLane valuation. The goal in this subsection is to further analyze the set

$$D_v := \{w \in V(K[x])^* \mid v \le w\}.$$

We set $D_v^\circ := D_v \setminus \{v\}$.

Let $O_v \subset K(x)$ be the valuation ring of $v$. We consider the integral domain

$$A_v := \{f \in K[x] \mid v(f) \ge 0\} = K[x] \cap O_v.$$

This is a normal domain in its fraction field $K(x)$.

**Lemma 2.13.** The prime ideals of height one of $A_v$ are the following:

$$\bullet p_v := \{f \in K[x] \mid v(f) > 0\}, \text{ and}$$
• $\mathfrak{p}_g := A_v \cap (K[x] \cdot g)$, where $g \in K[x]$ runs over all irreducible and monic polynomials.

Moreover, the localization of $A_v$ at any one of these prime ideals is a discrete valuation ring. In particular,

$$(A_v)_{\mathfrak{p}_v} = \mathcal{O}_v.$$

*Proof.* Let $v_g$ denote the discrete valuation on $K(x)$ corresponding to an irreducible and monic polynomial $g \in K[x]$. Its valuation ring is the localization of $K[x]$ at the maximal ideal $(g) \triangleleft K[x]$, $\mathcal{O}_{v_g} = K[x]_{(g)}$. Since $K[x]$ is a principal ideal domain, we have $K[x] = \cap_g \mathcal{O}_{v_g}$. Therefore,

$$A_v = \left( \bigcap_g \mathcal{O}_{v_g} \right) \cap \mathcal{O}_v. \qquad (2.3)$$

It follows that $A_v$ is a Krull ring, see [21, §12].

It is easy to see that the family of discrete valuation rings $(\mathcal{O}_{v_g}, \mathcal{O}_v)$ is a minimal defining family for $A_v$, i.e. (2.3) holds, and none of these rings contains the intersection of the others. By [21, Theorem 12.3], $A_v$ has a unique minimal defining family, consisting precisely of the localizations of the prime ideals of $A_v$ of height one. The lemma follows immediately. $\square$

The lemma implies in particular that the field of fractions of the residue ring

$$\bar{A}_v := A_v / \mathfrak{p}_v$$

is equal to the residue field $k(v)$ of $v$. It is proved in [28, §4.1.3] that

$$\bar{A}_v \cong k'[t] \qquad (2.4)$$

is a polynomial ring in one variable over a finite extension $k'/k$.

**Lemma 2.14.** (i) For $w \in D_v^\circ$ the set

$$\mathfrak{m}_w := A_v \cap \mathfrak{p}_w = \{f \in K[x] \mid v(f) \ge 0, w(f) > 0\}$$

is a maximal ideal of $A_v$ containing $\mathfrak{p}_v$.

(ii) The map

$$w \mapsto \bar{\mathfrak{m}}_w := \mathfrak{m}_w / \mathfrak{p}_v \qquad (2.5)$$

is a surjective map from $D_v^\circ$ onto the set of all maximal ideals of $\bar{A}_v$.

*Proof.* Let $w \in D_v^\circ$, i.e. $w > v$. Then obviously $\mathfrak{m}_w$ is a prime ideal of $A_v$ properly containing $\mathfrak{p}_v$. Therefore, $\bar{\mathfrak{m}}_w = \mathfrak{m}_w / \mathfrak{p}_v$ is a nonzero prime ideal of $\bar{A}_v$. Since $\bar{A}_v$ is a polynomial ring over a field, $\bar{\mathfrak{m}}_w$ is actually a maximal ideal. It follows that $\mathfrak{m}_v$ is maximal, and (i) is proved.

Let $\bar{\mathfrak{m}} \triangleleft \bar{A}_v$ be a maximal ideal and $\mathfrak{m} \triangleleft A_v$ its inverse image. By (2.4), $\bar{A}_v$ is a principal ideal domain, so $\bar{\mathfrak{m}} = (\bar{f})$, where $\bar{f}$ is the image of a polynomial $f \in \mathfrak{m}$. It follows from [20, Theorem 13.1] that there exists a key polynomial $\phi$ for $v$ such that $\phi|_v f$. We set

$$w := [v, w(\phi) = \infty] \in V(K[x])_\infty.$$

Then $v < w$ and $0 = v(f) < w(f)$. We conclude that

$$\mathfrak{m}_w = A_v \cap \mathfrak{p}_w = \mathfrak{m},$$

as both sides are maximal ideals which contain $\mathfrak{p}_v$ and the element $f$. This proves (ii). $\square$

**Definition 2.15.** The fibers of the map (2.5) are called the residue classes of $D_v$. We write $D_v(\bar{\mathfrak{m}})$ for the residue class corresponding to a maximal ideal $\bar{\mathfrak{m}} \triangleleft \bar{A}_v$, and $D_v(w)$ for the residue class containing an element $w \in D_v^\circ$.
**Remark 2.16.** Let $\phi$ be a key polynomial for $v$. Then all proper augmentations

$$v' := [v, v'(\phi) = \lambda],$$

with $\lambda > v(\phi)$, lie in the same residue class, which we denote by $D_v(\phi)$. Using Remark 2.8 one easily checks that two key polynomials define the same residue class if and only if they are $v$-equivalent. Moreover, it follows from [20, Theorem 13.1] that every residue class is of the form $D_v(\phi)$, for some key polynomial $\phi$.

**Lemma 2.17.** Let $w_1, w_2 \in D_v^\circ$. If $w_1 \le w_2$ then $w_1, w_2$ lie in the same residue class.

*Proof.* If $w_1 \le w_2$ then

$$\mathfrak{m}_{w_1} = A_v \cap \mathfrak{p}_{w_1} \subset A_v \cap \mathfrak{p}_{w_2} = \mathfrak{m}_{w_2}.$$

Since both ideals are maximal, we actually have equality.

□

**Definition 2.18.** Let $g \in K[x]$ be monic, integral and irreducible, and $t \in \mathbb{Q}$, $t \ge 0$. We set

$$D(g, t) := \{v \in V(K[x])^* \mid v(g) \ge t\}, \quad D(g, t)^\circ := \{v \in V(K[x])^* \mid v(g) > t\}.$$

A subset $D \subset V(K[x])^*$ of the form $D(g, t)$ (resp. $D^\circ(g, t)$) as above is called a closed (resp. an open) discoid.

**Proposition 2.19.** Every closed discoid $D$ is of the form

$$D = D_v := \{w \in V(K[x])^* \mid v \le w\},$$

where $v$ is the minimal element of $D$.

*Proof.* This is proved in [28, §4.4].

□

**Lemma 2.20.** Let $g \in K[x]$ be monic, integral and irreducible, and let $v_\xi$ be the MacLane pseudovaluation such that $v_\xi(g) = \infty$. Then

$$D_v = D(g, t), \quad \text{where } t := v(g),$$

for any MacLane valuation $v \le v_\xi$. Moreover, the residue class containing $v_\xi$ is

$$D_v(v_\xi) = D^\circ(g, t).$$

*Proof.* By Proposition 2.19 we have

$$D(g, t) = D_{v_0},$$

where $v_0$ is the minimal element of the discoid $D(g, t)$. By construction and the assumption we have $v_0 \le v < v_\xi$, and these are all elements of $D(g, t)$. It follows that $v_0(g) = v(g) = t$. We can find $a, b \in \mathbb{N}$ such that $v_0(f) = v(f) = 0$, where $f := g^a/\pi_K^b$. But $v_\xi(f) = \infty > 0$, so $f \in \mathfrak{m} \setminus \mathfrak{p}_v$, where $\mathfrak{m} \subsetneq A_v$ is the maximal ideal corresponding to the residue class $D_{v_0}(v_\xi)$. Since $v(f) = v_0(f) = 0$, $v$ does not lie in the residue class $D_{v_0}(v_\xi)$. On the other hand, $v_0 \le v < v_\xi$. Now Lemma 2.17 shows that $v = v_0$, proving the first part of the proposition.

By construction, $\mathfrak{p}_g := A_v \cap (K[x] \cdot g)$ is the only minimal prime ideal of $A_v$ containing $f$. Therefore, $\mathfrak{m}$, which contains $\mathfrak{p}_g$, is the only maximal ideal of $A_v$ containing $f$. This implies

$$D_v(v_\xi) = \{w \in D_{v_0} \mid w(f) > 0\}.$$

But for all $w \in D_v$ we have $w(f) > 0$ if and only if $w(g) > t$. This proves the second part of the proposition, and we are done.

□

**Lemma 2.21.** Let $v \in V(K[x])$ be a MacLane valuation. Let $g \in K[x]$ be monic and irreducible (but not necessarily integral) and $\xi := (g) \in |\mathbb{P}_K^1|$. Let $a, b \in \mathbb{Z}$, with $a > 0$, such that

$$v(f) = 0, \quad \text{where } f := \frac{g^a}{\pi_K^b}.$$

Let $\bar{f} \in \bar{A}_v$ be the image of $f$. Then the following are equivalent:
(a) $\tilde{f} \in \bar{A}_v$ is not a unit,

(b) $v < v_\xi$.

*Proof.* The implication (b)⇒(a) has been shown during the proof of Proposition 2.20. To prove (a)⇒(b), we assume that $\tilde{f}$ is not a unit. As in the proof of Lemma 2.14 we conclude that there exists a MacLane pseudovaluation $w$ such that $v \le w$ and $v(f) < w(f)$. Then we also have $v(g) < w(g)$.

Set $t := v(g)$ and let $v_0$ be the minimal element of the discoid $D(g, t)$, such that $D_{v_0} = D(g, t)$ (Lemma 2.20). Since $w(g) > v(g) = t$, Lemma 2.20 also shows that $w$ and $v_\xi$ lie in the same residue class. If $v = v_0$, then clearly $v \le v_\xi$ and we are done. Otherwise, $v < w$ and Lemma 2.17 shows that $v, w$ and $v_\xi$ all lie in the same residue class of $D_{v_0}$. But then $v(g) > t$ by Lemma 2.20, which is a contradiction. This completes the proof of the lemma. □

**Lemma 2.22.** *Two elements $w_1, w_2 \in D_v^\circ$ lie in the same residue class if and only if there exists $u \in D_v^\circ$ such that $u \le w_1, w_2$.*

*Proof.* Suppose that there exists $u \in D_v^\circ$ with $u \le w_1, w_2$. Then Lemma 2.17 immediately implies that $w_1, w_2$ lie in the same residue class. Conversely, assume that $w_1, w_2$ both lie in the same residue class as the infinite pseudovaluation $v_\xi$, with $\xi = (g)$. Lemma 2.20 implies that

$$t := v(g) < t_1 := \min(w_1(g), w_2(g)).$$

Let $u$ be the minimal element of the discoid $D(g, t_1)$. Then $D_u = D(g, t_1)$, by Proposition 2.19. Therefore, $v < u \le w_1, w_2$. This completes the proof of the lemma. □

**2.5 Valuation trees** Using the results of the previous subsection, we will now prove that any finite subset of $V(K[x])^*$ can be extended in such a way that it forms a finite rooted tree.

**Proposition 2.23.** *The subset*

$$\{w \mid w \le v\} \subset V(K[x])^*$$

is totally ordered, for all $v \in V(K[x])^*$.

*Proof.* It suffices to prove this when $v = v_\xi$ is an infinite pseudovaluation. If $w \le v_\xi$ then

$$D_w = D(g, t),$$

where $g$ is the irreducible polynomial corresponding to $\xi$ and $t := w(g)$ (Lemma 2.20). Given another valuation $w' \le v_\xi$, we conclude that

$$w \le w' \Leftrightarrow w(g) \le w'(g).$$

Therefore, any two valuations $w, w' \le v_\xi$ are comparable. □

**Proposition 2.24.** *For any two elements $v, w \in V(K[x])^*$, the set*

$$\{u \in V(K[x])^* \mid u \le v, u \le w\}$$

has a unique maximal element.

*Proof.* Choose an infinite pseudovaluation $v_\xi$ such that $v \le v_\xi$, and let $g$ denote the corresponding irreducible polynomial. Set

$$t := \min\{v(g), w(g)\}$$

and let $u$ be the minimal element of the discoid $D(g, t)$. Then

$$D_u = D(g, t),$$
by Lemma 2.20. In particular, $u \le v, w$.

Assume that there exists $u' \in V(K[x])^*$ such that $u < u' \le v, w$. Then Lemma 2.17 shows that $u', v, w$ all lie in the same residue class of the discoid $D_u$ as $v_\xi$. But then Lemma 2.20 shows that $v(g), w(t) > t$, which contradicts the definition of $t$. We conclude that $u$ is the desired maximal element. The uniqueness is clear. $\square$

**Definition 2.25.** Given $v, w \in V(K[x])^*$, the maximal elements $u$ from the previous lemma is called the infimum of $v, w$,

$$ \inf(v, w) := \max\{u \mid u \le v, w\}. $$

**Corollary 2.26.** Let $V \subset V(K[x])^*$ be a finite nonempty subset. Assume that $V$ is inf-closed, i.e. for $v, w \in V$ we also have $\inf(v, w) \in V$. Then $V$, as a partially ordered set, is a rooted tree, i.e. for all $v \in V$ the subset

$$ \{w \in V \mid w \le v\} $$

is well ordered, and there exists a minimal element $v_0 \in V$ (the root).

**Remark 2.27.** A finite, inf-closed subset $V \subset V(K[x])^*$ is called a valuation tree. We may consider a valuation tree as a finite rooted tree in the sense of graph theory, as follows. The set of (directed) edges is the set of pairs $(v, w)$, with $v, w \in V$, such that $v < w$ and there is no element $u \in V$ with $v < u < w$. The two valuations $v, w$ (nodes of $V$) are then said to be adjacent. The root of $V$ is the minimal element $v_0$.

**2.6 Algorithmic tools** The results presented in this section have been implemented in the computer algebra system Sage ([30]) and the Sage toolbox MCLF ([29]). The algorithms described in §3 and §4 crucially rely on these implementations.

Sage contains a very general concept of discrete (pseudo)valuations on rings and fields. See the relevant chapter of the documentation. For instance, it is possible to create and compute with inductive valuations $v$ on a polynomial ring $K[x]$ and the function field $K(x)$, where $K$ is an arbitrary field equipped with a discrete (and possibly trivial) valuation $v_K$. Given $v$ it is possible to construct an arbitrary augmentation

$$ v' = [v, v'(\phi) = \lambda] $$

(§2.2). One can evaluate $v(f)$, for polynomials and rational functions $f$, and compute the reduction $\tilde{f} \in k(v)$ if $v(f) \ge 0$. Given an irreducible element of the residue ring $\psi \in \tilde{A}_v = k'[t]$, one can 'lift' $\psi$ to a key polynomial $\phi$ for $v$ (in the situation of Remark 2.16, find $\phi$ such that $D_v(\phi) = D_v(\mathfrak{m})$, where $\tilde{\mathfrak{m}} := \mathfrak{m}/\mathfrak{p}_v = (\psi)$). Finally, given a square free polynomial $f \in K[x]$, it is possible to find arbitrarily good approximations $v$ for the MacLane pseudovaluations $v_\xi$ corresponding to the irreducible factors $g \mid f, g \in \tilde{K}[x]$, over the completion $\tilde{K}$ of $K$ with respect to $v_K$. When $f = g$ is already irreducible over $\tilde{K}$, then the algorithm computes the inductive pseudovaluation

$$ v_{\xi} = [v_0, v_1(\phi_1) = \lambda_1, \dots, v_n(g) = \infty]. $$

In the general case, the result of the algorithm can be used to find an arbitrarily good approximate factorization of $f$ over $\tilde{K}$.

**Remark 2.28.** So while we always assume in this article that $K$ is complete with respect to $v_K$, we do not actually work with complete fields at all when doing explicit computations. This is not a serious restriction for applications, and it makes it much easier to obtain results which are provably correct.

The results of §2.4 on discoids and residue classes, and of §2.5 on valuation trees have been implemented within the module berkovich, which is a part of the Sage toolbox MCLF. The main object one can work with is the Berkovich line over a discretely valued field $(K, v_K)$; it represents the analytification $X^{\text{an}}$ of the projective line $X = \mathbb{P}_{\tilde{K}}^1$ over the completion $\tilde{K}$ of $K$, see Remark 2.4. There are three types of points on this space one can use: points of Type I (corresponding to infinite pseudovaluations on $F_X := K(x)$), Type II (corresponding to true valuations on $F_X$) and Type V. The latter are not actual points on the analytic
space $X^{\text{an}}$, but rather on the *adic space* $X^{\text{ad}}$. They correspond to certain valuations of rank 2 and, in the language of §2.4 to residue classes of discoids. These points form a partially ordered set (of which $V(K[x])^*$ is a subset), corresponding to the closed unit disk. Making essential use of the results of §2.4 and §2.5, it is possible to evaluate inequalities, compute infima (Definition 2.25) and build the valuation tree spanned by a given finite set of points (Remark 2.27).

### 3 Regular models of the projective line

We fix a discretely valued field $(K, v_K)$ as in the previous section and a smooth projective curve $X_K$ over $K$. Let $F_X$ denote the function field of $X_K$. By a *model* of $X_K$ we will mean a normal $\mathfrak{o}_K$-model, i.e. an $\mathfrak{o}_K$-scheme $X \to \text{Spec} \mathfrak{o}_K$ which is proper and flat and whose generic fiber is equal to $X_K$. In this section we will mostly be interested in the case $X_K = \mathbb{P}_K^1$. We then write $F_X = K(x)$.

Let $D_K \subset X_K$ be an effective, reduced divisor (in other words, $D_K$ is a finite set of closed points of $X_K$). For any model $X$ of $X_K$, the closure $D^{\text{hor}} \subset X$ of $D_K$ is a closed subscheme of dimension 1, flat over $\text{Spec} \mathfrak{o}_K$. We call $D^{\text{hor}}$ a *horizontal divisor* on the model $X$.

The following result is well known (combine, for instance, the main result of [18] with [19, Theorem 9.2.26.]).

**Proposition 3.1.** Let $D_K \subset X_K$ be an effective reduced divisor. There exists a *model* $X$ of $X_K$ with the following properties.

(i) $X$ is regular.

(ii) Let $D^{\text{hor}} \subset X$ be the closure of $D_K$ inside $X$ and $D^{\text{vert}} := X_s \subset X$ the reduced special fiber. Then $D := D^{\text{vert}} \cup D^{\text{hor}}$ is a normal crossing divisor on $X$.

The goal of this section is to make the proof of Proposition 3.1 explicit in the case where $X_K = \mathbb{P}_K^1$, and describe an algorithm for computing such a model $X$ (see §3.4). We also describe an actual implementation of this algorithm. We use the methods of [28] and [27]. See [26] for a slightly different treatment of essentially the same results.

### 3.1 Models and valuations
Given a normal model $X$ of $X_K$, we let $X_s$ denote the special fiber. Here we consider $X_s$ as a closed subscheme of $X$ with the reduced subscheme structure. We can write $X_s$ as a union of irreducible components, which we usually call $E_i$,

$$X_s = \cup_i E_i.$$

So each $E_i \subset X$ is a prime *Weil divisor* and thus gives rise to a discrete valuation

$$v_i = v_{E_i} : F_X \to \mathbb{Q} \cup \{\infty\}.$$

The restriction of $v_i$ to the base field $K$ is equivalent to $v_K$. We normalize $v_i$ in such a way that we have equality, $v_i|_K = v_K$. Then the value group of $v_i$ is of the form $v_i(F_X^\times) = m_i^{-1}\mathbb{Z}$ for a positive integer $m_i$ (recall that $v_K(K^\times) = \mathbb{Z}$). We call $m_i$ the *multiplicity* of the component $E_i$ in the special fiber.

A discrete valuation $v$ on $F_X$ is called *geometric* if $v|_K = v_K$ and the residue field $k(v)$ has transcendence degree one over $k$. Let $V(F_X)$ denote the set of all geometric valuations. Given a normal $\mathfrak{o}_K$-model $X$ of $X_K$, we write $V(X)$ for the finite nonempty set of geometric valuations corresponding to the irreducible components of $X_s$. Then the association

$$X \mapsto V(X)$$

is an order-reversing bijection between the set of all models of $X_K$ and the set of all finite, nonempty subsets of $V(F)$ ([28, Corollary 3.18]). This will allow us to construct models of $X$ in an easy way.
It will be useful to consider the following enhancement of the above bijection. Let $|X_K|$ denote the set of all closed points of $X_K$. For $\xi \in |X_K|$ we let $\mathcal{O}_\xi \subset F_X$ denote the local ring of $\xi$. We define a map

$$v_{\xi}: \left\{ \begin{array}{rcl} F_X & \to & \mathbb{Q} \cup \{\pm\infty\} \\ f = g/h & \mapsto & v_K(g(\xi)) - v_K(h(\xi)). \end{array} \right.$$

Here $g, h \in \mathcal{O}_\xi$ are chosen such that not both lie in the maximal ideal of $\mathcal{O}_\xi$. We use $g(\xi), h(\xi)$ as a suggestive notation for the images of $g, h$ in the residue field $k(\xi)$ of the valuation ring $\mathcal{O}_\xi$ (which is a finite extension of $K$), and $v_K$ is used here for the unique extension of $v_K$ to $k(\xi)$. We call such a map $v_\xi$ a geometric infinite pseudovaluation on $F_X$.

We note that $v_\xi|_{K} = v_K$, and that $v_\xi$ uniquely determines the point $\xi \in X_K$. For instance,

$$\mathcal{O}_{\xi} = \{f \in F_X \mid v_{\xi}(f) > -\infty\}, \quad \mathfrak{m}_{\xi} = \{f \in F_X \mid v_{\xi}(f) = \infty\}.$$

But $v_\xi$ should not be confused with the discrete valuation corresponding to the valuation ring $\mathcal{O}_\xi$.

We set

$$V(F_X)^* := V(F_X) \cup \{v_\xi \mid \xi \in |X_K|\}.$$

The elements of this set are called geometric pseudovaluations. The subset of infinite pseudovaluations is denoted $V(F_X)_\infty$.

Given a pair $(X, D^{\text{hor}})$ consisting of a model $X$ of $X_K$ and a horizontal divisor $D^{\text{hor}} \subset X$, we set

$$V^*(X, D) := V(X) \cup \{v_\xi \mid \xi \in D_K\}.$$

We have the following formal consequence of [28, Corollary 3.18].

**Proposition 3.2.** *The association*

$$(X, D^{\text{hor}}) \mapsto V(X, D^{\text{hor}})$$

defines a bijection between the following two sets:

* Pairs $(X, D^{\text{hor}})$, where $X$ is a model of $X_K$ and $D^{\text{hor}} \subset X$ a horizontal divisor.

* Finite subsets of $V(F_X)^*$ with nonempty intersection with $V(F_X)$.

From now on, we set $X_K := \mathbb{P}_K^1$ and hence $F_X = K(x)$ is the rational function field in $x$. Then there is a certain subset of $V(F_X)^*$ corresponding to MacLane pseudovaluations, as defined in the previous section. More precisely:

**Remark 3.3.** (i) Let $v \in V(K[x])^*$ be a MacLane pseudovaluation (Definition 2.1). Then

$$v\left(\frac{f}{g}\right) = v(f) - v(g), \quad \text{with } f, g \in K[x], \gcd(f, g) = 1,$$

defines an extension of $v$ to a geometric pseudovaluation $v: F_X \to \mathbb{Q} \cup \{\pm\infty\}$. We obtain an inclusion

$$V(K[x])^* \hookrightarrow V(F_X)^*$$

whose image is the subset of geometric pseudovaluations $v$ such that $v(x) \ge 0$. We will henceforth consider $V(K[x])^*$ as a subset of $V(F_X)^*$.

(ii) It is clear that

$$V(K(x))^* = V(K[x])^* \cup V(K[x^{-1}])^*,$$

so every geometric pseudovaluation is a MacLane pseudovaluation either with respect to $x$ or to $x^{-1}$. As we will see, restricting attention to the subset $V(K[x])^*$ is not a serious restriction, and it considerably simplifies the exposition. In our implementation ([16]) this restriction is avoided.
**3.2 Explicit description of the divisor D** Let us fix a finite set $V^* \subset V(F_X)^*$ containing at least one finite valuation. Let $(X, D^{\text{hor}})$ be the model of $(X_K = \mathbb{P}_K^1, D_K)$ corresponding to $V^*$ via Proposition 3.2. Let $X_s$ denote the special fiber of $X$, considered as a closed subscheme with its reduced subscheme structure. Finally, set $D := X_s \cup D^{\text{hor}}$.

By construction, the irreducible components of $D$ correspond to the elements of $V^*$,

$$D = \bigcup_{v \in V^*} E_v.$$

Here $E_v \subset X_s$ for $v \in V := V^* \cap V(F_X)$ and $E_v \subset D^{\text{hor}}$ for $v \in V_\infty := V^* \cap V(F_X)_\infty$. The goal of this subsection is to describe the scheme $D$ explicitly, at least as a topological space, using only the set $V^*$. We make the following assumptions on $V^*$.

**Assumption 3.4.** (a) All elements of $V^*$ are MacLane pseudovaluations, $V^* \subset V(K[x])^*$. Thus, we may consider $V^*$ as a partially ordered set (see Definition 2.1 for the definition of $\le$).

(b) For $v_1, v_2 \in V^*$, $\inf(v_1, v_2)$ is also contained in $V^*$ (Definition 2.25).

(c) Given $v \in V^*$, every predecessor of $v$ is contained in $V$ as well (i.e. $P(v) \subset V$, see Definition 2.11).

Assumptions (a) and (b) mean that we may regard $V^*$ as a rooted tree, see Remark 2.27. Recall that a pair $(v_1, v_2)$ of elements of $V^*$ is an oriented edge of this tree if $v_1 < v_2$ and if there is no element $v \in V$ such that $v_1 < v < v_2$. If this is the case, we call the two elements $v_1, v_2 \in V^*$ adjacent.

The main result of this subsection states that the tree $V^*$ is naturally isomorphic to the tree of components given by the divisor $D$. Assumption 3.4 (c) is not needed for this result and will only be used later in §3.3.

**Proposition 3.5.** Let $V^*$, $X$, $D$, $E_v$ be as before. Assume that Assumption 3.4 (a) and (b) hold. Then for all $v, v' \in V^*$, $v \ne v'$, the components $E_v$ and $E_{v'}$ intersect if and only if $v, v'$ are adjacent. If this is the case then there is a unique intersection point.

*Proof.* The proof will occupy most of the rest of this subsection. We start with two lemmata.

**Lemma 3.6.** Let $v \in V(K[x])$ be a MacLane valuation, and let $X_v$ denote the model of $X_K$ corresponding to the set of valuations $\{v\}$. Let $\infty \subset X_v$ denote the closure of the point $\infty \in X_K = \mathbb{P}_K^1$, and $U_v := X_v \setminus \{\infty\}$. Write $\infty_v \in X_{v,s}$ for the unique intersection point of $\infty$ with $X_{v,s}$.

(i) $U_v = \text{Spec } A_v$, where $A_v := \mathcal{O}_v \cap K[x]$.

(ii) $X_{v,s} - \{\infty_v\} = \text{Spec} \bar{A}_v$, where $\bar{A}_v := A_v/\mathfrak{p}_v$, and where $\mathfrak{p}_v := \{f \in K[x] \mid v(f) > 0\}$.

(iii) Let $v_\xi \in V(F_X)_\infty$ be an infinite geometric pseudovaluation, corresponding to a closed point $\xi \in X_K$. Let $\bar{\xi} \subset X_v$ denote the closure of $\xi$. Then $\bar{\xi}$ intersects $X_{v,s}$ in $\infty_v$ if $v_\xi(x) < 0$, or if $v_\xi \in V(K[x])_\infty$ but $v \not\in v_\xi$. Otherwise, $\bar{\xi}$ intersects $X_{v,s}$ in the point $\mathfrak{m} \in \text{Spec} \bar{A}_v$ corresponding to the residue class of the discoid $D_v$ containing $v_\xi$ (Definition 2.15).

*Proof.* By construction, $X_v \to \text{Spec } \mathfrak{o}_K$ is a projective fibred surface whose reduced special fiber $X_{v,s}$ is a projective irreducible curve over $k$. The composition $\infty \hookrightarrow X_v \to \text{Spec } \mathfrak{o}_K$ is finite and birational. Since $\mathfrak{o}_K$ is integrally closed, it follows that $\infty \to \text{Spec } \mathfrak{o}_K$ is actually an isomorphism. Using [19, Corollary 5.3.24] we see that the divisor $\infty$ is ample on $X_v$. Therefore, the complement $U_v = X_v \setminus \infty$ is an affine open subset. So $U_v = \text{Spec } A_v$, where $A_v \subset F_X = K(x)$ is the subring of functions which are regular on $U_v$. By definition of $X_v$, these are precisely the functions $f \in K(x)$ such that

$$v(f) \ge 0, \quad \text{and} \quad \text{ord}_\xi(f) \ge 0 \quad \forall \xi \in |X_K|, \xi \ne \infty.$$

The second condition is equivalent to $f$ being a polynomial in $x$. This proves (i). Part (ii) is an immediate consequence of (i) and the definitions.
Let $\xi \in |X_K|$ be a closed point on the generic fiber, $\xi \neq \infty$. Then $\xi$ corresponds to a maximal ideal of $K[x]$, which is generated by a monic irreducible polynomial $g$. Set

$$f := \frac{g^a}{\pi^b}, \quad \text{where } v(g) = b/a, a > 0.$$

Then $v(f) = 0$. In particular, $f \in A_v$. We let $\bar{f} \in \bar{A}_v$ denote the image of $f$. By construction, the principal divisor of $f$ as a rational function on $X_v$ is

$$(f) = a \cdot \bar{\xi} - \deg(f) \cdot \infty.$$

As $\mathcal{X}$ is proper over $\text{Spec}\mathcal{O}_K$ and $\mathcal{O}_K$ is complete, $\bar{\xi}$ intersects the special fiber $X_{v,s}$ in a unique closed point (the reduction of $\xi$, see [19, §10.1.3]). Now it follows from (ii) that this point of intersection is $\infty_v$ if and only if $\bar{f} \in \bar{A}_v$ is a unit. Otherwise, the point of intersection corresponds to the maximal ideal

$$\mathfrak{m} := \text{rad}(\bar{f}) \triangleleft \bar{A}_v.$$

But Lemma 2.21 says that $\bar{f}$ is not a unit if and only if $v < v_\xi$. Moreover, if this is the case then the ideal $\mathfrak{m}$ defined above corresponds precisely to the residue class $D_v^\circ(\xi)$, as in Definition 2.15. Statement (iii) of the lemma follows. $\square$

**Lemma 3.7.** *Fix one element $v \in V$. Let*

$$\phi_v : X \to X_v$$

be the morphism of models corresponding to the inclusion $\{v\} \subset V$. Then the following holds.

(i) The restriction of $\phi_v$ to $E_v \subset X$ is a homeomorphism $E_v \xrightarrow{\sim} X_{v,s}$.

(ii) Let $v' \in V \setminus \{v\}$. Then $\phi_v$ contracts the vertical component $E_{v'}$ to a closed point $z$ of $X_{v,s}$. We have $z \neq \infty_v$ if and only if $v < v'$. Moreover, if this is the case then $z$ is the point on $X_{v,s} = \text{Spec} \bar{A}_v$ corresponding to the residue class $D_v^\circ(v')$.

(iii) Let $v' \in V_\infty$. Then the horizontal divisor $\phi(E_{v'}) \subset X_v$ intersects the special fiber $X_{v,s}$ in a point $z \neq \infty_v$ if and only if $v < v'$. Moreover, if this is the case then $z$ is the point on $X_{v,s} = \text{Spec} \bar{A}_v$ corresponding to the residue class $D_v^\circ(v')$.

*Proof.* By construction, the morphism $\phi_v : X \to X_v$ contracts all vertical components $E_{v'}$, where $v' \neq v$, to closed points of $X_{v,s}$, and it induces a finite, birational map $E_v \to X_{v,s}$. Both $E_v$ and $X_{v,s}$ are proper and integral curves over $k$. By Lemma 3.6 (ii), the open subset $X_{v,s} \setminus \{\infty_v\}$ is isomorphic to the affine line over a finite extension $k'/k$. It follows that the smooth projective model of both $E_v$ and $X_{v,s}$ is the projective line $\mathbb{P}_{k'}^1$ and that the natural birational morphism $\mathbb{P}_{k'}^1 \to X_{v,s}$ is a homeomorphism. since this map factors through the curve $E_v$, the map $E_v \to X_{v,s}$ is a homeomorphism, too, which proves (i).

A vertical component $E_{v'}$, with $v' \neq v$, is contracted to the center of the discrete valuation $v'$ on the scheme $X_v$. Clearly, this center is a closed point on $X_{v,s}$. It lies on the affine open $\text{Spec}A_v$ if and only if

$$A_v \subset \mathcal{O}_{v'}.$$

But this latter condition holds if and only if $v < v'$, by definition of the order relation $\leq$. If this is the case, then the center of $v'$ on $\text{Spec}A_v$ is the maximal ideal

$$\mathfrak{m} := A_v \cap \mathfrak{p}_{v'}$$

which, by Lemma 2.14, corresponds to the residue class $D_v(v')$. This proves (ii). Part (iii) follows directly from Lemma 3.6 (iii). $\square$
Now we prove Proposition 3.5. Let $v, v' \in V^*$ be distinct. We have to prove that $E_v$ intersects $E_{v'}$ if and only if $v$ and $v'$ are adjacent, and that there is at most one intersection point. For simplicity, we assume that $v, v' \in V$ are both MacLane valuations, and hence $E_v$ and $E_{v'}$ are vertical components. The argument for the general case is very similar and left to the reader (essentially, one uses Part (iii) of Lemma 3.7 instead of Part (ii)).

We first assume that $v, v'$ are not adjacent. There are two cases to consider. Firstly, suppose that there exists $v'' \in V^*$ such that $v < v'' < v'$. By Lemma 3.7 (ii), the morphism $\phi_{v''} : X \to X_{v''}$ contracts $E_v$ to the point $\infty_{v''} \in X_{v''},s$ and $E_{v'}$ to a closed point distinct from $\infty_{v''}$. Therefore, $E_v$ and $E_{v'}$ do not intersect. In the second case we assume that $v$ and $v'$ are incomparable (i.e. neither $v < v'$ nor $v' < v$). By Assumption 3.4 (b), $v'' := \inf(v, v') \in V$. Moreover, $v, v'$ lie in different residue classes of the discoid $D_{v''}$, by Lemma 2.22. Hence, by Lemma 3.7 (ii), the morphism $\phi_{v''}$ contracts $E_v$ and $E_{v'}$ to distinct points. Therefore, $E_v$ and $E_{v'}$ do not intersect, as in the first case.

Conversely, assume that $E_v$ and $E_{v'}$ do not intersect. We want to show that $v, v'$ are not adjacent. So we may assume that $v < v'$. Since $X_s$ is connected, there exists a chain of pairwise distinct components

$$E_v = E_{v_0}, \dots, E_{v_n} = E_{v'}$$

with $E_{v_i} \cap E_{v_{i-1}} \neq \emptyset$ and $n \ge 2$. By Lemma 3.7 (ii), the morphism $\phi_v$ contracts each component $E_{v_1}, \dots, E_{v_n}$ to a single point. But since $E_{v_i} \cap E_{v_{i-1}} \neq \emptyset$, they are all contracted to the same point. Since $v < v'$, applying Lemma 3.7 again shows that $v < v_1, \dots, v_n = v'$. Similarly, one can see that $v_1, \dots, v_{n-1} < v'$. In this case, consider the map $\phi_{v'} : X \to X_{v'}$. All components $E_{v_0}, \dots, E_{v_{n-1}}$ get contracted to the same point. Since $v < v'$, this is a point $z \neq \infty_v$, and applying Lemma 3.7 again, it follows that $v_1, \dots, v_{n-1} < v'$.

The same reasoning shows that $v_i < v_j$ for all $i < j$ and so

$$v = v_0 < \dots < v_n = v'$$

Since $n \ge 2$, $v$ and $v'$ are not adjacent.

To finish the proof, we assume that $v < v'$ are adjacent. As we have shown above, $E_v \cap E_{v'}$ is nonempty. However, by Lemma 3.7 (i)-(ii), the morphism $\phi_v$ is injective on $E_v$ and contracts $E_{v'}$ to a single point. Therefore, $E_v$ and $E_{v'}$ intersect in a unique point. This concludes the proof of Proposition 3.5. $\square$

**3.3 Regularity criteria** We continue with the assumptions and notation of the previous subsection. We will now formulate sufficient conditions for the model $X$ to be regular and $D$ to be a normal crossing divisor. These conditions will be formulated in Lemma 3.8 and Lemma 3.9 below.

The claim that $X$ is regular and $D$ is a normal crossing divisor needs only to be checked in a Zariski neighborhood in $X$ of every closed point on $D$. By Proposition 3.5, a closed point $z \in D$ lies on one and at most on two vertical components $E_v, v \in V$. We write $X_z$ for the localization of $X$ at $z$, $D_z$ for the restriction of $D$ to $X_z$ and $D_z^{\text{vert}}$ (resp. $D_z^{\text{hor}}$) for the vertical (resp. the horizontal) part of $D_z$.

Let us first consider the case where $z$ lies on exactly one vertical component $E_v, v \in V$. Consider the contraction map

$$\phi_v : X \to X_v$$

from Lemma 3.7. Our assumption that $z$ lies on no other vertical component except $E_v$ implies that $\phi_v$ is an isomorphism in a neighborhood of $z$.

Assume first that $\phi_v(z) = \infty_v$. We claim that this implies that $v = v_0$ is the Gauss valuation. To prove this, note that Assumption 3.4 (b) and (c) imply that the Gauss valuation $v_0$ is an element of $V$. It is in fact the minimal element of $V$. So if $v \neq v_0$ then Lemma 3.7 (ii) would imply that $z$ also lies on the component $E_{v'}$, where $v' < v$ is the unique element of $V$ which is adjacent to $v$ and precedes it. This contradicts our assumption, and shows that $v = v_0$ if $\phi_v(z) = \infty_v$.

By the definition of the Gauss valuation, the model $X_{v_0} = \mathbb{P}_{\mathfrak{o}_K}^1$ is simply the projective line over $\mathfrak{o}_K$, which is smooth over $\mathfrak{o}_K$. It follows that $X_z$ is regular and that $D_z^{\text{vert}}$ is a regular, principal divisor, defined by the uniformizer $\pi_K$. Also, $D_z^{\text{hor}} = \emptyset$, and $D_z$ is a normal crossing divisor.
So for the rest of this subsection, we may assume that $\phi_v(z) \neq \infty_v$. We use the contraction map $\phi_v : X \to X_v$ to identify $X_z$ with $\text{Spec}(A_v)_m$, where $A_v$ is defined as in §3.2 and $m \in \text{Spec} A_v \subset X_v$ is the image of $z$. Recall that we defined a residue class $D_v(m) \subset V(K[x])^*$ corresponding to $m$, see Definition 2.15.

We write $v$ as an inductive valuation,

$$v = [v_0, v_1(\phi_1) = \lambda_1, \dots, v_n(\phi_n) = \lambda_n], \qquad (3.1)$$

where $v_0 = v_0$, see (2.1). As in Remark 2.16, we denote by $D_v(\phi_n)$ the residue class associated to $\phi_n$ (which contains e.g. the infinite pseudovaluation $v_\xi$, where $v_\xi(\phi_n) = \infty$).

**Lemma 3.8.** Let $z \in X_s$ be a closed point, which lies on exactly one vertical component $E_v$.

(i) The point $z \in X$ is a regular point of $X$ if and only if one of the following conditions holds:

(a) $n = 0$,

(b) $\lambda_n \in \langle 1, \dots, \lambda_{n-1} \rangle_\mathbb{Z}$,

(c) $D_v(m) \neq D_v(\phi_n)$.

(ii) If $z \in X$ is regular, then $D$ is a normal crossing divisor in a neighborhood of $z$.

*Proof.* Part (i) is [27, Lemma 7.3]. We recall the proof of the sufficiency of either (a), (b) or (c). Firstly, if (a) holds then $v = v_0$. We have already seen that $X \to \text{Spec } \mathfrak{o}_K$ is then smooth in a neighborhood of $z$, and hence $z$ is a regular point.

By construction, the value group of the inductive valuation (3.1) is

$$v(F_X^\times) = \langle 1, \lambda_1, \dots, \lambda_n \rangle_\mathbb{Z} = \frac{1}{e_v}\mathbb{Z}$$

([20, Theorem 6.6]). This means that there exists a uniformizer for $v$ of the form

$$u_v := c \cdot \phi_1^{a_1} \cdots \phi_n^{a_n}, \quad \text{with } v(u_v) = \frac{1}{e_v},$$

where $c \in K^\times$ and $a_i \le 0$. By construction, the principal divisor of $u_v$ on $\text{Spec} A_v$ is

$$(u_v) = \mathfrak{p}_v + \sum_{i=1}^{n} a_i \cdot \mathfrak{p}_{\phi_i}.$$

We are interested in the restriction of this divisor to the local scheme $X_z = \text{Spec}(A_v)_m$.

For $i \neq n$, the prime ideal $\mathfrak{p}_{\phi_i} := A_v \cap (K[x] \cdot \phi_i) \subsetneq A_v$ is a maximal ideal not containing $\mathfrak{p}_v$, by Lemma 2.21. For $i = n$, the prime ideal $\mathfrak{p}_{\phi_n}$ is contained in $m$ if and only if $D_v(m) = D_v(\phi)$, i.e. if and only if Condition (c) is false.

In particular, if Condition (c) holds then $D_z$ is a principal divisor, defined by $u_v$. Since $D_z$ is regular, it follows that $X_z$ is regular, too. Similarly, if Condition (b) holds then we may assume that $a_n = 0$, and the same conclusion holds. So in both cases, $X_z$ is regular.

It remains to prove (ii). If $D^{\text{hor}} = \emptyset$ then we have already proved that $D_z = D_z^{\text{vert}}$ is a regular, and hence a normal crossing divisor. Therefore, we may assume that $z$ lies on a horizontal component $E_{v_\xi} = \bar{\xi}$. Here $\bar{\xi}$ is the closure of a closed point $\xi \in X_K$ corresponding to an infinite pseudovaluation $v_\xi$ which lies in $V^*$. The point $\xi$ corresponds to a monic, integral and irreducible polynomial $g \in K[x]$. Assumption 3.4 (c) guarantees that the immediate predecessor of $v_\xi$ lies in $V^*$ as well; by Proposition 3.5, this predecessor must be the valuation $v$. It follows that $g$ is a key polynomial for $v$ and that

$$v_\xi = [v, v_\xi(g) = \infty].$$
We set

$$f := u_v^{-e_v v(g)} \cdot g \in K[x].$$

Then $v(f) = 0$, and hence

$$D_z^{\text{hor}} = (f)$$

is a principal divisor. To prove that $D_z$ is normal crossing, we need to show that $\bar{f} \in \bar{A}_v$ generates the maximal ideal $\bar{m} := \mathfrak{m}/\mathfrak{p}_v$.

Assuming otherwise, there would exist an element $\bar{h} \in \bar{m}$ such that $\bar{h}^2 | \bar{f}$. Lift $\bar{h}$ to a polynomial $h \in K[x]$. Then $v_\xi(h) > v(h) = 0$. By [20, Theorem 5.1] this implies $g|_v h$, which in turn implies

$$g^2|_v f.$$

By the definition of $f$ and $u_v$ it follows that

$$g|_v \phi_1^{b_1} \cdots \phi_n^{b_n}, \quad b_i := -e_v v(g) a_i \ge 0.$$

But as a key polynomial, $g$ is $v$-irreducible (Definition 2.5). We conclude that $g|_v \phi_i$, for some $i$. But this would mean that the prime ideal $\mathfrak{p}_{\phi_i} \subsetneq A_v$ contains the maximal ideal $\mathfrak{m}$. We have already argued in the proof of (i) that this is not the case, if we assume either Condition (b) or (c). This finishes the proof of the lemma. $\square$

Let us now assume that $z$ lies on exactly two vertical components, $z \in E_{v_1} \cap E_{v_2}$, with $v_1 < v_2$. Then by Proposition 3.5, $v_1, v_2$ are adjacent, i.e. there is no other element of $V$ strictly in between $v_1$ and $v_2$. Together with Assumption 3.4 (c) this implies $v_0 := \text{pred}(v_2) \le v_1$. We may therefore write

$$v_1 = [v_0, v_1(\phi) = \lambda_1], \quad v_2 = [v_0, v_2(\phi) = \lambda_2],$$

where $\phi$ is a key polynomial for $v_0$ and $\lambda_1 < \lambda_2 \in \mathbb{Q}$ (note that the case $v_0 = v_1$ is not excluded). Let $N := e_{v_0}$. Write $\lambda_i = b_i/c_i$, with $\text{gcd}(b_i, c_i) = 1$.

**Lemma 3.9.** Assume that

$$\lambda_2 - \lambda_1 = \frac{N}{\text{lcm}(N, c_1)\text{lcm}(N, c_2)}.$$

Then $z$ is a regular point of $X$ in which the components $E_{v_1}$ and $E_{v_2}$ intersect transversally. In other words: $D$ is a normal crossing divisor at $z$.

*Proof.* This is [27, Lemma 7.4]. $\square$

**3.4 The algorithm** Let $D_K \subset X_K = \mathbb{P}_K^1$ be a reduced and effective divisor. We will now formulate an algorithm for constructing a regular model $X$ of $X_K$ such that $D := D^{\text{hor}} \cup X_s$ is a normal crossing divisor. See Example 5.1 for an explicit example worked out in detail.

Let $V_\infty$ denote the set of infinite pseudovaluations corresponding to the points of $D_K$. For simplicity, we assume that $V_\infty \subset V(K[x])^*$ consists of MacLane pseudovaluations. This is equivalent to saying that $D_K$ is the zero locus of a monic, integral and separable polynomial $f \in K[x]$.

**Algorithm 3.10.** We enlarge the set $V_\infty$ in three steps to oversets

$$V_\infty \subset V_1^* \subset V_2^* \subset V_3^* = V^*,$$

as follows.

(1) $V_1^*$ is the union of $V_\infty$ with the set of all predecessors of elements of $V_\infty$,

$$V_1^* := V_\infty \cup \bigcup_{v \in V_\infty} P(v).$$

See Definition 2.11.
(2) The set $V_2^*$ is obtained by computing the inf-closure of $V_1^*$, i.e. the smallest subset of $V(K[x])^*$ containing $V_1^*$ and being closed under taking the infimum of two elements. In fact, it is not hard to show that

$$V_2^* = V_1^* \cup \{\inf(v, w) \mid v, w \in V_1^*\}.$$

(3) The set $V_3^*$ is obtained by applying Algorithm 3.13 below to every $v \in V_2 := V_2^* \cap V(K[x])$.

**Remark 3.11.** The set $V_2^*$ produced by Step 2 of Algorithm 3.10 satisfies Assumption 3.4. For Condition (a) this is true by construction. By Step 1, $V_1^*$ satisfies (c). Then in Step 2 we have added, a finite number of times, a new element which is less than some old element. By Lemma 2.12, this does not destroy Property (c). At the end of Step 2, $V_2^*$ satisfies (b) by construction.

In Algorithm 3.13 below, we use shortest N-paths between rational numbers as defined in [25].

**Definition 3.12.** If $a > a' \ge 0$ are rational numbers, and $N$ is a positive integer, an N-path from $a$ to $a'$ is a sequence $a = b_0/c_0 > b_1/c_1 > \cdots > b_n/c_n = a'$ of rational numbers in lowest terms such that

$$\frac{b_i}{c_i} - \frac{b_{i+1}}{c_{i+1}} = \frac{N}{\text{lcm}(N, c_i)\text{lcm}(N, c_{i+1})}$$

for $0 \le i \le n - 1$. If, in addition, no proper subsequence $b_0/c_0 > \cdots > b_n/c_n$ containing $b_0/c_0$ and $b_n/c_n$ is an N-path, then the sequence is called a *shortest N-path* from $a$ to $a'$.

We remark that for any pair of rational numbers $a > a' \ge 0$ and any positive integer $N$, there exists a unique shortest N-path from $a$ to $a'$, [25, Proposition A.14].

**Algorithm 3.13.** Let $V^*$ be a finite set of MacLane pseudovaluations satisfying Assumption 3.4. Let $v \in V := V^* \cap V(K[x])$. We enlarge $V^*$ to an overset $V_v^*$, as follows.

(1) Let $v' \in V^*$ be such that $v < v'$ and that there is no element of $V^*$ strictly between $v$ and $v'$. Set $v_0 := \text{pred}(v')$. By Assumption 3.4 (c), $v_0 \le v$, and we can write

$$v = [v_0, v(\phi) = \lambda], \quad v' = [v_0, v'(\phi) = \lambda'].$$

Set $N := e_{v_0}$. Then we add to $V^*$ the MacLane valuations

$$v_t := [v_0, v_t(\phi) = t],$$

where $\lambda < t < \lambda'$ runs through the *shortest N-path from $\lambda'$ to $\lambda$*.

We do this for all $v'$ as above.

(2) Let $v_0 := \text{pred}(v)$ and write $v = [v_0, v(\phi) = \lambda]$. Set $N := e_{v_0}$. If $\lambda \notin N^{-1}\mathbb{Z}$ and $v'(\phi) = \lambda$ for all $v'$ as in (1), then we add to $V^*$ the MacLane valuations

$$v_t := [v_0, v_t(\phi) = t],$$

where $\lambda < t \le \lambda'$ runs through the *shortest N-path from $\lambda'$ to $\lambda$*, and where

$$\lambda' := \min\{t \in \frac{1}{N}\mathbb{Z} \mid t > \lambda\}.$$

**Remark 3.14.** After applying Step (3) of Algorithm 3.10, it is easy to see that the set $V^* = V_3^*$ still satisfies Assumption 3.4.

**Theorem 3.15.** Let $D_K \subset X_K$ be as at the beginning of this subsection. Let $V^*$ be the set of MacLane pseudovaluations produced by Algorithm 3.10 and let $(X, D^{\text{hor}})$ be the model of $(X_K, D_K)$ corresponding to $V^*$ via Proposition 3.2. Then $X$ is regular, and $D := D^{\text{hor}} \cup X_s$ is a normal crossing divisor.
*Proof.* By Remark 3.14, the set $V^*$ satisfies Assumption 3.4. Therefore, we only have to verify that the conditions of Lemma 3.8 and Lemma 3.9 are satisfied, for each closed point $z \in D^{\text{vert}}$.

Consider a closed point $z$ on a vertical component $E_w$, $w \in V$. As we have shown in §3.3, we may assume that $\phi_w(z) \neq \infty_w$. This implies that $z$ either does not lie on any other vertical component (the situation of Lemma 3.8), or $z \in E_{w'}$ where $w' > w$ is a MacLane valuation adjacent to $w$ (the situation of Lemma 3.9). In both cases, the application of Algorithm 3.13 to the set $V^*$ guarantees that

$$w = v_t = [v_0, v(\phi) = t]$$

where $t$ is a value from a 'shortest path' from $\lambda'$ to $\lambda$ (we use the notation of Algorithm 3.13).

If Condition (a), (b) or (c) of Lemma 3.8 hold then $z$ is a regular point and $D$ is a normal crossing divisor at $z$. We may therefore assume that all these three Conditions are false. This excludes the possibility that $t = \lambda'$, where $\lambda'$ is as in Part (2) of Algorithm 3.13. Indeed, $t = \lambda' \in 1/NZ$ implies that Condition (b) of Lemma 3.8 is true, contrary to our assumption. We may therefore assume that $t < \lambda$.

Further, since Condition (c) is not satisfied, we may assume that the point $z \in E_w$ corresponds to the residue class

$$D_w(m) = \{w' | w'(\phi) > t\}.$$

Let $t' > t$ be the next value after $t$ in the shortest path (this could be $\lambda'$). Then $w' := v_{t'} \in D_w(m) \cap V$. This means that $z$ also lies on the vertical component $E_{w'}$. But by the definition of 'shortest path', the pair $w = v_t, w' = v_{t'}$ satisfies the condition from Lemma 3.9. Then this Lemma says that $z$ is a regular point and $D$ a normal crossing divisor at $z$. This concludes the proof of the theorem. $\square$

**Remark 3.16.** The algorithm described above has been implemented in the Sage/Python module `models_of projective line` which is part of the Sage/Python package `regular_models`, [16].

# 4 Computing the lattice of integral differential forms

Let $Y_K$ be a superelliptic curve, i.e. the smooth projective $K$-model of an affine plane curve given by an equation

$$y^n = f(x).$$

We assume that $n$ is invertible in the ring $\mathfrak{o}_K$ (Assumption 1.4). In this section, we present an algorithm for computing the integral differential forms (Definition 1.3) of the curve $Y_K$.

Denote by $D_K \subset \mathbb{P}_K^1$ the divisor defined by the polynomial $f$. Using Algorithm 3.10, we construct a regular model $X$ of $X_K = \mathbb{P}_K^1$ such that $D := D^{\text{hor}} \cup X_s$ is a normal crossing divisor. By Theorem 1.5, the normalization of this model in the function field of $Y_K$ is a model $Y$ of $Y_K$ with only rational singularities; it can therefore be used for computing the lattice of integral differential forms. In this section we explain in detail how this is done.

First, we briefly explain how to find, under some extra assumption, a $K$-basis of

$$M_K = H^0(Y_K, \Omega_{Y_K/K})$$

for a smooth projective curve $Y_K$. This is followed by a general discussion of reduced bases, which allows us to compute bases of integral differential forms for models that correspond to exactly one valuation on the function field $F_Y$. For the explicit computations of such reduced bases, it is necessary to compute the order of vanishing of a rational section along components of the special fiber $Y_s$. For our situation, where the model $Y$ is given as a cover of a model of the projective line, these computations are explained in the following subsection. Finally a conjunction of these results leads to Algorithm 4.12.
**4.1 A K-basis** The first step is to find a K-basis of the vector space

$$M_K := H^0(Y_K, \Omega_{Y_K/K}).$$

It is well known how to do this, but the precise algorithm depends of course on the way the curve $Y_K$ is defined. Let us assume, for simplicity, that $Y_K$ is defined generically by an equation $F(x, y) = 0$, where $F \in K[x, y]$ is an absolutely irreducible polynomial, and the intersection of the plane model $F(x, y) = 0$ of $Y$ with the torus $\mathbb{G}^2 \subset \mathbb{A}_K^2$ is smooth. Then there is a basis for $H^0(Y_K, \Omega_{Y_K/K})$ of the form

$$x^{i-1}y^{j-1}\frac{dx}{F_y}, \quad (i, j) \in I,$$

where $I \subset \mathbb{Z}^2$ are the points in the interior of the Newton polygon of $F$. See e.g. [5, §1].

**Example 4.1.** Let $Y_K$ be superelliptic, with equation

$$Y_K : y^n = f(x),$$

with $n \ge 2$ and $f$ of degree $d \ge 3$. The condition that this equation defines a smooth curve in $\mathbb{G}_K^2$ means that $f$ has no multiple factors, except possibly an arbitrary power $x^m$ of $x$. A basis for $M_K$ is then

$$(x^{i-1}y^{j-n}dx)_{(i,j) \in I}, \quad I = \{(i,j) : m(n-j) < ni < d(n-j)\} \subset \mathbb{N}^2.$$

In the following, we assume that a K-basis of $M_K$ is already known. Let $V(Y)$ denote the finite set of discrete valuations on the function field $F_Y$ of $Y$ corresponding to the vertical components of $Y$. Since $\omega_{Y/S}$ is a divisorial sheaf, we have

$$M = \{\omega \in M_K \mid v(\omega) \ge 0 \forall v \in V(Y)\},$$

see (1.3). Here $v(\omega)$ denotes the order of vanishing of $\omega$ along the component corresponding to $v$. See (4.1) for a precise definition.

We choose a nonvanishing rational section $\eta$ of $\omega_{Y/S}$ (typically, $\eta = dx$) and obtain a K-linear embedding

$$M_K \hookrightarrow F, \quad \omega \mapsto \omega/\eta.$$

If we regard $M_K$ as a subvector space of $F_Y$, the definition of $M$ reads

$$M = \{f \in M \mid v(f) \ge -m_v \forall v \in V(Y)\},$$

with $m_v := v(\eta)$.

**4.2 Reduced bases** It will be useful to consider a more abstract situation. Let $K$ be as above and $M_K$ a finite-dimensional K-vector space. Let $F/K$ be a field extension and $v: F \to \frac{1}{e_v}\mathbb{Z} \cup \{\infty\}$ a discrete valuation whose restriction to $K$ is equal to $v_K$. Here $e_v$ denotes the ramification index of the extension of valuations $v/v_K$. Let us also fix a K-linear embedding $M_K \hookrightarrow F$ and an element $m \in \frac{1}{e_v}\mathbb{Z}$. The intermediate goal is to determine the $\mathfrak{o}_K$-submodule

$$M_{v,m} := \{f \in M_K \mid v(f) \ge -m\}.$$

**Definition 4.2.** A system $(f_1, \dots, f_i)$ of elements of $M_K$ is called reduced (with respect to $v$) if for all linear combinations $f = \sum_j a_j f_j$, $a_j \in K$, we have

$$v(f) = \min_j v(a_j f_j).$$

**Lemma 4.3.** There exists a reduced basis $(f_1, \dots, f_n)$ of $M_K$.
**Proof.** Starting with an arbitrary K-basis $(g_1, \dots, g_n)$ of $M_K$, a reduced basis can be constructed inductively.

Suppose that $(f_1, \dots, f_m)$ is a reduced basis for $\langle g_1, \dots, g_m \rangle$. For the construction of an element $f_{m+1}$ such that $(f_1, \dots, f_{m+1})$ is a reduced basis for $\langle g_1, \dots, g_{m+1} \rangle$, we may assume that $f_{m+1} = g_{m+1} + \sum_{i=1}^m a_i f_i$ for some $a_i \in K$. It is easy to see that we get a reduced basis if and only if $f_{m+1}$ is the element with maximal valuation of this form.

We set $h = g_{m+1}$. If $h$ does not have maximal valuation, there exists an element $h' = h + \sum_{i=1}^m a_i f_i$ so that $h \sim_v - \sum_{i=1}^m a_i f_i$. (see Definition 2.5.(i)). For determining $a_1, \dots, a_m$ with this property (if they exist), we may as well do computations in the residue field of $v$. For that purpose, let $h_0 \in \langle f_1, \dots, f_m \rangle$ be such that $v(h) = v(h_0)$. If such an element $h_0$ does not exist, we cannot have $v(h') > v(h)$ and we are done, i.e. $f_{m+1} = h$.

Otherwise, we check whether $h/h_0$ viewed as an element in the residue field of $v$, lies in the span of $(\pi^{e_i} f_i/h_0 \mid 1 \le i \le m)$, where the integers $e_i$ are chosen minimally with the property $v(\pi^{e_i} f_i/h_0) \ge 0$. If this is not the case, $h$ already has maximal valuation. Otherwise, we may lift the relation that we obtain in the residue field and thereby construct an element $h'$ of the desired form with strictly larger valuation than $h$. Iterating this process, we will eventually find an element with maximal valuation. This is the next basis element $f_{m+1}$. $\square$

**Corollary 4.4.** For all $m \in \frac{1}{e_v}\mathbb{Z}$, the subset

$$M_{v,m} := \{f \in M_K \mid v(f) \ge m\} \subset M_K$$

is a free $\mathfrak{o}_K$-module of rank $n$.

**Proof.** Let $(f_1, \dots, f_n)$ be a reduced K-basis of $M_K$. Then

$$M_{v,m} = \langle \pi^{k_1} f_1, \dots, \pi^{k_n} f_n \rangle,$$

where

$$k_i := [m - v(f_i)].$$

**Corollary 4.5.** Let $M_K \hookrightarrow F$ be as before, with pairwise distinct discrete valuations $v_i : F \to \frac{1}{e_i}\mathbb{Z} \cup \{\infty\}$ and elements $m_i \in \frac{1}{e_i}\mathbb{Z}$ for $i \in \{1, \dots, r\}$. Then

$$M := \{f \in M_K \mid v_i(f) \ge -m_i \forall i\}$$

is a free $\mathfrak{o}_K$-module of rank $n$.

**Proof.** By definition,

$$M = \cap_i M_i, \quad M_i = \{f \in M_K \mid v_i(f) \ge -m_i\}.$$

Since $M_i \subset M_K$ is a full lattice by Corollary 4.4, $M \subset M_K$ is a full lattice, too. $\square$

**Remark 4.6.** The proofs of Lemma 4.3 and Corollary 4.4-4.5 can be easily turned into an algorithm to compute an $\mathfrak{o}_K$-basis of $M$. In our implementation [16], this is done in the modules `lattices` and `RR spaces`.

**4.3 Order of vanishing of a rational section** In this subsection, we restrict our considerations to superelliptic curves. We assume that $Y_K$ is given by an affine equation $y^n = f(x)$, where $n$ is invertible in $\mathfrak{o}_K$. Moreover, we let $X$ be a regular model of the projective line such that $D = D^{\text{hor}} \cup X_s$ is a normal crossing divisor, where $D^{\text{hor}}$ is the horizontal divisor defined by $f$. Then the normalization of $X$ in the function field of $Y_K$ is a model $Y$ for $Y_K$. The valuations in the set $V(Y)$ correspond to extensions of the valuations in $V(X)$ to $F_Y$. The computation of such extensions is explained in [28, §4.6.2].
Let $\omega$ be a nonzero rational section of $\omega_{X/S}$. For any $v \in V(X)$, we can write $\omega = g \cdot \omega_0$, where $g \in F_X$ and $\omega_0$ is a generator of $\omega_{X/S}$ at the generic point of $E_v$. Recall that $E_v$ denotes the component of the special fiber $X_s$ which corresponds to the valuation $v$. We set

$$v(\omega) := v(g) \in \frac{1}{e_v} \mathbb{Z}. \qquad (4.1)$$

It is easy to see that this value is independent of the choice of $\omega_0$. We say that $v(\omega)$ is the order of vanishing of $\omega$ along the component $E_v$.<fnref n="4" /> The definition of $w(\omega)$ for a rational section of $\omega_{Y/S}$ and a valuation $w \in V(Y)$ is completely analogous.

Before we show how to compute the order of vanishing of a differential form in our setting, we first consider a more general situation.

**Proposition 4.7.** Let $M$ be a rational function field over $K$ and $L/M$ a finite and separable extension. Further let $v_L$ be a geometric valuation on $L$ with valuation ring $\mathfrak{o}_L$. Denote by $v_M$ the restriction of $v_L$ to $M$ and by $\mathfrak{o}_M$ the corresponding valuation ring. Let $\phi: \text{Speco}_L \to \text{Speco}_M$ be the induced morphism.

Assume that $\widehat{\mathfrak{o}}_L = \widehat{\mathfrak{o}}_M[\alpha]$ for some $\alpha \in \widehat{\mathfrak{o}}_L$ and let $p_\alpha$ denote the minimal polynomial of $\alpha$ over $\widehat{\mathfrak{o}}_M$. Then for a differential form $\omega_0 \in \omega_{\text{Speco}_M/\text{Speco}_K}$, it holds that

$$v_L(\phi^*\omega_0) = v_L(p'_\alpha(\alpha)) + v_M(\omega_0).$$

In particular, If $L/M$ is tame and totally ramified of degree $e$, then $v_L(\phi^*\omega_0) = (e-1)/e_L + v_M(\omega_0)$.

*Proof.* First, recall that

$$\omega_{\text{Speco}_L/\text{Speco}_K} = \omega_{\text{Speco}_L/\text{Speco}_M} \otimes_{\mathfrak{o}_L} \phi^* \omega_{\text{Speco}_M/\text{Speco}_K},$$

by the adjunction formula, [19, Theorem 6.4.9]. In the following, we describe $\omega_{\text{Speco}_L/\text{Speco}_M}$. Since

$$\omega_{\text{Speco}_L/\text{Speco}_M} = (\omega_{\mathfrak{o}_L/\mathfrak{o}_M}),$$

it suffices to study the $\mathfrak{o}_L$-module $\omega_{\mathfrak{o}_L/\mathfrak{o}_M}$. The latter is isomorphic to the the codifferent, $\mathfrak{C}(\mathfrak{o}_L/\mathfrak{o}_M)$ of the extension $\mathfrak{o}_L/\mathfrak{o}_M$ ([22, Corollary A.2]). Recall that the different ideal $\mathfrak{D}(\mathfrak{o}_L/\mathfrak{o}_M) \triangleleft \mathfrak{o}_L$ of the extension is defined as the complement of $\mathfrak{C}(\mathfrak{o}_L/\mathfrak{o}_M)$, i.e. $\mathfrak{C}(\mathfrak{o}_L/\mathfrak{o}_M) \mathfrak{D}(\mathfrak{o}_L/\mathfrak{o}_M) = \mathfrak{o}_L$.

For the computation of the different, we may pass to the completions of $\mathfrak{o}_L$ and $\mathfrak{o}_M$. More precisely, it holds that

$$\mathfrak{D}(\mathfrak{o}_L/\mathfrak{o}_M) \widehat{\mathfrak{o}}_L = \mathfrak{D}(\widehat{\mathfrak{o}}_L/\widehat{\mathfrak{o}}_M),$$

[24, Satz 2.2]. By assumption $\widehat{\mathfrak{o}}_L = \widehat{\mathfrak{o}}_M[\alpha]$. In that situation the different ideal is generated by $p'_\alpha(\alpha)$, [24, Satz 2.4], hence $\mathfrak{C}(\mathfrak{o}_L/\mathfrak{o}_M)/\mathfrak{o}_L$ has length $v_L(p'_\alpha(\alpha)) \cdot e_L$.

Let $\omega_0 \in \omega_{\text{Speco}_M/\text{Speco}_K}$. Clearly, $\phi^*\omega_0 = 1 \otimes_{\mathfrak{o}_L} \phi^*\omega_0$ in the representation given by the adjunction formula. The above discussion implies

$$v_L(\phi^*\omega_0) = v_L(p'_\alpha(\alpha)) + v_M(\omega_0).$$

If the extension $L/M$ is tame and totally ramified, then we can choose uniformizers $u_L$ and $u_M$ such that $\widehat{\mathfrak{o}}_M[u_L] = \widehat{\mathfrak{o}}_L$ and $p_{u_L} = T^e - u_M$. This means $p'_{u_L}(u_L) = e \cdot u_L^{e-1}$ and the statement follows from the formula in the general case. $\square$

We will now show how to compute $v(dx)$ for a valuation $v \in V(K[x])$. From that one can then deduce the value of $v(\omega)$ for any rational section $\omega \in H^0(X_K, \omega_{X_K/K})$.

**Definition 4.8.** Let $v \in V(X)$. We say that $(u_v, t_v)$ is a defining system for $E_v$ if $u_v, t_v \in F_X = K(x)$ and

<footnote n="4">⁴Note that in our setting the order of vanishing is not necessarily an integer, since $v$ is not normalized. In the literature, the integer $v(\omega) \cdot e_v$ is usually called the order of vanishing.</footnote>
(i) $u_v$ is a uniformizer for $v$.

(ii) $\bar{t}_v$ is a separable transcendental generator of $k(v)$, i.e. $k(v)/k(\bar{t}_v)$ is finite and separable.

**Proposition 4.9.** Let $(u_v, t_v)$ be a defining system for $E_v$. Then there exists an irreducible polynomial $F_v \in \mathfrak{o}_K[t_v][T]$ of degree $e_v$ satisfying $F_v(u_v) = 0$. Moreover

$$v(dx) = v(F'_v(u_v)) - v(dt_v/dx).$$

*Proof.* Consider the extension of function fields $K(x)/M$ with $M = K(t_v)$. This extension factors in the following way.

$$ \begin{array}{ccc} K(x) & \searrow & v \\ \phi_2 \downarrow & & \downarrow \text{res} \\ L = K(t_v, u_v) & & v_L = [v_0, v_1(u_v) = 1/e_v, v_L(F_v) = \infty] \\ \phi_1 \downarrow & & \downarrow \text{res} \\ M = K(t_v) & & v_M \end{array} $$

On the right, we included a description of the restrictions of $v$ to the respective fields. Note that the residue field of the valuation $v_M$ is equal to $k(\bar{t}_v)$ by definition of $t_v$. This implies that $v_M$ is the Gauß valuation on $K(t_v)$, i.e. the minimal element of $V(K[t_v])$.

Since $L = K(t_v, u_v)$ has transcendence degree one over $K$, there exists an irreducible primitive polynomial $0 \neq F \in \mathfrak{o}_K[T_1, T_2]$ satisfying $F(t_v, u_v) = 0$. In particular $L = M[T]/(F_1)$, where $F_1 = F(t_v, T)$. Write

$$0 = F_1(u_v) = \sum_{i=0}^{n} a_i u_v^i, \quad \text{where } a_i = \sum_{j=0}^{m_i} a_{i,j} t_v^j \in M.$$

Since $a_i \in \mathfrak{o}_K[t_v] \subset \mathfrak{o}_M$ for all $i$, the polynomial is integral. Moreover the leading coefficient has valuation zero. Assume otherwise, i.e. $v_M(a_n) > 0$. Having that $v_L(u_v^n) > v_L(u_v^i)$ for all $i \neq n$ implies that $v_M(a_i) > 0$ for all $i$. Since $v_M$ is the Gauß-valuation on $K(t_v)$, this shows $v_M(a_{i,j}) > 0$ for all $i, j$.

Viewed as a polynomial over $\tilde{M}$ (the completion of $M$ with respect to $v_M$), $F_1$ might be reducible. The irreducible factors are in correspondence with the extensions of $v_0$ to $L$ (see [28, §4.6.2]). Note that we may scale $F_1$ to make it monic in order to apply this correspondence. Since $v_M(a_n) = 0$, the polynomial remains integral. Let us denote by $F_v$ the factor corresponding to the valuation $v_L$. It follows from the description of $v_L$ that $F_v$ has degree $e_v$.

In order to compute $v(dx)$, first note that $v_M(dt_v) = 0$. It follows from Proposition 4.7 that $v_L(\phi_1^*dt_v) = v_L(F'_v(u_v))$. Recall that $(t_v, u_v)$ is a defining system for the valuation $v$, in particular $u_v$ is a uniformizer for $v$. This implies that the extension of valuations $v | v_L$ is unramified that is $v|_L = v_L$. Applying Proposition 4.7 again, we find that $v(\phi_2^*dt_v) = v_L(dt_v)$. Further note that $t_v \in L \subset K(x)$, hence we may denote $dt_v = \phi_2^*dt_v$. Finally $v(dt_v) = v(dt_v/dx) + v(dx)$ by definition. This concludes the proof. $\square$

**Remark 4.10.** There exist methods in the Computer Algebra System Sage to compute a uniformizing element, $u_v$, and a generator for the residue field, $\bar{t}_v$. Lifting the latter to the ring $\mathfrak{o}_K$, one obtains $t_v$. Both $u_v$ and $t_v$ may be chosen to lie in $K[x]$. For more details, we refer the reader to [28].

In order to find the algebraic relation between $u_v$ and $t_v$, set

$$I = (T_1 - u_v, T_2 - t_v) \in K[T_1, T_2, x].$$

Then $F$ is given by a generator of the elimination ideal $I \cap K[T_1, T_2]$. Using the methods outlined in [28, §4.7] it is possible to compute arbitrarily good approximations of the factors of $F$ over the completion.
**Lemma 4.11.** Let X and Y be as defined in the beginning of this subsection. Let $\omega \in H^0(X_K, \Omega_{X_K/K})$. Then for any $w \in V(Y)$, there exists a valuation $v \in V(X)$ such that $\phi(E_w) = E_v$. Moreover

$$w(\phi^*\omega) = v(\omega) + \frac{e-1}{e_w},$$

where e is the ramification index of the extension of valuations $[w:v]$.

*Proof.* The first part of the statement is clear from the construction of Y. Setting

$$L = F_Y, v_L = w, M = F_X, v_M = v,$$

the second part follows from Proposition 4.7.

<figure><img src="image_2.png" /></figure>

**4.4 An algorithm for Superelliptic Curves** Here, we describe an algorithm for computing a basis for the lattice of integral differential forms for a superelliptic curve. This algorithm has been implemented in the Sage/Python module `superelliptic_curves` which is part of the package `regular_models`, [16].

**Algorithm 4.12.** Let $Y_K$ be a superelliptic curve with equation

$$Y_K: y^n = f(x),$$

with $n \ge 2$, $f$ of degree $d \ge 3$ and assume that $f$ has no multiple factors, except possibly an arbitrary power $x^m$ of $x$.<fnref n="5" /> Write $D_K \subset \mathbb{P}_K^1$ for the divisor defined by $f$.

(1) Compute $V = V(X) \subset V(K[x])$, where X is a regular model of $\mathbb{P}_K^1$ with the property that $D = D^{\text{hor}} \cup X_s$ is a normal crossing divisor.

(2) Choose an element $\eta \in M_K = H^0(Y_K, \omega_{Y_K/K})$ and compute a basis $B_0$ of $M_K$ viewed as a subspace of $F_Y$ under the embedding $\omega \mapsto \omega/\eta$.

(3) Let $W = \{w \in V(F_Y) \mid w|_{K[x]} \in V(X)\}$. For each valuation $w \in W$ compute a basis $B_w$ for the module $M_w := \{g \in M_K \mid w(g) \ge -w(\eta)\}$.

(4) Compute an $\mathfrak{o}_K$-basis $B$ for $M_Y = \cap_{w \in W} M_w$.

**Remark 4.13.** We briefly explain how to perform the computations in each step of the above algorithm. As in our implementation, we choose $\eta = dx/y^{n-1}$ in Step (2). This choice is based on the fact that for every regular differential form $\omega$, there exists a polynomial $g \in K[x, y]$ such that $\omega = gdx/y^{n-1}$. As a result, the output of the algorithm is more legible. Of course the following steps can be easily adapted to a different choice of $\eta$.

(1) Apply Algorithm 3.10 to $D_K$.

(2) With $\eta = dx/y^{n-1}$, a basis for $M_K$ is given by

$$B_0 = (x^{i-1}y^{j-1} \mid (i,j) \in \mathbb{N}^2, m(n-j) < ni < d(n-j)),$$

cf. Example 4.1.

(3) This step is an application of the results from the previous subsection.

(a) First, compute $v(dx)$. For that purpose, determine a defining system $(u_v, t_v)$ and (an approximation of) the polynomial $F_v \in \widehat{\mathfrak{o}_K[t_v]}[T]$ as in Proposition 4.9. It is explained in Remark 4.10 how to find such elements algorithmically. Proposition 4.9 then allows to compute $v(dx)$. More precisely, we have

$$v(dx) = v(F'_v(u_v)) - v(dt_v/dx).$$

<footnote n="5">⁵This assumption is made for simplicity only and has no bearing on our results</footnote>
(b) Next, compute all extensions $W_v \subset V(F_Y)$ of $v$ to the function field $F_Y$. It is explained in [28, §4.6.2] how to compute such extensions of valuations. Then $W = \cup_{v \in V(X)} W_v$. As a consequence of Lemma 4.11, we get $w_v(dx) = v(dx) + (e-1)/e_w$ for each extension $w_v \in W_v$, where $e$ is the ramification index $[w_v : v]$. So

$$w_v(\eta) = v(dx) - (n-1) \cdot w_v(y) + (e-1)/e_w.$$

(c) In order to compute a basis $B_v$ for $M_v := \{g \in M_K | w_v(g) \ge -w_v(\eta)\}$, start with the basis $B_0$ of $M_K$ and modify it as described in the proof of Lemma 4.3 to get a basis which is reduced with respect to $v$. Then proceed as in the proof of Corollary 4.4.

(4) We have to compute the intersection of finitely many $\mathfrak{a}_K$-lattices. For two lattices $M_1, M_2 \subset M_K$, we have

$$M_1 \cap M_2 \cong \ker (M_1 \oplus M_2 \to M_K, \quad (m_1, m_2) \mapsto m_1 - m_2),$$

A basis of this module can easily be computed using the Smith normal form. The general case is done by iteration.

**Theorem 4.14.** Let $Y_K$ be a superelliptic curve, with equation

$$Y_K : y^n = f(x),$$

with $n \ge 2$, $f$ of degree $d \ge 3$ and assume that $f$ has no multiple factors, except possibly an arbitrary power $x^m$ of $x$. Let $\mathcal{B}$ be the system produced by Algorithm 4.12 and $\eta \in H^0(Y_K, \omega_{X_K/K})$ be the rational section chosen in Step (2) of the algorithm, then

$$(b \cdot \eta | b \in \mathcal{B})$$

is a basis for the lattice of integral differential forms for $Y_K$.

*Proof.* Let $X$ be the model from Step (1) and $Y$ the normalization of $X$ inside $F_Y$. It follows from Theorem 1.5 that $Y$ is a model of $Y_K$ with at most rational singularities. By Corollary 1.2, $M := H^0(Y, \omega_{Y/S})$ is the lattice of integral differential forms for $Y_K$.

As outlined in the end of §4.1,

$$M = \{g \in M_K | w(g) \ge -w(\eta) \ \forall w \in V(Y)\}.$$

The elements in $V(Y)$ correspond to the extensions of elements in $V(X)$ to $F_Y$. More precisely $V(Y) = \{w | w$ is an extension of some $v \in V$ to $F_Y\}$. $\square$

# 5 Examples

In this section we show how to compute a basis for the lattice of integral differential forms for superelliptic curves of the form

$$Y : y^n = (x^2 - 5)^3 - 5^5 \text{ over } \mathbb{Q}_5.$$

Using Algorithm 4.12, we can find a basis for $M_Y$ for any $n$ not divisible by 5. The first step in the algorithm is the same for all values of $n$. This computation is explained in Example 5.1. Following this example, we explain the remaining computations for the cases $n = 2$ and $n = 3$ in Examples 5.2 and 5.3 respectively.

The examples presented in this section, along with more examples, can be found in the Jupyter Notebook Examples.ipynb in our GitHub repository [16].

**Example 5.1.** We consider the polynomial

$$f = (x^2 - 5)^3 - 5^5 \in \mathbb{Q}_5[x].$$
Let $D_K \subset \mathbb{P}_K^1$ be the divisor of zeroes of $f$ joined by the point $\infty$. This corresponds to the branch divisor of the cover $Y \to \mathbb{P}_K^1$ defined by $(x, y) \mapsto (x).^6$

We will now compute the set $V^*$ as described in Algorithm 3.10. Since $f$ is irreducible, the set $V_\infty$ consists of only two valuations,

$$V_\infty = \{v_\infty, v_f\},$$

where $v_\infty = [v_0, v(x) = -\infty]$, $v_f = [v_0, v_1(x) = 1/2, v_2(x^2 - 5) = 5/3, v_3(f) = \infty]$. In the first step we add the predecessors of the valuations in $V_\infty$ and obtain

$$V_1^* = V_\infty \cup \{v_0, [v_0, v_1(x) = 1/2], [v_1, v_2(x^2 - 5) = 5/3]\}.$$

This set is already inf-closed, so there is nothing to do in the second step, i.e. $V_2^* = V_1^*$.

Applying Algorithm 3.13 to the set $V_2$, we find

$$V_3^* = V_2^* \cup \{v'_1 = [v_0, v_1(x) = 1]\} \cup \{v_{2,\lambda} = [v_1, v_2(x^2 - 5) = \lambda] \mid \lambda \in \{3/2, 7/4, 2\}\}.$$

<figure><img src="image_3.png" /><figcaption>Figure 1: Different steps in Algorithm 3.10 with input $f = (x^2 - 5)^3 - 5^5$</figcaption></figure>

Let $(X, D)$ be the model corresponding to $V^* = V_3^*$, and denote by $Y$ the normalization of $X$ in the function field of $Y$. By Theorems 3.15 and 1.5, $Y$ is a model for $Y$ with at most tame cyclic quotient singularities.

**Example 5.2.** Let $Y$ be the genus-2 hyperelliptic curve defined by

$$Y : y^2 = (x^2 - 5)^3 - 5^5 \quad \text{over } \mathbb{Q}_5.$$

In Example 5.1, we have already computed a model $\mathcal{X}$ of the projective line as is needed for Step (1) in Algorithm 4.12.

In Step (2), we choose $\eta = dx/y$ and since $Y$ is a genus-2 curve, a basis for $M_K$ is

$$\mathcal{B}_0 = (1, x),$$

where $M_K$ is viewed as a subspace of $F_Y$.

Next, we have to compute the extensions of the valuations in $V = V^* \cap V(K[x])$ to $F_Y$. We denote this set by $W$. For example the unique extension of the valuation

$$v_2 = [v_0, v_1(x) = 1/2, v_2(x^2 - 5) = 5/3] \in V$$

<footnote n="6">⁶If $n | 6$, then $\infty$ is not in the branch locus of the cover. Since we do not construct minimal models, there is no harm in adding it to the divisor $D_K$.</footnote>
to $F_Y$ is given by

$$w = [v_2, w(y^2 - (x^2 - 5)^3 - 5^5) = \infty].$$

In order to compute the module $M_w$ for this valuation, we first compute $v_2(dx)$. A defining system for $v_2$ is given by

$$(u_v, t_v) = \left( \frac{(x^2 - 5) \cdot x}{5^2}, \frac{(x^2 - 5)^3}{5^5} \right).$$

These two elements satisfy an algebraic relation $F_v(u_v, t_v) = 0$, where $F_v$ is a degree-6 polynomial. Computing this polynomial and applying Proposition 4.9, one obtains $v(dx) = 2$. More details are given in [15, Example 7.10].

Since the extension of valuations $w/v$ is unramified, we conclude that $w(dx) = 2$ as well (Lemma 4.11). Moreover $w(y^2) = v_2((x^2 - 5)^3 + 5^5) = 5$, hence $w(\eta) = w(dx) - w(y) = -1/2$.

It is easy to see that $B_0$ is already reduced with respect to $w$. And Corollary 4.4 shows that

$$B_w = (5, x)$$

is a basis for $M_w$.

<table><caption>Table 1: Data for Step (3) with $n = 2$</caption><thead><tr><th>v</th><th>v<sub>0</sub></th><th>v<sub>1</sub></th><th>v<sub>1</sub></th><th>v<sub>2,3/2</sub></th><th>v<sub>2</sub></th><th>v<sub>2,7/4</sub></th><th>v<sub>2,2</sub></th></tr></thead><tbody><tr><th>v(dx)</th><td>0</td><td>1</td><td>1</td><td>3/2</td><td>2</td><td>2</td><td>2</td></tr><tr><th>w<sub>v</sub>(η)</th><td>0</td><td>-1/2</td><td>0</td><td>-1/2</td><td>-1/2</td><td>-1/2</td><td>-1/2</td></tr></tbody></table>

The data for the remaining valuations is summarized in Table 1. The notation for the valuations in $V$ is the same as in Example 5.1. Note that some of the valuations $v \in V$ have more than one extension to $F_Y$. However, the value of $v(dx)$ (respectively $w_v(\eta)$) is the same for these extensions. Therefore we do not distinguish between different extensions in our table. In the implementation, it is necessary to perform the computation for all extensions, because the reduced bases might differ.

In total, we obtain the basis

$$B = (5, x)$$

for $M_Y$ (viewed as a subspace of $F_Y$).

**Example 5.3.** Now, we consider the genus-4 curve birationally defined by

$$Y : y^3 = (x^2 - 5)^3 - 5^5 \quad \text{over } \mathbb{Q}_5.$$

Clearly, the first step of the algorithm yields precisely the same output as in the previous example. In Step (2), we choose $\eta = dx/y^2$ and the basis

$$B_0 = (1, x, x^2, y)$$

of $M_K$.

Next, the extensions of the valuations in $V = V(\mathcal{X})$ to $F_Y$ are computed. The relevant data is given in Table 2.<fnref n="7" />

In this case, the reduced bases become more interesting. For example consider the valuation $v_2 = [v_0, v_1(x) = 1/2, v_2(x^2 - 5) = 5/3]$ and its unique extension $w$ to $F_Y$. The basis $(1, x, x^2 - 5, y)$ is reduced with respect to $w$. From the table, we can deduce that

$$B_w = (5^2, 5x, x^2 - 5, y)$$

<footnote n="7">⁷Although a cover of degree three is considered, we often obtain two valuations lying above a valuation $v \in V$ (see the second row of the table). Recall that we do not assume that the residue field is algebraically closed. Extending the field $\mathbb{Q}_p$ by adding a primitive third root of unity, the 2's in the second row of Table 2 become 3's, whereas the remaining values do not change, since the extension is unramified.</footnote>
<table><caption>Table 2: Data for Step (3) with $n = 3$</caption><thead><tr><th>v</th><th>v<sub>0</sub></th><th>v<sub>1</sub></th><th>v<sub>1'</sub></th><th>v<sub>2,3/2</sub></th><th>v<sub>2</sub></th><th>v<sub>2,7/4</sub></th><th>v<sub>2,2</sub></th></tr></thead><tbody><tr><td>v(dx)</td><td>0</td><td>1</td><td>1</td><td>3/2</td><td>2</td><td>2</td><td>2</td></tr><tr><td>#{w ∈ V(F) : w|<sub>K(x)</sub> = v}</td><td>2</td><td>2</td><td>2</td><td>2</td><td>1</td><td>1</td><td>1</td></tr><tr><td>e(w : v)</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>3</td><td>3</td></tr><tr><td>w<sub>v</sub>(η)</td><td>0</td><td>-1</td><td>-1</td><td>-3/2</td><td>-4/3</td><td>-7/6</td><td>-1</td></tr></tbody></table>

is a basis for $M_w$.

Repeating this computation for all valuations $w \in W$ and then computing the intersection of the resulting lattices, we obtain

$$ \mathcal{B} = (5^2, 5x, x^2 - 5, y). $$

## References

[1] Vladimir G. Berkovich, *Spectral theory and analytic geometry over non-Archimedean fields*, American Mathematical Soc., 2012.

[2] Wieb Bosma, John Cannon, and Catherine Playoust, *The Magma algebra system. I. The user language*, J. Symbolic Comput. **24** (1997), no. 3-4, 235-265, Computational algebra and number theory (London, 1993).

[3] Jean-François Boutot, *Singularités rationnelles et quotients par les groupes réductifs*, Inventiones mathematicae **88** (1987), no. 1, 65-68.

[4] Irene Bouw, Nirvana Coppola, Pmar Kihçer, Sabrina Kunzweiler, Elisa Lorenzo García, and Anna Somoza, *Reduction types of genus-3 curves in a special stratum of their moduli space*, Women in Numbers Europe III, Springer, 2021, pp. 115-162.

[5] Tim Dokchitser, *Models of curves*, https://people.maths.bris.ac.uk/~matyd/newton/.

[6] ———, *Models of curves over discrete valuation rings*, Duke Mathematical Journal **170** (2021), no. 11, 2519-2574.

[7] Tim Dokchitser, Vladimir Dokchitser, Céline Maistret, and Adam Morgan, *Arithmetic of hyperelliptic curves over local fields*, Contemp. Math **724** (2019), 73-135.

[8] Julio Fernández, Jordi Guàrdia, Jesús Montes, and Enric Nart, *Residual ideals of MacLane valuations*, Journal of Algebra **427** (2015), 30-75.

[9] E. Victor Flynn, Franck Leprévost, Edward Schaefer, William Stein, Michael Stoll, and Joseph Wetherell, *Empirical evidence for the Birch and Swinnerton-Dyer conjectures for modular Jacobians of genus 2 curves*, Mathematics of Computation **70** (2001), no. 236, 1675-1697.

[10] Alexander Grothendieck and Jacob P. Murre, *The tame fundamental group of a formal neighbourhood of a divisor with normal crossings on a scheme*, LNM, vol. 208, Springer, 2006.

[11] Lars Halvard Halle and Johannes Nicaise, *Néron models and base change*, Lecture Notes in Math., vol. 2156, Springer, 2016.

[12] Kazuya Kato, *Toric singularities*, American J. Math. **116** (1994), no. 5, 1073-1099.
[13] Ivan Kausz, *A discriminant and an upper bound for $\omega^2$ for hyperelliptic arithmetic surfaces*, Compositio Mathematica **115** (1999), no. 1, 37–69.

[14] Sabrina Kunzweiler, *Differential forms on hyperelliptic curves with semistable reduction*, Research in Number Theory **6** (2020), no. 2, 1–17.

[15] ———, *Models of curves and integral differential forms*, Ph.D. thesis, Universität Ulm, 2021.

[16] Sabrina Kunzweiler and Stefan Wewers, https://github.com/swewers/regular_models.

[17] Joseph Lipman, *Rational singularities with applications to algebraic surfaces and unique factorization*, Publications Mathématiques de l'IHÉS **36** (1969), 195–279.

[18] Joseph Lipman, *Desingularization of two-dimensional schemes*, Annals of Mathematics **107** (1978), no. 2, 151–207.

[19] Qing Liu, *Algebraic geometry and arithmetic curves*, vol. 6, Oxford University Press on Demand, 2002.

[20] Saunders MacLane, *A construction for absolute values in polynomial rings*, Trans. Amer. Math. Soc **40** (1936), no. 3, 363–395.

[21] Hideyuki Matsumura, *Commutative ring theory*, Cambridge studies in advanced mathematics, vol. 8, Cambridge university press, 1989.

[22] Matthew Morrow, *An explicit approach to residues on and dualizing sheaves of arithmetic surfaces*, New York J. Math **16** (2010), no. 2010, 575–627.

[23] Simone Muselli, *Models and integral differentials of hyperelliptic curves*, Glasgow Mathematical Journal **66** (2024), no. 2, 382–439.

[24] Jürgen Neukirch, *Algebraische zahlentheorie*, Springer, 1992.

[25] Andrew Obus and Padmavathi Srinivasan, *Explicit minimal embedded resolutions of divisors on models of the projective line*, Research in Number Theory **8** (2022), no. 2, 27.

[26] ———, *Conductor-discriminant inequality for hyperelliptic curves in odd residue characteristic*, International Mathematics Research Notices **2024** (2024), no. 9, 7343–7359.

[27] Andrew Obus and Stefan Wewers, *Explicit resolution of weak wild quotient singularities on arithmetic surfaces*, J. Algebraic Geometry (2019), https://doi.org/10.1090/jag/745.

[28] Julian Rüth, *Models of curves and valuations*, Ph.D. thesis, Universität Ulm, 2015.

[29] Julian Rüth and Stefan Wewers, *MCLF: A Sage toolbox for computations with Models of Curves over Local Fields*, https://github.com/MCLF/mclf.

[30] The Sage Developers, *Sagemath, the Sage Mathematics Software System (Version 10.5)*, 2025, https://www.sagemath.org.

[31] Raymond van Bommel, *Numerical verification of the Birch and Swinnerton-Dyer conjecture for hyperelliptic curves of higher genus over $\mathbb{Q}$ up to squares*, Experimental Mathematics (2019), 1–8.

Sabrina Kunzweiler
Inria Centre de l'université de Bordeaux
351, cours de la Libération
33405 Talence
sabrina.kunzweiler@math.u-bordeaux.fr
Stefan Wewers
Institut für Algebra und Zahlentheorie
Universität Ulm
Helmholtzstr. 18
89081 Ulm
stefan.wewers@uni-ulm.de