Ltac destruct_match H :=
match type of H with
| context [ match ?x with _ => _  end] => destruct x eqn:?
end.

Lemma exprD'_App_R_typ (e1 e2 : expr typ func) tus tvs ty1 ty2 v: exprD' tus tvs ty2 (App e1 e2) = Some v -> typeof_expr tus tvs e2 = Some ty1 -> (exists v1 , exprD' tus tvs (tyArr ty1 ty2) e1 = Some v1) /\ (exists v2, exprD' tus tvs ty1 e2 = Some v2).