Function Repository Resource:

PolynomialSystemInfeasibilityCertificate

Source Notebook

Find an independently verifiable certificate proving that a polynomial system has no solutions

Contributed by: Adam Strzeboński

ResourceFunction["PolynomialSystemInfeasibilityCertificate"][{f1,,fk},{g1,,gm},vars,Reals]

finds an infeasibility certificate for the real system f1==0∧fk==0∧g1>=0∧gm>=0.

ResourceFunction["PolynomialSystemInfeasibilityCertificate"][{f1,,fk},{g1,,gm},vars,Complexes]

finds an infeasibility certificate for the complex system f1==0∧fk==0∧g1!=0∧gm!=0.

Details

ResourceFunction["PolynomialSystemInfeasibilityCertificate"] is typically used to find an independently verifiable certificate proving that a system of real polynomial equations and inequalities does not have real solutions or a system of complex polynomial equations and inequations does not have complex solutions.
ResourceFunction["PolynomialSystemInfeasibilityCertificate"][{f1,,fk},{g1,,gm},vars,Reals] requires {f1,,fk} and {g1,,gm} to be polynomials in vars with real numeric coefficients.
An infeasibility certificate for a real system has the form {{t1,,tr},{u1,,uk}}. Each ti is a triple {qi,μi,αi}, where qi is a real symmetric positive semidefinite matrix, μi is a list of monomials in vars, and αi is a subset of {1,,m}. The {u1,,uk} are polynomials in vars with real numeric coefficients. Let si=μi.qi.μi and . Then si is non-negative for all values vars. The certificate satisfies the condition 1+i=1rsiγi==u1f1++ukfk. Note that at any real solution of the system f1==0∧fk==0∧g1>=0∧gm>=0 we would have 1+i=1rsiγi>=1 and u1f1++ukfk==0, and hence the system has no real solutions.
ResourceFunction["PolynomialSystemInfeasibilityCertificate"][{f1,,fk},{g1,,gm},vars,Complexes] requires {f1,,fk} and {g1,,gm} to be polynomials in vars with numeric coefficients.
An infeasibility certificate for a complex system has the form {{u1,,uk},{e1,,em}}, where {u1,,uk} are polynomials in vars with numeric coefficients and {e1,,em} are non-negative integers. The certificate satisfies the condition u1f1++ukfk==g1e1··gmem. Note that at any solution of the system f1==0∧fk==0∧g1!=0∧gm!=0 we would have u1f1++ukfk==0 and g1e1··gmem!=0, and hence the system has no solutions.

Examples

Basic Examples (2) 

Find an infeasibility certificate for the real system x2+y2=1 ∧ x4+y4≤1/4:

In[1]:=
ff = {x^2 + y^2 - 1};
gg = {1/4 - x^4 - y^4};
{tt, uu} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][ff, gg, {x, y}, Reals]
Out[3]=

Verify that the matrices qi are positive semidefinite:

