3
$\begingroup$

From the nlab article on Martin-Löf dependent type theory:

The weakening and substitution rules are admissible rules: they do not need to be explicitly included in the type theory as they could be proven by induction on the structure of all possible derivations.

Similarly, exercise E2.7 from the classic article "Syntax and Semantics of Dependent Types" by Martin Hofmann:

Show that for any type theory containing some or all of the type formers described above the rules Weak and Subst are admissible.

This was actually where, coming from the mathematical side, I prematurely ended my last incursion into type theory.

Now, in the hope to establish an entry point for anyone in a similar position: There must be a clear write-up of this somewhere, as it seems pointless to continue into type theory without having solved a point as fundamental as that. Is it just me or is this really nowhere to be found on the net?

I would appreciate answers demonstrating the admissibility of the aforementioned rules, or pointers to relevant sources. This is less about the results for their own sake than about seeing type theory at work supporting itself before serving as a foundation for other things. The scarcity (?) of hands-on demonstrations in this vein seems a major roadblock to entering the field, at least trustwise. It could be removed easily by material just plainly showing how these fundamental aspects are handled at a basic level (one that should really be routine for a seasoned type theorist?). Thanks!

$\endgroup$
10
  • $\begingroup$ What are you actually asking for? A detailed proof that weakening and substitution are admissible or an explanation of what admissible means? $\endgroup$
    – Max New
    Commented Aug 27 at 11:43
  • $\begingroup$ Thanks for answering! The former. I suspect the reason this seems so hard to come by is that a detailed writeup would probably quite long...but also quite instructive for a beginner. $\endgroup$
    – Michael
    Commented Aug 27 at 12:18
  • $\begingroup$ "it seems pointless to continue into type theory without having solved a point as fundamental as that" It depends on what your goal is. For using type theory, you certainly do not need to worry about such details of presentation and should just assume that weakening and substitution are available. $\endgroup$ Commented Aug 27 at 12:21
  • $\begingroup$ Quoting Jon Sterling: "Category theorists like to think of things in terms of maps, that can then be composed (which is the primitive operation). Type theorists think about things differently — in terms of generalised elements. These two viewpoints lead to different presentations of syntax — in the former you have a built in substitution construct, and in the latter, substitution is admissible. But in the end, the “complete” versions of either presentation are equivalent." $\endgroup$ Commented Aug 27 at 12:23
  • $\begingroup$ For one to be able to think about "things" in different ways may be enlightening for the initiated, but given that type theory is advertised as a foundational system it may even be disconcerting - until you are capable of making the equivalence between different views precise. As a beginner, I think it would help if you saw type theory support itself a bit before basing other things on it. $\endgroup$
    – Michael
    Commented Aug 27 at 12:35

2 Answers 2

2
$\begingroup$

I disagree with the premise that not having a full proof of the admissibility of substitution spelt out anywhere is a "major roadblock" to entering the field of type theory, at least as a user; but anyway, the reason it is not usually spelt out is that it is incredibly tedious and devoid of any mathematical content. Whether substitution is built-in or admissible is nothing more than an implementation detail.

As an example, assume we have $\Gamma \vdash t : X$, and let us try to prove that type substitution is admissible, i.e.

$$\frac{\Gamma, x : X, \Delta \vdash T\text{ type}}{\Gamma, \Delta[t/x] \vdash T[t/x]\text{ type}}$$

We proceed by structural induction on the premise. Let us only look at one case: the formation rule for dependent pair types, which has the following form here.

$$\frac{\Gamma, x : X, \Delta \vdash A\text{ type} \quad \Gamma, x : X, \Delta, a : A \vdash B\text{ type}}{\Gamma, x : X, \Delta \vdash \sum\limits_{a : A} B\text{ type}}$$

The induction hypothesis gives us the substituted judgements

$$\Gamma, \Delta[t/x] \vdash A[t/x]\text{ type} \qquad \Gamma, \Delta[t/x], a : A[t/x] \vdash B[t/x]\text{ type}$$

whence we conclude by the formation rule for dependent pair types

$$\Gamma, \Delta[t/x] \vdash \sum_{a : A[t/x]} B[t/x]\text{ type}$$

and that's it. It might seem like we haven't done anything at all, but it's useful to have in mind that (and how) alternative presentations of type theory can fail to have admissible substitution.

For instance, the nLab page on dependent sum types gives the following introduction rule:

$$\frac{\Gamma \vdash A\text{ type} \quad \Gamma, a : A \vdash B\text{ type}}{\Gamma, a : A, b : B \vdash (a, b) : \sum\limits_{a : A} B}$$

