Debian Codegraph @

test-suite/bugs/bug_3685.v

raw
1 Require Import TestSuite.admit.
2 Set Universe Polymorphism.
3 Class Funext := { }.
4 Delimit Scope category_scope with category.
5 Record PreCategory := { object :> Type ; morphism : object -> object -> Type }.
6 Set Implicit Arguments.
7 Record Functor (C D : PreCategory) :=
8 { object_of :> C -> D;
9 morphism_of : forall s d, morphism C s d -> morphism D (object_of s) (object_of d);
10 identity_of : forall s m, morphism_of s s m = morphism_of s s m }.
11 Definition sub_pre_cat `{Funext} (P : PreCategory -> Type) : PreCategory.
12 Proof.
13 exact (@Build_PreCategory PreCategory Functor).
14 Defined.
15 Definition opposite (C : PreCategory) : PreCategory.
16 Proof.
17 exact (@Build_PreCategory C (fun s d => morphism C d s)).
18 Defined.
19 Local Notation "C ^op" := (opposite C) (at level 3, format "C '^op'") : category_scope.
20 Definition prod (C D : PreCategory) : PreCategory.
21 Proof.
22 refine (@Build_PreCategory
23 (C * D)%type
24 (fun s d => (morphism C (fst s) (fst d) * morphism D (snd s) (snd d))%type)).
25 Defined.
26 Local Infix "*" := prod : category_scope.
27 Record NaturalTransformation C D (F G : Functor C D) := {}.
28 Definition functor_category (C D : PreCategory) : PreCategory.
29 Proof.
30 exact (@Build_PreCategory (Functor C D) (@NaturalTransformation C D)).
31 Defined.
32 Local Notation "C -> D" := (functor_category C D) : category_scope.
33 Module Export PointwiseCore.
34 Local Open Scope category_scope.
35 Definition pointwise
36 (C C' : PreCategory)
37 (F : Functor C' C)
38 (D D' : PreCategory)
39 (G : Functor D D')
40 : Functor (C -> D) (C' -> D').
41 Proof.
42 unshelve (refine (Build_Functor
43 (C -> D) (C' -> D')
44 _
45 _
46 _));
47 abstract admit.
48 Defined.
49 End PointwiseCore.
50 Axiom Pidentity_of : forall (C D : PreCategory) (F : Functor C C) (G : Functor D D), pointwise F G = pointwise F G.
51 Local Open Scope category_scope.
52 Module Success.
53 Definition functor_uncurried `{Funext} (P : PreCategory -> Type)
54 (has_functor_categories : forall C D : sub_pre_cat P, P (C -> D))
55 : object (((sub_pre_cat P)^op * (sub_pre_cat P)) -> (sub_pre_cat P))
56 := Eval cbv zeta in
57 let object_of := (fun CD => (((fst CD) -> (snd CD))))
58 in Build_Functor
59 ((sub_pre_cat P)^op * (sub_pre_cat P)) (sub_pre_cat P)
60 object_of
61 (fun CD C'D' FG => pointwise (fst FG) (snd FG))
62 (fun _ _ => @Pidentity_of _ _ _ _).
63 End Success.
64 Module Bad.
65 Include PointwiseCore.
66 Definition functor_uncurried `{Funext} (P : PreCategory -> Type)
67 (has_functor_categories : forall C D : sub_pre_cat P, P (C -> D))
68 : object (((sub_pre_cat P)^op * (sub_pre_cat P)) -> (sub_pre_cat P))
69 := Eval cbv zeta in
70 let object_of := (fun CD => (((fst CD) -> (snd CD))))
71 in Build_Functor
72 ((sub_pre_cat P)^op * (sub_pre_cat P)) (sub_pre_cat P)
73 object_of
74 (fun CD C'D' FG => pointwise (fst FG) (snd FG))
75 (fun _ _ => @Pidentity_of _ _ _ _).
76 End Bad.