| 1 |
Require Import TestSuite.admit. |
| 2 |
(* There are some problems in materialize_evar with local definitions, |
| 3 |
as CO below; this is not completely sorted out yet, but at least |
| 4 |
it fails in a smooth way at the time of today [HH] *) |
| 5 |
|
| 6 |
(* File reduced by coq-bug-finder from 9039 lines to 7786 lines, then |
| 7 |
from 7245 lines to 476 lines, then from 417 lines to 249 lines, |
| 8 |
then from 171 lines to 127 lines. *) |
| 9 |
|
| 10 |
Set Implicit Arguments. |
| 11 |
Set Universe Polymorphism. |
| 12 |
Definition admit {T} : T. |
| 13 |
Admitted. |
| 14 |
Delimit Scope object_scope with object. |
| 15 |
Delimit Scope morphism_scope with morphism. |
| 16 |
Delimit Scope category_scope with category. |
| 17 |
Delimit Scope functor_scope with functor. |
| 18 |
Delimit Scope natural_transformation_scope with natural_transformation. |
| 19 |
Reserved Infix "o" (at level 40, left associativity). |
| 20 |
Inductive paths {A : Type} (a : A) : A -> Type := |
| 21 |
idpath : paths a a. |
| 22 |
|
| 23 |
Arguments idpath {A a} , [A] a. |
| 24 |
Notation "x = y :> A" := (@paths A x y) : type_scope. |
| 25 |
Notation "x = y" := (x = y :>_) : type_scope. |
| 26 |
Definition inverse {A : Type} {x y : A} (p : x = y) : y = x |
| 27 |
:= match p with idpath => idpath end. |
| 28 |
|
| 29 |
Record PreCategory := |
| 30 |
{ |
| 31 |
Object :> Type; |
| 32 |
Morphism : Object -> Object -> Type; |
| 33 |
|
| 34 |
Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d' where "f 'o' g" := (Compose f g) |
| 35 |
}. |
| 36 |
Bind Scope category_scope with PreCategory. |
| 37 |
|
| 38 |
Arguments Compose [!C%_category s%_object d%_object d'%_object] m1%_morphism m2%_morphism : rename. |
| 39 |
|
| 40 |
Infix "o" := Compose : morphism_scope. |
| 41 |
Local Open Scope morphism_scope. |
| 42 |
|
| 43 |
Record Functor (C D : PreCategory) := |
| 44 |
{ |
| 45 |
ObjectOf :> C -> D; |
| 46 |
MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d); |
| 47 |
FCompositionOf : forall s d d' (m1 : C.(Morphism) s d) (m2: C.(Morphism) d d'), |
| 48 |
MorphismOf _ _ (m2 o m1) = (MorphismOf _ _ m2) o (MorphismOf _ _ m1) |
| 49 |
}. |
| 50 |
|
| 51 |
Bind Scope functor_scope with Functor. |
| 52 |
|
| 53 |
Arguments MorphismOf [C%_category] [D%_category] F%_functor [s%_object d%_object] m%_morphism : rename, simpl nomatch. |
| 54 |
|
| 55 |
Definition ComposeFunctors C D E |
| 56 |
(G : Functor D E) (F : Functor C D) : Functor C E |
| 57 |
:= Build_Functor C E |
| 58 |
(fun c => G (F c)) |
| 59 |
admit |
| 60 |
admit. |
| 61 |
|
| 62 |
Infix "o" := ComposeFunctors : functor_scope. |
| 63 |
|
| 64 |
Record NaturalTransformation C D (F G : Functor C D) := |
| 65 |
{ |
| 66 |
ComponentsOf :> forall c, D.(Morphism) (F c) (G c); |
| 67 |
Commutes : forall s d (m : C.(Morphism) s d), |
| 68 |
ComponentsOf d o F.(MorphismOf) m = G.(MorphismOf) m o ComponentsOf s |
| 69 |
}. |
| 70 |
|
| 71 |
Generalizable All Variables. |
| 72 |
|
| 73 |
Section NTComposeT. |
| 74 |
|
| 75 |
Variable C : PreCategory. |
| 76 |
Variable D : PreCategory. |
| 77 |
|
| 78 |
Variables F F' F'' : Functor C D. |
| 79 |
|
| 80 |
Variable T' : NaturalTransformation F' F''. |
| 81 |
Variable T : NaturalTransformation F F'. |
| 82 |
Let CO := fun c => T' c o T c. |
| 83 |
Definition NTComposeT_Commutes s d (m : Morphism C s d) |
| 84 |
: CO d o MorphismOf F m = MorphismOf F'' m o CO s. |
| 85 |
|
| 86 |
admit. |
| 87 |
Defined. |
| 88 |
Definition NTComposeT |
| 89 |
: NaturalTransformation F F'' |
| 90 |
:= Build_NaturalTransformation F F'' |
| 91 |
(fun c => T' c o T c) |
| 92 |
NTComposeT_Commutes. |
| 93 |
End NTComposeT. |
| 94 |
Definition NTWhiskerR C D E (F F' : Functor D E) (T : NaturalTransformation F F') |
| 95 |
(G : Functor C D) |
| 96 |
:= Build_NaturalTransformation (F o G) (F' o G) |
| 97 |
(fun c => T (G c)) |
| 98 |
admit. |
| 99 |
Class NTC_Composable A B (a : A) (b : B) (T : Type) (term : T) := {}. |
| 100 |
|
| 101 |
Definition NTC_Composable_term `{@NTC_Composable A B a b T term} := term. |
| 102 |
Notation "T 'o' U" |
| 103 |
:= (@NTC_Composable_term _ _ T%natural_transformation U%natural_transformation _ _ _) |
| 104 |
: natural_transformation_scope. |
| 105 |
|
| 106 |
Local Open Scope natural_transformation_scope. |
| 107 |
|
| 108 |
Lemma NTWhiskerR_CompositionOf C D |
| 109 |
(F G H : Functor C D) |
| 110 |
(T : NaturalTransformation G H) |
| 111 |
(T' : NaturalTransformation F G) B (I : Functor B C) |
| 112 |
: NTWhiskerR (NTComposeT T T') I = NTComposeT (NTWhiskerR T I) (NTWhiskerR T' I). |
| 113 |
|
| 114 |
admit. |
| 115 |
Defined. |
| 116 |
Definition FunctorCategory C D : PreCategory |
| 117 |
:= @Build_PreCategory (Functor C D) |
| 118 |
(NaturalTransformation (C := C) (D := D)) |
| 119 |
admit. |
| 120 |
|
| 121 |
Notation "[ C , D ]" := (FunctorCategory C D) : category_scope. |
| 122 |
|
| 123 |
Parameter C : PreCategory. |
| 124 |
Parameter D : PreCategory. |
| 125 |
Parameter E : PreCategory. |
| 126 |
Fail Definition NTWhiskerR_Functorial (G : [C, D]%category) |
| 127 |
: [[D, E], [C, E]]%category |
| 128 |
:= Build_Functor |
| 129 |
[C, D] [C, E] |
| 130 |
(fun F => F o G) |
| 131 |
(fun _ _ T => T o G) |
| 132 |
(fun _ _ _ _ _ => inverse (NTWhiskerR_CompositionOf _ _ _)). |
| 133 |
(* Anomaly: Uncaught exception Not_found(_). Please report. *) |