Matrix % Matrix requires free modules while quotientRemainder does not
Nobody has claimed this yet.
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
This issue was triaged from [`bugs/dan/0-quotient-for-non-free-modules`](https://github.com/Macaulay2/M2/blob/388c1ff0ce30d83751dea7bc7eac77fdc1305dd7/bugs/dan/0-quotient-for-non-free-modules), one of the 857 files removed from the pre-GitHub `bugs/` tree by [`d2c8d27826`](https://github.com/Macaulay2/M2/commit/d2c8d27826) and catalogued in [#36](https://github.com/Macaulay2/M2/issues/36). **The commentary below was written by Claude (Claude Opus 5, via Claude Code)**, not by @d-torrance, whose account posted it -- please weigh it accordingly.
### The original file, verbatim
```text
For quotientRemainder(Matrix,Matrix) and quotient(Matrix,Matrix), if the
source of the first map is not free, the resulting quotient may not be well-defined.
Think about the meaning of this, mathematically, and decide what to do.
Currently Matrix % Matrix requires free modules, inconsistently with quotientRemainder.
```
### Where it stands today
The inconsistency the file reports still stands, and it is easy to see side by side:
```m2
i1 : R = QQ[x,y]; M = R^1/(x^2); N = R^1/(x);
i2 : f = map(N, M, matrix{{1_R}}); g = map(N, N, matrix{{1_R}});
i3 : isFreeModule source f
o3 = false
i4 : first quotientRemainder(f, g)
o4 = matrix {{1}} -- accepted
i5 : f % g
error: expected maps from free modules -- Core/matrix2.m2:482
```
So `quotientRemainder` answers for a non-free source and `%` refuses the same input. `g \\ f` errors on
it too.
### The mathematical question the file raises
Dan's own framing is worth keeping: when the source of the first map is not free, the quotient *may not
be well defined*, so the right answer might be to make `quotientRemainder` stricter rather than `%`
more permissive. What is clearly wrong is having the two disagree silently.
### There is an announced fix that has not arrived
**#3222** (merged 2024-05-10) added the deprecation warning for `Matrix \\ Matrix` explicitly *"in
preparation for a PR in the next release which will change `g \\ f` to call `quotient'(f, g)` … and
which will add a new algorithm that works for arbitrary modules rather than only free modules, as well
as maps of coherent sheaves"*, crediting **#1448** as the design discussion with @mikestillman. The
deprecation landed; the algorithm did not.
`open` · disposition `issue` · source of truth: [`bug-triage/catalog.tsv`](https://github.com/d-torrance/M2/blob/bug-triage/bug-triage/catalog.tsv)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Core/matrix2.m2:482 and compare the implementations of quotientRemainder, Matrix % Matrix, and Matrix \\ Matrix using the non-free-module example in the issue. Read the context from #3222 and the design discussion in #1448. Done means resolving the inconsistent behavior with a documented, mathematically justified direction.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100