log(3).is_finite returns None

8 views
Skip to first unread message

smichr

unread,
Jan 21, 2011, 6:07:51 AM1/21/11
to sympy
Is there any reason that log(3).is_finite shouldn't return True?

Aaron S. Meurer

unread,
Jan 21, 2011, 2:07:20 PM1/21/11
to sy...@googlegroups.com
It's hard to say because we don't have documentation on the various assumptions. What exactly is is_finite, and do we need it? If it just means "a number that isn't infinity," how is that different from is_number? If it means bounded, we have is_bounded already too.

Aaron Meurer

smichr

unread,
Jan 27, 2011, 4:51:28 AM1/27/11
to sympy
On Jan 22, 12:07 am, "Aaron S. Meurer" <asmeu...@gmail.com> wrote:
> It's hard to say because we don't have documentation on the various assumptions.  What exactly is is_finite, and do we need it?  If it just means "a number that isn't infinity," how is that different from is_number?  If it meansbounded, we have is_bounded already too.
>

an infinitesimal is not finite:

h[2] >>> var('x', infinitesimal=1)
x
h[3] >>> x.is_finite
False

smichr

unread,
Jan 28, 2011, 12:05:38 AM1/28/11
to sympy
This truth table might help:

is
----------------------------
finite bounded zero
infinitesimal 0 - -
infinity 0 0 0
not infinitesimal - - 0

infinitesimal is to 0 what oo is to Infinity. There are two places in
sympy where is_finite is used when I think what was intended was
"foo.is_bounded is not False" or "not foo.is_unbounded"

/c

smichr

unread,
Jan 28, 2011, 12:11:26 AM1/28/11
to sympy
One place occurs in limits and the other in simplify. In simplify it
is processing Reals so it is ok there. I am changing the other
occurance, however.

Aaron S. Meurer

unread,
Jan 28, 2011, 2:00:29 PM1/28/11
to sy...@googlegroups.com
So both infinitesimals and noninfinitesimals are bounded? I'm not sure how well that kind of logic will work with an SAT solver based assumptions system.

Aaron Meurer

Vinzent Steinberg

unread,
Jan 29, 2011, 6:46:58 AM1/29/11
to sympy
On 28 Jan., 20:00, "Aaron S. Meurer" <asmeu...@gmail.com> wrote:
> So both infinitesimals and noninfinitesimals are bounded?  I'm not sure how well that kind of logic will work with an SAT solver based assumptions system.

Noninfinitesimals is not exact imho, because infinity is also not an
infinitesimal. How could an infinitesimal or a "finitesimal" not be
bounded?

Vinzent

Aaron S. Meurer

unread,
Jan 29, 2011, 1:06:03 PM1/29/11
to sy...@googlegroups.com
This whole infinitesimal business is sketchy at best. A git grep infinitesimal reveals that the only places where it is used is in setting some other assumptions, like in log.is_positive (which has a wrong result, btw; I think log(unbounded).is_positive should return None, not True).

Does infinitesimal actually have any practical uses, or at least could it?

Right. A implies B doesn't mean that !A implies !B. I think infinitesimal.is_bounded should just return None. And it also seems to me that infinitesimal.is_bounded should return True.

Aaron Meurer

Chris Smith

unread,
Jan 29, 2011, 12:15:42 PM1/29/11
to sy...@googlegroups.com
> Noninfinitesimals is not exact imho, because infinity is also not an
> infinitesimal. How could an infinitesimal or a "finitesimal" not be
> bounded?

An infinitesimal is unboundedly small, indistinguishable from 0, so eps**-2 would give infinity.

Chris Smith

unread,
Jan 29, 2011, 9:33:05 PM1/29/11
to sy...@googlegroups.com
Aaron S. Meurer wrote:
> This whole infinitesimal business is sketchy at best. A git grep
> infinitesimal reveals that the only places where it is used is in
> setting some other assumptions, like in log.is_positive (which has a
> wrong result, btw; I think log(unbounded).is_positive should return
> None, not True).

limit(log(x), x, oo) should be positive like oo (and it is) but
as x_.-oo it seems to me that the answer should be zoo not oo:

h[4] >>> log(-oo)
oo
h[4] >>> limit(log(x), x, -oo)
oo

That should be log(oo) + I*pi

>
> Does infinitesimal actually have any practical uses, or at least
> could it?

I'm not sure. I just discovered it while working on the power _is_bounded method.

/c

Chris Smith

unread,
Jan 29, 2011, 10:00:08 PM1/29/11
to sy...@googlegroups.com
Re limit(log(x), x, -oo) -> oo rather than oo + I*pi or zoo, gruntz says:

# For limits of complex functions, the algorithm would have to be
# improved, or just find limits of Re and Im components separately.

so this is a known deficiency.

/c

Vinzent Steinberg

unread,
Jan 30, 2011, 9:12:04 AM1/30/11
to sympy
I thought "bounded" is meant with respect to +-oo, so if x is an
infinitesimal, for any eps > 0 we have abs(x) < eps, and thus it is
bounded. If "bounded" also applies with respect to 0, I don't
understand how it could be useful.

> I think infinitesimal.is_bounded should just return None. And it also seems to me that infinitesimal.is_bounded should return True.

A contradiction? :)


Vinzent

Chris Smith

unread,
Jan 30, 2011, 11:13:38 AM1/30/11
to sy...@googlegroups.com
Vinzent Steinberg wrote:
>> I thought "bounded" is meant with respect to +-oo, so if x is an
>> infinitesimal, for any eps > 0 we have abs(x) < eps, and thus it is
>> bounded. If "bounded" also applies with respect to 0, I don't
>> understand how it could be useful.

I was just trying to rationalize why it might be like it is.
I agree that it seems that it should be considered bounded.
Having is_finite=True is perhaps more descriptive; in that case
both it and Zero share a False attribute.

/c

Aaron S. Meurer

unread,
Jan 30, 2011, 2:50:30 PM1/30/11
to sy...@googlegroups.com

Sorry, I meant (not infinitesimal).is_bounded should return None.

Aaron Meurer

>
> Vinzent

Aaron S. Meurer

unread,
Jan 30, 2011, 2:52:46 PM1/30/11
to sy...@googlegroups.com
There is is_finite too? Is this just a duplicate of is_bounded?

Aaron Meurer

Chris Smith

unread,
Jan 30, 2011, 10:04:37 PM1/30/11
to sy...@googlegroups.com
Aaron S. Meurer wrote:
>> There is is_finite too? Is this just a duplicate of is_bounded?

See the truth table I posted below. is_finite is used (perhaps erroneously) to tell about infinitesimals.

/c

Reply all
Reply to author
Forward
0 new messages