Skip to content

Commit 34c5b08

Browse files
committed
feat(CategoryTheory): results abouts kernels and pullback squares (leanprover-community#34495)
In a pullback square, the kernel of the top map identifies to the kernel of the bottom map. If the category is abelian and a square is pushout, the morphism from the kernel of the top map to the kernel of the bottom map is an epimorphism. Dual results are also obtained.
1 parent 409fcdc commit 34c5b08

5 files changed

Lines changed: 123 additions & 10 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2731,6 +2731,7 @@ public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback
27312731
public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic
27322732
public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.BicartesianSq
27332733
public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Defs
2734+
public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Kernels
27342735
public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Iso
27352736
public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Mono
27362737
public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.Pasting

Mathlib/CategoryTheory/Abelian/CommSq.lean

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Joël Riou
66
module
77

88
public import Mathlib.CategoryTheory.Abelian.Refinements
9+
public import Mathlib.CategoryTheory.MorphismProperty.Limits
910
public import Mathlib.Algebra.Homology.CommSq
1011

1112
/-!
@@ -14,13 +15,16 @@ public import Mathlib.Algebra.Homology.CommSq
1415
Consider a pushout square in an abelian category:
1516
1617
```
17-
X₁ ⟶ X₂
18-
| |
19-
v v
20-
X₃ ⟶ X₄
18+
t
19+
X₁ ⟶ X₂
20+
l| |r
21+
v v
22+
X₃ ⟶ X₄
23+
b
2124
```
2225
2326
We study the associated exact sequence `X₁ ⟶ X₂ ⊞ X₃ ⟶ X₄ ⟶ 0`.
27+
We also show that the induced morphism `kernel t ⟶ kernel b` is an epimorphism.
2428
2529
-/
2630

@@ -32,8 +36,19 @@ namespace CategoryTheory
3236

3337
open Category Limits
3438

35-
variable {C : Type u} [Category.{v} C] [Abelian C] {X₁ X₂ X₃ X₄ : C}
36-
{t : X₁ ⟶ X₂} {l : X₁ ⟶ X₃} {r : X₂ ⟶ X₄} {b : X₃ ⟶ X₄}
39+
variable {C : Type u} [Category.{v} C] [Abelian C]
40+
41+
namespace Abelian
42+
43+
instance : (MorphismProperty.monomorphisms C).IsStableUnderCobaseChange :=
44+
.mk' (fun _ _ _ _ _ _ (_ : Mono _) ↦ inferInstanceAs (Mono _))
45+
46+
instance : (MorphismProperty.epimorphisms C).IsStableUnderBaseChange :=
47+
.mk' (fun _ _ _ _ _ _ (_ : Epi _) ↦ inferInstanceAs (Epi _))
48+
49+
end Abelian
50+
51+
variable {X₁ X₂ X₃ X₄ : C} {t : X₁ ⟶ X₂} {l : X₁ ⟶ X₃} {r : X₂ ⟶ X₄} {b : X₃ ⟶ X₄}
3752

3853
namespace IsPushout
3954

@@ -113,5 +128,36 @@ statement to `IsPushout.hom_eq_add_up_to_refinements`.
113128

114129
end IsPullback
115130

131+
namespace Abelian
132+
133+
variable {X₁ X₂ X₃ X₄ : C} {t : X₁ ⟶ X₂} {l : X₁ ⟶ X₃} {r : X₂ ⟶ X₄} {b : X₃ ⟶ X₄}
134+
135+
lemma mono_cokernel_map_of_isPullback (sq : IsPullback t l r b) :
136+
Mono (cokernel.map _ _ _ _ sq.w) := by
137+
rw [Preadditive.mono_iff_cancel_zero]
138+
intro A₀ z hz
139+
obtain ⟨A₁, π₁, _, x₂, hx₂⟩ :=
140+
surjective_up_to_refinements_of_epi (cokernel.π t) z
141+
have : (ShortComplex.mk _ _ (cokernel.condition b)).Exact :=
142+
ShortComplex.exact_of_g_is_cokernel _ (cokernelIsCokernel b)
143+
obtain ⟨A₂, π₂, _, x₃, hx₃⟩ := this.exact_up_to_refinements (x₂ ≫ r) (by
144+
simpa [hz] using hx₂.symm =≫ cokernel.map _ _ _ _ sq.w)
145+
obtain ⟨x₁, hx₁, rfl⟩ := sq.exists_lift (π₂ ≫ x₂) x₃ (by simpa)
146+
simp [← cancel_epi π₁, ← cancel_epi π₂, hx₂, ← reassoc_of% hx₁]
147+
148+
lemma epi_kernel_map_of_isPushout (sq : IsPushout t l r b) :
149+
Epi (kernel.map _ _ _ _ sq.w) := by
150+
rw [epi_iff_surjective_up_to_refinements]
151+
intro A₀ z
152+
obtain ⟨A₁, π₁, _, x₁, hx₁⟩ := ((ShortComplex.mk _ _
153+
sq.cokernelCofork.condition).exact_of_g_is_cokernel
154+
sq.isColimitCokernelCofork).exact_up_to_refinements
155+
(z ≫ kernel.ι _ ≫ biprod.inr) (by simp)
156+
refine ⟨A₁, π₁, inferInstance, -kernel.lift _ x₁ ?_, ?_⟩
157+
· simpa using hx₁.symm =≫ biprod.fst
158+
· ext
159+
simpa using hx₁ =≫ biprod.snd
160+
161+
end Abelian
116162

117163
end CategoryTheory

Mathlib/CategoryTheory/Galois/Examples.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ instance : GaloisCategory (Action FintypeCat G) where
107107

108108
/-- The `G`-action on a connected finite `G`-set is transitive. -/
109109
theorem Action.pretransitive_of_isConnected (X : Action FintypeCat G)
110-
[IsConnected X] : MulAction.IsPretransitive G X.V where
110+
[PreGaloisCategory.IsConnected X] : MulAction.IsPretransitive G X.V where
111111
exists_smul_eq x y := by
112112
/- We show that the `G`-orbit of `x` is a non-initial subobject of `X` and hence by
113113
connectedness, the orbit equals `X.V`. -/
@@ -131,7 +131,7 @@ theorem Action.pretransitive_of_isConnected (X : Action FintypeCat G)
131131
/-- A nonempty `G`-set with transitive `G`-action is connected. -/
132132
theorem Action.isConnected_of_transitive (X : FintypeCat) [MulAction G X]
133133
[MulAction.IsPretransitive G X] [h : Nonempty X] :
134-
IsConnected (Action.FintypeCat.ofMulAction G X) where
134+
PreGaloisCategory.IsConnected (Action.FintypeCat.ofMulAction G X) where
135135
notInitial := not_initial_of_inhabited (Action.forget _ _) h.some
136136
noTrivialComponent Y i hm hni := by
137137
/- We show that the induced inclusion `i.hom` of finite sets is surjective, using the
@@ -151,15 +151,15 @@ theorem Action.isConnected_of_transitive (X : FintypeCat) [MulAction G X]
151151

152152
/-- A nonempty finite `G`-set is connected if and only if the `G`-action is transitive. -/
153153
theorem Action.isConnected_iff_transitive (X : Action FintypeCat G) [Nonempty X.V] :
154-
IsConnected X ↔ MulAction.IsPretransitive G X.V :=
154+
PreGaloisCategory.IsConnected X ↔ MulAction.IsPretransitive G X.V :=
155155
fun _ ↦ pretransitive_of_isConnected G X, fun _ ↦ isConnected_of_transitive G X.V⟩
156156

157157
variable {G}
158158

159159
/-- If `X` is a connected `G`-set and `x` is an element of `X`, `X` is isomorphic
160160
to the quotient of `G` by the stabilizer of `x` as `G`-sets. -/
161161
noncomputable def isoQuotientStabilizerOfIsConnected (X : Action FintypeCat G)
162-
[IsConnected X] (x : X.V) [Fintype (G ⧸ (MulAction.stabilizer G x))] :
162+
[PreGaloisCategory.IsConnected X] (x : X.V) [Fintype (G ⧸ (MulAction.stabilizer G x))] :
163163
X ≅ G ⧸ₐ MulAction.stabilizer G x :=
164164
haveI : MulAction.IsPretransitive G X.V := Action.pretransitive_of_isConnected G X
165165
let e : X.V ≃ G ⧸ MulAction.stabilizer G x :=

Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ lemma kernel.map_id {X Y : C} (f : X ⟶ Y) [HasKernel f] (q : Y ⟶ Y)
314314
(w : f ≫ q = 𝟙 _ ≫ f) : kernel.map f f (𝟙 _) q w = 𝟙 _ := by
315315
cat_disch
316316

317+
instance {X' Y' : C} (f' : X' ⟶ Y') [HasKernel f'] (p : X ⟶ X') (q : Y ⟶ Y')
318+
(w : f ≫ q = p ≫ f') [IsIso p] [Mono q] :
319+
IsIso (kernel.map _ _ _ _ w) :=
320+
⟨kernel.lift _ (kernel.ι f' ≫ inv p) (by simp [← cancel_mono q, w]),
321+
by cat_disch, by cat_disch⟩
322+
317323
/-- Given a commutative diagram
318324
```
319325
X --f--> Y --g--> Z
@@ -802,6 +808,12 @@ abbrev cokernel.map {X' Y' : C} (f' : X' ⟶ Y') [HasCokernel f'] (p : X ⟶ X')
802808
apply congrArg (· ≫ π f') w
803809
simp [this])
804810

811+
instance {X' Y' : C} (f' : X' ⟶ Y') [HasCokernel f'] (p : X ⟶ X') (q : Y ⟶ Y')
812+
(w : f ≫ q = p ≫ f') [Epi p] [IsIso q] :
813+
IsIso (cokernel.map _ _ _ _ w) :=
814+
⟨cokernel.desc _ (inv q ≫ cokernel.π f) (by simp [← cancel_epi p, ← reassoc_of% w]),
815+
by cat_disch, by cat_disch⟩
816+
805817
@[simp]
806818
lemma cokernel.map_id {X Y : C} (f : X ⟶ Y) [HasCokernel f] (q : X ⟶ X)
807819
(w : f ≫ 𝟙 _ = q ≫ f) : cokernel.map f f q (𝟙 _) w = 𝟙 _ := by
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/-
2+
Copyright (c) 2026 Joël Riou. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Joël Riou
5+
-/
6+
module
7+
8+
public import Mathlib.CategoryTheory.Limits.Shapes.Kernels
9+
public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic
10+
11+
/-!
12+
# Horizontal maps in a pullback square have the same kernel
13+
14+
Consider a commutative square:
15+
```
16+
t
17+
X₁ --> X₂
18+
l| |r
19+
v v
20+
X₃ --> X₄
21+
b
22+
```
23+
* If this is a pullback square, then the induced map `kernel t ⟶ kernel b`
24+
is an isomorphism.
25+
* If this is a pushout square, then the induced map `cokernel t ⟶ cokernel b`
26+
is an isomorphism.
27+
28+
(Similar results for the (co)kernels of the vertical maps can be obtained
29+
by applying these results to the flipped square.)
30+
31+
-/
32+
33+
@[expose] public section
34+
35+
universe v v' u u'
36+
37+
namespace CategoryTheory.Limits
38+
39+
variable {C : Type*} [Category* C] [HasZeroMorphisms C]
40+
{X₁ X₂ X₃ X₄ : C} {t : X₁ ⟶ X₂} {l : X₁ ⟶ X₃} {r : X₂ ⟶ X₄} {b : X₃ ⟶ X₄}
41+
42+
lemma isIso_kernel_map_of_isPullback [HasKernel t] [HasKernel b]
43+
(sq : IsPullback t l r b) :
44+
IsIso (kernel.map _ _ _ _ sq.w) :=
45+
⟨kernel.lift _ (sq.lift 0 (kernel.ι b) (by simp)) (by simp),
46+
by ext; exact sq.hom_ext (by cat_disch) (by cat_disch), by cat_disch⟩
47+
48+
lemma isIso_cokernel_map_of_isPushout [HasCokernel t] [HasCokernel b]
49+
(sq : IsPushout t l r b) :
50+
IsIso (cokernel.map _ _ _ _ sq.w) :=
51+
⟨cokernel.desc _ (sq.desc (cokernel.π t) 0 (by simp)) (by simp),
52+
by cat_disch, by ext; exact sq.hom_ext (by cat_disch) (by cat_disch)⟩
53+
54+
end CategoryTheory.Limits

0 commit comments

Comments
 (0)