(*s Computing the minimum of edges in a Map *)

Definition all_min (f : ad -> D -> option D) := MapFold _ _ None Ddmin f.

(* Specifications: *)
Lemma all_min_le_1 : forall (f : ad -> D -> option D) (m : Map D) (a : ad) (d : D), MapGet _ m a = Some d -> Ddle (all_min f m) (f a d) = true.
Lemma all_min_le_2_1 : forall (f : ad -> D -> option D) (m : Map D) (pf : ad -> ad) (d : D), MapFold1 _ _ None Ddmin f pf m = Some d -> {a : ad & {d' : D | MapGet _ m a = Some d' /\ f (pf a) d' = Some d}}.
Lemma all_min_le_2 : forall (f : ad -> D -> option D) (m : Map D) (d : D), all_min f m = Some d -> {a : ad & {d' : D | MapGet _ m a = Some d' /\ f a d' = Some d}}.
Lemma all_min_le_3 : forall (f g : ad -> D -> option D) (m : Map D), (forall (a : ad) (d : D), MapGet _ m a = Some d -> Ddle (f a d) (g a d) = true) -> Ddle (all_min f m) (all_min g m) = true.