Skip to content

Commit f6d7788

Browse files
committed
chore(CategoryTheory): some API for FormalCoproducts (leanprover-community#41126)
This is used in the construction of hypercovers. Co-authored by: Robin Carlier <robin.carlier@ens-lyon.fr>
1 parent 01749d4 commit f6d7788

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

  • Mathlib/CategoryTheory/Limits/FormalCoproducts

Mathlib/CategoryTheory/Limits/FormalCoproducts/Basic.lean

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,31 @@ lemma fromIncl_comp_cofanPtIsoSelf_inv (i : X.I) :
240240
Hom.fromIncl i (𝟙 (X.obj i)) ≫ (coproductIsoSelf X).inv = Sigma.ι X.toFun i :=
241241
(Iso.comp_inv_eq _).2 (ι_comp_coproductIsoSelf_hom _ _).symm
242242

243+
/-- Given an object `X : FormalCoproduct C` and an equality of indices `i = j`, this is
244+
the induced isomorphism `Xᵢ ≅ Xⱼ`. -/
245+
def objIsoOfEq (X : FormalCoproduct.{w} C) {i j : X.I} (hij : i = j) :
246+
X.obj i ≅ X.obj j :=
247+
eqToIso (by rw [hij])
248+
249+
@[simp]
250+
lemma objIsoOfEq_rfl (X : FormalCoproduct.{w} C) (i : X.I) :
251+
X.objIsoOfEq (rfl : i = i) = Iso.refl _ :=
252+
rfl
253+
254+
@[simp]
255+
lemma objIsoOfEq_trans (X : FormalCoproduct.{w} C) {i j k : X.I}
256+
(hij : i = j) (hjk : j = k) :
257+
X.objIsoOfEq hij ≪≫ X.objIsoOfEq hjk = X.objIsoOfEq (hij.trans hjk) := by
258+
subst hij hjk
259+
simp
260+
261+
@[simp]
262+
lemma objIsoOfEq_symm (X : FormalCoproduct.{w} C) {i j : X.I}
263+
(hij : i = j) :
264+
(X.objIsoOfEq hij).symm = X.objIsoOfEq hij.symm := by
265+
subst hij
266+
simp
267+
243268
end Coproduct
244269

245270
section Terminal
@@ -375,6 +400,22 @@ instance : PreservesColimit (Discrete.functor f) ((eval.{w} C A).obj F) :=
375400
instance : PreservesColimitsOfShape (Discrete J) ((eval.{w} C A).obj F) :=
376401
preservesColimitsOfShape_of_discrete _
377402

403+
/-- The yoneda embedding of `FormalCoproduct.{v} C` into `v`-presheaves. -/
404+
protected noncomputable abbrev yoneda :
405+
FormalCoproduct.{v} C ⥤ Cᵒᵖ ⥤ Type v :=
406+
(eval _ _).obj yoneda
407+
408+
/-- The yoneda embedding of `FormalCoproduct.{w} C` into `max w v`-presheaves. -/
409+
protected noncomputable abbrev uliftYoneda :
410+
FormalCoproduct.{w} C ⥤ Cᵒᵖ ⥤ Type (max w v) :=
411+
(eval _ _).obj uliftYoneda
412+
413+
/-- The yoneda embedding of `FormalCoproduct.{w} C` into `w`-presheaves for a locally
414+
`w`-small category. -/
415+
protected noncomputable abbrev shrinkYoneda [LocallySmall.{w} C] :
416+
FormalCoproduct.{w} C ⥤ Cᵒᵖ ⥤ Type w :=
417+
(eval _ _).obj shrinkYoneda
418+
378419
end HasCoproducts
379420

380421
noncomputable section HasProducts

0 commit comments

Comments
 (0)