Debian Codegraph @

test-suite/bugs/HoTT_coq_020.v

raw
1 Require Import TestSuite.admit.
2 Set Implicit Arguments.
3
4 Generalizable All Variables.
5
6 Set Asymmetric Patterns.
7
8 Polymorphic Record Category (obj : Type) :=
9 Build_Category {
10 Object :> _ := obj;
11 Morphism : obj -> obj -> Type;
12
13 Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d'
14 }.
15
16 Polymorphic Record Functor objC (C : Category objC) objD (D : Category objD) :=
17 { ObjectOf :> objC -> objD }.
18
19 Polymorphic Record NaturalTransformation objC C objD D (F G : Functor (objC := objC) C (objD := objD) D) :=
20 { ComponentsOf' :> forall c, D.(Morphism) (F.(ObjectOf) c) (G.(ObjectOf) c);
21 Commutes' : forall s d (m : C.(Morphism) s d), ComponentsOf' s = ComponentsOf' s }.
22
23 Ltac present_obj from to :=
24 match goal with
25 | [ _ : context[from ?obj ?C] |- _ ] => progress change (from obj C) with (to obj C) in *
26 | [ |- context[from ?obj ?C] ] => progress change (from obj C) with (to obj C) in *
27 end.
28
29 #[universes(polymorphic)]
30 Section NaturalTransformationComposition.
31 Set Universe Polymorphism.
32 Context `(C : @Category objC).
33 Context `(D : @Category objD).
34 Context `(E : @Category objE).
35 Variables F F' F'' : Functor C D.
36 Unset Universe Polymorphism.
37
38 Polymorphic Definition NTComposeT (T' : NaturalTransformation F' F'') (T : NaturalTransformation F F') :
39 NaturalTransformation F F''.
40 exists (fun c => Compose _ _ _ _ (T' c) (T c)).
41 repeat progress present_obj @Morphism @Morphism. (* removing this line makes the error go away *)
42 intros. (* removing this line makes the error go away *)
43 admit.
44 Defined.
45 End NaturalTransformationComposition.
46
47
48 Polymorphic Definition FunctorCategory objC (C : Category objC) objD (D : Category objD) :
49 @Category (Functor C D)
50 := @Build_Category (Functor C D)
51 (NaturalTransformation (C := C) (D := D))
52 (NTComposeT (C := C) (D := D)).
53
54 Polymorphic Definition Cat0 : Category Empty_set
55 := @Build_Category Empty_set
56 (@eq _)
57 (fun x => match x return _ with end).
58
59 Polymorphic Definition FunctorFrom0 objC (C : Category objC) : Functor Cat0 C
60 := Build_Functor Cat0 C (fun x => match x with end).
61
62 #[universes(polymorphic)]
63 Section Law0.
64 Polymorphic Variable objC : Type.
65 Polymorphic Variable C : Category objC.
66
67 Set Printing All.
68 Set Printing Universes.
69 Set Printing Existential Instances.
70
71 Polymorphic Definition ExponentialLaw0Functor_Inverse_ObjectOf' : Object (@FunctorCategory Empty_set Cat0 objC C).
72 (* In environment
73 objC : Type (* Top.154 *)
74 C : Category (* Top.155 Top.154 *) objC
75 The term "objC" has type "Type (* Top.154 *)"
76 while it is expected to have type "Type (* Top.184 *)"
77 (Universe inconsistency: Cannot enforce Top.154 <= Set)). *)
78 Admitted.
79
80 Polymorphic Definition ExponentialLaw0Functor_Inverse_ObjectOf : Object (FunctorCategory Cat0 C).
81 hnf.
82 refine (@FunctorFrom0 _ _).
83
84 (* Toplevel input, characters 23-40:
85 Error:
86 In environment
87 objC : Type (* Top.61069 *)
88 C : Category (* Top.61069 Top.61071 *) objC
89 The term
90 "@FunctorFrom0 (* Top.61077 Top.61078 *) ?69 (* [objC, C] *)
91 ?70 (* [objC, C] *)" has type
92 "@Functor (* Set Prop Top.61077 Top.61078 *) Empty_set Cat0
93 ?69 (* [objC, C] *) ?70 (* [objC, C] *)"
94 while it is expected to have type
95 "@Functor (* Set Prop Set Prop *) Empty_set Cat0 objC C".
96 *)
97 Defined.
98 End Law0.