substitution_preserves_typing proven