unfold eq_dir_b.
destruct d1; destruct d2; split; auto; intro Contra; inversion Contra.
Qed.
Definition refineList (d : SplitDirection) (l : list SplitPath) : list SplitPath :=
map (@tl SplitDirection) (filter (fun p => match hd_error p with
| Some d' => eq_dir_b d d'
| _       => false
end) l).

(* Specifications: *)
Lemma refineCorrect : forall d l p, In p (refineList d l) -> In (d :: p) l.
intros d l p.