On Fri, Mar 1, 2024 at 5:11 PM Nils Bruin <nbr...@sfu.ca> wrote: > On Friday 1 March 2024 at 04:26:43 UTC-8 Dima Pasechnik wrote: > > > It seems that exactly the same algorithm will work (I didn't check this!) > for Laurent polynomials (they still form a Euclidean domain), and there you > better set degree(0)=-oo, otherwise it's going to be a problem. > > I think it's been established > that LaurentPolynomialRing(QQ,'x').zero().degree() == -1 is problematic. > With the definition that (1/x).degree() == -1 it clearly is. > > I think the question is more: do we have enough evidence that setting > degree(0) == -oo for *all* polynomial rings is significantly better (if > better at all) that it's worth the pain and incompatibilities that would > ensue from changing the rest of sage as well? That's not so clear to me. > From the perspective of multivariate polynomials, the whole valuation > interpretation of "degree" goes out of the window, so there "-1" is largely > available and quite possibly used extensively by the underlying libraries. >
IMHO deg(0)=-1 was chosen by Singular long time ago for purely practical programming reasons: in C++ one has to jump through too many hoops in order to add +oo/-oo to Z, as a type (and it was much harder still in old-style C++ than it is now). (probably similarly for sympy). As I mentioned, both Macaulay2 and GAP have convertion deg(0)=-oo. For multivariate Laurent series total degree, indeed, makes little sense, one has to talk about vectors of degrees. Perhaps for an n-variate Laurent series one should choose deg(0)=(-oo,-oo,...,-oo). Dima > > I guess one could see what happens if the change is made to Laurent > polynomials (and Laurent series as well, perhaps?). Based on how that goes > one could re-evaluate degrees of 0 polynomials in other polynomial rings. > > Alternatively, we could deprecate degree on them in favour of using > valuation-inspired terms instead, where the extension val(0)=oo is more > universal. As Oscar's example in Matlab shows, the concept of degree gets > (mis)used for other, more implementation-oriented definitions as well, so > perhaps the term should just be avoided for Laurent polynomials. > > -- > 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/60c42d22-28dc-4221-96a0-b174585c9c23n%40googlegroups.com > <https://groups.google.com/d/msgid/sage-devel/60c42d22-28dc-4221-96a0-b174585c9c23n%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/CAAWYfq0MdLQeTd6Gym_JNCquOm7YCLheLMyxPxn1LTF4mARLXQ%40mail.gmail.com.