File: Mathlib/CategoryTheory/Yoneda.lean

full_name: CategoryTheory.yoneda_obj_obj
code: /-- The Yoneda embedding, as a functor from `C` into presheaves on `C`.

See <https://stacks.math.columbia.edu/tag/001O>.
-/
@[simps]
def yoneda : C ⥤ Cᵒᵖ ⥤ Type v₁ 
goal: (CategoryTheory.yoneda.obj X).obj Y = (Opposite.unop Y ⟶ X)

full_name: CategoryTheory.yoneda
code: /-- The Yoneda embedding, as a functor from `C` into presheaves on `C`.

See <https://stacks.math.columbia.edu/tag/001O>.
-/
@[simps]
def yoneda : C ⥤ Cᵒᵖ ⥤ Type v₁ 
goal: CategoryTheory.Functor C (CategoryTheory.Functor Cᵒᵖ (Type v₁))

full_name: CategoryTheory.yoneda_obj_map
code: /-- The Yoneda embedding, as a functor from `C` into presheaves on `C`.

See <https://stacks.math.columbia.edu/tag/001O>.
-/
@[simps]
def yoneda : C ⥤ Cᵒᵖ ⥤ Type v₁ 
goal: ∀ {X_1 Y : Cᵒᵖ} (f : X_1 ⟶ Y) (g : Opposite.unop X_1 ⟶ X),
  (CategoryTheory.yoneda.obj X).map f g = CategoryTheory.CategoryStruct.comp f.unop g

full_name: CategoryTheory.yoneda_map_app
code: /-- The Yoneda embedding, as a functor from `C` into presheaves on `C`.

See <https://stacks.math.columbia.edu/tag/001O>.
-/
@[simps]
def yoneda : C ⥤ Cᵒᵖ ⥤ Type v₁ 
goal: ∀ {X Y : C} (f : X ⟶ Y) (Y_1 : Cᵒᵖ)
  (g :
    ((fun X =>
            { obj := fun Y => Opposite.unop Y ⟶ X,
              map := fun {X_1 Y} f g => CategoryTheory.CategoryStruct.comp f.unop g, map_id := ⋯, map_comp := ⋯ })
          X).obj
      Y_1),
  (CategoryTheory.yoneda.map f).app Y_1 g = CategoryTheory.CategoryStruct.comp g f

full_name: CategoryTheory.coyoneda
code: /-- The co-Yoneda embedding, as a functor from `Cᵒᵖ` into co-presheaves on `C`.
-/
@[simps]
def coyoneda : Cᵒᵖ ⥤ C ⥤ Type v₁ 
goal: CategoryTheory.Functor Cᵒᵖ (CategoryTheory.Functor C (Type v₁))

full_name: CategoryTheory.coyoneda_map_app
code: /-- The co-Yoneda embedding, as a functor from `Cᵒᵖ` into co-presheaves on `C`.
-/
@[simps]
def coyoneda : Cᵒᵖ ⥤ C ⥤ Type v₁ 
goal: ∀ {X Y : Cᵒᵖ} (f : X ⟶ Y) (Y_1 : C)
  (g :
    ((fun X =>
            { obj := fun Y => Opposite.unop X ⟶ Y, map := fun {X_1 Y} f g => CategoryTheory.CategoryStruct.comp g f,
              map_id := ⋯, map_comp := ⋯ })
          X).obj
      Y_1),
  (CategoryTheory.coyoneda.map f).app Y_1 g = CategoryTheory.CategoryStruct.comp f.unop g

full_name: CategoryTheory.coyoneda_obj_map
code: /-- The co-Yoneda embedding, as a functor from `Cᵒᵖ` into co-presheaves on `C`.
-/
@[simps]
def coyoneda : Cᵒᵖ ⥤ C ⥤ Type v₁ 
goal: ∀ {X_1 Y : C} (f : X_1 ⟶ Y) (g : Opposite.unop X ⟶ X_1),
  (CategoryTheory.coyoneda.obj X).map f g = CategoryTheory.CategoryStruct.comp g f

full_name: CategoryTheory.coyoneda_obj_obj
code: /-- The co-Yoneda embedding, as a functor from `Cᵒᵖ` into co-presheaves on `C`.
-/
@[simps]
def coyoneda : Cᵒᵖ ⥤ C ⥤ Type v₁ 
goal: (CategoryTheory.coyoneda.obj X).obj Y = (Opposite.unop X ⟶ Y)

full_name: CategoryTheory.Yoneda.obj_map_id
code: theorem obj_map_id {X Y : C} (f : op X ⟶ op Y) :
    (yoneda.obj X).map f (𝟙 X) = (yoneda.map f.unop).app (op Y) (𝟙 Y) 
goal: (CategoryTheory.yoneda.obj X).map f (CategoryTheory.CategoryStruct.id X) =
  (CategoryTheory.yoneda.map f.unop).app (Opposite.op Y) (CategoryTheory.CategoryStruct.id Y)

