File: Mathlib/CategoryTheory/Comma/Presheaf.lean

full_name: CategoryTheory.OverPresheafAux.MakesOverArrow.app
code: /-- Via the Yoneda lemma, `u : F.obj (op X)` defines a natural transformation `yoneda.obj X ⟶ F`
    and via the element `η.app (op X) u` also a morphism `yoneda.obj X ⟶ A`. This structure
    witnesses the fact that these morphisms from a commutative triangle with `η : F ⟶ A`, i.e.,
    that `yoneda.obj X ⟶ F` lifts to a morphism in `Over A`. -/
structure MakesOverArrow {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) {X : C} (s : yoneda.obj X ⟶ A)
    (u : F.obj (op X)) : Prop where
  app : η.app (op X) u = yonedaEquiv s
goal: η.app (Opposite.op X) u = CategoryTheory.yonedaEquiv s

full_name: CategoryTheory.OverPresheafAux.MakesOverArrow
code: /-- Via the Yoneda lemma, `u : F.obj (op X)` defines a natural transformation `yoneda.obj X ⟶ F`
    and via the element `η.app (op X) u` also a morphism `yoneda.obj X ⟶ A`. This structure
    witnesses the fact that these morphisms from a commutative triangle with `η : F ⟶ A`, i.e.,
    that `yoneda.obj X ⟶ F` lifts to a morphism in `Over A`. -/
structure MakesOverArrow {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) {X : C} (s : yoneda.obj X ⟶ A)
    (u : F.obj (op X)) : Prop where
  app : η.app (op X) u = yonedaEquiv s
goal: Prop

full_name: CategoryTheory.OverPresheafAux.MakesOverArrow.map₁
code: /-- "Functoriality" of `MakesOverArrow η s` in `η`. -/
lemma map₁ {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} {ε : F ⟶ G}
    (hε : ε ≫ μ = η) {X : C} {s : yoneda.obj X ⟶ A} {u : F.obj (op X)}
    (h : MakesOverArrow η s u) : MakesOverArrow μ s (ε.app _ u) 
goal: CategoryTheory.OverPresheafAux.MakesOverArrow μ s (ε.app (Opposite.op X) u)

