Debian Codegraph @

test-suite/bugs/bug_3648.v

raw
1 (* File reduced by coq-bug-finder from original input, then from 8808 lines to 424 lines, then from 432 lines to 196 lines, then from\
2 145 lines to 82 lines *)
3 (* coqc version trunk (September 2014) compiled on Sep 18 2014 21:0:5 with OCaml 4.01.0
4 coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (07e4438bd758c2ced8caf09a6961ccd77d84e42b) *)
5
6 Reserved Infix "o" (at level 40, left associativity).
7 Global Set Primitive Projections.
8
9 Delimit Scope morphism_scope with morphism.
10 Delimit Scope category_scope with category.
11 Delimit Scope object_scope with object.
12
13 Record PreCategory :=
14 { object :> Type;
15 morphism : object -> object -> Type;
16
17 identity : forall x, morphism x x;
18 compose : forall s d d',
19 morphism d d'
20 -> morphism s d
21 -> morphism s d'
22 where "f 'o' g" := (compose f g)
23 }.
24 Arguments identity {!C%_category} / x%_object : rename.
25
26 Infix "o" := (@compose _ _ _ _) : morphism_scope.
27
28 Local Open Scope morphism_scope.
29 Definition prodC (C D : PreCategory) : PreCategory.
30 refine (@Build_PreCategory
31 (C * D)%type
32 (fun s d => (morphism C (fst s) (fst d)
33 * morphism D (snd s) (snd d))%type)
34 (fun x => (identity (fst x), identity (snd x)))
35 (fun s d d' m2 m1 => (fst m2 o fst m1, snd m2 o snd m1))).
36 Defined.
37
38 Local Infix "*" := prodC : category_scope.
39
40 Delimit Scope functor_scope with functor.
41
42 Record Functor (C D : PreCategory) :=
43 {
44 object_of :> C -> D;
45 morphism_of : forall s d, morphism C s d
46 -> morphism D (object_of s) (object_of d);
47 identity_of : forall x, morphism_of _ _ (identity x)
48 = identity (object_of x)
49 }.
50 Arguments morphism_of [C%_category] [D%_category] F%_functor [s%_object d%_object] m%_morphism : rename, simpl nomatch.
51 Notation "F '_1' m" := (morphism_of F m) (at level 10, no associativity) : morphism_scope.
52 Axiom cheat : forall {A}, A.
53 Record NaturalTransformation C D (F G : Functor C D) := { components_of :> forall c, morphism D (F c) (G c) }.
54 Definition functor_category (C D : PreCategory) : PreCategory.
55 exact (@Build_PreCategory (Functor C D)
56 (@NaturalTransformation C D) cheat cheat).
57 Defined.
58
59 Local Notation "C -> D" := (functor_category C D) : category_scope.
60 Parameter C1 : PreCategory.
61 Parameter C2 : PreCategory.
62 Parameter D : PreCategory.
63
64 Definition functor_object_of
65 : (C1 -> (C2 -> D))%category -> (C1 * C2 -> D)%category.
66 Proof.
67 intro F; hnf in F |- *.
68 refine (Build_Functor
69 (prodC C1 C2) D
70 (fun c1c2 => F (fst c1c2) (snd c1c2))
71 (fun s d m => F (fst d) _1 (snd m) o (@morphism_of _ _ F _ _ (fst m)) (snd s))
72 _).
73 intros.
74 rewrite identity_of.
75 cbn.
76 rewrite (identity_of _ _ F (fst x)).
77 Undo.
78 (* Toplevel input, characters 20-55:
79 Error:
80 Found no subterm matching "F _1 (identity (fst x))" in the current goal. *)
81 rewrite identity_of. (* Toplevel input, characters 15-34:
82 Error:
83 Found no subterm matching "morphism_of ?202 (identity ?203)" in the current goal. *)
84 Abort.