l3lab/ntp-mathlib huggingface dataset:
/-- Taking skyscraper presheaf at a point is functorial: `c ↦ skyscraper p₀ c` defines a functor by
sending every `f : a ⟶ b` to the natural transformation `α` defined as: `α(U) = f : a ⟶ b` if
`p₀ ∈ U` and the unique morphism to a terminal object in `C` if `p₀ ∉ U`.
-/
@[simps]
def SkyscraperPresheafFunctor.map' {a b : C} (f : a ⟶ b) :
    skyscraperPresheaf p₀ a ⟶ skyscraperPresheaf p₀ b where
  app U :=
    if h : p₀ ∈ U.unop then eqToHom (if_pos h) ≫ f ≫ eqToHom (if_pos h).symm
    else ((if_neg h).symm.ndrec terminalIsTerminal).from _
  naturality U V i := by
    simp only [skyscraperPresheaf_map]; by_cases hV : p₀ ∈ V.unop
    · have hU : p₀ ∈ U.unop := leOfHom i.unop hV; split_ifs <;>
      

Proof state:
case pos
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a b : C
f : a ⟶ b
U V : (Opens ↑X)ᵒᵖ
i : U ⟶ V
hV : p₀ ∈ V.unop
hU : p₀ ∈ U.unop
h✝ : p₀ ∈ V.unop
⊢ eqToHom (_ : (fun U => if p₀ ∈ U.unop then a else ⊤_ C) U = (fun U => if p₀ ∈ U.unop then a else ⊤_ C) V) ≫
      eqToHom (_ : (if p₀ ∈ V.unop then a else ⊤_ C) = a) ≫ f ≫ eqToHom (_ : b = if p₀ ∈ V.unop then b else ⊤_ C) =
    (eqToHom (_ : (if p₀ ∈ U.unop then a else ⊤_ C) = a) ≫ f ≫ eqToHom (_ : b = if p₀ ∈ U.unop then b else ⊤_ C)) ≫
      eqToHom (_ : (fun U => if p₀ ∈ U.unop then b else ⊤_ C) U = (fun U => if p₀ ∈ U.unop then b else ⊤_ C) V)

Next tactic:
simp only [eqToHom_trans_assoc, Category.assoc, eqToHom_trans]
/-- Taking skyscraper presheaf at a point is functorial: `c ↦ skyscraper p₀ c` defines a functor by
sending every `f : a ⟶ b` to the natural transformation `α` defined as: `α(U) = f : a ⟶ b` if
`p₀ ∈ U` and the unique morphism to a terminal object in `C` if `p₀ ∉ U`.
-/
@[simps]
def SkyscraperPresheafFunctor.map' {a b : C} (f : a ⟶ b) :
    skyscraperPresheaf p₀ a ⟶ skyscraperPresheaf p₀ b where
  app U :=
    if h : p₀ ∈ U.unop then eqToHom (if_pos h) ≫ f ≫ eqToHom (if_pos h).symm
    else ((if_neg h).symm.ndrec terminalIsTerminal).from _
  naturality U V i := by
    simp only [skyscraperPresheaf_map]; by_cases hV : p₀ ∈ V.unop
    · have hU : p₀ ∈ U.unop := leOfHom i.unop hV; split_ifs <;>
      

Proof state:
case neg
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a b : C
f : a ⟶ b
U V : (Opens ↑X)ᵒᵖ
i : U ⟶ V
hV : p₀ ∈ V.unop
hU : p₀ ∈ U.unop
h✝ : p₀ ∉ V.unop
⊢ eqToHom (_ : (fun U => if p₀ ∈ U.unop then a else ⊤_ C) U = (fun U => if p₀ ∈ U.unop then a else ⊤_ C) V) ≫
      eqToHom (_ : (if p₀ ∈ V.unop then a else ⊤_ C) = a) ≫ f ≫ eqToHom (_ : b = if p₀ ∈ V.unop then b else ⊤_ C) =
    (eqToHom (_ : (if p₀ ∈ U.unop then a else ⊤_ C) = a) ≫ f ≫ eqToHom (_ : b = if p₀ ∈ U.unop then b else ⊤_ C)) ≫
      eqToHom (_ : (fun U => if p₀ ∈ U.unop then b else ⊤_ C) U = (fun U => if p₀ ∈ U.unop then b else ⊤_ C) V)

