Skip to content

Commit 4a2711a

Browse files
committed
feat(CategoryTheory): effective epi implies strong epi (#31860)
Also: * Import `EffectiveEpi.Basic` in the file defining `RegularEpi`, and prove the relationship there. * Fix some names and golf some proofs in `EffectiveEpi.Basic`
1 parent 312eeb7 commit 4a2711a

File tree

3 files changed

+71
-85
lines changed

3 files changed

+71
-85
lines changed

Mathlib/CategoryTheory/EffectiveEpi/Basic.lean

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ our notion of `EffectiveEpi` is often called "strict epi" in the literature.
3939

4040
namespace CategoryTheory
4141

42-
open Limits
42+
open Limits Category
4343

4444
variable {C : Type*} [Category C]
4545

@@ -95,13 +95,21 @@ lemma EffectiveEpi.uniq {X Y W : C} (f : Y ⟶ X) [EffectiveEpi f]
9595
m = EffectiveEpi.desc f e h :=
9696
(EffectiveEpi.getStruct f).uniq e h _ hm
9797

98-
instance epiOfEffectiveEpi {X Y : C} (f : Y ⟶ X) [EffectiveEpi f] : Epi f := by
99-
constructor
100-
intro W m₁ m₂ h
101-
have : m₂ = EffectiveEpi.desc f (f ≫ m₂)
102-
(fun {Z} g₁ g₂ h => by simp only [← Category.assoc, h]) := EffectiveEpi.uniq _ _ _ _ rfl
103-
rw [this]
104-
exact EffectiveEpi.uniq _ _ _ _ h
98+
open EffectiveEpi Category
99+
100+
instance epi_of_effectiveEpi {X Y : C} (f : Y ⟶ X) [EffectiveEpi f] : Epi f where
101+
left_cancellation m₁ m₂ h := by
102+
rw [show m₂ = desc f (f ≫ m₂) (fun _ _ h => by simp [← assoc, h]) from uniq _ _ _ _ rfl]
103+
exact uniq _ _ _ _ h
104+
105+
@[deprecated (since := "2025-11-20")] alias epiOfEffectiveEpi := epi_of_effectiveEpi
106+
107+
instance (priority := 100) strongEpi_of_effectiveEpi {X Y : C} (f : X ⟶ Y) [EffectiveEpi f] :
108+
StrongEpi f :=
109+
StrongEpi.mk' fun A B z hz u v sq ↦
110+
have : ∀ {Z : C} (g₁ g₂ : Z ⟶ X), g₁ ≫ f = g₂ ≫ f → g₁ ≫ u = g₂ ≫ u := fun _ _ h ↦ by
111+
simpa [← sq.w, cancel_mono_assoc_iff] using h =≫ v
112+
CommSq.HasLift.mk' ⟨desc f u this, fac f u this, (cancel_epi f).1 ((by simp [← sq.w]))⟩
105113

106114
/--
107115
This structure encodes the data required for a family of morphisms to be effective epimorphic.
@@ -171,7 +179,7 @@ lemma EffectiveEpiFamily.hom_ext {B W : C} {α : Type*} (X : α → C) (π : (a
171179
[EffectiveEpiFamily X π] (m₁ m₂ : B ⟶ W) (h : ∀ a, π a ≫ m₁ = π a ≫ m₂) :
172180
m₁ = m₂ := by
173181
have : m₂ = EffectiveEpiFamily.desc X π (fun a => π a ≫ m₂)
174-
(fun a₁ a₂ g₁ g₂ h => by simp only [← Category.assoc, h]) := by
182+
(fun a₁ a₂ g₁ g₂ h => by simp only [← assoc, h]) := by
175183
apply EffectiveEpiFamily.uniq; intro; rfl
176184
rw [this]
177185
exact EffectiveEpiFamily.uniq _ _ _ _ _ h
@@ -224,7 +232,7 @@ def effectiveEpiFamilyStructOfIsIsoDesc {B : C} {α : Type*} (X : α → C)
224232
intro a
225233
have : π a = Sigma.ι X a ≫ (asIso (Sigma.desc π)).hom := by simp only [asIso_hom,
226234
colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
227-
rw [this, Category.assoc]
235+
rw [this, assoc]
228236
simp only [asIso_hom, asIso_inv, IsIso.hom_inv_id_assoc, colimit.ι_desc, Cofan.mk_pt,
229237
Cofan.mk_ι_app]
230238
uniq e h m hm := by

Mathlib/CategoryTheory/EffectiveEpi/RegularEpi.lean

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,5 @@ Authors: Dagur Asgeirsson
66
module
77

88
public import Mathlib.CategoryTheory.Limits.Shapes.RegularMono
9-
public import Mathlib.CategoryTheory.EffectiveEpi.Basic
10-
/-!
119

12-
# The relationship between effective and regular epimorphisms.
13-
14-
This file proves that the notions of regular epi and effective epi are equivalent for morphisms with
15-
kernel pairs, and that regular epi implies effective epi in general.
16-
-/
17-
18-
@[expose] public section
19-
20-
namespace CategoryTheory
21-
22-
open Limits RegularEpi
23-
24-
variable {C : Type*} [Category C]
25-
26-
/-- The data of an `EffectiveEpi` structure on a `RegularEpi`. -/
27-
def effectiveEpiStructOfRegularEpi {B X : C} (f : X ⟶ B) [RegularEpi f] :
28-
EffectiveEpiStruct f where
29-
desc _ h := Cofork.IsColimit.desc isColimit _ (h _ _ w)
30-
fac _ _ := Cofork.IsColimit.π_desc' isColimit _ _
31-
uniq _ _ _ hg := Cofork.IsColimit.hom_ext isColimit (hg.trans
32-
(Cofork.IsColimit.π_desc' _ _ _).symm)
33-
34-
instance {B X : C} (f : X ⟶ B) [RegularEpi f] : EffectiveEpi f :=
35-
⟨⟨effectiveEpiStructOfRegularEpi f⟩⟩
36-
37-
/-- A morphism which is a coequalizer for its kernel pair is an effective epi. -/
38-
theorem effectiveEpiOfKernelPair {B X : C} (f : X ⟶ B) [HasPullback f f]
39-
(hc : IsColimit (Cofork.ofπ f pullback.condition)) : EffectiveEpi f :=
40-
let _ := regularEpiOfKernelPair f hc
41-
inferInstance
42-
43-
/-- An effective epi which has a kernel pair is a regular epi. -/
44-
noncomputable instance regularEpiOfEffectiveEpi {B X : C} (f : X ⟶ B) [HasPullback f f]
45-
[EffectiveEpi f] : RegularEpi f where
46-
W := pullback f f
47-
left := pullback.fst f f
48-
right := pullback.snd f f
49-
w := pullback.condition
50-
isColimit := {
51-
desc := fun s ↦ EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
52-
simp only [Cofork.app_one_eq_π]
53-
rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
54-
simp)
55-
fac := by
56-
intro s j
57-
have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
58-
simp only [Cofork.app_one_eq_π]
59-
rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
60-
simp)
61-
simp only [Functor.const_obj_obj, Cofork.app_one_eq_π] at this
62-
cases j with
63-
| zero => simp [this]
64-
| one => simp [this]
65-
uniq := fun _ _ h ↦ EffectiveEpi.uniq f _ _ _ (h WalkingParallelPair.one) }
66-
67-
end CategoryTheory
10+
deprecated_module (since := "2025-11-20")

Mathlib/CategoryTheory/Limits/Shapes/RegularMono.lean

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ Authors: Kim Morrison, Bhavik Mehta
55
-/
66
module
77

8+
public import Mathlib.CategoryTheory.EffectiveEpi.Basic
89
public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.HasPullback
9-
public import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi
1010
public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers
11-
public import Mathlib.CategoryTheory.MorphismProperty.Basic
1211
public import Mathlib.CategoryTheory.MorphismProperty.Composition
13-
public import Mathlib.Lean.Expr.Basic
1412

1513
/-!
1614
# Definitions and basic properties of regular monomorphisms and epimorphisms.
@@ -27,8 +25,12 @@ and constructions
2725
* `RegularMono f → Mono f`
2826
as well as the dual definitions/constructions for regular epimorphisms.
2927
30-
Additionally, we give the construction
31-
* `RegularEpi f ⟶ StrongEpi f`.
28+
Additionally, we give the constructions
29+
* `RegularEpi f → EffectiveEpi f`, from which it can be deduced that regular epimorphisms are
30+
strong.
31+
* `regularEpiOfEffectiveEpi`: constructs a `RegularEpi f` instance from `EffectiveEpi f` and
32+
`HasPullback f f`.
33+
3234
3335
We also define classes `IsRegularMonoCategory` and `IsRegularEpiCategory` for categories in which
3436
every monomorphism or epimorphism is regular, and deduce that these categories are
@@ -311,6 +313,49 @@ noncomputable def regularEpiOfKernelPair {B X : C} (f : X ⟶ B) [HasPullback f
311313
w := pullback.condition
312314
isColimit := hc
313315

316+
/-- The data of an `EffectiveEpi` structure on a `RegularEpi`. -/
317+
def effectiveEpiStructOfRegularEpi {B X : C} (f : X ⟶ B) [RegularEpi f] :
318+
EffectiveEpiStruct f where
319+
desc _ h := Cofork.IsColimit.desc RegularEpi.isColimit _ (h _ _ RegularEpi.w)
320+
fac _ _ := Cofork.IsColimit.π_desc' RegularEpi.isColimit _ _
321+
uniq _ _ _ hg := Cofork.IsColimit.hom_ext RegularEpi.isColimit (hg.trans
322+
(Cofork.IsColimit.π_desc' _ _ _).symm)
323+
324+
instance {B X : C} (f : X ⟶ B) [RegularEpi f] : EffectiveEpi f :=
325+
⟨⟨effectiveEpiStructOfRegularEpi f⟩⟩
326+
327+
/-- A morphism which is a coequalizer for its kernel pair is an effective epi. -/
328+
theorem effectiveEpi_of_kernelPair {B X : C} (f : X ⟶ B) [HasPullback f f]
329+
(hc : IsColimit (Cofork.ofπ f pullback.condition)) : EffectiveEpi f :=
330+
let _ := regularEpiOfKernelPair f hc
331+
inferInstance
332+
333+
@[deprecated (since := "2025-11-20")] alias effectiveEpiOfKernelPair := effectiveEpi_of_kernelPair
334+
335+
/-- An effective epi which has a kernel pair is a regular epi. -/
336+
noncomputable instance regularEpiOfEffectiveEpi {B X : C} (f : X ⟶ B) [HasPullback f f]
337+
[EffectiveEpi f] : RegularEpi f where
338+
W := pullback f f
339+
left := pullback.fst f f
340+
right := pullback.snd f f
341+
w := pullback.condition
342+
isColimit := {
343+
desc := fun s ↦ EffectiveEpi.desc f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
344+
simp only [Cofork.app_one_eq_π]
345+
rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
346+
simp)
347+
fac := by
348+
intro s j
349+
have := EffectiveEpi.fac f (s.ι.app WalkingParallelPair.one) fun g₁ g₂ hg ↦ (by
350+
simp only [Cofork.app_one_eq_π]
351+
rw [← pullback.lift_snd g₁ g₂ hg, Category.assoc, ← Cofork.app_zero_eq_comp_π_right]
352+
simp)
353+
simp only [Functor.const_obj_obj, Cofork.app_one_eq_π] at this
354+
cases j with
355+
| zero => simp [this]
356+
| one => simp [this]
357+
uniq := fun _ _ h ↦ EffectiveEpi.uniq f _ _ _ (h WalkingParallelPair.one) }
358+
314359
/-- Every split epimorphism is a regular epimorphism. -/
315360
instance (priority := 100) RegularEpi.ofSplitEpi (f : X ⟶ Y) [IsSplitEpi f] : RegularEpi f where
316361
W := X
@@ -364,19 +409,9 @@ def regularOfIsPushoutFstOfRegular {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h
364409
RegularEpi k :=
365410
regularOfIsPushoutSndOfRegular comm.symm (PushoutCocone.flipIsColimit t)
366411

412+
@[deprecated "No replacement" (since := "2025-11-20")]
367413
instance (priority := 100) strongEpi_of_regularEpi (f : X ⟶ Y) [RegularEpi f] : StrongEpi f :=
368-
StrongEpi.mk'
369-
(by
370-
intro A B z hz u v sq
371-
have : (RegularEpi.left : RegularEpi.W f ⟶ X) ≫ u = RegularEpi.right ≫ u := by
372-
apply (cancel_mono z).1
373-
simp only [Category.assoc, sq.w, RegularEpi.w_assoc]
374-
obtain ⟨t, ht⟩ := RegularEpi.desc' f u this
375-
exact
376-
CommSq.HasLift.mk'
377-
⟨t, ht,
378-
(cancel_epi f).1
379-
(by simp only [← Category.assoc, ht, ← sq.w])⟩)
414+
inferInstance
380415

381416
/-- A regular epimorphism is an isomorphism if it is a monomorphism. -/
382417
theorem isIso_of_regularEpi_of_mono (f : X ⟶ Y) [RegularEpi f] [Mono f] : IsIso f :=

0 commit comments

Comments
 (0)