1 Introduction

We study a family of quadratic optimization problems with varying cost function:

$$\begin{aligned} \min _{x \in {\mathbb {R}}^n} \,\, g(x) \quad \hbox {subject to} \quad f_1(x) = f_2(x) = \cdots = f_m(x) = 0, \end{aligned}$$
(1)

where \(\mathbf{f} = (f_1,\ldots ,f_m)\) is a fixed tuple of elements in the space \({\mathbb {R}}[x]_{\le 2} \simeq {\mathbb {R}}^{\left( {\begin{array}{c}n+2\\ 2\end{array}}\right) }\) of polynomials of degree two in \(x = (x_1,\ldots ,x_n)\). Even though problem (1) is hard, there is a hierarchy of tractable semidefinite programming (SDP) relaxations, known as the Lasserre hierarchy [1, 13, 14]. In this paper we focus on the Shor relaxation [19], which is the first level of the hierarchy. We are interested in the set defined by the Shor relaxation:

$$\begin{aligned} {\mathcal {R}}_\mathbf{f} \,\, = \,\, \bigl \{\, \,g \in {\mathbb {R}}[x]_{\le 2} \,: \, \text {problem (1) is solved exactly by its (Shor) SDP relaxation} \,\bigr \}. \end{aligned}$$

We call \({\mathcal {R}}_\mathbf{f}\) the SDP-exact region of the tuple \(\,\mathbf{f} = (f_1,\ldots ,f_m)\). We will slightly change this definition in Sect. 3 by further imposing strict complementarity. This will lead to an explicit description of \({\mathcal {R}}_\mathbf{f}\) as a semialgebraic set in \({\mathbb {R}}[x]_{\le 2}\simeq {\mathbb {R}}^{\left( {\begin{array}{c}n+2\\ 2\end{array}}\right) }\). We refer to Definition 3.2.

The quadratic cost function that motivated this article is the squared distance to a given point \(u \in {\mathbb {R}}^n\). In symbols, \(\,g_u(x) = || x - u ||^2\). Here (1) is the Euclidean Distance (ED) problem (cf. [6]) for the variety \(\,V_\mathbf{f} = \{ x \in {\mathbb {R}}^n \,: \,f_1(x) = \cdots = f_m(x) = 0 \}\). By restricting \({\mathcal {R}}_\mathbf{f}\) to the space of cost functions \(g_u\), we obtain a semialgebraic set in \({\mathbb {R}}^n\). This is the SDP-exact region for the ED problem, denoted \({\mathcal {R}}_\mathbf{f}^{ ed}\), which was investigated in [3].

Fig. 1
figure 1

The variety of two quadratic equations in \({\mathbb {R}}^2\) consists of four points. The SDP-exact region for the ED problem consists of conics that are inscribed in the Voronoi cells. The conics can be ellipses (left) or hyperbolas (right) depending on the point configuration

Example 1.1

(ED problem for \(m=n=2\)) The variety \(V_\mathbf{f}\) consists of four points in \({\mathbb {R}}^2\). We seek the point in \(V_\mathbf{f}\) that is closest to a given point \(u = (u_1,u_2)\). The Voronoi decomposition of \({\mathbb {R}}^2\) characterizes the solution. The SDP-exact region \({\mathcal {R}}^{ed}_\mathbf{f}\) consists of four disjoint convex sets, one for each point in \(V_\mathbf{f}\). The convex sets are bounded by conics, and are contained in the Voronoi cells of the points. Figure 1 illustrates \({\mathcal {R}}^{ed}_\mathbf{f}\) for two configuration of points in \({\mathbb {R}}^2\): the cells on the left are bounded by ellipses, and on the right by hyperbolas. Note that in both cases the conics touch pairwise at the bisector lines (cf. Theorem 4.5).

Our second example is the Max-Cut Problem from discrete optimization. The SDP relaxation of this problem has been the subject of several papers; see, e.g., [8, 11, 12].

Fig. 2
figure 2

The elliptope (left) has four vertices, corresponding to the rank-one matrices. The rank-one region consists of the linear forms for which the minimum is attained at a vertex. It is given by the cones over the four circular facets of the dual convex body (right)

Example 1.2

(Max-Cut Problem) Let \(m=n\) and \(f_i(x) = x_i^2-1\), so \(V_\mathbf{f} = \{-1,+1\}^n\) is the vertex set of the n-cube. We seek a maximal cut in the complete graph \(K_n\) where the edge \(\{i,j\}\) has weight \(c_{ij}\). In (1) we take \(g(x) = \sum _{i,j} c_{ij} x_i x_j\) where \(C= (c_{ij})\) is a symmetric \(n \times n\) matrix with \(c_{11} = \cdots = c_{nn} = 0\). Note that these objective functions live in a subspace of dimension \({\left( {\begin{array}{c}n\\ 2\end{array}}\right) }\) in \({\mathbb {R}}[x]_{\le 2}\). The dual solution in the SDP relaxation is the Laplacian

$$\begin{aligned} \mathcal {L}(C) \,\,= \,\, \left( \begin{matrix} \, -\textstyle \sum _{j\ne 1} c_{1j} \! &{}\quad c_{12} &{}\quad c_{13} &{}\quad \cdots &{}\quad c_{1n}\\ c_{12} &{}\quad \! -\textstyle \sum _{j\ne 2} c_{2j} &{} \quad c_{23} &{}\quad \cdots &{}\quad c_{2n}\\ c_{13} &{}\quad c_{23} &{}\quad \! -\textstyle \sum _{j\ne 3} c_{2j} &{} \quad \cdots &{} \quad c_{3n}\\ \vdots &{}\quad \vdots &{}\quad \vdots &{}\quad \ddots &{}\quad \vdots \\ c_{1n} &{} \quad c_{2n} &{}\quad c_{3n} &{}\quad \ldots &{}\quad \! -\textstyle \sum _{j\ne n} c_{jn} \,\, \end{matrix} \right) . \end{aligned}$$

The SDP-exact region \({\mathcal {R}}_\mathbf{f}\) consists of \(2^{n-1}\) spectrahedral cones in \({\mathbb {R}}^{\left( {\begin{array}{c}n\\ 2\end{array}}\right) }\), each isomorphic to the set of matrices \(C = (c_{ij})\) such that \({\mathcal {L}}(C)\) is positive semidefinite. The boundary of this spectrahedron is given by a polynomial of degree \(n-1\), namely the determinant of any \((n-1) \times (n-1)\) principal minor of \({\mathcal {L}}(C)\). By the Matrix Tree Theorem, the expansion of this determinant is the sum of \(n^{n-2}\) monomials in the \(c_{ij}\), one for each spanning tree of \(K_n\). Hence the algebraic boundary of \({\mathcal {R}}_\mathbf{f}\) is a (reducible) hypersurface of degree \((n-1)2^{n-1}\).

The Max-Cut Problem for \(n=3\) asks to minimize the inner product with \(C = (c_{12},c_{13},c_{23})\) over \({\mathcal {T}} = \bigl \{(1,1,1), \,(1,-1,-1), \,(-1,1,-1), \,(-1,-1,1) \bigr \}\). The feasible region of the SDP relaxation is the elliptope on the left in Fig. 2. It strictly contains the tetrahedron \(\mathrm{conv}({\mathcal {T}})\). The region \({\mathcal {R}}_\mathbf{f}\) is the set of directions C whose minimum over the elliptope is attained in \({\mathcal {T}}\). It consists of the four circular cones over the facets of the dual of the elliptope. That dual body is shown in green in Fig. 2, next to the yellow elliptope. Thus \({\mathcal {R}}_\mathbf{f}\) corresponds to the union of the four circular facets of the dual elliptope. These four circles touch pairwise, just like the four ellipses in Fig. 1. The algebraic boundary of \({\mathcal {R}}_\mathbf{f}\) has degree \(8 = (3-1) 2^{3-1}\).

The present paper is a sequel to [3], where the SDP-exact region for the ED problem was shown to be full-dimensional in \({\mathbb {R}}^n\). We undertake a detailed study of \({\mathcal {R}}_\mathbf{f}\) and its topological boundary \(\partial {\mathcal {R}}_\mathbf{f}\). We define the algebraic boundary\(\partial _{\mathrm{alg}} {\mathcal {R}}_\mathbf{f}\) to be the Zariski closure of \(\partial {\mathcal {R}}_\mathbf{f}\). Our aim is to find the polynomial defining this hypersurface, or at least to find its degree. This degree is an intrinsic measure for the geometric complexity of the SDP-exact region.

The material that follows is organized into five sections. In Sect. 2 we introduce the rank-one region of a general semidefinite programming problem. Building on the theory developed in [17], we compute the degree of the algebraic boundary of this semialgebraic set.

In Sect. 3 we turn to the quadratic program (1). We introduce its SDP relaxation, and show that \({\mathcal {R}}_\mathbf{f}\) coincides with the rank-one region of that relaxation. In Theorem 3.5 we determine the degree of \(\partial _{\mathrm{alg}} {\mathcal {R}}_\mathbf{f}\) under the assumption that \(f_1,\ldots ,f_m\) are generic. That degree is strictly smaller than the corresponding degree for SDP, which appears in Theorem 2.6.

Section 4 concerns the Euclidean distance problem and the case when the cost function g is linear. Theorem 4.1 represents their SDP-exact regions in \({\mathbb {R}}^n\) as bundles of spectrahedral shadows. Each shadow lies in the normal space at a point on \(V_\mathbf{f}\), and is the linear image of a master spectrahedron that depends only on \(\mathbf{f}\). For linear g, the region \({\mathcal {R}}^{ lin}_\mathbf{f}\) is determined by the theta body of Gouveia et al. [9]; see Proposition 4.7. For the ED problem, \({\mathcal {R}}^{ ed}_\mathbf{f}\) is a tubular neighborhood of the variety \(V_\mathbf{f}\). Figure 1 showed this when \(V_\mathbf{f}\) consists of four points in \({\mathbb {R}}^2\). Analogs in \({\mathbb {R}}^3\) are depicted in Figs. 4, 89 (for points) and Figs. 56 (for curves).

In Sect. 5 we study the algebraic geometry of the SPD-exact region of the ED problem. Theorem 5.6 gives the degree of the algebraic boundary \(\,\partial _{\mathrm{alg}} {\mathcal {R}}^{ ed}_\mathbf{f}\) when \(V_\mathbf{f}\) is a generic complete intersection. It rests on representing our bundle as a Segre product and projecting it into the ambient space of \(V_\mathbf{f}\). The abelian surface in Example 5.2 serves as a nice illustration.

Section 6 addresses the ED problem when \(\mathbf{f}\) is not a complete intersection. Algorithm 1 shows how to compute the SDP-exact region. Several examples demonstrate what can happen. The dual elliptope on the right of Fig. 2 reappears in five copies in Fig. 9.

2 The rank-one region in semidefinite programming

Consider a family of semidefinite programming problems with varying cost function:

$$\begin{aligned} \min _{X\in {\mathcal {S}}^{d}} {\mathcal {C}}\bullet X \quad \,\hbox {subject to} \,\,{\mathcal {A}}_i \bullet X = b_i \,\,\,\hbox {for} \,\, i =1,2,\ldots ,l, \,\,\hbox {and} \,\, X\succeq 0. \end{aligned}$$
(2)

Here \(\,{\mathcal {C}}\bullet X = {{\,\mathrm{trace}\,}}({\mathcal {C}}X )\,\) is the usual inner product on the space \({\mathcal {S}}^{d} \simeq {\mathbb {R}}^{\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) }\) of symmetric \(d \times d\) matrices. The numbers \(b_1,\ldots ,b_l \in {\mathbb {R}}\) and the matrices \({\mathcal {A}}_1,\ldots ,{\mathcal {A}}_l \in {\mathcal {S}}^{d}\) are fixed in (2), whereas the cost matrix \({\mathcal {C}}\) varies freely over \({\mathcal {S}}^d\). The rank-one region \({\mathcal {R}}_{{\mathcal {A}},b}\) is a semialgebraic subset of \({\mathcal {S}}^d\) that depends on \({\mathcal {A}}= ({\mathcal {A}}_1,\ldots ,{\mathcal {A}}_l)\) and \(b= (b_1,\ldots ,b_l)\). It consists of all matrices \({\mathcal {C}}\) such that (2) has a rank-one solution and strict complementarity holds. See Definition 2.2 below. In this section we study the rank-one region \({\mathcal {R}}_{{\mathcal {A}},b}\) and its boundary. The methods introduced here will be later used in Sect. 3 to study the SDP-exact region \({\mathcal {R}}_\mathbf{f}\).

The feasible set of (2) is the spectrahedron \( \Sigma _{{\mathcal {A}},b} = \bigl \{X {\in } {\mathcal {S}}^{d} : X{\succeq } 0,\, {\mathcal {A}}_i {\bullet } X = b_i \text { for }1\le i\le l \bigr \} \). We assume that \(\Sigma _{{\mathcal {A}},b}\) is non-empty and does not contain the zero matrix. Then the region \({\mathcal {R}}_{{\mathcal {A}}, b}\) is the union of all normal cones at extreme points of rank one in the boundary of \(\Sigma _{{\mathcal {A}},b}\).

Example 2.1

