(** Injections on registers *)

  Definition reg_ren f (r:PregEq.t) (rs rs' : regset) : Prop :=
    val_obs f (Pregmap.get r rs) (Pregmap.get r rs').Definition regset_ren f rs rs' : Prop :=
    forall r, reg_ren f r rs rs'.Definition core_inj f c c' :=
    match c, c' with State rs _, State rs' _ => regset_ren f rs rs' end.

Lemma core_inj_after_ext : forall the_ge c cc c' (ov1 : option val) m m' (f fg : memren) (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg the_ge) (Hincr: ren_incr fg f), core_inj f c c' -> mem_obs_eq f m m' -> match ov1 with | Some v1 => valid_val f v1 | None => True end -> semantics.after_external (Asm_core_sem the_ge) ov1 c m = Some cc -> exists (ov2 : option val) (cc' : state), semantics.after_external (Asm_core_sem the_ge) ov2 c' m' = Some cc' /\ core_inj f cc cc' /\ match ov1 with | Some v1 => match ov2 with | Some v2 => val_obs f v1 v2 | None => False end | None => match ov2 with | Some _ => False | None => True end end.