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

Commit 3a06179

Browse files
committed
refactor(category_theory): reverse simp lemmas about (co)forks (#13519)
Makes `fork.ι` instead of `t.π.app zero` so that we avoid any unnecessary references to `walking_parallel_pair` in (co)fork homs. This induces quite a lot of changes in other files, but I think it's worth the pain. The PR also changes `fork.is_limit.mk` to avoid stating redundant morphisms.
1 parent b7cba57 commit 3a06179

File tree

21 files changed

+198
-197
lines changed

21 files changed

+198
-197
lines changed

src/algebra/category/Module/kernels.lean

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import algebra.category.Module.epi_mono
1111

1212
open category_theory
1313
open category_theory.limits
14-
open category_theory.limits.walking_parallel_pair
1514

1615
universes u v
1716

@@ -32,10 +31,7 @@ fork.is_limit.mk _
3231
by { rw [←@function.comp_apply _ _ _ f (fork.ι s) c, ←coe_comp, fork.condition,
3332
has_zero_morphisms.comp_zero (fork.ι s) N], refl }))
3433
(λ s, linear_map.subtype_comp_cod_restrict _ _ _)
35-
(λ s m h, linear_map.ext $ λ x, subtype.ext_iff_val.2 $
36-
have h₁ : (m ≫ (kernel_cone f).π.app zero).to_fun = (s.π.app zero).to_fun,
37-
by { congr, exact h zero },
38-
by convert @congr_fun _ _ _ _ h₁ x )
34+
(λ s m h, linear_map.ext $ λ x, subtype.ext_iff_val.2 (by simpa [←h]))
3935

4036
/-- The cokernel cocone induced by the projection onto the quotient. -/
4137
def cokernel_cocone : cokernel_cofork f :=
@@ -50,7 +46,7 @@ cofork.is_colimit.mk _
5046
begin
5147
haveI : epi (as_hom f.range.mkq) := (epi_iff_range_eq_top _).mpr (submodule.range_mkq _),
5248
apply (cancel_epi (as_hom f.range.mkq)).1,
53-
convert h walking_parallel_pair.one,
49+
convert h,
5450
exact submodule.liftq_mkq _ _ _
5551
end)
5652
end
@@ -86,7 +82,7 @@ limit.iso_limit_cone_inv_π _ _
8682

8783
@[simp, elementwise] lemma kernel_iso_ker_hom_ker_subtype :
8884
(kernel_iso_ker f).hom ≫ f.ker.subtype = kernel.ι f :=
89-
is_limit.cone_point_unique_up_to_iso_inv_comp _ (limit.is_limit _) zero
85+
is_limit.cone_point_unique_up_to_iso_inv_comp _ (limit.is_limit _) walking_parallel_pair.zero
9086

9187
/--
9288
The categorical cokernel of a morphism in `Module`

src/analysis/normed/group/SemiNormedGroup/kernels.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ namespace SemiNormedGroup
8686
section equalizers_and_kernels
8787

