Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The domain parameter of Reduce[]

18 views
Skip to first unread message

Szabolcs

unread,
Jan 10, 2012, 6:01:42 AM1/10/12
to
My question if motivated by http://stackoverflow.com/questions/8780068/mathematica-finding-the-conditions-for-the-real-part-of-a-complex-number-to-be

It seems that

Reduce[{ComplexExpand@Re[-1 - Sqrt[a - b] ] < 0, a > 0, b > 0}, {a, b}, Complexes]

will return a different result from

Reduce[{ComplexExpand@Re[-1 - Sqrt[a - b] ] < 0, a > 0, b > 0}, {a, b}]

Also the result of this latter calculation seems incorrect (I didn't expect 'b' to be restricted to be less than 'a')

How does the domain parameter of Reduce work? Isn't Complexes the default domain? What changes if we specify Complexes explicitly? Also, if the result of the second example incorrect (a bug)?

Andrzej Kozlowski

unread,
Jan 11, 2012, 4:23:48 AM1/11/12
to
There is something pretty fishy here, I would say.


Reduce uses the following principle: everything appearing on an algebraic level in an inequality will be assumed to be real,unless the domain Complexes is used.


Consider first both expressions without ComplexExpand:

In[17]:= Reduce[{Re[-1 - Sqrt[a - b]] < 0, a > 0, b > 0}, {a, b}]

a > 0 && (b >= a || 0 < b < a)

Reduce[{Re[-1 - Sqrt[a - b]] < 0, a > 0, b > 0}, {a,
b}, Complexes]

a > 0 && (b >= a || 0 < b < a)

The answers are identical and both are actually equivalent to the given assumption a>0&&b>0. Reduce did not assume that Sqrt[a-b] is real because of the presence of Re (this is what is mean by "algebraic level": Re[x] is not "algebraic"). Now consider:

ComplexExpand@Re[-1 - Sqrt[a - b]]

-1 - ((a - b)^2)^(1/4) Cos[1/2 Arg[a - b]]

Now there is no Re here and ((a - b)^2)^(1/4) is algebraic. So it will be assumed to be real. But this assumption, of course, does not entail that a>=b. Yet Reduce seems to think that it does:

Reduce[{-1 - ((a - b)^2)^(1/4) Cos[1/2 Arg[a - b]] < 0,
a > 0, b > 0}, {a, b}]

a > 0 && 0 < b <= a

As one would expect, with the domain Complexes it no longer assumes that:

Reduce[{-1 - ((a - b)^2)^(1/4) Cos[1/2 Arg[a - b]] < 0,
a > 0, b > 0}, {a, b}, Complexes]

a > 0 && b > 0

The first behaviour would not, perhaps, be surprising if the expression was

Reduce[{-1 - ((a - b)^(1/4))^2 Cos[1/2 Arg[a - b]] < 0,
a > 0, b > 0}, {a, b}]

a > 0 && 0 < b <= a

for this time indeed the expression (a - b)^(1/4) is real only if a>=b. But the really curious thing is that if you remove the requirement that a and b be positive you get:


Reduce[{-1 - ((a - b)^2)^(1/4) Cos[1/2 Arg[a - b]] < 0}, {a,
b}]

(a | b) \[Element] Reals

Reduce[{-1 - ((a - b)^(1/4))^2 Cos[1/2 Arg[a - b]] < 0}, {a,
b}]

(a | b) \[Element] Reals

Now that's really odd, since this case clearly includes the previous one as a sub-case. So if the inequality holds for all real a and b, it also holds for all positive a and b?

Andrzej Kozlowski




Murray Eisenberg

unread,
Jan 11, 2012, 4:31:15 AM1/11/12
to
Manifestly, the result of the first Reduce, namely,

a > 0 && b > 0

is correct whereas the result of the second Reduce, namely,

a > 0 && 0 < b <= a

is wrong. For example,

Re[-1 - Sqrt[a - b] /. {a -> 1/4, b -> 1/2}]

has value -1 even though b > a.

But I don't know why adding the domain Complexes works, because I've
never understood the documentation for Reduce as to exactly what is mean
by "doing the Reduction over" a specified domain.

The documentation seems to suggest by means of examples that what this
means is that the equalities and inequalities are allowed to hold in
that domain -- rather than that the variables involved are restricted
to, or allowed to range over values, in that domain.

But I don't think the docs actually come right out and say that. (An
all-too-common shortcoming of documentation.)

