Proof with auto.
split; intros.
hnf in H. specialize ( H a).
unfold map_val, map_share, lookup_fpm.
destruct (proj1_sig m1 a) as [[sh1 a1] | ];
destruct (proj1_sig m2 a) as [[sh2 a2] | ];
destruct (proj1_sig m3 a) as [[sh3 a3] | ]; inv H; try solve [inv H0]; simpl; auto.
destruct H3; simpl in *; auto.
split. apply join_lifted; auto. constructor; auto.
split; apply join_unit2; auto.
split; apply join_unit1; auto.
split; apply join_unit1; auto.
split; apply join_unit1; auto.
intro a. specialize ( H a). destruct H.
unfold map_val, map_share, lookup_fpm in *.
destruct (proj1_sig m1 a) as [[sh1 a1] | ];
destruct (proj1_sig m2 a) as [[sh2 a2] | ];
destruct (proj1_sig m3 a) as [[sh3 a3] | ]; inv H0; try solve [inv H1]; auto.
constructor. split; auto.
apply join_unit2_e in H; auto. apply join_unit2; auto.
repeat f_equal. destruct sh1; destruct sh3; simpl in *; subst.
rewrite (proof_irr n n0); auto.
apply join_unit1_e in H; auto. apply join_unit1; auto.
repeat f_equal. destruct sh2; destruct sh3; simpl in *; subst.
rewrite (proof_irr n n0); auto.
constructor. constructor.
Qed.

(* Specifications: *)
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'.