The computational complexity of integer programming with alternations

We prove that integer programming with three quantifier alternations is $NP$-complete, even for a fixed number of variables. This complements earlier results by Lenstra and Kannan, which together say that integer programming with at most two quantifier alternations can be done in polynomial time for a fixed number of variables. As a byproduct of the proof, we show that for two polytopes $P,Q \subset \mathbb{R}^4$ , counting the projection of integer points in $Q \backslash P$ is $\#P$-complete. This contrasts the 2003 result by Barvinok and Woods, which allows counting in polynomial time the projection of integer points in $P$ and $Q$ separately.


Introduction
1. 1. Background. In a pioneer paper [Len83], Lenstra showed that Integer Programming in a bounded dimension can be solved in polynomial time. The next breakthrough was obtained by Kannan in 1990 and until recently remained the most general result in this direction (see [Eis10,NP17a]).
Theorem 1.1 (Parametric Integer Programming [Kan90]). Fix d 1 and d 2 . Given a polyhedron P ⊆ R d 1 , a matrix A ∈ Z m×(d 1 +d 2 ) and a vector b ∈ Z m , the following sentence can be decided in polynomial time: Here P is given by a system C x ≤ γ, with C ∈ Z n×d 1 and γ ∈ Z n . The numbers m, n are part of the input. Theorem 1. 3. Fix d 1 ≥ 1, d 2 ≥ 2 and d 3 ≥ 3. Given two polyhedra P ⊆ R d 1 , Q ⊆ R d 2 , a matrix A ∈ Z m×(d 1 +d 2 +d 3 ) and a vector b ∈ Z m , then deciding the sentence (1.1) ∃x ∈ P ∩ Z d 1 ∀y ∈ Q ∩ Z d 2 ∃z ∈ Z d 3 : A (x, y, z) ≤ b is an NP-complete problem. Here P and Q are given by two systems C x ≤ γ and D y ≤ δ, with C ∈ Z n×d 1 , γ ∈ Z n , D ∈ Z q×d 2 , and δ ∈ Z q .
This result is especially surprising for the following reason. By an easy application of the Doignon-Bell-Scarf theorem, it suffices to prove Theorem 1.1 when m and n are also fixed. However, this argument breaks down when there are more than two quantifiers (see Section 7.1). We speculated in [NP17a] that a different argument might still lead to a stronger Theorem 1.2 with the bound on m, n, q removed. Theorem 1.3 refutes such possibility. In fact, Theorem 1.3 holds even when P is an interval and Q is an axis-parallel rectangle (see Theorem 4.1 and §7.8).
The difference between this and (1.1) is that the expression Φ(x, y) is allowed to contain both conjunctions and disjunctions of many inequalities. So one quantifier can be discarded at the cost of adding in extra disjunctions. In the next subsection, we generalize this observation.

Presburger sentences.
In [Grä87], Grädel considered the theory of Presburger Arithmetic, and proved many completeness results in this theory when the number of variables and quantifiers are bounded. Those results were later strengthened by Schöning in [Sch97]. They can be summed up as follows: Theorem 1.4 ( [Sch97]). Fix k ≥ 1. Let Φ(x, y) be a Boolean combination of linear inequalities with integer coefficients in the variables x = (x 1 , . . . , x k ) ∈ Z k and y = (y 1 , . . . , y 3 ) ∈ Z 3 . Then deciding the sentence Q 1 x 1 ∈ Z . . . Q k x k ∈ Z Q k+1 y ∈ Z 3 : Φ(x, y) is Σ P k -complete if k is even, and Π P k -complete if k is odd. Here Q 1 , . . . , Q k+1 ∈ {∀, ∃} are m + 1 alternating quantifiers, with Q k+1 = ∃.
This result characterizes the complexity of so called Presburger sentences with k+1 quantifiers in a fixed number of variables. The main difference between Presburger Arithmetic versus integer programming is that the expression Φ allows both conjunction and disjunction of many inequalities. This flexibility allows effective reductions of classical decision problems such as QSAT. For some time, it remains a question whether such reductions can be carried with only conjunctions, and at the same time keeping the number of variables fixed. We prove the following result, which generalizes Theorem 1.3: Theorem 1.5. Integer programming in a fixed number of variables with k + 2 quantifier alternations is Σ P k -complete if k is odd, and Π P k -complete if k is even. Here the problem is allowed to contain only a system of inequalities.
We refer to Theorem 6.1 for the precise statement. Thus, we see that integer programming requires only one more quantifier alternation to achieve the same complexity as Presburger Arithmetic. Again, we emphasize that while the number of variables and quantifiers are fixed in Theorem 1.5, the linear system is still allowed many inequalities. This greatly contrasts with the following general version of Theorem 1.2.

