misleading help leadTerm
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)
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.
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)
Well, let's just fix the documentation. Upward compatibility is important.