Fixpoint Map_of_alist (l:alist) : Map A :=
    match l with
    | nil => M0 A
    | (a, y) :: l' => MapPut A (Map_of_alist l') a y
    end.

Lemma fold_right_aapp : forall (M:Type) (neutral:M) (op:M -> M -> M), (forall a b c:M, op (op a b) c = op a (op b c)) -> (forall a:M, op neutral a = a) -> forall (f:ad -> A -> M) (l l':alist), fold_right (fun (r:ad * A) (m:M) => let (a, y) := r in op (f a y) m) neutral (aapp l l') = op (fold_right (fun (r:ad * A) (m:M) => let (a, y) := r in op (f a y) m) neutral l) (fold_right (fun (r:ad * A) (m:M) => let (a, y) := r in op (f a y) m) neutral l').