Skip to content

Commit 9132589

Browse files
BGuillemetBenoît Guillemet
andcommitted
feat(CategoryTheory/Yoneda): add curried version of Yoneda lemma for heterogeneous universes, and other version of homNatIso (#27819)
Prove a curried version of `yonedaCompUliftFunctorEquiv`, ie a completely functorial version of the Yoneda lemma with heterogeneous universes. Dually, prove a curried version of `coyonedaCompUliftFunctorEquiv`, ie a completely functorial version of the coYoneda lemma with heterogeneous universes. In addition, prove a functorial version of `FullyFaithful.natEquiv` using `coyoneda` instead of `yoneda` (previously, the only functorial version of `FullyFaithful.natEquiv` were `homNatIso`, which is written using `yoneda`). Co-authored-by: Benoît Guillemet <benoit@guillemet.org>
1 parent b52ea70 commit 9132589

File tree

8 files changed

+178
-68
lines changed

8 files changed

+178
-68
lines changed

Mathlib/CategoryTheory/Abelian/GrothendieckCategory/EnoughInjectives.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ lemma exists_pushouts
111111
∃ (X' : C) (i : X ⟶ X') (p' : X' ⟶ Y) (_ : (generatingMonomorphisms G).pushouts i)
112112
(_ : ¬ IsIso i) (_ : Mono p'), i ≫ p' = p := by
113113
rw [hG.isDetector.isIso_iff_of_mono] at hp
114-
simp only [ObjectProperty.singleton_iff, Function.Surjective, coyoneda_obj_obj,
115-
coyoneda_obj_map, forall_eq', not_forall, not_exists] at hp
114+
simp only [ObjectProperty.singleton_iff, Function.Surjective, Functor.flip_obj_obj,
115+
yoneda_obj_obj, Functor.flip_obj_map, forall_eq', not_forall, not_exists] at hp
116116
-- `f : G ⟶ Y` is a monomorphism the image of which is not contained in `X`
117117
obtain ⟨f, hf⟩ := hp
118118
-- we use the subobject `X'` of `Y` that is generated by the images of `p : X ⟶ Y`

Mathlib/CategoryTheory/Filtered/Final.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ theorem Functor.Final.exists_coeq_of_locally_small [IsFilteredOrEmpty C] [Final
236236
obtain ⟨c', t₁, t₂, h⟩ := (Types.FilteredColimit.colimit_eq_iff.{v₁, v₁, v₁} _).mp this
237237
refine ⟨IsFiltered.coeq t₁ t₂, t₁ ≫ IsFiltered.coeqHom t₁ t₂, ?_⟩
238238
conv_rhs => rw [IsFiltered.coeq_condition t₁ t₂]
239-
dsimp only [comp_obj, coyoneda_obj_obj, unop_op, Functor.comp_map, coyoneda_obj_map] at h
239+
dsimp only [comp_obj, flip_obj_obj, yoneda_obj_obj, comp_map, flip_obj_map, yoneda_map_app] at h
240240
simp [reassoc_of% h]
241241

242242
end LocallySmall

Mathlib/CategoryTheory/Limits/IndYoneda.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ noncomputable def colimitHomIsoLimitYoneda
6868
@[reassoc (attr := simp)]
6969
lemma colimitHomIsoLimitYoneda_hom_comp_π [HasLimitsOfShape Iᵒᵖ (Type u₂)] (A : C) (i : I) :
7070
(colimitHomIsoLimitYoneda F A).hom ≫ limit.π (F.op ⋙ yoneda.obj A) ⟨i⟩ =
71-
(coyoneda.map (colimit.ι F i).op).app A := by
71+
(yoneda.obj A).map (colimit.ι F i).op := by
7272
simp only [colimitHomIsoLimitYoneda, Iso.trans_hom, Iso.app_hom, Category.assoc]
7373
erw [limitObjIsoLimitCompEvaluation_hom_π]
7474
change ((coyonedaOpColimitIsoLimitCoyoneda F).hom ≫ _).app A = _
75-
rw [coyonedaOpColimitIsoLimitCoyoneda_hom_comp_π]
75+
rw [coyonedaOpColimitIsoLimitCoyoneda_hom_comp_π, Functor.flip_map_app]
7676

7777
@[reassoc (attr := simp)]
7878
lemma colimitHomIsoLimitYoneda_inv_comp_π [HasLimitsOfShape Iᵒᵖ (Type u₂)] (A : C) (i : I) :
79-
(colimitHomIsoLimitYoneda F A).inv ≫ (coyoneda.map (colimit.ι F i).op).app A =
79+
(colimitHomIsoLimitYoneda F A).inv ≫ (yoneda.obj A).map (colimit.ι F i).op =
8080
limit.π (F.op ⋙ yoneda.obj A) ⟨i⟩ := by
8181
rw [← colimitHomIsoLimitYoneda_hom_comp_π, ← Category.assoc,
8282
Iso.inv_hom_id, Category.id_comp]
@@ -115,16 +115,16 @@ noncomputable def colimitHomIsoLimitYoneda' [HasLimitsOfShape I (Type u₂)] (A
115115
@[reassoc (attr := simp)]
116116
lemma colimitHomIsoLimitYoneda'_hom_comp_π [HasLimitsOfShape I (Type u₂)] (A : C) (i : I) :
117117
(colimitHomIsoLimitYoneda' F A).hom ≫ limit.π (F.rightOp ⋙ yoneda.obj A) i =
118-
(coyoneda.map (colimit.ι F ⟨i⟩).op).app A := by
118+
(yoneda.obj A).map (colimit.ι F ⟨i⟩).op := by
119119
simp only [colimitHomIsoLimitYoneda', Iso.trans_hom,
120120
Iso.app_hom, Category.assoc]
121121
erw [limitObjIsoLimitCompEvaluation_hom_π]
122122
change ((coyonedaOpColimitIsoLimitCoyoneda' F).hom ≫ _).app A = _
123-
rw [coyonedaOpColimitIsoLimitCoyoneda'_hom_comp_π]
123+
rw [coyonedaOpColimitIsoLimitCoyoneda'_hom_comp_π, Functor.flip_map_app]
124124

125125
@[reassoc (attr := simp)]
126126
lemma colimitHomIsoLimitYoneda'_inv_comp_π [HasLimitsOfShape I (Type u₂)] (A : C) (i : I) :
127-
(colimitHomIsoLimitYoneda' F A).inv ≫ (coyoneda.map (colimit.ι F ⟨i⟩).op).app A =
127+
(colimitHomIsoLimitYoneda' F A).inv ≫ (yoneda.obj A).map (colimit.ι F ⟨i⟩).op =
128128
limit.π (F.rightOp ⋙ yoneda.obj A) i := by
129129
rw [← colimitHomIsoLimitYoneda'_hom_comp_π, ← Category.assoc,
130130
Iso.inv_hom_id, Category.id_comp]

Mathlib/CategoryTheory/Limits/Indization/FilteredColimits.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ theorem isFiltered [IsFiltered I] (hF : ∀ i, IsIndObject (F.obj i)) :
126126
-- faithful, `lim_j Hom_{Over (colimit F)}(yGj, yHk) ≅`
127127
-- `lim_j Hom_{CostructuredArrow yoneda (colimit F)}(Gj, Hk)` and so `Hk` is the object we're
128128
-- looking for.
129-
let q := htO.homNatIsoMaxRight
129+
let q := fun X => isoWhiskerLeft _ (uliftYonedaIsoYoneda.symm.app _) ≪≫ htO.homNatIso X
130130
obtain ⟨t'⟩ := Nonempty.map (limMap (isoWhiskerLeft G.op (q _)).hom) hk
131-
exact ⟨_, ⟨((preservesLimitIso uliftFunctor.{u, v} _).inv t').down⟩⟩
131+
exact ⟨_, ⟨((preservesLimitIso uliftFunctor.{max u v, v} _).inv t').down⟩⟩
132132

133133
end IndizationClosedUnderFilteredColimitsAux
134134

Mathlib/CategoryTheory/Limits/Yoneda.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def colimitCoconeIsColimit (X : Cᵒᵖ) : IsColimit (colimitCocone X) where
4444
fac s Y := by
4545
funext f
4646
convert congr_fun (s.w f).symm (𝟙 (unop X))
47-
simp only [coyoneda_obj_obj, Functor.const_obj_obj, types_comp_apply,
48-
coyoneda_obj_map, Category.id_comp]
47+
simp only [Functor.flip_obj_obj, yoneda_obj_obj, Functor.const_obj_obj, Functor.flip_obj_map,
48+
types_comp_apply, yoneda_map_app, Category.id_comp]
4949
uniq s m w := by
5050
apply funext; rintro ⟨⟩
5151
rw [← w]

Mathlib/CategoryTheory/Monoidal/Braided/Reflection.lean

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ theorem isIso_tfae : List.TFAE
122122
have w₁ : (coyoneda.map (L.map (adj.unit.app d ▷ d')).op).app c = (adj.homEquiv _ _).symm ∘
123123
(coyoneda.map (adj.unit.app d ▷ d').op).app (R.obj c) ∘ adj.homEquiv _ _ := by ext; simp
124124
rw [w₁, isIso_iff_bijective]
125-
simp only [comp_obj, coyoneda_obj_obj, id_obj, EquivLike.comp_bijective,
126-
EquivLike.bijective_comp]
125+
simp only [comp_obj, flip_obj_obj, yoneda_obj_obj, id_obj, op_tensorObj, unop_tensorObj,
126+
EquivLike.comp_bijective, EquivLike.bijective_comp]
127127
-- We commute the tensor product using the auxiliary commutative square `w₂`.
128128
have w₂ : ((coyoneda.map (adj.unit.app d ▷ d').op).app (R.obj c)) =
129129
((yoneda.obj (R.obj c)).mapIso (β_ _ _)).hom ∘
@@ -135,12 +135,11 @@ theorem isIso_tfae : List.TFAE
135135
((ihom.adjunction d').homEquiv _ _).symm ∘
136136
((coyoneda.map (adj.unit.app _).op).app _) ∘ (ihom.adjunction d').homEquiv _ _ := by
137137
ext
138-
simp only [id_obj, op_tensorObj, coyoneda_obj_obj, unop_tensorObj, comp_obj,
139-
coyoneda_map_app, Quiver.Hom.unop_op, Function.comp_apply,
140-
Adjunction.homEquiv_unit, Adjunction.homEquiv_counit]
138+
simp only [id_obj, op_tensorObj, flip_obj_obj, yoneda_obj_obj, unop_tensorObj, comp_obj,
139+
flip_map_app, Function.comp_apply, Adjunction.homEquiv_unit, Adjunction.homEquiv_counit]
141140
simp
142141
rw [w₃, isIso_iff_bijective]
143-
simp only [comp_obj, op_tensorObj, coyoneda_obj_obj, unop_tensorObj, id_obj,
142+
simp only [comp_obj, op_tensorObj, flip_obj_obj, yoneda_obj_obj, unop_tensorObj, id_obj,
144143
yoneda_obj_obj, curriedTensor_obj_obj, EquivLike.comp_bijective, EquivLike.bijective_comp]
145144
have w₄ : (coyoneda.map (adj.unit.app d).op).app ((ihom d').obj (R.obj c)) ≫
146145
(coyoneda.obj ⟨d⟩).map (adj.unit.app ((ihom d').obj (R.obj c))) =
@@ -156,9 +155,9 @@ theorem isIso_tfae : List.TFAE
156155
-- We give the inverse of the bottom map in the stack of commutative squares:
157156
refine ⟨fun f ↦ R.map ((adj.homEquiv _ _).symm f), ?_, by ext; simp⟩
158157
ext f
159-
simp only [comp_obj, coyoneda_obj_obj, id_obj, Adjunction.homEquiv_counit,
160-
map_comp, types_comp_apply, coyoneda_map_app, Quiver.Hom.unop_op, Category.assoc,
161-
types_id_apply]
158+
simp only [comp_obj, flip_obj_obj, yoneda_obj_obj, id_obj, flip_map_app,
159+
Adjunction.homEquiv_counit, map_comp, types_comp_apply, yoneda_obj_map, Quiver.Hom.unop_op,
160+
Category.assoc]
162161
have : f = R.map (R.preimage f) := by simp
163162
rw [this]
164163
simp [← map_comp, -map_preimage]
@@ -180,8 +179,8 @@ theorem isIso_tfae : List.TFAE
180179
rw [← Function.comp_assoc, ((ihom.adjunction ((L ⋙ R).obj d)).homEquiv _ _).eq_comp_symm]
181180
ext
182181
simp only [id_obj, yoneda_obj_obj, comp_obj, Function.comp_apply,
183-
yoneda_map_app, op_tensorObj, coyoneda_obj_obj, unop_tensorObj, op_whiskerRight,
184-
coyoneda_map_app, unop_whiskerRight, Quiver.Hom.unop_op]
182+
yoneda_map_app, op_tensorObj, flip_obj_obj, yoneda_obj_obj, unop_tensorObj, op_whiskerRight,
183+
flip_map_app]
185184
rw [Adjunction.homEquiv_unit, Adjunction.homEquiv_unit]
186185
simp
187186
rw [w₂, w₁, isIso_iff_bijective, isIso_iff_bijective]

Mathlib/CategoryTheory/Sites/DenseSubsite/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ theorem sheafHom_restrict_eq (α : G.op ⋙ ℱ ⟶ G.op ⋙ ℱ'.val) :
389389
· exact (pushforwardFamily_compatible _ _)
390390
intro Y f hf
391391
conv_lhs => rw [← hf.some.fac]
392-
simp only [pushforwardFamily, Functor.comp_map, yoneda_map_app, coyoneda_obj_map, op_comp,
392+
simp only [pushforwardFamily, Functor.comp_map, yoneda_map_app, flip_obj_map, op_comp,
393393
FunctorToTypes.map_comp_apply, homOver_app]
394394
congr 1
395395
simp only [Category.assoc]

0 commit comments

Comments
 (0)