Definition tree_eq (m1 m2: PTree.t L.t) : Prop :=
  forall i, opt_eq (PTree.get i m1) (PTree.get i m2).

(* Specifications: *)
Lemma tree_eq_refl: forall m, tree_eq m m.
Lemma tree_eq_sym: forall m1 m2, tree_eq m1 m2 -> tree_eq m2 m1.
Lemma tree_eq_trans: forall m1 m2 m3, tree_eq m1 m2 -> tree_eq m2 m3 -> tree_eq m1 m3.
Lemma tree_eq_node: forall l1 o1 r1 l2 o2 r2, tree_eq l1 l2 -> tree_eq r1 r2 -> opt_eq o1 o2 -> tree_eq (PTree.Node l1 o1 r1) (PTree.Node l2 o2 r2).
Lemma tree_eq_node': forall l1 o1 r1 l2 o2 r2, tree_eq l1 l2 -> tree_eq r1 r2 -> opt_eq o1 o2 -> tree_eq (PTree.Node l1 o1 r1) (PTree.Node' l2 o2 r2).
Lemma tree_eq_node'': forall l1 o1 r1 l2 o2 r2, tree_eq l1 l2 -> tree_eq r1 r2 -> opt_eq o1 o2 -> tree_eq (PTree.Node' l1 o1 r1) (PTree.Node' l2 o2 r2).