The Geometry of SDP-Exactness in Quadratic Optimization

Consider the problem of minimizing a quadratic objective subject to quadratic equations. We study the semialgebraic region of objective functions for which this problem is solved by its semidefinite relaxation. For the Euclidean distance problem, this is a bundle of spectrahedral shadows surrounding the given variety. We characterize the algebraic boundary of this region and we derive a formula for its degree.


Introduction
We study a family of quadratic optimization problems with varying cost function: min x∈R n g(x) subject to f 1 (x) = f 2 (x) = · · · = f m (x) = 0, (1) where f = (f 1 , . . . , f m ) is a fixed tuple of elements in the space R[x] ≤2 R ( n+2 2 ) of polynomials of degree two in x = (x 1 , . . . , x n ). The problem (1) is hard, but semidefinite programming (SDP) offers a tractable approach. Indeed, there is a hierarchy of SDP relaxations of (1); see, e.g., [1,12,13]. In this paper we focus on the first and simplest of these relaxations, also known as Shor relaxation [18]. We are interested in the set defined by the Shor relaxation: : the problem (1) is solved exactly by its SDP relaxation .
We call R f the SDP-exact region of the tuple f = (f 1 , . . . , f m ). We will slightly change this definition in Section 3 by further imposing strict complementarity. This will lead to an explicit description of R f as a semialgebraic set in R[x] ≤2 R ( n+2 2 ) . We refer to Definition 3.2. The quadratic cost function that motivated this article is the squared distance to a given point u ∈ R n . In symbols, g u (x) = ||x − u|| 2 . Here (1) is the Euclidean Distance (ED) problem (cf. [5]) for the variety V f = {x ∈ R n : f 1 (x) = · · · = f m (x) = 0}. By restricting R f to the space of cost functions g u , we obtain a semialgebraic set in R n . This is the SDP-exact region for the ED problem, denoted R ed f , which was investigated in [3]. Example 1.1 (ED problem for m = n = 2). The variety V f consists of four points in R 2 . We seek the point in V f that is closest to a given point u = (u 1 , u 2 ). The Voronoi decomposition of R 2 characterizes the solution. The SDP-exact region R ed f consists of four disjoint convex sets, one for each point in V f . The convex sets are bounded by conics, and are contained in the Voronoi cells of the points. Figure 1 illustrates R ed f for two configuration of points in 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., [7,10,11]. Example 1.2 (Max-Cut Problem). Let m = n and f i (x) = x 2 i − 1, so V 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) = i,j c ij x i x j where C = (c ij ) is a symmetric n×n matrix with c 11 = · · · = c nn = 0. Note that these objective functions live in a subspace of dimension n 2 in R[x] ≤2 . The dual solution in the SDP relaxation is the Laplacian The SDP-exact region R f consists of 2 n−1 spectrahedral cones in R ( n 2 ) , each isomorphic to the set of matrices C = (c ij ) such that 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) × (n−1) principal minor of 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 R f is a (reducible) hypersurface of degree (n−1)2 n−1 .
The region R f is the set of directions C whose minimum over the elliptope is attained in 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 Figure 2, next to the yellow elliptope. Thus R 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 Figure 1. The algebraic boundary of R 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 R n . We undertake a detailed study of R f and its topological boundary ∂R f . We define the algebraic boundary ∂ alg R f to be the Zariski closure of ∂R 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 Section 2 we introduce the rank-one region of a general semidefinite programming problem. Building on the theory developed in [16], we compute the degree of the algebraic boundary of this semialgebraic set.
In Section 3 we turn to the quadratic program (1). We introduce its SDP relaxation, and show that R f coincides with the rank-one region of that relaxation. In Theorem 3.5 we determine the degree of ∂ alg R f under the assumption that f 1 , . . . , 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 R n as bundles of spectrahedral shadows. Each shadow lies in the normal space at a point on V f , and is the linear image of a master spectrahedron that depends only on f . For linear g, the region R lin f is determined by the theta body of Gouveia et al. [8]; see Proposition 4.7. For the ED problem, R ed f is a tubular neighborhood of the variety V f . Figure 1 showed this when V f consists of four points in R 2 . Analogs in R 3 are depicted in Figures 4,8,9 (for points) and Figures 5, 6 (for curves).
In Section 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 ∂ alg R ed f when V 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 f . The abelian surface in Example 5.2 serves as a nice illustration. Section 6 addresses the ED problem when 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 Figure 2 reappears in five copies in Figure 9.

