Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sage mixes Infinity and +Infinity #9480

Closed
zimmermann6 opened this issue Jul 12, 2010 · 9 comments
Closed

Sage mixes Infinity and +Infinity #9480

zimmermann6 opened this issue Jul 12, 2010 · 9 comments

Comments

@zimmermann6
Copy link

This is related to #8942. The limit function can output either
+Infinity, -Infinity, or Infinity, the later
meaning a complex infinity. For example:

sage: limit(1/x, x=0, dir='above')
+Infinity
sage: limit(1/x, x=0, dir='below')
-Infinity
sage: limit(1/x, x=0)             
Infinity

However Sage does not distinguish +Infinity and Infinity:

sage: l1=limit(1/x, x=0, dir='above')
sage: l2=limit(1/x, x=0, dir='below')
sage: l3=limit(1/x, x=0)
sage: l1==l3
True

Component: coercion

Keywords: infinity, equality

Issue created by migration from https://trac.sagemath.org/ticket/9480

@burcin
Copy link

burcin commented Aug 29, 2010

comment:1

This is more of a problem with the equality checking rules in Sage and the coercion system than symbolics, so I'm changing the component to coercion.

If the arguments compare equal when coerced to a common parent, Sage returns True for the equality. In this case, the coercion goes to the UnsignedInfinityRing, where +Infinity is mapped to unsigned_infinity.

sage: UnsignedInfinityRing.has_coerce_map_from(InfinityRing)
True
sage: Infinity
+Infinity
sage: UnsignedInfinityRing.coerce(Infinity)
Infinity

BTW, isn't there an inconsistency in the capitalization of Infinity. Shouldn't it be lowercase according to Python conventions?

@burcin
Copy link

burcin commented Aug 29, 2010

Changed keywords from none to infinity, equality

@burcin burcin added this to the sage-4.5.3 milestone Aug 29, 2010
@burcin burcin assigned robertwb and unassigned burcin Aug 29, 2010
@tscrim
Copy link
Collaborator

tscrim commented May 11, 2012

comment:2

Sometimes it's infinity and others its Infinity. At the very least this should be consistent. Also there are other issues with infinity: #11506 #9547.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@zimmermann6
Copy link
Author

comment:4

in Sage 5.11 we get:

sage: l1=limit(1/x, x=0, dir='right'); l1
+Infinity
sage: l2=limit(1/x, x=0, dir='left'); l2 
-Infinity
sage: l3=limit(1/x, x=0); l3             
Infinity
sage: bool(l1==l2), bool(l2==l3), bool(l3==l1)
(False, False, False)

however the objects returned are in SR and not in the infinity class:

sage: type(l1), l1.parent()
(sage.symbolic.expression.Expression, Symbolic Ring)
sage: p1=+Infinity
sage: type(p1), p1.parent()
(sage.rings.infinity.PlusInfinity, The Infinity Ring)

I propose to close that ticket, and open a new one about the above issue (or add it to an existing ticket).

Paul

@zimmermann6
Copy link
Author

comment:5

or add it to an existing ticket

I've added a comment in #14857

Paul

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Dec 26, 2013

comment:6

No patch to review on this ticket...

Paul : when you want to close a ticket, you should set its milestone to wontfix/duplicate, say why on a comment, and change the status to positive_review so that the release manager will see it.

Nathann

@zimmermann6
Copy link
Author

comment:7

in Sage 6.0 we get:

sage: l1=limit(1/x, x=0, dir='above')
sage: l3=limit(1/x, x=0)
sage: bool(l1==l3)
False

thus the issue is fixed now, and I change the status to "fixed".

Paul

@zimmermann6
Copy link
Author

comment:8

sorry when changing to "fixed" (which made more sense to me than invalid or wontfix) the status was changed automatically to "closed"...

Paul

@tscrim
Copy link
Collaborator

tscrim commented Jan 3, 2014

comment:9

I also verified that it works in 6.1.beta2.

@tscrim tscrim removed this from the sage-6.1 milestone Jan 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants