# Maple gives phantom solution to inequalities

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?

-
Your conclusion that the system has no solution seems correct. Can't say what Maple is doing though (I don't have Maple so I can experiment). – icurays1 Jan 29 '13 at 17:28
Are you sure that the command solve works for inequalities? – Sigur Jan 29 '13 at 17:51
Maple is just 'solving' the last 2 equalities that you gave. – Calvin Lin Jan 29 '13 at 17:53
@Sigur It does. For example, solve({a+b = 1, 3*a+2*b > 1}, {a,b}); returns {a = -b+1, b < 2}. – user53153 Jan 29 '13 at 17:56
@SimonWillerton, just a question. I didn't know that solve could be used to do that. – Sigur Jan 29 '13 at 17:59

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.

-
Thanks. I'm not sure where to report bugs, but I've posted it over at mapleprimes. – Simon Willerton Jan 29 '13 at 20:54

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.

-
Thanks. I'll have to update to Maple 16 for this, though. – Simon Willerton Jan 29 '13 at 21:59