Zulip Chat Archive

Stream: mathlib4

Topic: Mathlib/Algebra/FreeMonoid/Count.lean


Kim Morrison (Dec 19 2024 at 20:53):

There is lots of defeq abuse here of FreeAddMonoid α = List α, e.g. in statements like

theorem countP_apply (l : FreeAddMonoid α) : countP p l = List.countP p l := rfl

Anyone interested in cleaning up?

Edward van de Meent (Dec 20 2024 at 20:59):

i've looked at this design before, since i wanted to use this for my free probability project... i think this should not be too difficult?

Edward van de Meent (Dec 20 2024 at 23:11):

In 12 hours, I'll take a look if noone else has

Edward van de Meent (Dec 21 2024 at 13:14):

is it an idea to have to_additive remove Multiplicative or add Additive automatically (in certain cases?)

Edward van de Meent (Dec 21 2024 at 13:15):

because right now, we have to write out both docs#FreeMonoid.countP and docs#FreeAddMonoid.countP...

Edward van de Meent (Dec 21 2024 at 13:44):

just came across docs#List.countP_singleton, which has if p a = true then ... in the rhs where p a : Bool...

Edward van de Meent (Dec 21 2024 at 13:45):

actually nvm, that seems to be a quirk of pretty printing?
actually the pretty printing is accurate, i just didn't have the right mental model of ite

Edward van de Meent (Dec 21 2024 at 14:18):

pr at #20156


Last updated: May 02 2025 at 03:31 UTC