File: Mathlib/CategoryTheory/Elements.lean

full_name: CategoryTheory.Functor.Elements
code: /-- The type of objects for the category of elements of a functor `F : C ⥤ Type`
is a pair `(X : C, x : F.obj X)`.
-/
def Functor.Elements (F : C ⥤ Type w) 
goal: Type (max u w)

full_name: CategoryTheory.Functor.elementsMk
code: /-- Constructor for the type `F.Elements` when `F` is a functor to types. -/
abbrev Functor.elementsMk (F : C ⥤ Type w) (X : C) (x : F.obj X) : F.Elements 
goal: F.Elements

full_name: CategoryTheory.Functor.Elements.ext
code: lemma Functor.Elements.ext {F : C ⥤ Type w} (x y : F.Elements) (h₁ : x.fst = y.fst)
    (h₂ : F.map (eqToHom h₁) x.snd = y.snd) : x = y 
goal: x = y

full_name: CategoryTheory.categoryOfElements
code: /-- The category structure on `F.Elements`, for `F : C ⥤ Type`.
    A morphism `(X, x) ⟶ (Y, y)` is a morphism `f : X ⟶ Y` in `C`, so `F.map f` takes `x` to `y`.
 -/
instance categoryOfElements (F : C ⥤ Type w) : Category.{v} F.Elements 
goal: CategoryTheory.Category.{v, max u w} F.Elements

full_name: CategoryTheory.CategoryOfElements.homMk
code: /-- Constructor for morphisms in the category of elements of a functor to types. -/
@[simps]
def homMk {F : C ⥤ Type w} (x y : F.Elements) (f : x.1 ⟶ y.1) (hf : F.map f x.snd = y.snd) :
    x ⟶ y 
goal: x ⟶ y

full_name: CategoryTheory.CategoryOfElements.homMk_coe
code: /-- Constructor for morphisms in the category of elements of a functor to types. -/
@[simps]
def homMk {F : C ⥤ Type w} (x y : F.Elements) (f : x.1 ⟶ y.1) (hf : F.map f x.snd = y.snd) :
    x ⟶ y 
goal: ↑(CategoryTheory.CategoryOfElements.homMk x y f hf) = f

full_name: CategoryTheory.CategoryOfElements.ext
code: @[ext]
theorem ext (F : C ⥤ Type w) {x y : F.Elements} (f g : x ⟶ y) (w : f.val = g.val) : f = g 
goal: f = g

full_name: CategoryTheory.CategoryOfElements.comp_val
code: @[simp]
theorem comp_val {F : C ⥤ Type w} {p q r : F.Elements} {f : p ⟶ q} {g : q ⟶ r} :
    (f ≫ g).val = f.val ≫ g.val 
goal: ↑(CategoryTheory.CategoryStruct.comp f g) = CategoryTheory.CategoryStruct.comp ↑f ↑g

full_name: CategoryTheory.CategoryOfElements.id_val
code: @[simp]
theorem id_val {F : C ⥤ Type w} {p : F.Elements} : (𝟙 p : p ⟶ p).val = 𝟙 p.1 
goal: ↑(CategoryTheory.CategoryStruct.id p) = CategoryTheory.CategoryStruct.id p.fst

full_name: CategoryTheory.CategoryOfElements.map_snd
code: @[simp]
theorem map_snd {F : C ⥤ Type w} {p q : F.Elements} (f : p ⟶ q) : (F.map f.val) p.2 = q.2 
goal: F.map (↑f) p.snd = q.snd

full_name: CategoryTheory.groupoidOfElements
code: instance groupoidOfElements {G : Type u} [Groupoid.{v} G] (F : G ⥤ Type w) :
    Groupoid F.Elements 
goal: CategoryTheory.Groupoid F.Elements

full_name: CategoryTheory.CategoryOfElements.π_obj
code: /-- The functor out of the category of elements which forgets the element. -/
@[simps]
def π : F.Elements ⥤ C 
goal: (CategoryTheory.CategoryOfElements.π F).obj X = X.fst

