# Weierstrass sets on finite graphs

Alessio Borzì

###### Abstract

We study two possible tropical analogues of Weierstrass semigroups on graphs,
called rank and functional Weierstrass sets. We prove that on simple graphs,
the first is contained in the second. We completely characterize the subsets
of $\mathbb{N}$ arising as a functional Weierstrass set of some graph.
Finally, we give a sufficient condition for a subset of $\mathbb{N}$ to be the
rank Weierstrass set of some graph, allowing us to construct examples of rank
Weierstrass sets that are not semigroups.

##  1 Introduction

Let $X$ be a smooth projective algebraic curve of genus $g$ and fix a point
$P\in X$. Denote by $H(P)$ the set of pole orders at $P$ of rational functions
regular on $X\setminus\\{P\\}$. By the Weierstrass gap theorem (see [11,
III.5.3]), the set of _gaps_ $G(P)=\mathbb{N}\setminus H(P)$ has cardinality
exactly $g$. This implies that $H(P)$ is a _numerical semigroup_ , that is, a
cofinite additive submonoid of $\mathbb{N}$. The numerical semigroups arising
in this way are called _Weierstrass semigroups_. We have
$G(P)=\\{1,\dots,g\\}$ except in a finite number of points, called
_Weierstrass points_ of $X$ (see [11, III.5.9]).

In 1893 Hurwitz [13] asks if all the numerical semigroups arise in this
manner. Several years later, in 1980, Buchweitz [5] showed that the numerical
semigroup $S=\langle 13,14,15,16,17,18,20,22,23\rangle$ is not Weierstrass
(see also [9, page 499]). The proof essentially gives the following necessary
condition for a semigroup to be Weierstrass: the $m$-sumset of the set of gaps
must satisfy $|mG(P)|\leq(2m-1)(g-1)$ for any integer $m\geq 2$. Several
numerical semigroups not satisfying the previous condition are constructed in
[16]. Furthermore, in [10] it was proved that for a fixed numerical semigroup
$S$, the set of integers $m$ that do not satisfy the above condition is
finite. Despite these results, little is known more generally about the family
of Weierstrass semigroups. For instance, the problem of determining its
density in the set of all numerical semigroups is still open [15].

After the advent of tropical geometry, the tropical analogues of many
classical results in algebraic geometry were found. Baker and Norine [2]
proved a Riemann-Roch theorem for graphs, which was successively extended by
Gathmann and Kerber [12] and Mikhalkin and Zharkov [17] to _metric graphs_ ,
namely (abstract) tropical curves. The analogue notion of Weierstrass points
on graphs was studied for instance in [1, Section 4] and [19].

Inspired by a work of Kang, Matthews and Peachey [14], in this paper we
investigate possible tropical analogues of Weierstrass semigroups. We will
focus our attention on graphs rather than metric graphs, the latter are left
for future work. It was already noted in [14] that two possible non-equivalent
definitions can be given, as we now explain. Throughout this paper, a _graph_
will mean a finite connected multigraph having no loop edges. Let $G$ be a
graph and fix a vertex $P\in V(G)$ of $G$. The _functional Weierstrass set_ of
$G$ at $P$ is defined by

$H_{f}(P)=\\{n\in\mathbb{N}:\exists f\in\mathcal{M}(G)\text{ that has a unique
pole of order $n$ at $P$}\\},$

where $\mathcal{M}(G)$ is the set of all integer-valued functions on the
vertices of $G$. The _rank Weierstrass set_ of $G$ at $P$ is defined by

$H_{r}(P)=\\{n\in\mathbb{N}:r(nP)>r((n-1)P)\\},$

where $r(D)$ denotes the _rank_ of the divisor $D$ of the graph $G$, in the
sense of Baker and Norine [2] (see Section 2). Classically, for curves, we
have $H_{f}(P)=H_{r}(P)=H(P)$. However this is not the case for graphs, for
instance the cardinality of the set difference $H_{f}(P)\setminus H_{r}(P)$
can be arbitrarily large [14, Proposition 3.9].

Our first main result was conjectured in [14], and relates the two sets when
$G$ is a graph with no multiple edges and more than one vertex, that in this
paper will be called _simple_.

######  Theorem A (Theorem 3.4).

Let $G$ be a simple graph. For every $P\in V(G)$ we have $H_{r}(P)\subseteq
H_{f}(P)$.

As an application of the previous theorem, we calculate the rank and
functional Weierstrass set of the graphs $K_{n+1}$ and $K_{n,m}$.

Secondly, we completely characterize the subsets of $\mathbb{N}$ arising as
functional Weierstrass sets of graphs and of simple graphs, answering a
question in [14].

######  Theorem B (Theorem 4.5).

The functional Weierstrass sets of graphs (resp. simple graphs) are precisely
the additive submonoids of $\mathbb{N}$ (resp. numerical semigroups).

Further, we give a sufficient condition for a subset of $\mathbb{N}$ to be the
rank Weierstrass set of a graph.

######  Theorem C (Theorem 5.3).

Let $e_{1}\geq e_{2}\geq\dots\geq e_{n}\geq 0$ be integers and set
$s_{i}=\nolinebreak\sum_{j=1}^{i}e_{j}$. There exists a simple graph $G$ with
a vertex $P\in V(G)$ such that

$H_{r}(P)=\\{0,s_{1},s_{2},\dots,s_{n-1}\\}\cup(s_{n}+\mathbb{N}).$

The previous theorem allows us to construct families of graphs in which the
rank Weierstrass set is not a semigroup (see Example 5.6), justifying the name
“Weierstrass _set_ ”.

##  2 Preliminaries

In this section, we fix our notation and review the basics and some results of
Riemann-Roch theory on finite graphs.

