5
$\begingroup$

For some reason, the output of the code below is False.

Reduce[(1/(
 2 a (-2 r + c^2 (1 + r)) (-1 + x)) (r - a c (2 + r) - 
   3 a r (-1 + x) + c^2 (-r + a (2 + r) x) - 
   Sqrt[-1 + c] Sqrt[r]
     Sqrt[(-1 + c) (1 + c)^2 r + 
     2 a (r + c (2 - (2 + c) r) + (-1 + c) (1 + c)^2 r x) + 
     a^2 (-8 + 4 c - r + 5 c r + 
        2 (r + c (2 - (2 + c) r)) x + (-1 + c) (1 + 
           c)^2 r x^2)])) > 1 && (c - a (1 - c))/c > r > a/(1 + a - c) && 1 > c > a > 0]

The way I understand the result is that Mathematica suggests that they can not all be true at the same time.

But, for example {c -> .5, a -> .1, r -> .8, x -> .15} will satisfy that.

Am I understanding it wrong? Or, is the Reduce function giving me a wrong output here?

$\endgroup$
7
  • 1
    $\begingroup$ Congratulation, you seem to discover a serious bug. ;-) Should be reported to Wolfram. $\endgroup$ Commented Nov 22 at 10:49
  • $\begingroup$ Omg! I feel good and bad at the same time. Are bugs like this common? I am not feeling confident about my other results now then! $\endgroup$
    – C. K
    Commented Nov 22 at 10:54
  • $\begingroup$ Bugs appear from time to time like with any other software. It should be investigated what is special about your inequality system. The output of Reduce is reliable most of the time. $\endgroup$ Commented Nov 22 at 11:00
  • 4
    $\begingroup$ @azerbajdzan This is not a bug, see my answer. $\endgroup$
    – yarchik
    Commented Nov 22 at 11:22
  • 2
    $\begingroup$ @azerbajdzan ; I think this is not a bug. Up to the documentation if an expression includes inequalities, then by default all variables are assumed real and Reduce works over the reals. However, there may be complex solutions. To find these, the domain Complexes should be explicitly indicated. $\endgroup$
    – user64494
    Commented Nov 22 at 12:18

2 Answers 2

6
$\begingroup$

This is not a bug. Your inequality contains Sqrt[-1 + c]. In general, this is a complex number, which you cannot compare unless $c \ge 1$. But this contradicts your other condition $1>c$.

$\endgroup$
5
  • 2
    $\begingroup$ It is not so simple. For example, Reduce[Sqrt[x]*Sqrt[x - 2] < 0, x, Complexes] performs Re[x] < 0 && Im[x] == 0. $\endgroup$
    – user64494
    Commented Nov 22 at 12:11
  • $\begingroup$ Your explanation is not deep and exact. Up to the documentation if an expression includes inequalities, then by default all variables are assumed real and Reduce works over the reals. However, there may be complex-valued solutions. To find these, the domain Complexes should be explicitly indicated. $\endgroup$
    – user64494
    Commented Nov 22 at 12:29
  • $\begingroup$ @yarchik Yes, you are right, the documentation states this limitation of Reduce. But then there is a question how to solve such a system? If the only requirement is that all three inequalities are satisfied after substitution of real variables. The OP values of variables are solution of the system even if Reduce was not designed for solving such cases. $\endgroup$ Commented Nov 22 at 15:34
  • $\begingroup$ @azerbajdzan Thanks, I feel that this question will be closed (I did not vote for closing). Given that there are already 3 closing votes, it might be better to ask how to solve such a problem as an independent question. $\endgroup$
    – yarchik
    Commented Nov 22 at 15:40
  • $\begingroup$ @yarchik Actually the documentation says what to do in such cases :-) Look at my answer. (+1) from me to your answer. $\endgroup$ Commented Nov 22 at 16:14
6
$\begingroup$

@yarchik's answer is correct that it is not a bug. I assumed it to be a bug too quickly without really looking what expressions contained and what documentation says about possible issues.

But anyway Reduce can in general solve even such systems but we need to add that variables are real and we are solving over Complexes.

The same is with FindInstance.

This returns {} because no solutions could be found.

