l3lab/ntp-mathlib huggingface dataset:
/-- The unit in `Presheaf.stalkFunctor ⊣ skyscraperPresheafFunctor`
-/
@[simps]
protected def unit : 𝟭 (Presheaf C X) ⟶ Presheaf.stalkFunctor C p₀ ⋙ skyscraperPresheafFunctor p₀
    where
  app 𝓕 := toSkyscraperPresheaf _ <| 𝟙 _
  naturality 𝓕 𝓖 f := by
    ext U; dsimp
    -- Porting note : added the following `rw` and `dsimp` to make it compile
    rw [NatTrans.comp_app, toSkyscraperPresheaf_app, NatTrans.comp_app, toSkyscraperPresheaf_app]
    dsimp only [skyscraperPresheaf_obj, unop_op, Eq.ndrec, SkyscraperPresheafFunctor.map'_app]
    split_ifs with h
    · simp only [Category.id_comp, ← Category.assoc]; rw [comp_eqToHom_iff]
      

Proof state:
case pos
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 𝓖 : Presheaf C X
f : 𝓕 ⟶ 𝓖
U : Opens ↑X
h : p₀ ∈ U
⊢ f.app (op U) ≫ Presheaf.germ 𝓖 { val := p₀, property := h } =
    ((((Presheaf.germ 𝓕 { val := p₀, property := h } ≫
              eqToHom (_ : Presheaf.stalk 𝓕 p₀ = if p₀ ∈ (op U).unop then Presheaf.stalk 𝓕 p₀ else ⊤_ C)) ≫
            eqToHom (_ : (if p₀ ∈ (op U).unop then Presheaf.stalk 𝓕 p₀ else ⊤_ C) = Presheaf.stalk 𝓕 p₀)) ≫
          (Presheaf.stalkFunctor C p₀).map f) ≫
        eqToHom (_ : Presheaf.stalk 𝓖 p₀ = if p₀ ∈ (op U).unop then Presheaf.stalk 𝓖 p₀ else ⊤_ C)) ≫
      eqToHom (_ : (if p₀ ∈ U then Presheaf.stalk 𝓖 p₀ else ⊤_ C) = Presheaf.stalk 𝓖 p₀)

Next tactic:
simp only [Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id]
/-- The unit in `Presheaf.stalkFunctor ⊣ skyscraperPresheafFunctor`
-/
@[simps]
protected def unit : 𝟭 (Presheaf C X) ⟶ Presheaf.stalkFunctor C p₀ ⋙ skyscraperPresheafFunctor p₀
    where
  app 𝓕 := toSkyscraperPresheaf _ <| 𝟙 _
  naturality 𝓕 𝓖 f := by
    ext U; dsimp
    -- Porting note : added the following `rw` and `dsimp` to make it compile
    rw [NatTrans.comp_app, toSkyscraperPresheaf_app, NatTrans.comp_app, toSkyscraperPresheaf_app]
    dsimp only [skyscraperPresheaf_obj, unop_op, Eq.ndrec, SkyscraperPresheafFunctor.map'_app]
    split_ifs with h
    · simp only [Category.id_comp, ← Category.assoc]; rw [comp_eqToHom_iff]
      simp only [Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id]
      

Proof state:
case pos
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 𝓖 : Presheaf C X
f : 𝓕 ⟶ 𝓖
U : Opens ↑X
h : p₀ ∈ U
⊢ f.app (op U) ≫ Presheaf.germ 𝓖 { val := p₀, property := h } =
    Presheaf.germ 𝓕 { val := p₀, property := h } ≫ (Presheaf.stalkFunctor C p₀).map f

Next tactic:
erw [colimit.ι_map]
/-- The unit in `Presheaf.stalkFunctor ⊣ skyscraperPresheafFunctor`
-/
@[simps]
protected def unit : 𝟭 (Presheaf C X) ⟶ Presheaf.stalkFunctor C p₀ ⋙ skyscraperPresheafFunctor p₀
    where
  app 𝓕 := toSkyscraperPresheaf _ <| 𝟙 _
  naturality 𝓕 𝓖 f := by
    ext U; dsimp
    -- Porting note : added the following `rw` and `dsimp` to make it compile
    rw [NatTrans.comp_app, toSkyscraperPresheaf_app, NatTrans.comp_app, toSkyscraperPresheaf_app]
    dsimp only [skyscraperPresheaf_obj, unop_op, Eq.ndrec, SkyscraperPresheafFunctor.map'_app]
    split_ifs with h
    · simp only [Category.id_comp, ← Category.assoc]; rw [comp_eqToHom_iff]
      simp only [Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id]
      erw [colimit.ι_map]; 

Proof state:
case pos
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 𝓖 : Presheaf C X
f : 𝓕 ⟶ 𝓖
U : Opens ↑X
h : p₀ ∈ U
⊢ f.app (op U) ≫ Presheaf.germ 𝓖 { val := p₀, property := h } =
    (((whiskeringLeft (OpenNhds p₀)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion p₀).op).map f).app
        (op { obj := U, property := (_ : ↑{ val := p₀, property := h } ∈ U) }) ≫
      colimit.ι (((whiskeringLeft (OpenNhds p₀)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion p₀).op).obj 𝓖)
        (op { obj := U, property := (_ : ↑{ val := p₀, property := h } ∈ U) })

Next tactic:
rfl
/-- The unit in `Presheaf.stalkFunctor ⊣ skyscraperPresheafFunctor`
-/
@[simps]
protected def unit : 𝟭 (Presheaf C X) ⟶ Presheaf.stalkFunctor C p₀ ⋙ skyscraperPresheafFunctor p₀
    where
  app 𝓕 := toSkyscraperPresheaf _ <| 𝟙 _
  naturality 𝓕 𝓖 f := by
    ext U; dsimp
    -- Porting note : added the following `rw` and `dsimp` to make it compile
    rw [NatTrans.comp_app, toSkyscraperPresheaf_app, NatTrans.comp_app, toSkyscraperPresheaf_app]
    dsimp only [skyscraperPresheaf_obj, unop_op, Eq.ndrec, SkyscraperPresheafFunctor.map'_app]
    split_ifs with h
    · simp only [Category.id_comp, ← Category.assoc]; rw [comp_eqToHom_iff]
      simp only [Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id]
      erw [colimit.ι_map]; rfl
    · 

Proof state:
case neg
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 𝓖 : Presheaf C X
f : 𝓕 ⟶ 𝓖
U : Opens ↑X
h : p₀ ∉ U
⊢ f.app (op U) ≫
      IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then Presheaf.stalk 𝓖 p₀ else ⊤_ C) ▸ terminalIsTerminal)
        (𝓖.obj (op U)) =
    IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then Presheaf.stalk 𝓕 p₀ else ⊤_ C) ▸ terminalIsTerminal)
        (𝓕.obj (op U)) ≫
      IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then Presheaf.stalk 𝓖 p₀ else ⊤_ C) ▸ terminalIsTerminal)
        (if p₀ ∈ U then Presheaf.stalk 𝓕 p₀ else ⊤_ C)