In this paper, a _graph_ will mean a finite connected multigraph having no
loop edges; a _simple graph_ will mean a graph with no multiple edges and more
than one vertex. Let $G$ be a graph and let $V(G)$ (resp. $E(G)$) denote the
set of vertices (resp. edges) of $G$. The set
$\operatorname{\operatorname{Div}}(G)$ of _divisors_ of $G$ is the free
abelian group on $V(G)$. We think of a divisor as a formal integer linear
combination of the vertices $D=\sum_{P\in
V(G)}a_{P}P\in\operatorname{\operatorname{Div}}(G)$ with $a_{P}\in\mathbb{Z}$.
For convenience, we will write $D(P)$ for the coefficient $a_{P}$ of $P$ in
$D$. The _degree_ of a divisor $D$ is defined by $\deg(D)=\sum_{P\in
V(G)}D(P)\in\mathbb{Z}$. If
$D,D^{\prime}\in\operatorname{\operatorname{Div}}(G)$ are two divisors, then
$D\geq D^{\prime}$ if and only if $D(P)\geq D^{\prime}(P)$ for all $P\in
V(G)$. A divisor $D$ is _effective_ if $D\geq 0$. The set of effective
divisors of degree $d$ is denoted by
$\operatorname{\operatorname{Div}}_{+}^{d}(G)$.

Let $\mathcal{M}(G)=\operatorname{Hom}(V(G),\mathbb{Z})$ be the set of
integer-valued functions on the vertices of $G$. For every vertex $P\in V(G)$,
define the _indicator function_ $f_{P}\in\mathcal{M}(G)$ by

$f_{P}(Q)=\begin{cases}-1&Q=P,\\\ 0&Q\neq P.\end{cases}$

Let $f\in\mathcal{M}(G)$, and denote by $\mathcal{N}(P)$ the neighbourhood of
$P\in V(G)$, that is, the subset of vertices of $G$ adjacent to $P$. Define
the _Laplacian operator_
$\Delta:\mathcal{M}(G)\rightarrow\operatorname{\operatorname{Div}}(G)$ by

$\Delta f=\sum_{P\in
V(G)}\left(\sum_{Q\in\mathcal{N}(P)}\big{(}f(P)-f(Q)\big{)}\right)P.$

The divisors of the form $\Delta f$ are _principal_. For convenience we will
write $\Delta_{P}f$ for the coefficient $\Delta f(P)$. If we think of $f$ as a
vector, the Laplacian operator can be seen as the multiplication of the
_Laplacian matrix_ $Q=D-A$, where $D$ is the diagonal matrix of the degrees of
the vertices, and $A$ is the adjacency matrix of $G$. The matrix $Q$ has rank
$|V(G)|-1$, and $\ker Q=(1,\dots,1)^{t}$. From this fact, it is easy to see
that every principal divisor has degree $0$.

Two divisors $D,D^{\prime}\in\operatorname{\operatorname{Div}}(G)$ are
_linearly equivalent_ , written $D\sim D^{\prime}$, if $D-D^{\prime}=\Delta
f$, for some $f\in\mathcal{M}(G)$. The _linear system_ associated to a divisor
$D\in\operatorname{\operatorname{Div}}(G)$ is

$|D|=\\{E\in\operatorname{\operatorname{Div}}(G):E\sim D,E\geq 0\\}.$

The _rank_ $r(D)$ of a divisor $D$ is defined as $-1$ if $|D|=\emptyset$,
otherwise

$r(D)=\max\\{k\in\mathbb{N}:|D-E|\neq\emptyset,\,\forall
E\in\operatorname{\operatorname{Div}}_{+}^{k}(G)\\}.$

######  Lemma 2.1.

[2, Lemma 2.1] For all $D_{1},D_{2}\in\operatorname{\operatorname{Div}}(G)$
with $r(D_{1}),r(D_{2})\geq 0$ we have $r(D_{1}+D_{2})\geq r(D_{1})+r(D_{2})$.

######  Lemma 2.2.

[1, Lemma 2.7] Let $G$ be a graph, and let
$D\in\operatorname{\operatorname{Div}}(G)$. Then $r(D-P)\geq r(D)-1$ for all
$P\in V(G)$, and if $r(D)\geq 0$, then $r(D-P)=r(D)-1$ for some $P\in V(G)$.

The _canonical divisor_ of $G$ is

$K_{G}=\sum_{P\in V(G)}(\deg(P)-2)P.$

It has degree $\deg(K_{G})=2g-2$, where $g=|E(G)|-|V(G)|+1$ is the _genus_ (or
_cyclomatic number_) of the graph $G$. We are now ready to state the Riemann-
Roch theorem for graphs, proved by Baker and Norine [2].

######  Theorem 2.3 (Riemann-Roch for graphs).

Let $D$ be a divisor on a graph $G$ of genus $g$. Then

$r(D)-r(K_{G}-D)=\deg(D)+1-g.$

For $A\subseteq V(G)$ and $Q\in A$, let
$\operatorname{\operatorname{outdeg}}_{A}(Q)$ denote the number of edges
incident with $Q$ and a vertex in $V(G)\setminus A$. Fix $P\in V(G)$. A
divisor $D$ is _$P$ -reduced_ if it is effective in $V(G)\setminus\\{P\\}$,
and every non-empty subset $A\subseteq V(G)\setminus\\{P\\}$ contains a vertex
$Q\in A$ such that $\operatorname{\operatorname{outdeg}}_{A}(Q)>D(Q)$.

######  Proposition 2.4.

[2, Proposition 3.1] Let $P$ be a vertex of a graph $G$. For every divisor $D$
in $G$, there exists a unique $P$-reduced divisor $D^{\prime}$ such that
$D\sim D^{\prime}$.

Following [1, Section 4], a vertex $P\in V(G)$ of a graph $G$ of genus $g$, is
a _Weierstrass point_ if $r(gP)\geq 1$. We now state an analogue of the
Weierstrass gap theorem for graphs.

