Definition pures_sub (phi phi' : rmap) :=
forall adr,
match resource_at phi adr with
| PURE k pp => resource_at phi' adr
= PURE k (preds_fmap (approx (level phi')) (approx (level phi')) pp)
| _ => True
end.

(* Specifications: *)
Lemma pures_sub_trans phi1 phi2 phi3 :
(level phi3 <= level phi2)%nat ->
pures_sub phi1 phi2 ->
pures_sub phi2 phi3 ->
pures_sub phi1 phi3.
Lemma pures_sub_refl phi : pures_sub phi phi.
Definition pures_eq (phi phi' : rmap) :=
pures_sub phi phi' /\
(forall adr,
match resource_at phi' adr with
| PURE k pp' => exists pp, resource_at phi adr = PURE k pp
| _ => True
end).
Lemma pures_eq_refl phi : pures_eq phi phi.
Lemma pures_eq_trans phi1 phi2 phi3 :
level phi3 <= level phi2 ->
pures_eq phi1 phi2 ->
pures_eq phi2 phi3 ->
pures_eq phi1 phi3.