-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInitialTerminalCategory.v
72 lines (57 loc) · 2.22 KB
/
InitialTerminalCategory.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
60
61
62
63
64
65
66
67
68
69
70
71
72
Require Export SpecializedCategory Functor.
Require Import Common Notations NatCategory.
Set Implicit Arguments.
Generalizable All Variables.
Set Asymmetric Patterns.
Set Universe Polymorphism.
Section InitialTerminal.
Definition InitialCategory : SmallSpecializedCategory _ := 0.
Definition TerminalCategory : SmallSpecializedCategory _ := 1.
End InitialTerminal.
Section Functors.
Context `(C : SpecializedCategory objC).
Definition FunctorTo1 : SpecializedFunctor C 1
:= Build_SpecializedFunctor C 1 (fun _ => tt) (fun _ _ _ => eq_refl) (fun _ _ _ _ _ => eq_refl) (fun _ => eq_refl).
Definition FunctorToTerminal : SpecializedFunctor C TerminalCategory := FunctorTo1.
Definition FunctorFrom1 (c : C) : SpecializedFunctor 1 C
:= Build_SpecializedFunctor 1 C (fun _ => c) (fun _ _ _ => Identity c) (fun _ _ _ _ _ => eq_sym (@RightIdentity _ _ _ _ _)) (fun _ => eq_refl).
Definition FunctorFromTerminal (c : C) : SpecializedFunctor TerminalCategory C := FunctorFrom1 c.
Definition FunctorFrom0 : SpecializedFunctor 0 C
:= Build_SpecializedFunctor 0 C (fun x => match x with end) (fun x _ _ => match x with end) (fun x _ _ _ _ => match x with end) (fun x => match x with end).
Definition FunctorFromInitial : SpecializedFunctor InitialCategory C := FunctorFrom0.
End Functors.
Section FunctorsUnique.
Context `(C : @SpecializedCategory objC).
Lemma InitialCategoryFunctorUnique
: forall F F' : SpecializedFunctor InitialCategory C,
F = F'.
Proof.
functor_eq; destruct_head_hnf @Empty_set.
Qed.
Lemma InitialCategoryFunctor'Unique
: forall F F' : SpecializedFunctor C InitialCategory,
F = F'.
Proof.
intros F F'.
functor_eq; auto.
match goal with
| [ x : _ |- _ ] => solve [ let H := fresh in assert (H := F x); destruct H ]
end.
Qed.
Lemma InitialCategoryInitial
: forall F, F = FunctorFromInitial C.
Proof.
intros; apply InitialCategoryFunctorUnique.
Qed.
Lemma TerminalCategoryFunctorUnique
: forall F F' : SpecializedFunctor C TerminalCategory,
F = F'.
Proof.
functor_eq; auto.
Qed.
Lemma TerminalCategoryTerminal
: forall F, F = FunctorToTerminal C.
Proof.
intros; apply TerminalCategoryFunctorUnique.
Qed.
End FunctorsUnique.