(\(d=l=3\)) The convex bodies in Fig. 2 arise for Max-Cut with \(n=3\) in Example 1.2. The spectrahedron \(\Sigma _{{\mathcal {A}},b}\) on the left is the elliptope. It is bounded by Cayley’s cubic surface. The four nodes are the rank-one points in \(\partial \Sigma _{{\mathcal {A}},b}\). The dual convex body, shown on the right, is bounded by the quartic Steiner surface and it has four circular facets. The rank-one region \({\mathcal {R}}_{{\mathcal {A}},b}\) is given by the interiors of these four circles, viewed as cones in \({\mathcal {S}}^3\).

The semidefinite program that is dual to (2) has the form:

$$\begin{aligned} \max _{Y\in {\mathcal {S}}^{d},\,\lambda \in {\mathbb {R}}^{l}} \quad b^T \lambda \qquad \text {subject to}\qquad Y \,=\, {\mathcal {C}}- \sum _{i=1}^l \lambda _i {\mathcal {A}}_i \quad \mathrm{and} \quad Y \succeq 0. \end{aligned}$$
(3)

The following critical equations express the complementary slackness condition that links the optimal solution \(X \succeq 0\) of the primal (2) and the optimal solution \(Y \succeq 0\) of the dual (3):

$$\begin{aligned} {\mathcal {A}}_i \bullet X = b_i \;\text { for } 1 \le i\le l \quad \mathrm{and} \quad Y = {\mathcal {C}}- \sum _{i=1}^l \lambda _i {\mathcal {A}}_i \quad \mathrm{and} \quad X \cdot Y = 0. \end{aligned}$$
(4)

Recall that strict complementarity holds if \({{\,\mathrm{rank}\,}}(X) \!+\! {{\,\mathrm{rank}\,}}(Y) \!=\! d\). The rank-one region is the semialgebraic set given by the critical equations and strict complementarity, as follows:

Definition 2.2

The rank-one region\({\mathcal {R}}_{{\mathcal {A}},b}\) is the set of all \(\,{\mathcal {C}}\in {\mathcal {S}}^{d}\) for which there exist \(\lambda \in {\mathbb {R}}^l\) and \(X,Y\in {\mathcal {S}}^{d}\) such that \(\,X , Y\succeq 0\), \(\, {{\,\mathrm{rank}\,}}(X)= 1 \), \(\, {{\,\mathrm{rank}\,}}(Y)= d-1\,\) and (4) holds.

Remark 2.3

The above construction can be extended to define the rank-r region for other values of r. It is an interesting open problem to investigate the geometry of these regions.

The results that follow hold for generic instances of the matrices \({\mathcal {A}}_i\) and the vector b. This implies that the results hold for “almost all” instances of \(({\mathcal {A}}, b)\), i.e., outside a set of Lebesgue measure zero. More precisely, a property holds generically if there is a polynomial f in the entries of \({\mathcal {A}}\) and b such that it holds whenever this polynomial does not vanish.

Genericity was also a standing assumption in the derivation of the algebraic degree of semidefinite programming by Nie et al. [17, §2]. That degree, denoted \(\delta (l,d,r)\), is the number of complex solutions (XY) of the critical equations (4) for the SDP (2), with l constraints for \(d \times d\) matrices, assuming that \(\mathrm{rank}(X) = d-r\) and \(\mathrm{rank}(Y) = r\). A formula for general r was given in [7]. The easier case \(r=d-1\) appeared in [17, Theorem 11]:

Proposition 2.4

The algebraic degree of rank-one solutions X to the SDP in (2) equals

$$\begin{aligned} \delta (l,d,d-1)\,\, = \,\,2^{l-1} \left( {\begin{array}{c}d\\ l\end{array}}\right) . \end{aligned}$$

The following geometric formulation of SDP was proposed in [17, Eqn. (4.1)]. Let \({\mathcal {V}}\) be the \((l-1)\)-dimensional subspace of \({\mathcal {S}}^d\) spanned by \(\{{\mathcal {A}}_2,\ldots ,{\mathcal {A}}_l\}\), and let \({\mathcal {U}}\) be the \((l+1)\)-dimensional subspace of \({\mathcal {S}}^d\) spanned by \(\{{\mathcal {C}},{\mathcal {A}}_1\}\) and \({\mathcal {V}}\). This specifies a dual pair of flags

$$\begin{aligned} {\mathcal {V}} \, \subset \,{\mathcal {U}} \, \subset \, {\mathcal {S}}^d \qquad \mathrm{and} \qquad {\mathcal {U}}^\perp \, \subset \,{\mathcal {V}}^\perp \, \subset \, {\mathcal {S}}^d . \end{aligned}$$
(5)

See [17, Eqn. (3.3)]. The critical equations (4) can now be written as

$$\begin{aligned} X \,\in \,{\mathcal {V}}^\perp \quad \mathrm{and} \quad Y \, \in \,{\mathcal {U}} \quad \mathrm{and} \quad X \cdot Y = 0 . \end{aligned}$$
(6)

The SDP problem (2) is equivalent to solving (6) subject to \(X , Y \succeq 0\). The algebraic degree \(\delta (l,d,r)\) is the number of complex solutions to (6) with \(\mathrm{rank}(X) = d-r\) and \(\mathrm{rank}(Y) = r\). The dual pair of flags in (5) will also play a critical role in our derivation of the degree of the boundary of the rank-one region.

Remark 2.5

If the matrices \({\mathcal {A}}_i\) and the scalars \(b_i\) are generic then strict complementarity always holds [17, Corollary 8], and hence the following conditions are equivalent:

  • The primal SDP problem (2) has a unique optimal matrix X of rank 1.

  • The dual SDP problem (3) has an optimal matrix Y of rank \(d-1\).

  • The system (6) has a solution (XY) with \({{\,\mathrm{rank}\,}}(X) = 1\) and \(X,Y \succeq 0\).

These conditions characterize the set of cost matrices \(\,{\mathcal {C}}\) that lie in the rank-one region \({\mathcal {R}}_{{\mathcal {A}},b}\).

Suppose that the rank-one region \({\mathcal {R}}_{{\mathcal {A}},b}\) is non-empty. The topological boundary \(\partial {\mathcal {R}}_{{\mathcal {A}},b} \) is a closed semialgebraic set of pure codimension one in \({\mathcal {S}}^{d}\). Its Zariski closure \(\partial _{\mathrm{alg}} {\mathcal {R}}_{{\mathcal {A}},b} \) is an algebraic hypersurface, called the rank-one boundary. We view this hypersurface either in the complex affine space \({\mathbb {C}}^{\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) }\), or in the corresponding projective space \({\mathbb {P}}( {\mathcal {S}}^d) \simeq {\mathbb {P}}^{\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) -1}\). By construction, the polynomial defining \(\partial _{\mathrm{alg}} {\mathcal {R}}_{{\mathcal {A}},b}\) has coefficients in the field generated by the entries of \({\mathcal {A}}\) and b over \({\mathbb {Q}}\). The rank-one boundary degree is the degree of this polynomial:

$$\begin{aligned} \beta (l,d) \,\, = \,\, \deg \bigl ( \partial _{\mathrm{alg}}{\mathcal {R}}_{{\mathcal {A}},b} \bigr ). \end{aligned}$$

Our main result in this section furnishes a formula for the degree of the rank-one boundary.

Theorem 2.6

Let \( 3 \le l \le d\) and consider the SDP with generic \({\mathcal {A}}\) and b, as given in (2). The degree of the hypersurface \(\partial _{\mathrm{alg}} {\mathcal {R}}_{{\mathcal {A}},b}\) that bounds the rank-one region \({\mathcal {R}}_{{\mathcal {A}},b}\) equals

$$\begin{aligned} \beta (l,d) \,\, = \,\, 2^{l-1} (d-1)\left( {\begin{array}{c}d\\ l\end{array}}\right) - 2^l\left( {\begin{array}{c}d\\ l+1\end{array}}\right) . \end{aligned}$$
(7)
Table 1 Algebraic degrees and boundary degrees of SDP

Table 1 illustrates Proposition 2.4 and Theorem 2.6. It shows the algebraic degrees of rank-one SDP on the top, and corresponding rank-one boundary degrees on the bottom. The entry for \(l=d=3\) equals \(8 = 2+2+2+2\), as argued in Example 2.1 and seen in Fig. 2. The first row (\(l=2\)) is not covered by Theorem 2.6. This case requires special consideration.

Proposition 2.7

If \(\,l=2\) then the rank-one region \({\mathcal {R}}_{{\mathcal {A}},b}\) is dense in the matrix space \({\mathcal {S}}^d\). If \({\mathcal {A}}, b\) are generic then \(\partial {\mathcal {R}}_{{\mathcal {A}},b} = {\mathcal {S}}^d \backslash {\mathcal {R}}_{{\mathcal {A}},b}\) is a hypersurface of degree \(\beta (2,d) = \left( {\begin{array}{c}d+1\\ 3\end{array}}\right) \).

Proof

The semialgebraic set \({\mathcal {R}}_{{\mathcal {A}},b}\) is dense in the classical topology on \({\mathcal {S}}^d\) because the Pataki range [17, §3] consists of a single rank for \(l=2\). This means that, for almost all cost matrices \({\mathcal {C}}\), there is an optimal pair (XY) that satisfies \(\mathrm{rank}(X)=1\) and \(\mathrm{rank}(Y) = d-1\). The boundary \(\partial {\mathcal {R}}_{{\mathcal {A}},b}\) is the set of \({\mathcal {C}}\) such that the optimal matrix \(Y = {\mathcal {C}}- \lambda _1 {\mathcal {A}}_1 - \lambda _2 {\mathcal {A}}_2\) has rank \(\le d-2\). The polynomial in \({\mathcal {A}}_1,{\mathcal {A}}_2,{\mathcal {C}}\) that defines this hypersurface is the Chow form of the determinantal variety \(\{\mathrm{rank}(Y) \le d-2 \}\). This variety has codimension three in \({\mathbb {P}}({\mathcal {S}}^d)\) and degree \(\left( {\begin{array}{c}d+1\\ 3\end{array}}\right) \) (see [10, Prop. 12(b)]). This is the degree of the Chow form in the entries of \({\mathcal {C}}\), and hence it is the degree of our hypersurface \(\partial _{\mathrm{alg}} {\mathcal {R}}_{{\mathcal {A}}, b}\). \(\square \)

The proof of Theorem 2.6 requires additional concepts from algebraic geometry. We work with the Veronese variety\(\,{\mathbb {P}}^{d-1} \hookrightarrow {\mathbb {P}}({\mathcal {S}}^d)\). By [17, Proposition 12], its conormal variety is

$$\begin{aligned} \!\! CV \,= \, \bigl \{ (X,Y) \in {\mathbb {P}}({\mathcal {S}}^d) \times {\mathbb {P}}({\mathcal {S}}^d) \,:\, XY = 0 \,\, \mathrm{and} \,\, \mathrm{rank}(X) = 1 \,\, \mathrm{and} \,\, \mathrm{rank}(Y) \le d-1 \bigr \}. \end{aligned}$$
(8)

As in [17, Theorem 10], we consider the corresponding class \(\,[CV]\,\) in the cohomology ring

$$\begin{aligned} H^*\bigl (\,{\mathbb {P}}({\mathcal {S}}^d) \times {\mathbb {P}}({\mathcal {S}}^d),\, {\mathbb {Z}}\,\bigr ) \, = \, {\mathbb {Z}}[\,s,\,t\, ] \, / \bigl \langle \,s^{\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) }, \,t^{\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) } \,\bigr \rangle . \end{aligned}$$
(9)

Its coefficients are the polar degrees of the Veronese variety. By Proposition 2.4,

$$\begin{aligned}{}[CV] \,\,\, = \,\, \, \sum _{l=1}^d 2^{l-1} \left( {\begin{array}{c}d\\ l\end{array}}\right) \cdot s^{\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) -l} t^l. \end{aligned}$$
(10)

We represent CV by its pullback under the Veronese map \(x \mapsto X = x x^T\) on the first factor. Thus the conormal variety equals \(\,CV \,=\, \bigl \{\, (x,Y) \, : \, Y x=0 \,,\, \, \mathrm{det}(Y) = 0 \, \bigr \}\) in \({\mathbb {P}}^{d-1} \times {\mathbb {P}}({\mathcal {S}}^d) \).

We note that the following boundary variety is irreducible of codimension one in CV:

$$\begin{aligned} BV= & {} \bigl \{ (X,Y) \in {\mathbb {P}}({\mathcal {S}}^d) \times {\mathbb {P}}({\mathcal {S}}^d) \,:\, XY = 0 \, , \,\, \mathrm{rank}(X) = 1 \,\, \mathrm{and} \,\, \mathrm{rank}(Y) \le d-2 \bigr \} \nonumber \\\simeq & {} \bigl \{\, (x,Y) \in {\mathbb {P}}^{d-1} \times {\mathbb {P}}({\mathcal {S}}^d) \,\,:\,\, Y x \,=\, 0 \quad \mathrm{and} \quad \mathrm{rank}(Y) \le d-2 \,\bigr \}. \end{aligned}$$
(11)

By the last item in Remark 2.5, the algebraic boundary of \({\mathcal {R}}_{{\mathcal {A}},b}\) is contained in BV.

