proposition: Lemma filter_perm: forall {A: Type} (f g: A -> bool) l, (forall x, In x l -> f x = negb (g x)) -> Permutation l (filter f l ++ filter g l).
proof: Proof. intros. induction l. + reflexivity. + simpl. pose proof (H a (or_introl eq_refl)). spec IHl; [intros; apply H; simpl; auto |]. destruct (g a) eqn:?H; simpl in H0; rewrite H0. - apply Permutation_cons_app; auto. - apply Permutation_cons; auto. Qed.
imports: Coq.Lists.List Coq.micromega.Lia Coq.Sorting.Permutation Coq.ZArith.ZArith_base Coq.ZArith.Zcomplements Coq.Logic.FunctionalExtensionality CertiGraph.lib.Coqlib CertiGraph.lib.EquivDec_ext VST.zlist.sublist VST.zlist.list_solver