######  Lemma 2.5.

[1, Lemma 4.2] Let $G$ be a graph of genus $g$, and fix a vertex $P\in V(G)$.

  1. 1.

$P$ is a Weierstrass point if and only if $\mathbb{N}\setminus
H_{r}(P)\neq\\{1,\dots,g\\}$.

  2. 2.

$|\mathbb{N}\setminus H_{r}(P)|=g$.

  3. 3.

$\mathbb{N}\setminus H_{r}(P)\subseteq\\{1,2,\dots,2g-1\\}$.

Note that, in the classical case for curves, the inclusion
$\mathbb{N}\setminus H(P)\subseteq\\{1,\dots,2g-1\\}$ follows from
$|\mathbb{N}\setminus H(P)|=g$ and the fact that $H(P)$ is a semigroup (see
[20, Lemma 2.14]).

We now describe a binary operation on graphs that we will use frequently in
Section 4 and 5. Let $G_{1}$ and $G_{2}$ be two graphs and $v_{1}$ and $v_{2}$
be vertices of respectively $G_{1}$ and $G_{2}$. The _vertex gluing_ (or
_vertex identification_) of $v_{1}$ and $v_{2}$ is the graph $G$ obtained from
$G_{1}$ and $G_{2}$ by identifying $v_{1}$ and $v_{2}$ as a new vertex $v$.

$G_{1}$$G_{2}$$G$$v_{1}$$v_{2}$$v$

##  3 The inclusion $H_{r}(P)\subseteq H_{f}(P)$

In this section, we will assume that $G$ is a simple graph. We will prove the
inclusion $H_{r}(P)\subseteq H_{f}(P)$ for every vertex $P\in V(G)$. First, we
will need a series of lemmas, inspired by the Cori-Le Borgne algorithm [7,
Proposition 2] for the rank of divisors of a complete graph.

######  Lemma 3.1.

Fix a vertex $P\in V(G)$ and let $D$ be a $P$-reduced divisor on $G$. There
exists a neighbour $Q\in V(G)\setminus\\{P\\}$ of $P$ such that $D(Q)=0$.

###### Proof.

Set $A=V(G)\setminus\\{P\\}$ and let $\mathcal{N}(P)\subseteq A$ be the set of
neighbours of $P$. Assume by contradiction that $D(Q)\geq 1$ for all
$Q\in\mathcal{N}(P)$. Since $G$ is simple, we have
$\operatorname{outdeg}_{A}(Q)=1$ for all $Q\in\mathcal{N}(P)$. This implies
$D(Q)\geq\operatorname{\operatorname{outdeg}}_{A}(Q)$ for all $Q\in A$,
contradicting the fact that $D$ is $P$-reduced. ∎

Let $D$ be a divisor on $G$ of rank $r$. Using the same terminology as in [7,
8], a _proof_ for the rank of $D$ is an effective divisor $E$ of degree $r+1$
with $|D-E|=\emptyset$. We denote by $\operatorname{\operatorname{Proof}}(D)$
the set of proofs of $D$. Note that if $D\sim D^{\prime}$, then
$\operatorname{\operatorname{Proof}}(D)=\operatorname{\operatorname{Proof}}(D^{\prime})$.

######  Lemma 3.2.

Fix a vertex $P\in V(G)$ and let $D$ be a $P$-reduced divisor on $G$ of rank
zero. We have
$\operatorname{\operatorname{Proof}}(D)\setminus\\{P\\}\neq\emptyset$.

###### Proof.

If $D(P)>0$, then
$P\notin\operatorname{\operatorname{Proof}}(D)\neq\emptyset$. Now assume
$D(P)=0$, from Lemma 3.1 there exists a neighbour $Q$ of $P$ such that
$D(Q)=0$. The divisor $D^{\prime}=D-Q$ is $Q$-reduced. In fact, let
$A\subseteq V(G)\setminus\\{Q\\}$: if $P\notin A$ then, since $D$ is
$P$-reduced, we have
$\operatorname{\operatorname{outdeg}}_{A}(v)>D(v)=D^{\prime}(v)$ for some
$v\in A$; otherwise if $P\in A$, then
$\operatorname{\operatorname{outdeg}}_{A}(P)\geq 1>0=D(P)=D^{\prime}(P)$.
Finally, since $D^{\prime}(Q)<0$ and $D^{\prime}$ is $Q$-reduced, it follows
that $Q$ is a proof for $D$ with $Q\neq P$. ∎

######  Lemma 3.3.

Let $D$ be a divisor on $G$. For every vertex $P\in V(G)$ there exists
$E\in\operatorname{\operatorname{Proof}}(D)$ such that $E(P)=0$.

###### Proof.

Without loss of generality, we can assume that $D$ is $P$-reduced. We proceed
by induction on the rank $r$ of $D$. The case $r=-1$ is trivial. If $r=0$ the
assertion follows from Lemma 3.2.

Now suppose that $D$ has rank $r\geq 1$ and assume the statement for divisors
of rank $r-1$. From Lemma 2.2 we have $r(D-P^{\prime})=r-1$ for some vertex
$P^{\prime}\in V(G)$. By the inductive hypothesis there exists
$E^{\prime}\in\operatorname{\operatorname{Proof}}(D-P^{\prime})$ such that
$E^{\prime}(P)=0$. Now apply Lemma 3.2 to the $P$-reduced divisor equivalent
to $D-E^{\prime}$. Thus there exists
$Q\in\operatorname{\operatorname{Proof}}(D-E^{\prime})$ with $Q\neq P$. We
conclude by noting that
$E=E^{\prime}+Q\in\operatorname{\operatorname{Proof}}(D)$ and $E(P)=0$. ∎

