Debian Codegraph @

test-suite/bugs/bug_3393.v

raw
1 Require Import TestSuite.admit.
2 (* -*- coq-prog-args: ("-indices-matter") -*- *)
3 (* File reduced by coq-bug-finder from original input, then from 8760 lines to 7519 lines, then from 7050 lines to 909 lines, then from 846 lines to 578 lines, then from 497 lines to 392 lines, then from 365 lines to 322 lines, then from 252 lines to 205 lines, then from 215 lines to 204 lines, then from 210 lines to 182 lines, then from 175 lines to 157 lines *)
4 Set Universe Polymorphism.
5 Axiom admit : forall {T}, T.
6 Set Implicit Arguments.
7 Generalizable All Variables.
8 Reserved Notation "g 'o' f" (at level 40, left associativity).
9 Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "a = b" := (@paths _ a b) : type_scope.
10 Arguments idpath {A a} , [A] a.
11 Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g) : forall x, f x = g x := fun x => match h with idpath => idpath end.
12 Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { equiv_inv : B -> A }.
13 Delimit Scope equiv_scope with equiv.
14 Local Open Scope equiv_scope.
15 Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
16 Class Funext := { isequiv_apD10 :: forall (A : Type) (P : A -> Type) f g, IsEquiv (@apD10 A P f g) }.
17 Definition path_forall `{Funext} {A : Type} {P : A -> Type} (f g : forall x : A, P x) : (forall x, f x = g x) -> f = g := (@apD10 A P f g)^-1.
18 Record PreCategory :=
19 { object :> Type;
20 morphism : object -> object -> Type;
21 compose : forall s d d', morphism d d' -> morphism s d -> morphism s d' where "f 'o' g" := (compose f g);
22 associativity : forall x1 x2 x3 x4 (m1 : morphism x1 x2) (m2 : morphism x2 x3) (m3 : morphism x3 x4), (m3 o m2) o m1 = m3 o (m2 o m1)
23 }.
24 Bind Scope category_scope with PreCategory.
25 Bind Scope morphism_scope with morphism.
26 Infix "o" := (@compose _ _ _ _) : morphism_scope.
27 Delimit Scope functor_scope with functor.
28 Record Functor (C D : PreCategory) :=
29 { object_of :> C -> D;
30 morphism_of : forall s d, morphism C s d -> morphism D (object_of s) (object_of d) }.
31 Bind Scope functor_scope with Functor.
32 Notation "F '_1' m" := (@morphism_of _ _ F _ _ m) (at level 10, no associativity) : morphism_scope.
33 Class IsIsomorphism {C : PreCategory} {s d} (m : morphism C s d) := { morphism_inverse : morphism C d s }.
34 Local Notation "m ^-1" := (morphism_inverse (m := m)) : morphism_scope.
35 Class Isomorphic {C : PreCategory} s d :=
36 { morphism_isomorphic :: morphism C s d;
37 isisomorphism_isomorphic :: IsIsomorphism morphism_isomorphic }.
38 Coercion morphism_isomorphic : Isomorphic >-> morphism.
39 Definition isisomorphism_inverse `(@IsIsomorphism C x y m) : IsIsomorphism m^-1 := {| morphism_inverse := m |}.
40
41 Global Instance isisomorphism_compose `(@IsIsomorphism C y z m0) `(@IsIsomorphism C x y m1) : IsIsomorphism (m0 o m1).
42 Admitted.
43 Infix "<~=~>" := Isomorphic (at level 70, no associativity) : category_scope.
44 Definition composef C D E (G : Functor D E) (F : Functor C D) : Functor C E
45 := Build_Functor
46 C E
47 (fun c => G (F c))
48 (fun _ _ m => @morphism_of _ _ G _ _ (@morphism_of _ _ F _ _ m)).
49 Infix "o" := composef : functor_scope.
50 Delimit Scope natural_transformation_scope with natural_transformation.
51
52 Local Open Scope morphism_scope.
53 Record NaturalTransformation C D (F G : Functor C D) :=
54 { components_of :> forall c, morphism D (F c) (G c);
55 commutes : forall s d (m : morphism C s d), components_of d o F _1 m = G _1 m o components_of s }.
56
57 Definition composet C D (F F' F'' : Functor C D) (T' : NaturalTransformation F' F'') (T : NaturalTransformation F F')
58 : NaturalTransformation F F''
59 := Build_NaturalTransformation F F'' (fun c => T' c o T c) admit.
60 Infix "o" := composet : natural_transformation_scope.
61 Section path_natural_transformation.
62 Context `{Funext}.
63 Variable C : PreCategory.
64 Variable D : PreCategory.
65 Variables F G : Functor C D.
66 Section path.
67 Variables T U : NaturalTransformation F G.
68 Lemma path'_natural_transformation
69 : components_of T = components_of U
70 -> T = U.
71 admit.
72 Defined.
73 Lemma path_natural_transformation
74 : (forall x, components_of T x = components_of U x)
75 -> T = U.
76 Proof.
77 intros.
78 apply path'_natural_transformation.
79 apply path_forall; assumption.
80 Qed.
81 End path.
82 End path_natural_transformation.
83 Ltac path_natural_transformation :=
84 repeat match goal with
85 | _ => intro
86 | _ => apply path_natural_transformation; simpl
87 end.
88
89 Local Open Scope natural_transformation_scope.
90 Definition associativityt `{fs : Funext}
91 C D F G H I
92 (V : @NaturalTransformation C D F G)
93 (U : @NaturalTransformation C D G H)
94 (T : @NaturalTransformation C D H I)
95 : (T o U) o V = T o (U o V).
96 Proof.
97 path_natural_transformation.
98 apply associativity.
99 Qed.
100 Definition functor_category `{Funext} (C D : PreCategory) : PreCategory
101 := @Build_PreCategory (Functor C D) (@NaturalTransformation C D) (@composet C D) (@associativityt _ C D).
102 Notation "C -> D" := (functor_category C D) : category_scope.
103 Definition NaturalIsomorphism `{Funext} (C D : PreCategory) F G := @Isomorphic (C -> D) F G.
104 Infix "<~=~>" := NaturalIsomorphism : natural_transformation_scope.
105 Global Instance isisomorphism_compose' `{Funext}
106 `(T' : @NaturalTransformation C D F' F'')
107 `(T : @NaturalTransformation C D F F')
108 `{@IsIsomorphism (C -> D) F' F'' T'}
109 `{@IsIsomorphism (C -> D) F F' T}
110 : @IsIsomorphism (C -> D) F F'' (T' o T)%natural_transformation
111 := @isisomorphism_compose (C -> D) _ _ T' _ _ T _.
112 Arguments isisomorphism_compose' {H C D F' F''} T' {F} T {H0 H1}.
113 Section lemmas.
114 Context `{Funext}.
115 Variable C : PreCategory.
116 Variable F : C -> PreCategory.
117 Context
118 {w y z}
119 {f : Functor (F w) (F z)} {f0 : Functor (F w) (F y)}
120 {f2 : Functor (F y) (F z)}
121 {f5 : Functor (F w) (F z)}
122 {n2 : f <~=~> (f2 o f0)%functor}.
123 Lemma p_composition_of_coherent_iso_for_rewrite__isisomorphism_helper' XX
124 : @IsIsomorphism
125 (F w -> F z) f5 f
126 (n2 ^-1 o XX)%natural_transformation.
127 Proof.
128 eapply isisomorphism_compose'.
129 eapply isisomorphism_inverse. (* Toplevel input, characters 22-43:
130 Error:
131 In environment
132 H : Funext
133 C : PreCategory
134 F : C -> PreCategory
135 w : C
136 y : C
137 z : C
138 f : Functor (F w) (F z)
139 f0 : Functor (F w) (F y)
140 f2 : Functor (F y) (F z)
141 f5 : Functor (F w) (F z)
142 n2 : f <~=~> (f2 o f0)%functor
143 XX : NaturalTransformation f5 (f2 o f0)
144 Unable to unify
145 "{|
146 object := Functor (F w) (F z);
147 morphism := NaturalTransformation (D:=F z);
148 compose := composet (D:=F z);
149 associativity := associativityt (D:=F z) |}" with
150 "{|
151 object := Functor (F w) (F z);
152 morphism := NaturalTransformation (D:=F z);
153 compose := composet (D:=F z);
154 associativity := associativityt (D:=F z) |}". *)
155 Abort.
156 End lemmas.