Definition mem_add (x: elt) (s: t) : option t :=
   match mem_add' x (proj1_sig s) as b return (b = mem_add' x (proj1_sig s) -> option t)with
     | None => fun _ => None
     | Some s' => fun p => Some (exist valid s' (mem_add_valid x _ (proj2_sig s) s' p))
     end (Logic.eq_refl _).

Lemma partition_aux_filter: forall f s n1 l1 n2 l2, partition_aux f s (n1,l1) (n2,l2) = (filter_aux f s n1 l1, filter_aux (compose negb f) s n2 l2).