Module Share : SHARE_MODEL := tree_shares.Share.
Definition share : Type := Share.t.
Instance pa_share : Perm_alg share := Share.pa.
Instance sa_share : Sep_alg share := Share.sa.
Instance ca_share : Canc_alg share := Share.ca.
Definition emptyshare : share := Share.bot.
Definition fullshare : share := Share.top.
Hint Resolve bot_identity : core.
Instance share_cross_split : Cross_alg t.
Proof with auto.
intro sh.
destruct (eq_dec sh top); subst.
left. apply fullshare_full.
right. intro. apply n.
generalize (Share.top_correct sh);intro.
apply leq_join_sub in H0.
destruct H0.
specialize ( H x). spec H. exists top...
specialize ( H sh top (join_comm H0))...
Qed.
Proof with auto.
intros until sh2; intros H H0.
destruct (dec_share_identity sh2).
generalize (split_nontrivial' _ _ _ H0); intro.
spec H1...
destruct (eq_dec sh1 sh)...
subst sh1.
generalize (split_join _ _ _ H0); intro.
apply join_comm in H1.
apply unit_identity in H1...
Qed.
Proof with auto.
intros until sh2; intros H H0.
destruct (dec_share_identity sh1).
generalize (split_nontrivial' _ _ _ H0); intro.
spec H1...
destruct (eq_dec sh2 sh)...
subst sh2.
generalize (split_join _ _ _ H0); intro.
apply unit_identity in H1...
Qed.
Hint Resolve bot_unit : core.

Lemma decompose_bijection: forall sh1 sh2,
sh1 = sh2 <-> decompose sh1 = decompose sh2.