Zulip Chat Archive

Stream: mathlib4

Topic: Separate `Finsupp` from `AddMonoidAlgebra`


Damiano Testa (Feb 15 2024 at 10:29):

The plan is to place the structure divide when defining AddMonoidAlgebra, right? I remember that @Eric Wieser had suggested even trying to unify AddMonoidAlgebra and MonoidAlgebra: these two refactors should not happen at the same time!

(conversation started here).

Damiano Testa (Feb 15 2024 at 10:32):

I envisage a process where

  • we introduce the divide in a branch,
  • we fix some of the proofs that break in Mathlib,
  • we stop when we get bored or there are no further proofs to fix, at which point, we also introduce the divide in Mathlib.

Does this sound reasonable?

María Inés de Frutos Fernández (Feb 15 2024 at 10:33):

@Xavier Généreux and I are working on a generalization of MonoidAlgebra, SkewMonoidAlgebra, in #10541 (which we would also need to refactor analogously). We only did the multiplicative version, partly because some of our results in the skewed case rely on MulSemiringAction.

Damiano Testa (Feb 15 2024 at 10:34):

Ok, thanks for the heads up! Since I think that this will be a somewhat long process, I do not see a big issue with starting it with AddMonoidAlgebra and then seeing when/where to extend.

María Inés de Frutos Fernández (Feb 15 2024 at 10:38):

Damiano Testa said:

@Eric Wieser had suggested even trying to unify AddMonoidAlgebra and MonoidAlgebra.

There is an implementation note in MonoidAlgebra.Basic which seems related to this:

Similarly, I attempted to just define k[G] := MonoidAlgebra k (Multiplicative G), but the definitional equality Multiplicative G = G leaks through everywhere, and seems impossible to use.

Would unifying the two classes lead to problems with polynomials?

Damiano Testa (Feb 15 2024 at 11:06):

María, yes, this is related to the unification. I am less confident about this change, so my plan is to start with defining

structure AddMonoidAlgebra where ofFinsupp ::
  toFinsupp : G →₀ k

instead of the current

def AddMonoidAlgebra :=
  G →₀ k

María Inés de Frutos Fernández (Feb 15 2024 at 11:07):

OK, sounds good.

Antoine Chambert-Loir (Feb 15 2024 at 12:55):

Can you explain what this modification should change?

Kevin Buzzard (Feb 15 2024 at 12:58):

It would break some proofs where definitonal abuse was occurring, and this might be a good thing because definitonal abuse can contribute to leakage. The point is that the dictionary between the two concepts will now be toFinsupp or \<_\> whereas right now it's id

Yaël Dillies (Feb 15 2024 at 13:03):

And mostly we get back the mathematical identity between AddMonoidAlgebra and Polynomial

Yaël Dillies (Feb 15 2024 at 13:03):

Polynomial are just a special-case of monoid algebras, and should be formalised as such.

Damiano Testa (Feb 15 2024 at 13:04):

It also moves the separation between Finsupp and Polynomial at the place where the "real" difference is, namely where multiplication starts being used.

Antoine Chambert-Loir (Feb 15 2024 at 18:16):

Except that I think there should exist a “monoid module” - at least if M acts on V, an action of the monoid algebra of M (Finsupp M k) on (Finsupp V k).

Xavier Généreux (May 14 2024 at 09:56):

Hello everyone,
Following the discussion of this thread, I have updated #10541 that introduces a generalisation of MonoidAlgebraSkewMonoidAlgebra, to match the change described above. Are there any updates on whether this change is still happening/planned? I would like to build on the current version of SkewMonoidAlgebra of #10541, in particular by defining SkewPolynomial.

Damiano Testa (May 14 2024 at 10:02):

I have not given up on the split, but AddMonoidAlgebra and MonoidAlgebra are not parallel enough. So, I am trying to first make them really parallel and then change only one, with the other auto-changed.

You can see some partial progress at #12637.


Last updated: May 02 2025 at 03:31 UTC