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".)
>
>
As a user of Sage who is also trying to convert others to Sage, I would 
advocate making the "in" keyword behave like "\in" and having RR and other 
fields behave like their mathematical counterparts.  As a matter of 
programming, this can possibly be achieved by having the programer-friendly 
implementation of RR etc be the primary implementations and then writing 
user-friendly wrappers to these that behave intuitively.  This could be 
something like Peter is advocating with exceptions = True.

My reading of this thread is that the problem extends beyond the infinity 
ring, and that comparisons in general may not behave in an intuitive 
mathematical way.  For example:
sage: GF(2)(1) == 1
True
sage: GF(2)(3) == 1
True

I see why these work on an implementation level, but this is strange:

sage: A = matrix(GF(2), 2, [2,0,0,1])
sage: B = matrix(2, [2,0,0,1])
sage: A == B
True
sage: A.rank()
1
sage: B.rank()
2

So we have a non-invertible matrix equal to an invertible matrix.  I think 
for most users, if two objects evaluate as equal, they should behave the 
same under operations like * and +.  This example breaks that assumption.  

Also strange:

sage: C = matrix(GF(2), 2, [1, 0, 0, 1])
sage: C in GL(2,RR)
True

I think we'd benefit generally from thinking about use cases involving 
novice Sage users and modifying the coercion framework (or whichever 
component is involved here) to deal with these use cases.

-Greg


-- 
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.

Reply via email to