M2 icon indicating copy to clipboard operation
M2 copied to clipboard

misleading help leadTerm

Open pzinn opened this issue 5 years ago • 3 comments

help "leadTerm(Ideal)" says

Compute a Gröbner basis and return the ideal generated by the lead terms of the Gröbner basis elements.`

but it's not true: it returns instead the generators of init(ideal) as a matrix. I'm assuming it's the documentation that's wrong and the method works as intended? (though it would seem to make more sense to return an Ideal)

pzinn avatar Sep 14 '20 05:09 pzinn

Good catch. Here's the code:

o16 = -- code for method: leadTerm(Ideal)
      /Users/dan/src/M2/M2.git/M2/Macaulay2/m2/matrix1.m2:513:33-513:59: --source code:
      leadTerm Ideal := Matrix => (I) -> leadTerm generators gb I

@mikestillman -- do you have an opinion?

By the way, if leadTerm works for ideals, it should also work for submodules of free modules.

DanGrayson avatar Sep 14 '20 11:09 DanGrayson

Certainly returning an Ideal would make a lot more sense, but I'm afraid it might break existing code. (a hacky way to avoid the latter would be to define ideal Ideal := identity but that's not great)

pzinn avatar Sep 22 '20 09:09 pzinn

Well, let's just fix the documentation. Upward compatibility is important.

DanGrayson avatar Sep 22 '20 12:09 DanGrayson