full_name: CategoryTheory.Yoneda.naturality
code: @[simp]
theorem naturality {X Y : C} (α : yoneda.obj X ⟶ yoneda.obj Y) {Z Z' : C} (f : Z ⟶ Z')
    (h : Z' ⟶ X) : f ≫ α.app (op Z') h = α.app (op Z) (f ≫ h) 
goal: CategoryTheory.CategoryStruct.comp f (α.app (Opposite.op Z') h) =
  α.app (Opposite.op Z) (CategoryTheory.CategoryStruct.comp f h)

full_name: CategoryTheory.Yoneda.fullyFaithful
code: /-- The Yoneda embedding is fully faithful. -/
def fullyFaithful : (yoneda (C := C)).FullyFaithful 
goal: CategoryTheory.yoneda.FullyFaithful

full_name: CategoryTheory.Yoneda.fullyFaithful_preimage
code: lemma fullyFaithful_preimage {X Y : C} (f : yoneda.obj X ⟶ yoneda.obj Y) :
    fullyFaithful.preimage f = f.app (op X) (𝟙 X) 
goal: CategoryTheory.Yoneda.fullyFaithful.preimage f = f.app (Opposite.op X) (CategoryTheory.CategoryStruct.id X)

full_name: CategoryTheory.Yoneda.yoneda_full
code: /-- The Yoneda embedding is full.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
instance yoneda_full : (yoneda : C ⥤ Cᵒᵖ ⥤ Type v₁).Full 
goal: CategoryTheory.yoneda.Full

full_name: CategoryTheory.Yoneda.yoneda_faithful
code: /-- The Yoneda embedding is faithful.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
instance yoneda_faithful : (yoneda : C ⥤ Cᵒᵖ ⥤ Type v₁).Faithful 
goal: CategoryTheory.yoneda.Faithful

full_name: CategoryTheory.Yoneda.ext
code: /-- Extensionality via Yoneda. The typical usage would be
```
-- Goal is `X ≅ Y`
apply yoneda.ext,
-- Goals are now functions `(Z ⟶ X) → (Z ⟶ Y)`, `(Z ⟶ Y) → (Z ⟶ X)`, and the fact that these
-- functions are inverses and natural in `Z`.
```
-/
def ext (X Y : C) (p : ∀ {Z : C}, (Z ⟶ X) → (Z ⟶ Y))
    (q : ∀ {Z : C}, (Z ⟶ Y) → (Z ⟶ X))
    (h₁ : ∀ {Z : C} (f : Z ⟶ X), q (p f) = f) (h₂ : ∀ {Z : C} (f : Z ⟶ Y), p (q f) = f)
    (n : ∀ {Z Z' : C} (f : Z' ⟶ Z) (g : Z ⟶ X), p (f ≫ g) = f ≫ p g) : X ≅ Y 
goal: X ≅ Y

full_name: CategoryTheory.Yoneda.isIso
code: /-- If `yoneda.map f` is an isomorphism, so was `f`.
-/
theorem isIso {X Y : C} (f : X ⟶ Y) [IsIso (yoneda.map f)] : IsIso f 
goal: CategoryTheory.IsIso f

full_name: CategoryTheory.Coyoneda.naturality
code: @[simp]
theorem naturality {X Y : Cᵒᵖ} (α : coyoneda.obj X ⟶ coyoneda.obj Y) {Z Z' : C} (f : Z' ⟶ Z)
    (h : unop X ⟶ Z') : α.app Z' h ≫ f = α.app Z (h ≫ f) 
goal: CategoryTheory.CategoryStruct.comp (α.app Z' h) f = α.app Z (CategoryTheory.CategoryStruct.comp h f)

full_name: CategoryTheory.Coyoneda.fullyFaithful
code: /-- The co-Yoneda embedding is fully faithful. -/
def fullyFaithful : (coyoneda (C := C)).FullyFaithful 
goal: CategoryTheory.coyoneda.FullyFaithful

full_name: CategoryTheory.Coyoneda.fullyFaithful_preimage
code: lemma fullyFaithful_preimage {X Y : Cᵒᵖ} (f : coyoneda.obj X ⟶ coyoneda.obj Y) :
    fullyFaithful.preimage f = (f.app X.unop (𝟙 X.unop)).op 
goal: CategoryTheory.Coyoneda.fullyFaithful.preimage f =
  Quiver.Hom.op (f.app (Opposite.unop X) (CategoryTheory.CategoryStruct.id (Opposite.unop X)))

full_name: CategoryTheory.Coyoneda.preimage
code: /-- The morphism `X ⟶ Y` corresponding to a natural transformation
`coyoneda.obj X ⟶ coyoneda.obj Y`. -/
def preimage {X Y : Cᵒᵖ} (f : coyoneda.obj X ⟶ coyoneda.obj Y) : X ⟶ Y 
goal: X ⟶ Y

full_name: CategoryTheory.Coyoneda.coyoneda_full
code: instance coyoneda_full : (coyoneda : Cᵒᵖ ⥤ C ⥤ Type v₁).Full 
goal: CategoryTheory.coyoneda.Full

full_name: CategoryTheory.Coyoneda.coyoneda_faithful
code: instance coyoneda_faithful : (coyoneda : Cᵒᵖ ⥤ C ⥤ Type v₁).Faithful 
goal: CategoryTheory.coyoneda.Faithful

full_name: CategoryTheory.Coyoneda.isIso
code: /-- If `coyoneda.map f` is an isomorphism, so was `f`.
-/
theorem isIso {X Y : Cᵒᵖ} (f : X ⟶ Y) [IsIso (coyoneda.map f)] : IsIso f 
goal: CategoryTheory.IsIso f

full_name: CategoryTheory.Coyoneda.punitIso
code: /-- The identity functor on `Type` is isomorphic to the coyoneda functor coming from `PUnit`. -/
def punitIso : coyoneda.obj (Opposite.op PUnit) ≅ 𝟭 (Type v₁) 
goal: CategoryTheory.coyoneda.obj (Opposite.op PUnit.{v₁ + 1}) ≅ CategoryTheory.Functor.id (Type v₁)

full_name: CategoryTheory.Coyoneda.objOpOp
code: /-- Taking the `unop` of morphisms is a natural isomorphism. -/
@[simps!]
def objOpOp (X : C) : coyoneda.obj (op (op X)) ≅ yoneda.obj X 
goal: CategoryTheory.coyoneda.obj (Opposite.op (Opposite.op X)) ≅ CategoryTheory.yoneda.obj X

full_name: CategoryTheory.Coyoneda.objOpOp_inv_app
code: /-- Taking the `unop` of morphisms is a natural isomorphism. -/
@[simps!]
def objOpOp (X : C) : coyoneda.obj (op (op X)) ≅ yoneda.obj X 
goal: ∀ (X_1 : Cᵒᵖ) (a : (CategoryTheory.yoneda.obj X).obj X_1),
  (CategoryTheory.Coyoneda.objOpOp X).inv.app X_1 a = (CategoryTheory.opEquiv (Opposite.op X) X_1).symm a

full_name: CategoryTheory.Coyoneda.objOpOp_hom_app
code: /-- Taking the `unop` of morphisms is a natural isomorphism. -/
@[simps!]
def objOpOp (X : C) : coyoneda.obj (op (op X)) ≅ yoneda.obj X 
goal: ∀ (X_1 : Cᵒᵖ) (a : (CategoryTheory.coyoneda.obj (Opposite.op (Opposite.op X))).obj X_1),
  (CategoryTheory.Coyoneda.objOpOp X).hom.app X_1 a = (CategoryTheory.opEquiv (Opposite.op X) X_1) a

full_name: CategoryTheory.Functor.Representable
code: /-- A functor `F : Cᵒᵖ ⥤ Type v₁` is representable if there is object `X` so `F ≅ yoneda.obj X`.

See <https://stacks.math.columbia.edu/tag/001Q>.
-/
class Representable (F : Cᵒᵖ ⥤ Type v₁) : Prop where
  /-- `Hom(-,X) ≅ F` via `f` -/
  has_representation : ∃ (X : _), Nonempty (yoneda.obj X ≅ F)
goal: Prop

full_name: CategoryTheory.Functor.Representable.has_representation
code: /-- A functor `F : Cᵒᵖ ⥤ Type v₁` is representable if there is object `X` so `F ≅ yoneda.obj X`.

See <https://stacks.math.columbia.edu/tag/001Q>.
-/
class Representable (F : Cᵒᵖ ⥤ Type v₁) : Prop where
  /-- `Hom(-,X) ≅ F` via `f` -/
  has_representation : ∃ (X : _), Nonempty (yoneda.obj X ≅ F)
goal: ∃ X, Nonempty (CategoryTheory.yoneda.obj X ≅ F)

full_name: CategoryTheory.Functor.instRepresentableObjOppositeTypeYoneda
code: instance {X : C} : Representable (yoneda.obj X) 
goal: (CategoryTheory.yoneda.obj X).Representable

full_name: CategoryTheory.Functor.Corepresentable
code: /-- A functor `F : C ⥤ Type v₁` is corepresentable if there is object `X` so `F ≅ coyoneda.obj X`.

See <https://stacks.math.columbia.edu/tag/001Q>.
-/
class Corepresentable (F : C ⥤ Type v₁) : Prop where
  /-- `Hom(X,-) ≅ F` via `f` -/
  has_corepresentation : ∃ (X : _), Nonempty (coyoneda.obj X ≅ F)
goal: Prop

full_name: CategoryTheory.Functor.Corepresentable.has_corepresentation
code: /-- A functor `F : C ⥤ Type v₁` is corepresentable if there is object `X` so `F ≅ coyoneda.obj X`.

See <https://stacks.math.columbia.edu/tag/001Q>.
-/
class Corepresentable (F : C ⥤ Type v₁) : Prop where
  /-- `Hom(X,-) ≅ F` via `f` -/
  has_corepresentation : ∃ (X : _), Nonempty (coyoneda.obj X ≅ F)
goal: ∃ X, Nonempty (CategoryTheory.coyoneda.obj X ≅ F)

full_name: CategoryTheory.Functor.instCorepresentableObjOppositeTypeCoyoneda
code: instance {X : Cᵒᵖ} : Corepresentable (coyoneda.obj X) 
goal: (CategoryTheory.coyoneda.obj X).Corepresentable

full_name: CategoryTheory.Functor.reprX
code: /-- The representing object for the representable functor `F`. -/
noncomputable def reprX : C 
goal: C

full_name: CategoryTheory.Functor.reprW
code: /-- An isomorphism between a representable `F` and a functor of the
form `C(-, F.reprX)`.  Note the components `F.reprW.app X`
definitionally have type `(X.unop ⟶ F.repr_X) ≅ F.obj X`.
-/
noncomputable def reprW : yoneda.obj F.reprX ≅ F 
goal: CategoryTheory.yoneda.obj F.reprX ≅ F

full_name: CategoryTheory.Functor.reprx
code: /-- The representing element for the representable functor `F`, sometimes called the universal
element of the functor.
-/
noncomputable def reprx : F.obj (op F.reprX) 
goal: F.obj (Opposite.op F.reprX)

full_name: CategoryTheory.Functor.reprW_app_hom
code: theorem reprW_app_hom (X : Cᵒᵖ) (f : unop X ⟶ F.reprX) :
    (F.reprW.app X).hom f = F.map f.op F.reprx 
goal: (F.reprW.app X).hom f = F.map f.op F.reprx

full_name: CategoryTheory.Functor.coreprX
code: /-- The representing object for the corepresentable functor `F`. -/
noncomputable def coreprX : C 
goal: C

full_name: CategoryTheory.Functor.coreprW
code: /-- An isomorphism between a corepresnetable `F` and a functor of the form
`C(F.corepr X, -)`. Note the components `F.coreprW.app X`
definitionally have type `F.corepr_X ⟶ X ≅ F.obj X`.
-/
noncomputable def coreprW : coyoneda.obj (op F.coreprX) ≅ F 
goal: CategoryTheory.coyoneda.obj (Opposite.op F.coreprX) ≅ F

full_name: CategoryTheory.Functor.coreprx
code: /-- The representing element for the corepresentable functor `F`, sometimes called the universal
element of the functor.
-/
noncomputable def coreprx : F.obj F.coreprX 
goal: F.obj F.coreprX

full_name: CategoryTheory.Functor.coreprW_app_hom
code: theorem coreprW_app_hom (X : C) (f : F.coreprX ⟶ X) :
    (F.coreprW.app X).hom f = F.map f F.coreprx 
goal: (F.coreprW.app X).hom f = F.map f F.coreprx

full_name: CategoryTheory.representable_of_natIso
code: theorem representable_of_natIso (F : Cᵒᵖ ⥤ Type v₁) {G} (i : F ≅ G) [F.Representable] :
    G.Representable 
goal: G.Representable

full_name: CategoryTheory.corepresentable_of_natIso
code: theorem corepresentable_of_natIso (F : C ⥤ Type v₁) {G} (i : F ≅ G) [F.Corepresentable] :
    G.Corepresentable 
goal: G.Corepresentable

full_name: CategoryTheory.instCorepresentableIdType
code: instance : Functor.Corepresentable (𝟭 (Type v₁)) 
goal: (CategoryTheory.Functor.id (Type v₁)).Corepresentable

full_name: CategoryTheory.prodCategoryInstance1
code: instance prodCategoryInstance1 : Category ((Cᵒᵖ ⥤ Type v₁) × Cᵒᵖ) 
goal: CategoryTheory.Category.{max u₁ v₁, max u₁ (max (v₁ + 1) u₁) v₁} (CategoryTheory.Functor Cᵒᵖ (Type v₁) × Cᵒᵖ)

full_name: CategoryTheory.prodCategoryInstance2
code: instance prodCategoryInstance2 : Category (Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)) 
goal: CategoryTheory.Category.{max u₁ v₁, max (max (max (v₁ + 1) u₁) v₁) u₁} (Cᵒᵖ × CategoryTheory.Functor Cᵒᵖ (Type v₁))

full_name: CategoryTheory.yonedaEquiv
code: /-- We have a type-level equivalence between natural transformations from the yoneda embedding
and elements of `F.obj X`, without any universe switching.
-/
def yonedaEquiv {X : C} {F : Cᵒᵖ ⥤ Type v₁} : (yoneda.obj X ⟶ F) ≃ F.obj (op X) 
goal: (CategoryTheory.yoneda.obj X ⟶ F) ≃ F.obj (Opposite.op X)

full_name: CategoryTheory.yonedaEquiv_apply
code: theorem yonedaEquiv_apply {X : C} {F : Cᵒᵖ ⥤ Type v₁} (f : yoneda.obj X ⟶ F) :
    yonedaEquiv f = f.app (op X) (𝟙 X) 
goal: CategoryTheory.yonedaEquiv f = f.app (Opposite.op X) (CategoryTheory.CategoryStruct.id X)

full_name: CategoryTheory.yonedaEquiv_symm_app_apply
code: @[simp]
theorem yonedaEquiv_symm_app_apply {X : C} {F : Cᵒᵖ ⥤ Type v₁} (x : F.obj (op X)) (Y : Cᵒᵖ)
    (f : Y.unop ⟶ X) : (yonedaEquiv.symm x).app Y f = F.map f.op x 
goal: (CategoryTheory.yonedaEquiv.symm x).app Y f = F.map f.op x

full_name: CategoryTheory.yonedaEquiv_naturality
code: lemma yonedaEquiv_naturality {X Y : C} {F : Cᵒᵖ ⥤ Type v₁} (f : yoneda.obj X ⟶ F)
    (g : Y ⟶ X) : F.map g.op (yonedaEquiv f) = yonedaEquiv (yoneda.map g ≫ f) 
goal: F.map g.op (CategoryTheory.yonedaEquiv f) =
  CategoryTheory.yonedaEquiv (CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map g) f)

full_name: CategoryTheory.yonedaEquiv_naturality'
code: lemma yonedaEquiv_naturality' {X Y : Cᵒᵖ} {F : Cᵒᵖ ⥤ Type v₁} (f : yoneda.obj (unop X) ⟶ F)
    (g : X ⟶ Y) : F.map g (yonedaEquiv f) = yonedaEquiv (yoneda.map g.unop ≫ f) 
goal: F.map g (CategoryTheory.yonedaEquiv f) =
  CategoryTheory.yonedaEquiv (CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map g.unop) f)

full_name: CategoryTheory.yonedaEquiv_comp
code: lemma yonedaEquiv_comp {X : C} {F G : Cᵒᵖ ⥤ Type v₁} (α : yoneda.obj X ⟶ F) (β : F ⟶ G) :
    yonedaEquiv (α ≫ β) = β.app _ (yonedaEquiv α) 
goal: CategoryTheory.yonedaEquiv (CategoryTheory.CategoryStruct.comp α β) =
  β.app (Opposite.op X) (CategoryTheory.yonedaEquiv α)

full_name: CategoryTheory.yonedaEquiv_yoneda_map
code: lemma yonedaEquiv_yoneda_map {X Y : C} (f : X ⟶ Y) : yonedaEquiv (yoneda.map f) = f 
goal: CategoryTheory.yonedaEquiv (CategoryTheory.yoneda.map f) = f

full_name: CategoryTheory.yonedaEquiv_symm_map
code: lemma yonedaEquiv_symm_map {X Y : Cᵒᵖ} (f : X ⟶ Y) {F : Cᵒᵖ ⥤ Type v₁} (t : F.obj X) :
    yonedaEquiv.symm (F.map f t) = yoneda.map f.unop ≫ yonedaEquiv.symm t 
goal: CategoryTheory.yonedaEquiv.symm (F.map f t) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map f.unop) (CategoryTheory.yonedaEquiv.symm t)