On 1/10/12 5:59 AM, Szabolcs wrote:
> My question if motivated by http://stackoverflow.com/questions/8780068/mathematica-finding-the-conditions-for-the-real-part-of-a-complex-number-to-be
>
> It seems that
>
> Reduce[{ComplexExpand@Re[-1 - Sqrt[a - b] ]< 0, a> 0, b> 0}, {a, b}, Complexes]
>
> will return a different result from
>
> Reduce[{ComplexExpand@Re[-1 - Sqrt[a - b] ]< 0, a> 0, b> 0}, {a, b}]
>
> Also the result of this latter calculation seems incorrect (I didn't expect 'b' to be restricted to be less than 'a')
>
> How does the domain parameter of Reduce work? Isn't Complexes the default domain? What changes if we specify Complexes explicitly? Also, if the result of the second example incorrect (a bug)?
>

--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305

Adam Strzebonski

unread,
Jan 11, 2012, 5:25:47 PM1/11/12
to
Andrzej Kozlowski wrote:
> On 10 Jan 2012, at 11:59, Szabolcs wrote:
>
>> My question if motivated by
>> http://stackoverflow.com/questions/8780068/mathematica-finding-the-conditions-for-the-real-part-of-a-complex-number-to-be
>>
>>
>> It seems that
>>
>> Reduce[{ComplexExpand@Re[-1 - Sqrt[a - b] ] < 0, a > 0, b > 0}, {a,
>> b}, Complexes]
>>
>> will return a different result from
>>
>> Reduce[{ComplexExpand@Re[-1 - Sqrt[a - b] ] < 0, a > 0, b > 0}, {a,
>> b}]
>>
>> Also the result of this latter calculation seems incorrect (I
>> didn't expect 'b' to be restricted to be less than 'a')
>>
>> How does the domain parameter of Reduce work? Isn't Complexes the
>> default domain? What changes if we specify Complexes explicitly?
>> Also, if the result of the second example incorrect (a bug)?
>>
>
>
> There is something pretty fishy here, I would say.
>
>
> Reduce uses the following principle: everything appearing on an
> algebraic level in an inequality will be assumed to be real,unless
> the domain Complexes is used.
>
>
> Consider first both expressions without ComplexExpand:
>
> In[17]:= Reduce[{Re[-1 - Sqrt[a - b]] < 0, a > 0, b > 0}, {a, b}]
>
> a > 0 && (b >= a || 0 < b < a)
>
> Reduce[{Re[-1 - Sqrt[a - b]] < 0, a > 0, b > 0}, {a, b}, Complexes]
>
> a > 0 && (b >= a || 0 < b < a)
>
> The answers are identical and both are actually equivalent to the
> given assumption a>0&&b>0. Reduce did not assume that Sqrt[a-b] is
> real because of the presence of Re (this is what is mean by
> "algebraic level": Re[x] is not "algebraic"). Now consider:
>
> ComplexExpand@Re[-1 - Sqrt[a - b]]
>
> -1 - ((a - b)^2)^(1/4) Cos[1/2 Arg[a - b]]
>
> Now there is no Re here and ((a - b)^2)^(1/4) is algebraic. So it
> will be assumed to be real. But this assumption, of course, does not
> entail that a>=b. Yet Reduce seems to think that it does:
>
> Reduce[{-1 - ((a - b)^2)^(1/4) Cos[1/2 Arg[a - b]] < 0, a > 0, b >
> 0}, {a, b}]
>
> a > 0 && 0 < b <= a
>
> As one would expect, with the domain Complexes it no longer assumes
> that:
>
> Reduce[{-1 - ((a - b)^2)^(1/4) Cos[1/2 Arg[a - b]] < 0, a > 0, b >
> 0}, {a, b}, Complexes]
>
> a > 0 && b > 0
>
> The first behaviour would not, perhaps, be surprising if the
> expression was
>
> Reduce[{-1 - ((a - b)^(1/4))^2 Cos[1/2 Arg[a - b]] < 0, a > 0, b >
> 0}, {a, b}]
>
> a > 0 && 0 < b <= a
>
> for this time indeed the expression (a - b)^(1/4) is real only if
> a>=b. But the really curious thing is that if you remove the
> requirement that a and b be positive you get:
>
>
> Reduce[{-1 - ((a - b)^2)^(1/4) Cos[1/2 Arg[a - b]] < 0}, {a, b}]
>
> (a | b) \[Element] Reals
>
> Reduce[{-1 - ((a - b)^(1/4))^2 Cos[1/2 Arg[a - b]] < 0}, {a, b}]
>
> (a | b) \[Element] Reals
>
> Now that's really odd, since this case clearly includes the previous
> one as a sub-case. So if the inequality holds for all real a and b,
> it also holds for all positive a and b?
>
> Andrzej Kozlowski
>
>
>
>

This is a bug. A transformation produces a disjunction term involving
Sec[Arg[a - b]/2], and the requirement that Sec[Arg[a - b]/2] be real
valued gets applied to a too wide context. It will be fixed in the next
release of Mathematica.

Best regards,

Adam Strzebonski
Wolfram Research

0 new messages