l3lab/ntp-mathlib huggingface dataset:
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  

Proof state:
case hf
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
⊢ pullback.fst ≫
      (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 i)).hom ≫
        pullback.map (OpenCover.map 𝒰 i) (PullbackCone.fst s) (OpenCover.map 𝒰 i ≫ f) g (𝟙 (OpenCover.obj 𝒰 i))
            (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 i ≫ f = 𝟙 (OpenCover.obj 𝒰 i) ≫ OpenCover.map 𝒰 i ≫ f)
            (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g) ≫
          GlueData.ι (gluing 𝒰 f g) i =
    pullback.snd ≫
      (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom ≫
        pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
            (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
            (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g) ≫
          GlueData.ι (gluing 𝒰 f g) j

Next tactic:
rw [← gluedLiftPullbackMap_fst_assoc]
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  

Proof state:
case hf
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
⊢ gluedLiftPullbackMap 𝒰 f g s i j ≫ pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i =
    pullback.snd ≫
      (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom ≫
        pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
            (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
            (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g) ≫
          GlueData.ι (gluing 𝒰 f g) j

Next tactic:
have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  

Proof state:
case hf
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ gluedLiftPullbackMap 𝒰 f g s i j ≫ pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i =
    pullback.snd ≫
      (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom ≫
        pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
            (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
            (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g) ≫
          GlueData.ι (gluing 𝒰 f g) j

Next tactic:
rw [← this, gluing_t, gluing_f]
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  rw [← this, gluing_t, gluing_f]
  

Proof state:
case hf
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ gluedLiftPullbackMap 𝒰 f g s i j ≫ t 𝒰 f g i j ≫ pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.snd ≫
      (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom ≫
        pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
            (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
            (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g) ≫
          GlueData.ι (gluing 𝒰 f g) j

Next tactic:
simp_rw [← Category.assoc]
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  rw [← this, gluing_t, gluing_f]
  simp_rw [← Category.assoc]
  

Proof state:
case hf
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ ((gluedLiftPullbackMap 𝒰 f g s i j ≫ t 𝒰 f g i j) ≫ pullback.fst) ≫ GlueData.ι (gluing 𝒰 f g) j =
    ((pullback.snd ≫ (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom) ≫
        pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
          (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
          (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g)) ≫
      GlueData.ι (gluing 𝒰 f g) j

Next tactic:
congr 1
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  rw [← this, gluing_t, gluing_f]
  simp_rw [← Category.assoc]
  congr 1
  

Proof state:
case hf.e_a
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ (gluedLiftPullbackMap 𝒰 f g s i j ≫ t 𝒰 f g i j) ≫ pullback.fst =
    (pullback.snd ≫ (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom) ≫
      pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
        (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
        (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g)

Next tactic:
apply pullback.hom_ext
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  rw [← this, gluing_t, gluing_f]
  simp_rw [← Category.assoc]
  congr 1
  apply pullback.hom_ext <;> 

Proof state:
case hf.e_a.h₀
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ ((gluedLiftPullbackMap 𝒰 f g s i j ≫ t 𝒰 f g i j) ≫ pullback.fst) ≫ pullback.fst =
    ((pullback.snd ≫ (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom) ≫
        pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
          (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
          (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g)) ≫
      pullback.fst

Next tactic:
simp_rw [Category.assoc]
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  rw [← this, gluing_t, gluing_f]
  simp_rw [← Category.assoc]
  congr 1
  apply pullback.hom_ext <;> 

Proof state:
case hf.e_a.h₁
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ ((gluedLiftPullbackMap 𝒰 f g s i j ≫ t 𝒰 f g i j) ≫ pullback.fst) ≫ pullback.snd =
    ((pullback.snd ≫ (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom) ≫
        pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
          (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
          (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g)) ≫
      pullback.snd

Next tactic:
simp_rw [Category.assoc]
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  rw [← this, gluing_t, gluing_f]
  simp_rw [← Category.assoc]
  congr 1
  apply pullback.hom_ext <;> simp_rw [Category.assoc]
  · 

Proof state:
case hf.e_a.h₀
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ gluedLiftPullbackMap 𝒰 f g s i j ≫ t 𝒰 f g i j ≫ pullback.fst ≫ pullback.fst =
    pullback.snd ≫
      (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom ≫
        pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
            (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
            (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g) ≫
          pullback.fst

Next tactic:
rw [t_fst_fst, gluedLiftPullbackMap_snd]
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  rw [← this, gluing_t, gluing_f]
  simp_rw [← Category.assoc]
  congr 1
  apply pullback.hom_ext <;> simp_rw [Category.assoc]
  · rw [t_fst_fst, gluedLiftPullbackMap_snd]
    

Proof state:
case hf.e_a.h₀
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ pullback.snd ≫ pullback.snd =
    pullback.snd ≫
      (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom ≫
        pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
            (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
            (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g) ≫
          pullback.fst

Next tactic:
congr 1
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  rw [← this, gluing_t, gluing_f]
  simp_rw [← Category.assoc]
  congr 1
  apply pullback.hom_ext <;> simp_rw [Category.assoc]
  · rw [t_fst_fst, gluedLiftPullbackMap_snd]
    congr 1
    

Proof state:
case hf.e_a.h₀.e_a
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ pullback.snd =
    (pullbackSymmetry (PullbackCone.fst s) (OpenCover.map 𝒰 j)).hom ≫
      pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
          (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
          (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g) ≫
        pullback.fst

Next tactic:
rw [← Iso.inv_comp_eq, pullbackSymmetry_inv_comp_snd]
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  rw [← this, gluing_t, gluing_f]
  simp_rw [← Category.assoc]
  congr 1
  apply pullback.hom_ext <;> simp_rw [Category.assoc]
  · rw [t_fst_fst, gluedLiftPullbackMap_snd]
    congr 1
    rw [← Iso.inv_comp_eq, pullbackSymmetry_inv_comp_snd]
    

Proof state:
case hf.e_a.h₀.e_a
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ pullback.fst =
    pullback.map (OpenCover.map 𝒰 j) (PullbackCone.fst s) (OpenCover.map 𝒰 j ≫ f) g (𝟙 (OpenCover.obj 𝒰 j))
        (PullbackCone.snd s) f (_ : OpenCover.map 𝒰 j ≫ f = 𝟙 (OpenCover.obj 𝒰 j) ≫ OpenCover.map 𝒰 j ≫ f)
        (_ : PullbackCone.fst s ≫ f = PullbackCone.snd s ≫ g) ≫
      pullback.fst

Next tactic:
erw [pullback.lift_fst]
/-- The lifted map `s.X ⟶ (gluing 𝒰 f g).glued` in order to show that `(gluing 𝒰 f g).glued` is
indeed the pullback.

Given a pullback cone `s`, we have the maps `s.fst ⁻¹' Uᵢ ⟶ Uᵢ` and
`s.fst ⁻¹' Uᵢ ⟶ s.X ⟶ Y` that we may lift to a map `s.fst ⁻¹' Uᵢ ⟶ Uᵢ ×[Z] Y`.

to glue these into a map `s.X ⟶ Uᵢ ×[Z] Y`, we need to show that the maps agree on
`(s.fst ⁻¹' Uᵢ) ×[s.X] (s.fst ⁻¹' Uⱼ) ⟶ Uᵢ ×[Z] Y`. This is achieved by showing that both of these
maps factors through `gluedLiftPullbackMap`.
-/
def gluedLift : s.pt ⟶ (gluing 𝒰 f g).glued := by
  fapply (𝒰.pullbackCover s.fst).glueMorphisms
  · exact fun i => (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition ≫
        (gluing 𝒰 f g).ι i
  intro i j
  rw [← gluedLiftPullbackMap_fst_assoc]
  have : _ = pullback.fst ≫ _ := (gluing 𝒰 f g).glue_condition i j
  rw [← this, gluing_t, gluing_f]
  simp_rw [← Category.assoc]
  congr 1
  apply pullback.hom_ext <;> simp_rw [Category.assoc]
  · rw [t_fst_fst, gluedLiftPullbackMap_snd]
    congr 1
    rw [← Iso.inv_comp_eq, pullbackSymmetry_inv_comp_snd]
    erw [pullback.lift_fst]
    

Proof state:
case hf.e_a.h₀.e_a
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
s : PullbackCone f g
i j : (OpenCover.pullbackCover 𝒰 (PullbackCone.fst s)).J
this :
  GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i ≫ GlueData.ι (gluing 𝒰 f g) j =
    pullback.fst ≫ GlueData.ι (gluing 𝒰 f g) i
⊢ pullback.fst = pullback.fst ≫ 𝟙 (OpenCover.obj 𝒰 j)

Next tactic:
rw [Category.comp_id]