full_name: CategoryTheory.CategoryOfElements.π_map
code: /-- The functor out of the category of elements which forgets the element. -/
@[simps]
def π : F.Elements ⥤ C 
goal: ∀ {X Y : F.Elements} (f : X ⟶ Y), (CategoryTheory.CategoryOfElements.π F).map f = ↑f

full_name: CategoryTheory.CategoryOfElements.π
code: /-- The functor out of the category of elements which forgets the element. -/
@[simps]
def π : F.Elements ⥤ C 
goal: CategoryTheory.Functor F.Elements C

full_name: CategoryTheory.CategoryOfElements.instFaithfulElementsπ
code: instance : (π F).Faithful 
goal: (CategoryTheory.CategoryOfElements.π F).Faithful

full_name: CategoryTheory.CategoryOfElements.instReflectsIsomorphismsElementsπ
code: instance : (π F).ReflectsIsomorphisms 
goal: (CategoryTheory.CategoryOfElements.π F).ReflectsIsomorphisms

full_name: CategoryTheory.CategoryOfElements.map_obj_fst
code: /-- A natural transformation between functors induces a functor between the categories of elements.
-/
@[simps]
def map {F₁ F₂ : C ⥤ Type w} (α : F₁ ⟶ F₂) : F₁.Elements ⥤ F₂.Elements 
goal: ((CategoryTheory.CategoryOfElements.map α).obj t).fst = t.fst

full_name: CategoryTheory.CategoryOfElements.map_obj_snd
code: /-- A natural transformation between functors induces a functor between the categories of elements.
-/
@[simps]
def map {F₁ F₂ : C ⥤ Type w} (α : F₁ ⟶ F₂) : F₁.Elements ⥤ F₂.Elements 
goal: ((CategoryTheory.CategoryOfElements.map α).obj t).snd = α.app t.fst t.snd

full_name: CategoryTheory.CategoryOfElements.map_map_coe
code: /-- A natural transformation between functors induces a functor between the categories of elements.
-/
@[simps]
def map {F₁ F₂ : C ⥤ Type w} (α : F₁ ⟶ F₂) : F₁.Elements ⥤ F₂.Elements 
goal: ↑((CategoryTheory.CategoryOfElements.map α).map k) = ↑k

full_name: CategoryTheory.CategoryOfElements.map
code: /-- A natural transformation between functors induces a functor between the categories of elements.
-/
@[simps]
def map {F₁ F₂ : C ⥤ Type w} (α : F₁ ⟶ F₂) : F₁.Elements ⥤ F₂.Elements 
goal: CategoryTheory.Functor F₁.Elements F₂.Elements

full_name: CategoryTheory.CategoryOfElements.map_π
code: @[simp]
theorem map_π {F₁ F₂ : C ⥤ Type w} (α : F₁ ⟶ F₂) : map α ⋙ π F₂ = π F₁ 
goal: (CategoryTheory.CategoryOfElements.map α).comp (CategoryTheory.CategoryOfElements.π F₂) =
  CategoryTheory.CategoryOfElements.π F₁

full_name: CategoryTheory.CategoryOfElements.toStructuredArrow
code: /-- The forward direction of the equivalence `F.Elements ≅ (*, F)`. -/
def toStructuredArrow : F.Elements ⥤ StructuredArrow PUnit F 
goal: CategoryTheory.Functor F.Elements (CategoryTheory.StructuredArrow PUnit.{w + 1} F)

full_name: CategoryTheory.CategoryOfElements.toStructuredArrow_obj
code: @[simp]
theorem toStructuredArrow_obj (X) :
    (toStructuredArrow F).obj X =
      { left := ⟨⟨⟩⟩
        right := X.1
        hom := fun _ => X.2 } 
goal: (CategoryTheory.CategoryOfElements.toStructuredArrow F).obj X =
  { left := { as := PUnit.unit }, right := X.fst, hom := fun x => X.snd }

