/--
A helper lemma for the following two lemmas. Basically stating that if the section `y : X ⟶ 𝒢(V)`
coincides with `x` on `G(V')` for all `G(V') ⊆ V ∈ S`, then `X ⟶ 𝒢(V) ⟶ ℱ(W)` is indeed the
section obtained in `get_sections`. That said, this is littered with some more categorical jargon
in order to be applied in the following lemmas easier.
-/
theorem helper {V} (f : V ⟶ U) (y : X ⟶ ((ran G.op).obj ℱ.val).obj (op V)) (W)
    (H : ∀ {V'} {fV : G.obj V' ⟶ V} (hV), y ≫ ((ran G.op).obj ℱ.val).map fV.op = x (fV ≫ f) hV) :
    y ≫ limit.π (Ran.diagram G.op ℱ.val (op V)) W =
      (gluedLimitCone ℱ hS hx).π.app ((StructuredArrow.map f.op).obj W) := by
  dsimp only [gluedLimitCone_π_app]
  apply getSection_is_unique ℱ hS hx ((StructuredArrow.map f.op).obj W)
  intro V' fV' hV'
  dsimp only [Ran.adjunction, Ran.equiv, pulledbackFamily_apply]
  

Proof state:
C D : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : Category.{v, u} D
G : C ⥤ D
A : Type w
inst✝² : Category.{max u v, w} A
inst✝¹ : HasLimits A
J : GrothendieckTopology C
K : GrothendieckTopology D
inst✝ : Functor.IsCocontinuous G J K
ℱ : Sheaf J A
X : A
U : D
S : Sieve U
hS : S ∈ GrothendieckTopology.sieves K U
x : FamilyOfElements ((ran G.op).obj ℱ.val ⋙ coyoneda.obj (op X)) S.arrows
hx : Compatible x
V : D
f : V ⟶ U
y : X ⟶ ((ran G.op).obj ℱ.val).obj (op V)
W : StructuredArrow (op V) G.op
H : ∀ {V' : C} {fV : G.obj V' ⟶ V} (hV : S.arrows (fV ≫ f)), y ≫ ((ran G.op).obj ℱ.val).map fV.op = x (fV ≫ f) hV
V' : C
fV' : V' ⟶ ((StructuredArrow.map f.op).obj W).right.unop
hV' : Presieve.functorPullback G (Sieve.pullback ((StructuredArrow.map f.op).obj W).hom.unop S).arrows fV'
⊢ ((𝟭 (Cᵒᵖ ⥤ A)).obj ℱ.val ⋙ coyoneda.obj (op X)).map fV'.op (y ≫ limit.π (Ran.diagram G.op ℱ.val (op V)) W) =
    x (G.map fV' ≫ ((StructuredArrow.map f.op).obj W).hom.unop) hV' ≫
      ((Adjunction.adjunctionOfEquivRight
                  (fun F G_1 =>
                    {
                        toFun := fun f =>
                          NatTrans.mk fun x =>
                            f.app (G.op.obj x) ≫
                              limit.π (Ran.diagram G.op G_1 (G.op.obj x)) (StructuredArrow.mk (𝟙 (G.op.obj x))),
                        invFun := fun f => NatTrans.mk fun x => limit.lift (Ran.diagram G.op G_1 x) (Ran.cone x f),
                        left_inv :=
                          (_ :
                            ∀ (x : F ⟶ Ran.loc G.op G_1),
                              (fun f => NatTrans.mk fun x => limit.lift (Ran.diagram G.op G_1 x) (Ran.cone x f))
                                  ((fun f =>
                                      NatTrans.mk fun x =>
                                        f.app (G.op.obj x) ≫
                                          limit.π (Ran.diagram G.op G_1 (G.op.obj x))
                                            (StructuredArrow.mk (𝟙 (G.op.obj x))))
                                    x) =
                                x),
                        right_inv :=
                          (_ :
                            ∀ (x : ((whiskeringLeft Cᵒᵖ Dᵒᵖ A).obj G.op).obj F ⟶ G_1),
                              (fun f =>
                                    NatTrans.mk fun x =>
                                      f.app (G.op.obj x) ≫
                                        limit.π (Ran.diagram G.op G_1 (G.op.obj x))
                                          (StructuredArrow.mk (𝟙 (G.op.obj x))))
                                  ((fun f => NatTrans.mk fun x => limit.lift (Ran.diagram G.op G_1 x) (Ran.cone x f))
                                    x) =
                                x) }.symm)
                  (_ :
                    ∀ (X' X : Dᵒᵖ ⥤ A) (Y : Cᵒᵖ ⥤ A) (f : X' ⟶ X) (g : ((whiskeringLeft Cᵒᵖ Dᵒᵖ A).obj G.op).obj X ⟶ Y),
                      ((fun F G_1 => (Ran.equiv G.op G_1 F).symm) X' Y)
                          (((whiskeringLeft Cᵒᵖ Dᵒᵖ A).obj G.op).map f ≫ g) =
                        f ≫ ((fun F G_1 => (Ran.equiv G.op G_1 F).symm) X Y) g)).counit.app
            ℱ.val).app
        (op V')

Next tactic:
erw [Adjunction.adjunctionOfEquivRight_counit_app]