-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPathsCategoryFunctors.v
45 lines (36 loc) · 1.36 KB
/
PathsCategoryFunctors.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
Require Import FunctionalExtensionality.
Require Export PathsCategory Functor SetCategory ComputableCategory SmallCat NaturalTransformation.
Require Import Common Adjoint.
Set Implicit Arguments.
Generalizable All Variables.
Set Asymmetric Patterns.
Set Universe Polymorphism.
Section FunctorFromPaths.
Variable V : Type.
Variable E : V -> V -> Type.
Context `(D : @SpecializedCategory objD).
Variable objOf : V -> objD.
Variable morOf : forall s d, E s d -> Morphism D (objOf s) (objOf d).
Fixpoint path_compose s d (m : Morphism (PathsCategory E) s d) : Morphism D (objOf s) (objOf d) :=
match m with
| NoEdges => Identity _
| AddEdge _ _ m' e => Compose (morOf e) (path_compose m')
end.
Lemma FunctorFromPaths_FCompositionOf s d d' (p1 : path E s d) (p2 : path E d d') :
path_compose (concatenate p1 p2) = Compose (path_compose p2) (path_compose p1).
Proof.
induction p2; t_with t'; autorewrite with morphism; reflexivity.
Qed.
Definition FunctorFromPaths : SpecializedFunctor (PathsCategory E) D.
Proof.
refine {|
ObjectOf := objOf;
MorphismOf := path_compose;
FCompositionOf := FunctorFromPaths_FCompositionOf
|};
abstract intuition.
Defined.
End FunctorFromPaths.
Section Underlying.
Definition UnderlyingGraph `(C : @SpecializedCategory objC) := @PathsCategory objC (Morphism C).
End Underlying.