full_name: CategoryTheory.OverPresheafAux.MakesOverArrow.map₂
code: /-- "Functoriality of `MakesOverArrow η s` in `s`. -/
lemma map₂ {F : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {X Y : C} (f : X ⟶ Y)
    {s : yoneda.obj X ⟶ A} {t : yoneda.obj Y ⟶ A} (hst : yoneda.map f ≫ t = s)
    {u : F.obj (op Y)} (h : MakesOverArrow η t u) : MakesOverArrow η s (F.map f.op u) 
goal: CategoryTheory.OverPresheafAux.MakesOverArrow η s (F.map f.op u)

full_name: CategoryTheory.OverPresheafAux.MakesOverArrow.of_arrow
code: lemma of_arrow {F : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {X : C} {s : yoneda.obj X ⟶ A}
    {f : yoneda.obj X ⟶ F} (hf : f ≫ η = s) : MakesOverArrow η s (yonedaEquiv f) 
goal: CategoryTheory.OverPresheafAux.MakesOverArrow η s (CategoryTheory.yonedaEquiv f)

full_name: CategoryTheory.OverPresheafAux.MakesOverArrow.of_yoneda_arrow
code: lemma of_yoneda_arrow {Y : C} {η : yoneda.obj Y ⟶ A} {X : C} {s : yoneda.obj X ⟶ A} {f : X ⟶ Y}
    (hf : yoneda.map f ≫ η = s) : MakesOverArrow η s f 
goal: CategoryTheory.OverPresheafAux.MakesOverArrow η s f

full_name: CategoryTheory.OverPresheafAux.OverArrows
code: /-- This is equivalent to the type `Over.mk s ⟶ Over.mk η`, but that lives in the wrong universe.
    However, if `F = yoneda.obj Y` for some `Y`, then (using that the Yoneda embedding is fully
    faithful) we get a good statement, see `OverArrow.costructuredArrowIso`. -/
def OverArrows {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) {X : C} (s : yoneda.obj X ⟶ A) : Type v 
goal: Type v

full_name: CategoryTheory.OverPresheafAux.OverArrows.val
code: /-- Since `OverArrows η s` can be thought of to contain certain morphisms `yoneda.obj X ⟶ F`, the
    Yoneda lemma yields elements `F.obj (op X)`. -/
def val {F : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {X : C} {s : yoneda.obj X ⟶ A} :
    OverArrows η s → F.obj (op X) 
goal: CategoryTheory.OverPresheafAux.OverArrows η s → F.obj (Opposite.op X)

full_name: CategoryTheory.OverPresheafAux.OverArrows.val_mk
code: @[simp]
lemma val_mk {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) {X : C} (s : yoneda.obj X ⟶ A) (u : F.obj (op X))
    (h : MakesOverArrow η s u) : val ⟨u, h⟩ = u 
goal: CategoryTheory.OverPresheafAux.OverArrows.val ⟨u, h⟩ = u

full_name: CategoryTheory.OverPresheafAux.OverArrows.ext
code: @[ext]
lemma ext {F : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {X : C} {s : yoneda.obj X ⟶ A}
    {u v : OverArrows η s} : u.val = v.val → u = v 
goal: u.val = v.val → u = v

full_name: CategoryTheory.OverPresheafAux.OverArrows.app_val
code: /-- The defining property of `OverArrows.val`. -/
lemma app_val {F : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {X : C} {s : yoneda.obj X ⟶ A}
    (p : OverArrows η s) : η.app (op X) p.val = yonedaEquiv s 
goal: η.app (Opposite.op X) p.val = CategoryTheory.yonedaEquiv s

full_name: CategoryTheory.OverPresheafAux.OverArrows.map_val
code: /-- In the special case `F = yoneda.obj Y`, the element `p.val` for `p : OverArrows η s` is itself
    a morphism `X ⟶ Y`. -/
@[simp]
lemma map_val {Y : C} {η : yoneda.obj Y ⟶ A} {X : C} {s : yoneda.obj X ⟶ A}
    (p : OverArrows η s) : yoneda.map p.val ≫ η = s 
goal: CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map p.val) η = s

full_name: CategoryTheory.OverPresheafAux.OverArrows.map₁
code: /-- Functoriality of `OverArrows η s` in `η`. -/
def map₁ {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} {X : C} {s : yoneda.obj X ⟶ A}
    (u : OverArrows η s) (ε : F ⟶ G) (hε : ε ≫ μ = η) : OverArrows μ s 
goal: CategoryTheory.OverPresheafAux.OverArrows μ s

full_name: CategoryTheory.OverPresheafAux.OverArrows.map₁_val
code: @[simp]
lemma map₁_val {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} {X : C}
    (s : yoneda.obj X ⟶ A) (u : OverArrows η s) (ε : F ⟶ G) (hε : ε ≫ μ = η) :
    (u.map₁ ε hε).val = ε.app _ u.val 
goal: (u.map₁ ε hε).val = ε.app (Opposite.op X) u.val

full_name: CategoryTheory.OverPresheafAux.OverArrows.map₂
code: /-- Functoriality of `OverArrows η s` in `s`. -/
def map₂ {F : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {X Y : C} {s : yoneda.obj X ⟶ A}
    {t : yoneda.obj Y ⟶ A} (u : OverArrows η t) (f : X ⟶ Y) (hst : yoneda.map f ≫ t = s) :
    OverArrows η s 
goal: CategoryTheory.OverPresheafAux.OverArrows η s

full_name: CategoryTheory.OverPresheafAux.OverArrows.map₂_val
code: @[simp]
lemma map₂_val {F : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {X Y : C} (f : X ⟶ Y)
    {s : yoneda.obj X ⟶ A} {t : yoneda.obj Y ⟶ A} (hst : yoneda.map f ≫ t = s)
    (u : OverArrows η t) : (u.map₂ f hst).val = F.map f.op u.val 
goal: (u.map₂ f hst).val = F.map f.op u.val

full_name: CategoryTheory.OverPresheafAux.OverArrows.map₁_map₂
code: @[simp]
lemma map₁_map₂ {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} (ε : F ⟶ G)
    (hε : ε ≫ μ = η) {X Y : C} {s : yoneda.obj X ⟶ A} {t : yoneda.obj Y ⟶ A} (f : X ⟶ Y)
    (hf : yoneda.map f ≫ t = s) (u : OverArrows η t) :
    (u.map₁ ε hε).map₂ f hf = (u.map₂ f hf).map₁ ε hε 
goal: (u.map₁ ε hε).map₂ f hf = (u.map₂ f hf).map₁ ε hε

full_name: CategoryTheory.OverPresheafAux.OverArrows.yonedaArrow
code: /-- Construct an element of `OverArrows η s` with `F = yoneda.obj Y` from a suitable morphism
    `f : X ⟶ Y`. -/
def yonedaArrow {Y : C} {η : yoneda.obj Y ⟶ A} {X : C} {s : yoneda.obj X ⟶ A} (f : X ⟶ Y)
    (hf : yoneda.map f ≫ η = s) : OverArrows η s 
goal: CategoryTheory.OverPresheafAux.OverArrows η s

full_name: CategoryTheory.OverPresheafAux.OverArrows.yonedaArrow_val
code: @[simp]
lemma yonedaArrow_val {Y : C} {η : yoneda.obj Y ⟶ A} {X : C} {s : yoneda.obj X ⟶ A} {f : X ⟶ Y}
    (hf : yoneda.map f ≫ η = s) : (yonedaArrow f hf).val = f 
goal: (CategoryTheory.OverPresheafAux.OverArrows.yonedaArrow f hf).val = f

full_name: CategoryTheory.OverPresheafAux.OverArrows.costructuredArrowIso
code: /-- If `η` is also `yoneda`-costructured, then `OverArrows η s` is just morphisms of costructured
    arrows. -/
def costructuredArrowIso (s t : CostructuredArrow yoneda A) : OverArrows s.hom t.hom ≅ t ⟶ s 
goal: CategoryTheory.OverPresheafAux.OverArrows s.hom t.hom ≅ t ⟶ s

full_name: CategoryTheory.OverPresheafAux.restrictedYonedaObj_obj
code: /-- This is basically just `yoneda.obj η : (Over A)ᵒᵖ ⥤ Type (max u v)` restricted along the
    forgetful functor `CostructuredArrow yoneda A ⥤ Over A`, but done in a way that we land in a
    smaller universe. -/
@[simps]
def restrictedYonedaObj {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v 
goal: (CategoryTheory.OverPresheafAux.restrictedYonedaObj η).obj s =
  CategoryTheory.OverPresheafAux.OverArrows η (Opposite.unop s).hom

full_name: CategoryTheory.OverPresheafAux.restrictedYonedaObj
code: /-- This is basically just `yoneda.obj η : (Over A)ᵒᵖ ⥤ Type (max u v)` restricted along the
    forgetful functor `CostructuredArrow yoneda A ⥤ Over A`, but done in a way that we land in a
    smaller universe. -/
@[simps]
def restrictedYonedaObj {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v 
goal: CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)

full_name: CategoryTheory.OverPresheafAux.restrictedYonedaObj_map
code: /-- This is basically just `yoneda.obj η : (Over A)ᵒᵖ ⥤ Type (max u v)` restricted along the
    forgetful functor `CostructuredArrow yoneda A ⥤ Over A`, but done in a way that we land in a
    smaller universe. -/
@[simps]
def restrictedYonedaObj {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v 
goal: ∀ {X Y : (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ} (f : X ⟶ Y)
  (u : CategoryTheory.OverPresheafAux.OverArrows η (Opposite.unop X).hom),
  (CategoryTheory.OverPresheafAux.restrictedYonedaObj η).map f u = u.map₂ f.unop.left ⋯

full_name: CategoryTheory.OverPresheafAux.restrictedYonedaObjMap₁
code: /-- Functoriality of `restrictedYonedaObj η` in `η`. -/
@[simps]
def restrictedYonedaObjMap₁ {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} (ε : F ⟶ G)
    (hε : ε ≫ μ = η) : restrictedYonedaObj η ⟶ restrictedYonedaObj μ 
goal: CategoryTheory.OverPresheafAux.restrictedYonedaObj η ⟶ CategoryTheory.OverPresheafAux.restrictedYonedaObj μ

full_name: CategoryTheory.OverPresheafAux.restrictedYonedaObjMap₁_app
code: /-- Functoriality of `restrictedYonedaObj η` in `η`. -/
@[simps]
def restrictedYonedaObjMap₁ {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} (ε : F ⟶ G)
    (hε : ε ≫ μ = η) : restrictedYonedaObj η ⟶ restrictedYonedaObj μ 
goal: (CategoryTheory.OverPresheafAux.restrictedYonedaObjMap₁ ε hε).app s u =
  CategoryTheory.OverPresheafAux.OverArrows.map₁ u ε hε

full_name: CategoryTheory.OverPresheafAux.restrictedYoneda_obj
code: /-- This is basically just `yoneda : Over A ⥤ (Over A)ᵒᵖ ⥤ Type (max u v)` restricted in the second
    argument along the forgetful functor `CostructuredArrow yoneda A ⥤ Over A`, but done in a way
    that we land in a smaller universe.

    This is one direction of the equivalence we're constructing. -/
@[simps]
def restrictedYoneda (A : Cᵒᵖ ⥤ Type v) : Over A ⥤ (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v 
goal: (CategoryTheory.OverPresheafAux.restrictedYoneda A).obj η = CategoryTheory.OverPresheafAux.restrictedYonedaObj η.hom

full_name: CategoryTheory.OverPresheafAux.restrictedYoneda
code: /-- This is basically just `yoneda : Over A ⥤ (Over A)ᵒᵖ ⥤ Type (max u v)` restricted in the second
    argument along the forgetful functor `CostructuredArrow yoneda A ⥤ Over A`, but done in a way
    that we land in a smaller universe.

    This is one direction of the equivalence we're constructing. -/
@[simps]
def restrictedYoneda (A : Cᵒᵖ ⥤ Type v) : Over A ⥤ (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v 
goal: CategoryTheory.Functor (CategoryTheory.Over A)
  (CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v))

full_name: CategoryTheory.OverPresheafAux.restrictedYoneda_map
code: /-- This is basically just `yoneda : Over A ⥤ (Over A)ᵒᵖ ⥤ Type (max u v)` restricted in the second
    argument along the forgetful functor `CostructuredArrow yoneda A ⥤ Over A`, but done in a way
    that we land in a smaller universe.

    This is one direction of the equivalence we're constructing. -/
@[simps]
def restrictedYoneda (A : Cᵒᵖ ⥤ Type v) : Over A ⥤ (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v 
goal: ∀ {X Y : CategoryTheory.Over A} (ε : X ⟶ Y),
  (CategoryTheory.OverPresheafAux.restrictedYoneda A).map ε =
    CategoryTheory.OverPresheafAux.restrictedYonedaObjMap₁ ε.left ⋯

full_name: CategoryTheory.OverPresheafAux.toOverYonedaCompRestrictedYoneda
code: /-- Further restricting the functor
    `restrictedYoneda : Over A ⥤ (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v` along the forgetful
    functor in the first argument recovers the Yoneda embedding
    `CostructuredArrow yoneda A ⥤ (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v`. This basically follows
    from the fact that the Yoneda embedding on `C` is fully faithful. -/
def toOverYonedaCompRestrictedYoneda (A : Cᵒᵖ ⥤ Type v) :
    CostructuredArrow.toOver yoneda A ⋙ restrictedYoneda A ≅ yoneda 
goal: (CategoryTheory.CostructuredArrow.toOver CategoryTheory.yoneda A).comp
    (CategoryTheory.OverPresheafAux.restrictedYoneda A) ≅
  CategoryTheory.yoneda

full_name: CategoryTheory.OverPresheafAux.map_mkPrecomp_eqToHom
code: /-- This lemma will be key to establishing good simp normal forms. -/
lemma map_mkPrecomp_eqToHom {F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} {X Y : C} {f : X ⟶ Y}
    {g g' : yoneda.obj Y ⟶ A} (h : g = g') {x : F.obj (op (CostructuredArrow.mk g'))} :
    F.map (CostructuredArrow.mkPrecomp g f).op (F.map (eqToHom (by rw [h])) x) =
      F.map (eqToHom (by rw [h])) (F.map (CostructuredArrow.mkPrecomp g' f).op x) 
goal: F.map (CategoryTheory.CostructuredArrow.mkPrecomp g f).op (F.map (CategoryTheory.eqToHom ⋯) x) =
  F.map (CategoryTheory.eqToHom ⋯) (F.map (CategoryTheory.CostructuredArrow.mkPrecomp g' f).op x)

full_name: CategoryTheory.OverPresheafAux.YonedaCollection
code: /-- To give an object of `Over A`, we will in particular need a presheaf `Cᵒᵖ ⥤ Type v`. This is the
    definition of that presheaf on objects.

    We would prefer to think of this sigma type to be indexed by natural transformations
    `yoneda.obj X ⟶ A` instead of `A.obj (op X)`. These are equivalent by the Yoneda lemma, but
    we cannot use the former because that type lives in the wrong universe. Hence, we will provide
    a lot of API that will enable us to pretend that we are really indexing over
    `yoneda.obj X ⟶ A`. -/
def YonedaCollection (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) (X : C) : Type v 
goal: Type v

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.mk
code: /-- Given a costructured arrow `s : yoneda.obj X ⟶ A` and an element `x : F.obj s`, construct
    an element of `YonedaCollection F X`. -/
def mk (s : yoneda.obj X ⟶ A) (x : F.obj (op (CostructuredArrow.mk s))) : YonedaCollection F X 
goal: CategoryTheory.OverPresheafAux.YonedaCollection F X

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.fst
code: /-- Access the first component of an element of `YonedaCollection F X`. -/
def fst (p : YonedaCollection F X) : yoneda.obj X ⟶ A 
goal: CategoryTheory.yoneda.obj X ⟶ A

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.snd
code: /-- Access the second component of an element of `YonedaCollection F X`. -/
def snd (p : YonedaCollection F X) : F.obj (op (CostructuredArrow.mk p.fst)) 
goal: F.obj (Opposite.op (CategoryTheory.CostructuredArrow.mk p.fst))

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.yonedaEquivFst
code: /-- This is a definition because it will be helpful to be able to control precisely when this
    definition is unfolded. -/
def yonedaEquivFst (p : YonedaCollection F X) : A.obj (op X) 
goal: A.obj (Opposite.op X)

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.yonedaEquivFst_eq
code: lemma yonedaEquivFst_eq (p : YonedaCollection F X) : p.yonedaEquivFst = yonedaEquiv p.fst 
goal: p.yonedaEquivFst = CategoryTheory.yonedaEquiv p.fst

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.mk_fst
code: @[simp]
lemma mk_fst (s : yoneda.obj X ⟶ A) (x : F.obj (op (CostructuredArrow.mk s))) : (mk s x).fst = s 
goal: (CategoryTheory.OverPresheafAux.YonedaCollection.mk s x).fst = s

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.mk_snd
code: @[simp]
lemma mk_snd (s : yoneda.obj X ⟶ A) (x : F.obj (op (CostructuredArrow.mk s))) :
    (mk s x).snd = F.map (eqToHom <| by rw [YonedaCollection.mk_fst]) x 
goal: (CategoryTheory.OverPresheafAux.YonedaCollection.mk s x).snd = F.map (CategoryTheory.eqToHom ⋯) x

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.ext
code: @[ext]
lemma ext {p q : YonedaCollection F X} (h : p.fst = q.fst)
    (h' : F.map (eqToHom <| by rw [h]) q.snd = p.snd) : p = q 
goal: p = q

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₁
code: /-- Functoriality of `YonedaCollection F X` in `F`. -/
def map₁ {G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G) :
    YonedaCollection F X → YonedaCollection G X 
goal: CategoryTheory.OverPresheafAux.YonedaCollection F X → CategoryTheory.OverPresheafAux.YonedaCollection G X

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₁_fst
code: @[simp]
lemma map₁_fst {G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G)
    (p : YonedaCollection F X) : (YonedaCollection.map₁ η p).fst = p.fst 
goal: (CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η p).fst = p.fst

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₁_yonedaEquivFst
code: @[simp]
lemma map₁_yonedaEquivFst {G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G)
    (p : YonedaCollection F X) :
    (YonedaCollection.map₁ η p).yonedaEquivFst = p.yonedaEquivFst 
goal: (CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η p).yonedaEquivFst = p.yonedaEquivFst

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₁_snd
code: @[simp]
lemma map₁_snd {G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G)
    (p : YonedaCollection F X) : (YonedaCollection.map₁ η p).snd =
      G.map (eqToHom (by rw [YonedaCollection.map₁_fst])) (η.app _ p.snd) 
goal: (CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η p).snd =
  G.map (CategoryTheory.eqToHom ⋯) (η.app (Opposite.op (CategoryTheory.CostructuredArrow.mk p.fst)) p.snd)

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₂
code: /-- Functoriality of `YonedaCollection F X` in `X`. -/
def map₂ (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) {Y : C} (f : X ⟶ Y)
    (p : YonedaCollection F Y) : YonedaCollection F X 
goal: CategoryTheory.OverPresheafAux.YonedaCollection F X

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₂_fst
code: @[simp]
lemma map₂_fst {Y : C} (f : X ⟶ Y) (p : YonedaCollection F Y) :
    (YonedaCollection.map₂ F f p).fst = yoneda.map f ≫ p.fst 
goal: (CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F f p).fst =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map f) p.fst

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₂_yonedaEquivFst
code: @[simp]
lemma map₂_yonedaEquivFst {Y : C} (f : X ⟶ Y) (p : YonedaCollection F Y) :
    (YonedaCollection.map₂ F f p).yonedaEquivFst = A.map f.op p.yonedaEquivFst 
goal: (CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F f p).yonedaEquivFst = A.map f.op p.yonedaEquivFst

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₂_snd
code: @[simp]
lemma map₂_snd {Y : C} (f : X ⟶ Y) (p : YonedaCollection F Y) :
    (YonedaCollection.map₂ F f p).snd = F.map ((CostructuredArrow.mkPrecomp p.fst f).op ≫
      eqToHom (by rw [YonedaCollection.map₂_fst f])) p.snd 
goal: (CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F f p).snd =
  F.map
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.CostructuredArrow.mkPrecomp p.fst f).op
      (CategoryTheory.eqToHom ⋯))
    p.snd

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₁_id
code: @[simp]
lemma map₁_id : YonedaCollection.map₁ (𝟙 F) (X := X) = id 
goal: CategoryTheory.OverPresheafAux.YonedaCollection.map₁ (CategoryTheory.CategoryStruct.id F) = id

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₁_comp
code: @[simp]
lemma map₁_comp {G H : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G) (μ : G ⟶ H) :
    YonedaCollection.map₁ (η ≫ μ) (X := X) =
      YonedaCollection.map₁ μ (X := X) ∘ YonedaCollection.map₁ η (X := X) 
goal: CategoryTheory.OverPresheafAux.YonedaCollection.map₁ (CategoryTheory.CategoryStruct.comp η μ) =
  CategoryTheory.OverPresheafAux.YonedaCollection.map₁ μ ∘ CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₂_id
code: @[simp]
lemma map₂_id : YonedaCollection.map₂ F (𝟙 X) = id 
goal: CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F (CategoryTheory.CategoryStruct.id X) = id

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₂_comp
code: @[simp]
lemma map₂_comp {Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) :
    YonedaCollection.map₂ F (f ≫ g) = YonedaCollection.map₂ F f ∘ YonedaCollection.map₂ F g 
goal: CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F f ∘ CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F g

full_name: CategoryTheory.OverPresheafAux.YonedaCollection.map₁_map₂
code: @[simp]
lemma map₁_map₂ {G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G) {Y : C} (f : X ⟶ Y)
    (p : YonedaCollection F Y) :
    YonedaCollection.map₂ G f (YonedaCollection.map₁ η p) =
      YonedaCollection.map₁ η (YonedaCollection.map₂ F f p) 
goal: CategoryTheory.OverPresheafAux.YonedaCollection.map₂ G f (CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η p) =
  CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η (CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F f p)

full_name: CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf
code: /-- Given `F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v`, this is the presheaf that is given by
    `YonedaCollection F X` on objects. -/
@[simps]
def yonedaCollectionPresheaf (A : Cᵒᵖ ⥤ Type v) (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) :
    Cᵒᵖ ⥤ Type v 
goal: CategoryTheory.Functor Cᵒᵖ (Type v)

full_name: CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf_obj
code: /-- Given `F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v`, this is the presheaf that is given by
    `YonedaCollection F X` on objects. -/
@[simps]
def yonedaCollectionPresheaf (A : Cᵒᵖ ⥤ Type v) (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) :
    Cᵒᵖ ⥤ Type v 
goal: (CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf A F).obj X =
  CategoryTheory.OverPresheafAux.YonedaCollection F (Opposite.unop X)

full_name: CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf_map
code: /-- Given `F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v`, this is the presheaf that is given by
    `YonedaCollection F X` on objects. -/
@[simps]
def yonedaCollectionPresheaf (A : Cᵒᵖ ⥤ Type v) (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) :
    Cᵒᵖ ⥤ Type v 
goal: ∀ {X Y : Cᵒᵖ} (f : X ⟶ Y) (p : CategoryTheory.OverPresheafAux.YonedaCollection F (Opposite.unop X)),
  (CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf A F).map f p =
    CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F f.unop p

full_name: CategoryTheory.OverPresheafAux.yonedaCollectionPresheafMap₁_app
code: /-- Functoriality of `yonedaCollectionPresheaf A F` in `F`. -/
@[simps]
def yonedaCollectionPresheafMap₁ {F G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G) :
    yonedaCollectionPresheaf A F ⟶ yonedaCollectionPresheaf A G 
goal: ∀ (a : CategoryTheory.OverPresheafAux.YonedaCollection F (Opposite.unop X)),
  (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafMap₁ η).app X a =
    CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η a

full_name: CategoryTheory.OverPresheafAux.yonedaCollectionPresheafMap₁
code: /-- Functoriality of `yonedaCollectionPresheaf A F` in `F`. -/
@[simps]
def yonedaCollectionPresheafMap₁ {F G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G) :
    yonedaCollectionPresheaf A F ⟶ yonedaCollectionPresheaf A G 
goal: CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf A F ⟶
  CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf A G

full_name: CategoryTheory.OverPresheafAux.yonedaCollectionFunctor
code: /-- This is the functor `F ↦ X ↦ YonedaCollection F X`. -/
@[simps]
def yonedaCollectionFunctor (A : Cᵒᵖ ⥤ Type v) :
    ((CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) ⥤ Cᵒᵖ ⥤ Type v 
goal: CategoryTheory.Functor (CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v))
  (CategoryTheory.Functor Cᵒᵖ (Type v))

full_name: CategoryTheory.OverPresheafAux.yonedaCollectionFunctor_obj
code: /-- This is the functor `F ↦ X ↦ YonedaCollection F X`. -/
@[simps]
def yonedaCollectionFunctor (A : Cᵒᵖ ⥤ Type v) :
    ((CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) ⥤ Cᵒᵖ ⥤ Type v 
goal: (CategoryTheory.OverPresheafAux.yonedaCollectionFunctor A).obj F =
  CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf A F

full_name: CategoryTheory.OverPresheafAux.yonedaCollectionFunctor_map
code: /-- This is the functor `F ↦ X ↦ YonedaCollection F X`. -/
@[simps]
def yonedaCollectionFunctor (A : Cᵒᵖ ⥤ Type v) :
    ((CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) ⥤ Cᵒᵖ ⥤ Type v 
goal: ∀ {X Y : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)} (η : X ⟶ Y),
  (CategoryTheory.OverPresheafAux.yonedaCollectionFunctor A).map η =
    CategoryTheory.OverPresheafAux.yonedaCollectionPresheafMap₁ η

full_name: CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA
code: /-- The Yoneda lemma yields a natural transformation `yonedaCollectionPresheaf A F ⟶ A`. -/
@[simps]
def yonedaCollectionPresheafToA (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) :
    yonedaCollectionPresheaf A F ⟶ A 
goal: CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf A F ⟶ A

full_name: CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA_app
code: /-- The Yoneda lemma yields a natural transformation `yonedaCollectionPresheaf A F ⟶ A`. -/
@[simps]
def yonedaCollectionPresheafToA (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) :
    yonedaCollectionPresheaf A F ⟶ A 
goal: (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA F).app X p = p.yonedaEquivFst

full_name: CategoryTheory.OverPresheafAux.costructuredArrowPresheafToOver_map
code: /-- This is the reverse direction of the equivalence we're constructing. -/
@[simps! obj map]
def costructuredArrowPresheafToOver (A : Cᵒᵖ ⥤ Type v) :
    ((CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) ⥤ Over A 
goal: ∀ {X Y : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)} (g : X ⟶ Y),
  (CategoryTheory.OverPresheafAux.costructuredArrowPresheafToOver A).map g =
    CategoryTheory.CostructuredArrow.homMk (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafMap₁ g) ⋯

full_name: CategoryTheory.OverPresheafAux.costructuredArrowPresheafToOver
code: /-- This is the reverse direction of the equivalence we're constructing. -/
@[simps! obj map]
def costructuredArrowPresheafToOver (A : Cᵒᵖ ⥤ Type v) :
    ((CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) ⥤ Over A 
goal: CategoryTheory.Functor (CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v))
  (CategoryTheory.Over A)

full_name: CategoryTheory.OverPresheafAux.costructuredArrowPresheafToOver_obj
code: /-- This is the reverse direction of the equivalence we're constructing. -/
@[simps! obj map]
def costructuredArrowPresheafToOver (A : Cᵒᵖ ⥤ Type v) :
    ((CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) ⥤ Over A 
goal: (CategoryTheory.OverPresheafAux.costructuredArrowPresheafToOver A).obj Y =
  CategoryTheory.CostructuredArrow.mk (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA Y)

full_name: CategoryTheory.OverPresheafAux.unitForward
code: /-- Forward direction of the unit. -/
def unitForward {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    YonedaCollection (restrictedYonedaObj η) X → F.obj (op X) 
goal: CategoryTheory.OverPresheafAux.YonedaCollection (CategoryTheory.OverPresheafAux.restrictedYonedaObj η) X →
  F.obj (Opposite.op X)

full_name: CategoryTheory.OverPresheafAux.unitForward_naturality₁
code: @[simp]
lemma unitForward_naturality₁ {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} (ε : F ⟶ G)
    (hε : ε ≫ μ = η) (X : C) (p : YonedaCollection (restrictedYonedaObj η) X) :
    unitForward μ X (p.map₁ (restrictedYonedaObjMap₁ ε hε)) = ε.app _ (unitForward η X p) 
goal: CategoryTheory.OverPresheafAux.unitForward μ X
    (CategoryTheory.OverPresheafAux.YonedaCollection.map₁ (CategoryTheory.OverPresheafAux.restrictedYonedaObjMap₁ ε hε)
      p) =
  ε.app (Opposite.op X) (CategoryTheory.OverPresheafAux.unitForward η X p)

full_name: CategoryTheory.OverPresheafAux.unitForward_naturality₂
code: @[simp]
lemma unitForward_naturality₂ {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X Y : C) (f : X ⟶ Y)
    (p : YonedaCollection (restrictedYonedaObj η) Y) :
    unitForward η X (YonedaCollection.map₂ (restrictedYonedaObj η) f p) =
      F.map f.op (unitForward η Y p) 
goal: CategoryTheory.OverPresheafAux.unitForward η X
    (CategoryTheory.OverPresheafAux.YonedaCollection.map₂ (CategoryTheory.OverPresheafAux.restrictedYonedaObj η) f p) =
  F.map f.op (CategoryTheory.OverPresheafAux.unitForward η Y p)

full_name: CategoryTheory.OverPresheafAux.app_unitForward
code: @[simp]
lemma app_unitForward {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : Cᵒᵖ)
    (p : YonedaCollection (restrictedYonedaObj η) X.unop) :
    η.app X (unitForward η X.unop p) = p.yonedaEquivFst 
goal: η.app X (CategoryTheory.OverPresheafAux.unitForward η (Opposite.unop X) p) = p.yonedaEquivFst

full_name: CategoryTheory.OverPresheafAux.unitBackward
code: /-- Backward direction of the unit. -/
def unitBackward {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    F.obj (op X) → YonedaCollection (restrictedYonedaObj η) X 
goal: F.obj (Opposite.op X) →
  CategoryTheory.OverPresheafAux.YonedaCollection (CategoryTheory.OverPresheafAux.restrictedYonedaObj η) X

full_name: CategoryTheory.OverPresheafAux.unitForward_unitBackward
code: lemma unitForward_unitBackward {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    unitForward η X ∘ unitBackward η X = id 
goal: CategoryTheory.OverPresheafAux.unitForward η X ∘ CategoryTheory.OverPresheafAux.unitBackward η X = id

full_name: CategoryTheory.OverPresheafAux.unitBackward_unitForward
code: lemma unitBackward_unitForward {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    unitBackward η X ∘ unitForward η X = id 
goal: CategoryTheory.OverPresheafAux.unitBackward η X ∘ CategoryTheory.OverPresheafAux.unitForward η X = id

full_name: CategoryTheory.OverPresheafAux.unitAuxAuxAux_inv
code: /-- Intermediate stage of assembling the unit. -/
@[simps]
def unitAuxAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    YonedaCollection (restrictedYonedaObj η) X ≅ F.obj (op X) 
goal: ∀ (a : F.obj (Opposite.op X)),
  (CategoryTheory.OverPresheafAux.unitAuxAuxAux η X).inv a = CategoryTheory.OverPresheafAux.unitBackward η X a

full_name: CategoryTheory.OverPresheafAux.unitAuxAuxAux_hom
code: /-- Intermediate stage of assembling the unit. -/
@[simps]
def unitAuxAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    YonedaCollection (restrictedYonedaObj η) X ≅ F.obj (op X) 
goal: ∀ (a : CategoryTheory.OverPresheafAux.YonedaCollection (CategoryTheory.OverPresheafAux.restrictedYonedaObj η) X),
  (CategoryTheory.OverPresheafAux.unitAuxAuxAux η X).hom a = CategoryTheory.OverPresheafAux.unitForward η X a

full_name: CategoryTheory.OverPresheafAux.unitAuxAuxAux
code: /-- Intermediate stage of assembling the unit. -/
@[simps]
def unitAuxAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    YonedaCollection (restrictedYonedaObj η) X ≅ F.obj (op X) 
goal: CategoryTheory.OverPresheafAux.YonedaCollection (CategoryTheory.OverPresheafAux.restrictedYonedaObj η) X ≅
  F.obj (Opposite.op X)

full_name: CategoryTheory.OverPresheafAux.unitAuxAux
code: /-- Intermediate stage of assembling the unit. -/
@[simps!]
def unitAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    yonedaCollectionPresheaf A (restrictedYonedaObj η) ≅ F 
goal: CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf A (CategoryTheory.OverPresheafAux.restrictedYonedaObj η) ≅ F

full_name: CategoryTheory.OverPresheafAux.unitAuxAux_inv_app_fst
code: /-- Intermediate stage of assembling the unit. -/
@[simps!]
def unitAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    yonedaCollectionPresheaf A (restrictedYonedaObj η) ≅ F 
goal: ∀ (a : F.obj X), ((CategoryTheory.OverPresheafAux.unitAuxAux η).inv.app X a).fst = η.app X a

full_name: CategoryTheory.OverPresheafAux.unitAuxAux_inv_app_snd_coe
code: /-- Intermediate stage of assembling the unit. -/
@[simps!]
def unitAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    yonedaCollectionPresheaf A (restrictedYonedaObj η) ≅ F 
goal: ∀ (a : F.obj X),
  ↑((CategoryTheory.OverPresheafAux.unitAuxAux η).inv.app X a).snd =
    CategoryTheory.OverPresheafAux.OverArrows.val ⟨a, ⋯⟩

full_name: CategoryTheory.OverPresheafAux.unitAuxAux_hom_app
code: /-- Intermediate stage of assembling the unit. -/
@[simps!]
def unitAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    yonedaCollectionPresheaf A (restrictedYonedaObj η) ≅ F 
goal: ∀
  (a :
    (CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf A
          (CategoryTheory.OverPresheafAux.restrictedYonedaObj η)).obj
      X),
  (CategoryTheory.OverPresheafAux.unitAuxAux η).hom.app X a =
    CategoryTheory.OverPresheafAux.unitForward η (Opposite.unop X) a

full_name: CategoryTheory.OverPresheafAux.unitAux_hom
code: /-- Intermediate stage of assembling the unit. -/
@[simps! hom]
def unitAux (η : Over A) : (restrictedYoneda A ⋙ costructuredArrowPresheafToOver A).obj η ≅ η 
goal: (CategoryTheory.OverPresheafAux.unitAux η).hom =
  { left := (CategoryTheory.OverPresheafAux.unitAuxAux η.hom).hom,
    right := CategoryTheory.CategoryStruct.id { as := PUnit.unit }, w := ⋯ }

full_name: CategoryTheory.OverPresheafAux.unitAux
code: /-- Intermediate stage of assembling the unit. -/
@[simps! hom]
def unitAux (η : Over A) : (restrictedYoneda A ⋙ costructuredArrowPresheafToOver A).obj η ≅ η 
goal: ((CategoryTheory.OverPresheafAux.restrictedYoneda A).comp
        (CategoryTheory.OverPresheafAux.costructuredArrowPresheafToOver A)).obj
    η ≅
  η

full_name: CategoryTheory.OverPresheafAux.unit
code: /-- The unit of the equivalence we're constructing. -/
def unit (A : Cᵒᵖ ⥤ Type v) : 𝟭 (Over A) ≅ restrictedYoneda A ⋙ costructuredArrowPresheafToOver A 
goal: CategoryTheory.Functor.id (CategoryTheory.Over A) ≅
  (CategoryTheory.OverPresheafAux.restrictedYoneda A).comp
    (CategoryTheory.OverPresheafAux.costructuredArrowPresheafToOver A)

full_name: CategoryTheory.OverPresheafAux.OverArrows.yonedaCollectionPresheafToA_val_fst
code: @[simp]
lemma OverArrows.yonedaCollectionPresheafToA_val_fst (s : yoneda.obj X ⟶ A)
    (p : OverArrows (yonedaCollectionPresheafToA F) s) : p.val.fst = s 
goal: CategoryTheory.OverPresheafAux.YonedaCollection.fst p.val = s

full_name: CategoryTheory.OverPresheafAux.counitForward
code: /-- Forward direction of the counit. -/
def counitForward (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) (s : CostructuredArrow yoneda A) :
    F.obj (op s) → OverArrows (yonedaCollectionPresheafToA F) s.hom 
goal: F.obj (Opposite.op s) →
  CategoryTheory.OverPresheafAux.OverArrows (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA F) s.hom

full_name: CategoryTheory.OverPresheafAux.counitForward_val_fst
code: lemma counitForward_val_fst (s : CostructuredArrow yoneda A) (x : F.obj (op s)) :
    (counitForward F s x).val.fst = s.hom 
goal: CategoryTheory.OverPresheafAux.YonedaCollection.fst (CategoryTheory.OverPresheafAux.counitForward F s x).val = s.hom

full_name: CategoryTheory.OverPresheafAux.counitForward_val_snd
code: @[simp]
lemma counitForward_val_snd (s : CostructuredArrow yoneda A) (x : F.obj (op s)) :
    (counitForward F s x).val.snd = F.map (eqToHom (by simp [← CostructuredArrow.eq_mk])) x 
goal: CategoryTheory.OverPresheafAux.YonedaCollection.snd (CategoryTheory.OverPresheafAux.counitForward F s x).val =
  F.map (CategoryTheory.eqToHom ⋯) x

full_name: CategoryTheory.OverPresheafAux.counitForward_naturality₁
code: @[simp]
lemma counitForward_naturality₁ {G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G)
    (s : (CostructuredArrow yoneda A)ᵒᵖ) (x : F.obj s) : counitForward G s.unop (η.app s x) =
      OverArrows.map₁ (counitForward F s.unop x) (yonedaCollectionPresheafMap₁ η) (by aesop_cat) 
goal: CategoryTheory.OverPresheafAux.counitForward G (Opposite.unop s) (η.app s x) =
  (CategoryTheory.OverPresheafAux.counitForward F (Opposite.unop s) x).map₁
    (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafMap₁ η) ⋯

full_name: CategoryTheory.OverPresheafAux.counitForward_naturality₂
code: @[simp]
lemma counitForward_naturality₂ (s t : (CostructuredArrow yoneda A)ᵒᵖ) (f : t ⟶ s) (x : F.obj t) :
    counitForward F s.unop (F.map f x) =
      OverArrows.map₂ (counitForward F t.unop x) f.unop.left (by simp) 
goal: CategoryTheory.OverPresheafAux.counitForward F (Opposite.unop s) (F.map f x) =
  (CategoryTheory.OverPresheafAux.counitForward F (Opposite.unop t) x).map₂ f.unop.left ⋯

full_name: CategoryTheory.OverPresheafAux.counitBackward
code: /-- Backward direction of the counit. -/
def counitBackward (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) (s : CostructuredArrow yoneda A) :
    OverArrows (yonedaCollectionPresheafToA F) s.hom → F.obj (op s) 
goal: CategoryTheory.OverPresheafAux.OverArrows (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA F) s.hom →
  F.obj (Opposite.op s)

full_name: CategoryTheory.OverPresheafAux.counitForward_counitBackward
code: lemma counitForward_counitBackward (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v)
    (s : CostructuredArrow yoneda A) : counitForward F s ∘ counitBackward F s = id 
goal: CategoryTheory.OverPresheafAux.counitForward F s ∘ CategoryTheory.OverPresheafAux.counitBackward F s = id

full_name: CategoryTheory.OverPresheafAux.counitBackward_counitForward
code: lemma counitBackward_counitForward (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v)
    (s : CostructuredArrow yoneda A) : counitBackward F s ∘ counitForward F s = id 
goal: CategoryTheory.OverPresheafAux.counitBackward F s ∘ CategoryTheory.OverPresheafAux.counitForward F s = id

full_name: CategoryTheory.OverPresheafAux.counitAuxAux_hom
code: /-- Intermediate stage of assembling the counit. -/
@[simps]
def counitAuxAux (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) (s : CostructuredArrow yoneda A) :
    F.obj (op s) ≅ OverArrows (yonedaCollectionPresheafToA F) s.hom 
goal: ∀ (a : F.obj (Opposite.op s)),
  (CategoryTheory.OverPresheafAux.counitAuxAux F s).hom a = CategoryTheory.OverPresheafAux.counitForward F s a

full_name: CategoryTheory.OverPresheafAux.counitAuxAux_inv
code: /-- Intermediate stage of assembling the counit. -/
@[simps]
def counitAuxAux (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) (s : CostructuredArrow yoneda A) :
    F.obj (op s) ≅ OverArrows (yonedaCollectionPresheafToA F) s.hom 
goal: ∀ (a : CategoryTheory.OverPresheafAux.OverArrows (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA F) s.hom),
  (CategoryTheory.OverPresheafAux.counitAuxAux F s).inv a = CategoryTheory.OverPresheafAux.counitBackward F s a

full_name: CategoryTheory.OverPresheafAux.counitAuxAux
code: /-- Intermediate stage of assembling the counit. -/
@[simps]
def counitAuxAux (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) (s : CostructuredArrow yoneda A) :
    F.obj (op s) ≅ OverArrows (yonedaCollectionPresheafToA F) s.hom 
goal: F.obj (Opposite.op s) ≅
  CategoryTheory.OverPresheafAux.OverArrows (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA F) s.hom

full_name: CategoryTheory.OverPresheafAux.counitAux_hom
code: /-- Intermediate stage of assembling the counit. -/
@[simps! hom]
def counitAux (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) :
    F ≅ restrictedYonedaObj (yonedaCollectionPresheafToA F) 
goal: (CategoryTheory.OverPresheafAux.counitAux F).hom =
  { app := fun X => (CategoryTheory.OverPresheafAux.counitAuxAux F (Opposite.unop X)).hom, naturality := ⋯ }

full_name: CategoryTheory.OverPresheafAux.counitAux
code: /-- Intermediate stage of assembling the counit. -/
@[simps! hom]
def counitAux (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) :
    F ≅ restrictedYonedaObj (yonedaCollectionPresheafToA F) 
goal: F ≅ CategoryTheory.OverPresheafAux.restrictedYonedaObj (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA F)

full_name: CategoryTheory.OverPresheafAux.counit
code: /-- The counit of the equivalence we're constructing. -/
def counit (A : Cᵒᵖ ⥤ Type v) : (costructuredArrowPresheafToOver A ⋙ restrictedYoneda A) ≅ 𝟭 _ 
goal: (CategoryTheory.OverPresheafAux.costructuredArrowPresheafToOver A).comp
    (CategoryTheory.OverPresheafAux.restrictedYoneda A) ≅
  CategoryTheory.Functor.id
    (CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v))

full_name: CategoryTheory.overEquivPresheafCostructuredArrow
code: /-- If `A : Cᵒᵖ ⥤ Type v` is a presheaf, then we have an equivalence between presheaves lying over
    `A` and the category of presheaves on `CostructuredArrow yoneda A`. There is a quasicommutative
    triangle involving this equivalence, see
    `CostructuredArrow.toOverCompOverEquivPresheafCostructuredArrow`.

    This is Lemma 1.4.12 in [Kashiwara2006]. -/
def overEquivPresheafCostructuredArrow (A : Cᵒᵖ ⥤ Type v) :
    Over A ≌ ((CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) 
goal: CategoryTheory.Over A ≌ CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)

full_name: CategoryTheory.CostructuredArrow.toOverCompOverEquivPresheafCostructuredArrow
code: /-- If `A : Cᵒᵖ ⥤ Type v` is a presheaf, then the Yoneda embedding for
    `CostructuredArrow yoneda A` factors through `Over A` via a forgetful functor and an
    equivalence.

    This is Lemma 1.4.12 in [Kashiwara2006]. -/
def CostructuredArrow.toOverCompOverEquivPresheafCostructuredArrow (A : Cᵒᵖ ⥤ Type v) :
    CostructuredArrow.toOver yoneda A ⋙ (overEquivPresheafCostructuredArrow A).functor ≅ yoneda 
goal: (CategoryTheory.CostructuredArrow.toOver CategoryTheory.yoneda A).comp
    (CategoryTheory.overEquivPresheafCostructuredArrow A).functor ≅
  CategoryTheory.yoneda