Next tactic:
simp only [eqToHom_trans_assoc, Category.assoc, eqToHom_trans]
/-- Taking skyscraper presheaf at a point is functorial: `c ↦ skyscraper p₀ c` defines a functor by
sending every `f : a ⟶ b` to the natural transformation `α` defined as: `α(U) = f : a ⟶ b` if
`p₀ ∈ U` and the unique morphism to a terminal object in `C` if `p₀ ∉ U`.
-/
@[simps]
def SkyscraperPresheafFunctor.map' {a b : C} (f : a ⟶ b) :
    skyscraperPresheaf p₀ a ⟶ skyscraperPresheaf p₀ b where
  app U :=
    if h : p₀ ∈ U.unop then eqToHom (if_pos h) ≫ f ≫ eqToHom (if_pos h).symm
    else ((if_neg h).symm.ndrec terminalIsTerminal).from _
  naturality U V i := by
    simp only [skyscraperPresheaf_map]; by_cases hV : p₀ ∈ V.unop
    · have hU : p₀ ∈ U.unop := leOfHom i.unop hV; split_ifs <;>
      simp only [eqToHom_trans_assoc, Category.assoc, eqToHom_trans]
    · 

Proof state:
case neg
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a b : C
f : a ⟶ b
U V : (Opens ↑X)ᵒᵖ
i : U ⟶ V
hV : p₀ ∉ V.unop
⊢ ((if h : p₀ ∈ V.unop then
        eqToHom (_ : (fun U => if p₀ ∈ U.unop then a else ⊤_ C) U = (fun U => if p₀ ∈ U.unop then a else ⊤_ C) V)
      else
        IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ V.unop then a else ⊤_ C) ▸ terminalIsTerminal)
          (if p₀ ∈ U.unop then a else ⊤_ C)) ≫
      if h : p₀ ∈ V.unop then
        eqToHom (_ : (if p₀ ∈ V.unop then a else ⊤_ C) = a) ≫ f ≫ eqToHom (_ : b = if p₀ ∈ V.unop then b else ⊤_ C)
      else
        IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ V.unop then b else ⊤_ C) ▸ terminalIsTerminal)
          ((skyscraperPresheaf p₀ a).obj V)) =
    (if h : p₀ ∈ U.unop then
        eqToHom (_ : (if p₀ ∈ U.unop then a else ⊤_ C) = a) ≫ f ≫ eqToHom (_ : b = if p₀ ∈ U.unop then b else ⊤_ C)
      else
        IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ U.unop then b else ⊤_ C) ▸ terminalIsTerminal)
          ((skyscraperPresheaf p₀ a).obj U)) ≫
      if h : p₀ ∈ V.unop then
        eqToHom (_ : (fun U => if p₀ ∈ U.unop then b else ⊤_ C) U = (fun U => if p₀ ∈ U.unop then b else ⊤_ C) V)
      else
        IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ V.unop then b else ⊤_ C) ▸ terminalIsTerminal)
          (if p₀ ∈ U.unop then b else ⊤_ C)

Next tactic:
apply ((if_neg hV).symm.ndrec terminalIsTerminal).hom_ext
theorem SkyscraperPresheafFunctor.map'_id {a : C} :
    SkyscraperPresheafFunctor.map' p₀ (𝟙 a) = 𝟙 _ := by
  

Proof state:
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a : C
⊢ map' p₀ (𝟙 a) = 𝟙 (skyscraperPresheaf p₀ a)

Next tactic:
ext U
theorem SkyscraperPresheafFunctor.map'_id {a : C} :
    SkyscraperPresheafFunctor.map' p₀ (𝟙 a) = 𝟙 _ := by
  ext U
  