Now we prove the main result of the section. We will follow the proof outlined
in [14, Theorem 2.4] in which the previous Lemma 3.3 was the key step missing.

######  Theorem 3.4.

Let $G$ be a simple graph. For every $P\in V(G)$ we have $H_{r}(P)\subseteq
H_{f}(P)$.

###### Proof.

Let $n\in H_{r}(P)$. By Lemma 3.3, there exists an effective divisor
$E\in\operatorname{\operatorname{Proof}}((n-1)P)$ such that $E(P)=0$. By the
choice of $E$ and since $r(nP)>r((n-1)P)$, there exists a function
$f\in\mathcal{M}(G)$ such that

$\displaystyle(n-1)P-E+\Delta f\ngeq 0,$ $\displaystyle nP-E+\Delta f\geq 0.$

This, together with the fact that $E(P)=0$, implies that $f$ has a unique pole
of order $n$ at $P$, that is $n\in H_{f}(P)$. ∎

######  Remark 3.5.

In general, Theorem 3.4 fails when $G$ has just one vertex $P$ (in which case
we have $H_{f}(P)=\\{0\\}$ and $H_{r}(P)=\mathbb{N}$) and when $G$ has
multiple edges. An example of the last statement is given by the multigraph
$B_{n}$ with two vertices connected by $n$ edges. For every vertex $P\in
V(B_{n})$, it results $H_{f}(P)=n\mathbb{N}$ and
$H_{r}(P)=\mathbb{N}\setminus\\{1,\dots,n-1\\}$, hence $H_{r}(P)\nsubseteq
H_{f}(P)$.

Following the strategy outlined in [14], as an application of Theorem 3.4 we
calculate the rank Weierstrass set of complete and complete bipartite graphs
from their functional Weierstrass set. In fact, in these two cases we have
$H_{r}(P)=H_{f}(P)$ for every vertex $P$ of the graph.

######  Lemma 3.6.

[14, Porism 2.11] Let $G$ be a simple graph, let $P\in V(G)$ be a vertex and
let $G-P$ be the graph $G$ with the vertex $P$ and its adjacent edges removed.
If $G-P$ is connected and $f\in\mathcal{M}(G)$ is a function with a unique
pole at $P$, then $f(P)<f(Q)$ for every $Q\in V(G)$.

Let $n\geq 1$ and consider the complete graph $K_{n+1}$.

######  Lemma 3.7.

[14, Proposition 3.7] For every vertex $P\in V(K_{n+1})$, we have
$H_{f}(P)=\langle n,n+1\rangle$.

######  Corollary 3.8.

For every vertex $P\in V(K_{n+1})$, we have $H_{r}(P)=\langle n,n+1\rangle$.

###### Proof.

By Lemma 3.7 and Theorem 3.4 we have $H_{r}(P)\subseteq H_{f}(P)=\langle
n,n+1\rangle$. Finally, from Lemma 2.5 we have $|\mathbb{N}\setminus
H_{r}(P)|=g(K_{n+1})=|\mathbb{N}\setminus\langle n,n+1\rangle|$. ∎

Now let $n,m\geq 1$ and consider the complete bipartite graph $K_{n.m}$. The
proof of the following lemma is inspired by the proof of [14, Proposition
3.7].

######  Lemma 3.9.

Let $P\in V(K_{m,n})$ be a vertex of degree $n$, we have

$H_{f}(P)=n\mathbb{N}\cup(n(m-1)+\mathbb{N})$

###### Proof.

If $n$ or $m$ is equal to $1$, then $H_{f}(P)=\mathbb{N}$, so we assume that
$n,m\geq 2$. We label the vertices of $K_{n,m}$ of degree $n$ by
$P=P_{1},P_{2},\dots,P_{m}$ and the vertices of degree $m$ by
$Q=Q_{1},\dots,Q_{n}$. Let $f\in\mathcal{M}(K_{n,m})$ with a unique pole at
$P$. By Lemma 3.6 the minimum of $f$ is attained at $P$. Without loss of
generality we can assume $f(P)=0$. Set $f(Q_{i})=a+\alpha_{i}$ for
$i\in\\{1,\dots,n\\}$ with $a,\alpha_{i}\in\mathbb{N}$ and $\alpha_{1}=0$, and
$f(P_{i})=b+\beta_{i}$ for $i\in\\{2,\dots,m\\}$ with
$b,\beta_{i}\in\mathbb{N}$ and $\beta_{2}=0$. Now we have

$\displaystyle-\Delta_{P}f$ $\displaystyle=na+\sum_{i=2}^{n}\alpha_{i}\geq 0,$
$\displaystyle\Delta_{Q}f$
$\displaystyle=a+(m-1)(a-b)-\sum_{i=3}^{m}\beta_{i}\geq 0,$
$\displaystyle\Delta_{P_{2}}f$
$\displaystyle=n(b-a)-\sum_{i=2}^{n}\alpha_{i}\geq 0.$

Now if $a\geq b$, then from the third inequality $0\geq
n(b-a)\geq\sum\alpha_{i}\geq 0$. Hence $\alpha_{i}=0$ for all
$i\in\\{2,\dots,m\\}$ and $-\Delta_{P}f=na\in n\mathbb{N}$. On the other hand,
if $a<b$, then from the second inequality

$a+(m-1)(a-b)\geq\sum\beta_{i}\geq 0\Rightarrow a\geq(m-1)(b-a)\geq m-1.$

This implies $-\Delta_{P}f=na+\sum\alpha_{i}\geq n(m-1)$, that is
$-\Delta_{P}f\in n(m-1)+\mathbb{N}$. This proves the inclusion
$H_{f}(P)\subseteq n\mathbb{N}\cup(n(m-1)+\mathbb{N})$.

