fact: Definition filter_pred {T} (P : T -> Prop) (S : Ensemble T) := fold_right (fun (a : T) (xs : list T) => (b <- { b : bool | b = true <-> P a }; ret (if b then a::xs else xs))) (ret nil) S.
imports: Coq.Lists.List Coq.Sets.Ensembles Fiat.Computation.Core Fiat.Computation.Notations Fiat.Common.Ensembles.EnsembleListEquivalence Fiat.Common.Ensembles.Cardinal