1.3.
Counting points in projections of non-convex polyhedra. For polytopes in arbitrary dimension, counting the number of integer points points is classically #P-complete, even for 0/1 polytopes. In a fixed dimension d, Barvinok famously showed this can be done in polynomial time: Given a polytope P ⊂ R d , the number of integer points in P ∩ Z d can be computed in polynomial time. Here P is described by For a set S ⊂ R d , denote by E(S) := S ∩ Z d . The previous results say that |E(P )| is computable in polynomial time. Given two polytopes P ⊂ Q ⊂ R d , we clearly have |E(Q\P )| = |E(Q)| − |E(P )|. So the number of integer points in a complement can also be computed effectively.
Theorem 1.7 was later generalized by Barvinok and Woods to count the number of integer points in projections of polytopes: Given a polytope P ⊂ R d 1 , and a linear transformation T : Z d 1 → Z d 2 , the number of integer points in T (P ∩ Z d 1 ) can be computed in polynomial time. Here P is described by a system A x ≤ b and T is described by a matrix M , where A ∈ Z m×d 1 , b ∈ Z m and M ∈ Z d 2 ×d 1 .
For a set S ⊂ R d , denote by E 1 (S) the projection of S ∩ Z d on the first coordinate, i.e., E 1 (S) := {x ∈ Z : ∃y ∈ Z d−1 (x, y) ∈ S}.
By Theorem 1.8, |E 1 (P )| can be computed in polynomial time for every polytope P ⊂ R d .
In other words, it is #P-complete to compute the size of the set Note that the corresponding decision problem |E 1 (Q\P )| ≥ 1 is equivalent to |E(Q\P )| ≥ 1, and thus can be decided in polynomial time by applying Theorem 1. 7.
The contrast between Theorem 1.8 and our negative result can be explained as follows. The proof Theorem 1.8 depends on the polytopal structure of P and exploited convexity in a crucial way. By taking the complement Q\P , we no longer have a convex set. In other words, we show that projection of the complement Q\P is complicated enough to allow encoding of hard counting problems, even in dimension 4 (see also §7.3).
Remark 1. 10. To understand the theorem, consider three examples of polygons P, Q ⊂ R 2 as in Figure 1. Note that the sets of integer points of the vertical projections of P, Q and P ∪ Q are the same in all three cases, but the sets number of integer points of the vertical projections of Q\P are quite different.

1.4.
Outline of the paper. We begin with notations (Section 2) and a geometric construction of certain polytopes based on Fibonacci numbers (Section 3). In Section 4 we use this construction to prove Theorem 1.3 via a reduction of the GOOD SIMULTA-NEOUS APPROXIMATION (GSA) Problem in Number Theory, which is known to be NP-complete. The proof of Theorem 1.9 follows a similar route via reduction of #GSA (Section 5). The proof of Theorem 1.5 is via a reduction of QSAT (Section 6). We conclude with final remarks and open problems (Section 7). We write x ≤ y if x j ≤ y j for all i. A polyhedron is an intersection of finitely many closed half-spaces in R n . A polytope is a bounded polyhedron. Polyhedra and polytopes are denoted by P, Q, R, etc. Let φ(·) denotes the binary length of a number, vector, matrix, or a logical formula. For a polyhedron Q described by a linear system Ax ≤ b, let φ(Q) denote the total length φ(A) + φ(b).

Geometric constructions and properties
3.1. Fibonacci points. We consider the first 2d Fibonacci numbers: From these, we construct d integer points: We have V ⊂ J. Denote by C the curve consisting of d − 1 segments connecting v i to v i+1 for i = 1, . . . , i − 1.
We also define the following two polygons. Their properties will be mentioned later.
) has no interior integer points. This can be deduced from the facts that two consecutive Fibonacci numbers are coprime, and also (F3) The set of integer points in J \V can be partitioned into 2 parts: those lying strictly above the convex curve C, and those lying strictly below it.
(F4) The part of J \V lying above C is exactly R 1 ∩ Z 2 . This can be seen as follows. The So every integer point y = (y 1 , y 2 ) lying above ℓ satisfies: By property (F2), there are no integer points y between C and ℓ. The other two edges of R 1 come from J. See Figure 2.
(F5) The part of J \V lying below C is exactly R 2 ∩ Z 2 . This can be seen as follows. The So all integer points below that line satisfies: This gives d − 1 faces for R 2 , one for each 1 ≤ i ≤ d − 1. The other two faces of R 2 come from from J. See Figure 2.
Next, for each 1 ≤ i ≤ d, we define two new polytopes Finally, we define the convex hulls: The following properties are straightforward from the above definitions: This follows from from (3.7) and (F1).
(P8) For every v i ∈ V , we have: (P11) For every v i ∈ V , we have: (P12) For every point (x, y, w) ∈ P ∩ Z 4 , we have either y ∈ V or y ∈ R 2 . This follows from (3.9), (F1) and (F5). The same holds for Q. We will be using these properties in the latter sections.
We will prove the following stronger version of Theorem 1.3.
Theorem 4.1. Given a polytope U ⊂ R 6 and two finite boxes I ⊂ Z, J ⊂ Z 2 , deciding the sentence Since low dimensional boxes can be easily embedded into higher dimensions, the above implies Theorem 1.3 for every d 1 ≥ 1, d 2 ≥ 3 and d 3 ≥ 3. Compared to Theorem 1.3, all parameters in the above theorem are fixed, except for m. So from now on, the symbols n and d will be reused for other purposes. For a vector α = (α 1 , . . . , α d ) ∈ Q d and an integer x ∈ Z, we define where for each rational β ∈ Q, the quantity {β} is defined as: We need the following important result by Lagarias: Let us emphasize that in GSA, the number d is part of the input. If d is fixed instead, then the problem can be decided in polynomial time (see [Lag85] and [GLS89, Ch. 5]). What follows is a reduction of GSA to a sentence of the form (4.1). GSA can be expressed as an integer programming problem: where ǫ = s 1 /s 2 . The inequalities on w i can be expressed as (x, w i ) ∈ P i , where P i was defined in (3.5). Letting I = [1, N ] ∩ Z, we see that GSA is equivalent to deciding: .2) and P be as in (3.9). We have: Proof. Indeed, assume {{xα}} ≤ ǫ, i.e., x satisfies GSA. By (4.4), for every i = 1, . . . , d, Since this holds for every v i ∈ V , the RHS in (4.5) is satisfied. For the other direction, assume the RHS in (4.5) holds. Then for every v i ∈ V , there exists w i ∈ Z with (x, v i , w i ) ∈ P . By (P8), we have (x, w i ) ∈ P i . By (4.4), x satisfies GSA, i.e., {{xα}} ≤ ǫ.
By the above lemma, GSA is equivalent to: ∃x ∈ I ∀y ∈ V ∃w ∈ Z : (x, y, w) ∈ P.
Next, define two polytopes R ′ 1 and R ′ 2 as follows: are defined in such a way so that for every x ∈ I and y ∈ J, we have y ∈ R i if and only if there exists w ∈ Z such that (x, y, w) ∈ R ′ i . 2 Now, it is clear that (4.7) is equivalent to: which is equivalent to: (4.9) ∃x ∈ I ∀y ∈ J ∃w ∈ Z : (x, y, w) ∈ R ′ 1 ∪ R ′ 2 ∪ P. The difference between (4.9) and (4.1) is that we have 3 polytopes instead of just one. 4.2. The final step is two compress three polytopes R ′ 1 , R ′ 2 and P into one polytope. Recall from (P7) that P has 4d vertices, which correspond to the vertices of all P i for 1 ≤ i ≤ d. The vertices of R 1 and R 2 can be computed in polynomial time from systems (3.3) and (3.4). From there we easily get the vertices of R ′ 1 and R ′ 2 . Since P, R ′ 1 and R ′ 2 are in the fixed dimension 4, we can write down all their facets in polynomial time using their vertices. So we can represent: (4.10) The above three systems all have lengths polynomial in the input α, N and ǫ. Next, we need the following lemma: 2 Such a w must automatically be 0 by the definition of R ′ i .
Lemma 4.4. Fix n and r. Given r polytopes R 1 , . . . , R r ⊂ R n described by r systems there is a polytope U ∈ R n+ℓ , where ℓ = ⌈log 2 r⌉, such that Furthermore, the system A (x, t) ≤ b that describes U can be found in polynomial time, given A i 's and b i 's as input.
Proof. Let ℓ = ⌈log 2 r⌉, we have 2 ℓ ≥ r. Pick t 1 , . . . , t r ∈ {0, 1} ℓ as r different vertices of the ℓ-dimensional unit cube. Define In other words, we form U j by augmenting each R j with ℓ coordinates of t j . Since t 1 , . . . , t r are in convex position, so are the new polytopes U 1 , . . . , U j . So the vertices of U are all the vertices of all U j . Note that for every t ∈ conv(t 1 , . . . , t r ), we have t ∈ Z ℓ if and only if t = t j for some j. This implies that the only integer points in U are those in U j 's. In other words: x ∈ R j ∩ Z n and t = t j for some j = 1, . . . , r.

