fact: Definition huffman_aux_type (l : list (nat * code A)) : Type := l <> [] -> ordered (fun x y => fst x <= fst y) l -> (forall a, In a l -> compute_code (to_btree (pbbuild empty (snd a))) = snd a) -> (forall a, In a l -> sum_leaves (fun x => number_of_occurrences A_eq_dec x m) (to_btree (pbbuild empty (snd a))) = fst a) -> (forall a, In a l -> snd a <> []) -> {c : code A | compute_code (to_btree (pbbuild empty c)) = c /\ build (fun x => number_of_occurrences A_eq_dec x m) (map (fun x => to_btree (pbbuild empty (snd x))) l) (to_btree (pbbuild empty c))}.
imports: Coq(Sorting.Permutation) Huffman(Code BTree Build PBTree2BTree Restrict)