The Rank-One Region in Semidefinite Programming
Consider a family of semidefinite programming problems with varying cost function: . . , l, and X 0.
Here C • X = trace(CX) is the usual inner product on the space S d R ( d+1 2 ) of symmetric d × d matrices. The numbers b 1 , . . . , b l ∈ R and the matrices A 1 , . . . , A l ∈ S d are fixed in (2), whereas the cost matrix C varies freely over S d . The rank-one region R A,b is a semialgebraic subset of S d that depends on A = (A 1 , . . . , A l ) and b = (b 1 , . . . , b l ). It consists of all matrices 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 R A,b and its boundary. The methods introduced here will be later used in Section 3 to study the SDP-exact region R f .
The feasible set of (2) is the spectrahedron Σ A,b = X∈S d : X 0, A i •X=b i for 1≤i≤l . We assume that Σ A,b is non-empty and does not contain the zero matrix. Then the region R A,b is the union of all normal cones at extreme points of rank one in the boundary of Σ A,b . 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 2.1 (d = l = 3). The convex bodies in Figure 2 arise for Max-Cut with n = 3 in Example 1.2. The spectrahedron Σ 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 ∂Σ 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 R A,b is given by the interiors of these four circles, viewed as cones in S 3 .
The semidefinite program that is dual to (2) has the form: The following critical equations express the complementary slackness condition that links the optimal solution X 0 of the primal (2) and the optimal solution Y 0 of the dual (3): Recall that strict complementarity holds if rank(X)+rank(Y ) = d. The rank-one region is the semialgebraic set given by the critical equations and strict complementarity, as follows: The rank-one region R A,b is the set of all C ∈ S d for which there exist λ ∈ R l and X, Y ∈ S d such that X, Y 0, rank(X) = 1, 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 A i and the vector b. This implies that the results hold for "almost all" instances of (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 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. [16, §2]. That degree, denoted δ(l, d, r), is the number of complex solutions (X, Y ) of the critical equations (4) for the SDP (2), with l constraints for d × d matrices, assuming that rank(X) = d − r and rank(Y ) = r. A formula for general r was given in [6]. The easier case r = d − 1 appeared in [16,Theorem 11]: Proposition 2.4. The algebraic degree of rank-one solutions X to the SDP in (2) equals δ(l, d, d − 1) = 2 l−1 d l .
The following geometric formulation of SDP was proposed in [16, eqn. (4.1)]. Let V be the (l − 1)-dimensional subspace of S d spanned by {A 2 , . . . , A l }, and let U be the (l + 1)dimensional subspace of S d spanned by {C, A 1 } and V. This specifies a dual pair of flags See [16, eqn. (3.3)]. The critical equations (4) can now be written as X ∈ V ⊥ and Y ∈ U and X · Y = 0.
The SDP problem (2) is equivalent to solving (6) subject to X, Y 0. The algebraic degree δ(l, d, r) is the number of complex solutions to (6) with rank(X) = d − r and 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 A i and the scalars b i are generic then strict complementarity always holds [16,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.
These conditions characterize the set of cost matrices C that lie in the rank-one region R A,b .
Suppose that the rank-one region R A,b is non-empty. The topological boundary ∂R A,b is a closed semialgebraic set of pure codimension one in S d . Its Zariski closure ∂ alg R A,b is an algebraic hypersurface, called the rank-one boundary. We view this hypersurface either in the complex affine space C ( d+1 2 ) , or in the corresponding projective space P(S d ) P ( d+1 2 )−1 .
By construction, the polynomial defining ∂ alg R A,b has coefficients in the field generated by the entries of A and b over Q. The rank-one boundary degree is the degree of this polynomial: Our main result in this section furnishes a formula for the degree of the rank-one boundary.
Theorem 2.6. Let 3 ≤ l ≤ d and consider the SDP with generic A and b, as given in (2). The degree of the hypersurface ∂ alg R A,b that bounds the rank-one region R A,b equals Algebraic degrees δ(l, d, d − 1)  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 left, and corresponding rank-one boundary degrees on the right. The entry for l = d = 3 equals 8 = 2+2+2+2, as argued in Example 2.1 and seen in Figure 2. The first row (l = 2) is not covered by Theorem 2.6. This case requires special consideration.
3 . Proof. The semialgebraic set R A,b is dense in the classical topology on S d because the Pataki range [16, §3] consists of a single rank for l = 2. This means that, for almost all cost matrices C, there is an optimal pair (X, Y ) that satisfies rank(X) = 1 and rank . This variety has codimension three in P(S d ) and degree d+1 3 (see [9,Prop. 12(b)]). This is the degree of the Chow form in the entries of C, and hence it is the degree of our hypersurface ∂ alg R A,b .
The proof of Theorem 2.6 requires additional concepts from algebraic geometry. We work with the Veronese variety P d−1 → P(S d ). By [16,Proposition 12], its conormal variety is Its coefficients are the polar degrees of the Veronese variety. By Proposition 2.4, we have We represent CV by its pullback under the Veronese map x → X = xx T on the first factor. Thus the conormal variety equals We note that the following boundary variety is irreducible of codimension one in CV : By the last item in Remark 2.5, the algebraic boundary of Proof of Theorem 2.6. Let C = (c ij ) denote the adjugate of Y . The entry c ij of this d × d matrix is the (d−1) × (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 2 1 = 0. To prove this claim, we consider the ideals I := I CV + c 11 and J := I CV +Min d−1 (Y )· x 2 1 in T . It suffices to show I = sat(J), the saturation with respect to Combining two of its generators, we find c ij x 2 1 − c 11 x i x j ∈ M . Therefore the generator c ij x 2 1 of J lies in M + c 11 ⊂ I. So J ⊆ I, and since I is saturated, sat(J) ⊆ I. For the reverse inclusion we need to show that c 11 ∈ sat(J). This follows by noting that c 11 x 2 k − c kk x 2 1 ∈ M , and thus Therefore, I = 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 P(S d ), so its class is (d − 1)t. The class of {x 2 1 = 0} is twice the hyperplane class in P d−1 . It is the pullback of [{x 11 = 0}] = s under the Veronese map into P(S d ). Here x 11 is the upper left entry in the matrix X = xx T . We multiply these classes with [CV ] as in (10), and thereafter we subtract. By the claim we proved, this gives 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 C travels on a generic line in S d from the inside to the outside of the rank-one region R A,b . For almost all points C on that line, the optimal pair (X, Y ) is unique. Before C crosses the boundary ∂R A,b , the optimal pair satisfies rank(X) = 1 and rank(Y ) = d − 1. Immediately after C crosses ∂R A,b , we have rank(X) = 2 and rank(Y ) = d − 2. At the transition point, the optimal pair (X, Y ) lies in the variety BV .
Consider the intersection of BV with the product of the codimension-(l − 1) plane P(V ⊥ ) and the subspace P(U ) P l+1 spanned by A 1 , . . . , A l and the line on which C travels. The points in that intersection are the pairs (X, Y ) ∈ BV that arise as C travels along the line. The number of such complex intersection points is the coefficient of . We need to argue that the inclusion (5) poses no restriction on the products of subspaces we intersect with, i.e., for generic flags V ⊂ U with dim(U /V) = 3, all intersections with BV are transverse and reduced. To this end, let X 0 be the rank-one d × d matrix with a single one in the first entry, and let Y 0 be the diagonal d × d matrix with two zeros followed by d − 2 ones. Then an affine neighborhood of (X 0 , Y 0 ) in P(S d ) × P(S d ) can be given as the direct sum of the spaces parametrized by The linear terms in the coordinates of the matrix equation XY = 0 are y 11 , y 12 , x 13 + y 13 , . . . , x 1,d + y 1,d and x 23 , . . . , x d,d , for a total of d+1 2 − 1 forms. To show that the intersection described above is transverse for generic flags V ⊂ U , it suffices to find one instance for which Let P(V ⊥ ) be determined by the vanishing of the l − 1 forms x 12 , . . . , x 1 l−1 , x 22 − x 23 and P(U ) by the d+1 2 −l forms y 1,l , . . . , y 1,d , y 22 +y 23 , y 23 , . . . , y d−1,d . Combining these forms with those in (12), we get 2( d+1 2 − 1) independent linear forms. This (highly non-generic) choice yields a transverse intersection. We conclude that the intersection BV ∩ (P(V ⊥ ) × P(U )) is transverse and reduced at (X 0 , Y 0 ) also for generic choices of V ⊂ U .

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 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: (13) Setting b = (1, 0, . . . , 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 To apply SDP to the problem (1), with m quadratic constraints in n variables, we set The matrices C, A i ∈ S n , the vectors c, a i ∈ R n , and the scalars α i ∈ R, give the entries in If we now also set X = 1 (1) is precisely the SDP (2). In other words, (1) is equivalent to (2) with the additional constraint 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 A 0 is the rank-one matrix E 00 , and we fix the values b 0 =1, c 00 =b 1 = · · · =b m =0. The last m + 1 equations pose no restriction: they can be achieved by adding multiples of A 0 to C, A 1 , . . . , A m . The only truly special feature of this SDP is that A 0 has rank one.
Remark 3.1. The Shor relaxation of a quadratic optimization problem in R n is a semidefinite program in S n+1 in which one constraint matrix 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 This polynomial is quadratic in x. Its Hessian with respect to x is the symmetric n×n matrix The entries of the matrix H(λ) are affine-linear in λ = (λ 1 , . . . , λ m ). The SDP-exact region is obtained by specializing Definition 2.2 to the matrices in (14): The SDP-exact region R f is the set of all matrices C ∈ S n+1 such that 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 R f as a union of spectrahedral shadows [17,19]. To see this, fix a point x in V f . The constraints (17) define a spectrahedron S x in the space with coordinates (λ, C, c). The SDP-exact region for x is the image of S x under the projection onto the coordinates (C, c). This image is a spectrahedral shadow. Definition 3.2 says that R 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 = n+2 2 − 1 and consider the map π : P N × P N P N × P N −1 that deletes the upper left entry y 00 of the matrix Y . Let CV = π(CV ) denote the closed image of the conormal variety CV in (8) under the map π, and similarly let BV = π(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 * (P N ×P N −1 ). We have Similarly, the degree of ∂ alg R f is given by the class of the projected boundary variety BV .
Proof. The map π is the projection from the special point A 0 = E 00 in 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 A 0 . Thus, our counting problem is equivalent to intersecting the projections via π by products of generic linear spaces of complementary dimension. The formula in (18) is the algebraic degree of quadratic programming, which is found in [15, eqn.  The algebraic boundary of the SDP-exact region R f is a hypersurface whose degree equals 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 β QP (n, n) = 2 n · 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 Section 2, but now the ambient ring is T = C[y 00 , y 01 , . . . , y nn , x 0 , . . . , 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 = Min n Y ) + Y x be the ideal generated by the n+2 2 minors of Y of size n and the n + 1 entries of vector Y x.
Proof. It is well-known in commutative algebra that the n × 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Ỹ whereỸ 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, . . . , n, n+1}. The columns ofỸ are all such circuits. These are formed by applying Cramer's rule to submatrices of Y with row indices 0, . . . , t − 1 and t + 1 arbitrary columns. The resulting entries of x TỸ 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.
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 Y x 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 .
Proof of Theorem 3.5. Let N = n+2 2 − 1. As in the proof of Theorem 2.6, we identify CV with its preimage in P n × P N , that is, CV = {(x, Y ) | Y x = 0, rank(Y ) ≤ n}. Its image CV under π lives in P n × P N −1 . The boundary BV is the projection of BV into P n × 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 2 0 = 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 P n . Using (18), this implies The coefficients β 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 + c 00 and J := I CV + C · x 0 . We claim that I = sat(J ). Observe that the (n+1)×2 matrix x | C satisfies Min 2 x | C ⊂ I CV . This implies c 0j x 0 ∈ J for all j ≥ 1. Then J ⊆ I and since I is saturated, sat(J ) ⊆ I . The reverse inclusion is implied by c 00 ∈ sat(J ), which follows from the fact that c 00 x j ∈ Min 2 x | C + C · x 0 . By Corollary 3.7, the elimination ideal is I BV = I CV + C . So we may conclude that CV ∩ {c 00 } = BV ∪ (CV ∩ {x 0 = 0}).

Bundles of Spectrahedral Shadows
We fix f = (f 1 , . . . , f m ) as before. For any u ∈ R n we consider the following two problems: These problems are special instances of the quadratic program (1), with the cost matrices We write R lin f and R ed f for the SDP-exact regions in R n of these two problems. They are the intersections of R f with the affine subspaces of S n+1 given in (20). The punchline of this section is that both regions are normal bundles of spectrahedral shadows over V f . Namely, we shall write R lin f and R ed f as a union of spectrahedral shadows, one for each point x ∈ V f . The lower right block of C lin and C ed is independent of u, and thus the Hessian matrix H(λ) is independent of u. The spectrahedron defined by the constraint H(λ) 0 is as follows: The sets in (21) are called master spectrahedra. Observe that S lin f is a cone in R m . Also note that S ed f is full-dimensional because λ = (0, . . . , 0) is an interior point. Let Jac f denote the Jacobian matrix of f . This matrix has format n × m, and its entry in row i and column j is the linear polynomial ∂f j /∂x i . At any point x ∈ V f , the specialized Jacobian matrix Jac f (x) defines a linear map R m → R n , whose range is the normal space of the variety V f at x. We consider all the images of the respective master spectrahedra under these linear maps.
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.
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.  The spectrahedral cones in R lin f are tightly connected to the first theta body of f , denoted TH 1 (f ), introduced by Gouveia et al. in [8]. The theta bodies of f are tractable approximations to the convex hull of V f , whose construction relies on the Lasserre hierarchy [1,12,13]. Later in this section we will show that R lin f consists of the normal cones of TH 1 (f ).
Example 4.4 (m = n = 2). Consider two quadrics in two variables such that V f consists of four points in convex position in R 2 . The region R ed f was illustrated in Figure 1. The region R lin f consists of four cones that sit inside the normal cones at the quadrilateral conv(V f ). We explain this for the specific instance examined in [8,Example 5.6]: The first theta body TH 1 (f ) is seen in [8, Figure 3]. Our rendition in Figure 3 show also the SDP-exact region R lin f . It consists of the normal cones of TH 1 (f ) at the four points in V f . For more details see Proposition 4.7.
It is interesting to examine Corollary 4.3 (b) when m = n and V f consists of 2 n real points. We know that R ed 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 Figure 1, whereas the case n = 3 is shown in Figure 4. For x ∈ V f , we set S x = x − 1 2 Jac f (x) · S ed f and we write ∂ alg S x for its algebraic boundary.
Theorem 4.5. Let m = n and f generic, so V f is finite. Let x, x ∈ V f , and S x , S x be the corresponding spectrahedra, and let bsc ⊂ R n be the bisector hyperplane of x and x . There is a point u ∈ R n at which the three hypersurfaces bsc, ∂ alg S x and ∂ alg S x meet tangentially.
Proof. Let p(λ) := det(I n − i λ i A i ) be the defining polynomial of ∂ alg S ed f . Then p x (u) := p(2 Jac f (x) −1 u − x) is the defining polynomial of ∂ alg S x . We shall construct a point u x in the hypersurface ∂ alg S x whose normal vector ∇ u p x (u x ) is parallel to x − x . Notice that where M denotes the adjugate of I n − i λ i A i . Since this matrix is supposed to be singular, 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 The desired vector λ is then determined by the equation holds, and the point u x = x − 1 2 Jac f (x)(λ) has its normal at ∂ alg S x parallel to x − x. We similarly construct u x ∈ ∂ alg S x . By (23), we have ( 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 bsc.
We see that u x is equidistant from x and x , i.e., u x belongs to the hyperplane bsc. We have shown that our three hypersurfaces all pass through u x and have the same normal vector.
We next illustrate how the normal bundle from Theorem 4.1 looks for a curve.
, so V f is the twisted cubic curve in R 3 . This specific instance was examined in [3, Example 1.1]. The spectrahedron S ed f is the interior of a parabola, namely {λ 2 2 < 2λ 1 + 1}. The image x − 1 2 Jac f (x) · S ed f is a parabola in the normal plane at x. The boundary ∂R ed f is the union of all these parabolas, as shown in Figure 5. We will elaborate more on the ED problem in Section 5. To conclude this section, we briefly develop the connection between our SDP-exact region R lin f and the theory of theta bodies [8]. By [8,Lemma 5.2], the first theta body of our instance f is By [8, §2], the set TH 1 (f ) is a spectrahedral shadow that contains the convex hull of V f .  By definition, this set is the SDP-exact region for (Lin). For an illustration see Figure 3.

Boundary Hypersurfaces in R n
We now examine our degrees of the ED problem. Following [5], the Euclidean distance degree of V f , denoted EDdegree(V f ), counts the number of complex critical points for the squared distance function g u (x) = x − u 2 on the variety V f , where u ∈ R n is a generic point.
Proposition 5.1. The algebraic degree of the quadratic program (1) that solves the ED problem for V f is EDdegree(V f ). This is bounded above by 2 m n m . Equality holds for generic f . Proof. The first statement is immediate from the definition of the ED degree. The last two statements follow from [5, Proposition 2.6]. We next assume that f is generic. Hence V f is a generic complete intersection. We are interested in the degree β ED (m, n) of the hypersurface ∂ alg R ed f ⊂ R n that bounds the SDP-exact region for the ED problem. Table 3 shows β ED (m, n) for some small cases.
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 Figure 6). The variety V f is a space curve of degree 4, obtained by intersecting two hyperboloids (upper right in Figure 6). We regard both curves as elliptic curves, the first in P 2 and the second in P 3 . The product of these two elliptic curves is an abelian surface, which has degree 24 under its Segre embedding into P 2 × P 3 ⊂ P 11 . Our boundary surface ∂ alg R ed f is a projection of this surface into P 3 . This explains β ED (2, 3) = 24. The picture on the left in Figure 6 shows ∂R ed f in real affine space R 3 . Each of the three connected components of the curve V f is surrounded by one color-coded component of that surface. These three pieces of ∂R ed 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 · 4 · 1+1 1 = 24. We consider the product of our feasible set V f with the algebraic boundary of its master spectrahedron S ed f . This is the real algebraic variety  Table 3: Algebraic degrees and boundary degrees for the ED problem.
this variety with its Zariski closure in the product of complex projective spaces P n × P m . Under the Segre map, we embed V f × ∂ alg S ed f as a projective variety in P (m+1)(n+1)−1 .
The map ψ is bilinear. We consider its homogenization This map factors as the Segre embedding σ followed by a linear projection π: Lemma 5.5. The restriction of π to (the image under σ of ) V f × ∂ alg S ed f is base-point free.
Proof. We show that L ∩ σ(V f × ∂ alg S ed f ) = ∅, where L ⊂ P (n+1)(m+1)−1 is the base locus of π. By (25), we know that L is contained in {λ 0 x 0 = 0}. First, assume λ 0 = 0 and x 0 = 1. The equations from (25) simplify to m i=1 λ i (a i + A i x) = 0, which means Jac f (x)λ = 0. But this is impossible because Jac f (x) has full rank, by genericity of f . Consider now the case x 0 = 0. We may assume that m < n, as otherwise V f does not intersect {x 0 = 0}. Setting the image in (25) to zero, we get λ 0 x − m i=1 λ i (A i x) = 0. Viewed as a system of linear equations in λ 0 , λ 1 , . . . , λ m , this is overconstrained, so by genericity it has no nonzero solution.
We now write π for the restriction to V f × ∂ alg S ed f . Lemma 5.5 and the dimension part in Corollary 5.4 show that π is a dimension-preserving morphism onto ∂ alg R ed f . The degree of this morphism, denoted deg(π), is the cardinality of the fiber of π over a generic point in the image. By [14,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 ∂ alg R ed f of the SPD-exact region is · m 2 m n m .
We conjecture that deg(π) = 1 whenever our variety V f is not a hypersurface, i.e., whenever m ≥ 2. This was verified computationally in all cases that are reported in Table 3.
Conjecture 5.7. If m ≥ 2 then the degree in Theorem 5.6 is β ED (m, n) = m 2 m n m . 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 R ed f is dense in R n . If f is generic, then deg(π) = 2 and the algebraic boundary ∂ alg R ed f consists of n hyperplanes. The topological boundary ∂R ed f = R n \R ed f is contained in at most two of these n hyperplanes: • If V f is an ellipsoid then ∂R ed f is the relative interior of an ellipsoid in a hyperplane.
• Otherwise, ∂R ed f spans two hyperplanes H 1 , H 2 , and ∂R ed f ∩H i is bounded by a quadric.
• The boundary ∂R ed f coincides with the cut locus of the quadratic hypersurface V f . The cut locus of a variety V in R n is defined as the set of all points in R n that have two nearest points on V . If V is the boundary of a full-dimensional region in R n then the part of the cut locus that lies inside the region is referred to as the medial axis. In Figure 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 f in this paper, the cut locus is always disjoint from the SDP-exact region R ed f . If m = 1 and f is generic then these two disjoint sets cover R n , by Proposition 5.8.
Proof. Proposition 2.7 implies that that R ed f is dense in R n . We drop indices and set f (x) = x T Ax + 2a T x + α. Let ω 1 < · · · < ω n be the eigenvalues of A, and let v i be the corresponding eigenvectors. We shall assume that ω 1 < 0 < ω n . The master spectrahedron is the interval and thus ∂S ed The fiber of ψ i over a point u ∈ H i is a line. That line has a parametrization φ i : R → R n , t → tv i + b u , where b u depends linearly on u. Then f (φ i (t)) = 0 is a quadratic equation in t with two solutions. This proves that the morphism π restricts to a 2-to-1 map from V f onto H i , and thus deg(π) = 2. The boundary ∂R ed f ∩ H i is given by requiring that both solutions of f (φ i (t)) = 0 are real. This is the solution set to a quadratic discriminantal inequality for u ∈ H i . Thus ∂R ed f ∩ H i is bounded by a quadric for i ∈ {1, n}. Since the Galois group for the n eigenvalues acts transitively, the algebraic boundary is ∂ alg R ed Remark 5.9. The derivation above leads to a formula for the cut locus of an arbitrary quadratic hypersurface in R n . For the special case of ellipsoids, this was found by Degen [4].
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 S lin f on the left of (21) is the master spectrahedron. The linear map (24) gets replaced by ψ : In contrast to (24), this map is now homogeneous in λ. Hence its homogenization equals Ψ : P n × P m−1 P n−1 , The map Ψ factors as the Segre embedding σ followed by a linear projection π: The following result transfers both Proposition 5.1 and Theorem 5.6 to the linear problem. Just like in Conjecture 5.7, we believe that deg(π) = 1, so that β lin (m, n) = 2 m n n−2 m−2 . There are notable differences between (Lin) and (ED). First, it is preferable to assume that V f is compact, so that (1) is always bounded. Second, the SDP-exact region R lin f is a cone in R n , so its algebraic boundary ∂ alg R lin f should be thought of as a hypersurface in P n−1 . Figure 8: The SDP-exact region for the ED problem on six points in R 3 consists of six spectrahedral shadows. Each shadow is the convex hull of a highlighted curve of degree four.
The master spectrahedron S ed f has degree n = 3 and it lives in R 4 . It is the convex hull of its rank-one points, which form a rational curve of degree four. By [19,Example 1.3], the projections of S ed f into R 3 are spectrahedral shadows of degree 6 = δ(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 · 6 · 6 = 36. Example 6.5 (n=3, c=3, p=2). Five general points in R 3 are cut out by five quadrics, e.g., The master spectrahedron S ed f lives in R 5 . It is an affine hyperplane section of the cone of positive semidefinite 3 × 3 matrices. Its projections into R 3 look like the dual elliptope in Figure 2. Such a spectrahedral shadow has degree δ(3, 3, * ) = 4 + 4, as seen in the left box of the p = 2 row in [19, Table 1]. Its boundary is given by four planes and a quartic surface.
Thus the SDP-exact region R ed f consists of five dual elliptopes, as seen in Figure 9. They touch pairwise along their circular facets. For instance, the region around (0, 0, 0) is bounded by the planes {2u 1 + 2u 2 − 2u 3 = −3}, {2u 1 − 2u 2 + 2u 3 = −3}, {2u 1 − 2u 2 − 2u 3 = 3}, {2u 1 + 2u 2 + 2u 3 = 3}, and the quartic Steiner surface {u 2 1 u 2 2 + u 2 1 u 2 3 + u 2 2 u 2 3 + 3u 1 u 2 u 3 = 0}. Again, the prediction in (28) is correct, since the boundary of R ed f has degree 1·5·(4+4) = 40. The algebraic computation of projections of spectrahedra is very hard (cf. [19,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 f . We demonstrate this in Algorithm 1. Examples 6.2 and 6.4 were computed with Algorithm 1 as is. This works because V f is smooth in both of these cases. If V f is singular then we must saturate the ideal given in step 5 with respect to the ideal of c × c minors of Jac f (x) prior to the elimination in step 6.
Algorithm 1 can be modified to also work when p ≥ 2 but the details are subtle. The polynomial h(λ) gets replaced by the ideal of (c+2−p) × (c+2−p) minors of the matrix H(λ), and the first row ∇ λ (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 Figure 4, they meet in a line segment in Figure 8, and they meet in a common circular facet in Figure 9.