The unreasonable ubiquitousness of quasi-polynomials

A function g, with domain the natural numbers, is a quasi-polynomial if there exists a period m and polynomials p_0,p_1,...,p_{m-1} such that g(t)=p_i(t) for t=i mod m. Quasi-polynomials classically -- and"reasonably"-- appear in Ehrhart theory and in other contexts where one examines a family of polyhedra, parametrized by a variable t, and defined by linear inequalities of the form a_1x_1+...+a_dx_d<= b(t). Recent results of Chen, Li, Sam; Calegari, Walker; and Roune, Woods show a quasi-polynomial structure in several problems where the a_i are also allowed to vary with t. We discuss these"unreasonable"results and conjecture a general class of sets that exhibit various (eventual) quasi-polynomial behaviors: sets S_t of d-tuples of natural numbers that are defined with quantifiers ("for all","there exists"), boolean operations (and, or, not), and statements of the form a_1(t)x_1+...+a_d(t)x_d<= b(t), where a_i(t) and b(t) are polynomials in t. These sets are a generalization of sets defined in the Presburger arithmetic. We prove several relationships between our conjectures, and we prove several special cases of the conjectures. The title is a play on Eugene Wigner's"The unreasonable effectiveness of mathematics in the natural sciences''.


Reasonable Ubiquitousness
In this section, we survey classical appearances of quasi-polynomials (though Section 1.3 might be new even to readers already familiar with Ehrhart theory). In Section 2, we survey some recent results where the appearance of quasi-polynomials is more surprising. In Section 3, we make several conjectures generalizing these "unreasonable" results. We state theorems relating these conjectures and state theorems proving certain cases. In particular, we conjecture that any family of sets S t -defined with quantifiers (∀, ∃), boolean operations (and, or, not), and statements of the form a(t) · x b(t) (where a(t) ∈ Z[t] d , b(t) ∈ Z[t], and · is the standard dot product) -exhibits eventual quasi-polynomial behavior, as well as rational generating function behavior. Of course, reasonable people may disagree on what is unreasonable; the title is a play on Eugene Wigner's "The unreasonable effectiveness of mathematics in the natural sciences" [18]. All proofs are contained in Section 4. We use bold letters such as x = (x 1 , . . . , x d ) to indicate multi-dimensional vectors.
is a quasi-polynomial with period 2.
This example makes it clear that the ubiquitousness of quasi-polynomials shouldn't be too surprising: anywhere there are floor functions, quasi-polynomials are likely to appear.
This motivates the definition of a multivariate quasi-polynomial; "residues modulo a period" are replaced by "cosets of a lattice": Definition 1.4. g : N n → Q is a (multivariate) quasi-polynomial if there exists an ndimensional lattice Λ ⊆ Z n , a set {λ i } of coset representatives of Z n /Λ, and polynomials p i ∈ Q[t] such that g(t) = p i (t), for t ∈ λ i + Λ.
We will generally be concerned with integer-valued quasi-polynomials, those quasipolynomials whose range lies in Z. Note that Examples 1.2 and 1.3 demonstrate that such quasi-polynomials may still require rational coefficients.

Ehrhart theory
Perhaps the most well-studied quasi-polynomials are the Ehrhart quasi-polynomials: Theorem 1.5 (Ehrhart [8]). Suppose P is a polytope (bounded polyhedron) whose vertices have rational coordinates. Let g(t) be the number of integer points in tP , the dilation of P by a factor of t. Then g(t) is a quasi-polynomial, with period the smallest m such that mP has integer coordinates.
Writing tP from this example as (x, y) ∈ R 2 : 2x t, y − x 0, −y 0 suggests a way to generalize this result: for t ∈ N n , let S t be the set of integer points, x ∈ Z d , in a polyhedron defined with linear inequalities of the form a · x b(t), where a ∈ Z d and b(t) ∈ Z[t] is linear.
For a fixed (s, t), S s,t is the set of integer points in a polyhedron in R 2 . As (s, t) varies, the "constant" term of these inequalities change, but the coefficients of x and y do not; in other words, the normal vectors to the facets of the polyhedron do not change, but the facets move "in and out". In fact, they can move in and out so much that the combinatorial structure of the polyhedron changes. Figure 1 shows the combinatorial structure for different (s, t) ∈ N 2 . Using various methods, Beck [3] and Verdoolaege and Woods [17] compute that In this example, the function g(s, t) is a quasi-polynomial, at least on pieces of parameter-space for which the combinatorial type is constant. Definition 1.8. A function g : N n → Q is a piecewise quasi-polynomial if there exists a finite partition i (P i ∩N n ) of N n with P i polyhedra (which may not all be full-dimensional) and there exist quasi-polynomials g i such that Sturmfels [15] effectively proved the following generalization of Ehrhart theory: Theorem 1.9. Let S t be the set of integer points, x ∈ Z d , in a polyhedron defined with linear inequalities of the form a · x b(t), where a ∈ Z d and b(t) ∈ Z[t] is linear. Then g(t) = |S t | is a piecewise quasi-polynomial. Remark 1.10. Sections 2 and further will predominantly be concerned with univariate functions. Being a univariate piecewise quasi-polynomial g : N → Q is equivalent to eventually being a quasi-polynomial; that is, there exists a T such that for all t T , g(t) agrees with a quasi-polynomial.

