0
为什么我不能确定异质平等这样一个更为明确的版本:为什么我不能在Agda中只使用索引定义`Eq`?
data Eq : (A : Set) -> A -> A -> Set where
Refl : (T : Set) -> (x : T) -> Eq T x x
当我这样做,我得到以下错误:
The type of the constructor does not fit in the sort of the
datatype, since Set₁ is not less or equal than Set
when checking the constructor Refl in the declaration of Eq
我知道这个错误有什么与宇宙的层面有关,但我不知道究竟是什么。它认为Eq T x x
应该是Set_1
,或者它是,但它不应该是?为什么这里有任何东西Set_1
?
它是'Set1',因为你的构造函数量化了'Set'。 – Vitus
检查[Agda Wiki](http://wiki.portal.chalmers.se/agda/pmwiki.php?n=ReferenceManual.UniversePolymorphism)(尽管它包含一些有误导性的说法:“(n:Level)→Set n '不属于任何宇宙,但它属于一个宇宙 - 超级宇宙(http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.221.1318&rep=rep1&type=pdf)你不能从Agda内部访问,但它存在于元素中)。 – user3237465
此外,由于Agda在数据声明中执行了某种形式的woodoo wrt universe级别,但是我无法找到任何关于此的详细信息。 – user3237465