For the reverse inclusion, it is enough to note that, for the indicator
function $f_{P}$, we have $\Delta f_{P}=-nP+\sum Q_{i}$. In addition, for
every $t\in\\{1,\dots,n-1\\}$

$\Delta\left(mf_{P}+\sum_{i=1}^{t}f_{Q_{i}}\right)=-\big{(}n(m-1)+t\big{)}P+\sum_{i=2}^{m}tP_{i}+\sum_{i=t+1}^{n}mQ_{i}.$

∎

Proceeding similarly as in the proof of Corollary 3.8, we are able to
calculate the rank Weierstrass set of complete bipartite graphs.

######  Corollary 3.10.

Let $P\in V(K_{m,n})$ be a vertex of degree $n$, we have

$H_{r}(P)=n\mathbb{N}\cup((m-1)n+\mathbb{N})$

######  Remark 3.11.

The computation of the rank Weierstrass set of complete graphs (Corollary 3.8)
was already implicit in the proof of [6, Theorem 8], a result that gives an
upper bound for the gonality sequence of complete graphs. In fact, we note
that the rank Weierstrass set of a complete graph coincides with its gonality
sequence.

######  Question 3.12.

Under which conditions on the graph $G$ and the vertex $P$ do we have
$H_{f}(P)=H_{r}(P)$?

##  4 Functional Weierstrass sets

In this section, we characterize the subsets of $\mathbb{N}$ that arise as the
functional Weierstrass sets of some graph or simple graph.

######  Lemma 4.1.

Let $G$ be a graph and fix a vertex $P\in V(G)$. The functional Weierstrass
set $H_{f}(P)$ is an additive submonoid of $\mathbb{N}$. Further, if $G$ is
simple, then $H_{f}(P)$ is a numerical semigroup.

###### Proof.

We always have $0\in H_{f}(P)$. Further, for every $f,g\in\mathcal{M}(G)$, we
have $\Delta(f+g)=\Delta f+\Delta g$, so $H_{f}(P)$ is closed under addition.
Moreover, if $G$ is simple, from Theorem 3.4 we have $H_{r}(P)\subseteq
H_{f}(P)$, and from Lemma 2.5 it follows $|\mathbb{N}\setminus
H_{f}(P)|\leq|\mathbb{N}\setminus H_{r}(P)|=g(G)$. Therefore $H_{f}(P)$ is a
numerical semigroup. ∎

When the graph $G$ is not clear from the context, we denote the functional
Weierstrass set by $H_{f}^{G}(P)$. For two subsets $A,B\subseteq\mathbb{N}$,
we define

$A+B=\\{a+b:a\in A,b\in B\\}.$

######  Proposition 4.2.

Let $G_{1}$ and $G_{2}$ be two graphs, and let $G$ be the graph obtained from
$G_{1}$ and $G_{2}$ by the vertex gluing of $P_{1}\in V(G_{1})$ and $P_{2}\in
V(G_{2})$, and denote by $P\in V(G)$ the identified vertex in $G$. Then

$H^{G}_{f}(P)=H^{G_{1}}_{f}(P_{1})+H^{G_{2}}_{f}(P_{2}).$

###### Proof.

We will consider $G_{1}$ and $G_{2}$ as subgraphs of $G$. For simplicity, set
$S=H_{f}^{G}(P)$ and $S_{i}=H^{G_{i}}_{f}(P_{i})$ for $i\in\\{1,2\\}$. Let
$x\in S_{1}$, then there exists $f\in\mathcal{M}(G_{1})$ such that
$\Delta(f)=D-xP_{1}$ for some effective divisor $D\geq 0$. Consider the
extension $f^{\prime}$ of $f$ to $G$ by setting $f^{\prime}(v)=f(P)$ for all
$v\in V(G_{2})\setminus\\{P\\}$. Then $\Delta(f^{\prime})=\Delta(f)$ and $x\in
S$. This proves $S_{1}\subseteq S$. Similarly we obtain $S_{2}\subseteq S$,
thus $S_{1}+S_{2}\subseteq S$ since $S$ is closed under addition.

On the other hand, let $x\in S$. Then there exists $f\in\mathcal{M}(G)$ such
that $\Delta(f)=D-xP$ for some $D\geq 0$. Substituting $f$ with $f+a$ for some
constant $a\in\mathbb{Z}$ if necessary, we can assume that $f(P)=0$. For
$i\in\\{1,2\\}$, define

$f_{i}\in\mathcal{M}(G_{i})\quad f_{i}(v)=f(v)\quad\forall v\in
V(G_{i})\subseteq V(G).$

Since $f(P)=0$, we have $\Delta_{v}(f_{i})=\Delta_{v}(f)\geq 0$ for all $v\in
V(G_{i})\setminus\\{P\\}\subseteq V(G)$, with $i\in\\{1,2\\}$. Since every
principal divisor has degree zero, we have

$\Delta(f_{1})=D_{1}-x_{1}P,\quad\Delta(f_{2})=D_{2}-x_{2}P$

for some $x_{1},x_{2}\in\mathbb{N}$ and some effective divisor $D_{i}\geq 0$
on $G_{i}$ for $i\in\\{1,2\\}$. From the definition we have $f=f_{1}+f_{2}$,
therefore $\Delta(f)=\Delta(f_{1})+\Delta(f_{2})$, hence $x=x_{1}+x_{2}\in
S_{1}+S_{2}$. ∎

######  Corollary 4.3.

For every additive submonoid $M$ of $\mathbb{N}$ there exists a graph $G$ such
that $M=H_{f}(P)$ for some $P\in V(G)$.

###### Proof.

