Section Filtering.
Variables (K : ordType) (V : Type).
Notation fmap := (finMap K V).
Notation nil := (nil K V).
Definition kfilter' (p : pred K) (s : fmap) :=
filter (fun kv => p kv.1) (seq_of s).
Definition kfilter (p : pred K) (s : fmap) := FinMap (sorted_kfilter p s).
(* filter and fcat *)

Lemma kfilt_fcat (p : pred K) (s1 s2 : fmap) :
kfilter p (fcat s1 s2) = fcat (kfilter p s1) (kfilter p s2).