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

Commit 656b1bb

Browse files
committed
feat(category_theory): essential image of a functor (#5352)
Define essential image of a functor as a predicate and use it to re-express essential surjectivity. Construct the essential image as a subcategory of the target and use it to factorise an arbitrary functor into a fully faithful functor and an essentially surjective functor. Also shuffles the import hierarchy a little so that essential image can import full subcategories.
1 parent 0bb665c commit 656b1bb

File tree

9 files changed

+145
-46
lines changed

9 files changed

+145
-46
lines changed

src/algebra/category/Group/Z_Module_equivalence.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ instance : full (forget₂ (Module ℤ) AddCommGroup.{u}) :=
2929

3030
/-- The forgetful functor from `ℤ` modules to `AddCommGroup` is essentially surjective. -/
3131
instance : ess_surj (forget₂ (Module ℤ) AddCommGroup.{u}) :=
32-
{ obj_preimage := λ A, ⟨Module.of ℤ A, ⟨{ hom := 𝟙 A, inv := 𝟙 A }⟩⟩}
32+
{ mem_ess_image := λ A, ⟨Module.of ℤ A, ⟨{ hom := 𝟙 A, inv := 𝟙 A }⟩⟩}
3333

3434
noncomputable instance : is_equivalence (forget₂ (Module ℤ) AddCommGroup.{u}) :=
3535
equivalence_of_fully_faithfully_ess_surj (forget₂ (Module ℤ) AddCommGroup)

src/category_theory/Fintype.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def incl : skeleton ⥤ Fintype :=
8181
instance : full incl := { preimage := λ _ _ f, f }
8282
instance : faithful incl := {}
8383
instance : ess_surj incl :=
84-
{ obj_preimage := λ X,
84+
{ mem_ess_image := λ X,
8585
let F := trunc.out (fintype.equiv_fin X) in
8686
⟨fintype.card X, ⟨⟨F.symm, F, F.self_comp_symm, F.symm_comp_self⟩⟩⟩ }
8787

src/category_theory/concrete_category/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Scott Morrison, Johannes Hölzl, Reid Barton, Sean Leather, Yury Kudryashov
55
-/
66
import category_theory.types
7-
import category_theory.full_subcategory
7+
import category_theory.epi_mono
88

99
/-!
1010
# Concrete categories

src/category_theory/equivalence.lean

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Tim Baumann, Stephen Morgan, Scott Morrison, Floris van Doorn
55
-/
66
import category_theory.fully_faithful
77
import category_theory.whiskering
8+
import category_theory.essential_image
89
import tactic.slice
910

1011
/-!
@@ -489,29 +490,6 @@ eq_of_inv_eq_inv (functor_unit_comp _ _)
489490

490491
end is_equivalence
491492

492-
/--
493-
A functor `F : C ⥤ D` is essentially surjective if for every `d : D`, there is some `c : C`
494-
so `F.obj c ≅ D`.
495-
496-
See https://stacks.math.columbia.edu/tag/001C.
497-
-/
498-
class ess_surj (F : C ⥤ D) : Prop :=
499-
(obj_preimage [] (d : D) : ∃ c, nonempty (F.obj c ≅ d))
500-
501-
namespace functor
502-
/-- Given an essentially surjective functor, we can find a preimage for every object `d` in the
503-
codomain. Applying the functor to this preimage will yield an object isomorphic to `d`, see
504-
`fun_obj_preimage_iso`. -/
505-
noncomputable def obj_preimage (F : C ⥤ D) [sF : ess_surj F] (d : D) : C :=
506-
classical.some (ess_surj.obj_preimage F d)
507-
/-- Applying an essentially surjective functor to a preimage of `d` yields an object that is
508-
isomorphic to `d`. -/
509-
noncomputable def fun_obj_preimage_iso (F : C ⥤ D) [sF : ess_surj F] (d : D) :
510-
F.obj (F.obj_preimage d) ≅ d :=
511-
classical.choice (classical.some_spec (ess_surj.obj_preimage F d))
512-
513-
end functor
514-
515493
namespace equivalence
516494

517495
/--
@@ -548,7 +526,7 @@ instance full_of_equivalence (F : C ⥤ D) [is_equivalence F] : full F :=
548526

549527
@[simps] private noncomputable def equivalence_inverse (F : C ⥤ D) [full F] [faithful F] [ess_surj F] : D ⥤ C :=
550528
{ obj := λ X, F.obj_preimage X,
551-
map := λ X Y f, F.preimage ((F.fun_obj_preimage_iso X).hom ≫ f ≫ (F.fun_obj_preimage_iso Y).inv),
529+
map := λ X Y f, F.preimage ((F.obj_obj_preimage_iso X).hom ≫ f ≫ (F.obj_obj_preimage_iso Y).inv),
552530
map_id' := λ X, begin apply F.map_injective, tidy end,
553531
map_comp' := λ X Y Z f g, by apply F.map_injective; simp }
554532

@@ -561,14 +539,16 @@ noncomputable def equivalence_of_fully_faithfully_ess_surj
561539
(F : C ⥤ D) [full F] [faithful F] [ess_surj F] : is_equivalence F :=
562540
is_equivalence.mk (equivalence_inverse F)
563541
(nat_iso.of_components
564-
(λ X, (preimage_iso $ F.fun_obj_preimage_iso $ F.obj X).symm)
542+
(λ X, (preimage_iso $ F.obj_obj_preimage_iso $ F.obj X).symm)
565543
(λ X Y f, by { apply F.map_injective, obviously }))
566-
(nat_iso.of_components F.fun_obj_preimage_iso (by tidy))
544+
(nat_iso.of_components F.obj_obj_preimage_iso (by tidy))
567545

568-
@[simp] lemma functor_map_inj_iff (e : C ≌ D) {X Y : C} (f g : X ⟶ Y) : e.functor.map f = e.functor.map g ↔ f = g :=
546+
@[simp] lemma functor_map_inj_iff (e : C ≌ D) {X Y : C} (f g : X ⟶ Y) :
547+
e.functor.map f = e.functor.map g ↔ f = g :=
569548
⟨λ h, e.functor.map_injective h, λ h, h ▸ rfl⟩
570549

571-
@[simp] lemma inverse_map_inj_iff (e : C ≌ D) {X Y : D} (f g : X ⟶ Y) : e.inverse.map f = e.inverse.map g ↔ f = g :=
550+
@[simp] lemma inverse_map_inj_iff (e : C ≌ D) {X Y : D} (f g : X ⟶ Y) :
551+
e.inverse.map f = e.inverse.map g ↔ f = g :=
572552
functor_map_inj_iff e.symm f g
573553

574554
end equivalence
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/-
2+
Copyright (c) 2020 Bhavik Mehta. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Bhavik Mehta
5+
-/
6+
import category_theory.natural_isomorphism
7+
import category_theory.full_subcategory
8+
9+
/-!
10+
# Essential image of a functor
11+
12+
The essential image `ess_image` of a functor consists of the objects in the target category which
13+
are isomorphic to an object in the image of the object function.
14+
This, for instance, allows us to talk about objects belonging to a subcategory expressed as a
15+
functor rather than a subtype, preserving the principle of equivalence. For example this lets us
16+
define exponential ideals.
17+
18+
The essential image can also be seen as a subcategory of the target category, and witnesses that
19+
a functor decomposes into a essentially surjective functor and a fully faithful functor.
20+
(TODO: show that this decomposition forms an orthogonal factorisation system).
21+
-/
22+
universes v₁ v₂ u₁ u₂
23+
24+
noncomputable theory
25+
26+
namespace category_theory
27+
28+
variables {C : Type u₁} {D : Type u₂} [category.{v₁} C] [category.{v₂} D] {F : C ⥤ D}
29+
30+
namespace functor
31+
32+
/--
33+
The essential image of a functor `F` consists of those objects in the target category which are
34+
isomorphic to an object in the image of the function `F.obj`. In other words, this is the closure
35+
under isomorphism of the function `F.obj`.
36+
This is the "non-evil" way of describing the image of a functor.
37+
-/
38+
def ess_image (F : C ⥤ D) : set D := λ Y, ∃ (X : C), nonempty (F.obj X ≅ Y)
39+
40+
/-- Get the witnessing object that `Y` is in the subcategory given by `F`. -/
41+
def ess_image.witness {Y : D} (h : Y ∈ F.ess_image) : C := h.some
42+
43+
/-- Extract the isomorphism between `F.obj h.witness` and `Y` itself. -/
44+
def ess_image.get_iso {Y : D} (h : Y ∈ F.ess_image) : F.obj h.witness ≅ Y :=
45+
classical.choice h.some_spec
46+
47+
/-- Being in the essential image is a "hygenic" property: it is preserved under isomorphism. -/
48+
lemma ess_image.of_iso {Y Y' : D} (h : Y ≅ Y') (hY : Y ∈ ess_image F) :
49+
Y' ∈ ess_image F :=
50+
hY.imp (λ B, nonempty.map (≪≫ h))
51+
52+
/--
53+
If `Y` is in the essential image of `F` then it is in the essential image of `F'` as long as
54+
`F ≅ F'`.
55+
-/
56+
lemma ess_image.of_nat_iso {F' : C ⥤ D} (h : F ≅ F') {Y : D} (hY : Y ∈ ess_image F) :
57+
Y ∈ ess_image F' :=
58+
hY.imp (λ X, nonempty.map (λ t, h.symm.app X ≪≫ t))
59+
60+
/-- Isomorphic functors have equal essential images. -/
61+
lemma ess_image_eq_of_nat_iso {F' : C ⥤ D} (h : F ≅ F') :
62+
ess_image F = ess_image F' :=
63+
set.ext $ λ A, ⟨ess_image.of_nat_iso h, ess_image.of_nat_iso h.symm⟩
64+
65+
/-- An object in the image is in the essential image. -/
66+
lemma obj_mem_ess_image (F : D ⥤ C) (Y : D) : F.obj Y ∈ ess_image F := ⟨Y, ⟨iso.refl _⟩⟩
67+
68+
instance : category F.ess_image := category_theory.full_subcategory _
69+
70+
/-- The essential image as a subcategory has a fully faithful inclusion into the target category. -/
71+
@[derive [full, faithful], simps {rhs_md := semireducible}]
72+
def ess_image_inclusion (F : C ⥤ D) : F.ess_image ⥤ D :=
73+
full_subcategory_inclusion _
74+
75+
/--
76+
Given a functor `F : C ⥤ D`, we have an (essentially surjective) functor from `C` to the essential
77+
image of `F`.
78+
-/
79+
@[simps]
80+
def to_ess_image (F : C ⥤ D) : C ⥤ F.ess_image :=
81+
{ obj := λ X, ⟨_, obj_mem_ess_image _ X⟩,
82+
map := λ X Y f, (ess_image_inclusion F).preimage (F.map f) }
83+
84+
/--
85+
The functor `F` factorises through its essential image, where the first functor is essentially
86+
surjective and the second is fully faithful.
87+
-/
88+
@[simps {rhs_md := semireducible}]
89+
def to_ess_image_comp_essential_image_inclusion :
90+
F.to_ess_image ⋙ F.ess_image_inclusion ≅ F :=
91+
nat_iso.of_components (λ X, iso.refl _) (by tidy)
92+
93+
end functor
94+
95+
/--
96+
A functor `F : C ⥤ D` is essentially surjective if every object of `D` is in the essential image
97+
of `F`. In other words, for every `Y : D`, there is some `X : C` with `F.obj X ≅ Y`.
98+
99+
See https://stacks.math.columbia.edu/tag/001C.
100+
-/
101+
class ess_surj (F : C ⥤ D) : Prop :=
102+
(mem_ess_image [] (Y : D) : Y ∈ F.ess_image)
103+
104+
instance : ess_surj F.to_ess_image :=
105+
{ mem_ess_image := λ ⟨Y, hY⟩, ⟨_, ⟨⟨_, _, hY.get_iso.hom_inv_id, hY.get_iso.inv_hom_id⟩⟩⟩ }
106+
107+
variables (F) [ess_surj F]
108+
109+
/-- Given an essentially surjective functor, we can find a preimage for every object `Y` in the
110+
codomain. Applying the functor to this preimage will yield an object isomorphic to `Y`, see
111+
`obj_obj_preimage_iso`. -/
112+
def functor.obj_preimage (Y : D) : C := (ess_surj.mem_ess_image F Y).witness
113+
/-- Applying an essentially surjective functor to a preimage of `Y` yields an object that is
114+
isomorphic to `Y`. -/
115+
def functor.obj_obj_preimage_iso (Y : D) : F.obj (F.obj_preimage Y) ≅ Y :=
116+
(ess_surj.mem_ess_image F Y).get_iso
117+
118+
end category_theory

src/category_theory/full_subcategory.lean

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2017 Scott Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Scott Morrison, Reid Barton
55
-/
6-
import category_theory.groupoid
6+
import category_theory.fully_faithful
77

88
namespace category_theory
99

@@ -74,12 +74,6 @@ instance induced_category.faithful : faithful (induced_functor F) := {}
7474

7575
end induced
7676

77-
instance induced_category.groupoid {C : Type u₁} (D : Type u₂) [groupoid.{v} D] (F : C → D) :
78-
groupoid.{v} (induced_category D F) :=
79-
{ inv := λ X Y f, groupoid.inv f,
80-
inv_comp' := λ X Y f, groupoid.inv_comp f,
81-
comp_inv' := λ X Y f, groupoid.comp_inv f,
82-
.. induced_category.category F }
8377

8478
section full_subcategory
8579
/- A full subcategory is the special case of an induced category with F = subtype.val. -/

src/category_theory/groupoid.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,11 @@ end
7171

7272
end
7373

74+
instance induced_category.groupoid {C : Type u} (D : Type u₂) [groupoid.{v} D] (F : C → D) :
75+
groupoid.{v} (induced_category D F) :=
76+
{ inv := λ X Y f, groupoid.inv f,
77+
inv_comp' := λ X Y f, groupoid.inv_comp f,
78+
comp_inv' := λ X Y f, groupoid.comp_inv f,
79+
.. induced_category.category F }
80+
7481
end category_theory

src/category_theory/limits/shapes/normal_mono.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import category_theory.limits.shapes.kernels
1111
1212
A normal monomorphism is a morphism that is the kernel of some other morphism.
1313
14-
We give the construction `normal_mono → regular_mono` (`category_theory.normal_mono.regular_mono`)
15-
as well as the dual construction for normal epimorphisms. We show equivalences reflect normal
16-
monomorphisms (`category_theory.equivalence_reflects_normal_mono`), and that the pullback of a
14+
We give the construction `normal_mono → regular_mono` (`category_theory.normal_mono.regular_mono`)
15+
as well as the dual construction for normal epimorphisms. We show equivalences reflect normal
16+
monomorphisms (`category_theory.equivalence_reflects_normal_mono`), and that the pullback of a
1717
normal monomorphism is normal (`category_theory.normal_of_is_pullback_snd_of_normal`).
1818
-/
1919

@@ -46,13 +46,13 @@ def equivalence_reflects_normal_mono {D : Type u₂} [category.{v₁} D] [has_ze
4646
(F : C ⥤ D) [is_equivalence F] {X Y : C} {f : X ⟶ Y} (hf : normal_mono (F.map f)) :
4747
normal_mono f :=
4848
{ Z := F.obj_preimage hf.Z,
49-
g := full.preimage (hf.g ≫ (F.fun_obj_preimage_iso hf.Z).inv),
49+
g := full.preimage (hf.g ≫ (F.obj_obj_preimage_iso hf.Z).inv),
5050
w := faithful.map_injective F $ by simp [reassoc_of hf.w],
5151
is_limit := reflects_limit.reflects $
5252
is_limit.of_cone_equiv (cones.postcompose_equivalence (comp_nat_iso F)) $
5353
is_limit.of_iso_limit
5454
(by exact is_limit.of_iso_limit
55-
(is_kernel.of_comp_iso _ _ (F.fun_obj_preimage_iso hf.Z) (by simp) hf.is_limit)
55+
(is_kernel.of_comp_iso _ _ (F.obj_obj_preimage_iso hf.Z) (by simp) hf.is_limit)
5656
(of_ι_congr (category.comp_id _).symm)) (iso_of_ι _).symm }
5757

5858
end
@@ -125,13 +125,13 @@ def equivalence_reflects_normal_epi {D : Type u₂} [category.{v₁} D] [has_zer
125125
(F : C ⥤ D) [is_equivalence F] {X Y : C} {f : X ⟶ Y} (hf : normal_epi (F.map f)) :
126126
normal_epi f :=
127127
{ W := F.obj_preimage hf.W,
128-
g := full.preimage ((F.fun_obj_preimage_iso hf.W).hom ≫ hf.g),
128+
g := full.preimage ((F.obj_obj_preimage_iso hf.W).hom ≫ hf.g),
129129
w := faithful.map_injective F $ by simp [hf.w],
130130
is_colimit := reflects_colimit.reflects $
131131
is_colimit.of_cocone_equiv (cocones.precompose_equivalence (comp_nat_iso F).symm) $
132132
is_colimit.of_iso_colimit
133133
(by exact is_colimit.of_iso_colimit
134-
(is_cokernel.of_iso_comp _ _ (F.fun_obj_preimage_iso hf.W).symm (by simp) hf.is_colimit)
134+
(is_cokernel.of_iso_comp _ _ (F.obj_obj_preimage_iso hf.W).symm (by simp) hf.is_colimit)
135135
(of_π_congr (category.id_comp _).symm))
136136
(iso_of_π _).symm }
137137

src/topology/category/Compactum.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ noncomputable def iso_of_topological_space {D : CompHaus} :
433433

434434
/-- The functor Compactum_to_CompHaus is essentially surjective. -/
435435
lemma ess_surj : ess_surj Compactum_to_CompHaus :=
436-
{ obj_preimage := λ X, ⟨Compactum.of_topological_space X, ⟨iso_of_topological_space⟩⟩ }
436+
{ mem_ess_image := λ X, ⟨Compactum.of_topological_space X, ⟨iso_of_topological_space⟩⟩ }
437437

438438
/-- The functor Compactum_to_CompHaus is an equivalence of categories. -/
439439
noncomputable def is_equivalence : is_equivalence Compactum_to_CompHaus :=

0 commit comments

Comments
 (0)