theorem about ends