8888
/-- The equalizer cone for a parallel pair of morphisms of seminormed groups. -/
89-
def parallel_pair_cone {V W : SemiNormedGroup.{u}} (f g : V ⟶ W) :
90-
cone (parallel_pair f g) :=
89+
def fork {V W : SemiNormedGroup.{u}} (f g : V ⟶ W) : fork f g :=
9190
@fork.of_ι _ _ _ _ _ _ (of (f - g).ker) (normed_group_hom.incl (f - g).ker) $
9291
begin
9392
ext v,
@@ -100,7 +99,7 @@ end
10099
instance has_limit_parallel_pair {V W : SemiNormedGroup.{u}} (f g : V ⟶ W) :
101100
has_limit (parallel_pair f g) :=
102101
{ exists_limit := nonempty.intro
103-
{ cone := parallel_pair_cone f g,
102+
{ cone := fork f g,
104103
is_limit := fork.is_limit.mk _
105104
(λ c, normed_group_hom.ker.lift (fork.ι c) _ $
106105
show normed_group_hom.comp_hom (f - g) c.ι = 0,
@@ -297,7 +296,7 @@ def explicit_cokernel_iso {X Y : SemiNormedGroup.{u}} (f : X ⟶ Y) :
297296
@[simp]
298297
lemma explicit_cokernel_iso_hom_π {X Y : SemiNormedGroup.{u}} (f : X ⟶ Y) :
299298
explicit_cokernel_π f ≫ (explicit_cokernel_iso f).hom = cokernel.π _ :=
300-
by simp [explicit_cokernel_π, explicit_cokernel_iso]
299+
by simp [explicit_cokernel_π, explicit_cokernel_iso, is_colimit.cocone_point_unique_up_to_iso]
301300

302301
@[simp]
303302
lemma explicit_cokernel_iso_inv_π {X Y : SemiNormedGroup.{u}} (f : X ⟶ Y) :
@@ -310,7 +309,8 @@ lemma explicit_cokernel_iso_hom_desc {X Y Z : SemiNormedGroup.{u}} {f : X ⟶ Y}
310309
(explicit_cokernel_iso f).hom ≫ cokernel.desc f g w = explicit_cokernel_desc w :=
311310
begin
312311
ext1,
313-
simp [explicit_cokernel_desc, explicit_cokernel_π, explicit_cokernel_iso],
312+
simp [explicit_cokernel_desc, explicit_cokernel_π, explicit_cokernel_iso,
313+
is_colimit.cocone_point_unique_up_to_iso],
314314
end
315315

316316
/-- A special case of `category_theory.limits.cokernel.map` adapted to `explicit_cokernel`. -/

src/category_theory/abelian/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ fork.is_limit.mk _
498498
{ rw [biprod.lift_fst, pullback.lift_fst] },
499499
{ rw [biprod.lift_snd, pullback.lift_snd] }
500500
end)
501-
(λ s m h, by ext; simp [fork.ι_eq_app_zero, ←h walking_parallel_pair.zero])
501+
(λ s m h, by ext; simp [←h])
502502

503503
end pullback_to_biproduct_is_kernel
504504

@@ -523,7 +523,7 @@ cofork.is_colimit.mk _
523523
sub_eq_zero.1 $ by rw [←category.assoc, ←category.assoc, ←sub_comp, sub_eq_add_neg, ←neg_comp,
524524
←biprod.lift_eq, cofork.condition s, zero_comp])
525525
(λ s, by ext; simp)
526-
(λ s m h, by ext; simp [cofork.π_eq_app_one, ←h walking_parallel_pair.one] )
526+
(λ s m h, by ext; simp [←h] )
527527

528528
end biproduct_to_pushout_is_cokernel
529529

src/category_theory/abelian/non_preadditive.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ begin
230230
{ intros s m h,
231231
haveI : mono (prod.lift (𝟙 A) (0 : A ⟶ A)) := mono_of_mono_fac (prod.lift_fst _ _),
232232
apply (cancel_mono (prod.lift (𝟙 A) (0 : A ⟶ A))).1,
233-
convert h walking_parallel_pair.zero,
233+
convert h,
234234
ext; simp } },
235235
let hp2 : is_colimit (cokernel_cofork.of_π (limits.prod.snd : A ⨯ A ⟶ A) hlp),
236236
{ exact epi_is_cokernel_of_kernel _ hp1 },

src/category_theory/idempotents/basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ begin
6868
split,
6969
{ erw [assoc, h₂, ← limits.fork.condition s, comp_id], },
7070
{ intros m hm,
71-
erw [← hm],
72-
simp only [← hm, assoc, fork.ι_eq_app_zero,
73-
fork.of_ι_π_app, h₁],
74-
erw comp_id m, }
71+
rw fork.ι_of_ι at hm,
72+
rw [← hm],
73+
simp only [← hm, assoc, h₁],
74+
exact (comp_id m).symm }
7575
end }⟩, },
7676
{ intro h,
7777
refine ⟨_⟩,

src/category_theory/limits/preserves/shapes/equalizers.lean

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def is_limit_map_cone_fork_equiv :
3939
is_limit (G.map_cone (fork.of_ι h w)) ≃
4040
is_limit (fork.of_ι (G.map h) (by simp only [←G.map_comp, w]) : fork (G.map f) (G.map g)) :=
4141
(is_limit.postcompose_hom_equiv (diagram_iso_parallel_pair.{v} _) _).symm.trans
42-
(is_limit.equiv_iso_limit (fork.ext (iso.refl _) (by simp)))
42+
(is_limit.equiv_iso_limit (fork.ext (iso.refl _) (by { simp [fork.ι] })))
4343

4444
/-- The property of preserving equalizers expressed in terms of forks. -/
4545
def is_limit_fork_map_of_is_limit [preserves_limit (parallel_pair f g) G]
@@ -115,8 +115,12 @@ This essentially lets us commute `cofork.of_π` with `functor.map_cocone`.
115115
def is_colimit_map_cocone_cofork_equiv :
116116
is_colimit (G.map_cocone (cofork.of_π h w)) ≃
117117
is_colimit (cofork.of_π (G.map h) (by simp only [←G.map_comp, w]) : cofork (G.map f) (G.map g)) :=
118-
(is_colimit.precompose_inv_equiv (diagram_iso_parallel_pair.{v} _) _).symm.trans
119-
(is_colimit.equiv_iso_colimit (cofork.ext (iso.refl _) (by { dsimp, simp })))
118+
(is_colimit.precompose_inv_equiv (diagram_iso_parallel_pair.{v} _) _).symm.trans $
119+
is_colimit.equiv_iso_colimit $ cofork.ext (iso.refl _) $
120+
begin
121+
dsimp only [cofork.π, cofork.of_π_ι_app],
122+
dsimp, rw [category.comp_id, category.id_comp]
123+
end
120124

121125
/-- The property of preserving coequalizers expressed in terms of coforks. -/
122126
def is_colimit_cofork_map_of_is_colimit [preserves_colimit (parallel_pair f g) G]

src/category_theory/limits/preserves/shapes/kernels.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ begin
4848
refine (is_limit.postcompose_hom_equiv _ _).symm.trans (is_limit.equiv_iso_limit _),
4949
refine parallel_pair.ext (iso.refl _) (iso.refl _) _ _; simp,
5050
refine fork.ext (iso.refl _) _,
51-
simp,
51+
simp [fork.ι]
5252
end
5353

5454
/--
@@ -137,7 +137,10 @@ begin
137137
refine (is_colimit.precompose_hom_equiv _ _).symm.trans (is_colimit.equiv_iso_colimit _),
138138
refine parallel_pair.ext (iso.refl _) (iso.refl _) _ _; simp,
139139
refine cofork.ext (iso.refl _) _,
140-
simp, dsimp, simp,
140+
simp only [cofork.π, iso.refl_hom, id_comp, cocones.precompose_obj_ι,
141+
nat_trans.comp_app, parallel_pair.ext_hom_app, functor.map_cocone_ι_app,
142+
cofork.of_π_ι_app],
143+
apply category.comp_id
141144
end
142145

143146
/--

src/category_theory/limits/shapes/biproducts.lean

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,16 +1408,7 @@ ht.hom_ext $ λ j, by { rw ht.fac, cases j; simp }
14081408
bicone. -/
14091409
def is_binary_bilimit_of_is_limit {X Y : C} (t : binary_bicone X Y) (ht : is_limit t.to_cone) :
14101410
t.is_bilimit :=
1411-
is_binary_bilimit_of_total _
1412-
begin
1413-
refine binary_fan.is_limit.hom_ext ht _ _,
1414-
{ rw [inl_of_is_limit ht, inr_of_is_limit ht, add_comp, category.assoc, category.assoc, ht.fac,
1415-
ht.fac, binary_fan.mk_π_app_left, binary_fan.mk_π_app_left, comp_zero, add_zero,
1416-
binary_bicone.binary_fan_fst_to_cone, category.comp_id, category.id_comp] },
1417-
{ rw [inr_of_is_limit ht, inl_of_is_limit ht, add_comp, category.assoc, category.assoc, ht.fac,
1418-
ht.fac, binary_fan.mk_π_app_right, binary_fan.mk_π_app_right, comp_zero, zero_add,
1419-
binary_bicone.binary_fan_snd_to_cone, category.comp_id, category.id_comp] }
1420-
end
1411+
is_binary_bilimit_of_total _ (by refine binary_fan.is_limit.hom_ext ht _ _; simp)
14211412

14221413
/-- We can turn any limit cone over a pair into a bilimit bicone. -/
14231414
def binary_bicone_is_bilimit_of_limit_cone_of_is_limit {X Y : C} {t : cone (pair X Y)}
@@ -1477,15 +1468,9 @@ def is_binary_bilimit_of_is_colimit {X Y : C} (t : binary_bicone X Y)
14771468
(ht : is_colimit t.to_cocone) : t.is_bilimit :=
14781469
is_binary_bilimit_of_total _
14791470
begin
1480-
refine binary_cofan.is_colimit.hom_ext ht _ _,
1481-
{ rw [fst_of_is_colimit ht, snd_of_is_colimit ht, comp_add, ht.fac_assoc, ht.fac_assoc,
1482-
binary_cofan.mk_ι_app_left, binary_cofan.mk_ι_app_left,
1483-
binary_bicone.binary_cofan_inl_to_cocone, zero_comp, add_zero, category.id_comp t.inl,
1484-
category.comp_id t.inl] },
1485-
{ rw [fst_of_is_colimit ht, snd_of_is_colimit ht, comp_add, ht.fac_assoc, ht.fac_assoc,
1486-
binary_cofan.mk_ι_app_right, binary_cofan.mk_ι_app_right,
1487-
binary_bicone.binary_cofan_inr_to_cocone, zero_comp, zero_add, category.comp_id t.inr,
1488-
category.id_comp t.inr] }
1471+
refine binary_cofan.is_colimit.hom_ext ht _ _; simp,
1472+
{ rw [category.comp_id t.inl] },
1473+
{ rw [category.comp_id t.inr] }
14891474
end
14901475

14911476
/-- We can turn any colimit cocone over a pair into a bilimit bicone. -/
@@ -1565,10 +1550,10 @@ def binary_bicone_of_split_mono_of_cokernel {X Y : C} {f : X ⟶ Y} [split_mono
15651550
rw [split_epi_of_idempotent_of_is_colimit_cofork_section_,
15661551
is_colimit_cofork_of_cokernel_cofork_desc, is_cokernel_epi_comp_desc],
15671552
dsimp only [cokernel_cofork_of_cofork_of_π],
1568-
letI := epi_of_is_colimit_parallel_pair i,
1553+
letI := epi_of_is_colimit_cofork i,
15691554
apply zero_of_epi_comp c.π,
1570-
simp only [sub_comp, category.comp_id, category.assoc, split_mono.id, is_colimit.fac_assoc,
1571-
cofork.of_π_ι_app, category.id_comp, cofork.π_of_π],
1555+
simp only [sub_comp, comp_sub, category.comp_id, category.assoc, split_mono.id, sub_self,
1556+
cofork.is_colimit.π_comp_desc_assoc, cokernel_cofork.π_of_π, split_mono.id_assoc],
15721557
apply sub_eq_zero_of_eq,
15731558
apply category.id_comp
15741559
end,
@@ -1586,8 +1571,8 @@ begin
15861571
split_epi_of_idempotent_of_is_colimit_cofork_section_],
15871572
dsimp only [binary_bicone_of_split_mono_of_cokernel_X],
15881573
rw [is_colimit_cofork_of_cokernel_cofork_desc, is_cokernel_epi_comp_desc],
1589-
simp only [cofork.is_colimit.π_desc_of_π, cokernel_cofork_of_cofork_π,
1590-
cofork.π_of_π, binary_bicone_of_split_mono_of_cokernel_inl, add_sub_cancel'_right],
1574+
simp only [binary_bicone_of_split_mono_of_cokernel_inl, cofork.is_colimit.π_comp_desc,
1575+
cokernel_cofork_of_cofork_π, cofork.π_of_π, add_sub_cancel'_right]
15911576
end
15921577

15931578
/--
@@ -1616,10 +1601,10 @@ def binary_bicone_of_split_epi_of_kernel {X Y : C} {f : X ⟶ Y} [split_epi f]
16161601
rw [split_mono_of_idempotent_of_is_limit_fork_retraction,
16171602
is_limit_fork_of_kernel_fork_lift, is_kernel_comp_mono_lift],
16181603
dsimp only [kernel_fork_of_fork_ι],
1619-
letI := mono_of_is_limit_parallel_pair i,
1604+
letI := mono_of_is_limit_fork i,
16201605
apply zero_of_comp_mono c.ι,
1621-
simp only [comp_sub, category.comp_id, category.assoc, sub_self, fork.ι_eq_app_zero,
1622-
fork.is_limit.lift_of_ι_ι, fork.of_ι_π_app, split_epi.id_assoc]
1606+
simp only [comp_sub, category.comp_id, category.assoc, sub_self, fork.is_limit.lift_comp_ι,
1607+
fork.ι_of_ι, split_epi.id_assoc]
16231608
end,
16241609
inr_snd' := by simp }
16251610

@@ -1635,8 +1620,7 @@ begin
16351620
split_mono_of_idempotent_of_is_limit_fork_retraction],
16361621
dsimp only [binary_bicone_of_split_epi_of_kernel_X],
16371622
rw [is_limit_fork_of_kernel_fork_lift, is_kernel_comp_mono_lift],
1638-
simp only [fork.ι_eq_app_zero, kernel_fork.condition, comp_zero, zero_comp, eq_self_iff_true,
1639-
fork.is_limit.lift_of_ι_ι, kernel_fork_of_fork_ι, fork.of_ι_π_app, sub_add_cancel]
1623+
simp only [fork.is_limit.lift_comp_ι, fork.ι_of_ι, kernel_fork_of_fork_ι, sub_add_cancel]
16401624
end
16411625

16421626
end

0 commit comments

Comments
 (0)