Zulip Chat Archive
Stream: mathlib4
Topic: MvPolynomial module
Brendan Seamas Murphy (May 15 2024 at 16:54):
There's a type PolynomialModule R M
, defined as a type synonym for finitely supported functions instead of a newtype like Polynomial M
. I'm not sure why we have separate versions of this but I guess it makes inference better? Anyways, is there a multivariate version of this? If there isn't I would like to add it, and I think I need a better understanding of why there's two types here in the first place
Johan Commelin (May 15 2024 at 17:22):
cc @Eric Wieser I think you've thought about design (issues) of this part of the library a lot...
Scott Carnahan (May 15 2024 at 17:33):
If M = R[X]
you get two non-defeq actions of R[X]
on Polynomial M
. This is briefly explained in docs#PolynomialModule .
Brendan Seamas Murphy (May 15 2024 at 17:45):
Ah sure this makes sense. But it still seems strange to use a type synonym for finsupp instead of the existing type of polynomials, imo
Brendan Seamas Murphy (May 15 2024 at 17:45):
I would assume this causes some code duplication
Eric Wieser (May 15 2024 at 17:49):
Polynomial M
isn't legal when M
isn't a ring
Brendan Seamas Murphy (May 15 2024 at 18:11):
I mean, that also seems a little questionable? Eg for ordinal notation you might want to talk about polynomials with ordinal coefficients, which don't form a ring
Brendan Seamas Murphy (May 15 2024 at 18:11):
For right now I'm just going to define MvPolynomialModule
mimicking PolynomialModule
as closely as possible
Eric Wieser (May 15 2024 at 18:16):
I think the mental model is that Polynomial
is Finsupp
with pointwise *
replaced by convolutional *
, and if you don't have a ring then you don't have that *
.
Antoine Chambert-Loir (May 15 2024 at 18:41):
No but you have a convolution from the sale Finsupp of anything that acts on M.
Eric Wieser (May 15 2024 at 18:57):
The problem is that SMul
only works for SMul X Y -> SMul X (F Y)
, but what you're asking for needs SMul X Y -> Smul (F X) (F Y)
, and you can't have both without diamonds
Brendan Seamas Murphy (Jun 07 2024 at 00:55):
I created a PR #13573 to add MvPolynomialModule
Johan Commelin (Jun 07 2024 at 06:13):
@Scott Carnahan did you also have something like :up: , or was it @Antoine Chambert-Loir ?
Scott Carnahan (Jun 07 2024 at 07:08):
I contributed docs#HahnModule given as a type alias for HahnSeries
(with a lot of help from Eric). Instead of convolutional *
, we have convolutional SMul.
Antoine Chambert-Loir (Jun 07 2024 at 16:43):
What #13573 does is not the analogue of docs#HahnModule, nor the type of finsupp function from index type I
to a given module M
(which would be a Module (MvPolynomial I A)
under Module A M
, but the structure of module over a docs#MvPolynomial ring that a module possesses when the variables are mapped to elements of the ring that acts on the module.
Brendan Seamas Murphy (Jun 07 2024 at 16:57):
Should it have a more descriptive name? I didn't think there would be any confusion over the module structure. To me this is what means
Antoine Chambert-Loir (Jun 08 2024 at 09:23):
I don't want to be prescriptive, but the ambiguity with the existing docs#HahnModule or docs#PolynomialModule would suggest finding another name.
In your case, I know that there is a similar definition for polynomial in one indeterminate (but I can't find it, surely @Oliver Nash will tell us which one it is), and their names and API should be aligned.
By the way, docs#MvPolynomial is an instance of docs#MonoidAlgebra and I believe that everything that is done for #MvPolynomial should be inherited from similar constructions at the level of docs#MonoidAlgebra.
Brendan Seamas Murphy (Jun 08 2024 at 17:05):
The similar definition in one indeterminate is docs#PolynomialModule, no? I mean I wrote the file largely by copy and pasting from PolynomialModule and then changing as appropriate
Brendan Seamas Murphy (Jun 08 2024 at 17:07):
As is we can't use nevermind, you were talking about MonoidAlgebra
because it has a typeclass parameter [Semiring k]
. I'm not sure how much we can inherit from this in principle (even if we change the parameter) vs inheriting from Finsupp
, because of the instance clashingMvPolynomial
not MvPolynomialModule
Last updated: May 02 2025 at 03:31 UTC