1 Introduction

Let \(A = \{a_0,a_1,\ldots ,a_{n-1}\} \subset \mathbb {N}\) be a set of non-negative integers where we assume that \(a_0<\dots <a_{n-1}\) and set \(d:=a_{n-1}\). For every \(s\in \mathbb {N}\), the s-fold sumset of A, sA, is defined by \(0A:= \{0\}\) and for \(s\ge 1\),

$$\begin{aligned}sA:= \{a_{i_1}+\dots +a_{i_s}: 0\le i_1\le \dots \le i_s \le n-1\}.\end{aligned}$$

Additive number theory studies the sumsets of A. As we will see later in (0.1), for our purpose, we will need to count the number of elements in sA. As observed in [21, (1.1) p.2], to compute |sA|, one may assume without loss of generality that \(a_0=0\) and \(\gcd (a_1,\ldots ,a_{n-1}) = 1\). When this occurs, A is said to be in normal form.

Consider now the points \(\textbf{a}_0 = (0,d), \ \textbf{a}_1=(a_1,d-a_1), \ldots , \textbf{a}_{n-1} = (d,0)\) in \(\mathbb {N}^2\), the set \(\textbf{A}= \{\textbf{a}_0,\textbf{a}_1,\ \ldots ,\ \textbf{a}_{n-1}\}\), and the subsemigroup \(\mathcal {S}\) of \(\mathbb {N}^2\) generated by \(\textbf{A}\). Given an arbitrary infinite field k, one can associate with A the projective monomial curve \(\mathcal {C}_A\) parametrized by \(\textbf{A}\)

$$\begin{aligned}\mathcal {C}_{A} = \{(v^d:u^{a_1}v^{d-a_1}:\dots :u^{a_{n-2}}v^{d-a_{n-2}}:u^{d}) \mid (u:v) \in \mathbb {P}^{1}_k\} \subset \mathbb {P}^{n-1}_k.\end{aligned}$$

If A is in normal form, it is an algebraic curve of degree d and its defining ideal \(I(\mathcal {C}_{A})\) is the kernel of the homomorphism of k-algebras \(\varphi :k[x_0,\ldots ,x_{n-1}] \rightarrow k[u,v]\) induced by \(\varphi (x_i) = u^{a_i}v^{d-a_i}\). The ideal \(I(\mathcal {C}_{A})\) is homogeneous, binomial, and prime, i.e., it is a homogeneous toric ideal. Denoting by \(k[\mathcal {C}_A]:=k[x_0,\ldots ,x_{n-1}]/I(\mathcal {C}_A)\) the homogeneous coordinate ring of \(\mathcal {C}_A\), one has that \(k[\mathcal {C}_A]\) is isomorphic to \(\hbox {Im}{\varphi }=k[\mathcal {S}]\), the semigroup ring of \(\mathcal {S}\). If \({\text {HF}}_{A}\) denotes the Hilbert function of \(k[\mathcal {C}_A]\), by [11, Prop. 2.3], one has that

$$\begin{aligned} |sA| = {\text {HF}}_{A}(s), \text { for all } s\in \mathbb {N}. \end{aligned}$$
(0.1)

This provides a bridge between additive number theory and the geometry of monomial projective curves that has been recently explored in [11] and later generalized to higher dimension varieties in [6]. We will follow here the same philosophy: our aim is to study some homological invariants of the projective monomial curve \(\mathcal {C}_{A}\) that we will now define, through the sumsets of A, and vice versa.

Given a minimal graded free resolution (m.g.f.r.) of the graded \(k[x_0,\ldots ,\) \(x_{n-1}]\)-module \(k[\mathcal {C}_A]\),

$$\begin{aligned}\mathcal {F}: 0 \rightarrow F_p \rightarrow \ldots F_0 \rightarrow k[\mathcal {C}_A] \rightarrow 0,\end{aligned}$$

where the \(F_i\)’s are free modules, one has that for all \(i=0,\ldots ,p\), \(F_i\) is generated by \(\beta _{i,j}\) elements of degree j. The non-zero integers \(\beta _{i,j}\) are invariants of the module \(k[\mathcal {C}_A]\) called its graded Betti numbers, and we can arrange them in the Betti diagram of \(k[\mathcal {C}_A]\), a table whose entry in column i and row j is \(\beta _{i,i+j}\). The size of the Betti diagram of \(k[\mathcal {C}_A]\) is measured by two important invariants of \(k[\mathcal {C}_A]\): the label of the last column is the projective dimension of \(k[\mathcal {C}_A]\), \({\text {pd}}(k[\mathcal {C}_A]) = p\), the index of the last free module in any m.g.f.r. of \(k[\mathcal {C}_A]\), while the label of the last row is its Castelnuovo–Mumford regularity

$$\begin{aligned} {\text {reg}}(k[\mathcal {C}_A]):= \max \{j-i: \beta _{i,j} \ne 0,\ 0\le i\le p,\ j\ge 0\}. \end{aligned}$$
(0.2)

The projective dimension is controlled by the Auslander–Buchsbaum formula: \({\text {pd}}(k[\mathcal {C}_A]) = n-{\text {depth}}(k[\mathcal {C}_A])\). As the Krull dimension of \(k[\mathcal {C}_A]\) is 2 and the ideal \(I(\mathcal {C}_A)\) is prime, the depth of \(k[\mathcal {C}_A]\) can only be 1 or 2. Thus, the projective dimension is either \(n-2\) if \(k[\mathcal {C}_A]\) is Cohen–Macaulay, or \(n-1\) otherwise. The behavior of the Castelnuovo–Mumford regularity of \(k[\mathcal {C}_A]\) is more chaotic. In this paper, the sumsets of A and the combinatorics of the semigroup \(\mathcal {S}\) will be related to the Castelnuovo–Mumford regularity and the regularity of the Hilbert function of \(k[\mathcal {C}_A]\), revealing a nice interplay between additive number theory and commutative algebra. Note that if \(n=2\), \(A = \{0,1\}\), and if \(n=3\), \(\mathcal {C}_A\) is a hypersurface, so we will assume here that \(n\ge 4\).

The paper is structured as follows. In Sect. 1, we recall some results in additive number theory, in particular the fundamental Structure Theorem and its relation to monomial curves. We define the sumsets regularity \(\sigma (A)\) of a finite set of integers in normal form A as the least integer, such that, for all larger integers, the decomposition in the Structure Theorem holds. Several upper bounds for \(\sigma (A)\) that appear in the literature are recalled, in particular the Granville–Walker bound recently obtained in [14]. In Sect. 2, we analyze the structure of the semigroup \(\mathcal {S}\) and see that the sumsets regularity of A defined in the previous section could also be called the conductor of the semigroup \(\mathcal {S}\). We focus on two important finite subsets of the semigroup \(\mathcal {S}\) that will play in fundamental role later: its Apery set and its exceptional set. Both subsets can be used to characterize the Cohen–Macaulay property for \(k[\mathcal {C}_A]\) as shown in Proposition 2.6. Section 3 contains our main results. We start by completing the characterization of the elements in the Structure Theorem given in [11, Prop. 3.4] and express the sumsets regularity of A in terms of some invariants of the monomial curve \(\mathcal {C}_A\) in Theorem 3.1. As a direct consequence, we give a new upper bound for the sumsets regularity in Theorem 3.4. We also give a combinatorial way for computing the Castelnuovo–Mumford regularity of \(k[\mathcal {C}_A]\) in terms of the Apery and the exceptional sets of \(\mathcal {S}\) (Theorem 3.7) and provide both upper and lower bounds for the Castelnuovo–Mumford regularity of \(k[\mathcal {C}_A]\) in terms of the conductor of \(\mathcal {S}\) (Theorem 3.16). In Sect. 4, we prove in Theorem 4.3 a general result that allows to read on the Betti diagram the value of the difference between the Castelnuovo–Mumford regularity and the regularity of the Hilbert function of \(k[\mathcal {C}_A]\). Applied to the monomial curve \(\mathcal {C}_A\), we deduce in Theorem 4.6 a way to characterize when the regularity is attained at the last step of a m.g.f.r. Finally, in Sect. 5, we use our results to relate a recent result in additive number theory, the Granville–Walker bound for the sumsets regularity, to a classical result in algebraic geometry, the Gruson–Lazarsfeld–Peskine bound for the Castelnuovo–Mumford regularity in the particular case of monomial curves. More precisely, we show how to obtain the first bound from the second and vice versa.

The computations in the examples given in this paper are performed using Singular [7] and, in particular, the library mregular.lib [2]. We also used the package NumericalSgps [8] of GAP.

1.1 Notations

In this paper, \(\mathbb {N}= \{0,1,2,\ldots \}\). For any \(a,b\in \mathbb {Z}\), such that \(a\le b\), we denote \([a,b]:= \{n\in \mathbb {Z}: a\le n \le b\}\). If \(x\in \mathbb {Z}\), \(\lfloor x \rfloor \) is the greatest integer less than or equal to x (floor function), while \(\lceil x \rceil \) is the least integer greater than or equal to x (ceil function). If \(d\in \mathbb {N}\) and \(A\subset \mathbb {N}\), we denote \(d-A:= \{d-a: a\in A\}\). Furthermore, we will assume that all the semigroups have an identity, i.e., we do not distinguish between semigroup and monoid.

If \(R = \oplus _{s\in \mathbb {N}}R_s\) is a standard graded k-algebra, we denote by \({\text {HF}}_{R}\) and \({\text {HP}}_{R}\) its Hilbert function and Hilbert polynomial respectively. The least integer r such that, for all integer \(s\ge r\), \({\text {HF}}_{R}(s)={\text {HP}}_{R}(s)\) is called the regularity of the Hilbert function of R and we will denote it by \({\text {r}}(R)\). The Castelnuovo–Mumford regularity of R will be denoted by \({\text {reg}}(R)\) and we will use the abbreviation m.g.f.r. for minimal graded free resolution.

Finally, when we draw part of a semigroup \(\mathcal {S}\subset \mathbb {N}^2\) as in Figs. 1 and 2, filled circles represent points in \(\mathcal {S}\), while empty squares represent points outside \(\mathcal {S}\), i.e., gaps of \(\mathcal {S}\).

2 The Structure Theorem

In this section, we give an overview of some results in additive number theory and their connection to monomial curves. Let us first recall the so-called Structure Theorem, one of the main results in additive number theory.

Theorem 1.1

(Structure Theorem, [21, Thm. 1.1]) If \(A=\{a_0=0<a_1<\dots <a_{n-1}=d\}\subset \mathbb {N}\) is a finite set in normal form, then there exist integers \(c_1,c_2 \in \mathbb {N}\) and finite subsets \(C_i \subset [0,c_i-2]\), \(i=1,2\), such that

$$\begin{aligned} sA = C_1 \sqcup [c_1,sd-c_2] \sqcup \left( sd - C_2\right) \end{aligned}$$
(1.1)

for all \(s\ge \max \{1,s_0\}\), where \(s_0:= (n-2)(d-1)d\).

