7

This is a follow-up this question on MathOverflow. The previous time I asked about SOS was Choi Lam homogeneous polynomials as sums of squares.

With positive integer $k,$ and real variables $x,y,z$ that are allowed to take on positive or negative or zero values. Schur defines a positive semi-definite polynomial $ F = x^{2k}(x-y)(x-z) + y^{2k}(y-x)(y-z) +z^{2k}(z-x)(z-y)$

Quick proof by Peter Mueller: If there are two or three negative values, negate all three, so that now there is at most one negative value. Name them in decreasing order, we have $$ x \geq y \geq z \; , \; \; \; y \geq 0 $$ so that $|x| \geq |y| $ and $x^{2k} \geq y^{2k}.$ Define the Schur expression
$$ F = x^{2k}(x-y)(x-z) + y^{2k}(y-x)(y-z) +z^{2k}(z-x)(z-y)$$ We see that $F \geq 0$ from the rearranged $$ \color{teal}{ F = (x-y) \left( x^{2k}(x-y) + (y-z)(x^{2k} - y^{2k}) \right) + z^{2k}(x-z)(y-z) } $$

The best thing for me would be information about how I can download software that can handle SOS problems. But for the first specific pair of problems: the conjecture is that $$ ( x^4 (x-y)(x-z) + y^4 (y-z)(y-x) + z^4(z-y)(z-x) )$$ is NOT a sum of squares of (real coefficient) polynomials. The second conjecture is that $$(x^2 + y^2 + z^2) ( x^4 (x-y)(x-z) + y^4(y-z)(y-x) + z^4(z-y)(z-x) )$$ really is a sum of squares. That is the specific question: somehow verify both sides of the conjecture. I have been trying with the second half, no luck so far.

It is a result of Claus Scheiderer that there is a non-negative integer $N$ such that $$(x^2 + y^2 + z^2)^N ( x^4 (x-y)(x-z) + y^4(y-z)(y-x) + z^4(z-y)(z-x) )$$ is a sum of squares of real polynomials. Actually the result applies to any positive semidefinite polynomial in three real variables. He has a recent book. ADDED: The eBook is on sale, I actually managed to buy it!

So that is the QUESTION: show the original form is not SOS (or quote relevant software), give an expression for the multiplied expression as SOS, and tell me what software I can download.

Scheiderer's result

Will Jagy
  • 146,052

2 Answers2

4

As indicated in a comment, I have used this Python wrapper of Chenyang Yuan.

The setup is as follows:

import sympy as sp
import numpy as np
from SumOfSquares import SOSProblem, poly_opt_prob

x,y,z = sp.symbols('x y z') poly = x4(x-y)(x-z) + y4(y-z)(y-x) + z*4 (z-y)*(z-x) prob1 = SOSProblem() const1 = prob1.add_sos_constraint(poly, [x,y,z])

prob2 = SOSProblem()
const2 = prob.add_sos_constraint(poly(x2+y2+z*2), [x,y,z])

When I run prob1.solve(), I receive a picos.modeling.problem.SolutionFailure, which indicates that this the polynomial $$P(x,y,z):=x^4(x-y)(x-z)+y^4(y-x)(y-z)+z^4(z-x)(z-y)$$ has no sum-of-squares representation. I do not know how to turn this into a human-checkable proof of this fact.

When I run prob2.solve(), no such error occurs, and I can use const.get_sos_decomp() to extract a sum-of-squares decomposition for $(x^2+y^2+z^2)P$. It's not pretty. However, I was able to turn it into a nicer form as follows:

  1. I spotted the term 0.619*(1.0*x**4 - 0.999*x**3*y - x**3*z + 1.0*x**2*y*z)**2. Up to rounding error, this is a constant times $x^4(x-y)^2(x-z)^2$. So, I figured out the largest constant $c$ for which $$(x^2+y^2+z^2)P-c\sum_{cyc}x^4(x-y)^2(x-z)^2$$ is a sum of squares. (The packages will do this for you if you set up the problem right, but I found it easier to just binary search.) This turns out to be $2/3$. Let $Q$ be the remainder.

  2. When I computed a sum-of-squares decomposition of $Q$, the only expression I found which looked like a rational polynomial with small denominators was (0.5*x**4 + 1.0*x**3*y - 0.5*x**3*z - 1.0*x**2*y*z - x*y**3 + 1.0*x*y**2*z - 0.5*y**4 + 0.5*y**3*z)**2. So, I took the symmetric sum $S$ of this and found the largest constant $c'$ for which $Q-c'S$ is a sum of squares. Let $R$ be the remainder.

  3. Finally, the sum of squares decomposition of $R$ was quite nice.

