-- Mathlib/CategoryTheory/Sites/SheafHom.lean
lemma exists_app (hx : x.Compatible) (g : Y ⟶ X) :
    ∃ (φ : F.obj (op Y) ⟶ G.obj (op Y)),
      ∀ {Z : C} (p : Z ⟶ Y) (hp : S (p ≫ g)), φ ≫ G.map p.op =
        F.map p.op ≫ (x (p ≫ g) hp).app ⟨Over.mk (𝟙 Z)⟩

Proof state:
case op.mk.op.mk.op
C : Type u
inst✝¹ : Category.{v, u} C
A : Type u'
inst✝ : Category.{v', u'} A
F G : Cᵒᵖ ⥤ A
X : C
S : Sieve X
hG : ⦃Y : C⦄ → (f : Y ⟶ X) → IsLimit (G.mapCone (Sieve.pullback f S).arrows.cocone.op)
x : Presieve.FamilyOfElements (presheafHom F G) S.arrows
Y : C
hx : x.Compatible
g : Y ⟶ X
Z₁ : Over Y
hZ₁ : (Sieve.pullback g S).arrows Z₁.hom
Z₂ : Over Y
hZ₂ : (Sieve.pullback g S).arrows Z₂.hom
f : Z₂ ⟶ Z₁
H : (presheafHom F G).map f.left.op (x (Z₁.hom ≫ g) hZ₁) = x (Z₂.hom ≫ g) hZ₂
⊢ F.map Z₂.hom.op ≫ (x (Z₂.hom ≫ g) ⋯).app (op (Over.mk (𝟙 Z₂.left))) =
    F.map Z₁.hom.op ≫ (x (Z₁.hom ≫ g) ⋯).app (op (Over.mk (𝟙 Z₁.left))) ≫ G.map f.left.op

Tactic:
let φ : Over.mk f.left ⟶ Over.mk (𝟙 Z₁.left) := Over.homMk f.left

Result:
case op.mk.op.mk.op
C : Type u
inst✝¹ : Category.{v, u} C
A : Type u'
inst✝ : Category.{v', u'} A
F G : Cᵒᵖ ⥤ A
X : C
S : Sieve X
hG : ⦃Y : C⦄ → (f : Y ⟶ X) → IsLimit (G.mapCone (Sieve.pullback f S).arrows.cocone.op)
x : Presieve.FamilyOfElements (presheafHom F G) S.arrows
Y : C
hx : x.Compatible
g : Y ⟶ X
Z₁ : Over Y
hZ₁ : (Sieve.pullback g S).arrows Z₁.hom
Z₂ : Over Y
hZ₂ : (Sieve.pullback g S).arrows Z₂.hom
f : Z₂ ⟶ Z₁
H : (presheafHom F G).map f.left.op (x (Z₁.hom ≫ g) hZ₁) = x (Z₂.hom ≫ g) hZ₂
φ : Over.mk f.left ⟶ Over.mk (𝟙 Z₁.left) := Over.homMk f.left ⋯
⊢ F.map Z₂.hom.op ≫ (x (Z₂.hom ≫ g) ⋯).app (op (Over.mk (𝟙 Z₂.left))) =
    F.map Z₁.hom.op ≫ (x (Z₁.hom ≫ g) ⋯).app (op (Over.mk (𝟙 Z₁.left))) ≫ G.map f.left.op

Proof state:
case h
C : Type u
inst✝¹ : Category.{v, u} C
A : Type u'
inst✝ : Category.{v', u'} A
F G : Cᵒᵖ ⥤ A
X : C
S : Sieve X
hG : ⦃Y : C⦄ → (f : Y ⟶ X) → IsLimit (G.mapCone (Sieve.pullback f S).arrows.cocone.op)
x : Presieve.FamilyOfElements (presheafHom F G) S.arrows
Y : C
hx : x.Compatible
g : Y ⟶ X
c : Cone ((Sieve.pullback g S).arrows.diagram.op ⋙ G) :=
  { pt := F.obj (op Y),
    π :=
      {
        app := fun x_1 =>
          match x_1 with
          | op { obj := Z, property := hZ } =>
            F.map Z.hom.op ≫ (x (Z.hom ≫ g) hZ).app (op (Over.mk (𝟙 (unop (op ((𝟭 C).obj Z.left)))))),
        naturality := ⋯ } }
Z : C
p : Z ⟶ Y
hp : S.arrows (p ≫ g)
⊢ (hG g).lift c ≫ G.map p.op = F.map p.op ≫ (x (p ≫ g) hp).app (op (Over.mk (𝟙 Z)))

Tactic:
exact ((hG g).fac c ⟨Over.mk p, hp⟩)

Result:
no goals

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
A : Type u'
inst✝ : Category.{v', u'} A
F G : Cᵒᵖ ⥤ A
X : C
S : Sieve X
hG : ⦃Y : C⦄ → (f : Y ⟶ X) → IsLimit (G.mapCone (Sieve.pullback f S).arrows.cocone.op)
x : Presieve.FamilyOfElements (presheafHom F G) S.arrows
Y : C
hx : x.Compatible
g : Y ⟶ X
⊢ ∀ ⦃X_1 Y_1 : (Sieve.pullback g S).arrows.categoryᵒᵖ⦄ (f : X_1 ⟶ Y_1),
    ((Functor.const (Sieve.pullback g S).arrows.categoryᵒᵖ).obj (F.obj (op Y))).map f ≫
        (fun x_1 =>
            match x_1 with
            | op { obj := Z, property := hZ } =>
              F.map Z.hom.op ≫ (x (Z.hom ≫ g) hZ).app (op (Over.mk (𝟙 (unop (op ((𝟭 C).obj Z.left)))))))
          Y_1 =
      (fun x_1 =>
            match x_1 with
            | op { obj := Z, property := hZ } =>
              F.map Z.hom.op ≫ (x (Z.hom ≫ g) hZ).app (op (Over.mk (𝟙 (unop (op ((𝟭 C).obj Z.left)))))))
          X_1 ≫
        ((Sieve.pullback g S).arrows.diagram.op ⋙ G).map f

