Instance set_compat2 (A : Type) x dom :
Proper (Logic.eq ==> @eq A dom dom ==> full_relation ==> @eq A dom dom) (@set A dom x).
Instance add_compat2 (A : Type) x dom :
Proper (Logic.eq ==> @eq A dom dom ==> @eq A (Dom.add x dom) (Dom.add x dom)) (@add A dom x).
Instance remove_compat2 (A : Type) x dom :
Proper (@eq A dom dom ==> @eq A (Dom.remove x dom) (Dom.remove x dom)) (@remove A dom x).

(* Specifications: *)
Corollary find_dom : forall A x v dom (m : t A dom), find x m = Some v -> Dom.In x dom.
Theorem set_None : forall A x y v dom (m : t A dom) (Hin : Dom.In x dom),
find y (set x v m Hin) = None <-> ¬X.eq y x ∧ find y m = None.
Theorem add_Some : forall A x y v u dom (m : t A dom),
find y (add x v m) = Some u <-> X.eq y x ∧ u = v ∨ ¬X.eq y x ∧ find y m = Some u.
Theorem add_None : forall A x y v dom (m : t A dom), find y (add x v m) = None <-> ¬X.eq y x ∧ find y m = None.
Theorem remove_Some : forall A x y u dom (m : t A dom),
find y (remove x m) = Some u <-> ¬X.eq y x ∧ find y m = Some u.
Theorem remove_None : forall A x y dom (m : t A dom),
find y (remove x m) = None <-> X.eq y x ∨ find y m = None.
Theorem add_cancel : forall A x v dom (m : t A dom), find x m = Some v -> eq (add x v m) m.
Theorem remove_cancel : forall A x dom (m : t A dom), find x m = None -> eq (remove x m) m.
Theorem add_merge : forall A x v₁ v₂ dom (m : t A dom), eq (add x v₂ (add x v₁ m)) (add x v₂ m).
Theorem add_comm : forall A x y v₁ v₂ dom (m : t A dom),
¬X.eq x y -> eq (add y v₂ (add x v₁ m)) (add x v₁ (add y v₂ m)).
Theorem remove_add_cancel : forall A x v dom (m : t A dom), eq (remove x (add x v m)) (remove x m).
Theorem map_None : forall A B (f : A -> B) dom (m : t A dom) x, find x (map f m) = None <-> ¬Dom.In x dom.
Theorem combine_None : forall A B C (f : A -> B -> C) g₁ g₂ dom₁ dom₂ (m₁ : t A dom₁) (m₂ : t B dom₂) x,
find x (combine f g₁ g₂ m₁ m₂) = None <-> find x m₁ = None ∧ find x m₂ = None.
Theorem add_incl : forall A x v dom (m : t A dom), ¬Dom.In x dom -> incl m (add x v m).
Theorem remove_incl : forall A x dom (m : t A dom), incl (remove x m) m.
Lemma for_all_spec : forall A f, Proper (X.eq ==> Logic.eq ==> Logic.eq) f -> forall dom (m : t A dom),
for_all f m = true <-> forall x v, find x m = Some v -> f x v = true.