Generating functions
Many classical proofs of Ehrhart's Theorem (Theorem 1.5) use generating functions. To prove that a function g(t) is a quasi-polynomial of period m, it suffices (see Section 4.4 of Stanley [14]) to prove that the Hilbert series t∈N g(t)y t can be written as a rational function of the form p(y) where p(y) is a polynomial of degree less than md. For g(t) = |tP ∩Z 2 | with P the triangle in Example 1.6, we can see that t∈N g(t)y t = 1 + y + 3y 2 + 3y 3 + 6y 4 + · · · = 1 + y Indeed, these proofs of Ehrhart's Theorem start by considering the generating function and substituting in x = (1, . . . , 1) to get the Hilbert series. For P in Example 1.6, t∈N,s∈tP ∩Z 2 , as can be checked by expanding as a product of infinite geometric series. Substituting x 1 = x 2 = 1 yields the Hilbert series in (2). Definition 1.11. We call any generating function or Hilbert series a rational generating function if it can be written in the form where p is a Laurent polynomial over Q and b i ∈ Z d are lexicographically positive (first nonzero entry is positive).
While we will generally be assuming that the generating functions are for subsets of N d , we need b i to be lexicographically positive rather than simply in N d \{0} for examples like the following: Example 1.12. Let S = (x, y) ∈ N 2 : x + y = 1000 . While y 1000 + xy 999 + · · · + x 1000 is a legitimate rational generating function, it makes more sense to write it as Remark 1.13. Having b lexicographically positive guarantees that 1/(1 − x b ) = 1 + x b + x 2b + · · · is the Laurent series convergent on a neighborhood of a .
= (e −ε , e −ε 2 , . . . , e −ε d ), for sufficiently small ε, as follows: Let b i > 0 be the first nonzero coordinate of b. Then For sufficiently small ε, the −ε i b i term dominates, and ln(a b ) < 0. This implies that |a b | < 1, and indeed 1 + x b + x 2b + · · · does converge on a neighborhood of a.
Remark 1.14. If b is lexicographically negative, then we may instead write Several classic results start with a simple generating function, and use it to find quasipolynomial behavior. Definition 1.15. Given a 1 , . . . , a d ∈ N n , the vector partition function g : N n → N is defined by that is, the number of ways to partition the vector t into parts taken from {a i }.
The generating function t∈N n g(t)y t can be written as obtained by rewriting the rational function as a product of infinite geometric series. The following is proved by Sturmfels [15]: Theorem 1.16. Any vector partition function is a piecewise quasi-polynomial.
See Beck [3] for a self-contained explanation utilizing the partial fraction expansion of the rational function. For example, if a 1 = 1 and a 2 = a 3 = 2, then the vector partition function is encoded by the generating function We saw previously that this generating function corresponds to the quasi-polynomial in Example 1.6.
In Section 3, we will use a different generating function: for fixed t, examine the generating function s∈tP ∩Z d x s . Example 1.17. In the triangle from Example 1.6, this gives us We can write this more compactly as which we can verify directly by expanding the fractions as products of geometric series. Given this generating function, we can count the number of integer points in tP by substituting in x = (1, . . . , 1). Substituting x 1 = x 2 = 1 into (3), we see that (1, 1) is a pole of these fractions. Fortunately, getting a common denominator and applying L'Hôpital's rule to find the limit as x 1 and x 2 approach 1 will work, and it is evident that the differentiation involved in L'Hôpital's rule will yield a quasi-polynomial in t as the result; careful calculation will show that it matches (1).
In general, Proposition 2.11 of Verdoolaege and Woods [17] or Theorem 4.4 of Barvinok and Pommersheim [2] both give an algorithmic version of the following theorem: Theorem 1.18. For t ∈ Z n , let S t be the set of integer points, x ∈ Z d , in a polyhedron defined with linear inequalities of the form a · x b(t), where a ∈ Z d and b(t) ∈ Z[t] is linear. Then there is a finite decomposition of Z n into pieces of the form P ∩ Z n (with P a polyhedron) such that, considering the t in each piece separately, where i = ±1, the coordinates of u i are linear quasi-polynomials in t, and d ij ∈ Z d \ {0}.
A key step in proving Theorem 1.18 is Brion's Theorem [5] (see Chapter 9 of Beck and Robins [4] for a proof and discussion), which reduces computing generating functions for polyhedra to computing generating functions for cones: Theorem 1.19 (Brion's Theorem). Let P be a polyhedron in the nonnegative orthant R d 0 . For each vertex v of P , define its vertex cone C v to be the set of points in R d satisfied by those inequalities defining P that are equalities at v. Then Note that, for different vertices v, the s∈Cv∩Z d x s may converge on different neighborhoods. If they are written as rational functions, Remarks 1.13 and 1.14 fix this problem. Example 1.20. For S = (x, y) ∈ N 2 : x + y = 1000 from Example 1.12, the two vertex cones are as seen in Example 1.12.
Example 1.21. The triangle from Example 1.6 has three vertex cones. Brion's Theorem applied to tP ∩ Z 2 is illustrated in (3), with Remark 1.14 already applied.
Remark 1.22. Note that Brion's Theorem is often stated for polyhedra in R d (unrestricted to the nonnegative orthant). If the polyhedron contains straight lines, one must be more careful when talking about generating functions. For example, the set Z has generating function See, for example, Barvinok [1] for more details. In this paper, we will constrain the sets that we are interested in to be nonnegative, to avoid issues like this.

