First time here? Check out the FAQ!

Ask Your Question
0

Redundant assumptions

asked 0 years ago

Jidong gravatar image

updated 0 years ago

I want to verify certain inequalities involving real numbers and infinity. One case is showing certain expression is less than infinity. However, the following situation really puzzles me:

a = SR.var('a')
bool(a < infinity)

It returns 'False'. But when I do

assume(a < infinity)

It says

ValueError: Assumption is redundant

Why is this the case and how should I get 'True' for 'bool(a < infinity)'?

Thanks!

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 0 years ago

Emmanuel Charpentier gravatar image

"When all else fails, RTFM..."

sage: x.is_infinity?
Docstring:     
   Return "True" if "self" is an infinite expression.

   EXAMPLES:

      sage: SR(oo).is_infinity()
      True
      sage: x.is_infinity()
      False
Init docstring: Initialize self.  See help(type(self)) for accurate signature.
File:           /usr/local/sage-10/src/sage/symbolic/expression.pyx
Type:           builtin_function_or_method

Illustration :

sage: foo=(1/x).limit(x=0)
sage: foo.is_infinity()
True

Note that :

sage: bool(foo>0)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[7], line 1
----> 1 bool(foo>Integer(0))

File /usr/local/sage-10/src/sage/symbolic/expression.pyx:3453, in sage.symbolic.expression.Expression.__bool__()
   3451 pynac_result = decide_relational(self._gobj)
   3452 if pynac_result == relational_undecidable:
-> 3453     raise ValueError('undecidable relation: ' + repr(self))
   3454 
   3455 # pynac is guaranteed to give the correct answer for comparing infinities

ValueError: undecidable relation: Infinity > 0

HTH,

Preview: (hide)
link

Comments

Thanks! That is interesting. If I do

bool(infinity > 0)

It returns 'True'. Why is this not contradicting to the ValueError in your example?

Jidong gravatar imageJidong ( 0 years ago )

Why is this not contradicting to the ValueError in your example?

Multiple synonyms to the same quantity :

sage: infinity is Infinity
True
sage: Infinity is +Infinity
True

BTW :

sage: foo=(1/x).limit(x=0)
sage: foo is infinity
False
sage: foo is Infinity
False
sage: foo is +Infinity
False

and, furthermore

sage: bool(foo==infinity)
False
sage: bool(foo==Infinity)
False
sage: bool(foo==+Infinity)
False

HTH,

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 0 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 0 years ago

Seen: 147 times

Last updated: Nov 26 '24