From: Michael Orlitzky Date: Thu, 21 Feb 2019 01:32:23 +0000 (-0500) Subject: mjo/polynomial.py: add another multidiv test based on an exercise. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=deb1e9c381606b637dac0f8948703fb4c27502b5;p=sage.d.git mjo/polynomial.py: add another multidiv test based on an exercise. --- diff --git a/mjo/polynomial.py b/mjo/polynomial.py index 2b8dc2a..ca09ebe 100644 --- a/mjo/polynomial.py +++ b/mjo/polynomial.py @@ -162,6 +162,19 @@ def multidiv(f, gs): ....: for g in gs )) True + Exercise 8 in Section 2.4 of Cox, Little, and O'Shea says that we + should always get a zero remainder if we divide an element of a + monomial ideal by its generators:: + + sage: set_random_seed() + sage: R = PolynomialRing(QQ,'x,y,z') + sage: gs = R.random_element().monomials() + sage: I = R.ideal(gs) + sage: f = I.random_element(ZZ.random_element(5).abs()) + sage: (qs, r) = multidiv(f, gs) + sage: r.is_zero() + True + """ R = f.parent() s = len(gs)