My question is twofold:
- How do you define consistency (analogously to the concept in first-order logic) in the context of a type theory?
- Are there any tools that can check consistency?
I have seen a few type theories, such as the systems described in the lambda cube, described using typing rules like the following.
$$ \frac{\Gamma \vdash e_1 : \sigma \to \tau \;\;\text{and}\;\; \Gamma \vdash e_2 : \sigma}{\Gamma \vdash e_1(e_2) : \tau} \;\; \text{is implication elimination in STLC} $$
I have a vague, intuitive sense of what consistency might mean for a type system. I don't know the true definition of consistency here. I'm offering up two examples (that are possibly incoherent) in an attempt to illustrate the concept I am interested in.
I think but am not certain we can define consistency as the existence of two things:
- inductive translation into the untyped lambda calculus that preserves and reflects the binary relation $=_{\alpha\beta\eta}$.
- every well-typed term beta-reduces to a value.
Also, and I'm speculating here, I think we could define consistency as having a semantics-preserving transformation into $\mathsf{ZFC}$ for well-typed terms. The well-foundedness of $\mathsf{ZFC}$ would stop us from constructing an infinite loop (assuming function application is defined in the usual set-theoretic way (i.e. functions are sets of Kuratowksi pairs and application is unioning together all the right elements of pairs with a given left element)).
For concreteness, here is application in $\mathsf{ZFC}$. $\pi_1$ and $\pi_2$ are projections out of a Kuratowski pair.
$$ f(x) := \bigcup \{\pi_2(p) : p \in f \land \pi_1(p) = x \} $$
I'm also curious if there are any tools that let you express a type theory as its set of typing rules (in some notation) and then either prove that it's consistent or test it experimentally to see what kinds of properties it has.
So, how exactly do you define consistency (or the equivalent concept) for a type system and are there any tools that can check it for you?