Let \(Y = (y_{ij})\) be a symmetric \(d \times d\) matrix and \(x = (x_1\;x_2\,\dots \,x_d)^T\) a column vector. Their entries are the variables of the polynomial ring \(T = {\mathbb {C}}[x_1,\dots ,x_d,y_{11}, y_{12}, \dots ,y_{dd}]\). Subvarieties of \( {\mathbb {P}}^{d-1} \times {\mathbb {P}}({\mathcal {S}}^d)\) are defined by bihomogeneous ideals in T. The ideal of the conormal variety equals \(I_{CV} = \langle Y x, \det (Y) \rangle \). The ideal of the boundary variety equals \(I_{BV} = I_{CV} + {\text {Min}}_{d-1}(Y)\). The latter is the ideal generated by the \((d-1) \times (d-1)\) minors of Y.

Proof of Theorem 2.6

Let \(C = (c_{ij})\) denote the adjugate of Y. The entry \(c_{ij}\) of this \(d \times d\) matrix is the \((d-1) \times (d-1)\) minor of Y complementary to \(y_{ij}\). We are interested in the divisor in the smooth variety CV that is defined by the equation \(c_{11} = 0\). We claim that this divisor is the sum of the boundary divisor BV and the divisor defined by \(x_1^2 = 0\).

To prove this claim, we consider the ideals \(I := I_{CV} + \langle c_{11}\rangle \) and \(J := I_{CV} + {\text {Min}}_{d-1}(Y) \cdot \langle x_1^2 \rangle \) in T. It suffices to show \(I = {\text {sat}}(J)\), the saturation with respect to \(\langle x_1,\dots ,x_d\rangle \). Consider the \(d \times (d+1)\) matrix \( ( x \;|\; C )\). The ideal \(M :={\text {Min}}_2(x \;|\; C )\) is contained in \(I_{CV}\). Combining two of its generators, we find \(c_{ij}x_1^2 - c_{11}x_ix_j \in M\). Therefore the generator \(c_{ij}x_1^2\) of J lies in \(M + \langle \, c_{11} \,\rangle \subset I\). So \(J\subseteq I\), and since I is saturated, \({\text {sat}}(J)\subseteq I\). For the reverse inclusion we need to show that \(c_{11} \in {\text {sat}}(J)\). This follows by noting that \( c_{11}x_k^2 - c_{kk}x_1^2 \in M\), and thus \(c_{11} x_k^2 \in M + {\text {Min}}_{d-1}(Y) \cdot \langle x_1^2\rangle \subset J\). Therefore, \(I = {\text {sat}}(J)\) and the claim follows.

We now compute the class of BV in the cohomology ring (9). The minor \(c_{11}\) defines a hypersurface of degree \(d-1\) in \({\mathbb {P}}({\mathcal {S}}^d)\), so its class is \((d-1) t\). The class of \(\{x_1^2=0\}\) is twice the hyperplane class in \({\mathbb {P}}^{d-1}\). It is the pullback of \([\{x_{11}=0\}]=s\) under the Veronese map into \({\mathbb {P}}({\mathcal {S}}^d)\). Here \(x_{11}\) is the upper left entry in the matrix \(X = x x^T\). We multiply these classes with [CV] as in (10), and thereafter we subtract. By the claim we proved, this gives

$$\begin{aligned}{}[BV]&\;=\; [\,CV \,\cap \, \{ c_{11} = 0 \}]\, -\, [\,CV \cap \{x_1^2=0\}] \\&\;=\; \bigl (\,(d-1)t \,-\,s \,\bigr ) \cdot [CV] \;=\; \sum _{l=2}^d \beta (l,d) \cdot s^{\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) -l} t^{l+1}, \end{aligned}$$

where the coefficients of the resulting binary form are the expressions on the right of (7).

The following argument shows that the class [BV] encodes the rank-one boundary degrees. Suppose the cost matrix \({\mathcal {C}}\) travels on a generic line in \({\mathcal {S}}^d\) from the inside to the outside of the rank-one region \({\mathcal {R}}_{{\mathcal {A}},b}\). For almost all points \({\mathcal {C}}\) on that line, the optimal pair (XY) is unique. Before \({\mathcal {C}}\) crosses the boundary \(\partial {\mathcal {R}}_{{\mathcal {A}},b}\), the optimal pair satisfies \(\mathrm{rank}(X) = 1\) and \(\mathrm{rank}(Y) = d-1\). Immediately after \({\mathcal {C}}\) crosses \(\partial {\mathcal {R}}_{{\mathcal {A}},b}\), we have \(\mathrm{rank}(X) =2\) and \(\mathrm{rank}(Y) = d-2\). At the transition point, the optimal pair (XY) lies in the variety BV.

Consider the intersection of BV with the product of the codimension-\((l-1)\) plane \({\mathbb {P}}({\mathcal {V}}^\perp )\) and the subspace \({\mathbb {P}}({\mathcal {U}}') \simeq {\mathbb {P}}^{l+1}\) spanned by \({\mathcal {A}}_1,\ldots ,{\mathcal {A}}_l\) and the line on which \({\mathcal {C}}\) travels. The points in that intersection are the pairs \((X,Y) \in BV\) that arise as \({\mathcal {C}}\) travels along the line. The number of such complex intersection points is the coefficient of \(s^{\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) -l} t^{l+1}\) in [BV] .

We need to argue that the inclusion (5) poses no restriction on the products of subspaces we intersect with, i.e., for generic flags \({\mathcal {V}} \subset \mathcal {U'}\) with \(\mathrm{dim}(\mathcal {U'}/ {\mathcal {V}}) = 3\), all intersections with BV are transverse and reduced. To this end, let \(X_0\) be the rank-one \(d \times d\) matrix with a single one in the first entry, and let \(Y_0\) be the diagonal \(d \times d\) matrix with two zeros followed by \(d-2\) ones. Then an affine neighborhood of \((X_0,Y_0) \) in \( {\mathbb {P}}({\mathcal {S}}^d) \times {\mathbb {P}}({\mathcal {S}}^d)\) can be given as the direct sum of the spaces parametrized by

$$\begin{aligned}&\begin{pmatrix} 1 &{} \quad x_{1 2} &{}\quad \cdots &{}\quad x_{1,d} \\ x_{1 2} &{}\quad x_{2 2} &{}\quad \cdots &{}\quad x_{2,d} \\ \vdots &{}\quad \vdots &{}\quad \ddots &{} \quad \vdots \\ x_{1,d} &{}\quad x_{2,d} &{}\quad \cdots &{}\quad x_{d,d} \end{pmatrix} \quad \text { and } \quad \\&\quad \begin{pmatrix} y_{1 1} &{}\quad y_{1 2} &{}\quad y_{1 3} &{}\quad \cdots &{}\quad y_{1 , d-1} &{}\quad y_{1,d} \\ y_{1 2} &{}\quad y_{2 2} &{}\quad y_{2 3} &{} \quad \cdots &{}\quad y_{2 , d-1} &{}\quad y_{2,d} \\ y_{1 3} &{}\quad y_{2 3} &{}\quad 1+y_{3 3} &{}\quad \cdots &{}\quad y_{3 , d-1} &{}\quad y_{3,d} \\ \vdots &{}\quad \vdots &{} \quad \vdots &{} \quad \ddots &{} \quad \vdots &{} \quad \vdots \\ y_{1, d-1} &{}\quad y_{2, d-1} &{} \quad y_{3, d-1} &{}\quad \cdots &{}\quad 1+y_{d-1 , d-1} &{}\quad y_{d-1 , d} \\ y_{1,d} &{} \quad y_{2,d} &{}\quad y_{3,d} &{} \quad \cdots &{}\quad y_{d-1 , d}&{} \quad 1 \end{pmatrix}. \end{aligned}$$

The linear terms in the coordinates of the matrix equation \(XY=0\) are

$$\begin{aligned} y_{1 1}, \,y_{1 2},\, x_{1 3} + y_{1 3},\, \ldots ,\, x_{1,d} + y_{1,d}\ \text { and } \ x_{2 3},\, \ldots , \,x_{d,d}, \end{aligned}$$
(12)

for a total of \(\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) -1\) forms. To show that the intersection described above is transverse for generic flags \({\mathcal {V}} \subset \mathcal {U'}\), it suffices to find one instance for which \(BV \cap ({\mathbb {P}}({\mathcal {V}}^\perp ) \times {\mathbb {P}}(\mathcal {U'})) = \{(X_0,Y_0)\} \) in the neighborhood of \((X_0,Y_0) \in {\mathbb {P}}({\mathcal {S}}^d) \times {\mathbb {P}}({\mathcal {S}}^d)\) defined above.

