Travis Scrimshaw writes:
>> While it is arguably too rigid to say that this is "senseless" (as I
>> wrote in the subject),
>
> You already did that, and because you started off calling them "senseless,"
> you have polluted this issue with your heavily loaded question. That is
> unfair and demeaning.
Yes, I'm guilty, I gave the thread a provocative name to make people
read it...
>> I believe that the use of these functions for
>> matrices is very narrow.
>
> That is untrue. They are very useful to create any sort of
> submodule/algebra of the matrix module/algebra to be consistent with all
> other modules or algebras with a distinguished basis. There is also a
> natural order on the basis too, so things like triangularity of module
> morphisms need such methods. So perhaps the field of representation theory
> and triangularity of morphisms is "very narrow."
Good point, as was Simon's concrete example.
> Let's get rid of hamming_weight for polynomials since polynomials are also
> extremely central objects that beginners start playing around with. Of
> course, I am not actually proposing this, but this is in the same spirit.
I disagree that this is in the same spirit: the hamming weight/sparsity
of a polynomial is a readily understandable concept, pertaining to
polynomials directly, whose functionality anyone "playing around" with
polynomials will recognise. As opposed to this, these generic finite
rank module methods seem not useful for matrices themselves, but
primarily as glue in a much more abstract context that you described
above.
>> (this came up during #23619 where we are introducing "leading_matrix"
>> and "leading_position" for matrices over a univariate polynomial ring.)
>>
>> I think you should be more explicit with your method names and call the
> first one leading_term_matrix() and the second one I have no idea why it
> would do.
I would argue that the burden of explicit method names should be *much
higher* on abstract, inherited methods! While I can see the argument for
preferring "leading_term_matrix" in favour of "leading_matrix", it is
important to keep in mind that this method will only appear for matrices
over univariate polynomials, and the user therefore expects its methods
to be named and behave accordingly.
Compare this with "leading_coefficient" on a matrix; most users would
have no idea what that is before they read the doc, and even then -
since the doc is written with totally different examples in mind - they
have to call that method and perhaps "leading_position" several times
before they can figure it out.
I won't argue further against whether the methods should be there
or not. If several mathematicians feel they are really useful, I'm sure
you're right. But then I would argue that they should be renamed into
something much more precise, or perhaps hidden behind an indirection.
Perhaps something like:
sage: M.as_finite_rank_module.leading_<stuff>?
(except that this sounds like the matrix becomes a finite rank module
which is nonsense.)
Best,
Johan