Ltac join_sh_contradiction:=
        match goal with
        | [ H: @join Share.t _ _ _ _ |- _ ] => apply join_joins in H
        end;
      joins_sh_contradiction.Ltac glb_contradictions:=
    repeat match goal with
           | [ H: writable0_share_dec _ = _ |- _ ] => clear H
           end;
    match goal with
    | [ H:  Share.glb Share.Rsh ?sh = Share.top  |- _ ] =>
      exfalso; eapply glb_Rsh_not_top; eassumption
    | [ H: writable0_share (Share.glb Share.Rsh ?sh) |- _ ] =>
      eapply writable0_right in H
    end; join_sh_contradiction.

Lemma joins_permDisjoint_lock: forall r1 r2, joins r1 r2 -> permDisjoint (perm_of_res_lock r1) (perm_of_res_lock r2).