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

Lemma join_pures_same phi1 phi2 phi3 : join phi1 phi2 phi3 -> pures_same phi1 phi2 /\ pures_same phi2 phi3 /\ pures_same phi1 phi3.