COMPUTING THE EHRHART QUASI-POLYNOMIAL OF A RATIONAL SIMPLEX
Alexander Barvinok April 2005
We present a polynomial time algorithm to compute any fixed number of the highest coefficients of the Ehrhart quasi-polynomial of a rational simplex. Previously such algorithms were known for integer simplices and for rational polytopes of a fixed dimension. The algorithm is based on the formula relating the kth coefficient of the Ehrhart quasi-polynomial of a rational polytope to volumes of sections of the polytope by affine lattice subspaces parallel to k-dimensional faces of the polytope. We discuss possible extensions and open questions.
1. Introduction and main results Let P ⊂ Rd be a rational polytope, that is, the convex hull of a finite set of points with rational coordinates. Let t ∈ N be a positive integer such that the vertices of the dilated polytope n o tP = tx : x ∈ P
are integer vectors. As is known, see, for example, Section 4.6 of [St97], there exist functions ei(P ; ·): N −→ Q, i = 0, . . . , d, such that
ei(P ; n + t) = ei(P ; n) for all n ∈ N and d d X i |nP ∩ Z | = ei(P ; n)n for all n ∈ N. i=0 The function on the right hand side is called the Ehrhart quasi-polynomial of P . It is clear that if dim P = d then ed(P ; n) = vol P . In this paper, we are interested in the computational complexity of the coefficients ei(P ; n).
1991 Mathematics Subject Classification. 52C07, 05A15, 68R05. Key words and phrases. Ehrhart quasi-polynomial, rational polytope, valuation, algorithm. This research was partially supported by NSF Grant DMS 0400617.
Typeset by AMS-TEX 1 If the dimension d is fixed in advance, the values of ei(P ; n) for any given P , n, and i can be computed in polynomial time by interpolation, as implied by a poly- nomial time algorithm to count integer points in a polyhedron of a fixed dimension [B94a], [BP99]. If the dimension d is allowed to vary, it is an NP-hard problem to check whether P ∩ Zd 6= ∅, let alone to count integer points in P . This is true even when P is a rational simplex, as exemplified by the knapsack problem see, for example, Section 16.6 of [Sc86]. If the polytope P is integral then the coefficients ei(P ; n) = ei(P ) do not depend on n. In that case, for any k fixed in advance, computation of the Ehrhart coefficient ed−k(P ) reduces in polynomial time to computation of the volumes of the (d − k)-dimensional faces of P [B94b]. The algorithm is based on efficient formulas relating ed−k(P ), volumes of the (d − k)-dimensional faces, and cones of feasible directions at those faces, see [Mo93], [BP99], and [PT04]. In particular, if P = ∆ is an integer simplex, there is a polynomial time algorithm for computing ed−k(∆) as long as k fixed in advance. In this paper, we extend the last result to rational simplices (a d-dimensional rational simplex is the convex hull in Rd of (d + 1) affinely independent points with rational coordinates).
• Let us fix an integer k ≥ 0. The paper presents a polynomial time algorithm, which, given an integer d ≥ k, a rational simplex ∆ ⊂ Rd, and a positive integer n, computes the value of ed−k(∆; n).
We present the algorithm in Section 7 and discuss its possible extensions in Section 8. In contrast to the case of an integral polytope, for a general rational polytope P computation of ei(P ; n) cannot be reduced to computation of the volumes of faces and some functionals of the “angles” (cones of feasible direction) at the faces. A general result of McMullen [Mc78], see also [MS83] and [Mc93], asserts that the contribution of the i-dimensional face F of a rational polytope P to the coefficient ei(P ; n) is a function of the volume of F , the cone of feasible directions of P at F , and the translation class of the affine hull aff(F ) of F modulo Zd.
Our algorithm is based on a new structural result, Theorem 1.3 below, relating the coefficient ed−k(P ; n) to volumes of sections of P by affine lattice subspaces parallel to faces F of P with dim F ≥ d − k. Theorem 1.3 may be of interest in its own right.
(1.1) Valuations and polytopes. Let V be a d-dimensional real vector space and let Λ ⊂ V be a lattice, that is, a discrete additive subgroup which spans V . A polytope P ⊂ V is called a Λ-polytope or a lattice polytope if the vertices of P belong to Λ. A polytope P ⊂ V is called Λ-rational or just rational if tP is a lattice polytope for some positive integer t. 2 For a set A ⊂ V , let [A]: V −→ R be the indicator of A:
1 if x ∈ A [A](x) = 0 if x∈ / A.
A complex-valued function ν on rational polytopes P ⊂ V is called a valuation if it preserves linear relations among indicators of rational polytopes:
X X αi[Pi] = 0 =⇒ αiν(Pi) = 0, i∈I i∈I where Pi ⊂ V is a finite family of rational polytopes and αi are rational numbers. We consider only Λ-valuations or lattice valuations ν that satisfy
ν(P + u) = ν(P ) for all u ∈ Λ, see [MS83] and [Mc93]. A general result of McMullen [Mc78] states that if ν is a lattice valuation, P ⊂ V is a rational polytope, and t ∈ N is a number such that tP is a lattice polytope then there exist functions νi(P ; ·): N −→ C, i = 0, . . . , d, such that
d X i ν(nP ) = νi(P ; n)n for all n ∈ N i=0 and νi(P ; n + t) = νi(P ; n) for all n ∈ N. Clearly, if we compute ν(mP ) for m = n, n + t, n + 2t, . . . , n + dt, we can obtain νi(P ; n) by interpolation. We are interested in the counting valuation E, where V = Rd, Λ = Zd, and
d E(P ) = |P ∩ Z | is the number of lattice points in P . The idea of the algorithm is to replace valuation E by some other valuation, so that the coefficients ed(P ; n), . . . , ed−k(P ; n) remain intact, but the new valuation can be computed in polynomial time on any given rational simplex ∆, so that the desired coefficient ed−k(∆; n) can be obtained by interpolation. d (1.2) Valuations EL. Let L ⊂ R be a lattice subspace, that is, a subspace spanned by the points L∩Zd. Suppose that dim L = k and let pr : Rd −→ L be the orthogonal projection onto L. Let P ⊂ Rd be a rational polytope, let Q = pr(P ), d Q ⊂ L, be its projection, and let Λ = pr Z . Since L is a lattice subspace, Λ ⊂ L is a lattice. 3 Let L⊥ be the orthogonal complement of L. Then L⊥ ⊂ Rd is a lattice sub- ⊥ space. We introduce the volume form vold−k on L which differs from the volume form inherited from Rd by a scaling factor chosen so that the determinant of the d ⊥ lattice Z ∩ L is 1. Consequently, the same volume form vold−k is carried by all translations x + L⊥, x ∈ Rd. We consider the following quantity
X ⊥ X ⊥ EL(P ) = vold−k P ∩ m + L = vold−k P ∩ m + L m∈Λ m∈Q∩Λ
(clearly, for m∈ / Q the corresponding terms are 0). In words: we take all lattice translates of L⊥, select those that intersect P and add the volumes of the intersections. Clearly, EL is a lattice valuation, so
d X i EL(nP ) = ei(P,L; n)n i=0 for some periodic functions ei(P,L; ·). If tP is an integer polytope for some t ∈ N then ei(P,L; n + t) = ei(P,L; n) for all n ∈ N and i = 0, . . . , d. d d Note that if L = {0} then EL(P ) = vol P and if L = R then EL(P ) = |P ∩ Z |, so the valuations EL interpolate between the volume and the number of lattice points as dim L grows. We prove that ed−k(P ; n) can be represented as a linear combination of ed−k(P,L; n) for some lattice subspaces L with dim L ≤ k. (1.3) Theorem. Let us fix an integer k ≥ 0. Let P ⊂ Rd be a full-dimensional ra- tional polytope and let t be a positive integer such that tP is an integer polytope. For a (d − k)-dimensional face F of P let lin(F ) ⊂ Rd be the (d − k)-dimensional sub- space parallel to the affine hull aff(F ) of F and let LF = (lin F )⊥ be its orthogonal complement, so LF ⊂ Rd is a k-dimensional lattice subspace. Let L be a finite collection of lattice subspaces which contains the subspaces LF for all (d − k)-dimensional faces F of P and is closed under intersections. For L ∈ L let µ(L) be integer numbers such that the identity " # [ X L = µ(L)[L] L∈L L∈L holds for the indicator functions of the subspaces from L. Let us define X ν(nP ) = µ(L)EL(nP ) for n ∈ N. L∈L 4 Then there exist functions νi(P ; ·): N −→ Q, i = 0, . . . , d, such that
d X i (1.3.1) ν(nP ) = νi(P ; n)n for all n ∈ N, i=0
(1.3.2) νi(P ; n + t) = νi(P ; n) for all n ∈ N,
and
(1.3.3) ed−i(P ; n) = νd−i(P ; n) for all n ∈ N and i = 0, . . . , k.
We prove Theorem 1.3 in Section 4 after some preparations in Sections 2 and 3. Remark. Valuation E clearly does not depend on the choice of the scalar product in Rd. One can observe that valuation ν of Theorem 1.3 admits a dual description which does not depend on the scalar product. Instead of L, we consider the set L∨ of subspaces containing the subspaces lin(F ) and closed under taking sums of ∨ ∨ subspaces, and for L ∈ L we define EL (·) as the sum of the volumes of sections of the polytope by the lattice affine subspaces parallel to L. Then
X ∨ ∨ ν = µ (L)EL , L∈L∨
where µ∨ are some integers computed from the set L∨, partially ordered by inclu- sion. However, using the explicit scalar product turns out to be more convenient.
The advantage of working with valuations EL is that they are more amenable to computations.
• Let us fix an integer k ≥ 0. We present a polynomial time algorithm, which, given an integer d ≥ k, a d-dimensional rational simplex ∆ ⊂ Rd, and a lattice d subspace L ⊂ R such that dim L ≤ k, computes EL(∆).
We present the algorithm in Section 6 after some preparations in Section 5.
(1.4) The main ingredient of the algorithm to compute ed−k(∆; n). Theorem 1.3 allows us to reduce computation of ed−k(∆; n) to that of EL(∆), where L ⊂ Rd is a lattice subspace and dim L ≤ k. Let us choose a particular lattice subspace L with dim L = j ≤ k. If P = ∆ is a simplex, then the description of the orthogonal projection Q = pr(∆) onto L can be computed in polynomial time. Moreover, one can compute in polynomial time a decomposition of Q into a union of non-intersecting polyhedral 5 −1 pieces Qi, such that vold−j pr (x) is a polynomial on each piece Qi. Thus computing EL(∆) reduces to computing the sum X φ(m),
m∈Qi∩Λ where φ is a polynomial with deg φ = d − j, Qi ⊂ L is a polytope with dim Qi = j ≤ k and Λ ⊂ L is a lattice. The sum is computed by applying the technique of “short rational functions” for lattice points in polytopes of a fixed dimension, cf. [BW03], [BP99], and [D+04]. The algorithm for computing the sum of a polynomial over integer points in a polytope is discussed in Section 5.
2. The Fourier expansions of E and EL Let V be a d-dimensional real vector space with the scalar product h·, ·i and the corresponding Euclidean norm k · k. Let Λ ⊂ V be a lattice and let Λ∗ ⊂ V be the dual or the reciprocal lattice
∗ n o Λ = x ∈ V : hx, yi ∈ Z for all y ∈ Λ . For τ > 0, we introduce the theta function
d/2 X 2 θΛ(x, τ) =τ exp −πτkx − mk m∈Λ X =(det Λ)−1 exp −πklk2/τ + 2πihl, xi , where x ∈ V. l∈Λ∗ The last inequality is the reciprocity relation for theta series (essentially, the Poisson summation formula), see, for example, Section 69 of [Be61]. For a polytope P , let int P denote the relative interior of P and let ∂P = P \int P be the boundary of P . (2.1) Lemma. Let P ⊂ V be a full-dimensional polytope such that ∂P ∩ Λ = ∅. Then Z |P ∩ Λ| = lim θΛ(x, τ) dx τ−→+∞ P X Z =(det Λ)−1 lim exp −πklk2/τ exp{2πihl, xi} dx. τ−→+∞ l∈Λ∗ P
Proof. As is known (cf., for example, Section B.5 of [La02]), as τ −→ +∞, the function θΛ(x, τ) converges in the sense of distributions to the sum of the delta- functions concentrated at the points m ∈ Λ. Therefore, for every smooth function φ : Rd −→ R with a compact support, we have Z X (2.1.1) lim φ(x)θΛ(x, τ) dx = φ(m). τ−→+∞ d R m∈Λ 6 Since ∂P ∩ Λ = ∅, we can replace φ by the indicator function [P ] in (2.1.1). Remark. If ∂P ∩ Λ 6= ∅, the limit still exists but then it counts every lattice point m ∈ ∂P with the weight equal to the “solid angle” of m at P , since every term exp −πτkx − mk2 is spherically symmetric about m. This connection between the solid angle valuation and the theta function was described by the author in the unpublished paper [Ba92] (the paper is very different from paper [B94b] which has the same title) and independently discovered by Diaz and Robins [DR94]. Diaz and Robins used a similar approach based on Fourier analysis to express coefficients of the Ehrhart polynomial of an integer polytope in terms of cotangent sums [DR97]. Banaszczyk [B93a] obtained asymptotically optimal bounds in transference theo- rems for lattices by using a similar approach with theta functions, with the polytope P replaced by a Euclidean ball. The formula of Lemma 2.1 can be considered as the Fourier expansion of the counting valuation. We need a similar result for valuation EL defined in Section 1.2. (2.2) Lemma. Let P ⊂ Rd be a full-dimensional polytope and let L ⊂ Rd be a lattice subspace with dim L = k. Let pr : Rd −→ L be the orthogonal projection onto L, let Q = pr(P ), and let Λ = pr(Zd), so Λ ⊂ L is a lattice in L. Suppose that ∂Q ∩ Λ = ∅. Then Z X 2 EL(P ) = lim exp −πklk /τ exp{2πihl, xi} dx. τ−→+∞ d P l∈L∩Z
d ∗ d Proof. We observe that L ∩ Z = Λ . For a vector x ∈ R , let xL be the orthogonal projection of x onto L. Applying the reciprocity relation for theta functions in L, we write X exp −πklk2/τ + 2πihl, xi d l∈L∩Z X 2 = exp −πklk /τ + 2πihl, xLi d l∈L∩Z k/2 X 2 =(det Λ)τ exp −πτkxL − mk . m∈Λ
As is known (cf., for example, Section B.5 of [La02]), as τ −→ +∞, the function
k/2 X 2 gτ (x) = τ exp −πτkxL − mk m∈Λ converges in the sense of distributions to the sum of the delta-functions concentrated ⊥ on the subspaces m + L (this is the set of points where xL = m) for m ∈ Λ. 7 Therefore, for every smooth function φ : Rd −→ R with a compact support, we have Z X Z (2.2.1) lim φ(x)gτ (x) dx = φ(x) dL⊥ x, τ−→+∞ d ⊥ R m∈Λ m+L ⊥ d where dL⊥ x is the Lebesgue measure on m + L induced from R . Since ∂Q ∩ Λ = ∅, each subspace m + L⊥ for m ∈ Λ either intersects the interior of P or is at least some distance = (P,L) > 0 away from P . Hence we may replace φ by the indicator [P ] in (2.2.1). Recall from Section 1.2 that measuring volumes in m + L⊥, we scale the volume form in L⊥ induced from Rd so that the determinant of the lattice L⊥ ∩ Zd is 1. One can observe that det Λ provides the required normalization factor, so Z ⊥ (det Λ) [P ](x) dL⊥ (x) = vold−k P ∩ m + L . m+L⊥ The proof now follows. Remark. If ∂Q ∩ Λ 6= ∅ the limit still exists but then for m ∈ ∂Q ∩ Λ the volume ⊥ vold−k P ∩ m + L is counted with the weight defined as follows: we find the minimal (under inclusion) face F of P such that m + L⊥ is contained in aff(F ) and let the weight equal to the solid angle of P at F .
3. Exponential valuations Let V be a d-dimensional Euclidean space, let Λ ⊂ V be a lattice and let Λ∗ be the reciprocal lattice. Let us choose a vector l ∈ Λ∗ and let us consider the integral Z Φl(P ) = exp{2πihl, xi} dx, P where dx is the Lebesgue measure in V . Note that for l = 0 we have Φl(P ) = Φ0(P ) = vol P . We have
Φl(P + a) = exp {2πihl, ai} Φl(P ) for all a ∈ V.
It follows that Φl is a Λ-valuation on rational polytopes P ⊂ V . If l 6= 0 then the following lemma (essentially, Stokes’ formula) shows that Φl can be expressed as a linear combination of exponential valuations on the facets of P . The proof can be found, for example, in [B93b]. (3.1) Lemma. Let P ⊂ V be a full-dimensional polytope. For a facet Γ of P , let dΓx be the Lebesgue measure on aff(Γ), and let pΓ be the unit outer normal to Γ. Then, for every l ∈ V \ 0, we have Z Z X hl, pΓi exp {2πihl, xi} dx = exp {2πihl, xi} d x, 2πiklk2 Γ P Γ Γ where the sum is taken over all facets Γ of P . Let F ⊂ P be an i-dimensional face of P . Recall that by lin(F ) we denote the i-dimensional subspace of Rd that is parallel to the affine hull aff(F ) of F . We need the following result. 8 (3.2) Theorem. Let P ⊂ V be a rational full-dimensional polytope and let t be a positive integer such that tP is a lattice polytope. Let ≥ 0 be a rational number and let a ∈ V be a vector. Let us choose l ∈ Λ∗. Then there exist functions fi(P, , a, l; ·): N −→ C, i = 0, . . . , d, such that
d X i (3.2.1) Φl (n + )P + a = fi(P, , a, l; n)n for all n ∈ N i=0
and
(3.2.2) fi(P, , a, l; n + t) = fi(P, , a, l; n) for all n ∈ N
and i = 0, . . . , d. Suppose that fd−k(P, , a, l; n) 6= 0 for some n. Then there exists a (d − k)- dimensional face F of P such that l is orthogonal to lin(F ). Proof. Since Φl(P + a) = exp {2πihl, ai} Φl(P ), without loss of generality we assume that a = 0. We will denote fi(P, , 0, l; n) just by fi(P, , l; n). We proceed by induction on d. For d = 0 the statement of the theorem obviously d holds. Suppose that d ≥ 1. If l = 0 then Φl (n + )P = (n + ) vol P and the statement holds as well. Suppose that l 6= 0. For a facet Γ of P , let ΛΓ = Λ ∩ lin(Γ) and let lΓ be the orthogonal projection of l onto lin(Γ). Thus ΛΓ is a lattice in the (d−1)-dimensional ∗ Euclidean space lin(Γ) and lΓ ∈ ΛΓ, so we can define valuations ΦlΓ on lin(Γ). Since tP is a lattice polytope, for every facet Γ there is a vector uΓ ∈ V such that
lin(Γ) = aff(tΓ) − tuΓ and tuΓ ∈ Λ.
0 0 Let Γ = Γ − uΓ, so Γ ⊂ lin(Γ) is a ΛΓ-rational (d − 1)-dimensional polytope 0 such that tΓ is a ΛΓ-polytope. We have
0 (n + )Γ = (n + )Γ + (n + )uΓ.
Applying Lemma 3.1 to (n + )P , we get