On 31 Mai, 15:59, "William Stein" <[EMAIL PROTECTED]> wrote:
> At a bare minimum there is never a canonical (automatic)
> coercion from elements of R to elements of S unless that coercion
> is defined (as a homomorphism) on all of R.

I dont want to be heretical by why is it so important that coercion is
totally defined?

Considering all the current discussion, I get the impression that
allowing partial coercion would solve much of the arising problems
nearly without effort.

SR can be easily partially coerced to any number system. Just try to
evaluate the SR term in that number system. Either it succeeds for
example
log(2) or sqrt(2) directly translates to RR by log(RR(2)) and
sqrt(RR(2)) or it fails, for example RR(x) or RR(1)/RR(0).

While sqrt(RR(-2)) is somehow mixed, depending on the sign of the
argument sqrt returns either something of a complex or a real field.
Which is quite desirable. So that means if one would try to coerce
from SR to RR it can happen that the result is a CC, what however
would perfectly fit, i.e. would perfectly be what one expects when one
writes: sqrt(-2)*1.0.

I hope everyone agrees that the above two (but at least the above
first) paragraph(s) is what one would expect/desire.

Then for coercion would only matter the exactness of a structure and
the subset relation. The general rule would be: If there one structure
is less exact then coerce to this structure. If we have two structures
with equal exactness coerce to the substructure if possible, in doubt
coerce to the superstructure.

This would also solve the performance and representation issue. As
long as no coercing takes places just compute in whatever Ring you
want. But if it comes to coercion/evaluation/decision it may take
somewhat longer (what also would be what I expect).

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to