sage: r.is_zero()
False
+ Example 4 in Section 2.3 of Cox, Little, and O'Shea. This is the
+ same as Example 2, except with the order of ``gs`` reversed::
+
+ sage: R = PolynomialRing(QQ, 'x,y', order='lex')
+ sage: x,y = R.gens()
+ sage: f = x^2*y + x*y^2 + y^2
+ sage: gs = [ y^2 - 1, x*y - 1 ]
+ sage: (qs, r) = multidiv(f, gs)
+ sage: (qs, r)
+ ([x + 1, x], 2*x + 1)
+ sage: r + sum( qs[i]*gs[i] for i in range(len(gs)) ) == f
+ True
+ sage: not any( g.lt().divides(m) for m in r.monomials()
+ ....: for g in gs )
+ True
+
TESTS:
If we get a zero remainder, then the numerator should belong to