-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFunctorProduct.v
59 lines (49 loc) · 2.05 KB
/
FunctorProduct.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
48
49
50
51
52
53
54
55
56
57
58
59
Require Export ProductCategory Functor NaturalTransformation.
Require Import Common TypeclassUnreifiedSimplification.
Set Implicit Arguments.
Generalizable All Variables.
Set Asymmetric Patterns.
Set Universe Polymorphism.
Section FunctorProduct.
Context `(C : @SpecializedCategory objC).
Context `(D : @SpecializedCategory objD).
Context `(D' : @SpecializedCategory objD').
Definition FunctorProduct (F : Functor C D) (F' : Functor C D') : SpecializedFunctor C (D * D').
match goal with
| [ |- SpecializedFunctor ?C0 ?D0 ] =>
refine (Build_SpecializedFunctor
C0 D0
(fun c => (F c, F' c))
(fun s d m => (MorphismOf F m, MorphismOf F' m))
_
_)
end;
abstract (intros; expand; apply f_equal2; rsimplify_morphisms; reflexivity).
Defined.
Definition FunctorProductFunctorial
(F G : Functor C D)
(F' G' : Functor C D')
(T : SpecializedNaturalTransformation F G)
(T' : SpecializedNaturalTransformation F' G')
: SpecializedNaturalTransformation (FunctorProduct F F') (FunctorProduct G G').
match goal with
| [ |- SpecializedNaturalTransformation ?F ?G ] =>
refine (Build_SpecializedNaturalTransformation F G
(fun x => (T x, T' x))
_)
end.
abstract (simpl; intros; repeat rewrite Commutes; reflexivity).
Defined.
End FunctorProduct.
Section FunctorProduct'.
Context `(C : @SpecializedCategory objC).
Context `(D : @SpecializedCategory objD).
Context `(C' : @SpecializedCategory objC').
Context `(D' : @SpecializedCategory objD').
Variable F : Functor C D.
Variable F' : Functor C' D'.
Definition FunctorProduct' : SpecializedFunctor (C * C') (D * D')
:= FunctorProduct (ComposeFunctors F fst_Functor) (ComposeFunctors F' snd_Functor).
End FunctorProduct'.
(** XXX TODO(jgross): Change this to [FunctorProduct]. *)
Infix "*" := FunctorProduct' : functor_scope.