Presburger arithmetic
So far, our examples have been integer points in polyhedra. A key property of such sets is that they can be defined without quantifiers. However, even for sets defined with quantifiers, we end up with reasonable appearances of quasi-polynomials.
Definition 1.23. A Presburger formula is a boolean formula with variables in N that can be written using quantifiers (∃, ∀), boolean operations (and, or, not), and linear (in)equalities in the variables. We write a Presburger formula as F (u) to indicate the free variables u (those not associated with a quantifier).
We can compute that This set has several properties, cf. Section 3: 1. The set of t such that S t is nonempty is {3, 5, 7, . . .}. This set is eventually periodic.

The cardinality of S t is
which is eventually a quasi-polynomial of period 4.
3. When S t is nonempty, we can obtain an element of S t with the function x(t) = t + 1, and x(t) is eventually a quasi-polynomial.
3a. More strongly, when S t is nonempty, we can obtain the maximum element of S t with the function x(t) = (5t − 3)/4 , and x(t) is eventually a quasi-polynomial.

We can compute the generating function
We see that, for fixed t, this generating function is a rational function. Considering each residue class of t mod 4 separately, the exponents in the rational function can eventually be written as polynomials in t.
Versions of these properties always hold for sets defined in Presburger arithmetic. For example, Woods [19] gave several properties of Presburger formulas that hold even for sets defined with multivariate parameters, t ∈ N n : Theorem 1.25 (from Theorems 1 and 2 of Woods [19]). Suppose F (s, t) is a Presburger formula, with s and t collections of free variables. Then x s y t is a rational generating function, and • t∈N n g(t)y t is a rational generating function.
Property 4 from Example 1.24 can be proved in general by using Theorem 1.25 to write s,t:F (s,t) x s y t as a rational generating function and applying Theorem 3.6. The proof of Theorem 3.3 then shows that all of the other properties follow.

Unreasonable Ubiquitousness
We now turn to the inspiration for this paper. Three recent results exhibit quasipolynomial behavior, in situations that seem "unreasonable". In particular, all three involve sets S t defined by inequalities of the form a(t) · x b(t), where a(t) is a polynomial in t; that is, the normal vectors to the facets change as t changes. First we give an example showing that, unlike in Section 1, it is now important that we restrict to only one parameter, t.
There is no hope for simple quasi-polynomial behavior here, as the cardinality depends on the arithmetic relationship of s and t.