The elements in the Structure Theorem have recently been characterized in [11, Prop. 3.4] in terms of the curve \(\mathcal {C}_A\) and some of its invariants. If A is a finite set in normal form, it is well known that \(\mathcal {C}_A\) has two possible singular points, \(P_1 = (1:0:\dots :0) \in \mathbb {P}^{n-1}_k\) and \(P_2 = (0:\dots :0:1) \in \mathbb {P}^{n-1}_k\). Moreover, if \(\delta (\mathcal {C}_A,P)\) denotes the singularity order of P, then \(\delta (\mathcal {C}_A,P_1) = |\mathbb {N}\setminus \mathcal {S}_1|\) and \(\delta (\mathcal {C}_A,P_2) = |\mathbb {N}\setminus \mathcal {S}_2|\), where \(\mathcal {S}_1\) and \(\mathcal {S}_2\) denote the numerical semigroups generated by A and \(d-A\), respectively. Using that \(\mathcal {C}_A\) has degree d, one gets ([11, Prop. 3.1]) that for all \(s\ge {\text {r}}(k[\mathcal {C}_A])\)

$$\begin{aligned} |sA| = {\text {HF}}_{A}(s) = sd+1-\delta (\mathcal {C}_A,P_1)-\delta (\mathcal {C}_A,P_2). \end{aligned}$$
(1.2)

Proposition 1.2

([11, Prop. 3.4]) Following notations in Theorem 1.1, for \(i=1,2\), the following claims hold:

  1. (1)

    \(c_i\) is the conductor of \(\mathcal {S}_i\).

  2. (2)

    \(C_i = \mathcal {S}_i \cap [0,c_i-2]\).

  3. (3)

    \(\delta (\mathcal {C}_A,P_i) = c_i-|C_i|\).

Definition 1.3

The least integer \(\sigma \), such that the decomposition (1.1) in Theorem 1.1 holds for all \(s\ge \sigma \), will be called the sumsets regularity of A and we will denote it by \(\sigma (A)\).

Theorem 1.1 provides an upper bound for \(\sigma (A)\) that is generally far from its real value: \(\sigma (A)\le (n-2)(d-1)d\). After Nathanson’s proof, other proofs of Theorem 1.1 have been published, [13, 14, 25]. In these articles, the authors give the following better upper bounds for \(\sigma (A)\):

  • [25, Thm. 2] (Wu, Chen, Chen; 2011) \(\sigma (A) \le \left( \sum _{i=2}^{n-2} a_i \right) +d-n+1=: s_0^{WCC}\).

  • [13, Thm. 1] (Granville, Shakan; 2020) \(\sigma (A) \le 2 \lfloor \frac{d}{2} \rfloor =: s_0^{GS}\).

  • [14, Thm. 1] (Granville, Walker; 2021) \(\sigma (A) \le d-n+2=: s_0^{GW}\).

Note that in [13, 14, 25], the union in Eq. (1.1) is not shown to be disjoint, but this is shown in [19] for the Granville–Walker bound and, as \(s_0^{WCC}>s_0^{GW}\) and \(s_0^{GS}>s_0^{GW}\) if \(n\ge 4\), the above claims hold.

Besides giving a great upper bound for \(\sigma (A)\), Granville and Walker also characterize the sets A for which this bound is attained.

Theorem 1.4

([14, Thm. 2]) Let \(n\in \mathbb {N}\), \(n\ge 3\), and \(A = \{a_0=0<a_1<\dots <a_{n-1}=d\}\subset \mathbb {N}\) be a set in normal form. Then, \(\sigma (A) = d-n+2\) if, and only if, either A or \(d-A\) belongs to one of the following two families:

  • \(A = [0,d] \setminus \{a\}\), for some a, such that \(2\le a\le d-2\);

  • \(A = [0,1] \sqcup [a+1,d]\), for some a, such that \(2\le a \le d-2\).

Note for any A belonging to one of the two families in Theorem 1.4, the monomial curve \(\mathcal {C}_A\) is smooth.

3 The Structure of the Homogeneous Semigroup and Its Relation to the Sumsets

As already observed, associated with a set of integers \(A = \{a_0=0<a_1<\dots <a_{n-1}=d\}\) in normal form, one has the set

$$\begin{aligned}\textbf{A}= \{\textbf{a}_0,\textbf{a}_1,\ldots ,\textbf{a}_{n-1}\} \subset \mathbb {N}^2,\end{aligned}$$

where \(\textbf{a}_i=(a_i,d-a_i)\) for all \(i=0,\ldots ,n-1\), that we will call its homogenization. A semigroup \(\mathcal {S}\) in \(\mathbb {N}^2\) generated by a set \(\textbf{A}\) of this form will be said to be homogeneous of degree d.

It is trivial to verify that the sumsets of \(\textbf{A}\) are completely determined by those of A, since, for each \(s\in \mathbb {N}\),

$$\begin{aligned}s\textbf{A}= \{(\alpha ,sd-\alpha ): \alpha \in sA\}.\end{aligned}$$

In particular, for any \(s\in \mathbb {N}\), \(|sA|=|s\textbf{A}|\). Furthermore, the semigroup \(\mathcal {S}\) generated by \(\textbf{A}\) satisfies that \(\mathcal {S}= \sqcup _{s=0}^\infty s \textbf{A}\). Note that each \(s\textbf{A}\) lies on the “line” \(L_s:=\{(x,y)\in \mathbb {N}^2: x+y=sd\}\).

We can apply the Structure Theorem to improve our knowledge on the sumsets of \(\textbf{A}\) and the semigroup \(\mathcal {S}\). By Theorem 1.1 and Proposition 1.2, we have that for all \(s\ge \sigma (A)\), \(s\textbf{A}\) consists on a central interval and, outside that interval, a copy of the non-trivial part of the semigroups \(\mathcal {S}_1\) and \(\mathcal {S}_2\), i.e., for all \(s\ge \sigma (A)\)

$$\begin{aligned} s\textbf{A}= & {} \{(i,sd-i),\,i\in \mathcal {S}_1 \cap [0,c_1-2]\} \sqcup \{(i,sd-i),\,i\in [c_1,sd-c_2]\}\\ {}{} & {} \sqcup \{(sd-i,i),\,i\in \mathcal {S}_2 \cap [0,c_2-2]\}. \end{aligned}$$

Furthermore, \(\sigma (A)\) is the least integer, such that this decomposition is satisfied for all \(s\ge \sigma (A)\). More precisely, for \(s\ge \sigma (A)\), when we go from \(s\textbf{A}\) to \((s+1)\textbf{A}\), gaps coming from \(\mathcal {S}_1\) move up while gaps coming from \(\mathcal {S}_2\) move to the right, and there are no other gaps in \((s+1)\textbf{A}\) than the ones coming from \(s\textbf{A}\), as shown in Fig. 1. And \(\sigma (A)\) is the least integer, such that this occurs. For this reason, the regularity of the sumsets of A, \(\sigma (A)\), could also be called the conductor of the homogeneous semigroup \(\mathcal {S}\) and denoted by \(\sigma (\mathcal {S})\). If no confusion arises, from now on, we will simply denote this number by \(\sigma \), i.e., \(\sigma =\sigma (\mathcal {S})=\sigma (A)\).

Fig. 1
figure 1

Structure of the sumsets of \(\textbf{A}\). For \(s\ge \sigma \), we distinguish three disjoint areas: the central interval and the copies of the non-trivial parts of \(\mathcal {S}_1\) and \(\mathcal {S}_2\)

We can relate the conductor of the semigroup \(\mathcal {S}\) to the Hilbert function regularity of \(k[\mathcal {C}_A]\) on the one hand, and to the conductors of the semigroups \(\mathcal {S}_1\) and \(\mathcal {S}_2\) on the other. This relation will become more precise later in Theorem 3.1.

Lemma 1.5

Let \(A=\{a_0=0<a_1<\dots <a_{n-1}=d\}\subset \mathbb {N}\) be a finite set in normal form and \(\sigma \) be its sumsets regularity.

  1. (1)

    For all \(s\ge \sigma \), \(|L_s\setminus s\textbf{A}|=|L_\sigma \setminus \sigma \textbf{A}|\) and \(|(s+1)A|-|sA|=d\). In particular, \(\sigma \ge {\text {r}}( k[\mathcal {C}_A])\).

  2. (2)

    If \(sd-c_2<c_1\), the central interval in the previous decomposition of \(s\textbf{A}\) does not exist, and hence, \(\sigma \ge \lceil \frac{c_1+c_2}{d} \rceil \).

Proof

Both results are consequences of the discussion before Fig. 1. (2) is direct and for (1), recall that for all \(s\ge 0\), \({\text {HF}}_{A}(s)= |sA|\) and if \(s\ge \sigma \)

$$\begin{aligned} \begin{aligned} {\text {HF}}_{A}(s)&= |sA| = sd+1-\left( c_1-|C_1|+c_2-|C_2|\right) \\&= sd+1-\delta (\mathcal {C}_A,P_1)-\delta (\mathcal {C}_A,P_2) = {\text {HP}}_{A}(s) \end{aligned} \end{aligned}$$
(2.1)

by Proposition 1.2, so \(\sigma \ge {\text {r}}(k[\mathcal {C}_A])\). \(\square \)

Remark 2.2

Note that both inequalities for \(\sigma \) in Lemma 2.1 can be strict as we will see later in Example 3.3.

Let us now focus on the three semigroups \(\mathcal {S}_1\), \(\mathcal {S}_2\), and \(\mathcal {S}\). For \(i=1,2\), we define the Apery set of \(\mathcal {S}_i\) with respect to d as \({\text {Ap}}_i:= \{a\in \mathcal {S}_i: a-d\notin \mathcal {S}_i\}\). We know that \({\text {Ap}}_i\) is a complete set of residues modulo d, and hence, \({\text {Ap}}_1 = \{r_0=0,r_1,\ldots ,r_{d-1}\}\) and \({\text {Ap}}_2 = \{t_0=0,t_1,\ldots ,t_{d-1}\}\) with \(r_i\equiv t_i \equiv i \pmod {d}\).

Definition 1.7

The Apery set \({\text {AP}}_{\mathcal {S}}\) of \(\mathcal {S}\) and the exceptional set \(E_\mathcal {S}\) of \(\mathcal {S}\) are defined as follows:

  • \({\text {AP}}_{\mathcal {S}}:= \{(x,y)\in \mathcal {S}: (x,y) - \textbf{a}_0 \notin \mathcal {S}, (x,y)-\textbf{a}_{n-1} \notin \mathcal {S}\}\).

  • \(E_\mathcal {S}:= \{(x,y)\in \mathcal {S}: (x,y) - \textbf{a}_0 \in \mathcal {S}, (x,y)-\textbf{a}_{n-1} \in \mathcal {S}, (x,y)- \textbf{a}_0-\textbf{a}_{n-1} \notin \mathcal {S}\}\).

Moreover, for each \(s\in \mathbb {N}\), set \({\text {AP}}_s:= {\text {AP}}_{\mathcal {S}}\cap L_s = {\text {AP}}_{\mathcal {S}}\cap s\textbf{A}\) and \(E_s:= E_\mathcal {S}\cap L_s= E_\mathcal {S}\cap s\textbf{A}\). Figure 2 shows how points in \(E_\mathcal {S}\) and \({\text {AP}}_{\mathcal {S}}\) look like when one draws the semigroup \(\mathcal {S}\).

Fig. 2
figure 2

A point (xy) in \(E_s\) and a point \((x',y')\) in \({\text {AP}}_s\)

Remark 2.4

As a consequence of Theorem 1.1, one gets that, if \(\sigma \) is the conductor of \(\mathcal {S}\), then

$$\begin{aligned}\forall s\ge \sigma + 2,\ {\text {AP}}_s = E_s = \emptyset .\end{aligned}$$