Proof state:
case w
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a : C
U : Opens ↑X
⊢ (map' p₀ (𝟙 a)).app (op U) = (𝟙 (skyscraperPresheaf p₀ a)).app (op U)

Next tactic:
simp only [SkyscraperPresheafFunctor.map'_app, NatTrans.id_app]
theorem SkyscraperPresheafFunctor.map'_id {a : C} :
    SkyscraperPresheafFunctor.map' p₀ (𝟙 a) = 𝟙 _ := by
  ext U
  simp only [SkyscraperPresheafFunctor.map'_app, NatTrans.id_app]; 

Proof state:
case w
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a : C
U : Opens ↑X
⊢ (if h : p₀ ∈ (op U).unop then
      eqToHom (_ : (if p₀ ∈ (op U).unop then a else ⊤_ C) = a) ≫
        𝟙 a ≫ eqToHom (_ : a = if p₀ ∈ (op U).unop then a else ⊤_ C)
    else
      IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then a else ⊤_ C) ▸ terminalIsTerminal)
        ((skyscraperPresheaf p₀ a).obj (op U))) =
    (𝟙 (skyscraperPresheaf p₀ a)).app (op U)

Next tactic:
split_ifs
theorem SkyscraperPresheafFunctor.map'_id {a : C} :
    SkyscraperPresheafFunctor.map' p₀ (𝟙 a) = 𝟙 _ := by
  ext U
  simp only [SkyscraperPresheafFunctor.map'_app, NatTrans.id_app]; split_ifs <;> 

Proof state:
case pos
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a : C
U : Opens ↑X
h✝ : p₀ ∈ (op U).unop
⊢ eqToHom (_ : (if p₀ ∈ (op U).unop then a else ⊤_ C) = a) ≫
      𝟙 a ≫ eqToHom (_ : a = if p₀ ∈ (op U).unop then a else ⊤_ C) =
    (𝟙 (skyscraperPresheaf p₀ a)).app (op U)

Next tactic:
aesop_cat
theorem SkyscraperPresheafFunctor.map'_id {a : C} :
    SkyscraperPresheafFunctor.map' p₀ (𝟙 a) = 𝟙 _ := by
  ext U
  simp only [SkyscraperPresheafFunctor.map'_app, NatTrans.id_app]; split_ifs <;> 

Proof state:
case neg
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a : C
U : Opens ↑X
h✝ : p₀ ∉ (op U).unop
⊢ IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then a else ⊤_ C) ▸ terminalIsTerminal)
      ((skyscraperPresheaf p₀ a).obj (op U)) =
    (𝟙 (skyscraperPresheaf p₀ a)).app (op U)

Next tactic:
aesop_cat
theorem SkyscraperPresheafFunctor.map'_comp {a b c : C} (f : a ⟶ b) (g : b ⟶ c) :
    SkyscraperPresheafFunctor.map' p₀ (f ≫ g) =
      SkyscraperPresheafFunctor.map' p₀ f ≫ SkyscraperPresheafFunctor.map' p₀ g := by
  

Proof state:
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a b c : C
f : a ⟶ b
g : b ⟶ c
⊢ map' p₀ (f ≫ g) = map' p₀ f ≫ map' p₀ g

Next tactic:
ext U
theorem SkyscraperPresheafFunctor.map'_comp {a b c : C} (f : a ⟶ b) (g : b ⟶ c) :
    SkyscraperPresheafFunctor.map' p₀ (f ≫ g) =
      SkyscraperPresheafFunctor.map' p₀ f ≫ SkyscraperPresheafFunctor.map' p₀ g := by
  ext U
  -- Porting note : change `simp` to `rw`
  

Proof state:
case w
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a b c : C
f : a ⟶ b
g : b ⟶ c
U : Opens ↑X
⊢ (map' p₀ (f ≫ g)).app (op U) = (map' p₀ f ≫ map' p₀ g).app (op U)

Next tactic:
rw [NatTrans.comp_app]
theorem SkyscraperPresheafFunctor.map'_comp {a b c : C} (f : a ⟶ b) (g : b ⟶ c) :
    SkyscraperPresheafFunctor.map' p₀ (f ≫ g) =
      SkyscraperPresheafFunctor.map' p₀ f ≫ SkyscraperPresheafFunctor.map' p₀ g := by
  ext U
  -- Porting note : change `simp` to `rw`
  rw [NatTrans.comp_app]
  

Proof state:
case w
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a b c : C
f : a ⟶ b
g : b ⟶ c
U : Opens ↑X
⊢ (map' p₀ (f ≫ g)).app (op U) = (map' p₀ f).app (op U) ≫ (map' p₀ g).app (op U)

Next tactic:
simp only [SkyscraperPresheafFunctor.map'_app]
theorem SkyscraperPresheafFunctor.map'_comp {a b c : C} (f : a ⟶ b) (g : b ⟶ c) :
    SkyscraperPresheafFunctor.map' p₀ (f ≫ g) =
      SkyscraperPresheafFunctor.map' p₀ f ≫ SkyscraperPresheafFunctor.map' p₀ g := by
  ext U
  -- Porting note : change `simp` to `rw`
  rw [NatTrans.comp_app]
  simp only [SkyscraperPresheafFunctor.map'_app]
  

Proof state:
case w
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{w, v} C
inst✝ : HasTerminal C
A a b c : C
f : a ⟶ b
g : b ⟶ c
U : Opens ↑X
⊢ (if h : p₀ ∈ (op U).unop then
      eqToHom (_ : (if p₀ ∈ (op U).unop then a else ⊤_ C) = a) ≫
        (f ≫ g) ≫ 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₀ a).obj (op U))) =
    (if h : p₀ ∈ (op U).unop then
        eqToHom (_ : (if p₀ ∈ (op U).unop then a else ⊤_ C) = a) ≫
          f ≫ eqToHom (_ : b = if p₀ ∈ (op U).unop then b else ⊤_ C)
      else
        IsTerminal.from ((_ : (⊤_ C) = if p₀ ∈ (op U).unop then b else ⊤_ C) ▸ terminalIsTerminal)
          ((skyscraperPresheaf p₀ a).obj (op U))) ≫
      if h : p₀ ∈ (op U).unop then
        eqToHom (_ : (if p₀ ∈ (op U).unop then b else ⊤_ C) = b) ≫
          g ≫ 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₀ b).obj (op U))

Next tactic:
split_ifs with h
theorem SkyscraperPresheafFunctor.map'_comp {a b c : C} (f : a ⟶ b) (g : b ⟶ c) :
    SkyscraperPresheafFunctor.map' p₀ (f ≫ g) =
      SkyscraperPresheafFunctor.map' p₀ f ≫ SkyscraperPresheafFunctor.map' p₀ g := by
  ext U
  -- Porting note : change `simp` to `rw`
  rw [NatTrans.comp_app]
  simp only [SkyscraperPresheafFunctor.map'_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.{w, v} C
inst✝ : HasTerminal C
A a b c : C
f : a ⟶ b
g : b ⟶ c
U : Opens ↑X
h : p₀ ∈ (op U).unop
⊢ eqToHom (_ : (if p₀ ∈ (op U).unop then a else ⊤_ C) = a) ≫
      (f ≫ g) ≫ eqToHom (_ : c = if p₀ ∈ (op U).unop then c else ⊤_ C) =
    (eqToHom (_ : (if p₀ ∈ (op U).unop then a else ⊤_ C) = a) ≫
        f ≫ eqToHom (_ : b = if p₀ ∈ (op U).unop then b else ⊤_ C)) ≫
      eqToHom (_ : (if p₀ ∈ (op U).unop then b else ⊤_ C) = b) ≫
        g ≫ eqToHom (_ : c = if p₀ ∈ (op U).unop then c else ⊤_ C)

Next tactic:
aesop_cat
theorem SkyscraperPresheafFunctor.map'_comp {a b c : C} (f : a ⟶ b) (g : b ⟶ c) :
    SkyscraperPresheafFunctor.map' p₀ (f ≫ g) =
      SkyscraperPresheafFunctor.map' p₀ f ≫ SkyscraperPresheafFunctor.map' p₀ g := by
  ext U
  -- Porting note : change `simp` to `rw`
  rw [NatTrans.comp_app]
  simp only [SkyscraperPresheafFunctor.map'_app]
  split_ifs with h <;> 

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

Next tactic:
aesop_cat
/-- The cocone at `A` for the stalk functor of `skyscraperPresheaf p₀ A` when `y ∈ closure {p₀}`
-/
@[simps]
def skyscraperPresheafCoconeOfSpecializes {y : X} (h : p₀ ⤳ y) :
    Cocone ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A) where
  pt := A
  ι :=
    { app := fun U => eqToHom <| if_pos <| h.mem_open U.unop.1.2 U.unop.2
      naturality := fun U V inc => 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
y : ↑X
h : p₀ ⤳ y
U V : (OpenNhds y)ᵒᵖ
inc : U ⟶ V
⊢ ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A).map inc ≫
      (fun U => eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A)) V =
    (fun U => eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A)) U ≫
      ((Functor.const (OpenNhds y)ᵒᵖ).obj A).map inc

