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.

(* Specifications: *)
Lemma meq_refl : forall x:multiset, meq x x.
Lemma meq_trans : forall x y z:multiset, meq x y -> meq y z -> meq x z.
Lemma meq_sym : forall x y:multiset, meq x y -> meq y x.