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

Commit 8575f59

Browse files
committed
feat(category_theory/limits): preservation of zero morphisms (#12068)
1 parent c9e8c64 commit 8575f59

File tree

7 files changed

+183
-36
lines changed

7 files changed

+183
-36
lines changed

src/category_theory/differential_object.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def shift_functor (n : ℤ) : differential_object C ⥤ differential_object C :=
219219
{ X := X.X⟦n⟧,
220220
d := X.d⟦n⟧' ≫ (shift_comm _ _ _).hom,
221221
d_squared' := by rw [functor.map_comp, category.assoc, shift_comm_hom_comp_assoc,
222-
←functor.map_comp_assoc, X.d_squared, is_equivalence_preserves_zero_morphisms, zero_comp] },
222+
←functor.map_comp_assoc, X.d_squared, functor.map_zero, zero_comp] },
223223
map := λ X Y f,
224224
{ f := f.f⟦n⟧',
225225
comm' := by { dsimp, rw [category.assoc, shift_comm_hom_comp, ← functor.map_comp_assoc,
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/-
2+
Copyright (c) 2022 Markus Himmel. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Markus Himmel
5+
-/
6+
import category_theory.limits.preserves.shapes.terminal
7+
import category_theory.limits.shapes.zero
8+
9+
/-!
10+
# Preservation of zero objects and zero morphisms
11+
12+
We define the class `preserves_zero_morphisms` and show basic properties.
13+
14+
## Main results
15+
16+
We provide the following results:
17+
* Left adjoints and right adjoints preserve zero morphisms;
18+
* full functors preserves zero morphisms;
19+
* if both categories involved have a zero object, then a functor preserves zero morphisms if and
20+
only if it preserves the zero object;
21+
* functors which preserve initial or terminal objects preserve zero morphisms.
22+
23+
-/
24+
25+
universes v₁ v₂ u₁ u₂
26+
27+
noncomputable theory
28+
29+
open category_theory
30+
open category_theory.limits
31+
32+
namespace category_theory.functor
33+
variables {C : Type u₁} [category.{v₁} C] {D : Type u₂} [category.{v₂} D]
34+
35+
section zero_morphisms
36+
variables [has_zero_morphisms C] [has_zero_morphisms D]
37+
38+
/-- A functor preserves zero morphisms if it sends zero morphisms to zero morphisms. -/
39+
class preserves_zero_morphisms (F : C ⥤ D) : Prop :=
40+
(map_zero' : ∀ (X Y : C), F.map (0 : X ⟶ Y) = 0 . obviously)
41+
42+
@[simp]
43+
protected lemma map_zero (F : C ⥤ D) [preserves_zero_morphisms F] (X Y : C) :
44+
F.map (0 : X ⟶ Y) = 0 :=
45+
preserves_zero_morphisms.map_zero' _ _
46+
47+
@[priority 100]
48+
instance preserves_zero_morphisms_of_is_left_adjoint (F : C ⥤ D) [is_left_adjoint F] :
49+
preserves_zero_morphisms F :=
50+
{ map_zero' := λ X Y, let adj := adjunction.of_left_adjoint F in
51+
begin
52+
calc F.map (0 : X ⟶ Y) = F.map 0 ≫ F.map (adj.unit.app Y) ≫ adj.counit.app (F.obj Y) : _
53+
... = F.map 0 ≫ F.map ((right_adjoint F).map (0 : F.obj X ⟶ _)) ≫ adj.counit.app (F.obj Y) : _
54+
... = 0 : _,
55+
{ rw adjunction.left_triangle_components, exact (category.comp_id _).symm },
56+
{ simp only [← category.assoc, ← F.map_comp, zero_comp] },
57+
{ simp only [adjunction.counit_naturality, comp_zero] }
58+
end }
59+
60+
@[priority 100]
61+
instance preserves_zero_morphisms_of_is_right_adjoint (G : C ⥤ D) [is_right_adjoint G] :
62+
preserves_zero_morphisms G :=
63+
{ map_zero' := λ X Y, let adj := adjunction.of_right_adjoint G in
64+
begin
65+
calc G.map (0 : X ⟶ Y) = adj.unit.app (G.obj X) ≫ G.map (adj.counit.app X) ≫ G.map 0 : _
66+
... = adj.unit.app (G.obj X) ≫ G.map ((left_adjoint G).map (0 : _ ⟶ G.obj X)) ≫ G.map 0 : _
67+
... = 0 : _,
68+
{ rw adjunction.right_triangle_components_assoc },
69+
{ simp only [← G.map_comp, comp_zero] },
70+
{ simp only [adjunction.unit_naturality_assoc, zero_comp] }
71+
end }
72+
73+
@[priority 100]
74+
instance preserves_zero_morphisms_of_full (F : C ⥤ D) [full F] : preserves_zero_morphisms F :=
75+
{ map_zero' := λ X Y, calc
76+
F.map (0 : X ⟶ Y) = F.map (0 ≫ (F.preimage (0 : F.obj Y ⟶ F.obj Y))) : by rw zero_comp
77+
... = 0 : by rw [F.map_comp, F.image_preimage, comp_zero] }
78+
79+
end zero_morphisms
80+
81+
section zero_object
82+
variables [has_zero_object C] [has_zero_object D]
83+
84+
open_locale zero_object
85+
86+
variables [has_zero_morphisms C] [has_zero_morphisms D] (F : C ⥤ D)
87+
88+
/-- A functor that preserves zero morphisms also preserves the zero object. -/
89+
@[simps] def map_zero_object [preserves_zero_morphisms F] : F.obj 00 :=
90+
{ hom := 0,
91+
inv := 0,
92+
hom_inv_id' := by rw [← F.map_id, id_zero, F.map_zero, zero_comp],
93+
inv_hom_id' := by rw [id_zero, comp_zero] }
94+
95+
variables {F}
96+
97+
lemma preserves_zero_morphisms_of_map_zero_object (i : F.obj 00) : preserves_zero_morphisms F :=
98+
{ map_zero' := λ X Y, calc
99+
F.map (0 : X ⟶ Y) = F.map (0 : X ⟶ 0) ≫ F.map 0 : by rw [← functor.map_comp, comp_zero]
100+
... = F.map 0 ≫ (i.hom ≫ i.inv) ≫ F.map 0
101+
: by rw [iso.hom_inv_id, category.id_comp]
102+
... = 0 : by simp only [zero_of_to_zero i.hom, zero_comp, comp_zero] }
103+
104+
@[priority 100]
105+
instance preserves_zero_morphisms_of_preserves_initial_object
106+
[preserves_colimit (functor.empty.{v₁} C) F] : preserves_zero_morphisms F :=
107+
preserves_zero_morphisms_of_map_zero_object $ (F.map_iso has_zero_object.zero_iso_initial).trans $
108+
(preserves_initial.iso F).trans has_zero_object.zero_iso_initial.symm
109+
110+
@[priority 100]
111+
instance preserves_zero_morphisms_of_preserves_terminal_object
112+
[preserves_limit (functor.empty.{v₁} C) F] : preserves_zero_morphisms F :=
113+
preserves_zero_morphisms_of_map_zero_object $ (F.map_iso has_zero_object.zero_iso_terminal).trans $
114+
(preserves_terminal.iso F).trans has_zero_object.zero_iso_terminal.symm
115+
116+
end zero_object
117+
118+
end category_theory.functor

src/category_theory/limits/shapes/kernels.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2019 Scott Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Scott Morrison, Markus Himmel
55
-/
6-
import category_theory.limits.shapes.zero
6+
import category_theory.limits.preserves.shapes.zero
77

88
/-!
99
# Kernels and cokernels

src/category_theory/limits/shapes/terminal.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,14 @@ by tidy
266266
initial.to P ≫ f = initial.to Q :=
267267
by tidy
268268

269+
/-- The (unique) isomorphism between the chosen initial object and any other initial object. -/
270+
@[simp] def initial_iso_is_initial [has_initial C] {P : C} (t : is_initial P) : ⊥_ C ≅ P :=
271+
initial_is_initial.unique_up_to_iso t
272+
273+
/-- The (unique) isomorphism between the chosen terminal object and any other terminal object. -/
274+
@[simp] def terminal_iso_is_terminal [has_terminal C] {P : C} (t : is_terminal P) : ⊤_ C ≅ P :=
275+
terminal_is_terminal.unique_up_to_iso t
276+
269277
/-- Any morphism from a terminal object is split mono. -/
270278
instance terminal.split_mono_from {Y : C} [has_terminal C] (f : ⊤_ C ⟶ Y) : split_mono f :=
271279
is_terminal.split_mono_from terminal_is_terminal _

src/category_theory/limits/shapes/zero.lean

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,24 +129,6 @@ instance : has_zero_morphisms (C ⥤ D) :=
129129

130130
@[simp] lemma zero_app (F G : C ⥤ D) (j : C) : (0 : F ⟶ G).app j = 0 := rfl
131131

132-
variables [has_zero_morphisms C]
133-
134-
lemma equivalence_preserves_zero_morphisms (F : C ≌ D) (X Y : C) :
135-
F.functor.map (0 : X ⟶ Y) = (0 : F.functor.obj X ⟶ F.functor.obj Y) :=
136-
begin
137-
have t : F.functor.map (0 : X ⟶ Y) =
138-
F.functor.map (0 : X ⟶ Y) ≫ (0 : F.functor.obj Y ⟶ F.functor.obj Y),
139-
{ apply faithful.map_injective (F.inverse),
140-
rw [functor.map_comp, equivalence.inv_fun_map],
141-
dsimp,
142-
rw [zero_comp, comp_zero, zero_comp], },
143-
exact t.trans (by simp)
144-
end
145-
146-
@[simp] lemma is_equivalence_preserves_zero_morphisms (F : C ⥤ D) [is_equivalence F] (X Y : C) :
147-
F.map (0 : X ⟶ Y) = 0 :=
148-
by rw [←functor.as_equivalence_functor F, equivalence_preserves_zero_morphisms]
149-
150132
end
151133

152134
variables (C)
@@ -225,6 +207,55 @@ has_initial_of_unique 0
225207
instance has_terminal : has_terminal C :=
226208
has_terminal_of_unique 0
227209

210+
/-- The (unique) isomorphism between any initial object and the zero object. -/
211+
def zero_iso_is_initial {X : C} (t : is_initial X) : 0 ≅ X :=
212+
zero_is_initial.unique_up_to_iso t
213+
214+
/-- The (unique) isomorphism between any terminal object and the zero object. -/
215+
def zero_iso_is_terminal {X : C} (t : is_terminal X) : 0 ≅ X :=
216+
zero_is_terminal.unique_up_to_iso t
217+
218+
/-- The (unique) isomorphism between the chosen initial object and the chosen zero object. -/
219+
def zero_iso_initial [has_initial C] : 0 ≅ ⊥_ C :=
220+
zero_is_initial.unique_up_to_iso initial_is_initial
221+
222+
/-- The (unique) isomorphism between the chosen terminal object and the chosen zero object. -/
223+
def zero_iso_terminal [has_terminal C] : 0 ≅ ⊤_ C :=
224+
zero_is_terminal.unique_up_to_iso terminal_is_terminal
225+
226+
section has_zero_morphisms
227+
variables [has_zero_morphisms C]
228+
229+
@[simp] lemma zero_iso_is_initial_hom {X : C} (t : is_initial X) :
230+
(zero_iso_is_initial t).hom = 0 :=
231+
by ext
232+
233+
@[simp] lemma zero_iso_is_initial_inv {X : C} (t : is_initial X) :
234+
(zero_iso_is_initial t).inv = 0 :=
235+
by ext
236+
237+
@[simp] lemma zero_iso_is_terminal_hom {X : C} (t : is_terminal X) :
238+
(zero_iso_is_terminal t).hom = 0 :=
239+
by ext
240+
241+
@[simp] lemma zero_iso_is_terminal_inv {X : C} (t : is_terminal X) :
242+
(zero_iso_is_terminal t).inv = 0 :=
243+
by ext
244+
245+
@[simp] lemma zero_iso_initial_hom [has_initial C] : zero_iso_initial.hom = (0 : 0 ⟶ ⊥_ C) :=
246+
by ext
247+
248+
@[simp] lemma zero_iso_initial_inv [has_initial C] : zero_iso_initial.inv = (0 : ⊥_ C ⟶ 0) :=
249+
by ext
250+
251+
@[simp] lemma zero_iso_terminal_hom [has_terminal C] : zero_iso_terminal.hom = (0 : 0 ⟶ ⊤_ C) :=
252+
by ext
253+
254+
@[simp] lemma zero_iso_terminal_inv [has_terminal C] : zero_iso_terminal.inv = (0 : ⊤_ C ⟶ 0) :=
255+
by ext
256+
257+
end has_zero_morphisms
258+
228259
@[priority 100]
229260
instance has_strict_initial : initial_mono_class C :=
230261
initial_mono_class.of_is_initial zero_is_initial (λ X, category_theory.mono _)

src/category_theory/preadditive/additive_functor.lean

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Adam Topaz, Scott Morrison
55
-/
66
import category_theory.preadditive
7+
import category_theory.limits.preserves.shapes.zero
78
import category_theory.limits.shapes.biproducts
89

910
/-!
@@ -54,9 +55,9 @@ add_monoid_hom.mk' (λ f, F.map f) (λ f g, F.map_add)
5455

5556
lemma coe_map_add_hom {X Y : C} : ⇑(F.map_add_hom : (X ⟶ Y) →+ _) = @map C _ D _ F X Y := rfl
5657

57-
@[simp]
58-
lemma map_zero {X Y : C} : F.map (0 : X ⟶ Y) = 0 :=
59-
F.map_add_hom.map_zero
58+
@[priority 100]
59+
instance preserves_zero_morphisms_of_additive : preserves_zero_morphisms F :=
60+
{ map_zero' := λ X Y, F.map_add_hom.map_zero }
6061

6162
instance : additive (𝟭 C) :=
6263
{}
@@ -84,16 +85,6 @@ lemma map_sum {X Y : C} {α : Type*} (f : α → (X ⟶ Y)) (s : finset α) :
8485
F.map (∑ a in s, f a) = ∑ a in s, F.map (f a) :=
8586
(F.map_add_hom : (X ⟶ Y) →+ _).map_sum f s
8687

87-
open category_theory.limits
88-
open_locale zero_object
89-
90-
/-- An additive functor takes the zero object to the zero object (up to isomorphism). -/
91-
@[simps]
92-
def map_zero_object [has_zero_object C] [has_zero_object D] : F.obj 00 :=
93-
{ hom := 0,
94-
inv := 0,
95-
hom_inv_id' := by { rw ←F.map_id, simp, } }
96-
9788
end
9889

9990
section induced_category

src/category_theory/shift.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2020 Scott Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Scott Morrison, Johan Commelin, Andrew Yang
55
-/
6-
import category_theory.limits.shapes.zero
6+
import category_theory.limits.preserves.shapes.zero
77
import category_theory.monoidal.End
88
import category_theory.monoidal.discrete
99

@@ -309,9 +309,8 @@ open category_theory.limits
309309

310310
variables [has_zero_morphisms C]
311311

312-
@[simp]
313312
lemma shift_zero_eq_zero (X Y : C) (n : A) : (0 : X ⟶ Y)⟦n⟧' = (0 : X⟦n⟧ ⟶ Y⟦n⟧) :=
314-
by apply is_equivalence_preserves_zero_morphisms _ (shift_functor C n)
313+
category_theory.functor.map_zero _ _ _
315314

316315
end add_group
317316

0 commit comments

Comments
 (0)