Proof using.
intros a n m; generalize n; elim m; clear m n; simpl in |- *; auto.
intros a0 l H n H0; case add_frequency_list_in_inv with (1 := H0); auto.
intros H1; right; apply (H n); auto.
Qed.

(* Developing the frequency list gives a permutation of the initial message *)
Theorem frequency_list_perm :
forall l : list A,
permutation l
(flat_map (fun p => id_list (fst p) (snd p)) (frequency_list l)).