Set Implicit Arguments.
Definition Tsh : share := Share.top.
Definition nonempty_share (sh: share) :=
sepalg.nonidentity sh.
Definition readable_share (sh: share) :=
nonempty_share (Share.glb Share.Rsh sh).
Definition writable_share (sh: share) :=
nonempty_share (Share.glb Share.Lsh sh) /\ join_sub Share.Rsh sh.
Hint Resolve writable_readable : core.
Arguments glb_Rsh_not_top sh _ : clear implicits.
Hint Resolve writable_share_top : core.
Hint Resolve writable_readable_share : core.
Definition extern_retainer := fst (Share.split Share.Lsh).
Definition Ews (* extern_write_share *) :=
Share.lub extern_retainer Share.Rsh.
Hint Resolve readable_nonidentity : core.
Definition pure_readable_share (sh: Share.t) :=
Share.glb Share.Lsh sh = Share.bot /\ readable_share sh.
Definition rshare := sig pure_readable_share.
Definition readable_part: forall (sh: Share.t) (rsh: readable_share sh), rshare.
intros.
exists (Share.glb Share.Rsh sh).
split.
rewrite <- Share.glb_assoc. rewrite glb_Lsh_Rsh.
rewrite Share.glb_commute. apply Share.glb_bot.
unfold readable_share.
rewrite <- Share.glb_assoc.
rewrite Share.glb_idem.
apply rsh.
Defined.
Arguments readable_not_identity sh P _ _ : clear implicits.

Lemma join_pure_readable:
forall sh1 sh2 sh3,
join sh1 sh2 sh3 ->
pure_readable_share sh1 ->
pure_readable_share sh2 ->
pure_readable_share sh3.