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

Commit bb44e1a

Browse files
committed
feat(category_theory/subobject): generalise bot of subobject lattice (#8232)
1 parent b61ce02 commit bb44e1a

File tree

6 files changed

+85
-48
lines changed

6 files changed

+85
-48
lines changed

src/algebra/homology/homology.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ variables {ι : Type*}
2828
variables {V : Type u} [category.{v} V] [has_zero_morphisms V]
2929
variables {c : complex_shape ι} (C : homological_complex V c)
3030

31-
open_locale classical
31+
open_locale classical zero_object
3232
noncomputable theory
3333

3434
namespace homological_complex

src/category_theory/abelian/basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ limits.has_finite_biproducts.of_has_finite_products
126126
instance has_binary_biproducts : has_binary_biproducts C :=
127127
limits.has_binary_biproducts_of_finite_biproducts _
128128

129+
@[priority 100]
130+
instance has_zero_object : has_zero_object C :=
131+
has_zero_object_of_has_initial_object
132+
129133
section to_non_preadditive_abelian
130134

131135
/-- Every abelian category is, in particular, `non_preadditive_abelian`. -/

src/category_theory/limits/shapes/zero.lean

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,25 @@ def zero_morphisms_of_zero_object : has_zero_morphisms C :=
210210
comp_zero' := λ X Y Z f, by { dunfold has_zero.zero, rw ←category.assoc, congr, }}
211211

212212
/-- A zero object is in particular initial. -/
213-
lemma has_initial : has_initial C :=
213+
def zero_is_initial : is_initial (0 : C) :=
214+
is_initial.of_unique 0
215+
/-- A zero object is in particular terminal. -/
216+
def zero_is_terminal : is_terminal (0 : C) :=
217+
is_terminal.of_unique 0
218+
219+
/-- A zero object is in particular initial. -/
220+
@[priority 10]
221+
instance has_initial : has_initial C :=
214222
has_initial_of_unique 0
215223
/-- A zero object is in particular terminal. -/
216-
lemma has_terminal : has_terminal C :=
224+
@[priority 10]
225+
instance has_terminal : has_terminal C :=
217226
has_terminal_of_unique 0
218227

228+
@[priority 100]
229+
instance has_strict_initial : initial_mono_class C :=
230+
initial_mono_class.of_is_initial zero_is_initial (λ X, category_theory.mono _)
231+
219232
open_locale zero_object
220233

221234
instance {B : Type*} [category B] [has_zero_morphisms C] : has_zero_object (B ⥤ C) :=
@@ -380,8 +393,7 @@ def is_iso_zero_self_equiv_iso_zero (X : C) : is_iso (0 : X ⟶ X) ≃ (X ≅ 0)
380393
end is_iso
381394

382395
/-- If there are zero morphisms, any initial object is a zero object. -/
383-
@[priority 50]
384-
instance has_zero_object_of_has_initial_object
396+
def has_zero_object_of_has_initial_object
385397
[has_zero_morphisms C] [has_initial C] : has_zero_object C :=
386398
{ zero := ⊥_ C,
387399
unique_to := λ X, ⟨⟨0⟩, by tidy⟩,
@@ -393,8 +405,7 @@ instance has_zero_object_of_has_initial_object
393405
⟩ }
394406

395407
/-- If there are zero morphisms, any terminal object is a zero object. -/
396-
@[priority 50]
397-
instance has_zero_object_of_has_terminal_object
408+
def has_zero_object_of_has_terminal_object
398409
[has_zero_morphisms C] [has_terminal C] : has_zero_object C :=
399410
{ zero := ⊤_ C,
400411
unique_from := λ X, ⟨⟨0⟩, by tidy⟩,

src/category_theory/subobject/factor_thru.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace mono_over
3030
`P.factors f` expresses that there exists a factorisation of `f` through `P`.
3131
Given `h : P.factors f`, you can recover the morphism as `P.factor_thru f h`.
3232
-/
33-
def factors {X Y : C} (P : mono_over Y) (f : X ⟶ Y) : Prop := ∃ g : X ⟶ P.val.left, g ≫ P.arrow = f
33+
def factors {X Y : C} (P : mono_over Y) (f : X ⟶ Y) : Prop := ∃ g : X ⟶ (P : C), g ≫ P.arrow = f
3434

3535
lemma factors_congr {X : C} {f g : mono_over X} {Y : C} (h : Y ⟶ X) (e : f ≅ g) :
3636
f.factors h ↔ g.factors h :=
@@ -39,7 +39,7 @@ lemma factors_congr {X : C} {f g : mono_over X} {Y : C} (h : Y ⟶ X) (e : f ≅
3939

4040
/-- `P.factor_thru f h` provides a factorisation of `f : X ⟶ Y` through some `P : mono_over Y`,
4141
given the evidence `h : P.factors f` that such a factorisation exists. -/
42-
def factor_thru {X Y : C} (P : mono_over Y) (f : X ⟶ Y) (h : factors P f) : X ⟶ P.val.left :=
42+
def factor_thru {X Y : C} (P : mono_over Y) (f : X ⟶ Y) (h : factors P f) : X ⟶ (P : C) :=
4343
classical.some h
4444

4545
end mono_over

src/category_theory/subobject/lattice.lean

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,39 @@ end
6868
end has_top
6969

7070
section has_bot
71-
variables [has_zero_morphisms C] [has_zero_object C]
72-
open_locale zero_object
71+
72+
variables [has_initial C] [initial_mono_class C]
7373

7474
instance {X : C} : has_bot (mono_over X) :=
75-
{ bot := mk' (0 : 0 X) }
75+
{ bot := mk' (initial.to X) }
7676

77-
@[simp] lemma bot_left (X : C) : ((⊥ : mono_over X) : C) = 0 := rfl
78-
@[simp] lemma bot_arrow {X : C} : (⊥ : mono_over X).arrow = 0 :=
79-
by ext
77+
@[simp] lemma bot_left (X : C) : ((⊥ : mono_over X) : C) = ⊥_ C := rfl
78+
@[simp] lemma bot_arrow {X : C} : (⊥ : mono_over X).arrow = initial.to X := rfl
8079

8180
/-- The (unique) morphism from `⊥ : mono_over X` to any other `f : mono_over X`. -/
8281
def bot_le {X : C} (f : mono_over X) : ⊥ ⟶ f :=
83-
hom_mk 0 (by simp)
82+
hom_mk (initial.to _) (by simp)
8483

8584
/-- `map f` sends `⊥ : mono_over X` to `⊥ : mono_over Y`. -/
8685
def map_bot (f : X ⟶ Y) [mono f] : (map f).obj ⊥ ≅ ⊥ :=
87-
iso_of_both_ways (hom_mk 0 (by simp)) (hom_mk (𝟙 _) (by simp [id_comp f]))
86+
iso_of_both_ways (hom_mk (initial.to _) (by simp)) (hom_mk (𝟙 _) (by simp))
8887

8988
end has_bot
9089

90+
section zero_order_bot
91+
92+
variables [has_zero_object C]
93+
open_locale zero_object
94+
95+
/-- The object underlying `⊥ : subobject B` is (up to isomorphism) the zero object. -/
96+
def bot_coe_iso_zero {B : C} : ((⊥ : mono_over B) : C) ≅ 0 :=
97+
initial_is_initial.unique_up_to_iso has_zero_object.zero_is_initial
98+
99+
@[simp] lemma bot_arrow_eq_zero [has_zero_morphisms C] {B : C} : (⊥ : mono_over B).arrow = 0 :=
100+
zero_of_source_iso_zero _ bot_coe_iso_zero
101+
102+
end zero_order_bot
103+
91104
section inf
92105
variables [has_pullbacks C]
93106

@@ -245,8 +258,7 @@ end
245258
end order_top
246259

247260
section order_bot
248-
variables [has_zero_morphisms C] [has_zero_object C]
249-
open_locale zero_object
261+
variables [has_initial C] [initial_mono_class C]
250262

251263
instance order_bot {X : C} : order_bot (subobject X) :=
252264
{ bot := quotient.mk' ⊥,
@@ -257,21 +269,37 @@ instance order_bot {X : C} : order_bot (subobject X) :=
257269
end,
258270
..subobject.partial_order X }
259271

260-
lemma bot_eq_zero {B : C} : (⊥ : subobject B) = subobject.mk (0 : 0 ⟶ B) := rfl
272+
lemma bot_eq_initial_to {B : C} : (⊥ : subobject B) = subobject.mk (initial.to B) := rfl
273+
274+
/-- The object underlying `⊥ : subobject B` is (up to isomorphism) the initial object. -/
275+
def bot_coe_iso_initial {B : C} : ((⊥ : subobject B) : C) ≅ ⊥_ C := underlying_iso _
276+
277+
lemma map_bot (f : X ⟶ Y) [mono f] : (map f).obj ⊥ = ⊥ :=
278+
quotient.sound' ⟨mono_over.map_bot f⟩
279+
280+
end order_bot
281+
282+
section zero_order_bot
283+
284+
variables [has_zero_object C]
285+
open_locale zero_object
261286

262287
/-- The object underlying `⊥ : subobject B` is (up to isomorphism) the zero object. -/
263-
def bot_coe_iso_zero {B : C} : ((⊥ : subobject B) : C) ≅ 0 := underlying_iso _
288+
def bot_coe_iso_zero {B : C} : ((⊥ : subobject B) : C) ≅ 0 :=
289+
bot_coe_iso_initial ≪≫ initial_is_initial.unique_up_to_iso has_zero_object.zero_is_initial
290+
291+
variables [has_zero_morphisms C]
292+
293+
lemma bot_eq_zero {B : C} : (⊥ : subobject B) = subobject.mk (0 : 0 ⟶ B) :=
294+
mk_eq_mk_of_comm _ _ (initial_is_initial.unique_up_to_iso has_zero_object.zero_is_initial) (by simp)
264295

265296
@[simp] lemma bot_arrow {B : C} : (⊥ : subobject B).arrow = 0 :=
266297
zero_of_source_iso_zero _ bot_coe_iso_zero
267298

268-
lemma map_bot (f : X ⟶ Y) [mono f] : (map f).obj ⊥ = ⊥ :=
269-
quotient.sound' ⟨mono_over.map_bot f⟩
270-
271299
lemma bot_factors_iff_zero {A B : C} (f : A ⟶ B) : (⊥ : subobject B).factors f ↔ f = 0 :=
272-
by { rintro ⟨h, w⟩, simp at w, exact w.symm, }, by { rintro rfl, exact ⟨0, by simp⟩, }⟩
300+
by { rintro ⟨h, rfl⟩, simp }, by { rintro rfl, exact ⟨0, by simp⟩, }⟩
273301

274-
end order_bot
302+
end zero_order_bot
275303

276304
section functor
277305
variable (C)
@@ -442,16 +470,7 @@ lemma sup_factors_of_factors_right {A B : C} {X Y : subobject B} {f : A ⟶ B} (
442470
(X ⊔ Y).factors f :=
443471
factors_of_le f le_sup_right P
444472

445-
/-!
446-
Unfortunately, there are two different ways we may obtain a `semilattice_sup_bot (subobject B)`,
447-
either as here, by assuming `[has_zero_morphisms C] [has_zero_object C]`,
448-
or if `C` is cartesian closed.
449-
450-
These will be definitionally different, and at the very least we will need two different versions
451-
of `finset_sup_factors`. So far I don't see how to handle this through generalization.
452-
-/
453-
section
454-
variables [has_zero_morphisms C] [has_zero_object C]
473+
variables [has_initial C] [initial_mono_class C]
455474

456475
instance {B : C} : semilattice_sup_bot (subobject B) :=
457476
{ ..subobject.order_bot,
@@ -472,8 +491,6 @@ begin
472491
{ exact sup_factors_of_factors_right (ih ⟨j, ⟨m, h⟩⟩), }, },
473492
end
474493

475-
end
476-
477494
end semilattice_sup
478495

479496
section lattice
@@ -483,7 +500,7 @@ instance {B : C} : lattice (subobject B) :=
483500
{ ..subobject.semilattice_inf_top,
484501
..subobject.semilattice_sup }
485502

486-
variables [has_zero_morphisms C] [has_zero_object C]
503+
variables [has_initial C] [initial_mono_class C]
487504

488505
instance {B : C} : bounded_lattice (subobject B) :=
489506
{ ..subobject.semilattice_inf_top,
@@ -648,7 +665,7 @@ end Sup
648665

649666
section complete_lattice
650667
variables [well_powered C] [has_wide_pullbacks C] [has_images C] [has_coproducts C]
651-
[has_zero_morphisms C] [has_zero_object C]
668+
[initial_mono_class C]
652669

653670
instance {B : C} : complete_lattice (subobject B) :=
654671
{ ..subobject.semilattice_inf_top,

src/category_theory/subobject/limits.lean

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,23 +259,28 @@ lemma factor_thru_image_subobject_comp_self_assoc {W W' : C} (k : W ⟶ W') (k'
259259
(image_subobject f).factor_thru (k ≫ k' ≫ f) h = k ≫ k' ≫ factor_thru_image_subobject f :=
260260
by { ext, simp, }
261261

262+
/-- The image of `h ≫ f` is always a smaller subobject than the image of `f`. -/
263+
lemma image_subobject_comp_le
264+
{X' : C} (h : X' ⟶ X) (f : X ⟶ Y) [has_image f] [has_image (h ≫ f)] :
265+
image_subobject (h ≫ f) ≤ image_subobject f :=
266+
subobject.mk_le_mk_of_comm (image.pre_comp h f) (by simp)
267+
268+
section
269+
open_locale zero_object
270+
variables [has_zero_morphisms C] [has_zero_object C]
271+
262272
@[simp]
263-
lemma image_subobject_zero_arrow [has_zero_morphisms C] [has_zero_object C] :
273+
lemma image_subobject_zero_arrow :
264274
(image_subobject (0 : X ⟶ Y)).arrow = 0 :=
265275
by { rw ←image_subobject_arrow, simp, }
266276

267277
@[simp]
268-
lemma image_subobject_zero [has_zero_morphisms C] [has_zero_object C]{A B : C} :
278+
lemma image_subobject_zero {A B : C} :
269279
image_subobject (0 : A ⟶ B) = ⊥ :=
270280
subobject.eq_of_comm
271281
(image_subobject_iso _ ≪≫ image_zero ≪≫ subobject.bot_coe_iso_zero.symm) (by simp)
272282

273-
/-- The image of `h ≫ f` is always a smaller subobject than the image of `f`. -/
274-
lemma image_subobject_comp_le
275-
{X' : C} (h : X' ⟶ X) (f : X ⟶ Y) [has_image f] [has_image (h ≫ f)] :
276-
image_subobject (h ≫ f) ≤ image_subobject f :=
277-
subobject.mk_le_mk_of_comm (image.pre_comp h f) (by simp)
278-
283+
end
279284

280285
section
281286
variables [has_equalizers C]

0 commit comments

Comments
 (0)