Nearly Gorenstein rings arising from finite graphs

The classification of complete multipartite graphs whose edge rings are nearly Gorenstein as well as that of finite perfect graphs whose stable set rings are nearly Gorenstein is achieved.

Since Ohsugi and Hibi in [14] have explicitly listed the complete multipartite graphs whose edge ring is Gorenstein (see Theorem 1.1 below), Theorem A offers a full description for the nearly Gorenstein property, as well.
The other class of algebras we consider deals with the stable sets in G. A nonempty set W of vertices is called stable (or independent) if there is no edge {i, j} in G with i, j ∈ W . The stable set ring of G denoted Stab K (G) is the K-subalgebra in the polynomial ring K[x 1 , . . . , x d , t] generated by those monomials ( i∈W x i ) · t with W any stable set in G. When G is a perfect graph, it is known [15] that Stab K (G) is Cohen-Macaulay, and that it is Gorenstein if and only if all maximal cliques of G have the same cardinality [16]. Recall that a set C ⊂ V (G) is called a clique if the subgraph induced by C is a complete graph.
The size of the maximal cliques in G is also relevant to describe in Theorem 2.3 for which perfect graphs the algebra Stab K (G) is nearly Gorenstein. We prove the following.
Theorem B. Let G be a perfect graph and G 1 , . . . , G s its connected components. Let δ i denote the maximal cardinality of cliques of G i . Then Stab K (G) is nearly Gorenstein if and only if for each G i its maximal cliques have the same cardinality and |δ i − δ j | ≤ 1 for 1 ≤ i < j ≤ s.
To prove Theorems A and B we observe that the algebras R which occur are Cohen-Macaulay domains, so ω R can be identified with an ideal in R. By [7, Lemma 1.1], its trace can be computed as is the anti-canonical ideal of R and Q(R) denotes the field of fractions of R.
We refer the reader to [1] and [2] for the undefined graph or algebraic notions.

