Module R := R0.

(* Specifications: *)
Lemma approx_p : forall (p:pred rmap) n w, approx n p w -> p w.
Lemma approx_lt : forall (p:pred rmap) n w, lt (level w) n -> p w -> approx n p w.
Lemma approx_ge : forall p n w, ge (level w) n -> approx n p w -> False.
Lemma ageN_level : forall n (phi1 phi2 : rmap), ageN n phi1 = Some phi2 -> level phi1 = (n + (level phi2))%nat.
Lemma NO_identity: forall nsh, identity (NO Share.bot nsh).
Lemma PURE_identity: forall k pds, identity (PURE k pds).
Lemma identity_NO: forall r, identity r -> r = NO Share.bot bot_unreadable \/ exists k, exists pds, r = PURE k pds.
Lemma make_rmap': forall f g, exists phi: rmap', phi = (f, g).
Lemma make_rmap (f: AV.address -> resource) g (n: nat) (H: resource_fmap (approx n) (approx n) oo f = f) (HG: ghost_fmap (approx n) (approx n) g = g) : {phi: rmap | level phi = n /\ resource_at phi = f /\ ghost_of phi = g}.
Lemma make_rmap'': forall n (f: AV.address -> resource) g, exists phi:rmap, level phi = n /\ resource_at phi = resource_fmap (approx n) (approx n) oo f /\ ghost_of phi = ghost_fmap (approx n) (approx n) g.
Lemma approx_oo_approx': forall n n', (n' >= n)%nat -> approx n oo approx n' = approx n.
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 preds_fmap_fmap: forall f1 f2 g1 g2 pp, preds_fmap f1 f2 (preds_fmap g1 g2 pp) = preds_fmap (f1 oo g1) (g2 oo f2) pp.
Lemma ghost_fmap_fmap: forall f1 f2 g1 g2 r, ghost_fmap f1 f2 (ghost_fmap g1 g2 r) = ghost_fmap (f1 oo g1) (g2 oo f2) r.
Lemma ghost_same_level: forall g phi, join_sub g (ghost_of phi) -> ghost_fmap (approx (level phi)) (approx (level phi)) g = g.
Lemma unsquash_inj : forall x y, unsquash x = unsquash y -> x = y.
Lemma resource_fmap_fmap: forall f1 f2 g1 g2 r, resource_fmap f1 f2 (resource_fmap g1 g2 r) = resource_fmap (f1 oo g1) (g2 oo f2) r.
Lemma ghost_of_approx: forall phi, ghost_fmap (approx (level phi)) (approx (level phi)) (ghost_of phi) = ghost_of phi.
Lemma ghost_same_level_gen: forall n a b c, join (ghost_fmap (approx n) (approx n) a) (ghost_fmap (approx n) (approx n) b) c -> ghost_fmap (approx n) (approx n) c = c.
Lemma ghost_of_join: forall phi1 phi2 phi3, join phi1 phi2 phi3 -> join (ghost_of phi1) (ghost_of phi2) (ghost_of phi3).
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 ex_level0: exists phi, age1 phi = None.
Lemma ex_level: forall n, exists phi, level phi = n.
Lemma YES_join_full: forall sh rsh n P r2 r3, join (R.YES sh rsh n P) r2 r3 -> writable0_share sh -> exists sh2 rsh2, r2 = NO sh2 rsh2.
Lemma YES_not_identity: forall sh rsh k Q, ~ identity (YES sh rsh k Q).