Topics in selective inference and its application to instrumental variables