In[4]:=
PositiveSemidefiniteMatrixQ[#[[1]]] & /@ tt
Out[4]=

Verify the condition 1+∑i=1rsiγi==u1f1++ukfk:

In[5]:=
ss = #[[2]] . #[[1]] . #[[2]] & /@ tt;
h = 1 + ss . ((Times @@ Part[gg, #[[3]]]) & /@ tt);
Expand[h - uu . ff]
Out[6]=

Find an infeasibility certificate for the complex system x4+y4+z4=1 ∧ 2 x2 y2+z4=1 ∧ x≠y ∧ x≠-y:

In[7]:=
ff = {x^4 + y^4 + z^4 - 1, 2 x^2 y^2 + z^4 - 1};
gg = {x - y, x + y};
{uu, ee} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][ff, gg, {x, y, z}, Complexes]
Out[9]=

Verify the condition u1f1++ukfk==g1e1··gmem:

In[10]:=
Expand[uu . ff - Times @@ (gg^ee)]
Out[10]=

We obtain a similar result by creating a new equation that forces both inequations to be False and removing the inequations:

In[11]:=
ResourceFunction["PolynomialSystemInfeasibilityCertificate"][
 Join[ff, {x^2 - y^2 - 1}], {}, {x, y, z}, Complexes]
Out[11]=

Scope (6) 

Infeasibility certificate for a real system of equations:

In[12]:=
ff = {x^2 + y^2 + z, z - 1};
gg = {};
{tt, uu} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][ff, gg, {x, y, z}, Reals];

Verify correctness of the certificate:

In[13]:=
PositiveSemidefiniteMatrixQ[#[[1]]] & /@ tt
Out[13]=
In[14]:=
ss = #[[2]] . #[[1]] . #[[2]] & /@ tt;
h = 1 + ss . ((Times @@ Part[gg, #[[3]]]) & /@ tt);
Expand[h - uu . ff]
Out[1]=

Visualize the disjoint solution surfaces of the equations:

In[15]:=
ContourPlot3D[{x^2 + y^2 + z == 0, z - 1 == 0}, Sequence[{x, -1, 1}, {y, -1, 1}, {z, -1, 1}, Mesh -> None, Ticks -> None, ImageSize -> Small]]
Out[15]=

Infeasibility certificate for a real system of inequalities:

In[16]:=
ff = {};
gg = {1 - x^2 - y^2 - z^2, 1 - (x - 2)^4 - (y - 2)^4 - z^4};
{tt, uu} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][ff, gg, {x, y, z}, Reals];

Verify correctness of the certificate:

In[17]:=
PositiveSemidefiniteMatrixQ[#[[1]]] & /@ tt
Out[17]=
In[18]:=
ss = #[[2]] . #[[1]] . #[[2]] & /@ tt;
h = 1 + ss . ((Times @@ Part[gg, #[[3]]]) & /@ tt);
Expand[h - uu . ff]
Out[11]=

Visualize the disjoint solution regions of the inequalities:

In[19]:=
RegionPlot3D[{1 - x^2 - y^2 - z^2 >= 0, 1 - (x - 2)^4 - (y - 2)^4 - z^4 >= 0}, Sequence[{x, -1, 3}, {y, -1, 3}, {z, -1, 1}, BoxRatios -> Automatic, Mesh -> None, Ticks -> None, PlotPoints -> 40, ImageSize -> Small]]
Out[19]=

Infeasibility certificate for a real system of equations and inequalities:

In[20]:=
ff = {x^2 + y^2 + z^2 - 1};
gg = {z^2 - 1/2, x^2 + y^2 - 2/3};
{tt, uu} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][ff, gg, {x, y, z}, Reals];

Verify correctness of the certificate:

In[21]:=
PositiveSemidefiniteMatrixQ[#[[1]]] & /@ tt
Out[21]=
In[22]:=
ss = #[[2]] . #[[1]] . #[[2]] & /@ tt;
h = 1 + ss . ((Times @@ Part[gg, #[[3]]]) & /@ tt);
Expand[h - uu . ff]
Out[23]=

Visualize the disjoint solution sets of the equation and of the inequalities:

In[24]:=
Show[{ContourPlot3D[x^2 + y^2 + z^2 - 1 == 0, Sequence[{x, -1, 1}, {y, -1, 1}, {z, -1, 1}, Ticks -> None, Mesh -> None]], RegionPlot3D[z^2 - 1/2 >= 0 && x^2 + y^2 - 2/3 >= 0, Sequence[{x, -1, 1}, {y, -1, 1}, {z, -1, 1}, PlotStyle -> Red, Ticks -> None, Mesh -> None]]}, ImageSize -> Small]
Out[24]=

Find an infeasibility certificate for the complex system of equations:

In[25]:=
ff = {x^2 - y, y^2 - z, x^4 - z + 1};
gg = {};
{uu, ee} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][ff, gg, {x, y, z}, Complexes]
Out[27]=

Verify correctness of the certificate:

In[28]:=
Expand[uu . ff - Times @@ (gg^ee)]
Out[28]=

Find an infeasibility certificate for the complex system of equations and inequations:

In[29]:=
ff = {(x^2 - y)^2, (y^2 - z)^3};
gg = {x^4 - z};
{uu, ee} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][ff, gg, {x, y, z}, Complexes]
Out[31]=

Verify correctness of the certificate:

In[32]:=
Expand[uu . ff - Times @@ (gg^ee)]
Out[32]=

PolynomialSystemInfeasibilityCertificate returns unevaluated when it fails to find an infeasibility certificate:

In[33]:=
ResourceFunction[
 "PolynomialSystemInfeasibilityCertificate"][{x - y}, {x + y}, {x, y}, Reals]
Out[33]=

In this case the system has solutions:

In[34]:=
FindInstance[x - y == 0 && x + y >= 0, {x, y}, Reals]
Out[34]=

Applications (3) 

Find an independently verifiable proof that surfaces x2+y2+z2=1 and x4+y4+z4=1/4 are disjoint:

In[35]:=
ff = {x^2 + y^2 + z^2 - 1, x^4 + y^4 + z^4 - 1/4};
gg = {};
{tt, uu} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][ff, gg, {x, y, z}, Reals];

Verify the proof:

In[36]:=
PositiveSemidefiniteMatrixQ[#[[1]]] & /@ tt
Out[36]=
In[37]:=
ss = #[[2]] . #[[1]] . #[[2]] & /@ tt;
h = 1 + ss . ((Times @@ Part[gg, #[[3]]]) & /@ tt);
Expand[h - uu . ff]
Out[39]=

Visualize the surfaces:

In[40]:=
ContourPlot3D[{x^2 + y^2 + z^2 == 1, x^4 + y^4 + z^4 == 1/4}, Sequence[{x, -1, 1}, {y, -1, 1}, {z, -1, 1},
   ContourStyle -> {
Opacity[0.5], Red}, Mesh -> None, Ticks -> None, ImageSize -> Small]]
Out[40]=

Find a proof that solids z2≥2 x2+2 y2 and 16 (x2+y2)≥(x2+y2+z2+2)2 are disjoint:

In[41]:=
ff = {};
gg = {z^2 - 2 x^2 - 2 y^2, 16 (x^2 + y^2) - (x^2 + y^2 + z^2 + 2)^2};
{tt, uu} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][ff, gg, {x, y, z}, Reals];

Verify the proof:

In[42]:=
PositiveSemidefiniteMatrixQ[#[[1]]] & /@ tt
Out[42]=
In[43]:=
ss = #[[2]] . #[[1]] . #[[2]] & /@ tt;
h = 1 + ss . ((Times @@ Part[gg, #[[3]]]) & /@ tt);
Expand[h - uu . ff]
Out[45]=

Visualize the solids:

In[46]:=
RegionPlot3D[{z^2 >= 2 x^2 + 2 y^2, 16 (x^2 + y^2) >= (x^2 + y^2 + z^2 + 2)^2}, Sequence[{x, -5, 5}, {y, -5, 5}, {z, -5, 5}, Mesh -> None, Ticks -> None, PlotPoints -> 40, ImageSize -> Small]]
Out[46]=

Find a proof that x+y+z belongs to the radical of ⟨x3+y3+z3,(x+y)2 (x+z)2 (y+z)2:

In[47]:=
ff = {x^3 + y^3 + z^3, (x + y)^2 (x + z)^2 (y + z)^2};
g = x + y + z;
{{u, v}, {e}} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][
  ff, {g}, {x, y, z}, Complexes]
Out[49]=

Verify that (x+y+z)e==u(x3+y3+z3)+v((x+y)2 (x+z)2 (y+z)2):

In[50]:=
Expand[g^e - {u, v} . ff]
Out[50]=

Properties and Relations (4) 

PolynomialSystemInfeasibilityCertificate finds an independently verifiable certificate of infeasibility:

In[51]:=
ff = {x^8 + y^8 + z^8 - 1};
gg = {x^2 + y^2 - z^2, z - 99/100};
({tt, uu} = ResourceFunction["PolynomialSystemInfeasibilityCertificate"][ff, gg, {x, y, z}, Reals];) // AbsoluteTiming
Out[53]=

Verify correctness of the certificate:

In[54]:=
PositiveSemidefiniteMatrixQ[#[[1]]] & /@ tt
Out[54]=
In[55]:=
ss = #[[2]] . #[[1]] . #[[2]] & /@ tt;
h = 1 + ss . ((Times @@ Part[gg, #[[3]]]) & /@ tt);
Expand[h - uu . ff]
Out[57]=

FindInstance usually faster proves infeasibility, but does not provide a certificate:

In[58]:=
FindInstance[
  x^8 + y^8 + z^8 - 1 == 0 && x^2 + y^2 - z^2 >= 0 && z - 99/100 >= 0, {x, y, z}, Reals] // AbsoluteTiming
Out[58]=

You can also prove infeasibility using Resolve:

In[59]:=
Resolve[Exists[{x, y, z}, x^8 + y^8 + z^8 - 1 == 0 && x^2 + y^2 - z^2 >= 0 && z - 99/100 >= 0], Reals] // AbsoluteTiming
Out[59]=

Possible Issues (3) 

PolynomialSystemInfeasibilityCertificate may fail even if the problem is infeasible:

In[60]:=
ResourceFunction[
  "PolynomialSystemInfeasibilityCertificate"][{x^2 + y^2 - 1}, {-x^3 + 2 y^3 - 2 - 10^-7}, {x, y}, Reals] // Head
Out[60]=

This shows that x2+y2-1=0∧-x3+2 y3-2-ε>=0 is infeasible for any ε>0:

In[61]:=
MaxValue[{-x^3 + 2 y^3, x^2 + y^2 - 1 == 0}, {x, y}]
Out[61]=

For a larger value of ε PolynomialSystemInfeasibilityCertificate succeeds:

In[62]:=
ResourceFunction[
  "PolynomialSystemInfeasibilityCertificate"][{x^2 + y^2 - 1}, {-x^3 + 2 y^3 - 2 - 10^-6}, {x, y}, Reals] // Head
Out[62]=

Publisher

Adam Strzebonski

Version History

  • 1.0.0 – 10 January 2022

Related Resources

License Information