Three results
This first result most directly generalizes Ehrhart Theory. Chen, Li, and Sam [7] prove that, if S t is the set of integer points in a polytope defined by inequalities of the form a(t) · x b(t), then |S t | is eventually a quasi-polynomial.
Theorem 2.2 (Theorem 2.1 of Chen et al. [7]). Let A(t) be an r × d matrix and b(t) be a column vector of length r, all of whose entries are in Then |P t ∩ Z 2 | is given by the quasi-polynomial Note that Theorem 2.2 can be equivalently phrased (Theorem 1.1 of Chen et al. [7]) using equalities A(t)x = b(t), where x is constrained to be nonnegative, or it can be phrased (Theorem 1.4 of Chen et al. [7]) by listing the vertices of P t as rational functions of t.
Calegari and Walker [6] were similarly concerned with the integer points in polyhedra defined by A(t)x b(t). Rather than counting |P t ∩ Z d |, they wanted to find the vertices of the integer hull of P t , that is, the set of vertices of the convex hull of P t ∩ Z d .
Theorem 2.4 (Theorem 3.5 of Calegari and Walker [6]). Let v i (t) be vectors in Q d whose coordinates are rational functions of size O(t), and let P t be the convex hull of the v i (t). Then there exists a modulus m and functions p ij : N → Z d with polynomial coordinates such that, for 0 i < m and for sufficiently large t ≡ i mod m, the set of vertices of the integer hull of Example 2.5. Consider the twisting square, P t , from Example 2.3. When t is even, the vertices of P t are integers, so the vertices of the integer hull are simply the vertices of P t : When t is odd, the integer hull of P t is an octagon (pictured in Figure 2b for t = 5) with vertices Theorem 2.4 could be similarly phrased using facet definitions of the polyhedra, rather than vertex definitions. That the vertices are O(t) (grow no faster that ct for some constant c) is important for the proof, though Calegari and Walker conjecture that the theorem still holds without this restriction.
A third recent result concerns the Frobenius number.
Definition 2.6. Given a 1 , . . . , a d ∈ N, let S be the semigroup generated by the a i , that is, If the a i are relatively prime, then S contains all sufficiently large integers, and the Frobenius number is defined to be the largest integer not in S.
Now we let a i = a i (t) vary with t. Roune and Woods [13] prove that, if the a i (t) are linear functions of t, then the Frobenius number is eventually a quasi-polynomial, and they conjecture that this is true if the a i (t) are any polynomial functions of t: be linear and eventually positive. Then the set of t such that the a i (t) are relatively prime is eventually periodic, and, for such t, the Frobenius number is eventually given by a quasi-polynomial.
Example 2.8. Consider a 1 (t) = t, a 2 (t) = t + 3. These are relatively prime exactly when t ≡ 1, 2 mod 3. Since there are only two generators, a well-known formula (seemingly due to Sylvester [16]) gives that the Frobenius number is Note that Theorem 2.7 utilizes sets defined with quantifiers; Presburger arithmetic seems a good place to look for generalizations encompassing these three results.
These are both useful results, and only slightly different. For example, suppose f (t) = 2t − 3 and g(t) = t. Then Statement 1 is a traditional polynomial division algorithm: f = 2g+−3. Statement 2, however, is a numerical division algorithm: f = 1g+(t−3), and the remainder t − 3 is between 0 and g as long as t 3. In other words, if we have found q 1 and r 1 , but we eventually have r 1 (t) < 0, then we should use quotient q 2 = q 1 − sgn(g) and remainder r 2 = |g| + r 1 instead, as eventually 0 |g(t)| + r 1 (t) < |g(t)|.
The main subtlety in proving Statement 1 of this theorem is the following: Suppose f (t) = t 2 +3t and g(t) = 2t+1. Then the leading coefficient of g does not divide the leading coefficient of f , and the traditional polynomial division algorithm would produce quotients that are not integer-valued. Instead, we look at t modulo the leading coefficient of g; for example, if t is odd, so t = 2s+1 for some s ∈ N, substituting gives f (2s+1) = 4s 2 +10s+3 and g(2s + 1) = 4s + 3, and now the leading term does divide evenly.
The division algorithm in hand, one can prove some stronger results: Theorem 2.10 (Euclidean Algorithm and gcds). Let f and g be integer-valued quasipolynomials. Then there exists integer-valued quasi-polynomials p(t), q(t), and This is obtained by repeated applications of the division algorithm.
Similarly, repeated application of the Euclidean algorithm can produce the Hermite or Smith normal forms of matrices. We won't define those here, but they are important, for example, in producing a basis for lower-dimensional sublattices of Z d (see Newman [10]). Theorem 2.12 (Hermite/Smith Normal Forms). Given a matrix A(t) with integer-valued quasi-polynomial entries, the Hermite and the Smith Normal forms, as well as their associated change-of-basis matrices, also have quasi-polynomial entries.
The following theorem is obvious, but is repeatedly used.
Repeated use of this property, for example, shows that the combinatorial structure of a polyhedron P t eventually stabilizes, when P t is defined by A(t)x b(t): Theorem 2.14 (Stabilization). Let A(t) be an r × d matrix and b(t) be a column vector of length r, all of whose entries are in Z[t], and let P t = {x ∈ R d : A(t)x b(t)}. For sufficiently large t, the set of vertices of P t are given by rational functions v i (t), and the combinatorial type of P t (the subsets of vertices lying on common faces) is constant.
Note that the vertices in this result are rational functions of t: a vertex will be a point where several of the inequalities are equalities, i.e., the solution to some A (t)x = b (t), where A (t) is a full-rank d × d matrix of polynomials in t. Solving for x using the adjunct matrix of A will result in x(t) given as a rational function of t.
For large t, the behavior of a rational function is predictable: . Then f (t)/g(t) converges to a polynomial, and f (t)/g(t) is eventually a quasi-polynomial.

Conjectures
Let S t , for t ∈ N, be a family of subsets of N d . We now discuss some properties that it would be nice (though unreasonable!) for such sets to have, cf. Example 1.24.

