Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Observe that:

sage: dT.full_simplify
<built-in method simplify_full of sage.symbolic.expression.Expression object at 0xb1ddb0c>

Which means "dT.full_simplify" is not a function call but the function itself, and comparing it to zero has no mathematical meaning. I think the reason sage (actually python) allows comparing very general object is to allow creation of sorted lists containing elements of many types. If you sort the list [1,2,dT.full_simplify,3] the result will not be "sorted mathematically" but it will allow binary search nonetheless!

In fact notice that you don't even have to call bool:

sage: dT.full_simplify >= 0
True

whereas for the mathematical comparison you do have to, since in symbolic computation we don't want every EXPR1 >= EXPR2 expression to evaluate immediately to boolean:

sage: dT.full_simplify() >= 0
-sqrt(c - u)*sqrt(c + u)*(c^2*t1 - c^2*t2 - u*x1 + u*x2)/(c^3 - c*u^2) >= 0
sage: bool(_)                
False

Observe that:

sage: dT.full_simplify
<built-in method simplify_full of sage.symbolic.expression.Expression object at 0xb1ddb0c>

Which means "dT.full_simplify" is not a function call but the "simplify_full" function itself, and comparing it to zero has no mathematical meaning. meaning.

I think the reason sage (actually python) allows comparing very general object is to allow creation of sorted lists containing elements of many assorted types. If you sort the list [1,2,dT.full_simplify,3] the result will not be "sorted mathematically" but it will allow binary search nonetheless!

In fact notice that you don't even have to call bool:

sage: dT.full_simplify >= 0
True

whereas for the mathematical comparison you do have to, since in doing symbolic computation computations we don't want every EXPR1 >= EXPR2 expression to evaluate immediately to boolean:

sage: dT.full_simplify() >= 0
-sqrt(c - u)*sqrt(c + u)*(c^2*t1 - c^2*t2 - u*x1 + u*x2)/(c^3 - c*u^2) >= 0
sage: bool(_)                
False