Proof using.
intros m; elim m; clear m; simpl in |- *; auto.
intros (a1, l1) l H a0 b n H0 [H1| H1]; case (eqA_dec b a1); simpl in |- *;
auto.
intros H2; case H0; injection H1; auto.
intros; apply trans_equal with (2 := sym_equal H2); auto.
Qed.
(* Create a frequency list from a message *)
Fixpoint frequency_list (l : list A) : list (A * nat) :=
match l with
| nil => nil
| a :: l1 => add_frequency_list a (frequency_list l1)
end.

(* Keys of the frequency are in the original message *)
Theorem frequency_list_in :
forall a n m, In (a, n) (frequency_list m) -> In a m.