Definition combine A B C f g₁ g₂ dom₁ dom₂ (m₁ : t A dom₁) (m₂ : t B dom₂) : t C (Dom.union dom₁ dom₂) :=
exist (OK (Dom.union dom₁ dom₂)) (Scombine f g₁ g₂ (proj1_sig m₁) (proj1_sig m₂)) (combine_OK f g₁ g₂ m₁ m₂).

(* Specifications: *)
(** [cast] **)
Lemma cast_OK : forall A dom₁ dom₂ (Heq : Dom.eq dom₁ dom₂) (m : S.t A), OK dom₁ m -> OK dom₂ m.
Corollary from_elements_OK : forall A l,
OK (fold_left (fun acc xv => Dom.add (fst xv) acc) l Dom.empty)
(fold_left (fun acc xv => S.add (fst xv) (snd xv) acc) l (S.empty A)).