Section Relations.
Context {R1 R2 : Type}.
Variable RR : R1 -> R2 -> Prop.
Definition map_default_eq d {E}
: (stateT map (itree E) R1) -> (stateT map (itree E) R2) -> Prop :=
fun t1 t2 => forall s1 s2, (@eq_map _ _ _ _ d) s1 s2 -> eutt (prod_rel (@eq_map _ _ _ _ d) RR) (t1 s1) (t2 s2).
End Relations.
Global Instance Proper_handle_map {E R}  d :
Proper (eq ==> map_default_eq eq d) (@handle_map _ _ _ _ E d R).

(* This lemma states that the operations provided by [handle_map] respect the equivalence on the underlying map interface *)
Lemma interp_map_id d {E X} (t : itree (mapE K d +' E) X) :
map_default_eq eq d (interp_map t) (interp_map t).