| 1 |
(* -*- mode: coq; coq-prog-args: ("-indices-matter") -*- *) |
| 2 |
Set Printing Universes. |
| 3 |
Set Implicit Arguments. |
| 4 |
Generalizable All Variables. |
| 5 |
Set Asymmetric Patterns. |
| 6 |
Set Universe Polymorphism. |
| 7 |
|
| 8 |
Inductive Unit : Type := |
| 9 |
tt : Unit. |
| 10 |
|
| 11 |
Inductive Bool : Type := |
| 12 |
| true : Bool |
| 13 |
| false : Bool. |
| 14 |
|
| 15 |
Inductive paths {A : Type} (a : A) : A -> Type := |
| 16 |
idpath : paths a a. |
| 17 |
|
| 18 |
Record PreCategory := |
| 19 |
{ |
| 20 |
Object :> Type; |
| 21 |
Morphism : Object -> Object -> Type |
| 22 |
}. |
| 23 |
|
| 24 |
Definition DiscreteCategory X : PreCategory |
| 25 |
:= @Build_PreCategory X |
| 26 |
(@paths X). |
| 27 |
|
| 28 |
Definition IndiscreteCategory X : PreCategory |
| 29 |
:= @Build_PreCategory X |
| 30 |
(fun _ _ => Unit). |
| 31 |
|
| 32 |
Definition NatCategory (n : nat) := |
| 33 |
match n with |
| 34 |
| 0 => IndiscreteCategory Unit |
| 35 |
| _ => DiscreteCategory Bool |
| 36 |
end. |
| 37 |
(* Error: Universe inconsistency (cannot enforce Set <= Prop).*) |
| 38 |
|
| 39 |
Definition NatCategory' (n : nat) := |
| 40 |
match n with |
| 41 |
| 0 => (fun X => @Build_PreCategory X |
| 42 |
(fun _ _ => Unit : Set)) Unit |
| 43 |
| _ => DiscreteCategory Bool |
| 44 |
end. |
| 45 |
|
| 46 |
Definition NatCategory'' (n : nat) := |
| 47 |
match n with |
| 48 |
| 0 => IndiscreteCategory Unit |
| 49 |
| _ => DiscreteCategory Bool |
| 50 |
end. |