(** A compilation environment (mapping) is valid in a given state if
  the registers associated with Cminor local variables and let-bound variables
  are valid in the state. *)

Definition map_valid (m: mapping) (s: state) : Prop :=
  forall r, reg_in_map m r -> reg_valid r s.

Lemma add_var_letenv: forall map1 id s1 r map2 s2 i, add_var map1 id s1 = OK (r, map2) s2 i -> map2.(map_letvars) = map1.(map_letvars).