# Quotient of Polynomial Ring (Leading Coefficient)

The following yields an error:

sage: R.<x> = Integers(4)[]
sage: Q.<a> = R.quotient(2*x)
...
TypeError: polynomial must have unit leading coefficient


How can I make it work?

edit retag close merge delete

Sort by » oldest newest most voted

You could try this:

sage: from sage.rings.quotient_ring import QuotientRing_generic
sage: R.<x> = Integers(4)[]
sage: I = R.ideal(2*x)
sage: Q = QuotientRing_generic(R, I, ['a'])
sage: Q.inject_variables()


but I wouldn't be surprised if some things were broken. Quotients of polynomial rings are well implemented only when the leading coefficient is a unit, as the error message implies.

Edit: this doesn't raise any errors when you define the ring:

sage: R.<x> = ZZ[]
sage: J = R.ideal(2*x, 4)
sage: Q = R.quotient(J)


Maybe you can get somewhere this way.

more

Thanks! Is it possible/feasible to implement the other case too, especially if the quotient is finite?

( 2022-12-02 13:17:15 +0100 )edit

I don't know how hard it would be. As least some of the tools for describing quotients of polynomial rings rely on degree arguments: if you mod out by a polynomial of degree d, you can use polynomials of degree less than d to represent the quotient elements. Anyway, the quotient you're talking about it not finite, right? Each power of x will be nonzero and distinct in the quotient, right?

( 2022-12-02 20:28:50 +0100 )edit

Yes and yes. I first wanted to emphasize the error that occurs with a non-unit leading coefficient. Meanwhile, I've opened another thread to talk about errors occurring in finite rings which aren't principal ideal rings: https://ask.sagemath.org/question/651...

( 2022-12-02 22:05:43 +0100 )edit

EDIT : this answer is FALSE : see John Palmieri's comment. I leave it for the edification of future ask.sagemath.org (per-)users.

You can also explicitely use the fact that the ring of congruences modulo 4 is a field :

sage: R.<x>=Zmod(4)[]
sage: Q.<a>=R.quotient(2*x)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)


[ Snip... ]

TypeError: polynomial must have unit leading coefficient


But :

sage: R.<x>=GF(4)[]
sage: Q.<a>=R.quotient(2*x)
sage: Q
Univariate Polynomial Ring in x over Finite Field in z2 of size 2^2


HTH,

more

2

GF(4) is not the same as Zmod(4). 2 is a zero-divisor in Zmod(4).

( 2022-12-02 20:24:25 +0100 )edit

@John Palmieri : You're right. Editing my (non-answer) for the edification of future |ask.sagemath.org` (per-)users...

( 2022-12-03 13:45:47 +0100 )edit