Record memstep_preserve (P:mem -> mem -> Prop) :=
{
preserve_trans: forall m1 m2 m3, P m1 m2 -> P m2 m3 -> P m1 m3;
preserve_mem: forall m m', mem_step m m' -> P m m'
}.

(*opposite direction appears not to hold*)
Theorem preserve_impl {A} (P:A -> mem -> mem -> Prop) (Q:A->Prop):
(forall a, Q a -> memstep_preserve (P a)) -> memstep_preserve (fun m m' => forall a, Q a -> P a m m').