Description: Define the type function in a Metamath formal system. (Contributed by Mario Carneiro, 14-Jul-2016)