HOW TO COMPUTE THE STANLEY DEPTH OF A MODULE

. In this paper we introduce an algorithm for computing the Stanley depth of a ﬁnitely generated multigraded module M over the polynomial ring K [ X 1 ,...,X n ]. As an application, we give an example of a module whose Stanley depth is strictly greater than the depth of its syzygy module. In particular, we obtain complete answers for two open questions raised by Herzog. Moreover, we show that the question whether M has Stanley depth at least r can be reduced to the question whether a certain combinatorially deﬁned polytope P contains a Z n -lattice point.

which was introduced by Bruns, Krattenthaler, and Uliczka in [BKU10]. In fact, the method of [HVZ09] extends directly to an algorithm for computing the Hilbert depth of finitely generated multigraded R-modules, introduced by the first and third author [IMF14] and the first author together with Zarojanu [IZ14]. However, until now, little is known about the computation of the Stanley depth in general, which is certainly desirable in view of the original conjecture of Stanley. For computing either the Stanley or the Hilbert depth one has to consider certain combinatorial decompositions. They are called Stanley decompositions in the first case, respectively Hilbert decompositions in the second case.
An interesting fact is that-beside the interest raised among algebraists and combinatorialists by the conjecture of Stanley-Stanley decompositions have a separate life in applied mathematics. This goes back to Sturmfels and White [SW91], where it is shown how Stanley decompositions can be used to describe finitely generated graded algebras, e.g. rings of invariants under some group action. More recently, this found applications in the normal form theory for systems of differential equations with nilpotent linear part (see Murdock [Mur02], Murdock and Sanders [MS07], Sanders [San07]).
It is also worth mentioning that, in the particular case of a normal affine monoid, suited Stanley (or Hilbert) decompositions have already been used with success in order to design arguable the fastest available algorithms for computing Hilbert series (see [BI10] and [BIS12]). Further, these algorithms have been used for computing the Hilbert series (and subsequently the associated probability generating functions) corresponding to three well studied (but difficult to compute) voting situations with four candidates arising from the field of social choice: the Condorcet paradox, the Condorcet efficiency of plurality voting and Plurality versus Plurality Runoff (see [Sch13] and [BIS12] for details).
We remark that every Stanley decomposition is inducing a Hilbert decomposition, but the converse is not true. In fact, in many particular cases studied until now the converse also holds (for example in [HVZ09] and the related results). More generally, it makes sense to ask: Question 1.2. Which Hilbert decompositions are induced by Stanley decompositions? Question 1.3. [Her13, Question 1.63] Let M be a finitely generated multigraded R-module with syzygy module Z k for k = 1, 2, . . .. Is it true that sdepth Z k+1 ≥ sdepth Z k ?
Moreover, we define and study the structure of the set of all g-determined Stanley decompositions of a finitely generated multigraded R-module M. In Section 5.2 we show that this set naturally corresponds to the set of solutions of a certain system of linear Diophantine inequalities. In other words, the question whether M has Stanley depth at least r can be reduced to the question whether a certain combinatorially defined polytope P contains a Z n -lattice point. This polytope P turns out to be an intersection of a certain affine subspace with the positive orthant and finitely many polymatroids.
Finally, we introduce a new invariant, named the rational Hilbert depth of a module. On one hand this invariant is relatively easy to find out, as its computation amounts to finding a rational solution for a certain system of linear inequalities. On the other hand, it approximates the Stanley depth for an important class of modules, cf. Proposition 5.11.
The article is organized as follows. In Section 2, we fix the notation, recall the definitions and the necessary previous results. In Section 3, we formulate and prove Theorem 3.4, which is the answer to Question 1.2. In Section 4, we deduce an algorithm for the computation of the Stanley depth. This fully responds to Herzog's Question 1.1. In Section 5 we answer Question 1.3 and we present several interesting applications of the main result.