So, in the end, I got the following human-readable sum-of-squares decomposition: \begin{align*} (x^2+y^2+z^2)P &=\frac23\sum_{\mathrm{cyc}}\left(x^2(x-y)(x-z)\right)^2\\ &\ \ +\frac19\sum_{\mathrm{cyc}}(y-z)^2\big((y+z)^3-x(y^2+3yz+z^2)\big)^2\\ &\ \ +\frac1{18}\sum_{\mathrm{cyc}}(y-z)^2\big(x^3-3x^2(y+z)+x(y+z)^2+(y+z)(y^2+z^2)\big)^2. \end{align*}

  • This is quite nice. Thank you. Given your final sum, maybe I should not feel bad about getting nowhere by hand. I did work out how to (slowly) use the text editor to form cyclic sums, suitable for Pari-GP, so I should be able to check your sum after, say, multiplying by 18 – Will Jagy Mar 10 '25 at 19:16
  • 2
    @WillJagy Yeah, computing SoS representations by hand is quite a pain. I would like to know whether there's a way to get the "sparsest" SoS decomposition possible; while the decomposition I've found is nice in the sense that there are not too many terms and the coefficients are rationals of rather small height, there may be a much cleaner decomposition out there. – Carl Schildkraut Mar 10 '25 at 20:12
  • @CarlSchildkraut On the sparsest SOS, you might want to take a look at this answer of mine, where I minimized the trace as a proxy for rank-minimization. – Rodrigo de Azevedo Mar 11 '25 at 13:48
  • 1
    @RodrigodeAzevedo Thanks! That does seem like a useful strategy. I imagine it could be carried through with the SoS workflow I've used here, but I'm really not so adept with it. – Carl Schildkraut Mar 11 '25 at 21:06
  • 1
    @CarlSchildkraut I might have gotten extremely lucky in that answer as I found a rational rank-$2$ matrix, thereby obtaining an SOS decomposition with just 2 terms. In general, since semialgebraic sets are involved, finding low-rank rational matrices might be a luxury. I would be happy with entries that are algebraic numbers. – Rodrigo de Azevedo Mar 11 '25 at 21:22
2

The Macaulay2 package SumsOfSquares$^\color{magenta}{\dagger}$ can handle sums of squares (SOS). Using the web interface:

Macaulay2, version 1.24.11-1695-gf35df1017f (vanilla)
Macaulay2, version 1.24.11-1695-gf35df1017f (vanilla)
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems, Isomorphism, LLLBases, MinimalPrimes, OnlineLookup, PackageCitations, Polyhedra, PrimaryDecomposition, ReesAlgebra, Saturation, TangentCone, Truncations, Varieties
i1 : needsPackage( "SumsOfSquares" );

-- storing configuration for package NumericalAlgebraicGeometry in /home/m2user/.Macaulay2/init-NumericalAlgebraicGeometry.m2 -- storing configuration for package Bertini in /home/m2user/.Macaulay2/init-Bertini.m2 -- storing configuration for package SemidefiniteProgramming in /home/m2user/.Macaulay2/init-SemidefiniteProgramming.m2 i2 : R = QQ[x,y,z];

i3 : p = x^4 * (x-y)(x-z) + y^4 (y-z) * (y-x) + z^4 * (z-y) * (z-x);

i4 : sosPoly solveSOS p

Since nothing was output after input i4, I assume that no SOS decomposition was found. Multiplying $p$ by $x^2 + y^2 + z^2$ and trying again,

i5 : f = p * (x^2 + y^2 + z^2);

i6 : sosPoly solveSOS f

Since the output o6 is hard to read on the web interface, one can use tex o6 to generate the $\TeX$ for output o6:

$$\texttt{SOSPoly}\left\{\texttt{coefficients}\ \Rightarrow \ \left\{{2.27005}\cdot 10^{-9},\,{4.98058}\cdot 10^{-9},\,{4.98064}\cdot 10^{-9},\,{2.81877}\cdot 10^{-8},\,{.000202688},\,{.000202688},\,{.000699075},\,{.966712},\,{.966738},\,{1.40704},\,{2.32435},\,{2.32438},\,{4.33843},\,{12.5545},\,{12.5545}\right\},\,\texttt{generators}\ \Rightarrow \ \left\{-{.45095}\,x^{4}-{.20703}\,x^{3}y-{.207093}\,x^{2}y^{2}-{.20703}\,x\,y^{3}-{.450957}\,y^{4}-{.207031}\,x^{3}z+{.0368588}\,x^{2}y\,z+{.0368588}\,x\,y^{2}z-{.207039}\,y^{3}z-{.207094}\,x^{2}z^{2}+{.0368588}\,x\,y\,z^{2}-{.207101}\,y^{2}z^{2}-{.207031}\,x\,z^{3}-{.207039}\,y\,z^{3}-{.450959}\,z^{4},\,{.018992}\,x^{4}+{.362657}\,x^{3}y+{.362636}\,x^{2}y^{2}+{.362685}\,x\,y^{3}+{.343697}\,y^{4}-{.343663}\,x^{3}z-{.00000102535}\,x^{2}y\,z-{.0000186032}\,x\,y^{2}z-{.0189588}\,y^{3}z-{.343646}\,x^{2}z^{2}+{.0000196385}\,x\,y\,z^{2}-{.0189874}\,y^{2}z^{2}-{.343696}\,x\,z^{3}-{.0190197}\,y\,z^{3}-{.362685}\,z^{4},\,-{.407835}\,x^{4}-{.18749}\,x^{3}y-{.187445}\,x^{2}y^{2}-{.187436}\,x\,y^{3}+{.220355}\,y^{4}-{.22038}\,x^{3}z+{.000022099}\,x^{2}y\,z-{.0000119085}\,x\,y^{2}z+{.40781}\,y^{3}z-{.220333}\,x^{2}z^{2}-{.0000101284}\,x\,y\,z^{2}+{.407769}\,y^{2}z^{2}-{.220329}\,x\,z^{3}+{.407808}\,y\,z^{3}+{.187463}\,z^{4},\,-{.17309}\,x^{4}+{.154303}\,x^{3}y+{.154118}\,x^{2}y^{2}+{.154303}\,x\,y^{3}-{.173089}\,y^{4}+{.154303}\,x^{3}z+{.481666}\,x^{2}y\,z+{.481666}\,x\,y^{2}z+{.154303}\,y^{3}z+{.154119}\,x^{2}z^{2}+{.481666}\,x\,y\,z^{2}+{.154119}\,y^{2}z^{2}+{.154303}\,x\,z^{3}+{.154303}\,y\,z^{3}-{.173089}\,z^{4},\,{.017071}\,x^{4}-{.274117}\,x^{3}y+{.114089}\,x^{2}y^{2}+{.0458084}\,x\,y^{3}+{.0971204}\,y^{4}+{.35939}\,x^{3}z+{.0682285}\,x^{2}y\,z+{.388166}\,x\,y^{2}z+{.439329}\,y^{3}z-{.0970331}\,x^{2}z^{2}-{.456394}\,x\,y\,z^{2}-{.0170557}\,y^{2}z^{2}-{.165212}\,x\,z^{3}-{.405198}\,y\,z^{3}-{.114191}\,z^{4},\,{.122001}\,x^{4}+{.349032}\,x^{3}y+{.0461748}\,x^{2}y^{2}-{.441435}\,x\,y^{3}-{.0757843}\,y^{4}+{.260389}\,x^{3}z+{.487607}\,x^{2}y\,z-{.302891}\,x\,y^{2}z+{.0628758}\,y^{3}z+{.075716}\,x^{2}z^{2}-{.184716}\,x\,y\,z^{2}-{.121891}\,y^{2}z^{2}-{.411908}\,x\,z^{3}+{.181046}\,y\,z^{3}-{.0462165}\,z^{4},\,{.129086}\,x^{4}+{.129174}\,x^{3}y-{.516422}\,x^{2}y^{2}+{.129175}\,x\,y^{3}+{.129086}\,y^{4}+{.129174}\,x^{3}z+{.128864}\,x^{2}y\,z+{.128865}\,x\,y^{2}z+{.129174}\,y^{3}z-{.516422}\,x^{2}z^{2}+{.128865}\,x\,y\,z^{2}-{.516422}\,y^{2}z^{2}+{.129175}\,x\,z^{3}+{.129174}\,y\,z^{3}+{.129086}\,z^{4},\,-{.455461}\,x^{4}+{.307095}\,x^{3}y+{.0581603}\,x^{2}y^{2}+{.277735}\,x\,y^{3}-{.187495}\,y^{4}-{.0250904}\,x^{3}z+{.132422}\,x^{2}y\,z+{.0545113}\,x\,y^{2}z-{.161645}\,y^{3}z-{.016961}\,x^{2}z^{2}-{.186932}\,x\,y\,z^{2}-{.0411993}\,y^{2}z^{2}-{.145455}\,x\,z^{3}-{.252643}\,y\,z^{3}+{.642958}\,z^{4},\,{.479473}\,x^{4}+{.0093414}\,x^{3}y+{.0139964}\,x^{2}y^{2}+{.131362}\,x\,y^{3}-{.634165}\,y^{4}-{.306219}\,x^{3}z-{.139391}\,x^{2}y\,z+{.18439}\,x\,y^{2}z+{.261269}\,y^{3}z-{.0573736}\,x^{2}z^{2}-{.0449692}\,x\,y\,z^{2}+{.0433772}\,y^{2}z^{2}-{.270635}\,x\,z^{3}+{.174823}\,y\,z^{3}+{.154721}\,z^{4},\,{.288685}\,x^{4}-{.288646}\,x^{3}y-{.000168526}\,x^{2}y^{2}-{.288634}\,x\,y^{3}+{.288727}\,y^{4}-{.288634}\,x^{3}z+{.288748}\,x^{2}y\,z+{.288725}\,x\,y^{2}z-{.288637}\,y^{3}z-{.000171322}\,x^{2}z^{2}+{.288725}\,x\,y\,z^{2}-{.000198927}\,y^{2}z^{2}-{.288615}\,x\,z^{3}-{.288626}\,y\,z^{3}+{.288699}\,z^{4},\,-{.0463119}\,x^{4}-{.180577}\,x^{3}y+{.54128}\,x^{2}y^{2}-{.245933}\,x\,y^{3}-{.0683413}\,y^{4}-{.111555}\,x^{3}z+{.119838}\,x^{2}y\,z+{.176867}\,x\,y^{2}z-{.185216}\,y^{3}z-{.322653}\,x^{2}z^{2}-{.296723}\,x\,y\,z^{2}-{.218627}\,y^{2}z^{2}+{.365816}\,x\,z^{3}+{.357501}\,y\,z^{3}+{.114635}\,z^{4},\,{.105646}\,x^{4}+{.318124}\,x^{3}y-{.0600633}\,x^{2}y^{2}-{.270814}\,x\,y^{3}-{.0929063}\,y^{4}+{.34839}\,x^{3}z-{.273411}\,x^{2}y\,z+{.240505}\,x\,y^{2}z-{.315477}\,y^{3}z-{.438733}\,x^{2}z^{2}+{.0329303}\,x\,y\,z^{2}+{.498797}\,y^{2}z^{2}-{.00268313}\,x\,z^{3}-{.0775897}\,y\,z^{3}-{.0127151}\,z^{4},\,-{.00000235896}\,x^{4}+{.408254}\,x^{3}y-{.00000263972}\,x^{2}y^{2}-{.408251}\,x\,y^{3}+{.00000221554}\,y^{4}-{.408244}\,x^{3}z-{.00000393591}\,x^{2}y\,z+{.00000332025}\,x\,y^{2}z+{.408244}\,y^{3}z-{.00000105854}\,x^{2}z^{2}+{.00000155861}\,x\,y\,z^{2}+{.00000369752}\,y^{2}z^{2}+{.408246}\,x\,z^{3}-{.408251}\,y\,z^{3}+{.0000010862}\,z^{4},\,{.165248}\,x^{4}-{.0322529}\,x^{3}y-{.358917}\,x^{2}y^{2}+{.236807}\,x\,y^{3}-{.0108709}\,y^{4}-{.236949}\,x^{3}z+{.488121}\,x^{2}y\,z-{.0321114}\,x\,y^{2}z-{.219092}\,y^{3}z-{.0252692}\,x^{2}z^{2}-{.456012}\,x\,y\,z^{2}+{.384187}\,y^{2}z^{2}+{.251351}\,x\,z^{3}+{.000141831}\,y\,z^{3}-{.15438}\,z^{4},\,-{.0828541}\,x^{4}+{.271614}\,x^{3}y-{.236405}\,x^{2}y^{2}-{.136879}\,x\,y^{3}+{.184534}\,y^{4}-{.136636}\,x^{3}z-{.244742}\,x^{2}y\,z+{.545095}\,x\,y^{2}z-{.163738}\,y^{3}z+{.429033}\,x^{2}z^{2}-{.300354}\,x\,y\,z^{2}-{.192628}\,y^{2}z^{2}-{.107878}\,x\,z^{3}+{.273521}\,y\,z^{3}-{.101681}\,z^{4}\right\},\,\texttt{ring}\ \Rightarrow \ {\mathbb R}_{53}\mathopen{}\left[x\,{.}{.}\,z\right]\right\}$$


