There seem to be two things we could do here: 1. Have some form of vote / discussion on whether the degree of the zero polynomial should *ever* be -1 2. Modify the degree calls for the LaurentSeries and LaurentPolynomialRing (maybe other Laurent* which I am unfamiliar with) to have the zero polynomial have degree -Infinity.
Option 1 may be cleaner in the long run, but I assume will cause issues for more people in the short term. Option 2 seems fairly harmless and there's no good argument for degree -1 in this case. If anyone is interested in option 2, I will find time to make a PR to do this, but I will not start this work without other people's input as this is not code I am familiar with using and so I don't know what people could be relying on. On Wednesday, February 28, 2024 at 6:41:48 PM UTC Dima Pasechnik wrote: > On Wed, Feb 28, 2024 at 5:00 PM Nils Bruin <nbr...@sfu.ca> wrote: > >> On Wednesday 28 February 2024 at 08:03:45 UTC-8 Giacomo Pope wrote: >> >> >> I don't know the history of this choice or what we should be doing >> generally. -1 for polynomials with only positive degree seems like a >> computer science workaround, but for the LaurentPolynomialRing it just >> seems wrong? >> >> >> I think it's more than just a CS workaround. It has its roots in >> dimension considerations: the space of polynomials of degree at most d is >> (d+1)-dimensional. WIth that convention, 0 having degree -1 makes perfect >> sense. >> > > well, it's the convention used in Singular. > But GAP and Macaulay2 use -infinity. > > The arguments for -infinity: > > 1) degree of the product should be the sum of degrees; so it's got to be > infinite. > 2) it should be -infinity, to make sense of the rule that if you do > division f/g with remainder r, > the degree of the remainder should be less than the deg(r)<=deg(f), but if > r=0 then the only way > to get this is to use -infinity. > > Dima > > >> >> For deg = - ord_infty it should definitely be -oo, though, and for >> Laurent polynomials the dimension argument doesn't work. >> >> -- >> > You received this message because you are subscribed to the Google Groups >> "sage-devel" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to sage-devel+...@googlegroups.com. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/sage-devel/ac40d2e7-5e71-43e1-8914-869081f9bdd9n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/sage-devel/ac40d2e7-5e71-43e1-8914-869081f9bdd9n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/6d95b253-fb17-4e2f-a61c-c723737774e8n%40googlegroups.com.