sel case needs helper lemmas. output var issue in fun