Fixpoint wf_btree_over t :=
match t with BNode keys children =>
(length keys = 2 * d + 1)%nat /\
(children = [] \/ length children = S (length keys) /\ Forall wf_btree_aux children)
end.

Lemma In_sorted_range : forall d lo hi x l (Hsort : sorted l) (Hlo : 0 <= lo <= hi)
(Hhi : hi <= Zlength l)
(Hin : In x (sublist lo hi l)),
Znth lo l d <= x <= Znth (hi - 1) l d.