l3lab/ntp-mathlib huggingface dataset:
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> 

Proof state:
case 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
i j k : 𝒰.J
⊢ (t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.fst =
    𝟙 (pullback (fV 𝒰 f g i j) (fV 𝒰 f g i k)) ≫ pullback.fst

Next tactic:
rw [Category.id_comp]
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> 

Proof state:
case 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
i j k : 𝒰.J
⊢ (t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.snd =
    𝟙 (pullback (fV 𝒰 f g i j) (fV 𝒰 f g i k)) ≫ pullback.snd

Next tactic:
rw [Category.id_comp]
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · 

Proof state:
case 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
i j k : 𝒰.J
⊢ (t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.fst = pullback.fst

Next tactic:
apply pullback.hom_ext
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · 

Proof state:
case h₀.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
i j k : 𝒰.J
⊢ ((t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.fst) ≫ pullback.fst = pullback.fst ≫ pullback.fst

Next tactic:
apply pullback.hom_ext
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · 

Proof state:
case h₀.h₀.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
i j k : 𝒰.J
⊢ (((t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.fst) ≫ pullback.fst) ≫ pullback.fst =
    (pullback.fst ≫ pullback.fst) ≫ pullback.fst

Next tactic:
simp_rw [Category.assoc]
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        

Proof state:
case h₀.h₀.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
i j k : 𝒰.J
⊢ t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j ≫ pullback.fst ≫ pullback.fst ≫ pullback.fst =
    pullback.fst ≫ pullback.fst ≫ pullback.fst

Next tactic:
exact cocycle_fst_fst_fst 𝒰 f g i j k
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · 

Proof state:
case h₀.h₀.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
i j k : 𝒰.J
⊢ (((t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.fst) ≫ pullback.fst) ≫ pullback.snd =
    (pullback.fst ≫ pullback.fst) ≫ pullback.snd

Next tactic:
simp_rw [Category.assoc]
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        

Proof state:
case h₀.h₀.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
i j k : 𝒰.J
⊢ t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j ≫ pullback.fst ≫ pullback.fst ≫ pullback.snd =
    pullback.fst ≫ pullback.fst ≫ pullback.snd

Next tactic:
exact cocycle_fst_fst_snd 𝒰 f g i j k
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_snd 𝒰 f g i j k
    · 

Proof state:
case h₀.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
i j k : 𝒰.J
⊢ ((t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.fst) ≫ pullback.snd = pullback.fst ≫ pullback.snd

Next tactic:
simp_rw [Category.assoc]
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_snd 𝒰 f g i j k
    · simp_rw [Category.assoc]
      

Proof state:
case h₀.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
i j k : 𝒰.J
⊢ t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j ≫ pullback.fst ≫ pullback.snd = pullback.fst ≫ pullback.snd

Next tactic:
exact cocycle_fst_snd 𝒰 f g i j k
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_snd 𝒰 f g i j k
    · simp_rw [Category.assoc]
      exact cocycle_fst_snd 𝒰 f g i j k
  · 

Proof state:
case 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
i j k : 𝒰.J
⊢ (t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.snd = pullback.snd

Next tactic:
apply pullback.hom_ext
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_snd 𝒰 f g i j k
    · simp_rw [Category.assoc]
      exact cocycle_fst_snd 𝒰 f g i j k
  · apply pullback.hom_ext
    · 

Proof state:
case h₁.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
i j k : 𝒰.J
⊢ ((t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.snd) ≫ pullback.fst = pullback.snd ≫ pullback.fst

Next tactic:
apply pullback.hom_ext
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_snd 𝒰 f g i j k
    · simp_rw [Category.assoc]
      exact cocycle_fst_snd 𝒰 f g i j k
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · 

Proof state:
case h₁.h₀.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
i j k : 𝒰.J
⊢ (((t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.snd) ≫ pullback.fst) ≫ pullback.fst =
    (pullback.snd ≫ pullback.fst) ≫ pullback.fst

Next tactic:
simp_rw [Category.assoc]
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_snd 𝒰 f g i j k
    · simp_rw [Category.assoc]
      exact cocycle_fst_snd 𝒰 f g i j k
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        

Proof state:
case h₁.h₀.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
i j k : 𝒰.J
⊢ t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j ≫ pullback.snd ≫ pullback.fst ≫ pullback.fst =
    pullback.snd ≫ pullback.fst ≫ pullback.fst

Next tactic:
exact cocycle_snd_fst_fst 𝒰 f g i j k
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_snd 𝒰 f g i j k
    · simp_rw [Category.assoc]
      exact cocycle_fst_snd 𝒰 f g i j k
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_snd_fst_fst 𝒰 f g i j k
      · 

Proof state:
case h₁.h₀.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
i j k : 𝒰.J
⊢ (((t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.snd) ≫ pullback.fst) ≫ pullback.snd =
    (pullback.snd ≫ pullback.fst) ≫ pullback.snd

Next tactic:
simp_rw [Category.assoc]
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_snd 𝒰 f g i j k
    · simp_rw [Category.assoc]
      exact cocycle_fst_snd 𝒰 f g i j k
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_snd_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        

Proof state:
case h₁.h₀.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
i j k : 𝒰.J
⊢ t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j ≫ pullback.snd ≫ pullback.fst ≫ pullback.snd =
    pullback.snd ≫ pullback.fst ≫ pullback.snd

Next tactic:
exact cocycle_snd_fst_snd 𝒰 f g i j k
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_snd 𝒰 f g i j k
    · simp_rw [Category.assoc]
      exact cocycle_fst_snd 𝒰 f g i j k
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_snd_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_snd_fst_snd 𝒰 f g i j k
    · 

Proof state:
case h₁.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
i j k : 𝒰.J
⊢ ((t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j) ≫ pullback.snd) ≫ pullback.snd = pullback.snd ≫ pullback.snd

Next tactic:
simp_rw [Category.assoc]
theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _ := by
  apply pullback.hom_ext <;> rw [Category.id_comp]
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_fst_fst_snd 𝒰 f g i j k
    · simp_rw [Category.assoc]
      exact cocycle_fst_snd 𝒰 f g i j k
  · apply pullback.hom_ext
    · apply pullback.hom_ext
      · simp_rw [Category.assoc]
        exact cocycle_snd_fst_fst 𝒰 f g i j k
      · simp_rw [Category.assoc]
        exact cocycle_snd_fst_snd 𝒰 f g i j k
    · simp_rw [Category.assoc]
      

Proof state:
case h₁.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
i j k : 𝒰.J
⊢ t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j ≫ pullback.snd ≫ pullback.snd = pullback.snd ≫ pullback.snd

Next tactic:
exact cocycle_snd_snd 𝒰 f g i j k
/-- Given `Uᵢ ×[Z] Y`, this is the glued fibered product `X ×[Z] Y`. -/
@[simps]
def gluing : Scheme.GlueData.{u} where
  J := 𝒰.J
  U i := pullback (𝒰.map i ≫ f) g
  V := fun ⟨i, j⟩ => v 𝒰 f g i j
  -- `p⁻¹(Uᵢ ∩ Uⱼ)` where `p : Uᵢ ×[Z] Y ⟶ Uᵢ ⟶ X`.
  f i j := pullback.fst
  f_id i := inferInstance
  f_open := inferInstance
  t i j := t 𝒰 f g i j
  t_id i := t_id 𝒰 f g i
  t' i j k := t' 𝒰 f g i j k
  t_fac i j k := by
    

Proof state:
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
i j k : 𝒰.J
⊢ (fun i j k => t' 𝒰 f g i j k) i j k ≫ pullback.snd = pullback.fst ≫ (fun i j => t 𝒰 f g i j) i j

Next tactic:
apply pullback.hom_ext
/-- Given `Uᵢ ×[Z] Y`, this is the glued fibered product `X ×[Z] Y`. -/
@[simps]
def gluing : Scheme.GlueData.{u} where
  J := 𝒰.J
  U i := pullback (𝒰.map i ≫ f) g
  V := fun ⟨i, j⟩ => v 𝒰 f g i j
  -- `p⁻¹(Uᵢ ∩ Uⱼ)` where `p : Uᵢ ×[Z] Y ⟶ Uᵢ ⟶ X`.
  f i j := pullback.fst
  f_id i := inferInstance
  f_open := inferInstance
  t i j := t 𝒰 f g i j
  t_id i := t_id 𝒰 f g i
  t' i j k := t' 𝒰 f g i j k
  t_fac i j k := by
    apply pullback.hom_ext
    

Proof state:
case 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
i j k : 𝒰.J
⊢ ((fun i j k => t' 𝒰 f g i j k) i j k ≫ pullback.snd) ≫ pullback.fst =
    (pullback.fst ≫ (fun i j => t 𝒰 f g i j) i j) ≫ pullback.fst
case 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
i j k : 𝒰.J
⊢ ((fun i j k => t' 𝒰 f g i j k) i j k ≫ pullback.snd) ≫ pullback.snd =
    (pullback.fst ≫ (fun i j => t 𝒰 f g i j) i j) ≫ pullback.snd

Next tactic:
apply pullback.hom_ext
/-- Given `Uᵢ ×[Z] Y`, this is the glued fibered product `X ×[Z] Y`. -/
@[simps]
def gluing : Scheme.GlueData.{u} where
  J := 𝒰.J
  U i := pullback (𝒰.map i ≫ f) g
  V := fun ⟨i, j⟩ => v 𝒰 f g i j
  -- `p⁻¹(Uᵢ ∩ Uⱼ)` where `p : Uᵢ ×[Z] Y ⟶ Uᵢ ⟶ X`.
  f i j := pullback.fst
  f_id i := inferInstance
  f_open := inferInstance
  t i j := t 𝒰 f g i j
  t_id i := t_id 𝒰 f g i
  t' i j k := t' 𝒰 f g i j k
  t_fac i j k := by
    apply pullback.hom_ext
    apply pullback.hom_ext
    

Proof state:
case h₀.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
i j k : 𝒰.J
⊢ (((fun i j k => t' 𝒰 f g i j k) i j k ≫ pullback.snd) ≫ pullback.fst) ≫ pullback.fst =
    ((pullback.fst ≫ (fun i j => t 𝒰 f g i j) i j) ≫ pullback.fst) ≫ pullback.fst
case h₀.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
i j k : 𝒰.J
⊢ (((fun i j k => t' 𝒰 f g i j k) i j k ≫ pullback.snd) ≫ pullback.fst) ≫ pullback.snd =
    ((pullback.fst ≫ (fun i j => t 𝒰 f g i j) i j) ≫ pullback.fst) ≫ pullback.snd
case 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
i j k : 𝒰.J
⊢ ((fun i j k => t' 𝒰 f g i j k) i j k ≫ pullback.snd) ≫ pullback.snd =
    (pullback.fst ≫ (fun i j => t 𝒰 f g i j) i j) ≫ pullback.snd

Next tactic:
all_goals
      simp only [t'_snd_fst_fst, t'_snd_fst_snd, t'_snd_snd, t_fst_fst, t_fst_snd, t_snd,
        Category.assoc]
/-- Given `Uᵢ ×[Z] Y`, this is the glued fibered product `X ×[Z] Y`. -/
@[simps]
def gluing : Scheme.GlueData.{u} where
  J := 𝒰.J
  U i := pullback (𝒰.map i ≫ f) g
  V := fun ⟨i, j⟩ => v 𝒰 f g i j
  -- `p⁻¹(Uᵢ ∩ Uⱼ)` where `p : Uᵢ ×[Z] Y ⟶ Uᵢ ⟶ X`.
  f i j := pullback.fst
  f_id i := inferInstance
  f_open := inferInstance
  t i j := t 𝒰 f g i j
  t_id i := t_id 𝒰 f g i
  t' i j k := t' 𝒰 f g i j k
  t_fac i j k := by
    apply pullback.hom_ext
    apply pullback.hom_ext
    all_goals
      

Proof state:
case h₀.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
i j k : 𝒰.J
⊢ (((fun i j k => t' 𝒰 f g i j k) i j k ≫ pullback.snd) ≫ pullback.fst) ≫ pullback.fst =
    ((pullback.fst ≫ (fun i j => t 𝒰 f g i j) i j) ≫ pullback.fst) ≫ pullback.fst

Next tactic:
simp only [t'_snd_fst_fst, t'_snd_fst_snd, t'_snd_snd, t_fst_fst, t_fst_snd, t_snd,
        Category.assoc]
/-- Given `Uᵢ ×[Z] Y`, this is the glued fibered product `X ×[Z] Y`. -/
@[simps]
def gluing : Scheme.GlueData.{u} where
  J := 𝒰.J
  U i := pullback (𝒰.map i ≫ f) g
  V := fun ⟨i, j⟩ => v 𝒰 f g i j
  -- `p⁻¹(Uᵢ ∩ Uⱼ)` where `p : Uᵢ ×[Z] Y ⟶ Uᵢ ⟶ X`.
  f i j := pullback.fst
  f_id i := inferInstance
  f_open := inferInstance
  t i j := t 𝒰 f g i j
  t_id i := t_id 𝒰 f g i
  t' i j k := t' 𝒰 f g i j k
  t_fac i j k := by
    apply pullback.hom_ext
    apply pullback.hom_ext
    all_goals
      

Proof state:
case h₀.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
i j k : 𝒰.J
⊢ (((fun i j k => t' 𝒰 f g i j k) i j k ≫ pullback.snd) ≫ pullback.fst) ≫ pullback.snd =
    ((pullback.fst ≫ (fun i j => t 𝒰 f g i j) i j) ≫ pullback.fst) ≫ pullback.snd

Next tactic:
simp only [t'_snd_fst_fst, t'_snd_fst_snd, t'_snd_snd, t_fst_fst, t_fst_snd, t_snd,
        Category.assoc]
/-- Given `Uᵢ ×[Z] Y`, this is the glued fibered product `X ×[Z] Y`. -/
@[simps]
def gluing : Scheme.GlueData.{u} where
  J := 𝒰.J
  U i := pullback (𝒰.map i ≫ f) g
  V := fun ⟨i, j⟩ => v 𝒰 f g i j
  -- `p⁻¹(Uᵢ ∩ Uⱼ)` where `p : Uᵢ ×[Z] Y ⟶ Uᵢ ⟶ X`.
  f i j := pullback.fst
  f_id i := inferInstance
  f_open := inferInstance
  t i j := t 𝒰 f g i j
  t_id i := t_id 𝒰 f g i
  t' i j k := t' 𝒰 f g i j k
  t_fac i j k := by
    apply pullback.hom_ext
    apply pullback.hom_ext
    all_goals
      

Proof state:
case 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
i j k : 𝒰.J
⊢ ((fun i j k => t' 𝒰 f g i j k) i j k ≫ pullback.snd) ≫ pullback.snd =
    (pullback.fst ≫ (fun i j => t 𝒰 f g i j) i j) ≫ pullback.snd

Next tactic:
simp only [t'_snd_fst_fst, t'_snd_fst_snd, t'_snd_snd, t_fst_fst, t_fst_snd, t_snd,
        Category.assoc]
/-- The first projection from the glued scheme into `X`. -/
def p1 : (gluing 𝒰 f g).glued ⟶ X := by
  

Proof state:
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
⊢ GlueData.glued (gluing 𝒰 f g) ⟶ X

Next tactic:
fapply Multicoequalizer.desc
/-- The first projection from the glued scheme into `X`. -/
def p1 : (gluing 𝒰 f g).glued ⟶ X := by
  fapply Multicoequalizer.desc
  

Proof state:
case k
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
⊢ (b : (GlueData.diagram (gluing 𝒰 f g).toGlueData).R) →
    MultispanIndex.right (GlueData.diagram (gluing 𝒰 f g).toGlueData) b ⟶ X
case 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
⊢ ∀ (a : (GlueData.diagram (gluing 𝒰 f g).toGlueData).L),
    MultispanIndex.fst (GlueData.diagram (gluing 𝒰 f g).toGlueData) a ≫
        ?k (MultispanIndex.fstFrom (GlueData.diagram (gluing 𝒰 f g).toGlueData) a) =
      MultispanIndex.snd (GlueData.diagram (gluing 𝒰 f g).toGlueData) a ≫
        ?k (MultispanIndex.sndFrom (GlueData.diagram (gluing 𝒰 f g).toGlueData) a)

Next tactic:
exact fun i => pullback.fst ≫ 𝒰.map i
/-- The first projection from the glued scheme into `X`. -/
def p1 : (gluing 𝒰 f g).glued ⟶ X := by
  fapply Multicoequalizer.desc
  exact fun i => pullback.fst ≫ 𝒰.map i
  

Proof state:
case 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
⊢ ∀ (a : (GlueData.diagram (gluing 𝒰 f g).toGlueData).L),
    MultispanIndex.fst (GlueData.diagram (gluing 𝒰 f g).toGlueData) a ≫
        pullback.fst ≫ OpenCover.map 𝒰 (MultispanIndex.fstFrom (GlueData.diagram (gluing 𝒰 f g).toGlueData) a) =
      MultispanIndex.snd (GlueData.diagram (gluing 𝒰 f g).toGlueData) a ≫
        pullback.fst ≫ OpenCover.map 𝒰 (MultispanIndex.sndFrom (GlueData.diagram (gluing 𝒰 f g).toGlueData) a)

Next tactic:
rintro ⟨i, j⟩
/-- The first projection from the glued scheme into `X`. -/
def p1 : (gluing 𝒰 f g).glued ⟶ X := by
  fapply Multicoequalizer.desc
  exact fun i => pullback.fst ≫ 𝒰.map i
  rintro ⟨i, j⟩
  

Proof state:
case h.mk
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
i j : (gluing 𝒰 f g).toGlueData.J
⊢ MultispanIndex.fst (GlueData.diagram (gluing 𝒰 f g).toGlueData) (i, j) ≫
      pullback.fst ≫ OpenCover.map 𝒰 (MultispanIndex.fstFrom (GlueData.diagram (gluing 𝒰 f g).toGlueData) (i, j)) =
    MultispanIndex.snd (GlueData.diagram (gluing 𝒰 f g).toGlueData) (i, j) ≫
      pullback.fst ≫ OpenCover.map 𝒰 (MultispanIndex.sndFrom (GlueData.diagram (gluing 𝒰 f g).toGlueData) (i, j))

Next tactic:
change pullback.fst ≫ _ ≫ 𝒰.map i = (_ ≫ _) ≫ _ ≫ 𝒰.map j
/-- The first projection from the glued scheme into `X`. -/
def p1 : (gluing 𝒰 f g).glued ⟶ X := by
  fapply Multicoequalizer.desc
  exact fun i => pullback.fst ≫ 𝒰.map i
  rintro ⟨i, j⟩
  change pullback.fst ≫ _ ≫ 𝒰.map i = (_ ≫ _) ≫ _ ≫ 𝒰.map j
  -- Porting note : change `rw` to `erw`
  

Proof state:
case h.mk
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
i j : (gluing 𝒰 f g).toGlueData.J
⊢ pullback.fst ≫ pullback.fst ≫ OpenCover.map 𝒰 i =
    (GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i) ≫
      pullback.fst ≫ OpenCover.map 𝒰 j

Next tactic:
erw [pullback.condition]
/-- The first projection from the glued scheme into `X`. -/
def p1 : (gluing 𝒰 f g).glued ⟶ X := by
  fapply Multicoequalizer.desc
  exact fun i => pullback.fst ≫ 𝒰.map i
  rintro ⟨i, j⟩
  change pullback.fst ≫ _ ≫ 𝒰.map i = (_ ≫ _) ≫ _ ≫ 𝒰.map j
  -- Porting note : change `rw` to `erw`
  erw [pullback.condition]
  

Proof state:
case h.mk
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
i j : (gluing 𝒰 f g).toGlueData.J
⊢ pullback.snd ≫ OpenCover.map 𝒰 j =
    (GlueData.t (gluing 𝒰 f g).toGlueData i j ≫ GlueData.f (gluing 𝒰 f g).toGlueData j i) ≫
      pullback.fst ≫ OpenCover.map 𝒰 j

Next tactic:
rw [← Category.assoc]