Skip to content

Commit f4001a9

Browse files
committed
feat(CategoryTheory/Limits/IsLimit): use to_dual on IsLimit (leanprover-community#36572)
This PR makes a start at translating `IsLimit` using `to_dual`.
1 parent 1531e8c commit f4001a9

16 files changed

Lines changed: 196 additions & 443 deletions

File tree

Mathlib/Algebra/Category/Grp/LargeColimits.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ lemma isColimit_iff_bijective_desc [DecidableEq J] :
4646
apply ofHom_injective
4747
refine hc.hom_ext (fun j ↦ ?_)
4848
ext x
49-
rw [ConcreteCategory.comp_apply, ConcreteCategory.comp_apply, ← Quot.ι_desc _ c j x]
49+
erw [ConcreteCategory.comp_apply, ConcreteCategory.comp_apply, ← Quot.ι_desc _ c j x]
5050
exact DFunLike.congr_fun eq (Quot.ι F j x)
5151
· set c' : Cocone F :=
5252
{ pt := AddCommGrpCat.of (ULift (AddCircle (1 : ℚ)))

Mathlib/Algebra/Category/ModuleCat/FilteredColimits.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,10 @@ def colimitDesc (t : Cocone F) : colimit F ⟶ t.pt :=
175175
obtain ⟨j, x, rfl⟩ := M.mk_surjective F x
176176
simp [hf] }
177177

178+
set_option backward.defeqAttrib.useBackward true in
178179
@[reassoc (attr := simp)]
179180
lemma ι_colimitDesc (t : Cocone F) (j : J) :
180-
(colimitCocone F).ι.app j ≫ colimitDesc F t = t.ι.app j :=
181+
dsimp% (colimitCocone F).ι.app j ≫ colimitDesc F t = t.ι.app j :=
181182
(forget₂ _ AddCommGrpCat).map_injective
182183
((AddCommGrpCat.FilteredColimits.colimitCoconeIsColimit (F ⋙ forget₂ _ _)).fac _ _)
183184

Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Colim.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ short complex `c₁.pt ⟶ c₂.pt ⟶ c₃.pt`. -/
109109
@[simps]
110110
def colim.mapShortComplex : ShortComplex C :=
111111
ShortComplex.mk f g (hc₁.hom_ext (fun j ↦ by
112-
dsimp
113112
rw [reassoc_of% (hf j), hg j, comp_zero, ← NatTrans.comp_app_assoc, S.zero,
114113
zero_app, zero_comp]))
115114

Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Connected.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ noncomputable def IsColimit.pullbackOfHasExactColimitsOfShape [HasPullbacks C]
5151
have := hc.isIso_colimMap_ι
5252
apply hpull.isIso_snd_of_isIso
5353

54+
set_option backward.isDefEq.respectTransparency false in
5455
/-- Detecting equality of morphisms factoring through a connected colimit by pulling back along
5556
the inclusions of the colimit. -/
5657
theorem IsColimit.pullback_hom_ext [HasPullbacks C] [HasColimitsOfShape J C]

Mathlib/CategoryTheory/Limits/Cones.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,11 @@ instance inhabitedCone (F : Discrete PUnit ⥤ C) : Inhabited (Cone F) :=
151151
}⟩
152152

153153
set_option backward.defeqAttrib.useBackward true in
154-
@[to_dual (attr := reassoc (attr := simp))]
154+
@[to_dual (attr := reassoc (attr := simp), elementwise)]
155155
theorem Cone.w {F : J ⥤ C} (c : Cone F) {j j' : J} (f : j ⟶ j') :
156156
dsimp% c.π.app j ≫ F.map f = c.π.app j' := by
157157
simpa using (c.π.naturality f).symm
158158

159-
attribute [elementwise] Cocone.w Cone.w
160-
161159
end
162160

163161
variable {F : J ⥤ C}

Mathlib/CategoryTheory/Limits/IsLimit.lean

Lines changed: 174 additions & 427 deletions
Large diffs are not rendered by default.

