Meta-analysis of type theories with an application to the design of formal proofs : doctoral thesis