Inductive multiset : Type :=
    Bag : (A -> nat) -> multiset.Inductive multiset : Type :=
    Bag : (A -> nat) -> multiset.Definition EmptyBag := Bag (fun a:A => 0).Definition SingletonBag (a:A) :=
    Bag (fun a':A => match Aeq_dec a a' with
                       | left _ => 1
                       | right _ => 0
                     end).Definition multiplicity (m:multiset) (a:A) : nat := let (f) := m in f a.(** multiset equality *)
  Definition meq (m1 m2:multiset) :=
    forall a:A, multiplicity m1 a = multiplicity m2 a.

Lemma meq_refl : forall x:multiset, meq x x.