full_name: CategoryTheory.CategoryOfElements.to_comma_map_right
code: @[simp]
theorem to_comma_map_right {X Y} (f : X ⟶ Y) : ((toStructuredArrow F).map f).right = f.val 
goal: ((CategoryTheory.CategoryOfElements.toStructuredArrow F).map f).right = ↑f

full_name: CategoryTheory.CategoryOfElements.fromStructuredArrow
code: /-- The reverse direction of the equivalence `F.Elements ≅ (*, F)`. -/
def fromStructuredArrow : StructuredArrow PUnit F ⥤ F.Elements 
goal: CategoryTheory.Functor (CategoryTheory.StructuredArrow PUnit.{w + 1} F) F.Elements

full_name: CategoryTheory.CategoryOfElements.fromStructuredArrow_obj
code: @[simp]
theorem fromStructuredArrow_obj (X) : (fromStructuredArrow F).obj X = ⟨X.right, X.hom PUnit.unit⟩ 
goal: (CategoryTheory.CategoryOfElements.fromStructuredArrow F).obj X = ⟨X.right, X.hom PUnit.unit⟩

full_name: CategoryTheory.CategoryOfElements.fromStructuredArrow_map
code: @[simp]
theorem fromStructuredArrow_map {X Y} (f : X ⟶ Y) :
    (fromStructuredArrow F).map f = ⟨f.right, congr_fun f.w.symm PUnit.unit⟩ 
goal: (CategoryTheory.CategoryOfElements.fromStructuredArrow F).map f = ⟨f.right, ⋯⟩

full_name: CategoryTheory.CategoryOfElements.structuredArrowEquivalence
code: /-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F 
goal: F.Elements ≌ CategoryTheory.StructuredArrow PUnit.{w + 1} F

full_name: CategoryTheory.CategoryOfElements.structuredArrowEquivalence_functor_obj
code: /-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F 
goal: (CategoryTheory.CategoryOfElements.structuredArrowEquivalence F).functor.obj X =
  CategoryTheory.StructuredArrow.mk fun x => X.snd

full_name: CategoryTheory.CategoryOfElements.structuredArrowEquivalence_counitIso_inv
code: /-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F 
goal: (CategoryTheory.CategoryOfElements.structuredArrowEquivalence F).counitIso.inv =
  { app := fun X => (CategoryTheory.StructuredArrow.isoMk (CategoryTheory.Iso.refl X.right) ⋯).inv, naturality := ⋯ }

full_name: CategoryTheory.CategoryOfElements.structuredArrowEquivalence_unitIso_hom
code: /-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F 
goal: (CategoryTheory.CategoryOfElements.structuredArrowEquivalence F).unitIso.hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.NatIso.ofComponents (fun X => CategoryTheory.Iso.refl X) ⋯).hom
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toStructuredArrow F)
        (CategoryTheory.CategoryOfElements.fromStructuredArrow F).leftUnitor.inv)
      (CategoryTheory.CategoryStruct.comp
        (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toStructuredArrow F)
          (CategoryTheory.whiskerRight
            (CategoryTheory.NatIso.ofComponents
                (fun X => CategoryTheory.StructuredArrow.isoMk (CategoryTheory.Iso.refl X.right) ⋯) ⋯).inv
            (CategoryTheory.CategoryOfElements.fromStructuredArrow F)))
        (CategoryTheory.CategoryStruct.comp
          (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toStructuredArrow F)
            ((CategoryTheory.CategoryOfElements.fromStructuredArrow F).associator
                (CategoryTheory.CategoryOfElements.toStructuredArrow F)
                (CategoryTheory.CategoryOfElements.fromStructuredArrow F)).hom)
          (CategoryTheory.CategoryStruct.comp
            ((CategoryTheory.CategoryOfElements.toStructuredArrow F).associator
                (CategoryTheory.CategoryOfElements.fromStructuredArrow F)
                ((CategoryTheory.CategoryOfElements.toStructuredArrow F).comp
                  (CategoryTheory.CategoryOfElements.fromStructuredArrow F))).inv
            (CategoryTheory.CategoryStruct.comp
              (CategoryTheory.whiskerRight
                (CategoryTheory.NatIso.ofComponents (fun X => CategoryTheory.Iso.refl X) ⋯).inv
                ((CategoryTheory.CategoryOfElements.toStructuredArrow F).comp
                  (CategoryTheory.CategoryOfElements.fromStructuredArrow F)))
              ((CategoryTheory.CategoryOfElements.toStructuredArrow F).comp
                    (CategoryTheory.CategoryOfElements.fromStructuredArrow F)).leftUnitor.hom)))))

