#8821: Adding a section on coercion to the tutorial (guided tour)
-----------------------------+----------------------------------------------
Reporter: SimonKing | Owner: mvngu
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.4.4
Component: documentation | Keywords: tutorial coercion
Author: Simon King | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Comment(by leif):
Replying to [comment:14 jhpalmieri]:
> [...] ZZ and QQ are equally exact: any element of them can be
represented exactly on a computer. Because of the presence of some
transcendental numbers with no exact representation, RR is inherently
inexact: when you work in RR, you're only working up to some level of
precision.
Well, irrational numbers and limited precision are different aspects; in
principle, "the" real field should contain QQ. And at least some
irrational numbers (I personally don't consider them numbers ;-) , or at
least not "real" in the sense of existence) ''can'' be represented - in
general as (symbolic) constants or as limits.
(On the other hand, {{{NaN in RR}}}, but {{{infinity}}} is not,
{{{RR.pi}}} is a method, {{{RR.pi() == pi}}} - where {{{parent(pi)}}} is
{{{Symbolic Ring}}} - evaluates to {{{True}}}...)
> Reading p. 12 of the Stein-Erocal paper, I would think that every
coercion comes from an embedding, but this is not true. Every coercion
should come from a mathematically canonical map (like mapping Z to any
ring, or the inclusion of Q into R). Thinking about it mathematically
makes sense to me, and I think this is the whole point.
If it's clear to everyone what is meant by "exact" and "inexact"...
Mapping Q into R is not the same as mapping {{{QQ}}} into {{{RR}}}; in
fact, Sage supports the direction that is sound in the mathematical
domains, i.e. that is valid for Q and R, though the implementation (the
actual domains considered mathematically; floating-point numbers in the
case of {{{RR}}}) would suggest the opposite, because every element of
{{{RR}}} (except some symbolic constants) can be represented in {{{QQ}}}.
IMHO coercions (as opposed to conversions) should be injective; the
natural embedding of Q in R does ''not'' hold for "Sage's" Q and R,
{{{QQ}}} and {{{RR}}}.
> Also, remember that a document like the Sage tutorial is aimed to a
large degree at mathematicians and math students (and other "consumers" of
mathematics), moreso than to people with a computer science focus. So
focusing on types, etc., is not appropriate.
I'm not sure what that refers to; nevertheless the reader will (or should)
be familiar with Python, including the concept of its types and classes,
and will be confronted with the differences between Python types
(including classes) and Sage's types, namely "parents".
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8821#comment:16>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.