l3lab/ntp-mathlib huggingface dataset:
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [Category.comp_id, Category.id_comp]
    · ext <;> simp
    · infer_instance
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 _) (𝟙 _) pullback.fst _ _) ?_
    · rw [Category.assoc, IsIso.inv_hom_id, Category.comp_id, Category.id_comp]
    · rw [Category.assoc, IsIso.inv_hom_id, Category.comp_id, Category.id_comp]
    · 

Proof state:
case refine'_2.refine'_3
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ IsIso
    (map (f ≫ inv fst) (g ≫ inv fst) f g (𝟙 X) (𝟙 Y) fst (_ : (f ≫ inv fst) ≫ fst = 𝟙 X ≫ f)
      (_ : (g ≫ inv fst) ≫ fst = 𝟙 Y ≫ g))

Next tactic:
infer_instance
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_hom_fst :
    (pullbackDiagonalMapIdIso f g i).hom ≫ pullback.fst = pullback.snd ≫ pullback.fst := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (pullbackDiagonalMapIdIso f g i).hom ≫ fst = snd ≫ fst

Next tactic:
delta pullbackDiagonalMapIdIso
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_hom_fst :
    (pullbackDiagonalMapIdIso f g i).hom ≫ pullback.fst = pullback.snd ≫ pullback.fst := by
  delta pullbackDiagonalMapIdIso
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (asIso
            (map (diagonal i)
              (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i)) (diagonal i)
              (map ((f ≫ inv fst) ≫ snd) ((g ≫ inv fst) ≫ snd) i i ((f ≫ inv fst) ≫ fst) ((g ≫ inv fst) ≫ fst) (𝟙 S)
                (_ : ((f ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((f ≫ inv fst) ≫ fst) ≫ i)
                (_ : ((g ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((g ≫ inv fst) ≫ fst) ≫ i))
              (𝟙 T) (congrHom (_ : f ≫ i = (f ≫ inv fst) ≫ snd) (_ : g ≫ i = (g ≫ inv fst) ≫ snd)).hom
              (𝟙 (diagonalObj i)) (_ : diagonal i ≫ 𝟙 (diagonalObj i) = 𝟙 T ≫ diagonal i)
              (_ :
                map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i) ≫
                    𝟙 (diagonalObj i) =
                  (congrHom (_ : f ≫ i = (f ≫ inv fst) ≫ snd) (_ : g ≫ i = (g ≫ inv fst) ≫ snd)).hom ≫
                    map ((f ≫ inv fst) ≫ snd) ((g ≫ inv fst) ≫ snd) i i ((f ≫ inv fst) ≫ fst) ((g ≫ inv fst) ≫ fst)
                      (𝟙 S) (_ : ((f ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((f ≫ inv fst) ≫ fst) ≫ i)
                      (_ : ((g ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((g ≫ inv fst) ≫ fst) ≫ i))) ≪≫
          pullbackDiagonalMapIso i (𝟙 S) (f ≫ inv fst) (g ≫ inv fst) ≪≫
            asIso
              (map (f ≫ inv fst) (g ≫ inv fst) f g (𝟙 X) (𝟙 Y) fst (_ : (f ≫ inv fst) ≫ fst = 𝟙 X ≫ f)
                (_ : (g ≫ inv fst) ≫ fst = 𝟙 Y ≫ g))).hom ≫
      fst =
    snd ≫ fst

Next tactic:
simp
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_hom_snd :
    (pullbackDiagonalMapIdIso f g i).hom ≫ pullback.snd = pullback.snd ≫ pullback.snd := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (pullbackDiagonalMapIdIso f g i).hom ≫ snd = snd ≫ snd

Next tactic:
delta pullbackDiagonalMapIdIso
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_hom_snd :
    (pullbackDiagonalMapIdIso f g i).hom ≫ pullback.snd = pullback.snd ≫ pullback.snd := by
  delta pullbackDiagonalMapIdIso
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (asIso
            (map (diagonal i)
              (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i)) (diagonal i)
              (map ((f ≫ inv fst) ≫ snd) ((g ≫ inv fst) ≫ snd) i i ((f ≫ inv fst) ≫ fst) ((g ≫ inv fst) ≫ fst) (𝟙 S)
                (_ : ((f ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((f ≫ inv fst) ≫ fst) ≫ i)
                (_ : ((g ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((g ≫ inv fst) ≫ fst) ≫ i))
              (𝟙 T) (congrHom (_ : f ≫ i = (f ≫ inv fst) ≫ snd) (_ : g ≫ i = (g ≫ inv fst) ≫ snd)).hom
              (𝟙 (diagonalObj i)) (_ : diagonal i ≫ 𝟙 (diagonalObj i) = 𝟙 T ≫ diagonal i)
              (_ :
                map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i) ≫
                    𝟙 (diagonalObj i) =
                  (congrHom (_ : f ≫ i = (f ≫ inv fst) ≫ snd) (_ : g ≫ i = (g ≫ inv fst) ≫ snd)).hom ≫
                    map ((f ≫ inv fst) ≫ snd) ((g ≫ inv fst) ≫ snd) i i ((f ≫ inv fst) ≫ fst) ((g ≫ inv fst) ≫ fst)
                      (𝟙 S) (_ : ((f ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((f ≫ inv fst) ≫ fst) ≫ i)
                      (_ : ((g ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((g ≫ inv fst) ≫ fst) ≫ i))) ≪≫
          pullbackDiagonalMapIso i (𝟙 S) (f ≫ inv fst) (g ≫ inv fst) ≪≫
            asIso
              (map (f ≫ inv fst) (g ≫ inv fst) f g (𝟙 X) (𝟙 Y) fst (_ : (f ≫ inv fst) ≫ fst = 𝟙 X ≫ f)
                (_ : (g ≫ inv fst) ≫ fst = 𝟙 Y ≫ g))).hom ≫
      snd =
    snd ≫ snd

Next tactic:
simp
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_inv_fst :
    (pullbackDiagonalMapIdIso f g i).inv ≫ pullback.fst = pullback.fst ≫ f := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (pullbackDiagonalMapIdIso f g i).inv ≫ fst = fst ≫ f

Next tactic:
rw [Iso.inv_comp_eq, ← Category.comp_id pullback.fst, ← diagonal_fst i, pullback.condition_assoc]
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_inv_fst :
    (pullbackDiagonalMapIdIso f g i).inv ≫ pullback.fst = pullback.fst ≫ f := by
  rw [Iso.inv_comp_eq, ← Category.comp_id pullback.fst, ← diagonal_fst i, pullback.condition_assoc]
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ snd ≫ map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i) ≫ fst =
    (pullbackDiagonalMapIdIso f g i).hom ≫ fst ≫ f

Next tactic:
simp
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_inv_snd_fst :
    (pullbackDiagonalMapIdIso f g i).inv ≫ pullback.snd ≫ pullback.fst = pullback.fst := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (pullbackDiagonalMapIdIso f g i).inv ≫ snd ≫ fst = fst

Next tactic:
rw [Iso.inv_comp_eq]
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_inv_snd_fst :
    (pullbackDiagonalMapIdIso f g i).inv ≫ pullback.snd ≫ pullback.fst = pullback.fst := by
  rw [Iso.inv_comp_eq]
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ snd ≫ fst = (pullbackDiagonalMapIdIso f g i).hom ≫ fst

Next tactic:
simp
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_inv_snd_snd :
    (pullbackDiagonalMapIdIso f g i).inv ≫ pullback.snd ≫ pullback.snd = pullback.snd := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (pullbackDiagonalMapIdIso f g i).inv ≫ snd ≫ snd = snd

Next tactic:
rw [Iso.inv_comp_eq]
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_inv_snd_snd :
    (pullbackDiagonalMapIdIso f g i).inv ≫ pullback.snd ≫ pullback.snd = pullback.snd := by
  rw [Iso.inv_comp_eq]
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ snd ≫ snd = (pullbackDiagonalMapIdIso f g i).hom ≫ snd

Next tactic:
simp
theorem pullback.diagonal_comp (f : X ⟶ Y) (g : Y ⟶ Z) [HasPullback f f] [HasPullback g g]
    [HasPullback (f ≫ g) (f ≫ g)] :
    diagonal (f ≫ g) = diagonal f ≫ (pullbackDiagonalMapIdIso f f g).inv ≫ pullback.snd := by
  

Proof state:
C : Type u_1
inst✝⁸ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁷ : HasPullbacks C
S T : C
f✝ : X ⟶ T
g✝ : Y ⟶ T
i : T ⟶ S
inst✝⁶ : HasPullback i i
inst✝⁵ : HasPullback f✝ g✝
inst✝⁴ : HasPullback (f✝ ≫ i) (g✝ ≫ i)
inst✝³ :
  HasPullback (diagonal i)
    (map (f✝ ≫ i) (g✝ ≫ i) i i f✝ g✝ (𝟙 S) (_ : (f✝ ≫ i) ≫ 𝟙 S = f✝ ≫ i) (_ : (g✝ ≫ i) ≫ 𝟙 S = g✝ ≫ i))
f : X ⟶ Y
g : Y ⟶ Z
inst✝² : HasPullback f f
inst✝¹ : HasPullback g g
inst✝ : HasPullback (f ≫ g) (f ≫ g)
⊢ diagonal (f ≫ g) = diagonal f ≫ (pullbackDiagonalMapIdIso f f g).inv ≫ snd

Next tactic:
ext
theorem pullback.diagonal_comp (f : X ⟶ Y) (g : Y ⟶ Z) [HasPullback f f] [HasPullback g g]
    [HasPullback (f ≫ g) (f ≫ g)] :
    diagonal (f ≫ g) = diagonal f ≫ (pullbackDiagonalMapIdIso f f g).inv ≫ pullback.snd := by
  ext <;> 

Proof state:
case h₀
C : Type u_1
inst✝⁸ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁷ : HasPullbacks C
S T : C
f✝ : X ⟶ T
g✝ : Y ⟶ T
i : T ⟶ S
inst✝⁶ : HasPullback i i
inst✝⁵ : HasPullback f✝ g✝
inst✝⁴ : HasPullback (f✝ ≫ i) (g✝ ≫ i)
inst✝³ :
  HasPullback (diagonal i)
    (map (f✝ ≫ i) (g✝ ≫ i) i i f✝ g✝ (𝟙 S) (_ : (f✝ ≫ i) ≫ 𝟙 S = f✝ ≫ i) (_ : (g✝ ≫ i) ≫ 𝟙 S = g✝ ≫ i))
f : X ⟶ Y
g : Y ⟶ Z
inst✝² : HasPullback f f
inst✝¹ : HasPullback g g
inst✝ : HasPullback (f ≫ g) (f ≫ g)
⊢ diagonal (f ≫ g) ≫ fst = (diagonal f ≫ (pullbackDiagonalMapIdIso f f g).inv ≫ snd) ≫ fst

Next tactic:
simp
theorem pullback.diagonal_comp (f : X ⟶ Y) (g : Y ⟶ Z) [HasPullback f f] [HasPullback g g]
    [HasPullback (f ≫ g) (f ≫ g)] :
    diagonal (f ≫ g) = diagonal f ≫ (pullbackDiagonalMapIdIso f f g).inv ≫ pullback.snd := by
  ext <;> 

Proof state:
case h₁
C : Type u_1
inst✝⁸ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁷ : HasPullbacks C
S T : C
f✝ : X ⟶ T
g✝ : Y ⟶ T
i : T ⟶ S
inst✝⁶ : HasPullback i i
inst✝⁵ : HasPullback f✝ g✝
inst✝⁴ : HasPullback (f✝ ≫ i) (g✝ ≫ i)
inst✝³ :
  HasPullback (diagonal i)
    (map (f✝ ≫ i) (g✝ ≫ i) i i f✝ g✝ (𝟙 S) (_ : (f✝ ≫ i) ≫ 𝟙 S = f✝ ≫ i) (_ : (g✝ ≫ i) ≫ 𝟙 S = g✝ ≫ i))
f : X ⟶ Y
g : Y ⟶ Z
inst✝² : HasPullback f f
inst✝¹ : HasPullback g g
inst✝ : HasPullback (f ≫ g) (f ≫ g)
⊢ diagonal (f ≫ g) ≫ snd = (diagonal f ≫ (pullbackDiagonalMapIdIso f f g).inv ≫ snd) ≫ snd

Next tactic:
simp
theorem pullback_map_diagonal_isPullback :
    IsPullback (pullback.fst ≫ f)
      (pullback.map f g (f ≫ i) (g ≫ i) _ _ i (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal i)
      (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ IsPullback (fst ≫ f) (map f g (f ≫ i) (g ≫ i) (𝟙 X) (𝟙 Y) i (_ : f ≫ i = 𝟙 X ≫ f ≫ i) (_ : g ≫ i = 𝟙 Y ≫ g ≫ i))
    (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))

Next tactic:
apply IsPullback.of_iso_pullback _ (pullbackDiagonalMapIdIso f g i).symm
theorem pullback_map_diagonal_isPullback :
    IsPullback (pullback.fst ≫ f)
      (pullback.map f g (f ≫ i) (g ≫ i) _ _ i (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal i)
      (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) := by
  apply IsPullback.of_iso_pullback _ (pullbackDiagonalMapIdIso f g i).symm
  · 

Proof state:
case w₁
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (pullbackDiagonalMapIdIso f g i).symm.hom ≫ fst = fst ≫ f

Next tactic:
simp
theorem pullback_map_diagonal_isPullback :
    IsPullback (pullback.fst ≫ f)
      (pullback.map f g (f ≫ i) (g ≫ i) _ _ i (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal i)
      (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) := by
  apply IsPullback.of_iso_pullback _ (pullbackDiagonalMapIdIso f g i).symm
  · simp
  · 

Proof state:
case w₂
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (pullbackDiagonalMapIdIso f g i).symm.hom ≫ snd =
    map f g (f ≫ i) (g ≫ i) (𝟙 X) (𝟙 Y) i (_ : f ≫ i = 𝟙 X ≫ f ≫ i) (_ : g ≫ i = 𝟙 Y ≫ g ≫ i)

Next tactic:
ext
theorem pullback_map_diagonal_isPullback :
    IsPullback (pullback.fst ≫ f)
      (pullback.map f g (f ≫ i) (g ≫ i) _ _ i (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal i)
      (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) := by
  apply IsPullback.of_iso_pullback _ (pullbackDiagonalMapIdIso f g i).symm
  · simp
  · ext <;> 

Proof state:
case w₂.h₀
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ ((pullbackDiagonalMapIdIso f g i).symm.hom ≫ snd) ≫ fst =
    map f g (f ≫ i) (g ≫ i) (𝟙 X) (𝟙 Y) i (_ : f ≫ i = 𝟙 X ≫ f ≫ i) (_ : g ≫ i = 𝟙 Y ≫ g ≫ i) ≫ fst

Next tactic:
simp
theorem pullback_map_diagonal_isPullback :
    IsPullback (pullback.fst ≫ f)
      (pullback.map f g (f ≫ i) (g ≫ i) _ _ i (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal i)
      (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) := by
  apply IsPullback.of_iso_pullback _ (pullbackDiagonalMapIdIso f g i).symm
  · simp
  · ext <;> 

Proof state:
case w₂.h₁
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ ((pullbackDiagonalMapIdIso f g i).symm.hom ≫ snd) ≫ snd =
    map f g (f ≫ i) (g ≫ i) (𝟙 X) (𝟙 Y) i (_ : f ≫ i = 𝟙 X ≫ f ≫ i) (_ : g ≫ i = 𝟙 Y ≫ g ≫ i) ≫ snd

Next tactic:
simp
theorem pullback_map_diagonal_isPullback :
    IsPullback (pullback.fst ≫ f)
      (pullback.map f g (f ≫ i) (g ≫ i) _ _ i (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal i)
      (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) := by
  apply IsPullback.of_iso_pullback _ (pullbackDiagonalMapIdIso f g i).symm
  · simp
  · ext <;> simp
  · 

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ CommSq (fst ≫ f) (map f g (f ≫ i) (g ≫ i) (𝟙 X) (𝟙 Y) i (_ : f ≫ i = 𝟙 X ≫ f ≫ i) (_ : g ≫ i = 𝟙 Y ≫ g ≫ i))
    (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))

Next tactic:
constructor
theorem pullback_map_diagonal_isPullback :
    IsPullback (pullback.fst ≫ f)
      (pullback.map f g (f ≫ i) (g ≫ i) _ _ i (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal i)
      (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) := by
  apply IsPullback.of_iso_pullback _ (pullbackDiagonalMapIdIso f g i).symm
  · simp
  · ext <;> simp
  · constructor
    

Proof state:
case w
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (fst ≫ f) ≫ diagonal i =
    map f g (f ≫ i) (g ≫ i) (𝟙 X) (𝟙 Y) i (_ : f ≫ i = 𝟙 X ≫ f ≫ i) (_ : g ≫ i = 𝟙 Y ≫ g ≫ i) ≫
      map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i)

Next tactic:
ext
theorem pullback_map_diagonal_isPullback :
    IsPullback (pullback.fst ≫ f)
      (pullback.map f g (f ≫ i) (g ≫ i) _ _ i (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal i)
      (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) := by
  apply IsPullback.of_iso_pullback _ (pullbackDiagonalMapIdIso f g i).symm
  · simp
  · ext <;> simp
  · constructor
    ext <;> 

Proof state:
case w.h₀
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ ((fst ≫ f) ≫ diagonal i) ≫ fst =
    (map f g (f ≫ i) (g ≫ i) (𝟙 X) (𝟙 Y) i (_ : f ≫ i = 𝟙 X ≫ f ≫ i) (_ : g ≫ i = 𝟙 Y ≫ g ≫ i) ≫
        map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i)) ≫
      fst

Next tactic:
simp [condition]
theorem pullback_map_diagonal_isPullback :
    IsPullback (pullback.fst ≫ f)
      (pullback.map f g (f ≫ i) (g ≫ i) _ _ i (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal i)
      (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) := by
  apply IsPullback.of_iso_pullback _ (pullbackDiagonalMapIdIso f g i).symm
  · simp
  · ext <;> simp
  · constructor
    ext <;> 

Proof state:
case w.h₁
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ ((fst ≫ f) ≫ diagonal i) ≫ snd =
    (map f g (f ≫ i) (g ≫ i) (𝟙 X) (𝟙 Y) i (_ : f ≫ i = 𝟙 X ≫ f ≫ i) (_ : g ≫ i = 𝟙 Y ≫ g ≫ i) ≫
        map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i)) ≫
      snd

Next tactic:
simp [condition]
@[reassoc (attr := simp)]
theorem diagonalObjPullbackFstIso_hom_fst_fst {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    (diagonalObjPullbackFstIso f g).hom ≫ pullback.fst ≫ pullback.fst =
      pullback.fst ≫ pullback.snd := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X✝ Y✝ Z✝ : C
inst✝⁴ : HasPullbacks C
S T : C
f✝ : X✝ ⟶ T
g✝ : Y✝ ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f✝ g✝
inst✝¹ : HasPullback (f✝ ≫ i) (g✝ ≫ i)
inst✝ :
  HasPullback (diagonal i)
    (map (f✝ ≫ i) (g✝ ≫ i) i i f✝ g✝ (𝟙 S) (_ : (f✝ ≫ i) ≫ 𝟙 S = f✝ ≫ i) (_ : (g✝ ≫ i) ≫ 𝟙 S = g✝ ≫ i))
X Y Z : C
f : X ⟶ Z
g : Y ⟶ Z
⊢ (diagonalObjPullbackFstIso f g).hom ≫ fst ≫ fst = fst ≫ snd

Next tactic:
delta diagonalObjPullbackFstIso
@[reassoc (attr := simp)]
theorem diagonalObjPullbackFstIso_hom_fst_fst {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    (diagonalObjPullbackFstIso f g).hom ≫ pullback.fst ≫ pullback.fst =
      pullback.fst ≫ pullback.snd := by
  delta diagonalObjPullbackFstIso
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X✝ Y✝ Z✝ : C
inst✝⁴ : HasPullbacks C
S T : C
f✝ : X✝ ⟶ T
g✝ : Y✝ ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f✝ g✝
inst✝¹ : HasPullback (f✝ ≫ i) (g✝ ≫ i)
inst✝ :
  HasPullback (diagonal i)
    (map (f✝ ≫ i) (g✝ ≫ i) i i f✝ g✝ (𝟙 S) (_ : (f✝ ≫ i) ≫ 𝟙 S = f✝ ≫ i) (_ : (g✝ ≫ i) ≫ 𝟙 S = g✝ ≫ i))
X Y Z : C
f : X ⟶ Z
g : Y ⟶ Z
⊢ (pullbackRightPullbackFstIso f g fst ≪≫
          congrHom (_ : fst ≫ f = snd ≫ g) (_ : g = g) ≪≫
            pullbackAssoc f g g g ≪≫ pullbackSymmetry f (fst ≫ g) ≪≫ congrHom (_ : fst ≫ g = snd ≫ g) (_ : f = f)).hom ≫
      fst ≫ fst =
    fst ≫ snd

Next tactic:
simp
@[reassoc (attr := simp)]
theorem diagonalObjPullbackFstIso_hom_fst_snd {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    (diagonalObjPullbackFstIso f g).hom ≫ pullback.fst ≫ pullback.snd =
      pullback.snd ≫ pullback.snd := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X✝ Y✝ Z✝ : C
inst✝⁴ : HasPullbacks C
S T : C
f✝ : X✝ ⟶ T
g✝ : Y✝ ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f✝ g✝
inst✝¹ : HasPullback (f✝ ≫ i) (g✝ ≫ i)
inst✝ :
  HasPullback (diagonal i)
    (map (f✝ ≫ i) (g✝ ≫ i) i i f✝ g✝ (𝟙 S) (_ : (f✝ ≫ i) ≫ 𝟙 S = f✝ ≫ i) (_ : (g✝ ≫ i) ≫ 𝟙 S = g✝ ≫ i))
X Y Z : C
f : X ⟶ Z
g : Y ⟶ Z
⊢ (diagonalObjPullbackFstIso f g).hom ≫ fst ≫ snd = snd ≫ snd

Next tactic:
delta diagonalObjPullbackFstIso