-- Mathlib/CategoryTheory/Sites/DenseSubsite/SheafEquiv.lean
lemma isIso_ranCounit_app_of_isDenseSubsite (Y : Sheaf J A) (U X) :
    IsIso ((yoneda.map ((G.op.ranCounit.app Y.val).app (op U))).app (op X))

Proof state:
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{u_3, u_1} C
inst✝³ : Category.{u_4, u_2} D
G : C ⥤ D
J : GrothendieckTopology C
K : GrothendieckTopology D
A : Type w
inst✝² : Category.{w', w} A
inst✝¹ : ∀ (X : Dᵒᵖ), Limits.HasLimitsOfShape (StructuredArrow X G.op) A
inst✝ : IsDenseSubsite J K G
Y : Sheaf J A
U : C
X : A
f : (yoneda.obj (((𝟭 (Cᵒᵖ ⥤ A)).obj Y.val).obj (op U))).obj (op X)
l : (X Y Z : C) → (f : X ⟶ Y) → (g : G.obj Y ⟶ G.obj Z) → (G.imageSieve g).arrows f → (X ⟶ Z)
hl :
  ∀ (X Y Z : C) (f : X ⟶ Y) (g : G.obj Y ⟶ G.obj Z) (hf : (G.imageSieve g).arrows f),
    G.map (l X Y Z f g hf) = G.map f ≫ g
W₁ W₂ : C
g : G.obj W₁ ⟶ G.obj U
i : W₂ ⟶ W₁
hi : 𝟙 (op (G.obj U)) ≫ g.op ≫ (G.map i.op.unop).op = g.op ≫ (G.map i.op.unop).op
I : GrothendieckTopology.Cover.Arrow ⟨G.imageSieve (G.map i ≫ g), ⋯⟩
I' : GrothendieckTopology.Cover.Arrow ⟨G.imageSieve g, ⋯⟩ := { Y := I.Y, f := I.f ≫ i, hf := ⋯ }
⊢ G.map (l I.Y W₂ U I.f (G.map i ≫ g) ⋯) = G.map (l I.Y W₁ U I'.f g ⋯)

Tactic:
simp [I', hl]

Result:
no goals

Proof state:
case refine_2.mk.mk.unit.op.mk.mk.unit.op.mk.up.up.refl.refl.intro
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{u_3, u_1} C
inst✝³ : Category.{u_4, u_2} D
G : C ⥤ D
J : GrothendieckTopology C
K : GrothendieckTopology D
A : Type w
inst✝² : Category.{w', w} A
inst✝¹ : ∀ (X : Dᵒᵖ), Limits.HasLimitsOfShape (StructuredArrow X G.op) A
inst✝ : IsDenseSubsite J K G
Y : Sheaf J A
U : C
X : A
f : (yoneda.obj (((𝟭 (Cᵒᵖ ⥤ A)).obj Y.val).obj (op U))).obj (op X)
l : (X Y Z : C) → (f : X ⟶ Y) → (g : G.obj Y ⟶ G.obj Z) → (G.imageSieve g).arrows f → (X ⟶ Z)
hl :
  ∀ (X Y Z : C) (f : X ⟶ Y) (g : G.obj Y ⟶ G.obj Z) (hf : (G.imageSieve g).arrows f),
    G.map (l X Y Z f g hf) = G.map f ≫ g
W₁ W₂ : C
i : op W₁ ⟶ op W₂
g : G.obj W₁ ⟶ G.obj U
hi : 𝟙 (op (G.obj U)) ≫ g.op ≫ (G.map i.unop).op = g.op ≫ (G.map i.unop).op
h : ∃ i', i = i'.op
⊢ 𝟙 X ≫
      ⋯.amalgamate
        ⟨G.imageSieve { left := { as := PUnit.unit }, right := op W₂, hom := g.op ≫ (G.map i.unop).op }.hom.unop, ⋯⟩
        (fun I =>
          f ≫
            Y.val.map
              (l I.Y (unop { left := { as := PUnit.unit }, right := op W₂, hom := g.op ≫ (G.map i.unop).op }.2) U I.f
                  { left := { as := PUnit.unit }, right := op W₂, hom := g.op ≫ (G.map i.unop).op }.hom.unop ⋯).op)
        ⋯ =
    ⋯.amalgamate ⟨G.imageSieve { left := { as := PUnit.unit }, right := op W₁, hom := g.op }.hom.unop, ⋯⟩
        (fun I =>
          f ≫
            Y.val.map
              (l I.Y (unop { left := { as := PUnit.unit }, right := op W₁, hom := g.op }.2) U I.f
                  { left := { as := PUnit.unit }, right := op W₁, hom := g.op }.hom.unop ⋯).op)
        ⋯ ≫
      Y.val.map { left := { down := { down := ⋯ } }, right := i, w := hi }.right

Tactic:
rcases h with ⟨i, rfl⟩

Result:
case refine_2.mk.mk.unit.op.mk.mk.unit.op.mk.up.up.refl.refl.intro.intro
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{u_3, u_1} C
inst✝³ : Category.{u_4, u_2} D
G : C ⥤ D
J : GrothendieckTopology C
K : GrothendieckTopology D
A : Type w
inst✝² : Category.{w', w} A
inst✝¹ : ∀ (X : Dᵒᵖ), Limits.HasLimitsOfShape (StructuredArrow X G.op) A
inst✝ : IsDenseSubsite J K G
Y : Sheaf J A
U : C
X : A
f : (yoneda.obj (((𝟭 (Cᵒᵖ ⥤ A)).obj Y.val).obj (op U))).obj (op X)
l : (X Y Z : C) → (f : X ⟶ Y) → (g : G.obj Y ⟶ G.obj Z) → (G.imageSieve g).arrows f → (X ⟶ Z)
hl :
  ∀ (X Y Z : C) (f : X ⟶ Y) (g : G.obj Y ⟶ G.obj Z) (hf : (G.imageSieve g).arrows f),
    G.map (l X Y Z f g hf) = G.map f ≫ g
W₁ W₂ : C
g : G.obj W₁ ⟶ G.obj U
i : W₂ ⟶ W₁
hi : 𝟙 (op (G.obj U)) ≫ g.op ≫ (G.map i.op.unop).op = g.op ≫ (G.map i.op.unop).op
⊢ 𝟙 X ≫
      ⋯.amalgamate
        ⟨G.imageSieve { left := { as := PUnit.unit }, right := op W₂, hom := g.op ≫ (G.map i.op.unop).op }.hom.unop, ⋯⟩
        (fun I =>
          f ≫
            Y.val.map
              (l I.Y (unop { left := { as := PUnit.unit }, right := op W₂, hom := g.op ≫ (G.map i.op.unop).op }.2) U I.f
                  { left := { as := PUnit.unit }, right := op W₂, hom := g.op ≫ (G.map i.op.unop).op }.hom.unop ⋯).op)
        ⋯ =
    ⋯.amalgamate ⟨G.imageSieve { left := { as := PUnit.unit }, right := op W₁, hom := g.op }.hom.unop, ⋯⟩
        (fun I =>
          f ≫
            Y.val.map
              (l I.Y (unop { left := { as := PUnit.unit }, right := op W₁, hom := g.op }.2) U I.f
                  { left := { as := PUnit.unit }, right := op W₁, hom := g.op }.hom.unop ⋯).op)
        ⋯ ≫
      Y.val.map { left := { down := { down := ⋯ } }, right := i.op, w := hi }.right

Proof state:
case refine_1
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{u_3, u_1} C
inst✝³ : Category.{u_4, u_2} D
G : C ⥤ D
J : GrothendieckTopology C
K : GrothendieckTopology D
A : Type w
inst✝² : Category.{w', w} A
inst✝¹ : ∀ (X : Dᵒᵖ), Limits.HasLimitsOfShape (StructuredArrow X G.op) A
inst✝ : IsDenseSubsite J K G
Y : Sheaf J A
U : C
X : A
f : (yoneda.obj (((𝟭 (Cᵒᵖ ⥤ A)).obj Y.val).obj (op U))).obj (op X)
l : (X Y Z : C) → (f : X ⟶ Y) → (g : G.obj Y ⟶ G.obj Z) → (G.imageSieve g).arrows f → (X ⟶ Z)
hl :
  ∀ (X Y Z : C) (f : X ⟶ Y) (g : G.obj Y ⟶ G.obj Z) (hf : (G.imageSieve g).arrows f),
    G.map (l X Y Z f g hf) = G.map f ≫ g
g : StructuredArrow (op (G.obj U)) G.op
⊢ ((const (StructuredArrow (op (G.obj U)) G.op)).obj X).obj g ⟶ (StructuredArrow.proj (op (G.obj U)) G.op ⋙ Y.val).obj g

Tactic:
refine Y.2.amalgamate ⟨_, IsDenseSubsite.imageSieve_mem J K G g.hom.unop⟩
  (fun I ↦ f ≫ Y.1.map (l _ _ _ _ _ I.hf).op) fun I₁ I₂ r ↦ ?_

Result:
case refine_1
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{u_3, u_1} C
inst✝³ : Category.{u_4, u_2} D
G : C ⥤ D
J : GrothendieckTopology C
K : GrothendieckTopology D
A : Type w
inst✝² : Category.{w', w} A
inst✝¹ : ∀ (X : Dᵒᵖ), Limits.HasLimitsOfShape (StructuredArrow X G.op) A
inst✝ : IsDenseSubsite J K G
Y : Sheaf J A
U : C
X : A
f : (yoneda.obj (((𝟭 (Cᵒᵖ ⥤ A)).obj Y.val).obj (op U))).obj (op X)
l : (X Y Z : C) → (f : X ⟶ Y) → (g : G.obj Y ⟶ G.obj Z) → (G.imageSieve g).arrows f → (X ⟶ Z)
hl :
  ∀ (X Y Z : C) (f : X ⟶ Y) (g : G.obj Y ⟶ G.obj Z) (hf : (G.imageSieve g).arrows f),
    G.map (l X Y Z f g hf) = G.map f ≫ g
g : StructuredArrow (op (G.obj U)) G.op
I₁ I₂ : GrothendieckTopology.Cover.Arrow ⟨G.imageSieve g.hom.unop, ⋯⟩
r : I₁.Relation I₂
⊢ (fun I => f ≫ Y.val.map (l I.Y (unop g.2) U I.f g.hom.unop ⋯).op) I₁ ≫ Y.val.map r.g₁.op =
    (fun I => f ≫ Y.val.map (l I.Y (unop g.2) U I.f g.hom.unop ⋯).op) I₂ ≫ Y.val.map r.g₂.op

Proof state:
case left.mk.mk.unit.op.intro.intro
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{u_3, u_1} C
inst✝³ : Category.{u_4, u_2} D
G : C ⥤ D
J : GrothendieckTopology C
K : GrothendieckTopology D
A : Type w
inst✝² : Category.{w', w} A
inst✝¹ : ∀ (X : Dᵒᵖ), Limits.HasLimitsOfShape (StructuredArrow X G.op) A
inst✝ : IsDenseSubsite J K G
Y : Sheaf J A
U : C
X : A
f₁ f₂ : (yoneda.obj (((G.op.ran ⋙ (whiskeringLeft Cᵒᵖ Dᵒᵖ A).obj G.op).obj Y.val).obj (op U))).obj (op X)
e :
  (yoneda.map ((G.op.ranCounit.app Y.val).app (op U))).app (op X) f₁ =
    (yoneda.map ((G.op.ranCounit.app Y.val).app (op U))).app (op X) f₂
W : C
g : G.obj W ⟶ G.obj U
V : C
iVW : V ⟶ W
iVU : V ⟶ U
e' : G.map iVU = G.map iVW ≫ g
this :
  f₁ ≫
      (((whiskeringLeft Cᵒᵖ Dᵒᵖ A).obj G.op).obj (G.op.ran.obj Y.val)).map iVU.op ≫
        (G.op.ranCounit.app Y.val).app (op V) =
    f₂ ≫
      (((whiskeringLeft Cᵒᵖ Dᵒᵖ A).obj G.op).obj (G.op.ran.obj Y.val)).map iVU.op ≫
        (G.op.ranCounit.app Y.val).app (op V)
⊢ f₁ ≫ (G.op.ran.obj Y.val).map (G.map iVU).op ≫ (G.op.ranCounit.app Y.val).app (op V) =
    f₂ ≫ (G.op.ran.obj Y.val).map (G.map iVU).op ≫ (G.op.ranCounit.app Y.val).app (op V)

Tactic:
exact this

Result:
no goals