So we have (4.11).
For each R j , its vertices can be computed in polynomial time from the system A i x ≤ b i . From these, we easily get the vertices for each U j . Thus, we can find all vertices of U in polynomial time. Note that U is in a fixed dimesion n + ℓ, since n and r are fixed. Therefore, we can find in polynomial time all the facets of U using those vertices. This gives us a system A (x, t) ≤ b of polynomial length that describes U .
Applying the above lemma for three polytopes R ′ 1 , R ′ 2 and P with n = 4 and r = 3, we find a polytope U ⊂ R 4+ℓ such that: Here we have ℓ = ⌈log 2 3⌉ = 2, which means t ∈ Z 2 and U ⊂ R 6 . The lemma also allows us to find a system A (x, y, w, t) ≤ b that describes U , which has size polynomial in the systems in (4.10). Now, we can rewrite (4.9) as: which is equivalent to ∃x ∈ I ∀y ∈ J ∃z ∈ Z 3 : A (x, y, z) ≤ b.
Here z = (w, t) ∈ Z 3 . The final system A (x, y, z) ≤ b still has size polynomial in the original input α, N and ǫ. Therefore, the original GSA problem is equivalent to (4.1). This implies that (4.1) is NP-hard.
It remains to show that (4.1) is in NP. We argue that more general sentence (1.1) is also in NP. From a result in [Grä87], if (1.1) is true, there must be an x satisfying it with length polynomial in the input P, A and b. For such an x, we can apply Theorem 1.1 to check the rest of the sentence, which has the form ∀y∃z, in polynomial time. This shows that deciding (1.1) is in NP, and thus NP-complete. The argument in [Lag85] is based on a parsimonious reduction. Namely, it gives a bijection between solutions for #GSA and the following problem: #WEAK PARTITIONS: Input: An integer vector a = (a 1 , . . . , a d ) ∈ Z d . Output: The number of y ∈ {−1, 0, 1} d for which a · y = 0.
It is well known and easy to see that #WEAK PARTITIONS is #P-complete. The decision version WEAK PARTITION was earlier shown by [vEB81] to be NP-complete with a parsimonious reduction from KNAPSACK. Together with Lagarias's reduction, we conclude: Theorem 5.1. #GSA is #P-complete.

