Definition map := fpm A (lifted Share.Join_ba * B).Instance Join_map : Join map := Join_fpm _.Instance pa_map : Perm_alg map := Perm_fpm _ _.Instance sa_map : Sep_alg map := Sep_fpm _ _.Instance ca_map {CA: Canc_alg B} : Canc_alg map := Canc_fpm _.Instance da_map {DA: Disj_alg B} : Disj_alg map := @Disj_fpm _ _ _ _ _ _.Definition map_share (a:A) (m:map) : share :=
    match lookup_fpm m a with
    | Some (sh,_) => lifted_obj sh
    | None => Share.bot
    end.Definition map_val (a:A) (m:map) : option B :=
    match lookup_fpm m a with
    | Some (_,b) => Some b
    | None => None
    end.Definition empty_map : map := empty_fpm _ _.Definition map_upd (a:A) (b:B) (m:map) : option map :=
    match lookup_fpm m a with
    | Some (sh,_) =>
        if eq_dec (lifted_obj sh) fullshare
           then Some (insert_fpm _ a (sh,b) m)
           else None
    | None => None
    end.

(* Specifications: *)
Lemma join_lifted {t} {J: Join t}: forall (a b c: lifted J), join a b c -> join (lifted_obj a) (lifted_obj b) (lifted_obj c).
Lemma map_join_char : forall m1 m2 m3, join m1 m2 m3 <-> (forall a, join (map_share a m1) (map_share a m2) (map_share a m3) /\ join (map_val a m1) (map_val a m2) (map_val a m3)).
Lemma empty_map_identity {CAB: Disj_alg B}: identity empty_map.
Lemma map_identity_unique {CAB: Disj_alg B}: forall m1 m2:map, identity m1 -> identity m2 -> m1 = m2.
Lemma map_identity_is_empty {CAB: Disj_alg B} : forall m, identity m -> m = empty_map.
Lemma empty_map_join {CAB: Disj_alg B} : forall m, join empty_map m m.
Lemma map_val_bot : forall a m, map_val a m = None <-> map_share a m = Share.bot.
Lemma map_upd_success : forall a v m, map_share a m = Share.top -> exists m', map_upd a v m = Some m'.
Lemma map_set_share1 : forall a v m m', map_upd a v m = Some m' -> map_share a m = Share.top.
Lemma map_set_share2 : forall a v m m', map_upd a v m = Some m' -> map_share a m' = Share.top.
Lemma map_set_share3 : forall a v m m', map_upd a v m = Some m' -> forall a', map_share a' m = map_share a' m'.
Lemma map_gss_val: forall a v m m', map_upd a v m = Some m' -> map_val a m' = Some v.
Lemma map_gso_val : forall i j v m m', i <> j -> map_upd j v m = Some m' -> map_val i m = map_val i m'.
Lemma map_gso_share : forall i j v m m', i <> j -> map_upd j v m = Some m' -> map_share i m = map_share i m'.
Lemma map_upd_join : forall m1 m2 m3 a v m1', map_upd a v m1 = Some m1' -> join m1 m2 m3 -> exists m3', map_upd a v m3 = Some m3' /\ join m1' m2 m3'.