Section Cover.
Variable A : Type.
Variable eqA_dec : forall a b : A, {a = b} + {a <> b}.
Variable empty : A.
(* A list of trees is a cover of a tree if all the trees in the list delimit a frontier in the tree *)
Inductive cover : list (btree A) -> btree A -> Prop :=
| cover_one : forall t, cover (t :: nil) t
| cover_node :
forall l1 l2 t1 t2 t3,
permutation l1 (t1 :: t2 :: l2) ->
cover (node t1 t2 :: l2) t3 -> cover l1 t3.
Hint Constructors cover : core.
Proof using.
intros t l1 l2 H; generalize l2; elim H; clear H t l1 l2; auto.
intros t l2 H; rewrite (permutation_one_inv _ _ _ H); auto.
intros l1 l2 t1 t2 t3 H H0 H1 l0 H2.
apply cover_node with (2 := H0).
apply permutation_trans with (2 := H).
apply permutation_sym; auto.
Qed.

(* A trivial way to cover a node *)
Theorem cover_cons_l :
forall t1 t2 l1, cover l1 t1 -> cover (t2 :: l1) (node t2 t1).