Function identify_varieties (ss : SS.t) (st : STt) {measure SS.cardinal ss}
                                 : SS.t :=
  let varieties := pick_varieties ss st in
    match varieties with
      |None => ss
      |Some (s1,s2) => let auxsetofsets := SS.remove s2 (SS.remove s1 ss) in
                       let auxset := S.union s1 s2 in
                       let newss := SS.add auxset auxsetofsets in
                         identify_varieties newss st
    end.Definition memCPAux m (cp : cartesianPower positive (S (S m))) (s : SS.elt) : bool.

Lemma memCPAuxHdTl : forall m cp s, memCPAux (S m) cp s = S.mem (fst cp) s && memCPAux m (tailCP cp) s.