(* this suggest capturing the pattern by means of a new definition *)

Definition after A s (p : proc A) (P : A -> state -> Prop) := 
  always s p (fun s2 p2 => forall v, p2 = Ret v -> P v s2).

Lemma aftA A B s (p : proc A) (P : B -> A -> state -> Prop) : alwsafe s p -> (after s p (fun v s' => forall x, P x v s') <-> forall x, after s p (fun v s' => P x v s')).