# find quotient of two multivariate polynomials (which are divisible)

I have two multivariate polynomials, num and denom such that denom divides num. But I have not been able to get SageMath to simplify the quotient num/denom.

The worksheet and the two polynomials are available at

Sample code is below.

sage: dR.<d1, d2, d3, d4, d12, d13, d14, d23, d24, d34, d123, d124, d134, d234, d1234> = PolynomialRing(ZZ, 15, order='lex')

sage: denom.divides(num)
True
sage: num.reduce(Ideal([denom]))
0
sage: F = num/denom
sage: F.denominator()/denom
1
sage: F.reduce()
sage: F.denominator() / denom
1
sage: num.number_of_terms()
3197
sage: denom.number_of_terms()
64
sage: num.degree()
24

edit retag close merge delete

1

As pointed out in the answers, the data was created with one term ordering, while the workbook uses another term ordering.

However, why does the term ordering affect the truth of 'num is contained in the ideal generated by denom' i.e., the value of num.reduce(Ideal[denom]) ? One of the answers refers to "This 'local' term ordering . I don't understand how the term ordering affects the structure of the ideals in a polynomial ring over the integers.

This is an unfortunate consequence of the fact that PolynomialRing uses Singular's ring in the background, without restricting the term ordering. Singular's ring is an ordinary polynomial ring when given a "global" term ordering, but it is rather a localization when given a "local" term ordering. These local orderings should be disallowed on a PolynomialRing, and the Singular functionality for localizations should be exposed in another way.

Sort by » oldest newest most voted sage: denom.parent().term_order()
Negative weighted degree reverse lexicographic term order with weights (1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4)


This 'local' term ordering causes reduce and (hence) divides to behave differently. In particular, it does not give the same result as with a well-ordering such as 'lex' in your ring dR:

sage: dR(denom).divides(dR(num))
False


So denom does not divide num in the ordinary sense.

Edit: In the 'local' sense, we have that denom is invertible, so the ideal generated by denom is the unit ideal, so of course num.reduce(Ideal([denom])) is zero.

more

There really should be a version of reduce somewhere that gives you which combination of the generators allowed for the reduction, and if someone can find where then that really should be the preferred solution, but at the expense of some extra variables, you can fake it:

Given two polynomials f and g in variables [z1,...,zn], embed the ring into a larger one with variables [z1,...,zn,F,G], with an elimination order for z1,...zn (i.e., those variables should be larger than F and G). Then reduce f-F with respect to the principal ideal generated by g-G. The result should be a polynomial that is free of z1,...,zn, and expresses F as a polynomial in G.

more