Skip to content

Commit 00dbc4e

Browse files
committed
chore(CategoryTheory/Comma): API separation for StructuredArrow (#37809)
The categories of `StructuredArrow` and `Over` are a particular case of a comma category involving the identity functor or a constant functor. We introduce abbreviations which no longer involve terms like `(𝟭 _).obj _`. This allows to remove some `set_option backward.isDefEq.respectTransparency false`. This is a follow up to #37764.
1 parent 36b6fb6 commit 00dbc4e

File tree

36 files changed

+407
-497
lines changed

36 files changed

+407
-497
lines changed

Mathlib/Algebra/Category/Ring/Under/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ variable (S) in
143143
def tensorProdObjIsoPushoutObj (A : Under R) :
144144
mkUnder S (S ⊗[R] A) ≅ (Under.pushout (ofHom <| algebraMap R S)).obj A :=
145145
Under.isoMk (CommRingCat.isPushout_tensorProduct R S A).flip.isoPushout <| by
146-
simp only [Functor.const_obj_obj, Under.pushout_obj, Functor.id_obj, Under.mk_right,
146+
simp only [Under.pushout_obj, Under.mk_right,
147147
mkUnder_hom, AlgHom.toRingHom_eq_coe, IsPushout.inr_isoPushout_hom, Under.mk_hom]
148148
rfl
149149

Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ This is the underlying cone, and it is limiting as witnessed by `isLimitOpensCon
218218
@[simps] noncomputable
219219
def opensCone (i : I) (U : (D.obj i).Opens) : Cone (opensDiagram D i U) where
220220
pt := c.π.app i ⁻¹ᵁ U
221-
π.app j := (c.π.app j.left).resLE _ _ (by rw [← Scheme.Hom.comp_preimage, c.w]; rfl)
221+
π.app j := (c.π.app j.left).resLE _ _ (by rw [← Scheme.Hom.comp_preimage, c.w])
222222

223223
attribute [local instance] CategoryTheory.isConnected_of_hasTerminal
224224

@@ -251,8 +251,7 @@ instance [∀ {i j} (f : i ⟶ j), IsAffineHom (D.map f)] {i : I}
251251
· rintro ⟨⟨_, hU⟩, hV, rfl⟩
252252
convert hV
253253
exact Subtype.ext (by simp)
254-
· simp only [Functor.id_obj, opensDiagram_obj, Functor.const_obj_obj,
255-
Scheme.Opens.opensRange_ι]
254+
· simp only [opensDiagram_obj, Scheme.Opens.opensRange_ι]
256255
rintro x ⟨⟨y, h₁ : (D.map k.hom).base y ∈ U⟩, h₂, e⟩
257256
obtain rfl : y = (D.map f.left).base x := congr($e)
258257
dsimp at h₁
@@ -320,7 +319,7 @@ lemma isBasis_preimage_isAffineOpen [IsCofiltered I] [∀ {i j} (f : i ⟶ j), I
320319
from (c.π.app i ⁻¹ᵁ V).topIso.commRingCatIsoToRingEquiv.symm_apply_eq.mp hs.symm using 3
321320
simp [Scheme.Hom.app_eq_appLE, Scheme.Hom.resLE_appLE]
322321
refine ⟨_, ⟨j.left, _, (hV.preimage _).basicOpen s, rfl⟩, ?_⟩
323-
simp only [Functor.const_obj_obj, Functor.id_obj, Scheme.preimage_basicOpen] at this ⊢
322+
simp only [Functor.const_obj_obj, Scheme.preimage_basicOpen] at this ⊢
324323
rw [← c.pt.basicOpen_res_eq _ (eqToHom h.symm).op, ← CommRingCat.comp_apply,
325324
Scheme.Hom.app_eq_appLE, Scheme.Hom.appLE_map, ← this]
326325
exact ⟨hxr, hrU⟩
@@ -1186,7 +1185,7 @@ lemma Scheme.exists_π_app_comp_eq_of_locallyOfFinitePresentation
11861185
let t𝒱 (j : _) : opensDiagram D i' (𝒱' j) ⟶ (Functor.const (Over i')).obj j.1.1.2.1.2 :=
11871186
{ app k := (t.app k.left).resLE _ _ <| by
11881187
refine (Hom.preimage_mono _ (hi' _)).trans ?_
1189-
simp only [Functor.id_obj, Functor.const_obj_obj, ← Hom.comp_preimage, t.naturality,
1188+
simp only [Functor.const_obj_obj, ← Hom.comp_preimage, t.naturality,
11901189
Functor.const_obj_map, Category.comp_id, le_refl]
11911190
naturality {k₁ k₂} f₁₂ := by simp [Hom.resLE_comp_resLE] }
11921191
have (j : s) : IsAffine j.1.1.2.1.1 := j.1.1.2.prop.1

Mathlib/AlgebraicGeometry/ColimitsOver.lean

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,14 @@ lemma isPullback {i j : 𝒰.I₀} (hij : i ⟶ j) :
127127
d.transitionMap hij := by
128128
apply (isColimitOfPreserves (Over.map _ (d.prop_trans hij)) (d.isColimit i)).hom_ext
129129
intro a
130-
simp only [IsColimit.coconePointsIsoOfNatIso_hom, Iso.trans_hom, Functor.isoWhiskerLeft_hom,
131-
iso1, ← Functor.map_comp_assoc, IsColimit.ι_map, Functor.mapCocone_pt,
132-
Functor.mapCocone_ι_app, Functor.map_comp, Category.assoc, Adjunction.counit_naturality,
133-
cocone_ι_transitionMap]
130+
dsimp only [Functor.comp_obj, Functor.id_obj, Functor.mapCocone_pt, Functor.const_obj_obj,
131+
Functor.mapCocone_ι_app, Iso.trans_hom, Functor.isoWhiskerLeft_hom, Iso.symm_hom]
132+
rw [IsColimit.coconePointsIsoOfNatIso_hom, ← Functor.map_comp_assoc, IsColimit.ι_map,
133+
Functor.mapCocone_ι_app, Functor.map_comp, Category.assoc,
134+
Adjunction.counit_naturality, cocone_ι_transitionMap]
134135
ext
135-
simp only [Comma.comp_hom, CategoryTheory.Comma.comp_left, ← Category.assoc]
136+
dsimp
137+
rw [Category.comp_id, ← Category.assoc]
136138
congr 1
137139
apply pullback.hom_ext <;> simp
138140
let iso2 : (d.cocone i).pt.left ≅ pullback (d.cocone j).pt.hom (𝒰.trans hij) :=

Mathlib/AlgebraicGeometry/Cover/Over.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ def Cover.pullbackCoverOverProp : W.Cover (precoverage P) where
143143
((PreservesPullback.iso (MorphismProperty.Over.forget Q _ _ ⋙ Over.forget S)
144144
(f.asOverProp S) ((𝒰.f _).asOverProp S)).inv)
145145
(PreservesPullback.iso_inv_fst _ _ _) x).mp hy
146-
· dsimp only
147-
rw [← Over.forget_map, MorphismProperty.Comma.toCommaMorphism_eq_hom,
146+
· simp only [← CategoryTheory.Over.forget_map]
147+
rw [MorphismProperty.Comma.toCommaMorphism_eq_hom,
148148
← MorphismProperty.Comma.forget_map, ← Functor.comp_map]
149149
rw [← PreservesPullback.iso_hom_fst, P.cancel_left_of_respectsIso]
150150
exact P.pullback_fst _ _ (𝒰.map_prop j)
@@ -175,8 +175,8 @@ def Cover.pullbackCoverOverProp' : W.Cover (precoverage P) where
175175
((PreservesPullback.iso (MorphismProperty.Over.forget Q _ _ ⋙ Over.forget S)
176176
((𝒰.f _).asOverProp S) (f.asOverProp S)).inv)
177177
(PreservesPullback.iso_inv_snd _ _ _) x).mp hy
178-
· dsimp only
179-
rw [← Over.forget_map, MorphismProperty.Comma.toCommaMorphism_eq_hom,
178+
· simp only [← CategoryTheory.Over.forget_map]
179+
rw [MorphismProperty.Comma.toCommaMorphism_eq_hom,
180180
← MorphismProperty.Comma.forget_map, ← Functor.comp_map]
181181
rw [← PreservesPullback.iso_hom_snd, P.cancel_left_of_respectsIso]
182182
exact P.pullback_snd _ _ (𝒰.map_prop j)

Mathlib/AlgebraicGeometry/Sites/Small.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ lemma Cover.overEquiv_generate_toPresieveOver_eq_ofArrows {X : Over S}
5858
[𝒰.Over S] : Sieve.overEquiv X (Sieve.generate 𝒰.toPresieveOver) =
5959
Sieve.ofArrows 𝒰.X 𝒰.f := by
6060
ext V f
61-
simp only [Sieve.overEquiv_iff, Functor.const_obj_obj, Sieve.generate_apply]
61+
simp only [Sieve.overEquiv_iff, Sieve.generate_apply]
6262
constructor
6363
· rintro ⟨U, h, g, ⟨k⟩, hcomp⟩
6464
exact ⟨𝒰.X k, h.left, 𝒰.f k, ⟨k⟩, congrArg CommaMorphism.left hcomp⟩

Mathlib/CategoryTheory/Adjunction/Basic.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,22 +276,21 @@ theorem right_triangle : whiskerLeft G adj.unit ≫ whiskerRight adj.counit G =
276276

277277
@[reassoc (attr := simp)]
278278
theorem counit_naturality {X Y : D} (f : X ⟶ Y) :
279-
F.map (G.map f) ≫ adj.counit.app Y = adj.counit.app X ≫ f :=
279+
dsimp% F.map (G.map f) ≫ adj.counit.app Y = adj.counit.app X ≫ f :=
280280
adj.counit.naturality f
281281

282282
@[reassoc (attr := simp)]
283283
theorem unit_naturality {X Y : C} (f : X ⟶ Y) :
284-
adj.unit.app X ≫ G.map (F.map f) = f ≫ adj.unit.app Y :=
284+
dsimp% adj.unit.app X ≫ G.map (F.map f) = f ≫ adj.unit.app Y :=
285285
(adj.unit.naturality f).symm
286286

287-
set_option backward.isDefEq.respectTransparency false in
288287
lemma unit_comp_map_eq_iff {A : C} {B : D} (f : F.obj A ⟶ B) (g : A ⟶ G.obj B) :
289-
adj.unit.app A ≫ G.map f = g ↔ f = F.map g ≫ adj.counit.app B :=
288+
dsimp% adj.unit.app A ≫ G.map f = g ↔ f = F.map g ≫ adj.counit.app B :=
290289
fun h => by simp [← h], fun h => by simp [h]⟩
291290

292291
set_option backward.isDefEq.respectTransparency false in
293292
lemma eq_unit_comp_map_iff {A : C} {B : D} (f : F.obj A ⟶ B) (g : A ⟶ G.obj B) :
294-
g = adj.unit.app A ≫ G.map f ↔ F.map g ≫ adj.counit.app B = f :=
293+
dsimp% g = adj.unit.app A ≫ G.map f ↔ F.map g ≫ adj.counit.app B = f :=
295294
fun h => by simp [h], fun h => by simp [← h]⟩
296295

297296
theorem homEquiv_apply_eq {A : C} {B : D} (f : F.obj A ⟶ B) (g : A ⟶ G.obj B) :

Mathlib/CategoryTheory/Adjunction/Lifting/Left.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,9 @@ def counitCoequalises (h : ∀ X : B, RegularEpi (adj₁.counit.app X)) (X : B)
8686
refine ⟨((h X).desc' s.π ?_).1, ?_, ?_⟩
8787
· rw [← cancel_epi (adj₁.counit.app (h X).W)]
8888
rw [← adj₁.counit_naturality_assoc (h X).left]
89-
dsimp only [Functor.comp_obj]
90-
rw [← s.condition, ← F.map_comp_assoc, ← U.map_comp, RegularEpi.w, U.map_comp,
89+
dsimp
90+
rw [← dsimp% s.condition, ← F.map_comp_assoc, ← U.map_comp, RegularEpi.w, U.map_comp,
9191
F.map_comp_assoc, s.condition, ← adj₁.counit_naturality_assoc (h X).right]
92-
simp
9392
· apply ((h X).desc' s.π _).2
9493
· intro m hm
9594
rw [← cancel_epi (adj₁.counit.app X)]
@@ -147,9 +146,10 @@ noncomputable def constructLeftAdjointEquiv (h : ∀ X : B, RegularEpi (adj₁.c
147146
rw [← (adj₂.homEquiv _ _).injective.eq_iff, eq_comm, adj₂.homEquiv_naturality_left,
148147
otherMap, assoc, adj₂.homEquiv_naturality_left, ← adj₂.counit_naturality,
149148
adj₂.homEquiv_naturality_left, adj₂.homEquiv_unit, adj₂.right_triangle_components,
150-
comp_id, Functor.comp_map, ← U.map_comp, assoc, ← adj₁.counit_naturality,
151-
adj₂.homEquiv_unit, adj₂.homEquiv_unit, F.map_comp, assoc]
152-
rfl
149+
comp_id, Functor.comp_map, ← U.map_comp, assoc]
150+
dsimp
151+
rw [← adj₁.counit_naturality]
152+
simp [dsimp% adj₂.homEquiv_unit _ _ f ]
153153
_ ≃ { z : F.obj (U.obj X) ⟶ R.obj Y // _ } := by
154154
apply (adj₁.homEquiv _ _).symm.subtypeEquiv
155155
intro g

Mathlib/CategoryTheory/Bicategory/Kan/Adjunction.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def isKanOfWhiskerLeftAdjoint
237237
bicategory) <| by
238238
intro s' τ₀'
239239
let τ' : t.extension ≫ h ⟶ s'.extension := τ₀'.right
240-
have Hτ' : t.unit ▷ h ⊗≫ f ◁ τ' = s'.unit := by simpa [bicategoricalComp] using τ₀'.w.symm
240+
have Hτ' : t.unit ▷ h ⊗≫ f ◁ τ' = s'.unit := by simpa [bicategoricalComp] using τ₀'.w
241241
ext
242242
apply (H' _).hom_ext
243243
dsimp only [StructuredArrow.homMk_right]

0 commit comments

Comments
 (0)