(* 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.

Theorem in_frequency_map_inv : forall l a, In a (map (fst (B:=_)) (frequency_list l)) -> In a l.