Now we proceed with the reduction of #GSA to (1.3).
Recall V and J from (3.2). We use the notations from section 3.1 and 3.2. Let P i , P ′ i and P be from (3.5), (3.7) and (3.9). Let Q i , Q ′ i and Q be from (3.6), (3.8) and (3.10). Let I = [1, N ] ∩ Z. We have: Observation 1. For every x ∈ I, there is a unique w ∈ Z such that (x, w) ∈ Q i . Indeed, from (3.6), we have (x, w) ∈ Q i if and only if x ∈ I and: For each x ∈ I, we get a half-open interval of length 1 for w, which has a unique integer.
Remark 5.2. Note that each Q i contains an open edge defined by α i x + ǫ − 1 < w. However, we can convert each strict inequality α i x + ǫ − 1 < w to an equivalent nonstrict inequality. Indeed, multiply the inequality with the denominators in α i and ǫ, which has polynomial length. Then the resulting sharp integer inequality of the form a < b is equivalent to a ≤ b − 1. Therefore, we can replace Q i with a (smaller) closed parallelogram without losing any integer points in Q i . Taking the convex hull as in (3.10), we can similarly replace Q with a (smaller) closed polyhedron, without losing any integer points in Q.
Observation 2. For every x ∈ I and v i ∈ V , there is a unique integer point (x, v i , w i ) ∈ Q.
Indeed, by (P11), for every v i ∈ V , we have (x, v i , w) ∈ Q if and only if (x, w) ∈ Q i . Together with Observation 1, we have Observation 2.
Recall from (P5) that P ⊂ Q. Now consider the following set: Proof. Assume x ∈ S, then there exist some v j ∈ V and w j ∈ Z so that (x, v i , w i ) ∈ Q\P . By Observation 2 and the fact that P ⊂ Q, there is no w ∈ Z for which (x, v i , w) ∈ P . By (4.5), we have {{xα}} > ǫ. Conversely, assume {{xα}} > ǫ. By (4.5), there exist v i ∈ V so that there is no w ∈ Z with (x, v i , w) ∈ P . By Observation 2, the unique point (x, v i , w i ) in Q must be outside of P , i.e., (x, v i , w i ) ∈ Q\P . We conclude that x ∈ S by (5.1).
By the above lemma, counting S is equivalent to #GSA. The formulation (5.1) is very similar to (1.3), with (y, w) in place of z. We cannot conclude directly that S is E 1 (Q\P ) because of the restricted quantifier ∃y ∈ V instead of ∃y ∈ Z 2 . To turn S into the form (1.3), we need to convert ∃y ∈ V to ∃y ∈ Z 2 . 5. 3. The final step is to modify the polytopes P and Q. In (5.1), we only consider projections of integer points (x, y, w) ∈ Q\P with y restricted to the set V . In general, the complement Q\P has some other integer points (x, y, w) with y not lying in V . By (P12) such a point must necessarily have y ∈ R 2 . We can eliminate all of them by taking the convex hulls of P and Q with a "high enough" box over R 2 . Below are the details. .7) and (3.9) that P is the convex hull of all P ′ i , which is simply P i with an added second component v i . This leads to the following observation: Observation 3. For every vector γ ∈ R 2 , we have: The same holds for Q.
Next, consider the rectangular box J containg V and the complement J \V , where J is from (3.2). From properties (F3), (F4) and (F5), integer points in the complement J \V lie in two separate convex polygons R 1 and R 2 , as described in (3.3) and (3.4). We will only need R 2 , which contains integer points below V . Define For γ ∈ R 2 , we denote by P γ the set: P γ = (x, y, w) ∈ P : y = γ , and analogously for P γ , Q γ , Q γ and R γ .
Indeed, since γ ∈ V , we have γ = v i and P γ = P v i for some i. By (3.7) and (P8), we have because R is a box over R 2 , and P ′ i is a parallelogram over v i . Recall from (P5) that P ′ i forms a 2-dimensional face of P . Therefore, it still remains a 2-dimensional face of the convex hull P = conv(P, R). So P γ = P γ = P ′ i . The same argument applies to Q γ and Q γ . Note that we also have P ⊂ Q, because P ⊂ Q. Consider the complement Q\ P . Assume (x, y, w) ∈ Z 3 is an integer point in Q\ P . By (5.4), such a point cannot exist for y ∈ R 2 . So we must have y ∈ V . Now by (5.5), we also have (x, y, w) ∈ Q\P . Therefore, from (5.1), we conclude that: Here z = (y, w). The systems describing Q and P can be obtained in polynomial time from the input α, N and ǫ. First, the vertices of P and Q are given by (P7) and (P10). The vertices of R directly come from those of R 2 , which can be found from (3.4). By (5.3), we can obtain the vertices of P and Q. The facets of P and Q can be found from their vertices in polynomial time, since both polytopes are in the fixed dimension 4. In summary, problem (1.3) applied to P and Q is #P-complete. This proves Theorem 1.9.

