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