|
1 | 1 | From HoTT Require Import Basics Types. |
2 | | -From HoTT.WildCat Require Import Core Opposite Bifunctor Square Equiv. |
| 2 | +From HoTT.WildCat Require Import Core Opposite Bifunctor AbEnriched. |
3 | 3 | Require Import HSet Truncations.Core Modalities.ReflectiveSubuniverse. |
4 | | -Require Import Groups.Group Groups.QuotientGroup AbelianGroup Biproduct. |
| 4 | +Require Import Groups.Group AbelianGroup Biproduct. |
5 | 5 |
|
6 | 6 | (** * Homomorphisms from a group to an abelian group form an abelian group. *) |
7 | 7 |
|
@@ -38,126 +38,6 @@ Proof. |
38 | 38 | apply commutativity. |
39 | 39 | Defined. |
40 | 40 |
|
41 | | -(** ** Coequalizers *) |
42 | | - |
43 | | -(** Using the cokernel and addition and negation for the homs of abelian groups, we can define the coequalizer of two group homomorphisms as the cokernel of their difference. *) |
44 | | -Definition ab_coeq {A B : AbGroup} (f g : A $-> B) |
45 | | - := ab_cokernel ((-f) + g). |
46 | | - |
47 | | -Definition ab_coeq_in {A B : AbGroup} {f g : A $-> B} : B $-> ab_coeq f g. |
48 | | -Proof. |
49 | | - exact grp_quotient_map. |
50 | | -Defined. |
51 | | - |
52 | | -Definition ab_coeq_glue {A B : AbGroup} {f g : A $-> B} |
53 | | - : ab_coeq_in (f:=f) (g:=g) $o f $== ab_coeq_in $o g. |
54 | | -Proof. |
55 | | - intros x. |
56 | | - napply qglue. |
57 | | - apply tr. |
58 | | - by exists x. |
59 | | -Defined. |
60 | | - |
61 | | -Definition ab_coeq_rec {A B : AbGroup} {f g : A $-> B} |
62 | | - {C : AbGroup} (i : B $-> C) (p : i $o f $== i $o g) |
63 | | - : ab_coeq f g $-> C. |
64 | | -Proof. |
65 | | - snapply (grp_quotient_rec _ _ i). |
66 | | - cbn. |
67 | | - intros b H. |
68 | | - strip_truncations. |
69 | | - destruct H as [a q]. |
70 | | - destruct q; simpl. |
71 | | - lhs napply grp_homo_op. |
72 | | - lhs napply (ap (+ _)). |
73 | | - 1: apply grp_homo_inv. |
74 | | - apply grp_moveL_M1^-1. |
75 | | - exact (p a)^. |
76 | | -Defined. |
77 | | - |
78 | | -Definition ab_coeq_rec_beta_in {A B : AbGroup} {f g : A $-> B} |
79 | | - {C : AbGroup} (i : B $-> C) (p : i $o f $== i $o g) |
80 | | - : ab_coeq_rec i p $o ab_coeq_in $== i |
81 | | - := fun _ => idpath. |
82 | | - |
83 | | -Definition ab_coeq_ind_hprop {A B f g} (P : @ab_coeq A B f g -> Type) |
84 | | - `{forall x, IsHProp (P x)} |
85 | | - (i : forall b, P (ab_coeq_in b)) |
86 | | - : forall x, P x. |
87 | | -Proof. |
88 | | - rapply Quotient_ind_hprop. |
89 | | - exact i. |
90 | | -Defined. |
91 | | - |
92 | | -Definition ab_coeq_ind_homotopy {A B C f g} |
93 | | - {l r : @ab_coeq A B f g $-> C} |
94 | | - (p : l $o ab_coeq_in $== r $o ab_coeq_in) |
95 | | - : l $== r. |
96 | | -Proof. |
97 | | - srapply ab_coeq_ind_hprop. |
98 | | - exact p. |
99 | | -Defined. |
100 | | - |
101 | | -Definition functor_ab_coeq {A B : AbGroup} {f g : A $-> B} {A' B' : AbGroup} {f' g' : A' $-> B'} |
102 | | - (a : A $-> A') (b : B $-> B') (p : f' $o a $== b $o f) (q : g' $o a $== b $o g) |
103 | | - : ab_coeq f g $-> ab_coeq f' g'. |
104 | | -Proof. |
105 | | - snapply ab_coeq_rec. |
106 | | - 1: exact (ab_coeq_in $o b). |
107 | | - refine (cat_assoc _ _ _ $@ _ $@ cat_assoc_opp _ _ _). |
108 | | - refine ((_ $@L p^$) $@ _ $@ (_ $@L q)). |
109 | | - refine (cat_assoc_opp _ _ _ $@ (_ $@R a) $@ cat_assoc _ _ _). |
110 | | - exact ab_coeq_glue. |
111 | | -Defined. |
112 | | - |
113 | | -Definition functor2_ab_coeq {A B : AbGroup} {f g : A $-> B} {A' B' : AbGroup} {f' g' : A' $-> B'} |
114 | | - {a a' : A $-> A'} {b b' : B $-> B'} |
115 | | - (p : f' $o a $== b $o f) (q : g' $o a $== b $o g) |
116 | | - (p' : f' $o a' $== b' $o f) (q' : g' $o a' $== b' $o g) |
117 | | - (s : b $== b') |
118 | | - : functor_ab_coeq a b p q $== functor_ab_coeq a' b' p' q'. |
119 | | -Proof. |
120 | | - snapply ab_coeq_ind_homotopy. |
121 | | - intros x. |
122 | | - exact (ap ab_coeq_in (s x)). |
123 | | -Defined. |
124 | | - |
125 | | -Definition functor_ab_coeq_compose {A B : AbGroup} {f g : A $-> B} |
126 | | - {A' B' : AbGroup} {f' g' : A' $-> B'} |
127 | | - (a : A $-> A') (b : B $-> B') (p : f' $o a $== b $o f) (q : g' $o a $== b $o g) |
128 | | - {A'' B'' : AbGroup} {f'' g'' : A'' $-> B''} |
129 | | - (a' : A' $-> A'') (b' : B' $-> B'') |
130 | | - (p' : f'' $o a' $== b' $o f') (q' : g'' $o a' $== b' $o g') |
131 | | - : functor_ab_coeq a' b' p' q' $o functor_ab_coeq a b p q |
132 | | - $== functor_ab_coeq (a' $o a) (b' $o b) (hconcat p p') (hconcat q q'). |
133 | | -Proof. |
134 | | - snapply ab_coeq_ind_homotopy. |
135 | | - simpl; reflexivity. |
136 | | -Defined. |
137 | | - |
138 | | -Definition functor_ab_coeq_id {A B : AbGroup} (f g : A $-> B) |
139 | | - : functor_ab_coeq (Id _) (Id _) (hrefl f) (hrefl g) $== Id _. |
140 | | -Proof. |
141 | | - snapply ab_coeq_ind_homotopy. |
142 | | - reflexivity. |
143 | | -Defined. |
144 | | - |
145 | | -Definition grp_iso_ab_coeq {A B : AbGroup} {f g : A $-> B} |
146 | | - {A' B' : AbGroup} {f' g' : A' $-> B'} |
147 | | - (a : A $<~> A') (b : B $<~> B') (p : f' $o a $== b $o f) (q : g' $o a $== b $o g) |
148 | | - : ab_coeq f g $<~> ab_coeq f' g'. |
149 | | -Proof. |
150 | | - snapply cate_adjointify. |
151 | | - - exact (functor_ab_coeq a b p q). |
152 | | - - exact (functor_ab_coeq a^-1$ b^-1$ (hinverse a _ p) (hinverse a _ q)). |
153 | | - - nrefine (functor_ab_coeq_compose _ _ _ _ _ _ _ _ |
154 | | - $@ functor2_ab_coeq _ _ _ _ _ $@ functor_ab_coeq_id _ _). |
155 | | - exact (cate_isretr b). |
156 | | - - nrefine (functor_ab_coeq_compose _ _ _ _ _ _ _ _ |
157 | | - $@ functor2_ab_coeq _ _ _ _ _ $@ functor_ab_coeq_id _ _). |
158 | | - exact (cate_issect b). |
159 | | -Defined. |
160 | | - |
161 | 41 | (** ** The bifunctor [ab_hom] *) |
162 | 42 |
|
163 | 43 | Instance is0functor_ab_hom01 `{Funext} {A : Group^op} |
@@ -220,6 +100,34 @@ Proof. |
220 | 100 | by apply equiv_path_grouphomomorphism. |
221 | 101 | Defined. |
222 | 102 |
|
| 103 | +(** ** [AbGroup] has a wild enrichment in wild abelian groups *) |
| 104 | + |
| 105 | +(** Using arguments very similar to the above, but without using [Funext], we can show that [AbGroup] is enriched in the wild sense. We could use this combined with [Funext] to deduce the results above, but we wouldn't get the extra generality where the domain group does not need to be abelian. And conversely we don't want to use the above results here, since we don't need to rely on [Funext]. *) |
| 106 | + |
| 107 | +Instance abenriched_abgroup : IsAbEnriched AbGroup. |
| 108 | +Proof. |
| 109 | + snapply Build_IsAbEnriched. |
| 110 | + - intros A B. |
| 111 | + snapply (Build_IsAbGroup_0gpd _ _ _ _ sgop_hom grp_homo_const inverse_hom). |
| 112 | + 3-8: hnf; intros; intro; cbn. |
| 113 | + + srapply Build_Is0Bifunctor'. |
| 114 | + snapply Build_Is0Functor. |
| 115 | + intros [f f'] [g g'] [p p'] a; cbn in *. |
| 116 | + exact (ap011 _ (p a) (p' a)). |
| 117 | + + snapply Build_Is0Functor. |
| 118 | + intros f g p a; cbn. |
| 119 | + apply (ap _ (p a)). |
| 120 | + + symmetry; apply associativity. |
| 121 | + + apply left_identity. |
| 122 | + + apply right_identity. |
| 123 | + + apply left_inverse. |
| 124 | + + apply right_inverse. |
| 125 | + + apply commutativity. |
| 126 | + - intros A B C g f f' a; cbn. |
| 127 | + apply grp_homo_op. |
| 128 | + - intros A B C f g g' a; cbn. reflexivity. |
| 129 | +Defined. |
| 130 | + |
223 | 131 | (** ** Properties of [ab_hom] *) |
224 | 132 |
|
225 | 133 | (** Precomposition with a surjection is an embedding. *) |
|
0 commit comments