Sums of Squares and Quadratic Persistence on Real Projective Varieties

We bound the Pythagoras number of a real projective subvariety: the smallest positive integer $r$ such that every sum of squares of linear forms in its homogeneous coordinate ring is a sum of at most $r$ squares. Enhancing existing methods, we exhibit three distinct upper bounds involving known invariants. In contrast, our lower bound depends on a new invariant of a projective subvariety called the quadratic persistence. Defined by projecting away from points, this numerical invariant is closely related to the linear syzygies of the variety. In addition, we classify the projective subvarieties of maximal and almost-maximal quadratic persistence, and determine their Pythagoras numbers.

Sums of squares occupy a central place in real algebraic geometry, optimization, and number theory. Being able to represent an element in a commutative ring as a sum of squares has substantial ramifications in the study of non-negativity and quadratic forms, whereas the constructive aspects of these representations are indispensable in developing efficient computational tools. The Pfister Theorem [Lam05,Corollary XI.4.11], proving that any nonnegative rational function in the field R(x 0 , x 1 , . . . , x n ) is a sum of at most 2 n+1 squares, serves as a motivational example. Our primary objective is to find similar effective bounds for homogeneous elements in a real affine algebra and our approach exposes some unexpected connections between real and complex geometry.
Given a real subvariety X ⊆ P n , let I X be its saturated homogeneous ideal in the polynomial ring S := R[x 0 , x 1 , . . . , x n ] and let R := S/I X denote its homogeneous coordinate ring. Inspired by [Lam05,Section XIII.5], the Pythagoras number py(X) is the smallest positive integer r such that any sum of squares of linear forms in R can be expressed as the sum of at most r squares. We focus on homogeneous polynomials of degree 2 because the appropriate Veronese re-embedding of X reduces the analysis to this case. Refining and consolidating existing methods, our first theorem provides three different upper bounds on the Pythagoras number for real projective subvarieties. To articulate this result, we set a(X) to be the largest number k such that the homogeneous ideal I X is generated by quadratic polynomials and the first k − 1 maps in its minimal free resolution are represented by matrices of linear forms, and we refer to a projective subvariety X ⊆ P n as 2-regular if its homogeneous ideal I X is generated by quadratic polynomials and all the maps in its minimal free resolution are represented by matrices of linear forms; see [Eis05,Sections 4A and 8D].
Theorem 1.1. For any real subvariety X ⊆ P n such that the set X(R) of real points is not contained in a hyperplane, we have the following upper bounds: i. py(X)+1 2 < dim R R 2 ; ii. py(X) n + 1 − min{a(X), codim(X)}; iii. py(X) is at most one more than the dimension of any real 2-regular variety containing X.
Together Example 2.10, Example 2.17, and Example 2.14 illustrate that any one of these upper bounds can be stronger than the other two.
More significantly, we devise a lower bound for the Pythagoras number of a real subvariety.
The key is to introduce a new numerical invariant for a complex projective subvariety. For any nonnegative integer k and any subset Γ of k closed points in X, let π Γ : P n P n−k be the rational map given by the linear projection away from Γ. The quadratic persistence qp(X) of the subvariety X ⊆ P n is the smallest nonnegative integer k for which there exists a subset Γ of k closed points in X such that the homogeneous ideal I π Γ (X) contains no quadratic polynomials. Lemma 3.3 shows that the quadratic persistence of an irreducible variety may be calculated by projecting away from a general set of closed points and Lemma 3.2 establishes the basic inequality qp(X) codim(X). On the other hand, quadratic persistence is also intimately related to linear syzygies. To state our second major result, let (X) be the number of nonzero entries in the first row of the Betti table for the homogeneous coordinate ring R regarded as an S-module; see (4.0.1) or [Eis05, Section 8D].
Theorem 1.2. For a non-degenerate irreducible complex subvariety X ⊆ P n , we have qp(X) (X).
By replacing codimension with quadratic persistence, this theorem sharpens the first part of Green's K p,1 -Theorem [Gre84, Theorem 3.c.1]. Even better, we use quadratic persistence to calculate (X) in some situations; see Proposition 4.10 and Proposition 5.12. Fulfilling our original motivation for introducing quadratic persistence, our third theorem gives a lower bound on the Pythagoras number of a real projective variety that does not lie in a hyperplane and contains a nonsingular real point.
Although the Pythagoras number is a semi-algebraic invariant relying on the real structure, the lower bounds are algebraic invariants depending only on the complex geometry of the subvariety. Counterintuitively, our upper and lower bounds on the Pythagoras number agree when the quadratic persistence is relatively large. In the maximal case, our fourth theorem strengthens Theorem 1.1 in [BPSV17] and yields yet another characterization for varieties of minimal degree.
In the nearly-maximal case, we can also compute the Pythagoras number and classify the varieties under the additional hypothesis that the homogeneous coordinate ring is Cohen-Macaulay.
Theorem 1.5. Let X ⊆ P n denote a non-degenerate irreducible totally-real subvariety. If X is arithmetically Cohen-Macaulay, then the following conditions are equivalent: a. qp(X) = codim(X) − 1; b. py(X) = 2 + dim(X); c. deg(X) = 2 + codim(X) or X is a codimension-one subvariety of a variety of minimal degree.
This fifth result is a counterpart to the third part of Green's K p,1 -Theorem [Gre84, Theorem 3.c.1] where quadratic persistence supplants the degree of a morphism. More directly, Theorem 1.2 and Theorem 1.3 establish the second part of Green's K p,1 -Theorem for totally-real projective varieties. Many of the implications between the three conditions in both Theorem 1.4 and Theorem 1.5 continue to hold under weaker assumptions on the subvariety X; see Section 3.
Explicit Bounds in Special Cases. To better assess the power of our geometric approach, we produce concrete bounds on the Pythagoras numbers and the quadratic persistence for projective curves and toric subvarieties. Corollary 2.9 proves that the Pythagoras number for a canonical real curve is bounded above by its real gonality: the lowest degree of a real non-constant morphism from the curve to the real projective line. Using Green's Conjecture [Voi05] for a general canonical curve X ⊂ P g−1 , Example 2.10 specializes the bounds from Theorem 1.1 and Example 4.7 shows that the quadratic persistence is strictly larger than the number (X) of nonzero entries in the first row of the Betti table for its homogeneous coordinate ring. Similarly, for a high-degree curve X ⊂ P n , Corollary 2.8 bounds the Pythagoras number via its gonality and, using the Gonality Conjecture [EL15], Example 4.9 establishes that qp(X) > (X). The close relationship between the Pythagoras number and these other sophisticated numerical invariants is remarkable, and the observations about quadratic persistence answer Question 5.8 in [HK15] negatively.
When compared to curves, the proofs of the analogous bounds for projective toric subvarieties reverse the flow of information. Instead of the well-known invariant for curves, Corollary 2.15 proves that the Pythagoras number of a projective toric subvariety X P∩Z d ⊆ P n is bounded above by a simple new invariant: the minimal number of parallel lines needed to cover all of the lattice points in the polytope P ⊂ R d . For toric surfaces, this invariant-disguised as the lattice width of a polygon-is already related to linear syzygies; see Definition 1.5 and Conjecture 1.6 in [CCDL19]. Proposition 5.12 computes the quadratic persistence for any toric subvariety associated to a tall prism (the product a lattice polytope and a sufficiently long interval) and, thereby, deduces both the Pythagoras number and the number of nonzero entries in the first row of the Betti table. In contrast with our examples for curves, we have qp(X) = (X) in this situation. Example 5.13 showcases a family for which the hypothesis on the height of the prism is vacuous. As Section 6 in [Rai16] underscores the difficulty in describing the linear syzygy modules for the SegreâȂŞVeronese embeddings of a product of projective spaces, our numerical success with the toric subvarieties associated to a tall prisms is all the more surprising.
Pythagoras Numbers in Applications. By emphasizing projective subvarieties, our approach unifies various viewpoints. Hilbert's Theorem [Hil88], demonstrating that every nonnegative ternary quartic is the sum of 3 squares, is the primal source for the Pythagoras numbers of homogeneous elements in a real affine algebra. From our perspective, this is the same as showing that the Pythagoras number of the Veronese surface P 2 ⊂ P 5 equals 3; see Example 2.17. Unlike the intervening work on rational functions, [CLR95] again concentrates on homogeneous polynomials, providing both lower and upper bounds on their Pythagoras numbers. Advancing these ideas, [Sch17] establishes new lower bounds that are much closer to the existing upper bounds. By reproving Theorem 3.6 in [Sch17], Example 5.11 hints at the universality of our geometric paradigm.
In optimization, the Pythagoras number is typically recast in terms of the rank of Gram matrices. Each quadratic form f ∈ S := R[x 0 , x 1 , . . . , x n ] corresponds to a real symmetric matrix A such that f = x T A x, where x is the column vector whose entries are the variables x 0 , x 1 , . . . , x n . By the spectral theorem, the quadratic form f is a sum of squares if and only if the matrix A is positive semidefinite. As a consequence, the set of sum-of-squares representations for a quadratic form in any real affine algebra is the intersection of the cone of positive-semidefinite matrices with an affine linear space, called the Gram spectrahedron. Hence, deciding whether a quadratic form is a sum of squares is equivalent to the feasibility of a semidefinite programming problem. Better yet, the polynomial f ∈ S 2 is a sum of r squares if and only if the positive-semidefinite matrix A has rank r. Thus, the Pythagoras number is the maximum rank among matrices of minimal rank in the Gram spectrahedra. Computationally, upper bounds on this Pythagoras number allow [BM03] to improve the scalability of such optimization problems by factoring the matrix A as B B T , where B is a real (n + 1) × r-matrix. Although this surrogate destroys convexity, [BVB16,BVB20] show that local methods do reliably converge to global optima. Beyond the upper bounds in Theorem 1.1, Theorems 1.4-1.5 can both be reinterpreted as structural results about Gram spectrahedra. For instance, Corollary 2.4 recovers Theorem 3.5 in [CPSV17].
Pythagoras numbers also appear in the study of metric embeddings of graphs. As explained in Section 1 of [LV14], deciding whether a simple graph has an isometric embedding into the (r − 1)-dimensional spherical metric space is tantamount to solving a matrix completion problem. Specifically, given a graph G with n + 1 vertices, one seeks the smallest number r ∈ N such that, for any positive-semidefinite matrix M, there exists a positive-semidefinite matrix N of rank r satisfying M i,i = N i,i for all 1 i n + 1 and M i, j = N i, j for each edge {i, j} in the graph G. Determining the Pythagoras number of the subvariety X G ⊆ P n , defined as zero-locus of the quadratic monomials x i x j for every pair {i, j} of distinct vertices that do not form an edge in the graph G, is the algebrogeometric reformulation. Example 2.13 and Example 2.14 specialize the bounds in Theorem 1.1 for cycles and the Petersen graph respectively. Providing even further evidence of the broad scope of the geometric approach, Corollary 2.11 rediscovers Lemma 2.7 in [LV14] and Remark 2.12 raises an enticing analogy between the treewidth of a graph and the dimension of a 2-regular variety.
Organization. Section 2 proves all three of the upper bounds in Theorem 1.1. Examples show that these upper bounds on the Pythagoras number of a real subvariety can be sharp and are frequently inequivalent. In Section 3, we introduce quadratic persistence, outline the essential properties of this new numerical invariant, and derive the lower bounds appearing in Theorem 1.3. Section 4 relates the quadratic persistence of a complex subvariety to the linear syzygies of its homogeneous ideal via the Bernstein-Gelfand-Gelfand correspondence. Finally, Section 5 hones our bounds on the quadratic persistence for some projective toric subvarieties.
Conventions. Throughout the article, the set of nonnegative integers denoted by N. For any n ∈ N, let S := R[x 0 , x 1 , . . . , x n ] be the polynomial ring with the standard N-grading induced by setting deg(x i ) = 1 for all 0 i n. A real quadratic function f is positive semidefinite if it is nonnegative on R n+1 . We write S + for the closed convex cone of positive-semidefinite forms in S 2 .
A real projective subvariety X ⊆ P n := Proj(S) is a reduced subscheme of projective space over the field R of real numbers. Likewise, a complex projective subvariety X ⊆ P n := Proj(C[x 0 , x 1 , . . . , x n ]) is a reduced subscheme of projective space over the field C of complex numbers. We do not require a variety to be irreducible. A projective subvariety is non-degenerate if it is not contained in a hyperplane. The variety X is totally real if the set X(R) of real points is Zariski dense in its set X(C) of complex points or, equivalently, if every irreducible component of X has a nonsingular real point.

