AbstractAlgebra.jl icon indicating copy to clipboard operation
AbstractAlgebra.jl copied to clipboard

Define and provide `coefficient_ring` for series rings

Open fingolfin opened this issue 2 months ago • 1 comments

In docs/src/series.md we may read:

## Functions for types and parents of series rings

```julia
base_ring(R::SeriesRing)
base_ring(a::SeriesElem)
```

Return the coefficient ring of the given series ring or series.

So here we actually specify what base_ring is, mathematically, contrary to how it used in the rest of AA sigh. And coefficient_ring is not supported.

I suggest we define coefficient_ring for series rings. For now we can just define

coefficient_ring(R::SeriesRing) = base_ring(R)
coefficient_ring_type(R::SeriesRing) = base_ring_type(R)

to make it work instantly, and then adjust the .md file to mention them.

However, the manual should keep mentioning base_ring because that's what we promised for a long time, and we can't change this promise now, so we should keep documenting it. We can, however, inserting language to the effect "we recommend using coefficient_ring to clearly express the intent, but base_ring will stay supported for this purpose".

If we want, we can then look into gradually changing our implementations to switch the roles of base_ring and coefficient_ring: we add "native" cleffificient_ring methods to all series rings in AA and Nemo (do we have any elsewhere?) -- by that I mean methods not defined in terms of base_ring. Then once this is complete, we can replace the delegation and instead define base_ring(R::SeriesRing) = coefficient_ring(R).

fingolfin avatar Oct 15 '25 10:10 fingolfin

I am heavily in favor of switching over to coefficient_ring for most uses of base_ring.

thofma avatar Oct 16 '25 05:10 thofma