From [20, Lemma 2.3], every additive submonoid of $\mathbb{N}$ is finitely
generated, so suppose that $M=\langle n_{1},\dots,n_{e}\rangle$. Now let $G$
be the graph with vertices $V(G)=\\{P,P_{1},\dots,P_{e}\\}$ where the vertex
$P$ has $n_{i}$ edges connected to the vertex $P_{i}$ for every
$i\in\\{1,\dots,e\\}$. From Remark 3.5 and Proposition 4.2 it follows that
$H_{f}(P)=n_{1}\mathbb{N}+\dots+n_{e}\mathbb{N}=M$. ∎

######  Corollary 4.4.

For every numerical semigroup $S$ there exists a simple graph $G$ such that
$S=H_{f}(P)$ for some $P\in V(G)$.

###### Proof.

Suppose that $S=\langle n_{1},\dots,n_{e}\rangle$. Set
$m=\max(\mathbb{N}\setminus S)+2$ and consider the complete bipartite graphs
$K_{m,n_{1}},\dots,K_{m,n_{e}}$. Fix a vertex of degree $n_{i}$ in each graph
and construct the graph $G$ by identifying these vertices, recursively
applying the vertex gluing. Denote with $P$ the identified vertex in $G$. From
Proposition 4.2 and Lemma 3.9 we obtain $H_{f}(P)=S$. ∎

Using Lemma 4.1 and Corollary 4.3 and 4.4 we now state the main result of this
section.

######  Theorem 4.5.

The functional Weierstrass sets of graphs (resp. simple graphs) are precisely
the additive submonoids of $\mathbb{N}$ (resp. numerical semigroups).

We close the section by calculating the multiplicity of the functional
Weierstrass set of a simple graph. Recall that the multiplicity of a numerical
semigroup $S$ is the integer $m(S)=\min(S\setminus\\{0\\})$. Let $G$ be a
simple graph and fix a vertex $P\in V(G)$. Denote with $G-P$ the graph
obtained from $G$ by removing the vertex $P$ and its adjacent edges.

######  Lemma 4.6.

[14, Theorem 2.10] Suppose that $G-P$ is connected. Then
$m(H_{f}(P))=\deg(P)$.

######  Proposition 4.7.

Let $G_{1},\dots,G_{m}$ be the connected components of $G-P$, and let
$\deg_{G_{i}}P$ be the number of edges incident with $P$ in $G_{i}$. Then

$m(H_{f}(P))=\min\\{\deg_{G_{i}}P:i\in\\{1,\dots,m\\}\\}$

###### Proof.

Let $C_{i}$ be the graph obtained from $G_{i}$ by adding the vertex $P$ and
the edges of $G$ incident with $P$ in $G_{i}$. The graph $G$ can be seen as
the vertex gluing of the graphs $C_{i}$ along $P$. Now it is enough to apply
Proposition 4.2 and Lemma 4.6. ∎

##  5 Rank Weierstrass sets

Let $G$ be a graph and fix a vertex $P\in V(G)$. Define the function
$\lambda_{P}:\mathbb{N}\rightarrow\mathbb{N}$ by

$\lambda_{P}(k)=\min\\{n\in\mathbb{N}:r(nP)=k\\}.$

Note that the function $\lambda_{P}$ is an order preserving bijection between
$\mathbb{N}$ and $H_{r}(P)$. Thus, $\lambda_{P}$ completely determines
$H_{r}(P)$ and vice versa. We will write $\lambda^{G}_{P}$ when the graph $G$
is not clear from the context

######  Proposition 5.1.

Let $G_{1}$ and $G_{2}$ be two graphs and fix $P_{i}\in V(G_{i})$ for
$i\in\\{1,2\\}$. Let $G$ be the vertex gluing of $P_{1}$ and $P_{2}$, and let
$P$ be the identified vertex. Then

$\lambda^{G}_{P}(k)=\max\left\\{\lambda_{P_{1}}^{G_{1}}(k_{1})+\lambda_{P_{2}}^{G_{2}}(k_{2}):k_{1}+k_{2}=k\right\\}.$

###### Proof.

We will consider $G_{1}$ and $G_{2}$ as subgraphs of $G$. First, note that
every divisor $E\in\operatorname{\operatorname{Div}}_{+}^{k}(G)$ can be
decomposed as the sum $E=E_{1}+E_{2}$ where
$E_{i}\in\operatorname{\operatorname{Div}}_{+}^{k_{i}}(G_{i})$ for
$i\in\\{1,2\\}$ with $k_{1}+k_{2}=k$. Further, if $\Delta f$ is a principal
divisor in $G$, without loss of generality we can assume that $f(P)=0$, so
that $f=f_{1}+f_{2}$ with $f_{1}=0$ in $G_{2}$ and $f_{2}=0$ in $G_{1}$. It
follows that $\Delta f=\Delta f_{1}+\Delta f_{2}$, in other words any
principal divisor in $G$ is the sum of two principal divisors in $G_{1}$ and
$G_{2}$ respectively.

######  Claim.

Let $n,k\in\mathbb{N}$, the following statements are equivalent:

  1. 1.

$|nP-E|\neq\emptyset$ for every
$E\in\operatorname{\operatorname{Div}}_{+}^{k}(G)$,

  2. 2.

$n\geq\lambda_{P_{1}}^{G_{1}}(k_{1})+\lambda_{P_{2}}^{G_{2}}(k_{2})$ for every
$k_{1}+k_{2}=k$.

###### Proof of claim.

First of all, set $n_{i}=\lambda_{P_{i}}^{G_{i}}(k_{i})$ for $i\in\\{1,2\\}$.

$1)\Rightarrow 2)$

Let $k_{1},k_{2}\in\mathbb{N}$ such that $k_{1}+k_{2}=k$. By the definition of
$n_{i}$, there exists
$E_{i}\in\operatorname{\operatorname{Div}}_{+}^{k_{i}}(G_{i})$ such that
$|(n_{i}-1)P-E_{i}|=\emptyset$ for $i\in\\{1,2\\}$. Set
$E=E_{1}+E_{2}\in\operatorname{\operatorname{Div}}_{+}^{k}(G)$. By hypothesis
we have

