proposition: Lemma subst_exp_open_exp_wrt_exp : forall e3 e1 e2 x1, lc_exp e1 -> [x1 ~> e1] (open e3 e2) = open ([x1 ~> e1] e3) ([x1 ~> e1] e2).
proof: Proof. Admitted. Lemma subst_var : forall (x y : var) u e, y <> x -> lc_exp u -> ([x ~> u] e) ^ y = [x ~> u] (e ^ y). Proof. intros x y u e Neq H. rewrite subst_exp_open_exp_wrt_exp with (e2 := var_f y); auto. rewrite subst_neq_var; auto. Qed.
imports: Metalib.Metatheory Stlc.Definitions String