Dependent types I › Rules of inference › Structural rules [01D0]
- August 11, 2025
- Jon Sterling
In type theory, the structural rules mainly ensure that judgemental equality behaves correctly. From a certain point of view, these rules are redundant (because without them, judgemental “equality” it wouldn’t be equality, etc.!), but we include them for the sake of explicitness. Recalling our warning, note and do not fear the fact that different presentations of type theory will organise these rules differently or may even choose different sets of rules. There are many roads to Rome.
Judgemental equality is an equivalence relation [01D1]
- August 11, 2025
- Jon Sterling
We have the following rules of inference witnessing that judgemental equality is an equivalence relation:
- Reflexivity.
- Given A~\mathit {type} we may assert A\equiv A~\mathit {type}.
- Given A~\mathit {type} and u:A, we may assert u\equiv u:A.
- Transitivity.
- Given A,B,C~\mathit {type} such that A\equiv B~\mathit {type} and B\equiv C~\mathit {type}, we may assert A\equiv C~\mathit {type}.
- Given A~\mathit {type} and u,v,w:A such that u\equiv v:A and v\equiv w:A, we may assert u\equiv w:A.
- Symmetry.
- Given A,B~\mathit {type} such that A\equiv B~\mathit {type}, we may assert B\equiv A~\mathit {type}.
- Given A~\mathit {type} and u,v:A such that u\equiv v:A, we may assert v\equiv u:A.
Typing respects equality [01D2]
- August 11, 2025
- Jon Sterling
Another important rule of equality is that equal types have the same elements; this is sometimes called the “conversion rule”. In particular:
- Given A,B~\mathit {type} and u:A such that A\equiv B~\mathit {type}, we may assert u:B.
- Given A,B~\mathit {type} and u,v:A such that A\equiv B~\mathit {type} and u\equiv v:A, we may assert u\equiv v:B.
This is rendered like so in short-hand:
\frac { A\equiv B~\mathit {type} \quad u:A }{ u:B } \qquad \frac { A\equiv B~\mathit {type} \quad u\equiv v:A }{ u\equiv v:B }Substitutivity of judgemental equality [01D6]
- August 11, 2025
- Jon Sterling
The following rules express the sense in which hypothetical judgments respect judgemental equality.
- Given A~\mathit {type} and x:A\vdash B[x]~\mathit {type} and u,v:A such that u\equiv v:A, we may assert B[u]\equiv B[v]~\mathit {type}.
- Given A~\mathit {type} and x:A\vdash B[x]~\mathit {type} and x:A\vdash w[x]:B[x] and u,v:A such that u\equiv v:A, we may assert w[u]\equiv w[v]:B[u].
We have written the rules “long-hand”, but a theoretician may write these in the following short-hand notation:
\frac { x:A\vdash B[x]~\mathit {type} \quad u\equiv v:A }{ B[u]\equiv B[v]~\mathit {type} } \frac { x:A\vdash B[x]~\mathit {type} \quad x:A\vdash w[x]:B[x] \quad u\equiv v:A }{ w[u]\equiv w[v]:B[u] }As you can see, it is common when in a hurry to leave out all some of the obvious premises (for example, the premises A~\mathit {type} and u,v:A in the first rule). From the perspective of this course, these premises are “actually” secretly present; when someone writes a rule like this, they are relying on a shared expectation of good faith—that they would never intentionally write down a judgement that is meaningless, and so if the necessary presuppositions are omitted, these are intended to be filled in by the reader.
Note: we could have added a rule coverning hypothetical judgements of the form X~\mathit {type}\vdash B[x]~\mathit {type}, etc., such judgements do not usually arise in dependent type theory, so we ignore it.
Exercise Rule golf [01D7]
- August 11, 2025
- Jon Sterling
Imagine that we had omitted the transitivity and symmetry rules for judgemental equality. Devise a single rule that handles both transitivity and symmetry simultaneously.