l3lab/ntp-mathlib huggingface dataset:
/-- The explicit coproduct for `F : discrete ι ⥤ LocallyRingedSpace`. -/
noncomputable def coproduct : LocallyRingedSpace where
  toSheafedSpace := colimit (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
    (F ⋙ forgetToSheafedSpace)
  localRing x := by
    obtain ⟨i, y, ⟨⟩⟩ := SheafedSpace.colimit_exists_rep (F ⋙ forgetToSheafedSpace) x
    haveI : LocalRing (((F ⋙ forgetToSheafedSpace).obj i).toPresheafedSpace.stalk y) :=
      (F.obj i).localRing _
    

Proof state:
case intro.intro.refl
ι : Type u
F : Discrete ι ⥤ LocallyRingedSpace
i : Discrete ι
y : ↑↑((F ⋙ forgetToSheafedSpace).obj i).toPresheafedSpace
this : LocalRing ↑(PresheafedSpace.stalk ((F ⋙ forgetToSheafedSpace).obj i).toPresheafedSpace y)
⊢ LocalRing
    ↑(TopCat.Presheaf.stalk (colimit (F ⋙ forgetToSheafedSpace)).toPresheafedSpace.presheaf
        ((colimit.ι (F ⋙ forgetToSheafedSpace) i).base y))

Next tactic:
exact
      (asIso (PresheafedSpace.stalkMap
        (colimit.ι (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) i : _) y)).symm.commRingCatIsoToRingEquiv.localRing
/-- The explicit coproduct cofan for `F : discrete ι ⥤ LocallyRingedSpace`. -/
noncomputable def coproductCofan : Cocone F where
  pt := coproduct F
  ι :=
    { app := fun j => ⟨colimit.ι (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
        (F ⋙ forgetToSheafedSpace) j, inferInstance⟩
      naturality := fun ⟨j⟩ ⟨j'⟩ ⟨⟨(f : j = j')⟩⟩ => by 

Proof state:
ι : Type u
F : Discrete ι ⥤ LocallyRingedSpace
x✝² x✝¹ : Discrete ι
j j' : ι
x✝ : { as := j } ⟶ { as := j' }
f : j = j'
⊢ F.map { down := { down := f } } ≫
      (fun j =>
          { val := colimit.ι (F ⋙ forgetToSheafedSpace) j,
            prop :=
              (_ :
                ∀ (x : ↑↑(F.obj j).toPresheafedSpace),
                  IsLocalRingHom (PresheafedSpace.stalkMap (colimit.ι (F ⋙ forgetToSheafedSpace) j) x)) })
        { as := j' } =
    (fun j =>
          { val := colimit.ι (F ⋙ forgetToSheafedSpace) j,
            prop :=
              (_ :
                ∀ (x : ↑↑(F.obj j).toPresheafedSpace),
                  IsLocalRingHom (PresheafedSpace.stalkMap (colimit.ι (F ⋙ forgetToSheafedSpace) j) x)) })
        { as := j } ≫
      ((Functor.const (Discrete ι)).obj (coproduct F)).map { down := { down := f } }

Next tactic:
subst f
/-- The explicit coproduct cofan for `F : discrete ι ⥤ LocallyRingedSpace`. -/
noncomputable def coproductCofan : Cocone F where
  pt := coproduct F
  ι :=
    { app := fun j => ⟨colimit.ι (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
        (F ⋙ forgetToSheafedSpace) j, inferInstance⟩
      naturality := fun ⟨j⟩ ⟨j'⟩ ⟨⟨(f : j = j')⟩⟩ => by subst f; 

Proof state:
ι : Type u
F : Discrete ι ⥤ LocallyRingedSpace
x✝² x✝¹ : Discrete ι
j : ι
x✝ : { as := j } ⟶ { as := j }
⊢ F.map { down := { down := (_ : j = j) } } ≫
      (fun j =>
          { val := colimit.ι (F ⋙ forgetToSheafedSpace) j,
            prop :=
              (_ :
                ∀ (x : ↑↑(F.obj j).toPresheafedSpace),
                  IsLocalRingHom (PresheafedSpace.stalkMap (colimit.ι (F ⋙ forgetToSheafedSpace) j) x)) })
        { as := j } =
    (fun j =>
          { val := colimit.ι (F ⋙ forgetToSheafedSpace) j,
            prop :=
              (_ :
                ∀ (x : ↑↑(F.obj j).toPresheafedSpace),
                  IsLocalRingHom (PresheafedSpace.stalkMap (colimit.ι (F ⋙ forgetToSheafedSpace) j) x)) })
        { as := j } ≫
      ((Functor.const (Discrete ι)).obj (coproduct F)).map { down := { down := (_ : j = j) } }

Next tactic:
aesop
/-- The explicit coproduct cofan constructed in `coproduct_cofan` is indeed a colimit. -/
noncomputable def coproductCofanIsColimit : IsColimit (coproductCofan F) where
  desc s :=
    ⟨colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
      (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s), by
      

Proof state:
ι : Type u
F : Discrete ι ⥤ LocallyRingedSpace
s : Cocone F
⊢ ∀ (x : ↑↑(coproductCofan F).pt.toPresheafedSpace),
    IsLocalRingHom
      (PresheafedSpace.stalkMap (colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s)) x)

Next tactic:
intro x
/-- The explicit coproduct cofan constructed in `coproduct_cofan` is indeed a colimit. -/
noncomputable def coproductCofanIsColimit : IsColimit (coproductCofan F) where
  desc s :=
    ⟨colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
      (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s), by
      intro x
      

Proof state:
ι : Type u
F : Discrete ι ⥤ LocallyRingedSpace
s : Cocone F
x : ↑↑(coproductCofan F).pt.toPresheafedSpace
⊢ IsLocalRingHom
    (PresheafedSpace.stalkMap (colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s)) x)

Next tactic:
obtain ⟨i, y, ⟨⟩⟩ := SheafedSpace.colimit_exists_rep (F ⋙ forgetToSheafedSpace) x
/-- The explicit coproduct cofan constructed in `coproduct_cofan` is indeed a colimit. -/
noncomputable def coproductCofanIsColimit : IsColimit (coproductCofan F) where
  desc s :=
    ⟨colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
      (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s), by
      intro x
      obtain ⟨i, y, ⟨⟩⟩ := SheafedSpace.colimit_exists_rep (F ⋙ forgetToSheafedSpace) x
      

Proof state:
case intro.intro.refl
ι : Type u
F : Discrete ι ⥤ LocallyRingedSpace
s : Cocone F
i : Discrete ι
y : ↑↑((F ⋙ forgetToSheafedSpace).obj i).toPresheafedSpace
⊢ IsLocalRingHom
    (PresheafedSpace.stalkMap (colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
      ((colimit.ι (F ⋙ forgetToSheafedSpace) i).base y))

Next tactic:
have := PresheafedSpace.stalkMap.comp
        (colimit.ι (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) i)
        (colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s)) y
/-- The explicit coproduct cofan constructed in `coproduct_cofan` is indeed a colimit. -/
noncomputable def coproductCofanIsColimit : IsColimit (coproductCofan F) where
  desc s :=
    ⟨colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
      (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s), by
      intro x
      obtain ⟨i, y, ⟨⟩⟩ := SheafedSpace.colimit_exists_rep (F ⋙ forgetToSheafedSpace) x
      have := PresheafedSpace.stalkMap.comp
        (colimit.ι (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) i)
        (colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s)) y
      

Proof state:
case intro.intro.refl
ι : Type u
F : Discrete ι ⥤ LocallyRingedSpace
s : Cocone F
i : Discrete ι
y : ↑↑((F ⋙ forgetToSheafedSpace).obj i).toPresheafedSpace
this :
  PresheafedSpace.stalkMap
      (colimit.ι (F ⋙ forgetToSheafedSpace) i ≫
        colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
      y =
    PresheafedSpace.stalkMap (colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
        ((colimit.ι (F ⋙ forgetToSheafedSpace) i).base y) ≫
      PresheafedSpace.stalkMap (colimit.ι (F ⋙ forgetToSheafedSpace) i) y
⊢ IsLocalRingHom
    (PresheafedSpace.stalkMap (colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
      ((colimit.ι (F ⋙ forgetToSheafedSpace) i).base y))

Next tactic:
rw [← IsIso.comp_inv_eq] at this
/-- The explicit coproduct cofan constructed in `coproduct_cofan` is indeed a colimit. -/
noncomputable def coproductCofanIsColimit : IsColimit (coproductCofan F) where
  desc s :=
    ⟨colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
      (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s), by
      intro x
      obtain ⟨i, y, ⟨⟩⟩ := SheafedSpace.colimit_exists_rep (F ⋙ forgetToSheafedSpace) x
      have := PresheafedSpace.stalkMap.comp
        (colimit.ι (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) i)
        (colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s)) y
      rw [← IsIso.comp_inv_eq] at this
      

Proof state:
case intro.intro.refl
ι : Type u
F : Discrete ι ⥤ LocallyRingedSpace
s : Cocone F
i : Discrete ι
y : ↑↑((F ⋙ forgetToSheafedSpace).obj i).toPresheafedSpace
this :
  PresheafedSpace.stalkMap
        (colimit.ι (F ⋙ forgetToSheafedSpace) i ≫
          colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
        y ≫
      inv (PresheafedSpace.stalkMap (colimit.ι (F ⋙ forgetToSheafedSpace) i) y) =
    PresheafedSpace.stalkMap (colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
      ((colimit.ι (F ⋙ forgetToSheafedSpace) i).base y)
⊢ IsLocalRingHom
    (PresheafedSpace.stalkMap (colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
      ((colimit.ι (F ⋙ forgetToSheafedSpace) i).base y))

Next tactic:
erw [← this,
        PresheafedSpace.stalkMap.congr_hom _ _
          (colimit.ι_desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
            (forgetToSheafedSpace.mapCocone s) i : _)]
/-- The explicit coproduct cofan constructed in `coproduct_cofan` is indeed a colimit. -/
noncomputable def coproductCofanIsColimit : IsColimit (coproductCofan F) where
  desc s :=
    ⟨colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
      (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s), by
      intro x
      obtain ⟨i, y, ⟨⟩⟩ := SheafedSpace.colimit_exists_rep (F ⋙ forgetToSheafedSpace) x
      have := PresheafedSpace.stalkMap.comp
        (colimit.ι (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) i)
        (colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s)) y
      rw [← IsIso.comp_inv_eq] at this
      erw [← this,
        PresheafedSpace.stalkMap.congr_hom _ _
          (colimit.ι_desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
            (forgetToSheafedSpace.mapCocone s) i : _)]
      

Proof state:
case intro.intro.refl
ι : Type u
F : Discrete ι ⥤ LocallyRingedSpace
s : Cocone F
i : Discrete ι
y : ↑↑((F ⋙ forgetToSheafedSpace).obj i).toPresheafedSpace
this :
  PresheafedSpace.stalkMap
        (colimit.ι (F ⋙ forgetToSheafedSpace) i ≫
          colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
        y ≫
      inv (PresheafedSpace.stalkMap (colimit.ι (F ⋙ forgetToSheafedSpace) i) y) =
    PresheafedSpace.stalkMap (colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
      ((colimit.ι (F ⋙ forgetToSheafedSpace) i).base y)
⊢ IsLocalRingHom
    ((eqToHom
          (_ :
            PresheafedSpace.stalk (forgetToSheafedSpace.mapCocone s).pt.toPresheafedSpace
                ((colimit.ι (F ⋙ forgetToSheafedSpace) i ≫
                      colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s)).base
                  y) =
              PresheafedSpace.stalk (forgetToSheafedSpace.mapCocone s).pt.toPresheafedSpace
                (((forgetToSheafedSpace.mapCocone s).ι.app i).base y)) ≫
        PresheafedSpace.stalkMap ((forgetToSheafedSpace.mapCocone s).ι.app i) y) ≫
      inv (PresheafedSpace.stalkMap (colimit.ι (F ⋙ forgetToSheafedSpace) i) y))

Next tactic:
haveI :
        IsLocalRingHom
          (PresheafedSpace.stalkMap ((forgetToSheafedSpace.mapCocone s).ι.app i) y) :=
        (s.ι.app i).2 y
/-- The explicit coproduct cofan constructed in `coproduct_cofan` is indeed a colimit. -/
noncomputable def coproductCofanIsColimit : IsColimit (coproductCofan F) where
  desc s :=
    ⟨colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
      (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s), by
      intro x
      obtain ⟨i, y, ⟨⟩⟩ := SheafedSpace.colimit_exists_rep (F ⋙ forgetToSheafedSpace) x
      have := PresheafedSpace.stalkMap.comp
        (colimit.ι (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) i)
        (colimit.desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
          (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s)) y
      rw [← IsIso.comp_inv_eq] at this
      erw [← this,
        PresheafedSpace.stalkMap.congr_hom _ _
          (colimit.ι_desc (C := SheafedSpace.{u+1, u, u} CommRingCatMax.{u, u})
            (forgetToSheafedSpace.mapCocone s) i : _)]
      haveI :
        IsLocalRingHom
          (PresheafedSpace.stalkMap ((forgetToSheafedSpace.mapCocone s).ι.app i) y) :=
        (s.ι.app i).2 y
      

Proof state:
case intro.intro.refl
ι : Type u
F : Discrete ι ⥤ LocallyRingedSpace
s : Cocone F
i : Discrete ι
y : ↑↑((F ⋙ forgetToSheafedSpace).obj i).toPresheafedSpace
this✝ :
  PresheafedSpace.stalkMap
        (colimit.ι (F ⋙ forgetToSheafedSpace) i ≫
          colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
        y ≫
      inv (PresheafedSpace.stalkMap (colimit.ι (F ⋙ forgetToSheafedSpace) i) y) =
    PresheafedSpace.stalkMap (colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s))
      ((colimit.ι (F ⋙ forgetToSheafedSpace) i).base y)
this : IsLocalRingHom (PresheafedSpace.stalkMap ((forgetToSheafedSpace.mapCocone s).ι.app i) y)
⊢ IsLocalRingHom
    ((eqToHom
          (_ :
            PresheafedSpace.stalk (forgetToSheafedSpace.mapCocone s).pt.toPresheafedSpace
                ((colimit.ι (F ⋙ forgetToSheafedSpace) i ≫
                      colimit.desc (F ⋙ forgetToSheafedSpace) (forgetToSheafedSpace.mapCocone s)).base
                  y) =
              PresheafedSpace.stalk (forgetToSheafedSpace.mapCocone s).pt.toPresheafedSpace
                (((forgetToSheafedSpace.mapCocone s).ι.app i).base y)) ≫
        PresheafedSpace.stalkMap ((forgetToSheafedSpace.mapCocone s).ι.app i) y) ≫
      inv (PresheafedSpace.stalkMap (colimit.ι (F ⋙ forgetToSheafedSpace) i) y))

Next tactic:
infer_instance
instance coequalizer_π_app_isLocalRingHom
    (U : TopologicalSpace.Opens (coequalizer f.val g.val).carrier) :
    IsLocalRingHom ((coequalizer.π f.val g.val : _).c.app (op U)) := by
  

Proof state:
X Y : LocallyRingedSpace
f g : X ⟶ Y
U : Opens ↑↑(coequalizer f.val g.val).toPresheafedSpace
⊢ IsLocalRingHom ((coequalizer.π f.val g.val).c.app (op U))

Next tactic:
have := ι_comp_coequalizerComparison f.1 g.1 SheafedSpace.forgetToPresheafedSpace
instance coequalizer_π_app_isLocalRingHom
    (U : TopologicalSpace.Opens (coequalizer f.val g.val).carrier) :
    IsLocalRingHom ((coequalizer.π f.val g.val : _).c.app (op U)) := by
  have := ι_comp_coequalizerComparison f.1 g.1 SheafedSpace.forgetToPresheafedSpace
  

Proof state:
X Y : LocallyRingedSpace
f g : X ⟶ Y
U : Opens ↑↑(coequalizer f.val g.val).toPresheafedSpace
this :
  coequalizer.π (SheafedSpace.forgetToPresheafedSpace.map f.val) (SheafedSpace.forgetToPresheafedSpace.map g.val) ≫
      coequalizerComparison f.val g.val SheafedSpace.forgetToPresheafedSpace =
    SheafedSpace.forgetToPresheafedSpace.map (coequalizer.π f.val g.val)
⊢ IsLocalRingHom ((coequalizer.π f.val g.val).c.app (op U))

Next tactic:
rw [← PreservesCoequalizer.iso_hom] at this
instance coequalizer_π_app_isLocalRingHom
    (U : TopologicalSpace.Opens (coequalizer f.val g.val).carrier) :
    IsLocalRingHom ((coequalizer.π f.val g.val : _).c.app (op U)) := by
  have := ι_comp_coequalizerComparison f.1 g.1 SheafedSpace.forgetToPresheafedSpace
  rw [← PreservesCoequalizer.iso_hom] at this
  

Proof state:
X Y : LocallyRingedSpace
f g : X ⟶ Y
U : Opens ↑↑(coequalizer f.val g.val).toPresheafedSpace
this :
  coequalizer.π (SheafedSpace.forgetToPresheafedSpace.map f.val) (SheafedSpace.forgetToPresheafedSpace.map g.val) ≫
      (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom =
    SheafedSpace.forgetToPresheafedSpace.map (coequalizer.π f.val g.val)
⊢ IsLocalRingHom ((coequalizer.π f.val g.val).c.app (op U))

Next tactic:
erw [SheafedSpace.congr_app this.symm (op U)]
instance coequalizer_π_app_isLocalRingHom
    (U : TopologicalSpace.Opens (coequalizer f.val g.val).carrier) :
    IsLocalRingHom ((coequalizer.π f.val g.val : _).c.app (op U)) := by
  have := ι_comp_coequalizerComparison f.1 g.1 SheafedSpace.forgetToPresheafedSpace
  rw [← PreservesCoequalizer.iso_hom] at this
  erw [SheafedSpace.congr_app this.symm (op U)]
  

Proof state:
X Y : LocallyRingedSpace
f g : X ⟶ Y
U : Opens ↑↑(coequalizer f.val g.val).toPresheafedSpace
this :
  coequalizer.π (SheafedSpace.forgetToPresheafedSpace.map f.val) (SheafedSpace.forgetToPresheafedSpace.map g.val) ≫
      (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom =
    SheafedSpace.forgetToPresheafedSpace.map (coequalizer.π f.val g.val)
⊢ IsLocalRingHom
    ((coequalizer.π (SheafedSpace.forgetToPresheafedSpace.map f.val) (SheafedSpace.forgetToPresheafedSpace.map g.val) ≫
              (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom).c.app
        (op U) ≫
      Y.presheaf.map
        (eqToHom
          (_ :
            (Opens.map
                      (coequalizer.π (SheafedSpace.forgetToPresheafedSpace.map f.val)
                            (SheafedSpace.forgetToPresheafedSpace.map g.val) ≫
                          (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom).base).op.obj
                (op U) =
              (Opens.map (SheafedSpace.forgetToPresheafedSpace.map (coequalizer.π f.val g.val)).base).op.obj (op U))))

Next tactic:
rw [PresheafedSpace.comp_c_app, ← PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit_hom_π]
instance coequalizer_π_app_isLocalRingHom
    (U : TopologicalSpace.Opens (coequalizer f.val g.val).carrier) :
    IsLocalRingHom ((coequalizer.π f.val g.val : _).c.app (op U)) := by
  have := ι_comp_coequalizerComparison f.1 g.1 SheafedSpace.forgetToPresheafedSpace
  rw [← PreservesCoequalizer.iso_hom] at this
  erw [SheafedSpace.congr_app this.symm (op U)]
  rw [PresheafedSpace.comp_c_app, ← PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit_hom_π]
  -- Porting note : this instance has to be manually added
  

Proof state:
X Y : LocallyRingedSpace
f g : X ⟶ Y
U : Opens ↑↑(coequalizer f.val g.val).toPresheafedSpace
this :
  coequalizer.π (SheafedSpace.forgetToPresheafedSpace.map f.val) (SheafedSpace.forgetToPresheafedSpace.map g.val) ≫
      (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom =
    SheafedSpace.forgetToPresheafedSpace.map (coequalizer.π f.val g.val)
⊢ IsLocalRingHom
    (((PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom.c.app (op U) ≫
        (PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit
              (parallelPair (SheafedSpace.forgetToPresheafedSpace.map f.val)
                (SheafedSpace.forgetToPresheafedSpace.map g.val))
              ((Opens.map (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom.base).obj
                (op U).unop)).hom ≫
          limit.π
            (PresheafedSpace.componentwiseDiagram
              (parallelPair (SheafedSpace.forgetToPresheafedSpace.map f.val)
                (SheafedSpace.forgetToPresheafedSpace.map g.val))
              ((Opens.map (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom.base).obj
                (op U).unop))
            (op WalkingParallelPair.one)) ≫
      Y.presheaf.map
        (eqToHom
          (_ :
            (Opens.map
                      (coequalizer.π (SheafedSpace.forgetToPresheafedSpace.map f.val)
                            (SheafedSpace.forgetToPresheafedSpace.map g.val) ≫
                          (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom).base).op.obj
                (op U) =
              (Opens.map (SheafedSpace.forgetToPresheafedSpace.map (coequalizer.π f.val g.val)).base).op.obj (op U))))

Next tactic:
haveI : IsIso (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom.c :=
    PresheafedSpace.c_isIso_of_iso _
instance coequalizer_π_app_isLocalRingHom
    (U : TopologicalSpace.Opens (coequalizer f.val g.val).carrier) :
    IsLocalRingHom ((coequalizer.π f.val g.val : _).c.app (op U)) := by
  have := ι_comp_coequalizerComparison f.1 g.1 SheafedSpace.forgetToPresheafedSpace
  rw [← PreservesCoequalizer.iso_hom] at this
  erw [SheafedSpace.congr_app this.symm (op U)]
  rw [PresheafedSpace.comp_c_app, ← PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit_hom_π]
  -- Porting note : this instance has to be manually added
  haveI : IsIso (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom.c :=
    PresheafedSpace.c_isIso_of_iso _
  

Proof state:
X Y : LocallyRingedSpace
f g : X ⟶ Y
U : Opens ↑↑(coequalizer f.val g.val).toPresheafedSpace
this✝ :
  coequalizer.π (SheafedSpace.forgetToPresheafedSpace.map f.val) (SheafedSpace.forgetToPresheafedSpace.map g.val) ≫
      (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom =
    SheafedSpace.forgetToPresheafedSpace.map (coequalizer.π f.val g.val)
this : IsIso (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom.c
⊢ IsLocalRingHom
    (((PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom.c.app (op U) ≫
        (PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit
              (parallelPair (SheafedSpace.forgetToPresheafedSpace.map f.val)
                (SheafedSpace.forgetToPresheafedSpace.map g.val))
              ((Opens.map (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom.base).obj
                (op U).unop)).hom ≫
          limit.π
            (PresheafedSpace.componentwiseDiagram
              (parallelPair (SheafedSpace.forgetToPresheafedSpace.map f.val)
                (SheafedSpace.forgetToPresheafedSpace.map g.val))
              ((Opens.map (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom.base).obj
                (op U).unop))
            (op WalkingParallelPair.one)) ≫
      Y.presheaf.map
        (eqToHom
          (_ :
            (Opens.map
                      (coequalizer.π (SheafedSpace.forgetToPresheafedSpace.map f.val)
                            (SheafedSpace.forgetToPresheafedSpace.map g.val) ≫
                          (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.val g.val).hom).base).op.obj
                (op U) =
              (Opens.map (SheafedSpace.forgetToPresheafedSpace.map (coequalizer.π f.val g.val)).base).op.obj (op U))))

Next tactic:
infer_instance
theorem imageBasicOpen_image_preimage :
    (coequalizer.π f.1 g.1).base ⁻¹' ((coequalizer.π f.1 g.1).base '' (imageBasicOpen f g U s).1) =
      (imageBasicOpen f g U s).1 := by
  

Proof state:
X Y : LocallyRingedSpace
f g : X ⟶ Y
U : Opens ↑↑(coequalizer f.val g.val).toPresheafedSpace
s : ↑((coequalizer f.val g.val).toPresheafedSpace.presheaf.obj (op U))
⊢ ⇑(coequalizer.π f.val g.val).base ⁻¹' (⇑(coequalizer.π f.val g.val).base '' (imageBasicOpen f g U s).carrier) =
    (imageBasicOpen f g U s).carrier

Next tactic:
fapply Types.coequalizer_preimage_image_eq_of_preimage_eq
    -- Porting note : Type of `f.1.base` and `g.1.base` needs to be explicit
    (f.1.base : X.carrier.1 ⟶ Y.carrier.1) (g.1.base : X.carrier.1 ⟶ Y.carrier.1)
theorem imageBasicOpen_image_preimage :
    (coequalizer.π f.1 g.1).base ⁻¹' ((coequalizer.π f.1 g.1).base '' (imageBasicOpen f g U s).1) =
      (imageBasicOpen f g U s).1 := by
  fapply Types.coequalizer_preimage_image_eq_of_preimage_eq
    -- Porting note : Type of `f.1.base` and `g.1.base` needs to be explicit
    (f.1.base : X.carrier.1 ⟶ Y.carrier.1) (g.1.base : X.carrier.1 ⟶ Y.carrier.1)
  · 

Proof state:
case e
X Y : LocallyRingedSpace
f g : X ⟶ Y
U : Opens ↑↑(coequalizer f.val g.val).toPresheafedSpace
s : ↑((coequalizer f.val g.val).toPresheafedSpace.presheaf.obj (op U))
⊢ ⇑f.val.base ≫ ⇑(coequalizer.π f.val g.val).base = ⇑g.val.base ≫ ⇑(coequalizer.π f.val g.val).base

Next tactic:
ext