Property 1:
The set of t such that S t is nonempty is eventually periodic.
This is the weakest of the properties we will discuss, but an important one, as it is related to the decision problem -"Is there a solution?" Property 2: There exists a function g : N → N such that, if S t has finite cardinality, then g(t) = |S t |, and g(t) is eventually a quasi-polynomial. The set of t such that S t has finite cardinality is eventually periodic.
This is the property found in Theorem 2.2, where S t is the set of integer points in a polytope defined by inequalities of the form a(t) · x b(t). Theorems 2.4 and 2.7, on the other hand, are not about counting points but about finding points: Property 3: There exists a function x : N → N d such that, if S t is nonempty, then x(t) ∈ S t , and the coordinate functions of x are eventually quasi-polynomials. The set of t such that S t is nonempty is eventually periodic.
This function x(t) acts as a certificate that the set is nonempty. But we may want to go further and pick out particular elements of S t : Property 3a: Given c ∈ Z d \ {0}, there exists a function x : N → N d such that, if max y∈St c · y exists, then it is attained at x(t) ∈ S t , and the coordinate functions of x are eventually quasi-polynomials. The set of t such that the maximum exists is eventually periodic.
This corresponds to Theorem 2.7, where we want to find the Frobenius number, the maximum element of the complement of the semigroup. On the other hand, we may want to list multiple elements of the set: Property 3b: Fix k ∈ N. There exist functions x 1 , . . . , x k : N → N d such that, if |S t | k, then x 1 (t), . . . , x k (t) are distinct elements of S t , and the coordinate functions of x i are eventually quasi-polynomials. The set of t such that |S t | k is eventually periodic.
If there is a uniform bound on |S t |, then this property can be used to enumerate all elements of S t , for all t. This is the content of Theorem 2.4. Property 2 is about counting all solutions and Properties 3/3a/3b are about obtaining specific solutions, and so they seem somewhat orthogonal to each other. The following property, we shall see, unifies them: Property 4: There exists a period m such that, for t ≡ i mod m, where α ij ∈ Q, and the coordinate functions of q ij , b ij : N → Z d are polynomials with the b ij (t) lexicographically positive.
For what sets S t can we hope for these properties to hold? Here is a candidate: We conjecture that these properties do, in fact, hold for any parametric Presburger family: Conjecture 3.2. Let S t be a parametric Presburger family. Then Properties 1, 2, 3, 3a, 3b, and 4 all hold.
Note that one can define a family S t of subsets of Z d rather than of N d , but care must be taken with generating functions; see Remark 1.22.
As evidence that Property 4 is interesting, we will show that it generalizes both 2 and 3/3a/3b: Theorem 3.3. Let S t be any family of subsets of N d . We have the following implications among possible properties of S t .
As a final relationship between these properties, we note that, for the class of parametric Presburger families, 3, 3a, and 3b are equivalent: Theorem 3.4 is a weaker implication than Theorem 3.3, which holds for a single family S t in isolation. To prove that 3 "implies" 3a and 3b, on the other hand, we will need to create new families S t using additional quantifiers or boolean operators, and we need to know that these new families still have Property 3.
Finally, we give evidence that these properties might actually hold. We can show that they all hold for two broad classes of parametric Presburger families: Theorem 3.5. Suppose S t is a parametric Presburger family such that either (a) S t is defined without using any quantifiers, or (b) the only inequalities used to define S t are of the form a · x b(t), where b(t) is a polynomial (that is, the normal vectors to the hyperplanes must be fixed).
We isolate a piece of the proof of Part (b), in order to point out that Property 4 is a weaker property than we might hope for, but seems to be as strong a property as we can get. Indeed, we might hope that t∈N,s∈St x s y t is a rational generating function. Theorem 1.25 shows that this is true for sets defined in the normal Presburger arithmetic, and the following theorem shows that this implies Property 4. Theorem 3.6. Suppose S p , for p ∈ N n , is a family of subsets of N d . If p∈N n ,s∈Sp x s y p is a rational generating function, then there is a finite decomposition of N n into pieces of the form P ∩ Z n (with P a polyhedron) such that, considering the p in each piece separately, where i = ±1, b ij ∈ Z d are lexicographically positive, and the coordinate functions of q i : N n → Z d are linear quasi-polynomials in p.
In general, however, t∈N,s∈St x s y t will not be a rational generating function: Example 3.7. Let S t be the set {(s 1 , s 2 ) ∈ N 2 : ts 1 = s 2 }. Then is a rational generating function with exponents depending on t, so Property 4 is satisfied. Nevertheless, t∈N,s∈St cannot be written as a rational function. To prove that it cannot be so written, note that the set (s 1 , s 2 , t) : s ∈ S t cannot be written as a finite union of sets of the form P ∩ (λ + Λ), where P is a polyhedron, λ ∈ Z 3 and Λ ⊆ Z 3 is a lattice; Theorem 1 of Woods [19] then implies that t∈N,s∈St x s y t is not a rational generating function.

