Proof using.
intros n ln t l H; elim H; simpl in |- *; auto.
intros; repeat rewrite length_app; auto with arith.
Qed.

(* The height and cover list gives a simple relation between weight_tree, sum_leaves and the product of the two lists *)
Theorem height_pred_weight :
forall (n : nat) (ln : list nat) (t : btree A) (l : list (btree A)),
height_pred n ln l t ->
n * sum_leaves f t + weight_tree f t = prod2list f ln l.