Next tactic:
apply ((if_neg h).symm.ndrec terminalIsTerminal).hom_ext
/-- The counit in `Presheaf.stalkFunctor ⊣ skyscraperPresheafFunctor`
-/
@[simps]
protected def counit :
    skyscraperPresheafFunctor p₀ ⋙ (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⟶ 𝟭 C where
  app c := (skyscraperPresheafStalkOfSpecializes p₀ c specializes_rfl).hom
  naturality x y f := colimit.hom_ext fun U => by
    

Proof state:
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
x y : C
f : x ⟶ y
U : (OpenNhds p₀)ᵒᵖ
⊢ colimit.ι
        (((whiskeringLeft (OpenNhds p₀)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion p₀).op).obj
          ((skyscraperPresheafFunctor p₀).obj x))
        U ≫
      (skyscraperPresheafFunctor p₀ ⋙ Presheaf.stalkFunctor C p₀).map f ≫
        (fun c => (skyscraperPresheafStalkOfSpecializes p₀ c (_ : p₀ ⤳ p₀)).hom) y =
    colimit.ι
        (((whiskeringLeft (OpenNhds p₀)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion p₀).op).obj
          ((skyscraperPresheafFunctor p₀).obj x))
        U ≫
      (fun c => (skyscraperPresheafStalkOfSpecializes p₀ c (_ : p₀ ⤳ p₀)).hom) x ≫ (𝟭 C).map f

Next tactic:
erw [← Category.assoc, colimit.ι_map, colimit.isoColimitCocone_ι_hom_assoc,
      skyscraperPresheafCoconeOfSpecializes_ι_app (h := specializes_rfl), Category.assoc,
      colimit.ι_desc, whiskeringLeft_obj_map, whiskerLeft_app, SkyscraperPresheafFunctor.map'_app,
      dif_pos U.unop.2, skyscraperPresheafCoconeOfSpecializes_ι_app (h := specializes_rfl),
      comp_eqToHom_iff, Category.assoc, eqToHom_comp_iff, ← Category.assoc, eqToHom_trans,
      eqToHom_refl, Category.id_comp, comp_eqToHom_iff, Category.assoc, eqToHom_trans, eqToHom_refl,
      Category.comp_id, CategoryTheory.Functor.id_map]
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    

Proof state:
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : (Presheaf.stalkFunctor C p₀).obj 𝓕 ⟶ c
⊢ ((fun c 𝓕 =>
          { toFun := toSkyscraperPresheaf p₀, invFun := fromStalk p₀,
            left_inv := (_ : ∀ (f : Presheaf.stalk c p₀ ⟶ 𝓕), fromStalk p₀ (toSkyscraperPresheaf p₀ f) = f),
            right_inv := (_ : ∀ (f : c ⟶ skyscraperPresheaf p₀ 𝓕), toSkyscraperPresheaf p₀ (fromStalk p₀ f) = f) })
        𝓕 c)
      α =
    (StalkSkyscraperPresheafAdjunctionAuxs.unit p₀).app 𝓕 ≫ (skyscraperPresheafFunctor p₀).map α

Next tactic:
ext U
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    ext U;
    -- Porting note : `NatTrans.comp_app` is not picked up by `simp`
    

Proof state:
case w
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : (Presheaf.stalkFunctor C p₀).obj 𝓕 ⟶ c
U : Opens ↑X
⊢ (((fun c 𝓕 =>
              { toFun := toSkyscraperPresheaf p₀, invFun := fromStalk p₀,
                left_inv := (_ : ∀ (f : Presheaf.stalk c p₀ ⟶ 𝓕), fromStalk p₀ (toSkyscraperPresheaf p₀ f) = f),
                right_inv := (_ : ∀ (f : c ⟶ skyscraperPresheaf p₀ 𝓕), toSkyscraperPresheaf p₀ (fromStalk p₀ f) = f) })
            𝓕 c)
          α).app
      (op U) =
    ((StalkSkyscraperPresheafAdjunctionAuxs.unit p₀).app 𝓕 ≫ (skyscraperPresheafFunctor p₀).map α).app (op U)

Next tactic:
rw [NatTrans.comp_app]
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    ext U;
    -- Porting note : `NatTrans.comp_app` is not picked up by `simp`
    rw [NatTrans.comp_app]
    

Proof state:
case w
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : (Presheaf.stalkFunctor C p₀).obj 𝓕 ⟶ c
U : Opens ↑X
⊢ (((fun c 𝓕 =>
              { toFun := toSkyscraperPresheaf p₀, invFun := fromStalk p₀,
                left_inv := (_ : ∀ (f : Presheaf.stalk c p₀ ⟶ 𝓕), fromStalk p₀ (toSkyscraperPresheaf p₀ f) = f),
                right_inv := (_ : ∀ (f : c ⟶ skyscraperPresheaf p₀ 𝓕), toSkyscraperPresheaf p₀ (fromStalk p₀ f) = f) })
            𝓕 c)
          α).app
      (op U) =
    ((StalkSkyscraperPresheafAdjunctionAuxs.unit p₀).app 𝓕).app (op U) ≫
      ((skyscraperPresheafFunctor p₀).map α).app (op U)

Next tactic:
simp only [Equiv.coe_fn_mk, toSkyscraperPresheaf_app, SkyscraperPresheafFunctor.map'_app,
      skyscraperPresheafFunctor_map, unit_app]
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    ext U;
    -- Porting note : `NatTrans.comp_app` is not picked up by `simp`
    rw [NatTrans.comp_app]
    simp only [Equiv.coe_fn_mk, toSkyscraperPresheaf_app, SkyscraperPresheafFunctor.map'_app,
      skyscraperPresheafFunctor_map, unit_app]
    

Proof state:
case w
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : (Presheaf.stalkFunctor C p₀).obj 𝓕 ⟶ c
U : Opens ↑X
⊢ (if h : p₀ ∈ (op U).unop then
      Presheaf.germ 𝓕 { val := p₀, property := (_ : p₀ ∈ (op U).unop) } ≫
        α ≫ eqToHom (_ : c = if p₀ ∈ (op U).unop then c else ⊤_ C)
    else IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then c else ⊤_ C) ▸ terminalIsTerminal) (𝓕.obj (op U))) =
    (if h : p₀ ∈ (op U).unop then
        Presheaf.germ 𝓕 { val := p₀, property := (_ : p₀ ∈ (op U).unop) } ≫
          𝟙 (Presheaf.stalk ((𝟭 (Presheaf C X)).obj 𝓕) p₀) ≫
            eqToHom
              (_ :
                (Presheaf.stalkFunctor C p₀).obj 𝓕 =
                  if p₀ ∈ (op U).unop then (Presheaf.stalkFunctor C p₀).obj 𝓕 else ⊤_ C)
      else
        IsTerminal.from
          ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then (Presheaf.stalkFunctor C p₀).obj 𝓕 else ⊤_ C) ▸ terminalIsTerminal)
          (𝓕.obj (op U))) ≫
      if h : p₀ ∈ (op U).unop then
        eqToHom
            (_ :
              (if p₀ ∈ (op U).unop then (Presheaf.stalkFunctor C p₀).obj 𝓕 else ⊤_ C) =
                (Presheaf.stalkFunctor C p₀).obj 𝓕) ≫
          α ≫ eqToHom (_ : c = if p₀ ∈ (op U).unop then c else ⊤_ C)
      else
        IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then c else ⊤_ C) ▸ terminalIsTerminal)
          ((skyscraperPresheaf p₀ ((Presheaf.stalkFunctor C p₀).obj 𝓕)).obj (op U))

