Is there a type theory in which the equivalence representability of identically formed inductive data types?

Say I have two inductively defined data types:

Inductive list1 (A : Type) : Type :=
 | nil1 : list1 A
 | cons1 : A -> list1 A -> list1 A.

and

Inductive list2 (A : Type) : Type :=
 | nil2 : list2 A
 | cons2 : A -> list2 A -> list2 A.

For anyone, P (list1 a)I should be able to build P (list2 a)using the same method that I used to build P (list1 a), instead of replacing nil1with nil2, list1with, list2and cons1with cons2. Similarly, any function that takes list1 aas a parameter can be extended to accept a list2 a.

Is there a type system that allows me to talk about two types of data having the same shape in this way (with constructions of the same shape) and prove it P (list1 a) -> P (list2 a)? For example, is that what allows for uniqueness, HOTT or a cubic / observational type system? It can also allow you to define functions such as reverse: list_like a -> list_like athat take both list1and list2as parameters.

+6
source share
1 answer

HoTT , list1 A list2 A A. p : list1 A = list2 A ( subst) P (list1 a) -> P (list2 a) P. , . , (CCHM cartesian) , . cubicaltt - ( ) .

+6

All Articles