In the HOTT book, p. 433 (Appendix A.2.2), we have a congruence rule with the three following premises:
- $\Gamma \vdash A : \mathcal{U}_i$
- $\Gamma, x : A \vdash B : \mathcal{U}_i$
- $\Gamma, x : A \vdash b \equiv b' : B$
and the following conclusion: $\Gamma \vdash \lambda x. b \equiv \lambda x. b' : \prod_{(x : A)} B$. I am wondering why we have premises 1 and 2 while these premises are absent in the introduction rule of $\Pi$ (p. 434, Appendix A.2.4). I noticed that we have these premises in the formation rule of $\Pi$ (p. 434, Appendix A.2.4) to conclude that $\prod_{(x : A)} B$ has type $\mathcal{U}_i$ but, since they are absent from the introduction rule, I thought that in absence of premises 1 and 2, we would only have $\prod_{(x : A)} B : \mathcal{U}_k$ for some $k$, which would be enough to state the congruence rule in the same manner we are able to state the introduction rule. So, why do we need premises 1 and 2 for the congruence rule and not for the introduction rule?
Sigma
, in say Lean, with#print Sigma
and#print Sigma.rec
. Then they can compare to the presentations in the HoTT book (and notice how Lean includes all the presuppositions likeα : Type u
). But I do see your point that this isn't really the same as the rules of the type theory, and they also can't see rules for built in types like Pi types and for definitional equality. $\endgroup$lean.mm1
contains Lean's DTT foundations. The code is remarkably readable. The rules most closely related to the examples in this question are axiomsty_lambda
,ty_Pi
, andconv_lambda
. I was surprised to see that the formal presentation inlean.mm1
omits the presuppositions. (Although, I guess there could be bugs since none of the very few examples use these 3 axioms.) $\endgroup$