Next tactic:
split_ifs with h
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    ext U;
    -- Porting note : `NatTrans.comp_app` is not picked up by `simp`
    rw [NatTrans.comp_app]
    simp only [Equiv.coe_fn_mk, toSkyscraperPresheaf_app, SkyscraperPresheafFunctor.map'_app,
      skyscraperPresheafFunctor_map, unit_app]
    split_ifs with h
    · 

Proof state:
case pos
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : (Presheaf.stalkFunctor C p₀).obj 𝓕 ⟶ c
U : Opens ↑X
h : p₀ ∈ (op U).unop
⊢ Presheaf.germ 𝓕 { val := p₀, property := (_ : p₀ ∈ (op U).unop) } ≫
      α ≫ eqToHom (_ : c = if p₀ ∈ (op U).unop then c else ⊤_ C) =
    (Presheaf.germ 𝓕 { val := p₀, property := (_ : p₀ ∈ (op U).unop) } ≫
        𝟙 (Presheaf.stalk ((𝟭 (Presheaf C X)).obj 𝓕) p₀) ≫
          eqToHom
            (_ :
              (Presheaf.stalkFunctor C p₀).obj 𝓕 =
                if p₀ ∈ (op U).unop then (Presheaf.stalkFunctor C p₀).obj 𝓕 else ⊤_ C)) ≫
      eqToHom
          (_ :
            (if p₀ ∈ (op U).unop then (Presheaf.stalkFunctor C p₀).obj 𝓕 else ⊤_ C) =
              (Presheaf.stalkFunctor C p₀).obj 𝓕) ≫
        α ≫ eqToHom (_ : c = if p₀ ∈ (op U).unop then c else ⊤_ C)