full_name: CategoryTheory.hom_ext_yoneda
code: /-- Two morphisms of presheaves of types `P ⟶ Q` coincide if the precompositions
with morphisms `yoneda.obj X ⟶ P` agree. -/
lemma hom_ext_yoneda {P Q : Cᵒᵖ ⥤ Type v₁} {f g : P ⟶ Q}
    (h : ∀ (X : C) (p : yoneda.obj X ⟶ P), p ≫ f = p ≫ g) :
    f = g 
goal: f = g

full_name: CategoryTheory.yonedaEvaluation
code: /-- The "Yoneda evaluation" functor, which sends `X : Cᵒᵖ` and `F : Cᵒᵖ ⥤ Type`
to `F.obj X`, functorially in both `X` and `F`.
-/
def yonedaEvaluation : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁) ⥤ Type max u₁ v₁ 
goal: CategoryTheory.Functor (Cᵒᵖ × CategoryTheory.Functor Cᵒᵖ (Type v₁)) (Type (max u₁ v₁))

full_name: CategoryTheory.yonedaEvaluation_map_down
code: @[simp]
theorem yonedaEvaluation_map_down (P Q : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)) (α : P ⟶ Q)
    (x : (yonedaEvaluation C).obj P) :
    ((yonedaEvaluation C).map α x).down = α.2.app Q.1 (P.2.map α.1 x.down) 
