Lean4
/-- Given a natural isomorphism `G ⋙ ℱ ≅ G ⋙ ℱ'` between presheaves of arbitrary category,
where `G` is locally-full and cover-dense, and `ℱ', ℱ` are sheaves,
we may obtain a natural isomorphism between presheaves.
-/
@[simps!]
noncomputable def presheafIso {ℱ ℱ' : Sheaf K A} (i : G.op ⋙ ℱ.val ≅ G.op ⋙ ℱ'.val) : ℱ.val ≅ ℱ'.val :=
by
have : ∀ X : Dᵒᵖ, IsIso ((sheafHom i.hom).app X) := by
intro X
rw [← isIso_iff_of_reflects_iso _ yoneda]
use (sheafYonedaHom i.inv).app X
constructor <;> ext x : 2 <;> simp only [sheafHom, NatTrans.comp_app, NatTrans.id_app, Functor.map_preimage]
· exact ((Types.presheafIso (isoOver i (unop x))).app X).hom_inv_id
· exact ((Types.presheafIso (isoOver i (unop x))).app X).inv_hom_id
haveI : IsIso (sheafHom i.hom) := by apply NatIso.isIso_of_isIso_app
apply asIso (sheafHom i.hom)