(********************* Lemmas and definitions related to mem_step ********)
apply (mem_step_freelist _ _ nil); trivial.
Qed.
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'
}.
subst; trivial. Qed.
intros. apply preserve_mem; trivial.
eapply mem_forward_preserve; trivial.
Qed.

Theorem preserves_max_eq_or_free:
memstep_preserve (fun m m' =>  mem_forward m m' /\
forall b (VB: Mem.valid_block m b) ofs,
(forall k p, Mem.perm m b ofs k p <-> Mem.perm m' b ofs k p) \/
(Mem.perm m b ofs Max Freeable /\
Mem.perm_order'' None ((Mem.mem_access m') !! b ofs Max))).