generalize frequency_more_than_one; case m; simpl in |- *; auto.
intros H; Contradict H; auto with arith.
intros; discriminate.
Qed.

(* Specifications: *)
(* Every tree that is built is of minimum weight *)
Theorem huffman_build_minimun :
forall (c : code A) (t : btree A),
unique_prefix c ->
in_alphabet m c ->
build (fun x => number_of_occurrences eqA_dec x m)
(map (fun x => leaf (fst x)) (frequency_list eqA_dec m)) t ->
weight eqA_dec m (compute_code t) <= weight eqA_dec m c.