oscar-system / Oscar.jl

A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
https://www.oscar-system.org
Other
339 stars 120 forks source link

`coefficient_ring` for modules #1505

Open thofma opened 2 years ago

thofma commented 2 years ago

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 like coefficient_ring for polynomial rings.

I think we should do the same for modules and introduce coefficient_ring. So whenever we have a ring R and M is an R-module (does not matter which type it has or how it is constructed), I propose to have coefficient_ring(M) == R.

Any concerns? @wdecker @fingolfin @fieker?

ederc commented 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) ?

wdecker commented 2 years ago

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 ...

ederc commented 2 years ago

I see, alright.

wdecker commented 2 years ago

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]

fingolfin commented 1 year ago

We just discussed this here. There weren't many concerns with the suggestion coefficient_ring(M) == R, but still some:

  1. it does sound somewhat weird (but we didn't really have a better suggestion either...)
  2. some of us found it confusing that if 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...
fingolfin commented 1 year ago

In the end, it seems it would be good to look at explicit usage cases to determine what is appropriate...