2013/10/8 Peter Bruin <pjbr...@gmail.com> > > The only two options that seem acceptable to me are > - disallowing RR(oo) (if RR is taken to represent the field of real > numbers as opposed to the extended real line); >
Sage's "in" is not a mathematical "\in", Sage's "RR" is not the field of real numbers. Peter is arguing to make them behave more like they are. Others are arguing not to change these things for various reasons. (And I will not get myself tangled up in that, since I don't know enough about floating point standards, nor do I know the reasons behind Sage's definition of "in".) But in any case, the current tutorial makes people think that "in" and "RR" mean exactly what they mean in mathematics. Their first occurrence in the tutorial is in http://www.sagemath.org/doc/tutorial/tour_rings.html and I quote: "the real numbers, called RR in Sage" "... Of course, this is not a rational number:: sage: i # square root of -1 I sage: i in QQ False " So the tutorial says "RR is the ring of real numbers", and "in QQ" tests whether something is a rational number. Extending this, the tutorial says "oo in RR" tests whether infinity is a real number! This tutorial would be a logical place to say that Sage's "in" and "RR" do not always mean what mathematicians think they do. The following examples / warnings would be in place when introducing "in" and "RR" to new users. sage: oo in RR True sage: Zmod(5)(3) in ZZ True Shall I open a ticket to add these caveats to the end of http://www.sagemath.org/doc/tutorial/tour_rings.html ? And is there a way to make one of the following work (and give some explanation as to how "in" is implemented and what it means): sage: in? Object `in` not found. sage: ?in Object `in` not found. > - making the "in" keyword treat infinity as a special case. > Either Sage's RR has an infinity element or it does not. And in this case the coercion framework correctly recognizes this and gives the output accordingly. If you are to introduce special cases, then some things are much worse: sage: Zmod(5)(3) in ZZ True -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.