Next tactic:
erw [Category.id_comp, ← Category.assoc, comp_eqToHom_iff, Category.assoc, Category.assoc,
        Category.assoc, Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id, ←
        Category.assoc _ _ α, eqToHom_trans, eqToHom_refl, Category.id_comp]
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    ext U;
    -- Porting note : `NatTrans.comp_app` is not picked up by `simp`
    rw [NatTrans.comp_app]
    simp only [Equiv.coe_fn_mk, toSkyscraperPresheaf_app, SkyscraperPresheafFunctor.map'_app,
      skyscraperPresheafFunctor_map, unit_app]
    split_ifs with h
    · erw [Category.id_comp, ← Category.assoc, comp_eqToHom_iff, Category.assoc, Category.assoc,
        Category.assoc, Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id, ←
        Category.assoc _ _ α, eqToHom_trans, eqToHom_refl, Category.id_comp]
    · 

Proof state:
case neg
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : (Presheaf.stalkFunctor C p₀).obj 𝓕 ⟶ c
U : Opens ↑X
h : p₀ ∉ (op U).unop
⊢ IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then c else ⊤_ C) ▸ terminalIsTerminal) (𝓕.obj (op U)) =
    IsTerminal.from
        ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then (Presheaf.stalkFunctor C p₀).obj 𝓕 else ⊤_ C) ▸ terminalIsTerminal)
        (𝓕.obj (op U)) ≫
      IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then c else ⊤_ C) ▸ terminalIsTerminal)
        ((skyscraperPresheaf p₀ ((Presheaf.stalkFunctor C p₀).obj 𝓕)).obj (op U))

