Formalization of Dependent Type Theory: The Example of CaTT