【发布时间】:2016-02-01 20:22:41
【问题描述】:
我正在学习同伦类型理论 (HoTT) 及其与 COQ 的关系。
尤其是身份类型的路径归纳概念对我来说还是很神秘的。
因此,我用 COQ 做了一些实验。
让我们从一个使用路径归纳的标准相等类型的简单引理开始:
Lemma eq_sym: forall (x y:nat), x = y -> y = x.
intros.
apply (match H in (_ = y0) return y0 = x with eq_refl => eq_refl end).
Defined.
现在让我们看看这是否是对 COQ "eq" 类型的特殊处理。因此,让我们用一个类似的对称引理定义一个新的相等类型(仅适用于 nat):
Inductive est (x : nat) : nat -> Prop :=
est_refl: est x x.
Lemma est_sym: forall (x y:nat), est x y -> est y x.
intros.
apply (match H in (est _ y0) return est y0 x with est_refl => est_refl x end).
Defined.
好的,这与标准“=”类型的工作方式相同。
现在让我们概括一下:
Inductive tri (x : nat) : nat->nat->Prop :=
tri_refl: tri x x x.
Lemma tri_sym: forall (x y z:nat), tri x y z -> tri z x y.
intros.
apply (match H in (tri _ y0 z0) return tri z0 x y0 with tri_refl => tri_refl x end).
Defined.
我的问题是:
这与HoTT理论有什么关系?
这是不是 HoTT 的一部分的广义路径归纳吗?
【问题讨论】:
标签: coq