rewrite R.unsquash_squash.
simpl.
apply extensionality; intro l.
unfold compose; simpl; auto.
Qed.

(* Specifications: *)
Lemma comparable_level : forall phi1 phi2 : rmap ,
comparable phi1 phi2 -> level phi1 = level phi2.
Lemma ageN_level : forall n (phi1 phi2 : rmap),
ageN n phi1 = Some phi2 -> level phi1 = (n + (level phi2))%nat.
Lemma NO_identity: identity NO.
Lemma PURE_identity: forall k pds, identity (PURE k pds).
Lemma identity_NO:
forall r, identity  r -> r = NO \/ exists k, exists pds, r = PURE k pds.
Lemma age1_resource_at_identity:
forall phi phi' loc, age1 phi = Some phi' ->
identity (phi@loc) ->
identity (phi'@loc).
Lemma unage1_resource_at_identity:
forall phi phi' loc, age1 phi = Some phi' ->
identity (phi'@loc) ->
identity (phi@loc).
Lemma necR_resource_at_identity:
forall phi phi' loc, necR phi phi' ->
identity (phi@loc) ->
identity (phi'@loc).
Lemma make_rmap': forall f, AV.valid (fun l => res_option (f l)) ->
exists phi: rmap', proj1_sig phi = f.
Lemma make_rmap (f: AV.address -> resource) (V: AV.valid (res_option oo f))
(n: nat) (H: resource_fmap (approx n) oo f = f) :
{phi: rmap | level phi = n /\ resource_at phi = f}.
Lemma make_rmap'':
forall n (f: AV.address -> resource) ,
AV.valid (fun l => res_option (f l)) ->
exists phi:rmap, level phi = n /\ resource_at phi = resource_fmap (approx n) oo f.