From: Michael Orlitzky Date: Mon, 18 Feb 2019 18:56:03 +0000 (-0500) Subject: mjo/polynomial.py: add a (failing!) test for Example 4 in the text. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=892a138853b8152e35605deedbfc8160309c2bc6;p=sage.d.git mjo/polynomial.py: add a (failing!) test for Example 4 in the text. --- diff --git a/mjo/polynomial.py b/mjo/polynomial.py index 4fe4b71..8b49371 100644 --- a/mjo/polynomial.py +++ b/mjo/polynomial.py @@ -114,6 +114,22 @@ def multidiv(f, gs): 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