FindInstance[(1/(2 a (-2 r + c^2 (1 + r)) (-1 + x)) (r - 
       a c (2 + r) - 3 a r (-1 + x) + c^2 (-r + a (2 + r) x) - 
       Sqrt[-1 + c] Sqrt[
         r] Sqrt[(-1 + c) (1 + c)^2 r + 
          2 a (r + c (2 - (2 + c) r) + (-1 + c) (1 + c)^2 r x) + 
          a^2 (-8 + 4 c - r + 5 c r + 
             2 (r + c (2 - (2 + c) r)) x + (-1 + 
                c) (1 + c)^2 r x^2)])) > 1 && (c - a (1 - c))/c > r > 
   a/(1 + a - c) && 1 > c > a > 0, {a, c, r, x}]

{}

But if we add ...&& {a, c, r, x} \[Element] Reals, {a, c, r, x}, Complexes] a solution is found.

FindInstance[(1/(2 a (-2 r + c^2 (1 + r)) (-1 + x)) (r - 
       a c (2 + r) - 3 a r (-1 + x) + c^2 (-r + a (2 + r) x) - 
       Sqrt[-1 + c] Sqrt[
         r] Sqrt[(-1 + c) (1 + c)^2 r + 
          2 a (r + c (2 - (2 + c) r) + (-1 + c) (1 + c)^2 r x) + 
          a^2 (-8 + 4 c - r + 5 c r + 
             2 (r + c (2 - (2 + c) r)) x + (-1 + 
                c) (1 + c)^2 r x^2)])) > 1 && (c - a (1 - c))/c > r > 
   a/(1 + a - c) && 
  1 > c > a > 0 && {a, c, r, x} \[Element] Reals, {a, c, r, 
  x}, Complexes]

{{a -> 1/15, c -> 1/15 (1 + Sqrt[31]), r -> 46/125, x -> -17}}

So same should be possible with Reduce. (it took some time as the system is complicated but solution was found).

Reduce[(1/(2 a (-2 r + c^2 (1 + r)) (-1 + x)) (r - a c (2 + r) - 
       3 a r (-1 + x) + c^2 (-r + a (2 + r) x) - 
       Sqrt[-1 + c] Sqrt[
         r] Sqrt[(-1 + c) (1 + c)^2 r + 
          2 a (r + c (2 - (2 + c) r) + (-1 + c) (1 + c)^2 r x) + 
          a^2 (-8 + 4 c - r + 5 c r + 
             2 (r + c (2 - (2 + c) r)) x + (-1 + 
                c) (1 + c)^2 r x^2)])) > 1 && (c - a (1 - c))/c > r > 
   a/(1 + a - c) && 
  1 > c > a > 0 && {a, c, r, x} \[Element] Reals, {a, c, r, 
  x}, Complexes]

(0 < a < 1/
    4 && ((a < c <= a + Sqrt[2 a + a^2] && 
       a/(1 + a - c) < r < (-a + c + a c)/
        c && (-a + a c - c r + a c r)/(a c r) < x < 
        1) || (a + Sqrt[2 a + a^2] < c < 
        1 && ((a/(1 + a - c) < 
            r < -(c^2/(-2 + c^2)) && ((-a + a c - c r + a c r)/(
              a c r) < 
              x <= (-2 a c + r - a r + c r + 2 a c r - c^2 r + 
                a c^2 r - c^3 r)/(a (-1 + c) (1 + c)^2 r) - 
               2 Sqrt[-((-c^2 + 2 r - c^2 r + c^4 r - 2 c^2 r^2 + 
                  c^4 r^2)/((-1 + c)^2 (1 + c)^4 r^2))] || 
             x > 1)) || (-(c^2/(-2 + c^2)) < r < (-a + c + a c)/
            c && (-a + a c - c r + a c r)/(a c r) < x < 1))))) || (1/
    4 <= a < 1 && a < c < 1 && 
   a/(1 + a - c) < r < (-a + c + a c)/c && (-a + a c - c r + a c r)/(
    a c r) < x < 1)
$\endgroup$
2
  • $\begingroup$ Very informative! (+) $\endgroup$
    – yarchik
    Commented Nov 22 at 16:47
  • $\begingroup$ +1 for && {a, c, r, x} \[Element] Reals. $\endgroup$
    – user64494
    Commented Nov 22 at 16:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.