(* ----------------- nom_envsubst reductions ------------------- *)
(* We can think of a an environment as a multi-substitution for locally nameless terms.  Therefore, the nom_envsubst function inherits many of the properties of the subst_exp function.  *)

(* Specifications: *)
Lemma nom_envsubst_open : forall rho e e',
(forall v, lc_exp (nom_val_to_exp v)) ->
(nom_envsubst rho (open e e')) = (open (nom_envsubst rho e) (nom_envsubst rho e')).
Lemma nom_envsubst_fresh_eq : forall rho e,
closed_env rho ->
fv_exp e [=] {} ->
nom_envsubst rho e = e.
Lemma nom_envsubst_var : forall x rho e rho',
closed_env rho ->
Some (e,rho') = rho_lookup x rho ->
nom_envsubst rho (var_f x) = nom_envsubst rho' (nom_to_exp e).
Lemma nom_envsubst_abs : forall rho e,
nom_envsubst rho (abs e) = abs (nom_envsubst rho e).
Lemma nom_envsubst_app : forall rho e1 e2,
nom_envsubst rho (app e1 e2) = app (nom_envsubst rho e1) (nom_envsubst rho e2).