intros l t H; elim H; clear H l t; auto.
intros t l1 l2 (l3, (t1, (t2, (HH, (HH1, HH2))))) H0 H1; try assumption.
apply cover_node with (1 := HH1); auto.
apply cover_permutation with (2 := HH2); auto.
Qed.

(* Building is compatible with the weight *)
Theorem build_comp :
forall (l1 l2 : list (btree A)) (t1 t2 : btree A),
build l1 t1 ->
build l2 t2 ->
weight_tree_list f l1 = weight_tree_list f l2 ->
same_sum_leaves f l1 l2 -> weight_tree f t1 = weight_tree f t2.