full_name: CategoryTheory.CategoryOfElements.structuredArrowEquivalence_functor_map
code: /-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F 
goal: (CategoryTheory.CategoryOfElements.structuredArrowEquivalence F).functor.map f =
  CategoryTheory.StructuredArrow.homMk ↑f ⋯

full_name: CategoryTheory.CategoryOfElements.structuredArrowEquivalence_unitIso_inv
code: /-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F 
goal: (CategoryTheory.CategoryOfElements.structuredArrowEquivalence F).unitIso.inv =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.CategoryOfElements.toStructuredArrow F).comp
          (CategoryTheory.CategoryOfElements.fromStructuredArrow F)).leftUnitor.inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.whiskerRight (CategoryTheory.NatIso.ofComponents (fun X => CategoryTheory.Iso.refl X) ⋯).hom
        ((CategoryTheory.CategoryOfElements.toStructuredArrow F).comp
          (CategoryTheory.CategoryOfElements.fromStructuredArrow F)))
      (CategoryTheory.CategoryStruct.comp
        ((CategoryTheory.CategoryOfElements.toStructuredArrow F).associator
            (CategoryTheory.CategoryOfElements.fromStructuredArrow F)
            ((CategoryTheory.CategoryOfElements.toStructuredArrow F).comp
              (CategoryTheory.CategoryOfElements.fromStructuredArrow F))).hom
        (CategoryTheory.CategoryStruct.comp
          (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toStructuredArrow F)
            ((CategoryTheory.CategoryOfElements.fromStructuredArrow F).associator
                (CategoryTheory.CategoryOfElements.toStructuredArrow F)
                (CategoryTheory.CategoryOfElements.fromStructuredArrow F)).inv)
          (CategoryTheory.CategoryStruct.comp
            (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toStructuredArrow F)
              (CategoryTheory.whiskerRight
                (CategoryTheory.NatIso.ofComponents
                    (fun X => CategoryTheory.StructuredArrow.isoMk (CategoryTheory.Iso.refl X.right) ⋯) ⋯).hom
                (CategoryTheory.CategoryOfElements.fromStructuredArrow F)))
            (CategoryTheory.CategoryStruct.comp
              (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toStructuredArrow F)
                (CategoryTheory.CategoryOfElements.fromStructuredArrow F).leftUnitor.hom)
              (CategoryTheory.NatIso.ofComponents (fun X => CategoryTheory.Iso.refl X) ⋯).inv)))))

full_name: CategoryTheory.CategoryOfElements.structuredArrowEquivalence_inverse_obj
code: /-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F 
goal: (CategoryTheory.CategoryOfElements.structuredArrowEquivalence F).inverse.obj X = ⟨X.right, X.hom PUnit.unit⟩

full_name: CategoryTheory.CategoryOfElements.structuredArrowEquivalence_counitIso_hom
code: /-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F 
goal: (CategoryTheory.CategoryOfElements.structuredArrowEquivalence F).counitIso.hom =
  { app := fun X => (CategoryTheory.StructuredArrow.isoMk (CategoryTheory.Iso.refl X.right) ⋯).hom, naturality := ⋯ }

full_name: CategoryTheory.CategoryOfElements.structuredArrowEquivalence_inverse_map
code: /-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F 
goal: ∀ {X Y : CategoryTheory.StructuredArrow PUnit.{w + 1} F} (f : X ⟶ Y),
  (CategoryTheory.CategoryOfElements.structuredArrowEquivalence F).inverse.map f = ⟨f.right, ⋯⟩

