2012/7/30 Thomas Feulner <thomas.feul...
It would be safer, but it sounds like it would break a lot of code.
Right now, reduce does exactly what it says:
Return the reduction of the element of `f` modulo the ideal
`I` (=self). This is an element of `R` that is
equivalent modulo `I` to `f`.
If you don't get any objections, you could change this documentation
and add a deprecation warning to this default implementation. Then
later it can be changed to NotImplementedError.
> These are the consequences:
> sage: Z16x.<x> = Integers(16)
> sage: GR.<y> = Z16x.quotient(x**2 + x+1 )
> sage: I = GR.ideal(4)
> sage: I.reduce(GR(6))
> 6 # should be reduced mod 4
> another example is
> sage: J = Z16x.ideal([x+1, x+1]) # just to avoid that the ideal is
> identified as a principal ideal
> sage: R.<z> = Z16x.quotient(J)
> sage: R(x) # should be 15
I'm fine with all the outputs above, though they can be improved.
However, I think the following is a bug:
sage: R(x+1) == 0
The only correct answer is "True". This goes wrong because the
"ASSUMPTION" that you quotes above is not satisfied. However, I would
trust R to be correct, because I never get to see the assumption, even
when I type
- add the assumption to the documentation of the quotient method of Z16x, or
- add some checks to the equality tests of QuotientRing, or
- kill the default implementation of reduce as you suggest (but do
(or some combination of the above)