l3lab/ntp-mathlib huggingface dataset:
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  

Proof state:
D : GlueData
⊢ Scheme

Next tactic:
apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  

Proof state:
D : GlueData
⊢ ∀ (x : ↑(LocallyRingedSpace.toTopCat (glued (toLocallyRingedSpaceGlueData D).toGlueData))),
    ∃ R f, x ∈ Set.range ⇑f.val.base ∧ LocallyRingedSpace.IsOpenImmersion f

Next tactic:
intro x
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  intro x
  

Proof state:
D : GlueData
x : ↑(LocallyRingedSpace.toTopCat (glued (toLocallyRingedSpaceGlueData D).toGlueData))
⊢ ∃ R f, x ∈ Set.range ⇑f.val.base ∧ LocallyRingedSpace.IsOpenImmersion f

Next tactic:
obtain ⟨i, y, rfl⟩ := D.toLocallyRingedSpaceGlueData.ι_jointly_surjective x
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  intro x
  obtain ⟨i, y, rfl⟩ := D.toLocallyRingedSpaceGlueData.ι_jointly_surjective x
  

Proof state:
case intro.intro
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ ∃ R f,
    (ι (toLocallyRingedSpaceGlueData D).toGlueData i).val.base y ∈ Set.range ⇑f.val.base ∧
      LocallyRingedSpace.IsOpenImmersion f

Next tactic:
refine' ⟨_, _ ≫ D.toLocallyRingedSpaceGlueData.toGlueData.ι i, _⟩
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  intro x
  obtain ⟨i, y, rfl⟩ := D.toLocallyRingedSpaceGlueData.ι_jointly_surjective x
  refine' ⟨_, _ ≫ D.toLocallyRingedSpaceGlueData.toGlueData.ι i, _⟩
  

