l3lab/ntp-mathlib huggingface dataset:
/-- Suppose `X Y : SheafedSpace C`, where `C` is a concrete category,
whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits.
Then a morphism `X ⟶ Y` that is a topological open embedding
is an open immersion iff every stalk map is an iso.
-/
theorem of_stalk_iso {X Y : SheafedSpace C} (f : X ⟶ Y) (hf : OpenEmbedding f.base)
    [H : ∀ x : X.1, IsIso (PresheafedSpace.stalkMap f x)] : SheafedSpace.IsOpenImmersion f :=
  { base_open := hf
    c_iso := fun U => by
      -- Porting note : was `apply (config := { instances := False }) ...`
      -- See https://github.com/leanprover/lean4/issues/2273
      have h := TopCat.Presheaf.app_isIso_of_stalkFunctor_map_iso
          (show Y.sheaf ⟶ (TopCat.Sheaf.pushforward _ f.base).obj X.sheaf from ⟨f.c⟩)
      refine @h _ ?_
      rintro ⟨_, y, hy, rfl⟩
      

Proof state:
case mk.intro.intro
C : Type u_1
inst✝⁶ : Category.{u_2, u_1} C
inst✝⁵ : HasLimits C
inst✝⁴ : HasColimits C
inst✝³ : ConcreteCategory C
inst✝² : ReflectsIsomorphisms (CategoryTheory.forget C)
inst✝¹ : PreservesLimits (CategoryTheory.forget C)
inst✝ : PreservesFilteredColimits (CategoryTheory.forget C)
X Y : SheafedSpace C
f : X ⟶ Y
hf : OpenEmbedding ⇑f.base
H : ∀ (x : ↑↑X.toPresheafedSpace), IsIso (PresheafedSpace.stalkMap f x)
U : Opens ↑↑X.toPresheafedSpace
h :
  ∀ (U : Opens ↑↑Y.toPresheafedSpace)
    [inst :
      ∀ (x : ↥U),
        IsIso
          ((TopCat.Presheaf.stalkFunctor C ↑x).map
            (let_fun this := { val := f.c };
              this).val)],
    IsIso
      ((let_fun this := { val := f.c };
            this).val.app
        (op U))
y : (CategoryTheory.forget TopCat).obj ↑X.toPresheafedSpace
hy : y ∈ ↑U
⊢ IsIso
    ((TopCat.Presheaf.stalkFunctor C ↑{ val := f.base y, property := (_ : ∃ a ∈ ↑U, f.base a = f.base y) }).map
      (let_fun this := { val := f.c };
        this).val)

Next tactic:
specialize H y
/-- Suppose `X Y : SheafedSpace C`, where `C` is a concrete category,
whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits.
Then a morphism `X ⟶ Y` that is a topological open embedding
is an open immersion iff every stalk map is an iso.
-/
theorem of_stalk_iso {X Y : SheafedSpace C} (f : X ⟶ Y) (hf : OpenEmbedding f.base)
    [H : ∀ x : X.1, IsIso (PresheafedSpace.stalkMap f x)] : SheafedSpace.IsOpenImmersion f :=
  { base_open := hf
    c_iso := fun U => by
      -- Porting note : was `apply (config := { instances := False }) ...`
      -- See https://github.com/leanprover/lean4/issues/2273
      have h := TopCat.Presheaf.app_isIso_of_stalkFunctor_map_iso
          (show Y.sheaf ⟶ (TopCat.Sheaf.pushforward _ f.base).obj X.sheaf from ⟨f.c⟩)
      refine @h _ ?_
      rintro ⟨_, y, hy, rfl⟩
      specialize H y
      

Proof state:
case mk.intro.intro
C : Type u_1
inst✝⁶ : Category.{u_2, u_1} C
inst✝⁵ : HasLimits C
inst✝⁴ : HasColimits C
inst✝³ : ConcreteCategory C
inst✝² : ReflectsIsomorphisms (CategoryTheory.forget C)
inst✝¹ : PreservesLimits (CategoryTheory.forget C)
inst✝ : PreservesFilteredColimits (CategoryTheory.forget C)
X Y : SheafedSpace C
f : X ⟶ Y
hf : OpenEmbedding ⇑f.base
U : Opens ↑↑X.toPresheafedSpace
h :
  ∀ (U : Opens ↑↑Y.toPresheafedSpace)
    [inst :
      ∀ (x : ↥U),
        IsIso
          ((TopCat.Presheaf.stalkFunctor C ↑x).map
            (let_fun this := { val := f.c };
              this).val)],
    IsIso
      ((let_fun this := { val := f.c };
            this).val.app
        (op U))
y : (CategoryTheory.forget TopCat).obj ↑X.toPresheafedSpace
hy : y ∈ ↑U
H : IsIso (PresheafedSpace.stalkMap f y)
⊢ IsIso
    ((TopCat.Presheaf.stalkFunctor C ↑{ val := f.base y, property := (_ : ∃ a ∈ ↑U, f.base a = f.base y) }).map
      (let_fun this := { val := f.c };
        this).val)

Next tactic:
delta PresheafedSpace.stalkMap at H
/-- Suppose `X Y : SheafedSpace C`, where `C` is a concrete category,
whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits.
Then a morphism `X ⟶ Y` that is a topological open embedding
is an open immersion iff every stalk map is an iso.
-/
theorem of_stalk_iso {X Y : SheafedSpace C} (f : X ⟶ Y) (hf : OpenEmbedding f.base)
    [H : ∀ x : X.1, IsIso (PresheafedSpace.stalkMap f x)] : SheafedSpace.IsOpenImmersion f :=
  { base_open := hf
    c_iso := fun U => by
      -- Porting note : was `apply (config := { instances := False }) ...`
      -- See https://github.com/leanprover/lean4/issues/2273
      have h := TopCat.Presheaf.app_isIso_of_stalkFunctor_map_iso
          (show Y.sheaf ⟶ (TopCat.Sheaf.pushforward _ f.base).obj X.sheaf from ⟨f.c⟩)
      refine @h _ ?_
      rintro ⟨_, y, hy, rfl⟩
      specialize H y
      delta PresheafedSpace.stalkMap at H
      

Proof state:
case mk.intro.intro
C : Type u_1
inst✝⁶ : Category.{u_2, u_1} C
inst✝⁵ : HasLimits C
inst✝⁴ : HasColimits C
inst✝³ : ConcreteCategory C
inst✝² : ReflectsIsomorphisms (CategoryTheory.forget C)
inst✝¹ : PreservesLimits (CategoryTheory.forget C)
inst✝ : PreservesFilteredColimits (CategoryTheory.forget C)
X Y : SheafedSpace C
f : X ⟶ Y
hf : OpenEmbedding ⇑f.base
U : Opens ↑↑X.toPresheafedSpace
h :
  ∀ (U : Opens ↑↑Y.toPresheafedSpace)
    [inst :
      ∀ (x : ↥U),
        IsIso
          ((TopCat.Presheaf.stalkFunctor C ↑x).map
            (let_fun this := { val := f.c };
              this).val)],
    IsIso
      ((let_fun this := { val := f.c };
            this).val.app
        (op U))
y : (CategoryTheory.forget TopCat).obj ↑X.toPresheafedSpace
hy : y ∈ ↑U
H : IsIso ((TopCat.Presheaf.stalkFunctor C (f.base y)).map f.c ≫ TopCat.Presheaf.stalkPushforward C f.base X.presheaf y)
⊢ IsIso
    ((TopCat.Presheaf.stalkFunctor C ↑{ val := f.base y, property := (_ : ∃ a ∈ ↑U, f.base a = f.base y) }).map
      (let_fun this := { val := f.c };
        this).val)

Next tactic:
haveI H' :=
        TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding C hf X.presheaf y
/-- Suppose `X Y : SheafedSpace C`, where `C` is a concrete category,
whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits.
Then a morphism `X ⟶ Y` that is a topological open embedding
is an open immersion iff every stalk map is an iso.
-/
theorem of_stalk_iso {X Y : SheafedSpace C} (f : X ⟶ Y) (hf : OpenEmbedding f.base)
    [H : ∀ x : X.1, IsIso (PresheafedSpace.stalkMap f x)] : SheafedSpace.IsOpenImmersion f :=
  { base_open := hf
    c_iso := fun U => by
      -- Porting note : was `apply (config := { instances := False }) ...`
      -- See https://github.com/leanprover/lean4/issues/2273
      have h := TopCat.Presheaf.app_isIso_of_stalkFunctor_map_iso
          (show Y.sheaf ⟶ (TopCat.Sheaf.pushforward _ f.base).obj X.sheaf from ⟨f.c⟩)
      refine @h _ ?_
      rintro ⟨_, y, hy, rfl⟩
      specialize H y
      delta PresheafedSpace.stalkMap at H
      haveI H' :=
        TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding C hf X.presheaf y
      

Proof state:
case mk.intro.intro
C : Type u_1
inst✝⁶ : Category.{u_2, u_1} C
inst✝⁵ : HasLimits C
inst✝⁴ : HasColimits C
inst✝³ : ConcreteCategory C
inst✝² : ReflectsIsomorphisms (CategoryTheory.forget C)
inst✝¹ : PreservesLimits (CategoryTheory.forget C)
inst✝ : PreservesFilteredColimits (CategoryTheory.forget C)
X Y : SheafedSpace C
f : X ⟶ Y
hf : OpenEmbedding ⇑f.base
U : Opens ↑↑X.toPresheafedSpace
h :
  ∀ (U : Opens ↑↑Y.toPresheafedSpace)
    [inst :
      ∀ (x : ↥U),
        IsIso
          ((TopCat.Presheaf.stalkFunctor C ↑x).map
            (let_fun this := { val := f.c };
              this).val)],
    IsIso
      ((let_fun this := { val := f.c };
            this).val.app
        (op U))
y : (CategoryTheory.forget TopCat).obj ↑X.toPresheafedSpace
hy : y ∈ ↑U
H : IsIso ((TopCat.Presheaf.stalkFunctor C (f.base y)).map f.c ≫ TopCat.Presheaf.stalkPushforward C f.base X.presheaf y)
H' : IsIso (TopCat.Presheaf.stalkPushforward C f.base X.presheaf y)
⊢ IsIso
    ((TopCat.Presheaf.stalkFunctor C ↑{ val := f.base y, property := (_ : ∃ a ∈ ↑U, f.base a = f.base y) }).map
      (let_fun this := { val := f.c };
        this).val)

Next tactic:
have := @IsIso.comp_isIso _ _ _ _ _ _ _ H (@IsIso.inv_isIso _ _ _ _ _ H')
/-- Suppose `X Y : SheafedSpace C`, where `C` is a concrete category,
whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits.
Then a morphism `X ⟶ Y` that is a topological open embedding
is an open immersion iff every stalk map is an iso.
-/
theorem of_stalk_iso {X Y : SheafedSpace C} (f : X ⟶ Y) (hf : OpenEmbedding f.base)
    [H : ∀ x : X.1, IsIso (PresheafedSpace.stalkMap f x)] : SheafedSpace.IsOpenImmersion f :=
  { base_open := hf
    c_iso := fun U => by
      -- Porting note : was `apply (config := { instances := False }) ...`
      -- See https://github.com/leanprover/lean4/issues/2273
      have h := TopCat.Presheaf.app_isIso_of_stalkFunctor_map_iso
          (show Y.sheaf ⟶ (TopCat.Sheaf.pushforward _ f.base).obj X.sheaf from ⟨f.c⟩)
      refine @h _ ?_
      rintro ⟨_, y, hy, rfl⟩
      specialize H y
      delta PresheafedSpace.stalkMap at H
      haveI H' :=
        TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding C hf X.presheaf y
      have := @IsIso.comp_isIso _ _ _ _ _ _ _ H (@IsIso.inv_isIso _ _ _ _ _ H')
      

Proof state:
case mk.intro.intro
C : Type u_1
inst✝⁶ : Category.{u_2, u_1} C
inst✝⁵ : HasLimits C
inst✝⁴ : HasColimits C
inst✝³ : ConcreteCategory C
inst✝² : ReflectsIsomorphisms (CategoryTheory.forget C)
inst✝¹ : PreservesLimits (CategoryTheory.forget C)
inst✝ : PreservesFilteredColimits (CategoryTheory.forget C)
X Y : SheafedSpace C
f : X ⟶ Y
hf : OpenEmbedding ⇑f.base
U : Opens ↑↑X.toPresheafedSpace
h :
  ∀ (U : Opens ↑↑Y.toPresheafedSpace)
    [inst :
      ∀ (x : ↥U),
        IsIso
          ((TopCat.Presheaf.stalkFunctor C ↑x).map
            (let_fun this := { val := f.c };
              this).val)],
    IsIso
      ((let_fun this := { val := f.c };
            this).val.app
        (op U))
y : (CategoryTheory.forget TopCat).obj ↑X.toPresheafedSpace
hy : y ∈ ↑U
H : IsIso ((TopCat.Presheaf.stalkFunctor C (f.base y)).map f.c ≫ TopCat.Presheaf.stalkPushforward C f.base X.presheaf y)
H' : IsIso (TopCat.Presheaf.stalkPushforward C f.base X.presheaf y)
this :
  IsIso
    (((TopCat.Presheaf.stalkFunctor C (f.base y)).map f.c ≫ TopCat.Presheaf.stalkPushforward C f.base X.presheaf y) ≫
      inv (TopCat.Presheaf.stalkPushforward C f.base X.presheaf y))
⊢ IsIso
    ((TopCat.Presheaf.stalkFunctor C ↑{ val := f.base y, property := (_ : ∃ a ∈ ↑U, f.base a = f.base y) }).map
      (let_fun this := { val := f.c };
        this).val)

Next tactic:
rwa [Category.assoc, IsIso.hom_inv_id, Category.comp_id] at this
theorem sigma_ι_openEmbedding : OpenEmbedding (colimit.ι F i).base := by
  

Proof state:
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
i : Discrete ι
⊢ OpenEmbedding ⇑(colimit.ι F i).base

Next tactic:
rw [← show _ = (colimit.ι F i).base from ι_preservesColimitsIso_inv (SheafedSpace.forget C) F i]
theorem sigma_ι_openEmbedding : OpenEmbedding (colimit.ι F i).base := by
  rw [← show _ = (colimit.ι F i).base from ι_preservesColimitsIso_inv (SheafedSpace.forget C) F i]
  

Proof state:
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
i : Discrete ι
⊢ OpenEmbedding ⇑(colimit.ι (F ⋙ forget C) i ≫ (preservesColimitIso (forget C) F).inv)

Next tactic:
have : _ = _ ≫ colimit.ι (Discrete.functor ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk)) i :=
    HasColimit.isoOfNatIso_ι_hom Discrete.natIsoFunctor i
theorem sigma_ι_openEmbedding : OpenEmbedding (colimit.ι F i).base := by
  rw [← show _ = (colimit.ι F i).base from ι_preservesColimitsIso_inv (SheafedSpace.forget C) F i]
  have : _ = _ ≫ colimit.ι (Discrete.functor ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk)) i :=
    HasColimit.isoOfNatIso_ι_hom Discrete.natIsoFunctor i
  

Proof state:
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
i : Discrete ι
this :
  colimit.ι (F ⋙ forget C) i ≫ (HasColimit.isoOfNatIso Discrete.natIsoFunctor).hom =
    Discrete.natIsoFunctor.hom.app i ≫ colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) i
⊢ OpenEmbedding ⇑(colimit.ι (F ⋙ forget C) i ≫ (preservesColimitIso (forget C) F).inv)

Next tactic:
rw [← Iso.eq_comp_inv] at this
theorem sigma_ι_openEmbedding : OpenEmbedding (colimit.ι F i).base := by
  rw [← show _ = (colimit.ι F i).base from ι_preservesColimitsIso_inv (SheafedSpace.forget C) F i]
  have : _ = _ ≫ colimit.ι (Discrete.functor ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk)) i :=
    HasColimit.isoOfNatIso_ι_hom Discrete.natIsoFunctor i
  rw [← Iso.eq_comp_inv] at this
  

Proof state:
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
i : Discrete ι
this :
  colimit.ι (F ⋙ forget C) i =
    (Discrete.natIsoFunctor.hom.app i ≫
        colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) i) ≫
      (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv
⊢ OpenEmbedding ⇑(colimit.ι (F ⋙ forget C) i ≫ (preservesColimitIso (forget C) F).inv)

Next tactic:
rw [this]
theorem sigma_ι_openEmbedding : OpenEmbedding (colimit.ι F i).base := by
  rw [← show _ = (colimit.ι F i).base from ι_preservesColimitsIso_inv (SheafedSpace.forget C) F i]
  have : _ = _ ≫ colimit.ι (Discrete.functor ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk)) i :=
    HasColimit.isoOfNatIso_ι_hom Discrete.natIsoFunctor i
  rw [← Iso.eq_comp_inv] at this
  rw [this]
  

Proof state:
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
i : Discrete ι
this :
  colimit.ι (F ⋙ forget C) i =
    (Discrete.natIsoFunctor.hom.app i ≫
        colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) i) ≫
      (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv
⊢ OpenEmbedding
    ⇑(((Discrete.natIsoFunctor.hom.app i ≫
            colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) i) ≫
          (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv) ≫
        (preservesColimitIso (forget C) F).inv)

Next tactic:
have : colimit.ι _ _ ≫ _ = _ :=
    TopCat.sigmaIsoSigma_hom_ι.{v, v} ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk) i.as
theorem sigma_ι_openEmbedding : OpenEmbedding (colimit.ι F i).base := by
  rw [← show _ = (colimit.ι F i).base from ι_preservesColimitsIso_inv (SheafedSpace.forget C) F i]
  have : _ = _ ≫ colimit.ι (Discrete.functor ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk)) i :=
    HasColimit.isoOfNatIso_ι_hom Discrete.natIsoFunctor i
  rw [← Iso.eq_comp_inv] at this
  rw [this]
  have : colimit.ι _ _ ≫ _ = _ :=
    TopCat.sigmaIsoSigma_hom_ι.{v, v} ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk) i.as
  