$nP-E+\Delta f=nP+(\Delta f_{1}-E_{1})+(\Delta f_{2}-E_{2})\geq 0,$

for some $f\in\mathcal{M}(G)$, with $f=f_{1}+f_{2}$ as described above. Assume
by contradiction $n<n_{1}+n_{2}$, this means that, for some $i\in\\{1,2\\}$,
we have $(n_{i}-1)P-E_{i}+\Delta f_{i}\geq 0$, that is
$|(n_{i}-1)P-E_{i}|\neq\emptyset$, contradiction.

$2)\Rightarrow 1)$

Let $E\in\operatorname{\operatorname{Div}}_{+}^{k}(G)$, then $E=E_{1}+E_{2}$
with $E_{i}\in\operatorname{\operatorname{Div}}_{+}^{k_{i}}(G_{i})$ for
$i\in\\{1,2\\}$ and $k_{1}+k_{2}=k$. By the definition of $n_{i}$, there
exists $f_{i}\in\mathcal{M}(G_{i})$ such that $n_{i}P-E_{i}+\Delta f_{i}\geq
0$ for $i\in\\{1,2\\}$. Without loss of generality, we can assume that
$f_{1}(P)=f_{2}(P)=0$, set $f=f_{1}+f_{2}$, we have

$nP-E+\Delta f\geq\sum_{i\in\\{1,2\\}}(n_{i}P-E_{i}+\Delta f_{i})\geq 0$

that is $|nP-E|\neq\emptyset$. ∎

Now write

$\begin{split}\lambda_{P}^{G}(k)&=\min\\{n\in\mathbb{N}:r(nP)\geq k\\}\\\
&=\min\\{n\in\mathbb{N}:|nP-E|\neq\emptyset,\,\forall
E\in\operatorname{\operatorname{Div}}_{+}^{k}(G)\\}\\\
&=\min\\{n\in\mathbb{N}:n\geq\lambda_{P_{1}}^{G_{1}}(k_{1})+\lambda_{P_{2}}^{G_{2}}(k_{2}),\text{
for every }k_{1}+k_{2}=k\\}\\\
&=\max\left\\{\lambda_{P_{1}}^{G_{1}}(k_{1})+\lambda_{P_{2}}^{G_{2}}(k_{2}):k_{1}+k_{2}=k\right\\}.\qed\end{split}$

######  Remark 5.2.

We note that the notion of rank Weierstrass set implicitly appears in [18,
Section 3.2]. In fact, the so called _Weierstrass partition_ of the zero
divisor at a marked point $P$ encodes the information of the rank Weierstrass
set $H_{r}(P)$ (see [18, Definition 3.11]). Further, we note that one of the
main techniques used in [18] to study the behaviour of Weierstrass partitions
is the (analogue of) vertex gluing of an arbitrary metric graph with a cycle.

######  Theorem 5.3.

Let $e_{1}\geq e_{2}\geq\dots\geq e_{n}\geq 0$ be integers and set
$s_{i}=\nolinebreak\sum_{j=1}^{i}e_{j}$. There exists a simple graph $G$ with
a vertex $P\in V(G)$ such that

$H_{r}(P)=\\{0,s_{1},s_{2},\dots,s_{n-1}\\}\cup(s_{n}+\mathbb{N}).$

###### Proof.

We proceed by induction on $n$. For the base case $n=1$, by Corollary 3.10 it
is enough to consider the graph $K_{2,e_{1}}$ and a vertex $P$ of degree
$e_{1}$. Now assume that the theorem is true for $n-1$, and let $G^{\prime}$
be a graph with a vertex $P_{1}$ such that

$H_{r}^{G^{\prime}}(P_{1})=\\{0,s_{1},\dots,s_{n-1}\\}\cup(s_{n-1}+\mathbb{N}).$

Consider the graph $K_{2,e_{n}}$ and fix a vertex $P_{2}$ of degree $e_{n}$.
Let $G$ be the vertex gluing of $P_{1}$ and $P_{2}$. From Corollary 3.10 we
have

$H_{r}^{K_{2,e_{n}}}(P_{2})=\\{0\\}\cup(e_{n}+\mathbb{N}).$

Now apply Proposition 5.1 to the vertex gluing $G$ of $P_{1}$ and $P_{2}$. ∎

######  Remark 5.4.

In the proof of Theorem 5.3 we glued together complete bipartite graphs
$K_{2,e_{i}}$ along vertices of degree $e_{i}$. However, we could have used
any graph of genus $e_{i}-1$ with a fixed non-Weierstrass point, i.e. with a
fixed vertex in which the Weierstrass set is
$\mathbb{N}\setminus\\{1,\dots,e_{i}-1\\}$.

######  Remark 5.5.

From Theorem 5.3 it follows that every Arf numerical semigroup is the rank
Weierstrass set of some graph. In fact, it is enough to choose the sequence
$e_{1}\geq\dots\geq e_{n}$ to be the multiplicity sequence of the given Arf
numerical semigroup. See [4, Section 2] for more information about Arf
numerical semigroups and their multiplicity sequence.

Theorem 5.3 can be used to construct families of graphs with rank Weierstrass
set that is not a semigroup. We now describe an example of such a graph.

######  Example 5.6.

Let $n=3$ and $(e_{1},e_{2},e_{3})=(3,2,2)$. Following the idea in the proof
of Theorem 5.3, we consider the graph $G$ (Figure 1) obtained as the vertex
gluing of $K_{2,3}$ and two copies of $K_{2,2}$. Let $P\in V(G)$ be the
identified vertex of degree $7$. We have

$H_{r}(P)=\\{0,3,5,7\\}\cup(8+\mathbb{N}).$

