The minimalPrimes documentation says decomposition does not happen over the extension field, then never shows what does
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
---
This issue was triaged from one request inside `bugs/dan/0-bugs-decker.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). That file is a wishlist holding several unrelated requests, so its asks were split apart and filed separately rather than as one issue nobody could close. **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 request, verbatim
> In documentation to minimalPrimes, finish example on absolute decomposition by showing how factor works over extension fields. Do the relevant interface to libfac first.
The rest of the file is unrelated to this request; it is linked in the footer below.
### Where it stands today
The `minimalPrimes` documentation tells the reader that decomposition does *not* happen over the extension
field, and then stops without showing what does. The passage is at
[`MinimalPrimes/doc.m2:126-131`](https://github.com/Macaulay2/M2/blob/development/M2/Macaulay2/packages/MinimalPrimes/doc.m2#L126-L131):
> Note that the ideal is decomposed over the given field of coefficients and not over the extension field
> where the decomposition into absolutely irreducible factors occurs:
```m2
i1 : R = QQ[w,x,y,z];
i2 : I = ideal(x^2 + y^2);
i3 : minimalPrimes I
2 2
o3 = {ideal(x + y )}
```
That is the whole example. A reader is shown a decomposition that does not split, told the reason lies over
an extension field, and left there — the interesting half, what the absolutely irreducible factors actually
are, never appears.
### It can be finished today
`factor` splits it over an extension, so the example only needs a continuation:
```m2
i4 : K = toField(QQ[i]/(i^2+1));
i5 : S = K[x,y];
i6 : factor(x^2 + y^2)
o6 = (x - i*y)*(x + i*y)
```
and over a finite field just as well, where the extension is generated by `a`:
```m2
i7 : U = (GF 9)[x,y];
i8 : factor(x^2 + y^2)
o8 = (x + (a + 1)*y)*(x + (- a - 1)*y)
```
### Two things the example should probably say
**`toField` is not optional, and omitting it fails silently.** Over the quotient ring without it, `factor`
returns the input unchanged rather than complaining:
```m2
i9 : A = QQ[i]/(i^2+1); T = A[x,y];
i11 : factor(x^2 + y^2)
o11 = (x^2 + y^2)
```
`QQ[i]/(i^2+1)` really is a field, but M2 does not know that until told, and a reader following the
documentation is quite likely to build it the first way. Showing the `toField` step explicitly — or showing
both, and the difference — would save that.
**The continuation has to use `factor`, not `minimalPrimes`.** It is natural to want to finish the example by
re-running `minimalPrimes` over the extension, but that is refused:
```m2
i12 : K = toField(QQ[i]/(i^2+1)); S = K[x,y];
i14 : minimalPrimes ideal(x^2 + y^2)
stdio:14:1:(3): error: no applicable strategy for (minimalPrimes,Ideal)
```
which is by design — the same doc node opens by restricting the base ring to `QQ` or `ZZ/p`, and the refusal
comes from `MinimalPrimes.m2:239`. So the example's point is necessarily "here is what `factor` shows you
about the geometry that `minimalPrimes` deliberately does not", and saying that in a sentence would make the
node self-consistent. It might also be worth a `SeeAlso` to `factor`, which the node does not currently have.
### Provenance
This is one request from `bugs/dan/0-bugs-decker.m2`, a wishlist file removed with the `bugs/` tree in
[`d2c8d27826`](https://github.com/Macaulay2/M2/commit/d2c8d27826) and catalogued in [#36](https://github.com/Macaulay2/M2/issues/36). The request reads in full:
> In documentation to minimalPrimes, finish example on absolute decomposition by showing how `factor` works
> over extension fields. Do the relevant interface to libfac first.
The second sentence is already satisfied: whatever was missing from the factorization interface when that was
written, `factor` over an extension field works now, which is what the transcripts above are.
Nothing in the tracker covers this — searched for `absolute`, `minimalPrimes` and `absolutely irreducible`.
[#1017](https://github.com/Macaulay2/M2/issues/1017), `radical` over Galois fields, and
[#2839](https://github.com/Macaulay2/M2/issues/2839), a correctness bug in `decompose` and `radical`, are the
nearest and neither is this.
`open` · disposition `issue` · ask 1 of [`bugs/dan/0-bugs-decker.m2`](https://github.com/Macaulay2/M2/blob/388c1ff0ce30d83751dea7bc7eac77fdc1305dd7/bugs/dan/0-bugs-decker.m2) · source of truth: [`bug-triage/asks.tsv`](https://github.com/d-torrance/M2/blob/bug-triage/bug-triage/asks.tsv)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with MinimalPrimes/doc.m2:126-131 and run the supplied Macaulay2 factor examples over QQ[i]/(i^2+1) and GF 9. Extend the minimalPrimes documentation to show absolute factorization, explain the required toField step and why factor is used instead of minimalPrimes, then verify the transcript output.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100