-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LeftIdeal as a Module #3032
base: development
Are you sure you want to change the base?
LeftIdeal as a Module #3032
Conversation
- still need to be able to find a common field ancestor
480350e
to
9d76fa5
Compare
@antonleykin @mikestillman this is now passing all tests, and by virtue of inheriting from Module, I believe everything else should work out of the box. Incidentally, I think it would also make a lot of sense to have Let me know what you think! |
Having |
Why is an instance of Module a right module necessarily? |
Because when representing a map between free modules as a matrix, the matrix acts on the left side of the vector. |
This sounds like programming detail that can be fixed by introducing covectors. Regardless, this is irrelevant to this PR. |
Well, no, it's an argument for introducing |
This PR isn't introducing |
But if |
Thanks, I'll add |
Or better, just don't make a left ideal a type of module. |
All ideals are modules. |
Then Hom(I,J) should work. |
Do you expect me to implement everything in one PR? Later, when left and right modules are in place, you can change one line and have LeftIdeal inherit from LeftModule instead, with Him(I, J) working as expected. |
You're the one who said "All ideals are modules." |
not related to this PR but:
|
I'm torn about whether Mathematically, yes, an ideal of But in Macaulay2, certain methods have different behaviors when passed an |
I think situations like this are rare enough that they can be considered exceptions forced by mathematical conventions. Also, I'm not necessarily suggesting that everything under the sun that has a module structure should inherit from modules, but for ideals in particular, almost every method turns the input into a module and sometimes the output back into an ideal. |
I have a few comments here.
This is not quite correct I think, as we have changed multiplication of matrices to use the opposite side. We did this precisely so people could have left modules (e.g. people working with D-modules are pretty used to thinking in these terms). See @pzinn 's comments above. Also
Why is this? In general, Hom only returns a result over the center of the ring, if the modules do not have extra bi-module structure?
In commutative algebra it is fairly confusing to have some operations on ideals work as if for the corresponding quotient module (e.g. depth, free resolution even, etc). But the difference is so ingrained it is hard to change these notions. And from an efficiency view, these are almost always better than treating an ideal as a module directly. I think I am against making an ideal be a module directly (although I could be convinced perhaps). @mahrud Are there really alot of cases where Ideal's are considered as Module's directly? I haven't gone to look, but I would think it is fairly small (Hom, tensor are the ones I think of). One reason I am against it is more pedagogical: I don't want to make people learning, e.g. undergraduates in a first class, need to know about these things completely. Ideals are just simpler than modules (I know that they will still see free modules, etc., and I used to think that this was not a good argument. Until I tried teaching younger undergraduates using Macaulay2). (Here is another thing we don't want to do: just make all modules into complexes? ) |
Like I said, I'm not suggesting turning everything to inherit from the most general type. Re: pedagogy, I also didn't learn what a Groebner basis of an ideal is by first learning what a Groebner basis of a module is, but here we are: i1 : code(gb, Ideal)
o1 = -- code for method: gb(Ideal)
../linuxbrew/.linuxbrew/share/Macaulay2/Core/gb.m2:307:35-307:57: --source code:
gb Ideal := GroebnerBasis => opts -> I -> gb (module I, opts) Re: efficiency, I think operations for ideals and submodules of R^1 should be identical in efficiency, since they are mathematically the same, no? I don't see why having them also be programatically the same would slow things down. The biggest reason I'm advocating for LeftIdeals inheriting from Modules (and, eventually, perhaps all Ideals, though that's not the point of this PR) is that there will be much less code duplication, therefore the code will be simpler to read and easier to maintain, because you only need to explicitly implement the methods where |
wrong thread sry |
@antonleykin I couldn't attend the meeting because of the MSRI workshop, could you summarize your objections to this approach? I don't think it's possible to switch back without significant confusion in the future. |
We haven't discussed this PR in any detail, but my personal opinion is that one should lay out a strategic vision of what one would do after this PR. Creating Please post to zulipchat in "M2internals:Noncommutativity". |
Maybe I don't understand what you mean by a "strategic vision". The vision is the same as yours, only the implementation is different.
LeftIdeal = new Type of Module -- or LeftModule, or ImmutableType? Which can be simply changed when we have that type. Like I said above, given the portion of (I'll elaborate in zulip, but wanted to give a quick answer here) |
This is an alternative to #2912 and #3020 which implements the following:
LeftIdeal
as a type ofModule
ideal
to return aLeftIdeal
if the ring is a Weyl algebraIdeal
which are not defined forModule
Ideal
I mostly wanted to see if this was feasible, but it was pretty straightforward (thanks to Anton and Mike's fixes to Dmodules, which I more or less copied), so I figured I'd turn it into a PR to present this option.
Pros:
Ideal
is intactCons:
LeftIdeal
andIdeal
are now unrelated