Typability and Type Checking in the Second-Order lambda-Calculus Are Equivalent and Undecidable
J. B. Wells
Dept. of Computer Science; Boston University
Boston, MA 02215, USA
We consider the problems of typability and type checking in the Girard/Reynolds second-order polymorphic typed-calculus, for which we use the short name "System F" and which we use in the "Curry style" where types are assigned to pure-terms. These problems have been considered and proven to be decidable or undecidable for various restrictions and extensions of System F and other related systems, and lower-bound complexity results for System F have been achieved, but they have remained "embarrassing open problems" 3 for System F itself. We first prove that type checking in System F is undecidable by a reduction from semi-unification. We then prove typability in System F is undecidable by a reduction from type checking. Since the reverse reduction is already known, this implies the two problems are equivalent. The second reduction uses a novel method of constructing-terms such that in all type derivations, specific bound variables must always be assigned a specific type. Using this technique, we can require that specif subterms must be typable using a specific, fixed type assignment in order for the entire term to be typable at all. Any desired type assignment maybe simulated. We develop this method, which we call \constants for free", for both the K and I calculi.