(* Decode is just decode_aux with an empty head *)
Definition decode (c : list (A * list bool)) (m : list bool) :=
  decode_aux c nil m.

(* Specifications: *)
Theorem decode_correct : forall c : code, unique_prefix c -> not_null c -> forall (m1 m2 : list bool) (a : A), find_val m1 c = Some a -> decode c (m1 ++ m2) = a :: decode c m2.
Theorem correct_encoding : forall c : code, unique_prefix c -> not_null c -> forall m : list A, in_alphabet m c -> decode c (encode c m) = m.
Theorem frequency_not_null : forall m (c : code), 1 < length (frequency_list eqA_dec m) -> unique_prefix c -> in_alphabet m c -> not_null c.