l3lab/ntp-mathlib huggingface dataset:
/-- The constructed `sheafHom α` is equal to `α` when restricted onto `C`.
-/
theorem sheafHom_restrict_eq (α : G.op ⋙ ℱ ⟶ G.op ⋙ ℱ'.val) :
    whiskerLeft G.op (sheafHom α) = α := by
  ext X
  apply yoneda.map_injective
  ext U
  -- porting note: didn't need to provide the input to `image_preimage` in Lean 3
  erw [yoneda.image_preimage ((sheafYonedaHom α).app (G.op.obj X))]
  symm
  change (show (ℱ'.val ⋙ coyoneda.obj (op (unop U))).obj (op (G.obj (unop X))) from _) = _
  apply sheaf_eq_amalgamation ℱ' (G.is_cover_of_isCoverDense _ _)
  -- porting note: next line was not needed in mathlib3
  · exact (pushforwardFamily_compatible _ _)
  intro Y f hf
  conv_lhs => rw [← hf.some.fac]
  simp only [pushforwardFamily, Functor.comp_map, yoneda_map_app, coyoneda_obj_map, op_comp,
    FunctorToTypes.map_comp_apply, homOver_app, ← Category.assoc]
  congr 1
  simp only [Category.assoc]
  congr 1
  rw [← G.image_preimage hf.some.map]
  

Proof state:
case w.h.a.w.h.h.h.e_a.e_a
C : Type u_1
inst✝⁵ : Category.{u_6, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_7, u_2} D
E : Type u_3
inst✝³ : Category.{?u.122032, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : G.op ⋙ ℱ ⟶ G.op ⋙ ℱ'.val
X : Cᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj ((G.op ⋙ ℱ).obj X)).obj U
Y : D
f : Y ⟶ G.obj X.unop
hf : (Sieve.coverByImage G (G.obj X.unop)).arrows f
⊢ α.app X ≫ ℱ'.val.map (G.map (G.preimage (Nonempty.some hf).map)).op =
    ℱ.map (G.map (G.preimage (Nonempty.some hf).map)).op ≫ α.app (op (Nonempty.some hf).1)

Next tactic:
symm
/-- The constructed `sheafHom α` is equal to `α` when restricted onto `C`.
-/
theorem sheafHom_restrict_eq (α : G.op ⋙ ℱ ⟶ G.op ⋙ ℱ'.val) :
    whiskerLeft G.op (sheafHom α) = α := by
  ext X
  apply yoneda.map_injective
  ext U
  -- porting note: didn't need to provide the input to `image_preimage` in Lean 3
  erw [yoneda.image_preimage ((sheafYonedaHom α).app (G.op.obj X))]
  symm
  change (show (ℱ'.val ⋙ coyoneda.obj (op (unop U))).obj (op (G.obj (unop X))) from _) = _
  apply sheaf_eq_amalgamation ℱ' (G.is_cover_of_isCoverDense _ _)
  -- porting note: next line was not needed in mathlib3
  · exact (pushforwardFamily_compatible _ _)
  intro Y f hf
  conv_lhs => rw [← hf.some.fac]
  simp only [pushforwardFamily, Functor.comp_map, yoneda_map_app, coyoneda_obj_map, op_comp,
    FunctorToTypes.map_comp_apply, homOver_app, ← Category.assoc]
  congr 1
  simp only [Category.assoc]
  congr 1
  rw [← G.image_preimage hf.some.map]
  symm
  

Proof state:
case w.h.a.w.h.h.h.e_a.e_a
C : Type u_1
inst✝⁵ : Category.{u_6, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_7, u_2} D
E : Type u_3
inst✝³ : Category.{?u.122032, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : G.op ⋙ ℱ ⟶ G.op ⋙ ℱ'.val
X : Cᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj ((G.op ⋙ ℱ).obj X)).obj U
Y : D
f : Y ⟶ G.obj X.unop
hf : (Sieve.coverByImage G (G.obj X.unop)).arrows f
⊢ ℱ.map (G.map (G.preimage (Nonempty.some hf).map)).op ≫ α.app (op (Nonempty.some hf).1) =
    α.app X ≫ ℱ'.val.map (G.map (G.preimage (Nonempty.some hf).map)).op

Next tactic:
apply α.naturality (G.preimage hf.some.map).op
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
⊢ sheafHom (whiskerLeft G.op α) = α

Next tactic:
ext X
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  

Proof state:
case w.h
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
⊢ (sheafHom (whiskerLeft G.op α)).app X = α.app X

Next tactic:
apply yoneda.map_injective
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  

Proof state:
case w.h.a
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
⊢ yoneda.map ((sheafHom (whiskerLeft G.op α)).app X) = yoneda.map (α.app X)

Next tactic:
ext U
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  ext U
  -- porting note: Lean 3 didn't need to be told the explicit input to image_preimage
  

Proof state:
case w.h.a.w.h.h
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj (ℱ.obj X)).obj U
⊢ (yoneda.map ((sheafHom (whiskerLeft G.op α)).app X)).app U a✝ = (yoneda.map (α.app X)).app U a✝

Next tactic:
erw [yoneda.image_preimage ((sheafYonedaHom (whiskerLeft G.op α)).app X)]
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  ext U
  -- porting note: Lean 3 didn't need to be told the explicit input to image_preimage
  erw [yoneda.image_preimage ((sheafYonedaHom (whiskerLeft G.op α)).app X)]
  

Proof state:
case w.h.a.w.h.h
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj (ℱ.obj X)).obj U
⊢ ((sheafYonedaHom (whiskerLeft G.op α)).app X).app U a✝ = (yoneda.map (α.app X)).app U a✝

Next tactic:
symm
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  ext U
  -- porting note: Lean 3 didn't need to be told the explicit input to image_preimage
  erw [yoneda.image_preimage ((sheafYonedaHom (whiskerLeft G.op α)).app X)]
  symm
  

Proof state:
case w.h.a.w.h.h
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj (ℱ.obj X)).obj U
⊢ (yoneda.map (α.app X)).app U a✝ = ((sheafYonedaHom (whiskerLeft G.op α)).app X).app U a✝

Next tactic:
change (show (ℱ'.val ⋙ coyoneda.obj (op (unop U))).obj (op (unop X)) from _) = _
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  ext U
  -- porting note: Lean 3 didn't need to be told the explicit input to image_preimage
  erw [yoneda.image_preimage ((sheafYonedaHom (whiskerLeft G.op α)).app X)]
  symm
  change (show (ℱ'.val ⋙ coyoneda.obj (op (unop U))).obj (op (unop X)) from _) = _
  

Proof state:
case w.h.a.w.h.h
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj (ℱ.obj X)).obj U
⊢ (let_fun this := (yoneda.map (α.app X)).app U a✝;
    this) =
    ((sheafYonedaHom (whiskerLeft G.op α)).app X).app U a✝

Next tactic:
apply sheaf_eq_amalgamation ℱ' (G.is_cover_of_isCoverDense _ _)
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  ext U
  -- porting note: Lean 3 didn't need to be told the explicit input to image_preimage
  erw [yoneda.image_preimage ((sheafYonedaHom (whiskerLeft G.op α)).app X)]
  symm
  change (show (ℱ'.val ⋙ coyoneda.obj (op (unop U))).obj (op (unop X)) from _) = _
  apply sheaf_eq_amalgamation ℱ' (G.is_cover_of_isCoverDense _ _)
  -- porting note: next line was not needed in mathlib3
  · 

Proof state:
case w.h.a.w.h.h.hx
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj (ℱ.obj X)).obj U
⊢ FamilyOfElements.Compatible (pushforwardFamily (homOver (whiskerLeft G.op α) U.unop) a✝)

Next tactic:
exact (pushforwardFamily_compatible _ _)
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  ext U
  -- porting note: Lean 3 didn't need to be told the explicit input to image_preimage
  erw [yoneda.image_preimage ((sheafYonedaHom (whiskerLeft G.op α)).app X)]
  symm
  change (show (ℱ'.val ⋙ coyoneda.obj (op (unop U))).obj (op (unop X)) from _) = _
  apply sheaf_eq_amalgamation ℱ' (G.is_cover_of_isCoverDense _ _)
  -- porting note: next line was not needed in mathlib3
  · exact (pushforwardFamily_compatible _ _)
  

Proof state:
case w.h.a.w.h.h.h
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj (ℱ.obj X)).obj U
⊢ FamilyOfElements.IsAmalgamation (pushforwardFamily (homOver (whiskerLeft G.op α) U.unop) a✝)
    (let_fun this := (yoneda.map (α.app X)).app U a✝;
    this)

Next tactic:
intro Y f hf
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  ext U
  -- porting note: Lean 3 didn't need to be told the explicit input to image_preimage
  erw [yoneda.image_preimage ((sheafYonedaHom (whiskerLeft G.op α)).app X)]
  symm
  change (show (ℱ'.val ⋙ coyoneda.obj (op (unop U))).obj (op (unop X)) from _) = _
  apply sheaf_eq_amalgamation ℱ' (G.is_cover_of_isCoverDense _ _)
  -- porting note: next line was not needed in mathlib3
  · exact (pushforwardFamily_compatible _ _)
  intro Y f hf
  

Proof state:
case w.h.a.w.h.h.h
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj (ℱ.obj X)).obj U
Y : D
f : Y ⟶ X.unop
hf : (Sieve.coverByImage G X.unop).arrows f
⊢ (ℱ'.val ⋙ coyoneda.obj (op U.unop)).map f.op
      (let_fun this := (yoneda.map (α.app X)).app U a✝;
      this) =
    pushforwardFamily (homOver (whiskerLeft G.op α) U.unop) a✝ f hf

Next tactic:
conv_lhs => rw [← hf.some.fac]
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  ext U
  -- porting note: Lean 3 didn't need to be told the explicit input to image_preimage
  erw [yoneda.image_preimage ((sheafYonedaHom (whiskerLeft G.op α)).app X)]
  symm
  change (show (ℱ'.val ⋙ coyoneda.obj (op (unop U))).obj (op (unop X)) from _) = _
  apply sheaf_eq_amalgamation ℱ' (G.is_cover_of_isCoverDense _ _)
  -- porting note: next line was not needed in mathlib3
  · exact (pushforwardFamily_compatible _ _)
  intro Y f hf
  conv_lhs => 

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj (ℱ.obj X)).obj U
Y : D
f : Y ⟶ X.unop
hf : (Sieve.coverByImage G X.unop).arrows f
| (ℱ'.val ⋙ coyoneda.obj (op U.unop)).map f.op
    (let_fun this := (yoneda.map (α.app X)).app U a✝;
    this)

Next tactic:
rw [← hf.some.fac]
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  ext U
  -- porting note: Lean 3 didn't need to be told the explicit input to image_preimage
  erw [yoneda.image_preimage ((sheafYonedaHom (whiskerLeft G.op α)).app X)]
  symm
  change (show (ℱ'.val ⋙ coyoneda.obj (op (unop U))).obj (op (unop X)) from _) = _
  apply sheaf_eq_amalgamation ℱ' (G.is_cover_of_isCoverDense _ _)
  -- porting note: next line was not needed in mathlib3
  · exact (pushforwardFamily_compatible _ _)
  intro Y f hf
  conv_lhs => rw [← hf.some.fac]
  

Proof state:
case w.h.a.w.h.h.h
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj (ℱ.obj X)).obj U
Y : D
f : Y ⟶ X.unop
hf : (Sieve.coverByImage G X.unop).arrows f
⊢ (ℱ'.val ⋙ coyoneda.obj (op U.unop)).map ((Nonempty.some hf).lift ≫ (Nonempty.some hf).map).op
      (let_fun this := (yoneda.map (α.app X)).app U a✝;
      this) =
    pushforwardFamily (homOver (whiskerLeft G.op α) U.unop) a✝ f hf

Next tactic:
dsimp
/-- If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α := by
  ext X
  apply yoneda.map_injective
  -- porting note: deleted next line as it's not needed in Lean 4
  ext U
  -- porting note: Lean 3 didn't need to be told the explicit input to image_preimage
  erw [yoneda.image_preimage ((sheafYonedaHom (whiskerLeft G.op α)).app X)]
  symm
  change (show (ℱ'.val ⋙ coyoneda.obj (op (unop U))).obj (op (unop X)) from _) = _
  apply sheaf_eq_amalgamation ℱ' (G.is_cover_of_isCoverDense _ _)
  -- porting note: next line was not needed in mathlib3
  · exact (pushforwardFamily_compatible _ _)
  intro Y f hf
  conv_lhs => rw [← hf.some.fac]
  dsimp
  

Proof state:
case w.h.a.w.h.h.h
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_6, u_2} D
E : Type u_3
inst✝³ : Category.{?u.129724, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_5, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'.val
X : Dᵒᵖ
U : Aᵒᵖ
a✝ : (yoneda.obj (ℱ.obj X)).obj U
Y : D
f : Y ⟶ X.unop
hf : (Sieve.coverByImage G X.unop).arrows f
⊢ (a✝ ≫ α.app X) ≫ ℱ'.val.map ((Nonempty.some hf).map.op ≫ (Nonempty.some hf).lift.op) =
    ((a✝ ≫ ℱ.map (Nonempty.some hf).map.op) ≫ α.app (op (G.obj (Nonempty.some hf).1))) ≫
      ℱ'.val.map (Nonempty.some hf).lift.op

Next tactic:
simp
/-- Given a full and cover-dense functor `G` and a natural transformation of sheaves `α : ℱ ⟶ ℱ'`,
if the pullback of `α` along `G` is iso, then `α` is also iso.
-/
theorem iso_of_restrict_iso {ℱ ℱ' : Sheaf K A} (α : ℱ ⟶ ℱ') (i : IsIso (whiskerLeft G.op α.val)) :
    IsIso α := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_5, u_2} D
E : Type u_3
inst✝³ : Category.{?u.139542, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_6, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ✝ : Dᵒᵖ ⥤ A
ℱ'✝ ℱ ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'
i : IsIso (whiskerLeft G.op α.val)
⊢ IsIso α

Next tactic:
convert IsIso.of_iso (sheafIso (asIso (whiskerLeft G.op α.val))) using 1
/-- Given a full and cover-dense functor `G` and a natural transformation of sheaves `α : ℱ ⟶ ℱ'`,
if the pullback of `α` along `G` is iso, then `α` is also iso.
-/
theorem iso_of_restrict_iso {ℱ ℱ' : Sheaf K A} (α : ℱ ⟶ ℱ') (i : IsIso (whiskerLeft G.op α.val)) :
    IsIso α := by
  convert IsIso.of_iso (sheafIso (asIso (whiskerLeft G.op α.val))) using 1
  

Proof state:
case h.e'_5
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_5, u_2} D
E : Type u_3
inst✝³ : Category.{?u.139542, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_6, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ✝ : Dᵒᵖ ⥤ A
ℱ'✝ ℱ ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'
i : IsIso (whiskerLeft G.op α.val)
⊢ α = (sheafIso (asIso (whiskerLeft G.op α.val))).hom

Next tactic:
ext1
/-- Given a full and cover-dense functor `G` and a natural transformation of sheaves `α : ℱ ⟶ ℱ'`,
if the pullback of `α` along `G` is iso, then `α` is also iso.
-/
theorem iso_of_restrict_iso {ℱ ℱ' : Sheaf K A} (α : ℱ ⟶ ℱ') (i : IsIso (whiskerLeft G.op α.val)) :
    IsIso α := by
  convert IsIso.of_iso (sheafIso (asIso (whiskerLeft G.op α.val))) using 1
  ext1
  

Proof state:
case h.e'_5.h
C : Type u_1
inst✝⁵ : Category.{u_7, u_1} C
D : Type u_2
inst✝⁴ : Category.{u_5, u_2} D
E : Type u_3
inst✝³ : Category.{?u.139542, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝² : Category.{u_6, u_4} A
G : C ⥤ D
inst✝¹ : IsCoverDense G K
inst✝ : Full G
ℱ✝ : Dᵒᵖ ⥤ A
ℱ'✝ ℱ ℱ' : Sheaf K A
α : ℱ ⟶ ℱ'
i : IsIso (whiskerLeft G.op α.val)
⊢ α.val = (sheafIso (asIso (whiskerLeft G.op α.val))).hom.val

Next tactic:
apply (sheafHom_eq _ _).symm
/-- A fully faithful cover-dense functor preserves compatible families. -/
lemma compatiblePreserving [Faithful G] : CompatiblePreserving K G := by
  

Proof state:
C : Type u_1
inst✝⁶ : Category.{u_5, u_1} C
D : Type u_2
inst✝⁵ : Category.{u_6, u_2} D
E : Type u_3
inst✝⁴ : Category.{?u.144116, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝³ : Category.{?u.144168, u_4} A
G : C ⥤ D
inst✝² : IsCoverDense G K
inst✝¹ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
inst✝ : Faithful G
⊢ CompatiblePreserving K G

Next tactic:
constructor
/-- A fully faithful cover-dense functor preserves compatible families. -/
lemma compatiblePreserving [Faithful G] : CompatiblePreserving K G := by
  constructor
  

Proof state:
case compatible
C : Type u_1
inst✝⁶ : Category.{u_5, u_1} C
D : Type u_2
inst✝⁵ : Category.{u_6, u_2} D
E : Type u_3
inst✝⁴ : Category.{?u.144116, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝³ : Category.{?u.144168, u_4} A
G : C ⥤ D
inst✝² : IsCoverDense G K
inst✝¹ : Full G
ℱ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
inst✝ : Faithful G
⊢ ∀ (ℱ : SheafOfTypes K) {Z : C} {T : Presieve Z} {x : FamilyOfElements (G.op ⋙ ℱ.val) T},
    FamilyOfElements.Compatible x →
      ∀ {Y₁ Y₂ : C} {X : D} (f₁ : X ⟶ G.obj Y₁) (f₂ : X ⟶ G.obj Y₂) {g₁ : Y₁ ⟶ Z} {g₂ : Y₂ ⟶ Z} (hg₁ : T g₁)
        (hg₂ : T g₂), f₁ ≫ G.map g₁ = f₂ ≫ G.map g₂ → ℱ.val.map f₁.op (x g₁ hg₁) = ℱ.val.map f₂.op (x g₂ hg₂)

Next tactic:
intro ℱ Z T x hx Y₁ Y₂ X f₁ f₂ g₁ g₂ hg₁ hg₂ eq
/-- A fully faithful cover-dense functor preserves compatible families. -/
lemma compatiblePreserving [Faithful G] : CompatiblePreserving K G := by
  constructor
  intro ℱ Z T x hx Y₁ Y₂ X f₁ f₂ g₁ g₂ hg₁ hg₂ eq
  

Proof state:
case compatible
C : Type u_1
inst✝⁶ : Category.{u_5, u_1} C
D : Type u_2
inst✝⁵ : Category.{u_6, u_2} D
E : Type u_3
inst✝⁴ : Category.{?u.144116, u_3} E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type u_4
inst✝³ : Category.{?u.144168, u_4} A
G : C ⥤ D
inst✝² : IsCoverDense G K
inst✝¹ : Full G
ℱ✝ : Dᵒᵖ ⥤ A
ℱ' : Sheaf K A
inst✝ : Faithful G
ℱ : SheafOfTypes K
Z : C
T : Presieve Z
x : FamilyOfElements (G.op ⋙ ℱ.val) T
hx : FamilyOfElements.Compatible x
Y₁ Y₂ : C
X : D
f₁ : X ⟶ G.obj Y₁
f₂ : X ⟶ G.obj Y₂
g₁ : Y₁ ⟶ Z
g₂ : Y₂ ⟶ Z
hg₁ : T g₁
hg₂ : T g₂
eq : f₁ ≫ G.map g₁ = f₂ ≫ G.map g₂
⊢ ℱ.val.map f₁.op (x g₁ hg₁) = ℱ.val.map f₂.op (x g₂ hg₂)

Next tactic:
apply Functor.IsCoverDense.ext G