goal: ((CategoryTheory.yonedaEvaluation C).map α x).down = α.2.app Q.1 (P.2.map α.1 x.down)

full_name: CategoryTheory.yonedaPairing
code: /-- The "Yoneda pairing" functor, which sends `X : Cᵒᵖ` and `F : Cᵒᵖ ⥤ Type`
to `yoneda.op.obj X ⟶ F`, functorially in both `X` and `F`.
-/
def yonedaPairing : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁) ⥤ Type max u₁ v₁ 
goal: CategoryTheory.Functor (Cᵒᵖ × CategoryTheory.Functor Cᵒᵖ (Type v₁)) (Type (max u₁ v₁))

full_name: CategoryTheory.yonedaPairingExt
code: @[ext]
lemma yonedaPairingExt {X : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)} {x y : (yonedaPairing C).obj X}
    (w : ∀ Y, x.app Y = y.app Y) : x = y 
goal: x = y

full_name: CategoryTheory.yonedaPairing_map
code: @[simp]
theorem yonedaPairing_map (P Q : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)) (α : P ⟶ Q) (β : (yonedaPairing C).obj P) :
    (yonedaPairing C).map α β = yoneda.map α.1.unop ≫ β ≫ α.2 
goal: (CategoryTheory.yonedaPairing C).map α β =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map α.1.unop) (CategoryTheory.CategoryStruct.comp β α.2)

