| 1 |
Set Implicit Arguments. |
| 2 |
Set Universe Polymorphism. |
| 3 |
Set Printing Universes. |
| 4 |
|
| 5 |
Inductive type_paths (A : Type) : Type -> Prop |
| 6 |
:= idtypepath : type_paths A A. |
| 7 |
Monomorphic Definition comp_type_paths := Eval compute in type_paths@{Type Type}. |
| 8 |
Check comp_type_paths. |
| 9 |
(* comp_type_paths |
| 10 |
: Type (* Top.12 *) -> Type (* Top.12 *) -> Prop *) |
| 11 |
(* This is terrible. *) |
| 12 |
|
| 13 |
Inductive type_paths' (A : Type) : Type -> Prop |
| 14 |
:= idtypepath' : type_paths' A A |
| 15 |
| other_type_path : False -> forall B : Type, type_paths' A B. |
| 16 |
Monomorphic Definition comp_type_paths' := Eval compute in type_paths'. |
| 17 |
Check comp_type_paths'. |
| 18 |
(* comp_type_paths' |
| 19 |
: Type (* Top.24 *) -> Type (* Top.23 *) -> Prop *) |
| 20 |
(* Ok, then ... *) |
| 21 |
|
| 22 |
(** Fail if it's [U0 -> U0 -> _], but not on [U0 -> U1 -> _]. *) |
| 23 |
Goal Type. |
| 24 |
Proof. |
| 25 |
match type of comp_type_paths' with |
| 26 |
| ?U0 -> ?U1 -> ?R |
| 27 |
=> exact (@comp_type_paths' nat U0) |
| 28 |
end. |
| 29 |
Defined. |
| 30 |
|
| 31 |
Goal Type. |
| 32 |
Proof. |
| 33 |
match type of comp_type_paths with |
| 34 |
| ?U0 -> ?U1 -> ?R |
| 35 |
=> exact (@comp_type_paths nat U0) |
| 36 |
end. |
| 37 |
(* Toplevel input, characters 110-112: |
| 38 |
Error: |
| 39 |
The term "Type (* Top.51 *)" has type "Type (* Top.51+1 *)" |
| 40 |
while it is expected to have type "Type (* Top.51 *)" |
| 41 |
(Universe inconsistency: Cannot enforce Top.51 < Top.51 because Top.51 |
| 42 |
= Top.51)). *) |
| 43 |
|
| 44 |
Defined. |