Let $$S$$ be solutions of a system of quadratic polynomials on $$\mathbb{R}^n$$.

Suppose $$q$$ is another quadratic polynomial such that $$q|_S\geqslant 0$$.

Is it possible to find a polynomial $$\tilde q$$ such that $$\tilde q\geqslant0$$, $$\deg \tilde q\leqslant 2$$, and $$\tilde q\ |_S=q|_S$$?

• If the system contains only one polynomial, then the answer is yes.

No. The main idea is to find a $$q$$ on $$S$$ that is the sum of squares, but where the expressions being squared are not linear combinations of the coordinates in $${\bf R}^n$$.

Consider the space curve \begin{align*} S &:= \{ (x,x^2,x^4): x \in {\bf R} \} \\ &= \{ (x,y,z) \in {\bf R}^3: y-x^2 = z - y^2 = 0 \} \end{align*} (an incomplete moment curve). The quadratic polynomial $$q(x,y,z) := y - 2z + yz$$ is non-negative on $$S$$, since we have a representation as a square $$q(x,x^2,x^4) = x^2 - 2x^4 + x^6 = (x-x^3)^2.$$ The point here is that the expression $$x-x^3$$ inside the square is not a linear function of the three coordinates $$x,x^2,x^4$$, preventing any obvious way to extend $$q$$ as a sum of squares of linear polynomials on all of $${\bf R}^3$$.

Indeed, if $$\tilde q$$ is a quadratic polynomial that agrees with $$q$$ on $$S$$, then $$(\tilde q-q)(x,x^2,x^4) \equiv 0$$ which on expanding the quadratic polynomial $$\tilde q-q$$ into coefficients reveals that $$\tilde q-q$$ must take the form $$(\tilde q-q)(x,y,z) = a (y-x^2) + b(z-y^2)$$ for some scalars $$a,b$$. Hence $$\tilde q\ (x,y,z) = a(y-x^2) + b(z-y^2) + y-2z+yz.$$ But this polynomial is linear in $$z$$ and not independent of $$z$$, and thus cannot be non-negative on $${\bf R}^3$$ regardless of what values one assigns to $$a$$ and $$b$$.

This is a bit too long for a comment ...

Forty years ago, I wrote a paper Formes quadratiques et calcul des variations, published in J. Maths. Pures & Appl. 62 (1983), p 177-196. It dealt with such a problem, in the following situation: $$S$$ is the subset of $${\bf M}_{p\times q}(\mathbb R)$$ consisting in the rank-one matrices. It is thus defined by quadratic identities $$a_{ij}a_{k\ell}-a_{i\ell}a_{kj}=0.$$ I showed that

• if $$p\le2$$ or $$q\le2$$, then the answer is positive: for every quadratic form $$Q$$ satisfying $$Q|_S\ge0$$, there exists a positive semi-definite quadratic form $$\tilde Q$$ that coincides with $$Q$$ over $$S$$.
• on the contrary, if both $$p,q\ge3$$, then there exists such a $$Q$$, so that no $$\tilde Q$$ exists.
• Does not it contradict mathoverflow.net/a/455619 for $n=3$? Oct 6 at 22:16
• @AntonPetrunin. It doesn't, because your MO question was about quadratic forms over the space of quadratic forms (say, over the space of symmetric matrices), while my work was about quadratic form over general $p\times q$ matrices. Oct 7 at 6:21