Bad Projections of the PSD Cone

The image of the cone of positive semidefinite matrices under a linear map is a convex cone. Pataki characterized the set of linear maps for which that image is not closed. The Zariski closure of this set is a hypersurface in the Grassmannian. Its components are the coisotropic hypersurfaces of symmetric determinantal varieties. We develop the convex algebraic geometry of such bad projections, with focus on explicit computations.


Introduction
Real symmetric n × n matrices are identified with quadratic forms on R n , and they form a vector space S n of dimension n+1 2 . We write S n + for the subset of quadratic forms that are nonnegative on R n . This is a full-dimensional closed semialgebraic convex cone in S n , known as the PSD cone. Its elements are identified with positive semidefinite matrices. The PSD cone is self-dual with respect to the trace inner product A • B := trace(AB) for A, B ∈ S n .
Given any linear subspace L of S n , we consider the linear projection π L : S n → L ∨ that is dual to the inclusion L ⊂ S n . Here, L ∨ = Hom(L, R) denotes the vector space dual of L. We are interested in the image π L (S n + ) of the PSD cone under this map. These objects can be written in coordinates as follows. If {A 1 , A 2 , . . . , A k } ⊂ S n is a basis of L then our map is π L : S n → R k , X → A 1 • X, A 2 • X, . . . , A k • X . (1) While the PSD cone S n + is closed in S n , its image under the map π L is not always closed. Example 1. Fix n = k = 2. Let L be the linear space spanned by the two quadratic forms q 1 = x 2 1 and q 2 = 2x 1 x 2 . The symmetric matrices that represent these quadratic forms are The linear map π L projects the 3-dimensional space S 2 into the plane R 2 via X = x 11 x 12 The image of the closed PSD cone S 2 + under this map into R 2 is not closed. We find that π L (S 2 + ) = (z 1 , z 2 ) ∈ R 2 : z 1 > 0 or z 1 = z 2 = 0 .
The failure of the image to be closed reflects the fact that strong duality can fail in semidefinite programming (SDP). A thorough study of this phenomenon was undertaken by Pataki in [12,15,16,17]. Basics on SDP and its algebraic aspects can be found in [1,Chapter 1] and [13,Chapter 12]. Our subspace L plays the role of an instance of SDP, as in [13,Corollary 12.12]. Using the adjective proposed in [16], the subspace L is called bad if π L (S n + ) is not closed. But, just like in slang usage, "bad" can also mean "good". Pataki derives a characterization, and he concludes that bad semidefinite programs all look the same [16].
The aim of this paper is to examine this phenomenon through the lens of algebraic geometry. The assertion of [16] that all bad instances "look the same" refers to the natural action of the group GL(n) × GL(k) on the domain and range of our map π L in (1). Pataki describes normal forms of bad instances L with respect to that action, to be reviewed in Section 2. We are here interested in the geometry of the locus of all bad instances, that is, the orbits of Pataki's normal forms under GL(n) × GL(k). We pass to the Zariski closure, and study the corresponding complex projective variety. The following example is meant to illustrate how our perspective builds on and differs from that developed in [12,15,16,17] Example 2. Fix n = k = 2 and let L be a general subspace in S 2 . We denote its basis by q 1 = a 11 x 2 1 + 2a 12 x 1 x 2 + a 13 x 2 2 and q 2 = b 11 x 2 2 + 2b 12 The nature of the cone π L (S 2 + ) is determined by the resultant of these two binary quadrics: Our theory in Section 3 implies that π L (S 2 + ) is not closed in R 2 if and only if R = 0. Furthermore, if R > 0 then π(S 2 + ) is a closed pointed cone. Yet, if R < 0 then π(S 2 + ) = R 2 . If R > 0 then L is spanned by two squares, γ 1 q 1 + γ 2 q 2 = (u 1 x 1 + u 2 x 2 ) 2 and δ 1 q 1 + δ 2 q 2 = (v 1 x 1 + v 1 x 2 ) 2 , and we have π(S 2 + ) = (z 1 , z 2 ) ∈ R 2 : γ 1 z 1 + γ 2 z 2 ≥ 0 and δ 1 z 1 + δ 2 z 2 ≥ 0 . If R = 0 then the two squares are linearly dependent and the image cone is not closed: π(S 2 + ) = (z 1 , z 2 ) ∈ R 2 : γ 1 z 1 + γ 2 z 2 > 0 ∪ (0, 0) .
In conclusion, all bad instances do look the same as Example 1. But, from an algebraic perspective, their parameter space {R = 0} is a variety of considerable independent interest.
This article is organized as follows. Section 2 characterizes all linear subspaces L in S n that are bad in the sense that the image cone π L (S n + ) is not closed. This result is due to Pataki [16,17]. In Theorem 5 we present his linear algebra formulation in terms of block matrices. We recast this in the setting of real algebraic geometry, motivated by Proposition 3 which states that the bad subspaces L form a semialgebraic subset of the Grassmannian Gr(k, S n ). In Example 10 we offer a contrast to the analogous closure question for the images of the quadratic maps R n → R k and C n → C k that also arise from our subspace L R k of S n .
In Section 3, we turn to projective geometry and study the Zariski closure Bad k,n of the set of bad subspaces L inside the complex Grassmannian Gr(k, S n ). These varieties have codimension one and they are generally reducible. Their irreducible components are the coisotropic hypersurfaces [11] of rank strata of symmetric matrices. This is the content of Theorem 11, which identifies bad projections with objects familiar from elimination theory, such as resultants, Chow forms and Hurwitz forms [7,21]. Hyperdeterminants [7] remain in the background. Examples 12 and 13 offer detailed analyses of the cases n = 3 and n = 4. Section 4 explains the badness of a subspace L in terms of the normal cycle of the cone S n + and its Zariski closure in P(S n ) × P(S n ). The latter is the projective normal cycle, whose irreducible components are the conormal varieties of the rank strata [1,Example 5.15]. Following [14], this encodes complementarity in SDP. Theorem 17 reveals that L is bad when the normal cycle meets L × L ⊥ . This furnishes effective algebraic tools to identify bad projections, illustrated by computations with Macaulay2 [8] in Examples 21, 22 and 23. We invite our readers to peek at Example 20 where the resultant from Example 2 is revisited.

