Definition eqopt (a b : option key) :=
 match a, b with
 | Some x, Some y => K.eq x y
 | _ , _ => False
 end.

(* Specifications: *)
Lemma searchtree_expand_left: forall k t lo hi, searchtree (Some k) hi t -> (eqopt lo (Some k) \/ ltopt lo (Some k)) -> searchtree lo hi t.
Lemma searchtree_expand_right: forall k t lo hi, searchtree lo (Some k) t -> (eqopt (Some k) hi \/ ltopt (Some k) hi) -> searchtree lo hi t.
Lemma searchtree_None: forall s lo hi, searchtree lo hi s -> searchtree None None s.
Lemma searchtree_mid_congr: forall c c' s1 x y s2 lo hi, searchtree lo hi (T c s1 x s2) -> K.eq x y -> searchtree lo hi (T c' s1 y s2).
Lemma searchtree_proper_bounds: forall lo hi t, searchtree lo hi t -> ltopt lo hi.
Lemma ins_is_searchtree: forall x s lo hi, ltopt lo (Some x) -> ltopt (Some x) hi -> searchtree lo hi s -> searchtree lo hi (ins x s).
Lemma insert_searchtree: forall x s, searchtree None None s -> searchtree None None (insert x s).