Definition HdRel' (R: key -> key -> Prop) (lo: option key) (l: list key) :=
   match lo with Some lo' => HdRel R lo' l | None => True end.

(* Specifications: *)
Lemma treeify_f_not_EE: forall n l, length l >= nat_of_P n -> fst (treeify_f n l) <> EE.
Lemma treeify'_g_is_searchtree: forall n l lo, HdRel' K.lt lo l -> Sorted K.lt l -> S (length l) >= nat_of_P n -> (searchtree lo (hd_error (snd (treeify_g n l))) (fst (treeify_g n l)) /\ (forall k, interp (fst (treeify_g n l)) k \/ InA K.eq k (snd (treeify_g n l)) <-> InA K.eq k l) /\ Sorted K.lt (snd (treeify_g n l))).