Section memstepN.
Context {C:Type} (M:@MemSem C).
induction n; intros; inv H.
apply mem_step_refl.
destruct H0 as [m'' [CS CSN]]. eapply mem_step_trans.
eapply corestep_mem; eassumption.
eapply IHn; eassumption.
Qed.
destruct H as [n H]. eapply corestepN_mem; eassumption. Qed.
destruct H as [n H]. eapply corestepN_mem; eassumption. Qed.
apply corestepN_mem in H. apply HP; trivial. Qed.
destruct H. apply (memsem_preservesN _ HP) in H; trivial. Qed.
destruct H. apply (memsem_preservesN _ HP) in H; trivial. Qed.

Lemma corestep_star_rdonly c m c' m'
(CS:corestep_star M c m c' m')b (VB:Mem.valid_block m b): readonly m b m'.