Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 90d3386

Browse files
committed
feat(category_theory/kernels): compute kernel (f ≫ g) when one is an iso (#3438)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 39f8f02 commit 90d3386

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

src/category_theory/limits/shapes/kernels.lean

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,46 @@ lemma kernel_not_epi_of_nonzero (w : f ≠ 0) : ¬epi (kernel.ι f) :=
190190
lemma kernel_not_iso_of_nonzero (w : f ≠ 0) : (is_iso (kernel.ι f)) → false :=
191191
λ I, kernel_not_epi_of_nonzero w $ by { resetI, apply_instance }
192192

193+
/--
194+
When `g` is an isomorphism, the kernel of `f ≫ g` is isomorphic to the kernel of `f`.
195+
-/
196+
@[simps]
197+
def kernel_comp_is_iso {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
198+
[has_kernel (f ≫ g)] [has_kernel f] [is_iso g] :
199+
kernel (f ≫ g) ≅ kernel f :=
200+
{ hom := kernel.lift _ (kernel.ι _) (by { rw [←cancel_mono g], simp, }),
201+
inv := kernel.lift _ (kernel.ι _) (by simp), }
202+
203+
lemma kernel_comp_is_iso_hom_comp_kernel_ι {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
204+
[has_kernel (f ≫ g)] [has_kernel f] [is_iso g] :
205+
(kernel_comp_is_iso f g).hom ≫ kernel.ι f = kernel.ι (f ≫ g) :=
206+
by simp
207+
208+
lemma kernel_comp_is_iso_inv_comp_kernel_ι {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
209+
[has_kernel (f ≫ g)] [has_kernel f] [is_iso g] :
210+
(kernel_comp_is_iso f g).inv ≫ kernel.ι (f ≫ g) = kernel.ι f :=
211+
by simp
212+
213+
/--
214+
When `f` is an isomorphism, the kernel of `f ≫ g` is isomorphic to the kernel of `g`.
215+
-/
216+
@[simps]
217+
def kernel_is_iso_comp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
218+
[has_kernel (f ≫ g)] [is_iso f] [has_kernel g] :
219+
kernel (f ≫ g) ≅ kernel g :=
220+
{ hom := kernel.lift _ (kernel.ι _ ≫ f) (by simp),
221+
inv := kernel.lift _ (kernel.ι _ ≫ inv f) (by simp), }
222+
223+
lemma kernel_is_iso_comp_hom_comp_kernel_ι {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
224+
[has_kernel (f ≫ g)] [is_iso f] [has_kernel g] :
225+
(kernel_is_iso_comp f g).hom ≫ kernel.ι g = kernel.ι (f ≫ g) ≫ f :=
226+
by simp
227+
228+
lemma kernel_is_iso_comp_inv_comp_kernel_ι {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
229+
[has_kernel (f ≫ g)] [is_iso f] [has_kernel g] :
230+
(kernel_is_iso_comp f g).inv ≫ kernel.ι (f ≫ g) = kernel.ι g ≫ (inv f) :=
231+
by simp
232+
193233
end
194234

195235
section has_zero_object
@@ -396,6 +436,47 @@ lemma cokernel_not_mono_of_nonzero (w : f ≠ 0) : ¬mono (cokernel.π f) :=
396436
lemma cokernel_not_iso_of_nonzero (w : f ≠ 0) : (is_iso (cokernel.π f)) → false :=
397437
λ I, cokernel_not_mono_of_nonzero w $ by { resetI, apply_instance }
398438

439+
/--
440+
When `g` is an isomorphism, the cokernel of `f ≫ g` is isomorphic to the cokernel of `f`.
441+
-/
442+
@[simps]
443+
def cokernel_comp_is_iso {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
444+
[has_cokernel (f ≫ g)] [has_cokernel f] [is_iso g] :
445+
cokernel (f ≫ g) ≅ cokernel f :=
446+
{ hom := cokernel.desc _ (inv g ≫ cokernel.π f) (by simp),
447+
inv := cokernel.desc _ (g ≫ cokernel.π (f ≫ g)) (by rw [←category.assoc, cokernel.condition]), }
448+
449+
lemma cokernel_π_comp_cokernel_comp_is_iso_hom {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
450+
[has_cokernel (f ≫ g)] [has_cokernel f] [is_iso g] :
451+
cokernel.π (f ≫ g) ≫ (cokernel_comp_is_iso f g).hom = inv g ≫ cokernel.π f :=
452+
by simp
453+
454+
lemma cokernel_π_comp_cokernel_comp_is_iso_inv {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
455+
[has_cokernel (f ≫ g)] [has_cokernel f] [is_iso g] :
456+
cokernel.π f ≫ (cokernel_comp_is_iso f g).inv = g ≫ cokernel.π (f ≫ g) :=
457+
by simp
458+
459+
/--
460+
When `f` is an isomorphism, the cokernel of `f ≫ g` is isomorphic to the cokernel of `g`.
461+
-/
462+
@[simps]
463+
def cokernel_is_iso_comp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
464+
[has_cokernel (f ≫ g)] [is_iso f] [has_cokernel g] :
465+
cokernel (f ≫ g) ≅ cokernel g :=
466+
{ hom := cokernel.desc _ (cokernel.π g) (by simp),
467+
inv := cokernel.desc _ (cokernel.π (f ≫ g)) (by { rw [←cancel_epi f, ←category.assoc], simp, }), }
468+
469+
470+
lemma cokernel_π_comp_cokernel_is_iso_comp_hom {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
471+
[has_cokernel (f ≫ g)] [is_iso f] [has_cokernel g] :
472+
cokernel.π (f ≫ g) ≫ (cokernel_is_iso_comp f g).hom = cokernel.π g :=
473+
by simp
474+
475+
lemma cokernel_π_comp_cokernel_is_iso_comp_inv {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
476+
[has_cokernel (f ≫ g)] [is_iso f] [has_cokernel g] :
477+
cokernel.π g ≫ (cokernel_is_iso_comp f g).inv = cokernel.π (f ≫ g) :=
478+
by simp
479+
399480
end
400481

401482
section has_zero_object

0 commit comments

Comments
 (0)