Tactic:
rintro ⟨Z₁, hZ₁⟩ ⟨Z₂, hZ₂⟩ ⟨f : Z₂ ⟶ Z₁⟩

Result:
case op.mk.op.mk.op
C : Type u
inst✝¹ : Category.{v, u} C
A : Type u'
inst✝ : Category.{v', u'} A
F G : Cᵒᵖ ⥤ A
X : C
S : Sieve X
hG : ⦃Y : C⦄ → (f : Y ⟶ X) → IsLimit (G.mapCone (Sieve.pullback f S).arrows.cocone.op)
x : Presieve.FamilyOfElements (presheafHom F G) S.arrows
Y : C
hx : x.Compatible
g : Y ⟶ X
Z₁ : Over Y
hZ₁ : (Sieve.pullback g S).arrows Z₁.hom
Z₂ : Over Y
hZ₂ : (Sieve.pullback g S).arrows Z₂.hom
f : Z₂ ⟶ Z₁
⊢ ((Functor.const (Sieve.pullback g S).arrows.categoryᵒᵖ).obj (F.obj (op Y))).map (op f) ≫
      (fun x_1 =>
          match x_1 with
          | op { obj := Z, property := hZ } =>
            F.map Z.hom.op ≫ (x (Z.hom ≫ g) hZ).app (op (Over.mk (𝟙 (unop (op ((𝟭 C).obj Z.left)))))))
        (op { obj := Z₂, property := hZ₂ }) =
    (fun x_1 =>
          match x_1 with
          | op { obj := Z, property := hZ } =>
            F.map Z.hom.op ≫ (x (Z.hom ≫ g) hZ).app (op (Over.mk (𝟙 (unop (op ((𝟭 C).obj Z.left)))))))
        (op { obj := Z₁, property := hZ₁ }) ≫
      ((Sieve.pullback g S).arrows.diagram.op ⋙ G).map (op f)

Proof state:
case op.mk.op.mk.op
C : Type u
inst✝¹ : Category.{v, u} C
A : Type u'
inst✝ : Category.{v', u'} A
F G : Cᵒᵖ ⥤ A
X : C
S : Sieve X
hG : ⦃Y : C⦄ → (f : Y ⟶ X) → IsLimit (G.mapCone (Sieve.pullback f S).arrows.cocone.op)
x : Presieve.FamilyOfElements (presheafHom F G) S.arrows
Y : C
hx : x.Compatible
g : Y ⟶ X
Z₁ : Over Y
hZ₁ : (Sieve.pullback g S).arrows Z₁.hom
Z₂ : Over Y
hZ₂ : (Sieve.pullback g S).arrows Z₂.hom
f : Z₂ ⟶ Z₁
H : (presheafHom F G).map f.left.op (x (Z₁.hom ≫ g) hZ₁) = x (Z₂.hom ≫ g) hZ₂
φ : Over.mk f.left ⟶ Over.mk (𝟙 Z₁.left) := Over.homMk f.left ⋯
⊢ F.map Z₂.hom.op ≫ (x (Z₂.hom ≫ g) ⋯).app (op (Over.mk (𝟙 Z₂.left))) =
    F.map Z₁.hom.op ≫ (x (Z₁.hom ≫ g) ⋯).app (op (Over.mk (𝟙 Z₁.left))) ≫ G.map f.left.op

Tactic:
have H' := (x (Z₁.hom ≫ g) hZ₁).naturality φ.op

Result:
case op.mk.op.mk.op
C : Type u
inst✝¹ : Category.{v, u} C
A : Type u'
inst✝ : Category.{v', u'} A
F G : Cᵒᵖ ⥤ A
X : C
S : Sieve X
hG : ⦃Y : C⦄ → (f : Y ⟶ X) → IsLimit (G.mapCone (Sieve.pullback f S).arrows.cocone.op)
x : Presieve.FamilyOfElements (presheafHom F G) S.arrows
Y : C
hx : x.Compatible
g : Y ⟶ X
Z₁ : Over Y
hZ₁ : (Sieve.pullback g S).arrows Z₁.hom
Z₂ : Over Y
hZ₂ : (Sieve.pullback g S).arrows Z₂.hom
f : Z₂ ⟶ Z₁
H : (presheafHom F G).map f.left.op (x (Z₁.hom ≫ g) hZ₁) = x (Z₂.hom ≫ g) hZ₂
φ : Over.mk f.left ⟶ Over.mk (𝟙 Z₁.left) := Over.homMk f.left ⋯
H' :
  ((Over.forget (unop (op ((𝟭 C).obj Z₁.left)))).op ⋙ F).map φ.op ≫ (x (Z₁.hom ≫ g) hZ₁).app (op (Over.mk f.left)) =
    (x (Z₁.hom ≫ g) hZ₁).app (op (Over.mk (𝟙 Z₁.left))) ≫
      ((Over.forget (unop (op ((𝟭 C).obj Z₁.left)))).op ⋙ G).map φ.op
⊢ F.map Z₂.hom.op ≫ (x (Z₂.hom ≫ g) ⋯).app (op (Over.mk (𝟙 Z₂.left))) =
    F.map Z₁.hom.op ≫ (x (Z₁.hom ≫ g) ⋯).app (op (Over.mk (𝟙 Z₁.left))) ≫ G.map f.left.op