instead of the more conventional

$$\frac{\Gamma \vdash A\text{ type} \quad \Gamma, a : A \vdash B\text{ type} \quad \Gamma \vdash u : A \quad \Gamma \vdash v : B[u/a]}{\Gamma \vdash (u, v) : \sum\limits_{a : A} B}$$

effectively restricting the pair constructor to variables. In this presentation, term substitution is not admissible, so we would have to add a built-in substitution rule.

Indeed, if we tried the same proof by induction as above, we would need to unify $\Gamma, x : X, \Delta$ with $\Gamma, a : A, b : B$; this is fine as long as $a$ and $b$ end up in $\Delta$, but if $x = a$ or $x = b$ then the proof can't go through. Intuitively, substituting $t$ for $a$ or $b$ in $(a, b)$ would now result in an ill-typed term unless $t$ is a variable.

$\endgroup$
2
  • $\begingroup$ This is actually fantastically helpful already, thank you for now. It has been a while, so I will have to think about this, to figure out the base cases even. I hope for a lot more trust-building tedium $\endgroup$
    – Michael
    Commented Aug 27 at 18:03
  • $\begingroup$ If someone wants to add more in the meantime, please go ahead. Chances are that for quite some readers these things will be seen spelt out in full for the first time (unless they have hit upon the right sources outside my knowledge. (Please share:) )) $\endgroup$
    – Michael
    Commented Aug 27 at 18:17
5
$\begingroup$

The proofs you are asking for are rarely found in published papers, at least not detailed versions, because an experienced reader is able to reconstruct them easily enough. They always proceed by some sort of structural induction, usually on the derivation of the judgement. The trickiest bit, always, is how to strengthen the induction hypothesis. That is, the statement we usually want to prove cannot be proven directly by induction, instead one looks for a sligthly stronger statement that does. (For instance in Naïm's answer he strengthened the substitution rule so that also part of the context undergoes a substitution, which is necessary as soon as one considers a rule that introduces a new variable into the context in one of its premises.)

The place to look are PhD theses, these more commonly contain detailed proofs. My student Philipp Haselwarter produced detailed proofs for a wide class of type theories, see Effective Metatheory for Type Theory:

  • Admissibility of weakening is Proposition 2.2.2. Note that when Philipp says that "most cases are straightforward" this actually means that by the time you write them down you also see that they hold because nothing is going on, one literally just applies the induction hypothesis.
  • Admissibility of substitution is in Section 2.1.1.1. This is more complicated, it's a whole section.
  • There are other admissibility results, for example, if you can derive that $e$ has type $A$, then you should be able to derive that $A$ is a type, yes? That's Theorem 2.2.18.

This is not the only thesis containing such results (although I would be hard pressed to point to another one that achieves this level of generality), it's just one that I know well, as an advisor. We can go one step further and ask for formalized proofs of admissibility etc. I am not sure a comprehensive library is available, if someone knows of one, I'd like to know too.

But most importantly, Naïm has a point. Wittgensteing wrote:

6.54 My propositions are elucidatory in this way: he who understands me finally recognizes them as senseless, when he has climbed out through them, on them, over them. (He must so to speak throw away the ladder, after he has climbed up on it.) He must surmount these propositions; then he sees the world rightly.

To bring this down to earth and closer to the present case: yes, it is elucidatory to work out the details of the syntax of type theory and belabor the syntactic meta-theorems involving renamings and substitution – but these are just a "ladder" one climbs to arrive at a better, mathematically more meaningful, understanding of what type theory is and how it works. So, after reading Philipp's thesis, you should read Ambrus Kaposi's thesis, and Jon Sterling's thesis, too :-)

$\endgroup$
2
  • $\begingroup$ Philipp Haselwarter's thesis is definitely on my (unfortunately quite long) to do list- I already bounced from it once with the new commitment of learning about de Bruijn-Indices. Also, to start climbing and use type theory oneself I feel there is no substitute for seeing it at work, replicating the experience in math where you observe the newly defined entities behave and relate in the arena provided by the proofs that follow. The dearth is in reasonably selfcontained instances of this being done in type theory; admissibility seemed the first nontrivial thing to do in such a buildup $\endgroup$
    – Michael
    Commented Aug 28 at 9:28
  • $\begingroup$ One issue here is that there are several conceptions of what "type theory" is, and that the very syntactic presentations of it that you are asking about are sometimes seen as "suboptimal". It's like matrices vs. abstract linear algebra. Each has its own uses, but if one is going to learn linear algebra, it's a bad idea to obsess about matrices. $\endgroup$ Commented Aug 28 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.