Next tactic:
change dite _ _ _ ≫ _ = _
/-- The cocone at `A` for the stalk functor of `skyscraperPresheaf p₀ A` when `y ∈ closure {p₀}`
-/
@[simps]
def skyscraperPresheafCoconeOfSpecializes {y : X} (h : p₀ ⤳ y) :
    Cocone ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A) where
  pt := A
  ι :=
    { app := fun U => eqToHom <| if_pos <| h.mem_open U.unop.1.2 U.unop.2
      naturality := fun U V inc => by
        change dite _ _ _ ≫ _ = _; 

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
y : ↑X
h : p₀ ⤳ y
U V : (OpenNhds y)ᵒᵖ
inc : U ⟶ V
⊢ (if h : p₀ ∈ ((OpenNhds.inclusion y).op.obj V).unop then
        (fun h =>
            eqToHom
              (_ :
                (fun U => if p₀ ∈ U.unop then A else ⊤_ C) ((OpenNhds.inclusion y).op.obj U) =
                  (fun U => if p₀ ∈ U.unop then A else ⊤_ C) ((OpenNhds.inclusion y).op.obj V)))
          h
      else
        (fun h =>
            IsTerminal.from
              ((_ : (⊤_ C) = if p₀ ∈ ((OpenNhds.inclusion y).op.obj V).unop then A else ⊤_ C) ▸ terminalIsTerminal)
              ((fun U => if p₀ ∈ U.unop then A else ⊤_ C) ((OpenNhds.inclusion y).op.obj U)))
          h) ≫
      (fun U => eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A)) V =
    (fun U => eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A)) U ≫
      ((Functor.const (OpenNhds y)ᵒᵖ).obj A).map inc