full_name: CategoryTheory.yonedaCompUliftFunctorEquiv
code: /-- A bijection `(yoneda.obj X ⋙ uliftFunctor ⟶ F) ≃ F.obj (op X)` which is a variant
of `yonedaEquiv` with heterogeneous universes. -/
def yonedaCompUliftFunctorEquiv (F : Cᵒᵖ ⥤ Type max v₁ w) (X : C) :
    (yoneda.obj X ⋙ uliftFunctor ⟶ F) ≃ F.obj (op X) 
goal: ((CategoryTheory.yoneda.obj X).comp CategoryTheory.uliftFunctor.{w, v₁} ⟶ F) ≃ F.obj (Opposite.op X)

full_name: CategoryTheory.yonedaLemma
code: /-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C 
goal: CategoryTheory.yonedaPairing C ≅ CategoryTheory.yonedaEvaluation C

full_name: CategoryTheory.curriedYonedaLemma
code: /-- The curried version of yoneda lemma when `C` is small. -/
def curriedYonedaLemma {C : Type u₁} [SmallCategory C] :
    (yoneda.op ⋙ coyoneda : Cᵒᵖ ⥤ (Cᵒᵖ ⥤ Type u₁) ⥤ Type u₁) ≅ evaluation Cᵒᵖ (Type u₁) 
