Zulip Chat Archive

Stream: Is there code for X?

Topic: Finset.prod s id


Arend Mellendijk (Jul 09 2023 at 16:12):

Are there lemmas to this effect? I find rw sometimes has trouble dealing with these expressions because it doesn't unify fun n => n and id

import Mathlib.Data.Finset

theorem prod_id [CommMonoid R] (s : Finset R) :  n in s, n = s.prod id := rfl
theorem sum_id [AddCommMonoid R] (s : Finset R) :  n in s, n = s.sum id := rfl

Eric Wieser (Jul 09 2023 at 16:41):

Does unfold id work in the place that you want this?

Arend Mellendijk (Jul 09 2023 at 17:02):

No, because ∏ n in s, n appears in the goal and I'm rewriting using docs#Finset.prod_val

Arend Mellendijk (Jul 09 2023 at 17:02):

That said perhaps this is a code smell and I should just refactor this proof

Arend Mellendijk (Jul 09 2023 at 17:08):

Actually it appears erw deals with it in this case


Last updated: Dec 20 2023 at 11:08 UTC