Next tactic:
rw [dif_pos]
/-- The cocone at `A` for the stalk functor of `skyscraperPresheaf p₀ A` when `y ∈ closure {p₀}`
-/
@[simps]
def skyscraperPresheafCoconeOfSpecializes {y : X} (h : p₀ ⤳ y) :
    Cocone ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A) where
  pt := A
  ι :=
    { app := fun U => eqToHom <| if_pos <| h.mem_open U.unop.1.2 U.unop.2
      naturality := fun U V inc => by
        change dite _ _ _ ≫ _ = _; rw [dif_pos]
        

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
y : ↑X
h : p₀ ⤳ y
U V : (OpenNhds y)ᵒᵖ
inc : U ⟶ V
⊢ (fun h =>
          eqToHom
            (_ :
              (fun U => if p₀ ∈ U.unop then A else ⊤_ C) ((OpenNhds.inclusion y).op.obj U) =
                (fun U => if p₀ ∈ U.unop then A else ⊤_ C) ((OpenNhds.inclusion y).op.obj V)))
        ?hc ≫
      (fun U => eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A)) V =
    (fun U => eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A)) U ≫
      ((Functor.const (OpenNhds y)ᵒᵖ).obj A).map inc
case hc
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{u, v} C
A : C
inst✝ : HasTerminal C
y : ↑X
h : p₀ ⤳ y
U V : (OpenNhds y)ᵒᵖ
inc : U ⟶ V
⊢ p₀ ∈ ((OpenNhds.inclusion y).op.obj V).unop

