-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProductCategory.v
47 lines (37 loc) · 1.71 KB
/
ProductCategory.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Require Export SpecializedCategory Functor.
Require Import Common.
Set Implicit Arguments.
Generalizable All Variables.
Set Asymmetric Patterns.
Set Universe Polymorphism.
Section ProductCategory.
Context `(C : @SpecializedCategory objC).
Context `(D : @SpecializedCategory objD).
Definition ProductCategory : @SpecializedCategory (objC * objD)%type.
refine (@Build_SpecializedCategory _
(fun s d => (C.(Morphism) (fst s) (fst d) * D.(Morphism) (snd s) (snd d))%type)
(fun o => (Identity (fst o), Identity (snd o)))
(fun s d d' m2 m1 => (Compose (fst m2) (fst m1), Compose (snd m2) (snd m1)))
_
_
_);
abstract (intros; simpl_eq; auto with morphism).
Defined.
End ProductCategory.
Infix "*" := ProductCategory : category_scope.
Section ProductCategoryFunctors.
Context `{C : @SpecializedCategory objC}.
Context `{D : @SpecializedCategory objD}.
Definition fst_Functor : SpecializedFunctor (C * D) C
:= Build_SpecializedFunctor (C * D) C
(@fst _ _)
(fun _ _ => @fst _ _)
(fun _ _ _ _ _ => eq_refl)
(fun _ => eq_refl).
Definition snd_Functor : SpecializedFunctor (C * D) D
:= Build_SpecializedFunctor (C * D) D
(@snd _ _)
(fun _ _ => @snd _ _)
(fun _ _ _ _ _ => eq_refl)
(fun _ => eq_refl).
End ProductCategoryFunctors.