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

Commit 1a5e56f

Browse files
committed
feat(category_theory/localization): basic API for localization of categories (#16969)
In this PR, the basic API for the localization of categories is introduced. If a functor `L : C ⥤ D` is a localization functor for `W : morphism_property C`, we shall say that a functor `F' : D ⥤ E` lifts a functor `F : C ⥤ E` if an isomorphism `L ⋙ F' ≅ F` is given: this is the class `[lifting L W F F']`. The basic API for lifting of functors and lifting of natural transformations is included.
1 parent db09163 commit 1a5e56f

File tree

2 files changed

+172
-18
lines changed

2 files changed

+172
-18
lines changed

src/category_theory/localization/construction.lean

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,6 @@ in `D` (i.e. we have `hG : W.is_inverted_by G`), then there exists a unique func
2929
The expected property of `lift G hG` if expressed by the lemma `fac` and the
3030
uniqueness is expressed by `uniq`.
3131
32-
TODO:
33-
1) implement a constructor for `is_localization L W` which would take
34-
as an input a *strict* universal property (`lift`/`fac`/`uniq`) similar to
35-
what is obtained here for `W.localization`. (Practically speaking, this is
36-
the easiest way to show that a functor is a localization.)
37-
38-
2) when we have `is_localization L W`, then show that `D ⥤ E` identifies
39-
to the full subcategory of `C ⥤ E` consisting of `W`-inverting functors.
40-
41-
3) provide an API for the lifting of functors `C ⥤ E`, for which
42-
`fac`/`uniq` assertions would be expressed as isomorphisms rather than
43-
by equalities of functors.
44-
4532
## References
4633
4734
* [P. Gabriel, M. Zisman, *Calculus of fractions and homotopy theory*][gabriel-zisman-1967]

src/category_theory/localization/predicate.lean

Lines changed: 172 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,24 @@ states that `L` inverts the morphisms in `W` and that all functors `C ⥤ E` inv
1919
`W` uniquely factors as a composition of `L ⋙ G` with `G : D ⥤ E`. Such universal
2020
properties are inputs for the constructor `is_localization.mk'` for `L.is_localization W`.
2121
22+
When `L : C ⥤ D` is a localization functor for `W : morphism_property` (i.e. when
23+
`[L.is_localization W]` holds), for any category `E`, there is
24+
an equivalence `functor_equivalence L W E : (D ⥤ E) ≌ (W.functors_inverting E)`
25+
that is induced by the composition with the functor `L`. When two functors
26+
`F : C ⥤ E` and `F' : D ⥤ E` correspond via this equivalence, we shall say
27+
that `F'` lifts `F`, and the associated isomorphism `L ⋙ F' ≅ F` is the
28+
datum that is part of the class `lifting L W F F'`. The functions
29+
`lift_nat_trans` and `lift_nat_iso` can be used to lift natural transformations
30+
and natural isomorphisms between functors.
31+
2232
-/
2333

2434
noncomputable theory
2535

2636
namespace category_theory
2737

38+
open category
39+
2840
variables {C D : Type*} [category C] [category D]
2941
(L : C ⥤ D) (W : morphism_property C)
3042
(E : Type*) [category E]
@@ -112,20 +124,15 @@ end functor
112124
namespace localization
113125

114126
variable [L.is_localization W]
115-
include L W
116127

117128
lemma inverts : W.is_inverted_by L := (infer_instance : L.is_localization W).inverts
118129

119-
variable {W}
120-
121130
/-- The isomorphism `L.obj X ≅ L.obj Y` that is deduced from a morphism `f : X ⟶ Y` which
122131
belongs to `W`, when `L.is_localization W`. -/
123132
@[simps]
124133
def iso_of_hom {X Y : C} (f : X ⟶ Y) (hf : W f) : L.obj X ≅ L.obj Y :=
125134
by { haveI : is_iso (L.map f) := inverts L W f hf, exact as_iso (L.map f), }
126135

