Hi,
This is related to trac ticket
http://trac.sagemath.org/sage_trac/ticket/14366 . That ticket is about ideals of number fields, but it made me look into the more general ideal code. I came across this:
sage: R.<x> = PolynomialRing(ZZ)
sage: I = R.ideal(2, x)
sage: 0 in I
NotImplementedError
This is because Ideal_generic's _contains_ is not implemented (understandable). A few thoughts come to mind. First off, is there a reason not to have __contains__ begin by checking if the input is the zero element of the ring (or coerces to such), and if so return True? Secondly, see this:
sage: S.<x,y> = PolynomialRing(ZZ)
sage: J = S.ideal(x,y)
sage: 0 in J
True
sage: M = S.ideal(2,x)
sage: 0 in M
True
This makes me think we should be able to deal with the univariate example above (I know next to nothing about Gröbner bases...).
Best,
Rob