Ltac crtac :=
repeat  (solve [constructor; auto] ||
match goal with
| H: None = res_option ?A |- _ => destruct A; inv H
| H: Some _ = res_option ?A |- _ => destruct A; inv H
| H: join NO _ _ |- _ => inv H
| H: join _ NO _ |- _ => inv H
| H: join (YES _ _ _) _ _ |- _ => inv H
| H: join _ (YES _ _ _) _ |- _ => inv H
| H: join (PURE _ _) _ _ |- _ => inv H
| H: join _ (PURE _ _) _ |- _ => inv H
| H: @join _ _ (Some _) _ _ |- _ => inv H
| H: @join _ _ _ (Some _) _ |- _ => inv H
| H: @join _ _ None _ _ |- _ =>
apply join_unit1_e in H; [| apply None_identity]
| H: @join _ _ _ None _ |- _ =>
apply join_unit2_e in H; [| apply None_identity]
| H:  prod pshare AV.kind |- _ => destruct H
| H: @join _ (Join_equiv _) ?a ?b ?c |- _ => destruct H; try subst a; try subst b; try subst c
| H: @join _ (Join_prod _ _ _ _) (_,_) (_,_) (_,_) |- _ => destruct H; simpl fst in *; simpl snd in *
end; auto).

(* Specifications: *)
Lemma Cross_resource: Cross_alg resource.
Instance Cross_rmap:
@Cross_alg _ (Join_prop _ Join_trace AV.valid) ->
Cross_alg rmap.
Lemma Cross_rmap_simple: (forall f, AV.valid f) -> Cross_alg rmap.
Lemma identity_resource: forall r: resource, identity r <->
match r with YES _ _ _ => False | _ => True end.
Lemma resource_at_core_identity:  forall m i, identity (core m @ i).
Lemma YES_inj: forall sh k pp sh' k' pp',
YES sh k pp = YES sh' k' pp' ->
sh=sh' /\ k=k' /\ pp=pp'.
Lemma PURE_inj: forall T x x' y y', PURE x (SomeP T y) = PURE x' (SomeP T y') -> x=x' /\ y=y'.
Lemma core_resource_at: forall w i, core (w @ i) = core w @ i.
End Rmaps_Lemmas.