l3lab/ntp-mathlib huggingface dataset:
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]; rfl
  · 

Proof state:
D : GlueData
i j : D.J
x : ↑↑(U D.toGlueData i).toPresheafedSpace
y : ↑↑(U D.toGlueData j).toPresheafedSpace
⊢ Mono (isoCarrier D).inv

Next tactic:
infer_instance
theorem isOpen_iff (U : Set D.glued.carrier) : IsOpen U ↔ ∀ i, IsOpen ((D.ι i).1.base ⁻¹' U) := by
  

Proof state:
D : GlueData
U : Set ↑↑(glued D).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ IsOpen U ↔ ∀ (i : D.J), IsOpen (⇑(ι D i).val.base ⁻¹' U)

Next tactic:
rw [← (TopCat.homeoOfIso D.isoCarrier.symm).isOpen_preimage]
theorem isOpen_iff (U : Set D.glued.carrier) : IsOpen U ↔ ∀ i, IsOpen ((D.ι i).1.base ⁻¹' U) := by
  rw [← (TopCat.homeoOfIso D.isoCarrier.symm).isOpen_preimage]
  

Proof state:
D : GlueData
U : Set ↑↑(glued D).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ IsOpen (⇑(TopCat.homeoOfIso (isoCarrier D).symm) ⁻¹' U) ↔ ∀ (i : D.J), IsOpen (⇑(ι D i).val.base ⁻¹' U)

Next tactic:
rw [TopCat.GlueData.isOpen_iff]
theorem isOpen_iff (U : Set D.glued.carrier) : IsOpen U ↔ ∀ i, IsOpen ((D.ι i).1.base ⁻¹' U) := by
  rw [← (TopCat.homeoOfIso D.isoCarrier.symm).isOpen_preimage]
  rw [TopCat.GlueData.isOpen_iff]
  

Proof state:
D : GlueData
U : Set ↑↑(glued D).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ (∀
      (i :
        (GlueData.toTopGlueData
              (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData.J),
      IsOpen
        (⇑(CategoryTheory.GlueData.ι
              (GlueData.toTopGlueData
                  (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                    (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
              i) ⁻¹'
          (⇑(TopCat.homeoOfIso (isoCarrier D).symm) ⁻¹' U))) ↔
    ∀ (i : D.J), IsOpen (⇑(ι D i).val.base ⁻¹' U)

Next tactic:
apply forall_congr'
theorem isOpen_iff (U : Set D.glued.carrier) : IsOpen U ↔ ∀ i, IsOpen ((D.ι i).1.base ⁻¹' U) := by
  rw [← (TopCat.homeoOfIso D.isoCarrier.symm).isOpen_preimage]
  rw [TopCat.GlueData.isOpen_iff]
  apply forall_congr'
  

Proof state:
case h
D : GlueData
U : Set ↑↑(glued D).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ ∀
    (a :
      (GlueData.toTopGlueData
            (SheafedSpace.GlueData.toPresheafedSpaceGlueData
              (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData.J),
    IsOpen
        (⇑(CategoryTheory.GlueData.ι
              (GlueData.toTopGlueData
                  (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                    (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
              a) ⁻¹'
          (⇑(TopCat.homeoOfIso (isoCarrier D).symm) ⁻¹' U)) ↔
      IsOpen (⇑(ι D a).val.base ⁻¹' U)

Next tactic:
intro i
theorem isOpen_iff (U : Set D.glued.carrier) : IsOpen U ↔ ∀ i, IsOpen ((D.ι i).1.base ⁻¹' U) := by
  rw [← (TopCat.homeoOfIso D.isoCarrier.symm).isOpen_preimage]
  rw [TopCat.GlueData.isOpen_iff]
  apply forall_congr'
  intro i
  

Proof state:
case h
D : GlueData
U : Set ↑↑(glued D).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
i :
  (GlueData.toTopGlueData
        (SheafedSpace.GlueData.toPresheafedSpaceGlueData
          (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData.J
⊢ IsOpen
      (⇑(CategoryTheory.GlueData.ι
            (GlueData.toTopGlueData
                (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                  (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
            i) ⁻¹'
        (⇑(TopCat.homeoOfIso (isoCarrier D).symm) ⁻¹' U)) ↔
    IsOpen (⇑(ι D i).val.base ⁻¹' U)

Next tactic:
erw [← Set.preimage_comp, ← ι_isoCarrier_inv]
theorem isOpen_iff (U : Set D.glued.carrier) : IsOpen U ↔ ∀ i, IsOpen ((D.ι i).1.base ⁻¹' U) := by
  rw [← (TopCat.homeoOfIso D.isoCarrier.symm).isOpen_preimage]
  rw [TopCat.GlueData.isOpen_iff]
  apply forall_congr'
  intro i
  erw [← Set.preimage_comp, ← ι_isoCarrier_inv]
  

Proof state:
case h
D : GlueData
U : Set ↑↑(glued D).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
i :
  (GlueData.toTopGlueData
        (SheafedSpace.GlueData.toPresheafedSpaceGlueData
          (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData.J
⊢ IsOpen
      (⇑(TopCat.homeoOfIso (isoCarrier D).symm) ∘
          ⇑(CategoryTheory.GlueData.ι
              (GlueData.toTopGlueData
                  (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                    (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
              i) ⁻¹'
        U) ↔
    IsOpen
      (⇑(CategoryTheory.GlueData.ι
              (GlueData.toTopGlueData
                  (SheafedSpace.GlueData.toPresheafedSpaceGlueData
                    (LocallyRingedSpace.GlueData.toSheafedSpaceGlueData (toLocallyRingedSpaceGlueData D)))).toGlueData
              i ≫
            (isoCarrier D).inv) ⁻¹'
        U)

Next tactic:
rfl
/-- (Implementation) the transition maps in the glue data associated with an open cover. -/
def gluedCoverT' (x y z : 𝒰.J) :
    pullback (pullback.fst : pullback (𝒰.map x) (𝒰.map y) ⟶ _)
        (pullback.fst : pullback (𝒰.map x) (𝒰.map z) ⟶ _) ⟶
      pullback (pullback.fst : pullback (𝒰.map y) (𝒰.map z) ⟶ _)
        (pullback.fst : pullback (𝒰.map y) (𝒰.map x) ⟶ _) := by
  

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ pullback pullback.fst pullback.fst ⟶ pullback pullback.fst pullback.fst

Next tactic:
refine' (pullbackRightPullbackFstIso _ _ _).hom ≫ _
/-- (Implementation) the transition maps in the glue data associated with an open cover. -/
def gluedCoverT' (x y z : 𝒰.J) :
    pullback (pullback.fst : pullback (𝒰.map x) (𝒰.map y) ⟶ _)
        (pullback.fst : pullback (𝒰.map x) (𝒰.map z) ⟶ _) ⟶
      pullback (pullback.fst : pullback (𝒰.map y) (𝒰.map z) ⟶ _)
        (pullback.fst : pullback (𝒰.map y) (𝒰.map x) ⟶ _) := by
  refine' (pullbackRightPullbackFstIso _ _ _).hom ≫ _
  

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ pullback (pullback.fst ≫ map 𝒰 x) (map 𝒰 z) ⟶ pullback pullback.fst pullback.fst

Next tactic:
refine' _ ≫ (pullbackSymmetry _ _).hom
/-- (Implementation) the transition maps in the glue data associated with an open cover. -/
def gluedCoverT' (x y z : 𝒰.J) :
    pullback (pullback.fst : pullback (𝒰.map x) (𝒰.map y) ⟶ _)
        (pullback.fst : pullback (𝒰.map x) (𝒰.map z) ⟶ _) ⟶
      pullback (pullback.fst : pullback (𝒰.map y) (𝒰.map z) ⟶ _)
        (pullback.fst : pullback (𝒰.map y) (𝒰.map x) ⟶ _) := by
  refine' (pullbackRightPullbackFstIso _ _ _).hom ≫ _
  refine' _ ≫ (pullbackSymmetry _ _).hom
  

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ pullback (pullback.fst ≫ map 𝒰 x) (map 𝒰 z) ⟶ pullback pullback.fst pullback.fst

Next tactic:
refine' _ ≫ (pullbackRightPullbackFstIso _ _ _).inv
/-- (Implementation) the transition maps in the glue data associated with an open cover. -/
def gluedCoverT' (x y z : 𝒰.J) :
    pullback (pullback.fst : pullback (𝒰.map x) (𝒰.map y) ⟶ _)
        (pullback.fst : pullback (𝒰.map x) (𝒰.map z) ⟶ _) ⟶
      pullback (pullback.fst : pullback (𝒰.map y) (𝒰.map z) ⟶ _)
        (pullback.fst : pullback (𝒰.map y) (𝒰.map x) ⟶ _) := by
  refine' (pullbackRightPullbackFstIso _ _ _).hom ≫ _
  refine' _ ≫ (pullbackSymmetry _ _).hom
  refine' _ ≫ (pullbackRightPullbackFstIso _ _ _).inv
  

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ pullback (pullback.fst ≫ map 𝒰 x) (map 𝒰 z) ⟶ pullback (pullback.fst ≫ map 𝒰 y) (map 𝒰 z)

Next tactic:
refine' pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) _ _
/-- (Implementation) the transition maps in the glue data associated with an open cover. -/
def gluedCoverT' (x y z : 𝒰.J) :
    pullback (pullback.fst : pullback (𝒰.map x) (𝒰.map y) ⟶ _)
        (pullback.fst : pullback (𝒰.map x) (𝒰.map z) ⟶ _) ⟶
      pullback (pullback.fst : pullback (𝒰.map y) (𝒰.map z) ⟶ _)
        (pullback.fst : pullback (𝒰.map y) (𝒰.map x) ⟶ _) := by
  refine' (pullbackRightPullbackFstIso _ _ _).hom ≫ _
  refine' _ ≫ (pullbackSymmetry _ _).hom
  refine' _ ≫ (pullbackRightPullbackFstIso _ _ _).inv
  refine' pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) _ _
  · 

Proof state:
case refine'_1
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ (pullback.fst ≫ map 𝒰 x) ≫ 𝟙 X = (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom ≫ pullback.fst ≫ map 𝒰 y

Next tactic:
simp [pullback.condition]
/-- (Implementation) the transition maps in the glue data associated with an open cover. -/
def gluedCoverT' (x y z : 𝒰.J) :
    pullback (pullback.fst : pullback (𝒰.map x) (𝒰.map y) ⟶ _)
        (pullback.fst : pullback (𝒰.map x) (𝒰.map z) ⟶ _) ⟶
      pullback (pullback.fst : pullback (𝒰.map y) (𝒰.map z) ⟶ _)
        (pullback.fst : pullback (𝒰.map y) (𝒰.map x) ⟶ _) := by
  refine' (pullbackRightPullbackFstIso _ _ _).hom ≫ _
  refine' _ ≫ (pullbackSymmetry _ _).hom
  refine' _ ≫ (pullbackRightPullbackFstIso _ _ _).inv
  refine' pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) _ _
  · simp [pullback.condition]
  · 

Proof state:
case refine'_2
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ map 𝒰 z ≫ 𝟙 X = 𝟙 (obj 𝒰 z) ≫ map 𝒰 z

Next tactic:
simp
@[simp, reassoc]
theorem gluedCoverT'_fst_fst (x y z : 𝒰.J) :
    𝒰.gluedCoverT' x y z ≫ pullback.fst ≫ pullback.fst = pullback.fst ≫ pullback.snd := by
  

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ gluedCoverT' 𝒰 x y z ≫ pullback.fst ≫ pullback.fst = pullback.fst ≫ pullback.snd

Next tactic:
delta gluedCoverT'
@[simp, reassoc]
theorem gluedCoverT'_fst_fst (x y z : 𝒰.J) :
    𝒰.gluedCoverT' x y z ≫ pullback.fst ≫ pullback.fst = pullback.fst ≫ pullback.snd := by
  delta gluedCoverT'; 

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ ((pullbackRightPullbackFstIso (map 𝒰 x) (map 𝒰 z) pullback.fst).hom ≫
        (pullback.map (pullback.fst ≫ map 𝒰 x) (map 𝒰 z) (pullback.fst ≫ map 𝒰 y) (map 𝒰 z)
              (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom (𝟙 (obj 𝒰 z)) (𝟙 X)
              (_ : (pullback.fst ≫ map 𝒰 x) ≫ 𝟙 X = (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom ≫ pullback.fst ≫ map 𝒰 y)
              (_ : map 𝒰 z ≫ 𝟙 X = 𝟙 (obj 𝒰 z) ≫ map 𝒰 z) ≫
            (pullbackRightPullbackFstIso (map 𝒰 y) (map 𝒰 z) pullback.fst).inv) ≫
          (pullbackSymmetry pullback.fst pullback.fst).hom) ≫
      pullback.fst ≫ pullback.fst =
    pullback.fst ≫ pullback.snd

Next tactic:
simp
@[simp, reassoc]
theorem gluedCoverT'_fst_snd (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ pullback.fst ≫ pullback.snd = pullback.snd ≫ pullback.snd := by
  

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ gluedCoverT' 𝒰 x y z ≫ pullback.fst ≫ pullback.snd = pullback.snd ≫ pullback.snd

Next tactic:
delta gluedCoverT'
@[simp, reassoc]
theorem gluedCoverT'_fst_snd (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ pullback.fst ≫ pullback.snd = pullback.snd ≫ pullback.snd := by
  delta gluedCoverT'; 

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ ((pullbackRightPullbackFstIso (map 𝒰 x) (map 𝒰 z) pullback.fst).hom ≫
        (pullback.map (pullback.fst ≫ map 𝒰 x) (map 𝒰 z) (pullback.fst ≫ map 𝒰 y) (map 𝒰 z)
              (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom (𝟙 (obj 𝒰 z)) (𝟙 X)
              (_ : (pullback.fst ≫ map 𝒰 x) ≫ 𝟙 X = (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom ≫ pullback.fst ≫ map 𝒰 y)
              (_ : map 𝒰 z ≫ 𝟙 X = 𝟙 (obj 𝒰 z) ≫ map 𝒰 z) ≫
            (pullbackRightPullbackFstIso (map 𝒰 y) (map 𝒰 z) pullback.fst).inv) ≫
          (pullbackSymmetry pullback.fst pullback.fst).hom) ≫
      pullback.fst ≫ pullback.snd =
    pullback.snd ≫ pullback.snd

Next tactic:
simp
@[simp, reassoc]
theorem gluedCoverT'_snd_fst (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ pullback.snd ≫ pullback.fst = pullback.fst ≫ pullback.snd := by
  

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ gluedCoverT' 𝒰 x y z ≫ pullback.snd ≫ pullback.fst = pullback.fst ≫ pullback.snd

Next tactic:
delta gluedCoverT'
@[simp, reassoc]
theorem gluedCoverT'_snd_fst (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ pullback.snd ≫ pullback.fst = pullback.fst ≫ pullback.snd := by
  delta gluedCoverT'; 

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ ((pullbackRightPullbackFstIso (map 𝒰 x) (map 𝒰 z) pullback.fst).hom ≫
        (pullback.map (pullback.fst ≫ map 𝒰 x) (map 𝒰 z) (pullback.fst ≫ map 𝒰 y) (map 𝒰 z)
              (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom (𝟙 (obj 𝒰 z)) (𝟙 X)
              (_ : (pullback.fst ≫ map 𝒰 x) ≫ 𝟙 X = (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom ≫ pullback.fst ≫ map 𝒰 y)
              (_ : map 𝒰 z ≫ 𝟙 X = 𝟙 (obj 𝒰 z) ≫ map 𝒰 z) ≫
            (pullbackRightPullbackFstIso (map 𝒰 y) (map 𝒰 z) pullback.fst).inv) ≫
          (pullbackSymmetry pullback.fst pullback.fst).hom) ≫
      pullback.snd ≫ pullback.fst =
    pullback.fst ≫ pullback.snd

Next tactic:
simp
@[simp, reassoc]
theorem gluedCoverT'_snd_snd (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ pullback.snd ≫ pullback.snd = pullback.fst ≫ pullback.fst := by
  

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ gluedCoverT' 𝒰 x y z ≫ pullback.snd ≫ pullback.snd = pullback.fst ≫ pullback.fst

Next tactic:
delta gluedCoverT'
@[simp, reassoc]
theorem gluedCoverT'_snd_snd (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ pullback.snd ≫ pullback.snd = pullback.fst ≫ pullback.fst := by
  delta gluedCoverT'; 

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ ((pullbackRightPullbackFstIso (map 𝒰 x) (map 𝒰 z) pullback.fst).hom ≫
        (pullback.map (pullback.fst ≫ map 𝒰 x) (map 𝒰 z) (pullback.fst ≫ map 𝒰 y) (map 𝒰 z)
              (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom (𝟙 (obj 𝒰 z)) (𝟙 X)
              (_ : (pullback.fst ≫ map 𝒰 x) ≫ 𝟙 X = (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom ≫ pullback.fst ≫ map 𝒰 y)
              (_ : map 𝒰 z ≫ 𝟙 X = 𝟙 (obj 𝒰 z) ≫ map 𝒰 z) ≫
            (pullbackRightPullbackFstIso (map 𝒰 y) (map 𝒰 z) pullback.fst).inv) ≫
          (pullbackSymmetry pullback.fst pullback.fst).hom) ≫
      pullback.snd ≫ pullback.snd =
    pullback.fst ≫ pullback.fst

Next tactic:
simp
theorem glued_cover_cocycle_fst (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.fst =
      pullback.fst :=
  by 

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.fst = pullback.fst

Next tactic:
apply pullback.hom_ext
theorem glued_cover_cocycle_fst (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.fst =
      pullback.fst :=
  by apply pullback.hom_ext <;> 

Proof state:
case h₀
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ (gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.fst) ≫ pullback.fst =
    pullback.fst ≫ pullback.fst

Next tactic:
simp
theorem glued_cover_cocycle_fst (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.fst =
      pullback.fst :=
  by apply pullback.hom_ext <;> 

Proof state:
case h₁
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ (gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.fst) ≫ pullback.snd =
    pullback.fst ≫ pullback.snd

Next tactic:
simp
theorem glued_cover_cocycle_snd (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.snd =
      pullback.snd :=
  by 

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.snd = pullback.snd

Next tactic:
apply pullback.hom_ext
theorem glued_cover_cocycle_snd (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.snd =
      pullback.snd :=
  by apply pullback.hom_ext <;> 

Proof state:
case h₀
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ (gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.snd) ≫ pullback.fst =
    pullback.snd ≫ pullback.fst

Next tactic:
simp [pullback.condition]
theorem glued_cover_cocycle_snd (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.snd =
      pullback.snd :=
  by apply pullback.hom_ext <;> 

Proof state:
case h₁
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ (gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.snd) ≫ pullback.snd =
    pullback.snd ≫ pullback.snd

Next tactic:
simp [pullback.condition]
theorem glued_cover_cocycle (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y = 𝟙 _ := by
  

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y = 𝟙 (pullback pullback.fst pullback.fst)

Next tactic:
apply pullback.hom_ext
theorem glued_cover_cocycle (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y = 𝟙 _ := by
  apply pullback.hom_ext <;> 

Proof state:
case h₀
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ (gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y) ≫ pullback.fst =
    𝟙 (pullback pullback.fst pullback.fst) ≫ pullback.fst

Next tactic:
simp_rw [Category.id_comp, Category.assoc]
theorem glued_cover_cocycle (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y = 𝟙 _ := by
  apply pullback.hom_ext <;> 

Proof state:
case h₁
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ (gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y) ≫ pullback.snd =
    𝟙 (pullback pullback.fst pullback.fst) ≫ pullback.snd

Next tactic:
simp_rw [Category.id_comp, Category.assoc]
theorem glued_cover_cocycle (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y = 𝟙 _ := by
  apply pullback.hom_ext <;> simp_rw [Category.id_comp, Category.assoc]
  

Proof state:
case h₀
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.fst = pullback.fst
case h₁
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.snd = pullback.snd

Next tactic:
apply glued_cover_cocycle_fst
theorem glued_cover_cocycle (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y = 𝟙 _ := by
  apply pullback.hom_ext <;> simp_rw [Category.id_comp, Category.assoc]
  apply glued_cover_cocycle_fst
  

Proof state:
case h₁
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.snd = pullback.snd

Next tactic:
apply glued_cover_cocycle_snd
/-- The glue data associated with an open cover.
The canonical isomorphism `𝒰.gluedCover.glued ⟶ X` is provided by `𝒰.fromGlued`. -/
@[simps]
def gluedCover : Scheme.GlueData.{u} where
  J := 𝒰.J
  U := 𝒰.obj
  V := fun ⟨x, y⟩ => pullback (𝒰.map x) (𝒰.map y)
  f x y := pullback.fst
  f_id x := inferInstance
  t x y := (pullbackSymmetry _ _).hom
  t_id x := by 

Proof state:
X : Scheme
𝒰 : OpenCover X
x : 𝒰.J
⊢ (fun x y => (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom) x x =
    𝟙
      ((fun x =>
          match x with
          | (x, y) => pullback (map 𝒰 x) (map 𝒰 y))
        (x, x))

Next tactic:
simp
/-- The glue data associated with an open cover.
The canonical isomorphism `𝒰.gluedCover.glued ⟶ X` is provided by `𝒰.fromGlued`. -/
@[simps]
def gluedCover : Scheme.GlueData.{u} where
  J := 𝒰.J
  U := 𝒰.obj
  V := fun ⟨x, y⟩ => pullback (𝒰.map x) (𝒰.map y)
  f x y := pullback.fst
  f_id x := inferInstance
  t x y := (pullbackSymmetry _ _).hom
  t_id x := by simp
  t' x y z := gluedCoverT' 𝒰 x y z
  t_fac x y z := by 

Proof state:
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ (fun x y z => gluedCoverT' 𝒰 x y z) x y z ≫ pullback.snd =
    pullback.fst ≫ (fun x y => (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom) x y

Next tactic:
apply pullback.hom_ext
/-- The glue data associated with an open cover.
The canonical isomorphism `𝒰.gluedCover.glued ⟶ X` is provided by `𝒰.fromGlued`. -/
@[simps]
def gluedCover : Scheme.GlueData.{u} where
  J := 𝒰.J
  U := 𝒰.obj
  V := fun ⟨x, y⟩ => pullback (𝒰.map x) (𝒰.map y)
  f x y := pullback.fst
  f_id x := inferInstance
  t x y := (pullbackSymmetry _ _).hom
  t_id x := by simp
  t' x y z := gluedCoverT' 𝒰 x y z
  t_fac x y z := by apply pullback.hom_ext <;> 

Proof state:
case h₀
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ ((fun x y z => gluedCoverT' 𝒰 x y z) x y z ≫ pullback.snd) ≫ pullback.fst =
    (pullback.fst ≫ (fun x y => (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom) x y) ≫ pullback.fst

Next tactic:
simp
/-- The glue data associated with an open cover.
The canonical isomorphism `𝒰.gluedCover.glued ⟶ X` is provided by `𝒰.fromGlued`. -/
@[simps]
def gluedCover : Scheme.GlueData.{u} where
  J := 𝒰.J
  U := 𝒰.obj
  V := fun ⟨x, y⟩ => pullback (𝒰.map x) (𝒰.map y)
  f x y := pullback.fst
  f_id x := inferInstance
  t x y := (pullbackSymmetry _ _).hom
  t_id x := by simp
  t' x y z := gluedCoverT' 𝒰 x y z
  t_fac x y z := by apply pullback.hom_ext <;> 

Proof state:
case h₁
X : Scheme
𝒰 : OpenCover X
x y z : 𝒰.J
⊢ ((fun x y z => gluedCoverT' 𝒰 x y z) x y z ≫ pullback.snd) ≫ pullback.snd =
    (pullback.fst ≫ (fun x y => (pullbackSymmetry (map 𝒰 x) (map 𝒰 y)).hom) x y) ≫ pullback.snd

Next tactic:
simp
/-- The canonical morphism from the gluing of an open cover of `X` into `X`.
This is an isomorphism, as witnessed by an `IsIso` instance. -/
def fromGlued : 𝒰.gluedCover.glued ⟶ X := by
  

Proof state:
X : Scheme
𝒰 : OpenCover X
⊢ GlueData.glued (gluedCover 𝒰) ⟶ X

Next tactic:
fapply Multicoequalizer.desc
/-- The canonical morphism from the gluing of an open cover of `X` into `X`.
This is an isomorphism, as witnessed by an `IsIso` instance. -/
def fromGlued : 𝒰.gluedCover.glued ⟶ X := by
  fapply Multicoequalizer.desc
  

Proof state:
case k
X : Scheme
𝒰 : OpenCover X
⊢ (b : (diagram (gluedCover 𝒰).toGlueData).R) → MultispanIndex.right (diagram (gluedCover 𝒰).toGlueData) b ⟶ X
case h
X : Scheme
𝒰 : OpenCover X
⊢ ∀ (a : (diagram (gluedCover 𝒰).toGlueData).L),
    MultispanIndex.fst (diagram (gluedCover 𝒰).toGlueData) a ≫
        ?k (MultispanIndex.fstFrom (diagram (gluedCover 𝒰).toGlueData) a) =
      MultispanIndex.snd (diagram (gluedCover 𝒰).toGlueData) a ≫
        ?k (MultispanIndex.sndFrom (diagram (gluedCover 𝒰).toGlueData) a)

Next tactic:
exact fun x => 𝒰.map x
/-- The canonical morphism from the gluing of an open cover of `X` into `X`.
This is an isomorphism, as witnessed by an `IsIso` instance. -/
def fromGlued : 𝒰.gluedCover.glued ⟶ X := by
  fapply Multicoequalizer.desc
  exact fun x => 𝒰.map x
  

Proof state:
case h
X : Scheme
𝒰 : OpenCover X
⊢ ∀ (a : (diagram (gluedCover 𝒰).toGlueData).L),
    MultispanIndex.fst (diagram (gluedCover 𝒰).toGlueData) a ≫
        map 𝒰 (MultispanIndex.fstFrom (diagram (gluedCover 𝒰).toGlueData) a) =
      MultispanIndex.snd (diagram (gluedCover 𝒰).toGlueData) a ≫
        map 𝒰 (MultispanIndex.sndFrom (diagram (gluedCover 𝒰).toGlueData) a)

Next tactic:
rintro ⟨x, y⟩
/-- The canonical morphism from the gluing of an open cover of `X` into `X`.
This is an isomorphism, as witnessed by an `IsIso` instance. -/
def fromGlued : 𝒰.gluedCover.glued ⟶ X := by
  fapply Multicoequalizer.desc
  exact fun x => 𝒰.map x
  rintro ⟨x, y⟩
  

Proof state:
case h.mk
X : Scheme
𝒰 : OpenCover X
x y : (gluedCover 𝒰).toGlueData.J
⊢ MultispanIndex.fst (diagram (gluedCover 𝒰).toGlueData) (x, y) ≫
      map 𝒰 (MultispanIndex.fstFrom (diagram (gluedCover 𝒰).toGlueData) (x, y)) =
    MultispanIndex.snd (diagram (gluedCover 𝒰).toGlueData) (x, y) ≫
      map 𝒰 (MultispanIndex.sndFrom (diagram (gluedCover 𝒰).toGlueData) (x, y))

Next tactic:
change pullback.fst ≫ _ = ((pullbackSymmetry _ _).hom ≫ pullback.fst) ≫ _