Arguments set {A} {dom} x v m _.

(* Specifications: *)
(** [singleton] **)
Lemma singleton_OK : forall A x v, OK (Dom.singleton x) (S.add x v (S.empty A)).
Definition singleton {A : Type} (x : key) (v : A) : t A (Dom.singleton x) :=
exist (OK (Dom.singleton x)) (S.add x v (@S.empty A)) (singleton_OK x v).
(** [remove] **)
Lemma remove_OK : forall A dom x (m : t A dom), OK (Dom.remove x dom) (S.remove (elt:=A) x (proj1_sig m)).
Definition remove {A : Type} {dom : Dom.t} (x : key) (m : @t A dom) : @t A (Dom.remove x dom) :=
exist (OK (Dom.remove x dom)) (S.remove x (proj1_sig m)) (remove_OK x m).
(** [constant] **)
Lemma constant_OK_aux : forall A v (m : S.t A) l x,
S.In x (fold_left (λ (a : S.t A) (e : Dom.elt), S.add e v a) l m) <-> S.In x m ∨ InA X.eq x l.
Corollary constant_OK : forall A dom v, OK dom (Dom.fold (fun x m => S.add x v m) dom (S.empty A)).
Definition constant (A : Type) dom (v : A) : t A dom :=
exist (OK dom) (Dom.fold (fun x m => S.add x v m) dom (@S.empty A)) (constant_OK dom v).