1 Introduction

1.1 Spherical codes and packings

Packing densities have been studied extensively, for purely mathematical reasons as well as for their connections to coding theory. The work of Conway and Sloane is a comprehensive reference for this subject [10]. We proceed by defining the basics of this subject. Consider \({\mathbb {R}}^n\) equipped with the Euclidean metric |.| and the associated volume \(\textrm{vol}(.)\). For each real \(r>0\) and each \(x\in {\mathbb {R}}^n\), we denote by \(B_n(x,r)\) the open ball in \({\mathbb {R}}^n\) centered at x and of radius r. For each discrete set of points \(S\subset {\mathbb {R}}^n\) such that any two distinct points \(x,y\in S\) satisfy \(|x-y|\ge 2\), we can consider

$$\begin{aligned} \mathcal {P}:=\cup _{x\in S}B_n(x,1), \end{aligned}$$

the union of non-overlap** unit open balls centered at the points of S. This is called a sphere packing (S may vary), and we may associate to it the function map** each real \(r>0\) to

$$\begin{aligned} \delta _{\mathcal {P}}(r):=\frac{\textrm{vol} (\mathcal {P}\cap B_n(0,r))}{\textrm{vol} (B_n(0,r))}. \end{aligned}$$

The packing density of \(\mathcal {P}\) is defined as

$$\begin{aligned} \delta _{\mathcal {P}}:=\limsup _{r\rightarrow \infty }\delta _{\mathcal {P}}(r). \end{aligned}$$

Clearly, this is a finite number. The maximal sphere packing density in \({\mathbb {R}}^n\) is defined as

$$\begin{aligned} \delta _n:=\sup _{\mathcal {P}\subset {\mathbb {R}}^n}\delta _{\mathcal {P}}, \end{aligned}$$

a supremum over all sphere packings \(\mathcal {P}\) of \({\mathbb {R}}^n\) by non-overlap** unit balls.

The linear programming method initiated by Delsarte is a powerful tool for giving upper bounds on sphere packing densities [13]. That being said, we only know the optimal sphere packing densities in dimensions 1, 2, 3, 8 and 24 [8, 14, 15, 29]. Very recently, the first author proved an optimal upper bound on the sphere packing density of all but a tiny fraction of even unimodular lattices in high dimensions; see [25, Theorem 1.1].

The best known linear programming upper bounds on sphere packing densities in low dimensions are based on the linear programming method developed by Cohn–Elkies [7] which itself was inspired by Delsarte’s linear programming method. As far as the exponent is concerned, in high dimensions, the best asymptotic upper bound goes back to Kabatyanskii–Levenshtein from 1978 [17] stating that \(\delta _n\le 2^{-(0.599+o(1))n}\) as \(n\rightarrow \infty \). More recently, de Laat–de Oliveira Filho–Vallentin improved upper bounds in very low dimensions using the semi-definite programming method [12], partially based on the semi-definite programming method developed by Bachoc–Vallentin [3] for bounding kissing numbers. The work of Bachoc–Vallentin was further improved by Mittelmann–Vallentin [23], Machado–de Oliveira Filho [22], and very recently after the writing of our paper by de Laat–Leijenhorst [19].

Another recent development is the discovery by Hartman–Mazác–Rastelli [16] of a connection between the spinless modular bootstrap for two-dimensional conformal field theories and the linear programming bound for sphere packing densities. After the writing of our paper, Afkhami-Jeddi–Cohn–Hartman–de Laat–Tajdini [1] numerically constructed solutions to the Cohn–Elkies linear programming problem and conjectured that the linear programming method is capable of producing an upper bound on sphere packing densities in high dimensions that is exponentially better than that of Kabatyanskii–Levenshtein.

A notion closely related to sphere packings in Euclidean spaces is that of spherical codes. By inequalities relating sphere packing densities to the sizes of spherical codes, Kabatyanskii–Levenshtein [17] obtained their bound on sphere packing densities stated above. The sizes of spherical codes are bounded from above using Delsarte’s linear programming method. In what follows, we define spherical codes and this linear programming method.

Given \(S^{n-1}\), the unit sphere in \({\mathbb {R}}^n\), a \(\theta \)-spherical code is a finite subset \(A\subset S^{n-1}\) such that no two distinct \(x,y\in A\) are at an angular distance less than \(\theta \). For each \(0<\theta \le \pi \), we define \(M(n,\theta )\) to be the largest cardinality of a \(\theta \)-spherical code \(A\subset S^{n-1}.\)

The Delsarte linear programming method is applied to spherical codes as follows. Throughout this paper, we work with probability measures \(\mu \) on \([-1,1].\) \(\mu \) gives an inner product on the \({\mathbb {R}}\)-vector space of real polynomials \({\mathbb {R}}[t]\), and let \(\{p_i\}_{i=0}^{\infty }\) be an orthonormal basis with respect to \(\mu \) such that the degree of \(p_i\) is i and \(p_i(1)>0\) for every i. Note that \(p_0=1\). Suppose that the basis elements \(p_k\) define positive definite functions on \(S^{n-1}\), that is,

$$\begin{aligned} \sum _{x_i,x_j\in A}h_ih_jp_k(\langle x_i,x_j\rangle )\ge 0 \end{aligned}$$
(1)

for any finite subset \(A\subset S^{n-1}\) and any real numbers \(h_i\in {\mathbb {R}}.\) An example of a probability measure satisfying inequality (1) is

$$\begin{aligned} d\mu _{\alpha }=\frac{(1-t^2)^{\alpha }}{\int _{-1}^1 (1-t^2)^{\alpha }dt} dt, \end{aligned}$$

where \(\alpha \ge \frac{n-3}{2}\) and \(2\alpha \in {\mathbb {Z}}\). Given \(s\in [-1,1]\), consider the space \(D(\mu ,s)\) of all functions \(f(t)=\sum _{i=0}^{\infty }f_ip_i(t)\), \(f_i\in {\mathbb {R}}\), such that

  1. (1)

    \(f_i\ge 0\) for every i, and \(f_0>0,\)

  2. (2)

    \(f(t)\le 0\) for \(-1\le t\le s.\)

Suppose \(0<\theta <\pi \), and \(A=\{x_1,\ldots ,x_N\}\) is a \(\theta \)-spherical code in \(S^{n-1}\). Given a function \(f\in D(\mu ,\cos \theta )\), we consider

$$\begin{aligned} \sum _{i,j}f(\langle x_i,x_j\rangle ). \end{aligned}$$

This may be written in two different ways as

$$\begin{aligned} Nf(1)+\sum _{i\ne j}f(\langle x_i,x_j\rangle ) =f_0N^2+\sum _{k=1}^{\infty }f_k\sum _{i,j}p_k(\langle x_i,x_j\rangle ). \end{aligned}$$

Since \(f\in D(\mu ,\cos \theta )\) and \(\langle x_i,x_j\rangle \le \cos \theta \) for every \(i\ne j\), this gives us the inequality

$$\begin{aligned} N\le \frac{f(1)}{f_0}. \end{aligned}$$

We define

$$\begin{aligned} \mathcal {L}(f):=\frac{f(1)}{f_0}. \end{aligned}$$
(2)

In particular, this method leads to the linear programming bound

$$\begin{aligned} M(n,\theta )\le \inf _{f\in D \left( d\mu _{\frac{n-3}{2}},\cos \theta \right) }\mathcal {L}(f). \end{aligned}$$
(3)

One of the novelties of our work is the construction using triple points of new test functions in Sect. 3 satisfying conditions (1) and (2) of the Delsarte linear programming method. In fact, our functions are infinite linear combinations of coefficients of the matrices appearing in Theorem 3.2 of Bachoc–Vallentin [3]. Bachoc–Vallentin use semi-definite programming to obtain an upper bound on kissing numbers \(M(n,\frac{\pi }{3})\) by summing over triples of points in spherical codes. On the other hand, we average one of the three points over the sphere, and take the other two points from the spherical code. Semi-definite programming is computationally feasible in very low dimensions, and improves upon linear programming bounds [11]. After the writing of our paper, a semi-definite programming method using triple point correlations for sphere packings was developed by Cohn–de Laat–Salmon [6], improving upon linear programming bounds on sphere packings in special low dimensions. In the semi-definite programming methods, the functions are numerically constructed. Furthermore, in high dimensions, there is no asymptotic bound using semi-definite programming which improves upon the linear programming bound of Kabatyanskii–Levenshtein [17], even up to a constant factor. The functions that we non-numerically construct improve upon [17] by a constant factor. In the same spirit, we also improve upon sphere packing density upper bounds in high dimensions.

Upper bounds on spherical codes are used to obtain upper bounds on sphere packing densities through inequalities proved using geometric methods. For example, for any \(0<\theta \le \pi /2\), Sidelnikov [26] proved using an elementary argument that

$$\begin{aligned} \delta _n\le \sin ^n(\theta /2)M(n+1,\theta ). \end{aligned}$$
(4)

