Opened 2 years ago

Last modified 5 months ago

#24149 new defect

roots of zero polynomial over finite ring

Reported by: zimmerma Owned by:
Priority: major Milestone: sage-8.4
Component: finite rings Keywords: padicBordeaux
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

currently we get with Sage 8.0:

sage: R.<x> = IntegerModRing(4)[]
sage: R(0).roots(multiplicities=False)
[0, 1, 2, 3]

but:

sage: R.<x> = ZZ[]
sage: R(0).roots(ring=IntegerModRing(4),multiplicities=False)
...
ValueError: roots of 0 are not defined

The second answer is inconsistent with the first one, and in this case the roots are well defined: all elements of the finite ring are roots.

Change History (7)

comment:1 Changed 2 years ago by zimmerma

moreover the first way does not work properly for 2:

sage: S.<x> = IntegerModRing(2)[]
sage: S(0).roots(multiplicities=False)
...
ArithmeticError: factorization of 0 is not defined

and the answer is wrong for other prime cardinalities:

sage: S.<x> = IntegerModRing(3)[]
sage: S(0).roots(multiplicities=False)
[]

comment:2 Changed 2 years ago by roed

There is certainly a bug here. The ArithmeticError is for consistency with non-finite rings, where we can't return a list of all elements. Certainly

sage: S.<x> = IntegerModRing(3)[]
sage: S(0).roots(multiplicities=False)
[]

should be fixed, but I would say that we should raise an ArithmeticError in every case.

comment:3 follow-up: Changed 2 years ago by vdelecroix

In the case of an infinite base ring, one can still return the base ring (thought as an infinite set). I would also prefer an ArithmeticError in every case.

comment:4 in reply to: ↑ 3 Changed 2 years ago by roed

Replying to vdelecroix:

In the case of an infinite base ring, one can still return the base ring (thought as an infinite set).

True, but the expectation is for a list.

I would also prefer an ArithmeticError in every case.

Let's do that then. :-)

comment:5 Changed 20 months ago by vklein

  • Milestone changed from sage-8.1 to sage-8.3

comment:6 Changed 18 months ago by vdelecroix

  • Milestone changed from sage-8.3 to sage-8.4

update milestone 8.3 -> 8.4

comment:7 Changed 5 months ago by roed

  • Keywords padicBordeaux added
Note: See TracTickets for help on using tickets.