Mathlib/CategoryTheory/Limits/MonoCoprod.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ instance {A B : C} [MonoCoprod C] [HasBinaryCoproduct A B] : Mono (coprod.inl :
7676
instance {A B : C} [MonoCoprod C] [HasBinaryCoproduct A B] : Mono (coprod.inr : B ⟶ A ⨿ B) :=
7777
binaryCofan_inr _ (colimit.isColimit _)
7878

79+
set_option backward.isDefEq.respectTransparency false in
7980
theorem mono_inl_iff {A B : C} {c₁ c₂ : BinaryCofan A B} (hc₁ : IsColimit c₁) (hc₂ : IsColimit c₂) :
8081
Mono c₁.inl ↔ Mono c₂.inl := by
8182
suffices

Mathlib/CategoryTheory/Limits/MorphismProperty.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ lemma CostructuredArrow.isClosedUnderColimitsOfShape {J : Type*} [Category* J]
121121
isColimitOfPreserves _ d.isColimit
122122
have heq : Y.hom = hd.desc { pt := X, ι := { app j := (d.diag.obj j).hom } } := by
123123
refine hd.hom_ext fun j ↦ ?_
124-
simp only [Functor.const_obj_obj, IsColimit.fac]
124+
simp only [IsColimit.fac]
125125
simp
126126
rw [P.costructuredArrowObj_iff, heq, ← hd.coconePointUniqueUpToIso_hom_desc (hc _),
127127
P.cancel_left_of_respectsIso]

Mathlib/CategoryTheory/Limits/Preserves/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ lemma isIso_app_coconePt_of_preservesColimit
778778
(isColimitOfPreserves L hc) (isColimitOfPreserves L' hc) (asIso (whiskerLeft K α))
779779
convert! (inferInstance : IsIso e.hom)
780780
apply (isColimitOfPreserves L hc).hom_ext fun j ↦ ?_
781-
simp only [Functor.comp_obj, Functor.mapCocone_pt, Functor.const_obj_obj, Functor.mapCocone_ι_app,
781+
simp only [Functor.comp_obj, Functor.mapCocone_pt, Functor.mapCocone_ι_app,
782782
NatTrans.naturality, IsColimit.coconePointsIsoOfNatIso_hom, asIso_hom, e]
783783
refine (((isColimitOfPreserves L hc).ι_map (L'.mapCocone c) (whiskerLeft K α) j).trans ?_).symm
784784
simp

Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ variable {c₁ : Cocone K₁} (hc₁ : IsColimit c₁)
146146
{c₃ : Cocone <| uncurry.obj (whiskeringLeft₂ C |>.obj K₁ |>.obj K₂ |>.obj G)}
147147
(hc₃ : IsColimit c₃)
148148

149+
set_option backward.isDefEq.respectTransparency false in
149150
/-- Characterize the inverse direction of the isomorphism
150151
`PreservesColimit₂.isoObjCoconePointsOfIsColimit` w.r.t. the canonical maps to the colimit. -/
151152
@[reassoc (attr := simp)]
@@ -231,10 +232,9 @@ instance of_preservesColimits_in_each_variable
231232
apply (P j₁).hom_ext
232233
intro j₂
233234
haveI := (P j₁).fac s j₂
235+
simp only [Functor.mapCocone_pt, Functor.mapCocone_ι_app, Q₀, s] at this
234236
simp only [Functor.mapCocone_pt,
235-
Functor.const_obj_obj, Functor.mapCocone_ι_app, Q₀, s] at this
236-
simp only [Functor.mapCocone_pt,
237-
Functor.const_obj_obj, Functor.mapCocone_ι_app, NatTrans.naturality, this, Q₀, s])
237+
Functor.mapCocone_ι_app, NatTrans.naturality, this, Q₀, s])
238238
⟨IsColimit.ofCoconeUncurry P <| IsColimit.precomposeHomEquiv E₀ _ <|
239239
IsColimit.ofIsoColimit (isColimitOfPreserves _ hc₁) E₁.symm⟩
240240

0 commit comments

Comments
 (0)