goal: CategoryTheory.yoneda.op.comp CategoryTheory.coyoneda ≅ CategoryTheory.evaluation Cᵒᵖ (Type u₁)

full_name: CategoryTheory.largeCurriedYonedaLemma
code: /-- The curried version of the Yoneda lemma. -/
def largeCurriedYonedaLemma {C : Type u₁} [Category.{v₁} C] :
    yoneda.op ⋙ coyoneda ≅
      evaluation Cᵒᵖ (Type v₁) ⋙ (whiskeringRight _ _ _).obj uliftFunctor.{u₁} 
goal: CategoryTheory.yoneda.op.comp CategoryTheory.coyoneda ≅
  (CategoryTheory.evaluation Cᵒᵖ (Type v₁)).comp
    ((CategoryTheory.whiskeringRight (CategoryTheory.Functor Cᵒᵖ (Type v₁)) (Type v₁) (Type (max u₁ v₁))).obj
      CategoryTheory.uliftFunctor.{u₁, v₁})

full_name: CategoryTheory.yonedaOpCompYonedaObj
code: /-- Version of the Yoneda lemma where the presheaf is fixed but the argument varies. -/
def yonedaOpCompYonedaObj {C : Type u₁} [Category.{v₁} C] (P : Cᵒᵖ ⥤ Type v₁) :
    yoneda.op ⋙ yoneda.obj P ≅ P ⋙ uliftFunctor.{u₁} 
goal: CategoryTheory.yoneda.op.comp (CategoryTheory.yoneda.obj P) ≅ P.comp CategoryTheory.uliftFunctor.{u₁, v₁}

full_name: CategoryTheory.curriedYonedaLemma'
code: /-- The curried version of yoneda lemma when `C` is small. -/
def curriedYonedaLemma' {C : Type u₁} [SmallCategory C] :
    yoneda ⋙ (whiskeringLeft Cᵒᵖ (Cᵒᵖ ⥤ Type u₁)ᵒᵖ (Type u₁)).obj yoneda.op
      ≅ 𝟭 (Cᵒᵖ ⥤ Type u₁) 
goal: CategoryTheory.yoneda.comp
    ((CategoryTheory.whiskeringLeft Cᵒᵖ (CategoryTheory.Functor Cᵒᵖ (Type u₁))ᵒᵖ (Type u₁)).obj
      CategoryTheory.yoneda.op) ≅
  CategoryTheory.Functor.id (CategoryTheory.Functor Cᵒᵖ (Type u₁))

full_name: CategoryTheory.isIso_of_yoneda_map_bijective
code: lemma isIso_of_yoneda_map_bijective {X Y : C} (f : X ⟶ Y)
    (hf : ∀ (T : C), Function.Bijective (fun (x : T ⟶ X) => x ≫ f)) :
    IsIso f 
goal: CategoryTheory.IsIso f

full_name: CategoryTheory.coyonedaEquiv
code: /-- We have a type-level equivalence between natural transformations from the coyoneda embedding
and elements of `F.obj X.unop`, without any universe switching.
-/
def coyonedaEquiv {X : C} {F : C ⥤ Type v₁} : (coyoneda.obj (op X) ⟶ F) ≃ F.obj X 
goal: (CategoryTheory.coyoneda.obj (Opposite.op X) ⟶ F) ≃ F.obj X