Next tactic:
swap
/-- The cocone at `A` for the stalk functor of `skyscraperPresheaf p₀ A` when `y ∈ closure {p₀}`
-/
@[simps]
def skyscraperPresheafCoconeOfSpecializes {y : X} (h : p₀ ⤳ y) :
    Cocone ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A) where
  pt := A
  ι :=
    { app := fun U => eqToHom <| if_pos <| h.mem_open U.unop.1.2 U.unop.2
      naturality := fun U V inc => by
        change dite _ _ _ ≫ _ = _; rw [dif_pos]
        swap -- Porting note : swap goal to prevent proving same thing twice
        · 

Proof state:
case hc
X : TopCat
p₀ : ↑X
inst✝² : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝¹ : Category.{u, v} C
A : C
inst✝ : HasTerminal C
y : ↑X
h : p₀ ⤳ y
U V : (OpenNhds y)ᵒᵖ
inc : U ⟶ V
⊢ p₀ ∈ ((OpenNhds.inclusion y).op.obj V).unop

Next tactic:
exact h.mem_open V.unop.1.2 V.unop.2
/-- The cocone at `A` for the stalk functor of `skyscraperPresheaf p₀ A` when `y ∈ closure {p₀}`
-/
@[simps]
def skyscraperPresheafCoconeOfSpecializes {y : X} (h : p₀ ⤳ y) :
    Cocone ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A) where
  pt := A
  ι :=
    { app := fun U => eqToHom <| if_pos <| h.mem_open U.unop.1.2 U.unop.2
      naturality := fun U V inc => by
        change dite _ _ _ ≫ _ = _; rw [dif_pos]
        swap -- Porting note : swap goal to prevent proving same thing twice
        · exact h.mem_open V.unop.1.2 V.unop.2
        · 

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
y : ↑X
h : p₀ ⤳ y
U V : (OpenNhds y)ᵒᵖ
inc : U ⟶ V
⊢ (fun h =>
          eqToHom
            (_ :
              (fun U => if p₀ ∈ U.unop then A else ⊤_ C) ((OpenNhds.inclusion y).op.obj U) =
                (fun U => if p₀ ∈ U.unop then A else ⊤_ C) ((OpenNhds.inclusion y).op.obj V)))
        (_ : p₀ ∈ ↑((OpenNhds.inclusion y).op.obj V).unop) ≫
      (fun U => eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A)) V =
    (fun U => eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A)) U ≫
      ((Functor.const (OpenNhds y)ᵒᵖ).obj A).map inc

Next tactic:
simp only [Functor.comp_obj, Functor.op_obj, skyscraperPresheaf_obj, unop_op,
            Functor.const_obj_obj, eqToHom_trans, Functor.const_obj_map, Category.comp_id]
/--
The cocone at `A` for the stalk functor of `skyscraperPresheaf p₀ A` when `y ∈ closure {p₀}` is a
colimit
-/
noncomputable def skyscraperPresheafCoconeIsColimitOfSpecializes {y : X} (h : p₀ ⤳ y) :
    IsColimit (skyscraperPresheafCoconeOfSpecializes p₀ A h) where
  desc c := eqToHom (if_pos trivial).symm ≫ c.ι.app (op ⊤)
  fac c 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
y : ↑X
h : p₀ ⤳ y
c : Cocone ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A)
U : (OpenNhds y)ᵒᵖ
⊢ (skyscraperPresheafCoconeOfSpecializes p₀ A h).ι.app U ≫
      (fun c =>
          eqToHom
              (_ :
                (skyscraperPresheafCoconeOfSpecializes p₀ A h).pt =
                  if True then (skyscraperPresheafCoconeOfSpecializes p₀ A h).pt else ⊤_ C) ≫
            c.ι.app (op ⊤))
        c =
    c.ι.app U

