Section Coinc_refl.
Context {AR : Arity}.
Definition pick_variety_auxCP {m : nat} (s : SS.elt) (cp : cartesianPower positive (S (S m))) : bool.
Definition pick_variety (s : SS.elt) (st : STt) :=
STexists_ (fun t => pick_variety_aux s t) st.
Definition exists_witness (f : SS.elt -> bool) (s : SS.t) : option SS.elt :=
SS.choose (SS.filter f s).

Lemma exists_witness_ok : forall e f s,
Proper (S.Equal ==> eq) f ->
exists_witness f s = Some e -> SS.In e s.