full_name: CategoryTheory.CategoryOfElements.toCostructuredArrow
code: /-- The forward direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def toCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : F.Elementsᵒᵖ ⥤ CostructuredArrow yoneda F 
goal: CategoryTheory.Functor F.Elementsᵒᵖ (CategoryTheory.CostructuredArrow CategoryTheory.yoneda F)

full_name: CategoryTheory.CategoryOfElements.toCostructuredArrow_map
code: /-- The forward direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def toCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : F.Elementsᵒᵖ ⥤ CostructuredArrow yoneda F 
goal: ∀ {X Y : F.Elementsᵒᵖ} (f : X ⟶ Y),
  (CategoryTheory.CategoryOfElements.toCostructuredArrow F).map f =
    CategoryTheory.CostructuredArrow.homMk (↑f.unop).unop ⋯

full_name: CategoryTheory.CategoryOfElements.toCostructuredArrow_obj
code: /-- The forward direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def toCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : F.Elementsᵒᵖ ⥤ CostructuredArrow yoneda F 
goal: (CategoryTheory.CategoryOfElements.toCostructuredArrow F).obj X =
  CategoryTheory.CostructuredArrow.mk (CategoryTheory.yonedaEquiv.symm (Opposite.unop X).snd)

full_name: CategoryTheory.CategoryOfElements.fromCostructuredArrow
code: /-- The reverse direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def fromCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : (CostructuredArrow yoneda F)ᵒᵖ ⥤ F.Elements 
goal: CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda F)ᵒᵖ F.Elements

full_name: CategoryTheory.CategoryOfElements.fromCostructuredArrow_obj_fst
code: /-- The reverse direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def fromCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : (CostructuredArrow yoneda F)ᵒᵖ ⥤ F.Elements 
goal: ((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).obj X).fst = Opposite.op (Opposite.unop X).left

full_name: CategoryTheory.CategoryOfElements.fromCostructuredArrow_obj_snd
code: /-- The reverse direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def fromCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : (CostructuredArrow yoneda F)ᵒᵖ ⥤ F.Elements 
goal: ((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).obj X).snd =
  CategoryTheory.yonedaEquiv.toFun (Opposite.unop X).hom

full_name: CategoryTheory.CategoryOfElements.fromCostructuredArrow_map_coe
code: /-- The reverse direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def fromCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : (CostructuredArrow yoneda F)ᵒᵖ ⥤ F.Elements 
goal: ↑((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).map f) = f.unop.left.op

full_name: CategoryTheory.CategoryOfElements.fromCostructuredArrow_obj_mk
code: @[simp]
theorem fromCostructuredArrow_obj_mk (F : Cᵒᵖ ⥤ Type v) {X : C} (f : yoneda.obj X ⟶ F) :
    (fromCostructuredArrow F).obj (op (CostructuredArrow.mk f)) = ⟨op X, yonedaEquiv.1 f⟩ 
goal: (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).obj (Opposite.op (CategoryTheory.CostructuredArrow.mk f)) =
  ⟨Opposite.op X, CategoryTheory.yonedaEquiv.toFun f⟩

full_name: CategoryTheory.CategoryOfElements.from_toCostructuredArrow_eq
code: /-- The unit of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` is indeed iso. -/
theorem from_toCostructuredArrow_eq (F : Cᵒᵖ ⥤ Type v) :
    (toCostructuredArrow F).rightOp ⋙ fromCostructuredArrow F = 𝟭 _ 
goal: (CategoryTheory.CategoryOfElements.toCostructuredArrow F).rightOp.comp
    (CategoryTheory.CategoryOfElements.fromCostructuredArrow F) =
  CategoryTheory.Functor.id F.Elements

full_name: CategoryTheory.CategoryOfElements.to_fromCostructuredArrow_eq
code: /-- The counit of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` is indeed iso. -/
theorem to_fromCostructuredArrow_eq (F : Cᵒᵖ ⥤ Type v) :
    (fromCostructuredArrow F).rightOp ⋙ toCostructuredArrow F = 𝟭 _ 