Note that $H_{r}(P)$ is not a semigroup, since $3\in H_{r}(P)$, but
$3+3=6\notin H_{r}(P)$.

Figure 1:

Theorem 5.3 gives a sufficient condition for a subset of $\mathbb{N}$ to be
the rank Weierstrass set of some graph. We now provide an easy necessary
condition.

######  Proposition 5.7.

Let $G$ be a graph and fix a vertex $P\in V(G)$. For every $n,k\in\mathbb{N}$
we have

$\big{|}H_{r}(P)\cap[1,nk]\big{|}\geq k\big{|}H_{r}(P)\cap[1,n]\big{|}.$

###### Proof.

From the definition we have $r(nP)=\big{|}H_{r}(P)\cap[1,n]\big{|}$, further
from Lemma 2.1 $r(nkP)\geq k\,r(nP)$. ∎

######  Question 5.8.

Can we characterize the cofinite subsets $H\subseteq\mathbb{N}$ that are the
rank Weierstrass set of some graph?

In [3] the notion of harmonic morphism between graphs is studied. It is a
discrete analogue of morphisms of curves. In particular, in this context it
makes sense to talk about hyperelliptic graphs and double covers.

Classically, we know that a curve $X$ is hyperelliptic if and only if there
exists $P\in X$ such that $2\in H(P)$. An analogous fact is proved in [21,
Theorem A]: a curve $X$ of genus $g\geq 6\gamma+4$ is a double cover of a
curve of genus $\gamma\geq 1$ if and only if there exists $P\in X$ such that
$H(P)$ has $\gamma$ even gaps.

######  Question 5.9.

Can we find an analogue of [21, Theorem A] for graphs?

### Acknowledgments.

I would like to thank Diane Maclagan, Yoav Len and Victoria Schleis for a
careful reading and comments on an earlier version of this manuscript, and
Marta Panizzut, Gretchen Matthews, Cong X. Kang and Nathan Pflueger for useful
discussions and email exchanges.

## References

  * [1] M. Baker.  Specialization of linear systems from curves to graphs.  Algebra Number Theory, 2(6):613–653, 2008.  With an appendix by Brian Conrad.
  * [2] M. Baker and S. Norine.  Riemann-Roch and Abel-Jacobi theory on a finite graph.  Adv. Math., 215(2):766–788, 2007.
  * [3] M. Baker and S. Norine.  Harmonic morphisms and hyperelliptic graphs.  Int. Math. Res. Not. IMRN, (15):2914–2955, 2009.
  * [4] V. Barucci, M. D’Anna, and R. Fröberg.  Arf characters of an algebroid curve.  JP J. Algebra Number Theory Appl., 3(2):219–243, 2003.
  * [5] R.-O. Buchweitz.  On Zariski’s criterion for equisingularity and non-smoothable monomial curves.  Inst., Univ., 1980.
  * [6] F. Cools and M. Panizzut.  The gonality sequence of complete graphs.  Electron. J. Combin., 24(4):Paper No. 4.1, 20, 2017.
  * [7] R. Cori and Y. Le Borgne.  On computation of Baker and Norine’s rank on complete graphs.  Electron. J. Combin., 23(1):Paper 1.31, 47, 2016.
  * [8] M. D’Adderio and Y. Le Borgne.  The sandpile model on $K_{m,n}$ and the rank of its configurations.  Sém. Lothar. Combin., 77:Art. B77h, 48, [2016-2018].
  * [9] D. Eisenbud and J. Harris.  Existence, decomposition, and limits of certain Weierstrass points.  Invent. Math., 87(3):495–515, 1987.
  * [10] S. Eliahou, J. I. García-García, D. Marín-Aragón, and A. Vigneron-Tenorio.  The Buchweitz set of a numerical semigroup.  arXiv preprint arXiv:2011.09187, 2020.
  * [11] H. M. Farkas and I. Kra.  Riemann surfaces, volume 71 of Graduate Texts in Mathematics.  Springer-Verlag, New York, second edition, 1992.
  * [12] A. Gathmann and M. Kerber.  A Riemann-Roch theorem in tropical geometry.  Math. Z., 259(1):217–230, 2008.
  * [13] A. Hurwitz.  Über algebraische gebilde mit eindeutigen transformationen in sich.  Mathematische Annalen, 41(3):403–442, 1892.
  * [14] C. X. Kang, G. L. Matthews, and J. D. Peachey.  On Laplacian monopoles.  Australas. J. Combin., 77(3):383–397, 2020.
  * [15] N. Kaplan and L. Ye.  The proportion of Weierstrass semigroups.  J. Algebra, 373:377–391, 2013.
  * [16] J. Komeda.  Non-Weierstrass numerical semigroups.  Semigroup Forum, 57(2):157–185, 1998.
  * [17] G. Mikhalkin and I. Zharkov.  Tropical curves, their Jacobians and theta functions.  In Curves and abelian varieties, volume 465 of Contemp. Math., pages 203–230. Amer. Math. Soc., Providence, RI, 2008.
  * [18] N. Pflueger.  Special divisors on marked chains of cycles.  J. Combin. Theory Ser. A, 150:182–207, 2017.
  * [19] D. H. Richman.  The distribution of Weierstrass points on a tropical curve.  Sém. Lothar. Combin., 82B:Art. 72, 12, 2020.
  * [20] J. C. Rosales and P. A. García-Sánchez.  Numerical semigroups, volume 20 of Developments in Mathematics.  Springer, New York, 2009.
  * [21] F. Torres.  Weierstrass points and double coverings of curves. With application: symmetric numerical semigroups which cannot be realized as Weierstrass semigroups.  Manuscripta Math., 83(1):39–58, 1994.

Alessio Borzì<EMAIL_ADDRESS>
Mathematics Institute, University of Warwick, Coventry CV4 7AL, United
Kingdom.