Proofs
Because of dependencies among these proofs, we present them out of numerical order. We first prove Theorem 3.6. Then we prove that Property 4 holds for the sets given in Theorem 3.5. Next we prove Theorem 3.3. The rest of the properties in Theorem 3.5 are an immediate corollary. Finally, we prove Theorem 3.4.

Proof of Theorem 3.6
We want to compute the coefficient of y p as a rational generating function in x. We can reduce to computing the coefficient of y p for a single term of the form where q, c i ∈ N d , r, d i ∈ N n , and c i , d i are nonzero: indeed, by the assumption that p∈N n ,s∈Sp x s y p is a rational generating function, it can be written as a linear combination of such terms as (4), so we could examine each such term separately and then apply the linear combination.
Let p ∈ N n be fixed. Expanding (4) as a product of geometric series, we see that we get a term x s y p exactly when there exist λ i ∈ N such that Define the parametric polyhedron Then (5) tells us that, for every λ ∈ Q p ∩ Z k , we will get a monomial x q+ i λ i c i y p in the expansion of (4), and therefore Theorem 1.18 implies that there is a finite decomposition of Z n into pieces of the form P ∩ Z n (with P a polyhedron) such that, considering the p in each piece separately, where i = ±1, the coordinates of u i are linear quasi-polynomials in p, and b ij ∈ Z d are lexicographically positive. Substituting z i = x c i and multiplying by x q yields λ∈Qp∩Z k x q+ i λ i c i . This is the desired generating function, s∈Sp x s , in the form required by the theorem.

Proof of Property 4 in Theorem 3.5
Part (a): We want to apply a key idea of Chen et al. [7,Lemma 3.2], but first we need to simplify by reducing our problem (that of showing Property 4 holds for any quantifier-free Presburger formula) to simpler ones.
Let the set of inequalities used in the quantifier-free Presburger formula be given by {a i (t) · x b i (t)}, 1 i n. Our domain N d is partitioned into (at most) 3 n pieces, as follows: to create a piece, for each i, choose either , and let a piece of the partition be the set of x satisfying the conjunction of these (in)equalities. Within each piece, either all points will satisfy the Presburger formula or all will fail to satisfy the Presburger formula. It suffices to prove Property 4 for one of these pieces that satisfy the Presburger formula, because the final generating function is simply a sum of the generating functions of these pieces. These pieces are polyhedra (since we are looking at integer points, we may replace the open a i (t) · x < b i (t) with the closed a i (t) · x b i (t) − 1), so it suffices to prove Property 4 for polyhedra, P t , defined with equations of the form a(t) · x b(t).
We still can't apply Chen et al. [7], because that will only apply to bounded polyhedra. For sufficiently large t, Theorem 2.14 shows that the combinatorics of the vertex cones of P t stabilize. Since Theorem 1.19 (Brion's Theorem) gives that the generating function for P t is the sum of the generating functions for these vertex cones, it suffices to prove Property 4 for such cones where the coordinates of v are rational functions and the coordinates of u i are polynomials. Now take Π t to be the fundamental parallelepiped of K t , that is, and note that .
It therefore suffices to prove Property 4 for Π t , which is a bounded polyhedron, so Chen et al. [7] finally applies, as follows. Given k, define the map ψ : Then Lemma 3.2 of Chen et al. [7] states that, for some k and some R t ⊆ Z d(k+1) , ψ : R t → Π t ∩ Z d is a bijection, and furthermore that R t can be defined as the disjoint union of the integer points in polyhedra which satisfy particular linear inequalities of the formā ·x b(t), is linear, andā no longer depends on t. Then Theorem 1.18 shows that (for sufficiently large t so that the combinatorial structure of this set stabilizes) where = ±1, the coordinates of u i are linear quasi-polynomials in t, and d ij ∈ Z d(k+1) are nonzero. Substitutingx ij = x t j i into a monomialxs gives i,j Therefore substitutingx ij = x t j i into (6) shows that s∈Πt∩Z d x s has Property 4, as desired.
Part (b): Let the set of inequalities used in the Presburger formula be given by {a i · x b i (t)}, 1 i n. For the moment, replace each b i (t) with a single variable p i , so that we have a Presburger formula F (x, p), defined using inequalities a i · x p i . Let Theorem 1.25 implies that p∈N n ,s∈Sp x s y p is a rational generating function. Theorem 3.6 then implies that there is a finite decomposition of N n into pieces of the form P ∩ Z n (with P a polyhedron), such that, considering the p in each piece separately, where i = ±1, d ij ∈ Z d are lexicographically positive, and the coordinate functions of q i are linear quasi-polynomials in p. For sufficiently large t, the vector b 1 (t), . . . , b n (t) eventually stays in one of these pieces of the decomposition. Therefore, we may substitute p = b 1 (t), . . . , b n (t) into the appropriate generating function. This proves Property 4 for S t .

