Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 0ea37e9

Browse files
committed
feat(algebra/big_operators): add prod_map, sum_map
1 parent d3c68fc commit 0ea37e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/algebra/big_operators.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ lemma prod_image [decidable_eq α] {s : finset γ} {g : γ → α} :
5656
(∀x∈s, ∀y∈s, g x = g y → x = y) → (s.image g).prod f = s.prod (λx, f (g x)) :=
5757
fold_image
5858

59+
@[simp, to_additive sum_map]
60+
lemma prod_map [comm_monoid γ] (s : finset α) (e : α ↪ β) (f : β → γ):
61+
(s.map e).prod f = s.prod (λa, f (e a)) :=
62+
by rw [finset.prod, finset.map_val, multiset.map_map]; refl
63+
5964
@[congr, to_additive finset.sum_congr]
6065
lemma prod_congr (h : s₁ = s₂) : (∀x∈s₂, f x = g x) → s₁.prod f = s₂.prod g :=
6166
by rw [h]; exact fold_congr

0 commit comments

Comments
 (0)