TITLE: For a Sum-of-Squares cost functions J(x) is it true that J(x)-j* is also SOS?
QUESTION [6 upvotes]: For polynomial optimization problems the sum-of-squares theory and Lasserre relaxation hierarchy provides a theoretically handy way of getting the solution. There are also results saying that finite relaxation is enough for global convergence.
My question is related to the unconstrained optimization of polynomials of the following form
$$
J(x) = \sum_{k=1}^N q^2_k(x)
$$
where $q_i(x)$ are arbitrary polynomials (they do have structure in my particular case, but I hope that wont be needed to get an answer).
Since $J(x)$ is sum of squares, it is non-negative. Let its minimum value be
$$
j^* = \min_{x}J(x)
$$
I know that there are general polynomials $P(x)$ such that $P(x)-p^*$ is not sum-of-squares. The questions is whether the assumption that $P(x)$ is sum-of-squares helps this situation or not.
Is $J(x)-j^*$ is also a sum of squares polynomial? If not, do we have a counterexample? 
Any pointers towards relevant literature is also appreciated, as searching "is sum-of-squares" is useless for such specific questions.

REPLY [2 votes]: Motzkin polynomial in the homogeneous form, i.e. $f(x):=f(x_1,x_2,x_3)=x_1^4x_2^2 + x_1^2x_2^4 − 3x_1^2x_2^2x_3^2 + x_3^6$ becomes an SOS if you add  $\frac{3}{16}x_1^6$ to it. $3/16$ is an upper bound on minimum such value (a better bound is $(3/4)^6$), as can be checked e.g. by using a nice Macaulay2 package by H.Peyrl. Thus $P(x):=f(1,x_2,x_3)+\frac{3}{16}$ is a counterexample. 
Below is the Macaulay code to run to find an appriximation to the minimal $a$ so that $f(1,y,z)+a$ is SOS (after installing that package), and its output, in the format ({list of squares},{list of positive coefficients for them},{value of a})
 S = QQ[z,y,a];
 f = y^2 + y^4 + z^6 - 3*y^2*z^2 + a;
 (g,d,aval)=getSOS (f,{a},a)

    2   2 2   17    15 3       3          9  51   1    11    3     3
 ({z  - -y  - --, - --z  + z, z , 1, y}, {-, --, ---, ----, --}, {--})
        3     60    17                    4  40  136  1600  20    16