Next tactic:
dsimp
/--
The cocone at `A` for the stalk functor of `skyscraperPresheaf p₀ A` when `y ∈ closure {p₀}` is a
colimit
-/
noncomputable def skyscraperPresheafCoconeIsColimitOfSpecializes {y : X} (h : p₀ ⤳ y) :
    IsColimit (skyscraperPresheafCoconeOfSpecializes p₀ A h) where
  desc c := eqToHom (if_pos trivial).symm ≫ c.ι.app (op ⊤)
  fac c U := by
    dsimp -- 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
y : ↑X
h : p₀ ⤳ y
c : Cocone ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A)
U : (OpenNhds y)ᵒᵖ
⊢ eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A) ≫
      eqToHom (_ : A = if True then A else ⊤_ C) ≫ c.ι.app (op ⊤) =
    c.ι.app U

Next tactic:
rw [← c.w (homOfLE <| (le_top : unop U ≤ _)).op]
/--
The cocone at `A` for the stalk functor of `skyscraperPresheaf p₀ A` when `y ∈ closure {p₀}` is a
colimit
-/
noncomputable def skyscraperPresheafCoconeIsColimitOfSpecializes {y : X} (h : p₀ ⤳ y) :
    IsColimit (skyscraperPresheafCoconeOfSpecializes p₀ A h) where
  desc c := eqToHom (if_pos trivial).symm ≫ c.ι.app (op ⊤)
  fac c U := by
    dsimp -- Porting note : added a `dsimp`
    rw [← c.w (homOfLE <| (le_top : unop U ≤ _)).op]
    

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
y : ↑X
h : p₀ ⤳ y
c : Cocone ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A)
U : (OpenNhds y)ᵒᵖ
⊢ eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A) ≫
      eqToHom (_ : A = if True then A else ⊤_ C) ≫
        ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A).map (homOfLE (_ : U.unop ≤ ⊤)).op ≫ c.ι.app (op U.unop) =
    c.ι.app U

Next tactic:
change _ ≫ _ ≫ dite _ _ _ ≫ _ = _
/--
The cocone at `A` for the stalk functor of `skyscraperPresheaf p₀ A` when `y ∈ closure {p₀}` is a
colimit
-/
noncomputable def skyscraperPresheafCoconeIsColimitOfSpecializes {y : X} (h : p₀ ⤳ y) :
    IsColimit (skyscraperPresheafCoconeOfSpecializes p₀ A h) where
  desc c := eqToHom (if_pos trivial).symm ≫ c.ι.app (op ⊤)
  fac c U := by
    dsimp -- Porting note : added a `dsimp`
    rw [← c.w (homOfLE <| (le_top : unop U ≤ _)).op]
    change _ ≫ _ ≫ dite _ _ _ ≫ _ = _
    

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
y : ↑X
h : p₀ ⤳ y
c : Cocone ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A)
U : (OpenNhds y)ᵒᵖ
⊢ eqToHom (_ : (if p₀ ∈ U.unop.obj.carrier then A else ⊤_ C) = A) ≫
      eqToHom (_ : A = if True then A else ⊤_ C) ≫
        (if h : p₀ ∈ ((OpenNhds.inclusion y).op.obj (op U.unop)).unop then
            (fun h =>
                eqToHom
                  (_ :
                    (fun U => if p₀ ∈ U.unop then A else ⊤_ C) ((OpenNhds.inclusion y).op.obj (op ⊤)) =
                      (fun U => if p₀ ∈ U.unop then A else ⊤_ C) ((OpenNhds.inclusion y).op.obj (op U.unop))))
              h
          else
            (fun h =>
                IsTerminal.from
                  ((_ : (⊤_ C) = if p₀ ∈ ((OpenNhds.inclusion y).op.obj (op U.unop)).unop then A else ⊤_ C) ▸
                    terminalIsTerminal)
                  ((fun U => if p₀ ∈ U.unop then A else ⊤_ C) ((OpenNhds.inclusion y).op.obj (op ⊤))))
              h) ≫
          c.ι.app (op U.unop) =
    c.ι.app U

Next tactic:
rw [dif_pos]