Debian Codegraph @

test-suite/bugs/bug_3422.v

raw
1 Require Import TestSuite.admit.
2 Generalizable All Variables.
3 Set Implicit Arguments.
4 Set Universe Polymorphism.
5 Axiom admit : forall {T}, T.
6 Reserved Infix "o" (at level 40, left associativity).
7 Class IsEquiv {A B : Type} (f : A -> B) := { equiv_inv : B -> A }.
8 Record Equiv A B := { equiv_fun :> A -> B ; equiv_isequiv :> IsEquiv equiv_fun }.
9 #[export] Existing Instance equiv_isequiv.
10 Delimit Scope equiv_scope with equiv.
11 Local Open Scope equiv_scope.
12 Notation "A <~> B" := (Equiv A B) (at level 85) : equiv_scope.
13 Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
14 Axiom IsHSet : Type -> Type.
15 Existing Class IsHSet.
16 Definition trunc_equiv' `(f : A <~> B) `{IsHSet A} : IsHSet B := admit.
17 Delimit Scope morphism_scope with morphism.
18 Delimit Scope category_scope with category.
19 Delimit Scope object_scope with object.
20 Record PreCategory :=
21 { object :> Type;
22 morphism : object -> object -> Type;
23
24 compose : forall s d d',
25 morphism d d'
26 -> morphism s d
27 -> morphism s d'
28 where "f 'o' g" := (compose f g);
29
30 trunc_morphism : forall s d, IsHSet (morphism s d) }.
31
32 Bind Scope category_scope with PreCategory.
33 Infix "o" := (@compose _ _ _ _) : morphism_scope.
34
35 Delimit Scope functor_scope with functor.
36
37 Record Functor (C D : PreCategory) :=
38 {
39 object_of :> C -> D;
40 morphism_of : forall s d, morphism C s d
41 -> morphism D (object_of s) (object_of d)
42 }.
43
44 Bind Scope functor_scope with Functor.
45 Arguments morphism_of [C%_category] [D%_category] F%_functor [s%_object d%_object] m%_morphism : rename, simpl nomatch.
46 Notation "F '_1' m" := (morphism_of F m) (at level 10, no associativity) : morphism_scope.
47 Local Open Scope morphism_scope.
48
49 Class IsIsomorphism {C : PreCategory} {s d} (m : morphism C s d) := { morphism_inverse : morphism C d s }.
50
51 Local Notation "m ^-1" := (morphism_inverse (m := m)) : morphism_scope.
52
53 Class Isomorphic {C : PreCategory} s d :=
54 {
55 morphism_isomorphic :: morphism C s d;
56 isisomorphism_isomorphic :: IsIsomorphism morphism_isomorphic
57 }.
58
59 Coercion morphism_isomorphic : Isomorphic >-> morphism.
60
61 Local Infix "<~=~>" := Isomorphic (at level 70, no associativity) : category_scope.
62
63 Definition isisomorphism_inverse `(@IsIsomorphism C x y m) : IsIsomorphism m^-1 := {| morphism_inverse := m |}.
64
65 Global Instance isisomorphism_compose `(@IsIsomorphism C y z m0) `(@IsIsomorphism C x y m1)
66 : IsIsomorphism (m0 o m1).
67 admit.
68 Defined.
69
70 Section composition.
71 Variable C : PreCategory.
72 Variable D : PreCategory.
73 Variable E : PreCategory.
74 Variable G : Functor D E.
75 Variable F : Functor C D.
76
77 Definition composeF : Functor C E
78 := Build_Functor
79 C E
80 (fun c => G (F c))
81 (fun _ _ m => morphism_of G (morphism_of F m)).
82 End composition.
83 Infix "o" := composeF : functor_scope.
84
85 Delimit Scope natural_transformation_scope with natural_transformation.
86 Record NaturalTransformation C D (F G : Functor C D) := { components_of :> forall c, morphism D (F c) (G c) }.
87
88 Section compose.
89 Variable C : PreCategory.
90 Variable D : PreCategory.
91 Variables F F' F'' : Functor C D.
92
93 Variable T' : NaturalTransformation F' F''.
94 Variable T : NaturalTransformation F F'.
95
96 Local Notation CO c := (T' c o T c).
97
98 Definition composeT
99 : NaturalTransformation F F'' := Build_NaturalTransformation F F'' (fun c => CO c).
100
101 End compose.
102
103 Section whisker.
104 Variable C : PreCategory.
105 Variable D : PreCategory.
106 Variable E : PreCategory.
107
108 Section L.
109 Variable F : Functor D E.
110 Variables G G' : Functor C D.
111 Variable T : NaturalTransformation G G'.
112
113 Local Notation CO c := (morphism_of F (T c)).
114
115 Definition whisker_l
116 := Build_NaturalTransformation
117 (F o G) (F o G')
118 (fun c => CO c).
119
120 End L.
121
122 Section R.
123 Variables F F' : Functor D E.
124 Variable T : NaturalTransformation F F'.
125 Variable G : Functor C D.
126
127 Local Notation CO c := (T (G c)).
128
129 Definition whisker_r
130 := Build_NaturalTransformation
131 (F o G) (F' o G)
132 (fun c => CO c).
133 End R.
134 End whisker.
135 Infix "o" := composeT : natural_transformation_scope.
136 Infix "oL" := whisker_l (at level 40, left associativity) : natural_transformation_scope.
137 Infix "oR" := whisker_r (at level 40, left associativity) : natural_transformation_scope.
138
139 Section path_natural_transformation.
140
141 Variable C : PreCategory.
142 Variable D : PreCategory.
143 Variables F G : Functor C D.
144
145 Lemma equiv_sig_natural_transformation
146 : { CO : forall x, morphism D (F x) (G x)
147 | forall s d (m : morphism C s d),
148 CO d o F _1 m = G _1 m o CO s }
149 <~> NaturalTransformation F G.
150 admit.
151 Defined.
152
153 Global Instance trunc_natural_transformation
154 : IsHSet (NaturalTransformation F G).
155 Proof.
156 eapply trunc_equiv'; [ exact equiv_sig_natural_transformation | ].
157 admit.
158 Qed.
159
160 End path_natural_transformation.
161 Definition functor_category (C D : PreCategory) : PreCategory
162 := @Build_PreCategory (Functor C D) (@NaturalTransformation C D) (@composeT C D) _.
163
164 Notation "C -> D" := (functor_category C D) : category_scope.
165
166 Definition NaturalIsomorphism (C D : PreCategory) F G := @Isomorphic (C -> D) F G.
167
168 Coercion natural_transformation_of_natural_isomorphism C D F G (T : @NaturalIsomorphism C D F G) : NaturalTransformation F G
169 := T : morphism _ _ _.
170 Local Infix "<~=~>" := NaturalIsomorphism : natural_transformation_scope.
171 Global Instance isisomorphism_compose'
172 `(T' : @NaturalTransformation C D F' F'')
173 `(T : @NaturalTransformation C D F F')
174 `{@IsIsomorphism (C -> D) F' F'' T'}
175 `{@IsIsomorphism (C -> D) F F' T}
176 : @IsIsomorphism (C -> D) F F'' (T' o T)%natural_transformation
177 := @isisomorphism_compose (C -> D) _ _ T' _ _ T _.
178 Arguments isisomorphism_compose' {C D F' F''} T' {F} T {H H0}.
179
180 Section lemmas.
181 Local Open Scope natural_transformation_scope.
182
183 Variable C : PreCategory.
184 Variable F : C -> PreCategory.
185 Context
186 {w x y z}
187 {f : Functor (F w) (F z)} {f0 : Functor (F w) (F y)}
188 {f1 : Functor (F x) (F y)} {f2 : Functor (F y) (F z)}
189 {f3 : Functor (F w) (F x)} {f4 : Functor (F x) (F z)}
190 {f5 : Functor (F w) (F z)} {n : f5 <~=~> (f4 o f3)%functor}
191 {n0 : f4 <~=~> (f2 o f1)%functor} {n1 : f0 <~=~> (f1 o f3)%functor}
192 {n2 : f <~=~> (f2 o f0)%functor}.
193
194 Lemma p_composition_of_coherent_iso_for_rewrite__isisomorphism_helper'
195 : @IsIsomorphism
196 (_ -> _) _ _
197 (n2 ^-1 o (f2 oL n1 ^-1 o (admit o (n0 oR f3 o n))))%natural_transformation.
198 Proof.
199 eapply isisomorphism_compose';
200 [ eapply isisomorphism_inverse
201 | eapply isisomorphism_compose';
202 [ admit
203 | eapply isisomorphism_compose';
204 [ admit |
205 eapply isisomorphism_compose'; [ admit | ]]]].
206 Set Printing All. Set Printing Universes.
207 apply @isisomorphism_isomorphic.
208 Qed.
209
210 End lemmas.