5.4.
Proof of Corollary 1.11. By Theorem 1.9, counting |E 1 (Q\P )| is #P-complete for P ⊂ Q ⊂ R 4 . Nevertheless, the complement Q\P can still be triangulated into polynomially many simplices R 1 ⊔ · · · ⊔ R r . In fact, by an application of Proposition 5.2.2 in [Woo15], the systems describing all such R i can be found in polynomial time. Therefore, counting |E 1 (R 1 ⊔ · · · ⊔ R r )| = |E 1 (Q\P )| is #P-complete.

Proof of Theorem 1.5
Recall the definition of boxes from Section 4. In this section, we prove: Theorem 6.1. Fix k ≥ 1. Given a polytope U ⊂ R k+7 and finite boxes I 1 , . . . , I k ⊂ Z, J ⊂ Z 2 , K ⊂ Z 5 , then the problem of deciding: is Σ P k complete if k is odd, and Π P k complete if k is even. Here Q 1 , . . . , Q k ∈ {∃, ∀} are k alternating quantifiers with Q k = ∃. The polytope U is described by a system A (x, y, z) For the proof, we work with the canonical problem Q3SAT: QUANTIFIED 3-SATISFIABILITY (Q3SAT): Input: Φ is a Boolean expression of the form: Here each u j = (u j1 , . . . , u jℓ ) ∈ {0, 1} ℓ is a tuple of ℓ Boolean variables, and each a i , b i , c i is a literal in the set {u js , ¬u js : 1 ≤ j ≤ k, 1 ≤ s ≤ ℓ}.
Output: Decide the truth of the sentence: Here Q 1 , Q 2 , . . . , Q k ∈ {∀, ∃} are k alternating quantifiers with the last quantifier Q k = ∃. The numbers ℓ and N are part of the input.
For clarity, we use the notation Q3SAT k to emphasize problem (6.3) for a fixed k. It is well-known that Q3SAT k is Σ P k -complete for k odd and Π P k -complete for k even (see e.g. [Pap94,MM11] and [AB09]). We proceed to reduce (6.3) to (6.1). In fact, by representing each Boolean string u j ∈ {0, 1} ℓ as an integer x j ∈ [0, 2 ℓ ), we will only need to use I 1 = I 2 = · · · = I k = [0, 2 ℓ ) ∩ Z.
Let x = (x 1 , . . . , x k ) ∈ [0, 2 ℓ ) k . Recall that each term a i , b i , c i in (6.2) is u js or ¬u js for some j and s. So each clause a i ∨ b i ∨ c i can be expressed in x as: are of the form (6.4) (with different j and s for each). Note that the strict inequalities in (6.4) can be sharpened without losing any integer solutions (see Remark 5.2). We define the polytopes: So the RHS in (6.5) can be rewritten as: Let I 1 = I 2 = · · · = I k = [0, 2 ℓ ) ∩ Z, we see that (6.3) is equivalent to: For each i, we apply Lemma 4.4 (with n = k + 1, r = 3) to the polytopes K i , L i , M i ⊂ R k+1 . This gives us another polytope G i ⊂ R k+3 that satisfies: Substituting this into (6.6), we have an equivalent sentence: Notice that apart from the outer quantifiers, (6.7) is a direct analogue of (4.4), with G i playing the role of P i and (x, w) in place of (x, w). The proof now proceeds similarly to the rest of Section 4 after (4.4). Along the proof, we need to define G ′ i and G in similar manners to (3.7) and (3.9). The variable y ∈ Z 2 is again needed to define G ′ i . V and J from (3.2) are reused without change. This gives us G ′ i , G ⊂ R k+5 . At the end of the proof, we also need to apply Lemma 4.4 one more time to produce a single polytope U , just like in (4.12). The dimension 4 in (4.12) is now k + 5. As a result, the final polytope U has dimension k + 7. In the final form (6.1), we will have x ∈ Z k , y ∈ Z 2 and z = (w, t) ∈ Z 5 .
We have converted (6.3) to an equivalent sentence (6.1) with polynomial size. This shows that (6.1) is Σ P k /Π P k -hard depending on the parity of k. For each tuple x = (x 1 , . . . , x k ), we can check in polynomial time whether ∀y ∈ J ∃z ∈ K : A (x, y, z) ≤ b by applying Theorem 1.1. This shows the membership of (6.1) in Σ P k /Π P k . We conclude that (6.1) is Σ P k /Π P k -complete. 7.
Final remarks and open problems 7.1. It is sufficient to prove Theorem 1.1 for the case when m, n are also bounded. In the system A (x, y) ≤ b, we view x as the parameters and y as the variables to be solved for. For a fixed d 2 and m ≥ 2 d 2 , the Doignon-Bell-Scarf theorem [Sch86, §16.5] implies that the system A (x, y) ≤ b is solvable in y ∈ Z d 2 if and only if every subsystem A ′ (x, y) ≤ b ′ is solvable. Here A ′ is a submatrix with 2 d 2 rows from A with b ′ the corresponding subvector from b. So we have: The total number of pairs (A ′ , b ′ ) is m 2 d 2 , which is polynomial in m. Note that the conjunction over all (A ′ , b ′ ) commutes with the universal quantifier ∀x. So we have: Thus, it is equivalent to check each of the smaller subproblems, each of which has m = 2 d 2 .
Recall that the number of facets in P is n, which can still be large. However, given the system C x ≤ γ describing P , we can triangulate P into to a union of simplices P 1 ⊔ · · · ⊔ P k .
Since the dimension d 1 is bounded, we can find such a triangulation in polynomial time (see e.g. [DRS10]). Now for each pair (A ′ , b ′ ), we have: Each simplex P i ⊂ R d 1 has d 1 + 1 facets. Each subsentence in the RHS now has m = 2 d 2 and d 1 + 1. Note that the total number of such subsentences is still polynomial, so it suffices to check each of them individually.
For three quantifiers ∃x ∀y ∃z, this argument breaks down because the existential quantifier ∃x no longer commutes with a long conjunction. This prevents Theorem 1.2 from generalizing to m, n, k unbounded. 7.2. By taking finite Boolean combinations, we see that Theorem 1.7 also allows counting integer points in a union of k polytopes, where k is bounded (see [Bar08,BP99]). In fact, Woods proved in [Woo15, Prop. 5. 3.1] that it is still possible to count all such points in polynomial time when k is arbitrary. By Corollary 1.11, we see that this is not the case for projection. 7.3. Let us give another motivation behind Theorem 1.9 and put it into context of our other work. In this paper, we bypass the "short generating function" technology developed for computing |E 1 (P )| for convex polytopes P ⊂ R d . Note, however, that for X = Q\P as in the theorem, the corresponding short GF f X (t) is simply the difference f Q (t) − f P (t), which can still be computed in polynomial time (see [Bar93]). Thus, if one could efficiently present the projection of f X (t) on Z as a short generating function of polynomial size, then one would be able to compute |E 1 (Q\P )|, a contradiction. In other words, Theorem 1.9 is an extension of a result by Woods [Woo04], which shows that computing projecting short generating functions is NP-hard. It is also an effective but weaker version of the main result in [NP17c, Th. 1.3], which deals with the size of short GFs of the projections rather than complexity of their computation. 7.4. It would be interesting to see if the dimension 4 in Theorem 1.9 is sharp and cannot be reduced to 3. One can argue both in favor and against this possibility. First, one can think of the result as a claim about complexity of nonconvex polyhedra Q\P in R d . For d = 3, the three dimensional nonconvex polyhedra are well known to be notoriously complicated to study via triangulations (see e.g. [RS92], the proof of the Th. 1.2 in [BBDR00] and a lengthly discussion in [DRS10]). This suggests that for the "long" first coordinate dimensions of Q, it is unlikely that there is a good way to triangulate Q\P which would allow to compute |E 1 (Q\P )| efficiently.
To argue in the opposite direction, the problem of computing the number of integer points for polytopes in R d becomes simpler for d ≤ 3 (see e.g. [BR15,Bri95,Dye91]), so perhaps there is an ad hoc approach in this case. 7.5. The GSA Problem plays an important role in both Number Theory and Integer Programming especially in connection to lattice reduction algorithms (see e.g. [GLS89]). Let us mention that via a chain of parsimonious reductions one can show that #GSA is also hard to approximate (cf. [ER09]). Note also that GSA has been recently used in a somewhat related geometric context in [EH12].