full_name: CategoryTheory.coyonedaEquiv_apply
code: theorem coyonedaEquiv_apply {X : C} {F : C ⥤ Type v₁} (f : coyoneda.obj (op X) ⟶ F) :
    coyonedaEquiv f = f.app X (𝟙 X) 
goal: CategoryTheory.coyonedaEquiv f = f.app X (CategoryTheory.CategoryStruct.id X)

full_name: CategoryTheory.coyonedaEquiv_symm_app_apply
code: @[simp]
theorem coyonedaEquiv_symm_app_apply {X : C} {F : C ⥤ Type v₁} (x : F.obj X) (Y : C)
    (f : X ⟶ Y) : (coyonedaEquiv.symm x).app Y f = F.map f x 
goal: (CategoryTheory.coyonedaEquiv.symm x).app Y f = F.map f x

full_name: CategoryTheory.coyonedaEquiv_naturality
code: lemma coyonedaEquiv_naturality {X Y : C} {F : C ⥤ Type v₁} (f : coyoneda.obj (op X) ⟶ F)
    (g : X ⟶ Y) : F.map g (coyonedaEquiv f) = coyonedaEquiv (coyoneda.map g.op ≫ f) 
goal: F.map g (CategoryTheory.coyonedaEquiv f) =
  CategoryTheory.coyonedaEquiv (CategoryTheory.CategoryStruct.comp (CategoryTheory.coyoneda.map g.op) f)

full_name: CategoryTheory.coyonedaEquiv_comp
code: lemma coyonedaEquiv_comp {X : C} {F G : C ⥤ Type v₁} (α : coyoneda.obj (op X) ⟶ F) (β : F ⟶ G) :
    coyonedaEquiv (α ≫ β) = β.app _ (coyonedaEquiv α) 
goal: CategoryTheory.coyonedaEquiv (CategoryTheory.CategoryStruct.comp α β) = β.app X (CategoryTheory.coyonedaEquiv α)

full_name: CategoryTheory.coyonedaEquiv_coyoneda_map
code: lemma coyonedaEquiv_coyoneda_map {X Y : C} (f : X ⟶ Y) :
    coyonedaEquiv (coyoneda.map f.op) = f 
goal: CategoryTheory.coyonedaEquiv (CategoryTheory.coyoneda.map f.op) = f

full_name: CategoryTheory.coyonedaEquiv_symm_map
code: lemma coyonedaEquiv_symm_map {X Y : C} (f : X ⟶ Y) {F : C ⥤ Type v₁} (t : F.obj X) :
    coyonedaEquiv.symm (F.map f t) = coyoneda.map f.op ≫ coyonedaEquiv.symm t 
goal: CategoryTheory.coyonedaEquiv.symm (F.map f t) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.coyoneda.map f.op) (CategoryTheory.coyonedaEquiv.symm t)

full_name: CategoryTheory.coyonedaEvaluation
code: /-- The "Coyoneda evaluation" functor, which sends `X : C` and `F : C ⥤ Type`
to `F.obj X`, functorially in both `X` and `F`.
-/
def coyonedaEvaluation : C × (C ⥤ Type v₁) ⥤ Type max u₁ v₁ 
goal: CategoryTheory.Functor (C × CategoryTheory.Functor C (Type v₁)) (Type (max u₁ v₁))

full_name: CategoryTheory.coyonedaEvaluation_map_down
code: @[simp]
theorem coyonedaEvaluation_map_down (P Q : C × (C ⥤ Type v₁)) (α : P ⟶ Q)
    (x : (coyonedaEvaluation C).obj P) :
    ((coyonedaEvaluation C).map α x).down = α.2.app Q.1 (P.2.map α.1 x.down) 
goal: ((CategoryTheory.coyonedaEvaluation C).map α x).down = α.2.app Q.1 (P.2.map α.1 x.down)

full_name: CategoryTheory.coyonedaPairing
code: /-- The "Coyoneda pairing" functor, which sends `X : C` and `F : C ⥤ Type`
to `coyoneda.rightOp.obj X ⟶ F`, functorially in both `X` and `F`.
-/
def coyonedaPairing : C × (C ⥤ Type v₁) ⥤ Type max u₁ v₁ 
goal: CategoryTheory.Functor (C × CategoryTheory.Functor C (Type v₁)) (Type (max u₁ v₁))

full_name: CategoryTheory.coyonedaPairingExt
code: @[ext]
lemma coyonedaPairingExt {X : C × (C ⥤ Type v₁)} {x y : (coyonedaPairing C).obj X}
    (w : ∀ Y, x.app Y = y.app Y) : x = y 
goal: x = y

full_name: CategoryTheory.coyonedaPairing_map
code: @[simp]
theorem coyonedaPairing_map (P Q : C × (C ⥤ Type v₁)) (α : P ⟶ Q) (β : (coyonedaPairing C).obj P) :
    (coyonedaPairing C).map α β = coyoneda.map α.1.op ≫ β ≫ α.2 
