Lehrer, a Harvard-trained mathematician, wrote darkly humorous songs, often with political connotations.