Proof state:
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
i : Discrete ι
this✝ :
  colimit.ι (F ⋙ forget C) i =
    (Discrete.natIsoFunctor.hom.app i ≫
        colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) i) ≫
      (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv
this :
  colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) { as := i.as } ≫
      (TopCat.sigmaIsoSigma ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)).hom =
    TopCat.sigmaι ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk) i.as
⊢ OpenEmbedding
    ⇑(((Discrete.natIsoFunctor.hom.app i ≫
            colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) i) ≫
          (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv) ≫
        (preservesColimitIso (forget C) F).inv)

Next tactic:
rw [← Iso.eq_comp_inv] at this
theorem sigma_ι_openEmbedding : OpenEmbedding (colimit.ι F i).base := by
  rw [← show _ = (colimit.ι F i).base from ι_preservesColimitsIso_inv (SheafedSpace.forget C) F i]
  have : _ = _ ≫ colimit.ι (Discrete.functor ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk)) i :=
    HasColimit.isoOfNatIso_ι_hom Discrete.natIsoFunctor i
  rw [← Iso.eq_comp_inv] at this
  rw [this]
  have : colimit.ι _ _ ≫ _ = _ :=
    TopCat.sigmaIsoSigma_hom_ι.{v, v} ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk) i.as
  rw [← Iso.eq_comp_inv] at this
  

