#18259: comparison of symbolic functions
-----------------------------+------------------------
       Reporter:  dkrenn     |        Owner:
           Type:  defect     |       Status:  new
       Priority:  major      |    Milestone:  sage-6.7
      Component:  symbolics  |   Resolution:
       Keywords:             |    Merged in:
        Authors:             |    Reviewers:
Report Upstream:  N/A        |  Work issues:
         Branch:             |       Commit:
   Dependencies:             |     Stopgaps:
-----------------------------+------------------------

Comment (by nbruin):

 This is a consequence of how coercion and comparison are implemented:
 {{{
 sage: var('y')
 y
 sage: f(x)=x*y
 sage: A=x*y
 sage: cSR=parent(f)
 sage: cSR.coerce_map_from(SR)
 Conversion map:
   From: Symbolic Ring
   To:   Callable function ring with arguments (x,)
 sage: SR.coerce_map_from(cSR) is None
 True
 }}}
 So, A coerces into the parent of f (and not the other way around): That
 means that for equality testing, A is coerced into the parent of f and
 then the comparison is done: comparison testing in sage is defined to be
 "equal up to coercion" (which probably necessarily breaks in all kinds of
 particular cases).

 If you do *not* want these things to compare equal then you should break
 the coercion. That might be reasonable. Conversion can still exist.
 Currently you can do:
 {{{
 sage: f+y^2
 x |--> x*y + y^2
 }}}
 without coercion but with conversion, this would need to be:
 {{{
 sage: f+cSR(y^2)
 x |--> x*y + y^2
 }}}
 which does not seem unreasonable to me.

--
Ticket URL: <http://trac.sagemath.org/ticket/18259#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to