simplify env and finish substitution lemma