Proof state:
case intro.intro.refine'_1
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ CommRingCat
case intro.intro.refine'_2
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ Spec.toLocallyRingedSpace.obj (op ?intro.intro.refine'_1) ⟶ U (toLocallyRingedSpaceGlueData D).toGlueData i
case intro.intro.refine'_3
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ (ι (toLocallyRingedSpaceGlueData D).toGlueData i).val.base y ∈
      Set.range ⇑(?intro.intro.refine'_2 ≫ ι (toLocallyRingedSpaceGlueData D).toGlueData i).val.base ∧
    LocallyRingedSpace.IsOpenImmersion (?intro.intro.refine'_2 ≫ ι (toLocallyRingedSpaceGlueData D).toGlueData i)

Next tactic:
swap
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  intro x
  obtain ⟨i, y, rfl⟩ := D.toLocallyRingedSpaceGlueData.ι_jointly_surjective x
  refine' ⟨_, _ ≫ D.toLocallyRingedSpaceGlueData.toGlueData.ι i, _⟩
  swap; 

Proof state:
case intro.intro.refine'_2
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ Spec.toLocallyRingedSpace.obj (op ?intro.intro.refine'_1) ⟶ U (toLocallyRingedSpaceGlueData D).toGlueData i
case intro.intro.refine'_1
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ CommRingCat
case intro.intro.refine'_3
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ (ι (toLocallyRingedSpaceGlueData D).toGlueData i).val.base y ∈
      Set.range ⇑(?intro.intro.refine'_2 ≫ ι (toLocallyRingedSpaceGlueData D).toGlueData i).val.base ∧
    LocallyRingedSpace.IsOpenImmersion (?intro.intro.refine'_2 ≫ ι (toLocallyRingedSpaceGlueData D).toGlueData i)

Next tactic:
exact (D.U i).affineCover.map y
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  intro x
  obtain ⟨i, y, rfl⟩ := D.toLocallyRingedSpaceGlueData.ι_jointly_surjective x
  refine' ⟨_, _ ≫ D.toLocallyRingedSpaceGlueData.toGlueData.ι i, _⟩
  swap; exact (D.U i).affineCover.map y
  

Proof state:
case intro.intro.refine'_3
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ (ι (toLocallyRingedSpaceGlueData D).toGlueData i).val.base y ∈
      Set.range
        ⇑(OpenCover.map (affineCover (U D.toGlueData i)) y ≫ ι (toLocallyRingedSpaceGlueData D).toGlueData i).val.base ∧
    LocallyRingedSpace.IsOpenImmersion
      (OpenCover.map (affineCover (U D.toGlueData i)) y ≫ ι (toLocallyRingedSpaceGlueData D).toGlueData i)

Next tactic:
constructor
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  intro x
  obtain ⟨i, y, rfl⟩ := D.toLocallyRingedSpaceGlueData.ι_jointly_surjective x
  refine' ⟨_, _ ≫ D.toLocallyRingedSpaceGlueData.toGlueData.ι i, _⟩
  swap; exact (D.U i).affineCover.map y
  constructor
  · 

Proof state:
case intro.intro.refine'_3.left
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ (ι (toLocallyRingedSpaceGlueData D).toGlueData i).val.base y ∈
    Set.range
      ⇑(OpenCover.map (affineCover (U D.toGlueData i)) y ≫ ι (toLocallyRingedSpaceGlueData D).toGlueData i).val.base

Next tactic:
dsimp [-Set.mem_range]
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  intro x
  obtain ⟨i, y, rfl⟩ := D.toLocallyRingedSpaceGlueData.ι_jointly_surjective x
  refine' ⟨_, _ ≫ D.toLocallyRingedSpaceGlueData.toGlueData.ι i, _⟩
  swap; exact (D.U i).affineCover.map y
  constructor
  · dsimp [-Set.mem_range]
    

Proof state:
case intro.intro.refine'_3.left
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ (ι (mapGlueData D.toGlueData forgetToLocallyRingedSpace) i).val.base y ∈
    Set.range
      ⇑((OpenCover.map (affineCover (U D.toGlueData i)) y).val.base ≫
          (ι (mapGlueData D.toGlueData forgetToLocallyRingedSpace) i).val.base)

Next tactic:
rw [coe_comp, Set.range_comp]
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  intro x
  obtain ⟨i, y, rfl⟩ := D.toLocallyRingedSpaceGlueData.ι_jointly_surjective x
  refine' ⟨_, _ ≫ D.toLocallyRingedSpaceGlueData.toGlueData.ι i, _⟩
  swap; exact (D.U i).affineCover.map y
  constructor
  · dsimp [-Set.mem_range]
    rw [coe_comp, Set.range_comp]
    

Proof state:
case intro.intro.refine'_3.left
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ (ι (mapGlueData D.toGlueData forgetToLocallyRingedSpace) i).val.base y ∈
    ⇑(ι (mapGlueData D.toGlueData forgetToLocallyRingedSpace) i).val.base ''
      Set.range ⇑(OpenCover.map (affineCover (U D.toGlueData i)) y).val.base

Next tactic:
refine' Set.mem_image_of_mem _ _
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  intro x
  obtain ⟨i, y, rfl⟩ := D.toLocallyRingedSpaceGlueData.ι_jointly_surjective x
  refine' ⟨_, _ ≫ D.toLocallyRingedSpaceGlueData.toGlueData.ι i, _⟩
  swap; exact (D.U i).affineCover.map y
  constructor
  · dsimp [-Set.mem_range]
    rw [coe_comp, Set.range_comp]
    refine' Set.mem_image_of_mem _ _
    

Proof state:
case intro.intro.refine'_3.left
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ y ∈ Set.range ⇑(OpenCover.map (affineCover (U D.toGlueData i)) y).val.base

Next tactic:
exact (D.U i).affineCover.Covers y
/-- (Implementation). The glued scheme of a glue data.
This should not be used outside this file. Use `AlgebraicGeometry.Scheme.GlueData.glued` instead. -/
def gluedScheme : Scheme := by
  apply LocallyRingedSpace.IsOpenImmersion.scheme
    D.toLocallyRingedSpaceGlueData.toGlueData.glued
  intro x
  obtain ⟨i, y, rfl⟩ := D.toLocallyRingedSpaceGlueData.ι_jointly_surjective x
  refine' ⟨_, _ ≫ D.toLocallyRingedSpaceGlueData.toGlueData.ι i, _⟩
  swap; exact (D.U i).affineCover.map y
  constructor
  · dsimp [-Set.mem_range]
    rw [coe_comp, Set.range_comp]
    refine' Set.mem_image_of_mem _ _
    exact (D.U i).affineCover.Covers y
  · 

Proof state:
case intro.intro.refine'_3.right
D : GlueData
i : (toLocallyRingedSpaceGlueData D).toGlueData.J
y : ↑(LocallyRingedSpace.toTopCat (U (toLocallyRingedSpaceGlueData D).toGlueData i))
⊢ LocallyRingedSpace.IsOpenImmersion
    (OpenCover.map (affineCover (U D.toGlueData i)) y ≫ ι (toLocallyRingedSpaceGlueData D).toGlueData i)

Next tactic:
infer_instance
instance ι_isOpenImmersion (i : D.J) : IsOpenImmersion (𝖣.ι i) := by
  

Proof state:
D : GlueData
i : D.J
⊢ IsOpenImmersion (CategoryTheory.GlueData.ι D.toGlueData i)

Next tactic:
rw [← D.ι_isoLocallyRingedSpace_inv]
instance ι_isOpenImmersion (i : D.J) : IsOpenImmersion (𝖣.ι i) := by
  rw [← D.ι_isoLocallyRingedSpace_inv]; 

Proof state:
D : GlueData
i : D.J
⊢ IsOpenImmersion
    (CategoryTheory.GlueData.ι (toLocallyRingedSpaceGlueData D).toGlueData i ≫ (isoLocallyRingedSpace D).inv)

Next tactic:
infer_instance
/-- The pullback cone spanned by `V i j ⟶ U i` and `V i j ⟶ U j`.
This is a pullback diagram (`vPullbackConeIsLimit`). -/
def vPullbackCone (i j : D.J) : PullbackCone (D.ι i) (D.ι j) :=
  PullbackCone.mk (D.f i j) (D.t i j ≫ D.f j i) (by 

Proof state:
D : GlueData
i j : D.J
⊢ f D.toGlueData i j ≫ ι D i = (t D.toGlueData i j ≫ f D.toGlueData j i) ≫ ι D j

Next tactic:
simp
/-- The underlying topological space of the glued scheme is isomorphic to the gluing of the
underlying spaces -/
def isoCarrier :
    D.glued.carrier ≅ (D_).glued := by
  

Proof state:
D : GlueData
⊢ ↑(glued D).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace ≅
    CategoryTheory.GlueData.glued
      (GlueData.toTopGlueData
          (SheafedSpace.GlueData.toPresheafedSpaceGlueData
            (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData

Next tactic:
refine (PresheafedSpace.forget _).mapIso ?_ ≪≫
    GlueData.gluedIso _ (PresheafedSpace.forget.{_, _, u} _)
/-- The underlying topological space of the glued scheme is isomorphic to the gluing of the
underlying spaces -/
def isoCarrier :
    D.glued.carrier ≅ (D_).glued := by
  refine (PresheafedSpace.forget _).mapIso ?_ ≪≫
    GlueData.gluedIso _ (PresheafedSpace.forget.{_, _, u} _)
  

Proof state:
D : GlueData
⊢ (glued D).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace ≅
    CategoryTheory.GlueData.glued
      (SheafedSpace.GlueData.toPresheafedSpaceGlueData
          (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D))).toGlueData

Next tactic:
refine SheafedSpace.forgetToPresheafedSpace.mapIso ?_ ≪≫
    SheafedSpace.GlueData.isoPresheafedSpace _
/-- The underlying topological space of the glued scheme is isomorphic to the gluing of the
underlying spaces -/
def isoCarrier :
    D.glued.carrier ≅ (D_).glued := by
  refine (PresheafedSpace.forget _).mapIso ?_ ≪≫
    GlueData.gluedIso _ (PresheafedSpace.forget.{_, _, u} _)
  refine SheafedSpace.forgetToPresheafedSpace.mapIso ?_ ≪≫
    SheafedSpace.GlueData.isoPresheafedSpace _
  

Proof state:
D : GlueData
⊢ (glued D).toLocallyRingedSpace.toSheafedSpace ≅
    CategoryTheory.GlueData.glued
      (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)).toGlueData

Next tactic:
refine LocallyRingedSpace.forgetToSheafedSpace.mapIso ?_ ≪≫
    LocallyRingedSpace.GlueData.isoSheafedSpace _
/-- The underlying topological space of the glued scheme is isomorphic to the gluing of the
underlying spaces -/
def isoCarrier :
    D.glued.carrier ≅ (D_).glued := by
  refine (PresheafedSpace.forget _).mapIso ?_ ≪≫
    GlueData.gluedIso _ (PresheafedSpace.forget.{_, _, u} _)
  refine SheafedSpace.forgetToPresheafedSpace.mapIso ?_ ≪≫
    SheafedSpace.GlueData.isoPresheafedSpace _
  refine LocallyRingedSpace.forgetToSheafedSpace.mapIso ?_ ≪≫
    LocallyRingedSpace.GlueData.isoSheafedSpace _
  

Proof state:
D : GlueData
⊢ (glued D).toLocallyRingedSpace ≅ CategoryTheory.GlueData.glued (toLocallyRingedSpaceGlueData D).toGlueData

Next tactic:
exact Scheme.GlueData.isoLocallyRingedSpace _
@[simp]
theorem ι_isoCarrier_inv (i : D.J) :
    (D_).ι i ≫ D.isoCarrier.inv = (D.ι i).1.base := by
  

Proof state:
D : GlueData
i : D.J
⊢ CategoryTheory.GlueData.ι
        (GlueData.toTopGlueData
            (SheafedSpace.GlueData.toPresheafedSpaceGlueData
              (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
        i ≫
      (isoCarrier D).inv =
    (ι D i).val.base

Next tactic:
delta isoCarrier
@[simp]
theorem ι_isoCarrier_inv (i : D.J) :
    (D_).ι i ≫ D.isoCarrier.inv = (D.ι i).1.base := by
  delta isoCarrier
  

Proof state:
D : GlueData
i : D.J
⊢ CategoryTheory.GlueData.ι
        (GlueData.toTopGlueData
            (SheafedSpace.GlueData.toPresheafedSpaceGlueData
              (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
        i ≫
      ((PresheafedSpace.forget CommRingCat).mapIso
            (SheafedSpace.forgetToPresheafedSpace.mapIso
                (LocallyRingedSpace.forgetToSheafedSpace.mapIso (isoLocallyRingedSpace D) ≪≫
                  LocallyRingedSpace.GlueData.isoSheafedSpace (toLocallyRingedSpaceGlueData D)) ≪≫
              SheafedSpace.GlueData.isoPresheafedSpace
                (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D))) ≪≫
          gluedIso
            (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D))).toGlueData
            (PresheafedSpace.forget CommRingCat)).inv =
    (ι D i).val.base

Next tactic:
rw [Iso.trans_inv, GlueData.ι_gluedIso_inv_assoc, Functor.mapIso_inv, Iso.trans_inv,
    Functor.mapIso_inv, Iso.trans_inv, SheafedSpace.forgetToPresheafedSpace_map, forget_map,
    forget_map, ← comp_base, ← Category.assoc,
    D.toLocallyRingedSpaceGlueData.toSheafedSpaceGlueData.ι_isoPresheafedSpace_inv i]
@[simp]
theorem ι_isoCarrier_inv (i : D.J) :
    (D_).ι i ≫ D.isoCarrier.inv = (D.ι i).1.base := by
  delta isoCarrier
  rw [Iso.trans_inv, GlueData.ι_gluedIso_inv_assoc, Functor.mapIso_inv, Iso.trans_inv,
    Functor.mapIso_inv, Iso.trans_inv, SheafedSpace.forgetToPresheafedSpace_map, forget_map,
    forget_map, ← comp_base, ← Category.assoc,
    D.toLocallyRingedSpaceGlueData.toSheafedSpaceGlueData.ι_isoPresheafedSpace_inv i]
  

Proof state:
D : GlueData
i : D.J
⊢ (CategoryTheory.GlueData.ι
          (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)).toGlueData i ≫
        (LocallyRingedSpace.GlueData.isoSheafedSpace (toLocallyRingedSpaceGlueData D)).inv ≫
          (LocallyRingedSpace.forgetToSheafedSpace.mapIso (isoLocallyRingedSpace D)).inv).base =
    (ι D i).val.base

Next tactic:
erw [← Category.assoc, D.toLocallyRingedSpaceGlueData.ι_isoSheafedSpace_inv i]
@[simp]
theorem ι_isoCarrier_inv (i : D.J) :
    (D_).ι i ≫ D.isoCarrier.inv = (D.ι i).1.base := by
  delta isoCarrier
  rw [Iso.trans_inv, GlueData.ι_gluedIso_inv_assoc, Functor.mapIso_inv, Iso.trans_inv,
    Functor.mapIso_inv, Iso.trans_inv, SheafedSpace.forgetToPresheafedSpace_map, forget_map,
    forget_map, ← comp_base, ← Category.assoc,
    D.toLocallyRingedSpaceGlueData.toSheafedSpaceGlueData.ι_isoPresheafedSpace_inv i]
  erw [← Category.assoc, D.toLocallyRingedSpaceGlueData.ι_isoSheafedSpace_inv i]
  

Proof state:
D : GlueData
i : D.J
⊢ ((CategoryTheory.GlueData.ι (toLocallyRingedSpaceGlueData D).toGlueData i).val ≫
        (LocallyRingedSpace.forgetToSheafedSpace.mapIso (isoLocallyRingedSpace D)).inv).base =
    (ι D i).val.base

Next tactic:
change (_ ≫ D.isoLocallyRingedSpace.inv).1.base = _
@[simp]
theorem ι_isoCarrier_inv (i : D.J) :
    (D_).ι i ≫ D.isoCarrier.inv = (D.ι i).1.base := by
  delta isoCarrier
  rw [Iso.trans_inv, GlueData.ι_gluedIso_inv_assoc, Functor.mapIso_inv, Iso.trans_inv,
    Functor.mapIso_inv, Iso.trans_inv, SheafedSpace.forgetToPresheafedSpace_map, forget_map,
    forget_map, ← comp_base, ← Category.assoc,
    D.toLocallyRingedSpaceGlueData.toSheafedSpaceGlueData.ι_isoPresheafedSpace_inv i]
  erw [← Category.assoc, D.toLocallyRingedSpaceGlueData.ι_isoSheafedSpace_inv i]
  change (_ ≫ D.isoLocallyRingedSpace.inv).1.base = _
  

Proof state:
D : GlueData
i : D.J
⊢ (CategoryTheory.GlueData.ι (toLocallyRingedSpaceGlueData D).toGlueData i ≫ (isoLocallyRingedSpace D).inv).val.base =
    (ι D i).val.base

Next tactic:
rw [D.ι_isoLocallyRingedSpace_inv i]
theorem ι_eq_iff (i j : D.J) (x : (D.U i).carrier) (y : (D.U j).carrier) :
    (𝖣.ι i).1.base x = (𝖣.ι j).1.base y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  

Proof state:
D : GlueData
i j : D.J
x : ↑↑(U D.toGlueData i).toPresheafedSpace
y : ↑↑(U D.toGlueData j).toPresheafedSpace
⊢ (CategoryTheory.GlueData.ι D.toGlueData i).val.base x = (CategoryTheory.GlueData.ι D.toGlueData j).val.base y ↔
    Rel D { fst := i, snd := x } { fst := j, snd := y }

Next tactic:
refine' Iff.trans _
    (TopCat.GlueData.ι_eq_iff_rel
      D.toLocallyRingedSpaceGlueData.toSheafedSpaceGlueData.toPresheafedSpaceGlueData.toTopGlueData
      i j x y)
theorem ι_eq_iff (i j : D.J) (x : (D.U i).carrier) (y : (D.U j).carrier) :
    (𝖣.ι i).1.base x = (𝖣.ι j).1.base y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  refine' Iff.trans _
    (TopCat.GlueData.ι_eq_iff_rel
      D.toLocallyRingedSpaceGlueData.toSheafedSpaceGlueData.toPresheafedSpaceGlueData.toTopGlueData
      i j x y)
  

Proof state:
D : GlueData
i j : D.J
x : ↑↑(U D.toGlueData i).toPresheafedSpace
y : ↑↑(U D.toGlueData j).toPresheafedSpace
⊢ (CategoryTheory.GlueData.ι D.toGlueData i).val.base x = (CategoryTheory.GlueData.ι D.toGlueData j).val.base y ↔
    (CategoryTheory.GlueData.ι
          (GlueData.toTopGlueData
              (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
          i)
        x =
      (CategoryTheory.GlueData.ι
          (GlueData.toTopGlueData
              (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
          j)
        y

Next tactic:
rw [← ((TopCat.mono_iff_injective D.isoCarrier.inv).mp _).eq_iff]
theorem ι_eq_iff (i j : D.J) (x : (D.U i).carrier) (y : (D.U j).carrier) :
    (𝖣.ι i).1.base x = (𝖣.ι j).1.base y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  refine' Iff.trans _
    (TopCat.GlueData.ι_eq_iff_rel
      D.toLocallyRingedSpaceGlueData.toSheafedSpaceGlueData.toPresheafedSpaceGlueData.toTopGlueData
      i j x y)
  rw [← ((TopCat.mono_iff_injective D.isoCarrier.inv).mp _).eq_iff]
  · 

Proof state:
D : GlueData
i j : D.J
x : ↑↑(U D.toGlueData i).toPresheafedSpace
y : ↑↑(U D.toGlueData j).toPresheafedSpace
⊢ (CategoryTheory.GlueData.ι D.toGlueData i).val.base x = (CategoryTheory.GlueData.ι D.toGlueData j).val.base y ↔
    (isoCarrier D).inv
        ((CategoryTheory.GlueData.ι
            (GlueData.toTopGlueData
                (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                  (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
            i)
          x) =
      (isoCarrier D).inv
        ((CategoryTheory.GlueData.ι
            (GlueData.toTopGlueData
                (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                  (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
            j)
          y)

Next tactic:
simp_rw [← comp_apply, ← D.ι_isoCarrier_inv]
theorem ι_eq_iff (i j : D.J) (x : (D.U i).carrier) (y : (D.U j).carrier) :
    (𝖣.ι i).1.base x = (𝖣.ι j).1.base y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  refine' Iff.trans _
    (TopCat.GlueData.ι_eq_iff_rel
      D.toLocallyRingedSpaceGlueData.toSheafedSpaceGlueData.toPresheafedSpaceGlueData.toTopGlueData
      i j x y)
  rw [← ((TopCat.mono_iff_injective D.isoCarrier.inv).mp _).eq_iff]
  · simp_rw [← comp_apply, ← D.ι_isoCarrier_inv]; 

Proof state:
D : GlueData
i j : D.J
x : ↑↑(U D.toGlueData i).toPresheafedSpace
y : ↑↑(U D.toGlueData j).toPresheafedSpace
⊢ (CategoryTheory.GlueData.ι
            (mapGlueData
              (mapGlueData
                (mapGlueData (mapGlueData D.toGlueData forgetToLocallyRingedSpace)
                  LocallyRingedSpace.forgetToSheafedSpace)
                SheafedSpace.forgetToPresheafedSpace)
              (PresheafedSpace.forget CommRingCat))
            i ≫
          (isoCarrier D).inv)
        x =
      (CategoryTheory.GlueData.ι
            (mapGlueData
              (mapGlueData
                (mapGlueData (mapGlueData D.toGlueData forgetToLocallyRingedSpace)
                  LocallyRingedSpace.forgetToSheafedSpace)
                SheafedSpace.forgetToPresheafedSpace)
              (PresheafedSpace.forget CommRingCat))
            j ≫
          (isoCarrier D).inv)
        y ↔
    (CategoryTheory.GlueData.ι
            (mapGlueData
              (mapGlueData
                (mapGlueData (mapGlueData D.toGlueData forgetToLocallyRingedSpace)
                  LocallyRingedSpace.forgetToSheafedSpace)
                SheafedSpace.forgetToPresheafedSpace)
              (PresheafedSpace.forget CommRingCat))
            i ≫
          (isoCarrier D).inv)
        x =
      (CategoryTheory.GlueData.ι
            (mapGlueData
              (mapGlueData
                (mapGlueData (mapGlueData D.toGlueData forgetToLocallyRingedSpace)
                  LocallyRingedSpace.forgetToSheafedSpace)
                SheafedSpace.forgetToPresheafedSpace)
              (PresheafedSpace.forget CommRingCat))
            j ≫
          (isoCarrier D).inv)
        y

Next tactic:
rfl