@@ -52,12 +52,12 @@ working with has natively.
52
52
53
53
## Implementation notes
54
54
55
- The typeclass `abelian` does not extend `non_preadditive_abelian`,
56
- to avoid having to deal with comparing the two `has_zero_morphisms` instances
57
- (one from `preadditive` in `abelian`, and the other a field of `non_preadditive_abelian`).
58
- As a consequence, at the beginning of this file we trivially build
59
- a `non_preadditive_abelian` instance from an `abelian` instance,
60
- and use this to restate a number of theorems,
55
+ The typeclass `abelian` does not extend `non_preadditive_abelian`,
56
+ to avoid having to deal with comparing the two `has_zero_morphisms` instances
57
+ (one from `preadditive` in `abelian`, and the other a field of `non_preadditive_abelian`).
58
+ As a consequence, at the beginning of this file we trivially build
59
+ a `non_preadditive_abelian` instance from an `abelian` instance,
60
+ and use this to restate a number of theorems,
61
61
in each case just reusing the proof from `non_preadditive_abelian.lean`.
62
62
63
63
We don't show this yet, but abelian categories are finitely complete and finitely cocomplete.
@@ -128,7 +128,8 @@ section to_non_preadditive_abelian
128
128
129
129
local attribute [instance] has_finite_biproducts
130
130
131
- @[priority 100 ] instance non_preadditive_abelian : non_preadditive_abelian C := { ..‹abelian C› }
131
+ /-- Every abelian category is, in particular, `non_preadditive_abelian`. -/
132
+ def non_preadditive_abelian : non_preadditive_abelian C := { ..‹abelian C› }
132
133
133
134
end to_non_preadditive_abelian
134
135
@@ -152,83 +153,92 @@ is_iso_of_mono_of_strong_epi _
152
153
end mono_epi_iso
153
154
154
155
section factor
156
+ local attribute [instance] non_preadditive_abelian
155
157
156
158
variables {P Q : C} (f : P ⟶ Q)
157
159
160
+ namespace images
161
+
158
162
/-- The kernel of the cokernel of `f` is called the image of `f`. -/
159
163
protected abbreviation image : C := kernel (cokernel.π f)
160
164
161
165
/-- The inclusion of the image into the codomain. -/
162
- protected abbreviation image.ι : abelian .image f ⟶ Q :=
166
+ protected abbreviation image.ι : images .image f ⟶ Q :=
163
167
kernel.ι (cokernel.π f)
164
168
165
169
/-- There is a canonical epimorphism `p : P ⟶ image f` for every `f`. -/
166
- protected abbreviation factor_thru_image : P ⟶ abelian .image f :=
170
+ protected abbreviation factor_thru_image : P ⟶ images .image f :=
167
171
kernel.lift (cokernel.π f) f $ cokernel.condition f
168
172
169
173
/-- `f` factors through its image via the canonical morphism `p`. -/
170
174
@[simp, reassoc] protected lemma image.fac :
171
- abelian .factor_thru_image f ≫ image.ι f = f :=
175
+ images .factor_thru_image f ≫ image.ι f = f :=
172
176
kernel.lift_ι _ _ _
173
177
174
178
/-- The map `p : P ⟶ image f` is an epimorphism -/
175
- instance : epi (abelian .factor_thru_image f) :=
179
+ instance : epi (images .factor_thru_image f) :=
176
180
show epi (non_preadditive_abelian.factor_thru_image f), by apply_instance
177
181
178
- instance mono_factor_thru_image [mono f] : mono (abelian .factor_thru_image f) :=
182
+ instance mono_factor_thru_image [mono f] : mono (images .factor_thru_image f) :=
179
183
mono_of_mono_fac $ image.fac f
180
184
181
- instance is_iso_factor_thru_image [mono f] : is_iso (abelian .factor_thru_image f) :=
185
+ instance is_iso_factor_thru_image [mono f] : is_iso (images .factor_thru_image f) :=
182
186
is_iso_of_mono_of_epi _
183
187
184
188
/-- Factoring through the image is a strong epi-mono factorisation. -/
185
189
@[simps] def image_strong_epi_mono_factorisation : strong_epi_mono_factorisation f :=
186
- { I := abelian .image f,
190
+ { I := images .image f,
187
191
m := image.ι f,
188
192
m_mono := by apply_instance,
189
- e := abelian .factor_thru_image f,
193
+ e := images .factor_thru_image f,
190
194
e_strong_epi := strong_epi_of_epi _ }
191
195
196
+ end images
197
+
198
+ namespace coimages
199
+
192
200
/-- The cokernel of the kernel of `f` is called the coimage of `f`. -/
193
201
protected abbreviation coimage : C := cokernel (kernel.ι f)
194
202
195
203
/-- The projection onto the coimage. -/
196
- protected abbreviation coimage.π : P ⟶ abelian .coimage f :=
204
+ protected abbreviation coimage.π : P ⟶ coimages .coimage f :=
197
205
cokernel.π (kernel.ι f)
198
206
199
207
/-- There is a canonical monomorphism `i : coimage f ⟶ Q`. -/
200
- protected abbreviation factor_thru_coimage : abelian .coimage f ⟶ Q :=
208
+ protected abbreviation factor_thru_coimage : coimages .coimage f ⟶ Q :=
201
209
cokernel.desc (kernel.ι f) f $ kernel.condition f
202
210
203
211
/-- `f` factors through its coimage via the canonical morphism `p`. -/
204
- protected lemma coimage.fac : coimage.π f ≫ abelian .factor_thru_coimage f = f :=
212
+ protected lemma coimage.fac : coimage.π f ≫ coimages .factor_thru_coimage f = f :=
205
213
cokernel.π_desc _ _ _
206
214
207
215
/-- The canonical morphism `i : coimage f ⟶ Q` is a monomorphism -/
208
- instance : mono (abelian .factor_thru_coimage f) :=
216
+ instance : mono (coimages .factor_thru_coimage f) :=
209
217
show mono (non_preadditive_abelian.factor_thru_coimage f), by apply_instance
210
218
211
- instance epi_factor_thru_coimage [epi f] : epi (abelian .factor_thru_coimage f) :=
219
+ instance epi_factor_thru_coimage [epi f] : epi (coimages .factor_thru_coimage f) :=
212
220
epi_of_epi_fac $ coimage.fac f
213
221
214
- instance is_iso_factor_thru_coimage [epi f] : is_iso (abelian .factor_thru_coimage f) :=
222
+ instance is_iso_factor_thru_coimage [epi f] : is_iso (coimages .factor_thru_coimage f) :=
215
223
is_iso_of_mono_of_epi _
216
224
217
225
/-- Factoring through the coimage is a strong epi-mono factorisation. -/
218
226
@[simps] def coimage_strong_epi_mono_factorisation : strong_epi_mono_factorisation f :=
219
- { I := abelian .coimage f,
220
- m := abelian .factor_thru_coimage f,
227
+ { I := coimages .coimage f,
228
+ m := coimages .factor_thru_coimage f,
221
229
m_mono := by apply_instance,
222
230
e := coimage.π f,
223
231
e_strong_epi := strong_epi_of_epi _ }
224
232
233
+ end coimages
234
+
225
235
end factor
226
236
227
237
section has_strong_epi_mono_factorisations
228
238
229
239
/-- An abelian category has strong epi-mono factorisations. -/
230
240
@[priority 100 ] instance : has_strong_epi_mono_factorisations C :=
231
- ⟨λ X Y f, image_strong_epi_mono_factorisation f⟩
241
+ ⟨λ X Y f, images. image_strong_epi_mono_factorisation f⟩
232
242
233
243
/- In particular, this means that it has well-behaved images. -/
234
244
example : has_images C := by apply_instance
@@ -239,22 +249,26 @@ end has_strong_epi_mono_factorisations
239
249
section images
240
250
variables {X Y : C} (f : X ⟶ Y)
241
251
242
- lemma image_eq_image : limits.image f = abelian .image f := rfl
252
+ lemma image_eq_image : limits.image f = images .image f := rfl
243
253
244
254
/-- There is a canonical isomorphism between the coimage and the image of a morphism. -/
245
- abbreviation coimage_iso_image : abelian .coimage f ≅ abelian .image f :=
246
- is_image.iso_ext (coimage_strong_epi_mono_factorisation f).to_mono_is_image
247
- (image_strong_epi_mono_factorisation f).to_mono_is_image
255
+ abbreviation coimage_iso_image : coimages .coimage f ≅ images .image f :=
256
+ is_image.iso_ext (coimages. coimage_strong_epi_mono_factorisation f).to_mono_is_image
257
+ (images. image_strong_epi_mono_factorisation f).to_mono_is_image
248
258
249
- lemma full_image_factorisation : coimage.π f ≫ (coimage_iso_image f).hom ≫ image.ι f = f :=
250
- by rw [limits.is_image.iso_ext_hom, ←image_strong_epi_mono_factorisation_to_mono_factorisation_m,
251
- is_image.lift_fac, coimage_strong_epi_mono_factorisation_to_mono_factorisation_m, coimage.fac]
259
+ lemma full_image_factorisation : coimages.coimage.π f ≫ (coimage_iso_image f).hom ≫
260
+ images.image.ι f = f :=
261
+ by rw [limits.is_image.iso_ext_hom,
262
+ ←images.image_strong_epi_mono_factorisation_to_mono_factorisation_m, is_image.lift_fac,
263
+ coimages.coimage_strong_epi_mono_factorisation_to_mono_factorisation_m, coimages.coimage.fac]
252
264
253
265
end images
254
266
255
267
section cokernel_of_kernel
256
268
variables {X Y : C} {f : X ⟶ Y}
257
269
270
+ local attribute [instance] non_preadditive_abelian
271
+
258
272
/-- In an abelian category, an epi is the cokernel of its kernel. More precisely:
259
273
If `f` is an epimorphism and `s` is some limit kernel cone on `f`, then `f` is a cokernel
260
274
of `fork.ι s`. -/
0 commit comments