Next tactic:
apply ((if_neg h).symm.ndrec terminalIsTerminal).hom_ext
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    ext U;
    -- Porting note : `NatTrans.comp_app` is not picked up by `simp`
    rw [NatTrans.comp_app]
    simp only [Equiv.coe_fn_mk, toSkyscraperPresheaf_app, SkyscraperPresheafFunctor.map'_app,
      skyscraperPresheafFunctor_map, unit_app]
    split_ifs with h
    · erw [Category.id_comp, ← Category.assoc, comp_eqToHom_iff, Category.assoc, Category.assoc,
        Category.assoc, Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id, ←
        Category.assoc _ _ α, eqToHom_trans, eqToHom_refl, Category.id_comp]
    · apply ((if_neg h).symm.ndrec terminalIsTerminal).hom_ext
  homEquiv_counit {𝓕} c α := by
    -- Porting note : added a `dsimp`
    

Proof state:
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : 𝓕 ⟶ (skyscraperPresheafFunctor p₀).obj c
⊢ ((fun c 𝓕 =>
            { toFun := toSkyscraperPresheaf p₀, invFun := fromStalk p₀,
              left_inv := (_ : ∀ (f : Presheaf.stalk c p₀ ⟶ 𝓕), fromStalk p₀ (toSkyscraperPresheaf p₀ f) = f),
              right_inv := (_ : ∀ (f : c ⟶ skyscraperPresheaf p₀ 𝓕), toSkyscraperPresheaf p₀ (fromStalk p₀ f) = f) })
          𝓕 c).symm
      α =
    (Presheaf.stalkFunctor C p₀).map α ≫ (StalkSkyscraperPresheafAdjunctionAuxs.counit p₀).app c

Next tactic:
dsimp
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    ext U;
    -- Porting note : `NatTrans.comp_app` is not picked up by `simp`
    rw [NatTrans.comp_app]
    simp only [Equiv.coe_fn_mk, toSkyscraperPresheaf_app, SkyscraperPresheafFunctor.map'_app,
      skyscraperPresheafFunctor_map, unit_app]
    split_ifs with h
    · erw [Category.id_comp, ← Category.assoc, comp_eqToHom_iff, Category.assoc, Category.assoc,
        Category.assoc, Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id, ←
        Category.assoc _ _ α, eqToHom_trans, eqToHom_refl, Category.id_comp]
    · apply ((if_neg h).symm.ndrec terminalIsTerminal).hom_ext
  homEquiv_counit {𝓕} c α := by
    -- Porting note : added a `dsimp`
    dsimp; 

Proof state:
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : 𝓕 ⟶ (skyscraperPresheafFunctor p₀).obj c
⊢ fromStalk p₀ α = (Presheaf.stalkFunctor C p₀).map α ≫ (skyscraperPresheafStalkOfSpecializes p₀ c (_ : p₀ ⤳ p₀)).hom

Next tactic:
ext U
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    ext U;
    -- Porting note : `NatTrans.comp_app` is not picked up by `simp`
    rw [NatTrans.comp_app]
    simp only [Equiv.coe_fn_mk, toSkyscraperPresheaf_app, SkyscraperPresheafFunctor.map'_app,
      skyscraperPresheafFunctor_map, unit_app]
    split_ifs with h
    · erw [Category.id_comp, ← Category.assoc, comp_eqToHom_iff, Category.assoc, Category.assoc,
        Category.assoc, Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id, ←
        Category.assoc _ _ α, eqToHom_trans, eqToHom_refl, Category.id_comp]
    · apply ((if_neg h).symm.ndrec terminalIsTerminal).hom_ext
  homEquiv_counit {𝓕} c α := by
    -- Porting note : added a `dsimp`
    dsimp; ext U; 

Proof state:
case ih
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : 𝓕 ⟶ (skyscraperPresheafFunctor p₀).obj c
U : Opens ↑X
hxU✝ : p₀ ∈ U
⊢ Presheaf.germ 𝓕 { val := p₀, property := hxU✝ } ≫ fromStalk p₀ α =
    Presheaf.germ 𝓕 { val := p₀, property := hxU✝ } ≫
      (Presheaf.stalkFunctor C p₀).map α ≫ (skyscraperPresheafStalkOfSpecializes p₀ c (_ : p₀ ⤳ p₀)).hom

Next tactic:
simp only [Equiv.coe_fn_symm_mk, counit_app]