Definition isVAL (r : resource) :=
  match r with
  | YES _ _ (VAL _) _ => Logic.True
  | _ => False
  end.

Lemma pures_same_necR phi1 phi2 phi1' : level phi1 = level phi2 -> pures_same phi1 phi2 -> necR phi1 phi1' -> exists phi2', level phi1' = level phi2' /\ pures_same phi1' phi2' /\ necR phi2 phi2'.