Proof state:
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
i : Discrete ι
this✝ :
  colimit.ι (F ⋙ forget C) i =
    (Discrete.natIsoFunctor.hom.app i ≫
        colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) i) ≫
      (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv
this :
  colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) { as := i.as } =
    TopCat.sigmaι ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk) i.as ≫
      (TopCat.sigmaIsoSigma ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)).inv
⊢ OpenEmbedding
    ⇑(((Discrete.natIsoFunctor.hom.app i ≫
            colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) i) ≫
          (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv) ≫
        (preservesColimitIso (forget C) F).inv)

Next tactic:
cases i
theorem sigma_ι_openEmbedding : OpenEmbedding (colimit.ι F i).base := by
  rw [← show _ = (colimit.ι F i).base from ι_preservesColimitsIso_inv (SheafedSpace.forget C) F i]
  have : _ = _ ≫ colimit.ι (Discrete.functor ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk)) i :=
    HasColimit.isoOfNatIso_ι_hom Discrete.natIsoFunctor i
  rw [← Iso.eq_comp_inv] at this
  rw [this]
  have : colimit.ι _ _ ≫ _ = _ :=
    TopCat.sigmaIsoSigma_hom_ι.{v, v} ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk) i.as
  rw [← Iso.eq_comp_inv] at this
  cases i
  

