1 Introduction

Given \({\varvec{a}}\in {{\mathbb {Z}}}^n\), \(b\in {{\mathbb {Z}}}\), a knapsack polyhedron\(P({\varvec{a}}, b)\) is defined as

$$\begin{aligned} P({\varvec{a}}, b)=\{{\varvec{x}}\in {{\mathbb {R}}}^n_{\ge 0}: {\varvec{a}}^T {\varvec{x}}=b\}\,. \end{aligned}$$

We will estimate the \(\ell _\infty \)-distance from a vertex of \(P({\varvec{a}}, b)\) to the set of its lattice points. For this purpose we define the (maximum) vertex distance

$$\begin{aligned} {d}({\varvec{a}},b)= \left\{ \begin{array}{rl} \max _{{\varvec{v}}}\min _{{\varvec{z}}\in P({\varvec{a}},b)\cap {{\mathbb {Z}}}^n} \Vert {\varvec{v}}-{\varvec{z}}\Vert _{\infty }\,, &{} \text{ if } P({\varvec{a}},b)\cap {{\mathbb {Z}}}^n\ne \emptyset \,,\\ -\infty \,, &{} \text{ otherwise }\,, \end{array} \right. \end{aligned}$$

where \(\Vert {\cdot }\Vert _{\infty }\) stands for the \(\ell _\infty \)-norm and the maximum is taken over all vertices \({\varvec{v}}\) of the polyhedron \(P({\varvec{a}},b)\).

We will exclude the trivial case \(n=1\), where the vertex distance takes the values 0 and \(-\infty \) only. We may also assume without loss of generality that \({\varvec{a}}\) is a primitive integer vector with nonzero entries. Thus, we will assume the following conditions:

$$\begin{aligned} \begin{array}{l} {\varvec{a}}=(a_1, \ldots , a_n)^T\in {{\mathbb {Z}}}^{ n}\,,n\ge 2\,, a_i\ne 0\,, i=1,\ldots ,n\,,\text { and }\\ \gcd ({\varvec{a}})=\gcd (a_1, \ldots , a_n)=1\,. \end{array} \end{aligned}$$
(1)

The first result of this paper gives an optimal upper bound for the vertex distance that depends only on the \(\ell _\infty \)-norm of the vector \({\varvec{a}}\) and independent of n and b.

Theorem 1

  1. (i)

    Let \({\varvec{a}}\) satisfy (1) and \(b\in {{\mathbb {Z}}}\). Then

    $$\begin{aligned} {d}({\varvec{a}},b)\le \Vert {\varvec{a}}\Vert _\infty -1\,. \end{aligned}$$
    (2)
  2. (ii)

    For any positive integer k and any dimension n there exist \({\varvec{a}}\) satisfying (1) with \(\Vert {\varvec{a}}\Vert _{\infty }=k\) and \(b\in {{\mathbb {Z}}}\) such that

    $$\begin{aligned} {d}({\varvec{a}},b)=\Vert {\varvec{a}}\Vert _\infty -1\,. \end{aligned}$$

Note that the classical sensitivity theorem of Cook et al. [8, Theorem 1] implies in the knapsack setting the bound \({d}({\varvec{a}},b) \le n \Vert {\varvec{a}}\Vert _\infty .\) Let \(A=(a_{ij})\in {{\mathbb {Z}}}^{m \times n}\), \({\varvec{b}}\in {{\mathbb {Z}}}^m\) and let \(\Vert \cdot \Vert _1\) denote the \(l_1\)-norm. A very recent strong improvement on the results of Cook et al. [8] obtained by Eisenbrand and Weismantel [12] implies that to every vertex \({\varvec{v}}\) of the polyhedron \(P=\{{\varvec{x}}\in {{\mathbb {R}}}^n_{\ge 0}: A{\varvec{x}}={\varvec{b}}\}\) there exists an integer point \({\varvec{z}}\) in P (provided it is integer feasible), such that

$$\begin{aligned} \Vert {\varvec{v}}-{\varvec{z}}\Vert _1\le m(2m\Vert A\Vert _\infty +1)^m, \end{aligned}$$
(3)

where \(\Vert A\Vert _\infty =\max _{i,j} |a_{ij}|\). It remains an open question how tight this bound is. For a bounded knapsack polyhedron the bound (3) can be strengthened as follows. In the proof of Theorem 1 (i) we estimate the vertex distance using a covering argument that guarantees for any vertex \({\varvec{v}}\) of a bounded integer feasible polyhedron \(P({\varvec{a}},b)\) existence of a lattice point \({\varvec{z}}\in P({\varvec{a}},b)\) in an \((n-1)\)-dimensional simplex of sufficiently small diameter, translated by \({\varvec{v}}\). The argument implies the bound

$$\begin{aligned} \min _{{\varvec{z}}\in P({\varvec{a}},b)\cap {{\mathbb {Z}}}^n} \Vert {\varvec{v}}-{\varvec{z}}\Vert _1\le 2 (\Vert {\varvec{a}}\Vert _{\infty }-1)\,. \end{aligned}$$

How large is the vertex distance of a “typical” knapsack polyhedron? Specifically, consider for \(H\ge 1\) the set \({{Q}}(H)\) of \({\varvec{a}}\in {{\mathbb {Z}}}^{ n}\) that satisfy (1) and

$$\begin{aligned} \Vert {\varvec{a}}\Vert _{\infty }\le H\,. \end{aligned}$$

The next theorem will estimate the proportion of the vectors \({\varvec{a}}\) in \({{Q}}(H)\) such that for some \(b\in {{\mathbb {Z}}}\) the knapsack polyhedron \(P({\varvec{a}}, b)\) has relatively large vertex distance. Let N(H) be the cardinality of \({{Q}}(H)\). For \(\epsilon \in (0,3/4)\) let

$$\begin{aligned} N_{\epsilon }(t,H)=\#\left\{ {\varvec{a}}\in {{Q}}(H): \max _{b\in {{\mathbb {Z}}}}\frac{{d}({\varvec{a}},b)}{\Vert {\varvec{a}}\Vert _{\infty }^{\epsilon }}>t \right\} \,. \end{aligned}$$

In the rest of the paper, the notation \(f({\varvec{x}})\ll _n g({\varvec{x}})\) for \({\varvec{x}}\in S\), where S is a set, means that \(|f({\varvec{x}})|\le c|g({\varvec{x}})|\), for \({\varvec{x}}\in S\) and a positive constant \(c=c(n)\) depending on n only. \(f({\varvec{x}})\asymp _n g({\varvec{x}})\) means that both \(f({\varvec{x}})\ll _n g({\varvec{x}})\), \(g({\varvec{x}})\ll _n f({\varvec{x}})\) hold.

Theorem 2

Fix \(n\ge 3\). For any \(\epsilon \in (0,3/4)\) we have

$$\begin{aligned} \frac{N_{\epsilon }(t,H)}{N(H)}\ll _n t^{-\alpha (\epsilon ,n)} \end{aligned}$$
(4)

uniformly over all \(t>0\) and \(H\ge 1\). Here

$$\begin{aligned} \alpha (\epsilon ,n)=\frac{n-2}{(1-\epsilon )n}\,. \end{aligned}$$

To prove Theorem 2, we will utilize results of Strömbergsson [23] (see also Schmidt [21] and references therein) on the asymptotic distribution of Frobenius numbers.

Theorems  1 and 2 can be applied to estimating the (additive) integrality gaps for integer knapsack problems. In the proceedings [4] the authors have considered this problem for the case that \(\varvec{a}\) is non-negative. In this paper we extend those results to greater generality. In particular, in Corollarys 1 and 2, we show that the two main statements of [4] hold true for general knapsack polyhedra, i.e., we drop the non-negativity assumption. We remark that extending results of [4] to general knapsack polyhedra requires using new covering arguments in the proofs of Theorems 1 and 2. Also, we include in this paper proofs that were omitted in [4].

Given \({\varvec{a}}\in {{\mathbb {Z}}}^n\), \(b\in {{\mathbb {Z}}}\) and a cost vector \({\varvec{c}}\in {{\mathbb {Q}}}^n\), we will consider the integer knapsack problem

$$\begin{aligned} \min \{ {\varvec{c}} ^T{\varvec{x}}: {\varvec{x}}\in P({\varvec{a}},b)\cap {{\mathbb {Z}}}^n\}\,. \end{aligned}$$
(5)

We will assume that (5) is feasible and bounded.

Let \(IP({\varvec{c}}, {\varvec{a}}, {b})\) and \(LP({\varvec{c}}, {\varvec{a}}, { b})\) denote the optimal values of (5) and its linear programming relaxation

$$\begin{aligned} \min \{ {\varvec{c}}^T {\varvec{x}}: {\varvec{x}}\in P({\varvec{a}},b)\}\,, \end{aligned}$$
(6)

respectively. The integrality gap \(IG({\varvec{c}}, {\varvec{a}}, {b})\) of (5) is defined as

$$\begin{aligned} IG({\varvec{c}}, {\varvec{a}}, {b})= IP({\varvec{c}}, {\varvec{a}}, { b})-LP({\varvec{c}}, {\varvec{a}}, { b})\,. \end{aligned}$$

Notice that

$$\begin{aligned} IG({\varvec{c}}, {\varvec{a}}, {b})\le {d}({\varvec{a}},b)\Vert {\varvec{c}}\Vert _1\,. \end{aligned}$$
(7)

Given a pair \(({\varvec{c}}, {\varvec{a}})\), the maximum of \(IG({\varvec{c}}, {\varvec{a}}, {b})\) over all suitable b is referred to as the integer programming gap (Hoşten and Sturmfels [17])

$$\begin{aligned} \mathrm {Gap}({\varvec{c}}, {\varvec{a}})= \max _{{b}} IG({\varvec{c}}, {\varvec{a}}, {b})\,. \end{aligned}$$

Here b ranges over all integers such that (5) is feasible and bounded. Notice that computing \(\mathrm {Gap}({\varvec{c}}, {\varvec{a}})\) when n is a part of input is NP-hard (see Aliev [1] and Eisenbrand et al. [10]). For any fixed n, the integer programming gap can be computed in polynomial time due to results of Hoşten and Sturmfels [17] (see also Eisenbrand and Shmonin [11]).

As a corollary of Theorem 1 and its proof, we obtain the following optimal upper bound on the integer programming gap.

Corollary 1

  1. (i)

    Let \({\varvec{a}}\) satisfy (1) and let \({\varvec{c}}\in {{\mathbb {Q}}}^n\). Then

    $$\begin{aligned} \mathrm {Gap}({\varvec{c}}, {\varvec{a}})\le \left( \Vert {\varvec{a}}\Vert _{\infty }-1 \right) \Vert {\varvec{c}}\Vert _1\,. \end{aligned}$$
    (8)
  2. (ii)

    For any positive integer k and any dimension n there exist \({\varvec{a}}\) satisfying (1) with \(\Vert {\varvec{a}}\Vert _{\infty }=k\) and \({\varvec{c}}\in {{\mathbb {Q}}}^n\) such that

    $$\begin{aligned} \mathrm {Gap}({\varvec{c}}, {\varvec{a}})= \left( \Vert {\varvec{a}}\Vert _{\infty }-1 \right) \Vert {\varvec{c}}\Vert _1\,. \end{aligned}$$

From (4) one can derive an upper bound on the average value of the (normalised) integer programming gap. The next corollary will show that for any \(\epsilon >2/n\) the ratio

$$\begin{aligned} \frac{\mathrm {Gap}({\varvec{c}}, {\varvec{a}})}{\Vert {\varvec{a}}\Vert _{\infty }^{\epsilon }\Vert {\varvec{c}}\Vert _1} \end{aligned}$$

is bounded, on average, by a constant that depends only on the dimension n. Hence, for fixed \(n>2\) and a “typical” integer knapsack problem with large \(\Vert {\varvec{a}}\Vert _{\infty }\), its linear programming relaxation provides a drastically better approximation (roughly of order \(\Vert {\varvec{a}}\Vert _{\infty }^{2/n}\)) to the solution than in the worst case scenario, determined by the optimal upper bound (8).

Corollary 2

Fix \(n\ge 3\). For any \(\epsilon >2/n\)

$$\begin{aligned} \frac{1}{N(H)}\sum _{{\varvec{a}}\in {Q}(H)}\max _{{\varvec{c}}\in {{\mathbb {Q}}}^n}\frac{\mathrm {Gap}({\varvec{c}}, {\varvec{a}})}{\Vert {\varvec{a}}\Vert _{\infty }^{\epsilon }\Vert {\varvec{c}}\Vert _1} \ll _n 1\,. \end{aligned}$$
(9)

The last two theorems of this paper give lower bounds for the integer programming gap and its average value. In particular, Theorem 4 shows that the bound in Corollary 2 is not far from being optimal.

Let \({\varvec{a}}\in {{\mathbb {Z}}}^n_{>0}\) satisfy (1) and let \({\varvec{c}}\in {{\mathbb {Q}}}^n\). We will say that \(({\varvec{a}}, {\varvec{c}})\) is generic if for any positive \(b \in {{\mathbb {Z}}}\) the linear programming relaxation (6) has a unique optimal solution. In this setting, an optimal lower bound for \(\mathrm {Gap}({\varvec{c}}, {\varvec{a}})\) can be obtained using recent results [1] on the lattice programming gaps associated with the group relaxations to (5). For a generic \(({\varvec{a}},{\varvec{c}})\), let \(\tau =\tau ({\varvec{a}}, {\varvec{c}})\) be the unique index of the basic variable for the optimal solution to the linear relaxation (6) with a positive \(b\in {{\mathbb {Z}}}\). Let \(\pi _i(\cdot ): {{\mathbb {R}}}^n\rightarrow {{\mathbb {R}}}^{n-1}\) be the projection that forgets the ith coordinate and let \({\varvec{l}}({\varvec{a}}, {\varvec{c}})=\pi _{\tau }({\varvec{c}})-{c}_{\tau }{a}_{\tau }^{-1}\pi _{\tau }({\varvec{a}})\). Note that \({\varvec{l}}({\varvec{a}}, {\varvec{c}})\) corresponds to the dual slack.

Let \(\rho _{d}\) denote the covering constant of the standard d-dimensional simplex, defined in Sect. 2.

Theorem 3

  1. (i)

    Let \({\varvec{a}}\in {{\mathbb {Z}}}^n_{>0}\) satisfy (1) and let \({\varvec{c}}\in {{\mathbb {Q}}}^n\). Suppose that \(({\varvec{a}}, {\varvec{c}})\) is generic. Then for \(\tau =\tau ({\varvec{a}}, {\varvec{c}})\) and \({\varvec{l}}={\varvec{l}}({\varvec{a}}, {\varvec{c}})\) we have

    $$\begin{aligned} \begin{aligned} \mathrm {Gap}({\varvec{c}}, {\varvec{a}})\ge \rho _{{n-1}} ({a}_{\tau } l_1\cdots l_{n-1})^{1/{(n-1)}}-\Vert {\varvec{l}}\Vert _1\,. \end{aligned} \end{aligned}$$
    (10)
  2. (ii)

    For any \(\epsilon >0\), there exists a vector \({\varvec{a}}\in {{\mathbb {Z}}}^n_{>0}\), satisfying (1) and \({\varvec{c}}\in {{\mathbb {Q}}}^n\) such that \(({\varvec{a}}, {\varvec{c}})\) is generic and, in the notation of part (i), we have

    $$\begin{aligned} \mathrm {Gap}({\varvec{c}}, {\varvec{a}})< (\rho _{{n-1}}+\epsilon ) ({a}_\tau l_1\cdots l_{n-1})^{1/{(n-1)}}-\Vert {\varvec{l}}\Vert _1\,. \end{aligned}$$

The only known exact values of \(\rho _{d}\) are \(\rho _1=1\) and \(\rho _2=\sqrt{3}\) (see [13]). It was proved in [2], that \(\rho _{d}>(d!)^{1/d}\). For sufficiently large d this bound is not far from being optimal. Indeed, \(\rho _{d}\le (d!)^{1/d}(1+O(d^{-1}\log d))\) (see [9, 19]).

Theorem 3 is the main ingredient in the proof of the last theorem of this paper that shows that the value of \(\epsilon \) in (9) cannot be smaller than \(1/(n-1)\).

Theorem 4

Fix \(n\ge 3\). For H large

$$\begin{aligned} \frac{1}{N(H)}\sum _{{\varvec{a}}\in {Q}(H)}\max _{{\varvec{c}}\in {{\mathbb {Q}}}^n}\frac{\mathrm {Gap}({\varvec{c}},{\varvec{a}})}{\Vert {\varvec{a}}\Vert _{\infty }^{1/(n-1)}\Vert {\varvec{c}}\Vert _1} \gg _n 1\,. \end{aligned}$$

2 Discrete coverings and Frobenius numbers

For linearly independent \({\varvec{b}}_1, \ldots , {\varvec{b}}_k\) in \({{\mathbb {R}}}^d\), the set \(\varLambda =\{\sum _{i=1}^{k} x_i {\varvec{b}}_i:\, x_i\in {{\mathbb {Z}}}\}\) is a k-dimensional lattice with basis\({\varvec{b}}_1, \ldots , {\varvec{b}}_k\) and determinant\(\det (\varLambda )=(\det [{\varvec{b}}_i\cdot {\varvec{b}}_j]_{1\le i,j\le k})^{1/2}\), where \({\varvec{b}}_i\cdot {\varvec{b}}_j\) is the standard inner product of the basis vectors \({\varvec{b}}_i\) and \({\varvec{b}}_j\). Recall that the Minkowski sum\(X+Y\) of the sets \(X, Y\subset {{\mathbb {R}}}^d\) consists of all points \({\varvec{x}}+{\varvec{y}}\) with \({\varvec{x}}\in X\) and \({\varvec{y}}\in Y\). For a lattice \(\varLambda \subset {{\mathbb {R}}}^d\) and \({\varvec{y}}\in {{\mathbb {R}}}^d\), the set \({\varvec{y}}+\varLambda \) is an affine lattice with determinant \(\det (\varLambda )\). For sets \(K, S \subset {{\mathbb {R}}}^d\) and a lattice \(\varLambda \subset {{\mathbb {R}}}^d\), the set \(K + \varLambda \) is a covering of S if \(S \subset K + \varLambda \).

In what follows, \({\mathcal {L}}^d\) will denote the set of all d-dimensional lattices in \({{\mathbb {R}}}^d\). By \({\mathcal {K}}^d\) we will denote the set of all d-dimensional convex bodies, i.e., closed bounded convex sets with non-empty interior in \({{\mathbb {R}}}^d\).

Lemma 1

Let \(K\in {\mathcal {K}}^d\), \(\varLambda \in {\mathcal {L}}^d\) and let \(K + \varLambda \) be a covering of \({{\mathbb {R}}}^d\). Then for any vectors \({\varvec{x}}, {\varvec{y}}\in {{\mathbb {R}}}^d\), we have \(({\varvec{x}}+K)\cap ({\varvec{y}}+\varLambda )\ne \emptyset \).

Proof

It is sufficient to show that for any vector \({\varvec{x}}\in {{\mathbb {R}}}^d\), we have \(({\varvec{x}}+K)\cap \varLambda \ne \emptyset \). Let \({\varvec{\lambda }}\) be any point of \(\varLambda \). Then \({\varvec{x}}\in K+{\varvec{\lambda }}\) if and only if \(-{\varvec{\lambda }}\in K+(-{\varvec{x}})\). Hence \({{\mathbb {R}}}^d\) is covered by the set \(K + \varLambda \) if and only if for each vector \({\varvec{x}}\in {{\mathbb {R}}}^d\), the set \({\varvec{x}}+K\) contains a point of \(\varLambda \). \(\square \)

For \(K\in {\mathcal {K}}^d\) and \(\varLambda \in {\mathcal {L}}^d\), we define the covering radius\(\mu (K,\varLambda )\) as

$$\begin{aligned} \mu (K,\varLambda ) =\min \{\mu > 0 : \mu K+ \varLambda \text { is a covering of }{{\mathbb {R}}}^d\}\,. \end{aligned}$$

For further results on covering radii in the context of the geometry of numbers see e.g. Gruber [15] and Gruber and Lekkerkerker [16].

Let \(S^d_{\varvec{1}}=\{{\varvec{x}}\in {{\mathbb {R}}}^d_{\ge 0}: x_1+\cdots +x_d\le 1\}\) be the standard d-dimensional simplex. The optimal lower bound in Theorem 3 is expressed using the covering constant \(\rho _d=\rho _d(S^d_{\varvec{1}})\) defined as

$$\begin{aligned} \rho _d=\inf \{\mu (S^d_{\varvec{1}}, \varLambda ): \varLambda \in {\mathcal {L}}^d \text { with } \det (\varLambda )=1 \}\,. \end{aligned}$$

Let \(\varLambda \) be a lattice in \({{\mathbb {R}}}^d\) with basis \({\varvec{b}}_1, \ldots , {\varvec{b}}_d\) and let \(\hat{\varvec{b}}_i\) be the vectors obtained using the Gram-Schmidt orthogonalisation of \({\varvec{b}}_1, \ldots , {\varvec{b}}_d\):

$$\begin{aligned} \begin{array}{l} \hat{\varvec{b}}_1= {\varvec{b}}_1\,, \\ \hat{\varvec{b}}_{i}= {\varvec{b}}_i-\displaystyle \sum \limits _{j=1}^{i-1}\mu _{i,j}\hat{\varvec{b}}_j\,, \;\;i=2,\ldots ,d\,, \end{array} \end{aligned}$$

where \(\mu _{i,j}=({\varvec{b}}_i\cdot \hat{\varvec{b}}_j)/|\hat{\varvec{b}}_j|^2\).

Define the box \({{\hat{B}}}={{\hat{B}}}({\varvec{b}}_1, \ldots , {\varvec{b}}_d)\) as

$$\begin{aligned} {{\hat{B}}}=[0,\hat{\varvec{b}}_1)\times \cdots \times [0, \hat{\varvec{b}}_d)\,. \end{aligned}$$

We will need the following useful observation.

Lemma 2

\({{\hat{B}}}+\varLambda \) is a covering of \({{\mathbb {R}}}^d\).

A proof of Lemma 2 is implicitly contained, for instance, in the proof of the classical result of Babai [5] on the nearest lattice point problem (see Theorem 5.3.26 in [14]). For completeness, we include a proof that follows along an argument of the proof of Theorem 5.3.26 in [14].

Proof

Let \({\varvec{x}}\) be any point of \({{\mathbb {R}}}^d\). It is sufficient to find a point \({\varvec{y}}\in \varLambda \) such that

$$\begin{aligned} {\varvec{x}}-{\varvec{y}}=\sum _{i=1}^d \lambda _i \hat{\varvec{b}}_i\quad 0\le \lambda _i<1\quad 1\le i \le d\,. \end{aligned}$$
(11)

This can be achieved using the following procedure. First we write

$$\begin{aligned} {\varvec{x}}=\sum _{i=1}^d \lambda _i^0 \hat{\varvec{b}}_i\,. \end{aligned}$$

Then we subtract \( \lfloor \lambda _d^0 \rfloor {\varvec{b}}_d\) to get a representation

$$\begin{aligned} {\varvec{x}}-\lfloor \lambda _d^0 \rfloor {\varvec{b}}_d=\sum _{i=1}^d \lambda _i^1 \hat{\varvec{b}}_i\,, \end{aligned}$$

where \(0\le \lambda _d^1<1\). Next subtract \( \lfloor \lambda _{d-1}^1 \rfloor {\varvec{b}}_{d-1}\) and so on until we obtain the representation (11). The lemma is proved. \(\square \)

Let now \(\varLambda \) be a sublattice of \({{\mathbb {Z}}}^{d}\) of full rank and let \(K\in {\mathcal {K}}^d\). In the course of the proof of part (i) of Theorem 1 we will need to work with coverings \(K+\varLambda \) of \({{\mathbb {Z}}}^d\), that we refer to as discrete coverings. For this purpose, we will need the following auxiliary results.

By Theorem I (A) and Corollary 1 in Chapter I of Cassels [7], there exists a unique basis \({\varvec{b}}_1, \ldots , {\varvec{b}}_d\) of the sublattice \(\varLambda \) of the form

$$\begin{aligned} \begin{array}{l} {\varvec{b}}_1= v_{11}{\varvec{e}}_1\,,\\ {\varvec{b}}_2= v_{21}{\varvec{e}}_1+v_{22}{\varvec{e}}_2\,,\\ \vdots \\ {\varvec{b}}_d= v_{d1}{\varvec{e}}_1+\cdots +v_{dd}{\varvec{e}}_d\,, \end{array} \end{aligned}$$
(12)

where \({\varvec{e}}_i\) are the standard basis vectors of \({{\mathbb {Z}}}^d\), the coefficients \(v_{ij}\) are integers, \(v_{ii}>0\) for \(i=1,\ldots ,d\) and \(0\le v_{ij}<v_{jj}\) for \(1\le j<i\le d\). Alternatively, the basis \({\varvec{b}}_1, \ldots , {\varvec{b}}_d\) can be obtained by taking the Hermite Normal Form of a basis matrix for \(\varLambda \).

Define the box \(B=B(\varLambda )\) as

$$\begin{aligned} B=[0,v_{11}-1]\times \cdots \times [0, v_{dd}-1]\,. \end{aligned}$$

Lemma 3

Let \(\varLambda \) be a full-dimensional sublattice of \({{\mathbb {Z}}}^{d}\). Then \(B(\varLambda )+\varLambda \) is a covering of \({{\mathbb {Z}}}^d\).

Proof

Observe that for the basis (12) the box \({{\hat{B}}}={{\hat{B}}}({\varvec{b}}_1, \ldots , {\varvec{b}}_d)\) can be written as

$$\begin{aligned} {{\hat{B}}}=[0,v_{11})\times \cdots \times [0, v_{dd})\,. \end{aligned}$$

The result now follows by Lemma 2. \(\square \)

Lemma 4

\((\det (\varLambda )-1)S^d_{\varvec{1}} + \varLambda \) covers \({{\mathbb {Z}}}^{d}\).

Proof

By Lemma 3, it is sufficient to show that \(B(\varLambda )\subset (\det (\varLambda )-1)S^d_{\varvec{1}}\) or, equivalently,

$$\begin{aligned} \sum _{i=1}^d (v_{ii}-1)\le \det (\varLambda )-1\,. \end{aligned}$$
(13)

The inequality (13) can be verified by induction for d and noticing that \(\det (\varLambda )=v_{11}\cdots v_{dd}\). \(\square \)

Lemma 5

Suppose that \(K + \varLambda \) is a covering of \({{\mathbb {Z}}}^d\). Then for any vectors \({\varvec{x}}, {\varvec{y}}\in {{\mathbb {Z}}}^d\), we have \(({\varvec{x}}+K)\cap ({\varvec{y}}+\varLambda )\ne \emptyset \).

A proof of Lemma 5 can be easily obtained from the proof of Lemma 1.

Given \(K\in {\mathcal {K}}^d\) and \(\varLambda \in {\mathcal {L}}^d\), we define the discrete covering radius\(\mu (K,\varLambda ; {{\mathbb {Z}}}^d)\) as

$$\begin{aligned} \begin{aligned} \mu (K,\varLambda ; {{\mathbb {Z}}}^d) =\min \{\mu > 0 : \mu K+ \varLambda \text { is a covering of }{{\mathbb {Z}}}^d \}\,. \end{aligned} \end{aligned}$$

For \({\varvec{y}}=(y_1, \ldots , y_d)^T\) with nonzero entries we will denote \(\mathrm {sign}(y_i)=y_i/|y_i|\). Let \({\mathcal {O}}_{\varvec{y}}=\{\varvec{x}\in {{\mathbb {R}}}^d\;|\;\mathrm {sign}(y_i) x_i\ge 0,\;1\le i \le d\}\) be the orthant that contains the vector \({\varvec{y}}\). Next, for \({\varvec{a}}\in {{\mathbb {Z}}}^n\) satisfying (1) we define the \((n-1)\)-dimensional simplex

$$\begin{aligned} S_{\varvec{a}}= \left\{ {\varvec{x}} \in {\mathcal {O}}_{\pi _n({\varvec{a}})}: a_1\,x_1+\cdots +a_{n-1}\,x_{n-1}\le 1 \right\} \end{aligned}$$

and the \((n-1)\)-dimensional lattice

$$\begin{aligned} \varLambda _{\varvec{a}} = \left\{ {\varvec{x}}\in {{\mathbb {Z}}}^{n-1} : a_1\,x_1+\cdots + a_{n-1}\,x_{n-1}\equiv 0 \bmod |a_n| \right\} . \end{aligned}$$

Given \({\varvec{a}}=(a_1, \ldots , a_n)^T\in {{\mathbb {Z}}}_{>0}^n\) with \(\gcd ({\varvec{a}})=1\), the Frobenius number\(g({\varvec{a}})\) is the smallest integer so that every integer \(b>g({\varvec{a}})\) can be represented as \( b= a_1 x_1 +\cdots + a_n x_n \) with nonnegative integers \(x_1,\ldots , x_n\).

Kannan [18] found the following very useful identities:

$$\begin{aligned} \mu (S_{\varvec{a}},\varLambda _{\varvec{a}})= g({\varvec{a}})+a_1+\cdots +a_n \end{aligned}$$
(14)

and

$$\begin{aligned} \mu (S_{\varvec{a}},\varLambda _{\varvec{a}}; {{\mathbb {Z}}}^{n-1})= g({\varvec{a}})+a_n. \end{aligned}$$
(15)

3 Proof of Theorem 1

We will start with a high-level informal description for the proof of part (i). For technical reasons, it is convenient to separately consider two special cases: Lemma 6 with Corollary 3 and Lemma 7 below prove part (i) for positive \({\varvec{a}}\) and for tuples \(({\varvec{a}}, b)\) that correspond to bounded or empty polyhedra \(P(\pi _n({\varvec{a}}),b)\), respectively. The proofs of these special cases are based on using covering tools from the geometry of numbers and results on Frobenius numbers.

The proof of the general case makes use of induction on dimension n with basis case \(n=2\). To settle the inductive step, we assume that part (i) holds for all dimensions \(2\le k < n\) and proceed as follows: Take \({\varvec{a}}\in {{\mathbb {Z}}}^n\) that satisfies (1), \(b\in {{\mathbb {Z}}}\) and assume without loss of generality that the knapsack polyhedron \(P({\varvec{a}},b)\) is integer feasible. Given any vertex \({\varvec{v}}\) of \(P({\varvec{a}},b)\), our aim is to show that \(P({\varvec{a}},b)\) contains an integer point \({\varvec{z}}\) with \(\ell _{\infty }\)-distance from \({\varvec{v}}\) at most \(\Vert {\varvec{a}}\Vert _{\infty }-1\). In this informal description we will only consider the case when the projected vertex \({\varvec{w}}=\pi _n({\varvec{v}})\) is nonzero (the proof of the case \({\varvec{w}}={\varvec{0}}\) makes use of a similar argument). In what follows, we will use the notation \(h= \gcd (\pi _n({\varvec{a}}))\). If \(P(\pi _n({\varvec{a}}),b)\) is integer feasible, the inductive hypothesis, applied to \(\pi _n({\varvec{a}})/h \) and b / h, implies existence of an integer point \({\varvec{y}} \in P(\pi _n({\varvec{a}}),b)\) with distance to the vertex \({\varvec{w}}\) of \(P(\pi _n({\varvec{a}}),b)\) at most \(\Vert \pi _n({\varvec{a}})\Vert _\infty /h-1\). By adding an extra zero entry, we lift \({\varvec{y}}\) to the point \({\varvec{z}}\).

Notice that by Corollary 3 and Lemma 7 we may assume that the polyhedron \(P(\pi _n({\varvec{a}}),b)\) is unbounded. If the (unbounded) polyhedron \(P(\pi _n({\varvec{a}}),b)\) is integer infeasible, we consider instead a polyhedron \(P(\pi _n({\varvec{a}}),t)\) with a suitable integer t that satisfies certain conditions (see conditions (a)-(c) on page 10). In particular, one of the conditions guarantees that the polyhedron \(P(\pi _n({\varvec{a}}),t)\) contains integer points. The inductive hypothesis, applied to \(\pi _n({\varvec{a}})/h\) and t / h, implies existence of an integer point \({\varvec{y}} \in P(\pi _n({\varvec{a}}),t)\) with distance to a suitably selected vertex of \(P(\pi _n({\varvec{a}}),t)\) at most \(\Vert \pi _n({\varvec{a}})\Vert _\infty /h-1\). Avoiding technical details, the conditions on t guarantee that the point \({\varvec{y}}\) can be lifted to the desired point \({\varvec{z}}\) of the original knapsack polyhedron \(P({\varvec{a}},b)\).

We will use the following notation. \(\varLambda ({\varvec{a}},b)\) will denote the affine lattice formed by integer points in the affine hyperplane \({\varvec{a}}^T{\varvec{x}}=b\), that is \(\varLambda ({\varvec{a}},b)=\{{\varvec{x}}\in {{\mathbb {Z}}}^n: {\varvec{a}}^T{\varvec{x}}=b\}\). We also set \(Q({\varvec{a}}, b)=\pi _n(P({\varvec{a}}, b))\) and \(L({\varvec{a}},b)=\pi _n(\varLambda ({\varvec{a}},b))\). Notice that the affine lattice \(L(\varvec{a},b)\) can be written in the form

$$\begin{aligned} L({\varvec{a}},b) = \left\{ {\varvec{x}}\in {{\mathbb {Z}}}^{n-1} : a_1\,x_1+\cdots + a_{n-1}\,x_{n-1}\equiv b \bmod |a_n| \right\} \,. \end{aligned}$$
(16)

Furthermore, \(L({\varvec{a}},0)=\varLambda _{\varvec{a}}\) is a lattice of determinant \(\det (\varLambda _{\varvec{a}})=a_n\) and \(L({\varvec{a}},b)=\varLambda _{\varvec{a}}+{\varvec{y}}\) for some \({\varvec{y}}\in {{\mathbb {Z}}}^{n-1}\).

As it was outlined above, we will start with two special cases. First we suppose that all entries of \({\varvec{a}}\) are positive. In this setting, we obtain an upper bound for \({d}({\varvec{a}},b)\) in terms of the Frobenius number \(g({\varvec{a}})\). This bound will be also used in the proof of Theorem 2.

Lemma 6

Let \({\varvec{a}}\in {{\mathbb {Z}}}_{>0}^{ n}\) satisfy (1) and \(b\in {{\mathbb {Z}}}\). Then

$$\begin{aligned} {d}({\varvec{a}},b)\le \frac{g({\varvec{a}})+\Vert {\varvec{a}}\Vert _{\infty }}{\min _i a_i}\,. \end{aligned}$$
(17)

Proof

If \(b<0\) then the polyhedron \(P({\varvec{a}},b)\) is empty and in the case \(b=0\) we have \(P({\varvec{a}},b)= \{\varvec{0}\}\). Assume now that b is a positive integer. Clearly, \(P({\varvec{a}}, b)\) is a simplex with vertices

$$\begin{aligned} \left( \frac{b}{a_1},0, \ldots , 0\right) ^T, \left( 0, \frac{b}{a_2}, \ldots , 0\right) ^T, \ldots , \left( 0, \ldots , 0, \frac{b}{a_n}\right) ^T \end{aligned}$$

and, consequently,

$$\begin{aligned} P({\varvec{a}}, b)\subset \left[ 0, \frac{b}{\min _i a_i}\right] ^n\,. \end{aligned}$$
(18)

Let \({\varvec{v}}\) be any vertex of \(P({\varvec{a}},b)\). Rearranging the entries of \({\varvec{a}}\), we may assume that \({\varvec{v}}=(0,\ldots , 0, b/a_n)^T\). If \(b \le \mu (S_{\varvec{a}},\varLambda _{\varvec{a}}; {{\mathbb {Z}}}^{n-1})\) then (15) combined with (18) implies (17). Suppose now that \(b > \mu (S_{\varvec{a}},\varLambda _{\varvec{a}}; {{\mathbb {Z}}}^{n-1})\). Then

$$\begin{aligned} \mu (S_{\varvec{a}},\varLambda _{\varvec{a}}; {{\mathbb {Z}}}^{n-1}) S_{\varvec{a}}\subset bS_{\varvec{a}}= Q({\varvec{a}}, b)\,. \end{aligned}$$
(19)

By Lemma 5, applied to the covering \(\mu (S_{\varvec{a}},\varLambda _{\varvec{a}}; {{\mathbb {Z}}}^{n-1}) S_{\varvec{a}}+\varLambda _{\varvec{a}}\) of \({{\mathbb {Z}}}^{n-1}\), there is a point \((z_1, \ldots , z_{n-1})^T\in L({\varvec{a}},b)\cap \mu (S_{\varvec{a}},\varLambda _{\varvec{a}}; {{\mathbb {Z}}}^{n-1}) S_{\varvec{a}}\). Hence, using (19) and the definition of the lattice \(L({\varvec{a}},b)\),

$$\begin{aligned} {\varvec{z}}=\left( z_1, \ldots , z_{n-1}, \frac{b}{a_n}-\frac{a_1z_1+\cdots +a_{n-1}z_{n-1}}{a_n}\right) ^T \end{aligned}$$

is an integer point in the knapsack polyhedron \(P({\varvec{a}}, b)\).

Since \((z_1, \ldots , z_{n-1})^T\in \mu (S_{\varvec{a}},\varLambda _{\varvec{a}}; {{\mathbb {Z}}}^{n-1}) S_{\varvec{a}}\), we have

$$\begin{aligned} \Vert {\varvec{v}}-{\varvec{z}}\Vert _\infty \le \frac{\mu (S_{\varvec{a}},\varLambda _{\varvec{a}}; {{\mathbb {Z}}}^{n-1})}{\min _i a_i}= \frac{g({\varvec{a}})+a_n}{\min _i a_i}\,, \end{aligned}$$

where the last equality follows from (15). The lemma is proved. \(\square \)

The next corollary will complete the proof of part (i) for vectors \({\varvec{a}}\) with positive entries.

Corollary 3

Let \({\varvec{a}}\in {{\mathbb {Z}}}^{n}_{>0}\) satisfy (1) and \(b\in {{\mathbb {Z}}}\). Then

$$\begin{aligned} {d}({\varvec{a}},b)\le \Vert {\varvec{a}}\Vert _{\infty }-1\,. \end{aligned}$$
(20)

Proof

We use a classical upper bound for the Frobenius number due to Schur (see Brauer [6]):

$$\begin{aligned} g({\varvec{a}})\le (\min _i a_i)\Vert {\varvec{a}}\Vert _{\infty }-(\min _i a_i)-\Vert {\varvec{a}}\Vert _{\infty }\,. \end{aligned}$$
(21)

The bound (17) combined with (21) immediately implies (20). \(\square \)

Next, we will consider the case when at least one of the entries of \({\varvec{a}}\) is negative, the entries of \({\varvec{a}}\) satisfy the condition

$$\begin{aligned} a_n= \min _{i} |a_i|<\Vert {\varvec{a}}\Vert _{\infty } \end{aligned}$$
(22)

and the polyhedron \(P(\pi _n({\varvec{a}}), b)=\{{\varvec{x}}\in {{\mathbb {R}}}^{n-1}_{\ge 0}: \pi _n({\varvec{a}})^T {\varvec{x}}=b\}\,\) is bounded or empty.

Lemma 7

Let \({\varvec{a}}\in {{\mathbb {Z}}}^{n}\) satisfy (1) and \(b\in {{\mathbb {Z}}}\). If \({\varvec{a}}\) has at least one negative entry, (22) holds and \(P(\pi _n({\varvec{a}}),b)\) is bounded or empty, then

$$\begin{aligned} {d}({\varvec{a}},b)\le \Vert {\varvec{a}}\Vert _{\infty }-1\,. \end{aligned}$$

Proof

The vector \({\varvec{a}}\) has at least one positive and at least one negative entry and, consequently, the polyhedron \(P({\varvec{a}}, b)\) is unbounded. Since we assumed \(a_n>0\), \(P(\pi _n({\varvec{a}}),b)\) can be bounded or empty only when all entries of \(\pi _n({\varvec{a}})\) are negative.

Suppose first that \(b>0\), so that \(P({\varvec{a}},b)\) has the single vertex \({\varvec{v}}=(0,\ldots , 0, b/a_n)^T\), the polyhedron \(P(\pi _n({\varvec{a}}),b)\) is empty and \(Q({\varvec{a}},b)={{\mathbb {R}}}^{n-1}_{\ge 0}\). By Lemma 4, \((a_n-1)S^{n-1}_{\varvec{1}}+\varLambda _{\varvec{a}}\) covers \({{\mathbb {Z}}}^{n-1}\). The affine lattice \(L({\varvec{a}},b)\) is an integer translate of the lattice \(\varLambda _{\varvec{a}}\). Hence, by Lemma 5, there is a point \({\varvec{y}}\in L({\varvec{a}},b)\cap (a_n-1)S^{n-1}_{\varvec{1}}\). In view of (22), we have \(a_n\le \Vert {\varvec{a}}\Vert _{\infty }-1\).

Hence

$$\begin{aligned} \Vert {\varvec{y}}\Vert _{\infty }<\Vert {\varvec{a}}\Vert _{\infty }-1\,. \end{aligned}$$
(23)

Let now

$$\begin{aligned} {\varvec{z}}=\left( y_1, \ldots , y_{n-1}, \frac{b-a_1y_1-\cdots -a_{n-1}y_{n-1}}{a_n}\right) ^T\,. \end{aligned}$$

Since \({\varvec{y}}\in L({\varvec{a}},b)\cap Q({\varvec{a}},b)\), the point \({\varvec{z}}\) is an integer point in the knapsack polyhedron \(P({\varvec{a}},b)\). Thus, in view of (23), it is sufficient to check that \(|z_n-b/a_n|\le \Vert {\varvec{a}}\Vert _{\infty }-1\). Since \({\varvec{y}}\in (a_n-1)S^{n-1}_{\varvec{1}}\), we have \(|a_1|y_1+\cdots +|a_{n-1}|y_{n-1}\le (a_n-1)\Vert {\varvec{a}}\Vert _{\infty }\). Therefore

$$\begin{aligned} \begin{aligned} \left| z_n-\frac{b}{a_n}\right| \le \frac{(a_n-1)\Vert {\varvec{a}}\Vert _{\infty }}{a_n} < \Vert {\varvec{a}}\Vert _{\infty }-1\,. \end{aligned} \end{aligned}$$

Suppose now that \(b\le 0\) and choose any vertex \({\varvec{v}}\) of the polyhedron \(P({\varvec{a}},b)\). We have \({\varvec{v}}=(0,\ldots , 0, b/a_j, 0, \ldots , 0)^T\) for some \(1\le j<n\) and, consequently, \({\varvec{w}}=\pi _n({\varvec{v}})\) is a vertex of the polyhedron \(P(\pi _n({\varvec{a}}),b)\). Let \({\varvec{u}}\) be the point obtained from \({\varvec{w}}\) by rounding up its jth entry, that is \({\varvec{u}}=(0,\ldots , 0, \lceil b/a_j\rceil , 0, \ldots , 0)^T\). Since all entries of \(\pi _n({\varvec{a}})\) are negative, we have \({\varvec{u}}\in Q({\varvec{a}},b)\).

By Lemmas  4 and 5, there is a point \({\varvec{y}}\in L({\varvec{a}},b)\) in the simplex \({\varvec{u}}+(a_n-1)S^{n-1}_{\varvec{1}}\). In view of (22), we have \(a_n\le \Vert {\varvec{a}}\Vert _{\infty }-1\). Hence

$$\begin{aligned} \Vert {\varvec{w}}-{\varvec{y}}\Vert _{\infty }\le a_n-1+ \Vert {\varvec{u}}-{\varvec{w}}\Vert _{\infty } <\Vert {\varvec{a}}\Vert _{\infty }-1\,. \end{aligned}$$
(24)

Let now

$$\begin{aligned} {\varvec{z}}=\left( y_1, \ldots , y_{n-1}, \frac{b-a_1y_1-\cdots -a_{n-1}y_{n-1}}{a_n}\right) ^T\,. \end{aligned}$$

Since \({\varvec{y}}\in {\varvec{u}}+{{\mathbb {R}}}^{n-1}_{\ge 0}\subset Q({\varvec{a}},b)\), the point \({\varvec{z}}\) is an integer point in the knapsack polyhedron \(P({\varvec{a}},b)\). Thus, noticing (24), it is sufficient to check that \(z_n\le \Vert {\varvec{a}}\Vert _{\infty }-1\). Observe that \(\pi _n({\varvec{a}})^T{\varvec{w}}=b\) and \(\pi _n({\varvec{a}})^T{\varvec{y}}=a_1y_1+\cdots +a_{n-1}y_{n-1}\). Therefore,

$$\begin{aligned} \begin{aligned}&b-a_1y_1-\cdots -a_{n-1}y_{n-1}=\pi _n({\varvec{a}})^T({\varvec{w}}-{\varvec{y}})=\pi _n({\varvec{a}})^T({\varvec{w}}-{\varvec{u}}+({\varvec{u}}-{\varvec{y}}))\\&\quad \le \lfloor |\pi _n({\varvec{a}})^T({\varvec{u}}-{\varvec{w}})|\rfloor +(a_n-1)\Vert {\varvec{a}}\Vert _{\infty } \le |a_j|-1+ (a_n-1)\Vert {\varvec{a}}\Vert _{\infty } \,. \end{aligned} \end{aligned}$$

The latter bound implies

$$\begin{aligned} \begin{aligned} z_n\le \left\lfloor \frac{ |a_j|-1+(a_n-1)\Vert {\varvec{a}}\Vert _{\infty }}{a_n}\right\rfloor \le \Vert {\varvec{a}}\Vert _{\infty }-1\,. \end{aligned} \end{aligned}$$

The lemma is proved. \(\square \)

Now, to prove the statement (i) of Theorem 1 in the general case we will proceed by induction on n.

The basis step \(n=2\) is immediately settled by Corollary 3 and Lemma 7. Suppose now that \(n\ge 3\) and the statement (i) of Theorem 1 holds in all dimensions \(2\le k<n\). We may assume without loss of generality that the condition (22) is satisfied. Indeed, rearranging the entries of \({\varvec{a}}\) and replacing \({\varvec{a}}\), b by \(-{\varvec{a}}\), \(-b\) we may assume that \( 0<a_n= \min _{i} |a_i|\). Furthermore, \(\min _{i} |a_i|=\Vert {\varvec{a}}\Vert _{\infty }\) would imply that \({\varvec{a}}=(\pm 1,\ldots , \pm 1, 1)^T\). In this case \({\varvec{a}}\) is totally unimodular and, consequently, \(P({\varvec{a}},b)\) is an integral polyhedron.

Furthermore, by Corollary 3 and Lemma 7, we may assume that at least one of the entries of \({\varvec{a}}\) is negative and the polyhedron \(P(\pi _n({\varvec{a}}),b)\) is unbounded.

Let \({\varvec{v}}\) be any vertex of \(P({\varvec{a}},b)\). Observe that \({\varvec{v}}\) has at most one nonzero entry \(b/a_j\) for some \(1\le j \le n\) and that \({\varvec{w}}=\pi _n({\varvec{v}})\) is a vertex of the polyhedron \(Q({\varvec{a}}, b)\). Suppose first that \({\varvec{w}}\ne {\varvec{0}}\). Rearranging the first \(n-1\) entries of \({\varvec{a}}\), we may assume without loss of generality that \({\varvec{w}}=(0,\ldots ,0,b/a_{n-1})^T\).

Clearly, \({\varvec{w}}\) is a vertex of \(P(\pi _n({\varvec{a}}),b)\). Suppose that \(P(\pi _n({\varvec{a}}),b)\cap L({\varvec{a}},b)\) is not empty. Recall that we use the notation \(h= \gcd (\pi _n({\varvec{a}}))\). By the inductive hypothesis, applied with \(\pi _n({\varvec{a}})/h\) and b / h, there exists an integer point \({\varvec{y}}=(y_1,\ldots , y_{n-1})^T\in P(\pi _n({\varvec{a}}),b)\) such that \(\Vert {\varvec{w}}-{\varvec{y}}\Vert _{\infty }\le \Vert \pi _n({\varvec{a}})\Vert _{\infty }/h-1\). Hence the point \({\varvec{z}}=(y_1,\ldots , y_{n-1},0)^T\in P({\varvec{a}},b)\) satisfies (2).

Next we will suppose that \(P(\pi _n({\varvec{a}}),b)\cap L({\varvec{a}},b)=\emptyset \). Noting (16), we have

$$\begin{aligned} P(\pi _n({\varvec{a}}),t)\cap L({\varvec{a}},t)=P(\pi _n({\varvec{a}}),t)\cap {{\mathbb {Z}}}^{n-1}\;\;\text { for any }t\in {{\mathbb {Z}}}\,. \end{aligned}$$
(25)

Hence \(P(\pi _n({\varvec{a}}),b)\cap {{\mathbb {Z}}}^{n-1}=\emptyset \) and, taking into account that \(P(\pi _n({\varvec{a}}),b)\) is unbounded, we have \(h\ge 2\). Since \(\gcd (h, a_n)=1\) and \(Q({\varvec{a}},b)=\{{\varvec{x}}\in {{\mathbb {R}}}_{\ge 0}^{n-1}: \pi _n({\varvec{a}})^T{\varvec{x}}\le b\}\), there exists an integer t such that

  1. (a)

    t is in the interval \([b-ha_n+1, b)\),

  2. (b)

    \(P(\pi _n({\varvec{a}}),t)\cap L({\varvec{a}},b)\) is not empty or, equivalently, \(t\equiv 0\;\mathrm {mod}\; h\) and \(t\equiv b\;\mathrm {mod}\; a_n\).

  3. (c)

    \(P(\pi _n({\varvec{a}}),t)\subset Q({\varvec{a}},b)\).

Notice that the condition (a) implies (c).

Let us choose a vertex \({\varvec{p}}\) of the polyhedron \(P(\pi _n({\varvec{a}}),t)\) in the following way. If \({\varvec{p}}'=(0,\ldots , 0, t/a_{n-1})^T\) is a vertex of \(P(\pi _n({\varvec{a}}),t)\), then we set \({\varvec{p}}={\varvec{p}}'\). Otherwise, we select \({\varvec{p}}\) as an arbitrary vertex of \(P(\pi _n({\varvec{a}}),t)\). By the inductive hypothesis, applied with \(\pi _n({\varvec{a}})/h\) and t / h, there exists an integer point \({\varvec{y}}=(y_1,\ldots , y_{n-1})^T\in P(\pi _n({\varvec{a}}),t)\) such that

$$\begin{aligned} ||{\varvec{p}}-{\varvec{y}}||_\infty \le \frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1\,. \end{aligned}$$

By (25), we have \({\varvec{y}}\in L({\varvec{a}},b)\) and, using (c), there exists an integer point \({\varvec{z}}=(y_1,\ldots , y_{n-1},z)^T\in P({\varvec{a}},b)\). Now \(a_1y_1+\cdots +a_{n-1}y_{n-1}+a_n z=b\) implies \(z=(b-t)/a_n\). Hence by (a) we have

$$\begin{aligned} |z|< h\le \Vert {\varvec{a}}\Vert _{\infty }. \end{aligned}$$
(26)

Recall that \({\varvec{p}}=(0,\ldots , 0, t/a_j, 0, \ldots , 0)^T\) for some \(1\le j\le n-1\) and \({\varvec{w}}=(0,\ldots ,0,b/a_{n-1})^T\). If \(j=n-1\), then by (a)

$$\begin{aligned} ||{\varvec{w}}-{\varvec{y}}||_\infty \le \left| \frac{b-t}{a_j}\right| +\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1\le \left| \frac{ha_n-1}{a_j}\right| +\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1\,. \end{aligned}$$

On the other hand, if \(j\ne n-1\) then, by construction of \({\varvec{p}}\), we have \(t/a_{n-1}<0\), so that \(bt<0\). Consequently, by (a), we get \(|b|+|t|\le ha_n-1\). Hence

$$\begin{aligned} ||{\varvec{w}}-{\varvec{y}}||_\infty \le \max \left( \left| \frac{t}{a_j}\right| , \left| \frac{b}{a_{n-1}}\right| \right) + \frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1\le \left| \frac{ha_n-1}{a_j}\right| +\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1\,. \end{aligned}$$

Taking into account (26), we have

$$\begin{aligned} ||{\varvec{v}}-{\varvec{z}}||_\infty \le \max \left( \left| \frac{ha_n-1}{a_j}\right| +\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1, \Vert {\varvec{a}}\Vert _{\infty }-1\right) \,. \end{aligned}$$

Suppose first that \(\Vert {\varvec{a}}\Vert _{\infty }=h\). Then \(|a_1|=\cdots =|a_{n-1}|=h\) and, using the assumption (22), we have \(a_n\le h-1\). Now we get

$$\begin{aligned} \left| \frac{ha_n-1}{a_j}\right| +\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1 \le \frac{h(h-1)-1}{h}+1-1< h-1\,. \end{aligned}$$

We may now assume that \(\Vert {\varvec{a}}\Vert _{\infty }\ge 2h\). Then, using (22),

$$\begin{aligned} \begin{aligned} \frac{ha_n-1}{|a_j|}+\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1\le h+\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1 \le \Vert {\varvec{a}}\Vert _{\infty }-1. \end{aligned} \end{aligned}$$

Let us now suppose that \({\varvec{w}}={\varvec{0}}\), so that \({\varvec{v}}=(0,\ldots , 0, b/a_n)^T\). In this setting, we will need to consider separately the case \(\Vert {\varvec{a}}\Vert _{\infty }=h=\gcd (\pi _n({\varvec{a}}))\). There exists an index \(1\le i< n\) such that \(\pi _i({\varvec{a}})\) has at least one negative entry. Hence, the polyhedron \(P(\pi _i({\varvec{a}}),b)\) is unbounded. Since \(|a_1|=\cdots =|a_{n-1}|=h\), we have \(\gcd (\pi _i({\varvec{a}}))=1\).

Next, \(\pi _i({\varvec{v}})\) is a vertex of \(P(\pi _i({\varvec{a}}),b)\) and, since \(\gcd (\pi _i({\varvec{a}}))=1\), we have \(P(\pi _i({\varvec{a}}),b)\cap {{\mathbb {Z}}}^{n-1}\ne \emptyset \). Then, by the inductive hypothesis, there exists an integer point \({\varvec{y}}\in P(\pi _i({\varvec{a}}),b)\) such that \(\Vert \pi _i({\varvec{v}})-{\varvec{y}}\Vert _{\infty }\le \Vert \pi _i({\varvec{a}})\Vert _{\infty }-1\). Therefore, (2) holds with the integer point \({\varvec{z}}=(y_1,\ldots , y_{i-1},0, y_{i+1}, \ldots , y_{n-1})^T\in P({\varvec{a}},b)\). For the rest of the proof of the part (i) we will assume without loss of generality that

$$\begin{aligned} \Vert {\varvec{a}}\Vert _{\infty }\ge 2h\,. \end{aligned}$$
(27)

Since \({\varvec{0}}={\varvec{w}}\in Q({\varvec{a}},b)\), there exists an integer t such that

(\(\hbox {a}'\)):

t is in the interval \([-ha_n+1, 0]\),

(\(\hbox {b}'\)):

\(P(\pi _n({\varvec{a}}),t)\cap L({\varvec{a}},b)\) is not empty,

(\(\hbox {c}'\)):

\(P(\pi _n({\varvec{a}}),t)\subset Q({\varvec{a}},b)\).

Let \({\varvec{p}}\) be a vertex of the polyhedron \(P(\pi _n({\varvec{a}}),t)\). By the inductive hypothesis, applied with \(\pi _n({\varvec{a}})/h\) and t / h, there exists an integer point \({\varvec{y}}=(y_1,\ldots , y_{n-1})^T\in P(\pi _n({\varvec{a}}),t)\) such that

$$\begin{aligned} ||{\varvec{p}}-{\varvec{y}}||_\infty \le \frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1\,. \end{aligned}$$

By (25), we have \({\varvec{y}}\in L({\varvec{a}},t)\). Therefore, using (\(\hbox {c}'\)), there exists an integer point \({\varvec{z}}=(y_1,\ldots , y_{n-1},z)^T\in P({\varvec{a}},b)\). Next, \(a_1y_1+\cdots +a_{n-1}y_{n-1}+a_n z=b\) implies \(z=(b-t)/a_n\) and, by (\(\hbox {a}'\)), we have

$$\begin{aligned} \left| z-\frac{b}{a_n}\right| \le h-\frac{1}{a_n}< \Vert {\varvec{a}}\Vert _{\infty }-1\,, \end{aligned}$$
(28)

where the last inequality follows from (27).

Observe that \({\varvec{p}}=(0,\ldots , 0, t/a_j, 0, \ldots , 0)^T\) for some \(1\le j\le n-1\). Since \({\varvec{v}}=(0,\ldots ,0,b/a_{n})^T\) and taking into account (28), we have

$$\begin{aligned} ||{\varvec{v}}-{\varvec{z}}||_\infty \le \max \left( \left| \frac{t}{a_j}\right| +\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1, \Vert {\varvec{a}}\Vert _{\infty }-1\right) \,. \end{aligned}$$

Now, using (\(\hbox {a}'\)), (22) and (27),

$$\begin{aligned} \begin{aligned} \left| \frac{t}{a_j}\right| +\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1&\le \frac{ha_n-1}{|a_j|}+\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1\le h+\frac{\Vert {\varvec{a}}\Vert _{\infty }}{h}-1\\&\le \Vert {\varvec{a}}\Vert _{\infty }-1. \end{aligned} \end{aligned}$$

This completes the proof of part (i).

To prove part (ii), we set \({\varvec{a}}=(k,\ldots ,k,1)^T\) and \(b=k-1\). The knapsack polyhedron \(P({\varvec{a}},b)\) contains precisely one integer point, \({\varvec{z}}=(k-1)\cdot \varvec{e}_n\). Choosing the vertex \({\varvec{v}}=\frac{k-1}{k}\cdot \varvec{e}_1\) of \(P({\varvec{a}},b)\) we get \(\Vert {\varvec{v}}-{\varvec{z}}\Vert _{\infty }=k-1 =\Vert {\varvec{a}}\Vert _{\infty }-1\).

4 Proof of Corollary 1

The part (i) immediately follows from part (i) of Theorem 1. To prove part (ii) it is sufficient to consider the same \({\varvec{a}}, b\) as in the proof of part (ii) of Theorem 1 and take \(\varvec{c}=\varvec{e}_n\). Then the integer programming problem (5) has precisely one feasible, and therefore optimal, integer solution \((k-1)\cdot \varvec{e}_n\). Thus \(IP(\varvec{c},{\varvec{a}},b)=k-1\). The corresponding linear relaxation (6) has the, in general not unique, optimal solution \(\frac{k-1}{k}\cdot \varvec{e}_1\) with \(LP(\varvec{c},{\varvec{a}},b)=0\). Hence, \(\mathrm {Gap}(\varvec{c},{\varvec{a}}) \ge IG(\varvec{c}, {\varvec{a}},b) = k-1 = (\Vert {\varvec{a}}\Vert _{\infty }-1) \Vert {\varvec{c}}\Vert _1\).

5 Proof of Theorem 2

We will first obtain an analog of Lemma 6 for the unbounded polyhedra \(P({\varvec{a}},b)\).

Set \({\varvec{a}}^+=(|a_1|, \ldots , |a_n|)^T\). For convenience, we will work with the quantity

$$\begin{aligned} f({\varvec{a}}^+)= g({\varvec{a}}^+)+|a_1| +\cdots + |a_n|\,. \end{aligned}$$

Lemma 8

Let \({\varvec{a}}\in {{\mathbb {Z}}}^{ n}\) satisfy (1) and \(b\in {{\mathbb {Z}}}\). If \(P({\varvec{a}},b)\) is unbounded then

$$\begin{aligned} {d}({\varvec{a}},b)\le \frac{(n-1)f({\varvec{a}}^+)}{\min _i |a_i|}\,. \end{aligned}$$

Proof

We will use the notation from the proof of Theorem 1. Let \({\varvec{v}}\) be any vertex of \(P({\varvec{a}},b)\). Rearranging the entries of \({\varvec{a}}\) and replacing \({\varvec{a}}\), b by \(-{\varvec{a}}\), \(-b\), we may assume that \({\varvec{v}}=(0,\ldots , 0, b/a_n)^T\), \(a_n>0\), and \(b\ge 0\). The unbounded polyhedron

$$\begin{aligned} Q({\varvec{a}},b)=\pi _n(P({\varvec{a}},b))=\{{\varvec{x}}\in {{\mathbb {R}}}^{n-1}_{\ge 0}: a_1 x_1 +\cdots + a_{n-1} x_{n-1}\le b\}\, \end{aligned}$$

can be represented in the form \(Q({\varvec{a}},b)=R({\varvec{a}},b)+C({\varvec{a}},b)\), where \(R({\varvec{a}},b)\) is a polytope and

$$\begin{aligned} C({\varvec{a}},b)=\{{\varvec{x}}\in {{\mathbb {R}}}^{n-1}_{\ge 0}: a_1 x_1 +\cdots + a_{n-1} x_{n-1}\le 0\}\, \end{aligned}$$

is the recession cone of the polyhedron \(Q({\varvec{a}},b)\) (see e.g. [22, Section 8.2]). For \(t\ge 0\) let \({\varvec{u}}(t)=(u_1(t), \ldots , u_{n-1}(t))^T\) with

$$\begin{aligned} u_i(t)=\left\{ \begin{array}{ll} -t/a_i, &{} \text { if }a_i<0\,,\\ 0, &{} \text { otherwise}\,. \end{array} \right. \end{aligned}$$

Observe that \({\varvec{u}(t)}+tS_{\varvec{a}}\subset C({\varvec{a}},b)\). Indeed, it is easy to check that \(C({\varvec{a}},b)\) contains all vertices \({\varvec{u}}(t)\), \({\varvec{u}}(t)+ (t/a_i) {\varvec{e}}_i\), \(1\le i\le n-1\) of the simplex \({\varvec{u}(t)}+tS_{\varvec{a}}\).

Recall that \(\mathrm {sign}(a_i)=a_i/|a_i|\) for \(1\le i \le n\). Let \(\phi \) be the linear map that sends a vector \({\varvec{x}}=(x_1, \ldots , x_{n-1})^T\in {{\mathbb {R}}}^{n-1}\) to the vector \(\phi ({\varvec{x}})= (\mathrm {sign}(a_1)x_1, \ldots , \mathrm {sign}(a_{n-1})x_{n-1})^T\). Observe that \(\phi (S_{{\varvec{a}}^+})=S_{\varvec{a}}\) and \(\phi (\varLambda _{{\varvec{a}}^+})=\varLambda _{\varvec{a}}\) . Therefore, by (14) and the linear invariance of the covering radius, we have

$$\begin{aligned} f({\varvec{a}}^+)= \mu (S_{{\varvec{a}}^+},\varLambda _{{\varvec{a}}^+}) = \mu (S_{\varvec{a}}, \varLambda _{\varvec{a}}). \end{aligned}$$
(29)

Let \(t_0=f({\varvec{a}}^+)\). Hence, using (29), \(t_0 S_{\varvec{a}} + \varLambda _{\varvec{a}}\) is a covering of \({{\mathbb {R}}}^{n-1}\). We have \({\varvec{u}}(t_0)+t_0 S_{\varvec{a}}\subset C({\varvec{a}},b)\subset Q({\varvec{a}},b)\), where the last inclusion follows from the assumption that \(b\ge 0\). By Lemma 1, there exists a point \({\varvec{y}}\) of the affine lattice \(L({\varvec{a}},b)\) in \({\varvec{u}}(t_0)+t_0 S_{\varvec{a}}\). Therefore, \(|y_i|\le t_0/|a_i|\) for \(1\le i \le n-1\). Hence, there exists a point \({\varvec{z}}=(y_1, \ldots , y_{n-1},z)^T\in \varLambda ({\varvec{a}},b)\cap P({\varvec{a}},b)\) with

$$\begin{aligned} \begin{aligned} z=\frac{b-a_1y_1-\cdots -a_{n-1}y_{n-1}}{a_n}=\frac{b}{a_n}-\frac{a_1y_1+\cdots +a_{n-1}y_{n-1}}{a_n} \le v_n+\frac{(n-1)t_0}{a_n}\,. \end{aligned} \end{aligned}$$

The lemma is proved. \(\square \)

Set

$$\begin{aligned} {R}= \{{\varvec{a}}\in {{\mathbb {Z}}}^{ n}: 0<a_1\le \cdots \le a_n\} \, \end{aligned}$$

and recall that

$$\begin{aligned} N_{\epsilon }(t,H)=\#\left\{ {\varvec{a}}\in {{Q}}(H): \max _{b\in {{\mathbb {Z}}}}\frac{{d}({\varvec{a}},b)}{\Vert {\varvec{a}}\Vert _{\infty }^{\epsilon }}>t \right\} \,. \end{aligned}$$

By Lemmas 6 and 8, we have

$$\begin{aligned} \begin{aligned} N_{\epsilon }(t,H)\ll _n\, \#\left\{ {\varvec{a}}\in {{Q}}(H)\cap {R}: \frac{(n-1)f({\varvec{a}})}{a_1 a_n^{\epsilon }}>t \right\} \,. \end{aligned} \end{aligned}$$
(30)

We keep \(t' > 0\) to be fixed later. Then, setting \(s({\varvec{a}})= a_{n-1} a_n^{1/(n-1)}\) and noting (30), we get

$$\begin{aligned} N_{\epsilon }(t,H)&\ll _n&\, \#\left\{ {\varvec{a}}\in {{Q}}(H)\cap {R}: \frac{(n-1)f({\varvec{a}})}{s({\varvec{a}})}>t' \text{ or } \frac{s({\varvec{a}})}{a_1a_n^{\epsilon }}> \frac{t}{t'}\right\} \nonumber \\\le & {} \#\left\{ {\varvec{a}}\in {{Q}}(H)\cap {R}: \frac{f({\varvec{a}})}{s({\varvec{a}})}>\frac{t'}{n-1}\right\} \nonumber \\&+ \,\,\#\left\{ {\varvec{a}}\in {{Q}}(H)\cap {R}: \frac{a_{n-1}}{a_1 a_n^{\epsilon -1/(n-1)}} > \frac{t}{t'}\right\} \,. \end{aligned}$$
(31)

The first of the last two terms in (31) can be estimated using a special case of Theorem 3 in Strömbergsson [23].

Lemma 9

$$\begin{aligned} \#\left\{ {\varvec{a}}\in {{Q}}(H)\cap {R}: \frac{f({\varvec{a}})}{s({\varvec{a}})}>\frac{r}{n-1}\right\} \ll _n \frac{1}{r^{n-1}} N(H) \,, \end{aligned}$$
(32)

uniformly over all \(r>0\) and \(H\ge 1\).

Proof

The inequality (32) follows from Theorem 3 in [23]. Specifically, we apply the theorem to \({\mathcal D}=[0,1]^{n-1}\). Notice that \(\#({{Q}}(H)\cap {R}) \asymp _n \#{Q}(H)=N(H)\) and the normalization \(s(\varvec{a})\asymp _n\left( \sum _{j=1}^n a_j\sqrt{\Vert \varvec{a}\Vert ^2_2-a_j^2}\right) /\left( \Vert a\Vert _2^{1-1/(d-1)}\right) \) for \(\varvec{a} \in R\). Then, using the notation of [23], the left-hand side of the inequality (32) is \(\ll _n \#({\hat{{{\mathbb {N}}}}}^n \cap H{\mathcal {D}})\cdot {{\tilde{P}}}_n(H,r)\) over all \(H\ge 1\) and \(r>0\). \(\square \)

To estimate the last term in (31), we will need the following lemma.

Lemma 10

$$\begin{aligned} \#\left\{ {\varvec{a}}\in {{Q}}(H)\cap {R}: \frac{a_{n-1}}{a_1 a_n^{\epsilon -1/(n-1)}} > r\right\} \ll _n \frac{1}{rH^{\epsilon -1/(n-1)}}N(H) \,, \end{aligned}$$
(33)

uniformly over all \(r>0\) and \(H\ge 1\).

Proof

Since \({\varvec{a}}\in {R}\), we have \(a_{n-1}\le a_n\). Hence

$$\begin{aligned} \#\left\{ {\varvec{a}}\in {{Q}}(H)\cap {R}: \frac{a_{n-1}}{a_1 a_n^{\epsilon -1/(n-1)}}> r\right\} \le \#\left\{ {\varvec{a}}\in {{Q}}(H)\cap {R}: a_n^{1+1/(n-1)-\epsilon }> r a_1\right\} \,. \end{aligned}$$

Furthermore, all \({\varvec{a}}\in {{Q}}(H)\cap {R}\) with \(a_n^{1+1/(n-1)-\epsilon }> r a_1\) are in the set

$$\begin{aligned} U=\{{\varvec{a}}\in {{\mathbb {Z}}}^{ n}: 0< a_1< H^{1+1/(n-1)-\epsilon }/r, 0< a_i\le H, i=2, \ldots , n\}\,. \end{aligned}$$

It is easy to show that

$$\begin{aligned} \frac{1}{3} <\frac{N(H)}{H^n}\le 1, \end{aligned}$$
(34)

see for example the proof of Lemma 1 in [3]. Then, since \(\#(U\cap {{\mathbb {Z}}}^n)< \min \{H^{n+1/(n-1)-\epsilon }/r, H^n\}\), the result follows. \(\square \)

Then by (31)–(33)

$$\begin{aligned} \frac{N_{\epsilon }(t,H)}{N(H)} \ll _n \frac{1}{(t')^{n-1}} + \frac{t'}{tH^{\epsilon -1/(n-1)}}\,. \end{aligned}$$
(35)

Next, we will bound H from below in terms of t, similar to Theorem 3 in [23]. The upper bound of Schur (21) implies \(f({\varvec{a}})< n a_1 a_n\). Thus, using (30),

$$\begin{aligned} \begin{aligned} N_{\epsilon }(t,H)&\ll _n \#\left\{ {\varvec{a}}\in {{Q}}(H)\cap {R}: \frac{(n-1)f({\varvec{a}})}{a_1 a_n^{\epsilon }}>t \right\} \\&\le \#\left\{ {\varvec{a}}\in {{Q}}(H)\cap {R}: a_n^{1-\epsilon }>\frac{t}{n(n-1)} \right\} \,. \end{aligned} \end{aligned}$$

The latter set is empty if \(H \le (t/(n(n-1)))^{\frac{1}{1-\epsilon }}\). Hence we may assume

$$\begin{aligned} H > \left( \frac{t}{n(n-1)}\right) ^{\frac{1}{1-\epsilon }}\,. \end{aligned}$$
(36)

Using (35), (36), and noticing that \(\epsilon <3/4\), we have

$$\begin{aligned} \frac{N_{\epsilon }(t,H)}{N(H)}\ll _n \frac{1}{(t')^{n-1}} + \frac{t'}{ t^{ 1+\frac{ 1 }{ 1-\epsilon } \left( \epsilon -\frac{1}{n-1}\right) } }\,. \end{aligned}$$
(37)

To minimise the exponent of the right hand side of (37), set \(t'=t^\beta \) and choose \(\beta \) with

$$\begin{aligned} \beta (n-1)= 1+\frac{ 1 }{ 1-\epsilon } \left( \epsilon -\frac{1}{n-1}\right) -\beta \,. \end{aligned}$$
(38)

We get

$$\begin{aligned} \beta = \frac{n -2}{n(n-1)(1-\epsilon )} \end{aligned}$$

and, by (37) and (38),

$$\begin{aligned} \frac{N_{\epsilon }(t,H)}{N(H)} \ll _n t^{-\alpha (\epsilon ,n)}\, \end{aligned}$$

with \(\alpha (\epsilon ,n)=\beta (n-1)\). The theorem is proved.

6 Proof of Corollary 2

It is sufficient to show (9) for

$$\begin{aligned} \frac{2}{n}<\epsilon <\frac{3}{4}\,. \end{aligned}$$
(39)

Observe that the conditions \(n\ge 3\) and \(\epsilon >2/n\) imply that in (4) \(\alpha (\epsilon , n)>1\). For an integer s, consider the vectors \({\varvec{a}}\in {Q}(H)\) with

$$\begin{aligned} e^{s-1}\le \max _{{\varvec{c}}\in {{\mathbb {Q}}}^n}\frac{\mathrm {Gap}({\varvec{c}}, {\varvec{a}})}{\Vert {\varvec{a}}\Vert _{\infty }^{\epsilon }\Vert {\varvec{c}}\Vert _1}<e^s\,. \end{aligned}$$
(40)

By (7), we have

$$\begin{aligned} \max _{{\varvec{c}}\in {{\mathbb {Q}}}^n}\frac{\mathrm {Gap}({\varvec{c}}, {\varvec{a}})}{\Vert {\varvec{a}}\Vert _{\infty }^{\epsilon }\Vert {\varvec{c}}\Vert _1}\le \max _{b\in {{\mathbb {Z}}}}\frac{{d}({\varvec{a}},b)}{\Vert {\varvec{a}}\Vert _{\infty }^{\epsilon }}\,. \end{aligned}$$

Therefore, the contribution of vectors satisfying (40) to the sum

$$\begin{aligned} \sum _{{\varvec{a}}\in {Q}(H)}\max _{{\varvec{c}}\in {{\mathbb {Q}}}^n}\frac{\mathrm {Gap}({\varvec{c}}, {\varvec{a}})}{\Vert {\varvec{a}}\Vert _{\infty }^{\epsilon }\Vert {\varvec{c}}\Vert _1} \end{aligned}$$

is

$$\begin{aligned} \le N_{\epsilon }(e^{s-1}, H)e^{s}\ll _n e^{-\alpha (\epsilon , n) s}e^s N(H)\,, \end{aligned}$$

where the last inequality holds by (4) and the upper bound in (39). Therefore

$$\begin{aligned} \frac{1}{N(H)}\sum _{{\varvec{a}}\in {Q}(H)}\max _{{\varvec{c}}\in {{\mathbb {Q}}}^n}\frac{\mathrm {Gap}({\varvec{c}}, {\varvec{a}})}{\Vert {\varvec{a}}\Vert _{\infty }^{\epsilon }\Vert {\varvec{c}}\Vert _1}\ll _n \sum _{s=1}^\infty e^{s(1-\alpha (\epsilon , n))}\,. \end{aligned}$$

Finally, observe that the series

$$\begin{aligned} \sum _{s=1}^\infty e^{s(1-\alpha (\epsilon , n))} \end{aligned}$$

is convergent for \(\alpha (\epsilon , n)>1\).

7 Proof of Theorem 3

We will first show that \(\mathrm {Gap}({\varvec{c}},{\varvec{a}})\) is bounded from below by the lattice programming gap associated with a certain lattice program.

For a vector \(\bar{\varvec{l}}\in {{\mathbb {Q}}}^{n-1}_{>0}\), an \((n-1)\)-dimensional lattice \(\varLambda \subset {{\mathbb {Z}}}^{n-1}\) and \({\varvec{r}}\in {{\mathbb {Z}}}^{n-1}\) consider the lattice program (also referred to as the group problem)

$$\begin{aligned} \begin{aligned} \min \{\bar{\varvec{l}}^T {\varvec{x}}: {\varvec{x}} \equiv {\varvec{r}} (\,\mathrm {mod}\; \varLambda ), {\varvec{x}}\in {{\mathbb {R}}}^{n-1}_{\ge 0}\}\,. \end{aligned} \end{aligned}$$
(41)

Here \({\varvec{x}} \equiv {\varvec{r}} (\,\mathrm {mod}\; \varLambda )\) if and only if \({\varvec{x}} - {\varvec{r}}\) is a point of \(\varLambda \).

Let \(m(\varLambda ,\bar{\varvec{l}}, {\varvec{r}})\) denote the value of the minimum in (41). The lattice programming gap\(\mathrm {Gap}(\varLambda , \bar{\varvec{l}})\) of (41) is defined as

$$\begin{aligned} \begin{aligned} \mathrm {Gap}(\varLambda ,\bar{\varvec{l}})=\max _{{\varvec{r}}\in {{\mathbb {Z}}}^{n-1}}m(\varLambda ,\bar{\varvec{l}}, {\varvec{r}})\,. \end{aligned} \end{aligned}$$
(42)

Notice that the maximum is attained because \(m(\varLambda ,\bar{\varvec{l}}, {\varvec{r}})\) is constant for all \(\varvec{r}\) in the same congruence class modulo \(\varLambda \) and there are precisely \(\det (\varLambda )\) congruence classes. The lattice programming gaps were introduced and studied for sublattices of all dimensions in \({{\mathbb {Z}}}^{n-1}\) by Hoşten and Sturmfels [17].

To proceed with the proof of the part (i), we assume without loss of generality that \(\tau ({\varvec{a}}, {\varvec{c}})=\{n\}\). The (Gomory’s) group relaxation to (5) is a lattice program

$$\begin{aligned} \begin{aligned} \min \{ {\varvec{l}}^T {\varvec{x}}: {\varvec{x}} \equiv {\varvec{r}}\; (\,\mathrm {mod}\; \varLambda _{{\varvec{a}}}), {\varvec{x}}\in {{\mathbb {R}}}^{n-1}_{\ge 0}\}\,, \end{aligned} \end{aligned}$$
(43)

where \({\varvec{l}}={\varvec{l}}({{\varvec{a}}},{\varvec{c}})\) is the vector from Theorem 3 and \({\varvec{r}}\in {{\mathbb {Z}}}^{n-1}\) is any point of the affine lattice \(\pi _n(\varLambda ({\varvec{a}}, b))\). We refer the reader to [22, Section 24.2] and [24] for a detailed introduction to the theory of group relaxations.

The group relaxation (43) provides a lower bound for the integrality gap of (5). Specifically, for any \(b\in {{\mathbb {Z}}}\) such that (5) is feasible and bounded, we have

$$\begin{aligned} IG({\varvec{c}}, {\varvec{a}}, b)\ge m(\varLambda _{{\varvec{a}}},{\varvec{l}}, {\varvec{r}}), \end{aligned}$$
(44)

for all \(\varvec{r} \in \pi _n(\varLambda ({\varvec{a}}, b))\). On the other hand, for every \(\varvec{r}\in {{\mathbb {Z}}}^{n-1}\) there exists a \(b\in {{\mathbb {Z}}}\) such that (5) is feasible and \(\varvec{r} \in \pi _n(\varLambda ({\varvec{a}}, b))\). Consequently, by (44),

$$\begin{aligned} \mathrm {Gap}({\varvec{c}}, {\varvec{a}})\ge \mathrm {Gap}(\varLambda _{\varvec{a}}, {\varvec{l}})\,. \end{aligned}$$
(45)

We will need the following result, obtained in [1].

Proposition 1

(Theorem 1.2 (i) in [1]) For any \(\bar{\varvec{l}}=(\bar{l}_1, \ldots , {\bar{l}}_k)^T\in {{\mathbb {Q}}}^k_{>0}\), \(k\ge 2\), and any k-dimensional lattice \(\varLambda \subset {{\mathbb {Z}}}^k\)

$$\begin{aligned} \mathrm {Gap}(\varLambda ,\bar{\varvec{l}})\ge \rho _k (\det (\varLambda ) {\bar{l}}_1 \cdots {\bar{l}}_k)^{1/k}-\Vert \bar{\varvec{l}}\Vert _1. \end{aligned}$$

Note that for \(n=2\) we have \(\mathrm {Gap}(\varLambda _{\varvec{a}}, {\varvec{l}})=l_1(|a_2|-1)\) and thus (45) implies (10). For \(n>2\), the bound (10) immediately follows from (45) and Proposition 1.

The proof of the part (ii) will be based on the following lemma.

Lemma 11

Let \({\varvec{a}}\in {{\mathbb {Z}}}^n_{>0}\) satisfy (1), \({\varvec{c}}=(a_1, \ldots , a_{n-1}, 0)^T\) and \({\varvec{l}}=(a_1, \ldots , a_{n-1})^T\). Then

$$\begin{aligned} \mathrm {Gap}({\varvec{c}}, {\varvec{a}})= \mathrm {Gap}(\varLambda _{\varvec{a}}, {\varvec{l}})\,. \end{aligned}$$
(46)

Proof

Recall that \(\varLambda ({\varvec{a}},b)=\{{\varvec{x}}\in {{\mathbb {Z}}}^n: {\varvec{a}}^T{\varvec{x}}=b\}\) denotes the affine lattice formed by integer points in the affine hyperplane \({\varvec{a}}^T{\varvec{x}}=b\) and \(P({\varvec{a}},b)=\{{\varvec{x}}\in {{\mathbb {R}}}_{\ge 0}: {\varvec{a}}^T{\varvec{x}}=b\}\) denotes the knapsack polytope. The assumption \({\varvec{a}}\in {{\mathbb {Z}}}^n_{>0}\) implies that the linear programming relaxation (6) is feasible if and only if b is nonnegative. Suppose that for a nonnegative b the knapsack problem (5) has solution \({\varvec{y}}\in {{\mathbb {Z}}}^n_{\ge 0}\). Then for \({\varvec{r}}=\pi _n({\varvec{y}})\in {{\mathbb {Z}}}^{n-1}_{\ge 0}\)

$$\begin{aligned} \pi _n(\varLambda ({\varvec{a}},b))={\varvec{r}}+\varLambda _{\varvec{a}}\,. \end{aligned}$$

As \(c_n=0\), the optimal value of the linear programming relaxation \(LP({\varvec{c}},{\varvec{a}}, b)=0\). Therefore, noting that \({\varvec{c}}=(a_1, \ldots , a_{n-1}, 0)^T\) and \({\varvec{l}}=\pi _n({\varvec{c}})\),

$$\begin{aligned} IG({\varvec{c}},{\varvec{a}}, b)=\min \{{\varvec{l}}^T {\varvec{x}}: {\varvec{x}}\in {\varvec{r}}+\varLambda _{\varvec{a}}\,, {\varvec{x}}\in \pi _n(P({\varvec{a}}, b)) \}\,. \end{aligned}$$
(47)

Since

$$\begin{aligned} \pi _n(P({{\varvec{a}}}, b))=bS_{{\varvec{a}}}=\{{\varvec{x}}\in {{\mathbb {R}}}^{n-1}_{\ge 0}: {\varvec{l}}^T {\varvec{x}}\le b\}\, \end{aligned}$$

and \({\varvec{l}}^T {\varvec{r}}\le {\varvec{a}}^T{\varvec{y}}=b\), the constraint \({\varvec{x}}\in \pi _n(P({{\varvec{a}}}, b))\) in (47) can be replaced by \({\varvec{x}}\in {{\mathbb {R}}}^{n-1}_{\ge 0}\). Consequently, we have

$$\begin{aligned} IG({\varvec{c}},{\varvec{a}}, b)= m(\varLambda _{\varvec{a}},{\varvec{l}}, {\varvec{r}})\,. \end{aligned}$$

Hence, by (42), we obtain

$$\begin{aligned} \mathrm {Gap}({\varvec{c}}, {\varvec{a}})\le \mathrm {Gap}(\varLambda _{\varvec{a}}, {\varvec{l}})\,. \end{aligned}$$

Together with (45), this implies (46). \(\square \)

As was shown in the proof of Theorem 1.1 in [1], for \({\varvec{l}}=(a_1, \ldots , a_{n-1})^T\)

$$\begin{aligned} \mathrm {Gap}(\varLambda _{\varvec{a}}, {\varvec{l}})=g({\varvec{a}})+a_n\,. \end{aligned}$$

Thus we obtain the following corollary.

Corollary 4

Let \({\varvec{a}}=(a_1, \ldots , a_n)^T\in {{\mathbb {Z}}}^n_{>0}\) satisfy (1) and \({\varvec{c}}=(a_1, \ldots , a_{n-1}, 0)^T\). Then

$$\begin{aligned} \mathrm {Gap}({\varvec{c}}, {\varvec{a}})= g({\varvec{a}})+a_n\,. \end{aligned}$$

To complete the proof of Theorem 3 we will need the following result, obtained in [2].

Proposition 2

(see Theorem 1.1 (ii) in [2]) For any \(\epsilon >0\), there exists a vector \({\varvec{a}}\in {{\mathbb {Z}}}^{n}_{>0}\) such that

$$\begin{aligned} g({\varvec{a}})<(\rho _{n-1}+\epsilon ) (a_1\cdots a_n)^{1/(n-1)}- \Vert {\varvec{a}}\Vert _1\,. \end{aligned}$$

For \(n=2\), we have

$$\begin{aligned} g({\varvec{a}})=a_1a_2-a_1-a_2 \end{aligned}$$

by a classical result of Sylvester (see e.g. [20]). Hence the part (ii) immediately follows from Corollary 4. For \(n>2\), the part (ii) follows from Corollary 4 and Proposition 2.

8 Proof of Theorem 4

We will denote for \({\varvec{a}}\in Q(H)\cap {{\mathbb {Z}}}^n_{>0}\) the index of a maximum coordinate by \(i({\varvec{a}})\) and we set \({\varvec{c}}_{{\varvec{a}}}=-\varvec{e}_{i({\varvec{a}})}\). The tuples \(({\varvec{a}},{\varvec{c}}_{\varvec{a}} )\) are generic and in view of Theorem 3 we find

$$\begin{aligned} \begin{aligned} \mathrm {Gap}({{\varvec{c}}_{\varvec{a}}}, {\varvec{a}})&\ge \rho _{n-1} a_{i({\varvec{a}})}^{1/(n-1)}\left( \prod _{i=1, i\ne i({\varvec{a}})}^{n}\frac{a_i}{a_{i({\varvec{a}})}}\right) ^{1/(n-1)} - \sum _{i=1, i\ne i({\varvec{a}})}^n \frac{a_i}{a_{i({\varvec{a}})}} \\&\ge \frac{1}{\Vert \varvec{\varvec{a}}\Vert _\infty }\rho _{n-1} \left( \prod _{i=1}^{n} a_i\right) ^{1/(n-1)}-n+1. \end{aligned} \end{aligned}$$

Hence

$$\begin{aligned} \frac{\mathrm {Gap}({\varvec{c}}_{\varvec{a}},{\varvec{a}})}{\Vert {\varvec{a}}\Vert _\infty ^{1/(n-1)}} \ge \rho _{n-1} \frac{1}{\Vert {\varvec{a}}\Vert _\infty ^{1+1/(n-1)}} \left( \prod _{i=1}^{n} a_i\right) ^{1/(n-1)}-\frac{n-1}{\Vert {\varvec{a}}\Vert _\infty ^{1/(n-1)}}. \end{aligned}$$

Next we observe that

$$\begin{aligned} \begin{aligned} \sum _{{\varvec{a}}\in Q(H)\cap {{\mathbb {Z}}}^n_{>0}} \frac{1}{\Vert {\varvec{a}}\Vert _\infty ^{1/(n-1)}}&\le n\,H^{n-1}\sum _{t=1}^H \frac{1}{t^{1/(n-1)}} \le n\,H^{n-1}\left( 1+\int _{1}^H \frac{1}{t^{1/(n-1)}}\mathrm{d}t\right) \\&\le \frac{n-1}{n-2}n\,H^{n-1} H^{1-1/(n-1)} \le 2\,n\, H^{n-1/(n-1)} \end{aligned} \end{aligned}$$

for \(n\ge 3\). Since \(N(H)> \tfrac{1}{3} H^n\), by (34), we know that

$$\begin{aligned} \begin{aligned}&\frac{1}{N(H)}\sum _{{\varvec{a}}\in Q(H)} \max _{\varvec{c}\in {{\mathbb {Q}}}^n}\frac{\mathrm {Gap}({\varvec{c}}, {\varvec{a}})}{\Vert {\varvec{a}}\Vert _\infty ^{1/(n-1)}\Vert \varvec{c}\Vert _1} \ge \frac{1}{N(H)} \sum _{{\varvec{a}}\in Q(H)\cap {{\mathbb {Z}}}^n_{>0}} \frac{\mathrm {Gap}({\varvec{c}}_{\varvec{a}}, {\varvec{a}})}{\Vert {\varvec{a}}\Vert _\infty ^{1/(n-1)}}\\&\quad \ge \rho _{n-1}\frac{1}{N(H)} \sum _{{\varvec{a}}\in Q(H)\cap {{\mathbb {Z}}}^n_{>0}} \left( \prod _{i=1}^{n} \frac{a_i}{\Vert {\varvec{a}}\Vert _\infty }\right) ^{1/(n-1)}- \frac{6n^2}{ H^{1/(n-1)}}. \end{aligned} \end{aligned}$$

Instead of summing over all \(Q(H)\cap {{\mathbb {Z}}}^n_{>0}\) in the first summand we will consider the subset

$$\begin{aligned} {{\overline{Q}}}(H)=\left\{ {\varvec{a}}\in Q(H)\cap {{\mathbb {Z}}}^n_{>0} : a_i\ge \frac{H}{2},\, 1\le i\le n\right\} \end{aligned}$$

for which we know \(a_i/\Vert {\varvec{a}}\Vert _\infty \ge 1/2\). In order to estimate (very roughly) the cardinality of \({{\overline{Q}}}(H)\) we start with \(n=2\) and we denote this 2-dimensional set by \({{\overline{Q}}}_2(H)\). There are at most

$$\begin{aligned} \left( \left\lfloor \frac{H}{m}\right\rfloor -\left\lceil \frac{H}{2m}\right\rceil +1 \right) ^2 \le \left( \frac{H}{2m}+1\right) ^2 \end{aligned}$$

tuples \((a,b)\in [0,H]^2\) with \(\gcd (a,b)=m\) and \(a,b\ge H/2\). Thus

$$\begin{aligned} \begin{aligned} \#{{\overline{Q}}}_2(H)&\ge \left( \frac{H}{2}\right) ^2 - \sum _{m=2}^{H/2}\left( \frac{H}{2m}+1\right) ^2 \ge \frac{H^2}{4}\left( 1-\sum _{m=2}^\infty \frac{1}{m^2}\right) - H \sum _{m=2}^{H/2}\frac{1}{m} -\frac{H}{2} \\&\ge \frac{H^2}{4}\left( 2-\frac{\pi ^2}{6}\right) - H \sum _{m=1}^{H/2}\frac{1}{m} \ge \frac{H^2}{12} - H\, (1+\ln (H/2))\\&\ge \frac{H^2}{12} -2\, H\ln (H), \end{aligned} \end{aligned}$$

for \(H\ge 2\). Since \(\# {{\overline{Q}}}(H)\ge \#{\overline{Q}}_2(H)\times (H/2)^{n-2}\) we get

$$\begin{aligned} \begin{aligned}&\frac{1}{N(H)} \sum _{{\varvec{a}}\in Q(H)\cap {{\mathbb {Z}}}^n_{>0}} \left( \prod _{i=1}^{n} \frac{a_i}{\Vert {\varvec{a}}\Vert _\infty }\right) ^{1/(n-1)} \ge \frac{1}{(2H)^n} \sum _{{\varvec{a}}\in \overline{Q}(H)} \left( \prod _{i=1}^{n} \frac{a_i}{\Vert {\varvec{a}}\Vert _\infty }\right) ^{1/(n-1)} \\&\quad \ge \frac{\# {\overline{Q}}(H)}{(2H)^n}\left( \frac{1}{2}\right) ^{n/(n-1)} \ge \left( \frac{1}{4}\right) ^{n} \left( \frac{1}{12}-2\frac{\ln H }{H}\right) \ge \left( \frac{1}{4}\right) ^{n+2}, \end{aligned} \end{aligned}$$

for H large enough. Hence, all together we have found for sufficiently large H

$$\begin{aligned} \begin{aligned} \frac{1}{N(H)}\sum _{{\varvec{a}}\in Q(H)}&\max _{\varvec{c}\in {{\mathbb {Q}}}^n}\frac{\mathrm {Gap}({\varvec{c}}, {\varvec{a}})}{\Vert \varvec{\varvec{a}}\Vert _\infty ^{1/(n-1)}\Vert \varvec{c}\Vert _1} \ge \rho _{n-1}\left( \frac{1}{4}\right) ^{n+2} - \frac{6n^2}{ H^{1/(n-1)}}\ge \frac{1}{2}\rho _{n-1}\left( \frac{1}{4}\right) ^{n+2} \,. \\ \end{aligned} \end{aligned}$$

The theorem is proved.