-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathSubcat.v
118 lines (113 loc) · 3.93 KB
/
Subcat.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
(* This program is free software; you can redistribute it and/or *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1 *)
(* of the License, or (at your option) any later version. *)
(* *)
(* This program is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU General Public License for more details. *)
(* *)
(* You should have received a copy of the GNU Lesser General Public *)
(* License along with this program; if not, write to the Free *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA *)
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Categories.
Require Export Parts.
(** Title "Sub-category." *)
Section Subcategory_def.
Variable C : category.
Variable C' : Type.
Variable i : C' -> C.
Variable homC' : forall a b : C', subtype_image (Hom (i a) (i b)).
Definition subcat_Hom (a b : C') := homC' a b:Setoid.
Variable
CompC' :
forall a b c : C', subcat_Hom b c -> subcat_Hom a b -> subcat_Hom a c.
Variable idC' : forall a : C', subcat_Hom a a.
Hypothesis
idC'ok : forall a : C', Equal (subtype_image_inj (idC' a)) (Hom_id (i a)).
Hypothesis
CompC'_ok :
forall (a b c : C') (g : subcat_Hom b c) (f : subcat_Hom a b),
Equal (subtype_image_inj (CompC' g f))
(comp_hom (subtype_image_inj g) (subtype_image_inj f)).
Definition subcat_Hom_comp :
forall a b c : C',
MAP (cart (subcat_Hom b c) (subcat_Hom a b)) (subcat_Hom a c).
intros a b c; try assumption.
apply
(Build_Map (A:=cart (subcat_Hom b c) (subcat_Hom a b)) (B:=
subcat_Hom a c)
(Ap:=fun x : cart (subcat_Hom b c) (subcat_Hom a b) =>
CompC' (proj1 x) (proj2 x))).
red in |- *.
intros x y H'; try assumption.
simpl in |- *.
unfold subtype_image_equal in |- *.
apply
Trans
with (comp_hom (subtype_image_inj (proj1 x)) (subtype_image_inj (proj2 x)));
auto with algebra.
apply
Trans
with (comp_hom (subtype_image_inj (proj1 y)) (subtype_image_inj (proj2 y)));
auto with algebra.
apply comp_hom_compatible.
cut (Equal (proj1 x) (proj1 y)).
auto with algebra.
auto with algebra.
cut (Equal (proj2 x) (proj2 y)).
auto with algebra.
auto with algebra.
Defined.
Definition subcat : category.
apply
(Build_category (Ob:=C') (Hom:=subcat_Hom) (Hom_comp:=subcat_Hom_comp)
(Hom_id:=idC')).
red in |- *.
unfold subcat_Hom_comp in |- *.
simpl in |- *.
unfold subtype_image_equal in |- *.
intros a b c d f g h; try assumption.
apply
Trans with (comp_hom (subtype_image_inj (CompC' h g)) (subtype_image_inj f));
auto with algebra.
apply
Trans
with
(comp_hom (comp_hom (subtype_image_inj h) (subtype_image_inj g))
(subtype_image_inj f)); auto with algebra.
apply
Trans with (comp_hom (subtype_image_inj h) (subtype_image_inj (CompC' g f)));
auto with algebra.
apply
Trans
with
(comp_hom (subtype_image_inj h)
(comp_hom (subtype_image_inj g) (subtype_image_inj f)));
auto with algebra.
red in |- *.
unfold subcat_Hom_comp in |- *.
simpl in |- *.
unfold subtype_image_equal in |- *.
intros a b f; try assumption.
apply
Trans with (comp_hom (subtype_image_inj (idC' b)) (subtype_image_inj f));
auto with algebra.
apply Trans with (comp_hom (Hom_id (i b)) (subtype_image_inj f));
auto with algebra.
red in |- *.
unfold subcat_Hom_comp in |- *.
simpl in |- *.
unfold subtype_image_equal in |- *.
intros a b f; try assumption.
apply
Trans with (comp_hom (subtype_image_inj f) (subtype_image_inj (idC' a)));
auto with algebra.
apply Trans with (comp_hom (subtype_image_inj f) (Hom_id (i a)));
auto with algebra.
Defined.
End Subcategory_def.