| 1 |
Set Universe Polymorphism. |
| 2 |
Inductive Box@{s; u} (A : Type@{u}) : Type@{s; u} := box (x : A). |
| 3 |
|
| 4 |
Module Type M. |
| 5 |
Parameter T@{s; u} : forall A, Box@{s; u} A -> Box@{Type; u} A. |
| 6 |
Parameter T_correct@{s; u} : forall (A : Type@{u}) x, T@{s; u} A (box@{s; u} _ x) = box@{Type; u} _ x. |
| 7 |
End M. |
| 8 |
|
| 9 |
Module M2. |
| 10 |
Definition T@{s; u|s -> Type} := fun A (x : Box@{s; u} A) => match x with box _ y => box@{Type;u} _ y end. |
| 11 |
Definition T_correct@{s; u|s -> Type} : forall (A : Type@{u}) x, T@{s; u} A (box@{s; u} _ x) = box@{Type; u} _ x := fun A x => eq_refl. |
| 12 |
End M2. |
| 13 |
|
| 14 |
Fail Module M3 : M := M2. |
| 15 |
|
| 16 |
Unset Universe Polymorphism. |
| 17 |
Inductive squash (A : Type) : SProp := sq (x : A). |
| 18 |
Fail Definition unbox A (x : squash A) : A := |
| 19 |
match M2.T A (match x return Box@{SProp; _} _ with sq _ y => box _ y end) with box _ y => y end. |