(quotient, Ideal) is documented as returning a Module but returns a QuotientRing, and its source declares Module too
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
This issue was triaged from [`bugs/mike/0-doc-quotient.m2`](https://github.com/Macaulay2/M2/blob/388c1ff0ce30d83751dea7bc7eac77fdc1305dd7/bugs/mike/0-doc-quotient.m2), 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
```m2
doc for (quotient,Ideal) is wrong
also, the quotient page should perhaps say something
```
### Where it stands today
`(quotient, Ideal)` shares a documentation node with `comodule`, and that node says the output is a
module. It is not — for an ideal, `quotient` returns a ring:
```m2
i1 : R = QQ[a..d];
i2 : I = ideal(a,b,c,d^3);
o2 : Ideal of R
i3 : quotient I
R
o3 = -------------
3
(a, b, c, d )
o3 : QuotientRing
i4 : comodule I
o4 = cokernel | a b c d3 |
1
o4 : R-module, quotient of R
```
The node keys four methods together and promises a `Module` for all of them:
https://github.com/Macaulay2/M2/blob/development/M2/Macaulay2/packages/Macaulay2Doc/functions/comodule-doc.m2#L5-L27
Three of the four deliver that. `(quotient, Ideal)` returns a `QuotientRing`, so the `Usage` line
`comodule M` / `quotient M` presents two things as interchangeable when they are not, and the
`Outputs` clause is wrong for one of the four keys. The node's only example is `comodule I`, so the
rendered page never shows the case that misbehaves.
The declared return type in the source is wrong in the same way:
https://github.com/Macaulay2/M2/blob/development/M2/Macaulay2/m2/matrix1.m2#L438-L439
`quotient Ideal := Module => opts -> I -> (ring I) / I` — annotated `Module`, returning a
`QuotientRing`. The neighbouring `comodule Ideal := Module => I -> cokernel generators I` on the line
above is correct.
### A second, softer point
The bug file adds *"also, the quotient page should perhaps say something"*, which seems worth passing
on. `quotient` carries three unrelated meanings, and nothing orients a reader among them:
* `quotient(I, J)` — the colon ideal $I : J$
* `quotient I` — the quotient ring `(ring I)/I`
* `quotient M` — the comodule of a module
The first is documented under its own nodes, the last two share the `comodule` page, and the middle
one is the one documented incorrectly.
### Where this came from
Cataloguing the `bugs/` directory removed in d2c8d27826 (#36). `bugs/mike/0-doc-quotient.m2` is three
lines long and says only *"doc for (quotient,Ideal) is wrong"* — which is still accurate, and now has
a location.
`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
Research direction
Start with M2/Macaulay2/packages/Macaulay2Doc/functions/comodule-doc.m2 and M2/m2/matrix1.m2 at the referenced declarations. Check how the four method keys are documented and how `(quotient, Ideal)` is annotated versus what the example shows. Done means the documentation and declared return type distinguish the quotient ring from the module/comodule cases; verify with the documentation build or relevant checks.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100