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

Commit 61e02dd

Browse files
kim-emcipher1024
authored andcommitted
feat(data/finset): missing fold_map lemma (#794)
1 parent cc753d7 commit 61e02dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/data/finset.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,10 @@ by unfold fold; rw [insert_val, ndinsert_of_not_mem h, map_cons, fold_cons_left]
12471247

12481248
@[simp] theorem fold_singleton : (singleton a).fold op b f = f a * b := rfl
12491249

1250+
@[simp] theorem fold_map [decidable_eq α] {g : γ ↪ α} {s : finset γ} :
1251+
(s.map g).fold op b f = s.fold op b (f ∘ g) :=
1252+
by simp only [fold, map, multiset.map_map]
1253+
12501254
@[simp] theorem fold_image [decidable_eq α] {g : γ → α} {s : finset γ}
12511255
(H : ∀ (x ∈ s) (y ∈ s), g x = g y → x = y) : (s.image g).fold op b f = s.fold op b (f ∘ g) :=
12521256
by simp only [fold, image_val_of_inj_on H, multiset.map_map]

0 commit comments

Comments
 (0)