goal: (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp.comp
    (CategoryTheory.CategoryOfElements.toCostructuredArrow F) =
  CategoryTheory.Functor.id (CategoryTheory.CostructuredArrow CategoryTheory.yoneda F)

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence_counitIso_inv
code: /-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).counitIso.inv = CategoryTheory.eqToHom ⋯

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence_inverse_map
code: /-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F 
goal: ∀ {X Y : CategoryTheory.CostructuredArrow CategoryTheory.yoneda F} (f : X ⟶ Y),
  (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).inverse.map f =
    ((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).map f.op).op

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence
code: /-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F 
goal: F.Elementsᵒᵖ ≌ CategoryTheory.CostructuredArrow CategoryTheory.yoneda F

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence_inverse_obj
code: /-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).inverse.obj X =
  Opposite.op ((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).obj (Opposite.op X))

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence_counitIso_hom
code: /-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).counitIso.hom = CategoryTheory.eqToHom ⋯

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence_functor_map
code: /-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F 
goal: ∀ {X Y : F.Elementsᵒᵖ} (f : X ⟶ Y),
  (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).functor.map f =
    CategoryTheory.CostructuredArrow.homMk (↑f.unop).unop ⋯

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence_functor_obj
code: /-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).functor.obj X =
  CategoryTheory.CostructuredArrow.mk (CategoryTheory.yonedaEquiv.symm (Opposite.unop X).snd)

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence_unitIso_inv
code: /-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).unitIso.inv =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.CategoryOfElements.toCostructuredArrow F).comp
          (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp).leftUnitor.inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.whiskerRight (CategoryTheory.NatTrans.op (CategoryTheory.eqToHom ⋯))
        ((CategoryTheory.CategoryOfElements.toCostructuredArrow F).comp
          (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp))
      (CategoryTheory.CategoryStruct.comp
        ((CategoryTheory.CategoryOfElements.toCostructuredArrow F).associator
            (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp
            ((CategoryTheory.CategoryOfElements.toCostructuredArrow F).comp
              (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp)).hom
        (CategoryTheory.CategoryStruct.comp
          (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toCostructuredArrow F)
            ((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp.associator
                (CategoryTheory.CategoryOfElements.toCostructuredArrow F)
                (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp).inv)
          (CategoryTheory.CategoryStruct.comp
            (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toCostructuredArrow F)
              (CategoryTheory.whiskerRight (CategoryTheory.eqToHom ⋯)
                (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp))
            (CategoryTheory.CategoryStruct.comp
              (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toCostructuredArrow F)
                (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp.leftUnitor.hom)
              (CategoryTheory.NatTrans.op (CategoryTheory.eqToHom ⋯)))))))

full_name: CategoryTheory.CategoryOfElements.costructuredArrow_yoneda_equivalence_naturality
code: /-- The equivalence `(-.Elements)ᵒᵖ ≅ (yoneda, -)` of is actually a natural isomorphism of functors.
-/
theorem costructuredArrow_yoneda_equivalence_naturality {F₁ F₂ : Cᵒᵖ ⥤ Type v} (α : F₁ ⟶ F₂) :
    (map α).op ⋙ toCostructuredArrow F₂ = toCostructuredArrow F₁ ⋙ CostructuredArrow.map α 
goal: (CategoryTheory.CategoryOfElements.map α).op.comp (CategoryTheory.CategoryOfElements.toCostructuredArrow F₂) =
  (CategoryTheory.CategoryOfElements.toCostructuredArrow F₁).comp (CategoryTheory.CostructuredArrow.map α)

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceFunctorProj
code: /-- The equivalence `F.elementsᵒᵖ ≌ (yoneda, F)` is compatible with the forgetful functors. -/
@[simps!]
def costructuredArrowYonedaEquivalenceFunctorProj (F : Cᵒᵖ ⥤ Type v) :
    (costructuredArrowYonedaEquivalence F).functor ⋙ CostructuredArrow.proj _ _ ≅ (π F).leftOp 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).functor.comp
    (CategoryTheory.CostructuredArrow.proj CategoryTheory.yoneda F) ≅
  (CategoryTheory.CategoryOfElements.π F).leftOp

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceFunctorProj_hom_app
code: /-- The equivalence `F.elementsᵒᵖ ≌ (yoneda, F)` is compatible with the forgetful functors. -/
@[simps!]
def costructuredArrowYonedaEquivalenceFunctorProj (F : Cᵒᵖ ⥤ Type v) :
    (costructuredArrowYonedaEquivalence F).functor ⋙ CostructuredArrow.proj _ _ ≅ (π F).leftOp 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceFunctorProj F).hom.app X =
  CategoryTheory.CategoryStruct.id (Opposite.unop (Opposite.unop X).1)

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceFunctorProj_inv_app
code: /-- The equivalence `F.elementsᵒᵖ ≌ (yoneda, F)` is compatible with the forgetful functors. -/
@[simps!]
def costructuredArrowYonedaEquivalenceFunctorProj (F : Cᵒᵖ ⥤ Type v) :
    (costructuredArrowYonedaEquivalence F).functor ⋙ CostructuredArrow.proj _ _ ≅ (π F).leftOp 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceFunctorProj F).inv.app X =
  CategoryTheory.CategoryStruct.id (Opposite.unop (Opposite.unop X).1)

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceInverseπ
code: /-- The equivalence `F.elementsᵒᵖ ≌ (yoneda, F)` is compatible with the forgetful functors. -/
@[simps!]
def costructuredArrowYonedaEquivalenceInverseπ (F : Cᵒᵖ ⥤ Type v) :
    (costructuredArrowYonedaEquivalence F).inverse ⋙ (π F).leftOp ≅ CostructuredArrow.proj _ _ 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).inverse.comp
    (CategoryTheory.CategoryOfElements.π F).leftOp ≅
  CategoryTheory.CostructuredArrow.proj CategoryTheory.yoneda F

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceInverseπ_inv_app
code: /-- The equivalence `F.elementsᵒᵖ ≌ (yoneda, F)` is compatible with the forgetful functors. -/
@[simps!]
def costructuredArrowYonedaEquivalenceInverseπ (F : Cᵒᵖ ⥤ Type v) :
    (costructuredArrowYonedaEquivalence F).inverse ⋙ (π F).leftOp ≅ CostructuredArrow.proj _ _ 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceInverseπ F).inv.app X =
  CategoryTheory.CategoryStruct.id X.left

full_name: CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceInverseπ_hom_app
code: /-- The equivalence `F.elementsᵒᵖ ≌ (yoneda, F)` is compatible with the forgetful functors. -/
@[simps!]
def costructuredArrowYonedaEquivalenceInverseπ (F : Cᵒᵖ ⥤ Type v) :
    (costructuredArrowYonedaEquivalence F).inverse ⋙ (π F).leftOp ≅ CostructuredArrow.proj _ _ 
goal: (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceInverseπ F).hom.app X =
  CategoryTheory.CategoryStruct.id X.left

full_name: CategoryTheory.Functor.Elements.initial
code: /--
The initial object in the category of elements for a representable functor. In `isInitial` it is
shown that this is initial.
-/
def Elements.initial (A : C) : (yoneda.obj A).Elements 
goal: (CategoryTheory.yoneda.obj A).Elements

full_name: CategoryTheory.Functor.Elements.isInitial
code: /-- Show that `Elements.initial A` is initial in the category of elements for the `yoneda` functor.
-/
def Elements.isInitial (A : C) : Limits.IsInitial (Elements.initial A) 
goal: CategoryTheory.Limits.IsInitial (CategoryTheory.Functor.Elements.initial A)