Definition identity_rmap' : R.rmap' := exist valid (fun _: AV.address => R.NO) AV.valid_empty.Definition identity_rmap (n:nat) : rmap := R.squash (n, identity_rmap').

(* Specifications: *)
Lemma identity_level : forall n, level (identity_rmap n) = n.
Lemma snd_identity_map : forall n, proj1_sig (snd (R.unsquash (identity_rmap n))) = fun _ => R.NO .
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 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.
Lemma approx_oo_approx': forall n n', (n' >= n)%nat -> approx n oo approx n' = approx n.
Lemma approx_oo_approx: forall n, approx n oo approx n = approx n.
Lemma approx_approx' n n' x : (n' >= n)%nat -> approx n (approx n' x) = approx n x.
Lemma unsquash_inj : forall x y, unsquash x = unsquash y -> x = y.
Lemma ageN_squash : forall d n rm, le d n -> ageN d (squash (n, rm)) = Some (squash ((n - d)%nat, rm)).
Lemma unageN: forall n (phi': rmap), exists phi, ageN n phi = Some phi'.
Lemma YES_join_full: forall n P r2 r3, join (R.YES pfullshare n P) r2 r3 -> r2 = NO.
Lemma YES_not_identity: forall sh k Q, ~ identity (YES sh k Q).