From deb1e9c381606b637dac0f8948703fb4c27502b5 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 20 Feb 2019 20:32:23 -0500 Subject: [PATCH] mjo/polynomial.py: add another multidiv test based on an exercise. --- mjo/polynomial.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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) -- 2.43.2