The Cohen–Macaulayness of \(k[\mathcal {C}_A]\) is characterized in terms of \({\text {AP}}_{\mathcal {S}}\) and \(E_\mathcal {S}\) as we will show in Proposition 2.6. Let us previously prove the following easy lemma.

Lemma 1.9

For all \(i=1,\ldots ,d-1\), the following claims hold:

  1. (1)

    If \((r_i,t_{d-i}) \in \mathcal {S}\), then \((r_i,t_{d-i}) \in {\text {AP}}_{\mathcal {S}}\).

  2. (2)

    If \((r_i,t_{d-i}) \notin \mathcal {S}\), then \((r_i,t_{d-i}) \notin {\text {AP}}_{\mathcal {S}}\) and there exist natural numbers \(x>r_i\) and \(y>t_{d-i}\), such that \((x,t_{d-i}) \in {\text {AP}}_{\mathcal {S}}\) and \((r_i,y) \in {\text {AP}}_{\mathcal {S}}\).

Proof

(1) is trivial. To prove (2), take \(i \in \{1,2,\ldots ,d-1\}\). Since \(r_i \in \mathcal {S}_1\), there exists a natural number \(y>t_{d-i}\), such that \((r_i,y) \in \mathcal {S}\), and if we choose the least \(y \in \mathbb {N}\) satisfying this property, then \((r_i,y) \in {\text {AP}}_{\mathcal {S}}\). The proof of the existence of x is analogous. \(\square \)

Denote by G the subgroup of \(\mathbb {Z}^2\) generated by \(\mathcal {S}\) and set \(\mathcal {S}':= G \cap \left( \mathcal {S}_1 \times \mathcal {S}_2 \right) \).

Proposition 1.10

(Characterization of the Cohen–Macaulayness of \(\mathcal {C}_A)\) The following statements are equivalent:

  1. (1)

    \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay, i.e., the ring \(k[\mathcal {C}_A]\) is Cohen–Macaulay.

  2. (2)

    For all \(i=1,\ldots ,d-1\), \((r_i,t_{d-i}) \in \mathcal {S}\). In other words, if \(q_1\in {\text {Ap}}_1\), \(q_2\in {\text {Ap}}_2\) and \(q_1+q_2 \equiv 0 \pmod {d}\), then \((q_1,q_2) \in {\text {AP}}_{\mathcal {S}}\).

  3. (3)

    \({\text {AP}}_{\mathcal {S}}= \{(0,0)\} \cup \{(r_i,t_{d-i}):1\le i <d\}\).

  4. (4)

    \({\text {AP}}_{\mathcal {S}}\) has exactly d elements.

  5. (5)

    The exceptional set \(E_\mathcal {S}\) is empty.

  6. (6)

    \(\mathcal {S}'=\mathcal {S}\).

Proof

The equivalences (1) \(\Leftrightarrow (5)\) and (1)\(\Leftrightarrow (6)\) are well known; see, e.g., [4, Lemma 4.3, Thm. 4.6]. Moreover, the implications \((3) \Rightarrow (2)\) and \((3) \Rightarrow (4)\) are trivial and \((4) \Rightarrow (3)\) is a direct consequence of Lemma 2.5, so let us prove \((2) \Leftrightarrow (5) \Rightarrow (3)\).

\(\underline{(5) \Leftrightarrow (2)}\): Suppose that there is an index i, \(1\le i<d\), such that \((r_i,t_{d-i}) \notin \mathcal {S}\). By Lemma 2.5 (2), there exist \(x> r_i\) and \(y> t_{d-i}\), such that \((x,t_{d-i}) \in {\text {AP}}_{\mathcal {S}}\) and \((r_i,y) \in {\text {AP}}_{\mathcal {S}}\). Then, there exist \(x'\le x\) and \(y'\le y\), such that \((x',y') \in E_\mathcal {S}\), so \(E_\mathcal {S}\) is not empty.

Conversely, suppose that there exist \((x,y) \notin \mathcal {S}\), such that \((x+d,y) \in \mathcal {S}\) and \((x,y+d) \in \mathcal {S}\) and let i be the index, \(1\le i\le d-1\), such that \(x\equiv i \equiv r_i \pmod {d}\) and \(y \equiv d-i\equiv t_{d-i} \pmod {d}\). As \((x,y+d) \in \mathcal {S}\), \(x\in \mathcal {S}_1\), and \(y\in \mathcal {S}_2\), because \((x+d,y) \in \mathcal {S}\), so \(r_i\le x\) and \(t_{d-i} \le y\). This implies that \((r_i,t_{d-i}) \notin \mathcal {S}\).

\(\underline{(5)+(2) \Rightarrow (3)}\): Assuming that (2) holds, one gets that \( \{(0,0)\} \cup \{(r_i,t_{d-i}):1\le i <d\} \subset {\text {AP}}_{\mathcal {S}}\) by Lemma 2.5 (1). To prove the equality, take \((x,y) \in {\text {AP}}_{\mathcal {S}}\). If \(x\notin {\text {Ap}}_1\), then \(x-d\in \mathcal {S}_1\), so there exists \(y'>y\), such that \((x-d,y') \in \mathcal {S}\) and choosing \(y'\) minimum with this property, one gets that \((x-d,y') \in \mathcal {S}\), \((x,y'-d) \in \mathcal {S}\) and \((x-d,y'-d) \notin \mathcal {S}\), a contradiction with (5). This implies that \(x\in {\text {Ap}}_1\), and we prove that \(y\in {\text {Ap}}_2\) using a similar argument. Thus, \((x,y)=(r_i,t_{d-i})\) for some i, \(1\le i <d\), and we are done. \(\square \)

