Set Bullet Behavior "Strict Subproofs".
Opaque upto.

Lemma map_snd_filter_fst : forall {A B C} f (g : B -> C) (l : list (A * B)),
filter (fun '(a, _) => f a) (map (fun '(a, b) => (a, g b)) l) =
map (fun '(a, b) => (a, g b)) (filter (fun '(a, _) => f a) l).