Edge rings
In this section unless stated otherwise G = K r 1 ,...rn is the complete multipartite graph on [d] with vertices partitioned V (G) = V 1 ⊔ · · · ⊔ V n , n ≥ 2, |V k | = r k for all k. In this context d = n k=1 r k and without loss of generality, we will always assume that 1 ≤ r 1 ≤ · · · ≤ r n .
The graph G satisfies the so called odd cycle condition, i.e. for any two odd cycles in G which have no common vertex there is a bridge between them. Indeed, when n = 2 there is no odd cycle and anything to prove. Assume n ≥ 3, and C 1 and C 2 be two disjoint odd cycles in G. Since G is multipartite, each of these contains vertices from at least two of the components V 1 , . . . , V n , so one finds v ∈ C 1 ∩ V a and w ∈ C 2 ∩ V b with a = b. Then vw is an edge in G and a bridge between C 1 and C 2 . Consequently, by [13] the edge ring is normal, hence a Cohen-Macaulay domain ( [12]). Before we address the nearly Gorenstein property, we recall that Ohsugi and Hibi [14] classified the complete multipartite edge rings which are Gorenstein. With notation as above, their result is the following. For some complete multipartite graphs the edge ring fits into classes of algebras for which the nearly Gorenstein property is already understood. Example 1.2. When r 1 = · · · = r n = 1, the edge ring R is the squarefree Veronese subalgebra of degree 2 in the polynomial ring K[x 1 , . . . , x n ], and according to [7,Theorem 4.14], R is nearly Gorenstein if and only if it is Gorenstein. The latter property holds if and only if n ≤ 4, by using work of De Negri and Hibi [5], or Bruns, Vasconcelos and Villarreal [3]. Example 1.3. According to Higashitani and Matsushita [10, Proposition 2.2], when n = 2, or when n = 3 and r 1 = 1, the corresponding edge ring is isomorphic to a Hibi ring, and for the latter the nearly Gorenstein property is described in [7]. We refer to [9] for background on Hibi rings.  [9]) Let P be a finite poset. Then the Hibi ring R of the distributive lattice of the order ideals in P is nearly Gorenstein if and only if P is the disjoint union of pure connected posets P 1 , . . . , P q such that | rank(P i ) − rank(P j )| ≤ 1 for 1 ≤ i < j ≤ q.
In particular, R is a Gorenstein ring if and only if P is pure.
Based on that, when G is a complete bipartite graph we obtain the following classification.
Proposition 1.5. Let G = K r 1 ,r 2 be the complete bipartite graph with 1 ≤ r 1 ≤ r 2 . Then the edge ring K[G] is nearly Gorenstein if and only if r 1 = 1, or r 1 ≥ 2 and r 2 ∈ {r 1 , r 1 + 1}. For non-bipartite graphs we prove the following result.
Theorem 1.6. Let R be the edge ring of a complete multipartite graph K r 1 ,...,rn with n ≥ 3. The following statements are equivalent: (i) R is a Gorenstein ring; (ii) R is a nearly Gorenstein ring.
We now consider the remaining cases: either n = 3 and r 1 ≥ 2, or n ≥ 4. Assume, by contradiction that R is nearly Gorenstein and not Gorenstein, i.e.
The monomials in R and ω R have a nice combinatorial description as feasable integer solutions to some systems of inequalities. This can be described as follows. We denote H = {i,j}∈E(G) N(e i + e j ) ⊂ N d the affine semigroup generated by the columns of the vertex-edge incidence matrix for G, and C = R + H the rational cone over H.
For u = (u 1 , . . . , u d ) ∈ N d , it follows from [13] and [18,Proposition 3.4 The latter inequalities are equivalent to Since R is normal, by [4], [17] (see also [2, Theorem 6.3.5(b)]), a K-basis for ω R is given by the monomials From the equations above it is easy to see that if the monomial x u is in R or in ω R , we can permute the exponents x i and x j whenever i, j ∈ V k for some k, and we obtain another monomial in R, or in ω R , respectively.
For a monomial x u ∈ ω R and 1 ≤ k ≤ n we say that V k (or simply, k) is a heavy component in u if For any x u ∈ ω R there exist at most two heavy components in u. In particular, there is at least one non-heavy component in u.
Proof. Indeed, if k 1 < k 2 < k 3 are heavy components in u, then by adding the equations (7) for these indices we get Since u i ≥ r i ≥ 2 for all i, we infer that r 1 = r 2 = r 3 = 2, and K[G] is a Gorenstein ring (by Theorem 1.1), which is not the case.
If n ≥ 4, then d i=1 u i < 6. As d i=1 u i is even, we get that n = 4 and r 1 = r 2 = r 3 = r 4 = 1. Example 1.2 implies that R is a Gorenstein ring, which is false.
Proof. We fix i and we denote a i = min{u i : x u i i ∈ ω R }. By (5), a i ≥ 1. Assume a i ≥ 2, and say i ∈ V k .
If r k > 1, we may pick j ∈ V k , j = i. Then it is easy to check that the monomial m = x u x i x j ∈ ω R and deg x i (m) = a i − 1, a contradiction. When r k = 1, then n ≥ 4 and by the previous claim there is at least one nonheavy component V k 1 in u which is different from V k . We pick j ∈ V k 1 and since the monomial m = x u x i x j ∈ ω R and deg x i (m) = a i − 1 we obtain a contradiction. It follows at once that where the greatest common divisor is computed in the polynomial ring S = K[x 1 , . . . , x d ].
Since ω R is generated by monomials, one gets that ω −1 R is also generated by mono- x v coprime monomials in S, then x v divides the greatest common divisor of the monomials in ω R . Hence, in order to determine a system of generators for the R-module ω −1 R it is enough to scan among the (non-reduced) A monomial x u is in B if and only if d i=1 u i ≡ 0 mod 2 and That is equivalent, via (2), (4), (3), to the fact that for k = 1, . . . , d, and any x v ∈ ω R .
For k = 1, . . . , n we set Therefore, (9) is equivalent to Before computing E k we make a simple observation regarding d and the r i 's. Proof. Indeed, if that were not the case, then 2r n + 2 ≥ 2r n−1 + 2 > d, hence 2r n ≥ 2r n−1 ≥ d − 1. This implies r n + r n−1 ≥ d − 1, equivalently that 1 = n−2 i=1 r i , which is not possible in our setup.
Next we show that E k does not depend on k. Claim 1.10. E k = 2 for k = 1, . . . , n.
Proof. We fix 1 ≤ k ≤ n. Clearly, E k ≥ 2, by (6). Then E k = 2 once we find (11) x Using Eqs. (4), (5), (6), and translating v i = r i + s i for i = 1, . . . , n, we observe that finding v as in (11) is equivalent to finding integers s 1 , . . . , s n such that The s ℓ represents the sum of the components of v from V ℓ , each decreased by one. Note that (14) already implies that n i=1 s i ≡ d mod 2. We have two cases to consider. Case k = n: We let s ℓ = ⌊d/2⌋ − r ℓ − 1 for ℓ = 1, . . . , n − 1. For (14) to hold, we must let For ℓ < n, one has s ℓ ≥ 0 by the previous Claim. Also, 2s ℓ + 2 + 2r ℓ − d is either 0 or 1, depending on d being even or odd. Therefore, (13) and (12) are all verified.
Case 1 ≤ k ≤ n − 1: We let s n = 0 and s ℓ = ⌊d/2⌋ − r ℓ − 1 for ℓ = 1, . . . , n − 1 where ℓ = k. For (14) to hold, we must let Clearly, s k ≥ 0 since d ≥ 2r k + 2. Arguing as in the other case, for k = ℓ < n one has s ℓ ≥ 0 and (13) holds. We are left to verify that Substituting (14) into the left hand side term above, (16) is equivalent to s k + r k ≥ s n + r n .
We can now finish the proof of Theorem 1.6. Let m = x a 1 1 . . . x a d d be a monomial generator for ω R . Then deg m = d i=1 a i ≥ 2 + 2 j∈V k a j for all k = 1, . . . , n. In particular, deg m ≥ 2r n + 2. (10), u j for all k = 1, . . . , n.
Since d > r n + 2 in our setup, we find a component k 1 such that j∈V k 1 u j > 0. The product m · f is a monomial in R of degree at least (2r n + 2) + (d − r k 1 − 2 + 2 Consequently, tr(ω R ) = ω R · ω −1 R m R , a contradiction with (1).

Stable set rings
In this section we consider an algebra generated by the monomials coming from the stable sets of a graph.
Let G be a finite simple graph on [n] and E(G) is the set of edges of G. A subset In particular, the empty set as well as each {i} ⊂ [n] is both a clique of G and a stable subset of G. Let ∆(G) denote the clique complex of G which is the simplicial complex on [n] consisting of all cliques of G. Let δ denote the maximal cardinality of cliques of G. Thus dim ∆(G) = δ − 1. We say that G is pure if ∆(G) is a pure simplicial complex, i.e. the cardinality of each maximal clique of G is δ. The chromatic number of a graph is the smallest number of colors that can be used for its vertices such that no adjacent vertices have the same color. The graph G is called perfect if for all induced subgraphs H of G, including G itself, the chromatic number is equal to the maximal cardinality of cliques contained in H, see [1, p. 165].
Let K[x 1 , . . . , x n , t] denote the polynomial ring in n + 1 variables over the field K. If, in general, W ⊂ [n], then x W t stands for the squarefree monomial Let Stab K (G) denote the subalgebra of K[x 1 , . . . , x n ] which is generated by those x W t for which W is a stable set of G. Letting deg(x W t) = 1 for any stable set W , the algebra Stab K (G) becomes standard graded. We call Stab K (G) the stable set ring of G.
It is known [15,Example 1.3 (c)] that Stab K (G) is normal if G is perfect. It follows that, when G is perfect, Stab K (G) is spanned over K by those monomials ( n i=1 x a i i )t q with i∈C a i ≤ q for each maximal clique C of G. Furthermore, the canonical module ω Stab K (G) of Stab K (G) is spanned over K by those monomials ( n i=1 x a i i )t q with each a i > 0 and with i∈C a i < q for each maximal clique C of G. Thus [16, Theorem 2.1 (b)] implies that Stab K (G) is Gorenstein if and only if G is pure.
The following lemma captures a sufficient combinatorial condition for Stab K (G) to be nearly Gorenstein. Since each x i t as well as t belongs to R, the quotient field of R is the rational function field K(x 1 , . . . , x n , t) over K.
Suppose G 1 is a connected component of G which is not pure. Let δ and δ 1 denote the maximal cardinality of cliques of G and of G 1 , respectively. Then there is an edge {i 0 , j 0 } ∈ E(G 1 ) for which i 0 belongs to a clique C of G with |C| = δ 1 and for which j 0 belongs to no clique C of G with |C| = δ 1 .
It is easy to check that v 1 ∈ ω R and that each monomial belonging to ω R is divisible (in K[x 1 , . . . , x n , t]) by v 1 . Hence a i ≥ −1 for all i. Clearly, Since G is not pure, R is not a Gorenstein ring and thus Since q ′ ≥ −δ and q ≥ δ + 1, one has q ′ = −δ and q = δ + 1. Let This is clear when δ > δ 1 . In case δ = δ 1 , since i 0 belongs to a clique C of G with |C| = δ, one has a i 0 = 1. Thus a ′ i 0 = 0 and the claim is verified. Thus w ′ · x j 0 v must be of the form x W t, where W is a stable set of G, which contradicts {i 0 , j 0 } ∈ E(G). Hence m R tr(ω R ), as desired.
Recall that the a-invariant of any graded algebra R with canonical module ω R is defined as a(R) = − min{i : (ω R ) i = 0}.
Proof. Let δ be the maximal size of a clique in G. From the proof of the Lemma 2.1, v = x 1 · · · x n t δ+1 is in (ω Stab K (G) ) δ+1 and v divides every monomial in ω Stab K (G) . This gives the conclusion. Theorem 2.3. Let G be a finite simple graph with G 1 , . . . , G s its connected components and suppose that G is perfect. Let δ i denote the maximal cardinality of cliques of G i . Then Stab K (G) is nearly Gorenstein if and only if each G i is pure and |δ i − δ j | ≤ 1 for 1 ≤ i < j ≤ s.
Proof. Suppose that Stab K (G) is nearly Gorenstein. It follows from Lemma 2.1 that each G i is pure and each Stab K (G i ) is Gorenstein. Since Stab K (G) is the Segre product of Stab K (G 1 ), . . . , Stab K (G s ), it follows from [7, Corollary 4.16] and [8, Corollary 2.8] that |a(Stab K (G i )) − a(Stab K (G j ))| ≤ 1 for all i, j.