Proof state:
case mk
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
as✝ : ι
this✝ :
  colimit.ι (F ⋙ forget C) { as := as✝ } =
    (Discrete.natIsoFunctor.hom.app { as := as✝ } ≫
        colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) { as := as✝ }) ≫
      (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv
this :
  colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) { as := { as := as✝ }.as } =
    TopCat.sigmaι ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk) { as := as✝ }.as ≫
      (TopCat.sigmaIsoSigma ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)).inv
⊢ OpenEmbedding
    ⇑(((Discrete.natIsoFunctor.hom.app { as := as✝ } ≫
            colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) { as := as✝ }) ≫
          (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv) ≫
        (preservesColimitIso (forget C) F).inv)

Next tactic:
rw [this, ← Category.assoc]
theorem sigma_ι_openEmbedding : OpenEmbedding (colimit.ι F i).base := by
  rw [← show _ = (colimit.ι F i).base from ι_preservesColimitsIso_inv (SheafedSpace.forget C) F i]
  have : _ = _ ≫ colimit.ι (Discrete.functor ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk)) i :=
    HasColimit.isoOfNatIso_ι_hom Discrete.natIsoFunctor i
  rw [← Iso.eq_comp_inv] at this
  rw [this]
  have : colimit.ι _ _ ≫ _ = _ :=
    TopCat.sigmaIsoSigma_hom_ι.{v, v} ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk) i.as
  rw [← Iso.eq_comp_inv] at this
  cases i
  rw [this, ← Category.assoc]
  -- Porting note : `simp_rw` can't use `TopCat.openEmbedding_iff_comp_isIso` and
  -- `TopCat.openEmbedding_iff_isIso_comp`.
  -- See https://github.com/leanprover-community/mathlib4/issues/5026
  

