-- Module: Mathlib.CategoryTheory.Sites.PrecoverageToGrothendieck
Goal:
C : Type u_3
inst : Category.{u_2, u_3} C
J : Precoverage.{u_2, u_3} C
P : Functor.{u_2, u_1, u_3, u_1 + 1} Cᵒᵖ (Type u_1)
X_1 : C
S_1 : Sieve.{u_2, u_3} X_1
X : C
R S : Sieve.{u_2, u_3} X
hS : J.Saturate X R
h : ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, R.arrows f → J.Saturate Y (Sieve.pullback f S)
Y : C
f : Y ⟶ X
H :
  ∀ {X Y : C} {f : Y ⟶ X},
    ∀ R ∈ J.coverings X,
      Presieve.IsSeparatedFor P (Sieve.pullback f (Sieve.generate R)).arrows ∧
        ∀ (x : Presieve.FamilyOfElements P (Sieve.pullback f (Sieve.generate R)).arrows),
          x.Compatible (R := (Sieve.pullback f (Sieve.generate R)).arrows) →
            ∃ (t : P.obj (Opposite.op Y)), x.IsAmalgamation (R := (Sieve.pullback f (Sieve.generate R)).arrows) t
H1 : ∀ ⦃Y : C⦄ (f : Y ⟶ X), Presieve.IsSeparatedFor P (Sieve.pullback f R).arrows
H1' :
  ∀ ⦃Y : C⦄ (f : Y ⟶ X) (x : Presieve.FamilyOfElements P (Sieve.pullback f R).arrows),
    x.Compatible (R := (Sieve.pullback f R).arrows) →
      ∃ (t : P.obj (Opposite.op Y)), x.IsAmalgamation (R := (Sieve.pullback f R).arrows) t
H2 :
  ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄,
    R.arrows f → ∀ ⦃Y_1 : C⦄ (f_1 : Y_1 ⟶ Y), Presieve.IsSeparatedFor P (Sieve.pullback f_1 (Sieve.pullback f S)).arrows
H2' :
  ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄,
    R.arrows f →
      ∀ ⦃Y_1 : C⦄ (f_1 : Y_1 ⟶ Y) (x : Presieve.FamilyOfElements P (Sieve.pullback f_1 (Sieve.pullback f S)).arrows),
        x.Compatible (R := (Sieve.pullback f_1 (Sieve.pullback f S)).arrows) →
          ∃ (t : P.obj (Opposite.op Y_1)), x.IsAmalgamation (R := (Sieve.pullback f_1 (Sieve.pullback f S)).arrows) t
x : Presieve.FamilyOfElements P (Sieve.pullback f S).arrows
hx : x.Compatible (R := (Sieve.pullback f S).arrows)
y : ⦃Z : C⦄ → (g : Z ⟶ Y) → Presieve.FamilyOfElements P (Sieve.pullback (𝟙 Z) (Sieve.pullback (g ≫ f) S)).arrows :=
  fun (Z : C) (g : Z ⟶ Y) (ZZ : C) (gg : ZZ ⟶ Z) (hgg : (Sieve.pullback (𝟙 Z) (Sieve.pullback (g ≫ f) S)).arrows gg) ↦
    x (gg ≫ g) ⋯
hy : ∀ ⦃Z : C⦄ (g : Z ⟶ Y), (y g).Compatible (R := (Sieve.pullback (𝟙 Z) (Sieve.pullback (g ≫ f) S)).arrows)
z : ⦃Z : C⦄ → ⦃g : Z ⟶ Y⦄ → (hg : (Sieve.pullback f R).arrows g) → P.obj (Opposite.op Z)
hz :
  ∀ ⦃Z : C⦄ ⦃g : Z ⟶ Y⦄ (hg : (Sieve.pullback f R).arrows g),
    (y g).IsAmalgamation (R := (Sieve.pullback (𝟙 Z) (Sieve.pullback (g ≫ f) S)).arrows) (z hg)
q : Presieve.FamilyOfElements P (Sieve.pullback f R).arrows :=
  fun (Z : C) (g : Z ⟶ Y) (hg : (Sieve.pullback f R).arrows g) ↦ z hg
hq : q.Compatible (R := (Sieve.pullback f R).arrows)
t : P.obj (Opposite.op Y)
ht : q.IsAmalgamation (R := (Sieve.pullback f R).arrows) t
Z : C
g : Z ⟶ Y
hg : (Sieve.pullback f S).arrows g
ZZ : C
gg : ZZ ⟶ Z
hgg : (Sieve.pullback (g ≫ f) R).arrows gg
ZZZ : C
ggg : ZZZ ⟶ ZZ
hggg : (Sieve.pullback (𝟙 ZZ) (Sieve.pullback (gg ≫ g ≫ f) S)).arrows ggg
ZZZZ : C
gggg : ZZZZ ⟶ ZZZ
h_1 : (Sieve.pullback ggg (Sieve.pullback (gg ≫ g ≫ f) S)).arrows gggg
mpr :
  Eq (α := (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZZ)))
    ((ConcreteCategory.hom (FC := TypeCat.Fun) (P.map gggg.op) :
          (a : (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZ))) →
            (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZZ)))
        (y (gg ≫ g) ggg ⋯) :
      (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZZ)))
    ((ConcreteCategory.hom (FC := TypeCat.Fun) (P.map (gggg ≫ ggg ≫ gg).op) :
          (a : (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op Z))) → P.obj (Opposite.op ZZZZ))
        (x g hg) :
      P.obj (Opposite.op ZZZZ))
⊢ Eq (α := (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZZ)))
    ((ConcreteCategory.hom (FC := TypeCat.Fun) (P.map gggg.op) :
          (a : (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZ))) →
            (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZZ)))
        (y (gg ≫ g) ggg ⋯) :
      (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZZ)))
    ((ConcreteCategory.hom (FC := TypeCat.Fun) (P.map gggg.op) :
          (a : (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZ))) →
            (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZZ)))
        ((ConcreteCategory.hom (FC := TypeCat.Fun) (P.map (ggg ≫ gg).op) :
              (a : (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op Z))) → P.obj (Opposite.op ZZZ))
            (x g hg) :
          P.obj (Opposite.op ZZZ)) :
      (fun (X : Type u_1) ↦ X) (P.obj (Opposite.op ZZZZ)))

Tactic:
rw [← comp_apply _ (P.map gggg.op), ← P.map_comp, ← op_comp]

Premises used: CategoryTheory.op_comp, Quiver.Hom.op, CategoryTheory.Functor.map, CategoryTheory.comp_apply, CategoryTheory.Functor.map_comp