UPPER BOUNDS ON THE PYTHAGORAS NUMBER
We provide three different upper bounds on the Pythagoras number of a projective subvariety. In addition, we specialize these results to obtain concrete upper bounds on the Pythagoras numbers of several classes including varieties of small degree, projective curves, varieties associated to graphs, and toric subvarieties. We also show that these bounds are often sharp and, in general, incomparable.
An upper bound through convex geometry. To establish our first bound, we exploit the existence of low-rank matrices on sufficiently large affine subspaces of quadratic forms that intersect the cone S + of positive-semidefinite forms. Given a real subvariety X ⊆ P n , we write I X for its saturated homogeneous ideal in S := R[x 0 , x 1 , . . . , x n ] and R := S/I X denotes its homogeneous coordinate ring. Let Σ X := f ∈ R 2 there exist g 1 , g 2 , . . . , g r ∈ R 1 such that f = g 2 1 + g 2 2 + · · · + g 2 r be the convex cone of sums of squares in R 2 and define the Pythagoras number of the variety X to be py(X) := min r ∈ N for all f ∈ Σ X , there exists g 1 , g 2 , . . . , g r ∈ R 1 such that f = g 2 1 + g 2 2 + · · · + g 2 r .
We first strengthen the non-strict inequality derived from Theorem 4.4 and Corollary 5.3 in [CLR95].
Theorem 2.1. Let X ⊆ P n be a real subvariety such that X(R) is non-degenerate. When the ideal I X contains at least one nonzero quadratic form, we have the inequality py(X)+1 Proof. Set I := I X , let η 2 : S 2 → R 2 = S 2 /I 2 denote the degree-two piece of the canonical quotient map, and set r := py(X) − 1. Fix a nonzero f ∈ Σ X . Since X is non-degenerate, there exists a polynomial representative f ∈ S 2 such that η 2 (f ) = f andf is also a sum of squares. Each nonzero quadratic form in S corresponds to a real symmetric (n + 1) × (n + 1)-matrix and this form is a sum of squares in S if and only if the matrix is positive semidefinite. Better yet, the form is a sum of r squares if and only if the corresponding positive-semidefinite matrix has rank r. Let A be the affine subspace of symmetric matrices corresponding tof + I 2 , that is all polynomial representatives of f . By construction, the affine subspace A has dimension equal to dim R (I 2 ) and codimension equal to dim R (R 2 ). Moreover, A has a nonempty intersection with the cone S + of positive-semidefinite matrices because f ∈ Σ X . Since X(R) is non-degenerate, the vector space I 2 does not contain a sum of squares and the intersection A ∩ S + is compact. If codim(A) = dim R (R 2 ) < py(X)+1 2 = r+2 2 , then Proposition II.13.1 in [Bar02] implies that there exists a matrix in A ∩ S + with rank at most r = py(X) − 1. However, this would contradict the definition of the Pythagoras number, so we deduce that codim(A) = dim R (R 2 ) py(X)+1 2 = r+2 2 . It remains to prove that the equality codim(A) = dim R (R 2 ) = r+2 2 = py(X)+1 2 is also impossible. If r = 0 and dim R R 2 = 1, then the Macaulay Characterization Theorem [HH11, Theorem 6.3.8] shows that the Hilbert function of X equals 1 for all integers greater than 1, so X is a single point and, hence, degenerate. Finally, suppose that r > 0 and dim R R 2 = r+2 2 . Since every quadratic form in S 2 has rank at most n + 1, we see that py(X) n + 1. However, the ideal I contains, by hypothesis, at least one nonzero quadratic form, so it follows that py(X) < n + 1 and r + 2 n + 1.
Thus, Proposition II.13.4 in [Bar02] proves that there is a matrix in A ∩ S + with rank at most r = py(X) − 1 which again contradicts the definition of the Pythagoras number.
An upper bound from differential topology. To prove our second bound, we rely on a topological argument originating in Hilbert's proof [Hil88] that every nonnegative ternary quartic is a sum of 3 squares. More recently, Theorem 3.5 in [CPSV17] and Section 2 in [BPSV17] develop variants. Our version depends on a technical property of a basepoint-free linear series; compare with the p-base-point-free property in Subsection 1.2 of [BSV17]. Following Definition 6.0.23 in [CLS11], a linear series W ⊆ R 1 is basepoint-free if the linear forms in W have no common zeroes (neither real nor complex) on the underlying variety X.
Theorem 2.2. Let X ⊆ P n be a real subvariety such that X(R) is non-degenerate. If k ∈ N is the smallest integer such that any basepoint-free linear series W ⊆ R 1 of dimension k generates all of R 2 , then we have py(X) k.
Proof. Any linear series of dimension at most dim(X) determines a nonempty subscheme of X, so we may assume that k > dim(X) and a general linear series in R 1 of dimension k is basepoint-free. For any positive integer r, let ς r : r i=1 R 1 → R 2 be the map defined by ς (g 1 , g 2 , . . . , g r ) = ∑ r i=1 g 2 i . It suffices to prove that Im(ς k ) = Σ X .
We begin with a connectedness observation. Since X(R) is non-degenerate, we may regard ς r as a continuous map from P( r i=1 R 1 ) to P(R 2 ) where both spaces are endowed with the Euclidean topology as in Lemma 2.2 of [BPSV17]. As a continuous map between compact Hausdorff spaces, it is both proper and closed. The differential dς r at the point (g 1 , g 2 , . . . , g r ) sends the r-tuple of linear forms (h 1 , h 2 , . . . , h r ) to the sum 2 ∑ r i=1 h i g i , so the image is the graded component of the ideal generated by linear forms, namely the R-vector space g 1 , g 2 , . . . , g r 2 . The defining condition for k implies that the differential dς k is surjective at all points (g 1 , g 2 , . . . , g k ) where the homogeneous polynomials g 1 , g 2 , . . . , g k are linearly independent and do not have a common zero on X. If Λ denotes the branch locus of ς k and ∆ is the Zariski closure of all quadratic forms that are singular at a smooth point of X (also known as the discriminant variety), then Φ := Σ X \(Λ ∪ ∆) is a dense subset of Σ X in the Euclidean topology. The implicit function theorem shows that the subset Im(ς k ) ∩ Φ is open. The subset Im(ς k ) ∩ Φ is also closed (in Φ) because the map ς k is closed and the hypothesis that k > dim(X) ensures that it is nonempty. Thus, the intersection Im(ς k ) ∩ Φ is a union of connected components of Φ.
Using this connectivity, we complete the proof. A real quadratic form lies in ∆ ∩ int(Σ X ) if and only if there exists a conjugate pair of complex points in X at which it is singular, so the set ∆ ∩ int(Σ X ) has codimension at least 2 in R 2 . Since dim Σ X = dim R R 2 , we see that Σ X \∆ is connected. If Φ is also connected, as occurs when the branch locus Λ is empty, then we have Φ ⊆ Im(ς k ). If not, then Λ is a divisor and two connected components of Φ are separated by an irreducible component Z of the branch locus Λ. In particular, there is a real smooth point z on the hypersurface Z lying in int(Σ X ) \ ∆. Since z ∈ Λ \ ∆, there exists g 1 , g 2 , . . . , g k ∈ R 1 having no common zero in X such that z = g 2 1 + g 2 2 + · · · + g 2 k , but the R-vector space g 1 , g 2 , . . . , g k 2 ⊂ R 2 has codimension 1 contradicting the defining condition for k. It follows that Λ ⊂ ∆, which implies that Φ is connected. Since Φ is dense in Σ X and ς k is closed, we conclude that Im(ς k ) = Σ X .
The bound in Theorem 2.2 is hard to determine precisely. Nonetheless, it is related to the Green-Lazarsfeld index, which is defined to be a(X) := max { j ∈ N | Tor S k (R, R) 2+k = 0 for all k j} . In other words, a(X) is the largest k ∈ N such that the homogeneous ideal I X is generated by quadrics and the first k − 1 maps in its minimal free resolution are represented by matrices of linear forms; see Remark 4.1 and page 155 in [Eis05].
Corollary 2.3. For any real subvariety X ⊆ P n such that X(R) is non-degenerate, we have Proof. Theorem 6 in [BSV17] shows that any basepoint-free linear series of dimension n + 1 − k generates all of R 2 when the homogeneous ideal I X is generated by quadrics and its first k − 1 syzygies are linear. Thus, the assertion follows immediately from Theorem 2.2.
Corollary 2.4. Let X ⊆ P n be an irreducible real subvariety such that X(R) is non-degenerate. If X is arithmetically Cohen-Macaulay and deg X = 2 + codim X, then we have py(X) 2 + dim(X).
Proof. When X is hypersurface, the statement is trivial. If X is not a hypersurface, then Theorem 4.3 in [HK12] shows that X is an arithmetically Cohen-Macaulay variety such that deg X = 2 + codim X if and only if a(X) = codim(X) − 1. Hence, Corollary 2.3 establishes that py(X) 2 + dim(X).
Upper bounds via embeddings. Our third bound comes from embeddings into a special type of variety. We start with an elementary inequality among Pythagoras numbers.
Lemma 2.5. An inclusion of real subvarieties X ⊆ X ⊆ P n produces the inequality py(X) py(X ).
Proof. Let R := R[x 0 , x 1 , . . . , x n ]/I X denote the homogenenous coordinate ring of X in P n . The inclusion X ⊆ X corresponds to an N-graded surjective ring homomorphism ϕ : R → R, so every square in R is the image of a square in R and Σ X = ϕ(Σ X ). If an element f ∈ Σ X satisfies f = ϕ( f ) for some f ∈ Σ X and f can be expressed as a sum of k squares, then we obtain an expression for g involving at most k squares by applying ϕ. It follows that py(X) py(X ).
To capitalize on this lemma, we need to know the Pythagoras numbers for a class of subvarieties. With this in mind, a subvariety X ⊆ P n is 2-regular (in the sense of Castelnuovo-Mumford) if its homogeneous ideal I X is generated by quadratic polynomials and all the maps in its minimal free resolution are represented by matrices of linear forms or, equivalently, a(X ) = ∞; see Section 4A in [Eis05]. Fortuitously, Corollary 32 in [BSV17] shows that the Pythagoras number for any totally-real 2-regular subvariety X is 1 + dim(X ). Motivated by this, our third bound revolves around embeddings into 2-regular subvarieties.
Theorem 2.6. For any real subvariety X ⊆ P n such that X(R) is non-degenerate, its Pythagoras number py(X) is at most one more than the minimum dimension of any real 2-regular variety that contains it.
Proof. Let X be a real 2-regular variety such that X ⊆ X ⊆ P n . Since a(X ) = ∞, Corollary 2.3 gives py(X ) n + 1 − codim X = 1 + dim(X ) and Lemma 2.5 completes the proof.
Proof of Theorem 1.1. Theorem 2.1 proves the first part, Corollary 2.3 proves the second, and Theorem 2.6 proves the third.
For irreducible subvarieties, we can improve this bound. A projective subvariety X ⊂ P n has minimal degree if it is non-degenerate and deg X = 1 + codim X . Theorem 0.4 in [EGHP06] gives a complete classification of 2-regular varieties: the irreducible components are varieties of minimal degree that meet in a particularly simple way. Therefore, to bound the Pythagoras number of an irreducible subvariety, one need only consider the varieties of minimal degree that contain it. Moreover, the Del Pezzo-Bertini Theorem [EH87, Theorem 1] proves that an irreducible variety of minimal degree is either a quadric hypersurface, a rational normal scroll, or a cone over the Veronese surface P 2 ⊂ P 5 . Concentrating on just the rational normal scrolls that contain an irreducible variety produces the next bound. As in Section 6C in [Eis05], a projective subvariety X ⊆ P n is linearly normal if the canonical map H 0 P n , O P n (1) → H 0 X, O X (1) is surjective Corollary 2.7. Let X ⊆ P n be a non-degenerate irreducible real subvariety. If X is linearly normal, then the Pythagoras number py(X) is at most Proof. In light of Theorem 2.6, it suffices to prove that the dimension of a rational normal scroll containing X equals n + 1 − dim R H 0 X, O X (1) ⊗ L −1 for some real line bundle L on X satisfying dim R H 0 (X, L) 2. Paragraph 2.2 in [Sch86] indicates that we can construct from any pencil of divisors in |L| on X satisfying dim R H 0 (X, O X (1) ⊗ L −1 2 a rational normal scroll X ⊆ P n which contains X. Since X is variety of minimal degree and deg(X To illustrate this corollary, we specialize to curves whose hyperplane section is non-special. Emulating the definition in Section 8C in [Eis05], the real gonality of a real curve is the lowest degree of a real non-constant morphism from the curve to the real projective line. In particular, the real gonality of a real curve X ⊆ P n is at least the gonality of its complexification X × Spec(R) Spec(C).
Corollary 2.8. Let X ⊂ P n be a linearly-normal irreducible non-singular real curve of genus g and real gonality δ . If X has degree at least 2g − 1 + δ , then we have py(X) 1 + δ .
Proof. Since the real gonality of X is δ , there is a non-constant morphism ϖ : X → P 1 of schemes over R having degree δ . Fix a real divisor D in the complete linear series of the real line bundle 2 and the line bundle O X (D − Q) would define a real morphism to P 1 of smaller degree. Let H be a hyperplane section of X and let K be the canonical divisor on X. It follows that deg(H) 2g − 1 + δ and deg(K) = 2g − 2, so deg(K − H + D) < 0 and Therefore, Corollary 2.7 establishes that py( For a canonical curve (a non-hyperelliptic smooth curve of genus g at least 3 embedded by its canonical linear series), we get a slightly better bound.
Corollary 2.9. If X ⊂ P g−1 is a canonical real curve of real gonality δ , then we have py(X) δ .
Proof. Just as in the proof of Corollary 2.8, let D denote a real divisor on the curve X of degree δ such that dim R H 0 X, O X (D) = 2. Since the canonical divisor K on X corresponds to a hyperplane section, the Riemann-Roch Theorem shows that Thus, Corollary 2.7 demonstrates that py(X) (g − 1) For general real canonical curves, we can compare our three bounds.
Specific bounds for graphs. Restricting our attention to certain unions of coordinate spaces allows us to compare our three bounds on the Pythagoras number. We focus on varieties defined by the Stanley-Reisner ideal of the clique complex of a graph or, equivalently, the edge ideal of the complementary graph. Remarkably, all three bounds have explicit formulations in terms of well-known numerical invariants of the underlying graph.
To be more precise, let G be a graph (with no multiple edges or loops) whose vertex set is {0, 1, . . . , n}. The homogeneous ideal I G in S := R[x 0 , x 1 , . . . , x n ] is generated by the quadratic monomials x i x j for every pair {i, j} of distinct vertices that do not form an edge in the graph G; see Section 9.1 in [HH11]. The associated subvariety is X G := V(I G ) ⊆ P n and its homogeneous coordinate ring is R G := R[x 0 , x 1 , . . . , x n ]/I G . If the graph G also has m edges, then the definition of the ideal I G implies that dim R (R G ) 2 = n+2 2 − n+1 2 + m = n + m + 1. Hence, the first bound derived from Theorem 2.1 is Using 'Gram dimension' as a synonym for the Pythagoras number, this bound also appears in the introduction to [LV14].
For the second bound, we translate both the Green-Lazarsfeld index and the dimension of X G into numerical graph invariants. To do this for the index a(X G ), recall that a cycle in the graph G of length m 3, as defined in Section 1.3 of [Die17], is determined by a sequence of distinct is an edge in the graph. An edge that joins two vertices of a cycle but is not itself an edge of the cycle is called a chord and an induced cycle has no chords. Theorem 2.1 in [EGHP05] proves that the Green-Lazarsfeld index a(X G ) is 3 less than minimal length of an induced cycle in G having length at least 4. To reinterpret dim(X G ), recall that a clique in the graph G is a subset of vertices such that every pair of distinct vertices forms an edge and the clique number ω(G) is the number of vertices in a maximum clique; see Section 5.5 in [Die17]. Lemma 1.5.4 in [HH11] shows that the primary decomposition of I G is the intersection of monomial prime ideals generated by the variables corresponding to the complement of a maximum clique, so dim(X G ) = ω(G) − 1. Thus, if ι(G) is the minimal length of an induced cycle in G having length at least 4, then Corollary 2.3 gives The third type of bound depends on a more subtle numerical invariant of G. A graph is chordal if every induced cycle has exactly three vertices; again see Section 5.5 in [Die17]. Proposition 12.4.4 in [Die17] demonstrates that the treewidth of G is one less than the size of the largest clique in a chordal graph containing G with the smallest clique number. In this setting, the explicit form of the third bound rediscovers Lemma 2.7 in [LV14].
Corollary 2.11. For any graph G, the Pythagoras number py(X G ) of its associated subvariety is at most one more than the treewidth of the underlying graph G.
Proof. The definition of Stanley-Reisner ideals implies that one has an containment of graphs G ⊆ G if and only if one has a containment of varieties X G ⊆ X G . The Fröberg Theorem [HH11, Theorem 9.2.3] asserts that the Stanley-Reisner ideal I G is 2-regular if and only if the graph G is chordal. Therefore, the minimum dimension of any real 2-regular variety containing X G is at most the treewidth of G and appealing to Theorem 2.6 finishes the proof.
Remark 2.12. Corollary 2.11 demonstrates that the upper bound in Theorem 2.6 specializes to the treewidth of a graph. For a non-degenerate subvariety X ⊆ P n , to what extent is this numerical invariant, namely one more that the minimum dimension of any 2-regular variety in P n that contains X, the natural geometric generalization of treewidth?
We contrast our three bounds on Pythagoras numbers for some specific graphs.
Example 2.13 (Bounds for cycles). For any integer n 3, suppose that the graph G is a cycle on n + 1 vertices. Since G also has n + 1 edges, the first bound is py( The minimum length of an induced cycle is n + 1 and ω(G) = 2, so the second bound becomes py(X G ) 3. Lastly, adjoining all the chords incident to a fixed vertex yields a chordal graph containing the cycle, so the treewidth of G is at most 2 and the third bound also is py(X G ) 3. In particular, the first bound is weaker than the other two bounds.
Example 2.14 (Bounds for the Petersen graph). Suppose that the graph G is the Petersen graph; see Figure 6.6.1 in [Die17]. Since G has 10 vertices and 15 edges, the first bound is py(X G ) 6. The minimum length of an induced cycle is 5 and ω(G) = 2, so the second bound becomes py(X G ) 8. Lastly, the treewidth of the Petersen graph is known to be 4 (for example see Section 3 in [HW14]), so the third bound is py(X G ) 5. Here the third bound is stronger than the other two bounds.
Specific bounds for toric subvarieties. By concentrating on projective toric subvarieties, we can relate our bounds to the numerical invariants of a lattice polytope. Consider a lattice polytope P ⊂ R d containing n + 1 lattice points, so n := P ∩ Z d − 1. Influenced by Definition 2.1.1 in [CLS11], the associated toric subvariety X P∩Z d ⊆ P n is the Zariski closure of the image of the map from the d-dimensional algebraic torus to P n given by We caution that the variety X P∩Z d may not be normal; see Definition 2.3.14 in [CLS11] for the canonical normal toric variety associated to P. Regardless, if R := R[x 0 , x 2 , . . . , x n ]/I X P∩Z d is the homogeneous coordinate ring of the subvariety X P∩Z d ⊆ P n , then m := dim R (R 2 ) equals the number of points in the Minkowski sum (P ∩ Z d ) + (P ∩ Z d ); compare with Theorem 1.1.17 in [CLS11]. Hence, the first bound derived from Theorem 2.1 is py(X P∩Z d ) For the second bound, we would need a polyhedral interpretation of the Green-Lazarsfeld index a(X P∩Z d ). Sadly, we are unaware of even a reasonable conjectural lower bound for an general projective toric subvariety. However, for toric surfaces embedded in projective space, Corollary 2.1 in [Sch04] proves that a(X P∩Z d ) is 3 less than the number of lattice points on the boundary of the polygon P. Thus, if i(P) denotes the number of lattice points on the interior of the polygon P, then Corollary 2.3 gives py(X P∩Z d ) i(P) + 3.
The third bound depends on estimating the dimension of the smallest rational normal scroll than contains the subvariety X P∩Z d . Once again, this bound can be found analyzing the lattice points.
Corollary 2.15. For any lattice polytope P ⊂ R d , its projective toric subvariety X P∩Z d is contained in a rational normal scroll whose dimension is equal to the minimal number of parallel lines needed to cover all of the lattice points in P, so the Pythagoras number py(X P∩Z d ) is at most one more than the dimension of this rational normal scroll.
Proof. Applying Theorem 2.6, it suffices to find a rational normal scroll containing X P∩Z d whose dimension is equal to the minimal number of parallel lines needed to cover all of the lattice points in P. Suppose that the lattice points in P are covered by k lines parallel to the vector v ∈ R d . We may assume that v is a primitive lattice vector. For each index 0 i < k, let a i be the lattice length of the corresponding line segment covering lattice points in P. By relabeling the lines, we may also assume that a k−1 a k−2 · · · a 0 0. Let e 1 , e 2 , . . . , e k denote the standard basis for Z k and consider the lattice polytope P := conv {0, e 1 , e 2 , . . . , e k−1 , a 0 e k , e 1 + a 1 e k , e 2 + a 2 e k , . . . , e k−1 + a k−1 e k } ⊂ R k .
By construction, the Lawrence prism P is the normal full-dimensional lattice polytope of a rational normal scroll. The affine map, which sends e k to v and the lattice points 0, e 1 , e 2 , . . . , e k−1 to the minimal points in P relative to the vector v on the corresponding line, defines a bijection between the lattice points in the polytopes P and P and, thereby, induces a toric inclusion X P∩Z d ⊆ X P ∩Z k .
Remark 2.16. Since every line bundle on a toric variety is the image of a torus-invariant Cartier divisor (see Theorem 4.2.1 in [CLS11]), modifying the proof of Corollary 2.7 shows that, among all rational normal scrolls containing a toric variety, there is one having minimal dimension such that the inclusion map is a toric morphism. Hence, the minimal number of parallel lines needed to cover all the lattice points in the polytope P is the dimension of the smallest rational normal scroll containing the toric variety X P∩Z d .
Example 2.17 (Upper bounds for the Veronese embeddings of P 2 ). For any integer j 2, consider the lattice polygon P := conv{(0, 0), ( j, 0), (0, j)} ⊂ R 2 . The associated toric subvariety X P∩Z 2 is the j-th Veronese embedding This polygon has j−1 2 interior lattice points, so the second bound is py(X P ) j−1 2 + 3. Lastly, j + 1 horizontal lines cover all the lattice points in P, so the third bound is py(X P∩Z 2 ) j + 2. For j = 2, the second bound is stronger than the other two and is optimal because X P∩Z 2 is a variety of minimal degree. On the other hand, the third bound is at least as strong as the other two for all j 3. For lower bounds on the Pythagoras number of the Veronese embeddings of P 2 , see Example 5.11.

QUADRATIC PERSISTENCE
This section introduces a numerical invariant of a projective subvariety, which we call the quadratic persistence. By definition, this invariant encodes information about the behaviour of the variety under projections away from certain linear subspaces. After summarizing the fundamental features of this new invariant, we analyze varieties with large quadratic persistence and find a lower bound on the Pythagoras number of an irreducible totally-real variety.
Properties of quadratic persistence. Let X ⊆ P n be a complex subvariety prescribed by the saturated homogeneous ideal I X in polynomial ring C[x 0 , x 1 , . . . , x n ]. For any subset Z ⊆ P n , the intersection of all linear subspaces of P n which each contain every point in Z is denoted by Span(Z). Given a finite set Γ of closed points in X spanning a (k − 1)-plane and a complementary linear subspace P n−k in P n , the projection away from Γ is the rational map π Γ : P n P n−k defined by sending a closed point q ∈ P n \ Span(Γ) to the intersection of P n−k with the k-plane Span({q} ∪ Γ).
To be notational consistent, we write I π Γ (X) for the saturated homogeneous ideal of the image π Γ (X) ⊆ P n−k . With these preparations, we now present the key numerical invariant.
Definition 3.1. For a complex subvariety X ⊆ P n , the quadratic persistence qp(X) is the smallest k ∈ N for which there exists a finite set Γ of closed points in X such that k = |Γ| and the homogeneous ideal I π Γ (X) contains no quadratic polynomials.
The definition of quadratic persistence leads to some easy inequalities.
Lemma 3.2. Let X ⊆ P n be a complex subvariety.
i. If X is non-degenerate, then we have the upper bound qp(X) codim(X).
ii. An inclusion of varieties X ⊆ X produces the inequality qp(X ) qp(X).

Proof.
i. Fix an irreducible component Z of X. Since X is non-degenerate, there is a set Γ of closed points in X \ Z such that |Γ| = codim Span(Z), P n and Span(Γ ∪ Z) = P n . For any set Γ of closed points in Z such that |Γ | = codim Z, Span(Z) and the projection away from Γ is dominant when restricted to Z, the projection away from Γ ∪ Γ is also dominant when restricted to Z because codim Span(Z), P n + codim Z, Span(Z) = codim Z, P n . Thus, the ideal I π Γ∪Γ (X) contains no quadratic polynomials and qp(X) codim(Z, P n ). ii. For any finite set Γ ⊆ X ⊆ X , we have I π Γ (X) ⊇ I π Γ (X ) which gives qp(X) qp(X ).
To better understand quadratic persistence, we examine an auxiliary function that counts the quadrics kept under an inner projection. More precisely, for any finite subset Γ of closed points in X, set λ Γ (X) := dim(I π Γ (X) ) 2 . Beyond recording the basic attributes of this function, the following result shows that the quadratic persistence of an irreducible subvariety is computed by projecting away from a general set of closed points. Part v appears implicitly in Theorem 3.1 (a) of [HK15].
Lemma 3.3. Let X ⊆ P n be a complex subvariety.
i. For any finite set Γ of closed points in X, the number λ Γ (X) is the dimension of the linear subspace spanned by the quadrics in I X that are singular in P n at the points of Γ.
ii. An inclusion Γ ⊆ Γ of finite subsets of X gives the inequality λ Γ (X) λ Γ (X). iii. For any r ∈ N, the function that sends the r-tuple (p 1 , p 2 , . . . , p r ) ∈ X r of closed points to λ {p 1 ,p 2 ,...,p r } (X) is upper semi-continuous. iv. For any r ∈ N, the locus in X r on which the function (p 1 , p 2 , . . . , p r ) → λ {p 1 ,p 2 ,...,p r } (X) achieves its minimum is Zariski open. v. For any finite set Γ of closed points in X, we have qp(X) |Γ| + qp π Γ (X) . vi. For any closed point p ∈ X, the difference dim C (I X ) 2 − λ {p} (X) is the dimension of the linear subspace spanned by the gradients of the quadrics in I X evaluated at an affine representative of the point p. vii. For any closed point p ∈ X, we have dim C (I X ) 2 − λ {p} (X) codim X. Proof.
i. Choose coordinates x 0 , x 1 , . . . , x n on P n so that the linear subspace spanned by Γ is cut out by the variables x k−1 , x k , . . . , x n . It follows that I π Γ (X) = I X ∩ C[x k−1 , x k , . . . , x n ]; see Theorem 8.5.8 in [CLO15]. Hence, the graded piece (I π Γ (X) ) 2 consists of the quadratic polynomials in I X that do not involve the variables x 0 , x 1 , . . . , x k−2 . These are precisely the quadrics in I X that are singular along the linear subspace spanned by Γ or, equivalently, at the points in Γ.
ii. Since Γ ⊆ Γ , the quadrics in I X singular along Γ are contained among those singular along Γ, so part i implies that λ Γ (X) λ Γ (X). iii. For any r ∈ N, consider the incidence correspondence Ψ r ⊆ P (I X ) 2 × X r consisting of all pairs f , (p 1 , p 2 , . . . , p r ) where the quadratic polynomial f ∈ I X is singular at all of the closed points p 1 , p 2 , . . . , p r ∈ X. Part i implies that the value of (p 1 , p 2 , . . . , p r ) → λ {p 1 ,p 2 ,...,p r } (X) is equal to one more than the dimension of the fiber of the projection pr 2 : Ψ r → X r . The claim follows from the semi-continuity of fibre dimensions; see Théorème 13.1.3 in [Gro66]. iv. We consider two distinct cases. First, suppose that the image pr 2 (Ψ r ) is a proper closed subset of the product X r . If Γ is a general set of r points on X, then the ideal I π Γ (X) contains no quadratic polynomials and the function (p 1 , p 2 , . . . , p r ) → λ {p 1 ,p 2 ,...,p r } (X) attains its minimum 0 on the complement of the image which is a Zariski open set. Otherwise, we have pr 2 (Ψ r ) = X r . In this case, the minimum of the function (p 1 , p 2 , . . . , p r ) → λ {p 1 ,p 2 ,...,p r } (X) is some i ∈ N. This minimum is attained on the complement of the sets Γ ⊆ X r of closed points with image greater than or equal to i + 1, which is closed by part iii. v. Let Γ ⊆ π Γ (X) be a set of closed points such that |Γ | = qp π Γ (X) and the homogeneous ideal I π Γ (π Γ (X)) contains no quadrics. Using part iv, we may assume that the subset Γ lies in the image of the rational map π Γ . For each closed point in Γ , choose a closed point in its fibre contained in X, so that the resulting finite set Γ ⊆ π −1 Γ (Γ ) ∩ X has the same cardinality as Γ and π Γ (Γ ) = Γ . It follows that π Γ∪Γ (X) = π Γ π Γ (X) , so there are no quadratic polynomials in I π Γ∪Γ (X) . Therefore, we conclude that qp(X) |Γ ∪ Γ | = |Γ| + |Γ | = |Γ| + qp π Γ (X) . vi. Choose an affine representative p ∈ A n+1 of the point p ∈ P n and let ∇| p : (I X ) 2 → T * P n ,p be the map defined by sending the quadratic polynomial f to its gradient ∇ f ( p). Part i implies that the kernel of this map is (I π {p} (X) ) 2 , so dim C (I X ) 2 − dim C (I π Γ (X) ) 2 = rank(∇| p ). vii. Since every point in T X,p is annihilated by the gradient ∇ f ( p), the image of ∇| p is contained in (T P n ,p /T X,p ) * and dim C (I X ) 2 − λ {p} (X) codim X.
As an application, we characterize the projective subvarieties having quadratic persistence one.
Corollary 3.4. The quadratic persistence of a complex subvariety X ⊆ P n equals one if and only if the vector space (I X ) 2 is nonempty and the hypersurfaces corresponding to a basis for (I X ) 2 intersect transversely at a generic point in X.
Proof. For notational brevity, set I := I X . By definition, the equality qp(X) = 0 is equivalent to the vector space I 2 being empty. Hence, the equality qp(X) = 1 ensures that, for a generic point p ∈ X, we have λ {p} (X) = 0. Let p ∈ A n+1 be an affine representative of the point p ∈ P n . If m := dim C (I 2 ) and the polynomials f 1 , f 2 , . . . , f m form a basis for I 2 , then Part vi of Lemma 3.3 establishes that the gradients ∇ f i ( p), for all 1 i m, are linearly independent.
We assemble the number of quadrics kept under successive inner projections into a sequence. For a non-degenerate irreducible complex subvariety X ⊆ P n , set λ j (X) := λ Γ j (X) where Γ j is any general set of closed points on X having cardinality j and let λ (X) := λ 0 (X), λ 1 (X), λ 2 (X), . . . ∈ N N . Part iv of Lemma 3.3 proves that the sequence λ (X) is independent of the choice of the general sets. We verify that λ (X) is a strictly-convex integer partition with distinct parts.
Proof. Again for brevity, let k := qp(X) and let λ j := λ j (X) for all j ∈ N. Choose a general set Γ k := {p 1 , p 2 , . . . , p k } ⊆ X of closed points and set Γ j := {p 1 , p 2 , . . . , p j }. Part ii of Lemma 3.3 demonstrates that λ j λ j+1 and the definition of quadratic persistence implies that λ j = 0 if and only if j qp(X). If λ j = λ j−1 for some 0 < j k, then Part vi of Lemma 3.3 produces a nonzero quadratic polynomial f ∈ I X which is singular at the closed point p j . Since the singular locus of f is a linear subspace of P n , we conclude that π Γ j−1 (X) is degenerate, which contradicts the hypothesis that X is non-degenerate or the genercity of Γ k . It follows that λ j−1 > λ j for all 0 < j k.
To prove convexity, it suffices to show that, for all 0 < j k, the difference ∆ λ j := λ j − λ j−1 is strictly increasing. Let W j denote the linear subspace of quadrics in (I X ) 2 that are singular at the point p j . Hence, Part i of Lemma 3.3 gives The latter relation holds if and only if W ⊥ j ∩ W ⊥ j+1 = 0 which, by duality, is the same as saying that (V ∩W j ) + (V ∩W j+1 ) = V . We establish this last inequality by contradiction. Assuming that (V ∩W j ) + (V ∩W j+1 ) = V , every quadratic polynomial f ∈ V can be written as f = f j + f j+1 where f i ∈ V ∩W i . Since f is homogeneous, we see that it vanishes on the entire line passing through the closed points p j and p j+1 . In other words, each quadratic polynomial in V vanishes on the secant variety of π Γ j−1 (X). However, Lemma 2.2 in [LM03] confirms that this contradicts the hypothesis that X is non-degenerate.
Remark 3.6. The sequence λ (X) is closely related to the gap vector introduced in [BIJV15]. To be more explicit, we must assume that X ⊆ P n is a non-degenerate totally-real variety having codimension c. If g(X) := g 1 (X), g 2 (X), . . . , g c (X) is the gap vector from Definition 1.1 of [BIJV15], then Theorem 1.6 in [BIJV15] implies that for all 1 j c, and Theorem 1.7 in [BIJV15] proves that λ (X) is an integer partition with distinct parts. However, the convexity of λ (X) reveals that the gap vector is also convex. For instance, the existence of an index i such that g i−1 (X) = g i (X) implies that g j (X) = 0 for all 1 j i.
Using the properties of the sequence λ (X), we see that the quadratic persistence bounds the dimension of the linear subspace of quadrics in the defining ideal of a variety.
Corollary 3.7. For a non-degenerate irreducible complex subvariety X ⊆ P n , we have Proof. Let c := codim(X), let k := qp(X), and let λ j := λ j (X) for all j ∈ N. We first bound the difference ∆ λ j for all 0 < j k. Choose a general set Γ k := {p 1 , p 2 , . . . , p k } ⊆ X of closed points. Setting Γ j := {p 1 , p 2 , . . . , p j } for all 0 < j k, we see that codim π Γ j−1 (X) = c − ( j − 1) and Part vii in Lemma 3.3 gives Combined with Proposition 3.5, we deduce that Varieties with large quadratic persistence. The bounds in Corollary 3.7 allow us to classify the subvarieties with maximal quadratic persistence. This classification simultaneously shows that the upper and lower bounds can coincide.
Theorem 3.8. For a non-degenerate irreducible complex subvariety X ⊆ P n , we have the equality qp(X) = codim(X) if and only if X has minimal degree, that is deg(X) = 1 + codim(X).
Proof. Set c := codim(X) and k := qp(X). The hypothesis k = c implies that kc − k 2 = k+1 2 , so the bounds in Corollary 3.7 are equal. It is well-known, going back to G. Castelnuovo, that the equality dim C (I X ) 2 = c+1 2 is equivalent to X being a variety of minimal degree; see Corollary 5.8 in [Zak99]. Conversely, assuming that X has minimal degree, we have dim C (I X ) 2 = c+1 2 and the bounds in Corollary 3.7 become 0 c+1 2 − k+1 2 kc − k 2 or 0 (c − k)(c + k + 1) (c − k)k. Since Part i in Lemma 3.2 establishes that c − k 0, the strict inequality c − k > 0 would imply that c + k + 1 k which is absurd. We conclude that c = k when X has minimal degree.
To expand on this classification, we look at another prominent numerical invariant of a variety. Following Section 3 of [BSV16], the quadratic deficiency of the projective subvariety X ⊆ P n is ε(X) := codim(X)+1 2 − dim C (I X ) 2 . From this perspective, Theorem 3.8 proves that ε(X) = 0 if and only if qp(X) = codim(X). For the subvarieties having small positive quadratic deficiency, we have the following one-way implication.
When ε(X) = 1, Proposition 3.9 shows that the upper bound in Corollary 3.7 is achieved. It also shows that the lower bound is attained when ε(X) = 2 and codim(X) = 2, which means that X is a complete intersection of two quadrics. Extending both cases, the subsequent family of varieties have almost maximal quadratic persistence and a minimal number of quadratic generators.
Example 3.11 (Extremal varieties with almost maximal quadratic persistence). Let X ⊂ P n be the intersection of a general hypersurface of degree at least two with a variety X ⊂ P n of minimal degree. If the hypersurface has degree greater than two, then it follows that (I X ) 2 = (I X ) 2 and When the hypersurface has degree two, we have dim C (I X ) 2 = 1 + dim C (I X ) 2 and In both cases, parts i and ii in Lemma 3.2 show that codim(X ) + 1 = codim(X) qp(X) qp(X ). Using Theorem 3.8 twice, we also see that codim(X) > qp(X) and qp(X ) = codim(X ). Thus, we surmise that qp(X) = codim(X ) = codim(X) − 1.
Under the additional assumption that X ⊆ P n is arithmetically Cohen-Macaulay, the two extremal possibilities become the only options. To explain this, we start on the 0-dimensional case with an analogue of the Strong Castelnuovo Lemma; see Theorem 3.c.6 in [Gre84].
Lemma 3.12. Let n 2 and let X ⊂ P n be a set of closed points in linearly general position. We have qp(X) n − 1 if and only if X lies on a rational normal curve.
Proof. When X lies on a rational normal curve C ⊂ P n , Part ii of Lemma 3.2 demonstrates that qp(X) qp(C) and Theorem 3.8 establishes that qp(C) = codim(C) = n − 1.
For the other implication, suppose that qp(X) n − 1. We proceed by induction on n. For n = 2, we have qp(X) 1 if and only if X lies on a quadratic curve, which is a rational normal curve in P 2 . We now assume that n > 2. Every set of n + 3 closed points in linearly general position in P n lies on a unique rational normal curve; see Theorem 1.18 in [Har95]. Hence, we may also assume that |X| > n + 3. Let Γ := {p 1 , p 2 , . . . , p n+3 } ⊂ X be a set of closed points and let C be the unique rational normal curve containing Γ. For any point p i ∈ Γ, the set X := π {p i } (X \ {p i }) is in linearly general position. Part v of Lemma 3.3 shows that qp(X ) qp(X) − 1 n − 2 and the induction hypothesis shows that the set X is contained in a rational normal curve C ⊂ P n−1 . As C and π {p i } (C) are rational normal curves passing through the n + 2 points in π {p i } (Γ \ {p i }), we see that C = π {p} (C). It follows that, for all p i ∈ Γ, the ideal I X contains the ideal of the cone over π {p i } (C) with vertex p i .
We next describe the ideals of π {p i } (C) more explicitly; compare with Exercise 1.25 in [Har95]. Fix two distinct points p 1 , p 2 ∈ Γ and an isomorphism ν : P 1 → C. Choose coordinates on P 1 such that ν([0 : 1]) = p 1 and ν([1 : 0]) = p 2 and choose coordinates on P n such that the morphism ν is given by [t 0 : t 1 ] → [t n 0 : t n−1 0 t 1 : · · · : t n 1 ]. In these coordinates, the ideals I C , I π {p 1 } (C) , and I π {p 2 } (C) are given by the maximal minors of the matrices x 0 x 1 · · · x n−1 x 1 x 2 · · · x n , x 1 x 2 · · · x n−1 x 2 x 3 · · · x n , and x 0 x 1 · · · x n−2 x 1 x 2 · · · x n−1 respectively. Setting J := I π {p 1 } (C) + I π {p 2 } (C) , the previous paragraph proves that J ⊆ I X . For all 1 j n − 1, we have x j x 0 x n = x j−1 x 1 x n = x j x n−1 x 1 (mod J), so x j (x 0 x n − x 1 x n−1 ) ∈ J and I C = J : x 1 , x 2 , . . . , x n−1 . Hence, the reduced scheme defined by J is the union of the rational normal curve C and the line through the closed points p 1 and p 2 . Since no three points of X are collinear and X ⊂ V(J), we deduce that X ⊂ C.
Remark 3.13. One cannot extend the argument in Lemma 3.12 to higher-dimensional varieties by constructing the determinantal representations of rational normal scrolls as in Example 9.15 of [Har95]. For instance, consider the irreducible curve X lying on the Veronese surface ν 2 (P 2 ) ⊂ P 5 obtained by intersecting ν 2 (P 2 ) with a general cubic hypersurface. For all closed points p ∈ X, the projection π {p} (X) is contained in a 2-dimensional rational normal scroll. However, the curve X is not contained in a 2-dimensional rational normal scroll, because the quadrics in I X define ν 2 (P 2 ).
We now turn to the higher-dimensional situation.
Theorem 3.14. For a non-degenerate irreducible complex subvariety X ⊆ P n that is arithmetically Cohen-Macaulay, we have qp(X) = codim(X) − 1 if and only if either ε(X) = 1 or X is a codimension-one subvariety in a variety of minimal degree.
Proof. Proposition 3.9 and Example 3.11 prove one direction. For the other direction, assume that qp(X) = codim(X) − 1. We proceed by induction on d := dim(X). The Bertini Theorem (Theorem 17.16 in [Har95]) implies that the intersection of X with d general hyperplanes yields a set Z of closed points in linearly general position. Since Lemma 3.12 demonstrates that the homogeneous ideal I Z contains the ideal of a rational normal curve in C, Corollary 1.26 in [AN10] proves that the linear strand in the minimal free resolution of the ideal I Z has at least codim(C) = codim(Z) − 1 nonzero terms. Because the d general hyperplanes form a regular sequence, Lemma 2.19 in [AN10] implies that the minimal free resolution of I X also has at least codim(Z) − 1 = dim(X) − 1 nonzero terms. Applying Green's K p,1 -Theorem (Theorem 3.c.1 in [Gre84]) shows that either deg(X) 2 + codim(X) or the variety X lies in a variety of minimal degree having dimension equal to 1 + dim(X). Theorem 3.8 precludes the possibility that deg(X) = 1 + codim(X), so the classification of varieties with quadratic deficiency 1 appearing in Remark 3.10 proves that ε(X) = 1.
Remark 3.15. Having almost maximal quadratic persistence dictates how many quadrics are kept under succesive projections. When qp(X) = codim(X) − 1, the sequence λ := λ (X) is given by Remark 3.16. Our results and examples of subvarieties with large quadratic persistence suggest a dichotomy. Either the ideal intrinsically has many quadratic polynomials or the variety has small codimension in another variety with large quadratic persistence. Perhaps the strongest statement of this form, consistent with our work, is the following: for any d ∈ N, the quadratic persistence of a non-degenerate irreducible complex subvariety X ⊆ P n is at least codim(X) − d if and only if ε(X) < d+2 2 or X is a hypersurface in a variety Y with quadratic persistence codim(Y ) − d + 1. It would be interesting to determine whether a statement of this form is true.
Lower bounds on Pythagoras numbers. To link the quadratic persistence of a subvariety to its Pythagoras number, we focus on an irreducible totally-real subvariety X ⊆ P n . When working over the real numbers, we typically focus on the real points in a variety. The next proposition shows that, for irreducible totally-real varieties, the quadratic persistence is insensitive to the distinction between real and complex points.
Lemma 3.17. For an irreducible totally-real subvariety X ⊆ P n , the quadratic persistence of X is equal to the smallest cardinality of a finite set Γ of real points in X such that the homogeneous ideal I π Γ (X) contains no quadratic polynomials.
Proof. The complexification of the real variety X is the complex variety X C := X × Spec(R) Spec(C) and Part iv in Lemma 3.3 establishes that qp(X C ) is the cardinality of the smallest general set Γ of closed points in X C such that the ideal I π Γ (X C ) contains no quadratic polynomials. Since the variety X is totally real if and only if the set X(R) of real points is Zariski dense, we may assume that the set Γ of closed points that determines the quadratic persistence contains only real points.
The strategy for creating lower bounds on the Pythagoras number involves restricting to faces in the cone Σ X . The crucial observation, for which variants already appear in Proposition 1.1 in [BIK15], Theorem 1.6 in [BIJV15], and Proposition 3.3 in [Sch17], is the following lemma. For any subset Γ of closed points in X, the projection π Γ : P n P n−k induces a monomorphism π Γ : R[y 0 , y 1 , . . . , y n−k ]/I π Γ (X) → R[x 0 , x 1 , . . . , x n ]/I X between the homogeneous coordinate rings.
Lemma 3.18. Let X ⊆ P n be a real subvariety. For any subset Γ of real points in X, the monomorphism π Γ identifies the sums-of-squares cone Σ π Γ (X) with the face in Σ X consisting of all quadratic polynomials vanishing at the points in Γ.
Proof. Let F ⊂ Σ X be the face of the sums-of-squares cone in R := R[x 0 , x 1 , . . . , x n ]/I X consisting of all quadratic polynomials vanishing at the points in Γ. As π Γ is homomorphism of N-graded rings, we see that π Γ (Σ π Γ (X) ) ⊆ F. Consider f = g 2 1 + g 2 2 + · · · + g 2 r ∈ F and fix p ∈ Γ. Since f vanishes at the real point p, we see that, for all 1 i r, the element g i also vanishes at p. Hence, the elements f , g 1 , g 2 , . . . , g r all lie in the image of the map π Γ , so we have F ⊆ π Γ (Σ π Γ (X) ). Theorem 1.3 rephrases this observation in terms of the quadratic persistence and provided our original motivation for Definition 3.1.
Proof of Theorem 1.3. Set k := qp(X). Lemma 3.17 ensures that exists a set Γ := {p 1 , p 2 , . . . , p k } of real points in X such that the ideal I π Γ (X) contains no quadratic polynomials. The non-degeneracy of X implies the non-degeneracy of π Γ (X), so the cone Σ π Γ (X) is equal to the sums-of-squares cone in P n−k . Since py(P n−k ) = n − k + 1, Lemma 3.18 establishes that py(X) n + 1 − k. Lastly, Part i of Lemma 3.2 proves that k codim(X), so py(X) 1 + n − codim(X) = 1 + dim(X).
As an immediate consequence, we can strengthen Theorem 1.1 in [BPSV17].
Corollary 3.19. For any non-degenerate irreducible totally-real subvariety X ⊆ P n , we see that X is a variety of minimal degree if and only if py(X) = 1 + dim(X).
Proof. Suppose that X is a variety of minimal degree. Theorem 3.8 shows that qp(X) = codim(X). Combining Corollary 2.3 and Theorem 1.3 gives 1 + dim(X) py(X) 1 + dim(X). Conversely, suppose that py(X) = 1 + dim(X). Combining Part i of Lemma 3.2 and Theorem 1.3 gives codim(X) qp(X) codim(X) and Theorem 3.8 shows that X is a variety of minimal degree.
Proof of Theorem 1.4. Theorem 3.8 proves that conditions a and c are equivalent, and Corollary 3.19 proves between conditions a and b are equivalent.
We end this section by describing the arithmetically Cohen-Macaulay varieties with almost minimal Pythagoras numbers.
Suppose that X is arithmetically Cohen-Macaulay and qp(X) = codim(X) − 1. Theorem 1.3 yields the lower bound py(X) 2 + dim(X). To give the matching upper bound, Theorem 3.14, together with Remark 3.10, divides the analysis into two cases: if X is a subvariety having codimension 1 in a variety of minimal degree, then Theorem 2.6 proves that py(X) 2 + dim(X), and if deg(X) = 2 + codim(X), then Corollary 2.4 proves that py(X) 2 + dim(X).
Proof of Theorem 1.5. Theorem 3.14 proves that conditions a and c are equivalent, and Corollary 3.20 proves between conditions a and b are equivalent.

QUADRATIC PERSISTENCE AND MINIMAL FREE RESOLUTIONS
This section connects the quadratic persistence of a complex subvariety X ⊆ P n with a homological invariant of its homogeneous coordinate ring R := C[x 0 , x 1 , . . . , x n ]/I X viewed as a module over the polynomial ring S := C[x 0 , x 1 , . . . , x n ]. To be more precise, set In other words, the Betti table for the S-module R has (X) nonzero entries in its first row or the linear strand in the minimal free resolution of the ideal I X has (X) nonzero terms. In contrast, Section 8D in [Eis05] emphasizes the invariant b(X) := (X) + 1 when X is a curve of high degree.
where "*" denotes a positive integer. If a(X) and (X) are finite, then we have 0 a(X) (X) n.
Theorem 1.2 asserts that, for any non-degenerate irreducible subvariety X ⊆ P n , the quadratic persistence qp(X) is bounded below by the homological invariant (X). The basic plan for proving Theorem 1.2 involves relating the linear syzygies of the variety X with those of a general inner projection. Roughly speaking, we do this by first evaluating the matrices of linear forms, which represent the linear part of the minimal free resolution of the homogeneous ideal I X , at general closed points of X. By analyzing the vectors lying in the kernel of a product of these complex matrices, we obtain quadratic polynomials lying in the homogeneous ideal of the general inner projection. The fact that these complex matrices anti-commute is vital to the analysis. To convert this outline into a rigorous argument requires a fair-sized piece of homological machinery.
For convenience, we use the Bernstein-Gelfand-Gelfand correspondence to describe the linear part of a minimal free resolution. Following Section 7B in [Eis05], the exterior algebra E ∼ = (S 1 ) * is the Koszul dual of the polynomial ring S. If e 0 , e 1 , . . . , e n are the generators of E dual to the variables x 0 , x 1 , . . . , x n in S, then we have e 2 j = 0 for all 1 j n and e j e k = −e k e j for all 1 j < k n. We equip E with the Z-grading induced by setting deg e j = −1 for all 1 j n. Although we work with left E-modules, any Z-graded left E-module U can also be viewed as a Z-graded right E-module. Specifically, if e ∈ E − j and u ∈ U k , then we have e u = (−1) jk u e. For a finitely-generated left E-module U = i∈Z U i , the C-vector space dual U * := i∈Z (U i ) * , where (U i ) * := Hom C (U i , C), is naturally a right E-module: for all φ ∈ (U i ) * , all e ∈ E − j , and all u ∈ U i+ j , we have (φ e)(u) = φ (e u). However, as a Z-graded left E-module where the summand (U * ) −i = (U i ) * has degree −i, we have (e φ )(u) = (−1) i j (φ e)(u) = (−1) i j φ (e u).
The Bernstein-Gelfand-Gelfand correspondence supplies an equivalence of categories between linear complexes of free S-modules and Z-graded E-modules. Given a Z-graded E-module U, we make the tensor product S ⊗ C U into the complex of Z-graded free S-modules where ∂ i (1 ⊗ u) := ∑ n j=0 x j ⊗ e j u and the term S ⊗ C U i ∼ = S(−i) dim C U i sits in homological degree i and is generated in degree i; see Section 7B in [Eis05]. By choosing bases {u for all 0 j n and some c j,r,s ∈ C, the map ∂ i is represented by a matrix of linear forms whose (r, s)-entry is ∑ n j=0 c j,r,s x j . Proposition 7.5 in [Eis05] proves that L defines a covariant functor and induces an equivalence from the category of Z-graded E-modules to the category of linear complexes of free S-modules. Given a Z-graded E-module U, we identify an element v ∈ E −1 = (S 1 ) * with the linear map v : Building on this equivalence, Corollary 7.11 in [Eis05] identifies the left E-module corresponding to the linear part in the minimal free resolution of an S-module. Focusing on a non-degenerate irreducible complex subvariety X ⊆ P n defined by the saturated homogeneous S-ideal I X , the strand in the minimal free resolution of the S-module R := S/I X corresponding to the first row of the Betti and the map α is defined on the generators 1 ⊗ (I X ) 3 * = (I X ) 3 * as the dual of the multiplication map S 1 ⊗ C (I X ) 2 → (I X ) 3 . It follows that there is a canonical isomorphism (U * X ) 1 ∼ = (I X ) 2 of C-vector spaces and dim C (U X ) − j = dim C Tor S j (R, C) 1+ j for all j ∈ Z. To help internalize this construction, we illustrate it for an accessible projective subvariety.
Example 4.2. For the rational normal curve C := ν 3 (P 1 ) ⊂ P 3 , the saturated homogeneous ideal I C is minimally generated by f 0 := x 2 2 −x 1 x 3 , f 1 := x 1 x 2 −x 0 x 3 , and f 2 : Because the syzygies among these three quadratic binomials are freely generated by the two relations Choosing the ten cubic binomials 1 − x 2 0 x 3 g 9 := x 0 x 2 1 − x 2 0 x 2 , as a basis for (I C ) 3 , it follows that the left E-module homomorphism α : 9 i=0 E(2) → 2 i=0 E(1) corresponds to the matrix  The entries in the first row of this matrix come from the four equations x 3 f 0 = g 0 , x 2 f 0 = −g 1 + g 3 , x 1 f 0 = −g 2 + g 4 , and x 0 f 0 = g 5 . The first row of the Betti table corresponds to the left E-module U C := Coker(α). From the given free presentation, we may verify directly that dim C (U C ) −1 = 3, dim C (U C ) −2 = 2, and dim C (U C ) − j = 0 for all other j. In particular, the three standard basis vectors for the free E-module 2 i=0 E(1) surject onto a C-vector space basis for (U C ) −1 and the two vectors [ e 0 0 0 ] T , [ e 1 0 0 ] T ∈ 2 i=0 E(1) surject onto a C-vector space basis for (U C ) −2 . The choice of a closed point p ∈ X spawns two related linear free complexes. The first operation extracts the linear part of the minimal free resolution of the homogeneous coordinate ring regarded as a module over a smaller polynomial ring. To understand this, choose an affine representative p ∈ A n+1 for p ∈ P n and let W be the kernel of the C-linear map S 1 → C defined by the evaluation f → f ( p). Setting S := Sym(W ), the rational map π {p} : P n P n−1 := Proj(S ) corresponds to the inclusion W → S 1 of linear subspaces. Since S 1 = (E −1 ) * , the annihilator of W is generated by v :=p 0 e 0 +p 1 e 1 + · · · +p n e n and the exterior algebra E := E/ v ∼ = Hom C (W , C) is Koszul dual to the polynomial ring S . By Corollary 7.12 in [Eis05], the linear part of the minimal free resolution of the S -module The second operation produces the subcomplex of L(U * X ) generated by all of the quadratic polynomials in I X that are singular at the closed point p ∈ X. For the affine representative p ∈ A n+1 of p ∈ P n , a polynomial f ∈ (I X ) 2 is singular at p ∈ X if and only if the evaluation of its gradient at this affine representative vanishes: ∇ f ( p) = 0. If J denotes the S-ideal generated by the kernel of the linear map ∇| p : and α sg is defined on the generators (J 3 ) * as the dual of the multiplication map S 1 ⊗ C J 2 → J 3 . There is a canonical isomorphism (U sg X ) * 1 ∼ = J 2 of C-vector spaces and (U sg X ) * is a Z-graded submodule of U * X . We demonstrate these two operations with the twisted cubic curve. Example 4.3. As in Example 4.2, let C denote the rational normal curve in P 3 . From the given generators of its homogeneous ideal I C , we see that the closed point p := [1 : 0 : 0 : 0] ∈ P 3 lies on the curve C. With this choice, the homogeneous coordinate ring for the codomain of the linear projection away from p is just S := C[x 1 , x 2 , x 3 ]. When viewed by restriction of scalars as an S -module, the linear part of the minimal free resolution of I X (1) still has the three generators f 0 , f 1 , f 2 , but only one syzygy x 1 f 0 − x 2 f 1 + x 3 f 2 = 0. On the other hand, left multiplication by v := e 0 ∈ E −1 on U C is equivalent, modulo the defining relations for U C , to acting on the free E-module 2 i=0 E(1) via the matrix   e 0 0 0 0 0 0 0 0 0   .
Hence, the cokernel of left multiplication by v on U C has C-vector space basis corresponding to the three vectors . From the given free presentation, we may verify directly that dim C (U sg C ) −1 = 1 and dim C (U sg C ) − j = 0 for all other j. In particular, the standard basis vector in the free E-module E(1) surjects onto a C-vector space basis for (U sg C ) −1 . Foreshadowing the next lemma, we also observe that the coimage of multiplication by v on U C is spanned by the vector [ 1 0 0 ] T ∈ 2 i=0 E(1) and corresponds to U sg C .
Having gathered this background and notation, we record a couple of observations. This lemma formalizes our heuristic that evaluating matrices of linear forms at a point on the variety relates the linear syzygies of a variety to those of its inner projection.
Lemma 4.4. Let p be a closed point in P n , let p := (p 0 ,p 1 , . . . ,p n ) ∈ A n+1 be an affine representative of p, and let v :=p 0 e 0 +p 1 e 1 + · · · +p n e n be the corresponding element in E.
i. For a general closed point p ∈ X, the condition (U * X ) i+1 = 0 for some i 1 implies that we For any closed point p ∈ X, the product vU * X lies in the E-module (U sg X ) * .
Proof. From the definition, we see that (U * s for all 0 j n and some c j,r,s ∈ C, the E-module homomorphism from (U * X ) i+1 to (U * X ) i defined by multiplication with v is represented by the matrix whose (r, s)-entry is the number ∑ n j=0 c j,r,spj . Since X is non-degenerate and p ∈ X is general, this matrix is nonzero, so the image v (U * X ) i+1 ⊆ (U * X ) i is nonzero. ii. By definition, the E-module U r ) = ∑ s ∑ n j=0 c j,r,spj ∇ f s ( p). However, the map ∂ 2 : S ⊗ C U 2 → S ⊗U 1 generates the linear syzygies among the polynomials { f s }, so we also have ∑ s ∑ n j=0 c j,r,s x j f s = 0. Since p ∈ X and f s ∈ I X , we see that f s ( p) = 0. Thus, the product rule implies that 0 = ∇| p ∑ s ∑ n j=0 c j,r,s x j ∇ f s = ∑ s ∑ n j=0 c j,r,spj ∇ f s ( p), from which we deduce that v u With these preparations, we present a counterpart to Corollary 7.13 in [Eis05] showing that length of the linear part of a minimal free resolution can drop by at most one under a general inner projection. Identifying the left E-module corresponding to the linear part in the minimal free resolution of the image is the critical insight. Proposition 3.16 in [AN10] presents another approach using Koszul cohomology.
Proposition 4.5. Let X ⊆ P n be a non-degenerate complex subvariety. For any subset Γ of k general closed points in X, we have (X) k + π Γ (X) .
Proof. By construction, we have (X) = max { j ∈ N | (U * X ) j = 0}. It suffices to consider the case k = 1. Let p ∈ X be a general closed point, let p = (p 0 ,p 1 , . . . ,p n ) ∈ A n+1 be an affine representative, and let v :=p 0 e 0 +p 1 e 1 + · · · +p n e n ∈ E. Set W to be the kernel of the C-linear map S 1 → C defined by the evaluation at p and S := Sym(W ). As in the proof of part vi of Lemma 3.3, the quadratic polynomials in I X that lie in W are precisely the quadrics that are singular at the closed point p ∈ X. It follows that (I π {p} (X) ) 2 = J 2 and all of their higher syzygies lie in S . By design, S is annihilated by v, so we see that Proof of Theorem 1.2. Let k := qp(X). We first claim that k = 1 implies that (X) = 1. To see this, suppose that the polynomials f 1 , f 2 , . . . , f m form a basis for the C-vector space (I X ) 2 . For a general closed point p ∈ X with affine representative p ∈ A n+1 , Corollary 3.4 shows that the gradients ∇ f j ( p), for all 1 j m, are linearly independent. If the polynomials f 1 , f 2 , . . . , f m have a linear syzygy, then there are linear forms g 1 , g 2 , . . . , g m such that ∑ m j=1 g j f j = 0. Taking the gradient and evaluating at p gives ∑ m j=1 g j ( p)∇ f j ( p) = 0, so g j ( p) = 0 for all 1 j m. Since X is non-degenerate, we deduce that all of the linear forms g j are identically zero. Thus, there are no linear syzygies and (X) = 1. Now, assume that k > 1. Choose a general set {p 1 , p 2 , . . . , p k } of closed points in X and, for all 1 j k, set π j := π {p 1 ,p 2 ,...,p j } . Combining Definition 3.1 and Lemma 3.3 affirms that I π k (X) 2 = 0 and I π k−1 (X) 2 = 0, so the previous paragraph implies that π k−1 (X) = 1. Since Proposition 4.5 establishes that (X) (k − 1) + π k−1 (X) , we conclude that k (X).
We first show that the inequality in Theorem 1.2 may fail for a reducible variety.
Example 4.6 (Bounds for a reducible variety). The variety X ⊂ P 2 determined by the monomial ideal x 0 x 1 , x 0 x 2 = x 0 ∩ x 1 , x 2 is just the union of the x 0 -axis and the point [1 : 0 : 0]. Since the Betti table of its homogeneous coordinate ring is i \ j 0 1 2 0 1 0 0 1 0 2 1 , we deduce that (X) = 2. On the other hand, the rational map given by projecting away from the point [1 : 0 : 0] ∈ X surjects onto P 1 . Hence, the ideal of the image contains no quadratic polynomials, so we have qp(X) = 1 < 2 = (X).
The next two examples demonstrates that the inequality in Theorem 1.2 can be strict. They also answer Question 5.8 in [HK15] negatively.
Example 4.9 (Bounds for curves of high degree). Suppose that d g and X is a smooth irreducible complex curve of genus g and gonality δ embedded by a complete linear series of degree d in P n . Corollary 8.4 in [Eis05] shows that n = d − g and dim C (I X ) 2 = d−g+2 2 − (2d − g + 1). Setting k := qp(X), Corollary 3.7 gives Moreover, the Gonality Conjecture, which is discussed in Section 8C of [Eis05] and proven in [EL15], asserts that (X) = d − g − δ . Therefore, the hypothesis that 2δ > 1 + √ 8g + 1 implies that k > (X). As already observed in Example 2.10, the gonality of a general curve is 1 2 (g + 2) , so we have the strict inequality qp(X) > (X) whenever X is a general curve of genus at least 7.
We close this section with a curious relationship between three of our favourite numerical invariants of an irreducible complex subvariety.
Proposition 4.10. Let X ⊆ P n be a non-degenerated irreducible complex subvariety. If there exists a variety X ⊆ P n of minimal degree such that X ⊆ X and qp(X) = qp(X ), then we have (X) = (X ). Under the additional hypothesis that X is totally real, we also have py(X) = py(X ).

TORIC APPLICATIONS
In this closing section, we refine our estimates on quadratic persistence for projective toric subvarieties. Notably, we compute the quadratic persistence for any Veronese embedding of the projective plane and for the embedded toric variety corresponding to any sufficiently tall lattice prism.
For a nested pair X ⊆ X of irreducible complex varieties, Part i of Lemma 3.2 establishes the inequality qp(X) qp(X ). Our initial goal is to show that the opposite inequality holds in a special situation. To elucidate this partial converse, we devise a new kind of transversality. Given a finite set Γ of closed points in X ⊆ P n spanning a (k − 1)-plane, we write π Γ : P n P n−k for the linear projection away from Span(Γ ); see Section 3.
Definition 5.1. Let X ⊆ P n be an irreducible complex subvariety. A subvariety X ⊆ X is transverse to general inner projections if, for all 0 k dim(X ) and all subsets Γ of k general closed points in X , there exists a subset Γ of k general closed points in X such that the image π Γ (X ) is projectively equivalent to the image π Γ (X ).
This definition captures those nested pairs of subvarieties for which the points in the smaller variety are sufficient to compute the quadratic persistence of the larger variety.
Lemma 5.2. Let X ⊆ P n be an irreducible complex subvariety. If X ⊆ X is transverse to general inner projections, then the quadratic persistence of X is equal to the smallest cardinality of a finite set Γ of general closed points in X such that the ideal I π Γ (X ) contains no quadratic polynomials.
Proof. By Part iv of Lemma 3.3, the quadratic persistence qp(X ) is the smallest k ∈ N for which there exists a finite set Γ of general closed points in X such that k = |Γ | and the ideal I π Γ (X ) contains no quadratic polynomials. Since X is transverse to general inner projections, there exists a subset Γ of general closed points in X such that image π Γ (X ) is projectively equivalent to the image π Γ (X ). Thus, the ideal I π Γ (X ) contains no quadratic polynomials which completes the proof.
To relate the number of quadratic polynomials in the homogeneous ideals of X and X , it is convenient to have the following notation.
Definition 5.3. For the nested sequence X ⊆ X ⊆ P n of complex subvarieties, the quadratic residual of X in X is defined to be the integer qr(X, Like in Example 3.1 of [Har95], a variety X ⊆ P n is a cone if there exists a proper subvariety X and a closed point q ∈ X not lying on X such that X is the union of the lines Span({q, p}) spanned by the point q ∈ X and the points p ∈ X. Every such point q is a vertex of the cone X . Having collected the requisite definitions, we now bound the quadratic persistence from above.
Theorem 5.4. Let X ⊂ P n be a non-degenerate irreducible complex subvariety. Suppose that X ⊆ P n is a cone containing X such that dim(X ) = 1 + dim(X) and, for a vertex q ∈ X , we have π {q} (X ) = π {q} (X). Assuming that X ⊂ X is also transverse to general inner projections, we obtain the inequality qp(X) max{qp(X ), qr(X, X )}.
Proof. Set k := qp(X ). Part iv of Lemma 3.3 implies that, for a general subset Γ of k closed points in X , the ideal I π Γ (X ) contains no quadratic polynomials. Since X ⊂ X is transverse to general inner projections, there exists a subset Γ of k closed points in X such that the ideal I π Γ (X ) also contains no quadratic polynomials. If necessary, enlarge the subset Γ, by appending additional general closed points in X, to ensure that |Γ| qr(X, X ). We now claim that the homogeneous ideal I π Γ (X) contains no quadratic polynomials.
To prove this claim, fix an affine representative p ∈ A n+1 , for each closed point p ∈ X, and consider the map del X : (I X ) 2 → ∏ p∈X (T X ,p /T X,p ) * defined by del X ( f ) := ∇ f ( p) p ∈ X . We first show that the kernel of this map is (I X ) 2 . The variety X cannot be contained in the singular locus of X , because the line corresponding to nonsingular point in X is nonsingular in X . Hence, at a general closed point p ∈ X, the tangent space T X ,p is naturally isomorphic to T X,p ⊕ Span({p, q}). If f ∈ Ker(del X ), then the gradient of f evaluated at the pointp is orthogonal to the line Span({p, q}).
Since X is non-degenerate, it follows that f vanishes to order at least to 2 at the vertex q, so our assumption that π {q} (X) = π {q} (X ) guarantees that f ∈ (I X ) 2 . From our characterization of the kernel, we see that the image of del X has dimension qr(X, X ). Therefore, we deduce that (I π Γ (X) ) 2 = 0 and k qp(X).
Remark 5.5. Under the additional hypothesis that qr(X, X ) qp(X ), Part ii of Lemma 3.2 and Theorem 5.4 combine to prove that qp(X) = qp(X ).
To apply Theorem 5.4, we need a better tool for recognizing subvarieties that are transverse to general inner projections. The next lemma and proposition forge such a tool.
Proposition 5.7. Let X ⊂ P n be an irreducible complex subvariety and let X ⊆ P n be a cone containing X. If π {q} | X : X π {q} (X) is birational map and π {q} (X) is projectively equivalent to π {q} (X ), then the subvariety X ⊆ X is transverse to general inner projections.
We illustrate the power of Theorem 5.4 and Proposition 5.7 with a family of examples.
Example 5.8 (The quadratic persistence of the Veronese embeddings of P 2 ). For all j 2, the map . We claim that qp ν j (P 2 ) = j+1 2 . To prove this, we proceed by induction on j. In the base case, the Veronese surface ν 2 (P 2 ) ⊂ P 5 is a variety of minimal degree, so Theorem 3.8 gives qp ν 2 (P 2 ) = codim ν 2 (P 2 ) = 3 = 2+1 2 . For any j > 2, the embedded toric surface ν j (P 2 ) ⊂ P j( j+3)/2 corresponds to the lattice triangle T j := conv{0, j e 1 , j e 2 } ⊂ R 2 where e 1 , e 2 denotes the standard basis for R 2 ; see Example 2.3.15 in [CLS11]. Consider the following sequence of inner projections: for i, decreasing by 1 from j to 1, project away from the torus-invariant point corresponding to the lattice point (0, i). The final embedded projective toric variety corresponds to the lattice polytope P := conv{0, T j−1 + e 1 } and Part v of Lemma 3.3 shows that qp ν j (P 2 ) j + qp(X P∩Z 2 ). We next verify that qp(X P∩Z 2 ) = qp ν j−1 (P 2 ) . Let e 0 , e 1 , e 2 denote the standard basis for R 3 and set P := conv{e 0 , T j−1 + e 1 } ⊂ R × R 2 ∼ = R 3 . The coordinate projection R × R 2 → R 2 defines a bijection between the lattice points in P and P and establishes that the associated toric varieties are nested in the same ambient projective space. Since the lattice polytope P is a pyramid, its associated embedded projective toric variety X P ∩Z 3 is a cone whose vertex corresponds to the lattice point e 0 ∈ P , so Proposition 5.7 shows that the subvariety X P∩Z 2 ⊂ X P ∩Z 3 is transverse to general inner projections. Applying Part ii of Lemma 3.2 and Theorem 5.4, we obtain the inequalities qp(X P ∩Z 3 ) qp(X P∩Z 2 ) max{qp(X P ∩Z 3 ), qr(X P∩Z 2 , X P ∩Z 2 )}. We deduce that the lattice polytopes P and P are normal from Corollary 2.2.13 in [CLS11]. Hence, combining Theorem 5.4.8 and Theorem 9.2.3 in [CLS11] with the theory of Ehrhart polynomials (see Section 9.4 of [CLS11]) yields qr(X P∩Z 2 , X P ∩Z 3 ) = 2P ∩ Z 3 − 2P ∩ Z 2 = 2 j 2 + j+1 2 + 1 − 2 j 2 + j + 1 = j 2 .
Because P is a pyramid over the polygon T j−1 + e 1 , we also have qp(X P ∩Z 3 ) = qp(X (T j−1 +e 1 )∩Z 2 ). Thus, the induction hypothesis gives qp(X (T j−1 +e 1 )∩Z 2 ) = qp(X T j−1 ∩Z 2 ) = qp ν j−1 (P 2 ) = j 2 , so we conclude that qp(X P∩Z 2 ) = j 2 = qp ν j−1 (P 2 ) . The inequality at the end of the first paragraph together with the equality in the second paragraph prove that qp ν j (P 2 ) and the right side is the sum of the codimension of the varieties obtained by successively projecting ν j (P 2 ) away from a point j+1 2 times. Thus, Part i of Lemma 3.2 shows that we need to project away from at least j+1 2 points to eliminate all quadratic polynomials, so qp ν j (P 2 ) j+1 2 .
Remark 5.9. The techniques developed in [Sch17] yield a different proof that qp ν j (P 2 ) = j+1 2 . This completely independent approach hinges on knowning the Hilbert function for the square of the vanishing ideal for general closed points in P 2 ; see Proposition 4.8 in [IK99].
Remark 5.10. The tactic employed in Example 5.8 to realize a toric variety as a subvariety transverse to general inner projections generalizes. For a lattice polytope P ⊂ R d and a vertex v ∈ P ∩ Z d , set P := conv{v + e 0 , (P ∩ Z d ) \ v} ⊂ R × R d ∼ = R d+1 . Using Proposition 5.7, one may verify that the toric inclusion X P∩Z d ⊂ X P ∩Z d+1 is always transverse to general inner projections.
We next calculate the quadratic persistence for projective toric subvarieties arising from a special class of polytopes. For all positive k ∈ Z and any lattice polytope P ⊂ R d , the prism P×[0, k] ⊂ R d+1 is also a lattice polytope. The ensuing proposition shows that a rational normal scroll containing the toric variety X (P×[0,k])∩Z d+1 determines its quadratic persistence for all large k.
Proof. We proceed by induction on |P ∩ Z d |. For the base case, it suffices to consider a standard simplex. If e 1 , e 2 , . . . , e d denotes the standard basis for R d , then we have P = conv{0, e 1 , e 2 , . . . , e d }.
For any positive integer k, the corresponding toric subvariety X (P×[0,k])∩Z d+1 is the Segre embedding of the product P d × ν k (P 1 ) in P kd+d+k , where the factor ν k (P 1 ) ⊂ P k is the rational normal curve of degree k. This variety is itself a rational normal scroll, so Theorem 3.8 establishes that qp(X (P×[0,k])∩Z d+1 ) = codim(X (P×[0,k])∩Z d+1 ) = (kd + d + k) − (d + 1) = k |P ∩ Z d | − 1 . Now, suppose that P ⊂ R d is an arbitrary lattice polytope and assume that the positive integer k satisfies k 1 dim(P)−1 |P ∩ Z d | − 1. Corollary 2.15 shows that the embedded projective toric variety X (P×[0,k])∩Z d+1 is contained in a rational normal scroll X P ∩Z m whose dimension m := P ∩ Z d is equal to the number of parallel lines needed to cover all of the lattice points in the prism P × [0, k]. Hence, Part ii of Lemma 3.2 and Theorem 3.8 give the lower bound qp(X (P×[0,k])∩Z d ) qp(X P ∩Z m ) = codim(X P ∩Z m ) = (k + 1) P ∩ Z d − 1 − P ∩ Z d = k P ∩ Z d − 1 .
To accomplish this, choose a lattice point w ∈ P ∩ Z d adjacent to the vertex v ∈ P such that the primitive vector v − w is parallel to an edge of the polytope P passing through v. Consider the pyramid Q := conv (Q × [0, k] × 0) ∪ {(w, 0, 1)} ⊂ R d × R × R and the linear projection θ : R d × R × R → R d × R defined by (u, y, z) → (u, y) + z(v − w, 0). By design, the map θ induces a bijection between the lattice points in Q and Q , so the associated toric varieties are nested in the same ambient projective space. Since the lattice polytope Q is a pyramid, the embedded projective toric variety X Q ∩Z d+2 is a cone and Proposition 5.7 shows that the subvariety X Q ∩Z d+1 ⊂ X Q ∩Z d+2 is transverse to general inner projections. Applying Part ii of Lemma 3.2 and Theorem 5.4, we obtain qp(X Q ∩Z d+1 ) qp(X Q ∩Z d+1 ) max{qp(X Q ∩Z d+2 ), qr(X Q ∩Z d+1 , X Q ∩Z d+2 )}. Regarding the homogeneous coordinates rings of these embedded projective toric varieties as semigroup algebras (see Theorem 1.1.7 in [CLS11]), we have Partitioning via the last coordinate, we deduce that For all u ∈ Q ∩ Z d and all i ∈ Z satisfying 0 i k, the condition (u, i) + (v, 0) ∈ Q ∩ Z d+1 + Q ∩ Z d+1 implies that u + v ∈ Q, so a similar partition gives It follows that qr(X Q ∩Z d+1 , X Q ∩Z d+2 ) = (k + 1) Q ∩ Z d − |A| . Since Q is a pyramid over the prism Q × [0, k], we also have qp(X Q ∩Z d+2 ) = qp(X (Q×[0,k])∩Z d+1 ) = k Q ∩ Z d − 1. As advertised in Remark 5.5, the additional inequality qr(X Q ∩Z d+1 , X Q ∩Z d+2 ) qp(X Q ∩Z d+2 ) would give the equality qp(X Q ∩Z d+1 ) = qp(X Q ∩Z d+2 ) and, thereby, prove the claim. This additional inequality is equivalent to P ∩ Z d = Q ∩ Z d + 1 (k + 1) |A|. To estimate the cardinality of A, consider a facet F ⊂ Q that is not a facet of P. For each lattice point u ∈ F ∩ Z d , we have u + v ∈ Q, so |A| F ∩ Z d . Because F is a lattice polytope of dimension dim(Q) − 1 dim(P) − 1, we infer that |A| dim(P) − 1. Therefore, the hypothesis that k 1 dim(P)−1 P ∩ Z d − 1 guarantees that additional inequality holds. Finally, using the rational normal scroll X P ∩Z m , Proposition 4.10 proves that py(X (P×[0,k])∩Z d+1 ) = 1 + P ∩ Z d and (X (P×[0,k])∩Z d+1 ) = k P ∩ Z d − 1.
We draw attention to an application of Proposition 5.12 in which the hypothesis on k is vacuous.