Proof of Theorem 3.3
2 ⇒ 1 : Suppose g(t) = |S t | is eventually a quasi-polynomial. Let m be a period and p i (t) be polynomials such that, eventually, g(t) = p i (t) for t ≡ i mod m. Let I be the indices i such that p i is not identically 0. For i ∈ I, we have |S t | = p i (t) > 0 for sufficiently large t, so, eventually, S t is nonempty if and only if t mod m is in I.
3 ⇒ 1 : Property 1 is in the definition of Property 3.
3a ⇒ 3 : Take c = (−1, . . . , −1). Then S t ⊆ N d is nonempty if and only if c · y has a maximum on S t . By property 3a, the set of such t is eventually periodic, and when nonempty, 3a gives an element x(t) ∈ S t . 3b ⇒ 3 : Property 3 is Property 3b with k = 1.
4 ⇒ 2 : Let f (x) = s∈St x s . Let us examine a particular residue class, so that, for sufficiently large t ≡ i mod m, we have where α j ∈ Q, and the coordinate functions of q j , b j : N → N d are polynomials. When f is defined at (1, . . . , 1), f (1, . . . , 1) = |S t | < ∞, and when f has a pole at (1, . . . , 1), S t has infinite cardinality. So we attempt to compute lim x→1 f (x), letting x j → 1 one variable at a time, repeatedly using L'Hôpital's rule. We will repeatedly take partial derivatives of the numerator (and denominator) and set some of the x j to 1. At each point, we will see that the numerator (and denominator) will look like where β j and the coordinate functions of r j are polynomials, andx is a subset of the variables of x. Our base case, f , certainly has numerator and denominator of this form.
Note that, at each step, we may simplify (7) so that the r j are distinct polynomials and the β j are not identically zero. Then for sufficiently large t,x r j (t) are distinct monomials and β j (t) are nonzero. Therefore g(x) is either a nonzero polynomial inx for all sufficiently large t or identically zero for all sufficiently large t.
Starting with x 1 , we substitute x 1 = 1 into the numerator and denominator of f . If both are eventually nonzero, we continue to x 2 . If the numerator is eventually nonzero but the denominator is eventually zero, then (1, . . . , 1) is eventually a pole of f (x), meaning that for sufficiently large t ≡ i mod m, |S t | is infinite. If the numerator is eventually zero but the denominator is eventually nonzero, then |S t | = f (1, . . . , 1) = 0. If both the numerator and denominator are eventually 0, then we apply L'Hôpital's rule, taking the derivatives of the numerator and denominator with respect to x 1 . Our new numerator and denominator will continue having the form (7).
We continue with x 1 in this way, and then continue with x 2 , etc., until we have either established that |S t | is infinite for all t ≡ i mod m, zero for all t ≡ i mod m, or we have eliminated all of the variables among x. In this last case, the numerator and the denominator of the result are still in the form (7), so we must have To conclude, we need to show that g(t)/h(t) must actually be a polynomial. Indeed, this follows from the fact that g(t)/h(t) must always be an integer, |S t |: Apply the standard polynomial division algorithm in Q[t] so that with deg r < deg h. Let n be a common multiple of the denominators of the coefficients of q(t), so that nq(t) is always an integer. Since ng(t)/h(t) is always an integer, nr(t)/h(t) must also always be an integer. Since deg r < deg h, eventually |nr(t)/h(t)| < 1, so the only possibility is that r = 0. Then |S t | = g(t)/h(t) = q(t) is a polynomial (for t ≡ i mod m), and we have proven Property 2.