Let \( 0< \theta < \theta ^{\prime } \le \pi \). We write \(\lambda _n(\theta ,\theta ^{\prime })\) for the ratio of volume of the spherical cap with radius \(\frac{\sin (\theta /2)}{\sin (\theta ^{\prime }/2)}\) on the unit sphere \(S^{n-1}\) to the volume of the whole sphere. Sidelnikov [26] used a similar argument to show that for \(0<\theta <\theta '\le \pi \)

$$\begin{aligned} M(n,\theta )\le \frac{M(n+1,\theta ')}{\lambda _n(\theta ,\theta ^{\prime })}. \end{aligned}$$
(5)

Kabatyanskii–Levenshstein used the Delsarte linear programming method and Jacobi polynomials to give an upper bound on \(M(n,\theta )\) [17]. A year later, Levenshtein [20] found optimal polynomials up to a certain degree and improved the Kabatyanskii–Levenshtein bound by a constant factor. Levenshtein obtained the upper bound

$$\begin{aligned} M(n,\theta )\le M_{\textrm{Lev}}(n,\theta ), \end{aligned}$$
(6)

where

$$\begin{aligned} M_{\textrm{Lev}}(n,\theta ):={\left\{ \begin{array}{ll} 2 {\left( {\begin{array}{c}d+n-1\\ n-1\end{array}}\right) } &{}\quad \text { if } t^{\alpha +1,\alpha }_{1,d}< \cos (\theta ) \le t^{\alpha +1,\alpha +1}_{1,d} , \\ \left( {\begin{array}{c}d+n-1\\ n-1\end{array}}\right) +\left( {\begin{array}{c}d+n-2\\ n-1\end{array}}\right)&\quad \text { if } t^{\alpha +1,\alpha +1}_{1,d-1}< \cos (\theta ) \le t^{\alpha +1,\alpha }_{1,d}. \end{array}\right. } \end{aligned}$$
(7)

Here, \(\alpha =\frac{n-3}{2}\) and \(t^{\alpha ,\beta }_{1,d}\) is the largest root of the Jacobi polynomial \(p^{\alpha ,\beta }_d\) of degree \(d=d(n,\theta )\), a function of n and \(\theta \). We carefully define \(d=d(n,\theta )\) and Levenshtein’s optimal polynomials in Sect. 5.1. Also see Sect. 5.1 for the definition and properties of Jacobi polynomials.

Throughout this paper, \(\theta ^*= 62.997 \cdots ^{\circ }\) is the unique root of the equation

$$\begin{aligned} \cos \theta \log \left( \frac{1+\sin \theta }{1-\sin \theta }\right) -(1+\cos \theta ) \sin \theta =0 \end{aligned}$$

in \((0,\pi /2)\). As demonstrated by Kabatyanskii–Levenshtein in  [17], for \(0<\theta < \theta ^*\), the bound \(M(n,\theta )\le M_{\textrm{Lev}}(n,\theta )\) is asymptotically exponentially weaker in n than

$$\begin{aligned} M(n,\theta )\le \frac{M_{\textrm{Lev}} (n+1,\theta ^*)}{\lambda _n(\theta ,\theta ^*)} \end{aligned}$$
(8)

obtained from inequality (5). Barg–Musin [4, p.11 (8)], based on the work [2] of Agrell–Vargy–Zeger, improved inequality (5) and showed that

$$\begin{aligned} M(n,\theta )\le \frac{M(n-1,\theta ')}{\lambda _n(\theta ,\theta ')} \end{aligned}$$
(9)

whenever \(\pi>\theta '>2\arcsin \left( \frac{1}{2\cos (\theta /2)} \right) \). Cohn–Zhao [9] improved sphere packing density upper bounds by combining the upper bound of Kabatyanskii–Levenshtein on \(M(n,\theta )\) with their analogue [9, Proposition 2.1] of (9) stating that for \(\pi /3\le \theta \le \pi \),

$$\begin{aligned} \delta _n\le \sin ^n(\theta /2)M(n,\theta ), \end{aligned}$$
(10)

leading to better bounds than those obtained from (4). Aside from our main results discussed in the next subsection, in Proposition 2.2 of Sect. 2 we remove the angular restrictions on inequality (9) in the large n regime by using a concentration of mass phenomenon. An analogous result removes the restriction \(\theta \ge \pi /3\) on inequality (10) for large n.

Inequalities (9) and (10) give, respectively, the bounds

$$\begin{aligned} M(n,\theta )\le \frac{M_{\textrm{Lev}}(n-1,\theta ^*)}{\lambda _n (\theta ,\theta ^*)}, \end{aligned}$$
(11)

for \(\theta \) and \(\theta ^*\) restricted as in the conditions for inequality (9), and

$$\begin{aligned} \delta _n\le \sin ^n(\theta ^*/2)M_{\textrm{Lev}}(n,\theta ^*). \end{aligned}$$
(12)

Prior to our work, the above were the best bounds for large enough n. In Theorems 1.1 and 1.2, we improve both by a constant factor for large n, the first such improvement since the work of Levenshtein [20] more than forty years ago. We also relax the angular condition in inequality (11) to \(0<\theta <\theta ^*\) for large n. For \(\theta ^*\le \theta \le \pi \), \(M(n,\theta )\le M_{\textrm{Lev}}(n,\theta )\) is still the best bound. We also prove a number of other results, including the construction of general test functions in Sect. 3 that are of independent interest.

1.2 Main results and general strategy

We improve inequalities (11) and (12) with an extra factor 0.4325 for each sufficiently large n. In the case of sphere packings, we obtain an improvement by a factor of \(0.4325+\frac{51}{n}\) for dimensions \(n\ge 2000\). In low dimensions, our geometric ideas combined with numerics lead to improvements that are better than 0.4325. In Sect. 6, we provide the results of our extensive numerical calculations. We now state our main theorems.

Theorem 1.1

Suppose that \(0<\theta <\theta ^*\). Then

$$\begin{aligned} M(n,\theta )\le c_n\frac{M_{\textrm{Lev}}(n-1,\theta ^*)}{\lambda _n (\theta ,\theta ^*)}, \end{aligned}$$

where \(c_n\le 0.4325\) for large enough n independent of \(\theta .\)

We also have a uniform version of this theorem for sphere packing densities.

Theorem 1.2

Suppose that \(\frac{1}{3}\le \cos (\theta )\le \frac{1}{2}\). We have

$$\begin{aligned} \delta _{n} \le c_{n}(\theta )\sin ^{n}(\theta /2)M_{\textrm{Lev}}(n,\theta ), \end{aligned}$$

where \(c_{n}(\theta )<1\) for every n. If, additionally, \(n\ge 2000\) we have \(c_{n}(\theta )\le 0.515+\frac{74}{n}\). Furthermore, for \(n\ge 2000\) we have \(c_{n}(\theta ^*)\le 0.4325+\frac{51}{n}\).

Fig. 1
figure 1

Schematic diagram for sphere packings

By Kabatyanskii–Levenshtein [17], the best bound on sphere packing densities \(\delta _n\) for large n comes from \(\theta =\theta ^*\); comparisons using other angles are exponentially worse. Consequently, this theorem implies that we have an improvement by 0.4325 for sphere packing density upper bounds in high dimensions. Furthermore, note that the constants of improvement \(c_n(\theta )\) are bounded from above uniformly in \(\theta \). The lower bound in \(\frac{1}{3}\le \cos \theta \le \frac{1}{2}\) is not conceptually significant in the sense that a change in \(\frac{1}{3}\) would lead to a change in the bound \(c_n(\theta )\le 0.515+\frac{74}{n}\).

We prove Theorem 1.2 by constructing a new test function that satisfies the Cohn–Elkies linear programming conditions. The geometric idea behind the construction of our new test functions is the following (see Fig. 1). In [9], for every \(\pi \ge \theta \ge \frac{\pi }{3}\), Cohn and Zhao choose a ball of radius \(r=\frac{1}{2\sin (\theta /2)}\) around each point of the sphere packing so that for every two points \(\varvec{a}\) and \(\varvec{b}\) that are centers of balls in the sphere packing, for every point \(\varvec{z}\) in the shaded region, \(\varvec{a}\) and \(\varvec{b}\) make an angle \(\varphi \ge \theta \) with respect to \(\varvec{z}\). By averaging a function satisfying the Delsarte linear programming conditions for the angle \(\theta \), a new function satisfying the conditions of the Cohn–Elkies linear programming method is produced. The negativity condition easily follows as \(\varphi \ge \theta \) for every point \(\varvec{z}\) in the shaded region. Our insight is that since we are taking an average, we do not need pointwise negativity for each point \(\varvec{z}\) to ensure the negativity condition for the new averaged function. In fact, we can enlarge the radii of the balls by a quantity \(\delta =O(1/n)\) so that the conditions of the Cohn–Elkies linear programming method continue to hold for this averaged function. Since the condition \(\varphi \ge \theta \) is no longer satisfied for every point \(\varvec{z}\), determining how large \(\delta \) may be chosen is delicate. We develop analytic methods for determining such \(\delta \). This requires us to estimate triple density functions in Sect. 4, and estimating the Jacobi polynomials near their extreme roots in Sect. 5.1. It is known that the latter problem is difficult [18, Conjecture 1]. In Sect. 5.1, we treat this difficulty by using the relation between the zeros of Jacobi polynomials; these ideas go back to the work of Stieltjes [27]. More precisely, we use the underlying differential equations satisfied by Jacobi polynomials, and the fact that the roots of the family of Jacobi polynomials are interlacing. For Theorem 1.1, we use a similar idea but consider how much larger we can make certain appropriately chosen strips on a sphere. See Fig. 3.

Table 1 Upper bounds on maximal sphere packing densities \(\delta _n\) in \({\mathbb {R}}^n\) using functions that are not constructed using computer assistance. The last column is obtained using the method of this paper

We use our geometrically constructed test functions to obtain the last column of Table 1. Table 1 is a comparison of upper bounds on sphere packing densities. This table does not include the computer-assisted mathematically rigorous bounds obtained using the Cohn–Elkies linear programming method or those of semi-definite programming. We now describe the different columns. The Rogers column corresponds to the bounds on sphere packing densities obtained by Rogers [24]. The Levenshtein79 column corresponds to the bound obtained by Levenshtein in terms of roots of Bessel functions [20]. The K.–L. column corresponds to the bound on \(M(n,\theta )\) proved by Kabatyanskii and Levenshtein [17] combined with inequality (5). The Cohn–Zhao column corresponds to the column found in the work of Cohn and Zhao [9]; they combined their inequality (10) with the bound on \(M(n,\theta )\) proved by Kabatyanskii–Levenshtein [17]. We also include the column C.–Z.+L79 which corresponds to combining Cohn and Zhao’s inequality with improved bounds on \(M(n,\theta )\) using Levenshtein’s optimal polynomials [20]. The final column corresponds to the bounds on sphere packing densities obtained by our method. In Table 1, the highlighted entries are the best bounds obtained from these methods. Our bounds break most of the other bounds also in low dimensions. Our bounds are obtained from explicit geometrically constructed functions satisfying the Cohn–Elkies linear programming method. Our method only involves explicit integral calculations; in contrast to the numerical method in [7], we do not rely on any searching algorithm. Moreover, compared to the Cohn–Elkies linear programming method, in \(n=120\) dimensions, we improve upon the sphere packing density upper bound of \(1.164\times 10^{-17}\) obtained by forcing eight double roots.

1.3 Structure of the paper

In Sect. 2, we setup some of the notation used in this paper and prove Proposition 2.2. Section 3 concerns the general construction of our test functions that are used in conjunction with the Delsarte and Cohn–Elkies linear programming methods. In Sect. 5, we prove our main Theorems 1.1 and 1.2. In this section, we use our estimates on the triple density functions proved in Sect. 4. In Sect. 5.1, we describe Jacobi polynomials, Levenshtein’s optimal polynomials, and locally approximate Jacobi polynomials near their largest roots. In the final Sect. 6, we provide a table of improvement factors.

2 Geometric improvement

In this section, we prove Proposition 2.2, improving inequality (9) by removing the restrictions on the angles for large dimensions n. This is achieved via a concentration of mass phenomenon, at the expense of an exponentially decaying error term. First, we introduce some notations that we use throughout this paper.

Let \(0<\theta<\theta '<\pi \) be given angles, and let \(s:=\cos \theta \) and \(s':=\cos \theta '\). Throughout, \(S^{n-1}\) is the unit sphere centered at the origin of \({\mathbb {R}}^n\). Suppose \(\varvec{z}\in S^{n-1}\) is a fixed point.

Consider the hyperplane \(N_{\varvec{z}}:=\{\varvec{w}\in {\mathbb {R}}^n:\langle \varvec{w},\varvec{z}\rangle =0\}\). For each \(\varvec{a},\varvec{b}\in S^{n-1}\) of radial angle at least \(\theta \) from each other, we may orthogonally project them onto \(N_{\varvec{z}}\) via the map \(\Pi _{\varvec{z}}:S^{n-1}{\setminus }\{\pm \varvec{z}\} \rightarrow N_{\varvec{z}}\). For every \(\varvec{a}\in S^{n-1}\),

$$\begin{aligned} \Pi _{\varvec{z}}(\varvec{a})=\varvec{a} -\langle \varvec{a},\varvec{z}\rangle \varvec{z}. \end{aligned}$$

For brevity, when \(\varvec{a}\ne \pm \varvec{z}\) we denote \(\frac{\Pi _{\varvec{z}}(\varvec{a})}{|\Pi _{\varvec{z}}(\varvec{a})|}\) by \(\tilde{\varvec{a}}\) lying inside the unit sphere \(S^{n-2}\) in \(N_{\varvec{z}}\) centered at the origin. Given \(\varvec{a},\varvec{b}\in S^{n-1}{\setminus }\{\pm \varvec{z}\}\), we obtain points \(\tilde{\varvec{a}},\tilde{\varvec{b}}\in S^{n-2}\). We will use the following notation.

$$\begin{aligned}{} & {} u:=\langle \varvec{a},\varvec{z}\rangle ,\\{} & {} v:=\langle \varvec{b},\varvec{z}\rangle , \end{aligned}$$

and

$$\begin{aligned} t:=\langle \varvec{a},\varvec{b}\rangle . \end{aligned}$$

It is easy to see that

$$\begin{aligned} \langle \tilde{\varvec{a}},\tilde{\varvec{b}}\rangle =\frac{t-uv}{\sqrt{(1-u^2)(1-v^2)}}. \end{aligned}$$
(13)
Fig. 2
figure 2

Spherical cap \(Cap _{\theta ,\theta '} (\varvec{z})\) containing points \(\varvec{a},\varvec{b}\)

Consider the cap \(Cap _{\theta ,\theta '}(\varvec{z})\) on \(S^{n-1}\) centered at \(\varvec{z}\) and of radius \(\frac{\sin (\theta /2)}{\sin (\theta '/2)}\). \(Cap _{\theta ,\theta '}(\varvec{z})\) is the spherical cap centered at \(\varvec{z}\) with the defining property that any two points \(\varvec{a}\), \(\varvec{b}\) on its boundary of radial angle \(\theta \) are sent to points \(\tilde{\varvec{a}}\), \(\tilde{\varvec{b}}\in S^{n-2}\) having radial angle \(\theta '\) (Fig. 2).

It will be convenient for us to write the radius of the cap as \(\sqrt{1-r^2}=\frac{\sin (\theta /2)}{\sin (\theta '/2)}\), from which it follows that

$$\begin{aligned} r=\sqrt{\frac{s-s'}{1-s'}}. \end{aligned}$$
(14)

This r is the distance from the center of the cross-section defining the cap \(Cap _{\theta ,\theta '}(\varvec{z})\) to the center of \(S^{n-1}\). In fact,

$$\begin{aligned} Cap _{\theta ,\theta '}(\varvec{z}) =\{\varvec{a}\in S^{n-1}:\langle \varvec{a}, \varvec{z}\rangle \ge r\}. \end{aligned}$$

For \(0<\theta<\theta '<\pi \), we define

$$\begin{aligned} \gamma _{\theta ,\theta '}:=2\arctan \frac{s}{\sqrt{(1-s)(s-s')}} +\arccos (r)-\pi , \end{aligned}$$
(15)

and

$$\begin{aligned} R:=\cos (\gamma _{\theta ,\theta '}). \end{aligned}$$
(16)

Then \(R>r\), and we define the strip

$$\begin{aligned} Str _{\theta ,\theta '}(\varvec{z}):=\left\{ \varvec{a}\in S^{n-1}:r\le \langle \varvec{a},\varvec{z}\rangle \le R\right\} . \end{aligned}$$
Fig. 3
figure 3

Spherical strip \(Str _{\theta , \theta '}(\varvec{z})\)

Lemma 2.1

The strip \(Str _{\theta ,\theta '}(\varvec{z})\) is contained in \(Cap _{\theta ,\theta '}(\varvec{z})\). Furthermore, any two points in \(Str _{\theta ,\theta '} (\varvec{z}){\setminus }\{\pm \varvec{z}\}\) of radial angle at least \(\theta \) apart are mapped to points in \(S^{n-2}\) (unit sphere in \(N_{\varvec{z}}\)) of radial angle at least \(\theta '\).

Proof

The first statement follows from \(\langle \varvec{a},\varvec{z}\rangle \ge r\) for any point \(\varvec{a}\in Str _{\theta ,\theta '}(\varvec{z})\). The second statement follows from equation (147) and Lemma 42 of [2]. \(\square \)

With this in mind, we are now ready to prove Proposition 2.2. When discussing the measure of strips \(Str _{\theta ,\theta '}(\varvec{z})\), we drop \(\varvec{z}\) from the notation and simply write \(Str _{\theta ,\theta '}\).

Proposition 2.2

Let \(0<\theta<\theta ^{\prime }<\pi .\) We have

$$\begin{aligned} M(n,\theta )\le \frac{M(n-1,\theta ')}{\lambda _n (\theta ,\theta ^{\prime })} (1+O(ne^{-nc})), \end{aligned}$$
(17)

where \(c:=\frac{1}{2}\log \left( \frac{1-r^2}{1-R^2}\right) >0\) is independent of n and only depends on \(\theta \) and \(\theta '\).

Proof

Suppose \(\{x_1,\ldots ,x_N\}\subset S^{n-1}\) is a maximal \(\theta \)-spherical code. Given \(x\in S^{n-1}\), let m(x) be the number of such strips \(Str _{\theta ,\theta '}(x_i)\) such that \(x\in Str _{\theta ,\theta '}(x_i)\). Note that \(x\in Str _{\theta ,\theta '}(x_i)\) if and only if \(x_i\in Str _{\theta ,\theta '}(x)\). Therefore, the strip \(Str _{\theta ,\theta '}(x)\) contains m(x) points of \(\{x_1,\ldots ,x_N\}\). From the previous lemma, we know that these m(x) points are mapped to points in \(S^{n-2}\) that have pairwise radial angles at least \(\theta '\). As a result,

$$\begin{aligned} m(x)\le M(n-1,\theta '), \end{aligned}$$

using which we obtain

$$\begin{aligned} N\cdot \mu (Str _{\theta ,\theta '})= & {} \sum _{i=1}^N \int _{\textrm{Str}_{\theta ,\theta '} (x_i)}d\mu (x)\\= & {} \int _{S^{n-1}}m(x)d\mu (x) \le M(n-1,\theta ') \int _{S^{n-1}}d\mu (x)=M(n-1,\theta '), \end{aligned}$$

where \(\mu \) is the uniform probability measure on \(S^{n-1}\). Hence,

$$\begin{aligned} M(n,\theta )\le \frac{M(n-1,\theta ')}{\mu (Str _{\theta ,\theta '})}. \end{aligned}$$
(18)

Note that the masses of \(Str _{\theta ,\theta '}\) and the cap \(Cap _{\theta ,\theta '}\) have the property that

$$\begin{aligned} 1-\frac{\mu (Str _{\theta ,\theta '})}{\lambda _n (\theta ,\theta ')}= & {} \frac{1}{\omega _n\lambda _n (\theta ,\theta ')}\int _{R}^1(1-t^2)^{\frac{n-3}{2}}dt\\\le & {} \frac{(1-R^2)^{\frac{n-3}{2}}}{\omega _n\lambda _n(\theta ,\theta ')}. \end{aligned}$$

Here, \(\omega _n=\int _{-1}^1(1-t^2)^{\frac{n-3}{2}}dt\). On the other hand, we may also give a lower bound on \(\lambda _n(\theta ,\theta ')\) by noting that

$$\begin{aligned} \lambda _n(\theta ,\theta ')= & {} \frac{1}{\omega _n}\int _r^1 (1-t^2)^{\frac{n-3}{2}}dt\\\ge & {} \frac{\left( \sqrt{\frac{1+r}{1-r}}\right) ^{n-3}}{\omega _n} \int _r^1(1-t)^{n-3}dt\\= & {} \frac{\left( \sqrt{\frac{1+r}{1-r}}\right) ^{n-3}(1-r)^{n-2}}{(n-2) \omega _n}. \end{aligned}$$

The first inequality follows from

$$\begin{aligned} \frac{1+t}{1-t}\ge \frac{1+r}{1-r} \end{aligned}$$

for \(t\in [r,1)\). Combining this inequality for \(\lambda _n(\theta ,\theta ')\) with the above, we obtain

$$\begin{aligned} 1\ge \frac{\mu (Str _{\theta ,\theta '})}{\lambda _n (\theta ,\theta ')}\ge 1- \frac{(n-2)(1-R^2)^{\frac{n-3}{2}}}{(1-r) (1-r^2)^{\frac{n-3}{2}}}=1-\frac{(n-2)}{(1-r)}e^{-\frac{n-3}{2}\log \left( \frac{1-r^2}{1-R^2}\right) }. \end{aligned}$$

The conclusion follows using (18). \(\square \)

Remark 19

Proposition 2.2 removes the angular condition on inequality (9) of Barg–Musin at the expense of an error term that is exponentially decaying in the dimension n.

3 New test functions

In this section, we prove general linear programming bounds on the sizes of spherical codes and sphere packing densities by constructing new test functions.

3.1 Spherical codes

Recall the definition of \(D(\mu ,s)\) from the discussion of the Delsarte linear programming method in the introduction. In this subsection, we construct a function inside \(D(d\mu _{\frac{n-3}{2}},\cos \theta )\) from a given one inside \(D(d\mu _{\frac{n-4}{2}},\cos \theta ^{\prime }),\) where \(\theta '>\theta .\)

Suppose that \(g_{\theta '}\in D(d\mu _{\frac{n-4}{2}}, \cos \theta ^{\prime }).\) Fix \(\varvec{z}\in S^{n-1}\). Given \(\varvec{a},\varvec{b} \in S^{n-1}\), we define

$$\begin{aligned} h(\varvec{a},\varvec{b};\varvec{z}) := F(\langle \varvec{a},\varvec{z}\rangle ) F(\langle \varvec{b},\varvec{z}\rangle ) g_{\theta '}\left( \langle \tilde{\varvec{a}}, \tilde{\varvec{b}}\rangle \right) , \end{aligned}$$
(20)

where F is an arbitrary integrable real valued function on \([-1,1]\), and \(\tilde{\varvec{a}}\) and \(\tilde{\varvec{b}}\) are unit vectors on the tangent space of the sphere at \(\varvec{z}\) as defined in the previous section. Using the notation uvt of Sect. 2,

$$\begin{aligned} h(\varvec{a},\varvec{b};\varvec{z}):= F(u)F(v) g_{\theta '} \left( \frac{t-uv}{\sqrt{(1-u^2)(1-v^2)}}\right) . \end{aligned}$$
(21)

Note that the projection is not defined at \(\pm \varvec{z}\). If either \(\varvec{a}\) or \(\varvec{b}\) is \(\pm \varvec{z}\), we let \(h(\varvec{a},\varvec{b};\varvec{z})=0\).

Lemma 3.1

\(h(\varvec{a},\varvec{b};\varvec{z})\) is a positive semi-definite function in the variables \(\varvec{a},\varvec{b}\) on \(S^{n-1},\) namely

$$\begin{aligned} \sum _{x_i,x_j\in A} a_i a_j h(\varvec{a}_i, \varvec{a}_j;\varvec{z})\ge 0 \end{aligned}$$

for every finite subset \(A\subset S^{n-1}\), and coefficients \(a_i \in {\mathbb {R}}.\) Moreover, h is invariant under the diagonal action of the orthogonal group O(n), namely

$$\begin{aligned} h(\varvec{a},\varvec{b};\varvec{z})=h(k\varvec{a}, k\varvec{b};k\varvec{z}) \end{aligned}$$

for every \(k\in O(n)\).

Proof

By (20), we have

$$\begin{aligned} \sum _{x_i,x_j\in A} a_i a_j h(\varvec{a}_i, \varvec{a}_j;\varvec{z})= \sum _{{x_i,x_j\in A} } a_iF(\langle \varvec{x_i},\varvec{z}\rangle ) a_jF(\langle \varvec{x_j},\varvec{z}\rangle ) g_{\theta '}(\langle \tilde{\varvec{x_i}}, \tilde{\varvec{x_j}}\rangle ). \end{aligned}$$

By (1) and the positivity of the Fourier coefficients of \(g_{\theta '}\), we have

$$\begin{aligned} \sum _{{x_i,x_j\in A} } a_iF(\langle \varvec{x_i}, \varvec{z}\rangle ) a_jF(\langle \varvec{x_j}, \varvec{z}\rangle ) g_{\theta '}(\langle \tilde{\varvec{x_i}},\tilde{\varvec{x_j}}\rangle )\ge 0. \end{aligned}$$

This proves the first part, and the second part follows from (20) and the O(n)-invariance of the inner product. \(\square \)

Let

$$\begin{aligned} h(\varvec{a},\varvec{b}):=\int _{O(n)} h(\varvec{a},\varvec{b};k\varvec{z}) d\mu (k), \end{aligned}$$
(22)

where \(d\mu (k)\) is the probability Haar measure on O(n).

Lemma 3.2

\(h(\varvec{a},\varvec{b})\) is a positive semi-definite point pair invariant function on \(S^{n-1}.\)

Proof

This follows from the previous lemma. \(\square \)

Since \(h(\varvec{a},\varvec{b})\) is a point pair invariant function, it only depends on \(t=\langle \varvec{a},\varvec{b}\rangle .\) For the rest of this paper, we abuse notation and consider h as a real valued function of t on \([-1,1],\) and write \(h(\varvec{a},\varvec{b})=h(t).\)

3.1.1 Computing \(\mathcal {L}(h)\)

See (2) for the definition of \(\mathcal {L}\). We proceed to computing the value of \(\mathcal {L}(h)\) in terms of F and \(g_{\theta '}.\) First, we compute the value of h(1). Let \( \Vert F \Vert ^2_2:=\int _{-1}^{1} F(u)^2 d\mu _{\frac{n-3}{2}}(u).\)

Lemma 3.3

We have

$$\begin{aligned} h(1)=g_{\theta '}(1) \Vert F \Vert ^2_2. \end{aligned}$$

Proof

Indeed, by definition, h(1) corresponds to taking \(\varvec{a}=\varvec{b}\), from which it follows that \(t=1\), \(u=v\) and \(\frac{t-uv}{\sqrt{(1-u^2)(1-v^2)}}=1\). Therefore, we obtain

$$\begin{aligned} h(1)= \int _{-1}^{1} F(u)^2 g_{\theta '}(1) d\mu _{\frac{n-3}{2}}(u) =g_{\theta '}(1) \Vert F \Vert ^2_2. \end{aligned}$$

\(\square \)

Next, we compute the zero Fourier coefficient of h,  that is, \(h_0:=\int _{-1}^{1} h(t) d\mu _{\frac{n-3}{2}}(t)\). Let \(F_0=\int _{-1}^{1} F(u) d\mu _{\frac{n-3}{2}}(u) \) and \(g_{\theta ',0}=\int _{-1}^{1} g_{\theta '} d\mu _{\frac{n-4}{2}}(u)\).

Lemma 3.4

We have

$$\begin{aligned} h_0=g_{\theta ',0}F_0^2. \end{aligned}$$

Proof

Let \(O(n-1)\subset O(n)\) be the stabilizer of \(\varvec{z}.\) We identify \(O(n)/O(n-1)\) with \(S^{n-1}\) and write \([k_1]:= k_1\varvec{z}\in S^{n-1}\) for any \(k_1\in O(n).\) Then we write the probability Haar measure of O(n) as the product of the probability Haar measure of \(O(n-1)\) and the uniform probability measure \(d\sigma \) of \(S^{n-1}:\)

$$\begin{aligned} d\mu (k_1)=d\mu (k_1')d\sigma ([k_1]), \end{aligned}$$

where \(k_1'\in O(n-1).\) By Eqs. (20),  (22) and the above, we obtain

$$\begin{aligned} h_0&=\iint _{k_i'\in O(n-1)} \iint _{[k_i]\in S^{n-1}} F(\langle k_1'[k_1],\varvec{z}\rangle ) F (\langle k_2'[k_2],\varvec{z}\rangle ) g_{\theta '}\\&\quad \times \left( \langle \widetilde{k_1'[k_1]}, \widetilde{k_2'[k_2]}\rangle \right) d\mu (k_1')d \sigma ([k_1])d\mu (k_2')d\sigma ([k_2])\\&= \iint _{[k_i]\in S^{n-1}}F(\langle [k_1], \varvec{z}\rangle ) F(\langle [k_2], \varvec{z}\rangle ) d\sigma ([k_1]) d \sigma ([k_2]) \\&\quad \times \iint _{k_i'\in O(n-1)}g_{\theta '} \left( \langle k_1'\widetilde{[k_1]}, k_2' \widetilde{[k_2]}\rangle \right) d\mu (k_1')d\mu (k_2'). \end{aligned}$$

We note that

$$\begin{aligned} \iint _{k_i'\in O(n-1)}g_{\theta '}\left( \langle k_1' \widetilde{[k_1]}, k_2' \widetilde{[k_2]}\rangle \right) d\mu (k_1')d\mu (k_2')=g_{\theta ',0}, \end{aligned}$$

and

$$\begin{aligned}{} & {} \iint _{[k_i]\in S^{n-1}}F(\langle [k_1], \varvec{z}\rangle ) F(\langle [k_2], \varvec{z}\rangle ) d\sigma ([k_1]) d\sigma ([k_2])\\{} & {} \quad = \int _{-1}^{1}\int _{-1}^{1} F(u)F(v) d\mu _{\frac{n-3}{2}}(u) \mu _{\frac{n-3}{2}}(v)=F_0^2. \end{aligned}$$

Therefore,

$$\begin{aligned} h_0=g_{\theta ',0}F_0^2, \end{aligned}$$

as required. \(\square \)

Proposition 3.5

We have

$$\begin{aligned} \mathcal {L}(h)=\mathcal {L}(g_{\theta '})\frac{\Vert F \Vert ^2_2}{F_0^2}. \end{aligned}$$

Proof

This follows immediately from Lemmas 3.3 and 3.4. \(\square \)

3.1.2 Criterion for \(\varvec{h\in D(d\mu _{\frac{n-3}{2}},\cos \theta )}\)

Finally, we give a criterion which implies \(h\in D(d\mu _{\frac{n-3}{2}},\cos \theta ).\) Recall that \(0<\theta < \theta ',\) and \(0<r<R<1\) are as defined in Sect. 2. Let \(s^{\prime }=\cos (\theta ^{\prime })\) and \(s=\cos (\theta ).\) Note that \(s^{\prime }<s\), \(r=\sqrt{\frac{s-s^{\prime }}{1-s^\prime }}\), and \(R=\cos \gamma _{\theta ,\theta '}\) as in Eq. (15). We define

$$\begin{aligned} \chi (y):={\left\{ \begin{array}{ll} 1 &{}\quad \text {for } r\le y\le R, \\ 0 &{}\quad \text {otherwise}. \end{array}\right. } \end{aligned}$$

Proposition 3.6

Suppose that \(g_{\theta '}\in D(d\mu _{\frac{n-4}{2}},\cos \theta ^{\prime })\) is given and h is defined as in (22) for some F. Suppose that F(x) is a positive integrable function giving rise to an h such that \(h(t)\le 0\) for every \(-1\le t\le \cos \theta \). Then

$$\begin{aligned} h\in D\left( d\mu _{\frac{n-3}{2}},\cos \theta \right) , \end{aligned}$$

and

$$\begin{aligned} M(n,\theta )\le \mathcal {L}(h)=\mathcal {L}(g_{\theta '}) \frac{\Vert F \Vert ^2_2}{F_0^2}. \end{aligned}$$

Among all positive integrable functions F with compact support inside [rR], \(\chi \) minimize the value of \( \mathcal {L}(h),\) and for \(F=\chi \) we have

$$\begin{aligned} M(n,\theta )\le \mathcal {L}(h)\le \frac{ \mathcal {L}(g_{\theta '})}{\lambda _n(\theta ,\theta ')}(1+O(ne^{-nc})), \end{aligned}$$

where \(c=\frac{1}{2}\log \left( \frac{1-r^2}{1-R^2}\right) >0.\)

Proof

The first part follows from the previous lemmas and propositions. Let us specialize to the situation where F is merely assumed to be a positive integrable function with compact support inside [rR]. Let us first show that \(h(t)\le 0\) for \(t\le s\). We have

$$\begin{aligned} h(t):=\int _{O(n)} h(\varvec{a},\varvec{b};k\varvec{z}) d\mu (k), \end{aligned}$$

where \(h(\varvec{a},\varvec{b};\varvec{z}):= F(u)F(v) g_{\theta '}\left( \frac{t-uv}{\sqrt{(1-u^2)(1-v^2)}}\right) . \) First, note that \(F(u)F(v)\ne 0\) implies that \(\varvec{a}\) and \(\varvec{b}\) belong to \(Str _{\theta ,\theta '}(\varvec{z}).\) By Lemma 2.1, the radial angle between \(\tilde{\varvec{a}}\) and \(\tilde{\varvec{b}}\) is at least \(\theta '\), and so

$$\begin{aligned} \frac{t-uv}{\sqrt{(1-u^2)(1-v^2)}}=\langle \tilde{\varvec{a}}, \tilde{\varvec{b}}\rangle \in [-1,\cos \theta ']. \end{aligned}$$

Therefore

$$\begin{aligned} g_{\theta '}\left( \frac{t-uv}{\sqrt{(1-u^2)(1-v^2)}}\right) \le 0 \end{aligned}$$

when \(F(u)F(v)\ne 0.\) Hence, the integrand \(h(\varvec{a},\varvec{b},\varvec{z})\) is non-positive when \(t\in [-1,\cos \theta ]\), and so \(h(t)\le 0\) for \(t\le s\).

It is easy to see that when \(F=\chi \),

$$\begin{aligned} \Vert F\Vert _2^2=\mu (Str _{\theta ,\theta '}(\varvec{z})) \end{aligned}$$

and

$$\begin{aligned} F_0=\mu (Str _{\theta ,\theta '}(\varvec{z})). \end{aligned}$$

Therefore, by our estimate in the proof of Proposition 2.2 we have

$$\begin{aligned} M(n,\theta )\le \mathcal {L}(h)\le \frac{\mathcal {L}(g_{\theta '})}{\lambda _n(\theta ,\theta ')} \left( 1+O\left( ne^{-\frac{n}{2} \log \left( \frac{1-r^2}{1-R^2}\right) }\right) \right) . \end{aligned}$$

Finally, the optimality follows from the Cauchy–Schwarz inequality. More precisely, since F(x) has compact support inside [rR], we have

$$\begin{aligned} \mu (Str _{\theta ,\theta '}(\varvec{z})) \Vert F\Vert _2^2 \ge F_0^2. \end{aligned}$$

Therefore, \(\mathcal {L}(h)=\frac{g_{\theta '}(1)}{g_{\theta ',0}} \frac{\Vert F \Vert ^2_2}{F_0^2}\ge \frac{\mathcal {L}(g_{\theta '})}{\mu (Str _{\theta ,\theta '}(\varvec{z}))} \) with equality only when \(F=\chi \). \(\square \)

3.2 Sphere packings

Suppose \(0<\theta \le \pi \) is a given angle, and suppose \(g_{\theta }\in D(d\mu _{\frac{n-3}{2}},\cos \theta )\). Fixing \(\varvec{z}\in {\mathbb {R}}^n\), for each pair of points \(\varvec{a},\varvec{b}\in {\mathbb {R}}^n\backslash \{\varvec{z}\}\) consider

$$\begin{aligned} H(\varvec{a},\varvec{b};\varvec{z}):=F(|\varvec{a}-\varvec{z}|)F(|\varvec{b} -\varvec{z}|)g_{\theta }\left( \left\langle \frac{\varvec{a}-\varvec{z}}{|\varvec{a} -\varvec{z}|},\frac{\varvec{b}-\varvec{z}}{|\varvec{b}-\varvec{z}|}\right\rangle \right) , \end{aligned}$$

where F is an even positive function on \({\mathbb {R}}\) such that it is in \(L^1({\mathbb {R}}^n)\cap L^2({\mathbb {R}}^n)\). We may then define \(H(\varvec{a},\varvec{b})\) by averaging over all \(\varvec{z}\in {\mathbb {R}}^n\):

$$\begin{aligned} H(\varvec{a},\varvec{b}):=\int _{{\mathbb {R}}^n}H (\varvec{a},\varvec{b};\varvec{z})d\varvec{z}. \end{aligned}$$
(23)

Lemma 3.7

\(H(\varvec{a},\varvec{b})\) is a positive semi-definite kernel on \({\mathbb {R}}^n\) and depends only on \(T=|\varvec{a}-\varvec{b}|\).

Proof

The proof is similar to that of Lemma 3.1. \(\square \)

As before, we abuse notation and write H(T) instead of \(H(\varvec{a},\varvec{b})\) when \(T=|\varvec{a}-\varvec{b}|\). The analogue of Proposition 3.6 is then the following.

Proposition 3.8

Let \(0<\theta \le \pi \) and suppose \(g_{\theta }\in D(d\mu _{\frac{n-3}{2}},\cos \theta )\). Suppose F is as above such that \(H(T)\le 0\) for every \(T\ge 1\). Then

$$\begin{aligned} \delta _n\le \frac{\textrm{vol}(B_1^n)\Vert F\Vert _{L^2({\mathbb {R}}^n)}^2}{2^n\Vert F\Vert _{L^1({\mathbb {R}}^n)}^2}\mathcal {L}(g_{\theta }), \end{aligned}$$
(24)

where \(\textrm{vol}(B_1^n)\) is the volume of the n-dimensional unit ball. In particular, if \(F=\chi _{[0,r]}\), where \(0\le r\le 1\), is such that it gives rise to an H satisfying \(H(T)\le 0\) for every \(T\ge 1\), then

$$\begin{aligned} \delta _n\le \frac{\mathcal {L}(g_{\theta })}{(2r)^n}. \end{aligned}$$
(25)

Proof

The proof of this proposition is similar to that of Theorem 3.4 of Cohn–Zhao [9]. We focus our attention on proving inequality (24). Suppose we have a packing of \({\mathbb {R}}^n\) of density \(\Delta \) by non-overlap** balls of radius \(\frac{1}{2}\). By Theorem 3.1 of Cohn–Elkies [7], we have

$$\begin{aligned} \Delta \le \frac{\textrm{vol}(B_1^n)H(0)}{2^n\widehat{H}(0)}. \end{aligned}$$

Note that \(H(0)=g_{\theta }(1)\Vert F\Vert _{L^2({\mathbb {R}}^n)}^2\), and that

$$\begin{aligned} \widehat{H}(0)=\int _{{\mathbb {R}}^n}H(|\varvec{z}|)d \varvec{z}=g_{\theta ,0}\Vert F\Vert _{L^1({\mathbb {R}}^n)}^2. \end{aligned}$$

As a result, we obtain inequality (24). The rest follows from a simple computation. \(\square \)

Note that the situation \(r=\frac{1}{2\sin (\theta /2)}\) with \(\pi /3\le \theta \le \pi \) corresponds to Theorem 3.4 of Cohn–Zhao [9], as checking the negativity condition \(H(T)\le 0\) for \(T\ge 1\) follows from Lemma 2.2 therein. The factor \(2^n\) comes from considering functions where the negativity condition is for \(T\ge 1\) instead of \(T\ge 2\).

Remark 26

In this paper, we consider characteristic functions; however, it is an interesting open question to determine the optimal such F in order to obtain the best bounds on sphere packing densities through this method.

3.3 Incorporating geometric improvement into linear programming

In proving upper bounds on \(M(n,\theta )\), Levenshtein [20, 21], building on Kabatyanskii–Levenshtein [17], constructed feasible test functions \(g_{\theta }\in D(d\mu _{\frac{n-3}{2}},\cos \theta )\) for the Delsarte linear programming problem with \(\mathcal {L}(g_{\theta })=M_{\textrm{Lev}}(n,\theta )\) defined in (7). This gave the bound

$$\begin{aligned} M(n,\theta )\le M_{\textrm{Lev}}(n,\theta ). \end{aligned}$$
(27)

Sidelnikov’s geometric inequality (5) gives

$$\begin{aligned} M(n,\theta )\le \frac{M(n+1,\theta ')}{\lambda _n (\theta ,\theta ^{\prime })} \end{aligned}$$

for angles \(0<\theta<\theta '<\frac{\pi }{2}\). Applying this for \(0<\theta <\theta ^*\) and combining with inequality (27), Kabatyanskii and Levenshtein obtained

$$\begin{aligned} M(n,\theta )\le \frac{M_{\textrm{Lev}}(n+1,\theta ^*)}{\lambda _n(\theta ,\theta ^*)}. \end{aligned}$$
(28)

From [17], it is known that this is exponentially better than inequality (27) for \(0<\theta <\theta ^*\). Finding functions \(h\in D(d\mu _{\frac{n-3}{2}},\cos \theta )\) with \(\mathcal {L}(h)<\mathcal {L}(g_{\theta })\) was suggested by Levenshtein in [21, page 117]. In fact, Boyvalenkov–Danev–Bumova [5] gives necessary and sufficient conditions for constructing extremal polynomials that improve Levenshtein’s bound. However, their construction does not exponentially improve inequality (27) for \(0<\theta <\theta ^*\). In contrast to their construction, Proposition 3.6 gives the following corollary stating that our construction of the function h gives an exponential improvement in the linear programming problem comparing to Levenshtein’s optimal polynomials for \(0<\theta <\theta ^*\). This is not to say that we exponentially improve the bounds given for spherical codes and sphere packings; we provide a single function using which the Delsarte linear programming method gives a better version of the exponentially better inequality (28).

Corollary 3.9

Fix \(0<\theta <\theta ^*.\) Let \(h_{\theta ^*}\in D(d\mu _{\frac{n-3}{2}},\cos \theta )\) be the function associated to Levenshtein’s \(g_{n-1,\theta ^*}\) constructed in Proposition 3.6. Then

$$\begin{aligned} M(n,\theta )\le \mathcal {L}(h_{\theta ^*}) \le e^{-n(\delta _{\theta }+o(1))}M_{\textrm{Lev}}(n,\theta ), \end{aligned}$$

where \(o(1)\rightarrow 0\) as \(n\rightarrow \infty \) and \(\delta _{\theta }:=\Delta (\theta )-\Delta (\theta ^*)>0\), with

$$\begin{aligned} \Delta (\theta ):=\frac{1+\sin \theta }{2\sin \theta } \log \frac{1+\sin \theta }{2\sin \theta }-\frac{1-\sin \theta }{2\sin \theta }\log \frac{1-\sin \theta }{2\sin \theta } +\frac{1}{2}\log (1-\cos \theta ). \end{aligned}$$

Proof

Let \(0<\theta <\theta ^{\prime }\le \pi /2\). Recall the notation of Proposition 3.6. Associated to a function \(g_{\theta '}\) satisfying the Delsarte linear programming conditions in dimension \(n-1\) and for angle \(\theta '\), in Proposition 3.6 we constructed an explicit \(h_{\theta '}\in D(d\mu _{\frac{n-3}{2}},\cos \theta )\) such that

$$\begin{aligned} \mathcal {L}(h_{\theta '})\le \frac{ \mathcal {L}(g_{\theta '})}{\lambda _n(\theta ,\theta ')}(1+O(ne^{-nc})), \end{aligned}$$

where \(c>0\) is a specific constant depending only on \(\theta \) and \(\theta '\). Therefore,

$$\begin{aligned} \frac{1}{n}\log \mathcal {L}(h_{\theta '})\le \frac{1}{n}\log \mathcal {L} (g_{\theta '}) -\frac{\log \lambda _n(\theta ,\theta ')}{n} + O(e^{-nc}). \end{aligned}$$

By [17, Theorem 4]

$$\begin{aligned} \lim _{n\rightarrow \infty } \frac{1}{n}\log \mathcal {L}(g_{\theta '}) =\frac{1+\sin \theta '}{2\sin \theta '}\log \frac{1+\sin \theta '}{2\sin \theta '}-\frac{1-\sin \theta '}{2\sin \theta '}\log \frac{1-\sin \theta '}{2\sin \theta '}. \end{aligned}$$

It is easy to show that [17, Proof of Theorem 4]

$$\begin{aligned} \lim _{n\rightarrow \infty }\frac{\log \lambda _n(\theta ,\theta ')}{n} = \frac{1}{2}\log \frac{1-\cos \theta }{1-\cos \theta '}. \end{aligned}$$

Hence,

$$\begin{aligned} \frac{1}{n}\log \mathcal {L}(h_{\theta '})\le \Delta (\theta ') -\frac{1}{2}\log (1-\cos \theta )+o(1), \end{aligned}$$

where

$$\begin{aligned} \Delta (\theta '):=\frac{1+\sin \theta '}{2\sin \theta '}\log \frac{1+\sin \theta '}{2\sin \theta '}-\frac{1-\sin \theta '}{2\sin \theta '}\log \frac{1-\sin \theta '}{2\sin \theta '} +\frac{1}{2}\log (1-\cos \theta '). \end{aligned}$$

Note that

$$\begin{aligned} \frac{d}{d\theta '} \Delta (\theta ')=-\frac{\csc ^2(\theta ')}{2} \left( \cos \theta ' \log (\frac{1+\sin \theta '}{1-\sin \theta '}) -(1+\cos \theta ')\sin \theta '\right) . \end{aligned}$$

As we mentioned before, \(\theta ^*:= 62.997 \cdots ^{\circ }\) is the unique root of the equation \(\frac{d}{d\theta '} \Delta (\theta ')=0\) [17, Theorem 4] in the interval \(0<\theta '<\pi /2\), which is the unique minimum of \(\Delta (\theta ')\) for \(0<\theta '< \pi /2.\) Hence, for \(0<\theta <\theta ^*,\) taking \(h_{\theta ^*}\) the function constructed in Proposition 3.6 associated to Levenshtein’s optimal polynomial \(g_{n-1,\theta ^*}\) for angle \(\theta ^*\) in dimension \(n-1\), and \(g_{n,\theta }\) Levenshtein’s optimal polynomial for angle \(\theta \) in dimension n, we obtain

$$\begin{aligned} \frac{1}{n} \left( \log \mathcal {L}(h_{\theta ^*}) -\log \mathcal {L} (g_{n,\theta }) \right) \le \Delta (\theta ^*)-\Delta (\theta )+o(1)<0 \end{aligned}$$

for sufficiently large n. This concludes the proof of this proposition. \(\square \)

3.4 Constant improvement to Barg–Musin and Cohn–Zhao

In this subsection, we sketch the ideas that go into proving Theorems 1.1 that improves inequality (9) of Barg–Musin by a constant factor of at least 0.4325 for every angle \(\theta \) with \(0<\theta <\theta ^*\). The improvement to the Cohn–Zhao inequality (10) for sphere packings is similar. We will complete the technical details in the rest of the paper.

Fig. 4
figure 4

r and R defined in (14) and (16)

Recall that given any test function \(g_{\theta '}\in D(d\mu _{\frac{n-4}{2}},\cos \theta ^{\prime })\) and F an arbitrary integrable real valued function on \([-1,1]\), we defined

$$\begin{aligned} h(\varvec{a},\varvec{b};\varvec{z}):= F(u)F(v) g_{\theta '}\left( \frac{t-uv}{\sqrt{(1-u^2)(1-v^2)}}\right) \end{aligned}$$

in Eq. (21), using which we defined the function

$$\begin{aligned} h(\varvec{a},\varvec{b}):=\int _{O(n)} h(\varvec{a}, \varvec{b};k\varvec{z}) d\mu (k). \end{aligned}$$
(29)

\(h(\varvec{a},\varvec{b})\) is a point-pair invariant function, and so we viewed it as a function h(t) of \(t:=\langle \varvec{a},\varvec{b}\rangle \). As we saw in the proof of Proposition 3.6, for F positive integrable and compactly supported on [rR], \(F(u)F(v)\ne 0\) implies that \(\varvec{a},\varvec{b}\in \text {Str}_{\theta , \theta '}(\varvec{z})\), where

$$\begin{aligned} Str _{\theta ,\theta '}(\varvec{z}):=\{\varvec{a}\in S^{n-1}:r \le \langle \varvec{a},\varvec{z}\rangle \le R\} \end{aligned}$$

is the grey strip illustrated above in Fig. 4. From this, we obtained that

$$\begin{aligned} g_{\theta '}\left( \frac{t-uv}{\sqrt{(1-u^2)(1-v^2)}}\right) \le 0, \end{aligned}$$

using which we obtained that the integrand in (29) is non-positive, giving us

$$\begin{aligned} h(t)\le 0 for t\in [-1,\cos \theta ]. \end{aligned}$$
(30)

Our insight is that the integrand in (29) need not be non-positive everywhere in order to have (30). In fact, we will show that when F is the characteristic function with support \([r-\delta ,R]\) for some \(\delta >\frac{c}{n}\), where \(c>0\) is independent of n, and \(g_{\theta '}\) are Levenshtein’s optimal polynomials, we continue to have (30). This corresponds to allowing \(\varvec{a},\varvec{b}\) be contained in a slight enlargement of the strip \(Str _{\theta ,\theta '}(\varvec{z})\) (See Fig. 4).

There are two main ingredients that go into determining an explicit lower bound for \(\delta \). The first is related to understanding the behavior of Levenshtein’s optimal polynomials near their largest roots. This reduces to understanding the behavior of Jacobi polynomials near their largest roots. This is done in Sect. 5.1. The other idea is estimating the density function of the inner product matrix of triple uniformly distributed points on high-dimensional spheres. This allows us to rewrite the integral (29) and its sphere packing analogue using different coordinates. This is done in Sect. 4.

4 Conditional density functions

In this section, we rewrite the averaging integral (29) when F is a characteristic function in different coordinates. We also do the same for sphere packings. See Eqs. (31) and (33). In order to prove Theorems 1.1 and 1.2 in Sect. 5, we will also need to estimate certain conditional densities, which is the main purpose of this section.

4.1 Conditional density for spherical codes

Let \({\mathcal {S}}\) be the space of positive semi-definite symmetric \(3\times 3\) matrices with 1 on diagonal. Let

$$\begin{aligned} \pi : (S^{n-1})^3 \rightarrow {\mathcal {S}} \end{aligned}$$

be the map that sends triple points to their pairwise inner products via

$$\begin{aligned} (\varvec{a},\varvec{b},\varvec{z})\mapsto \begin{bmatrix} 1&{}\quad t&{}\quad u \\ t &{}\quad 1 &{}\quad v \\ u &{}\quad v &{}\quad 1 \end{bmatrix}, \end{aligned}$$

where \((t,u,v):=(\langle \varvec{a},\varvec{b}\rangle ,\langle \varvec{a},\varvec{z}\rangle ,\langle \varvec{b},\varvec{z}\rangle )\). Let \(\mu (u,v,t)dudvdt\) be the density function of the pushforward of the product of uniform probability measures on \((S^{n-1})^3 \) to the coordinates (uvt).

Proposition 4.1

We have

$$\begin{aligned} \mu (u,v,t):= C\det \begin{bmatrix} 1&{}\quad t&{}\quad u \\ t &{}\quad 1 &{}\quad v \\ u &{}\quad v &{}\quad 1 \end{bmatrix}^{\frac{n-4}{2}}. \end{aligned}$$

where C is a normalization constant such that \(\int _{{\mathcal {S}}} \mu (u,v,t) dudvdt=1\)

Proof

The density of the conditional measure is given by

$$\begin{aligned} \mu (u,v,t)=\mu (u,v;t)\mu (t) \end{aligned}$$

where \(\mu (t)=(1-t^2)^{\frac{n-3}{2}}\) and \(\mu (u,v;t)\) is the conditional density of uv given t. We note that this conditional density function is proportional to

$$\begin{aligned} \lim _{\varepsilon \rightarrow 0}\frac{\text {vol}(Str(u,v,\varepsilon ; \varvec{a},\varvec{b}))}{\varepsilon ^2}. \end{aligned}$$

where

$$\begin{aligned} Str(u,v,\varepsilon ;\varvec{a},\varvec{b}):=\{\varvec{z}\in S^{n-1}: 0\le \langle \varvec{a}, \varvec{z}\rangle -u, \langle \varvec{b}, \varvec{z}\rangle -v \le \varepsilon \}. \end{aligned}$$

We write \(\varvec{z}=\varvec{z}^{\perp }+\varvec{z}^{\Vert }\), where \(\varvec{z}^{\Vert }\) is the projection of \(\varvec{z}\) onto the two dimensional plane spanned by \(\varvec{a}\) and \(\varvec{b}\) and \(\varvec{z}^{\perp }\) is orthogonal to \(\varvec{a}\) and \(\varvec{b}\). Fix \(\varvec{a}, \varvec{b}\) and consider the following map from \(S^{n-1}\)

$$\begin{aligned} \varvec{z}\rightarrow [\varvec{z}^{\Vert },\varvec{z}^{\perp }]. \end{aligned}$$

The above map has Jacobian \(\frac{\det \begin{bmatrix} 1&{}\quad t&{}\quad u \\ t &{}\quad 1 &{}\quad v \\ u &{}\quad v &{}\quad 1\end{bmatrix}^{1/2}}{\sqrt{1-t^2}}\) with respect to the Euclidean metric. We note that the geometric locus of \(\varvec{z}^{\Vert }\) is a rhombus with area \(\frac{\varepsilon ^2}{\sqrt{1-t^2}}\). Moreover, given \(\varvec{z}^{||}\), the geometric locus of \(\varvec{z}^{\perp }\) is a sphere of dimension \(n-3\) and radius

$$\begin{aligned} |\varvec{z}^{\perp }|=\frac{\det \begin{bmatrix} 1&{}\quad t&{}\quad u \\ t &{}\quad 1 &{}\quad v \\ u &{}\quad v &{}\quad 1 \end{bmatrix}^{1/2}}{\sqrt{1-t^2}}+O(\varepsilon ). \end{aligned}$$

Therefore,

$$\begin{aligned} \text {vol}(Str(u,v,\varepsilon ;x,y)){} & {} =\frac{\varepsilon ^2}{\sqrt{1-t^2}} \frac{\sqrt{1-t^2}}{\det \begin{bmatrix} 1&{}\quad t&{}\quad u \\ t &{}\quad 1 &{}\quad v \\ u &{}\quad v &{}\quad 1 \end{bmatrix}^{1/2}}\left( \frac{\det \begin{bmatrix} 1&{}\quad t&{}\quad u \\ t &{}\quad 1 &{}\quad v \\ u &{}\quad v &{}\quad 1 \end{bmatrix}^{1/2}}{\sqrt{1-t^2}}\right) ^{n-3}\\{} & {} (1+O(\varepsilon )), \end{aligned}$$

from which it follows that

$$\begin{aligned} \mu (u,v;t)=C \frac{\det \begin{bmatrix} 1&{}\quad t&{}\quad u \\ t &{}\quad 1 &{}\quad v \\ u &{}\quad v &{}\quad 1 \end{bmatrix}^{\frac{n-4}{2}}}{(1-t^2)^{\frac{n-3}{2}}} \end{aligned}$$

for some constant \(C>0\). This implies our proposition. \(\square \)

Recall that \(\theta <\theta ^{\prime }\). Let \(s^{\prime }=\cos (\theta ^{\prime })\) and \(s=\cos (\theta ).\) Note that \(s^{\prime }<s\) and for \(r=\sqrt{\frac{s-s^{\prime }}{1-s^\prime }}\), we have \(s^{\prime }=\frac{s-r^2}{1-r^2}\) and \(0< r<1\). Let \(0<\delta =o(\frac{1}{\sqrt{n}})\) that we specify later, and define

$$\begin{aligned} \chi (y):={\left\{ \begin{array}{ll} 1 &{}\quad \text {for } r-\delta \le y\le R, \\ 0 &{}\quad \text {otherwise}. \end{array}\right. } \end{aligned}$$

See Fig. 4. \(\varvec{a},\varvec{b}\) are in the shaded areas corresponding to uv being in the support of \(\chi \).

Recall (13), and denote

$$\begin{aligned} x:=\frac{t-uv}{\sqrt{(1-u^2)(1-v^2)}}. \end{aligned}$$

Let \(\mu (x;t,\chi )\) be the induced density function on x subjected to the conditions of fixed t,  and \(r-\delta \le u,v\le R\). Precisely, up to a positive constant multiple that depends on \(n,t, R, r-\delta \), we have

$$\begin{aligned} \mu (x;t,\chi )=\int _{C_{x,t}}\chi (u)\chi (v)\mu ^*(x,l,t)dl, \end{aligned}$$

where the integral is over the curve \(C_{x,t}\subset {\mathbb {R}}^2\) that is given by \(\frac{t-uv}{\sqrt{(1-u^2)(1-v^2)}}=x\) (Fig. 5), dl is the induced Euclidean metric on \(C_{x,t},\) and

$$\begin{aligned} \mu ^*(x,l,t)dxdldt= \mu (u,v,t)dudvdt. \end{aligned}$$
Fig. 5
figure 5

\(\varvec{a}\) and \(\varvec{b}\) are two points with fixed \(t=\langle \varvec{a},\varvec{b} \rangle \). The two outer curves within the shaded regions represent the 2-dimensional locus of points \(\varvec{z}\) having (uv) on the curve \(C_{x,t}\). Shaded region corresponds to the support of \(\chi (u)\chi (v)\)

We explicitly compute \(\mu ^*(x,l,t)\). We have

$$\begin{aligned} du dv dt= \frac{1}{\sqrt{(\frac{\partial x}{\partial u})^2 +\left( \frac{\partial x}{\partial v}\right) ^2}} dx dl dt, \end{aligned}$$

from which it follows that

$$\begin{aligned} \mu ^*(x,l,t)=\frac{\mu (u,v,t)}{\sqrt{\left( \frac{\partial x}{\partial u}\right) ^2 +\left( \frac{\partial x}{\partial v}\right) ^2}}. \end{aligned}$$

Hence, up to a positive constant multiple that depends on \(n,t, R, r-\delta \),

$$\begin{aligned} \mu (x;t,\chi )=\int _{C_{x,t}}\frac{\chi (u)\chi (v)\mu (u,v,t)}{\sqrt{\left( \frac{\partial x}{\partial u}\right) ^2 +\left( \frac{\partial x}{\partial v}\right) ^2}} dl. \end{aligned}$$

We may write the test function constructed in Eq. (22) with \(F=\chi \) and any given g as

$$\begin{aligned} h(t)=\int _{-1}^1g(x)\mu (x;t,\chi )dx, \end{aligned}$$
(31)

where \(t=\langle \varvec{a},\varvec{b}\rangle \); see Sect. 3.4. We define for complex x

$$\begin{aligned} x^{+}:={\left\{ \begin{array}{ll} x &{}\quad \text {for } x\ge 0, \\ 0 &{}\quad \text {otherwise.} \end{array}\right. } \end{aligned}$$

Proposition 4.2

Suppose that \(|x-s^{\prime }|=o(\frac{1}{\sqrt{n}}).\) We have, up to a positive constant multiple depending on \(n,s,R,r-\delta \),

$$\begin{aligned} \mu (x;s,\chi )= & {} \left( \frac{2(1-r^2)^2}{r(1-s)}+o(1)\right) \left( \delta +\sqrt{\frac{s-x}{1-x}}-r \right) ^+\\{} & {} \times \left( \left( \frac{1-x^2}{x^2}\right) \left( s-r^2\right) ^2\right) ^{\frac{n-4}{2}} e^{\left( -\frac{2nr\left( \sqrt{\frac{s-x}{1-x}} -r \right) }{ s-r^2} \right) }. \end{aligned}$$

Proof

Let \(C_x:=C_{x,s}\). Note that

$$\begin{aligned} x=\frac{s-uv}{\sqrt{(1-u^2)(1-v^2)}} \end{aligned}$$

and

$$\begin{aligned} \mu (u,v,s)=\left( (1-x^2)(1-u^2)(1-v^2)\right) ^{\frac{n-4}{2}}. \end{aligned}$$

Furthermore,

$$\begin{aligned} \left( \frac{\partial x}{\partial u}\right) ^2 +\left( \frac{\partial x}{\partial v}\right) ^2 =\frac{(us-v)^2}{(1-v^2)(1-u^2)^3}+\frac{(vs-u)^2}{(1-u^2)(1-v^2)^3}=2\frac{r^2(1-s)^2}{(1-r^2)^4}+o(1). \end{aligned}$$

Hence, up to a positive constant multiple depending on \(n,s,R,r-\delta \),

$$\begin{aligned} \mu (x;s,\chi )= & {} \left( \frac{(1-r^2)^2}{\sqrt{2}r(1-s)}+o(1)\right) \int _{C_x}\chi (u)\chi (v)\mu (u,v,s) dl \\= & {} \left( \frac{(1-r^2)^2}{\sqrt{2}r(1-s)}+o(1)\right) (1-x^2)^{\frac{n-4}{2}}\int _{C_x}\chi (u)\chi (v) \left( (1-u^2)(1-v^2)\right) ^{\frac{n-4}{2}} dl \\= & {} \left( \frac{(1-r^2)^2}{\sqrt{2}r(1-s)}+o(1)\right) (1-x^2)^{\frac{n-4}{2}}\int _{C_x}\chi (u)\chi (v) \left( \frac{s-uv}{x}\right) ^{{n-4}} dl \\= & {} \left( \frac{(1-r^2)^2}{\sqrt{2}r(1-s)}+o(1)\right) \left( \frac{1-x^2}{x^2}\right) ^{\frac{n-4}{2}} \int _{C_x}\chi (u)\chi (v)\left( s-uv\right) ^{{n-4}} dl \end{aligned}$$

Suppose that \(r\le u,v\le R\). Then, by the definition of R, the equality

$$\begin{aligned} s'=\frac{s-uv}{\sqrt{(1-u^2)(1-v^2)}} \end{aligned}$$

occurs when \((u,v)\in \{(r,R),(R,r),(r,r)\}\). Furthermore, when \(|x-s'|=o\left( \frac{1}{\sqrt{n}}\right) \), we must have \((u,v)\in \{(r,R),(R,r),(r,r)\}\) up to \(o\left( \frac{1}{\sqrt{n}}\right) \). Since the integrand \(\chi (u)\chi (v)(s-uv)^{n-4}\) of the last integral above is exponentially larger when \(u,v=r+o\left( \frac{1}{\sqrt{n}}\right) \), the main contribution of the integral comes when u and v are near r up to \(o\left( \frac{1}{\sqrt{n}}\right) \). Writing \(u=r+\tilde{u}\) and \(v=r+\tilde{v},\) where \(\tilde{u}, \tilde{v}=o(\frac{1}{\sqrt{n}}),\) we have

$$\begin{aligned} s-uv=s-r^2-r(\tilde{u}+\tilde{v})-\tilde{u}\tilde{v} =(s-r^2)\left( 1-\frac{r(\tilde{u}+\tilde{v})+\tilde{u} \tilde{v}}{ s-r^2}\right) . \end{aligned}$$

Hence, up to a positive constant multiple depending on \(n,s,R,r-\delta \),

$$\begin{aligned} \mu (x;s,\chi )= & {} \left( \frac{(1-r^2)^2}{\sqrt{2}r(1-s)}+o(1)\right) \left( \left( \frac{1-x^2}{x^2}\right) \left( s-r^2\right) ^2 \right) ^{\frac{n-4}{2}}\\{} & {} \times \int _{C_x}\chi (u)\chi (v) \left( 1-\frac{r(\tilde{u}+\tilde{v})+\tilde{u} \tilde{v}}{ s-r^2}\right) ^{{n-4}} dl. \end{aligned}$$

Recall the following inequalities, which follow easily from the Taylor expansion of \(\log (1+x)\)

$$\begin{aligned} e^{a-\frac{a^2}{n}} \le \left( 1+\frac{a}{n} \right) ^n\le e^a \end{aligned}$$

for \(|a|\le n/2.\) We apply the above inequalities to estimate the integral, and obtain

$$\begin{aligned} \int _{C_x}\chi (u)\chi (v)\left( 1-\frac{r(\tilde{u}+\tilde{v}) +\tilde{u}\tilde{v}}{ s-r^2}\right) ^{{n-4}} dl=\left( 1+o(1)\right) \int _{C_x}e^{\left( -\frac{nr(\tilde{u}+\tilde{v})}{ s-r^2}\right) } \chi (u)\chi (v) dl. \end{aligned}$$

We approximate the curve \(C_x\) with the following line

$$\begin{aligned} \tilde{u}+\tilde{v}= 2\left( \sqrt{\frac{s-x}{1-x}}-r \right) +o\left( \frac{1}{n}\right) . \end{aligned}$$

It follows that

$$\begin{aligned} \int _{C_x}e^{\left( -\frac{nr(\tilde{u}+\tilde{v})}{s-r^2}\right) } \chi (u)\chi (v) dl =(1+o(1))2\sqrt{2}\left( \delta +\sqrt{\frac{s-x}{1-x}}-r \right) ^+e^{\left( -\frac{2nr \left( \sqrt{\frac{s-x}{1-x}}-r \right) }{ s-r^2} \right) }, \end{aligned}$$

from which the conclusion follows. \(\square \)

4.2 Conditional density for sphere packings

Let \(s=\cos (\theta )\) and \(r=\frac{1}{\sqrt{2(1-s)}}\), where \(\frac{1}{3}\le s\le \frac{1}{2}\). Let \(0<\delta =\frac{c_1}{n}\) for some fixed \(c_1>0\) that we specify later, and define

$$\begin{aligned} \chi (y):={\left\{ \begin{array}{ll} 1 &{}\quad \text {for } 0 \le y\le r+\delta , \\ 0 &{}\quad \text {otherwise}. \end{array}\right. } \end{aligned}$$

Let \(\varvec{a},\varvec{b}\) be two randomly independently chosen points on \({\mathbb {R}}^{n}\) with respect to the Euclidean measure such that \(|\varvec{a}|,|\varvec{b}|\le r+\delta ,\) where |.| is the Euclidean norm. Let

$$\begin{aligned}{} & {} U:=|\varvec{a}|,\\{} & {} V:=|\varvec{b}|,\\{} & {} T:=|\varvec{a}-\varvec{b}|, \end{aligned}$$

and \(\alpha \) be the angle between \(\varvec{a}\) and \(\varvec{b}\). The pushforward of the product measure on \({\mathbb {R}}^{n}\times {\mathbb {R}}^{n}\) onto the coordinates \((U,V,\alpha )\) is, up to a positive scalar depending only on n, the measure

$$\begin{aligned} \mu (U,V,\alpha ) dUdVd\alpha =U^{n-1}V^{n-1}\sin (\alpha )^{n-3}dUdVd\alpha . \end{aligned}$$

Let

$$\begin{aligned} x:=\cos \alpha =\frac{U^2+V^2-T^2}{2UV}, \end{aligned}$$
(32)

which follows from the cosine law. We have

$$\begin{aligned} \sin \alpha d\alpha = \frac{T}{UV}dT- \frac{\partial \frac{U^2+V^2-T^2}{2UV}}{\partial U} dU -\frac{\partial \frac{U^2+V^2-T^2}{2UV}}{\partial V} dV. \end{aligned}$$

Hence, the pushforward of the product measure on \({\mathbb {R}}^{n}\times {\mathbb {R}}^{n}\) onto the coordinates \((U,V,T)\in {\mathbb {R}}^3\) has the following density function up to a positive scalar depending only on n:

$$\begin{aligned} \mu (U,V,T)= (U^2V^2T)\Delta (U,V,T)^{n-4}, \end{aligned}$$

where \(\Delta (U,V,T)\) is the Euclidean area of the triangle with sides UVT. If no such triangle exists, then \(\Delta (U,V,T)=0\). Let \(\mu (x;T,\chi )\) be the induced density function on x subjected to the conditions of fixed T,  and \( U,V\le r+\delta \). Precisely, we have, up to a positive constant multiple depending on \(n, r+\delta \) and T, that

$$\begin{aligned} \mu (x;T,\chi ):=\int _{C_{x,T}}\chi (U)\chi (V)\mu (x,l,T)dl, \end{aligned}$$

where the integral is over the curve \(C_{x,T}\subset {\mathbb {R}}^2\) that is given by \(\frac{U^2+V^2-T^2}{2UV}=x\) (Fig. 6) and dl is the induced Euclidean metric on \(C_{x,T},\) and

$$\begin{aligned} \mu (x,l,T) dxdldT= \mu (U,V,T)dUdVdT. \end{aligned}$$
Fig. 6
figure 6

\(\varvec{a}\) and \(\varvec{b}\) are two points with \(T=|\varvec{a}-\varvec{b}|\). The two outer curves within the shaded region represent the locus of of points \(\varvec{z}\) having (UV) on the curve \(C_{x,T}\), that is, \(\varvec{z}\) with respect to which \(\varvec{a}\) and \(\varvec{b}\) have angle whose cosine is x. Shaded region corresponds to the support of \(\chi (U)\chi (V)\)

We have

$$\begin{aligned} dU dV dT= \frac{1}{\sqrt{\left( \frac{\partial x}{\partial U}\right) ^2 +\left( \frac{\partial x}{\partial V}\right) ^2}} dx dl dT, \end{aligned}$$

and

$$\begin{aligned} \left( \frac{\partial x}{\partial U}\right) ^2 +\left( \frac{\partial x}{\partial V} \right) ^2 = \left( \frac{T}{UV}\right) ^2(1+x^2)-\frac{2x(1-x^2)}{UV}. \end{aligned}$$

Hence,

$$\begin{aligned} \mu (x;T,\chi )=\int _{C_{x,T}}\frac{\chi (U)\chi (V) \mu (U,V,T)}{\sqrt{\left( \frac{T}{UV}\right) ^2(1+x^2) -\frac{2x(1-x^2)}{UV}}} dl \end{aligned}$$

up to a positive constant multiple depending on \(n, r+\delta \) and T.

From Lemma 3.7, Eq. (23) with \(F=\chi \) and any given g may be written as

$$\begin{aligned} H(T)=\int _{-1}^1g(x)\mu (x;T,\chi )dx. \end{aligned}$$
(33)

We now study the scaling property of \(\mu (x;T,\chi ).\) Let \(\chi _{T}(x):=\chi (\frac{x}{T}).\)

Lemma 4.3

We have

$$\begin{aligned} \mu (x;T,\chi )=T^{2n-1}\mu (x;1,\chi _{T}). \end{aligned}$$

Proof

Note that

$$\begin{aligned} \mu (U,V,T)= T^{2n-3}\mu \left( \frac{U}{T},\frac{V}{T},1\right) , \end{aligned}$$

and x is invariant by scaling UVT. The conclusion follows. \(\square \)

Let \(\mu (x;\chi ):=\mu (x;1,\chi ),\) and

$$\begin{aligned} r_1:=\sqrt{1-(1-x^2)(r+\delta )^2}+x(r+\delta ). \end{aligned}$$

Proposition 4.4

Suppose that \(|x-s|\le \frac{c_2}{n}\), \(x<1/2\) and \(\delta =\frac{c_1}{n}\). We have

$$\begin{aligned} \mu (x;\chi )= & {} (1+E)(1-x^2)^{\frac{n-4}{2}} \left( \frac{1}{2(1-x)}\right) ^{{n-1}}\\{} & {} \times \frac{1}{\sqrt{1-x}}\sqrt{1+\left( x-\frac{(1-x^2)r}{\sqrt{1-(1-x^2)r^2}}\right) ^2}\left( r+\delta - r_1 \right) ^+ \end{aligned}$$

up to a positive scalar multiple making this a probability measure on \([-1,1]\), and where E is a function of x with the uniform bound \(|E|<\frac{(4c_2+2c_1+2)^2}{n}\) for \(n\ge 2000\).

Proof

We have

$$\begin{aligned} \mu (x;\chi )=\int _{C_x}\chi (U)\chi (V) \frac{\mu (U,V,1)}{{\sqrt{\frac{1+x^2}{\left( UV\right) ^2} -\frac{2x(1-x^2)}{UV}}} } dl, \end{aligned}$$

where \(C_x:=C_{x,1}.\) We note that up to a positive scalar depending only on n,

$$\begin{aligned} \mu (U,V,1)=U^2V^2\left( (1-x^2)U^2V^2\right) ^{\frac{n-4}{2}}. \end{aligned}$$

Hence,

$$\begin{aligned} \mu (x;\chi )=(1-x^2)^{\frac{n-4}{2}}\int _{C_x}\chi (U)\chi (V) \frac{\left( UV\right) ^{n-1}}{{\sqrt{1+x^2-2x(1-x^2)UV}}} dl. \end{aligned}$$

Suppose that U and V are in the support of \(\chi .\) By concentration of mass, we may assume that \(U=r+\tilde{U}\) and \(V=r+\tilde{V},\) with \(\tilde{U}, \tilde{V}\le \frac{c_1}{n}.\) From (32), we have

$$\begin{aligned} \tilde{U}+\tilde{V}= \frac{1}{2r(1-x)}-r+E_1, \end{aligned}$$

where

$$\begin{aligned} E_1:= \frac{1}{2r(1-x)}\left( 2x\tilde{U}\tilde{V} -\tilde{U}^2 -\tilde{V}^2 \right) . \end{aligned}$$

Since \(|x-s|\le \frac{c_2}{n},\) and \(\frac{1}{2}<2r(1-x)^2,\) it follows that \(-\frac{c_1+2c_2}{n}< \tilde{U}, \tilde{V}\le \frac{c_1}{n}\) for \(n\ge 2000\). Hence,

$$\begin{aligned} |E_1|\le 3\frac{(c_1+2c_2)^2}{n^2}. \end{aligned}$$

We have

$$\begin{aligned} UV=r^2+r(\tilde{U}+\tilde{V})+\tilde{U}\tilde{V} =r^2\left( 1+\frac{\tilde{U}+\tilde{V}}{r}\right) +\tilde{U}\tilde{V}= \frac{1}{2(1-x)}+E_2, \end{aligned}$$

where \(|E_2|< 4\frac{(c_1+2c_2)^2}{n^2}.\) Furthermore,

$$\begin{aligned} \sqrt{1+x^2-2x(1-x^2)UV}= \sqrt{1-x-2x(1-x^2)E_2}=\sqrt{1-x}+E_2', \end{aligned}$$

where \(|E_2'|<|E_2|.\) Hence,

$$\begin{aligned} \mu (x;\chi )= & {} (1-x^2)^{\frac{n-4}{2}} \left( \frac{1}{2(1-x)} \right) ^{{n-1}} \frac{1}{\sqrt{1-x}+E_2'}\\{} & {} \times \left( 1+\frac{E_2}{2(1-x)}\right) ^{n-1} \int _{C_x} \chi (U)\chi (V) dl. \end{aligned}$$

Note that

$$\begin{aligned} \frac{1}{\sqrt{1-x}+E_2'} \left( 1+\frac{E_2}{2(1-x)}\right) ^{n-1} =\frac{1}{\sqrt{1-x}}(1+E_2''), \end{aligned}$$

where \(E_2''\le 4\frac{(c_1+2c_2)^2}{n}\) for \(n\ge 2000\). We parametrize the curve \(C_x\) with V to obtain

$$\begin{aligned} U(V)=\sqrt{1-(1-x^2)V^2}+xV. \end{aligned}$$

We have

$$\begin{aligned} \frac{dU}{dV}=x-\frac{(1-x^2)V}{\sqrt{1-(1-x^2)V^2}} =x-\frac{(1-x^2)r}{\sqrt{1-(1-x^2)r^2}}+E_3, \end{aligned}$$

where

$$\begin{aligned} |E_3|=\left| (V-r) \frac{(1-x^2)}{(1-(1-x^2)V_1^2)^{3/2}}\right| \end{aligned}$$

for some \(V_1\in \left( r-\frac{c_1+2c_2}{n},r+\frac{c_1}{n}\right) ,\) which implies \(\left| \frac{(1-x^2)}{(1-(1-x^2)V_1^2)^{3/2}} \right| <6.\) Hence,

$$\begin{aligned} |E_3|\le 6\left( \frac{c_1+2c_2}{n}\right) . \end{aligned}$$

Hence,

$$\begin{aligned} \int _{C_x} \chi (U)\chi (V) dl&=^+\int _{r_1}^{r+\delta } \sqrt{1+\left( \frac{dU}{dV}\right) ^2} dV \\&=\sqrt{1+\left( x-\frac{(1-x^2)r}{\sqrt{1-(1-x^2)r^2}}\right) ^2} \left( r+\delta - r_1 \right) ^+ (1+\bar{E_3}) \end{aligned}$$

where

$$\begin{aligned} r_1:=\sqrt{1-(1-x^2)(r+\delta )^2}+x(r+\delta ), \end{aligned}$$

and

$$\begin{aligned} |E_3|\le 6\left( \frac{c_1+2c_2}{n}\right) . \end{aligned}$$

The first equality \(=^+\) above means equal to 0 if \(r+\delta <r_1\). Therefore,

$$\begin{aligned} \mu (x;\chi )= & {} (1+E)(1-x^2)^{\frac{n-4}{2}} \left( \frac{1}{2(1-x)}\right) ^{{n-1}}\\{} & {} \times \frac{1}{\sqrt{1-x}}\sqrt{1+\left( x-\frac{(1-x^2)r}{\sqrt{1-(1-x^2)r^2}}\right) ^2} \left( r+\delta - r_1 \right) ^+ \end{aligned}$$

up to a positive scalar multiple, where \(|E|<\frac{(4c_2+2c_1+2)^2}{n}\) for \(n\ge 2000\). This completes the proof of our Proposition. \(\square \)

5 Comparison with previous bounds

We define Jacobi polynomials, state some of their properties, and prove a local approximation result for Jacobi polynomials in Sect. 5.1. In Sect. 5.2, we improve bounds on \(\theta \)-spherical codes. In Sect. 5.3, we improve upper bounds on sphere packing densities. The general constructions of our test functions were provided in Sect. 3. For each of our main theorems, we determine the largest values of \(\delta =O(1/n)\) measuring the extent to which the supports of the characteristic functions \(\chi \) in Propositions 3.6 and 3.8 could be enlarged. See the end of Sect. 3 for an outline of the general strategy.

5.1 Jacobi polynomials and their local approximation

Recall definition (7) of \(M_{\textrm{Lev}}(n,\theta )\). Levenshtein proved inequality (6) by applying Delsarte’s linear programming bound to a family of even and odd degree polynomials inside \(D(d\mu _{\frac{n-3}{2}},\cos \theta ),\) which we now discuss. In order to define these Levenshtein polynomials, we record some well-known properties of Jacobi polynomials (see [28, Chapter IV]) that we will also use in the rest of the paper.

We denote by \(p^{\alpha ,\beta }_{d}(t)\) Jacobi polynomials of degree d with parameters \(\alpha \) and \(\beta \). These are orthogonal polynomials with respect to the probability measure

$$\begin{aligned} d\mu _{\alpha ,\beta }:=\frac{(1-t)^{\alpha }(1+t)^{\beta }dt}{\int _{-1}^1(1-t)^{\alpha }(1+t)^{\beta }dt} \end{aligned}$$

on the interval \([-1,1]\) with the normalization that gives

$$\begin{aligned} p^{\alpha ,\beta }_d(1)=\left( {\begin{array}{c}d+\alpha \\ d\end{array}}\right) . \end{aligned}$$

\(p^{\alpha ,\beta }_{d}(t)\) has n simple real roots \(t_{1,d}^{\alpha ,\beta }> t_{2,d}^{\alpha ,\beta }> \dots >t_{d,d}^{\alpha ,\beta }.\) When \(\alpha =\beta \), we denote the measure \(d\mu _{\alpha ,\alpha }\) simply as \(d\mu _{\alpha }\).

$$\begin{aligned} \frac{d}{dt}p_d^{\alpha ,\beta }(t)=\frac{d+\alpha +\beta +1}{2} p_{d-1}^{\alpha +1,\beta +1}(t). \end{aligned}$$
(34)

When proving our local approximation result on Levenshtein’s optimal polynomials in the rest of this subsection, we use the fact that the Jacobi polynomial \(p_d^{\alpha ,\beta }(t)\) satisfies the differential equation

$$\begin{aligned} (1-t^2)x''(t)+(\beta -\alpha -(\alpha +\beta +2)t)x'(t) +d(d+\alpha +\beta +1)x(t)=0.\nonumber \\ \end{aligned}$$
(35)

By [21, Lemma 5.89],

$$\begin{aligned} t^{\alpha +1,\alpha +1}_{1,d-1}<t^{\alpha +1,\alpha }_{1,d} <t^{\alpha +1,\alpha +1}_{1,d}. \end{aligned}$$

It is also well-known that for fixed \(\alpha \), \(t^{\alpha +1,\alpha +1}_{1,d}\rightarrow 1\) as \(d\rightarrow \infty \). Henceforth, let \(d:=d(n,\theta )\) be uniquely determined by \(t^{\alpha +1,\alpha +1}_{1,d-1}< \cos (\theta ) \le t^{\alpha +1,\alpha +1}_{1,d}\). Let [21, Lemma 5.38]

$$\begin{aligned} g_{n,\theta }(x)={\left\{ \begin{array}{ll} \frac{(x+1)^2}{(x-t^{\alpha +1,\alpha +1}_{1,d})} \left( p^{\alpha +1,\alpha +1}_{d}(x) \right) ^2 &{}\quad \text { if } t^{\alpha +1,\alpha }_{1,d}< \cos (\theta ) \le t^{\alpha +1,\alpha +1}_{1,d} , \\ \frac{(x+1)}{(x-t^{\alpha +1,\alpha }_{1,d})} \left( p^{\alpha +1,\alpha }_{d}(x) \right) ^2 &{}\quad \text { if } t^{\alpha +1,\alpha +1}_{1,d-1}< \cos (\theta ) \le t^{\alpha +1,\alpha }_{1,d}, \end{array}\right. } \end{aligned}$$
(36)

where \(\alpha :=\frac{n-3}{2}\) in our case. Levenshtein proved that \(g_{n,\theta }\in D(d\mu _{\frac{n-3}{2}},\cos \theta ),\) and

$$\begin{aligned} \mathcal {L}(g_{n,\theta })=M_{\textrm{Lev}}(n,\theta ). \end{aligned}$$

By (3), this gives

$$\begin{aligned} M(n,\theta )\le M_{\textrm{Lev}}(n,\theta ). \end{aligned}$$

As part of our proofs of our main theorems in the next subsections, we need to determine local approximations to Jacobi polynomials \(p_d^{\alpha ,\beta }\) in the neighbourhood of points \(s\in (-1,1)\) such that \(s\ge t_{1,d}^{\alpha ,\beta }\). This is obtained using the behaviour of the zeros of Jacobi polynomials. Using this, we obtain suitable local approximations of Levenshtein’s optimal functions near s.

Proposition 5.1

Suppose that \(\alpha \ge \beta \ge 0,\) \(|\alpha -\beta |\le 1\), \(d\ge 0\) and \(s\in [t_{1,d}^{\alpha ,\beta },1)\). Then, we have

$$\begin{aligned} p_d^{\alpha ,\beta }(t)=p_d^{\alpha ,\beta }(s)+(t-s) \frac{dp_d^{\alpha ,\beta }}{dt}(s)(1+A(t)), \end{aligned}$$

where,

$$\begin{aligned} |A(t)|\le \frac{e^{\sigma (t)}-1}{\sigma (t)}-1 \end{aligned}$$

with

$$\begin{aligned} \sigma (t):=\frac{|t-s|\left( 2\alpha s+2s+1\right) }{1-s^2}. \end{aligned}$$

Proof

Consider the Taylor expansion

$$\begin{aligned} p_d^{\alpha ,\beta }(t)=\sum _{k=0}^{\infty } \frac{(t-s)^k}{k!}\frac{d^kp_d^{\alpha ,\beta }}{dt^k}(s) \end{aligned}$$

of \(p_d^{\alpha ,\beta }\) centered at s. We prove the proposition by showing that for \(s\in [t_{1,d}^{\alpha ,\beta },1)\), the higher degree terms in the Taylor expansion are small in comparison to the linear term. Indeed, suppose \(k\ge 1\). Then, using Eq. (34),

$$\begin{aligned} \frac{(d^{k+1}/dt^{k+1})p_d^{\alpha ,\beta }(s)}{(d^k/dt^k) p_d^{\alpha ,\beta }(s)}=\frac{(d/dt) p_{d-k}^{\alpha +k,\beta +k}(s)}{p_{d-k}^{\alpha +k,\beta +k}(s)} =\sum _{i=1}^{d-k}\frac{1}{s-t_{i,d-k}^{\alpha +k,\beta +k}} \le \sum _{i=1}^{d-1}\frac{1}{s-t_{i,d-1}^{\alpha +1,\beta +1}}, \end{aligned}$$

where the last inequality follows from the fact that the roots of a Jacobi polynomial interlace with those of its derivative. However, the last quantity is equal to \(\frac{(d^2/dt^2)p_d^{\alpha ,\beta } (s)}{(d/dt)p_d^{\alpha ,\beta }(s)}\). We proceed to show that

$$\begin{aligned} \frac{(d^2/dt^2)p_d^{\alpha ,\beta }(s)}{(d/dt) p_d^{\alpha ,\beta }(s)}\le \frac{2\alpha s+2s+1}{1-s^2}. \end{aligned}$$
(37)

Indeed, we know from the differential equation (35) that

$$\begin{aligned}{} & {} (1-s^2)(d^2/dt^2)p_d^{\alpha ,\beta }(s)+(\beta -\alpha -(\alpha +\beta +2)s)(d/dt)p_d^{\alpha ,\beta }(s) \nonumber \\{} & {} \quad +d(d+\alpha +\beta +1)p_d^{\alpha ,\beta }(s)=0. \end{aligned}$$
(38)

However, since s is to the right of the largest root of \(p_d^{\alpha ,\beta }\), \(p_d^{\alpha ,\beta }(s)\ge 0\). Therefore,

$$\begin{aligned} (1-s^2)(d^2/dt^2)p_d^{\alpha ,\beta }(s)+(\beta -\alpha -(\alpha +\beta +2)s)(d/dt)p_d^{\alpha ,\beta }(s)\le 0, \end{aligned}$$

from which inequality (37) follows. As a result, the degree \(k+1\) term compares to the linear term as

$$\begin{aligned} \frac{(d^{k+1}/dt^{k+1})p_d^{\alpha ,\beta }(s)}{(d/dt) p_d^{\alpha ,\beta }(s)}\frac{|t-s|^k}{(k+1)!} \le \frac{|t-s|^k}{(k+1)!}\left( \frac{2(\alpha +1)s+1}{1-s^2}\right) ^k \end{aligned}$$

Consequently, for every \(k\ge 1\),

$$\begin{aligned} \frac{|t-s|^{k+1}}{(k+1)!}(d^{k+1}/dt^{k+1}) p_d^{\alpha ,\beta }(s)\le |t-s|(d/dt)p_d^{\alpha ,\beta }(s) \frac{\left( \frac{|t-s|\left( 2\alpha +2s+1\right) }{1-s^2}\right) ^k}{(k+1)!} \end{aligned}$$

As a result, we obtain that

$$\begin{aligned} p_d^{\alpha ,\beta }(t)=p_d^{\alpha ,\beta }(s)+(t-s) \frac{dp_d^{\alpha ,\beta }}{dt}(s)(1+A(t)), \end{aligned}$$

where

$$\begin{aligned} |A(t)|\le \frac{e^{\sigma (t)}-1}{\sigma (t)}-1 \end{aligned}$$

with

$$\begin{aligned} \sigma (t)=\frac{|t-s|\left( 2\alpha s+2s+1\right) }{1-s^2}. \end{aligned}$$

\(\square \)

5.2 Improving spherical codes bound

We prove a stronger version of Theorem 1.1 that we now state.

Theorem 5.2

Fix \(\theta <\theta ^*\) and suppose \(0<\theta <\theta '\le \pi /2\). Then there is a function \(h\in D(d\mu _{\frac{n-3}{2}},\cos \theta )\) such that

$$\begin{aligned} \mathcal {L}(h) \le c_n \frac{M_{\textrm{Lev}}(n-1,\theta ')}{\lambda _n(\theta ,\theta ')}, \end{aligned}$$

where \(c_n\le 0.4325\) for large enough n independent of \(\theta \) and \(\theta '\).

Proof

Without loss of generality, we may assume that \(\cos (\theta ^{\prime })=t^{\alpha +1,\alpha +\varepsilon }_{1,d}\) for some \(\varepsilon \in \{0,1\}\) and \(\alpha :=\frac{n-4}{2}.\) Indeed, recall from Sect. 5.1 that d is uniquely determined by \(t^{\alpha +1,\alpha +1}_{1,d-1}< \cos (\theta ') \le t^{\alpha +1,\alpha +1}_{1,d}\),

$$\begin{aligned} g(x)={\left\{ \begin{array}{ll} \frac{(x+1)^2}{(x-t^{\alpha +1,\alpha +1}_{1,d})} \left( p^{\alpha +1,\alpha +1}_{d}(x) \right) ^2 &{}\quad \text { if } t^{\alpha +1,\alpha }_{1,d}< \cos (\theta ') \le t^{\alpha +1,\alpha +1}_{1,d} , \\ \frac{(x+1)}{(x-t^{\alpha +1,\alpha }_{1,d})} \left( p^{\alpha +1,\alpha }_{d}(x) \right) ^2 &{}\quad \text { if } t^{\alpha +1,\alpha +1}_{1,d-1} < \cos (\theta ') \le t^{\alpha +1,\alpha }_{1,d}, \end{array}\right. } \end{aligned}$$

and

$$\begin{aligned} M_{\textrm{Lev}}(n-1,\theta ') = \mathcal {L}(g)=M_{\textrm{Lev}} \left( n-1,\arccos \left( t^{\alpha +1,\alpha +\varepsilon }_{1,d}\right) \right) . \end{aligned}$$

We also have

$$\begin{aligned} \lambda _n(\theta ,\theta ') \le \lambda _n (\theta ,\arccos (t^{\alpha +1,\alpha +\varepsilon }_{1,d}) ), \end{aligned}$$

where the above follows from \(\cos (\theta ^{\prime })\le t^{\alpha +1,\alpha +\varepsilon }_{1,d}\) and \(\lambda _n(\theta ,\theta ^{\prime })\) is the ratio of volume of the spherical cap with radius \(\frac{\sin (\theta /2)}{\sin (\theta ^{\prime }/2)}\) on the unit sphere \(S^{n-1}\) to the volume of the whole sphere. Hence,

$$\begin{aligned} \frac{M_{\textrm{Lev}}(n-1,\arccos (t^{\alpha +1,\alpha +\varepsilon }_{1,d}))}{\lambda _n(\theta ,\arccos (t^{\alpha +1,\alpha +\varepsilon }_{1,d}))} \le \frac{M_{\textrm{Lev}}(n-1,\theta ')}{\lambda _n(\theta ,\theta ')}. \end{aligned}$$

As before, \(s=\cos (\theta ),\) and \(s'=\cos (\theta ')=t^{\alpha +1,\alpha +\varepsilon }_{1,d}.\) Note that \(s^{\prime }<s\) and for \(r=\sqrt{\frac{s-s^{\prime }}{1-s^\prime }}\), we have \(s^{\prime }=\frac{s-r^2}{1-r^2}\) and \(0< r<1\). Let \(0<\delta =O(\frac{1}{n})\) that we specify later, and define the function F for the application of Proposition 3.6 to be

$$\begin{aligned} F(y)=\chi (y):={\left\{ \begin{array}{ll} 1 &{}\quad \text {for } r-\delta <y\le R, \\ 0 &{}\quad \text {otherwise}. \end{array}\right. } \end{aligned}$$

Recall from (31) that

$$\begin{aligned} h(t):=\int _{-1}^1g(x)\mu (x,t;\chi )dx. \end{aligned}$$

Applying Proposition 3.6 with the function F as above and the function g, we obtain the inequality in the statement of the theorem with \(c_n\le 1+o(1)\). We now prove the desired bound on \(c_n\) for sufficiently large n.

By Proposition 3.9, for any \(\delta _1>0\), if \(|s'-\cos (\theta ^*)|\ge \delta _1\), then for large n, \(M_{\textrm{Lev}}(n-1,\theta ')/\lambda _n(\theta ,\theta ')\) is exponentially worse than \(M_{\textrm{Lev}}(n-1,\theta ^*)/\lambda _n(\theta ,\theta ^*)\). Therefore, we assume that \(s'=\cos (\theta ')=t_{1,d}^{\alpha +1, \alpha +\varepsilon }\) for some \(\varepsilon \in \{0,1\}\), and that \(s'\) is sufficiently close to \(\cos \theta ^*\). We specify the precision of the difference later. Suppose \(\varepsilon =0\), and so \(s'=t^{\alpha +1,\alpha }_{1,d}\). By Proposition 5.1, we have

$$\begin{aligned} g(x)=(x+1)(x-s^{\prime })\frac{dp_d^{\alpha +1,\alpha }}{dt} (s^{\prime })^2(1+A(x))^2, \end{aligned}$$

where

$$\begin{aligned} |A(x)|\le \frac{e^{\sigma (x)}-1}{\sigma (x)}-1 \end{aligned}$$
(39)

with

$$\begin{aligned} \sigma (x):=\frac{|x-s'|(ns'+s'+1)}{1-s'^2}. \end{aligned}$$

By Proposition 4.2, we have for \(|x-s'|=o\left( \frac{1}{\sqrt{n}}\right) \) the estimate

$$\begin{aligned} \mu (x;s,\chi )= & {} \left( \frac{2(1-r^2)^2}{r(1-s)}+o(1)\right) \left( \delta +\sqrt{\frac{s-x}{1-x}}-r \right) ^+\\{} & {} \times \left( \left( \frac{1-x^2}{x^2}\right) \left( s-r^2\right) ^2 \right) ^{\frac{n-4}{2}}e^{\left( -\frac{2nr \left( \sqrt{\frac{s-x}{1-x}}-r \right) }{s-r^2}\right) }. \end{aligned}$$

We need to find the maximal \(\delta >0\) such that

$$\begin{aligned} h(t)=\int _{-1}^1 g(x)\mu (x;t,\chi ) dx \le 0 \end{aligned}$$

for every \(-1\le t\le s\). We first address the above inequality for \(t=s\). Note that the integrand is negative for \(x<s^{\prime }\) and positive for \(x>s^{\prime }.\) Hence,

$$\begin{aligned} \int _{-1}^1 g(x)\mu (x;s,\chi )dx=\left| \int _{s'}^1 g(x) \mu (x;s,\chi )dx\right| - \left| \int _{-1}^{s'} g(x) \mu (x;s,\chi )dx\right| . \end{aligned}$$

Its non-positivity is equivalent to

$$\begin{aligned} \left| \int _{-1}^{s'} g(x)\mu (x;s,\chi )dx\right| \ge \left| \int _{s'}^1 g(x)\mu (x;s,\chi )dx\right| . \end{aligned}$$

We proceed to give a lower bound on the absolute value of the integral over \(-1\le x\le s^{\prime }.\) Later, we give an upper bound on the right hand side. By (39), we have

$$\begin{aligned} |1+A(x)|\ge \left( 2-\frac{e^{\sigma (x)}-1}{\sigma (x)}\right) ^+. \end{aligned}$$

We note that \(2-\frac{e^{\sigma }-1}{\sigma }\) is a concave function with value 1 as \(\sigma \rightarrow 0\) and a root at \(\sigma =1.256431 \cdots \). Hence, for \(\sigma <1.25643\), we have

$$\begin{aligned} |1+A(x)|\ge \left( 2-\frac{e^{\sigma (x)}-1}{\sigma (x)}\right) . \end{aligned}$$

Note that \(\sigma (x)<1.25643\) implies

$$\begin{aligned} |x-s'| \le \frac{(1.25643)(1-s'^2)}{ns'}. \end{aligned}$$

Let

$$\begin{aligned} \lambda :=\frac{(1.25643)(1-s'^2) }{ns'}. \end{aligned}$$

Therefore, as \(n\rightarrow \infty \)

$$\begin{aligned}&\frac{r(1-s)}{2(1-r^2)^2}\left( s-r^2\right) ^{-(n-4)} \frac{dp_d^{(\alpha +1,\alpha )}}{dt}(s^{\prime })^{-2} \left| \int _{-1}^{s'} g(x)\mu (x;s,\chi )dx\right| \nonumber \\&\quad \gtrsim \int _{s'-\lambda }^{s'}(1+x) (s^{\prime }-x) \left( 2-\frac{e^{\sigma (x)}-1}{\sigma (x)}\right) ^2 \left( \delta +\sqrt{\frac{s-x}{1-x}}-r \right) \nonumber \\&\qquad \times \left( \frac{1-x^2}{x^2}\right) ^{\frac{n-4}{2}} e^{\left( -\frac{2nr\left( \sqrt{\frac{s-x}{1-x}}-r \right) }{s-r^2} \right) }dx. \end{aligned}$$
(40)

We change the variable \(s'-x\) to z and note that

$$\begin{aligned}&\sqrt{\frac{s-x}{1-x}}-r =\frac{z(1-s) }{2(s-s')^{1/2} (1-s')^{3/2}}+O(\lambda ^2) \end{aligned}$$
(41)
$$\begin{aligned}&\frac{1-x^2}{x^2}= \frac{1-s'^2}{s'^2} \left( 1+\frac{2z}{s'(1-s'^2)}+ O(\lambda ^2)\right) \end{aligned}$$
(42)

for \(|x-s'|<\lambda .\) Hence, we obtain that as \(n\rightarrow \infty \) and \(|x-s'|<\lambda \),

$$\begin{aligned} e^{\left( -\frac{2nr\left( \sqrt{\frac{s-x}{1-x}} -r \right) }{ s-r^2}\right) }= & {} e^{\left( -\frac{2nr \left( \frac{z(1-s) }{2(s-s')^{1/2}(1-s')^{3/2}} \right) }{ s-r^2} \right) +O(\lambda )} =e^{\left( \frac{-nz}{s'(1-s')}\right) +O(\lambda )} \\ \left( \frac{1-x^2}{x^2}\right) ^{\frac{n-4}{2}}= & {} \left( \frac{1-s'^2}{s'^2}\right) ^{\frac{n-4}{2}} e^{\left( \frac{nz}{s'(1-s'^2)} \right) +O(\lambda )} \\ 2-\frac{e^{\sigma (x)}-1}{\sigma (x)}= & {} \left( 2-\frac{e^{\frac{nzs'}{(1-s'^2)}}-1}{\frac{nzs'}{(1-s'^2)}}\right) (1+O(\lambda )). \end{aligned}$$

for \(|x-s'|<\lambda .\) We replace the above asymptotic formulas and obtain that as \(n\rightarrow \infty \), the right hand side of (40) is at least

$$\begin{aligned}{} & {} (1+s')\left( \frac{1-s'^2}{s'^2}\right) ^{\frac{n-4}{2}} \int _{0}^{\lambda }z \left( 2-\frac{e^{\frac{nzs'}{(1-s'^2)}}-1}{\frac{nzs'}{(1-s'^2)}} \right) ^2\\{} & {} \quad \times \left( \delta +\frac{z(1-s)}{2(s-s')^{1/2}(1-s')^{3/2}} \right) e^{\left( -\frac{nz}{1-s'^2}\right) } dz. \end{aligned}$$

We now give an upper bound on the absolute value of the integral over \(s'\le x\le 1.\) We note that

$$\begin{aligned} \sqrt{\frac{s-x}{1-x}}-r =\frac{z(1-s) }{2(s-s')^{1/2}(1-s')^{3/2}} +O(\lambda ^2). \end{aligned}$$

Let \(\Lambda := \frac{2(s-s')^{1/2}(1-s')^{3/2}\delta }{(1-s)}\). We have

$$\begin{aligned} \left( \delta +\sqrt{\frac{s-x}{1-x}}-r \right) ^+=0 \end{aligned}$$

for \(x-s'>\Lambda .\) We have

$$\begin{aligned} |1+A(x)|\le \frac{e^{\sigma (x)}-1}{\sigma (x)}, \end{aligned}$$

where

$$\begin{aligned} \sigma (x)=\frac{n|x-s'|s'}{1-s^{'2}}+o(1). \end{aligned}$$

Therefore,

$$\begin{aligned}{} & {} \frac{r(1-s)}{2(1-r^2)^2}\left( s-r^2\right) ^{-(n-4)} \frac{dp_d^{(\alpha +1,\alpha )}}{dt}(s^{\prime })^{-2} \left| \int _{s'}^{1} g(x)\mu (x;s,\chi )dx\right| \\{} & {} \quad \lesssim (1+s') \left( \frac{1-s'^2}{s'^2}\right) ^{\frac{n-4}{2}} \int _{0}^{\Lambda }z\left( \frac{e^{\frac{nzs'}{(1-s'^2)}}-1}{\frac{nzs'}{(1-s'^2)}} \right) ^2\\{} & {} \qquad \times \left( \delta -\frac{z(1-s)}{2(s-s')^{1/2}(1-s')^{3/2}} \right) e^{\left( \frac{nz}{1-s'^2} \right) } dz. \end{aligned}$$

We choose \(\delta \) such that

$$\begin{aligned}&\int _{0}^{\lambda }z \left( 2-\frac{e^{\frac{nzs'}{(1-s'^2)}}-1}{\frac{nzs'}{(1-s'^2)}} \right) ^2\left( \delta +\frac{z(1-s)}{2(s-s')^{1/2}(1-s')^{3/2}} \right) e^{\left( -\frac{nz}{1-s'^2} \right) } dz\\&\quad \ge \int _{0}^{\Lambda }z\left( \frac{e^{\frac{nzs'}{(1-s'^2)}}-1}{\frac{nzs'}{(1-s'^2)}} \right) ^2 \left( \delta -\frac{z(1-s) }{2(s-s')^{1/2}(1-s')^{3/2}} \right) e^{\left( \frac{nz}{1-s'^2} \right) } dz. \end{aligned}$$

For large enough n we may replace the numerical value \(\cos (1.0995124)\) for \(s'\) as we may assume that \(s'\) is close to \(\cos (\theta ^*)\). Furthermore, write \(v:=nz\), and divide by \(\delta \) to obtain

$$\begin{aligned}&\int _{0}^{2.196823}v \left( 2-\frac{e^{0.571931v}-1}{0.571931v}\right) ^2 \left( 1+\frac{v}{n\Lambda } \right) e^{\left( -1.259674v \right) } dv \\&\quad \ge \int _{0}^{n\Lambda }v \left( \frac{e^{0.571931v}-1}{0.571931v}\right) ^2 \left( 1-\frac{v}{n\Lambda } \right) e^{\left( 1.259674v\right) } dv. \end{aligned}$$

Here, we have also used that \(\Lambda =\frac{2\delta (s-s')^{1/2}(1-s')^{3/2}}{(1-s) }\). Also, note that \(n\lambda =2.196823 \cdots \) when \(s'\) is near \(\cos (1.0995124)\). We have the Taylor expansion around \(v=0\)

$$\begin{aligned}{} & {} v \left( \frac{e^{0.571931v}-1}{0.571931v} \right) ^2 e^{\left( 1.259674v \right) }\\{} & {} \quad =v + 1.83161 v^2 + 1.70465 v^3 + 1.07403 v^4 + 0.514959 v^5 + 0.200242 v^6 \\{} & {} \qquad + 0.0657225 v^7 + 0.0187113 v^8 + 0.00471321 v^9 + 0.0010662 v^{10} + 0.000219143 v^{11} \\{} & {} \qquad + 0.0000413083 v^{12} + Er \end{aligned}$$

with error \(|Er|<2\times 10^{-5}\) if \(n\Lambda <0.92\), which we assume to be the case. Simplifying, we want to find the maximal \(n\Lambda \) such that

$$\begin{aligned}{} & {} 0.195783+\frac{0.140655}{n\Lambda }\ge \int _{0}^{n\Lambda }v \left( \frac{e^{0.571556v}-1}{0.571556v}\right) ^2 \left( 1-\frac{v}{n\Lambda } \right) e^{\left( 1.259392v\right) } dv \\{} & {} \quad =3.17756\times 10^{-6} (n\Lambda )^2 \\{} & {} \qquad \times \Bigg ((n\Lambda )^{11} + 5.74715 (n\Lambda )^{10} + 30.5037 (n\Lambda )^9 + 148.328 (n\Lambda )^8 + 654.286 (n\Lambda )^7 \\{} & {} \qquad + 2585.41 (n\Lambda )^6 + 9002.5 (n\Lambda )^5 + 27010.2 (n\Lambda )^4 + 67600.9 (n\Lambda )^3 \\{} & {} \qquad + 134116 (n\Lambda )^2 + 192140(n\Lambda ) + 157353\Bigg )\\{} & {} \qquad -\frac{1}{n\Lambda }\left( -0.360653 + 2.42691 e^{1.25967(n\Lambda )}\right. \\{} & {} \qquad \left. - 3.33819 e^{1.83161(n\Lambda )} + 1.27193 e^{2.40354(n\Lambda )}\right) +Er, \end{aligned}$$

where the error Er again satisfies \(|Er|\le 2\times 10^{-5}\). A numerical computation gives us that the inequality is satisfied when \(n\Lambda \le 0.915451 \cdots \). Consequently, if we choose \(\delta =\ell /n\), then we must have

$$\begin{aligned} \ell \le 0.915451 \cdots \frac{(1-s)}{2(s-s')^{1/2}(1-s')^{3/2}}. \end{aligned}$$

In this case, the cap of radius \(\sqrt{1-r^2}\) becomes \(\sqrt{1-(r-\delta )^2}=\sqrt{1-r^2}\)\(\left( 1+\frac{\ell r}{n(1-r^2)}\right) +O(1/n^2)\). Note that \(r=\sqrt{\frac{s-s'}{1-s'}}\), and so

$$\begin{aligned} \frac{r}{1-r^2}=\frac{(s-s')^{1/2}(1-s')^{1/2}}{1-s}. \end{aligned}$$

We deduce that,

$$\begin{aligned} \frac{\ell r}{(1-r^2)}\le & {} 0.915451 \cdots \frac{(1-s)}{2(s-s')^{1/2} (1-s')^{3/2}}\\{} & {} \cdot \frac{(s-s')^{1/2}(1-s')^{1/2}}{1-s} =\frac{0.457896862 \cdots }{1-s'}=0.83837237 \cdots \end{aligned}$$

This computation shows that for sufficiently large n, for any \(0\le \delta \le \frac{0.83837237(1-r^2)}{nr}\), \(h(s)\le 0\). We now show that \(h(t)\le 0\) for \(-1\le t<s\). Note that

$$\begin{aligned} r(t):=\sqrt{\frac{(t-s^{\prime })^+}{1-s^\prime }} <\sqrt{\frac{s-s^{\prime }}{1-s^\prime }}=r. \end{aligned}$$

If \(s-t\) is of order greater than O(1/n), then \(r(t)<r-\delta \) for large n, and so \(h(t)\le 0\) as the integrand is negative in this case. Therefore, we may assume that \(-1\le t<s\) and \(s-t=O(1/n)\). For such t, replacing s with t in the above calculations shows that the negativity \(h(t)\le 0\) is true for all \(0\le \delta \le \frac{0.83837237(1-r(t)^2)}{nr(t)}.\) Since \(r(t)<r\), \(\frac{0.83837237(1-r(t)^2)}{nr(t)}>\frac{0.83837237(1-r^2)}{nr}\). Consequently, \(h(t)\le 0\) for every \(-1\le t\le s\) whenever \(0\le \delta \le \frac{0.83837237(1-r^2)}{nr}\).

Similarly, one obtains the same conclusion when \(\varepsilon =1\), that is \(s^{\prime }=t^{\alpha +1,\alpha +1}_{1,d}\). Therefore, our improvement to Levenshtein’s bound on \(M(n,\theta )\) for large n is by a factor of \(1/e^{0.83837237 \cdots }=0.432413 \cdots \) for any choice of angle \(0<\theta <\theta ^*\). As the error in our computations is less than \(2\times 10^{-5}\), we deduce that we have an improvement by a factor of 0.4325 for sufficiently large n. \(\square \)

5.3 Improving bound on sphere packing densities

In this subsection, we give our improvement to Cohn and Zhao’s [9] bound on sphere packings. Recall that in the case of sphere packings, we let \(s=\cos (\theta )\), \(r=\frac{1}{\sqrt{2(1-s)}}\), and \(\alpha =\frac{n-3}{2}\). By assumption, \(\frac{1}{3}\le s\le \frac{1}{2}\). In this case, we define for each \(0<\delta =\frac{c_1}{n}\) the function F to be used in Proposition 3.8 to be

$$\begin{aligned} F(y):=\chi (y):={\left\{ \begin{array}{ll} 1 &{}\quad \text {for } 0 \le y\le r+\delta , \\ 0 &{}\quad \text {otherwise}. \end{array}\right. } \end{aligned}$$

Proof of Theorem  1.2

As in the proof of Theorem 5.2, we consider \(g=g_{n,\theta }\in D(d\mu _{\frac{n-3}{2}},\theta )\). Note that by Proposition 3.8 applied to the function F above and g, we have for the function

$$\begin{aligned} H(T)=\int _{-1}^1g(x)\mu (x;T,\chi )dx \end{aligned}$$

of Eq. (33), the inequality

$$\begin{aligned} \delta _{n}\le \frac{\mathcal {L}(g)}{(2(r+\delta ))^{n}} =\frac{M_{\textrm{Lev}}(n,\theta )}{(2(r+\delta ))^{n}} \end{aligned}$$

if \(\delta >0\) is chosen such that \(H(T)\le 0\) for \(T\ge 1\). We wish to maximize \(\delta \) under this negativity condition. Let \(n\ge 2000\) and s be a root of the Jacobi polynomial as before. As in the proof of Theorem 1.1, we begin by considering that case where \(\varepsilon =0\), that is, \(s=t^{\alpha +1,\alpha }_{1,d}\), and take g for this s. We show that \(H(1)\le 0\). For the other T, showing \(H(T)\le 0\) follows similarly by using Lemma 4.3. Note that

$$\begin{aligned} \int _{-1}^1 g(x)\mu (x;\chi )dx=\left| \int _{s}^1 g(x)\mu (x;\chi ) dx\right| - \left| \int _{-1}^{s} g(x)\mu (x;\chi )dx\right| . \end{aligned}$$

To show \(H(1)\le 0\), it suffices to show that

$$\begin{aligned} \left| \int _{-1}^{s} g(x)\mu (x;\chi )dx\right| \ge \left| \int _{s}^1 g(x)\mu (x;\chi )dx\right| . \end{aligned}$$
(43)

First, we give a lower bound for the left hand side of Eq. (43). As before, Proposition 5.1 allows us to write

$$\begin{aligned} g(x)=(x+1)(x-s^{\prime })\frac{dp_d^{\alpha +1,\alpha }}{dt} (s^{\prime })^2(1+A(x))^2, \end{aligned}$$

where

$$\begin{aligned} |A(x)|\le \frac{e^{\sigma (x)}-1}{\sigma (x)}-1 \end{aligned}$$

with

$$\begin{aligned} \sigma (x):=\frac{|x-s|(ns-s+1)}{1-s^2}. \end{aligned}$$

As before,

$$\begin{aligned} |1+A(x)|\ge \left( 2-\frac{e^{\sigma (x)}-1}{\sigma (x)}\right) ^+. \end{aligned}$$

Note that if \(\sigma (x)<1.25643\), ensuring that the right hand side of the bound on \(1+A(x)\) is non-negative, then

$$\begin{aligned} |x-s| \le \frac{1.25643(1-s^{2}) }{ns+1}. \end{aligned}$$

Let

$$\begin{aligned} \lambda :=\frac{1.25643(1-s^{2}) }{ns+1}. \end{aligned}$$

Let

$$\begin{aligned} r_1:=\sqrt{1-(1-x^2)(r+\delta )^2}+x(r+\delta ). \end{aligned}$$

Suppose that \(|x-s|\le \frac{c_2}{n}\) and \(\delta =\frac{c_1}{n}\) for some \(0<c_1<0.81\), \(0<c_2<3.36\). Note that for such a \(c_1\) and \(n\ge 2000\), the assumption \(s\le 1/2\) implies that \(r+\delta \le 1\). By Proposition 4.4, we have \(\mu (x;\chi )=0\) for \(r_1\ge r+\delta .\) Otherwise,

$$\begin{aligned} \mu (x;\chi )= & {} C_n(1+E)(1-x^2)^{\frac{n-4}{2}} \left( \frac{1}{2(1-x)}\right) ^{{n-1}} \\{} & {} \times \frac{1}{\sqrt{1-x}} \sqrt{1+\left( x-\frac{(1-x^2)r}{\sqrt{1-(1-x^2)r^2}}\right) ^2}\left( r+\delta - r_1 \right) \end{aligned}$$

for some constant \(C_n>0\) making \(\mu (x;\chi )\) a probability measure on \([-1,1]\), and where \(|E|<\frac{(4c_2+2c_1+2)^2}{n}\) for \(n\ge 2000\). In particular, for such \(c_1,c_2\), we have \(|E|<\frac{292}{n}\). By letting \(z:=s-x\) and \(v:=\frac{(ns+1)z}{(1-s^{2})}\), Taylor expansion approximations imply that inequality (43) is satisfied for \(\frac{1}{3}\le s\le \frac{1}{2}\) and large n if

$$\begin{aligned} \int _0^{1.25643}v\left( 2-\frac{e^v-1}{v}\right) ^2e^{-3v} \left( 1+\frac{3v}{2c_1}\right) dv\ge \int _0^{\frac{2c_1}{3}}v \left( \frac{e^v-1}{v}\right) ^2e^{3v}\left( 1-\frac{3v}{2c_1}\right) dv.\nonumber \\ \end{aligned}$$
(44)

By a numerics similar to that done for spherical codes, one finds that the maximal such \(c_1<1\) is \(0.66413470 \cdots \). Therefore, for every \(\frac{1}{3}\le s\le \frac{1}{2}\) and \(n\rightarrow \infty \), we have an improvement at least as good as

$$\begin{aligned} e^{-0.6641347/r}= \exp (-0.6641347\sqrt{2(1-s)}). \end{aligned}$$

Note that for such s, as \(n\rightarrow \infty \), this gives us an improvement of at most 0.5148, a universal such improvement factor.

Table 2 Table of improvement factors \(\alpha _n(\theta )\)

Returning to the case of general \(n\ge 2000\) and \(\frac{1}{3}\le s\le \frac{1}{2}\), given such an n we need to maximize \(c_1<0.81\) such that

$$\begin{aligned}{} & {} \left( 1-\frac{312}{n}\right) \int _0^{1.25643}v \left( 2-\frac{e^v-1}{v}\right) ^2e^{-3v} \left( 1+\frac{1.499v}{c_1}-\frac{17.31}{c_1n}\right) dv\\{} & {} \quad \ge \left( 1+\frac{312}{n}\right) \int _0^{0.667c_1}v \left( \frac{e^v-1}{v}\right) ^2e^{3v}\left( 1-\frac{1.499v}{c_1} +\frac{17.31}{c_1n}\right) dv. \end{aligned}$$

By a numerical calculation with Sage, we obtain that the improvement factor for any \(\frac{1}{3}\le s\le \frac{1}{2}\) and any \(n\ge 2000\) is at least as good as

$$\begin{aligned} 0.515+74/n. \end{aligned}$$

On the other hand, if we fix s such that s is sufficiently close to \(s^*=\cos (\theta ^*)\), then the same kind of calculations as above give us an asymptotic improvement constant of 0.4325, the same as in the case of spherical codes. In fact, for \(n\ge 2000\), we have an improvement factor at least as good as

$$\begin{aligned} 0.4325+51/n \end{aligned}$$

over the combination of Cohn–Zhao [9] and Levenshtein’s optimal polynomials [20].

The case \(s=t^{\alpha +1,\alpha +1}_{1,d}\) follows in exactly the same way. This completes the proof of our theorem. \(\square \)

Remark 45

We end this section by saying that our improvements above are based on a local understanding of Levenshtein’s optimal polynomials, and that there is a loss in our computations. By doing numerics, we may do computations without having to rely on such local approximations.

6 Numerics

In Theorem 1.2, we improved the sphere packing densities by a factor of 0.4325 for sufficiently high dimensions. There is a loss in our estimates due to neglecting the contribution of Levenshtein’s polynomials away from their largest roots, as giving rigorous estimates is difficult. In this section, we numerically investigate the behavior of our constant improvement factors for sphere packing densities by considering those neglected terms in dimensions up to 130. As we noted before in the introduction, in low dimensions, there are better bounds on sphere packing densities using semi-definite programming, and so the objective of this section is guessing the improvement over 0.4325 in high dimensions.

Before our work, the best known upper bound on sphere packing densities in high dimensions was obtained using inequalities

$$\begin{aligned} \delta _n\le \sin ^n(\theta /2)Lev (n,\theta ), \end{aligned}$$

where \(\text {Lev}(n,\theta )\) is the linear programming bound using Levenshtein’s optimal polynomials [20, eq.(3),(4)]. Note that \(\text {Lev}(n,\theta )\le M_{\textrm{Lev}}(n,\theta )\) and equality occurs when \(\cos (\theta )=t^{\alpha +1,\alpha +\varepsilon }_{1,d}.\) In this section, we apply Proposition 3.8 to Levenshtein’s optimal polynomials for various angles \(\theta \) (columns of Table 2) and obtain

$$\begin{aligned} \delta _n\le \alpha _n(\theta ) \sin ^n(\theta /2)\text {Lev}(n,\theta ) \end{aligned}$$

with maximal r (in Proposition 3.8), where \(\alpha _n(\theta )\) are the entries of the table. Note that in Table 2, the improvement factors appear to gradually become independent of \(\theta \) as n enlarges. We conjecture that they tend to \(\frac{1}{e}\) as \(n\rightarrow \infty \).