Once I needed to write a proof of permutation transitivity in Idris. I’m not smart enough to write it myself, but I found a proof in Agda and translated it to Idris in 20 minutes. https://github.com/stepancheg/idris-sort/blob/master/PermHar...
Ref: https://cs.stackexchange.com/questions/122066/does-the-under...
To answer you more directly, one starts with the most powerful system, the lambda calculus and then one restricts its power using types. Finding the goldilocks zone of the right amount of power is one of the primary things type theory research has been about. Type theories vary in decidability, those that aren't decidable aren't usually used for theorem provers or as substrata for programming languages.
https://www.acm.org/articles/bulletins/2020/march/dl-access-...