How To Be Bad
We are interested in the subset of the real Grassmannian Gr(k, S n ) whose points are the bad linear spaces L. By definition, a space L is bad if the image cone π L (S n + ) is not closed in R k .
Proposition 3. The set of bad L is semialgebraic in Gr(k, S n ). It is not closed when n ≥ 3.
Proof. The first assertion follows from the Tarski-Seidenberg Theorem on Quantifier Elimination [1,Theorem A.49]. Indeed, the image π L (S n + ) is a semialgebraic subset of R k , i.e. it can be described by a Boolean combination of polynomial inequalities. The dependence on L is semialgebraic, as is the statement that the image is not closed. We can eliminate the coordinates of R k to obtain a quantifier-free formula in the Plücker coordinates of L. This formula describes the desired semialgebraic subset of the real Grassmannian Gr(k, S n ).
To see that this subset is not closed, fix k = 2, n = 3, let t be a parameter, and consider the quadrics q 1 = x 2 1 and q 2 = x 2 2 + tx 1 x 3 . Their span is a 2-dimensional subspace L t in S 3 for all t ∈ R. For t = 0, the space L t is bad because π Lt (S 3 ) = {z 1 > 0} ∪ {z 1 = 0 and z 2 ≥ 0} is not closed. For t = 0, the image π L 0 (S 3 ) = R 2 ≥0 is closed, so L 0 is good. This specifies a sequence of bad points in Gr(2, S 3 ) whose limit is a good point, so our set is not closed. We note that, by Example 2, for n = 2 the set {R = 0} of bad L is closed in Gr(2, S 3 ) P 2 .
A characterization of bad subspaces was given by Pataki. Our first goal is to state his result. Consider the spectrahedral cone L ∩ S n + . It relates to our object of interest as follows: Lemma 4. The closure of π L (S n + ) is linearly isomorphic to the convex cone dual to L ∩ S n + .
Proof. This follows from the first statement in [19,Corollary 16.3.2], where we take A to be the linear map π L and the convex set C is the PSD cone S n + . Note that S n + is self-dual. In what follows we assume that k ≥ 2. The reason is that L is always good when k = 1: the one-dimensional cone π L (S n + ) equals R if L ∩ S n + = {0} and it is R ≥0 or R ≤0 otherwise. We fix a quadric q of maximal rank in L∩S n + . The rank of q is an invariant of the subspace L, denoted s = s(L) and called the spectrahedral rank of L. If s = n then L ∩ S n + is fulldimensional and π L (S n + ) is pointed and closed. If s = 0 then L ∩ S n + = {0} and π L (S n + ) = L ∨ , which is also closed. Thus we are mostly interested in the cases where 0 < s < n.
After a linear change of coordinates given by the action of GL(n), we may assume q = x 2 1 +x 2 2 +· · ·+x 2 s . The matrix that represents a quadratic form v ∈ S n has the block structure where V 11 ∈ S s and V 22 ∈ S n−s .
The following result, due to Pataki, appears in [17,Theorems 1,2]. We say that a subspace L is good if it is not bad. We write L ⊥ = ker(π L ) for the orthogonal complement of L in S n .
Theorem 5 (Pataki). A linear space of quadrics L ⊆ S n is bad if and only if there exists a quadric v ∈ L whose associated matrix V satisfies V 22 ∈ S n−s We now present an alternative version of this result. Let I L denote the real radical in R[x 1 , . . . , x n ] of the principal ideal q . We refer to [1,Section 7.2.2] or [13,Section 6.3] for the definition of the real radical. The real variety of q is a linear space of codimension s in R n , and I L is generated by all linear forms that vanish on this space. For instance, if n ≥ 3 and q = ( We consider the inclusions of linear spaces L is the linear span of the spectrahedon L ∩ S n + , while the second space L ∩ I L also records tangent directions relative to the PSD cone. To illustrate the inclusions, we consider the bad plane in Example 1, where q = x 2 1 , I L = x 1 and v = x 1 x 2 ∈ I L \I 2 L . We already know that the existence of such a pair (q, v) characterizes non-closed projections. (3) Proof. We set s = s(L) and assume I L = x 1 , . . . , x s . If s = 0 then L ∩ S n + = {0} and thus, by Lemma 4, the closure of π L (S n + ) is equal to {0} ⊥ = L ∨ R k . But, since π L (S n + ) is convex, this implies that π L (S n + ) equals L ∨ , so L is good. Thus, we can now assume s ≥ 1. We claim that the two conditions in the disjunction in (3) are the negations of the two conditions in the conjunction that characterizes goodness in the last statement of Theorem 5. Indeed, since two matrices in S n + have trace inner product equal to zero if and only if their matrix product is the zero matrix, we always have s(L ⊥ ) ≤ n−s. The equality s(L ⊥ ) = n−s holds if and only if there is a positive definite (n − s) × (n − s) matrix U as in Theorem 5. Next, consider any matrix V that would correspond to a quadratic form in (L ∩ I L )\(L ∩ I 2 L ). Containment in L∩I L means that V 22 = 0, and non-containment in L∩I 2 L means that V 12 = 0. We conclude that Corollary 6 is the contrapositive of the last statement of Theorem 5.
Example 7. Let n = k = 3 and let L be spanned by the span of the quadratic forms These are identified with symmetric 3 × 3-matrices A 1 , A 2 , A 3 , so the quadrics are To reveal the nature of L, we display the elements Hence I L = 5x 1 + 7x 2 + 7x 3 . The space L ∩ I 2 L is one-dimensional and spanned by the square above. But L ∩ I L is two-dimensional. Our two linear combinations form a basis. The theorem shows that the cone π L (S 3 + ) is not closed. It is the union of an open half-space in 3-space, together with a line through the origin in the plane that bounds the half-space.
We now turn the section title around and we focus on how to be good. For our best case scenario, we assume s(L) = n. This means that L intersects the interior of the PSD cone S n + . Hence the intersection L ∩ S n + is a full-dimensional pointed cone in L R k . Its convex dual (L ∩ S n ) ∨ is a full-dimensional pointed cone in the dual space L ∨ R k . Lemma 4 and Theorem 5 imply that this closed dual cone is precisely our projection of the PSD cone: Suppose that the subspace L is generic among points in Gr(k, S n ) that satisfy s(L) = n. Then the image cone (4) is a generic spectrahedral shadow, in the sense of [20]. The boundary of the image is an algebraic hypersurface that can have multiple irreducible components, one for each matrix rank r in the Pataki range; see e.g. [5,Lemma 5] and [20, Theorem 1.1]. The degree of the rank r component is a positive integer, denoted δ(k, n, r), that is known as the algebraic degree of semidefinite programming. These degrees play a major role in our main result, which is Theorem 11. We refer to [20, Table 1] for explicit numbers, and to the bibliographies of [2,5,14,20,22] for additional references. For instance, for projections of the PSD cone S 3 + into dimensions k = 3 and k = 4, we find that δ(2, 3, 2) = 6 and δ(3, 3, r) = 4 for r = 1, 2. The following two subspaces exhibit the generic good behavior.
Example 8 (n = k = 3). Let L be the space spanned by the following rank two quadrics: Their sum is positive definite, so s(L) = 3. This specific linear space L appeared in [22] as an illustration for linear concentration models in statistics. In that application, the threedimensional cone (4) serves as the cone of sufficient statistics of the model. Its boundary is an irreducible surface of degree six, defined by the polynomial H L shown in [22, Example 1.1]. That surface is the cone over the plane sextic curve shown in red on the left in Figure 1. For a discussion of this curve in the context of semidefinite programming see [13,Example 12.5].
Example 9 (n = 3, k = 4). Let L be the space spanned by the following rank one quadrics: Their sum is positive definite, so s(L) = 3. The 4-dimensional cone L ∩ S 3 + is the cone over a 3-dimensional convex body known as elliptope and shown in [13, Figure 1.1]. The cone (4) is bounded by four hyperplanes and a quartic threefold in R 4 . These correspond respectively to the four circles and the Roman surface that bounds the green body on the right in Figure 1. In the literature, there has been a discrepancy between studies in convex algebraic geometry, like [2,20], and how semidefinite programming is actually used. The former has focused on generic figures, while the latter often concerns special instances from combinatorial optimization. For such scenarios, strong duality can fail, thus motivating works like [10,12,17]. The present paper aims to reconcile these perspectives. We study special scenarios through the lens of algebraic geometry, by highlighting cases that are generic among the bad ones.
We close this section with a brief exploration of another connection to algebraic geometry. Namely, we consider the restriction of π L to the set of rank one matrices in S n + . This set comprises the extreme rays of the cone S n + , and it coincides with the image of the map [L] R : R n → S n + that takes a vector y to the rank one matrix y T · y. It is therefore equivalent to study the quadratic map R n → R k defined by evaluating the quadrics q 1 , . . . , q k that span L. The image im([L] R ) of this map in R k coincides with the image of rank one matrices under π L . What is this image, and under what conditions on L is it closed? To answer these questions for a small instance, one can apply the method of Cylindrical Algebraic Decomposition [4]. In our experiments we used the implementation Resolve in Mathematica.
For an algebraic geometer, it is natural to first pass to the algebraic closure and to consider the map [L C ] : C n → C k over the complex numbers. Our questions remain as above. What is the image im([L] C ) of this map in C k , and under which conditions on L is it closed? We know from [13,Theorem 4.23 To answer these questions for any given instance, we can apply the algorithm due to Harris, Micha lek and Sertöz [9]. Our experiments used their implementation in Macaulay2 [8].
We now compare the closure property for the three sets π L (S n + ), im([L] R ) and im([L] C ). In each example we display a basis for L. One easily finds cases when all three sets are closed, like (x 2 1 , x 2 2 ), or where none is closed, like (x 2 1 , x 1 x 2 ). The following maps are more interesting.
Here π L (S 3 + ) = R 3 is closed because the off-diagonal entries of a positive semidefinite matrix can be arbitrary. However, im([L] R ) and im([L] C ) are not closed. Their images lack all points that have precisely one coordinate zero.
This is not closed. However, since i = √ −1, none of the missing points is real. 2 4 , and im([L] R ) is its set of real points. Both are closed.

Coisotropic Hypersurfaces
In this section we study the projective variety Bad k,n . By definition, this is the Zariski closure in the complex Grassmannian Gr(k, S n ) of the set of bad subspaces L. Our goal is to characterize Bad k,n in terms of objects that are familiar to algebraic geometers. We focus on subvarieties of Grassmannians called higher associated varieties that are introduced in Section 3.2.E of the book on Discriminants, Resultants and Multidimensional Determinants by Gel'fand, Kapranov and Zelevinsky [7]. They were further studied in recent work of Kohn [11] who calls them coisotropic varieties. We shall adopt that name and the notation in [11]. We write P(S n ) P ( n+1 2 )−1 for the complex projective space of symmetric n × n matrices. Every point L in Gr(k, S n ) represents a (k − 1)-dimensional linear subspace PL of P(S n ).
Let Y be a projective variety of codimension c in P(S n ). For a regular point X ∈ Reg(Y), we write T X Y for the tangent space of Y at X. The i-th coisotropic variety of Y is defined as The bar denotes Zariski closure in the Grassmannian. Note that T X Y has codimension c while PL has dimension c+i−1. The expected dimension of their intersection is i−1. Hence Ch i (Y) is a proper subvariety of Gr(c + i, S n ), and we expect this to be a hypersurface.
The following theorem accomplishes our stated goal. We write X s for the subvariety of P(S n ) given by all symmetric n × n-matrices of rank ≤ s. We set c = n−s+1 2 = codim(X s ).
Theorem 11. The bad subvariety Bad k,n has codimension one in Gr(k, S n ). It is the union of the irreducible coisotropic hypersurfaces Ch k−c (X s ), where s runs over integers such that The degree of the irreducible polynomial in Plücker coordinates that defines the hypersurface Ch k−c (X s ) is the algebraic degree of semidefinite programming, which is denoted by δ(k, n, s).
Our first task is to make this statement understandable by defining all ingredients. We recall (e.g. from [13,Chapter 5]) that the Grassmannian Gr(k, S n ) is embedded, via the Plücker embedding, in a projective space of dimension ( n+1 2 ) k − 1. The coordinates we use for Gr(k, S n ) are described in [11,Section 2.1]. The primal Stiefel coordinates are the entries of matrices A 1 , . . . , A k that span L. The dual Stiefel coordinates are matrix entries for a basis of L ⊥ . If we vectorize these basis elements and write them as the rows of a matrix with n+1 2 columns, then the maximal minors of this matrix are the Plücker coordinates of L.
Fix any irreducible variety Y in P(S n ) P ( n+1 2 )−1 . Its projectively dual variety Y ∨ parametrizes hyperplanes that are tangent to Y at some regular point. Note that Y and Y ∨ live in the same ambient space P(S n ), since S n is identified with its dual via the trace inner product. We set c = codim(Y) and d = dim(Y ∨ ). Following [11] and (5) above, we write Ch i (Y) for the i-th coisotropic variety of Y. This is an irreducible subvariety of the Grassmannian Gr(k, S n ), where k = c + i. The points of Ch i (Y) are linear subspaces L that have non-transversal intersection with the tangent space at some point of Y. Kohn [11] follows the seminal work of Gel'fand, Kapranov and Zelevinsky [7] in developing a general theory of coisotropic varieties. She proves in [11,Corollary 6] that Ch i (Y) is a hypersurface if and only if c ≤ k ≤ d + 1. In that case, the degree of its equation in Plücker coordinates equals This is the content of [11,Theorem 9]. The duality formula in [11,Theorem 20] states that This isomorphism is equality under the identification of Gr(k, S n ) with Gr n+1 2 − k, S n given by L → L ⊥ . In addition, the polar degree δ i (X ) is nonzero if and only if i ≤ d − c + 1.
We now apply these considerations to the determinantal variety Y = X s , the codimension of which equals c = n−s+1 2 . It is known that (X s ) ∨ = X n−s by [ 2 . This is almost the same as (6), which is known as the Pataki range [5,14,20]. However, the minimal value for k in the Pataki range is disallowed in Theorem 11. The coisotropic hypersurface for that minimal value of k is the Chow form Ch 0 (X s ). This does not contribute to Bad k,n .
Before proving Theorem 11, let us explore its implications for matrices of small size. For n = 2, the only interesting case is k = 2. This was studied in Example 2, where the resultant R was written in primal Stiefel coordinates on Gr(2, S 2 ) = P 2 . The dual Stiefel coordinates are the usual coordinates (y 0 : y 1 : y 2 ) on P 2 , which here agree with the Plücker coordinates: The Veronese curve in P 2 with equation R = y 0 y 2 − y 2 1 is equal to Ch 0 (X ∨ 1 ) Ch 1 (X 1 ).
Example 12 (n = 3). We discuss the bad varieties for k = 2, 3, 4, 5. Theorem 11 states that Bad k,3 is irreducible and equal to the hypersurface Ch k−c (X s ) in Gr(k, S 3 ) = Gr(k, 6). The inequalities (6) imply that s = 2 and c = 1 for k = 1, 2, and s = 1 and c = 3 for k = 3, 4. The hypersurface Bad 2,3 has degree 6 in the 8-dimensional Grassmannian Gr(2, S 3 ) ⊂ P 14 . Its equation is the classical tact invariant of two ternary quadrics q 1 and q 2 . The tact invariant vanishes if and only if the conics {q 1 = 0} and {q 2 = 0} are tangent in P 2 . When written in the 12 = 6 + 6 entries of the matrices A 1 and A 2 , the tact invariant is a sum of 3210 terms of total degree 12. This is the Hurwitz form of the Veronese surface in P(S 3 ) = P 5 . The formula in Plücker coordinates has degree six, and it appears explicitly in [21,Example 2.7].
The hypersurface Bad 3,3 = Ch 2 (X 2 ) Ch 0 (X 1 ) has degree 4 in the 9-dimensional Grassmannian Gr(3, S 3 ) ⊂ P 19 . It is the Chow form of the Veronese embedding of P 2 into P 5 = P(S 3 ). Equivalently, it is the resultant of three ternary quadrics q 1 , q 2 , q 3 that span L. When written in terms of their 18 = 6 + 6 + 6 coefficients, this resultant has 21894 terms. We invite our readers to check that this resultant vanishes at the specific instance (q 1 , q 2 , q 3 ) we discussed in Example 7. Indeed, those three quadrics have two common zeros in P 2 .
The hypersurface Bad 4,3 = Ch 1 (X 1 ) agrees with Bad 2,3 = Ch 1 (X 2 ) under the identification of Gr(4, S 3 ) with Gr(2, S 3 ). It has degree six as before. If we replace the 15 Plücker coordinates p ij in [21, Example 2.7] with the complementary maximal minors of a 4 × 6matrix, then we get an equation of degree 24 in the entries of a basis A 1 , A 2 , A 3 , A 4 of L.
The hypersurface Bad 5,3 = Ch 2 (X 1 ) has degree three in Gr(5, S 3 ) P 5 . In fact, it is simply the determinant hypersurface X 2 = X ∨ 1 itself. Indeed, a 5-dimensional subspace L is bad if and only if the line L ⊥ is spanned by a positive semidefinite matrix of rank ≤ 2.
We discuss these four coisotropic hypersurfaces along with their dual interpretations.
• Ch 3 (X 3 ) Ch 0 (X 1 ) has degree 8 in Gr(4, S 4 ). Here the subspace L = R{q 1 , q 2 , q 3 , q 4 } has a common zero y in P 3 . This means that L ⊥ contains a rank one matrix, namely y T · y. For a generic bad instance L in this family, a basis of L ⊥ is given by In this example we have y = (0 : 0 : 0 : 1) and 1 , 2 , . . . , 9 are generic linear forms.
• Ch 1 (X 2 ) Ch 3 (X 2 ) has degree 30 in Gr(4, S 4 ). In this case, both the zero-dimensional scheme PL ∩ X 2 and the surface PL ⊥ ∩ X 2 are singular. A bad instance in this family is Here 1 , . . . , 6 are generic linear forms. The zero-dimensional scheme PL ∩ X 2 has length 10 in P(S 4 ) P 9 . The quadric q 1 is a point of multiplicity two in that scheme.
• Ch 4 (X 2 ) Ch 0 (X 2 ) has degree 10 in Gr(7, S 4 ). Here, the threefold PL ∩ X 2 is singular and L ⊥ contains a rank two matrix. That matrix is a singular point of the plane quartic curve PL ⊥ ∩ X 3 . For a generic bad instance L of this kind, a basis of L ⊥ is given by Here 1 , 2 , 3 , 4 are binary linear forms in the two unknowns x 3 and x 4 .
• Ch 1 (X 1 ) Ch 2 (X 3 ) has degree 16 in Gr(7, S 4 ). Here, both the zero-dimensional scheme PL ∩ X 1 and the plane quartic PL ⊥ ∩ X 3 are singular. But now its singular point is a rank three matrix. For a generic bad instance L of this kind, a basis of L ⊥ is given by where 1 , 2 are linear forms in x 2 , x 3 , x 4 , and q 2 , q 3 are quadratic forms in x 2 , x 3 , x 4 .
We note that the two irreducible components of Bad 7,4 are precisely the irreducibe factors P and M of the Vinnikov discriminant of a ternary quartic. This was discussed in [18, Theorem 7.5] and in [6,Remark 22]. The three matrices A, B, C that give the determinantal representation of quartics in [18] span our space L ⊥ . Fløystad, Kileel and Ottaviani [6] present an explicit formula for Ch 4 (X 2 ) as the Pfaffian of a skewsymmetric 20 × 20-matrix.
Proof of Theorem 11. We already remarked above that Ch k−c (X s ) is a hypersurface whenever (6) holds. The degree of this coisotropic hypersurface is the i-th polar degree of X s by (7), where i = k − c. That polar degree of X s is equal to δ(k, n, s) by [14,Theorem 13].
In what follows we prove the assertions about the bad variety Bad k,n that are stated in the first two sentences of Theorem 11. Let I L and I L ⊥ be defined as in the paragraph prior to Corollary 6. The integers k, n are fixed throughout. We begin by assuming that s is in the range (6). We first show that every bad subspace L ∈ Gr(k, S n ) with 0 < s(L ⊥ ) ≤ n − s and 0 < s(L) ≤ s is in the coisotropic hypersurface Ch k−c (X s ). We shall proceed in two steps. Step We may assume, after a change of coordinates, that L contains the special diagonal matrix Let H = T X (X s ) denote the tangent space of the determinantal variety X s at X. This is the linear space of codimension c = n−s+1 2 in P(S n ) defined by x ij = 0 for i > s and j > s. The matrix Y satisfies Y ∈ H ⊥ . Hence, for a generic subspace L with X ∈ L and Y ∈ L ⊥ , we have dim(PL ∩ H) ≥ k − c. This number exceeds the expected dimension of PL ∩ H among generic L that contain X. This shows that any subspace L with s(L) = s and s(L ⊥ ) = n − s is a point in the coisotropic variety Ch k−c (X s ). In particular, a generic element of (9) lies in the following full-dimensional semialgebraic set of real points in Ch k−c (X s ): Step 2: If 0 < s(L) = r < s and 0 < s(L ⊥ ) = t ≤ n − s. We may assume that our subspace L contains the specific diagonal matrix Then s(L ) = s and L → L as → 0. Let H = T X (X s ). By construction, we still have Y ∈ L ⊥ ∩ H ⊥ . By the proof of Step 1, we conclude that L ∈ Ch k−c (X s ) for all > 0. Then L ∈ Ch k−c (X s ) since varieties are closed. In particular, we see that the set of bad instances with s(L) + s(L ⊥ ) = n is dense in the set of all bad instances, so (9) is Zariski dense in (10). Next we show that values of s outside the range (6) are covered by those in that range. Suppose that s does not satisfy (6). We claim that the set of bad instances is in the closure of the set of bad subspaces for which s is in the range. Fix an s outside the range (6). Let L be a bad subspace such that either s(L) = s or s(L ⊥ ) = n − s. There are again two cases. Case 1: If k ≤ c = codim(X s ), then k − c ≤ 0. Then Ch k−c (X s ) is either the Chow form or trivially Gr(k, S n ), neither of which characterizes bad subspaces as argued below. By a similar -argument as that in Step 2, we may assume s(L) = s and s(L ⊥ ) = n − s. Then L∩I 2 L L∩I L by Corollary 6. Therefore, if X ∈ Reg(X s )∩S n + ∩L, then dim(PL∩T X (X s )) = dim P(L ∩ I L ) > dim P(L ∩ I 2 L ) ≥ 0. So, dim(PL ∩ T X (X s )) ≥ 1. The set of bad subspaces is contained in the Zariski closure of the following set whose codimension is greater than 1: Fix an integer s < s < n such that c = codim(X s ) < k ≤ dim(X n−s ). We claim that the set of bad instances in Gr(k, S n ) is contained in Ch k−c (X s ) where c = n−s +1  , 0). We may assume X ∈ L and we define L as above. Thus we have L → L as → 0. Since s(L ) = s < n, we have n − s ≥ s(L ⊥ ) > 0 by the paragraph folowing Lemma 4. By the argument in Step 1, we find that L ∈ Ch k−c (X s ) for > 0, and therefore L ∈ Ch k−c (X s ).
− k, S n ) which does not characterize the orthogonal complement of bad subspaces. By Corollary 6, the set of bad subspaces is contained in the Zariski closure of the following set whose codimension in the Grassmannian is greater than one: Choose 0 < s < s with codim(X n−s ) ≤ dim L ⊥ < dim(X s ). Applying the same -argument as in Case 1, we find L ⊥ ∈ Ch ( n+1 2 )−( s +1 2 )−k (X n−s ). By duality, this means L ∈ Ch k−c (X s ) where c = codim(X s ). We have now shown that all bad subspaces L with s(L) outside the Pataki range lie in one of the coisotropic hypersurfaces Ch k−c (X s ) where k satisfies (6).
It remains to be seen that the bad subspaces are Zariski dense in Ch k−c (X s ), provided (6) holds. By Step 1, the set of bad subspaces is Zariski dense in (9). Since (9) is Zariski dense in (10), it suffices to show that (10) is Zariski dense in Ch k−c (X s ). The subset Reg(X s ) ∩ S + n of positive semidefinite rank s matrices is Zariski dense in the variety X s . The same holds for the incidence variety of pairs (X, L), where L is tangent to X s at X. We project this incidence variety, and its Zariski dense subset given by X ∈ S n + , into the Grassmannian Gr(k, S n ). The image of the latter is Zariski dense in the image of the former. Hence the bad subspaces form a Zariski dense subset of Ch k−c (X s ). This completes the proof of Theorem 11. Remark 14. Our proof gives rise to an explicit parametrization of generic bad subspaces L in Ch k−c (X s ) which satisfy s(L) + s(L ⊥ ) = n. We shall present a basis for L ⊥ , similar to those given for k = 7, n = 4 in Example 13. Namely, we start with q 1 = n i=s+1 x 2 i . For i ≥ 2 we set q i = q i + s j=1 ij x j , where q i is a generic quadratic form in x 1 , . . . , x s of trace zero, and the ij are linear forms in x s+1 , . . . , x n . The dimension of L ⊥ is supposed to be Hence, there is enough freedom to keep all q 1 , q 2 , q 3 , . . . linearly independent. The resulting subspaces L are generically bad, and they form the Zariski dense subset (9) of Ch k−c (X s ).
Our main result, Theorem 11, identifies the subvarieties in the Grassmannian that are responsible for bad behavior in semidefinite programming (SDP). However, these are complex projective varieties and hence they are one step removed from the real figures that are of interest in optimization theory. We close this section by returning to the real and semidefinite setting. The argument in the last paragraph in the proof of Theorem 11 gives rise to the following corollary, aimed at capturing in precise terms what the typical bad subspaces are.
Corollary 15. Fix integers n, k, s that satisfy (6). A generic real subspace L in the component Ch k−c (X s ) of the bad variety Bad k,n is tangent to X s at a unique matrix X ∈ S n , and this X is real. A generic subspace L such that the matrix X is positive semidefinite is bad.

Algebraic Computations
In this section we develop computational tools for the geometric problem studied in this paper. Suppose we are given matrices A 1 , A 2 , . . . , A k in S n whose entries are rational numbers. The most basic decision problem is to determine whether or not L = R{A 1 , A 2 , . . . , A k } is a bad subspace, and to find a certificate as in Theorem 5. The first step in this decision process is the computation of the spectrahedral rank. Recall that s(L) is the largest rank of any matrix X in the spectrahedral cone L ∩ S n + . For a generic instance L, we have s(L) = 0 or s(L) = n. These are the easy cases, where the image π L (S n + ) is either all of R k or a closed pointed cone in R k . We are interested in the decision boundary between these two regimes.
An upper bound on s(L) is given by the rank of any matrix Y in L ⊥ ∩ S n + . Indeed, we have s(L) + s(L ⊥ ) ≤ n, with equality for all good subspaces L, and for generic bad ones. This leads us to consider the following system of polynomial equations in 2 n+1 2 unknowns: X ∈ L and Y ∈ L ⊥ and X · Y = 0.
The pair (X, Y ) represents a point in the product space PL × PL ⊥ inside P(S n ) × P(S n ). We call (11) the critical equations, and its solution set is the critical variety of the subspace L.
As is customary in algebraic geometry, we work in the complex projective setting, with PL P k−1 and PL ⊥ P ( n+1 2 )−k−1 . Thus PL × PL ⊥ is a variety of dimension n+1 2 − 2. The equations (11) are reminiscent of the optimality conditions for SDP, in the notation used in [2, (5)], [13, (12.14)] and [14, (3.4)]. However, there is a crucial distinction. The optimality conditions are based on a flag of subspaces V ⊂ U where dim(U) − dim(V) = 2. They have many solutions in P(S n ) × P(S n ), counted by the algebraic degree of SDP, as shown in [14]. In our setting, the flag V ⊂ U is replaced by L ⊆ L. The equations (11) are expected to have no solutions. The critical variety of a generic subspace L is the empty set in P(S n ) × P(S n ). What we care about are the exceptional L for which (11) has a solution.
Let us step back and first review the meaning of the equations X ·Y = 0. These represent complementary slackness in SDP. The normal cycle of the PSD cone is the semialgebraic set The normal cycle represents pairs of points in the cone together with supporting hyperplanes.
In the real affine version seen in (12), this is a semialgebraic set of middle dimension n+1 2 . If X ranges over matrices of rank s then Y ranges over complementary matrices of rank n − s. For an algebraic geometer, it is more natural to consider the complex projective version. This is a reducible complex algebraic variety, here referred to as the projective normal cycle: Fix a generic point L in the Grassmannian Gr(k, S n ). For dimension reasons, the intersection (PL × PL ⊥ ) ∩ PNC n that is defined by (11) will be the empty set in (P(S n )) 2 . As alluded to, our objects of interest are subspaces L for which that intersection is nonempty.
They are equal unless k = n−s+1 2 , in which case the difference is the Chow form Ch 0 (X s ). The closure of the semialgebraic set of bad subspaces is the set of real L for which L × L ⊥ intersects the normal cycle NC n nontrivially, i.e. (11) has a solution (X, Y ) with X = 0, Y = 0.
Proof. This follows from Theorem 11 and Corollary 15, using the fact about conormal varieties stated in Proposition 16. It suffices to show that a Zariski dense subset of the bad variety Bad k,n is contained in the left hand side of (14). We choose that subset to be the union of (10) over all s within the range (6). Fix s and consider L in (10). Pick X ∈ Reg(X s ) ∩ L such that dim(PL ∩ T X (X s )) ≥ k − c. Let I L and I L ⊥ be defined as in the paragraph prior to Corollary 6. Let L be the image of L under the map S n → S n−s which restricts the domain of each matrix to the variety of I L . Then dim(L ) ≤ c − 1 = dim(S n−s ) − 1, so that π L : S n−s → L ∨ has a nontrivial kernel. If Y ∈ ker(π L ), then Y ∈ L ⊥ and X · Y = 0.
The same relationship between coisotropic hypersurfaces and the conormal variety extends from our specific varieties X s to arbitrary subvarieties in a projective space. This is essentially biduality, and we view this fact as a geometric refinement of [11,Section 4].
The coisotropic hypersurface Ch 0 (X 1 ) is defined by the following resultant with 549 terms: The bad variety Bad 3,3 is equal to Ch 2 (X 2 ). All generic subspaces in Ch 0 (X 1 ) are good.
The objects in (11), (12) and (13) are symmetric under switching the two factors. But this is not the case when it comes to π L (S n + ) being closed. For deciding between bad and good, the symmetry between primal and dual is broken. From an SDP perspective, one can see this in Proposition 1 of [17, Section 3]. For a concrete example, consider the dual pair Then L ∈ Ch 2 (X 2 )\Ch 0 (X 1 ) is bad, and quite typical for this, whereas L ⊥ ∈ Ch 1 (X 0 )\Ch 2 (X 2 ) is good.
We can use Theorem 17 to compute equations that define our coisotropic hypersurfaces. Namely, consider the incidence variety in P(S n ) × P(S n ) × Gr(k, S n ) that is defined by the critical equations (11). The hypersurface we are interested in is the image of that incidence variety under the map P(S n ) × P(S n ) × Gr(k, S n ) → Gr(k, S n ). In particular, if we fix some particular rank s, then the image of the incidence variety in X s × X n−s × Gr(k, S n ) is the irreducible hypersurface Ch k−c (X s ) in Gr(k, S n ). Algebraically, one obtains the polynomial defining Ch k−c (X s ) by eliminating X and Y from the following rank s critical equations of L: X ∈ L and Y ∈ L ⊥ and X · Y = 0 and rank(X) ≤ s and rank(Y ) ≤ n − s.
Corollary 19. Under the assumption of Corollary 15, the system (15) has a unique solution (X, Y ) in (P(S n )) 2 . Here X is the unique point of tangency and Y is in the normal space.
Example 21 (n = 3, k = 4, s = 1). We represent L ⊥ by a basis of 3 × 3-matrices U and V. Their 6+6 entries are the dual Stiefel coordinates on Gr(4, S 3 ). We run this Macaulay2 code: The output of this computation is a polynomial in u1..u6,v1..v6 with 3210 terms of degree 12. This is the tact invariant we saw in Example 12. It defines Bad 4,3 = Ch 1 (X 1 ) Ch 1 (X 2 ).
We close by presenting two case studies with numerical examples. In both cases, the critical variety defined by (15) consists of a single rational point, and it is computed using the command criticalIdeal in the Macaulay2 package SemidefiniteProgramming [3]. Working with this package has the advantage that we can compare the algebraic approach described above with Pataki's facial reduction [15] in the usual numerical framework of SDP.   .
Is there a value of t for which L t is bad? Geometrically, {L t } t∈R is a line in Gr(4, S 4 ) ⊂ P 209 . What is its intersection with Bad 4,4 ? To answer this question, we consider s = 2 and we evaluate the Hurwitz form Ch 1 (X 2 ) on L t . The result is a primitive polynomial f ∈ Z[t] of degree 30. Each of its coefficients has well over 100 digits. The leading coefficient equals 017413181247522771810155185. One of the 30 complex roots of f (t) is the integer 194.
The matrices X * and Y * are unique up to scaling. They are positive semidefinite of rank 2. For instance, X * = 14A 1 − 18A 2 + 24A 3 + A 4 is the point of tangency for L at the variety X 2 .
Example 23 (n = 4, k = 5, s = 2). Let A 1 , . . . , A 5 be the five matrices displayed in equation (2.1) of [17,Example 4]. Their linear span L ∈ Gr(5, S 4 ) is a bad subspace. However, L is not generic in the sense of Corollary 15. To see this, we compute the saturation of the ideal specified in (15). We find that the critical variety is a reducible surface in PL × PL ⊥ . We conclude that L is a point in Bad 5,4 , but it does not satisfy the hypothesis in Corollary 19, as that would imply that the variety is only one point. The projection of the critical variety into PL P 4 is the plane defined by 3x 1 + 2x 3 + 3x 4 + 9x 5 , 3x 2 − x 3 + 3x 5 . The point x = (−1, −1, 0, −2, 1) lies in that plane. It specifies the matrix X = 5 i=1 x i A i = diag(1, 1, 0, 0), seen on the right in [17, equation (2.4)]. Note that X is in L ∩ S 4 + and rank(X) = s(L) = 2. The bad variety Bad 5,4 is the coisotropic hypersurface Ch 2 (X 2 ), which is self-dual and has degree δ(5, 4, 2) = 42. To construct typical points on that hypersurface, we choose random