Proof using.
intros c H H0 m1 m2 a H1; unfold decode in |- *; apply decode_aux_correct;
auto.
Qed.

(* Encoding and decoding return the same message if the code is prefix *)
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.