| 1 |
Require Import TestSuite.admit. |
| 2 |
(* File reduced by coq-bug-finder from 279 lines to 219 lines. *) |
| 3 |
|
| 4 |
Set Implicit Arguments. |
| 5 |
Set Universe Polymorphism. |
| 6 |
Definition admit {T} : T. |
| 7 |
Admitted. |
| 8 |
Module Export Overture. |
| 9 |
Reserved Notation "g 'o' f" (at level 40, left associativity). |
| 10 |
|
| 11 |
Inductive paths {A : Type} (a : A) : A -> Type := |
| 12 |
idpath : paths a a. |
| 13 |
|
| 14 |
Arguments idpath {A a} , [A] a. |
| 15 |
|
| 16 |
Notation "x = y :> A" := (@paths A x y) : type_scope. |
| 17 |
|
| 18 |
Notation "x = y" := (x = y :>_) : type_scope. |
| 19 |
|
| 20 |
Delimit Scope path_scope with path. |
| 21 |
|
| 22 |
Local Open Scope path_scope. |
| 23 |
|
| 24 |
Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y |
| 25 |
:= match p with idpath => idpath end. |
| 26 |
|
| 27 |
Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g) |
| 28 |
: forall x, f x = g x |
| 29 |
:= fun x => match h with idpath => idpath end. |
| 30 |
|
| 31 |
Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { equiv_inv : B -> A }. |
| 32 |
|
| 33 |
Delimit Scope equiv_scope with equiv. |
| 34 |
Local Open Scope equiv_scope. |
| 35 |
|
| 36 |
Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope. |
| 37 |
|
| 38 |
Class Funext. |
| 39 |
Axiom isequiv_apD10 : `{Funext} -> forall (A : Type) (P : A -> Type) f g, IsEquiv (@apD10 A P f g) . |
| 40 |
#[export] Existing Instance isequiv_apD10. |
| 41 |
|
| 42 |
Definition path_forall `{Funext} {A : Type} {P : A -> Type} (f g : forall x : A, P x) : |
| 43 |
(forall x, f x = g x) -> f = g |
| 44 |
:= |
| 45 |
(@apD10 A P f g)^-1. |
| 46 |
|
| 47 |
End Overture. |
| 48 |
|
| 49 |
Module Export Core. |
| 50 |
|
| 51 |
Set Implicit Arguments. |
| 52 |
Delimit Scope morphism_scope with morphism. |
| 53 |
Delimit Scope category_scope with category. |
| 54 |
Delimit Scope object_scope with object. |
| 55 |
|
| 56 |
Record PreCategory := |
| 57 |
{ |
| 58 |
object :> Type; |
| 59 |
morphism : object -> object -> Type; |
| 60 |
|
| 61 |
compose : forall s d d', |
| 62 |
morphism d d' |
| 63 |
-> morphism s d |
| 64 |
-> morphism s d' |
| 65 |
where "f 'o' g" := (compose f g); |
| 66 |
|
| 67 |
associativity : forall x1 x2 x3 x4 |
| 68 |
(m1 : morphism x1 x2) |
| 69 |
(m2 : morphism x2 x3) |
| 70 |
(m3 : morphism x3 x4), |
| 71 |
(m3 o m2) o m1 = m3 o (m2 o m1) |
| 72 |
}. |
| 73 |
Bind Scope category_scope with PreCategory. |
| 74 |
Arguments compose [!C%_category s%_object d%_object d'%_object] m1%_morphism m2%_morphism : rename. |
| 75 |
|
| 76 |
Infix "o" := compose : morphism_scope. |
| 77 |
|
| 78 |
End Core. |
| 79 |
|
| 80 |
Local Open Scope morphism_scope. |
| 81 |
Record Functor (C D : PreCategory) := |
| 82 |
{ |
| 83 |
object_of :> C -> D; |
| 84 |
morphism_of : forall s d, morphism C s d |
| 85 |
-> morphism D (object_of s) (object_of d) |
| 86 |
}. |
| 87 |
|
| 88 |
Inductive Unit : Set := |
| 89 |
tt : Unit. |
| 90 |
|
| 91 |
Definition indiscrete_category (X : Type) : PreCategory |
| 92 |
:= @Build_PreCategory X |
| 93 |
(fun _ _ => Unit) |
| 94 |
(fun _ _ _ _ _ => tt) |
| 95 |
(fun _ _ _ _ _ _ _ => idpath). |
| 96 |
|
| 97 |
|
| 98 |
Record NaturalTransformation C D (F G : Functor C D) := { components_of :> forall c, morphism D (F c) (G c) }. |
| 99 |
Section path_natural_transformation. |
| 100 |
Context `{Funext}. |
| 101 |
Variable C : PreCategory. |
| 102 |
Variable D : PreCategory. |
| 103 |
Variables F G : Functor C D. |
| 104 |
|
| 105 |
Section path. |
| 106 |
Variables T U : NaturalTransformation F G. |
| 107 |
Lemma path'_natural_transformation |
| 108 |
: components_of T = components_of U |
| 109 |
-> T = U. |
| 110 |
admit. |
| 111 |
Defined. |
| 112 |
Lemma path_natural_transformation |
| 113 |
: (forall x, T x = U x) |
| 114 |
-> T = U. |
| 115 |
Proof. |
| 116 |
intros. |
| 117 |
apply path'_natural_transformation. |
| 118 |
apply path_forall; assumption. |
| 119 |
Qed. |
| 120 |
End path. |
| 121 |
End path_natural_transformation. |
| 122 |
Ltac path_natural_transformation := |
| 123 |
repeat match goal with |
| 124 |
| _ => intro |
| 125 |
| _ => apply path_natural_transformation; simpl |
| 126 |
end. |
| 127 |
Definition comma_category A B C (S : Functor A C) (T : Functor B C) |
| 128 |
: PreCategory. |
| 129 |
admit. |
| 130 |
Defined. |
| 131 |
Definition compose C D (F F' F'' : Functor C D) |
| 132 |
(T' : NaturalTransformation F' F'') (T : NaturalTransformation F F') |
| 133 |
: NaturalTransformation F F'' |
| 134 |
:= Build_NaturalTransformation F F'' |
| 135 |
(fun c => T' c o T c). |
| 136 |
|
| 137 |
Infix "o" := compose : natural_transformation_scope. |
| 138 |
|
| 139 |
Local Open Scope natural_transformation_scope. |
| 140 |
|
| 141 |
Definition associativity `{fs : Funext} |
| 142 |
C D F G H I |
| 143 |
(V : @NaturalTransformation C D F G) |
| 144 |
(U : @NaturalTransformation C D G H) |
| 145 |
(T : @NaturalTransformation C D H I) |
| 146 |
: (T o U) o V = T o (U o V). |
| 147 |
Proof. |
| 148 |
path_natural_transformation. |
| 149 |
|
| 150 |
apply associativity. |
| 151 |
Qed. |
| 152 |
Definition functor_category `{Funext} (C D : PreCategory) : PreCategory |
| 153 |
:= @Build_PreCategory (Functor C D) |
| 154 |
(@NaturalTransformation C D) |
| 155 |
(@compose C D) |
| 156 |
(@associativity _ C D). |
| 157 |
|
| 158 |
Notation "C -> D" := (functor_category C D) : category_scope. |
| 159 |
|
| 160 |
Definition compose_functor `{Funext} (C D E : PreCategory) : object ((C -> D) -> ((D -> E) -> (C -> E))). |
| 161 |
admit. |
| 162 |
|
| 163 |
Defined. |
| 164 |
|
| 165 |
Definition pullback_along `{Funext} (C C' D : PreCategory) (p : Functor C C') |
| 166 |
: object ((C' -> D) -> (C -> D)) |
| 167 |
:= Eval hnf in compose_functor _ _ _ p. |
| 168 |
|
| 169 |
Definition IsColimit `{Funext} C D (F : Functor D C) |
| 170 |
(x : object |
| 171 |
(@comma_category (indiscrete_category Unit) |
| 172 |
(@functor_category H (indiscrete_category Unit) C) |
| 173 |
(@functor_category H D C) |
| 174 |
admit |
| 175 |
(@pullback_along H D (indiscrete_category Unit) C |
| 176 |
admit))) : Type |
| 177 |
:= admit. |
| 178 |
|
| 179 |
Generalizable All Variables. |
| 180 |
Axiom fs : Funext. |
| 181 |
#[export] Existing Instance fs. |
| 182 |
|
| 183 |
Section bar. |
| 184 |
|
| 185 |
Variable D : PreCategory. |
| 186 |
|
| 187 |
Context `(has_colimits |
| 188 |
: forall F : Functor D C, |
| 189 |
@IsColimit _ C D F (colimits F)). |
| 190 |
(* Error: Unsatisfied constraints: Top.3773 <= Set |
| 191 |
(maybe a bugged tactic). *) |
| 192 |
End bar. |