Irrelevance, Polymorphism, and Erasure in Type Theory