(* Specifications: *)
Theorem lt_minus_O : forall n m, m < n -> 0 < n - m.
Theorem le_minus : forall a b : nat, a - b <= a.
Theorem minus_minus_simpl4 : forall a b c : nat, b <= c -> c <= a -> a - b - (a - c) = c - b.
Theorem plus_minus_simpl4 : forall a b c : nat, b <= a -> c <= b -> a - b + (b - c) = a - c.
Theorem not_null_m : m <> nil.
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.
Theorem Contradict1 : forall a b : Prop, b -> (a -> ~ b) -> ~ a.
Theorem Contradict2 : forall a b : Prop, b -> ~ b -> a.
Theorem Contradict3 : forall a : Prop, a -> ~ ~ a.
Theorem fold_plus_split : forall (B : Type) (l : list B) (c : nat) (f : B -> nat), c + fold_left (fun (a : nat) (b : B) => a + f b) l 0 = fold_left (fun (a : nat) (b : B) => a + f b) l c.
Theorem fold_plus_permutation : forall (B : Type) (l1 l2 : list B) (c : nat) (f : B -> nat), permutation l1 l2 -> fold_left (fun (a : nat) (b : B) => a + f b) l1 c = fold_left (fun (a : nat) (b : B) => a + f b) l2 c.
Theorem length_encode_nId : forall a l1 l n, length (encode eqA_dec ((a, l1) :: l) (id_list a n)) = n * length l1.
Theorem frequency_length : forall (m : list A) (c : code A), unique_key c -> length (encode eqA_dec c m) = fold_left (fun a b => a + number_of_occurrences eqA_dec (fst b) m * length (snd b)) c 0.