是否存在一种类型理论,其中可以表示相同形状的归纳数据类型的等价性?
Is there a type theory in which the equivalence of identically shaped inductive datatypes is representable?
假设我有两个归纳定义的数据类型:
Inductive list1 (A : Type) : Type :=
| nil1 : list1 A
| cons1 : A -> list1 A -> list1 A.
和
Inductive list2 (A : Type) : Type :=
| nil2 : list2 A
| cons2 : A -> list2 A -> list2 A.
对于任何 P (list1 a)
我应该能够构造一个 P (list2 a)
,通过应用我用来构造 P (list1 a)
的完全相同的方法,除了将 nil1
替换为 nil2
、list1
与 list2
和 cons1
与 cons2
。类似地,任何将 list1 a
作为参数的函数都可以扩展为采用 list2 a
.
是否有类型系统允许我以这种方式谈论具有相同形状(具有相同形状的构造函数)的两种数据类型,并证明 P (list1 a) -> P (list2 a)
?例如,这是单价、HOTT 或 cubical/observational 类型系统允许的吗?它还可能允许定义像 reverse: list_like a -> list_like a
这样接受 list1
s 和 list2
s 作为参数的函数。
假设我有两个归纳定义的数据类型:
Inductive list1 (A : Type) : Type :=
| nil1 : list1 A
| cons1 : A -> list1 A -> list1 A.
和
Inductive list2 (A : Type) : Type :=
| nil2 : list2 A
| cons2 : A -> list2 A -> list2 A.
对于任何 P (list1 a)
我应该能够构造一个 P (list2 a)
,通过应用我用来构造 P (list1 a)
的完全相同的方法,除了将 nil1
替换为 nil2
、list1
与 list2
和 cons1
与 cons2
。类似地,任何将 list1 a
作为参数的函数都可以扩展为采用 list2 a
.
是否有类型系统允许我以这种方式谈论具有相同形状(具有相同形状的构造函数)的两种数据类型,并证明 P (list1 a) -> P (list2 a)
?例如,这是单价、HOTT 或 cubical/observational 类型系统允许的吗?它还可能允许定义像 reverse: list_like a -> list_like a
这样接受 list1
s 和 list2
s 作为参数的函数。