Skip to content

Commit feba708

Browse files
committed
chore(CategoryTheory/Adjunction): dualize some of the API for reflective functors (#13948)
1 parent 1e77bed commit feba708

File tree

3 files changed

+75
-9
lines changed

3 files changed

+75
-9
lines changed

Mathlib/AlgebraicGeometry/AffineScheme.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def Scheme.isoSpec (X : Scheme) [IsAffine X] : X ≅ Scheme.Spec.obj (op <| Sche
7171
Also see `AffineScheme.of` for a typeclass version. -/
7272
@[simps]
7373
def AffineScheme.mk (X : Scheme) (_ : IsAffine X) : AffineScheme :=
74-
⟨X, mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
74+
⟨X, ΓSpec.adjunction.mem_essImage_of_unit_isIso _⟩
7575
#align algebraic_geometry.AffineScheme.mk AlgebraicGeometry.AffineScheme.mk
7676

7777
/-- Construct an affine scheme from a scheme. Also see `AffineScheme.mk` for a non-typeclass
@@ -88,7 +88,7 @@ def AffineScheme.ofHom {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
8888

8989
theorem mem_Spec_essImage (X : Scheme) : X ∈ Scheme.Spec.essImage ↔ IsAffine X :=
9090
fun h => ⟨Functor.essImage.unit_isIso h⟩,
91-
fun _ => mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
91+
fun _ => ΓSpec.adjunction.mem_essImage_of_unit_isIso _⟩
9292
#align algebraic_geometry.mem_Spec_ess_image AlgebraicGeometry.mem_Spec_essImage
9393

9494
instance isAffineAffineScheme (X : AffineScheme.{u}) : IsAffine X.obj :=

Mathlib/CategoryTheory/Adjunction/FullyFaithful.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ lemma isIso_counit_app_iff_mem_essImage [L.Faithful] [L.Full] {X : D} :
171171
rw [NatTrans.isIso_app_iff_of_iso _ i.symm]
172172
infer_instance
173173

174+
lemma mem_essImage_of_counit_isIso (A : D)
175+
[IsIso (h.counit.app A)] : A ∈ L.essImage :=
176+
⟨R.obj A, ⟨asIso (h.counit.app A)⟩⟩
177+
174178
lemma isIso_counit_app_of_iso [L.Faithful] [L.Full] {X : D} {Y : C} (e : X ≅ L.obj Y) :
175179
IsIso (h.counit.app X) :=
176180
(isIso_counit_app_iff_mem_essImage h).mpr ⟨Y, ⟨e.symm⟩⟩
@@ -190,6 +194,15 @@ lemma isIso_unit_app_iff_mem_essImage [R.Faithful] [R.Full] {Y : C} :
190194
rw [NatTrans.isIso_app_iff_of_iso _ i.symm]
191195
infer_instance
192196

197+
/-- If `η_A` is an isomorphism, then `A` is in the essential image of `i`. -/
198+
theorem mem_essImage_of_unit_isIso (A : C)
199+
[IsIso (h.unit.app A)] : A ∈ R.essImage :=
200+
⟨L.obj A, ⟨(asIso (h.unit.app A)).symm⟩⟩
201+
#align category_theory.mem_ess_image_of_unit_is_iso CategoryTheory.Adjunction.mem_essImage_of_unit_isIso
202+
203+
@[deprecated (since := "2024-06-19")] alias _root_.CategoryTheory.mem_essImage_of_unit_isIso :=
204+
mem_essImage_of_unit_isIso
205+
193206
lemma isIso_unit_app_of_iso [R.Faithful] [R.Full] {X : D} {Y : C} (e : Y ≅ R.obj X) :
194207
IsIso (h.unit.app Y) :=
195208
(isIso_unit_app_iff_mem_essImage h).mpr ⟨X, ⟨e.symm⟩⟩

Mathlib/CategoryTheory/Adjunction/Reflective.lean

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ theorem Functor.essImage.unit_isIso [Reflective i] {A : C} (h : A ∈ i.essImage
8989
rwa [isIso_unit_app_iff_mem_essImage]
9090
#align category_theory.functor.ess_image.unit_is_iso CategoryTheory.Functor.essImage.unit_isIso
9191

92-
/-- If `η_A` is an isomorphism, then `A` is in the essential image of `i`. -/
93-
theorem mem_essImage_of_unit_isIso {L : C ⥤ D} (adj : L ⊣ i) (A : C)
94-
[IsIso (adj.unit.app A)] : A ∈ i.essImage :=
95-
⟨L.obj A, ⟨(asIso (adj.unit.app A)).symm⟩⟩
96-
#align category_theory.mem_ess_image_of_unit_is_iso CategoryTheory.mem_essImage_of_unit_isIso
97-
9892
/-- If `η_A` is a split monomorphism, then `A` is in the reflective subcategory. -/
9993
theorem mem_essImage_of_unit_isSplitMono [Reflective i] {A : C}
10094
[IsSplitMono ((reflectorAdjunction i).unit.app A)] : A ∈ i.essImage := by
@@ -106,7 +100,7 @@ theorem mem_essImage_of_unit_isSplitMono [Reflective i] {A : C}
106100
rw [show retraction _ ≫ η.app A = _ from η.naturality (retraction (η.app A))]
107101
apply epi_comp (η.app (i.obj ((reflector i).obj A)))
108102
haveI := isIso_of_epi_of_isSplitMono (η.app A)
109-
exact mem_essImage_of_unit_isIso (reflectorAdjunction i) A
103+
exact (reflectorAdjunction i).mem_essImage_of_unit_isIso A
110104
#align category_theory.mem_ess_image_of_unit_is_split_mono CategoryTheory.mem_essImage_of_unit_isSplitMono
111105

112106
/-- Composition of reflective functors. -/
@@ -228,4 +222,63 @@ def equivEssImageOfReflective [Reflective i] : D ≌ i.EssImageSubcategory where
228222
aesop_cat
229223
#align category_theory.equiv_ess_image_of_reflective CategoryTheory.equivEssImageOfReflective
230224

225+
/--
226+
A functor is *coreflective*, or *a coreflective inclusion*, if it is fully faithful and left
227+
adjoint.
228+
-/
229+
class Coreflective (L : C ⥤ D) extends L.Full, L.Faithful where
230+
/-- a choice of a right adjoint to `L` -/
231+
R : D ⥤ C
232+
/-- `L` is a left adjoint -/
233+
adj : L ⊣ R
234+
235+
variable (j : C ⥤ D)
236+
237+
/-- The coreflector `D ⥤ C` when `L : C ⥤ D` is coreflective. -/
238+
def coreflector [Coreflective j] : D ⥤ C := Coreflective.R (L := j)
239+
240+
/-- The adjunction `j ⊣ coreflector j` when `j` is coreflective. -/
241+
def coreflectorAdjunction [Coreflective j] : j ⊣ coreflector j := Coreflective.adj
242+
243+
instance [Coreflective j] : j.IsLeftAdjoint := ⟨_, ⟨coreflectorAdjunction j⟩⟩
244+
245+
instance [Coreflective j] : (coreflector j).IsRightAdjoint := ⟨_, ⟨coreflectorAdjunction j⟩⟩
246+
247+
/-- A coreflective functor is fully faithful. -/
248+
def Functor.fullyFaithfulOfCoreflective [Coreflective j] : j.FullyFaithful :=
249+
(coreflectorAdjunction j).fullyFaithfulLOfIsIsoUnit
250+
251+
lemma counit_obj_eq_map_counit [Coreflective j] (X : D) :
252+
(coreflectorAdjunction j).counit.app (j.obj ((coreflector j).obj X)) =
253+
j.map ((coreflector j).map ((coreflectorAdjunction j).counit.app X)) := by
254+
rw [← cancel_epi (j.map ((coreflectorAdjunction j).unit.app ((coreflector j).obj X))),
255+
← j.map_comp]
256+
simp
257+
258+
example [Coreflective j] {B : C} : IsIso ((coreflectorAdjunction j).counit.app (j.obj B)) :=
259+
inferInstance
260+
261+
variable {j}
262+
263+
lemma Functor.essImage.counit_isIso [Coreflective j] {A : D} (h : A ∈ j.essImage) :
264+
IsIso ((coreflectorAdjunction j).counit.app A) := by
265+
rwa [isIso_counit_app_iff_mem_essImage]
266+
267+
lemma mem_essImage_of_counit_isSplitEpi [Coreflective j] {A : D}
268+
[IsSplitEpi ((coreflectorAdjunction j).counit.app A)] : A ∈ j.essImage := by
269+
let ε : coreflector j ⋙ j ⟶ 𝟭 D := (coreflectorAdjunction j).counit
270+
haveI : IsIso (ε.app (j.obj ((coreflector j).obj A))) :=
271+
Functor.essImage.counit_isIso ((j.obj_mem_essImage _))
272+
have : Mono (ε.app A) := by
273+
refine @mono_of_mono _ _ _ _ _ (ε.app A) (section_ (ε.app A)) ?_
274+
rw [show ε.app A ≫ section_ _ = _ from (ε.naturality (section_ (ε.app A))).symm]
275+
apply mono_comp _ (ε.app (j.obj ((coreflector j).obj A)))
276+
haveI := isIso_of_mono_of_isSplitEpi (ε.app A)
277+
exact (coreflectorAdjunction j).mem_essImage_of_counit_isIso A
278+
279+
instance Coreflective.comp (F : C ⥤ D) (G : D ⥤ E) [Coreflective F] [Coreflective G] :
280+
Coreflective (F ⋙ G) where
281+
R := coreflector G ⋙ coreflector F
282+
adj := (coreflectorAdjunction F).comp (coreflectorAdjunction G)
283+
231284
end CategoryTheory

0 commit comments

Comments
 (0)