Closed Ailrun closed 4 months ago
Or maybe what we need is a more lenient judgement than type subsumption so that we indeed have (directed) uniqueness modulo that judgement.
It is actually easier to define such a judgement (that subsumes type subsumption) for completeness
We do not really have type uniqueness because of cumulativity, but we at least need the following:
Why? Let's think about the following type inference process for application
M N
:A
ofM
underG
B
andC
satisfyingG |- Π B C ≈ A : Type@i
for somei
N
whether it is ofB
underG
C[Id,,N]
The problem here is on step 3. What if
N
is not ofB
? To get a complete algorithm, we need to showHowever, without the theorem (1) above, we don't know if there is
G |- M : Π B' C'
whileG |- N : B'
is also true (and if this is the case (2) is not true and the algorithm is incomplete)I think (1) can be proved by the normal form of a function. Our lambda syntax contain a type annotation for its argument, and that should guarantee the equivalence between all possible types.(this isn't the case)