proposition: Lemma Forall2_filter Q1 Q2 `{∀ x, Decision (Q1 x), ∀ y, Decision (Q2 y)} l k: (∀ x y, P x y → Q1 x ↔ Q2 y) → Forall2 P l k → Forall2 P (filter Q1 l) (filter Q2 k).
proof: Proof. intros HP; induction 1 as [|x y l k]; unfold filter; simpl; auto. simplify_option_eq by (by rewrite <-(HP x y)); repeat constructor; auto. Qed.
imports: stdpp(options)