127-
variable (W)
128-
129136
instance : is_equivalence (localization.construction.lift L (inverts L W)) :=
130137
(infer_instance : L.is_localization W).nonempty_is_equivalence.some
131138

@@ -156,6 +163,166 @@ lemma ess_surj : ess_surj L :=
156163
nonempty.intro ((Q_comp_equivalence_from_model_functor_iso L W).symm.app _ ≪≫
157164
(equivalence_from_model L W).counit_iso.app X)⟩⟩
158165

166+
/-- The functor `(D ⥤ E) ⥤ W.functors_inverting E` induced by the composition
167+
with a localization functor `L : C ⥤ D` with respect to `W : morphism_property C`. -/
168+
def whiskering_left_functor : (D ⥤ E) ⥤ W.functors_inverting E :=
169+
full_subcategory.lift _ ((whiskering_left _ _ E).obj L)
170+
(morphism_property.is_inverted_by.of_comp W L (inverts L W ))
171+
172+
instance : is_equivalence (whiskering_left_functor L W E) :=
173+
begin
174+
refine is_equivalence.of_iso _ (is_equivalence.of_equivalence
175+
((equivalence.congr_left (equivalence_from_model L W).symm).trans
176+
(construction.whiskering_left_equivalence W E))),
177+
refine nat_iso.of_components (λ F, eq_to_iso begin
178+
ext,
179+
change (W.Q ⋙ (localization.construction.lift L (inverts L W))) ⋙ F = L ⋙ F,
180+
rw construction.fac,
181+
end)
182+
(λ F₁ F₂ τ, begin
183+
ext X,
184+
dsimp [equivalence_from_model, whisker_left, construction.whiskering_left_equivalence,
185+
construction.whiskering_left_equivalence.functor, whiskering_left_functor,
186+
morphism_property.Q],
187+
erw [nat_trans.comp_app, nat_trans.comp_app, eq_to_hom_app, eq_to_hom_app,
188+
eq_to_hom_refl, eq_to_hom_refl, comp_id, id_comp],
189+
all_goals
190+
{ change (W.Q ⋙ (localization.construction.lift L (inverts L W))) ⋙ _ = L ⋙ _,
191+
rw construction.fac, },
192+
end),
193+
end
194+
195+
/-- The equivalence of categories `(D ⥤ E) ≌ (W.functors_inverting E)` induced by
196+
the composition with a localization functor `L : C ⥤ D` with respect to
197+
`W : morphism_property C`. -/
198+
def functor_equivalence : (D ⥤ E) ≌ (W.functors_inverting E) :=
199+
(whiskering_left_functor L W E).as_equivalence
200+
201+
include W
202+
203+
/-- The functor `(D ⥤ E) ⥤ (C ⥤ E)` given by the composition with a localization
204+
functor `L : C ⥤ D` with respect to `W : morphism_property C`. -/
205+
@[nolint unused_arguments]
206+
def whiskering_left_functor' :
207+
(D ⥤ E) ⥤ (C ⥤ E) := (whiskering_left C D E).obj L
208+
209+
lemma whiskering_left_functor'_eq :
210+
whiskering_left_functor' L W E =
211+
localization.whiskering_left_functor L W E ⋙ induced_functor _ := rfl
212+
213+
variable {E}
214+
215+
@[simp]
216+
lemma whiskering_left_functor'_obj
217+
(F : D ⥤ E) : (whiskering_left_functor' L W E).obj F = L ⋙ F := rfl
218+
219+
instance : full (whiskering_left_functor' L W E) :=
220+
by { rw whiskering_left_functor'_eq, apply_instance, }
221+
222+
instance : faithful (whiskering_left_functor' L W E) :=
223+
by { rw whiskering_left_functor'_eq, apply_instance, }
224+
225+
lemma nat_trans_ext {F₁ F₂ : D ⥤ E} (τ τ' : F₁ ⟶ F₂)
226+
(h : ∀ (X : C), τ.app (L.obj X) = τ'.app (L.obj X)) : τ = τ' :=
227+
begin
228+
haveI : category_theory.ess_surj L := ess_surj L W,
229+
ext Y,
230+
rw [← cancel_epi (F₁.map (L.obj_obj_preimage_iso Y).hom), τ.naturality, τ'.naturality, h],
231+
end
232+
233+
/-- When `L : C ⥤ D` is a localization functor for `W : morphism_property C` and
234+
`F : C ⥤ E` is a functor, we shall say that `F' : D ⥤ E` lifts `F` if the obvious diagram
235+
is commutative up to an isomorphism. -/
236+
class lifting (F : C ⥤ E) (F' : D ⥤ E) :=
237+
(iso [] : L ⋙ F' ≅ F)
238+
239+
variable {W}
240+
241+
/-- Given a localization functor `L : C ⥤ D` for `W : morphism_property C` and
242+
a functor `F : C ⥤ E` which inverts `W`, this is a choice of functor
243+
`D ⥤ E` which lifts `F`. -/
244+
def lift (F : C ⥤ E) (hF : W.is_inverted_by F) (L : C ⥤ D) [hL : L.is_localization W] :
245+
D ⥤ E :=
246+
(functor_equivalence L W E).inverse.obj ⟨F, hF⟩
247+
248+
instance lifting_lift (F : C ⥤ E) (hF : W.is_inverted_by F) (L : C ⥤ D)
249+
[hL : L.is_localization W] : lifting L W F (lift F hF L) :=
250+
⟨(induced_functor _).map_iso ((functor_equivalence L W E).counit_iso.app ⟨F, hF⟩)⟩
251+
252+
/-- The canonical isomorphism `L ⋙ lift F hF L ≅ F` for any functor `F : C ⥤ E`
253+
which inverts `W`, when `L : C ⥤ D` is a localization functor for `W`. -/
254+
@[simps]
255+
def fac (F : C ⥤ E) (hF : W.is_inverted_by F) (L : C ⥤ D) [hL : L.is_localization W] :
256+
L ⋙ lift F hF L ≅ F :=
257+
lifting.iso _ W _ _
258+
259+
instance lifting_construction_lift (F : C ⥤ D) (hF : W.is_inverted_by F) :
260+
lifting W.Q W F (construction.lift F hF) :=
261+
⟨eq_to_iso (construction.fac F hF)⟩
262+
263+
variable (W)
264+
265+
/-- Given a localization functor `L : C ⥤ D` for `W : morphism_property C`,
266+
if `(F₁' F₂' : D ⥤ E)` are functors which lifts functors `(F₁ F₂ : C ⥤ E)`,
267+
a natural transformation `τ : F₁ ⟶ F₂` uniquely lifts to a natural transformation `F₁' ⟶ F₂'`. -/
268+
def lift_nat_trans (F₁ F₂ : C ⥤ E) (F₁' F₂' : D ⥤ E) [lifting L W F₁ F₁']
269+
[h₂ : lifting L W F₂ F₂'] (τ : F₁ ⟶ F₂) : F₁' ⟶ F₂' :=
270+
(whiskering_left_functor' L W E).preimage
271+
((lifting.iso L W F₁ F₁').hom ≫ τ ≫ (lifting.iso L W F₂ F₂').inv)
272+
273+
@[simp]
274+
lemma lift_nat_trans_app (F₁ F₂ : C ⥤ E) (F₁' F₂' : D ⥤ E) [lifting L W F₁ F₁']
275+
[lifting L W F₂ F₂'] (τ : F₁ ⟶ F₂) (X : C) :
276+
(lift_nat_trans L W F₁ F₂ F₁' F₂' τ).app (L.obj X) =
277+
(lifting.iso L W F₁ F₁').hom.app X ≫ τ.app X ≫ ((lifting.iso L W F₂ F₂')).inv.app X :=
278+
congr_app (functor.image_preimage (whiskering_left_functor' L W E) _) X
279+
280+
@[simp, reassoc]
281+
lemma comp_lift_nat_trans (F₁ F₂ F₃ : C ⥤ E) (F₁' F₂' F₃' : D ⥤ E)
282+
[h₁ : lifting L W F₁ F₁'] [h₂ : lifting L W F₂ F₂'] [h₃ : lifting L W F₃ F₃']
283+
(τ : F₁ ⟶ F₂) (τ' : F₂ ⟶ F₃) :
284+
lift_nat_trans L W F₁ F₂ F₁' F₂' τ ≫ lift_nat_trans L W F₂ F₃ F₂' F₃' τ' =
285+
lift_nat_trans L W F₁ F₃ F₁' F₃' (τ ≫ τ') :=
286+
nat_trans_ext L W _ _
287+
(λ X, by simp only [nat_trans.comp_app, lift_nat_trans_app, assoc, iso.inv_hom_id_app_assoc])
288+
289+
@[simp]
290+
lemma lift_nat_trans_id (F : C ⥤ E) (F' : D ⥤ E) [h : lifting L W F F'] :
291+
lift_nat_trans L W F F F' F' (𝟙 F) = 𝟙 F' :=
292+
nat_trans_ext L W _ _
293+
(λ X, by simpa only [lift_nat_trans_app, nat_trans.id_app, id_comp, iso.hom_inv_id_app])
294+
295+
/-- Given a localization functor `L : C ⥤ D` for `W : morphism_property C`,
296+
if `(F₁' F₂' : D ⥤ E)` are functors which lifts functors `(F₁ F₂ : C ⥤ E)`,
297+
a natural isomorphism `τ : F₁ ⟶ F₂` lifts to a natural isomorphism `F₁' ⟶ F₂'`. -/
298+
@[simps]
299+
def lift_nat_iso (F₁ F₂ : C ⥤ E) (F₁' F₂' : D ⥤ E)
300+
[h₁ : lifting L W F₁ F₁'] [h₂ : lifting L W F₂ F₂']
301+
(e : F₁ ≅ F₂) : F₁' ≅ F₂' :=
302+
{ hom := lift_nat_trans L W F₁ F₂ F₁' F₂' e.hom,
303+
inv := lift_nat_trans L W F₂ F₁ F₂' F₁' e.inv, }
304+
305+
namespace lifting
306+
307+
@[simps]
308+
instance comp_right {E' : Type*} [category E'] (F : C ⥤ E) (F' : D ⥤ E) [lifting L W F F']
309+
(G : E ⥤ E') : lifting L W (F ⋙ G) (F' ⋙ G) :=
310+
⟨iso_whisker_right (iso L W F F') G⟩
311+
312+
@[simps]
313+
instance id : lifting L W L (𝟭 D) :=
314+
⟨functor.right_unitor L⟩
315+
316+
/-- Given a localization functor `L : C ⥤ D` for `W : morphism_property C`,
317+
if `F₁' : D ⥤ E` lifts a functor `F₁ : C ⥤ D`, then a functor `F₂'` which
318+
is isomorphic to `F₁'` also lifts a functor `F₂` that is isomorphic to `F₁`. -/
319+
@[simps]
320+
def of_isos {F₁ F₂ : C ⥤ E} {F₁' F₂' : D ⥤ E} (e : F₁ ≅ F₂) (e' : F₁' ≅ F₂')
321+
[lifting L W F₁ F₁'] : lifting L W F₂ F₂' :=
322+
⟨iso_whisker_left L e'.symm ≪≫ iso L W F₁ F₁' ≪≫ e⟩
323+
324+
end lifting
325+
159326
end localization
160327

161328
end category_theory

0 commit comments

Comments
 (0)