Zulip Chat Archive
Stream: new members
Topic: list.map versus list.filter_map
Martin Dvořák (Aug 15 2022 at 15:35):
example {α β : Type*} {f : α → option β} {x : list α} {y : list β}
(hmap : list.map f x = list.map some y) :
list.filter_map f x = y :=
begin
sorry,
end
Eric Wieser (Aug 15 2022 at 15:44):
I think it follows from docs#list.map_filter_map_of_inv with g = id
Martin Dvořák (Aug 15 2022 at 16:59):
I don't see how it should follow from it.
Martin Dvořák (Aug 15 2022 at 17:18):
Nevermind. I have proved it myself. Just tell me whether you want the lemma to be added to mathlib.
Last updated: Dec 20 2023 at 11:08 UTC