Debian Codegraph @

test-suite/bugs/HoTT_coq_036.v

raw
1 Unset Strict Universe Declaration.
2 Module Version1.
3 Set Implicit Arguments.
4 Set Universe Polymorphism.
5 Generalizable All Variables.
6
7 Record SpecializedCategory (obj : Type) :=
8 {
9 Object :> _ := obj
10 }.
11
12 Record > Category :=
13 {
14 CObject : Type;
15 UnderlyingCategory :> @SpecializedCategory CObject
16 }.
17
18 Record SpecializedFunctor `(C : @SpecializedCategory objC) `(D : @SpecializedCategory objD) :=
19 {
20 ObjectOf :> objC -> objD
21 }.
22
23 Definition Functor (C D : Category) := SpecializedFunctor C D.
24
25 Parameter TerminalCategory : SpecializedCategory unit.
26
27 Definition focus A (_ : A) := True.
28
29 Definition CommaCategory_Object (A : Category) (S : Functor TerminalCategory A) : Type.
30 assert (Hf : focus ((S tt) = (S tt))) by constructor.
31 let C1 := constr:(CObject) in
32 let C2 := constr:(fun C => @Object (CObject C) C) in
33 unify C1 C2; idtac C1 C2. Show Universes.
34 progress change @CObject with (fun C => @Object (CObject C) C) in *.
35 simpl in *.
36 match type of Hf with
37 | focus ?V => exact V
38 end.
39 Defined.
40
41 Definition Build_SliceCategory (A : Category) (F : Functor TerminalCategory A) := @Build_SpecializedCategory (CommaCategory_Object F).
42 Parameter SetCat : @SpecializedCategory Set.
43
44 Set Printing Universes.
45 Check (fun (A : Category) (F : Functor TerminalCategory A) => @Build_SpecializedCategory (CommaCategory_Object F)) SetCat.
46 (* (fun (A : Category (* Top.68 *))
47 (F : Functor (* Set Top.68 *) TerminalCategory A) =>
48 {| |}) SetCat (* Top.68 *)
49 : forall
50 F : Functor (* Set Top.68 *) TerminalCategory SetCat (* Top.68 *),
51 let Object := CommaCategory_Object (* Top.68 Top.69 Top.68 *) F in
52 SpecializedCategory (* Top.69 *)
53 (CommaCategory_Object (* Top.68 Top.69 Top.68 *) F) *)
54 Check @Build_SliceCategory SetCat. (* Toplevel input, characters 0-34:
55 Error: Universe inconsistency (cannot enforce Top.51 <= Set because Set
56 < Top.51). *)
57 End Version1.
58
59 Module Version2.
60 Set Implicit Arguments.
61 Set Universe Polymorphism.
62
63 Record SpecializedCategory (obj : Type) :=
64 {
65 Object : _ := obj
66 }.
67
68 Record > Category :=
69 {
70 CObject : Type;
71 UnderlyingCategory :> @SpecializedCategory CObject
72 }.
73
74 Parameter TerminalCategory : SpecializedCategory unit.
75
76 Definition focus A (_ : A) := True.
77 Parameter ObjectOf' : forall (objC : Type) (C : SpecializedCategory objC)
78 (objD : Type) (D : SpecializedCategory objD), Prop.
79 Definition CommaCategory_Object (A : Category) : Type.
80 assert (Hf : focus (@ObjectOf' _ (@Build_Category unit TerminalCategory) _ A)) by constructor.
81 progress change CObject with (fun C => @Object (CObject C) C) in *;
82 simpl in *.
83 match type of Hf with
84 | focus ?V => exact V
85 end.
86 Defined.
87
88 Definition Build_SliceCategory := @CommaCategory_Object.
89 Parameter SetCat : @SpecializedCategory Set.
90
91 Set Printing Universes.
92 Check @Build_SliceCategory SetCat.
93 End Version2.
94
95 Module OtherBug.
96 Set Implicit Arguments.
97 Set Universe Polymorphism.
98
99 Record SpecializedCategory (obj : Type) : Set :=
100 {
101 Object : _ := obj
102 }.
103
104 Record > Category :=
105 {
106 CObject : Type;
107 UnderlyingCategory :> @SpecializedCategory CObject
108 }.
109
110 Parameter TerminalCategory : SpecializedCategory unit.
111
112 Definition focus A (_ : A) := True.
113
114 Parameter ObjectOf' : forall (objC : Type) (C : SpecializedCategory objC)
115 (objD : Type) (D : SpecializedCategory objD), Prop.
116 Definition CommaCategory_Object (A : Category@{i}) : Type.
117 assert (Hf : focus (@ObjectOf' _ (@Build_Category unit TerminalCategory) _ A)) by constructor.
118 progress change CObject with (fun C => @Object (CObject C) C) in *;
119 simpl in *.
120 match type of Hf with
121 | focus ?V => exact V
122 end.
123 Defined.
124
125 Parameter SetCat : @SpecializedCategory Set.
126
127 Set Printing Universes.
128 Definition Build_SliceCategory := @CommaCategory_Object.
129 Check @CommaCategory_Object SetCat.
130 (* CommaCategory_Object (* Top.43 Top.44 Top.43 *) SetCat (* Top.43 *)
131 : Type (* Top.44 *) *)
132 Check @Build_SliceCategory SetCat.
133 (* Toplevel input, characters 0-34:
134 Error: Universe inconsistency (cannot enforce Top.36 <= Set because Set
135 < Top.36). *)
136 End OtherBug.