proposition: Lemma mapi_inv {elt elt'} m x b (f : key -> elt -> elt') : MapsTo x b (mapi f m) -> exists a y, K.eq y x /\ b = f y a /\ MapsTo x a m.
proof: Proof. rewrite <- find_spec. setoid_rewrite <- find_spec. destruct (mapi_find f m x) as (y,(E,->)). destruct (find x m); simpl. - injection 1 as <-. now exists e, y. - discriminate. Qed.
imports: Coq(Bool Equalities Orders OrdersFacts OrdersLists) Coq(Morphisms Permutation SetoidPermutation) MMaps(Utils Comparisons Interface)