Open thofma opened 2 years ago
I'm not sure I understand correctly but wouldn't it be more natural to have
base_ring(M) == R
and
coefficient_ring(M) == coefficient_ring(R)
?
If R is a polynomial ring with coefficients in C, and M is an R-module, then M is an R-module but also a C-algebra. But still we are concerned with the R-module structure of M when we talk about modules. For example, if we have elements of M, we talk about R-linear combinations of these elements, or about linear combinations of these elements with coefficients in R. So coefficient_ring(M) == R
seems to be fine. If we would consider instead an OSCAR type for C-algebras, what we don't, then ...
I see, alright.
By the way, what I wrote fits also to the coefficient function for module elements:
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]) (Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> A = R[x; y] [x] [y]
julia> B = R[x^2; y^3; z^4] [x^2] [y^3] [z^4]
julia> M = SubQuo(A, B) Subquotient of Submodule with 2 generators 1 -> xe[1] 2 -> ye[1] by Submodule with 3 generators 1 -> x^2e[1] 2 -> y^3e[1] 3 -> z^4*e[1]
julia> coefficients(x^2*M[1]) Sparse row with positions [1] and values fmpq_mpoly[x^2]
We just discussed this here. There weren't many concerns with the suggestion coefficient_ring(M) == R
, but still some:
R = k[x,y]
then for an ideal $I$ of $R$ we have coefficient_ring(I) == k
while for an $R$-module we have coefficient_ring(M) == R
. Of course ideal are not of type module, so one can justify that (and Claus thinks that's enough), but some of us (e.g. me) are still not really happy with this...In the end, it seems it would be good to look at explicit usage cases to determine what is appropriate...
If I remember correctly, the fanbase for
base_ring
is rather small (mainly because we used it in a different way than it was designed for) and we started introducing mathematically well-defined terms likecoefficient_ring
for polynomial rings.I think we should do the same for modules and introduce
coefficient_ring
. So whenever we have a ringR
andM
is anR
-module (does not matter which type it has or how it is constructed), I propose to havecoefficient_ring(M) == R
.Any concerns? @wdecker @fingolfin @fieker?