Proof state:
case mk
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
as✝ : ι
this✝ :
  colimit.ι (F ⋙ forget C) { as := as✝ } =
    (Discrete.natIsoFunctor.hom.app { as := as✝ } ≫
        colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) { as := as✝ }) ≫
      (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv
this :
  colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) { as := { as := as✝ }.as } =
    TopCat.sigmaι ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk) { as := as✝ }.as ≫
      (TopCat.sigmaIsoSigma ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)).inv
⊢ OpenEmbedding
    ⇑((((Discrete.natIsoFunctor.hom.app { as := as✝ } ≫
              TopCat.sigmaι ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk) { as := as✝ }.as) ≫
            (TopCat.sigmaIsoSigma ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)).inv) ≫
          (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv) ≫
        (preservesColimitIso (forget C) F).inv)

Next tactic:
erw [TopCat.openEmbedding_iff_comp_isIso, TopCat.openEmbedding_iff_comp_isIso,
    TopCat.openEmbedding_iff_comp_isIso, TopCat.openEmbedding_iff_isIso_comp]
theorem sigma_ι_openEmbedding : OpenEmbedding (colimit.ι F i).base := by
  rw [← show _ = (colimit.ι F i).base from ι_preservesColimitsIso_inv (SheafedSpace.forget C) F i]
  have : _ = _ ≫ colimit.ι (Discrete.functor ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk)) i :=
    HasColimit.isoOfNatIso_ι_hom Discrete.natIsoFunctor i
  rw [← Iso.eq_comp_inv] at this
  rw [this]
  have : colimit.ι _ _ ≫ _ = _ :=
    TopCat.sigmaIsoSigma_hom_ι.{v, v} ((F ⋙ SheafedSpace.forget C).obj ∘ Discrete.mk) i.as
  rw [← Iso.eq_comp_inv] at this
  cases i
  rw [this, ← Category.assoc]
  -- Porting note : `simp_rw` can't use `TopCat.openEmbedding_iff_comp_isIso` and
  -- `TopCat.openEmbedding_iff_isIso_comp`.
  -- See https://github.com/leanprover-community/mathlib4/issues/5026
  erw [TopCat.openEmbedding_iff_comp_isIso, TopCat.openEmbedding_iff_comp_isIso,
    TopCat.openEmbedding_iff_comp_isIso, TopCat.openEmbedding_iff_isIso_comp]
  

