Maple gives phantom solution to inequalities

1k Views Asked by At

I'm trying to get maple to solve some inequalities for me, and in particular to tell me when they have no solution. Unfortunately, it does not seem to be doing what I expect.

The following inequalities have no solution.

\begin{align*} 0 &\lt f[1], &0 &< f[2], \\0 &< f[3], &0 &< f[4], \\ 8 &< f[1]+f[3], &6 &< f[2]+f[4],\\ 6 &< f[2]+f[3], &7 &< f[1]+f[4],\\ 5&=f[1]+f[2], & 11/2&=f[3]+f[4] \end{align*}

This is because the left most bottom two expressions imply $1+f[1]<f[3]$ whereas the right-most bottom two expressions imply that $f[3]<f[1]-3/2$.

Yet if I put the following into maple 15

solve({f[1]+f[2] = 5, f[3]+f[4] = 11/2,  0 <f[1], 0 < f[2], 0 < f[3], 0 < f[4], 
         6 < f[2]+f[3], 6 < f[2]+f[4], 7 < f[1]+f[4], 8 < f[1]+f[3]},
                                                       {f[1],f[2],f[3],f[4]});

then it gives the following "solution":

{f[1] = 5-f[2], f[2] = f[2], f[3] = 11/2-f[4], f[4] = f[4]}

Who is being stupid here? Me or maple?

2

There are 2 best solutions below

1
On BEST ANSWER

Same happens in Maple 16. When the system with inequalities is inconsistent in a non-obvious way, Maple sometimes disregards all inequalities and returns a solution based on equations only. Probably should be a bug report; the Maple help file claims that systems of linear equations and inequalities are fully supported.

Here is a simpler example of this kind:

solve({ a + b = 1, a > 0, b > 1, c > 0 }, {a,b,c});

output: {a = -b+1, b = b, c = c}

The inconsistency of inequalities is non-obvious since it arises when the equation is taken into account.

Oddly enough, dropping the irrelevant inequality $c>0$ causes Maple to give correct answer: no solutions.

solve({a+b = 1, a>0, b>1}, {a,b,c});

output: nothing 

Definitely a bug.

1
On

In 16.01 on 64bit Linux on an Intel i5, after about 5 minutes,

SolveTools:-SemiAlgebraic({f1+f2 = 5, f3+f4 = 11/2,
                           0 <f1, 0 < f2, 0 < f3, 0 < f4,
                           6 < f2+f3, 6 < f2+f4,
                           7 < f1+f4, 8 < f1+f3},
                           [f1,f2,f3,f4]);

                         []

which, with [] as output, means no solutions.

More quickly,

SolveTools:-SemiAlgebraic({ a + b = 1, a > 0, b > 1, c > 0 }, {a,b,c});

                                   []

However, the computation time grows quickly with problem size, for this approach.

The solve command is using an older, faster, and buggier algorithm here.