Let \({\mathbb {P}}({\mathcal {V}}^\perp )\) be determined by the vanishing of the \(l-1\) forms \(x_{1 2},\dots , x_{1\, l-1},x_{2 2}-x_{2 3}\) and \({\mathbb {P}}(\mathcal {U'})\) by the \(\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) - l\) forms \(y_{1,l},\dots ,y_{1,d},y_{2 2}+y_{2 3},y_{2 3}, \dots , y_{d-1, d}\). Combining these forms with those in (12), we get \(2(\left( {\begin{array}{c}d+1\\ 2\end{array}}\right) -1)\) independent linear forms. This (highly non-generic) choice yields a transverse intersection. We conclude that the intersection \(BV \cap ({\mathbb {P}}({\mathcal {V}}^\perp ) \times {\mathbb {P}}(\mathcal {U'}))\) is transverse and reduced at \((X_0,Y_0)\) also for generic choices of \({\mathcal {V}} \subset \mathcal {U'}\). \(\square \)

3 From semidefinite to quadratic optimization

We now model the quadratic optimization problem (1) as a special case of the semidefinite program (2). To this end, we set \(l=m+1\), \(d=n+1\), and we use indices that start at 0 and run to m and n respectively. Let \({\mathcal {A}}_0\) be the rank-one matrix \(E_{00}\) whose entries are 0 except for the entry 1 in the upper left corner. The following two conditions are equivalent:

$$\begin{aligned} {\mathcal {A}}_0 \bullet X = 1, \,\,{{\,\mathrm{rank}\,}}(X) = 1 \; \,\mathrm{and}\; \,X \succeq 0 \; \iff \; X = (1,x_1,\ldots ,x_{n})^T (1,x_1,\ldots ,x_{n}).\nonumber \\ \end{aligned}$$
(13)

Setting \(b = (1,0,\ldots ,0)\) and imposing the rank constraint in (13), our SDP in (2) is equivalent to minimizing a quadratic function in x subject to the constraints \({\mathcal {A}}_1 \bullet X = \cdots = {\mathcal {A}}_{m} \bullet X = 0 \).

To apply SDP to the problem (1), with m quadratic constraints in n variables, we set

$$\begin{aligned} g({x}) \, \,= \,\, {x}^T {C} {x} + c^T {x} \quad \mathrm{and} \quad f_i({x}) \,\,= \,\, {x}^T {A}_i {x} + 2 a_i^T {x} + \alpha _i \quad \text { for }1\le i \le m. \end{aligned}$$

The matrices \({C},{A}_i\in {\mathcal {S}}^{n}\), the vectors \(c,a_i\in {\mathbb {R}}^{n}\), and the scalars \(\alpha _i\in {\mathbb {R}}\), give the entries in

$$\begin{aligned} {\mathcal {C}}:= \begin{bmatrix} 0&\quad c^T \\ c&\quad {C} \end{bmatrix}, \;\, {\mathcal {A}}_0 := \begin{bmatrix} 1&\quad 0 \\ 0&\quad 0 \end{bmatrix}, \;\, {\mathcal {A}}_i := \begin{bmatrix} \alpha _i&\quad a_i^T \\ a_i&\quad {A}_i \end{bmatrix} \,\in \, {\mathcal {S}}^{d}. \end{aligned}$$
(14)

If we now also set \(\,X = \bigl ({\begin{matrix}1\\ x\end{matrix}}\bigr ) (1\; x^T) \) then (1) is precisely the SDP (2). In other words, (1) is equivalent to (2) with the additional constraint \(\,{{\,\mathrm{rank}\,}}(X) = 1\). The SDP (2) is called the Shor relaxation of the quadratic program (1). We say that the relaxation is exact if the primal optimal solution \(X^*\) of the SDP is unique and has rank one.

The SDP arising as a relaxation of a quadratic program has two distinctive features: the matrix \({\mathcal {A}}_0\) is the rank-one matrix \(E_{00}\), and we fix the values \(b_0 = 1\), \(c_{00} = b_1 = \cdots = b_m = 0\). The last \(m+1\) equations pose no restriction: they can be achieved by adding multiples of \({\mathcal {A}}_0\) to \({\mathcal {C}},{\mathcal {A}}_1,\ldots ,{\mathcal {A}}_m\). The only truly special feature of this SDP is that \({\mathcal {A}}_0\) has rank one.

Remark 3.1

The Shor relaxation of a quadratic optimization problem in \({\mathbb {R}}^n\) is a semidefinite program in \({\mathcal {S}}^{n+1}\) in which one constraint matrix \({\mathcal {A}}_0\) is rank-one.

We fix the identifications in (14) throughout this section. In particular, we will define the SDP-exact region as the restriction of the rank-one region to SDP’s coming from quadratic programs. Consider the Lagrangian function

$$\begin{aligned} {\mathcal {L}}(\lambda ,{x}) \,\, := \,\, g(x) \,-\, \sum _{i=1}^{m} \lambda _i f_i({x}). \end{aligned}$$
(15)

This polynomial is quadratic in x. Its Hessian with respect to x is the symmetric \(n \times n\) matrix

$$\begin{aligned} \mathrm{H}(\lambda ) \,\, := \,\, \biggl ( \frac{\partial ^2 {\mathcal {L}} }{ \partial x_i \partial x_j} \biggr )_{\! 1 \le i,j \le n} = \quad C - \sum _{i=1}^m {\lambda }_i{A}_i. \end{aligned}$$
(16)

The entries of the matrix \(\mathrm{H}(\lambda )\) are affine-linear in \(\lambda = (\lambda _1,\ldots ,\lambda _m)\).

The SDP-exact region is obtained by specializing Definition 2.2 to the matrices in (14):

Definition 3.2

The SDP-exact region\({\mathcal {R}}_\mathbf{f}\) is the set of all matrices \(\,{\mathcal {C}}\in {\mathcal {S}}^{n+1}\) such that

$$\begin{aligned} \mathrm{H}(\lambda ) \,\succ \, 0 \quad \mathrm{and} \quad c - \sum _{i=1}^m {\lambda }_i a_i + \mathrm{H}(\lambda ) {x}\, =\, 0 \qquad \text {for some } {x} \in V_\mathbf{f}\text { and }\,{\lambda }\in {\mathbb {R}}^m.\nonumber \\ \end{aligned}$$
(17)

The condition (17) has a natural interpretation in the setting of constrained optimization. It says that the Hessian of the Lagrangian is positive definite at the optimal solution.

Remark 3.3

Definition 3.2 expresses \({\mathcal {R}}_\mathbf{f}\) as a union of spectrahedral shadows [18, 20]. To see this, fix a point x in \(V_\mathbf{f}\). The constraints (17) define a spectrahedron \({S}_{{x}}\) in the space with coordinates \(({\lambda }, {C}, c)\). The SDP-exact region for x is the image of \({S}_{{x}}\) under the projection onto the coordinates (Cc). This image is a spectrahedral shadow. Definition 3.2 says that \({\mathcal {R}}_\mathbf{f}\) is the union of these shadows. We shall return to this point in Theorem 4.1.

The main result in this section is the extension of Proposition 2.4 and Theorem 2.6 to quadratic optimization. Let \(N = \left( {\begin{array}{c}n+2\\ 2\end{array}}\right) -1\) and consider the map \(\pi : {\mathbb {P}}^N \times {\mathbb {P}}^N \dashrightarrow {\mathbb {P}}^N \times {\mathbb {P}}^{N-1}\) that deletes the upper left entry \(y_{00}\) of the matrix Y. Let \(CV' = \overline{\pi (CV)} \) denote the closed image of the conormal variety CV in (8) under the map \(\pi \), and similarly let \(BV' = \overline{\pi (BV)}\) denote the closed image of the boundary variety in (11). Algebraically, we compute these projected varieties by eliminating the unknown \(y_{00}\) from the defining ideals of (8) and (11).

Proposition 3.4

The algebraic degree of (1) is given by \([CV']\) in \(H^*({\mathbb {P}}^N\times {\mathbb {P}}^{N-1})\). We have

$$\begin{aligned}{}[ CV'] \,\, = \,\, \sum _{m=0}^{n} 2^{m} \left( {\begin{array}{c}n\\ m\end{array}}\right) \cdot s^{\left( {\begin{array}{c}n+2\\ 2\end{array}}\right) -(m+1)} t^{m} . \end{aligned}$$
(18)

Similarly, the degree of \(\partial _{\mathrm{alg}} {\mathcal {R}}_\mathbf{f}\) is given by the class of the projected boundary variety \(BV'\).

Proof

The map \(\pi \) is the projection from the special point \({\mathcal {A}}_0 = E_{00}\) in \({\mathbb {P}}^N\). In the proof of Theorem 2.6, we intersect CV and BV with products of complementary linear spaces. The situation is the same here, except that we now require the linear space in the second factor to contain the point \( {\mathcal {A}}_0\). Thus, our counting problem is equivalent to intersecting the projections via \(\pi \) by products of generic linear spaces of complementary dimension. The formula in (18) is the algebraic degree of quadratic programming, which is found in [16, Eqn. (3.1)]. \(\square \)

Table 2 Algebraic degrees and boundary degrees for the QP problem (1)

Theorem 3.5

Let \(m \le n\) and suppose that \(f_1,\ldots ,f_m\) are generic polynomials in \({\mathbb {R}}[x]_{\le 2}\). The algebraic boundary of the SDP-exact region \({\mathcal {R}}_\mathbf{f}\) is a hypersurface whose degree equals

$$\begin{aligned} \beta _{QP}(m,n) \,\,\, = \,\, \, 2^m\left( n \left( {\begin{array}{c}n\\ m\end{array}}\right) - \left( {\begin{array}{c}n\\ m+1\end{array}}\right) \right) . \end{aligned}$$
(19)

Table 2 illustrates (18) and Theorem 3.5. It shows the algebraic degrees of quadratic programming and corresponding degrees of rank-one boundaries. Compare with Table 1. The diagonal entries \((m=n)\) in Table 2 are similar to those in the Max-Cut Problem (Example 1.2), but there is an index shift because the general objective function g(x) is not homogeneous. We have \(\beta _{QP}(n,n) = 2^n \cdot n\), since the n quadrics \(\{f_i(x) = 0\}\) intersect in \(2^n\) points, and each of these contributes a spectrahedron of degree n to the SDP-exact region.

For the proof we shall use polynomial ideals as in Sect. 2, but now the ambient ring is \(T = {\mathbb {C}}[y_{00},y_{01},\ldots ,y_{nn}, x_0,\ldots ,x_n]\). Using this variable ordering, we fix the lexicographic monomial order on T. In particular, \(y_{00}\) is the highest variable. Let \(I_{BV}={\text {Min}}_n\bigl (Y) + \langle Y x \rangle \) be the ideal generated by the \(\left( {\begin{array}{c}n+2\\ 2\end{array}}\right) \) minors of Y of size n and the \(n+1\) entries of vector Yx.

Lemma 3.6

The initial ideal \(\mathrm{in}(I_{BV})\) is radical. It is minimally generated by \(\left( {\begin{array}{c}n+2\\ 2\end{array}}\right) + \sum _{t=0}^{n-2} \left( {\begin{array}{c}n+1\\ t+1\end{array}}\right) \) squarefree monomials, namely the leading terms of the \(n \times n\) minors of Y, and the monomials \(\,x_t \cdot y_{0 k_0} y_{1 k_1} \cdots y_{t k_t}\,\) where \(\,t \in \{0,1,\ldots ,n-2\}\,\) and \(\, 0 \le k_0< k_1< \cdots < k_t \le n\).

Proof

It is well-known in commutative algebra that the \(n \times n\) minors of Y form a reduced Gröbner basis. We augment these to a reduced Gröbner basis for \(I_{BV}\) by adding the entries of the row vector \(x^T {{\tilde{Y}}}\) where \({{\tilde{Y}}}\) is a certain matrix with \(n+1\) rows and many more columns. To construct this, we consider the T-module spanned by any subset of columns of T. The circuits in such a submodule of \(T^{n+1}\) are the nonzero vectors with minimal support. We consider all circuits whose support is a terminal segment \(\{t,t+1,\ldots ,n,n+1\}\). The columns of \({{\tilde{Y}}}\) are all such circuits. These are formed by applying Cramer’s rule to submatrices of Y with row indices \(0,\ldots ,t-1\) and \(t+1\) arbitrary columns. The resulting entries of \(x^T {{\tilde{Y}}}\) lie in \(I_{BV}\). They are linear in x, of degree \(t+1\) in Y, and have the desired initial monomials. One checks that their S-pairs reduce to zero, and that this Gröbner basis is reduced. \(\square \)

Corollary 3.7

The ideal \(I_{BV}'\) obtained from \(I_{BV}\) by eliminating the highest variable \(y_{00}\) is generated by those n entries of Yx and \(n+1\) minors of \(\,Y\) of size n that do not use \(y_{00}\).

Proof

The elimination ideal \(I'_{BV}\) is generated by elements of the lexicographic Gröbner basis that do not contain \(y_{00}\). These are elements whose leading monomials do not contain \(y_{00}\). Each of these is a polynomial linear combination of the above \(2n+1\) generators of \(I_{BV}\). \(\square \)

Proof of Theorem 3.5

Let \(N = \left( {\begin{array}{c}n+2\\ 2\end{array}}\right) -1\). As in the proof of Theorem 2.6, we identify CV with its preimage in \({\mathbb {P}}^{n} \times {\mathbb {P}}^N\), that is, \( CV = \{ (x,Y) \;|\; Y x=0, {{\,\mathrm{rank}\,}}(Y) \le n\}\). Its image \(CV'\) under \(\pi \) lives in \({\mathbb {P}}^{n} \times {\mathbb {P}}^{N-1}\). The boundary \(BV'\) is the projection of BV into \({\mathbb {P}}^{n} \times {\mathbb {P}}^{N-1}\).

In Theorem 2.6, the boundary was found by intersecting CV with the divisor given by the minor \(c_{00}\) of Y, and by removing the non-reduced excess component \(\{x_0^2 = 0\}\). In the present case, we still have that excess component, but it is reduced, given by \(x_0 = 0\). The class \([\{x_0=0\}]\) is half of the pullback of the hyperplane class s of \({\mathbb {P}}^{n}\). Using (18), this implies

$$\begin{aligned}{}[BV'] \,=\, \left( \,- \frac{1}{2}s \,+ \, n t \,\right) \, [CV'] \,\, = \,\, \sum _{m=1}^{n} \beta _{QP}(m,n) \cdot s^{\left( {\begin{array}{c}n\\ 2\end{array}}\right) -(m+1)} t^{m+1} . \end{aligned}$$

The coefficients \(\beta _{QP}(m,n)\) of this binary form are the combinatorial expressions in (19).

To see that the excess component is now \(\{ x_0 = 0\}\), we argue as follows. Let \(C'=(c_{0j})\) be the leftmost column of the adjugate matrix of Y. Consider the ideals \(I' := I_{CV}' + \langle c_{00} \rangle \) and \(J':= I_{CV}' + \langle C' \rangle \cdot \langle x_0 \rangle \). We claim that \(I'={\text {sat}}(J')\). Observe that the \((n+1) \times 2\) matrix \( \bigl ( \,x \,| \,C' \bigr )\) satisfies \({\text {Min}}_2\bigl (\,x\,|\,C'\bigr ) \subset I_{CV}'\). This implies \(c_{0j} x_0 \in J'\) for all \(j \ge 1\). Then \(J' \subseteq I'\) and since \(I'\) is saturated, \({\text {sat}}(J') \subseteq I'\). The reverse inclusion is implied by \(c_{00} \in {\text {sat}}(J')\), which follows from the fact that \(c_{00}x_j \in {\text {Min}}_2\bigl (\,x\,|\,C'\bigr ) + \langle C' \rangle \cdot \langle x_0 \rangle \). By Corollary 3.7, the elimination ideal is \(I_{BV}' = I_{CV}' + \langle C' \rangle \). So we may conclude that \(CV' \cap \{c_{00}\} = BV' \cup (CV' \cap \{x_0=0\})\). \(\square \)

Remark 3.8

(Lasserre hierarchy) It is natural to try to extend the SDP-exact region to higher levels of the Lasserre hierarchy [1, 13, 14]. Consider equations \(\mathbf{f }=(f_1,\dots ,f_m)\) of degree \(\le 2d\). We may define the d-th SDP-exact region \({\mathcal {R}}^{d}_\mathbf{f}\) as the set of all \(g\in {\mathbb {R}}[x]_{\le 2d}\) such that (1) is solved exactly by the d-th level of the hierarchy. By further imposing strict complementarity, we may derive a semialgebraic representation similar to (17). Some illustrations of \({\mathcal {R}}^{d}_\mathbf{f}\) were obtained in [4]. It is an open problem to investigate the geometry of this region and, in particular, to compute the degree of its algebraic boundary. This analysis might be significantly more complicated, since the special structure of the moment matrix must be taken into account (so the dual pair of flags is not generic).

4 Bundles of spectrahedral shadows

We fix \({\mathbf {f}}=(f_1,\dots ,f_m)\) as before. For any \(u\in {\mathbb {R}}^n\) we consider the following two problems:

  • Linear Objective (Lin): Minimize \(u^T x\) subject to \(x\in V_\mathbf{f}\).

  • Euclidean Distance (ED): Minimize \(\Vert x-u\Vert ^2\) subject to \(x\in V_\mathbf{f}\).

These problems are special instances of the quadratic program (1), with the cost matrices

(20)

We write \({\mathcal {R}}^{ lin}_\mathbf{f}\) and \( {\mathcal {R}}^{ ed}_\mathbf{f} \) for the SDP-exact regions in \({\mathbb {R}}^n\) of these two problems. They are the intersections of \({\mathcal {R}}_\mathbf{f}\) with the affine subspaces of \({\mathcal {S}}^{n+1}\) given in (20). The punchline of this section is that both regions are normal bundles of spectrahedral shadows over \(V_\mathbf{f}\). Namely, we shall write \({\mathcal {R}}^{ lin}_\mathbf{f}\) and \({\mathcal {R}}^{ ed}_\mathbf{f}\) as a union of spectrahedral shadows, one for each point \({x} \in V_\mathbf{f}\).

The lower right block of \({\mathcal {C}}^{ lin}\) and \({\mathcal {C}}^{ ed}\) is independent of u, and thus the Hessian matrix \(\mathrm{H}(\lambda )\) is independent of u. The spectrahedron defined by the constraint \( \mathrm{H}(\lambda ) \succ 0 \) is as follows:

$$\begin{aligned} \mathrm{S}^{ lin}_\mathbf{f} = \left\{ \, {\lambda }\in {\mathbb {R}}^{m} \,:\, \sum _{i=1}^m \lambda _i A_i \,\prec \,0 \,\right\} \quad \mathrm{and} \qquad \mathrm{S}^{ ed}_\mathbf{f} = \left\{ \, {\lambda }\in {\mathbb {R}}^{m} \,:\, \sum _{i=1}^m \lambda _i A_i \,\prec \,I_n \,\right\} . \end{aligned}$$
(21)

The sets in (21) are called master spectrahedra. Observe that \(\mathrm{S}^{ lin}_\mathbf{f}\) is a cone in \({\mathbb {R}}^{m}\). Also note that \(\mathrm{S}^{ ed}_\mathbf{f}\) is full-dimensional because \(\lambda = (0,\ldots ,0)\) is an interior point. Let \(\mathrm{Jac}_\mathbf{f}\) denote the Jacobian matrix of \(\mathbf{f}\). This matrix has format \(n \times m\), and its entry in row i and column j is the linear polynomial \(\partial f_j/\partial x_i\). At any point \(x \in V_\mathbf{f}\), the specialized Jacobian matrix \(\mathrm{Jac}_\mathbf{f}(x)\) defines a linear map \({\mathbb {R}}^m \rightarrow {\mathbb {R}}^n\), whose range is the normal space of the variety \(V_\mathbf{f}\) at x. We consider all the images of the respective master spectrahedra under these linear maps.

Theorem 4.1

The SDP-exact regions for (Lin) and (ED) are comprised of the images of the corresponding master spectrahedra in the normal spaces of the variety \(V_\mathbf{f}\). To be precise,

$$\begin{aligned} {\mathcal {R}}_\mathbf{f}^{ lin} = \bigcup _{{x} \in V_\mathbf{f}} \bigl ( \tfrac{1}{2} \,\mathrm{Jac}_\mathbf{f}({x}) \cdot \mathrm {S}^{ lin}_\mathbf{f} \, \bigr ) \qquad \mathrm{and} \qquad {\mathcal {R}}_\mathbf{f}^{ ed} = \bigcup _{{x} \in V_\mathbf{f}} \bigl (\, x - \tfrac{1}{2}\,\mathrm{Jac}_\mathbf{f}({x}) \cdot \mathrm {S}^{ ed}_\mathbf{f} \, \bigr ). \end{aligned}$$

Moreover, the above unions are disjoint because our spectrahedra are relatively open.

Proof

The result follows by substituting (20) into Definition 3.2. Disjointness holds because any u in one of the parenthesized sets has the associated x as its unique optimal solution. \(\square \)

One consequence of Theorem 4.1 is that the SDP-exact region for an ED problem is always full-dimensional. This fact was observed in [3], where it was shown to have interesting applications in computer vision, tensor approximation and rotation synchronization.

Corollary 4.2

If x is a regular point of \(V_\mathbf{f}\), then \({\mathcal {R}}^{ ed}_\mathbf{f}\) contains an open neighborhood of x.

Proof

The regularity hypothesis means that \({{\,\mathrm{rank}\,}}(\mathrm{Jac}_\mathbf{f}(x))= {{\,\mathrm{codim}\,}}_x(V_\mathbf{f})\). This ensures that \(\mathrm{Jac}_\mathbf{f}({z})\cdot \mathrm{S}^{ ed}_\mathbf{f}\) is full-dimensional in the normal space of \(V_\mathbf{f}\) at any point z close to x. \(\square \)

For finite complete intersections, the SDP-exact regions are finite unions of spectrahedra:

Corollary 4.3

Let \(\mathbf{f}=(f_1,\dots ,f_n)\) be a complete intersection with \(k\le 2^n\) real points. Then

  1. (a)

    \({\mathcal {R}}^{ lin}_\mathbf{f}\) consists of k spectrahedral cones, each of them isomorphic to the master \(\mathrm{S}^{ lin}_\mathbf{f}\).

  2. (b)

    \({\mathcal {R}}^{ ed}_\mathbf{f}\) consists of k full-dimensional spectrahedra, each isomorphic to the master \(\mathrm{S}^{ ed}_\mathbf{f}\).

Proof

The linear map \(\mathrm{Jac}_\mathbf{f}({x})\) is injective and hence invertible on its image. Therefore, the spectrahedral shadow \(\mathrm{Jac}_\mathbf{f}({x})\cdot \mathrm{S}_\mathbf{f}\) is actually a spectrahedron, linearly isomorphic to \(\mathrm{S}_\mathbf{f}\). \(\square \)

The spectrahedral cones in \({\mathcal {R}}^{ lin}_\mathbf{f}\) are tightly connected to the first theta body of \(\langle \mathbf{f}\rangle \), denoted \(\mathrm{TH}_1(\mathbf{f})\), introduced by Gouveia et al. [9]. The theta bodies of \(\mathbf{f}\) are tractable approximations to the convex hull of \(V_\mathbf{f}\), given by projecting the feasible set of the Lasserre relaxation [13] onto the first order moments. Later in this section we will show that \({\mathcal {R}}^{ lin}_\mathbf{f}\) consists of the normal cones of \(\mathrm{TH}_1(\mathbf{f})\).

Example 4.4

(\(m=n=2\)) Consider two quadrics in two variables such that \(V_\mathbf{f}\) consists of four points in convex position in \({\mathbb {R}}^2\). The region \({\mathcal {R}}^{ ed}_\mathbf{f}\) was illustrated in Fig. 1. The region \({\mathcal {R}}^{ lin}_\mathbf{f}\) consists of four cones that sit inside the normal cones at the quadrilateral \(\mathrm{conv}(V_\mathbf{f})\). We explain this for the specific instance examined in [9, Example 5.6]:

$$\begin{aligned} \mathbf{f} = (x_1 x_2-2 x_2^2+2 x_2,\, x_1^2-x_2^2-x_1+x_2),\quad V_\mathbf{f} = \{\, (0,0)\,,\,(0,1)\,,\,(1,0)\,,\,(2,2) \,\} . \end{aligned}$$

The first theta body \(\mathrm{TH}_1(\mathbf{f})\) is seen in [9, Figure 3]. Our rendition in Fig. 3 show also the SDP-exact region \({\mathcal {R}}^{ lin}_\mathbf{f}\). It consists of the normal cones of \(\mathrm{TH}_1(\mathbf{f})\) at the four points in \(V_\mathbf{f}\). For more details see Proposition 4.7.

It is interesting to examine Corollary 4.3 (b) when \(m=n\) and \(V_\mathbf{f}\) consists of \(2^n\) real points. We know that \({\mathcal {R}}^{ ed}_\mathbf{f}\) consists of \(2^n\) full-dimensional spectrahedra of degree n. We show that these hypersurfaces are pairwise tangent, and also tangent to the walls of the Voronoi diagram. The case \(n=2\) was seen in Fig. 1, whereas the case \(n=3\) is shown in Fig. 4.

Fig. 3
figure 3

We consider two quadrics in \({\mathbb {R}}^2\) that meet in four points. The SDP-exact region for minimizing linear functions over this intersection consists of four cones, shown in the left. These are the normal cones at the first theta body \(\mathrm{TH}_1(\mathbf{f})\), as illustrated in the right

Fig. 4
figure 4

We consider three quadrics in \({\mathbb {R}}^3\) that meet in eight points. The SDP-exact region for the ED problem on this variety consists of eight spectrahedra, each around one of these points. The algebraic boundaries of the spectahedra are pairwise tangent

For \( x \in V_\mathbf{f}\), we set \(\,S_x = x - \tfrac{1}{2}\,\mathrm{Jac}_\mathbf{f}({x}) \cdot \mathrm {S}^{ ed}_\mathbf{f} \,\) and we write \(\,\partial _{\mathrm{alg}} S_x\) for its algebraic boundary.

Theorem 4.5

Let \(m=n\) and \(\mathbf{f}\) generic, so \(V_\mathbf{f}\) is finite. Let \(x,x' \in V_\mathbf{f}\), and \(S_x, S_x'\) be the corresponding spectrahedra, and let \(\mathrm {bsc}\subset {\mathbb {R}}^{n}\) be the bisector hyperplane of x and \(x'\). There is a point \(u\in {\mathbb {R}}^{n}\) at which the three hypersurfaces \(\mathrm {bsc}\), \(\partial _{\mathrm{alg}} S_x\) and \(\partial _{\mathrm{alg}} S_x'\) meet tangentially.

Proof

Let \(p(\lambda ):= \det (I_{n}-\sum _i \lambda _i {A}_i)\) be the defining polynomial of \(\partial _{\mathrm{alg}} \mathrm{S}^{ ed}_\mathbf{f}\). Then \(\,p_x(u):= p(2\,\mathrm{Jac}_\mathbf{f}({x})^{-1} u - x)\,\) is the defining polynomial of \(\partial _{\mathrm{alg}} S_x\). We shall construct a point \(u_x\) in the hypersurface \( \partial _{\mathrm{alg}} S_x\) whose normal vector \(\nabla _u p_x (u_x) \) is parallel to \(x-x'\). Notice that

$$\begin{aligned} \nabla _{u} p_x \, =\, 2 (\nabla _\lambda p) \mathrm{Jac}_\mathbf{f}({x})^{-1} \, = \,- 2 \left( {A}_1 \bullet M, \dots , {A}_m \bullet M \right) \cdot \mathrm{Jac}_\mathbf{f}({x})^{-1}, \end{aligned}$$

where M denotes the adjugate of \(I_{n} - \textstyle \sum _i {\lambda }_i {A}_i\). Since this matrix is supposed to be singular,

$$\begin{aligned} \left( I_n-\sum _i \lambda _i {A}_i\right) M = 0, \quad \left( {A}_1 \bullet M, \dots , {A}_m \bullet M \right) \propto \tfrac{1}{2} (x' - x)^T \mathrm{Jac}_\mathbf{f}({x}), \quad {{\,\mathrm{rank}\,}}(M) = 1. \end{aligned}$$
(22)

We claim that \(M = (x'-x)(x'-x)^T\) satisfies the constraint in the middle. This is seen by showing that the i-th coordinate of the vector \(\tfrac{1}{2} (x' - x)^T \mathrm{Jac}_\mathbf{f}({x})\) equals

$$\begin{aligned}&(x' - x)^T (a_i + {A}_i x) = x'^T {A}_i x + a_i^T(x' - x) - x^T {A}_i x \nonumber \\&\quad = x'^T {A}_i x -\tfrac{1}{2}(x'^T {A}_i x' - x^T {A}_i x) - x^T {A}_i x = {A}_i \bullet (-\tfrac{1}{2}) (x'-x) (x'-x)^T.\qquad \quad \end{aligned}$$
(23)

The desired vector \(\lambda \) is then determined by the equation \((I_n-\sum _i\lambda _i {A}_i)(x'-x)=0\). Now, (22) holds, and the point \(u_x = x - \tfrac{1}{2}\mathrm{Jac}_\mathbf{f}({x})(\lambda )\) has its normal at \( \partial _{\mathrm{alg}} S_x\) parallel to \(x' - x\).

We similarly construct \(u_x' \in \partial _{\mathrm{alg}} S_x'\). By (23), we have \((x - x')^T \mathrm{Jac}_\mathbf{f}({x}') = (x' - x)^T \mathrm{Jac}_\mathbf{f}({x})\). Hence the value of M that satisfies (22) is the same for both x and \(x'\), and thus \(u_x=u_x'\).

Finally, let us show that \(u_x\) lies on \(\mathrm {bsc}\). Since \((I_{n} - \textstyle \sum _i \lambda _i {A}_i) (x'-x) = 0\), we have

$$\begin{aligned} u_x^T (x'-x)&\,\,=\,\, \left( x - \sum _i \lambda _i(a_i + {A}_i x)\right) ^T (x'-x) \\&\,\,=\,\, -\left( \sum _i \lambda _i a_i^T\right) (x'-x) + x^T \left( I_{n} - \sum _i \lambda _i {A}_i\right) (x'-x) \\&\,\,=\,\, -\sum _i \lambda _i a_i^T (x'-x). \end{aligned}$$

The difference \(\Vert u_x - x' \Vert ^2 - \Vert u_x - x \Vert ^2 \) equals

$$\begin{aligned}&\Vert x'\Vert ^2 - \Vert x\Vert ^2 - 2 u_x^T (x'-x) = x'^T x' - x^T x + 2\sum _i {\lambda }_i a_i^T(x'-x) \\&\quad = x'^T x' - x^T x - \sum _i {\lambda }_i (x'^T {A}_i x' - x^T {A}_i x)\\&\quad = (x' + x)^T \left( I_{n} - \sum _i {\lambda }_i {A}_i \right) (x' - x) = 0. \end{aligned}$$

We see that \(u_x\) is equidistant from x and \(x'\), i.e., \(u_x\) belongs to the hyperplane \(\mathrm {bsc}\). We have shown that our three hypersurfaces all pass through \(u_x\) and have the same normal vector. \(\square \)

We next illustrate how the normal bundle from Theorem 4.1 looks for a curve.

Example 4.6

Let \(\mathbf{f} = (x_2 - x_1^2,\, x_3 - x_1 x_2)\), so \(V_\mathbf{f}\) is the twisted cubic curve in \({\mathbb {R}}^3\). This specific instance was examined in [3, Example 1.1]. The spectrahedron \(\mathrm {S}^{ ed}_\mathbf{f}\) is the interior of a parabola, namely \(\{ \lambda _2^2 < 2 \lambda _1 + 1 \}\). The image \({x} - \tfrac{1}{2}\mathrm{Jac}_\mathbf{f}({x}) \cdot \mathrm{S}^{ ed}_\mathbf{f}\) is a parabola in the normal plane at x. The boundary \(\partial {\mathcal {R}}^{ ed}_\mathbf{f}\) is the union of all these parabolas, as shown in Fig. 5.

We will elaborate more on the ED problem in Sect. 5. To conclude this section, we briefly develop the connection between our SDP-exact region \({\mathcal {R}}^{ lin}_\mathbf{f}\) and the theory of theta bodies [9]. By [9, Lemma 5.2], the first theta body of our instance \(\mathbf{f}\) is

$$\begin{aligned} \mathrm {TH}_1({\mathbf {f}}) \,\quad = \bigcap _{\begin{array}{c} F \in \langle {\mathbf {f}}\rangle \\ F \text { convex quadric} \end{array}} \!\!\!\!\! \bigl \{\,x\in {\mathbb {R}}^n \, : \, F(x)\le 0 \,\bigr \}. \end{aligned}$$

By [9, §2], the set \(\mathrm {TH}_1({\mathbf {f}})\) is a spectrahedral shadow that contains the convex hull of \(V_\mathbf{f}\).

Proposition 4.7

Let \(B = \mathrm {TH}_1({\mathbf {f}})\) be the first theta body for the problem (Lin). Then the SDP-exact region \( {\mathcal {R}}^{ lin}_\mathbf{f} \) is the union of the normal cones to B at all points in \(V_\mathbf{f}\). In symbols,

$$\begin{aligned} {\mathcal {R}}^{ lin}_\mathbf{f} \,\, = \bigcup _{x \in V_\mathbf{f}} \! N_B(x). \end{aligned}$$
Fig. 5
figure 5

The boundary of the SDP-exact region for the ED problem on the twisted cubic curve is ruled by parabolas. This surface has degree eight. It is computed in Example 6.1

Proof

Note that \(u\in N_B(x)\) if and only if \(x=\mathop {\mathrm{arg max}}\limits _{y\in B} u^T y\). On the other hand, the problem \(\max _{y\in B} u^T y\) is equivalent to the SDP relaxation of our QP (1). Then,

$$\begin{aligned} \bigcup _{x \in V_\mathbf{f}} N_B(x)&\,\, =\,\, \left\{ u \in {\mathbb {R}}^n : (\mathop {\mathrm{arg max}}\limits _{y\in B} u^Ty) \in V_\mathbf{f} \right\} \\&\,\,=\,\, \{ u \in {\mathbb {R}}^n : \text { the solution of the SDP relaxation lies in } V_\mathbf{f} \}. \end{aligned}$$

By definition, this set is the SDP-exact region for (Lin). For an illustration see Fig. 3. \(\square \)

5 Boundary hypersurfaces in \({\mathbb {R}}^n\)

We now examine our degrees of the ED problem. Following [6], the Euclidean distance degree of \(V_\mathbf{f}\), denoted \({\text {EDdegree}}(V_\mathbf{f})\), counts the number of complex critical points for the squared distance function \(g_u(x) = \Vert x-u \Vert ^2\) on the variety \(V_\mathbf{f}\), where \(u \in {\mathbb {R}}^n\) is a generic point.

Proposition 5.1

The algebraic degree of the quadratic program (1) that solves the ED problem for \(V_\mathbf{f}\) is \({\text {EDdegree}}(V_\mathbf{f})\). This is bounded above by \( 2^{m} \left( {\begin{array}{c}n\\ m\end{array}}\right) \). Equality holds for generic \(\mathbf{f}\).

Proof

The first statement is immediate from the definition of the ED degree. The last two statements follow from [6, Proposition 2.6]. \(\square \)

We next assume that \(\mathbf{f}\) is generic. Hence \(V_\mathbf{f}\) is a generic complete intersection. We are interested in the degree \(\beta _{ED}(m,n)\) of the hypersurface \(\,\partial _{\mathrm{alg}} {\mathcal {R}}^{ ed}_\mathbf{f} \subset {\mathbb {R}}^n\,\) that bounds the SDP-exact region for the ED problem. Table 3 shows \(\beta _{ED}(m,n)\) for some small cases.

Table 3 Algebraic degrees and boundary degrees for the ED problem
Fig. 6
figure 6

Upper right: space curve cut out by two quadrics. Left: The SDP-exact region for its ED problem. Lower right: the elliptic curve that defines the master spectrahedron

Example 5.2

(\(m=2,n=3\)) Figure 6 shows the SDP-exact region for a generic instance. Its boundary is an irreducible surface of degree 24. The master spectrahedron is the convex region of a planar cubic (lower right in Fig. 6). The variety \(V_\mathbf{f}\) is a space curve of degree 4, obtained by intersecting two hyperboloids (upper right in Fig. 6). We regard both curves as elliptic curves, the first in \({\mathbb {P}}^2\) and the second in \({\mathbb {P}}^3\). The product of these two elliptic curves is an abelian surface, which has degree 24 under its Segre embedding into \({\mathbb {P}}^2 \times {\mathbb {P}}^3 \subset {\mathbb {P}}^{11}\). Our boundary surface \(\partial _{\mathrm{alg}} {\mathcal {R}}^{ ed}_\mathbf{f}\) is a projection of this surface into \({\mathbb {P}}^3\). This explains \(\beta _{ED}(2,3) = 24\). The picture on the left in Fig. 6 shows \(\partial {\mathcal {R}}^{ ed}_\mathbf{f}\) in real affine space \({\mathbb {R}}^3\). Each of the three connected components of the curve \(V_\mathbf{f}\) is surrounded by one color-coded component of that surface. These three pieces of \(\partial {\mathcal {R}}^{ ed}_\mathbf{f}\) are pairwise tangent along curves.

For the subsequent degree computations we record the following standard fact from algebraic geometry. Example 5.2 used this formula for deriving the number \(3 \cdot 4 \cdot \left( {\begin{array}{c}1+1\\ 1\end{array}}\right) = 24\).

Lemma 5.3

Fix two projective varieties \(V \subset {\mathbb {P}}^n\) and \(W \subset {\mathbb {P}}^m\). The projective variety \(V \times W\) has degree \(\,\deg (V)\deg (W) \left( {\begin{array}{c}\dim V + \dim W\\ \dim W\end{array}}\right) \,\) in the Segre embedding of \( \,{\mathbb {P}}^n \times {\mathbb {P}}^m \,\) in \(\,{\mathbb {P}}^{(n+1)(m+1)-1}\).

We consider the product of our feasible set \(V_\mathbf{f}\) with the algebraic boundary of its master spectrahedron \( \mathrm{S}^{ ed}_\mathbf{f}\). This is the real algebraic variety \(\,V_\mathbf{f} \times \partial _{\mathrm{alg}} \mathrm{S}^{ ed}_\mathbf{f} \,\) in \({\mathbb {R}}^n \times {\mathbb {R}}^m\). We identify this variety with its Zariski closure in the product of complex projective spaces \({\mathbb {P}}^n \times {\mathbb {P}}^m\). Under the Segre map, we embed \(\,V_\mathbf{f} \times \partial _{\mathrm{alg}} \mathrm{S}^{ ed}_\mathbf{f} \,\) as a projective variety in \({\mathbb {P}}^{(m+1)(n+1)-1}\).

Corollary 5.4

The variety \(\,V_\mathbf{f} \times \partial _{\mathrm{alg}} \mathrm{S}^{ ed}_\mathbf{f} \,\) has dimension \(n -1\) and degree \(m\, 2^m \left( {\begin{array}{c}n\\ m\end{array}}\right) \).

Proof

The variety \(V_\mathbf{f}\) has dimension \(n-m\) and degree \(2^m\). The variety \(\partial _{\mathrm{alg}} \mathrm{S}^{ ed}_\mathbf{f} \) has dimension \(m-1\) and degree n. By Lemma 5.3, their product has degree \(\,2^m \cdot n \cdot \left( {\begin{array}{c}n-1\\ m-1\end{array}}\right) = m \cdot 2^m \cdot \left( {\begin{array}{c}n\\ m\end{array}}\right) \). \(\square \)

By Theorem 4.1, the boundary of the SDP-exact region is the image of \(\,V_\mathbf{f} \times \partial _{\mathrm{alg}} \mathrm{S}^{ ed}_\mathbf{f} \,\) under

$$\begin{aligned} \psi \,:\, {\mathbb {R}}^n \times {\mathbb {R}}^m \,\rightarrow \, {\mathbb {R}}^n, \qquad (x,\lambda ) \,\,\mapsto \,\, x - \tfrac{1}{2}\mathrm{Jac}_\mathbf{f}({x}) \lambda \,=\, x - \sum _{i=1}^m \lambda _i (a_i + A_i x).\qquad \end{aligned}$$
(24)

The map \(\psi \) is bilinear. We consider its homogenization

$$\begin{aligned} \Psi \,:\,&{\mathbb {P}}^n\times {\mathbb {P}}^m\, \dashrightarrow \, {\mathbb {P}}^n, \,\,\, \bigl (\,(x_0:x)\, ,\, (\lambda _0:\lambda )\, \bigr ) \nonumber \\&\quad \mapsto \, \left( \,\lambda _0 x_0\,: \, \lambda _0 x - \sum _{i=1}^m \lambda _i (x_0 a_i+ A_i x)\, \right) . \end{aligned}$$
(25)

This map factors as the Segre embedding \(\sigma \) followed by a linear projection \(\pi \):

$$\begin{aligned} {\mathbb {P}}^n \times {\mathbb {P}}^m \,\overset{\sigma }{\longrightarrow }\,\, {\mathbb {P}}^{(n+1)(m+1)-1} \,\overset{\pi }{\dashrightarrow }\,\, {\mathbb {P}}^n . \end{aligned}$$
(26)

Lemma 5.5

The restriction of \(\,\pi \) to (the image under \(\sigma \) of) \(\,V_\mathbf{f} \times \partial _{\mathrm{alg}} \mathrm{S}^{ ed}_\mathbf{f} \,\) is base-point free.

Proof

We show that \(L \cap \sigma (V_\mathbf{f} \times \partial _{\mathrm{alg}} \mathrm{S}^{ ed}_\mathbf{f} ) = \emptyset \), where \(L \subset {\mathbb {P}}^{(n+1)(m+1)-1}\) is the base locus of \(\pi \). By (25), we know that L is contained in \(\{\lambda _0 x_0 = 0\}\). First, assume \(\lambda _0=0\) and \(x_0=1\). The equations from (25) simplify to \(\sum _{i=1}^{m} \lambda _i(a_i + A_i x) = 0\), which means \(\mathrm{Jac}_\mathbf{f}(x) \lambda = 0\). But this is impossible because \(\mathrm{Jac}_\mathbf{f}(x)\) has full rank, by genericity of \(\mathbf{f}\). Consider now the case \(x_0=0\). We may assume that \(m<n\), as otherwise \(V_\mathbf{f}\) does not intersect \(\{x_0=0\}\). Setting the image in (25) to zero, we get \(\lambda _0 x - \sum _{i=1}^{m} \lambda _i ( A_i x) = 0\). Viewed as a system of linear equations in \(\lambda _0,\lambda _1,\ldots , \lambda _m \), this is overconstrained, so by genericity it has no nonzero solution. \(\square \)

We now write \(\pi \) for the restriction to \(V_\mathbf{f} \times \partial _{\mathrm{alg}} \mathrm{S}^{ ed}_\mathbf{f}\). Lemma 5.5 and the dimension part in Corollary 5.4 show that \(\pi \) is a dimension-preserving morphism onto \(\partial _{\mathrm{alg}} {\mathcal {R}}^{ ed}_\mathbf{f}\). The degree of this morphism, denoted \(\deg (\pi )\), is the cardinality of the fiber of \(\pi \) over a generic point in the image. By [15, Proposition 5.5], the degree of the source equals the degree of the image times the degree of the map. Hence, Lemma 5.3 implies the following result:

Theorem 5.6

The degree of the algebraic boundary \(\partial _{\mathrm{alg}} {\mathcal {R}}^{ ed}_\mathbf{f}\) of the SPD-exact region is

$$\begin{aligned} \beta _{ED}(m,n) \quad =\quad \frac{1}{\deg (\pi )} \cdot m\, 2^{m} \left( {\begin{array}{c}n\\ m\end{array}}\right) . \end{aligned}$$

We conjecture that \(\deg (\pi )=1\) whenever our variety \(V_\mathbf{f}\) is not a hypersurface, i.e., whenever \(m \ge 2\). This was verified computationally in all cases that are reported in Table 3.

Conjecture 5.7

If \(m \ge 2\) then the degree in Theorem 5.6 is \(\,\beta _{ED}(m,n) = m\, 2^{m}\left( {\begin{array}{c}n\\ m\end{array}}\right) \).

Analogously to Proposition 2.7, the above formula fails in the case \(m=1\).

Proposition 5.8

If \(m=1\) then the SDP-exact region \({\mathcal {R}}^{ ed}_\mathbf{f}\) is dense in \({\mathbb {R}}^n\). If \(\mathbf{f}\) is generic, then \(\deg (\pi )=2\) and the algebraic boundary \(\,\partial _{\mathrm{alg}}{\mathcal {R}}^{ ed}_\mathbf{f}\) consists of n hyperplanes. The topological boundary \(\,\partial {\mathcal {R}}^{ ed}_\mathbf{f} = {\mathbb {R}}^n \backslash {\mathcal {R}}^{ ed}_\mathbf{f}\) is contained in at most two of these n hyperplanes:

  • If \(V_\mathbf{f}\) is an ellipsoid then \(\partial {\mathcal {R}}^{ ed}_\mathbf{f}\) is the relative interior of an ellipsoid in a hyperplane.

  • Otherwise, \(\partial {\mathcal {R}}^{ ed}_\mathbf{f}\) spans two hyperplanes \(H_1, H_2\), and \(\partial {\mathcal {R}}^{ ed}_\mathbf{f} \cap H_i\) is bounded by a quadric.

  • The boundary \(\partial {\mathcal {R}}^{ ed}_\mathbf{f}\) coincides with the cut locus of the quadratic hypersurface \(V_\mathbf{f}\).

Fig. 7
figure 7

The cut locus of a hyperboloid (yellow) lies in two planes. It is the set shown in red and blue. The complement of the cut locus is the SDP-exact region for the ED problem (colour figure online)

The cut locus of a variety V in \({\mathbb {R}}^n\) is defined as the set of all points in \({\mathbb {R}}^n\) that have two nearest points on V. If V is the boundary of a full-dimensional region in \({\mathbb {R}}^n\) then the part of the cut locus that lies inside the region is referred to as the medial axis. In Fig. 7, the blue region is the medial axis. The red region is in the cut locus but not in the medial axis.

For the varieties \(V_\mathbf{f}\) in this paper, the cut locus is always disjoint from the SDP-exact region \({\mathcal {R}}^{ ed}_\mathbf{f}\). If \(m=1\) and \(\mathbf{f}\) is generic then these two disjoint sets cover \({\mathbb {R}}^n\), by Proposition 5.8.

Proof

Proposition 2.7 implies that that \({\mathcal {R}}^{ ed}_\mathbf{f}\) is dense in \({\mathbb {R}}^n\). We drop indices and set \(\,f(x) = x^T A x + 2 a^Tx + \alpha \). Let \(\omega _1<\dots <\omega _n\) be the eigenvalues of A, and let \(v_i\) be the corresponding eigenvectors. We shall assume that \(\omega _1<0<\omega _n\). The master spectrahedron is the interval

$$\begin{aligned} \mathrm{S}^{ ed}_\mathbf{f} \, = \,\{ \lambda \in {\mathbb {R}}\,:\, I_n - \lambda A \succ 0 \} \, =\, (1/\omega _1,1/\omega _m), \end{aligned}$$

and thus \(\partial \mathrm{S}^{ ed}_\mathbf{f} = \{1/\omega _1,1/\omega _n\}\). Let \(\lambda _i = 1/\omega _i\) and \(\psi _i(x):= \psi (x,\lambda _i) = (I_n-\lambda _i A) x - \lambda _i a\). The image of \(\psi _i\) is the hyperplane \(\,H_i \, = \,\{ u \in {\mathbb {R}}^n \, :\, v_i^T u + \lambda _i v_i^T a = 0 \}\). The fiber of \(\psi _i\) over a point \(u \in H_i\) is a line. That line has a parametrization \(\phi _i:{\mathbb {R}}\rightarrow {\mathbb {R}}^n\), \(\,t \mapsto t v_i + b_u\), where \(b_u\) depends linearly on u. Then \(f(\phi _i(t))=0\) is a quadratic equation in t with two solutions. This proves that the morphism \(\pi \) restricts to a 2-to-1 map from \(V_\mathbf{f}\) onto \(H_i\), and thus \(\deg (\pi )= 2\). The boundary \(\partial {\mathcal {R}}^{ ed}_\mathbf{f}\cap H_i\) is given by requiring that both solutions of \(f(\phi _i(t))=0\) are real. This is the solution set to a quadratic discriminantal inequality for \(u \in H_i\). Thus \(\partial {\mathcal {R}}^{ ed}_\mathbf{f} \cap H_i\) is bounded by a quadric for \(i\in \{1,n\}\). Since the Galois group for the n eigenvalues acts transitively, the algebraic boundary is \(\,\partial _{\mathrm{alg}} {\mathcal {R}}^{ ed}_\mathbf{f} = \bigcup _{i=1}^n H_i \). \(\square \)

Remark 5.9

The derivation above leads to a formula for the cut locus of an arbitrary quadratic hypersurface in \({\mathbb {R}}^n\). For the special case of ellipsoids, this was found by Degen [5].

We close this section with the analog to Theorem 5.6 for the problem (Lin) where (1) has linear objective function g. Now the cone \( \mathrm{S}^{ lin}_\mathbf{f}\) on the left of (21) is the master spectrahedron. The linear map (24) gets replaced by \( \psi \,:\, {\mathbb {R}}^n \times {\mathbb {R}}^m \rightarrow {\mathbb {R}}^n, (x,\lambda ) \,\mapsto \, \textstyle \sum _{i=1}^m \lambda _i (a_i + A_i x)\). In contrast to (24), this map is now homogeneous in \(\lambda \). Hence its homogenization equals

$$\begin{aligned} \Psi \,:\, {\mathbb {P}}^n\times {\mathbb {P}}^{m-1}\,\dashrightarrow \, {\mathbb {P}}^{n-1}, \quad \bigl (\,(x_0:x)\, ,\, \lambda \, \bigr )\, \,\mapsto \, \, \sum _{i=1}^m \lambda _i (x_0 a_i + A_i x). \end{aligned}$$

The map \(\Psi \) factors as the Segre embedding \(\sigma \) followed by a linear projection \(\pi \):

$$\begin{aligned} {\mathbb {P}}^n \times {\mathbb {P}}^{m-1} \,\overset{\sigma }{\longrightarrow }\,\, {\mathbb {P}}^{(n+1)m-1} \,\overset{\pi }{\dashrightarrow }\,\, {\mathbb {P}}^{n-1} . \end{aligned}$$

The following result transfers both Proposition 5.1 and Theorem 5.6 to the linear problem.

Theorem 5.10

Let \(\,\mathbf{f}\) be generic and \(m \ge 2\). The algebraic degree of (Lin) equals \(\,2^m \left( {\begin{array}{c}n-1\\ m-1\end{array}}\right) \). The degree of the algebraic boundary \(\,\partial _{\mathrm{alg}} {\mathcal {R}}^{ lin}_\mathbf{f}\,\) of the SPD-exact region equals

$$\begin{aligned} \beta _{ lin}(m,n) \quad =\quad \frac{1}{\deg (\pi )} \cdot 2^{m} n \left( {\begin{array}{c}n-2\\ m-2\end{array}}\right) . \end{aligned}$$
(27)

Proof

The first statement is [16, Theorem 2.2] for \(d_0 =1\) and \(d_1 = \cdots = d_m = 2\). The proof of (27) mirrors the proof of Theorem 5.6, but with m replaced by \(m-1\). The analogue to Corollary 5.4 says that \(\,V_\mathbf{f} \times \partial _{\mathrm{alg}} \mathrm{S}^{ lin}_\mathbf{f} \,\) has dimension \((n-m) + (m-2)\) and degree \(2^m n \left( {\begin{array}{c}n-2\\ m-2\end{array}}\right) \). \(\square \)

Just like in (5.7), we believe that \(\deg (\pi ) = 1\), so that \(\beta _{ lin}(m,n) = 2^m n \left( {\begin{array}{c}n-2\\ m-2\end{array}}\right) \). There are notable differences between (Lin) and (ED). First, it is preferable to assume that \(V_\mathbf{f}\) is compact, so that (1) is always bounded. Second, the SDP-exact region \({\mathcal {R}}^{ lin}_\mathbf{f}\) is a cone in \({\mathbb {R}}^n\), so its algebraic boundary \(\,\partial _{\mathrm{alg}} {\mathcal {R}}^{ lin}_\mathbf{f}\,\) should be thought of as a hypersurface in \({\mathbb {P}}^{n-1}\).

Example 5.11

(\(m=2, n=3\)) Consider the curve shown in the upper right of Fig. 6. After a projective transformation, \(V_\mathbf{f} \subset {\mathbb {R}}^3\) is bounded with two connected components. Its theta body \(\mathrm{TH}_1(\mathbf{f})\) is an intersection of two solid ellipsoids that strictly contains \(\mathrm{conv}(V_\mathbf{f})\). The region \({\mathcal {R}}^{ lin}_\mathbf{f}\) consists of linear functionals whose minimum is the same for the two convex bodies. Its algebraic boundary \(\,\partial _{\mathrm{alg}} {\mathcal {R}}^{ lin}_\mathbf{f}\,\) is an irreducible curve in \({\mathbb {P}}^2\) of degree \(\beta _{ lin}(2,3) = 12\). This is analogous to Fig. 3, where \(n=2\) and \(\partial _{\mathrm{alg}} {\mathcal {R}}^{ lin}_\mathbf{f}\) consists of 8 points on the line \({\mathbb {P}}^1\).

6 Computing spectrahedral shadows

The previous section focused on the case when \(\mathbf{f}\) is generic. We here consider the ED problem for overconstrained systems of quadratic equations. These are important in many applications (e.g., tensor approximation, computer vision). For a concrete example see [6, Example 3.7]. These cases do not exhibit the generic behavior. The degree computed for generic \(\mathbf{f}\) in Theorem 5.6 serves as an upper bound for the corresponding degree when \(\mathbf{f}\) is special.

In this section we discuss the SDP-exact region for the ED problem when the constraints can be arbitrary equations of degree two. We change notation by setting \(m=c+p\) and by considering a variety \(V_\mathbf{f}\) of codimension c in \({\mathbb {R}}^{n}\) that is cut out by \(c+p\) quadratic polynomials \(\mathbf{f} = (f_1,\ldots ,f_{c+p}) \) in \({x} = (x_1,\ldots ,x_n)\). If \(p \ge 1\) then \(V_\mathbf{f}\) is not a complete intersection.

Recall from Theorem 4.1 that \({\mathcal {R}}^{ ed}_\mathbf{f}\) is a union of spectrahedral shadows, one for each point \(x \in V_\mathbf{f}\). Each shadow lies in the c-dimensional affine space through x that is normal to \(V_\mathbf{f}\). Thus \({\mathcal {R}}_\mathbf{f}\) is the union over an \((n-c)\)-dimensional family of c-dimensional spectrahedral shadows. The algebraic boundary \(\partial _{\mathrm{alg}} {\mathcal {R}}^{ ed}_\mathbf{f}\) can be written in a similar way.

By [20, Theorem 1.1], the expected degree of the boundary of each individual shadow is

$$\begin{aligned} \delta (p+1,n,*) \,\,= \,\, \sum _r \delta (p+1,n,r), \end{aligned}$$

where r runs over the Pataki range of possible matrix ranks. A key observation in [20] is that this only depends on the codimension p of the projection and not on the dimension of the spectrahedral shadow. Note that the latter dimension is c for regular points x on \(V_\mathbf{f}\).

We define the expected degree of our SDP-exact boundary \(\,\partial _{\mathrm{alg}} {\mathcal {R}}^{ ed}_\mathbf{f}\, \) to be the product

$$\begin{aligned} \left( {\begin{array}{c}n-1\\ n-c\end{array}}\right) \cdot \deg (V_\mathbf{f}) \cdot \delta ( p+1,n,*) . \end{aligned}$$
(28)

This quantity should be an upper bound for the actual degree of the hypersurface \(\partial _{\mathrm{alg}}({\mathcal {R}}^{ ed}_\mathbf{f})\), and we think that this bound should be attained in situations that are generic enough.

In what follows we present several explicit examples of SDP-exact regions where \(p \ge 1\). We use \(x = (x_1,\ldots ,x_n)\) to denote points on \(V_\mathbf{f}\) and we use \(u = (u_1,\ldots ,u_n)\) for points on \(\partial _{\mathrm{alg}} {\mathcal {R}}^{ed}_\mathbf{f}\). Our discussion elucidates formula (28) and connects it to scenarios seen earlier.

Example 6.1

(\(n=3,c=2,p=0\)) The equations \(f_1= x_2 - x_1^2\) and \(f_2= x_3 - x_1 x_2\) from Example 4.6 cut out the twisted cubic curve \(V_\mathbf{f}\) in \({\mathbb {R}}^3\). The master spectrahedron \(\mathrm{S}^{ ed}_\mathbf{f}\) is the parabola \(\{ \lambda \in {\mathbb {R}}^2 : \lambda _2^2 < 2 \lambda _1 + 1 \}\). The normal plane at the point \(x=(t,t^2,t^3)\) in \(V_\mathbf{f}\) equals

$$\begin{aligned} \bigl \{ \,(u_1,u_2,u_3) \in {\mathbb {R}}^3 \,\,:\,\, u_1 + 2 t u_2 + 3 t^2 u_3 = 3 t^5 + 2 t^3 + t \,\bigr \}. \end{aligned}$$
(29)

Since \(c=0\), the image \({x} - \tfrac{1}{2}\mathrm{Jac}_\mathbf{f}({x}) \cdot \mathrm{S}^{ ed}_\mathbf{f}\) is a parabola in that plane, defined by the equation \(u_3^2 + 2 u_2 - 2 (t^3 - t) u_3 + t^6 - 2 t^4 - 2 t^2 - 1 = 0\). Together with (29) we now have two equations in four unknowns \(t,u_1,u_2,u_3\). By eliminating t from these two polynomials, we obtain

$$\begin{aligned}&64u_2^6u_3^2+16u_1^3u_2^3u_3+408u_1^2u_2^3u_3^2-64u_1u_2^5u_3-96u_1u_2^3u_3^3+128u_2^7-256u_2^5u_3^2\\&\quad -56u_2^3u_3^4+u_1^6-30u_1^5u_3-80u_1^4u_2^2+294u_1^4u_3^2 -416u_1^3u_2^2u_3 \\&\quad -880u_1^3u_3^3 +880u_1^2u_2^4-876u_1^2u_2^2u_3^2-588u_1^2u_3^4+32u_1u_2^4u_3+256u_1u_2^2u_3^3\\&\quad -120u_1u_3^5- 576u_2^6+304u_2^4u_3^2+148u_2^2u_3^4-8u_3^6 +1140u_1^4u_2 \\&\quad -1092u_1^3u_2u_3-2544u_1^2u_2^3- 558 u_1^2u_2u_3^2+192u_1u_2^3u_3-408u_1u_2u_3^3+1088u_2^5\\&\quad -138u_2u_3^4-2670u_1^4-600u_1^3u_3+2832 u_1^2u_2^2+207u_1^2u_3^2 +39u_3^4 \\&\quad -96u_1u_2^2u_3 +120u_1u_3^3-1120u_2^4-228u_2^2u_3^2 -1332u_1^2 u_2-108u_1u_2u_3\\&\quad +680u_2^3+144u_2u_3^2+189u_1^2+54u_1u_3-244u_2^2-27u_3^2+48u_2-4. \end{aligned}$$

This irreducible polynomial of degree 8 defines the SDP-exact boundary \(\partial _{\mathrm{alg}} {\mathcal {R}}^{ ed}_\mathbf{f}\) around \(V_\mathbf{f}\). This surface and the curve \(V_\mathbf{f}\) are shown in the left of Fig. 5. The surface is ruled by the parabolas in the normal bundle of the curve. This ruling is shown on the right in Fig. 5.

Our next example shows that the SDP-exact region is not an invariant of the variety \(V_\mathbf{f}\). It depends on the choice of defining equations. We can have \(\,V_\mathbf{f} = V_\mathbf{f'}\,\) but \(\,{\mathcal {R}}^{ ed}_\mathbf{f} \not = {\mathcal {R}}^{ ed}_{\mathbf{f}'}\).

Example 6.2

(\(n=3,c=2,p=1\)) We continue Example 6.1 and set \(f_3 = x_1x_3-x_2^2\). Then \(\mathbf{f}' = (f_1,f_2,f_3)\) defines the same twisted cubic curve as before. The master spectrahedron \(\mathrm{S}^{ ed}_\mathbf{f'}\) lives in \({\mathbb {R}}^3\) and has degree 3, like the left body in Fig. 2. Planar projections of such an elliptope have expected degree \(\delta (2,3,*) = 6\). Here, the degree drops to 4 because \(\mathrm{S}^{ ed}_{\mathbf{f}'}\) is degenerate: it is singular at only two points (in \({\mathbb {P}}^3\)). The spectrahedral shadow \({x} - \tfrac{1}{2}\mathrm{Jac}_{\mathbf{f}'}({x}) \cdot \mathrm{S}^{ ed}_{\mathbf{f}'}\) around \({x} = (t,t^2,t^3)\) is defined by a quartic curve in the normal plane. The SDP-exact boundary \(\partial _{\mathrm{alg}} {\mathcal {R}}^{ ed}_{\mathbf{f}'}\) is an irreducible surface of degree 9, with defining polynomial

$$\begin{aligned}&5832 u_2^3 u_3^6+27648 u_2^6 u_3^2-62208 u_1 u_2^4 u_3^3-2916 u_1^2 u_2^2 u_3^4+15552 u_2^4 u_3^4-5832 u_1^3 u_3^5\\&\quad +8748 u_1^2 u_3^6-5832 u_2^2 u_3^6-4374 u_1 u_3^7+729 u_3^8-41472 u_1^2 u_2^5\\&\quad +86400 u_1^3 u_2^3 u_3+27648 u_1 u_2^5 u_3+60750 u_1^4 u_2 u_3^2-41472 u_1^2 u_2^3 u_3^2-62208 u_2^5 u_3^2\\&\quad -106920 u_1^3 u_2 u_3^3+85536 u_1 u_2^3 u_3^3+71442 u_1^2 u_2 u_3^4-19656 u_2^3 u_3^4\\&\quad -19440 u_1 u_2 u_3^5+3888 u_2 u_3^6-84375 u_1^6-54000 u_1^4 u_2^2+72576 u_1^2 u_2^4\\&\quad +202500 u_1^5 u_3-19440 u_1^3 u_2^2 u_3-48384 u_1 u_2^4 u_3-220725 u_1^4 u_3^2+6912 u_1^2 u_2^2 u_3^2\\&\quad +58032 u_2^4 u_3^2+140454 u_1^3 u_3^3-35424 u_1 u_2^2 u_3^3-54027 u_1^2 u_3^4+8424 u_2^2 u_3^4\\&\quad +11178 u_1 u_3^5-1161 u_3^6+40050 u_1^4 u_2-50760 u_1^2 u_2^3-21132 u_1^3 u_2 u_3\\&\quad +33840 u_1 u_2^3 u_3+11880 u_1^2 u_2 u_3^2-28744 u_2^3 u_3^2+3708 u_1 u_2 u_3^3-1314 u_2 u_3^4\\&\quad -7431 u_1^4+17736 u_1^2 u_2^2+6112 u_1^3 u_3-11824 u_1 u_2^2 u_3-3246 u_1^2 u_3^2\\&\quad +7976 u_2^2 u_3^2+312 u_1 u_3^3+37 u_3^4-3096 u_1^2 u_2+2064 u_1 u_2 u_3\\&\quad -1176 u_2 u_3^2+216 u_1^2-144 u_1 u_3+72 u_3^2. \end{aligned}$$

The above polynomial is also the defining equation of the cut locus of the twisted cubic curve. In fact, the SDP-exact region \(\,{\mathcal {R}}^{ ed}_{{\mathbf {f}}'}\,\) is dense in \({\mathbb {R}}^3\) and only misses the cut locus. This is similar to the behavior we saw in Proposition 5.8 for quadratic hypersurfaces.

Remark 6.3

Quadratic hypersurfaces and the twisted cubic curve share an important geometric property. They are varieties of minimal degree. Blekherman et al. [2] showed that every non-negative quadratic form on a variety of minimal degree admits a sum-of-squares representation. The converse holds as well. This property implies that \(\,{\mathcal {R}}^{ ed}_{{\mathbf {f}}}\,\) is dense in \({\mathbb {R}}^n\) whenever \(\mathbf{f}\) spans the full system of all quadrics vanishing on such a variety \(V_\mathbf{f}\) in \({\mathbb {R}}^n\).

Our bundle of spectrahedral shadows is interesting even for finite varieties (\(c=n\)). We demonstrate this for point configurations in \({\mathbb {R}}^3\). As we remove points from the eight points in Fig. 4, the algebraic degree increases for the region around each remaining point.

Fig. 8
figure 8

The SDP-exact region for the ED problem on six points in \({\mathbb {R}}^3\) consists of six spectrahedral shadows. Each shadow is the convex hull of a highlighted curve of degree four

Example 6.4

(\(n=3,c=3,p=1\)) Six general points in \({\mathbb {R}}^3\) are cut out by four quadrics, e.g.,

$$\begin{aligned} \mathbf{f} \;=\;&(9 x_1 x_3-5 x_2 x_3-x_3^2+x_3,\, 6 x_2^2-13 x_2 x_3+x_3^2-6 x_2-x_3,\,\\&\quad 2 x_1 x_2-6 x_1 x_3+x_2 x_3+x_3^2-x_3, 6 x_1^2-5 x_2 x_3-x_3^2-6 x_1+x_3), \\ V_\mathbf{f} \;=\;&\left\{ \, (0,0,0)\,,\,(0,0,1)\,,\,(0,1,0)\,,\,(1,0,0)\,,\,(-2,-3,-2)\,,\, \left( -\tfrac{1}{2},-\tfrac{1}{2},-1\right) \, \right\} . \end{aligned}$$

The master spectrahedron \(\mathrm{S}^{ ed}_\mathbf{f}\) has degree \(n=3\) and it lives in \({\mathbb {R}}^4\). It is the convex hull of its rank-one points, which form a rational curve of degree four. By [20, Example 1.3], the projections of \(\mathrm{S}^{ ed}_\mathbf{f}\) into \({\mathbb {R}}^3\) are spectrahedral shadows of degree \(6 = \delta (2,3,*)\), and each shadow is the convex hull of a curve of degree four. Figure 8 illustrates the six shadows. As predicted in (28), the SDP-exact boundary has degree \(1 \cdot 6 \cdot 6 = 36 \).

Fig. 9
figure 9

The SDP-exact region \({\mathcal {R}}^{ ed}_\mathbf{f}\) for five points in \({\mathbb {R}}^3\) consists of five dual elliptopes

Example 6.5

(\(n=3,c=3,p=2\)) Five general points in \({\mathbb {R}}^3\) are cut out by five quadrics, e.g.,

$$\begin{aligned} \mathbf{f}&\;=\; (\, x_2 x_3-x_1,\, x_1 x_3-x_2 x_3+x_1-x_2,\, x_2^2-x_3^2,\, x_1 x_2-x_3,\, x_1^2-x_3^2\,), \\ V_\mathbf{f}&\;=\; \{ (0,0,0),\, ( 1, 1, 1),\, ( 1,-1,-1),\, (-1, 1,-1),\, (-1,-1, 1) \}. \end{aligned}$$

The master spectrahedron \(\mathrm{S}^{ ed}_\mathbf{f}\) lives in \({\mathbb {R}}^5\). It is an affine hyperplane section of the cone of positive semidefinite \(3 \times 3\) matrices. Its projections into \({\mathbb {R}}^3\) look like the dual elliptope in Fig. 2. Such a spectrahedral shadow has degree \(\delta (3,3,*) = 4+4\), as seen in the left box of the \(p=2\) row in [20, Table 1]. Its boundary is given by four planes and a quartic surface.

Thus the SDP-exact region \({\mathcal {R}}^{ ed}_\mathbf{f}\) consists of five dual elliptopes, as seen in Fig. 9. They touch pairwise along their circular facets. For instance, the region around (0, 0, 0) is bounded by the planes \(\{2 u_1+2 u_2-2 u_3=-3\}\), \(\{2 u_1-2 u_2+2 u_3=-3\}\), \(\{2 u_1-2 u_2-2 u_3=3\}\), \(\{2 u_1+2 u_2+2 u_3=3\}\), and the quartic Steiner surface\( \{u_1^2 u_2^2+u_1^2 u_3^2+u_2^2 u_3^2+3 u_1 u_2 u_3 = 0\}\). Again, the prediction in (28) is correct, since the boundary of \({\mathcal {R}}^{ ed}_\mathbf{f}\) has degree \(1 \cdot 5 \cdot (4+4) = 40 \).

The algebraic computation of projections of spectrahedra is very hard (cf. [20, Remark 2.3]). In our situation, it is even harder, since we are dealing with a family of varying projections, one for each point x in the variety \(V_\mathbf{f}\). We demonstrate this in Algorithm 1.

Examples 6.2 and 6.4 were computed with Algorithm 1 as is. This works because \(V_\mathbf{f}\) is smooth in both of these cases. If \(V_\mathbf{f}\) is singular then we must saturate the ideal given in step 5 with respect to the ideal of \(c \times c\) minors of \(\mathrm{Jac}_\mathbf{f}({x})\) prior to the elimination in step 6.

figure a

Algorithm 1 can be modified to also work when \(p \ge 2\) but the details are subtle. The polynomial \(h(\lambda )\) gets replaced by the ideal of \((c+2-p) \times (c+2-p)\) minors of the matrix \(\mathrm{H}(\lambda )\), and the first row \(\nabla _\lambda (h)\) in the augmented Jacobian in step 4 gets replaced by the Jacobian matrix of that determinantal ideal. This requires great care since these matrices are large.

Remark 6.6

It would be interesting to study the tangency behavior of the spectrahedral shadows in our bundles. For instance, pairs of convex bodies meet in a point in Fig. 4, they meet in a line segment in Fig. 8, and they meet in a common circular facet in Fig. 9.