A few questions on Mathematics SE that I have answered using SumsOfSquares:

It seems that there is an "equivalent" package for Julia. There is also Parrilo et al.'s SOSTOOLS for Matlab, which is over two decades old.


$\color{magenta}{\dagger}$ Diego Cifuentes, Thomas Kahle, Pablo Parrilo, Sums of squares in Macaulay2, Journal of Software for Algebra and Geometry, Volume 10, 2020.

  • Thank you. I was able to duplicate this after I realized that needsPackage( "SumsOfSquares" ); must be typed by me, simply because of the i1 : in front. Then I multiplied $p$ by $(x^2 + y^2 + z^2)$ and ran it again; very hard to read the output. My guess is that the terms to be squared are separated by commas...yes, it has 15 terms. The first line lists the coefficients in increasing order, maybe convenient to ...not sure – Will Jagy Mar 11 '25 at 18:06
  • correction, the initial line also has 15 entries, so perhaps it is a sum $\Sigma c_i g_i(x,y,z)^2 $ Need to try that on some simpler examples where I can readily check – Will Jagy Mar 11 '25 at 18:13
  • @WillJagy I have given it a try and updated my answer. Since reading the output produced by Macaulay2 is hard, I usually use the command tex to generate the $\TeX$ for the outputs and then read them on Mathematics SE. – Rodrigo de Azevedo Mar 11 '25 at 18:41
  • Thanks again: potentially big question: how do we get an expression with rational coefficients out of such a mess of decimals? Note that the OP at https://mathoverflow.net/questions/488871/show-degree-six-schur-inequality-cant-be-represented-as-the-sum-of-square-of-po gave an expression with multiplier $2(x^2 + y^2 + z^2 - yz - zx -xy)$ rather than $(x^2 + y^2 + z^2)$ – Will Jagy Mar 11 '25 at 23:29
  • @WillJagy Helfried Peyrl, Pablo Parrilo, Computing sum of squares decompositions with rational coefficients, Theoretical Computer Science, Volume 409, Issue 2, December 2008. – Rodrigo de Azevedo Mar 12 '25 at 09:08
  • @WillJagy In Example 1, a rational SOS decomposition is produced, though that is not the case in the instance mentioned in my answer. Perhaps, when the rational numbers become too long, the decimals are printed instead? My experience with numerical methods using arbitrary-precision rationals is that "long" rationals that take a full page to print can be produced in less than 20 iterations – Rodrigo de Azevedo Mar 12 '25 at 09:21
  • 1
    I found a piece by Scheiderer, rational coefficients are not always possible.. https://arxiv.org/pdf/1209.2976 – Will Jagy Mar 12 '25 at 16:40