Prerequisites
In this section we recall the basics about both Stanley and Hilbert decompositions. We refer the reader to [Her13] for a more comprehensive treatment.
Let K be a field, R = K[X 1 , . . . , X n ] be the polynomial ring with the fine Z ngrading, and let M be a finitely generated Z n -graded R-module. Throughout the paper, we denote the cardinality of a set S by |S| and we set [n] := {1, . . . , n}. Moreover, n-tuples in Z n will be denoted by boldface letters as a, b, . . ., while a i will denote the i-th component of a ∈ Z n . Further, for a ∈ N n , we set supp(a) := {i ∈ [n] : a i = 0} and X a := X a 1 1 · · · X an n . Definition 2.1.
(1) A Stanley decomposition of M is a finite family (R i , m i ) i∈I , in which all m i ∈ M are homogeneous and R i are subalgebras of R generated by a subset of the indeterminates of R, such that R i ∩ Ann m i = 0 for each i ∈ I, and M = i∈I as a multigraded K-vector spaces.
(2) A Hilbert decomposition of M is a finite family (R i , s i ) i∈I , where s i ∈ Z n and the R i are again subalgebras of R generated by a subset of the indeterminates of R for each i ∈ I, such that as a multigraded K-vector spaces.
Note that every Stanley decomposition (R i , m i ) i∈I of M gives rise to the Hilbert decomposition (R i , deg m i ) i∈I . In the sequel, we will say that a Hilbert decomposition is induced by a Stanley decomposition if it arises in this way. Moreover, observe that, in general, the R-module structure of a Stanley decomposition is different from that of M, and that Hilbert decompositions depend only on the Hilbert series of M, i.e. they do not take the R-module structure of M into account.
Definition 2.2. The depth of a Hilbert (resp. Stanley) decomposition is the minimal dimension of the subalgebras R i in the decomposition. Equivalently, it is the depth of the right-hand side of (2) (resp. (1)), considered as R-module. The multigraded Hilbert depth (resp. the Stanley depth) of M is then the maximal depth of a Hilbert (resp. Stanley) decomposition of M. We write hdepth M and sdepth M for the multigraded Hilbert resp. Stanley depth.
We denote by the componentwise order on Z n and we set For the computation of the Hilbert resp. Stanley depth, one may restrict the attention to a certain finite class of decompositions. Let us briefly recall the details. The module M is said to be positively g-determined for g ∈ N n if M a = 0 for a / ∈ N n and the multiplication map ·X k : M a −→ M a+e k is an isomorphism whenever a k ≥ g k , see Miller [Mil00]. A characterization of positively g-determined modules is given by the following: In particular, if M has no components with negative degrees, then it is always g-determined for a sufficiently large g ∈ N n . For our purpose, the importance of M being positively g-determined is that it allows us to restrict the search space for possible Hilbert or Stanley decompositions, as we explain in the following.
For a given Hilbert decomposition (R i , s i ) i∈I of M and a multidegree a ∈ N n , let be the set of indices of those Hilbert spaces that contribute to degree a.
Proposition 2.4. Let M be a positively g-determined module. The following statements are equivalent for a Hilbert decomposition (K[Z i ], s i ) i∈I of M: (1) s i g for all i ∈ I.
(2) {j : (s i ) j = g j } ⊆ Z i for all i ∈ I.
(3) C(a) = C(a ∧ g) for all a ∈ N n . (Here, a ∧ g denotes the componentwise minimum.) (1)=⇒(2) Let i ∈ I and j ∈ [n] such that g j = (s i ) j . By assumption 1), it holds that ( Thus i ∈ C(s i ) = C(s i + e j ) and the claim follows.
(2) =⇒ (3) We first show that C(a ∧ g) ⊆ C(a) for a ∈ N n . Let i ∈ C(a ∧ g). It suffices to prove that for each j ∈ [n] with (s i ) j < a j , it holds that j ∈ Z i . Note that (s i ) j ≤ (a ∧ g) j for every j. Moreover, if (s i ) j < (a ∧ g) j then i ∈ C(a ∧ g) implies that j ∈ Z i . On the other hand, if (s i ) j = (a ∧ g) j and (s i ) j < a j , then (s i ) j = g j and thus j ∈ Z i by assumption. It follows that C(a ∧ g) ⊆ C(a).
Further, M being g-determined implies as above that |C(a)| = |C(a ∧ g)| and thus C(a) = C(a ∧ g).
(3) =⇒ (1) For each i ∈ I, it holds that i ∈ C(s i ) = C(s i ∧ g). Therefore s i s i ∧ g g.
(1) and (2) ⇐⇒ (4) This follows easily by considering the Betti numbers of Note that the conditions are not equivalent if M is not g-determined. Moreover, the existence of a Hilbert decomposition satisfying these conditions for some g ∈ N n does not imply that M is g-determined. Motivated by the preceding proposition we introduce the following: Definition 2.5.
(1) A Hilbert decomposition D of M is called g-determined if M is positively g-determined and D satisfies the equivalent conditions of Proposition 2.4.
Every Hilbert decomposition of M is g-determined for a sufficiently large g ∈ N n . On the other hand, for a fixed g ∈ N n there are only finitely many g-determined Hilbert decompositions. By the following result, it is essentially sufficient to consider g-determined Hilbert (Stanley) decompositions if M is g-determined: Proposition 2.6. Let M be positively g-determined.
(1) There exists a g-determined Hilbert decomposition of M whose depth equals the Hilbert depth of M. Proof. This is immediate from Corollary 3.4 and Corollary 4.7 of [IMF14], since the decompositions used there are g-determined.
3. Which Hilbert decompositions are induced by Stanley decompositions?
In this section we characterize those Hilbert decompositions which are induced by Stanley decompositions. Throughout the section, we fix a finitely generated Z ngraded R-module M and a Hilbert decomposition D = (R i , s i ) i∈I of M. Without loss of generality, we shall assume that both M and D are (positively) g-determined for some g ∈ N n . As above, we set For all i ∈ I we have that R i ∩ Ann m i = 0, and for all a ∈ N n , a g, the set The difficulty for applying this result is that one has to choose the right elements m i ∈ M s i in order to determine whether a given Hilbert decomposition is induced by a Stanley decomposition. In the following we present a method for circumventing this problem. The idea is to consider (for all i ∈ I) "generic" elementsm i ∈ M s i and to test (for all a ∈ [0, g]) the linear independence of the sets (3) via computations of determinants. We make this precise as follows.
Construction 3.2. For the given Hilbert decomposition (R i , s i ) i∈I of M, we construct a collection of matrices (A a ) a∈[0,g] as follows. First, for each a ∈ [0, g], we choose a basis {b a,1 , . . . , b a,la } for the K-vector space M a . Then, for each i ∈ I, we The matrix A a has one row for each of the basis vectors of M a and one column for each i ∈ C(a). For every such i, expand X a−s im i in the chosen basis of M a and write the coefficients into A a . More explicitly, if We set A a = ( j c j,k Y i,j ) i,k . For the ease of reference, we also set Note that the entries of A a are linear polynomials in the Y i,j . Moreover, the matrices A a are square matrices, because the number of rows equals dim M a , while the number of columns equals the cardinality of C(a). But this is also dim M a , as we started with a Hilbert decomposition.
Example 3.3. We give a simple example to illustrate the construction.
The module M is positively gdetermined for g = (1, 1). Let e 1 , e 2 be the generators of R 2 . We choose as vector space bases X 1 e 1 , X 2 e 1 , X 1 X 2 e 1 and X 1 X 2 e 2 for the corresponding components of M. Consider the Hilbert decomposition We havem 1 = Y 1,1 X 1 e 1 andm 2 = Y 2,1 X 2 e 1 . The matrices A a constructed above are in this case Next theorem is the main result of this paper. Proof. We use the characterization of Proposition 3.1. First, note that the assumption R i ∩ Ann m i = 0 in Proposition 3.1 is not really needed: If the sets are K-linearly independent for all a ∈ [0, g], then the fact that R i ∩Ann m i = 0 for all i follows automatically. To see this, assume for the contrary that R j ∩ Ann m j = 0 for some j. Then there exists a multidegree d ∈ N n such that X d m j = 0 and Then the set {X d ′ m i : i ∈ C(d ′ + s j )} contains the zero vector and therefore cannot be linearly independent.
Next, consider a choice of elements m i = j y i,j b s i ,j with (y i,j ) (i,j)∈Ĩ ⊂ K. We now observe that for a fixed a ∈ N n , the set {X a−s i m i : i ∈ C(a)} is K-linearly independent if and only if det A a ((y i,j ) (i,j)∈Ĩ ) = 0. Hence the elements m i build a Stanley decomposition if and only if a∈ If the field is infinite, then it is possible to choose such y i,j if and only if P := a∈[0,g] det A a is not the zero polynomial. This is clearly equivalent to each of the factors det A a being nonzero.
If K is finite, then P has a non-zero value over K |Ĩ| if and only if it is not contained . This set of generators is already a (universal) Gröbner basis, hence P is contained in the ideal if and only if its remainder modulo this Gröbner basis is zero, see Cox, Little, O'Shea [CLO07, p. 82, Corollary 2]. Clearly,P is the remainder of P with respect to this Gröbner basis, so the claim follows.
Note that this theorem gives an effectively computable criterion to decide whether a Hilbert decomposition is induced by a Stanley decomposition.
Remark 3.5. Let us add some remarks.
(1) We can say a little more about the structure of det A a . Endow the polynomial It follows from the definition that the entries of a column of A a corresponding to m i are homogeneous of degree e i . Hence det A a is a homogeneous polynomial (with respect to this grading) and its degree is a 0/1-vector. In particular, all monomials in det A a are squarefree.
(2) Consider the case that dim K M a ≤ 1 for all a ∈ Z n . Then, by the above remark, the single entry of A a is either zero or of the form cY i1 for some i ∈ I and c ∈ K \ {0}. Hence the Hilbert decomposition is induced by a Stanley decomposition if and only if none of the A a is the zero matrix. So, in this case our Theorem 3.4 specializes to [BKU10, Proposition 2.8]. In particular, the assumption that K is infinite can be removed from [Sta82, Conjecture 5.1] in the case that M is an R-module with dim K M a ≤ 1 for all a ∈ Z n . While this seems to be known, we could not find a precise reference for it.
In general, the case distinction on the cardinality of the field cannot be removed. In fact, if K is finite, then the condition that det A a = 0 for all a is not sufficient. On the positive side, we know that the determinants of the A a are polynomials with squarefree monomials. Hence, if they are nonzero, then they do not vanish identically even over a finite field. On the other hand, it might not be possible to find values for the Y i,j such that all determinants are nonzero simultaneously. The following example shows this phenomenon.
For later use, we note the following consequence of Theorem 3.4: Corollary 3.7. Assume that K is infinite and let (R i , s i ) i∈I be a Hilbert decomposition of M. Then (R i , s i ) i∈I is induced by a Stanley decomposition if and only if for each a ∈ N n , a g, there exists a linearly independent subset (m i ) i∈C(a) of M a , such that m i ∈ X a−s i M s i for i ∈ C(a).
Proof. The condition is clearly equivalent to the non-vanishing of the determinants of A a for a ∈ [0, g].

An algorithm for computing the Stanley depth of a module
In this section we describe how Theorem 3.4 can be used to effectively compute the Stanley depth of a given (finitely generated Z n -graded) module. We assume (as in Section 3) that M is a fixed finitely generated Z n -graded R-module and we fix g ∈ N n such that M is positively g-determined.
By Proposition 2.6, one only needs to consider g-determined Stanley decompositions. Hence the Stanley depth of M can be expressed as sdepth M = max depth D : D is a g-determined Hilbert decomposition of M which is induced by a Stanley decomposition. .
A key remark is that there are only finitely many g-determined Hilbert decompositions of M for a fixed g. To actually compute the Stanley depth using this formula, one needs to (1) iterate over all g-determined Hilbert decompositions D of M; and (2) decide whether D is induced by a Stanley decomposition of M.
An algorithm for the first task was presented in [IZ14, Algorithm 1]. In this section we shall follow this approach and we modify [IZ14, Algorithm 1], so that it may be used for computing the Stanley depth. We would like to remark at this point that an alternative approach for this first task is to use a description of the set of gdetermined Hilbert decompositions as the set of lattice points in a certain polytope.
We give a precise description of this polytope later, in Proposition 5.4. So, in fact one may use standard software to enumerate these points, for example SCIP [Ach09] or Normaliz [BI10,BIS12]. This idea for enumerating Hilbert decompositions was originally suggested by W. Bruns and described in Katthän [Kat14, Section 7.2.1].
For the second task, we suggest to apply Theorem 3.4. In order to make this effective, one has to choose bases for the components M a of M. One possibility is to choose standard monomials with respect to some Gröbner bases, cf. Eisenbud [Eis95,Theorem 15.3]. The computation of the matrices A a and their determinant can then be done using standard algorithms from constructive module theory. We refer to Chapter 15 of [Eis95] or Chapter 10.4 of Becker and Weispfenning [BW93]. A possible alternative for the second task is provided by Theorem 5.5.
Remark 4.1. For the case distinction of Theorem 3.4, one has to decide whether the field is finite or not. We describe one way to avoid this. With the notation introduced in Construction 3.2, let If the field is finite, one has to reduce P toP as described in Theorem 3.4, while in the infinite case one can directly use P . But even in the finite case, P equalsP if the largest exponent in P does not exceed the cardinality of K. Note that this is trivially true if K is infinite, so we can base the case distinction on the question whether the largest exponent in P exceeds the cardinality of K. As the algorithm in [IZ14] is formulated in terms of Hilbert partitions, we recall the necessary definitions from [IMF14].
Let Note that there are only finitely many Hilbert partitions of H M (t) g . On one hand, every Hilbert partition P induces a g-determined Hilbert decomposition D(P) by the following construction.
On the other hand, by Proposition 2.4, each g-determined Hilbert decomposition (K[Z i ], s i ) i∈I is induced by the Hilbert partition  The differences from [IZ14, Algorithm 1] appear at lines 1-4, 5, and in the usage of the extra parameters M, P, and q. The container P is used for storing the intervals in the Hilbert partitions that have been computed, and it can be initialized empty. The R-module structure of M is needed for computing the matrices A a (for all a ∈ [0, g]). Moreover, q is the cardinality of the field, which is needed for the reduction. Assuming that the reader is familiar with [IZ14, Algorithm 1], we describe below the new key steps of the algorithm: • line 1. If E is empty, then we have computed a complete Hilbert partition in P (since there are no elements in E to cover). Then we have to check using Theorem 3.4 whether the Hilbert decomposition D(P) is induced by a Stanley partition.
• line 2. The function ComputeDeterminantsProduct computes P (D(P)) as in Remark 4.1. Since P depends on the R-module structure of M, we have to pass it as a parameter. • line 3. Here we compute the reduction of P with respect to the cardinality q of the field. We point out that we can skip this step if K is infinite. • line 4. We apply Theorem 3.4, so we check whether P = 0. If the answer is positive, then we are done. We have reached a good leaf of the searching tree. • lines 5. The childP is generated here and further investigated in the recursive call.

Applications and Examples
In this section, we present several applications of Theorem 3.4. To simplify the discussion we assume throughout this section that |K| = ∞. where n is the number of variables. As sdepth m = ⌈ n 2 ⌉, we see that in order to use this upper bound, we need that the Stanley depth of m increases at least by two after adding any number of copies of the ring. The smallest n where this is possible is six. Indeed, an easy computation following Popescu [Pop15] shows that the Z-graded Hilbert depth of m 6 ⊕ R 9 equals 5, while sdepth Syz 1 R (m 6 ⊕ R 9 ) = sdepth Syz 1 R (m 6 ) ≤ 6 − ⌈ 6−2 3 ⌉ = 4 (see Uliczka [Uli10] for details about the Z-graded Hilbert depth). So M = m 6 ⊕ R 9 is our candidate for a counterexample.
We need to compute a Hilbert decomposition D of M with depth D = 5. Unfortunately, this module is already too large for the CoCoA implementation of the Algorithm in [IZ14]. By Proposition 2.4, it is enough to search for a g-Hilbert decomposition, where g = (1, 1, 1, 1, 1, 1). These decompositions are described by a system of linear Diophantine inequalities (see Section 5.2 for details) and we can solve the system with the software SCIP [Ach09]. This yields the Hilbert decomposition of M, which is summarized in Table 1. There, an entry such as 2 × [001111, 101111] is to be interpreted as two copies of the vector space K[X 1 , X 3 , X 4 , X 5 , X 6 ](0, 0, −1, −1, −1, −1) in the Hilbert decomposition.

In fact, every Hilbert decomposition of this module is induced by a Stanley decomposition.
Proof. Let M := m ⊕α ⊕ R ⊕β . Further, let e 1 , . . . , e α , f 1 , . . . , f β be the natural set of generators of R ⊕α ⊕ R ⊕β and consider M as a submodule of this module.
In every nonzero multidegree a ∈ N n , the elements X a e 1 , . . . , X a e α , X a f 1 , . . . , X a f β form a vector space basis of M a . Moreover, a vector space basis of M 0 is given by f 1 , . . . , f β . Now consider a Hilbert decomposition (R i , s i ) i∈I of M. We distinguish two kinds of summands in this decomposition. First, there are those i where s i = 0. Here we set m i := j Z ij f j and we call these generators of the first type. As we start from a Hilbert decomposition, it is clear that there are exactly dim M 0 = β generators of the first type. Further, for i with s i = 0 we set m i := j Y ij X s i e j + j Z ij X s i f j . We call these the generators of the second type.
Next we consider the corresponding matrices as in Theorem 3.4. In the multidegree 0, it is easy to see that A 0 is a generic (square) matrix in the variables Z ij , and thus its determinant is non-zero. So consider a multidegree a = 0. Both types of generators can contribute to M a , so the matrix A a has the following shape: Here u stands for the number of generators of the first type contributing to the multidegree a. Note that every entry on the antidiagonal of A a is non-zero. Indeed, because the sum of the indices of the matrix entries is α+β +1, while for every entry of the zero-block this sum is at most α + u ≤ α + β. Hence the antidiagonal gives a non-zero monomial in the Leibniz expansion of the determinant, and as all nonzero entries of the matrix are different variables, therefore cancelation cannot occur. Thus the determinant is non-zero and the claim follows from Theorem 3.4.
(1) Proposition 5.1 does not hold as stated for arbitrary ideals. Consider the case R = K[X 1 , X 2 ] and M = (X 1 X 2 ) ⊕ R. Then K ⊕ X 1 K[X 1 , X 2 ] ⊕ X 2 K[X 1 , X 2 ] is a Hilbert decomposition of M that is not induced by a Stanley decomposition.
(2) The result also does not hold if one adds shifted copies of the ring. Consider R = K[X 1 , X 2 ] and M = (X 1 , X 2 ) ⊕ R(−1, −1). Then X 1 K[X 1 , X 2 ] ⊕ X 2 K[X 1 , X 2 ] is a Hilbert decomposition of M which is not induced by a Stanley decomposition. In fact, by adding shifted copies of the ring, one can always obtain a Hilbert decomposition of Hilbert depth n for an arbitrary graded module M. For this, consider a finite free resolution of M, Then the sum of the Hilbert series of the even modules equals the Hilbert series of M plus the sum of the Hilbert series of the odd modules, so the former is a Hilbert decomposition of the latter.
Based on several examples, we conjecture the following strengthening of Proposition 5.1: Conjecture 5.3. For every number of variables and any α, β ∈ N, the Z-graded Hilbert depth [Uli10] and the Stanley depth of m ⊕α ⊕ R β coincide.

The set of g-determined Stanley decompositions.
In this section, we show that the set of all g-determined Stanley decompositions can be described by a (large) system of linear Diophantine inequalities, or, equivalently, by the set of Z n -lattice points inside a polytope P.
Consider a finitely generated N n -graded R-module M which is g-determined for some g ∈ N n . Let So, the set of g-determined Hilbert decompositions corresponds naturally to the set of Z n -lattice points in the polytope H of non-negative solutions to (5). The set of g-determined Stanley decompositions is a subset of this. By the following result, this subset may be defined by linear inequalities as well, i.e. the g-determined Hilbert decomposition of M which are induced by g-determined Stanley decompositions correspond to the Z n -lattice points in a certain polytope P. This is the main result of this subsection.
Theorem 5.5. A vector u ∈ N Ω corresponds to a g-determined Hilbert decomposition of M which is induced by a g-determined Stanley decomposition, if and only if it satisfies both (5) and in addition the following inequalities: Here, the sum on the right-hand side is a sum of vector spaces.
Remark 5.6. The system of inequalities (6) is rather large, so it does not seem to be feasible for the actual computation of the Stanley depth. However, the theorem shows that the set of all Stanley decomposition has a nice structure. Note that the integer solutions of (6) for a fixed a ∈ [0, g] form a discrete polymatroid, cf. Herzog and Hibi [HH02]. So the set of g-determined Stanley decompositions may also be seen as an intersection of discrete polymatroids with the polytope H.
The proof uses Rado's theorem, which we recall for the reader's convenience. Recall that a transversal of a set system A 1 , . . . , A r is a collection of pairwise different elements a 1 ∈ A 1 , a 2 ∈ A 2 , . . . , a r ∈ A r . We use the following variant of Rado's theorem.
Corollary 5.8. Let V be a vector space and V : V 1 , . . . , V s a collection of linear subspaces of V . For u ∈ N s , the following are equivalent: (1) There exists an independent transversal of V, i.e. a linearly independent family of vectors v 1 ∈ V 1 , v 2 ∈ V 2 , . . . , v s ∈ V s . (2) For each subset I ⊆ {1, . . . , s}, the following inequality holds: Here, the sum on the right-hand side is a sum of vector spaces.
Proof. The inequality is clearly necessary, so we only need to show the sufficiency. Let A i be a basis for V i , 1 ≤ i ≤ s. Consider the union M := i A i as a matroid. By Rado's theorem 5.7, A 1 , . . . , A s has an independent transversal if and only if . Hence the inequality in our claim is sufficient.
Proof of Theorem 5.5. Assume that u ∈ N Ω is indeed a g-determined Hilbert decomposition of the module M. By Corollary 3.7, the Hilbert decomposition u corresponds to a Stanley decomposition if and only if for each a ∈ [0, g], there are linearly independent elements (m(b, So in particular, the inequality in our claim is necessary. We apply the preceding Corollary 5.8 to the vector space M a and the collection (X a−b M b ) (b,Z,i)∈Λ of subspaces. For a subset I ⊂ Λ, consider

It clearly holds that
hence it suffices to consider subsets of the formĪ, and these are in bijection with subsets J ⊆ [0, a]. Hence our inequalities are also sufficient. 5.3. Rational Hilbert depth. In this subsection we introduce and study a new invariant, which we call rational Hilbert depth. Our motivation is the following.
Actually, one is interested in Stanley decompositions and the Stanley depth. Unfortunately, this invariant is very difficult to compute. So in [BKU10] the (multigraded) Hilbert depth was introduced as an approximation of the Stanley depth. It is conceptually simpler than the latter because it neglects the module structure and only depends on the Hilbert series of the module in question. As mentioned in [Kat14], computing the Hilbert depth amounts to solving the system (5) of linear inequalities over the non-negative integers.
More precisely, M has Hilbert depth ≥ r if and only if there exists a solution u ∈ N Ω of (5), such that u(b, Z) = 0 for all Z ⊆ [n] with |Z| < r and b ∈ [0, g]. We relax the integrality condition.
Definition 5.9. Let M be a finitely generated multigraded R-module. The rational Hilbert depth of M, denoted by rhdepth M, is defined to be the largest integer r such that there exists a non-negative rational solution u ∈ Q Ω ≥0 of (5), such that u(b, Z) = 0 for all Z ⊆ [n] with |Z| < r and b ∈ [0, g].
Equivalently, the rational Hilbert depth of M may be defined as the largest integer r such that the Hilbert series of M can be written as for polynomials p 1 , . . . , p l ∈ Q[t 1 , t −1 1 , . . . , t n , t −1 n ] with non-negative coefficients, and subsets I 1 , . . . , I l ⊆ [n] with |I i | ≥ r. We call such a decomposition of the Hilbert series a rational Hilbert decomposition of M.
Actually, the polynomials p 1 , . . . , p l that come from a solution of (5) satisfy certain bounds on their degrees. However, by [IMF14, Corollary 3.4] this does not affect the number r.
Remark 5.10. The computation of the rational Hilbert depth is much easier than the computation of the Hilbert depth, because solving linear inequalities over rational numbers is much easier than solving them over the integers. It is clear from the definition that every rational Hilbert decomposition of M gives rise to an actual Hilbert decomposition of M ⊕α for some α ∈ N. Hence rhdepth M = lim α→∞ hdepth M ⊕α .
So we expect the rational Hilbert depth to be still a reasonable approximation to the Stanley depth.
Let us compare the rational Hilbert depth with the Z-graded Hilbert depth (see [Uli10]), which we denote by hdepth 1 M. It is defined by specializing the multigrading to a Z-grading and then taking Hilbert decompositions. As it neglects the multigraded structure of the module, it is very easy to compute but sometimes it seems to fail to capture important aspects of the module. Note that the Z-graded Hilbert depth can be described by linear equations (according to [Uli10, Theorem 3.2]), so the "rational" version of hdepth 1 equals the usual hdepth 1 . Hence it follows that rhdepth M ≤ hdepth 1 M. We expect the rational Hilbert depth to be typically much closer to the actual Stanley depth than to the Z-graded Hilbert depth. Let us summarize the known relations among the invariants: The following result shows a direct relation between the Stanley depth and the rational Hilbert depth for an important class of modules. It is also our last application of Theorem 3.4.
Proof. The first claim immediately implies the second, so we will only show the former. In fact, every Hilbert decomposition of this module is induced by a Stanley decomposition. Let e 1 , . . . , e α be the natural set of generators of (R/J) ⊕α and consider M ⊕α as a submodule of this module. Consider a multidegree a ∈ N n , such that M a = 0. Then X a e 1 , . . . , X a e α form a vector space basis of (M ⊕α ) a . Now let (R i , s i ) i∈I be a Hilbert decomposition of M ⊕α . For each i we set m i := j Y ij X s i e i . It is clear that for each multidegree a ∈ N n with (M ⊕α ) a = 0, the matrix A a is a generic matrix in some of the Y ij , so its determinant is non-zero.
Example 5.12. We give two examples which show that the rational Hilbert depth may indeed be different from the Hilbert depth and the Z-graded Hilbert depth.
It is clear that H can be realized as Hilbert function of a module M over a polynomial ring in six variables R = K[X 1 , Y 1 , Z 1 , X 2 , Y 2 , Z 2 ]. For example, one can consider the following R-module: Obviously the Hilbert depth of M is at least 1. In fact, it is exactly one. It is easy to see by inspection that there is no Hilbert decomposition of M of Hilbert depth 2. On the other hand, the second representation of H gives a rational Hilbert decomposition of M. As dim M = 2, the rational Hilbert depth of M is 2. So we have hdepth M = 1 < 2 = rhdepth M.
Note that in the second example above, the degree 0 component of M has dimension three. We wonder if this is necessary: Question 5.13. Is there a module M with dim K M a ≤ 1 for all a ∈ N n , such that rhdepth M = hdepth M?
There is also a natural version of the Stanley conjecture for the rational Hilbert depth: Conjecture 5.14. Let M be a finitely generated multigraded R-module. Then depth M ≤ rhdepth M. By (7) the above conjecture is weaker than the analogue conjecture for the multigraded Hilbert depth formulated in [BKU10,Equation 2.2], which in turn is weaker than [Sta82, Conjecture 5.1], so one may expect that is easier to prove. However, we do not think that it admits a straightforward proof as the similar result for the graded Hilbert depth discussed in [BKU11, Theorem 1.1].