Proof state:
case mk
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
as✝ : ι
this✝ :
  colimit.ι (F ⋙ forget C) { as := as✝ } =
    (Discrete.natIsoFunctor.hom.app { as := as✝ } ≫
        colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) { as := as✝ }) ≫
      (HasColimit.isoOfNatIso Discrete.natIsoFunctor).inv
this :
  colimit.ι (Discrete.functor ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)) { as := { as := as✝ }.as } =
    TopCat.sigmaι ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk) { as := as✝ }.as ≫
      (TopCat.sigmaIsoSigma ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk)).inv
⊢ OpenEmbedding ⇑(TopCat.sigmaι ((F ⋙ forget C).toPrefunctor.obj ∘ Discrete.mk) { as := as✝ }.as)

Next tactic:
exact openEmbedding_sigmaMk
theorem image_preimage_is_empty (j : Discrete ι) (h : i ≠ j) (U : Opens (F.obj i)) :
    (Opens.map (colimit.ι (F ⋙ SheafedSpace.forgetToPresheafedSpace) j).base).obj
        ((Opens.map (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv.base).obj
          ((sigma_ι_openEmbedding F i).isOpenMap.functor.obj U)) =
      ⊥ := by
  

Proof state:
C : Type u_1
inst✝² : Category.{v, u_1} C
inst✝¹ : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝ : HasColimit F
i j : Discrete ι
h : i ≠ j
U : Opens ↑↑(F.obj i).toPresheafedSpace
⊢ (Opens.map (colimit.ι (F ⋙ forgetToPresheafedSpace) j).base).obj
      ((Opens.map (preservesColimitIso forgetToPresheafedSpace F).inv.base).obj
        ((IsOpenMap.functor (_ : IsOpenMap ⇑(colimit.ι F i).base)).obj U)) =
    ⊥

Next tactic:
ext x