Remark 2.7

  1. (1)

    If \(k[\mathcal {S}]\) is not Cohen–Macaulay, the ring \(k[\mathcal {S}']\) is called the Cohen–Macaulayfication of \(k[\mathcal {S}]\). This is because \(\mathcal {S}\ne \mathcal {S}'\) by Proposition 2.6 (6) and \(k[\mathcal {S}']\) is the least Cohen–Macaulay intermediate between \(k[\mathcal {S}]\) and its field of fractions; see [4, Remark 4.7].

  2. (2)

    For a general affine semigroup ring \(\mathcal {S}\), the Cohen–Macaulay property of the semigroup ring \(k[\mathcal {S}]\) may depend on the characteristic of the field k, as shown in [17]. However, by Proposition 2.6, it is clear that this is not the case for a homogeneous semigroup \(\mathcal {S}\subset \mathbb {N}^2\).

Example 2.8

Let \(A = \{0,1,2,3,8\}\subset \mathbb {N}\). One can check that the Apery sets of \(\mathcal {S}_1\) and \(\mathcal {S}_2\) are \({\text {Ap}}_1 = \{0,1,2,3,4,5,6,7\}\) and \({\text {Ap}}_2 = \{0,17,10,11,12,5,6,7\}\), respectively, and that \({\text {AP}}_{\mathcal {S}}= \{(0,0),(1,7),(2,6),(3,5),(4,12),(5,11),(6,10)\), \((7,17)\}\), and hence, \(k[\mathcal {C}_A]\) is Cohen–Macaulay.

We focus now on the distribution of points (xy) in \({\text {AP}}_{\mathcal {S}}\) and \(E_\mathcal {S}\) on the levels given by the sumsets of A.

Proposition 1.13

\(|{\text {AP}}_s| - |E_{s}| = |sA|-2|(s-1)A|+|(s-2)A|\), for all \(s\in \mathbb {N}\).

Proof

Let us count the number of elements in \({\text {AP}}_s\) for all \(s\in \mathbb {N}\). Note that \(|{\text {AP}}_0| = 1 = |0A|\) and \(|{\text {AP}}_1|= |\textbf{A}|-2 = |A|-2|0A|\), and since \(E_0=E_1=\emptyset \) and \(sA=\emptyset \) if \(s<0\), one gets that the formula holds if \(s\le 1\). Consider now \(s\ge 2\). Since for each element \(\textbf{s}\in (s-1)\textbf{A}\), neither \(\textbf{s}+\textbf{a}_0\) nor \(\textbf{s}+\textbf{a}_{n-1}\) belong to \({\text {AP}}_s\), every element in \((s-1)\textbf{A}\) provides two elements in \(s\textbf{A}\) that do not belong to \({\text {AP}}_s\) and any other element in \(s\textbf{A}\) belongs to \({\text {AP}}_s\). However, we are counting some of those elements twice, precisely the \(\textbf{s}\in s\textbf{A}\), such that \(\textbf{s}-\textbf{a}_0\in (s-1) \textbf{A}\) and \(\textbf{s}-\textbf{a}_{n-1} \in (s-1) \textbf{A}\). Now, for such an element \(\textbf{s}\), either \(\textbf{s}-\textbf{a}_0-\textbf{a}_{n-1}\notin (s-2) \textbf{A}\), and hence, \(\textbf{s}\in E_s\), or \((x,y)-\textbf{a}_0-\textbf{a}_{n-1}\in (s-2)\textbf{A}\). This provides the following formula:

$$\begin{aligned}|{\text {AP}}_s| = |s\textbf{A}|-2|(s-1)\textbf{A}|+ \left( |(s-2)\textbf{A}| + |E_s|\right) ,\end{aligned}$$

and the result follows. \(\square \)

Remark 2.10

As a consequence of the previous theorem and Remark 2.4, we obtain that \(|{\text {AP}}_{\mathcal {S}}| = |E_\mathcal {S}|+d\), since

$$\begin{aligned}\begin{aligned} |{\text {AP}}_{\mathcal {S}}|&= \sum _{s=0}^{\sigma +1} |{\text {AP}}_s| = \sum _{s=0}^{\sigma +1} \left( |sA|-2|(s-1)A|+|(s-2)A| \right) + \sum _{s=0}^{\sigma +1} |E_{s}|\\&= \left( |(\sigma +1)A|-|\sigma A|\right) + |E_\mathcal {S}| = |E_\mathcal {S}|+d, \end{aligned}\end{aligned}$$

where we have that \(|(\sigma +1)A|-|\sigma A|=d\) by Lemma 2.1 (1). In particular, \(|{\text {AP}}_{\mathcal {S}}|\ge d\) and we recover that \((4)\Leftrightarrow (5)\) in Proposition 2.6.

Corollary 1.15

If \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay, the sequence

$$\begin{aligned}\left( |sA|-|(s-1)A|\right) _{s=0}^{\infty } \subset \mathbb {N}\end{aligned}$$

is increasing (and it stabilizes at d).

Proof

For each \(s\in \mathbb {N}\), we observe that

$$\begin{aligned}|sA| -|(s-1)A| = \sum _{j=0}^s \left( |jA|-2|(j-1)A|+|(j-2)A| \right) = \sum _{j=0}^s |{\text {AP}}_j|,\end{aligned}$$

by Proposition 2.9. \(\square \)

Remark 2.12

The result in Corollary 2.11 holds in a more general setting. For a graded (or local) k-algebra R of Krull dimension two, the differences between two consecutive elements in the sequence \(({\text {HF}}_{R}(s)-{\text {HF}}_{R}(s-1))_{s=0}^{\infty }\) are the coefficients of its h-polynomial that are known to be non-negative when R is Cohen–Macaulay [24]. Thus, the sequence \(({\text {HF}}_{R}(s)-{\text {HF}}_{R}(s-1))_{s=0}^{\infty }\) is increasing.

Note that if one removes the Cohen–Macaulay hypothesis, then the result in Corollary 2.11 may be wrong as the first example below shows. However, this property does not characterize arithmetically Cohen–Macaulay curves as the second example shows.

Example 2.13

  1. (1)

    For \(A = \{0,1,3,11,13\}\), \(\left( |sA|-|(s-1)A|\right) _{s=0}^{\infty } = (1, 4, 9,\) \(14, 17, 15, 13, 13,\dots )\) is not increasing, and hence, \(k[\mathcal {C}_A]\) is not Cohen–Macaulay by Corollary 2.11.

  2. (2)

    [1, Ex. 4.3]. For \(A = \{0,5,9,11,20\}\), \(\left( |sA|-|(s-1)A|\right) _{s=0}^{\infty } = (1, 4, 9, 15,\) \(20, 20,\dots )\) is increasing, but \(k[\mathcal {C}_A]\) is not Cohen–Macaulay.

4 Regularity, Sumsets, and Semigroups

We start this section by giving a characterization of \(\sigma \), the sumsets regularity of A, which is also the conductor of the semigroup \(\mathcal {S}\), in terms of the curve \(\mathcal {C}_A\) and its invariants. This result already appears in [12] and it concludes the characterization of the elements in Structure Theorem given in [11, Prop. 3.4].

Theorem 1.18

The least integer \(\sigma \) such that the decomposition (1.1) in Theorem 1.1 holds for all \(s\ge \sigma \) is

$$\begin{aligned} \sigma = \max \left\{ {\text {r}}( k[\mathcal {C}_A]),\Bigg \lceil \dfrac{c_1+c_2}{d} \Bigg \rceil \right\} , \end{aligned}$$

where \({\text {r}}( k[\mathcal {C}_A])\) is the regularity of the Hilbert function of \(k[\mathcal {C}_A]\) and \(c_i\) is the conductor of the numerical semigroup \(\mathcal {S}_i\) for \(i=1,2\).

Proof

By Lemma 2.1, \(\sigma \ge \max \left\{ {\text {r}}( k[\mathcal {C}_A]),\lceil \frac{c_1+c_2}{d} \rceil \right\} \). Conversely, for \(s\ge \max \left\{ {\text {r}}( k[C_A]), \lceil \frac{c_1+c_2}{d} \rceil \right\} \), one has that (2.1) is satisfied by applying (1.2). Moreover, since \(sd-c_2\ge c_1\), one has that

$$\begin{aligned}\begin{aligned} sA&= \left( sA \cap C_1\right) \sqcup \left( sA \cap [c_1,sd-c_2]\right) \sqcup \left( sA \cap \left( sd-C_2 \right) \right) \\&\subset C_1 \sqcup [c_1,sd-c_2] \sqcup \left( sd-C_2\right) . \end{aligned}\end{aligned}$$

Since both sets sA and \(C_1 \sqcup [c_1,sd-c_2] \sqcup \left( sd-C_2\right) \) are finite and have the same cardinality, they are equal, so \(\max \left\{ {\text {r}}( k[C_A]), \lceil \frac{c_1+c_2}{d} \rceil \right\} \ge \sigma \) and the result follows. \(\square \)

Given a subset \(A\subset \mathbb {N}\) in normal form, it is not easy to know in advance whether \(\sigma = {\text {r}}(k[\mathcal {C}_A])\) or \(\sigma = \lceil \frac{c_1+c_2}{d} \rceil \). However, in some cases, it is, as Proposition 3.2 and Corollary 3.21 show.

Proposition 1.19

  1. (1)

    If \(\mathcal {C}_A\) is smooth, then \(\sigma = {\text {r}}(k[\mathcal {C}_A])\ge \lceil \frac{c_1+c_2}{d} \rceil = 0\).

  2. (2)

    If \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay, then \(\sigma = \lceil \frac{c_1+c_2}{d} \rceil \ge {\text {r}}(k[\mathcal {C}_A])\).

Proof

If \(\mathcal {C}_A\) is smooth, then \(c_1=c_2=0\) and (1) follows. Now, for \(s=\lceil \frac{c_1+c_2}{d} \rceil \), the sumset sA decomposes as the union of three disjoint subsets

$$\begin{aligned}sA = \left( sA \cap C_1\right) \sqcup \left( sA \cap [c_1,sd-c_2]\right) \sqcup \left( sA \cap \left( sd-C_2 \right) \right) .\end{aligned}$$

If either \(sA \cap C_1\ne C_1\), or \(sA \cap [c_1,sd-c_2]\ne [c_1,sd-c_2]\), or \(sA \cap \left( sd-C_2 \right) \ne \left( sd-C_2 \right) \), then \(E_\mathcal {S}\ne \emptyset \). Thus, if \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay, by applying Proposition 2.6 (5), one gets that \(sA = C_1 \sqcup [c_1,sd-c_2] \sqcup \left( sd-C_2 \right) \) and (2) follows. \(\square \)

As a direct consequence of Proposition 3.2, we recover the well-known fact that for any \(n\ge 4\), the rational normal curve, i.e., the curve \(\mathcal {C}_A\) given by \(A = [0,n-1]\), is the only projective monomial curve in \(\mathbb {P}^{n-1}_k\) which is both smooth and arithmetically Cohen–Macaulay.

Example 3.3

  1. (1)

    If \(A = [0,d] \setminus \{a\}\) for some \(2\le a\le d-2\), then \(c_1=c_2=0\) and \(\sigma = 2\) by Theorem 1.4. In this example, \(\sigma = {\text {r}}(k[\mathcal {C}_A]) > \lceil \frac{c_1+c_2}{d} \rceil \).

  2. (2)

    For \(A = \{0,2,5,6,9\}\), one has \(c_1 = 4\), \(c_2=6\) and \({\text {r}}(k[\mathcal {C}_A]) = 1\), so \(\sigma =\lceil \frac{c_1+c_2}{d} \rceil = 2 > {\text {r}}(k[\mathcal {C}_A])\).

By combining the Erdös–Graham bound for the conductor of a numerical semigroup and the bound for the Castelnuovo–Mumford regularity of a projective monomial curve given by L’vovsky, we obtain the following new bound for the sumsets regularity. This bound is different from the already known bounds recalled in Sect. 1. Indeed, in Example 3.3 (2), both numbers \(s_0^{EG}\) and \(s_0^L\) introduced in Theorem 3.4 are strictly lower than the Granville–Walker bound \(s_0^{GW}\) recalled in Sect. 1: \(s_0^{EG}=4\), \(s_0^L=5\), and \(s_0^{GW}=6\). This new bound deserves to be studied in the future.

Theorem 1.21

If \(A=\{a_0=0<a_1<\dots <a_{n-1}=d\}\subset \mathbb {N}\) is a finite set in normal form, set

  • \(s_0^{EG}:= \Bigg \lceil 2 \left( \left\lfloor \dfrac{d}{n-1} \right\rfloor (1+\dfrac{a_{n-2}-a_1}{d})-1+\dfrac{1}{d} \right) \Bigg \rceil \), and

  • \(s_0^L:=\max _{1 \le i < j \le n-1} \left\{ (a_i-a_{i-1})+(a_j-a_{j-1}) \right\} -1\).

Then, the least integer \(\sigma \) such that the decomposition (1.1) in Theorem 1.1 holds for all \(s\ge \sigma \), i.e., the sumsets regularity of A, satisfies

$$\begin{aligned}\sigma \le \max \{ s_0^{EG},s_0^L \}.\end{aligned}$$

Proof

By [22, Thm. 3.1.12], one has that \(c_1 \le 2a_{n-2} \lfloor \frac{d}{n-1} \rfloor -d+1\) and \(c_2 \le 2(d-a_1) \lfloor \frac{d}{n-1}\rfloor -d+1\). Combining these two bounds, one gets that \(\lceil \frac{c_1+c_2}{d} \rceil \le s_0^{EG}\). On the other hand, using the known fact that \({\text {r}}(k[\mathcal {C}_A]) \le {\text {reg}}(k[\mathcal {C}_A])\) ([9, Thm 4.2]) and that \({\text {reg}}(k[\mathcal {C}_A])\le s_0^L\) by [20, Prop. 5.5], the upper bound follows from Theorem 1.1. \(\square \)

To express \({\text {reg}}(k[\mathcal {C}_A])\) in terms of \({\text {AP}}_{\mathcal {S}}\) and \(E_\mathcal {S}\), let us introduce the following notations.

Definition 1.22

For any set \(A\subset \mathbb {N}\) in normal form, consider the homogeneous semigroup \(\mathcal {S}\subset \mathbb {N}^2\) associated. We define

  • \(m \left( E_\mathcal {S}\right) := \max \left( \{ s\in \mathbb {N}: E_{s+1}\ne \emptyset \}\right) \) (and \(m \left( E_\mathcal {S}\right) :=-\infty \) if \(E_\mathcal {S}=\emptyset \)),

  • \(m \left( {\text {AP}}_\mathcal {S}\right) := \max \left( \left\{ s \in \mathbb {N}: {\text {AP}}_s \ne \emptyset \right\} \right) \).

Remark 3.6

  1. (1)

    Note that the maxima in Definition 3.5 are attained, because \({\text {AP}}_\mathcal {S}\) and \(E_\mathcal {S}\) are finite subsets of \(\mathbb {N}^2\) by Remark 2.4. In fact, \(m \left( E_\mathcal {S}\right) \le \sigma \) and \(m \left( {\text {AP}}_\mathcal {S}\right) \le \sigma +1\).

  2. (2)

    Both \(m \left( E_\mathcal {S}\right) \) and \(m \left( {\text {AP}}_\mathcal {S}\right) \) can be expressed in terms of the sumsets of A as follows:

  • \(m \left( E_\mathcal {S}\right) = \max \left( \{s \in \mathbb {N}: \exists \alpha \in sA \,|\ \alpha -d\in sA\setminus (s-1)A\} \right) \),

  • \(m \left( {\text {AP}}_\mathcal {S}\right) = \max \left( \left\{ s \in \mathbb {N}: \exists \alpha \in sA \,|\ \alpha \notin (s-1)A\text { and } \alpha -d \notin (s-1)A\right\} \right) \).

The following result gives a combinatorial way for computing the regularity of \(k[\mathcal {C}_A]\).

Theorem 1.24

The Castelnuovo–Mumford regularity of the projective monomial curve \(\mathcal {C}_A\) is

$$\begin{aligned}{\text {reg}}(k[\mathcal {C}_A]) = \max \{ m \left( E_\mathcal {S}\right) ,m \left( {\text {AP}}_\mathcal {S}\right) \}.\end{aligned}$$

To prove this result, let us recall some known facts on the local cohomology modules of the coordinate ring of \(\mathcal {C}_A\), \(k[\mathcal {C}_A]\cong k[\mathcal {S}]\). For \(k[\mathcal {C}_A]\), there are at most two non-trivial local cohomology modules, \(H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \) and \(H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \), where \(\mathfrak {m}\) denotes the irredundant ideal. Furthermore, these two modules are completely characterized in terms of the semigroup \(\mathcal {S}\).

Lemma 1.25

([16, Lemma 2.2]) Let \(G \subset \mathbb {Z}^2\) be the group generated by \(\mathcal {S}\) and \(\mathcal {S}' = G \cap \left( \mathcal {S}_1 \times \mathcal {S}_2 \right) \).

  1. (1)

    \(H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \cong k[\mathcal {S}'\setminus \mathcal {S}]\), and

  2. (2)

    \(H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \cong k\left[ G \cap \left( (\mathbb {Z}\setminus \mathcal {S}_1) \times (\mathbb {Z}\setminus \mathcal {S}_2) \right) \right] \),

where the symbol \(\cong \) means that there exists an isomorphism of \(\mathbb {Z}\)-graded modules.

When \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay, \(\mathcal {S}'=\mathcal {S}\) by Proposition 2.6 (6), so \(H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) = 0\) as we already know. For \(i=1,2\), let

$$\begin{aligned}{\text {end}}\left( H_\mathfrak {m}^{i} \left( k[\mathcal {S}] \right) \right) := \max \{ j: \left( H_\mathfrak {m}^{i} \left( k[\mathcal {S}] \right) \right) _j \ne 0 \}\end{aligned}$$

(with the convention that \({\text {end}}\left( H_\mathfrak {m}^{i} \left( k[\mathcal {S}] \right) \right) := -\infty \) if \(H_\mathfrak {m}^{i} \left( k[\mathcal {S}] \right) = 0\)). Then, by the equivalent definition for the Castelnuovo–Mumford regularity given in [10], one has that

$$\begin{aligned} {\text {reg}}(k[\mathcal {S}]) = \max \{ {\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1,{\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2 \}. \end{aligned}$$
(3.1)

The proof of Theorem 3.7 will then be a consequence of the following two lemmas that relate the local cohomology modules \(H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \) and \(H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \) to the numbers \(m \left( E_\mathcal {S}\right) \) and \(m \left( {\text {AP}}_\mathcal {S}\right) \). Note that the relation \(m \left( E_\mathcal {S}\right) = {\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1\) stated in Lemma 3.9 also holds when \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay, since both numbers are \(-\infty \) in this case.

Lemma 1.26

If \(S'\ne S\), i.e., if \(\mathcal {C}_A\) is not arithmetically Cohen–Macaulay, then

$$\begin{aligned}\max \{s: E_{s+2}\ne \emptyset \} = \max \{s: (S'\setminus S) \cap L_s \ne \emptyset \}.\end{aligned}$$

Therefore, \(m \left( E_\mathcal {S}\right) = {\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1\).

Proof

If \(\mathcal {C}_A\) is not arithmetically Cohen–Macaulay, then \(E_\mathcal {S}\ne \emptyset \) by Proposition 2.6 (5). Set \(E_\mathcal {S}':= \{(x,y) \in \mathbb {N}^2: (x,y)+\textbf{a}_0+\textbf{a}_{n-1} \in E_\mathcal {S}\}\) and, for each \(s\in \mathbb {N}\), \(E_s':= E_\mathcal {S}' \cap L_s\). Note that \((x,y) \in E_s'\) if and only if \((x,y)+\textbf{a}_0+\textbf{a}_{n-1} \in E_{s+2}\) so \(\max \{s: E_{s+2} \ne \emptyset \} = \max \{s: E_s' \ne \emptyset \}\). Let us consider an element \((x,y) \in E_\mathcal {S}'\). It is clear that \((x,y)\in \mathcal {S}' \setminus \mathcal {S}\), since \((x,y) = (x+d,y) -(d,0) \in G\). Therefore, \(E_\mathcal {S}' \subset \mathcal {S}'\setminus \mathcal {S}\) and we get that \(\max \{ s: E_s'\ne \emptyset \} \le \max \{s: (S'{\setminus } S) \cap L_s \ne \emptyset \}\).

Conversely, let \((x,y) \in \left( \mathcal {S}'{\setminus } \mathcal {S}\right) \cap L_s\) be an element, such that s is maximum. Then, \((x,y)+\textbf{a}_0 \in \mathcal {S}\) and \((x,y)+\textbf{a}_{n-1} \in \mathcal {S}\), and hence, \((x,y) \in E_s'\). Therefore, \(\max \{s: E_s'\ne \emptyset \} \ge \max \{s: (S'{\setminus } S) \cap L_s \ne \emptyset \}\) and the equality \(\max \{s: E_{s+2}\ne \emptyset \} = \max \{s: (S'{\setminus } S) \cap L_s \ne \emptyset \}\) follows. By Lemma 3.8 (1), it implies that \(m \left( E_\mathcal {S}\right) = {\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1\). \(\square \)

Observe that in the previous proof, we show that \(E_\mathcal {S}' \subset \mathcal {S}'{\setminus } \mathcal {S}\). Equality, which would be a result stronger than the one stated in Lemma 3.9, is wrong in general. Using the example given in [16, Example 3.2], we show that those two sets may be different.

Example 3.10

For \(A = \{0,1,2,5,13,14,16,17\}\), the curve \(\mathcal {C}_A\) is smooth. Thus, \(\mathcal {S}_1=\mathcal {S}_2=\mathbb {N}\) and \(G = \mathbb {Z}^2\), and hence, \(\mathcal {S}' = G\cap \mathbb {N}^2 = \mathbb {N}^2\). Since \((8,9) \in \mathcal {S}'{\setminus } \mathcal {S}\) but \((8,9) \notin E_\mathcal {S}'\), because \((8,26)\notin \mathcal {S}\), one has that the inclusion \(E_\mathcal {S}' \subset \mathcal {S}'{\setminus } \mathcal {S}\) is strict.

We now want to relate \(m \left( {\text {AP}}_\mathcal {S}\right) \) to \({\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) \). Let \((x,y) \in G \cap \left( (\mathbb {Z}{\setminus }\mathcal {S}_1) \times (\mathbb {Z}{\setminus }\mathcal {S}_2) \right) \cap L_s\) be an element with s maximal. Since \(x\notin \mathcal {S}_1\) and \(y\notin \mathcal {S}_2\), one has that \((x,y+d) \notin \mathcal {S}\) and \((x+d,y) \notin \mathcal {S}\). There are two possibilities, either \((x+d,y+d)\in \mathcal {S}\) or \((x+d,y+d) \notin \mathcal {S}\), and let us check that in both cases, the inequality (3.2) below holds. In the first case, note that \((x+d,y+d) \in {\text {AP}}_{\mathcal {S}}\cap L_{s+2}\), so \(\max \{s: {\text {AP}}_{s+2} \ne \emptyset \} \ge \max \{ s: G \cap \left( (\mathbb {Z}{\setminus }\mathcal {S}_1) \times (\mathbb {Z}{\setminus }\mathcal {S}_2) \right) \cap L_s \ne \emptyset \}\) and (3.2) follows from Lemma 3.8 (2). In the second case, there exists an index i, \(0\le i\le d-1\), such that \(x\equiv r_i \pmod {d}\) and \(y \equiv t_{d-i} \pmod {d}\). Then, \(r_i \ge x+d\) and \(t_{d-i} \ge y+d\) and since \((x+d,y+d) \notin \mathcal {S}\), by Lemma 2.5, there exist natural numbers \(x'\ge x+d\) and \(y'\ge y+d\), being at least one of these two inequalities strict, such that \((x',y') \in {\text {AP}}_{\mathcal {S}}\). Observe that \((x',y') \in L_{s'}\) for \(s'\ge s+3\), so \(\max \{s: {\text {AP}}_{s+2} \ne \emptyset \} > \max \{ s: G \cap \left( (\mathbb {Z}{\setminus }\mathcal {S}_1) \times (\mathbb {Z}{\setminus }\mathcal {S}_2) \right) \cap L_s \ne \emptyset \}\) in this case. In both cases, one has that

$$\begin{aligned} m \left( {\text {AP}}_\mathcal {S}\right) \ge {\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2. \end{aligned}$$
(3.2)

Adding an additional hypothesis, one gets equality in (3.2) as the following lemma shows.

Lemma 1.28

If \({\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2 > {\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1 = m \left( E_\mathcal {S}\right) \), then

$$\begin{aligned}\max \{s: {\text {AP}}_{s+2} \ne \emptyset \} = \max \{ s: G \cap \left( (\mathbb {Z}\setminus \mathcal {S}_1) \times (\mathbb {Z}\setminus \mathcal {S}_2) \right) \cap L_s \ne \emptyset \}.\end{aligned}$$

Therefore, in this case, one has that \(m \left( {\text {AP}}_\mathcal {S}\right) = {\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2\).

Proof

Let \((x,y) \in {\text {AP}}_{s+2}\) be an element, such that s is maximal and consider the element \((x-d,y-d)\). If \((x-d,y-d) \notin G \cap \left( (\mathbb {Z}{\setminus }\mathcal {S}_1) \times (\mathbb {Z}{\setminus }\mathcal {S}_2) \right) \), one can assume without loss of generality that \(x-d\notin \mathcal {S}_1\). Then, there exists \(y'\ge y+d\), such that \((x-d,y') \in \mathcal {S}\), so \((x,y') \in E_{s'}\) for some \(s'\ge s+3\). Therefore, \({\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1 = m \left( E_\mathcal {S}\right) \ge m \left( {\text {AP}}_\mathcal {S}\right) \) by Lemma 3.9, and using (3.2), we get that \({\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1\ge {\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2\) which is in contradiction with the hypothesis in the statement of the lemma. Thus, \((x-d,y-d) \in G \cap \left( (\mathbb {Z}{\setminus }\mathcal {S}_1) \times (\mathbb {Z}{\setminus }\mathcal {S}_2) \right) \cap L_s\), and hence, \({\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2 \ge m \left( {\text {AP}}_\mathcal {S}\right) \) by Lemma 3.8 (2). Using (3.2), we are done. \(\square \)

If one removes the hypothesis \({\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2 > {\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1 = m \left( E_\mathcal {S}\right) \) in Lemma 3.11, the result may be wrong. To illustrate this fact, we will use again the example in [16, Example 3.2].

Example 3.12

For \(A = \{0,1,2,5,13,14,16,17\}\), as observed in Example 3.10, \(\mathcal {S}_1=\mathcal {S}_2=\mathbb {N}\) and \(G = \mathbb {Z}^2\). Therefore, \({\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) = 0\) by Lemma 3.8 (2), but \((8,43) \in {\text {AP}}_3\) so \(m \left( {\text {AP}}_\mathcal {S}\right) \ne {\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2\).

Proof of Thm. 3.7

If \(m \left( E_\mathcal {S}\right) \ge m \left( {\text {AP}}_\mathcal {S}\right) \), then \(m \left( E_\mathcal {S}\right) = {\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1\) by Lemma 3.9, and \({\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1 \ge {\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2\), because otherwise, by Lemma 3.11, one would have that \(m \left( {\text {AP}}_\mathcal {S}\right) >m \left( E_\mathcal {S}\right) \), a contradiction. Thus, the equality \({\text {reg}}(k[\mathcal {C}_A]) = m \left( E_\mathcal {S}\right) \) follows from Eq. (3.1).

Assume now that \(m \left( {\text {AP}}_\mathcal {S}\right) > m \left( E_\mathcal {S}\right) \) and consider an element \((x,y) \in {\text {AP}}_s\) with \(s=m \left( {\text {AP}}_\mathcal {S}\right) \). Since \(s > m \left( E_\mathcal {S}\right) \), then \((x,y)-\textbf{a}_0-\textbf{a}_{n-1} \in G \cap \left( (\mathbb {Z}{\setminus } \mathcal {S}_1) \times (\mathbb {Z}{\setminus } \mathcal {S}_2)\right) \cap L_{s-2}\), and hence

$$\begin{aligned}{\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2 \ge s=m \left( {\text {AP}}_\mathcal {S}\right) > m \left( E_\mathcal {S}\right) = {\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) ,\end{aligned}$$

where the first inequality follows from Lemma 3.8 (2) and the last equality from Lemma 3.9. Therefore, \({\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2>{\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1\) and the equality \({\text {reg}}(k[\mathcal {C}_A]) = m \left( {\text {AP}}_\mathcal {S}\right) \) follows from Lemma 3.11 and Eq. (3.1).

\(\square \)

Note that there exist curves, such that the maximum in Theorem 3.7 is equal to \(m \left( E_\mathcal {S}\right) \) and not equal to \(m \left( {\text {AP}}_\mathcal {S}\right) \), and vice versa. For instance, if \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay, then \(m \left( {\text {AP}}_\mathcal {S}\right) > m \left( E_\mathcal {S}\right) =-\infty \). However, there also exist non-arithmetically Cohen–Macaulay curves, such that \(m \left( {\text {AP}}_\mathcal {S}\right) >m \left( E_\mathcal {S}\right) \). To illustrate these facts, we use the same curves as in Example 2.13.

Example 3.13

  1. (1)

    For \(A = \{0,1,3,11,13\}\), one has that \(m \left( E_\mathcal {S}\right) = 5\) and \(m \left( {\text {AP}}_\mathcal {S}\right) = 4\). Thus, \(\mathcal {C}_A\) is not arithmetically Cohen–Macaulay, and \({\text {reg}}(k[\mathcal {C}_A]) = 5=m \left( E_\mathcal {S}\right) >m \left( {\text {AP}}_\mathcal {S}\right) \).

  2. (2)

    [1, Ex. 4.3]. For \(A = \{0,5,9,11,20\}\), \(m \left( E_\mathcal {S}\right) = 4\) and \(m \left( {\text {AP}}_\mathcal {S}\right) =5\), so \(\mathcal {C}_A\) is not arithmetically Cohen–Macaulay, and \({\text {reg}}(k[\mathcal {C}_A]) = 5=m \left( {\text {AP}}_\mathcal {S}\right) >m \left( E_\mathcal {S}\right) \).

Remark 3.14

Let \(\mathfrak {m}\) be the maximal homogeneous ideal of \(k[\mathcal {S}] \cong k[\mathcal {C}_A]\) and \(\mathfrak {q}:= \langle u^d,v^d\rangle \). We know that \(\mathfrak {q}\) is a minimal reduction of \(\mathfrak {m}\). Denote by \({\text {red}}(k[\mathcal {C}_A])\) the reduction number of \(\mathfrak {m}\) with respect to \(\mathfrak {q}\), i.e., \({\text {red}}(k[\mathcal {C}_A]) = \min \{s\in \mathbb {N}: \mathfrak {m}^{s+1}=\mathfrak {q} \mathfrak {m}^s\}\), which can be computed as

$$\begin{aligned}{\text {red}}(k[\mathcal {C}_A]) = \min \{ s\in \mathbb {N}: (s+1)\textbf{A}= s\textbf{A}+ \{\textbf{a}_0,\textbf{a}_{n-1}\} \}.\end{aligned}$$

By the discussion at the beginning of Sect. 2, it is clear that \({\text {red}}(k[\mathcal {C}_A]) = m \left( {\text {AP}}_\mathcal {S}\right) \), and we can characterize when \({\text {reg}}(k[\mathcal {C}_A]) = {\text {red}}(k[\mathcal {C}_A])\) in a combinatorial way: by Theorem 3.7,

$$\begin{aligned}{\text {reg}}(k[\mathcal {C}_A]) = {\text {red}}(k[\mathcal {C}_A]) \Longleftrightarrow m \left( {\text {AP}}_\mathcal {S}\right) \ge m \left( E_\mathcal {S}\right) .\end{aligned}$$

In particular, we obtain that \({\text {reg}}(k[\mathcal {C}_A]) = {\text {red}}(k[\mathcal {C}_A])\) whenever \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay which is already known. However, this occurs in many other examples, e.g., in Example 3.13 (2).

The Castelnuovo–Mumford regularity of the semigroup ring \(k[\mathcal {S}]\) can also be bounded from above and from below in terms of \(\sigma \), the conductor of \(\mathcal {S}\). These bounds will be given in Theorem 3.16 where we distinguish two cases depending on the value of \(\sigma \) in Theorem 3.1. Let us first prove a lemma that will be needed in the proof. Recall that for \(i=1,2\), the Fröbenius number of \(\mathcal {S}_i\), denoted by \(F(\mathcal {S}_i)\), is the largest gap of \(\mathcal {S}_i\), i.e., \(F(\mathcal {S}_i)=c_i-1\).

Lemma 1.32

Set \(N:= \lceil \frac{c_1+c_2}{d} \rceil \). Then, \({\text {reg}}(k[\mathcal {C}_A]) \ge \lceil \frac{N}{2} \rceil +1\).

Proof

One has that \(F(\mathcal {S}_1)+d\in {\text {Ap}}_1\) and consider \(y \in {\text {Ap}}_2\), such that \(F(\mathcal {S}_1)+d+y \equiv 0 \pmod {d}\). Note that \(y\ne 0\). By Lemma 2.5, there are two options: either \((F(\mathcal {S}_1)+d,y) \in {\text {AP}}_{\mathcal {S}}\), or there exist \(y'\ge y\) such that \((F(\mathcal {S}_1)+d,y') \in {\text {AP}}_{\mathcal {S}}\). In both cases, there exists \(y\ge 1\), such that \((F(\mathcal {S}_1)+d,y)\in {\text {AP}}_{\mathcal {S}}\) and, analogously, there exists \(x\ge 1\), such that \((x,F(\mathcal {S}_2)+d) \in {\text {AP}}_{\mathcal {S}}\). By Theorem 3.7

$$\begin{aligned} {\text {reg}}(k[\mathcal {C}_A])\ge & {} \max \left\{ \dfrac{F(\mathcal {S}_1)+d+y}{d}, \dfrac{F(\mathcal {S}_2)+d+x}{d} \right\} \\\ge & {} \dfrac{1}{2} \dfrac{F(\mathcal {S}_1)+F(\mathcal {S}_2)+2}{d}+1 = \dfrac{c_1+c_2}{2d}+1. \end{aligned}$$

Thus, \({\text {reg}}(k[\mathcal {C}_A]) \ge \lceil \frac{c_1+c_2}{2d} \rceil +1=\lceil \frac{N}{2} \rceil +1\). \(\square \)

Theorem 1.33

We have the following bounds for the Castelnuovo–Mumford regularity of \(k[\mathcal {C}_A]\):

  1. (1)

    If \(\sigma = {\text {r}}(k[\mathcal {C}_A]) \ge \lceil \frac{c_1+c_2}{d} \rceil \), then \(\sigma \le {\text {reg}}(k[\mathcal {C}_A]) \le \sigma +1\).

  2. (2)

    If \(\sigma = \lceil \frac{c_1+c_2}{d} \rceil > {\text {r}}(k[\mathcal {C}_A])\), then \(\lceil \frac{\sigma }{2} \rceil +1 \le {\text {reg}}(k[\mathcal {C}_A]) \le \sigma +1\).

Proof

In both cases, the upper bound is a consequence of Theorem 3.7 and Remark 3.6 (1). If \(\sigma = {\text {r}}(k[\mathcal {C}_A]) \ge \lceil \frac{c_1+c_2}{d} \rceil \), then we apply the known fact \({\text {r}}(k[\mathcal {C}_A]) \le {\text {reg}}(k[\mathcal {C}_A])\), see [9, Thm 4.2], and in the other case, the lower bound is the one given in Lemma 3.15. \(\square \)

Example 3.17

To illustrate that all the upper and lower bounds in Theorem 3.16 are sharp, the values of \({\text {r}}(k[\mathcal {C}_A])\), \(\lceil \frac{c_1+c_2}{d} \rceil \), \(\sigma \) and \({\text {reg}}(k[\mathcal {C}_A])\) in four different examples are displayed in Table 1.

Table 1 Examples where the bounds in Theorem 3.16 are attained

The following result is more precise than the one stated in Theorem 3.16 in a particular case. It gives, in this case, the precise relationship between the three regularities, in the sense of Castelnuovo–Mumford, of the Hilbert function, and of the sumsets.

Proposition 1.35

If \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay and \((F(\mathcal {S}_1)+d\), \(F(\mathcal {S}_2)+d) \in {\text {AP}}_{\mathcal {S}}\), then

$$\begin{aligned}\sigma =\Bigg \lceil \frac{c_1+c_2}{d} \Bigg \rceil ,\ {\text {r}}(k[\mathcal {C}_A]) = \sigma ,\text { and }{\text {reg}}(k[\mathcal {C}_A]) = \sigma +1.\end{aligned}$$

Proof

Since \(\left( F(\mathcal {S}_1)+d,F(\mathcal {S}_2)+d\right) \in {\text {AP}}_{\mathcal {S}}\), one has that \((F(\mathcal {S}_1)+d\), \(F(\mathcal {S}_2)+d)\in {\text {AP}}_s\) for \(s=m \left( {\text {AP}}_\mathcal {S}\right) \) and, as \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay, \({\text {reg}}(k[\mathcal {C}_A]) =m \left( {\text {AP}}_\mathcal {S}\right) \) by Theorem 3.7. Thus,

$$\begin{aligned}{\text {reg}}(k[\mathcal {C}_A]) = \dfrac{F(\mathcal {S}_1)+d+F(\mathcal {S}_2)+d}{d} = \dfrac{F(\mathcal {S}_1)+F(\mathcal {S}_2)}{d}+2.\end{aligned}$$

On the other hand,

$$\begin{aligned}\Bigg \lceil \dfrac{c_1+c_2}{d} \Bigg \rceil = \Bigg \lceil \dfrac{F(\mathcal {S}_1)+F(\mathcal {S}_2)}{d}+\dfrac{2}{d} \Bigg \rceil = \dfrac{F(\mathcal {S}_1)+F(\mathcal {S}_2)}{d}+1,\end{aligned}$$

so \({\text {reg}}(k[\mathcal {C}_A]) = \lceil \frac{c_1+c_2}{d} \rceil +1\), and \({\text {r}}(k[\mathcal {C}_A])=\lceil \frac{c_1+c_2}{d} \rceil \), since \({\text {reg}}(k[\mathcal {C}_A])={\text {r}}(k[\mathcal {C}_A])+1\) whenever \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay. Finally, \(\sigma =\lceil \frac{c_1+c_2}{d} \rceil \) by Theorem 3.1. \(\square \)

Example 3.19

For \(A = \{0,1,2,3,8\}\), \(k[\mathcal {C}_A]\) is Cohen–Macaulay, as shown in Example 2.8, and \((F(\mathcal {S}_1)+d,F(\mathcal {S}_2)+d) = (7,17) \in {\text {AP}}_{\mathcal {S}}\). By Proposition 3.18, \(\sigma = {\text {r}}(k[\mathcal {C}_A]) = \lceil \frac{c_1+c_2}{d} \rceil = 3\), and \({\text {reg}}(k[\mathcal {C}_A]) = \sigma +1 = 4\).

Using the previous results, we can give a new proof for the bound obtained by J. Elias in [11] for arithmetically Cohen–Macaulay curves.

Proposition 1.37

([11, Thm. 4.7]) If \(A = \{a_0=0<a_1<\dots <a_{n-1}=d\} \subset \mathbb {N}\) is a set in normal form, such that \(\mathcal {C}_A\) is arithmetically Cohen–Macaulay, then

$$\begin{aligned}{\text {reg}}(k[\mathcal {C}_A]) \le \Bigg \lceil \dfrac{d-1}{n-2} \Bigg \rceil .\end{aligned}$$

Proof

Set \(s_0:=\lceil \frac{d-1}{n-2}\rceil \). By Corollary 2.11, the sequence \(\left( |sA|-|(s-1)A|\right) _{s=0}^{\infty }\) is increasing and its limit is d. Indeed, as observed in the proof of this corollary, \(|sA|-|(s-1)A|=\sum _{j=0}^s |{\text {AP}}_j|\) for all \(s\in \mathbb {N}\). On the other hand, \(|{\text {AP}}_{\mathcal {S}}|=d\) by Proposition 2.6 (4) and, by [18, Thm. 1], \(|sA|-|(s-1)A|\ge d\) if \(s\ge s_0\). Therefore, \(|{\text {AP}}_s|=0\) for all \(s>s_0\), and hence, \({\text {reg}}(k[\mathcal {C}_A])\le s_0\) by Theorem 3.7. \(\square \)

Finally, as a consequence of Theorem 3.16, one gets a sufficient condition for \(\sigma \) to be equal to \(\lceil \frac{c_1+c_2}{d} \rceil \) in Theorem 3.1. The condition is expressed in terms of the difference between the Castelnuovo–Mumford regularity and the regularity of the Hilbert function of \(k[\mathcal {C}_A]\). We will see in the next section how this condition can be characterized in terms of the Betti numbers of \(k[\mathcal {C}_A]\).

Corollary 1.38

If \(D = {\text {reg}}(k[\mathcal {C}_A])-{\text {r}}(k[\mathcal {C}_A]) \ge 2\), then \(\sigma = \lceil \frac{c_1+c_2}{d} \rceil > {\text {r}}(k[\mathcal {C}_A])\).

Proof

If \(\sigma = {\text {r}}(k[\mathcal {C}_A]) \ge \lceil \frac{c_1+c_2}{d} \rceil \), then \(\sigma \le {\text {reg}}(k[\mathcal {C}_A]) \le \sigma +1\) by Theorem 3.16, so \(D\le 1\). \(\square \)

5 The Shape of the Betti Diagram

In this section, we relate both regularities \({\text {reg}}(k[\mathcal {C}_A])\) and \({\text {r}}(k[\mathcal {C}_A])\) in terms of the Betti diagram of \(k[\mathcal {C}_A]\) that can be used to characterize the difference \(D:={\text {reg}}(k[\mathcal {C}_A])-{\text {r}}(k[\mathcal {C}_A])\). Recall that the projective dimension of \(k[\mathcal {C}_A]\) is either \(n-2\) if the ring \(k[\mathcal {C}_A]\) is Cohen–Macaulay, or \(n-1\) otherwise.

The Hilbert function and polynomial of \(k[\mathcal {C}_A]\) are computed using the Betti numbers as follows: if we denote by \({\text {reg}}:= {\text {reg}}(k[\mathcal {C}_A])\) the Castelnuovo–Mumford regularity of \(k[\mathcal {C}_A]\), then

$$\begin{aligned} {\text {HF}}_{A}(t)= & {} \left( {\begin{array}{c}t+n-1\\ n-1\end{array}}\right) + \sum _{i=1}^{n-1} \sum _{j=0}^{{\text {reg}}} (-1)^i \beta _{i,i+j} \left( {\begin{array}{c}t-(i+j)+n-1\\ n-1\end{array}}\right) , \\ {\text {HP}}_{A}(t)= & {} \dfrac{1}{(n-1)!} \Biggl [ (t+n-1)(t+n-2)\dots (t+1) \\{} & {} + \sum _{i=1}^{n-1} \sum _{j=0}^{{\text {reg}}} (-1)^i \beta _{i,i+j} \prod _{l=1}^{n-1} \left( t-(i+j)+l \right) \Biggr ]. \end{aligned}$$

Taking into account the roots of the polynomial \(\prod _{l=1}^{n-1} \left( t-(i+j)+l\right) \), it is easy to prove that \({\text {HF}}_{A}(t)={\text {HP}}_{A}(t)\) for all \(t\ge {\text {reg}}\), that is

$$\begin{aligned} {\text {r}}(k[\mathcal {C}_A]) \le {\text {reg}}(k[\mathcal {C}_A]); \end{aligned}$$
(4.1)

see [9, Thm. 4.2] for the details. To determine precisely the difference D between the two regularities, we need to evaluate the difference \({\text {HP}}_{A}({\text {reg}}-\lambda )-{\text {HF}}_{A}({\text {reg}}-\lambda )\) for \(1\le \lambda \le {\text {reg}}\). For \(\lambda \ge 1\), set

$$\begin{aligned} \begin{aligned} A_{i+j}^{(\lambda )}&:= \left( {\begin{array}{c}{\text {reg}}+n-(\lambda +1)-(i+j)\\ n-1\end{array}}\right) , \\ B_{i+j}^{(\lambda )}&:= \dfrac{1}{(n-1)!} \prod _{l=1}^{n-1} \left( {\text {reg}}-\lambda -(i+j)+l\right) . \end{aligned} \end{aligned}$$

Using this notation, for all \(\lambda \), \(1\le \lambda \le {\text {reg}}\), we can write

$$\begin{aligned} {\text {HP}}_{A}({\text {reg}}-\lambda )-{\text {HF}}_{A}({\text {reg}}-\lambda )= & {} \sum _{i=1}^{n-1} \sum _{j=0}^{{\text {reg}}} (-1)^i \beta _{i,i+j} \left( B_{i+j}^{(\lambda )} - A_{i+j}^{(\lambda )} \right) \nonumber \\= & {} \sum _{i+j=1}^{{\text {reg}}+n-1} (-1)^i \beta _{i,i+j} \left( B_{i+j}^{(\lambda )} - A_{i+j}^{(\lambda )} \right) .\nonumber \\ \end{aligned}$$
(4.2)

The following lemma establishes when \(A_{i+j}^{(\lambda )}\) and \(B_{i+j}^{(\lambda )}\) coincide.

Lemma 1.39

Consider \(\lambda \ge 1\) and \(i+j\), such that \(1\le i+j\le {\text {reg}}+n-\lambda \).

  1. (1)

    If \(i+j\le {\text {reg}}-\lambda \), then \(A_{i+j}^{(\lambda )} = B_{i+j}^{(\lambda )} \ne 0\).

  2. (2)

    If \({\text {reg}}-\lambda +1 \le i+j \le {\text {reg}}+n-(\lambda +1)\), then \(A_{i+j}^{(\lambda )} = B_{i+j}^{(\lambda )} = 0\).

  3. (3)

    If \(i+j = {\text {reg}}+n-\lambda \), then \(A_{i+j}^{(\lambda )} = 0\) and \(B_{i+j}^{(\lambda )} = (-1)^{n-1}\).

Proof

If \(i+j\le {\text {reg}}-\lambda \), then \({\text {reg}}+n-(\lambda +1)-(i+j) \ge n-1\) so \(A_{i+j}^{(\lambda )} = B_{i+j}^{(\lambda )} \ne 0\) and \((1)\) follows. Otherwise, \(A_{i+j}^{(\lambda )} = 0\) and we distinguish two cases. If \(i+j \le {\text {reg}}+n-(\lambda +1)\), then \(1\le i+j+\lambda -{\text {reg}}\le n-1\), and hence, \(B_{i+j}^{(\lambda )} = 0\) and (2) follows. Finally, if \(i+j = {\text {reg}}+n-\lambda \), then

$$\begin{aligned}B_{{\text {reg}}+n-\lambda }^{(\lambda )} = \dfrac{1}{(n-1)!} \prod _{l=1}^{n-1} (l-n) = (-1)^{n-1},\end{aligned}$$

and we are done. \(\square \)

By Lemma 4.1 (3) and Eq. (4.2), \({\text {HP}}_{A}({\text {reg}}-1) -{\text {HF}}_{A}({\text {reg}}-1) = \beta _{n-1,{\text {reg}}+n-1}\) so if \(\beta _{n-1,{\text {reg}}+n-1} \ne 0\), one gets that \({\text {r}}(k[\mathcal {C}_A]) = {\text {reg}}(k[\mathcal {C}_A])\), i.e., \(D=0\). And the reciprocal statement also holds. This is a particular case of the following result that relates precisely D to some of the Betti numbers.

Proposition 1.40

If \(\lambda \ge 1\) is the least positive integer, such that

$$\begin{aligned}\sum _{i} (-1)^i \beta _{i,{\text {reg}}+n-\lambda } \ne 0,\end{aligned}$$

then \({\text {r}}(k[\mathcal {C}_A]) = {\text {reg}}(k[\mathcal {C}_A])-\lambda +1\), i.e., \(D = \lambda -1\), and

$$\begin{aligned}{\text {HP}}_{A}({\text {reg}}-\lambda )-{\text {HF}}_{A}({\text {reg}}-\lambda ) = \sum _{i} (-1)^{n+i-1} \beta _{i,{\text {reg}}+n-\lambda }.\end{aligned}$$

Proof

The case \(\lambda =1\) is proved just before the proposition, so assume that \(\lambda \ge 2\). Since, for all \(\mu =1,2,\ldots ,\lambda -1\), \(\sum _{i} (-1)^i \beta _{i,{\text {reg}}+n-\mu } = 0\), by Eq. (4.2), one gets that \({\text {HP}}_{A}(t) = {\text {HF}}_{A}(t)\) for all \(t\ge {\text {reg}}-\lambda +1\), i.e., \({\text {r}}(k[\mathcal {C}_A]) \le {\text {reg}}(k[\mathcal {C}_A])-\lambda +1\). Moreover, by applying Lemma 4.1 to Eq. (4.2), we obtain that

$$\begin{aligned}{\text {HP}}_{A}({\text {reg}}-\lambda )-{\text {HF}}_{A}({\text {reg}}-\lambda )= & {} \sum _i (-1)^i \beta _{i,{\text {reg}}+n-\lambda } B_{{\text {reg}}+n-\lambda }^{(\lambda )} \\= & {} \sum _i (-1)^{n+i-1} \beta _{i,{\text {reg}}+n-\lambda } \ne 0, \end{aligned}$$

and hence, \({\text {r}}(k[\mathcal {C}_A]) = {\text {reg}}(k[\mathcal {C}_A])-\lambda +1\). \(\square \)

Note that the previous result is general. In its proof, we do not use that the ring is the coordinate ring of a monomial projective curve. This proves the following result that improves [9, Thm. 4.2]:

Theorem 1.41

Let M be a finitely generated graded module over \(k[x_0,\ldots ,x_{n-1}]\), and denote by D the difference between the Castelnuovo–Mumford regularity and the regularity of the Hilbert function of M, i.e., \(D:={\text {reg}}(M)-{\text {r}}(M)\). Then, \(D+1\) is the least non-negative integer \(\lambda \ge 0\), such that

$$\begin{aligned} \sum _{i} (-1)^i \beta _{i,{\text {reg}}(M)+n-\lambda } \ne 0\,\end{aligned}$$

where the \(\beta _{ij}\) are the graded Betti numbers of M.

Remark 4.4

  1. (1)

    If we focus on the secondary diagonals of the Betti diagram starting from the bottom right of the table, the number \(\lambda \) in the previous theorem is the label of the first diagonal, such that the alternating sum of the Betti numbers on this diagonal is not 0.

    figure a
  2. (2)

    If p denotes the projective dimension of the module M, the previous result implies that \(\beta _{p,{\text {reg}}(M)+p}\ne 0\), i.e., the regularity is attained at the last step of a m.g.f.r. of M, if, and only if, \(\lambda =n-p\), i.e., \(D=n-1-p\). This occurs, in particular, whenever M is a Cohen–Macaulay module, so, in this case, \({\text {reg}}(M) - {\text {r}}(M)=n-1-p\) which is a well-known fact; see, e.g., [9, Cor. 4.8].

Going back to the case of projective monomial curves, the case \(\lambda =2\) (i.e., \(D=1\)) in Proposition 4.2 includes all arithmetically Cohen–Macaulay curves, since \(\beta _{n-1,{\text {reg}}+n-1} = \beta _{n-1,{\text {reg}}+n-2} =0\) and \(\beta _{n-2,{\text {reg}}+n-2} \ne 0\) in this case. However, there are also non-arithmetically Cohen–Macaulay curves \(\mathcal {C}_A\), such that \(D = {\text {reg}}(k[\mathcal {C}_A])-{\text {r}}(k[\mathcal {C}_A]) = 1\) as we will see in the next example.

Example 4.5

Different values of \(D = {\text {reg}}(k[\mathcal {C}_A])-{\text {r}}(k[\mathcal {C}_A])\) and different shapes for the Betti diagram of \(k[\mathcal {C}_A]\) are obtained in the following four examples of monomial curves in \(\mathbb {P}^{4}_k\).

figure b

Recall that, as stated in [23, Thm. 3.11], the regularity is always determined by the tail of a m.g.f.r.. In other words, the definition of regularity given in (0.2) can be simplified as

$$\begin{aligned}{\text {reg}}(k[\mathcal {C}_A]):= \max \{j-i: \beta _{i,j} \ne 0,\ n-\dim (k[\mathcal {C}_A])\le i\le n-{\text {depth}}(k[\mathcal {C}_A]),\ j\ge 0\}.\end{aligned}$$

In our situation, \(\dim (k[\mathcal {C}_A])=2\), and hence, \(1\le {\text {depth}}(k[\mathcal {C}_A])\le 2\). If \(k[\mathcal {C}_A]\) is Cohen–Macaulay, then the regularity is always attained at the last step of a m.g.f.r., a general and well-known fact. When \(k[\mathcal {C}_A]\) is not Cohen–Macaulay, it is always attained at one of the last two steps of a m.g.f.r. and our next result characterizes when the regularity is attained at the last step in terms of the formula given in Theorem 3.7 and of the difference \(D={\text {reg}}(k[\mathcal {C}_A])-{\text {r}}(k[\mathcal {C}_A])\).

Theorem 1.44

If \(\mathcal {C}_A\) is not arithmetically Cohen–Macaulay, the following are equivalent:

  1. (1)

    The Castelnuovo–Mumford regularity of \(k[\mathcal {C}_A]\) is attained at the last step of a m.g.f.r.

  2. (2)

    \({\text {reg}}(k[\mathcal {C}_A]) = m \left( E_\mathcal {S}\right) \), i.e., \(m \left( E_\mathcal {S}\right) \ge m \left( {\text {AP}}_\mathcal {S}\right) \).

  3. (3)

    \({\text {reg}}(k[\mathcal {C}_A])={\text {r}}(k[\mathcal {C}_A])\), i.e., \(D=0\).

Proof

The equivalence (1)\(\Leftrightarrow \)(3) is a direct consequence of Proposition 4.2 as observed in Remark 4.4 (2). Therefore, we only have to prove (1)\(\Leftrightarrow \)(2). It is well known that the maximal degree of the minimal \((n-{\text {depth}}(R/I))\)-syzygies of \(k[\mathcal {C}_A]\) is equal to \({\text {end}}\left( H_\mathfrak {m}^{{\text {depth}}(R/I)} \left( k[\mathcal {S}] \right) \right) +n\). This is, e.g., a consequence of [5, Cor. 2.2]. If \(k[\mathcal {C}_A]\) is not Cohen–Macaulay, then by Theorem 3.7, its proof, and Lemma 3.9, one has that \({\text {reg}}(k[\mathcal {C}_A])=m \left( E_\mathcal {S}\right) \) if and only if \({\text {end}}\left( H_\mathfrak {m}^{1} \left( k[\mathcal {S}] \right) \right) +1 = m \left( E_\mathcal {S}\right) \ge {\text {end}}\left( H_\mathfrak {m}^{2} \left( k[\mathcal {S}] \right) \right) +2\), i.e., if and only if the Castelnuovo–Mumford regularity is attained at the last step of a m.g.f.r. of \(k[\mathcal {C}_A]\) by (3.1) and the previous observation. This proves the equivalence between (1) and (2). \(\square \)

Finally, let us focus on monomial curves in \(\mathbb {P}^{3}_k\). Since these curves have codimension 2, they have some additional properties.

Proposition 1.45

Let \(A\subset \mathbb {N}\) be a set in normal form with \(|A|=4\) and consider the associated monomial curve \(\mathcal {C}_A\subset \mathbb {P}^{3}_k\).

  1. (1)

    The Castelnuovo–Mumford regularity is attained at the last step of a m.g.f.r. of \(k[\mathcal {C}_A]\).

  2. (2)

    Setting \(D:= {\text {reg}}(k[\mathcal {C}_A]) - {\text {r}}(k[\mathcal {C}_A])\), one has that \(0\le D \le 1\). More precisely,

    $$\begin{aligned}\begin{aligned} D=0&\Leftrightarrow k[\mathcal {C}_A] \text { is not Cohen--Macaulay} \Leftrightarrow {\text {reg}}(k[\mathcal {C}_A]) = m \left( E_\mathcal {S}\right) \ge m \left( {\text {AP}}_\mathcal {S}\right) , \\ D=1&\Leftrightarrow k[\mathcal {C}_A] \text { is Cohen--Macaulay} \Leftrightarrow {\text {reg}}(k[\mathcal {C}_A]) = m \left( {\text {AP}}_\mathcal {S}\right) > m \left( E_\mathcal {S}\right) . \end{aligned}\end{aligned}$$

Proof

(1) is a particular case of [3, Cor. 2.13]. By Proposition 4.2 and Remark 4.4 (2), this implies that either \(D=0\) if \(\mathcal {C}_A\) is not arithmetically Cohen–Macaulay, or \(D = 1\) if \(\mathcal {C}_A\) is arithmetically Cohen Macaulay. (2) then follows from Theorem 4.6. \(\square \)

6 The Relation Between Known Bounds for \(\sigma \) and \({\text {reg}}(k[\mathcal {C}_A])\)

In this final section, we show how the bound for \(\sigma \) recently obtained by Granville and Walker in [14] and the classical bound for \({\text {reg}}(k[\mathcal {C}_A])\) given by the Gruson–Lazarsfeld–Peskine Theorem [15] are related. As a consequence of some of our results, we obtain that each of these bounds can be deduced from the other.

Let us first recall these two bounds. Consider \(A = \{a_0=0<a_1<\dots <a_{n-1}=d\} \subset \mathbb {N}\) a set in normal form. In Sect. 1, we presented several upper bounds for \(\sigma \), the sumsets regularity of A, which we also called the conductor of the homogeneous semigroup \(\mathcal {S}\). The best bound is the one given in [14, Thm. 1] by Granville and Walker:

$$\begin{aligned} \sigma \le d-n+2.\end{aligned}$$
(5.1)

On the other hand, a classical and important result in algebraic geometry provides an upper bound for the Castelnuovo–Mumford regularity of any reduced and irreducible projective curve in terms of its degree and codimension. It is the Gruson–Lazarsfeld–Peskine Theorem; see, e.g., [9, Thm. 5.1]. Applied to the monomial projective curve \(\mathcal {C}_A\), the Gruson–Lazarsfeld–Peskine Theorem claims that

$$\begin{aligned} {\text {reg}}(k[\mathcal {C}_A])\le d-n+2.\end{aligned}$$
(5.2)

Let us first show that the Granville–Walker bound (5.1) can be deduced from (5.2) using Theorem 3.1. We start with the following result that bounds one of the terms in Theorem 3.1.

Lemma 1.46

Let \(A = \{a_0=0<a_1<\dots <a_{n-1} = d\}\subset \mathbb {N}\) be a set in normal form. If \(\mathcal {S}_1\) is the semigroup generated by A, \(\mathcal {S}_2\) is the semigroup generated by \(d-A\), and \(c_i\) is the conductor of \(\mathcal {S}_i\) for \(i=1,2\), then

$$\begin{aligned}\Bigg \lceil \dfrac{c_1+c_2}{d} \Bigg \rceil \le d-n+1.\end{aligned}$$

Proof

The conductors of both semigroups \(\mathcal {S}_1\) and \(\mathcal {S}_2\) can be bounded using [22, Thm. 3.1.1]:

$$\begin{aligned}\begin{aligned} c_1&\le (a_1-1)(a_{n-1}-1)=(a_1-1)(d-1), \\ c_2&\le (d-a_{n-2}-1)(d-a_1-1). \end{aligned}\end{aligned}$$

Therefore

$$\begin{aligned}\begin{aligned} c_1+c_2&\le d^2-3d-da_{n-2}+a_1a_{n-2}+a_{n-2}+2\\&\le d^2-3d-d(a_1+n-3)+(d-1)a_1+(d-1)+2, \end{aligned}\end{aligned}$$

because \(a_{n-2} \ge a_1+n-3\) and \(a_{n-2}\le d-1\). Thus,

$$\begin{aligned}c_1+c_2 \le d^2-3d-nd+3d-a_1+d+1 \le d^2-nd+d = d(d-n+1).\end{aligned}$$

Dividing by d, the result follows. \(\square \)

As recalled in (4.1), \({\text {r}}(k[\mathcal {C}_A]) \le {\text {reg}}(k[\mathcal {C}_A])\), so (5.1) is a straightforward consequence of (5.2), Lemma 5.1, and Theorem 3.1.

Conversely, to show that (5.2) can be deduced from (5.1), we will use the additional result of Granville and Walker recalled in Theorem 1.4 where all the sets A in normal form, such that the bound in (5.1) is attained are characterized. We distinguish three cases:

  1. (a)

    If neither A nor \(d-A\) belongs to the two families listed in Theorem 1.4, then \(\sigma \le d-n+1\), and (5.2) follows from Theorem 3.16.

  2. (b)

    If \(A = [0,d] \setminus \{a\}\) for some \(a\in [2,d-2]\), then \(\sigma = 2\) and \({\text {reg}}(k[\mathcal {C}_A])=2\) as well by Theorem 3.7, and hence (5.2) holds for such a set A. Observe that, in this case, \(d= n\) so equality holds in (5.1) and (5.2).

  3. (c)

    If \(A = [0,1] \sqcup [a+1,d]\) for some \(a\in [2,d-2]\), then \(sA = [0,sd]\) for all \(s\ge a\) and \(a\notin (a-1)A\). Therefore, \(\sigma =a\) and \({\text {reg}}(k[\mathcal {C}_A]) = a\) by Theorem 3.7, so (5.2) also follows from (5.1) in this case. One gets the same conclusion if \(d-A=[0,1] \sqcup [a+1,d]\) for some \(a \in [2,d-2]\).

Note that this discussion provides a new combinatorial proof of the Gruson–Lazarsfeld–Peskine Theorem for projective monomial curves.