Zulip Chat Archive

Stream: Is there code for X?

Topic: multiset.sum


Marcus Rossel (Jul 26 2021 at 19:38):

Clicking on the "source" for multiset.sum shows the definition of multiset.prod. What is the definition of multiset.sum?

Ruben Van de Velde (Jul 26 2021 at 19:46):

It's translated automatically from prod by the to_additive attribute

Eric Wieser (Jul 26 2021 at 19:59):

#print multiset.sum will show you the translation

Kevin Buzzard (Jul 26 2021 at 21:58):

The answer is "it's the same but change all prods to sums, all monoids to add_monoids, all ->* to ->+ etc". More formally you can look at the definition of to_additive to see what the translation is


Last updated: Dec 20 2023 at 11:08 UTC