⇒ 3a :
Without loss of generality, assume c 1 = 0 (otherwise, reorder the variables). Define the map φ : Since c 1 = 0, this map is injective, and therefore the map is bijective from S t onto its image φ(S t ).
Assume that c · x has a maximum on S t . Then φ(S t ) has a unique lexicographically minimal element; this is the element we will give a function for. Given s∈St x s as in Property 4, substitute in x 1 = y −c 1 1 and x i = y −c i 1 y i for 2 i d; note that and so the generating function becomes .
Restricting our attention to sufficiently large t and a particular residue class of t mod m, we have α j ∈ Q \ {0} and the coordinate functions of r j , d j , are polynomials. We may assume that d j (t) are lexicographically positive, by taking sufficiently large t so that the signs of the coordinate functions do not change, and then using Remark 1.14.
Since we are assuming that c · x has a maximum, M , on S t , we see that all p ∈ φ(S t ) have (−M, 0, 0, . . . , 0) p coordinatewise. Therefore p∈φ(St) y p is a Laurent power series convergent on a neighborhood of y = (e −ε , e −ε 2 , . . . , e −ε d ), for any ε > 0. Expanding the right-hand side of (8) as a product of geometric series also gives a Laurent power series convergent on a neighborhood of y = (e −ε , e −ε 2 , . . . , e −ε d ), for sufficiently small ε (since the d j are lexicographically positive; see Remark 1.13). Therefore they must be identical as Laurent power series expansions. But the lexicographically minimal term of the expanded right-hand side is clear: for sufficiently large t, it is the unique lexicographical minimum among the r j (t), 1 j n. Inverting φ yields an element of S t maximizing c · x.
Finally, we will show that, c · x either eventually always achieves a maximum or eventually always doesn't (at least for this residue class of t mod m; this implies that the set of all t for which it achieves a maximum is eventually periodic). If the maximum exists, we have found it above; call it M (t), which is a polynomial. Define the set R t = {x ∈ N d : c · x M (t) + 1}. Then c · x attains a maximum on S t if and only if S t ∩ R t is empty.
Given two Laurent power series f (s) = s∈Z d p s x s and g(x) = s∈Z d q s x s (p s , q s ∈ Q) convergent on a neighborhood of some (e −ε , e −ε 2 , . . . , e −ε d ), define their Hadamard product, f g, to be s∈Z d p s q s x s . We are given that f (x) .
= s∈St x s has Property 4.
= s∈Rt x s also has Property 4. In particular, their numerator and denominator have the form j β j (t)x r j (t) , where β j and the coordinate functions of r j are polynomials. Note that f g = s∈St∩Rt x s ; we want to decide whether this is identically zero. We will show that f g also has numerator and denominator in the form (9), in which case (for sufficiently large t) it is identically zero if and only if its numerator is identically zero. Since the Hadamard product is a bilinear operator, it suffices to show that has numerator and denominator of the form (9). What is the coefficient of x s in this Hadamard product? Expanding the first rational function as a product of geometric series, the coefficient of x s in it is #λ ∈ N k : q(t) + λ 1 b 1 (t) + · · · + λ k b k (t) = s, and similarly the coefficient of x s in the second is #µ ∈ N : r + µ · d(t) = s. Therefore the coefficient of x s in the Hadamard product is the product of these, that is, There are no quantifiers in this expression (10), so it is of the form in Part (a) of Theorem 3.5, meaning we proved in Section 4.2 that the generating function s∈N d ,λ∈N k ,µ∈N satisfying (10) x s y λ z µ satisfies Property 4. Substituting y = 1, z = 1 gives the Hadamard product; following the proof of 4 ⇒ 2 (which may involve L'Hôpital's rule and therefore differentiation of the numerator and denominator), we see that the Hadamard product indeed has numerator and denominator in the form (9). Therefore f g is either identically zero (and hence c · x is always maximized on S t ) or eventually never zero (and hence c · x does not achieve a maximum). This is true for every residue class of t, so, all together, the set of t for which a maximum is achieved will eventually be periodic. 4 ⇒ 3b : Since we have proven that 4 ⇒ 3a ⇒ 3, we can get a single element y 1 (t) ∈ S t , when S t is nonempty. Now we can continue inductively: s∈St\{y 1 (t)} x s = s∈St x s − x y 1 (t) can be written as a rational function of the appropriate form, so S t \ {y 1 (t)} has Property 4. Thus we can use Property 3 to get another element y 2 (t) and also conclude that the set of t for which |S t | 2 (which is the set of t for which |S t \{y 1 (t)}| is nonempty) is eventually periodic. Continue inductively.

Proof of Theorem 3.5
Section 4.2 proved Property 4 for the sets given in Theorem 3.5. The other properties follow immediately using Theorem 3.3.

Proof of Theorem 3.4
Assume that Property 3 holds for all parametric Presburger families. For t ∈ N, let S t = {x ∈ N d : F (x, t)} be a parametric Presburger family defined by formula F . We must show that 3a and 3b hold for S t .
To prove that 3a holds, let c ∈ Z d \ {0} be given. Define a new set S t to be the solutions x to F (x, t) ∧ ∀y F (y, t) ⇒ c · y c · x .
These are exactly the set of elements x maximizing c·x in S t (and it is empty if there is no such x). By Property 3, the set of t such that S t is nonempty is eventually periodic, and there exists an eventually quasi-polynomial x(t) such that x(t) ∈ S t when it is nonempty. This is the desired x(t).
To prove that 3b holds, we induct on k. The base case k = 1 is Property 3 and so is true. Inductively applying Property 3 to the sentence yields new elements, and this formula has solutions exactly when |S t | k, so the set of such t is eventually periodic, by Property 3.