goal: (CategoryTheory.coyonedaPairing C).map α β =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.coyoneda.map α.1.op) (CategoryTheory.CategoryStruct.comp β α.2)

full_name: CategoryTheory.coyonedaCompUliftFunctorEquiv
code: /-- A bijection `(coyoneda.obj X ⋙ uliftFunctor ⟶ F) ≃ F.obj (unop X)` which is a variant
of `coyonedaEquiv` with heterogeneous universes. -/
def coyonedaCompUliftFunctorEquiv (F : C ⥤ Type max v₁ w) (X : Cᵒᵖ) :
    (coyoneda.obj X ⋙ uliftFunctor ⟶ F) ≃ F.obj X.unop 
goal: ((CategoryTheory.coyoneda.obj X).comp CategoryTheory.uliftFunctor.{w, v₁} ⟶ F) ≃ F.obj (Opposite.unop X)

full_name: CategoryTheory.coyonedaLemma
code: /-- The Coyoneda lemma asserts that the Coyoneda pairing
`(X : C, F : C ⥤ Type) ↦ (coyoneda.obj X ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def coyonedaLemma : coyonedaPairing C ≅ coyonedaEvaluation C 
goal: CategoryTheory.coyonedaPairing C ≅ CategoryTheory.coyonedaEvaluation C

full_name: CategoryTheory.curriedCoyonedaLemma
code: /-- The curried version of coyoneda lemma when `C` is small. -/
def curriedCoyonedaLemma {C : Type u₁} [SmallCategory C] :
    coyoneda.rightOp ⋙ coyoneda ≅ evaluation C (Type u₁) 
goal: CategoryTheory.coyoneda.rightOp.comp CategoryTheory.coyoneda ≅ CategoryTheory.evaluation C (Type u₁)

full_name: CategoryTheory.largeCurriedCoyonedaLemma
code: /-- The curried version of the Coyoneda lemma. -/
def largeCurriedCoyonedaLemma {C : Type u₁} [Category.{v₁} C] :
    (coyoneda.rightOp ⋙ coyoneda) ≅
      evaluation C (Type v₁) ⋙ (whiskeringRight _ _ _).obj uliftFunctor.{u₁} 
goal: CategoryTheory.coyoneda.rightOp.comp CategoryTheory.coyoneda ≅
  (CategoryTheory.evaluation C (Type v₁)).comp
    ((CategoryTheory.whiskeringRight (CategoryTheory.Functor C (Type v₁)) (Type v₁) (Type (max u₁ v₁))).obj
      CategoryTheory.uliftFunctor.{u₁, v₁})

full_name: CategoryTheory.coyonedaCompYonedaObj
code: /-- Version of the Coyoneda lemma where the presheaf is fixed but the argument varies. -/
def coyonedaCompYonedaObj {C : Type u₁} [Category.{v₁} C] (P : C ⥤ Type v₁) :
    coyoneda.rightOp ⋙ yoneda.obj P ≅ P ⋙ uliftFunctor.{u₁} 
goal: CategoryTheory.coyoneda.rightOp.comp (CategoryTheory.yoneda.obj P) ≅ P.comp CategoryTheory.uliftFunctor.{u₁, v₁}

full_name: CategoryTheory.curriedCoyonedaLemma'
code: /-- The curried version of coyoneda lemma when `C` is small. -/
def curriedCoyonedaLemma' {C : Type u₁} [SmallCategory C] :
    yoneda ⋙ (whiskeringLeft C (C ⥤ Type u₁)ᵒᵖ (Type u₁)).obj coyoneda.rightOp
      ≅ 𝟭 (C ⥤ Type u₁) 
goal: CategoryTheory.yoneda.comp
    ((CategoryTheory.whiskeringLeft C (CategoryTheory.Functor C (Type u₁))ᵒᵖ (Type u₁)).obj
      CategoryTheory.coyoneda.rightOp) ≅
  CategoryTheory.Functor.id (CategoryTheory.Functor C (Type u₁))

full_name: CategoryTheory.isIso_of_coyoneda_map_bijective
code: lemma isIso_of_coyoneda_map_bijective {X Y : C} (f : X ⟶ Y)
    (hf : ∀ (T : C), Function.Bijective (fun (x : Y ⟶ T) => f ≫ x)) :
    IsIso f 
goal: CategoryTheory.IsIso f

full_name: CategoryTheory.yonedaMap
code: /-- The natural transformation `yoneda.obj X ⟶ F.op ⋙ yoneda.obj (F.obj X)`
when `F : C ⥤ D` and `X : C`. -/
def yonedaMap (X : C) : yoneda.obj X ⟶ F.op ⋙ yoneda.obj (F.obj X) 
goal: CategoryTheory.yoneda.obj X ⟶ F.op.comp (CategoryTheory.yoneda.obj (F.obj X))

full_name: CategoryTheory.yonedaMap_app_apply
code: @[simp]
lemma yonedaMap_app_apply {Y : C} {X : Cᵒᵖ} (f : X.unop ⟶ Y) :
    (yonedaMap F Y).app X f = F.map f 
goal: (CategoryTheory.yonedaMap F Y).app X f = F.map f